andreasjhkarlsson / gbdk-n

gbdk libraries updated for newer versions of sdcc
174 stars 25 forks source link

More examples #7

Open andreasjhkarlsson opened 8 years ago

andreasjhkarlsson commented 8 years ago

More examples are needed as part of documented the available functions and showcase how to do stuff and how to build them. New and current examples needs to be checked for correctness as well as old gbdk used 8 bit-ints (not standard compliant).

bokney commented 8 years ago

It's been some time since I last played around with this and now I cannot seem to compile at all with the new library. I remember previously noticing a vast difference in vblank timing. I can't personally replicate these results right now but here is some code similar to what I used: https://github.com/bokny/wavy Would really like some more information on compiler arguments & how to link multiple files.

andreasjhkarlsson commented 8 years ago

If you want to see some more advanced usage of the library you can take a look at my minesweeper game link which includes linking multiple c files into one rom.

But yeah, there should be more example command lines in the README, part of the problem with that however is that gbdk-n is not really a compiler / linker, but only a runtime and stdlib. The bin/gbdk-n*.sh scripts are really only for convenience so documenting the flags and general sdcc usage is outside the scope of this project.

Other than that I have been working on banking support, which is really tricky with sdcc (gbdk-n handles it fine). Hopefully I will be able to make something work and produce an example for it.

bokney commented 8 years ago

Ah your minesweeper game looks like the perfect example, thanks! I've managed to get gbdk-n working again for me, at least from the terminal. I previously had a nice tidy xCode workflow but now its telling me "/opt/gbdk-n-master/bin/gbdk-n-compile.sh: line 7: sdcc: command not found". Here is a short video of the interrupt timing issue I mentioned before, I'm way out of my depth here but it looks as though the interrupt code is maybe being run at the wrong time?

andreasjhkarlsson commented 8 years ago

That looks really strange, could be that the interrupt is run too often as well, I will take a look when (if) I managed to get the banking done (currently trying to understand the source code for the sdcc linker).

Regarding your xcode, I would make sure that the user that xcode is run under has the sdcc folder in its PATH, alternatively, just add the full path to the sdcc binaries in the gbdk-n/bin scripts.