Skip to content

Commit 5c46593

Browse files
committed
Added subsection-comments for main loops
1 parent c03a545 commit 5c46593

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

src/code/gameplay.asm

+14-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ GameplayLoop::
113113
; Make sure that VBlank handler ran first
114114
rst WaitVBlank
115115

116+
; ---------------------------------------------------------
117+
; Check DPad input and move cursor accordingly
118+
; ---------------------------------------------------------
119+
116120
; Check for DPad input
117121
ld hl, hPressedButtons
118122
ld a, [hl]
@@ -193,8 +197,12 @@ GameplayLoop::
193197
; Play sound
194198
ld de, GameMoveBeep
195199
call PlaySound
196-
197200
.noCursorMove
201+
202+
; ---------------------------------------------------------
203+
; Update cursor animation
204+
; ---------------------------------------------------------
205+
198206
; Check if cursor animation needs to be updated
199207
ld hl, wCursorAnimCooldown
200208
dec [hl]
@@ -217,8 +225,12 @@ GameplayLoop::
217225
.reloadOne
218226
ld a, 1
219227
ld [wCursorPosAnimAdd], a
220-
221228
.noCursorAnimUpdate
229+
230+
; ---------------------------------------------------------
231+
; Check for A button press to place symbol
232+
; ---------------------------------------------------------
233+
222234
; Check if A button was pressed
223235
ld hl, hPressedButtons
224236
bit PADB_A, [hl]

src/code/menu.asm

+9-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ MenuLoop::
9090
; Make sure that VBlank handler ran first
9191
rst WaitVBlank
9292

93+
; ---------------------------------------------------------
94+
; Check for UP/DOWN input and change selected option
95+
; ---------------------------------------------------------
96+
9397
; Check if either up/down was pressed
9498
ld a, [hPressedButtons]
9599
and PADF_DOWN | PADF_UP
@@ -121,8 +125,12 @@ MenuLoop::
121125
; Play sound
122126
ld de, MenuMoveBeep
123127
call PlaySound
124-
125128
.noCursorMove
129+
130+
; ---------------------------------------------------------
131+
; Check for game to be started on START press
132+
; ---------------------------------------------------------
133+
126134
; Check if START was pressed
127135
ld a, [hPressedButtons]
128136
and PADF_START

src/code/win.asm

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ SECTION "Win Screen Code", ROM0
55
WinLoop::
66
; Make sure that VBlank handler ran first
77
rst WaitVBlank
8+
9+
; ---------------------------------------------------------
10+
; Check for game to be restarted on START press
11+
; ---------------------------------------------------------
812
913
; Check if Start is pressed
1014
ld a, [hPressedButtons]
@@ -22,6 +26,10 @@ WinLoop::
2226
jp GameplayLoop
2327
.noRestart
2428

29+
; ---------------------------------------------------------
30+
; Update animations for 'PRESS START' Text
31+
; ---------------------------------------------------------
32+
2533
; Check if animation should be updated
2634
ld hl, wWinAnimCooldown
2735
dec [hl]
@@ -56,6 +64,10 @@ WinLoop::
5664
ld [hStringDrawFlag], a
5765
.noUpdateWinAnim
5866

67+
; ---------------------------------------------------------
68+
; Update animation for win symbols
69+
; ---------------------------------------------------------
70+
5971
; Check if draw
6072
ld a, [wPlayerWin]
6173
and a

0 commit comments

Comments
 (0)