pitch-dark/src/pitchdark.a

70 lines
1.7 KiB
Plaintext

;license:MIT
;(c) 2018 by 4am
!cpu 65c02
!ct "lcase.ct"
!to "../build/PITCHDRK.SYSTEM#FF2000",plain
*=$2000
; application constants
RAW = 1
!zone {
jmp .start
!source "WeeGUI_MLI.s"
.weeguiFilename
!byte 6
!raw "WEEGUI"
!source "prodos.a"
!source "config.a"
!source "action.a"
!source "paint.a"
.start
lda MACHID
and #$30
cmp #$30 ; 128K?
beq + ; yes, continue
jmp QuitToProDOS
+
bit $c010
jsr LoadFile ; load WEEGUI binary at $4000
!word .weeguiFilename
!word $4000
!word $2000
!word $1C00
jsr $4000 ; initialize WeeGUI
lda #22 ; TODO load this from a prefs file instead
sta gCurrentGame
jsr LoadGameInfo ; load and parse game description text
jsr CreateViews ; create all WeeGUI views (UI elements)
ldx #WGClearScreen ; clear screen
jsr WeeGUI
jsr PaintAllViews ; draw all UI elements
ldx #WGEnableMouse ; enable mouse support
jsr WeeGUI
.runLoop
ldx #WGPendingViewAction
jsr WeeGUI
lda $c000
bpl .runLoop
bit $c010
jsr HandleKey
bcc .runLoop
ldx #WGDisableMouse ; disable mouse support before quitting
jsr WeeGUI
ldx #WGExit ; clean up WeeGUI
jsr WeeGUI
jmp QuitToProDOS ; quit via ProDOS MLI
}