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
|
|
|
.weeguiFilename
|
2018-02-22 20:52:54 +00:00
|
|
|
!byte 10
|
|
|
|
!raw "LIB/WEEGUI"
|
2018-02-07 14:05:24 +00:00
|
|
|
|
2018-02-20 21:37:28 +00:00
|
|
|
!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"
|
2018-03-16 18:17:45 +00:00
|
|
|
!source "src/prefs.a"
|
2018-02-20 21:37:28 +00:00
|
|
|
!source "src/action.a"
|
2018-03-01 16:06:00 +00:00
|
|
|
!source "src/paintcommon.a"
|
2018-02-20 21:37:28 +00:00
|
|
|
!source "src/paint.a"
|
2018-03-01 16:06:00 +00:00
|
|
|
!source "src/paintoptions.a"
|
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
|
|
|
|
+ !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
|
2018-02-07 21:02:14 +00:00
|
|
|
bit $C010
|
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-01 16:06:00 +00:00
|
|
|
jsr WGInit ; initialize WeeGUI
|
2018-02-01 20:27:33 +00:00
|
|
|
|
2018-02-09 01:38:26 +00:00
|
|
|
jsr LoadGlobalPreferences ; get current game
|
2018-02-07 14:05:24 +00:00
|
|
|
jsr LoadGameInfo ; load and parse game description text
|
2018-02-06 20:32:24 +00:00
|
|
|
|
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
|
|
|
|
.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
|
|
|
|
|
|
|
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
|