Skip to content
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

GBDK calling convention #5

Open
qwertymodo opened this issue Mar 13, 2020 · 0 comments
Open

GBDK calling convention #5

qwertymodo opened this issue Mar 13, 2020 · 0 comments

Comments

@qwertymodo
Copy link

I've run into a few homebrew ROMs that were obviously written in C. GBDK seems to be the only game in town when it comes to C compilers that target the GB, so I'm guessing that's what was used. Here's what I was able to find about the C calling convention in GBDK: http://gbdk.sourceforge.net/doc/html/c0402.html

From the looks of things, this would be implemented in the .cspec file. I've found the documentation for the cspec format, but it's a lot to work through. I tried copying/pasting the _stdcall convention from Ghidra's included z80 cspec, and then modifying it to remove the register inputs, change the alignment to 1, change the output register to DE, and remove some of the unaffected register nodes (not really sure about that last part). Seems to be a decent starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant