Fix black screen, text rendering, and keyboard input issues
This commit is contained in:
23
main.s
23
main.s
@@ -38,6 +38,7 @@ START:
|
||||
|
||||
; Enable DMA for Copper, Bitplanes, Blitter
|
||||
move.w #$83C0,DMACON(a6) ; Set DMAEN, BPLEN, COPEN, BLTEN
|
||||
move.w #0,COPJMP1(a6) ; Strobe Copper to start immediately
|
||||
|
||||
MAIN_LOOP:
|
||||
; Wait for vertical blank
|
||||
@@ -49,25 +50,15 @@ MAIN_LOOP:
|
||||
; 2. Update Game Logic
|
||||
bsr UpdateGame
|
||||
|
||||
; 3. Check for Exit (Left Mouse Button for now)
|
||||
; 3. Check for Reset (Left Mouse Button)
|
||||
btst #6,CIAA
|
||||
bne.s MAIN_LOOP
|
||||
|
||||
EXIT:
|
||||
; Restore System
|
||||
lea CUSTOM,a6
|
||||
move.w #$7FFF,DMACON(a6)
|
||||
move.w #$7FFF,INTENA(a6)
|
||||
|
||||
move.w OldDmaCon,DMACON(a6)
|
||||
move.w OldIntEna,INTENA(a6)
|
||||
; If button pressed, restart game
|
||||
bra START
|
||||
|
||||
; Enable multitasking
|
||||
; move.l 4.w,a6
|
||||
; jsr -138(a6) ; Permit
|
||||
|
||||
moveq #0,d0
|
||||
rts
|
||||
; EXIT label removed as we don't return to OS
|
||||
; The bootblock environment has no OS to return to cleanly in this simple setup
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Helper Routines
|
||||
@@ -78,7 +69,7 @@ WaitVBlank:
|
||||
.wait:
|
||||
move.l $04(a6),d0
|
||||
and.l #$1ff00,d0
|
||||
cmp.l #300<<8,d0
|
||||
cmp.l #250<<8,d0
|
||||
bne.s .wait
|
||||
rts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user