.include "atari.inc" font = $9c00 CCNTL = $d500 destptr = FR0 srcptr = FR1 codedest = $0400 cart_trailer = $bffa .org $a000 ; left cartridge titledata: .incbin "titledata.dat" dlist: ; copy 7680 bytes from $8000-$9dff to (destptr). ; on exit, destptr points to the next 7680 byte chunk. copy_30_pages: lda #$0 tay sta srcptr lda #$80 sta srcptr+1 ldx #$1e @copypage: lda (srcptr),y sta (destptr),y dey bne @copypage inc srcptr+1 inc destptr+1 dex bne @copypage init: rts start: ; turn off ANTIC DMA to speed up copying to RAM lda #0 sta SDMCTL sta DMACTL ; copy code to RAM lda #codedest sta destptr+1 lda #0 ; bank 0... sta CCNTL ; ...select it jsr copy_30_pages lda #1 ; bank 1... sta CCNTL ; ...select it jsr copy_30_pages lda #2 ; bank 2... sta CCNTL ; ...select it jsr copy_30_pages lda #3 ; bank 3... sta CCNTL ; ...select it jsr copy_30_pages ; leave bank 3 enabled, as it has our custom font in it ; set up display list lda #34 sta SDMCTL lda #>font sta CHBAS ;lda $ff ;sta CH ;@wait4key: ;cmp CH ;beq @wait4key jsr $0400 .if * > cart_trailer .fatal "bank7 code too large" .endif .res cart_trailer - *, $ff .word start ; entry point .byte 0 ; 0 = cartridge present .byte 4 ; init and run the cart, don't boot the disk, non-diagnostic .word init ; init address (just an RTS)