2018-02-01 03:04:10 +00:00
|
|
|
;license:MIT
|
2018-02-01 00:07:35 +00:00
|
|
|
;(c) 2018 by 4am
|
2018-03-29 02:49:51 +00:00
|
|
|
;
|
|
|
|
; Public entry points
|
|
|
|
; - MainScreen
|
|
|
|
|
|
|
|
; Public functions
|
|
|
|
; - ExitWeeGUI
|
|
|
|
;
|
2018-04-15 02:49:15 +00:00
|
|
|
; Public variables
|
|
|
|
; - gGamesListStore
|
|
|
|
;
|
2018-02-01 00:07:35 +00:00
|
|
|
|
|
|
|
!cpu 65c02
|
2018-02-20 21:37:28 +00:00
|
|
|
!ct "src/lcase.ct"
|
|
|
|
!to "build/PITCH.DARK",plain
|
2018-03-28 18:18:35 +00:00
|
|
|
*=$3FFD
|
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-28 18:18:35 +00:00
|
|
|
!bin "res/WEEGUI"
|
|
|
|
|
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-04-15 02:49:15 +00:00
|
|
|
!source "src/prodos.mli.a"
|
|
|
|
!source "src/prodos.ramdisk.a"
|
|
|
|
!source "src/prodos.path.a"
|
|
|
|
!source "src/glue.onbeyond.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"
|
2018-04-15 02:49:15 +00:00
|
|
|
!source "src/ui.sound.a"
|
2018-03-27 20:55:31 +00:00
|
|
|
!source "src/ui.main.a"
|
|
|
|
!source "src/ui.main.keys.a"
|
|
|
|
!source "src/ui.options.a"
|
2018-04-11 19:12:36 +00:00
|
|
|
; !source "src/ui.resume.a"
|
|
|
|
!source "src/ui.versions.a"
|
2018-04-02 19:43:11 +00:00
|
|
|
!source "src/ui.artwork.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-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
|
2018-03-29 02:49:51 +00:00
|
|
|
jsr LoadGlobalPreferences ; get global options, including current game
|
2018-03-28 15:48:47 +00:00
|
|
|
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
|
2018-04-01 22:26:54 +00:00
|
|
|
jsr PaintMain ; create all WeeGUI views (UI elements) and paint them
|
2018-03-27 00:30:19 +00:00
|
|
|
bit $C010 ; clear keyboard strobe
|
2018-04-11 19:12:36 +00:00
|
|
|
ldx #WGClearPendingClick ; clear WeeGUI mouse strobe
|
|
|
|
jsr WeeGUI
|
2018-03-31 16:31:49 +00:00
|
|
|
.mainRunLoop
|
2018-04-01 22:26:54 +00:00
|
|
|
jsr RepaintMainIfDirty
|
2018-02-06 20:32:24 +00:00
|
|
|
ldx #WGPendingViewAction
|
2018-03-29 02:49:51 +00:00
|
|
|
jsr WeeGUI ; handle mouse movement and clicks
|
2018-04-11 19:12:36 +00:00
|
|
|
lda $C000
|
2018-03-31 16:31:49 +00:00
|
|
|
bpl .mainRunLoop
|
2018-04-11 19:12:36 +00:00
|
|
|
bit $C010
|
2018-03-29 02:49:51 +00:00
|
|
|
jsr HandleKey ; handle keypresses
|
2018-03-31 16:31:49 +00:00
|
|
|
bra .mainRunLoop
|
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-04-01 16:21:48 +00:00
|
|
|
ldx #WGClearScreen ; clear screen (HOME)
|
|
|
|
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
|
|
|
gGamesListStore
|
2018-03-29 02:49:51 +00:00
|
|
|
!word *+2 ; address of first okvs store
|