-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: BIOS calls like PLAYER_START? #11
Comments
I think I figured it out. It looks like neogeodev has one here: https://wiki.neogeodev.org/index.php?title=68k_program_header Where they do
ngdevkit's crt0.S does
where GAME_BOOT calls C's main(), and the others are noops. So it looks like if I needed support for say |
I need a bit of time to figure out that one. The whole idea behind the devkit is to have a ld linkscript that woudl automatically map your user-provided functions in the program header, like it's done for the VBlank interrupt handler, and revert to default no-op otherwise. As a proof-of-concept, I did the vblank and hblank interrupt handlers, but I didn't map anything else yet in the ld linkscript. I suspect though that this jump table is meant to be called by the original BIOS, so if we want a similar support in ngdevkit, we'd have to implement input polling and jmp in nullbios. Until I come back with an example in the devkit, I think you don't have any other choice than to poll the inputs yourself in your own vblank handler. |
I'm currently exploring this. My first goal is to get the eye catcher to run then to move onto the game. So far the rom just boots to the cross hatch in gngeo. I'm not exploring it by trying to get user defined functions in the linkscript, just editing the assembly directly. If I can get this working, I'll see about the linkscript next. |
I'm slowly but surely learning 68k asm :) This hack allows the eyecatcher to run, then boots into the game proper: https://github.com/city41/ngdevkit/commit/2f3395ee5208c5bc5746f95434628bba75b53293 Not good enough to make official, but if anyone reading this has any suggestions, I'd love to hear it. (oh and you need the real neo geo bios instead of null bios) |
Currently the game boots straight to the C's main function, without honoring the various initial command calls that the Neo Geo BIOS may request at startup. This prevents the Eye Catcher animation from showing properly. Fix that by implementing implementing the request calls as expected by the BIOS. Make nullbios mimick that behaviour as well. The default is now to jump to C's main only after the Eye Catcher, but that behaviour can be overriden by providing your own functions with the same name (the link script will use them automatically). Closes #11
OK so I finally came up with what I believe is what you asked for in the first place. I fixed how crt0 behaves when the BIOS calls it, so it can distinguish between request type 0 (StartupInit) and request type 2 (Game). Previously, crt0 would jump into your C main as soon as USER subroutine is called. Now crt0 correctly honours what the BIOS is requesting, and calls default functions for all the 4 request types. At link time, the linker checks whether you provided your own functions for each request type, and if so it will use it, otherwise it will default to what crt0 provides currently: initializing the C runtime and calling the C main. Also, all those behaviour happens at the right time, so the Eye Catcher will play if configured to. If needed, you can disable the Eye Catcher as explained in #19. |
I am brand new to Neo Geo dev.
I've been reading the examples over at https://github.com/freem/freemlib-neogeo/tree/master/examples
I'm curious how to deal with things like
PLAYER_START
,DEMO_END
,COIN_SOUND
andBIOS_USER_REQUEST
in ngdevkit?I see if the game defines a function named
rom_callback_VBlank
then it will get called on vblank. Is it possible to do a similar callback approach for the above subroutines?Thanks!
The text was updated successfully, but these errors were encountered: