Added support for raw characters to WGPrint

- Updated Applesoft sample code
This commit is contained in:
Quinn Dunki 2015-02-03 16:16:05 -08:00
parent 0c12da7c89
commit 36e4157db7
5 changed files with 40 additions and 2 deletions

View File

@ -812,8 +812,13 @@ Prints a string into the current view, at the *local* cursor position. The text
X: WGPrint
PARAM0: Pointer to null-terminated string (LSB)
PARAM1: Pointer to null-terminated string (MSB)
Overflow: If set, characters are printed raw, with no high bit manipulation. Only works in NORMAL mode.
</pre></td><td><pre>
&PRINT("string")
or
&PRINT(raw_character)
</pre></td></tr>
</table>

View File

@ -8,7 +8,6 @@ Known issues
To Do:
------
- Clicking on scroll arrows in basicdemo messes up title rendering
- Write sample code
- Update side effects in assembly API
- Support for frameless views

View File

@ -611,6 +611,10 @@ WGAmpersand_CURSR:
WGAmpersand_PRINT:
jsr WGAmpersandBeginArguments
jsr CHRGOT ; Experimental alternate parameter support
cmp #'"'
bne WGAmpersand_PRINTint
jsr WGAmpersandTempStrArgument
stx PARAM0
sty PARAM1
@ -637,6 +641,24 @@ WGAmpersand_PRINT:
rts
WGAmpersand_PRINTint:
; User passed a non-string, so interpret as an ASCII code
jsr WGAmpersandIntArgument
sta WGAmpersand_PRINTintBuffer
jsr WGAmpersandEndArguments
lda #<WGAmpersand_PRINTintBuffer
sta PARAM0
lda #>WGAmpersand_PRINTintBuffer
sta PARAM1
bit WGAmpersand_PRINTrts ; Set overflow
jsr WGPrint
WGAmpersand_PRINTrts:
rts
WGAmpersand_PRINTintBuffer:
.byte 0,0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGAmpersand_SCR

View File

@ -130,12 +130,22 @@ WGPlot_done:
; cursor position. Clips to current view.
; PARAM0: String pointer, LSB
; PARAM1: String pointer, MSB
; V: If set, characters are printed raw with no high bit alterations
; Side effects: Clobbers SA,BASL,BASH
;
WGPrint:
SAVE_AXY
SAVE_ZPS
lda #%10000000
bvc WGPrint_setupMask
lda #0
clv
WGPrint_setupMask:
sta WGPrint_specialMask
; Start checking clipping boundaries
lda WG_LOCALCURSORY
cmp WG_VIEWCLIP+3
bcs WGPrint_leapDone ; Entire string is below the clip box
@ -220,7 +230,7 @@ WGPrint_visibleChars:
WGPrint_charLoopNormal:
lda (PARAM0),y ; Draw current character
beq WGPrint_done
ora #%10000000
ora WGPrint_specialMask
jsr WGPlot
iny
@ -286,3 +296,5 @@ WGPrint_charLoopInversePlot:
beq WGPrint_endVisible
bra WGPrint_charLoopInverse
WGPrint_specialMask:
.byte 0

Binary file not shown.