mirror of
https://github.com/blondie7575/WeeGUI.git
synced 2024-12-12 09:29:03 +00:00
Added support for raw bytes in view titles
This commit is contained in:
parent
14d8928d17
commit
5cb58f44dc
@ -695,7 +695,7 @@ Sets the currently selected view's value. Currently only useful for progress bar
|
||||
|
||||
<table width="100%">
|
||||
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
|
||||
X: WGSetState
|
||||
X: WGSetValue
|
||||
A: new value
|
||||
</td><td>
|
||||
&SETV(value)
|
||||
@ -703,6 +703,19 @@ A: new value
|
||||
</table>
|
||||
|
||||
|
||||
####WGViewSetRawTitle
|
||||
Sets the currently selected view's title to be rendered in raw bytes (or not). This allows some advanced tricks with using Mousetext and mixed inversion in view titles.
|
||||
|
||||
<table width="100%">
|
||||
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
|
||||
X: WGSetRawTitle
|
||||
PARAM0: 0 or 1
|
||||
</td><td>
|
||||
&STRW(0 or 1)
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
Cursor Routines
|
||||
|
2
Makefile
2
Makefile
@ -11,7 +11,7 @@
|
||||
|
||||
CL65=cl65
|
||||
AC=AppleCommander.jar
|
||||
ADDR=7b00
|
||||
ADDR=7a00
|
||||
ADDRDEMO=6000
|
||||
|
||||
PGM=weegui
|
||||
|
@ -21,7 +21,7 @@ PARAM3 = $09
|
||||
; WeeGUI entry point
|
||||
; Set up your call, then do a JSR to this address.
|
||||
;
|
||||
WeeGUI = $7b04 ; 7c00
|
||||
WeeGUI = $7a04
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@ -68,5 +68,5 @@ WGEraseView = 68
|
||||
WGExit = 70
|
||||
WGCreateProgress = 72
|
||||
WGSetState = 74
|
||||
|
||||
WGViewSetRawTitle = 76
|
||||
|
||||
|
25
applesoft.s
25
applesoft.s
@ -549,6 +549,28 @@ WGAmpersand_SETV:
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGAmpersand_STRW
|
||||
; Sets the "raw title" flag on the selected view
|
||||
; &STRW(0/1)
|
||||
WGAmpersand_STRW:
|
||||
jsr WGAmpersandBeginArguments
|
||||
|
||||
jsr WGAmpersandIntArgument
|
||||
pha
|
||||
|
||||
jsr WGAmpersandEndArguments
|
||||
|
||||
pla
|
||||
sta PARAM0
|
||||
jsr WGViewSetRawTitle
|
||||
|
||||
jsr WGPaintView
|
||||
jsr WGBottomCursor
|
||||
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGAmpersand_BUTTN
|
||||
; Create a button
|
||||
@ -1285,6 +1307,9 @@ WGAmpersandCommandTable:
|
||||
.byte "SETV",0,0
|
||||
.addr WGAmpersand_SETV
|
||||
|
||||
.byte "STRW",0,0
|
||||
.addr WGAmpersand_STRW
|
||||
|
||||
;.byte TOKEN_GOSUB,0,0,0,0,0,0,0,0,0,0,0,0,0 ; For internal testing of the procedural gosub
|
||||
;.addr WGAmpersand_GOSUB
|
||||
|
||||
|
1
memory.s
1
memory.s
@ -24,6 +24,7 @@ VIEW_STYLE_BUTTON = $05
|
||||
VIEW_STYLE_TAKESFOCUS = $04 ; Styles >= this one are selectable
|
||||
|
||||
VIEW_STYLE_APPLESOFT = $80 ; High nybble flag bit for views created from Applesoft
|
||||
VIEW_STYLE_RAWTITLE = $40 ; High nybble flag bit for views with raw titles
|
||||
|
||||
IRQVECTORL = $03fe
|
||||
IRQVECTORH = $03ff
|
||||
|
@ -138,12 +138,15 @@ WGPrint:
|
||||
SAVE_ZPS
|
||||
|
||||
lda #%10000000
|
||||
ldx #%00111111
|
||||
bvc WGPrint_setupMask
|
||||
lda #0
|
||||
ldx #$ff
|
||||
clv
|
||||
|
||||
WGPrint_setupMask:
|
||||
sta WGPrint_specialMask
|
||||
stx WGPrint_setupMaskInverse
|
||||
|
||||
; Start checking clipping boundaries
|
||||
lda WG_LOCALCURSORY
|
||||
@ -280,7 +283,7 @@ WGPrint_charLoopInverse:
|
||||
bra WGPrint_charLoopInversePlot
|
||||
|
||||
WGPrint_charLoopInverseLow:
|
||||
and #%00111111 ; Normal inverse
|
||||
and WGPrint_setupMaskInverse ; Normal inverse
|
||||
|
||||
WGPrint_charLoopInversePlot:
|
||||
jsr WGPlot
|
||||
@ -298,3 +301,5 @@ WGPrint_charLoopInversePlot:
|
||||
|
||||
WGPrint_specialMask:
|
||||
.byte 0
|
||||
WGPrint_setupMaskInverse:
|
||||
.byte 0
|
||||
|
62
views.s
62
views.s
@ -457,6 +457,10 @@ paintCheck_plot: ; Paint our state
|
||||
sta PARAM1
|
||||
ldy #0
|
||||
|
||||
lda WG_VIEWRECORDS+4,y ; Raw or Apple format title?
|
||||
and #VIEW_STYLE_RAWTITLE
|
||||
bne paintCheck_titleRawLoop
|
||||
|
||||
paintCheck_titleLoop:
|
||||
lda (PARAM0),y
|
||||
beq paintCheck_done
|
||||
@ -466,12 +470,19 @@ paintCheck_titleLoop:
|
||||
iny
|
||||
bra paintCheck_titleLoop
|
||||
|
||||
paintCheck_titleRawLoop:
|
||||
lda (PARAM0),y
|
||||
beq paintCheck_done
|
||||
jsr WGPlot
|
||||
inc WG_CURSORX
|
||||
iny
|
||||
bra paintCheck_titleLoop
|
||||
|
||||
paintCheck_done:
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; paintProgress
|
||||
; Paints the contents of a progress bar
|
||||
; Y: Index into view records of progress bar to paint
|
||||
@ -568,6 +579,14 @@ paintButton_titleMarginLeftLoop:
|
||||
jmp paintButton_titleMarginLeftLoop
|
||||
|
||||
paintButton_title:
|
||||
pha
|
||||
lda WG_VIEWRECORDS+4,y ; Raw or Apple format title?
|
||||
and #VIEW_STYLE_RAWTITLE
|
||||
beq paintButton_titleApple
|
||||
bit paintButton_doneRTS ; Set overflow
|
||||
|
||||
paintButton_titleApple:
|
||||
pla
|
||||
jsr WGPrint
|
||||
ldx WG_VIEWRECORDS+2,y
|
||||
stx SCRATCH1 ; Loop until right edge of button is reached
|
||||
@ -585,6 +604,8 @@ paintButton_titleMarginRightLoop:
|
||||
paintButton_done:
|
||||
pla ; Restore inverse state
|
||||
sta INVERSE
|
||||
|
||||
paintButton_doneRTS:
|
||||
rts
|
||||
|
||||
|
||||
@ -620,15 +641,28 @@ paintWindowTitle_compute:
|
||||
sta WG_CURSORY
|
||||
|
||||
ldy #0
|
||||
|
||||
lda WG_VIEWRECORDS+4,y ; Raw or Apple format title?
|
||||
and #VIEW_STYLE_RAWTITLE
|
||||
bne paintWindowTitleRawLoop
|
||||
|
||||
paintWindowTitleLoop:
|
||||
lda (PARAM0),y
|
||||
beq paintWindowTitle_done
|
||||
ora #%10000000
|
||||
ora #$80
|
||||
jsr WGPlot ; Draw the character
|
||||
iny
|
||||
inc WG_CURSORX ; Advance cursors
|
||||
bra paintWindowTitleLoop
|
||||
|
||||
paintWindowTitleRawLoop:
|
||||
lda (PARAM0),y
|
||||
beq paintWindowTitle_done
|
||||
jsr WGPlot ; Draw the character
|
||||
iny
|
||||
inc WG_CURSORX ; Advance cursors
|
||||
bra paintWindowTitleRawLoop
|
||||
|
||||
paintWindowTitle_done:
|
||||
rts
|
||||
|
||||
@ -1126,6 +1160,30 @@ WGViewSetAction_done:
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGViewSetRawTitle
|
||||
; Sets the raw title flag of the active view
|
||||
; PARAM0: Flag to set
|
||||
WGViewSetRawTitle:
|
||||
SAVE_AY
|
||||
|
||||
LDY_ACTIVEVIEW
|
||||
lda PARAM0
|
||||
asl ; Shifts need to match VIEW_STYLE_RAWTITLE
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
eor WG_VIEWRECORDS+4,y
|
||||
sta WG_VIEWRECORDS+4,y
|
||||
|
||||
WGViewSetRawTitle_done:
|
||||
RESTORE_AY
|
||||
rts
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGSetCursor
|
||||
; Sets the current local view cursor
|
||||
|
BIN
weegui.dsk
BIN
weegui.dsk
Binary file not shown.
11
weegui.s
11
weegui.s
@ -7,7 +7,7 @@
|
||||
;
|
||||
|
||||
|
||||
.org $7b00
|
||||
.org $7a00
|
||||
|
||||
; Common definitions
|
||||
|
||||
@ -23,11 +23,6 @@ main:
|
||||
rts ; Don't add any bytes here!
|
||||
|
||||
|
||||
; This is the non-negotiable entry point used by applications Don't move it!
|
||||
; $7e04
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGDispatch
|
||||
; The dispatcher for calling the assembly-language API from assembly programs
|
||||
@ -76,6 +71,8 @@ WGEntryPointTable:
|
||||
.addr WGExit
|
||||
.addr WGCreateProgress
|
||||
.addr WGSetState
|
||||
.addr WGViewSetRawTitle
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; WGInit
|
||||
@ -113,7 +110,7 @@ WGInit:
|
||||
tsb MEMBITMAP + $12
|
||||
|
||||
; Protect us from Applesoft by setting up HIMEM
|
||||
lda #$7a ; 7b00 (really 7aff)
|
||||
lda #$79 ; 7a00 (really 79ff)
|
||||
sta LINNUMH
|
||||
lda #$ff
|
||||
sta LINNUML
|
||||
|
Loading…
Reference in New Issue
Block a user