Skip to content

Commit fd22da7

Browse files
committed
save 31 bytes
1 parent ca61f05 commit fd22da7

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

src/gamemode/gametypemenu/linecap.asm

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@ linecapMenuCursorIndices := 3
66
jsr updateAudioWaitForNmiAndDisablePpuRendering
77
jsr disableNmi
88

9-
; clearNametable
10-
lda #$20
11-
sta PPUADDR
12-
lda #$0
13-
sta PPUADDR
14-
lda #EMPTY_TILE
15-
ldx #4
16-
ldy #$BF
17-
@clearTile:
18-
sta PPUDATA
19-
dey
20-
bne @clearTile
21-
sta PPUDATA
22-
ldy #$FF
23-
dex
24-
bne @clearTile
9+
jsr clearNametable
2510

2611
jsr bulkCopyToPpu
2712
.addr linecapMenuNametable

src/gamemode/speedtest.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ gameMode_speedTest:
1010
jsr hzStart
1111
jsr updateAudioWaitForNmiAndDisablePpuRendering
1212
jsr disableNmi
13-
jsr copyRleNametableToPpu
14-
.addr speedtest_nametable
13+
jsr clearNametable
14+
jsr bulkCopyToPpu
15+
.addr speedtest_nametable_patch
1516
jsr bulkCopyToPpu
1617
.addr game_palette
1718
; patch color

src/nametables.asm

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ rocket_nametable: ; RLE
1212
.incbin "nametables/rocket_nametable.bin"
1313
legal_nametable: ; RLE
1414
.incbin "nametables/legal_nametable.bin"
15-
speedtest_nametable: ; RLE
16-
.incbin "nametables/speedtest_nametable.bin"
1715
title_nametable_patch: ; stripe
1816
.byte $21, $69, $5, $1D, $12, $1D, $15, $E
1917
.byte $FF
@@ -22,5 +20,17 @@ rocket_nametable_patch: ; stripe
2220
.byte $20, $A3, 5, $1c, $1d, $a, $1b, $1d
2321
.byte $FF
2422

23+
speedtest_nametable_patch:
24+
; tiles
25+
.byte $21, $A3, $6, 0, 0, $ED, 0, 0, $EC
26+
.byte $22, $23, $3, 'T', 'A', 'P'
27+
.byte $22, $A3, $3, 'D', 'I', 'R'
28+
.byte $22, $28, $1, 0
29+
; attrs
30+
.byte $23, $e2, $1, 0
31+
.byte $23, $ea, $1, 0
32+
.byte $23, $d8, $43, $55
33+
.byte $FF
34+
2535

2636
.include "nametables/rle.asm"

src/util/core.asm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ clearPlayfield:
77
bne @loop
88
rts
99

10+
clearNametable:
11+
lda #$20
12+
sta PPUADDR
13+
lda #$0
14+
sta PPUADDR
15+
lda #EMPTY_TILE
16+
ldx #4
17+
ldy #$BF
18+
@clearTile:
19+
sta PPUDATA
20+
dey
21+
bne @clearTile
22+
sta PPUDATA
23+
ldy #$FF
24+
dex
25+
bne @clearTile
26+
1027
drawBlackBGPalette:
1128
lda #$3F
1229
sta PPUADDR

0 commit comments

Comments
 (0)