aboutsummaryrefslogtreecommitdiff
path: root/bank7.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-09 20:31:12 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-09 20:31:12 -0500
commitce772f39231647cf7a5558d94f542f4ebcdc7025 (patch)
tree7b57875b1cf206f7d4230caa52c86f3e78944512 /bank7.s
parentfdc8911c487236fe978e7f010b299ce98cc223aa (diff)
downloadtaipan-ce772f39231647cf7a5558d94f542f4ebcdc7025.tar.gz
cartridge version WIP. Not really usable yet.
Diffstat (limited to 'bank7.s')
-rw-r--r--bank7.s85
1 files changed, 85 insertions, 0 deletions
diff --git a/bank7.s b/bank7.s
new file mode 100644
index 0000000..c86f889
--- /dev/null
+++ b/bank7.s
@@ -0,0 +1,85 @@
+
+ .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
+ 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)