.include "atari.inc" font = $9c00 CCNTL = $d500 destptr = FR0 srcptr = FR1 codedest = $0400 cart_trailer = $bffa .org $a000 ; left cartridge screendata: .incbin "titledata.dat" .res $44, $ff ; fudge factor, keep the DL from crossing a 1K boundary CART_TARGET = 1 .include "newtitle.s" ; 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 cartstart: ; 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 #1 sta COLDST ; System Reset = reboot jsr start ; from newtitle.s jsr $0400 ; run the game (romable_taimain) jmp cartstart ; redisplay title screen if "play again? N" .if * > cart_trailer .fatal "bank7 code too large" .endif .res cart_trailer - *, $ff .word cartstart ; 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)