mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-09-27 19:57:56 +00:00
93 lines
2.4 KiB
Plaintext
93 lines
2.4 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/config.a"
|
|
!source "src/prefs.a"
|
|
!source "src/action.a"
|
|
!source "src/paintcommon.a"
|
|
!source "src/paint.a"
|
|
!source "src/paintoptions.a"
|
|
Start
|
|
lda MACHID
|
|
and #$30
|
|
cmp #$30 ; 128K?
|
|
beq + ; yes, continue
|
|
- jmp QuitToProDOS
|
|
+ !byte $1a ; 65C02 INC, clear Z flag if supported
|
|
beq - ; not a 65C02
|
|
jsr DisconnectRAM32 ; disconnect /RAM in S3,D2 so we can use DHGR
|
|
bit $C010
|
|
jsr LoadFile ; load WEEGUI binary at $4000
|
|
!word .weeguiFilename
|
|
!word WGInit
|
|
!word $2000
|
|
!word kProDOSFileBuffer
|
|
|
|
jsr WGInit ; initialize WeeGUI
|
|
|
|
jsr LoadGlobalPreferences ; get current game
|
|
jsr LoadGameInfo ; load and parse game description text
|
|
|
|
ldx #WGEnableMouse ; enable mouse support
|
|
jsr WeeGUI
|
|
|
|
MainScreen
|
|
ldx #$FF
|
|
txs
|
|
ldx #WGReset ; reset WeeGUI views
|
|
jsr WeeGUI
|
|
jsr CreateViews ; create all WeeGUI views (UI elements)
|
|
ldx #WGClearScreen ; clear screen
|
|
jsr WeeGUI
|
|
jsr PaintAllViews ; draw all UI elements
|
|
.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
|
|
|
|
WAIT = $FCA8
|
|
SPEAKER = $C030
|
|
|
|
SoftBell
|
|
php
|
|
phx
|
|
pha
|
|
ldx #32
|
|
- lda #2
|
|
jsr WAIT
|
|
bit SPEAKER
|
|
lda #33
|
|
jsr WAIT
|
|
bit SPEAKER
|
|
dex
|
|
bne -
|
|
pla
|
|
plx
|
|
plp
|
|
rts
|