1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-27 19:30:04 +00:00
millfork/include/nes_mmc4.mfk
Karol Stasiak 63ff28e94e Changes to macros and parameter list syntax:
* non-asm macros can now take `const` and `call` parameters
* register parameters to asm functions and macros can be given names if annotated explicitly
2020-03-30 19:23:48 +02:00

37 lines
700 B
Plaintext

#if not(NES)
#warn nes_mmc4 module should be only used on NES/Famicom targets
#endif
asm inline void set_prg_bank(byte register(a) bank) {
STA $A000
? RTS
}
// calling with with e.g. $1E will set $0000-$0fff to $E000-$EFFF in chrrom1
asm inline void set_chr_bank0(byte register(a) bank) {
STA $B000
STA $C000
? RTS
}
// calling with with e.g. $1E will set $1000-$1fff to $E000-$EFFF in chrrom1
asm inline void set_chr_bank1(byte register(a) bank) {
STA $D000
STA $E000
? RTS
}
// TODO: FD/FE latches
asm inline void set_vertical_mirroring() {
LDA #0
STA $F000
? RTS
}
asm inline void set_horizontal_mirroring() {
LDA #1
STA $F000
? RTS
}