Giter Site home page Giter Site logo

bartmanabyss / vscode-amiga-debug Goto Github PK

View Code? Open in Web Editor NEW
289.0 289.0 35.0 970.74 MB

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.

License: GNU General Public License v3.0

C 59.01% Shell 0.10% C++ 4.80% XC 0.24% XS 0.23% TypeScript 10.96% Assembly 20.01% Makefile 0.03% CSS 0.65% JavaScript 2.94% GLSL 0.01% Batchfile 0.05% SWIG 0.73% Tcl 0.24%
amiga cpp debugger fs-uae gcc gdb vscode vscode-extension winuae

vscode-amiga-debug's People

Contributors

bartmanabyss avatar davidcanadas avatar dependabot[bot] avatar grahambates avatar mihamarkic avatar petmac avatar tehkain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-amiga-debug's Issues

Add ability to unregister bitmaps / copperlists etc.

My codebase uses dynamic memory management - I can't just register bitmap / copperlist / etc. once and be cool with it - I need to be able to unregister them at some point and register next ones a bit later.

Compiling -O0 with 1.1.0 preview

One new issue I've run into with the 1.1.0 preview is that if I change the makefile so it'll compile with -O0 for easier debugging then it'll give me compile error in the support code around memcopy and memset. I can fix it by commenting out the special optimization options those functions have but that didn't use to be necessary.

Fix OS function calls so that they don't produce `-Wold-style-declaration` warning

When compiling with -Wextra I get tons of messages near os fn calls:

warning: 'register' is not at beginning of declaration [-Wold-style-declaration]

Of course adding -Wno-old-style-declaration to compile flags fixes problem, but I think this shouldn't be required.

This is of course a very low priority, but a nice fix to have in future.

Unable to open console.device

Hello

I am unable to open console.device despite me following the steps in the reference manuals. I'm thinking it may be an issue with
vscode-amiga-debug since I simply cannot see any issues with the code.

The window, port and IORequest all open up with no errors. It only fails when OpenDevice() is called on line 58.

Feel free to tell me my code is wrong but this is what is in the reference manual for KS 1.3.

My repo is at https://github.com/sacredbanana/DF0Engine

Thanks so much, I'm pulling my hair out trying to get console.device to open :(

Btw I also had to comment out the inclusion of the <rexx/storage.h> header file since that appears to be missing in your extension.

Assembler debugging

First of all thank you! This is incredible and has really given me the easy path I needed to revisit the Amiga.

I'm not sure if this is the appropriate place to ask questions but here goes.

When debugging C I'm sometimes able to single step through the assembly code, not sure if it works %100 but it certain is possible.

However if I write some inline asm code then I'm unable to single step through that code, it'll keep bouncing back to the C source.

Is this something would I can fix? Or is there something in the setup that would need to be improved?

ProTracker integration in the example code?

This was super easy to set up but it would be good to have integration with ThePlayer or another ProTracker replay routine in the example project as it is rather hard to get that one working with C (at least for me).

Launch JSON Config

So, I am guessing from your configuration that we are supposed to add a "config" JSON property that matches configurations[x].config for one of the configuration block objects in the launch.json file. However, the only way I can get it to do anything other than choose the first configuration is to make something else the first configuration manually. I can only specify a newer kickstart. Nothing I do can get it to use the A1200 or A4000 configs.

Also, the A4000 configuration is not setup in the version of your extension pulled from the Visual Studio Code extension search. Am I doing something wrong? I'd like to develop some apps, not games, using this extension and they are aimed at "newer" Amigas running 3.1.4 and so on.

Is there a way to tweak the WinUAE settings applied to each config?

More documentation

Hi!

Perhaps not the right place, or the right forum even.

I am new to C on Amiga (emulated), and would like to test it. I found your(s) excelent work here, it looks nice, uses visual studio code which is a nice editor...

I did some tests, opened a few windows and wrote Hello World as one should, after some changes and added includes (like missing rexx if you include alib_proto.h) it worked.

However, for me I am stuck and mostly that depends on missing documantation or the inability to find the right docs.

I also tried to do an Hello World with MUI and this is why I am adressing this topic, I got completely stucked, MUI apparantly wish to call a routine called DoMethod, I scanned the whole MUI NDK and could not find it, I scanned the whole internet and with only sparse information I could figure out that the routine where located in alib.lib or amiga.lib, I think the latter.

So I got an error when linking could not find where it was defined when linking (more or less) I added in different combinations lamiga lalib llibamiga and whatnot, still no luck, error was could not find whatever .lib I added.

So I explored the [user]*abyss**. thing, could not find any alib.lib or amiga.lib... so I "stole" a version from vbcc and put in various places, no luck.

I started Process Monitor (sysinternals) and did see that ld where trying to do something with /libamiga.(a|so) files, i read the docs for ld, and indeed it stated that it puts lib infront of the libraries I wish to use, I tried to change the name of the lib just to test. Did not work...

Anyway despite this long and for you I guess, kind of boring description of my problem. I wonder if you would like to include some help documentation how to solve various easy problems for an experienced coder, but perhaps a "stopper" for any unexperienced ones with your toolchain solution, or perhaps links and references to where one could solve the problem at hand.

//Thank you for your time, and my appology for the rather unusual "request" of mine. And thanks for a nice tool to test out and perhaps learn to use
//HEA

ADF creation

Would it be possible to add the ability to create a bootable ADF containing the compiled app along with its required assets as long as it fits onto a floppy?

Laggy P61 module playback on A1200 configuration

Although not released yet, I checked the sound playback capability available on master branch. Everything works fine with A500 configuration (around 20-25% CPU), but switching to A1200 config with the same binary gives big lags and CPU on the level of 130-150%, with clicky sound and slowed down execution.

In order to separate the problem, I reassembled P61 player example from original sources available on Aminet and it sounds exactly the same (I can provide the exe if needed). Surprisingly, running the same binary on vanilla A1200 WinUAE setup (although 4.3.0, which IMHO makes no difference) runs perfectly smooth, so I guess there's something in the WinUAE configuration that makes it laggy. I tried to adjust the settings to match the not lagging one using the WinUAE GUI, but cannot find the culprit.

I'm just wondering if the problem also appears on your setup. I'm running Windows 10, WinUAE 4.4.0 as attached to current version of the extension.

PS: great thanks for bringing back my memories and allow me to learn how machine of my childhood/adolescence works and can be programmed. You made easier to fulfil my nostalgic dream of programming an Amiga computer!

stdio.h: No such file or directory #include <stdio.h>

I'm pretty sure i would work round this issue but I wanted to give you feedback on a clean machine running the project for the first time.

Perhaps some hard coded path in there somwhere that needs updated?


> Executing task: c:\Users\stephen\.vscode\extensions\bartman-abyss.amiga-debug-0.7.0\bin\gnumake.exe -f Makefile8mingw -j4 <

Makefile8mingw:41: target 'obj8mingw/main.o' given more than once in the same rule
Compiling bin/elf2hunk.c
C:/github/vscode-amiga-debug/bin/elf2hunk.c:10:10: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
          ^~~~~~~~~
compilation terminated.
gnumake: *** [Makefile8mingw:44: obj8mingw/elf2hunk.o] Error 1
The terminal process terminated with exit code: 1

I wonder if this is only triggered due to the modification date on a clean checkout?

Steps for building the vsix file?

In order to contribute to the project, it would be nice to know how to set up a dev environment so we can best provide you with PRs that you'll likely approve and merge.

I presume it starts with

  1. Make sure you have Ubuntu WSL installed
  2. Install NVM and latest NodeJS version (14?)
  3. Clone the repo and cd into it
  4. npm install
  5. ??

I saw some steps on requirements on the README.md for porting, but this is different. What do we have to have present in order to contribute. Help me and I'll add a wiki page to the repo for others to follow.

The supplied scripts in the package.json file are as follows:

{
	"scripts": {
		"vscode:prepublish": "concurrently -r \"npm:compile:ext\" \"webpack --mode=production\"",
		"compile": "concurrently -r \"npm:compile:*\"",
		"compile:ext": "tsc -p ./",
		"compile:client": "webpack --mode=development",
		"watch": "concurrently -r \"npm:watch:*\"",
		"watch:ext": "tsc -watch -p ./",
		"watch:client": "webpack --watch --mode=development --info-verbosity verbose",
		"serve": "webpack-dev-server --mode=development",
		"pretest": "npm run compile:ext",
		"test": "node ./out/test/runTest.js"
	}
}

None of these create a vsix file for testing.

Feature: OS Support

Hello,

is it possible to run the cool extension under OS? You could exchange WinUAE with FS-UAE.

Greetings

mulsw etc functions not working correctly?

I've been trying to use mulsw to make sure the compiler does a 16x16=32 multiplication. But as things are the compiler seems to assume mulsw results can be truncated to 16bits. I'm seeing generated code that does this. I think its because the inline asm used 'a' for the result and 'a' is a short. So it optimizes out the additional bits you might hope for in the returning int.

Well, anyway I think this alternative works:

inline int mulsw(short a, short b) {
int r = a;
asm("mulsw %1,%0":"+d"(r): "mid"(b): "cc");
return r;
}

But you will probably want to check that yourself and do the same for muluw.

Function list in assembly view should filter out names as you type

My current project has hundreds of fns - looking for specific one is very tedious. ;) Adding filtering out names when typing would significantly increase usability.

Alternatively, perhaps adding a "jump to disassembly" context menu on profiling blocks would do the trick.

Make it easy to set up an Assembler project

Right now it is very easy and convenient to create a C/C++ project: simply press Ctrl+Shift+P, select Amiga: Init Project, and you're all set. This is awesome!

But unless I am missing something (in which case: sorry!), there is no such easy way to create an Assembler project.

bump release in store?

Since changes so far seem to be stable, perhaps it's time to update extension in vscode marketplace? This is mainly for #7 because it's needed to set up CMake workflow correctly, which my library extensively use, and I have some ppl asking me when my project will be compatible with your extension. ;)

Move kickstart ROM paths to vscode settings

Hi,

I've started developing a project along with a friend. Everything works nice, except that we have kickstart ROMs in totally different filesystem paths. I know that we can just unify that on our side, but I think that it would be more beneficial to have it predefined globally for whole extension. This way the launch.json won't change and could be commited on repository and used by anyone without any changes.

There are two ways in which it could be solved:

  • in settings.json add "path to kickstart" and use it as a var in launch.json paths, like "kickstart": "${amiga.kickstartPath}/kick13.rom",. It would still require filenames to be exactly the same, but it's still better than current approach.
  • in settings.json add amiga.kickstarts object which could be assigned with "name": "filePath", like:
"amiga.kickstarts": {
  "kick13": "/path/to/my/kick13.rom",
  "kick30": "/path/to/my/kick30dumpedFromMyAmiga.bin"
}

Dunno which approach is better. This is a low priority issue for me. ;)

Appcrash: WinUAE has stopped working (winuae-gdb.exe 4.4.0.0) [KS 1.3]

Hello, thanks for this awesome project. I've just tried it out with a fresh install from marketplace (v1.0.0) and wrote a simple helloworld program. It works as expected but winuae-gdb.exe crashes after a while, sometimes after 15 seconds and sometimes a little later, a little random when it occurs but seem to always happen. It is highly reproducible. This is when running on A500 KS 1.3 (kick34005.A500) rom with or without debugging. If I close the winuae window by clicking [x] it freezes and hangs. Trying the same on A1200 KS 3.1 (kick40068.A1200) or KS 2.0 (kick37175.A500) works fine without any crashes and doesn't hang. I'm using a win 8.1 machine and latest VSCode 1.47.3 64-bit. The crash seems to be caused by different dll calls e.g. to ntdll.dll, details below, any clue what is causing this? Tried on KS 1.2 too and same problem there so problem seems to be tied to when using older Kickstarts.

Problem signature:
  Problem Event Name:	        APPCRASH
  Application Name:	        winuae-gdb.exe
  Application Version:	        4.4.0.0
  Application Timestamp:	5ed1714a
  Fault Module Name:	        ntdll.dll
  Fault Module Version:	        6.3.9600.19678
  Fault Module Timestamp:	5e82c88a
  Exception Code:	        c0000005
  Exception Offset:	        00000000000358fa
  OS Version:	                6.3.9600.2.0.0.256.48
  Locale ID:	                1053
  Additional Information 1:	cee4
  Additional Information 2:	cee49baf695955cc06ce73bf396842b0
  Additional Information 3:	ac31
  Additional Information 4:	ac31d5743764a6b1b96c6fe1859d6916

Problem signature:
  Problem Event Name:	        APPCRASH
  Application Name:	        winuae-gdb.exe
  Application Version:	        4.4.0.0
  Application Timestamp:	5ed1714a
  Fault Module Name:	        StackHash_2269
  Fault Module Version:	        6.3.9600.19678
  Fault Module Timestamp:	5e82c88a
  Exception Code:	        c0000374
  Exception Offset:	        PCH_C3_FROM_ntdll+0x0000000000090CBA
  OS Version:	                6.3.9600.2.0.0.256.48
  Locale ID:	                1053
  Additional Information 1:	2269
  Additional Information 2:	2269d2f9a7df7b894866693deedbe695
  Additional Information 3:	2387
  Additional Information 4:	238760144906e0a39667ea3de5604a11


Problem signature:
  Problem Event Name:	        APPCRASH
  Application Name:	        winuae-gdb.exe
  Application Version:	        4.4.0.0
  Application Timestamp:	5ed1714a
  Fault Module Name:	        GDI32.dll
  Fault Module Version:	        6.3.9600.19781
  Fault Module Timestamp:	5f0d29d8
  Exception Code:	        c0000005
  Exception Offset:	        000000000000972c
  OS Version:	                6.3.9600.2.0.0.256.48
  Locale ID:	                1053
  Additional Information 1:	e6da
  Additional Information 2:	e6dad71e24846c6e936596e26d8739b2
  Additional Information 3:	23c4
  Additional Information 4:	23c498ae9be98440f541d454c625566d

Code debug break points

Hi Bartman
Is there a way to code a debug break point in C or inline asm? I thought maybe calling the exec function Debug(0) would do it. That seems to be an old way to hook into debuggers. How does the framework trigger break points? Maybe I can just emit the correct magic code?

Unknown register names

When compiling inline asm I seem to always get a bunch of "unknown register name" warnings.

The sample project does this for the unpacking and player inline asm.

It hasn't been a problem until recently. I now have a few different blocks of inline asm that need to specify the registers to use for some variables because they'll be used with a "movem". I do that the usual way: "register int var asm("d0");" for example. However the compiler is not always enforcing the register specification, I suspect the optimizer is doing something because it works okay with compiling with -Og.

It seems plausible that the problem stems from those compiler warnings. Do you know why those warnings are happening and if they can be fixed correctly?

VS Code install instructions or binary?

Fantastic project. I love the one stop shop idea.

I'm a big VSCode user. However I cannot get the extension install. I dont even know where to start.

What deps and steps are needed to get the vscode extension module built. Could we get a binary install package or even better integrate into the marget place?

Bundle support libraries with compiler

Hi,

Having gcc_support files inside a project is little troublesome. When using newer versions of plugin I had problems with building code containing old support files, so now I'm trying to update them along the way. It raises some problems, though. Having different versions of those files in git history of my project is problematic - If I go back in history, I have to apply support files which are compatible with current version of extension, and I have to do it each time when I'm bisecting commits to find regression bug. The problem escalates to all of my projects because I've made a poor decision of adding those support files to my game library to have plug-and-play experience across repos, but it prevents me from freely selecting the commit from which the library is built.

I think it could be solved by bundling support libs directly with compiler:

  • distribute as .h/.a along with compiler
  • add paths to support files to builtin include/link dirs
  • one could then easily integrate all support features by doing #include <extamiga.h> and linking with -lextamiga (-lamiga name is already taken for amiga library present in most of other compilers)

Can default compiler path not be changed by the extension every now and then?

The following lines gets added to .vscode/settings.json:

	"C_Cpp.default.compilerPath": "path\\to\\m68k-amiga-elf-gcc.exe",

Which is not fine because it's also appended in non-amiga projects, including my work projects. I know I can disable extension for given workspace, but i don't need this line 95% of the time and I have 100+ projects on my disk. I keep removing it from non-amiga projects but that line comes back.

Perhaps this line could be added once when project gets created from template?

Add ability to define filesystem when launching UAE debugging

Now since my library and games are building correctly, I still need one thing to be completely happy - ability to load files. Right now I see that there is a dh0 directory in extension's directory, which I assume is used to run the executable.

Would it be possible for extension to dynamically bind executable's original directory as UAE's main DH, so that when launching executable via debug task it'd be able to find files via relative paths?

mulsw macro change issue

Hi,

I'm helping out Virgill with his Amigaklang exe generator which uses your cool gcc environment.

I updated his project from gcc8 to the gcc10 version and it stopped working (corrupt sounds). I have traced it to a commit on the 18th may where the mulsw and other macros were improved. If I leave the gcc10 in place but use the old mulsw macros it works OK again.

I had a look a the macros but the gcc/asm syntax is new to me so I couldn't spot any errors.

Virgill calls mulsw in two places as follows, maybe the error will be obvious to you:

short osc_sine (BYTE instance, short freq, UBYTE gain){ int temp; short res;static short counter[16]; short buf = counter[instance]+=freq; buf -= 16384; temp= mulsw(buf, 32767-abs(buf)); res =temp>>16; res<<=3; return vol(res,gain); }

inline short vol(short val, UBYTE gain){ return mulsw(val, gain) >> 7; }

You can message me here or on EAB if you need me to check/change something.

Cheers
Antiriad

What is the bare minimum needed?

So I am trying to pare down the minimal required code for an application to work well with the system. The supplied main.c is impressive but it's also got a lot going on. If I wanted to be a good Amiga citizen and follow the rules, and print hello world in the console, I was thinking it would look something like this.

#include "support/gcc8_c_support.h"

#include <exec/exec.h>

#include <dos/dos.h>
#include <dos/stdio.h>

#include <proto/dos.h>
#include <proto/exec.h>

volatile struct Custom *custom;
struct ExecBase *SysBase;
struct DosLibrary *DOSBase;

int main(int argc, char **argv) {
  SysBase = *((struct ExecBase**)4UL);
  custom = (struct Custom*)0xdff000;

  FPrintf(Output(), "Hello World\n");

  return 0;
}

From what I can tell we need to have the gcc8_c_support stuff, but what else is required? What is the struct Custom *custom bit? I haven't seen that before. This program, by the way, crashes when run in the emulator. Do you know why?

error

gnumake clean error

Hi Bartman,
First thing first, nice job on this Amiga tool :)
I started using it lately and noticed an error while trying to use command gnumake clean
image
Using plugin 1.0.0 with VSCode 1.45.1 on a Windows 10 64 bits machine
Let me know if you need more informations or help
Cheers
Kyle/MenTaSm

Ability to have the extension create directories and place assets

Hi

I was wondering if it would be possible to add a feature where every directory and file inside a special folder in the project automatically gets deployed onto the virtual amiga hard disk rather than having to manually put them in there yourself.

This would make life so much easier! Thanks!

__attribute__((aligned(n)) doesn't seem to work for static vars.

Hi Bartman
Loving this system and the profiler and all the updates! But wanted to ask if you are aware of a way to force alignment for static variables. Using __attribute__((aligned(n)) works fine for structs but in my case I'm just trying to align a statically allocated array.

Debug not working in some places

I'm unable to debug for some regions of my code for some reason. The breakpoints completely get ignored and for earlier breakpoints that work, it is also unable to step into functions where my broken breakpoints reside. The code executes fine but debugging is broken for some reason.

Getting a HALT3 using the "A4000" config

The a500 and a1200 configs works out of the box with added-rom files,
cannot get the a4000 config to work though, got a HALT3 error and a black screen only.

Also kind of expected to be able to fire up a "1260", poking around in amigaDebug.js using
config['quickstart'] = 'a1200,4'; instead of config['quickstart'] = 'a1200,0';
and adding:
config['cpuboard_rom_file']= <Blizzard_1260.rom>
config['cpuboard_rom_file_id']='F88AE0F1,Blizzard 1240/1260'
Did not work either, got a black screen and a HALT3.
[edit] Using "winuae64.exe -portable" instead of "winuae-gdb -portable" with the generated default.uae works though :-)

I highly appreciate your effort making this!

How about using WinUAE 4.4.0's logger?

I hope you don't have enough of me and my issues. ;)

The WinUAE 4.4.0 was released recently. It comes with printf-like logging, which works almost the same as your vscode-bound logger. Quoting the WinUAE release topic from EAB:

New easy to use and transparent printf()-like debug logging method for developers: simply write parameters to address $bfff00 (byte, word and long accepted) one by one, then format string to $bfff04 (must be long) and formatted log message will appear in log window. Address may change, currently only active if 128k UAE boot rom mode is enabled and accepts only %d, %u, %x, %p, %s and %b (BSTR). Quickly made for quick and easy UAESND AHI driver debug logging..

I think it'd be cool to be consistent and use same interface to pass the debug messages to vscode. This way, I can use same code to send messages to vscode and later give the exact same build to betatesters with uae logger enabled. It can be done with an ifdef and two code variants, which I already do, but having unified interface is better, I think. ;)

Uninstalling / Reinstalling

No matter what I do now, I cannot get the extension to reinstall. I played with the unreleased version, then ram into issues and tried to revert to the main version.

I’ve tried removing it using the GUI. I’ve tried removing it from %userprofile%.vscode\extensions and I’m out of ideas. What am I missing?

endcli CloseWorkBench pair doesn't free up any memory

I thought I would try endcli/CloseWorkBench to free up some chipmem on the A500 config.

However, it didn't seem to improve how much memory I can allocated with AllocMem(... , MEMF_CHIP). The largest size I can allocate is 427k in both cases.

Am I doing something wrong or is that to be expected?

I vaguely remember that kick1.3 might not close the workbench all the way.

Is there any other way to improve the chipmem I can allocate?

CloseWorkBench() is unable to close workbench screen

Hi

I have an issue where the system call CloseWorkBench() fails. This call is used to close the main workbench screen. I do this to free up some memory. This normally only fails if some non drawer windows are open but none are. I assume something hidden is preventing the workbench screen to close?

stdlib.h missing?!

I am profoundly impressed with this extension and it will definitely lead to me writing more Amiga code this year and going forward. I desperately wish there was a version for macos but in the meantime I went to use calloc and found that I could not compile because stdlib.h could not be found.

Is it a setting or is simply not there?

rexx/storage.h missing

I've had to manually comment out references to the rexx/storage.h file since this file seems to me missing from the extension and my code would not compile otherwise

Messed up static / global variable preview and when using watch

Hi,

I'm having some problems with debugger features:

  • variables in Variables and Watch panels have wrong values, their addresses doesn't match. If I do the watch for specific address of a variable (which e.g. I print out in log) the values are correct.
  • static variables are shown in Globals subcategory, not Static.

I'm using custom CMake to generate .map, .elf and hunk files in similar manner as your makefile, but perhaps I've messed up something. I'll try to debug it myself but I need a little guidance from you. How does vscode know at which address is given static/global/local variable?

  • my C flags: -m68000 -fomit-frame-pointer -nostdlib -Wno-unused-function -Wno-volatile-register-var -fno-tree-loop-distribution -flto -fwhole-program -Wno-old-style-declaration
  • my link flags -Wl,--emit-relocs,-Ttext=0
  • I'm generating .map file using -Wl,-Map=germz.map linker flag.
  • I'm using command ${OBJDUMP} --disassemble -S ${GERMZ_EXECUTABLE} > germz.s to generate disassembly, where ${OBJDUMP} is objdump from your compiler suite.
  • link to CMake toolchain file if you're interested: https://github.com/AmigaPorts/AmigaCMakeCrossToolchains/blob/bartman/m68k-bartman.cmake

EDIT: The local variables are most of the time okay, the problem is with static/global vars.

Question about inline asm register usage.

I'm adding inline asm so I can write some fast code without giving up on the convenience of C/C++. However if I use too many registers, such as 8 data register then I run into problems. I haven't taken the time to examine what exactly is going on but was wondering if you know where I can find more information about how the compiler uses the registers. Seems likely there is a stack frame pointer in a6 but from the problems I'm getting it seems like one of the data registers is also in use. I'll look more closely if you've no idea what I'm doing wrong.

__far, register args

I'm maintaining game engine/framework/library/whatever as seen here https://github.com/AmigaPorts/ACE . I use some low level stuff in my code via macros in a way that is compatible with Bebbo's GCC, (kinda) VBCC and x86 (logic only).

For example putting function args in registers:

#elif defined(__VBCC__)
#define REGARG(arg, reg) __reg(reg) arg
#elif defined(__GNUC__)
#define REGARG(arg, reg) arg asm(reg)

which is used like:

void INTERRUPT keyIntServer(
	REGARG(volatile tCustom *pCustom, "a0"),
	REGARG(volatile void *pData, "a1")
);

Unfortunately GNUC variant syntax doesn't work with your compiler. In fact I tried some variations and I wasn't able to make it run. Also __far:

#define REGPTR volatile * const
extern tCustom FAR REGPTR g_pCustom; // FAR translates to __far
extern tRayPos FAR REGPTR g_pRayPos;

I've tried putting that __far everywhere but it didn't work. What's the correct syntax in both cases?

Failing to work with GIT Bash

Hi,

I've installed this plugin on a Windows 7 system with GIT Bash package. After slight modifications to tasks [removed amiga.bin-path, added static paths] I was able to run compilation but it fails:

process_begin: CreateProcess(NULL, m68k-amiga-elf-gcc -g -MP -MMD -m68000 -Ofast -nostdlib -Wall -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -Wa,-g -xassembler-with-cpp -c -o obj/gcc8_a_support.o C:/Users/rafamiga/OneDrive/tmp/amiga/amiga-1st/support/gcc8_a_support.s, ...) failed.

It's obvious paths inserted here [and in fact everywhere] adhere to Windows convention while GIT Bash [MINGW64] expects something like /c/Users...

I'm no VS guru nor any kind of expert but can you think of a way to tweak this in either VS or plugin settings?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.