mirror of
https://github.com/a2-4am/pitch-dark.git
synced 2024-06-27 21:29:28 +00:00
80 lines
2.5 KiB
Plaintext
80 lines
2.5 KiB
Plaintext
;license:MIT
|
|
;(c) 2018 by 4am
|
|
;
|
|
; It is Pitch Dark. You are likely to be eaten by a GUI.
|
|
;
|
|
; Public entry points
|
|
; - MainScreen
|
|
;
|
|
; Public variables
|
|
; - gGamesListStore
|
|
;
|
|
|
|
!cpu 65c02
|
|
!ct "src/lcase.ct"
|
|
!to "build/PITCH.DARK",plain
|
|
*=$3FFD
|
|
|
|
jmp Start
|
|
|
|
!bin "res/WEEGUI"
|
|
|
|
!source "src/macros.a"
|
|
!source "src/constants.a"
|
|
!source "src/WeeGUI_MLI.s"
|
|
|
|
!source "src/okvs.a"
|
|
!source "src/prodos.mli.a"
|
|
!source "src/prodos.ramdisk.a"
|
|
!source "src/prodos.path.a"
|
|
!source "src/parse.common.a"
|
|
!source "src/parse.gamelist.a"
|
|
!source "src/parse.gameinfo.a"
|
|
!source "src/parse.prefs.a"
|
|
!source "src/glue.common.a"
|
|
!source "src/glue.onbeyond.a"
|
|
!source "src/glue.zinfo.a"
|
|
!source "src/ui.common.a"
|
|
!source "src/ui.sound.a"
|
|
!source "src/ui.main.a"
|
|
!source "src/ui.main.keys.a"
|
|
!source "src/ui.options.a"
|
|
!source "src/ui.resume.a"
|
|
!source "src/ui.versions.a"
|
|
!source "src/ui.artwork.a"
|
|
|
|
Start
|
|
lda MACHID
|
|
and #$30
|
|
cmp #$30 ; 128K?
|
|
beq + ; yes, continue
|
|
- jmp QuitToProDOS
|
|
+ inc ; 65C02-only INC instruction will clear Z flag
|
|
beq - ; if Z flag is still set, this is not a 65C02
|
|
|
|
jsr DisconnectRAM32 ; disconnect /RAM in S3,D2
|
|
jsr ClearInterpreterOptions ; clear options struct at $300
|
|
jsr WGInit ; initialize WeeGUI
|
|
jsr LoadGameList ; get master list of games
|
|
jsr LoadGlobalPreferences ; get global options, including current game
|
|
jsr LoadGameInfo ; get current game description and game-specific options
|
|
ldx #WGEnableMouse ; enable mouse support
|
|
jsr WeeGUI
|
|
MainScreen
|
|
ldx #$FF
|
|
txs
|
|
jsr PaintMain ; create all WeeGUI views (UI elements) and paint them
|
|
jsr ClearPendingInput
|
|
.mainRunLoop
|
|
jsr RepaintMainIfDirty
|
|
ldx #WGPendingViewAction
|
|
jsr WeeGUI ; handle mouse movement and clicks
|
|
lda $C000
|
|
bpl .mainRunLoop
|
|
jsr ClearPendingInput
|
|
jsr HandleKey ; handle keypresses
|
|
bra .mainRunLoop
|
|
|
|
gGamesListStore
|
|
!word *+2 ; address of first okvs store
|