pitch-dark/src/pitchdark.a

62 lines
1.7 KiB
Plaintext

;license:MIT
;(c) 2018 by 4am
!cpu 65c02
!ct "src/lcase.ct"
!to "build/PITCH.DARK",plain
*=$6000
jmp Start
.weeguiFilename
!byte 10
!raw "LIB/WEEGUI"
!source "src/WeeGUI_MLI.s"
!source "src/memory.a"
!source "src/prodos.a"
!source "src/ramdisk.a"
!source "src/path.a"
!source "src/prefs.a"
!source "src/config.a"
!source "src/action.a"
!source "src/paint.a"
Start
lda MACHID
and #$30
cmp #$30 ; 128K?
beq + ; yes, continue
jmp QuitToProDOS
+ jsr DisconnectRAM32 ; disconnect /RAM in S3,D2 so we can use DHGR
bit $C010
jsr LoadFile ; load WEEGUI binary at $4000
!word .weeguiFilename
!word $4000
!word $2000
!word kProDOSFileBuffer
jsr $4000 ; initialize WeeGUI
jsr LoadGlobalPreferences ; get current game
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
bra .runLoop
ExitWeeGUI
ldx #WGDisableMouse ; disable mouse support before quitting
jsr WeeGUI
ldx #WGExit ; clean up WeeGUI
jmp WeeGUI