pitch-dark/src/pitchdark.a

82 lines
2.4 KiB
Plaintext
Raw Normal View History

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-27 21:00:02 +00:00
!source "src/games.a"
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/gameinfo.a"
2018-03-16 18:17:45 +00:00
!source "src/prefs.a"
2018-03-27 21:00:02 +00:00
!source "src/sound.a"
!source "src/launch.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
.weeguiFilename
!byte 10
!raw "LIB/WEEGUI"
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
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
!word kProDOSFileBuffer
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
jsr LoadGlobalPreferences ; get current game
2018-02-07 14:05:24 +00:00
jsr LoadGameInfo ; load and parse game description text
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
bit $C010 ; clear keyboard strobe
2018-02-07 14:05:24 +00:00
.runLoop
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
bra .runLoop
ExitWeeGUI
ldx #WGDisableMouse ; disable mouse support before quitting
2018-02-01 03:04:10 +00:00
jsr WeeGUI
ldx #WGExit ; clean up WeeGUI
jmp WeeGUI
2018-03-16 18:17:45 +00:00
gPrefsStore
!word *+2 ; address of storage space for prefs