2018-03-01 16:06:00 +00:00
|
|
|
;license:MIT
|
|
|
|
;(c) 2018 by 4am
|
|
|
|
;
|
|
|
|
; User interface - common views and paint routines across screens
|
|
|
|
;
|
|
|
|
; Public functions
|
|
|
|
; - CreateRadio
|
|
|
|
; - CreateCheckbox
|
|
|
|
; - CreateButton
|
2018-04-01 16:21:48 +00:00
|
|
|
; - PaintTitleBar
|
2018-03-01 16:06:00 +00:00
|
|
|
;
|
|
|
|
|
2018-03-27 21:17:47 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; CreateRadio/CreateCheckbox/CreateButton
|
|
|
|
; creates a WeeGUI UI control with the 'raw title' option set
|
|
|
|
;
|
|
|
|
; in: stack contains 2 bytes of parameters:
|
|
|
|
; +1 [word] pointer to WeeGUI view configuration block
|
|
|
|
; out: $00/$01 clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;------------------------------------------------------------------------------
|
2018-04-01 16:21:48 +00:00
|
|
|
!zone {
|
2018-03-01 16:06:00 +00:00
|
|
|
CreateRadio
|
|
|
|
ldx #WGCreateRadio
|
|
|
|
!byte $2C ; hide next 2 bytes
|
|
|
|
CreateCheckbox
|
|
|
|
ldx #WGCreateCheckbox
|
|
|
|
!byte $2C ; hide next 2 bytes
|
|
|
|
CreateButton
|
|
|
|
ldx #WGCreateButton
|
2018-03-26 18:57:06 +00:00
|
|
|
stx .type
|
|
|
|
|
|
|
|
+PARAMS_ON_STACK 2
|
|
|
|
|
2018-03-01 16:06:00 +00:00
|
|
|
ldy #$01
|
2018-04-01 16:21:48 +00:00
|
|
|
lda (PARAM),y
|
2018-03-01 16:06:00 +00:00
|
|
|
sta PARAM0
|
|
|
|
iny
|
2018-04-01 16:21:48 +00:00
|
|
|
lda (PARAM),y
|
2018-03-01 16:06:00 +00:00
|
|
|
sta PARAM1
|
2018-03-26 18:57:06 +00:00
|
|
|
.type=*+1
|
2018-03-28 15:48:47 +00:00
|
|
|
ldx #$FD ; SMC
|
2018-03-01 16:06:00 +00:00
|
|
|
jsr WeeGUI
|
|
|
|
ldx #WGViewSetRawTitle
|
|
|
|
lda #1
|
|
|
|
sta PARAM0
|
|
|
|
jmp WeeGUI
|
2018-04-01 16:21:48 +00:00
|
|
|
}
|
|
|
|
|
2018-03-27 21:17:47 +00:00
|
|
|
;------------------------------------------------------------------------------
|
2018-04-01 16:21:48 +00:00
|
|
|
; PaintTitleBar
|
2018-03-27 21:17:47 +00:00
|
|
|
; paints the title bar
|
|
|
|
;
|
|
|
|
; in: none
|
2018-04-01 16:21:48 +00:00
|
|
|
; out: all registers and flags clobbered
|
2018-03-27 21:17:47 +00:00
|
|
|
;------------------------------------------------------------------------------
|
2018-04-01 16:21:48 +00:00
|
|
|
!zone {
|
|
|
|
PaintTitleBar
|
|
|
|
ldy #79
|
|
|
|
- sty PARAM0
|
|
|
|
stz PARAM1
|
|
|
|
ldx #WGSetGlobalCursor
|
2018-03-01 16:06:00 +00:00
|
|
|
jsr WeeGUI
|
2018-04-01 16:21:48 +00:00
|
|
|
ldx #WGPlot
|
|
|
|
lda .stringTitle,y
|
2018-03-01 16:06:00 +00:00
|
|
|
jsr WeeGUI
|
2018-04-01 16:21:48 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
|
|
|
ldx #WGSyncGlobalCursor
|
|
|
|
jmp WeeGUI
|
2018-03-01 16:06:00 +00:00
|
|
|
|
|
|
|
.stringTitle
|
2018-04-01 16:21:48 +00:00
|
|
|
!raw " "
|
|
|
|
!byte 16
|
|
|
|
!raw "itch "
|
|
|
|
!byte 4
|
|
|
|
!raw "ark ",0
|
2018-03-26 20:28:20 +00:00
|
|
|
}
|