Skip to content

Commit

Permalink
Debug shows frame vsync count not total vsyncs.
Browse files Browse the repository at this point in the history
Do 63 lines not 48 as could see fire being clipped.
  • Loading branch information
kieranhj committed Feb 14, 2020
1 parent c23c9c4 commit 98ffc3f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions doom-fire.asm
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ main_loop:
bl debug_write_vsync_count

; Block if we've not even had a vsync since last time - we're >50Hz!
.if Screen_Banks > 2
ldr r1, last_vsync
.1:
ldr r2, vsync_count
cmp r1, r2
beq .1
str r2, last_vsync

.if Screen_Banks > 2
; Swap banks
; Display whichever bank we've just written to
ldr r1, scr_bank ; bank we want to display next
Expand Down Expand Up @@ -185,6 +185,8 @@ debug_write_vsync_count:
swi OS_WriteC

ldr r0, vsync_count
ldr r1, last_vsync
sub r0, r0, r1
adr r1, debug_string
mov r2, #8
swi OS_ConvertHex4
Expand Down Expand Up @@ -479,8 +481,8 @@ plot_horizontal_line:
movlt r0, #0 ; or MOD ScreenWidth

; update colour with some randomness
and r7, r7, #1 ; rnd & 1
subs r4, r4, r7 ; colour -= rnd & 1
; and r7, r7, #1 ; rnd & 1
subs r4, r4, r7, lsr #1 ; colour -= rnd & 1
.endm

.macro PLOT_PIXEL_BIT
Expand Down Expand Up @@ -515,7 +517,7 @@ do_fire:
ldr r8, rnd_seed ; seed
mov r9, #1 ; bit

mov r3, #Screen_Height - 48
mov r3, #Screen_Height - 63

; R10 = ptr to start of source line
add r10, r12, r3, lsl #7 ; r10 = screen_addr + y * 128
Expand Down

0 comments on commit 98ffc3f

Please sign in to comment.