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.
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.
... 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.
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.
-mcpu=mosw65816 will enable some 65816-specific optimizations.
|
|
||
|
|
||
|
|
||
| union uOAMCopy{ |
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.