2018-02-01 03:04:10 +00:00
|
|
|
;license:MIT
|
2018-02-01 00:07:35 +00:00
|
|
|
;(c) 2018 by 4am
|
|
|
|
|
|
|
|
!cpu 65c02
|
2018-02-20 21:37:28 +00:00
|
|
|
!ct "src/lcase.ct"
|
|
|
|
!to "build/PITCH.DARK",plain
|
2018-02-08 22:01:58 +00:00
|
|
|
*=$6000
|
2018-02-01 00:07:35 +00:00
|
|
|
|
2018-02-24 20:25:41 +00:00
|
|
|
jmp Start
|
2018-02-07 14:05:24 +00:00
|
|
|
|
2018-03-24 19:28:55 +00:00
|
|
|
!source "src/macros.a"
|
2018-03-26 23:42:17 +00:00
|
|
|
!source "src/constants.a"
|
2018-02-20 21:37:28 +00:00
|
|
|
!source "src/WeeGUI_MLI.s"
|
2018-03-26 17:24:42 +00:00
|
|
|
|
2018-03-24 16:04:09 +00:00
|
|
|
!source "src/okvs.a"
|
2018-02-20 21:37:28 +00:00
|
|
|
!source "src/prodos.a"
|
|
|
|
!source "src/ramdisk.a"
|
|
|
|
!source "src/path.a"
|
2018-03-27 21:00:02 +00:00
|
|
|
!source "src/sound.a"
|
|
|
|
!source "src/launch.a"
|
2018-03-28 02:40:09 +00:00
|
|
|
!source "src/parse.common.a"
|
2018-03-28 15:48:47 +00:00
|
|
|
!source "src/parse.gamelist.a"
|
2018-03-28 02:40:09 +00:00
|
|
|
!source "src/parse.gameinfo.a"
|
|
|
|
!source "src/parse.prefs.a"
|
2018-03-27 20:55:31 +00:00
|
|
|
!source "src/ui.common.a"
|
|
|
|
!source "src/ui.main.a"
|
|
|
|
!source "src/ui.main.keys.a"
|
|
|
|
!source "src/ui.options.a"
|
2018-03-26 17:19:17 +00:00
|
|
|
|
2018-02-07 21:02:14 +00:00
|
|
|
Start
|
2018-02-01 00:07:35 +00:00
|
|
|
lda MACHID
|
|
|
|
and #$30
|
|
|
|
cmp #$30 ; 128K?
|
|
|
|
beq + ; yes, continue
|
2018-03-06 23:10:51 +00:00
|
|
|
- jmp QuitToProDOS
|
2018-03-26 17:24:42 +00:00
|
|
|
+ inc ; 65C02-only INC instruction will clear Z flag
|
|
|
|
beq - ; if Z flag is still set, this is not a 65C02
|
|
|
|
|
2018-02-05 15:04:35 +00:00
|
|
|
jsr LoadFile ; load WEEGUI binary at $4000
|
2018-02-07 14:05:24 +00:00
|
|
|
!word .weeguiFilename
|
2018-03-01 16:06:00 +00:00
|
|
|
!word WGInit
|
2018-02-01 00:07:35 +00:00
|
|
|
!word $2000
|
2018-02-09 01:38:26 +00:00
|
|
|
!word kProDOSFileBuffer
|
|
|
|
|
2018-03-27 00:30:19 +00:00
|
|
|
jsr DisconnectRAM32 ; disconnect /RAM in S3,D2
|
|
|
|
jsr ClearInterpreterOptions ; clear options struct at $300
|
2018-03-01 16:06:00 +00:00
|
|
|
jsr WGInit ; initialize WeeGUI
|
2018-03-28 15:48:47 +00:00
|
|
|
jsr LoadGameList ; get master list of games
|
|
|
|
jsr LoadGlobalPreferences ; get current game and global options
|
|
|
|
jsr LoadGameInfo ; get current game description and game-specific options
|
2018-03-01 16:06:00 +00:00
|
|
|
ldx #WGEnableMouse ; enable mouse support
|
|
|
|
jsr WeeGUI
|
|
|
|
MainScreen
|
2018-03-03 16:41:09 +00:00
|
|
|
ldx #$FF
|
|
|
|
txs
|
|
|
|
ldx #WGReset ; reset WeeGUI views
|
|
|
|
jsr WeeGUI
|
2018-02-07 14:05:24 +00:00
|
|
|
jsr CreateViews ; create all WeeGUI views (UI elements)
|
2018-02-01 20:27:33 +00:00
|
|
|
ldx #WGClearScreen ; clear screen
|
2018-02-01 00:07:35 +00:00
|
|
|
jsr WeeGUI
|
2018-02-07 14:05:24 +00:00
|
|
|
jsr PaintAllViews ; draw all UI elements
|
2018-03-27 00:30:19 +00:00
|
|
|
bit $C010 ; clear keyboard strobe
|
2018-02-07 14:05:24 +00:00
|
|
|
.runLoop
|
2018-02-06 20:32:24 +00:00
|
|
|
ldx #WGPendingViewAction
|
|
|
|
jsr WeeGUI
|
|
|
|
lda $c000
|
2018-02-07 14:05:24 +00:00
|
|
|
bpl .runLoop
|
2018-02-01 03:04:10 +00:00
|
|
|
bit $c010
|
2018-02-07 14:05:24 +00:00
|
|
|
jsr HandleKey
|
2018-02-09 01:38:26 +00:00
|
|
|
bra .runLoop
|
2018-02-07 21:02:14 +00:00
|
|
|
|
|
|
|
ExitWeeGUI
|
2018-02-06 20:32:24 +00:00
|
|
|
ldx #WGDisableMouse ; disable mouse support before quitting
|
2018-02-01 03:04:10 +00:00
|
|
|
jsr WeeGUI
|
2018-02-06 20:32:24 +00:00
|
|
|
ldx #WGExit ; clean up WeeGUI
|
2018-02-07 21:02:14 +00:00
|
|
|
jmp WeeGUI
|
2018-03-16 18:17:45 +00:00
|
|
|
|
2018-03-28 15:48:47 +00:00
|
|
|
.weeguiFilename
|
|
|
|
!byte 10
|
|
|
|
!raw "LIB/WEEGUI"
|
|
|
|
|
|
|
|
gGamesListStore
|
|
|
|
!word *+2 ; address first okvs store
|