Skip to content

Commit 6d5c6f1

Browse files
committed
Fixed skyline scroll logic; Added title to titlescreen
- Fixed the skyline scroll logic to actually work. - Change the skyline to scroll once every three frames. - Added a title to the title screen.
1 parent 38fb612 commit 6d5c6f1

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

game.asm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Game_Init:
5454
sta SkyScroll+1
5555
sta game_paused
5656

57+
lda #SKYLINE_SCROLL_SPEED
58+
sta SScrollNext
59+
5760
; Status bar stuff
5861

5962
; Generate and draw first screen of columns (plus a few)
@@ -1804,7 +1807,7 @@ BufferSkylineScroll:
18041807
bne @noWrap
18051808

18061809
dec SScrollNext
1807-
beq @noWrap
1810+
bne @noWrap
18081811

18091812
lda #SKYLINE_SCROLL_SPEED
18101813
sta SScrollNext

runner.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ StatusDrawn: .res 1
198198
SkyScroll: .res 2 ; Scroll position of the skyline
199199
SScrollNext: .res 1 ; next frame to scroll
200200
ScrollBuffer: .res 2 ; Playfield PPU scroll value
201-
SKYLINE_SCROLL_SPEED = 2
201+
SKYLINE_SCROLL_SPEED = 3
202202

203203
.segment "SAVERAM"
204204
; battery backed RAM

runner_01.bmp

0 Bytes
Binary file not shown.

title.asm

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,28 @@ InitTitle:
131131
; Draw Title
132132
lda #$22
133133
sta $2006
134-
lda #$4A
134+
lda #$28
135135
sta $2006
136136

137-
ldx #0
138-
@loop2:
139-
lda TitleText, x
140-
beq @titleTextDone
141-
sta $2007
137+
; Top row of title
138+
ldx #$90
139+
:
140+
stx $2007
142141
inx
143-
jmp @loop2
144-
@titleTextDone:
142+
cpx #$A0
143+
bne :-
144+
145+
; Bottom row of title
146+
lda #$22
147+
sta $2006
148+
lda #$48
149+
sta $2006
150+
ldx #$A0
151+
:
152+
stx $2007
153+
inx
154+
cpx #$B0
155+
bne :-
145156

146157
lda #$22
147158
sta TmpAddr
@@ -408,14 +419,14 @@ Title_BG6:
408419
TitlePalette:
409420
; Background
410421
.byte $0F,$0F,$0F,$0F
411-
.byte $0F,$17,$25,$09
412-
.byte $0F,$16,$39,$06
413-
.byte $0F,$30,$21,$15
422+
.byte $0F,$17,$24,$14
423+
.byte $0F,$0F,$0F,$0F
424+
.byte $0F,$0F,$0F,$0F
414425

415426
; Sprites
416427
.byte $0F,$10,$00,$30
417-
.byte $0F,$05,$05,$05
418-
.byte $0F,$0A,$0A,$0A
419-
.byte $0F,$0F,$11,$11
428+
.byte $0F,$0F,$0F,$0F
429+
.byte $0F,$0F,$0F,$0F
430+
.byte $0F,$0F,$0F,$0F
420431

421432
.byte $EA, $EA

0 commit comments

Comments
 (0)