remove unnecessary duplicates of wait routine (saves 781 bytes)

This commit is contained in:
4am 2024-05-25 16:57:13 -04:00
parent 5dbcb0507c
commit 93ee4bee01
89 changed files with 56 additions and 118 deletions

View File

@ -127,7 +127,6 @@ ResetVector ; 6 bytes, copied to $100
!source "src/glue.decompress.a"
!source "src/textrank.a"
!source "src/okvs.a"
!source "src/wait.a"
; add new files above here
!source "src/hw.vbl.a"
@ -157,6 +156,21 @@ SwitchToBank2
rts
!source "src/prodos.path.a" ; paths end up on the same page
; WaitForKeyWithTimeout (label is in constants.a)
; in: A = timeout length (like standard $FCA8 wait routine)
; out: A clobbered
; X/Y preserved
sec
@wait1 pha
@wait2 sbc #1
bne @wait2
pla
bit $C000
bmi @exit
sbc #1
bne @wait1
@exit rts
; iLoadFXDATA (label is in constants.a)
jmp LoadFXDATA ; no direct calling - target can move

View File

@ -170,6 +170,7 @@ gSearchIndex = $6000
gSearchCache = $A000
; LC RAM 1 & 2
WaitForKeyWithTimeout = $FFD5
iLoadFXDATA = $FFE6
iLoadXSingle = $FFE9
iAddToPath = $FFEC

View File

@ -53,7 +53,5 @@ dst sta $FDFD ,y ; SMC
lda <startx
beq loop
exit rts
!source "src/wait.a"
}
end

View File

@ -72,7 +72,5 @@ exit rts
toaux sta $C003
sta $C005
rts
!source "src/wait.a"
}
end

View File

@ -59,5 +59,4 @@ row = $FF
bne @outerloop2
@exit rts
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -86,6 +86,5 @@ copymasks4
!byte %11111110
!byte %11111111
!source "src/wait.a"
+HGR_BLOCK_COPY_ROUTINES
+HGR_COPY_MASK_ROUTINES

View File

@ -193,5 +193,4 @@ copymasks4
!byte %11111110
!byte %11111111
!source "src/wait.a"
+HGR_BLOCK_COPY_ROUTINES

View File

@ -40,5 +40,4 @@ row2 = $ff
bne @loop
@exit rts
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -33,5 +33,4 @@
+ bne @loop2
@exit rts
!source "src/wait.a"
+HGR_BLOCK_COPY_ROUTINES

View File

@ -56,6 +56,5 @@
+ bne @copyloop
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -120,5 +120,3 @@ copymasks2
!byte %11110000
!byte %11100000
!byte %11000000
!source "src/wait.a"

View File

@ -74,5 +74,4 @@ colors
!byte %11010101
!byte %11111111
!source "src/wait.a"
+HGR_BLOCK_COPY_ROUTINES

View File

@ -141,7 +141,6 @@
!byte $05, $AF, $A5, $05, $AF, $05, $AF, $FA, $50, $FA, $50, $5A, $50, $5A, $F0, $5A
!byte $F0, $0F, $A5, $0F, $A5, $05, $05, $AF, $05, $AF, $06, $90, $FA, $50, $FA, $50
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES
!if * and 1 {

View File

@ -58,6 +58,5 @@ copymasks
!byte %11000000
!byte %10000000
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -59,6 +59,5 @@ copymasks
!byte %10000001
!byte %10000000
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -60,6 +60,5 @@ copymasks
!byte %10111111
!byte %11111111
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -60,6 +60,5 @@ copymasks
!byte %11111110
!byte %11111111
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -144,6 +144,5 @@ copymasks4
!byte %11111110
!byte %11111111
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -65,5 +65,4 @@ mask4 !byte %10011001
!byte %10110011
!byte %11100110
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -72,8 +72,6 @@ nextcolumn
bne frameloop
exit rts
!source "src/wait.a"
initial_rowcounts
!byte $01,$01,$00,$00,$FF,$FF,$FE,$FE,$FD,$FD
!byte $FC,$FC,$FB,$FB,$FA,$FA,$F9,$F9,$F8,$F8

View File

@ -91,5 +91,4 @@
jmp @outerloop
@exit rts
!source "src/wait.a"
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -158,7 +158,6 @@ stainc sta ($FE), y
inc $FF
+ rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -33,5 +33,4 @@
+ bne @loop2
@exit rts
!source "src/wait.a"
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -56,6 +56,5 @@
+ bne @copyloop
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -41,5 +41,4 @@ row = $FF
bpl @outerloop
@exit rts
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -40,5 +40,4 @@ row2 = $ff
bpl @loop
@exit rts
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -216,5 +216,3 @@ copymask_odd6
!byte %11111111
!byte %11111111
!byte %11111111
!source "src/wait.a"

View File

@ -111,5 +111,4 @@ clearmasks
!byte $80,$81,$83,$87,$8F,$9F,$BF
copymasks
!byte $FF,$BF,$9F,$8F,$87,$83,$81
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -94,5 +94,4 @@ copymasks2
!byte %11100000
!byte %11000000
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -140,7 +140,6 @@
beq @loop2 ; always branches
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -104,5 +104,3 @@ copymask_even
!byte %11001100
copymask_odd
!byte %10110011
!source "src/wait.a"

View File

@ -104,5 +104,3 @@ copymask_even
!byte %11010101
copymask_odd
!byte %10101010
!source "src/wait.a"

View File

@ -62,5 +62,4 @@ col = $ff
copymasks
!byte $FF,$BF,$9F,$8F,$87,$83,$81
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -97,5 +97,4 @@ CopyLine
bpl -
rts
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -193,5 +193,3 @@ copymasks6
!byte %10111110
!byte %10111110
!byte %11010101
!source "src/wait.a"

View File

@ -193,5 +193,3 @@ copymasks6
!byte %10111110
!byte %10111110
!byte %11010101
!source "src/wait.a"

View File

@ -147,5 +147,4 @@ masks
!byte %11111111
!byte %11111111
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -155,5 +155,4 @@ masks
!byte %11111111
!byte %11111111
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -158,5 +158,4 @@ masks
!byte %11111111
!byte %11111111
!source "src/wait.a"
+HGR_CALC_ROUTINES

View File

@ -77,5 +77,4 @@
bne @outerloop ; always branches
@exit rts
!source "src/wait.a"
+HGR_BLOCK_COPY_ROUTINES

View File

@ -122,6 +122,5 @@ row2 = $FF
jmp @outerloop
@exit jmp UnwaitForVBL
!source "src/wait.a"
+HGR_CALC_ROUTINES
+HGR_WHITE_ROUTINES

View File

@ -41,5 +41,4 @@ col2 = $ff
bpl @outerloop
@exit rts
!source "src/wait.a"
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -70,6 +70,5 @@ col2 = $ff
bpl @outerloop2
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -41,5 +41,4 @@ row2 = $ff
bpl @loop1
@exit rts
!source "src/wait.a"
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -69,6 +69,5 @@ row2 = $ff
bpl @loop3
@exit rts
!source "src/wait.a"
+HGR_WHITE_ROUTINES
+HGR_HALF_BLOCK_COPY_ROUTINES

View File

@ -62,7 +62,6 @@ dst = $26
bne @loop
@exit rts
!source "src/wait.a"
+HGR_CALC_ROUTINES
mask1 !byte %10110011

View File

@ -107,6 +107,5 @@ mask4
!byte %11111110
!byte %11111111
!source "src/wait.a"
+HGR_COPY_MASK_ROUTINES
+HGR_BLOCK_COPY_ROUTINES

View File

@ -183,5 +183,3 @@ copy2 lda $4500, y ; SMC
dex
bpl copyloop
exit jmp UnwaitForVBL
!source "src/wait.a"

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15965732
!be24 15964951
!le16 5130

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15910412
!be24 15909631
!le16 5732

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15842179
!be24 15841398
!le16 4194

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15856893
!be24 15856112
!le16 4652

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15875608
!be24 15874827
!le16 5621

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15896649
!be24 15895868
!le16 6199

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15970862
!be24 15970081
!le16 410

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15971616
!be24 15970835
!le16 449

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15972065
!be24 15971284
!le16 303

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 12738397
!be24 12737616
!le16 1652

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15918784
!be24 15918003
!le16 1640

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15971348
!be24 15970567
!le16 67

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15965673
!be24 15964892
!le16 59

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15964093
!be24 15963312
!le16 1426

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15948859
!be24 15948078
!le16 557

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15916144
!be24 15915363
!le16 2640

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15920782
!be24 15920001
!le16 451

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15921233
!be24 15920452
!le16 7564

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15971272
!be24 15970491
!le16 76

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15965519
!be24 15964738
!le16 154

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15971415
!be24 15970634
!le16 201

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15949416
!be24 15948635
!le16 4334

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15953750
!be24 15952969
!le16 1733

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15955483
!be24 15954702
!le16 1181

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15956664
!be24 15955883
!le16 3394

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15960058
!be24 15959277
!le16 3429

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15963487
!be24 15962706
!le16 479

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15963966
!be24 15963185
!le16 127

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15972368
!be24 15971587
!le16 2370

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15934202
!be24 15933421
!le16 5083

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15939285
!be24 15938504
!le16 2485

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15902848
!be24 15902067
!le16 7564

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15832596
!be24 15831815
!le16 9583

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15846373
!be24 15845592
!le16 10520

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15861545
!be24 15860764
!le16 14063

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15881229
!be24 15880448
!le16 15420

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15920424
!be24 15919643
!le16 358

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15928797
!be24 15928016
!le16 5405

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15941770
!be24 15940989
!le16 7089

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 15828248
!be24 15827467
!le16 4348

View File

@ -1,21 +0,0 @@
;license:MIT
;(c) 2018-9 by 4am
;
; This file is included from multiple assembly targets,
; so it should only have 1 function.
WaitForKeyWithTimeout
; in: A = timeout length (like standard $FCA8 wait routine)
; out: A clobbered
; X/Y preserved
sec
@wait1 pha
@wait2 sbc #1
bne @wait2
pla
bit $C000
bmi @exit
sbc #1
bne @wait1
@exit rts