Instead of using the bootsector to load a bootloader, just put the bootloader in the ROM and call it a day. It looks for a file on the SD card in the root directory named `kernel.bin` and loads it into memory. This is not a perfect solution, as the kernel will grow larger and the kernel load address will have to change. At this point I could add back the bootloader, but that is for later. Also the bootloader is just a copy of the kernel, so that can be trimmed down a lot.
33 lines
309 B
ArmAsm
33 lines
309 B
ArmAsm
.include "io.inc65"
|
|
|
|
.importzp sp, sreg
|
|
|
|
.export _mapper_enable
|
|
.export _mapper_read, _mapper_write
|
|
|
|
.autoimport on
|
|
|
|
.code
|
|
|
|
|
|
; void mapper_enable(uint8_t en)
|
|
_mapper_enable:
|
|
sta MM_CTRL
|
|
rts
|
|
|
|
_mapper_read:
|
|
phx
|
|
tax
|
|
lda MM_DATA,x
|
|
ldx #$00
|
|
rts
|
|
|
|
_mapper_write:
|
|
phx
|
|
tax
|
|
jsr popa
|
|
sta MM_DATA,x
|
|
plx
|
|
rts
|
|
|