Skip to content

Commit 2ab72f5

Browse files
committed
copy success graphic
2 parents a365199 + 5979fa2 commit 2ab72f5

File tree

10 files changed

+129
-174
lines changed

10 files changed

+129
-174
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/nametables/build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ require('./enter_high_score');
33
require('./game_type_menu');
44
require('./level_menu');
55
require('./rocket_legal');
6-
require('./speedtest');

src/nametables/speedtest.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/nmi/render_mode_play_and_demo.asm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ updateLineClearingAnimation:
268268
tay
269269
lda vramPlayfieldRows,y
270270
sta generalCounter
271-
lda generalCounter
272-
clc
273-
adc #$06
274-
sta generalCounter
275271

276272
iny
277273
lda vramPlayfieldRows,y

src/nmi/render_util.asm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ render_playfield:
5555
rts
5656

5757
vramPlayfieldRows:
58-
.word $20C6,$20E6,$2106,$2126
59-
.word $2146,$2166,$2186,$21A6
60-
.word $21C6,$21E6,$2206,$2226
61-
.word $2246,$2266,$2286,$22A6
62-
.word $22C6,$22E6,$2306,$2326
58+
.word $20CC,$20EC,$210C,$212C
59+
.word $214C,$216C,$218C,$21AC
60+
.word $21CC,$21EC,$220C,$222C
61+
.word $224C,$226C,$228C,$22AC
62+
.word $22CC,$22EC,$230C,$232C
6363

6464
copyPlayfieldRowToVRAM:
6565
ldx vramRow
@@ -76,8 +76,6 @@ copyPlayfieldRowToVRAM:
7676
dex
7777

7878
lda vramPlayfieldRows,x
79-
clc
80-
adc #$06
8179
sta PPUADDR
8280
@copyRow:
8381
ldx #$0A

src/palettes.asm

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,55 @@
1+
; ppu hi, ppu lo
2+
; length
3+
; palette data
4+
; $FF
5+
16
game_palette:
2-
.byte $3F,$00,$20,$0F,$30,$12,$16,$0F
3-
.byte $20,$12,$00,$0F,$2C,$16,$29,$0F
4-
.byte $3C,$00,$30,$0F,$16,$2A,$22,$0F
5-
.byte $10,$16,$2D,$0F,$2C,$16,$29,$0F
6-
.byte $3C,$00,$30,$FF
7+
.byte $3F,$00
8+
.byte $20
9+
.byte $0F,$30,$12,$16 ; bg
10+
.byte $0F,$20,$12,$00
11+
.byte $0F,$2C,$16,$29
12+
.byte $0F,$3C,$00,$30
13+
.byte $0F,$16,$2A,$22 ; sprite
14+
.byte $0F,$10,$16,$2D
15+
.byte $0F,$2C,$16,$29
16+
.byte $0F,$3C,$00,$30
17+
.byte $FF
718
title_palette:
8-
.byte $3F,$00,$14,$0F,$3C,$38,$00,$0F
9-
.byte $17,$27,$37,$0F,$30,MENU_HIGHLIGHT_COLOR,$00,$0F
10-
.byte $22,$2A,$28,$0F,$30,$29,$27,$FF
19+
.byte $3F,$00
20+
.byte $14
21+
.byte $0F,$3C,$38,$00 ; bg
22+
.byte $0F,$17,$27,$37
23+
.byte $0F,$30,MENU_HIGHLIGHT_COLOR,$00
24+
.byte $0F,$22,$2A,$28
25+
.byte $0F,$30,$29,$27 ; sprite
26+
.byte $FF
1127
menu_palette:
12-
.byte $3F,$00,$16,$0F,$30,$38,$26,$0F
13-
.byte $17,$27,$37,$0F,$30,MENU_HIGHLIGHT_COLOR,$00,$0F
14-
.byte $16,$2A,$28,$0F,$16,$26,$27,$0f,$2A,$FF
28+
.byte $3F,$00
29+
.byte $16
30+
.byte $0F,$30,$38,$26 ; bg
31+
.byte $0F,$17,$27,$37
32+
.byte $0F,$30,MENU_HIGHLIGHT_COLOR,$00
33+
.byte $0F,$16,$2A,$28
34+
.byte $0F,$16,$26,$27 ; sprite
35+
.byte $0F,$2A
36+
.byte $FF
1537
rocket_palette:
16-
.byte $3F,$11,$7,$16,$2A,$28,$0f,$37,$18,$38 ; sprite
17-
.byte $3F,$00,$8,$0f,$3C,$38,$00,$0F,$20,$12,$15 ; bg
38+
.byte $3F,$11
39+
.byte $07
40+
.byte $16,$2A,$28 ; sprite
41+
.byte $0F,$37,$18,$38
42+
.byte $3F,$00
43+
.byte $08
44+
.byte $0F,$3C,$38,$00 ; bg
45+
.byte $0F,$20,$12,$15
1846
.byte $FF
1947
wait_palette:
20-
.byte $3F,$11,$1,$30
21-
.byte $3F,$00,$8,$f,$30,$38,$26,$0F,$17,$27,$37
48+
.byte $3F,$11
49+
.byte $01
50+
.byte $30 ; sprite
51+
.byte $3F,$00
52+
.byte $08
53+
.byte $0F,$30,$38,$26 ; bg
54+
.byte $0F,$17,$27,$37
2255
.byte $FF

src/playstate/preparenext.asm

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -44,54 +44,27 @@ playState_prepareNext:
4444
lda linecapState
4545
cmp #LINECAP_HALT
4646
bne @linecapHaltEnd
47-
lda crashFlag
47+
ldx #<haltEndingGraphic
48+
ldy #>haltEndingGraphic
49+
50+
lda crashFlag ; LINECAP_HALT set in testCrash
4851
cmp #$F0
49-
bne @gg
50-
lda #'C'
51-
sta playfield+$66
52-
lda #'R'
53-
sta playfield+$67
54-
lda #'A'
55-
sta playfield+$68
56-
lda #'S'
57-
sta playfield+$69
58-
lda #'H'
59-
sta playfield+$6A
60-
lda #$28
61-
sta playfield+$6B
62-
bne @finish
63-
@gg:
64-
lda #'G'
65-
sta playfield+$67
66-
sta playfield+$68
67-
lda #$28
68-
sta playfield+$6A
69-
@finish:
70-
lda #0
71-
sta vramRow
72-
jsr typeBEndingStuffEnd
73-
rts
74-
@linecapHaltEnd:
52+
bne @nonCrash
53+
ldx #<crashGraphic
54+
ldy #>crashGraphic
55+
@nonCrash:
56+
jmp copyGraphic
7557

58+
@linecapHaltEnd:
7659
jsr practisePrepareNext
7760
inc playState
7861
rts
7962

8063
typeBEndingStuff:
81-
; copy success graphic
82-
ldx #$5C
83-
ldy #$0
84-
@copySuccessGraphic:
85-
lda typebSuccessGraphic,y
86-
cmp #$80
87-
beq @graphicCopied
88-
sta playfield,x
89-
inx
90-
iny
91-
jmp @copySuccessGraphic
92-
@graphicCopied:
93-
lda #$00
94-
sta vramRow
64+
ldx #<typebSuccessGraphic
65+
ldy #>typebSuccessGraphic
66+
copyGraphic:
67+
jsr copyGraphicToPlayfield
9568

9669
typeBEndingStuffEnd:
9770
; play sfx
@@ -116,5 +89,32 @@ sleep_gameplay_nextSprite:
11689
bne @loop
11790
rts
11891

92+
copyGraphicToPlayfield:
93+
lda #$09 ; default row
94+
copyGraphicToPlayfieldAtCustomRow:
95+
stx generalCounter
96+
sty generalCounter2
97+
tax
98+
lda multBy10Table,x
99+
clc
100+
adc #$02 ; indent
101+
tax
102+
ldy #$00
103+
@copySuccessGraphic:
104+
lda (generalCounter),y
105+
beq @graphicCopied
106+
sta playfield,x
107+
inx
108+
iny
109+
bne @copySuccessGraphic
110+
@graphicCopied: ; 0 in accumulator
111+
sta vramRow
112+
rts
113+
114+
; $28 is ! in game tileset
115+
haltEndingGraphic:
116+
.byte $FF,'G','G',$FF,$28,$00
119117
typebSuccessGraphic:
120-
.byte $17,$12,$0C,$0E,$FF,$28,$80
118+
.byte 'N','I','C','E',$FF,$28,$00
119+
crashGraphic:
120+
.byte 'C','R','A','S','H',$28,$00

src/util/core.asm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ 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+
rts
27+
1028
drawBlackBGPalette:
1129
lda #$3F
1230
sta PPUADDR

0 commit comments

Comments
 (0)