diff --git a/applesoft.s b/applesoft.s index 9520c92..246a6bb 100644 --- a/applesoft.s +++ b/applesoft.s @@ -37,6 +37,7 @@ TOKEN_GOSUB = $b0 ; Applesoft's token for GOSUB TOKEN_HOME = $97 ; Applesoft's token for HOME TOKEN_PRINT = $ba ; Applesoft's token for PRINT TOKEN_MINUS = $c9 ; Applesoft's token for a minus sign +TOKEN_DRAW = $94 ; Applesoft's token for DRAW ERR_UNDEFINEDFUNC = 224 ERR_SYNTAX = 16 @@ -710,6 +711,121 @@ WGAmpersand_ERASE: rts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_NRML +; Sets text mode to normal +; &NRML +WGAmpersand_NRML: + jsr WGNormal + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_IVER +; Sets text mode to inverse +; &INVR +WGAmpersand_INVR: + jsr WGInverse + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_FILL +; Fills a rectangle with a character +; &FILL(x,y,width,height,char) +WGAmpersand_FILL: + jsr WGAmpersandBeginArguments + + jsr WGAmpersandIntArgument + sta PARAM0 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM1 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM2 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM3 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + ora #$80 ; Convert to Apple format + pha + + jsr WGAmpersandEndArguments + plx + + jsr WGFillRect + jsr WGBottomCursor + + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_DRAW +; Strokes a rectangle with a character +; &DRAW(x,y,width,height) +WGAmpersand_DRAW: + jsr WGAmpersandBeginArguments + + jsr WGAmpersandIntArgument + sta PARAM0 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM1 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM2 + jsr WGAmpersandNextArgument + + jsr WGAmpersandIntArgument + sta PARAM3 + + jsr WGAmpersandEndArguments + + jsr WGStrokeRect + jsr WGBottomCursor + + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_PNT +; Repaints the selected view +; &PNT +WGAmpersand_PNT: + jsr WGPaintView + jsr WGBottomCursor + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_UNPNT +; Erases the selected view +; &UNPNT +WGAmpersand_UNPNT: + jsr WGEraseView + jsr WGBottomCursor + rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGAmpersand_PNTA +; Repaints all views +; &PNTA +WGAmpersand_PNTA: + jsr WGViewPaintAll + jsr WGBottomCursor + rts + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; WGBottomCursor @@ -801,7 +917,7 @@ WG_STACKPTR: ; A place to save the stack pointer for tricky Applesoft manipulati ; Jump table for ampersand commands. ; Each row is 8 bytes (5 for name, NULL terminator, 2 for address) ; -; Note the strange byte values amidst some strings- this is because +; Note the strange constants in place of some strings- this is because ; all text is tokenized before we receive it, so reserved words may ; be compressed ; @@ -858,6 +974,28 @@ WGAmpersandCommandTable: .byte TOKEN_PRINT,0,0,0,0,0 .addr WGAmpersand_PRINT +.byte "NRML",0,0 +.addr WGAmpersand_NRML + +.byte "INVR",0,0 +.addr WGAmpersand_INVR + +.byte "FILL",0,0 +.addr WGAmpersand_FILL + +.byte TOKEN_DRAW,0,0,0,0,0 +.addr WGAmpersand_DRAW + +.byte "PNT",0,0,0 +.addr WGAmpersand_PNT + +.byte "UNPNT",0 +.addr WGAmpersand_UNPNT + +.byte "PNTA",0,0 +.addr WGAmpersand_PNTA + + ;.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 diff --git a/guidemo.dsk b/guidemo.dsk index e3e23a0..c75b40d 100644 Binary files a/guidemo.dsk and b/guidemo.dsk differ diff --git a/macros.s b/macros.s index c8d8a7e..bd41338 100644 --- a/macros.s +++ b/macros.s @@ -166,10 +166,10 @@ .macro VBL_SYNC ; Synchronize with vertical blanking lda #$80 -macroWaitVBLToFinish: - bit RDVBLBAR - bmi macroWaitVBLToFinish -macroWaitVBLToStart: - bit RDVBLBAR - bpl macroWaitVBLToStart +;macroWaitVBLToFinish: +; bit RDVBLBAR +; bmi macroWaitVBLToFinish +@macroWaitVBLToStart: +; bit RDVBLBAR +; bpl @macroWaitVBLToStart .endmacro diff --git a/rects.s b/rects.s index cc0850e..3392e97 100644 --- a/rects.s +++ b/rects.s @@ -14,7 +14,7 @@ ; PARAM1: Top edge ; PARAM2: Width ; PARAM3: Height -; X: Character to fill +; X: Character to fill (Apple format) ; Side effects: Clobbers BASL,BASH ; WGFillRect: diff --git a/views.s b/views.s index 91faf39..d0fd3d1 100644 --- a/views.s +++ b/views.s @@ -535,20 +535,20 @@ WGEraseView: LDY_ACTIVEVIEW - lda WG_VIEWRECORDS,y ; Fetch the record + lda WG_VIEWRECORDS+0,y dec sta PARAM0 - iny - lda WG_VIEWRECORDS,y + + lda WG_VIEWRECORDS+1,y dec sta PARAM1 - iny - lda WG_VIEWRECORDS,y + + lda WG_VIEWRECORDS+2,y inc inc sta PARAM2 - iny - lda WG_VIEWRECORDS,y + + lda WG_VIEWRECORDS+3,y inc inc sta PARAM3