mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-06-26 15:29:31 +00:00
70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
;license:MIT
|
|
;(c) 2018 by 4am
|
|
|
|
!cpu 65c02
|
|
!ct "lcase.ct"
|
|
!to "../build/PITCH.DARK",plain
|
|
*=$6000
|
|
|
|
lda #0 ; set Z flag always
|
|
!cpu 65816
|
|
rep #2 ; clear Z flag on 65816 only
|
|
!cpu 65c02
|
|
beq + ; skip GS-specific code on non-GS machines (required, will crash on //c, grr)
|
|
lda $C029
|
|
and #$1F
|
|
sta $C029 ; set GS NEWVIDEO mode to turn off linearize
|
|
+ jmp Start
|
|
.weeguiFilename
|
|
!byte 10
|
|
!raw "BIN/WEEGUI"
|
|
|
|
!source "WeeGUI_MLI.s"
|
|
!source "memory.a"
|
|
!source "prodos.a"
|
|
!source "ramdisk.a"
|
|
!source "path.a"
|
|
!source "prefs.a"
|
|
!source "config.a"
|
|
!source "action.a"
|
|
!source "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
|