Fix black screen, text rendering, and keyboard input issues

This commit is contained in:
2025-12-01 22:13:06 +01:00
parent 965e10f6b2
commit a1150081e9
6 changed files with 100 additions and 46 deletions

View File

@@ -46,11 +46,28 @@ StartGame:
rts
SpawnEmail:
; For now, just pick the first email always, or cycle
; TODO: Randomize
; Check if CurrentEmail is valid, if not start from beginning
move.l CurrentEmail,a0
cmp.l #0,a0
beq.s .firstEmail
; Advance to next email (26 bytes per email structure)
add.l #26,a0
; Check if we've reached the end
lea EmailListEnd,a1
cmp.l a1,a0
bge.s .firstEmail
; Valid email, use it
move.l a0,CurrentEmail
bra.s .draw
.firstEmail:
lea EmailList,a0
move.l a0,CurrentEmail
.draw:
bsr DrawEmail
rts
@@ -62,34 +79,34 @@ DrawEmail:
; Draw Sender (at 2, 12)
move.l 2(a0),a0 ; Get Sender Ptr
moveq #2,d0 ; X
moveq #12,d1 ; Y
moveq #30,d1 ; Y
bsr DrawText
; Draw Subject (at 2, 14)
move.l CurrentEmail,a0
move.l 6(a0),a0 ; Get Subject Ptr
moveq #2,d0
moveq #14,d1
moveq #45,d1
bsr DrawText
; Draw Body (at 2, 16)
move.l CurrentEmail,a0
move.l 10(a0),a0 ; Get Body Ptr
moveq #2,d0
moveq #16,d1
moveq #60,d1
bsr DrawText
; Draw Options (at 2, 20 and 2, 22)
move.l CurrentEmail,a0
move.l 14(a0),a0 ; Opt1
moveq #2,d0
moveq #20,d1
moveq #90,d1
bsr DrawText
move.l CurrentEmail,a0
move.l 18(a0),a0 ; Opt2
moveq #2,d0
moveq #22,d1
moveq #105,d1
bsr DrawText
.done: