ds25: got fancy wipe going again

but at what cost
This commit is contained in:
Vince Weaver
2025-10-31 00:12:58 -04:00
parent 0ad00a7faa
commit 92648b33ef
5 changed files with 174 additions and 166 deletions
+26 -27
View File
@@ -7,18 +7,17 @@ monster-c7: raw 16k
Order of being loaded:
QLOAD: 3495 4k
Credits: 3311 4k T2
QLOAD: 3573 4k T1
Credits: 3542 4k T2
Music: 10994 12k T3,4,5
Fourcolor: 4096 4k T6
Monster1: 12247 16k T7,8,9,10
Monster2: 12247 16k T11,12,13,14
Woz: 8k? 8k T15,16,17,18
Monster1: 13740 16k T7,8,9,10
Monster2: 12031 12k T11,12,13,14
Woz: 14982 16k T15,16,17,18 (8077 compressed)
Extra: 5121 8k T19,20
Intro: 15220 16k T21,22,23,24
Intro: 15295 16k T21,22,23,24
===== ===
88k?
90k?
free space:
main RAM, from $6000...$9FFF = 16k
@@ -48,24 +47,24 @@ Monsters: (16k)
Memory map:
MAIN AUX
~~~~ ~~~
$00 -- zero page $00 -- unused
$01 -- stack $01 -- unused
$02 -- disk data $02 -- ???
$03 -- disk data $03 -- ???
$04-$07 -- lores p1 $04-$07 -- dlores p1
$08-$0B -- lores p2 $08-$0B -- dlores p2
$0c-$0F -- ZP save $0c-$0F -- ???
$10-$11 -- Boot code $10-$11 -- FOUR
$12-$1F -- QLOAD $12-$1F -- FOUR
$20-$3F -- hires p1 $20-$3F -- dhires p1
$40-$5F -- hires p2 $40-$5F -- dhires p2
$60-$9F -- code $60-$9F -- ??
$A0-$BF -- temp area $A0-$BF -- ??
$C0-$CF -- I/O $C0-$CF -- I/O
$D0-$DF(1) -- MUSIC $D0-$DF(1) -- hard to access
$D0-$FC(2) -- CREDITS $D0-$DF(2) -- hard to access
$E0-$FC -- MUSIC $E0-$FF -- hard to access
MAIN AUX
~~~~ ~~~
$00 -- zero page $00 -- unused
$01 -- stack $01 -- unused
$02 -- disk data $02 -- ???
$03 -- disk data $03 -- ???
$04-$07 -- lores p1 $04-$07 -- dlores p1
$08-$0B -- lores p2 $08-$0B -- dlores p2
$0c-$0F -- ZP save $0c-$0F -- ???
$10-$11 -- Boot code $10-$11 -- FOUR
$12-$1F -- QLOAD $12-$1F -- FOUR
$20-$3F -- hires p1 $20-$3F -- dhires p1
$40-$5F -- hires p2 $40-$5F -- dhires p2
$60-$9F -- running code $60-$9F -- MONSTER
$A0-$BF -- temp area $A0-$BF -- ??
$C0-$CF -- I/O $C0-$CF -- I/O
$D0-$DF(1) -- MUSIC $D0-$DF(1) -- hard to access
$D0-$FC(2) -- CREDITS $D0-$DF(2) -- hard to access
$E0-$FC -- MUSIC $E0-$FF -- hard to access
$FD-$FE -- hires lookup
$FF -- irq vector
+126 -126
View File
@@ -1,126 +1,126 @@
;license:MIT
;(c) 2017-2020 by qkumba/4am/John Brooks
;
addrs=$70 ; $40 bytes from $70..$AF (original code used $BF)
; Code is $70 bytes
.macro OVERCOPY_TO_0 start, end
; over-copy region to $00
; clobbers $FF
.local oczm
; out: X=0
; Y=last byte before start (e.g. 0 if the last instruction is JMP $0000)
ldx #(end-start+1)
oczm:
ldy start-2, X
sty $FE, X
dex
bne oczm
.endmacro
do_wipe_fizzle:
ldx #$1F ; build address lookup table
dwf1:
txa
eor #$20 ;
sta addrs, X ; builds the dest table starting at $20
eor #$80 ; (was originally $A0 to build at $80)
sta addrs+$20, X ; builds aux table starting at $A0
dex
bpl dwf1
OVERCOPY_TO_0 start, end
; $FF clobbered
; X=0
; Y=0
jmp copyaux
start:
.org $00
;!pseudopc 0 {
;Y=0 on entry to copyaux
copyaux:
sta READAUXMEM ; copy $4000/aux to $A000/main
ldx #$20
aa:
lda $4000, Y
bb:
sta $A000, Y ; was $8000
iny
bne aa
inc aa+2
inc bb+2
dex
bne aa
sta READMAINMEM
sta $C001 ; 80STORE mode
;X,Y=0 on entry to LFSR
loop:
txa
loop1:
eor #$35 ; LFSR form 0x3500 with period 16383
tax
loop2:
lda addrs, X
bmi aux
sta $C054 ; switch $2000 access to main memory
sta <dst+2
eor #$60
sta <src+2
src:
lda $FD00, Y
dst:
sta $FD00, Y
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
bit KBD
bmi zexit
txa
bne loop1
lda (src+1), Y ; last lousy byte (because LFSR never hits 0)
sta (dst+1), Y
zexit:
sta $C000 ; 80STORE mode off
rts
aux:
sta $C055 ; switch $2000 access to aux memory (read/write!)
sta <auxsrc+2
eor #$80 ; (was originally $A0 when it loaded from $8000)
sta <auxdst+2
auxsrc:
lda $FD00, Y ; gets modified to $A000
auxdst:
sta $FD00, Y ; gets modified to $2000
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
lda KBD
bmi zexit
txa
bne loop1
beq zexit
.reloc
end:
;license:MIT
;(c) 2017-2020 by qkumba/4am/John Brooks
;
addrs=$70 ; $40 bytes from $70..$AF (original code used $BF)
; Code is $70 bytes
.macro OVERCOPY_TO_0 start, end
; over-copy region to $00
; clobbers $FF
.local oczm
; out: X=0
; Y=last byte before start (e.g. 0 if the last instruction is JMP $0000)
ldx #(end-start+1)
oczm:
ldy start-2, X
sty $FE, X
dex
bne oczm
.endmacro
do_wipe_fizzle:
ldx #$1F ; build address lookup table
dwf1:
txa
eor #$20 ;
sta addrs, X ; builds the dest table starting at $20
eor #$80 ; (was originally $A0 to build at $80)
sta addrs+$20, X ; builds aux table starting at $A0
dex
bpl dwf1
OVERCOPY_TO_0 start, end
; $FF clobbered
; X=0
; Y=0
jmp copyaux
start:
.org $00
;!pseudopc 0 {
;Y=0 on entry to copyaux
copyaux:
sta READAUXMEM ; copy $4000/aux to $A000/main
ldx #$20
aa:
lda $4000, Y
bb:
sta $A000, Y ; was $8000
iny
bne aa
inc aa+2
inc bb+2
dex
bne aa
sta READMAINMEM
sta $C001 ; 80STORE mode
;X,Y=0 on entry to LFSR
loop:
txa
loop1:
eor #$35 ; LFSR form 0x3500 with period 16383
tax
loop2:
lda addrs, X
bmi aux
sta $C054 ; switch $2000 access to main memory
sta <mdst+2
eor #$60
sta <msrc+2
msrc:
lda $FD00, Y
mdst:
sta $FD00, Y
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
bit KBD
bmi zexit
txa
bne loop1
lda (msrc+1), Y ; last lousy byte (because LFSR never hits 0)
sta (mdst+1), Y
zexit:
sta $C000 ; 80STORE mode off
rts
aux:
sta $C055 ; switch $2000 access to aux memory (read/write!)
sta <auxsrc+2
eor #$80 ; (was originally $A0 when it loaded from $8000)
sta <auxdst+2
auxsrc:
lda $FD00, Y ; gets modified to $A000
auxdst:
sta $FD00, Y ; gets modified to $2000
txa
lsr
tax
tya
ror
tay
bcc loop2
bne loop
lda KBD
bmi zexit
txa
bne loop1
beq zexit
.reloc
end:
+14 -8
View File
@@ -149,7 +149,7 @@ monsters:
jsr save_zp
ldx #0
; jsr wipe_48
jsr wipe_48
; jsr do_wipe_fizzle
@@ -160,6 +160,19 @@ monsters:
cli
; restore_70..8F
restore70:
; re-copy monsters from AUX $7000 to MAIN $7000
lda #$70 ; AUX src $7000
ldy #$70 ; MAIN dest $7000
ldx #48 ; 12k*4 = 48 pages
jsr copy_aux_main
;============================
; wait a bit
@@ -245,13 +258,6 @@ pq_tree_bottom:
.incbin "graphics/pq_tree_dhgr.raw_bottom.zx02"
;monster1_bin:
; .incbin "graphics/monster_pumpkin.bin.zx02"
;monster1_aux:
; .incbin "graphics/monster_pumpkin.aux.zx02"
;.include "fx.dhgr.fizzle.s"
.include "wipe_48_all.s"
+2 -2
View File
@@ -451,7 +451,7 @@ bp_p1:
bp_m2:
lda hgrhi-1, X
clc
adc #$70
adc #$80 ; $70->$80 so $9000->$A000
sta auxsrc_hgrhi-1, X
dex
bne bp_m2
@@ -735,7 +735,7 @@ CopyAuxDHGRToMain:
at_a:
lda $4000, X
at_b:
sta $A000, X
sta $A000, X ; 9000 -> A000
inx
bne at_a
inc <at_a+2
+6 -3
View File
@@ -8,10 +8,13 @@ PNG2GR = ../../../utils/gr-utils/png2gr
HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
LINKER_SCRIPTS = ../../../linker_scripts/
all: WOZ
all: WOZ WOZ.zx02
###
WOZ.zx02: WOZ
$(ZX02) WOZ WOZ.zx02
WOZ: woz.o
ld65 -o WOZ woz.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
@@ -36,10 +39,10 @@ sprites/ball_sprites.inc:
####
clean:
rm -f *~ WOZ *.zx02 *.lst *.o *.AUX *.BIN
rm -f *~ WOZ *.zx02 *.lst *.o *.AUX *.BIN *.zx02
distclean:
rm -f *~ WOZ *.zx02 *.lst *.o *.AUX *.BIN
rm -f *~ WOZ *.zx02 *.lst *.o *.AUX *.BIN *.zx02
cd graphics && make clean
cd sprites && make clean