emailler/client/carts/crt8040.src

108 lines
1.6 KiB
Plaintext

;taken from DocBacardi's CRT8040 tool - http://freenet-homepage.de/LittleDreamLand/CRT8040.html
#segdef "zp", $57-$72
#segdef "bank0", $8000-$9f10, force, fillup
#segdef "common", $df10-$e000, force, fillup
#outfile @, $00, "bank0", "common"
;--------------------------------------
; init the startadr of all segments
.segment "zp"
* = $57
.segment "bank0"
* = $8000
.segment "common"
* = $df10
;--------------------------------------
; init the rr registers and copy
; bank 3 to ram
.segment "bank0"
.DW Bank0_Reset ;Reset vector
.DW $fe5e ;NMI vector is not used here, points to system
.PET "CBM80" ;Reset Magic
Bank0_Reset:
lda #%01000111 ;Standard Memory Map, No Freeze, No Banking in $DF00 (+ allow access to accessory connector - Jonno 2009-08-20)
sta $de01
ldx #kickStack_len-1
copyKickStack:
lda kickStack_org,x
sta kickStack,x
dex
bpl copyKickStack
jmp kickStack
kickStack_org:
.pseudopc $0900
kickStack:
ldx #$1f
ldy #0
copyCrt:
lda #%00101011 ; switch to bank 1
sta $de00
delay0:
nop
iny
bne delay0
copyPage0:
smod0:
lda $e000,y
sta $0400,y
iny
bne copyPage0
lda #%00110011 ; switch to bank 2
sta $de00
delay1:
nop
iny
bne delay1
copyPage1:
lda $0400,y
smod1:
sta $8000,y
iny
bne copyPage1
inc smod0+2
inc smod1+2
inc $d020
dex
bpl copyCrt
lda #%00110001 ; switch to 8040
sta $de00
delay2:
nop
iny
bne delay2
; during the copy process occured some irqs, clear them
lda $dc0d
lda $dd0d
asl $d019
; set registers
; NV-BDIZC
lda #%00110111
pha
lda #$c3
ldx #$00
plp
jmp ($8000)
kickStack_len = *-kickStack
.realpc
;--------------------------------------