-
Notifications
You must be signed in to change notification settings - Fork 69
[SNES] Add target #415
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
base: main
Are you sure you want to change the base?
[SNES] Add target #415
Conversation
| @@ -0,0 +1,301 @@ | |||
| ; SNES Interrupt Vector Handlers for LLVM-MOS (6502 compatible) | |||
| ; Based on vectors.asm reference from wdc816cc | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't really "base" code on WDC's, unfortunately. I assume the licenses are not compatible.
However, what little potentially copyrightable material I see in this file requires a rework anyway...
| pha | ||
| php | ||
| ; Save zero page registers that LLVM-MOS might use | ||
| lda $00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... because this isn't how we do things here. We mark the IRQ function with __attribute__((interrupt)), which then takes care of saving and restoring registers and everything. Study, for example, the PC Engine target's examples.
| ; Entry point - called by SNES reset vector | ||
| .global _start | ||
| _start: | ||
| ; Call LLVM-MOS crt0 initialization functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, we don't really do jsr calls here; we expect the linker to put these functions in order in the. See common/ldscripts/text-sections.ld.
|
Overall, this is a solid proof of concept, but as discussed in |
| @@ -0,0 +1,2 @@ | |||
| -mlto-zp=224 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-mcpu=mosw65816 will enable some 65816-specific optimizations.
|
|
||
|
|
||
|
|
||
| union uOAMCopy{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh?
Here's an initial draft for a snes target, based my snes xc libraries, so registers are named with REG_ for example REG_INIDISP, the example provided is an input test that changes the screens colour. I've already used essentially this target for my demake/port of c celeste.