Skip to content

Instantly share code, notes, and snippets.

@ARM9
Created December 17, 2014 11:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ARM9/463f76c21d3e9a57994c to your computer and use it in GitHub Desktop.
Save ARM9/463f76c21d3e9a57994c to your computer and use it in GitHub Desktop.
wla hirom
; == HiRom =========================
.MEMORYMAP ; Tell WLA that the SNES has ROM at locations 0000-$FFFF in every bank
SLOTSIZE $10000 ; and that this area is $10000 bytes in size.
DEFAULTSLOT 0
SLOT 0 $0000
;SLOT 1 START $8000 SIZE $8000
.ENDME
.ROMBANKSIZE $10000 ; Every ROM bank is 64 KBytes in size, also necessary.
.ROMBANKS 4 ;
; ===========================
.SNESHEADER
ID "SNES" ; 1-4 letter string, just leave it as "SNES"
NAME "wla hirom test " ; Program Title - can't be over 21 bytes,
; "123456789012345678901" ; use spaces for unused bytes of the name.
SLOWROM ; SLOWROM or FASTROM
HIROM ; LOROM or HIROM, LOROM banks must be $8000 (32KB) and HIROM banks must be $10000 (64KB)
CARTRIDGETYPE $00
ROMSIZE $08 ; $08 = 2 Mbits, $08 to $0C, 256KB (2mb) to 4MB (32mb), MUST CHANGE LABELS .ROMBANKSIZE AND .ROMBANKS
SRAMSIZE $00 ; No SRAM
COUNTRY $01 ; country code $00 => Japanese, $01 => NTSC, $02 to $0c => PAL, $0d => NTSC
LICENSEECODE $00 ; use $00
VERSION $00 ; $00 = 1.00, $01 = 1.01, etc.
.ENDSNES
.SNESNATIVEVECTOR ; Define Native Mode interrupt vector table
COP 0
BRK 0
ABORT 0
NMI 0
IRQ 0
.ENDNATIVEVECTOR
.SNESEMUVECTOR ; Define Emulation Mode interrupt vector table
COP 0
ABORT 0
NMI 0
RESET Start ; where execution starts
IRQBRK 0
.ENDEMUVECTOR
.EMPTYFILL $00
; ===========================
.base $00
.bank 0
.org $8000
.section "lorom" semifree
Start:
sei
clc
xce
rep #$39
sep #$20
jml hirom
.ends
.base $40
.bank 0
.org $0000
.section "hirom" semifree
hirom:
lda #$0f
stz $2121
sta $2122
sta $2122
sta $2100
- bra -
.ends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment