blob: 3459aa0f8daa691b2f6d61838c02ae1af3568e15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
.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
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)
|