diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index 6d0886ea..6a395c5d 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -81,7 +81,7 @@ X = hDev # GetDevStatus -## C +## C `int getdevstatus(short int DevID, S.DIB *dstat);` ## ASM @@ -491,14 +491,11 @@ A = Child PSID Load TXT a file in memory (with ending 0) ## C -`int loadtxtfile ( const char * filename, short int flags, short int ftype, int auxtype );` +`int loadtxtfile ( const char * filename );` ## ASM **In:** -`>PUSHW filename` -`>PUSHB flags` -`>PUSHB ftype` -`>PUSHW auxtype` +`>LDYA filename` `>SYSCALL loadtxtfile` ## RETURN VALUE diff --git a/.Floppies/A2OSX.BOOTHD.woz b/.Floppies/A2OSX.BOOTHD.woz index 69024b3c..0b560846 100644 Binary files a/.Floppies/A2OSX.BOOTHD.woz and b/.Floppies/A2OSX.BOOTHD.woz differ diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index a3a5360b..f17b68fd 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/A2OSX.TEST.po b/.Floppies/A2OSX.TEST.po index c4ef4a15..641e4ad9 100644 Binary files a/.Floppies/A2OSX.TEST.po and b/.Floppies/A2OSX.TEST.po differ diff --git a/BIN/ACC.S.txt b/BIN/ACC.S.txt index 3aab5be1..1200c856 100644 --- a/BIN/ACC.S.txt +++ b/BIN/ACC.S.txt @@ -1,218 +1,218 @@ -NEW - AUTO 3,1 - .LIST OFF - .OP 65C02 - .OR $2000 - .TF bin/acc -*-------------------------------------- - .INB inc/macros.i - .INB inc/a2osx.i -*-------------------------------------- -* Zero Page Segment, up to 32 bytes -*-------------------------------------- - .DUMMY - .OR ZPBIN -ZS.START -ZPPtr1 .BS 2 ; address pointer (used in arg parsing) -ArgIndex .BS 1 ; index offset for argument parsing -bFast .BS 1 ; arg variable - fast mode if = 1 -bSlow .BS 1 ; arg variable - slow mode if = 1 -ZS.END .ED -*-------------------------------------- -* File Header (16 Bytes) -*-------------------------------------- -CS.START cld - jmp (.1,x) - .DA #$61 ; 6502,Level 1 (65c02) - .DA #1 ; BIN Layout Version 1 - .DA #0 ; Events disabled (enable with S.PS.F.EVENT) - .DA #0 - .DA CS.END-CS.START ; Code Size (without Constants) - .DA DS.END-DS.START ; Data SegmentSize - .DA #32 ; Stack Size - .DA #ZS.END-ZS.START ; Zero Page Size - .DA 0 -*-------------------------------------- -* Relocation Table -*-------------------------------------- -.1 .DA CS.INIT - .DA CS.RUN - .DA CS.DOEVENT - .DA CS.QUIT -L.MSG.USAGE .DA MSG.USAGE ; msg for usage / help text -L.MSG.FAST .DA MSG.MSG.FAST ; msg for saying fast mode is enabled -L.MSG.SLOW .DA MSG.MSG.SLOW ; msg for saying slow mode is enabled - .DA 0 -*-------------------------------------- -* Called once at process creation -* Put code for loading LIB here -*-------------------------------------- -CS.INIT clc ; nothing to init, so just clc and return - rts -*-------------------------------------- -* Called until exit with CS -* if RUN exits with CC, RN entered again -*-------------------------------------- -CS.RUN -.1 inc ArgIndex ; Check next argument - lda ArgIndex - >SYSCALL ArgV ; check for an arg at index in A - bcs .4 ; If doesn't exist, we're done with args - - >STYA ZPPtr1 ; ArgV pointer was in Y,A so stick into ZPPtr1 - lda (ZPPtr1) - cmp #'-' ; does arg have a hyphen? - bne .9 ; no, we're done as we don't use any non-hyphened args - - jsr CS.RUN.CheckOpt ; if it had a hyphen, check and set arg if recognized - bcc .1 ; if we recognized the arg, then loop again to check next - - -*--- Fast Mode Test ------------------- -.4 - bit bFast ; did they want us to switch to fast mode? - bpl .5 ; no, so go check next possibility - >PUSHW L.MSG.FAST ; push address for fast mode message - >PUSHBI 0 - >SYSCALL PrintF ; print fast mode msg - jsr CS.RUN.SetFastMode ; call fast mode routine - jmp .99 ; jump to successful exit - -*--- Slow mode test ------------------- -.5 - bit bSlow ; did they want us to switch to slow mode? - bpl .9 ; no, so go display usage - >PUSHW L.MSG.SLOW ; push address for slow mode message - >PUSHBI 0 - >SYSCALL PrintF ; print slow mode message - jsr CS.RUN.SetSlowMode ; call slow mode routine - jmp .99 ; jump to successful exit - -*--- Display usage and error out ------ -.9 - >PUSHW L.MSG.USAGE ; push address for usage text - >PUSHBI 0 - >SYSCALL PrintF ; print usage message - lda #E.SYN ; set OS return code as Syntax Error - sec ; indicate we don't want CS.RUN called again - rts ; return to OS - -*--- Successful exit ------------------ -.99 - lda #0 ; set OS return code to success - sec ; indicate we don't want CS.RUN called again - rts ; return to OS -*-------------------------------------- -* Called if option S.PS.F.EVENT enabled in Header -* Timer Event : every 10th seconds -*-------------------------------------- -CS.DOEVENT sec ; we don't use this since we don't have timer events - rts -*-------------------------------------- -* Called once, when RUN exited with CS -* Put code for unloading LIB here -*-------------------------------------- -CS.QUIT clc ; nothing to do on exit except clear carry and return - rts -*-------------------------------------- -* CheckOpt assumes a set ZPPtr1 which is the address of the command line argument being examined. -* We start at 1 to look past the '-' as position 0 since that was checked by the caller. -* OptionList is a list of possible options and each character correlates with a memory offset -* in OptionVars, which are only one byte since they are in ZP but this also allows for us to -* simply use indexed addressing to reference them easily as well instead of doing 16-bit -* address juggling. -* The options are checked in reverse from end-to-start and indexed by X. -*-------------------------------------- -CS.RUN.CheckOpt ldy #1 ; set up y to look at second character of passed in arg - lda (ZPPtr1),y ; check second character of passed in argument into A - ldx #OptionVars-OptionList-1 ; clever way to put size of OptionList into X - -.2 cmp OptionList,x ; compare the arg we got to the OptionList at X - beq .3 ; if it is a match, go handle it. - dex ; if not, decrement so we can check next OptionList - bpl .2 ; if we haven't reached end of OptionList, go check next - sec ; set carry if we didn't find a match - rts ; return to caller - -.3 ldy OptionVars,x ; since we matched, find ZP addr of matching option into Y - lda #$ff ; we will set this ZP option to $FF - sta 0,y ; store A into the ZP address we have in Y - clc ; clear carry since we found a match - rts ; return to caller -*-------------------------------------- -* CS.RUN.SetFastMode -* Calls a few different ways to enable accelerators, mainly ZipChip, Titan, and TransWarp. -* However, it also works for RocketChip as well. -* The first one (using $C05C) came from some documentation, but not sure which accelerator uses it. -*-------------------------------------- -CS.RUN.SetFastMode - sta $C05C ; not sure which accelerator follows this? Not RC at least.. - -* lda #$05 ; enable Titan Accelerator //e fast mode -* sta $C086 ; by storing $05 to $C086 - - lda #$5A ; unlock ZipChip so we can configure it - sta $C05A ; by storing $5A into $C05A 4 times - sta $C05A ; to trigger the unlock latch - sta $C05A - sta $C05A - - lda #0 ; enable ZipChip fast mode by storing #0 - sta $C05B ; into $C05B - - lda #$A5 ; lock ZipChip to prevent more configs - sta $C05A ; by setting $C05A to $A5 - - lda #0 ; enable TransWarp fast mode by storing #0 - sta $C074 ; into $C074 - - rts -*-------------------------------------- -* CS.RUN.SetSlowMode -* Calls a few different ways to disable accelerators, mainly ZipChip, Titan, and TransWarp. -* However, it also works for RocketChip as well. -* The first one (using $C05C) came from some documentation, but not sure which accelerator uses it. -*-------------------------------------- -CS.RUN.SetSlowMode - sta $C05D ; not sure which accelerator follows this? Not RC at least.. - -* lda #$01 ; enable Titan Accelerator //e slow mode -* sta $C086 ; by storing $01 to $C086 - - lda #$5A ; unlock ZipChip so we can configure it - sta $C05A ; by storing $5A into $C05A 4 times - sta $C05A ; to trigger the unlock latch - sta $C05A - sta $C05A - - lda #0 ; disable ZipChip acceleration by setting location - sta $C05A ; $C05A to #0 - - lda #$A5 ; lock ZipChip to prevent more configs - sta $C05A ; by setting $C05A to $A5 - - lda #1 ; disable TransWarp acceleration by storing #1 - sta $C074 ; into $C074 - rts -*-------------------------------------- -CS.END -*-------------------------------------- -MSG.USAGE .AS "Usage : ACC\r\n" - .AS " -F : Fast speed\r\n" - .AZ " -S : Slow speed\r\n" -MSG.MSG.FAST .AZ "FAST mode enabled\r\n" -MSG.MSG.SLOW .AZ "SLOW mode enabled\r\n" -*-------------------------------------- -OptionList .AS "FfSs" -OptionVars .DA #bFast,#bFast,#bSlow,#bSlow -*-------------------------------------- -* Per Process DATA segment (0 filled before INIT) -*-------------------------------------- - .DUMMY - .OR 0 -DS.START -DS.END .ED -*-------------------------------------- -MAN -SAVE usr/src/bin/acc.s -ASM +NEW + AUTO 3,1 + .LIST OFF + .OP 65C02 + .OR $2000 + .TF bin/acc +*-------------------------------------- + .INB inc/macros.i + .INB inc/a2osx.i +*-------------------------------------- +* Zero Page Segment, up to 32 bytes +*-------------------------------------- + .DUMMY + .OR ZPBIN +ZS.START +ZPPtr1 .BS 2 ; address pointer (used in arg parsing) +ArgIndex .BS 1 ; index offset for argument parsing +bFast .BS 1 ; arg variable - fast mode if = 1 +bSlow .BS 1 ; arg variable - slow mode if = 1 +ZS.END .ED +*-------------------------------------- +* File Header (16 Bytes) +*-------------------------------------- +CS.START cld + jmp (.1,x) + .DA #$61 ; 6502,Level 1 (65c02) + .DA #1 ; BIN Layout Version 1 + .DA #0 ; Events disabled (enable with S.PS.F.EVENT) + .DA #0 + .DA CS.END-CS.START ; Code Size (without Constants) + .DA DS.END-DS.START ; Data SegmentSize + .DA #32 ; Stack Size + .DA #ZS.END-ZS.START ; Zero Page Size + .DA 0 +*-------------------------------------- +* Relocation Table +*-------------------------------------- +.1 .DA CS.INIT + .DA CS.RUN + .DA CS.DOEVENT + .DA CS.QUIT +L.MSG.USAGE .DA MSG.USAGE ; msg for usage / help text +L.MSG.FAST .DA MSG.MSG.FAST ; msg for saying fast mode is enabled +L.MSG.SLOW .DA MSG.MSG.SLOW ; msg for saying slow mode is enabled + .DA 0 +*-------------------------------------- +* Called once at process creation +* Put code for loading LIB here +*-------------------------------------- +CS.INIT clc ; nothing to init, so just clc and return + rts +*-------------------------------------- +* Called until exit with CS +* if RUN exits with CC, RN entered again +*-------------------------------------- +CS.RUN +.1 inc ArgIndex ; Check next argument + lda ArgIndex + >SYSCALL ArgV ; check for an arg at index in A + bcs .4 ; If doesn't exist, we're done with args + + >STYA ZPPtr1 ; ArgV pointer was in Y,A so stick into ZPPtr1 + lda (ZPPtr1) + cmp #'-' ; does arg have a hyphen? + bne .9 ; no, we're done as we don't use any non-hyphened args + + jsr CS.RUN.CheckOpt ; if it had a hyphen, check and set arg if recognized + bcc .1 ; if we recognized the arg, then loop again to check next + + +*--- Fast Mode Test ------------------- +.4 + bit bFast ; did they want us to switch to fast mode? + bpl .5 ; no, so go check next possibility + >PUSHW L.MSG.FAST ; push address for fast mode message + >PUSHBI 0 + >SYSCALL PrintF ; print fast mode msg + jsr CS.RUN.SetFastMode ; call fast mode routine + jmp .99 ; jump to successful exit + +*--- Slow mode test ------------------- +.5 + bit bSlow ; did they want us to switch to slow mode? + bpl .9 ; no, so go display usage + >PUSHW L.MSG.SLOW ; push address for slow mode message + >PUSHBI 0 + >SYSCALL PrintF ; print slow mode message + jsr CS.RUN.SetSlowMode ; call slow mode routine + jmp .99 ; jump to successful exit + +*--- Display usage and error out ------ +.9 + >PUSHW L.MSG.USAGE ; push address for usage text + >PUSHBI 0 + >SYSCALL PrintF ; print usage message + lda #E.SYN ; set OS return code as Syntax Error + sec ; indicate we don't want CS.RUN called again + rts ; return to OS + +*--- Successful exit ------------------ +.99 + lda #0 ; set OS return code to success + sec ; indicate we don't want CS.RUN called again + rts ; return to OS +*-------------------------------------- +* Called if option S.PS.F.EVENT enabled in Header +* Timer Event : every 10th seconds +*-------------------------------------- +CS.DOEVENT sec ; we don't use this since we don't have timer events + rts +*-------------------------------------- +* Called once, when RUN exited with CS +* Put code for unloading LIB here +*-------------------------------------- +CS.QUIT clc ; nothing to do on exit except clear carry and return + rts +*-------------------------------------- +* CheckOpt assumes a set ZPPtr1 which is the address of the command line argument being examined. +* We start at 1 to look past the '-' as position 0 since that was checked by the caller. +* OptionList is a list of possible options and each character correlates with a memory offset +* in OptionVars, which are only one byte since they are in ZP but this also allows for us to +* simply use indexed addressing to reference them easily as well instead of doing 16-bit +* address juggling. +* The options are checked in reverse from end-to-start and indexed by X. +*-------------------------------------- +CS.RUN.CheckOpt ldy #1 ; set up y to look at second character of passed in arg + lda (ZPPtr1),y ; check second character of passed in argument into A + ldx #OptionVars-OptionList-1 ; clever way to put size of OptionList into X + +.2 cmp OptionList,x ; compare the arg we got to the OptionList at X + beq .3 ; if it is a match, go handle it. + dex ; if not, decrement so we can check next OptionList + bpl .2 ; if we haven't reached end of OptionList, go check next + sec ; set carry if we didn't find a match + rts ; return to caller + +.3 ldy OptionVars,x ; since we matched, find ZP addr of matching option into Y + lda #$ff ; we will set this ZP option to $FF + sta 0,y ; store A into the ZP address we have in Y + clc ; clear carry since we found a match + rts ; return to caller +*-------------------------------------- +* CS.RUN.SetFastMode +* Calls a few different ways to enable accelerators, mainly ZipChip, Titan, and TransWarp. +* However, it also works for RocketChip as well. +* The first one (using $C05C) came from some documentation, but not sure which accelerator uses it. +*-------------------------------------- +CS.RUN.SetFastMode + sta $C05C ; not sure which accelerator follows this? Not RC at least.. + +* lda #$05 ; enable Titan Accelerator //e fast mode +* sta $C086 ; by storing $05 to $C086 + + lda #$5A ; unlock ZipChip so we can configure it + sta $C05A ; by storing $5A into $C05A 4 times + sta $C05A ; to trigger the unlock latch + sta $C05A + sta $C05A + + lda #0 ; enable ZipChip fast mode by storing #0 + sta $C05B ; into $C05B + + lda #$A5 ; lock ZipChip to prevent more configs + sta $C05A ; by setting $C05A to $A5 + + lda #0 ; enable TransWarp fast mode by storing #0 + sta $C074 ; into $C074 + + rts +*-------------------------------------- +* CS.RUN.SetSlowMode +* Calls a few different ways to disable accelerators, mainly ZipChip, Titan, and TransWarp. +* However, it also works for RocketChip as well. +* The first one (using $C05C) came from some documentation, but not sure which accelerator uses it. +*-------------------------------------- +CS.RUN.SetSlowMode + sta $C05D ; not sure which accelerator follows this? Not RC at least.. + +* lda #$01 ; enable Titan Accelerator //e slow mode +* sta $C086 ; by storing $01 to $C086 + + lda #$5A ; unlock ZipChip so we can configure it + sta $C05A ; by storing $5A into $C05A 4 times + sta $C05A ; to trigger the unlock latch + sta $C05A + sta $C05A + + lda #0 ; disable ZipChip acceleration by setting location + sta $C05A ; $C05A to #0 + + lda #$A5 ; lock ZipChip to prevent more configs + sta $C05A ; by setting $C05A to $A5 + + lda #1 ; disable TransWarp acceleration by storing #1 + sta $C074 ; into $C074 + rts +*-------------------------------------- +CS.END +*-------------------------------------- +MSG.USAGE .AS "Usage : ACC\r\n" + .AS " -F : Fast speed\r\n" + .AZ " -S : Slow speed\r\n" +MSG.MSG.FAST .AZ "FAST mode enabled\r\n" +MSG.MSG.SLOW .AZ "SLOW mode enabled\r\n" +*-------------------------------------- +OptionList .AS "FfSs" +OptionVars .DA #bFast,#bFast,#bSlow,#bSlow +*-------------------------------------- +* Per Process DATA segment (0 filled before INIT) +*-------------------------------------- + .DUMMY + .OR 0 +DS.START +DS.END .ED +*-------------------------------------- +MAN +SAVE usr/src/bin/acc.s +ASM diff --git a/BIN/ATLOGON.S.txt b/BIN/ATLOGON.S.txt index 7f66687e..bde85ca2 100644 --- a/BIN/ATLOGON.S.txt +++ b/BIN/ATLOGON.S.txt @@ -47,7 +47,7 @@ CS.INIT clc rts *-------------------------------------- CS.RUN ldy #S.PS.ARGC - lda (pPs),y + lda (pPS),y beq CS.RUN.USAGE jsr CS.RUN.GetInfo diff --git a/BIN/CSH.S.txt b/BIN/CSH.S.txt index c6a8002c..8afc4943 100644 --- a/BIN/CSH.S.txt +++ b/BIN/CSH.S.txt @@ -170,11 +170,7 @@ CS.RUN.ARGS inc ArgIndex sec QUIT Process rts *-------------------------------------- -CS.RUN.LoadFile >PUSHYA - >PUSHBI O.RDONLY - >PUSHBI S.FI.T.TXT - >PUSHWZ Aux type - >SYSCALL LoadTxtFile +CS.RUN.LoadFile >SYSCALL LoadTxtFile bcs .9 phx diff --git a/BIN/CUT.S.txt b/BIN/CUT.S.txt index 04b69904..19b39936 100644 --- a/BIN/CUT.S.txt +++ b/BIN/CUT.S.txt @@ -140,9 +140,13 @@ CS.RUN lda #C.SPACE .80 ldy #S.PS.hStdIn lda (pPS),y tax - lda OF.Table.hFD-1,x + lsr + bcs .97 + + lda Nod.Table.hFD-2,x >SYSCALL GetMemPtr >STYA ZPPtr1 + lda (ZPPtr1) cmp #S.FD.T.PIPE bne .97 diff --git a/BIN/FORMAT.S.txt b/BIN/FORMAT.S.txt index 26695ad6..0b121abe 100644 --- a/BIN/FORMAT.S.txt +++ b/BIN/FORMAT.S.txt @@ -8,7 +8,6 @@ NEW .INB inc/macros.i .INB inc/a2osx.i .INB inc/mli.e.i - .INB inc/kernel.i .INB inc/libblkdev.i *-------------------------------------- .DUMMY @@ -768,7 +767,7 @@ Disk2.XD .DA 640 BlkCnt Disk2.HD .DA 1280 BlkCnt .DA #80 TrkCnt .DA #2 Stepping - .DA ##194 VolNum + .DA #194 VolNum .DA #$80 AltBB .DA #1 HeadCnt .BS 1 @@ -776,7 +775,7 @@ Disk2.HD .DA 1280 BlkCnt Disk2.HXD .DA 1280 BlkCnt .DA #80 TrkCnt .DA #2 Stepping - .DA ##194 VolNum + .DA #194 VolNum .DA #$80 AltBB .DA #1 HeadCnt .BS 1 diff --git a/BIN/FORTH.S.GFX.txt b/BIN/FORTH.S.GFX.txt new file mode 100644 index 00000000..ff2c8b88 --- /dev/null +++ b/BIN/FORTH.S.GFX.txt @@ -0,0 +1,109 @@ +NEW + AUTO 3,1 +*-------------------------------------- +GFX.Open >PUSHBI 0 + >LDYA L.DEV.GFX + >SYSCALL Open + bcs .9 + + >STA.G hDevGFX + +* ldy #S.PS.hStdIn +* lda (pPS),y +* >SYSCALL GetMemPtr +* >STYA ZPPtr1 + +* ldy #S.FD.DEV.DEVID +* lda (ZPPtr1),y + +* >PUSHA +* >PUSHBI IOCTL.CONTROL +* >PUSHWI 0 +* >SYSCALL IOCTL + +.9 rts +*-------------------------------------- +GFX.Close >LDA.G hDevGFX + beq .9 + + >SYSCALL Close + +.9 rts +*-------------------------------------- +* (Y X C) +*-------------------------------------- +GFX.PLOT lda #S.CB.CMD.SETPIXEL + >STA.G GFX.CB+S.CB.CMD + lda #S.CB.OP.SET + >STA.G GFX.CB+S.CB.OP + lda #S.CB.M.C16 + >STA.G GFX.CB+S.CB.M + + >PULLA + >STA.G GFX.CB+S.CB.COLOR + + >PULLA + + ldx #4 + ldy #GFX.CB+S.CB.X1+3 + +.1 >PULLA + sta (pData),y + dey + dex + bne .1 + + >PUSHB.G hDevGFX + >PUSHBI IOCTL.WRITE + >PUSHEA.G GFX.CB + >SYSCALL IOCTL + + lda pStack + clc + adc #6 + sta pStack + + rts +*-------------------------------------- +* (Y2 X2 Y1 X1 C) +*-------------------------------------- +GFX.RECT lda #S.CB.CMD.FILLRECT + >STA.G GFX.CB+S.CB.CMD + lda #S.CB.OP.SET + >STA.G GFX.CB+S.CB.OP + lda #S.CB.M.C16 + >STA.G GFX.CB+S.CB.M + + >PULLA + >STA.G GFX.CB+S.CB.COLOR + + >PULLA + + ldx #8 + ldy #GFX.CB+S.CB.X1+7 + +.1 >PULLA + sta (pData),y + dey + dex + bne .1 + + >PUSHB.G hDevGFX + >PUSHBI IOCTL.WRITE + >PUSHEA.G GFX.CB + >SYSCALL IOCTL + + lda pStack + clc + adc #10 + sta pStack + + rts +*-------------------------------------- +*-------------------------------------- +*-------------------------------------- +*-------------------------------------- +MAN +SAVE usr/src/bin/forth.s.gfx +LOAD usr/src/bin/forth.s +ASM diff --git a/BIN/FORTH.S.KW.txt b/BIN/FORTH.S.KW.txt index a8c50514..19356fe5 100644 --- a/BIN/FORTH.S.KW.txt +++ b/BIN/FORTH.S.KW.txt @@ -4,9 +4,6 @@ NEW KW.Lookup >LDYA L.KEYWORDS >STYA ZPPtr1 - >LDYA ZPCLBufPtr - >STYA ZPPtr2 - ldx #0 .1 ldy #$ff @@ -51,7 +48,7 @@ KW.Lookup >LDYA L.KEYWORDS rts .7 iny - lda (ZPPtr2),y Get Src text char... + lda (ZPCLBufPtr),y Get Src text char... beq .9 end of text jmp IsSpaceOrCR CS=end of valid chars @@ -761,7 +758,7 @@ KW.PRINT >LDYAI 256 >SYSCALL PutS pla - >SYSCALL freemem + >SYSCALL FreeMem .9 rts *-------------------------------------- diff --git a/BIN/FORTH.S.txt b/BIN/FORTH.S.txt index 85f428a9..5e82b897 100644 --- a/BIN/FORTH.S.txt +++ b/BIN/FORTH.S.txt @@ -9,6 +9,7 @@ NEW .INB inc/a2osx.i .INB inc/mli.i .INB inc/mli.e.i + .INB inc/gfx.i *-------------------------------------- CODE.SIZE .EQ 2048 DATA.SIZE .EQ 2048 @@ -73,6 +74,7 @@ CS.START cld .DA CS.RUN .DA CS.DOEVENT .DA CS.QUIT +L.DEV.GFX .DA DEV.GFX L.MSG.GREETINGS .DA MSG.GREETINGS L.MSG.USAGE .DA MSG.USAGE L.MSG.ECHOCRLF .DA MSG.ECHOCRLF @@ -94,7 +96,9 @@ J.ESC .DA CL.BS left arrow * .DA HIS.GetPrev .DA CL.NAK right arrow L.KEYWORDS .DA KEYWORDS -J.KEYWORDS .DA KW.DUP +J.KEYWORDS .DA GFX.PLOT + .DA GFX.RECT + .DA KW.DUP .DA KW.DROP .DA KW.SWAP J.KEYWORDS.OVER .DA KW.OVER @@ -262,6 +266,8 @@ CS.RUN >PUSHW L.MSG.GREETINGS stz bCompile lda #127 sta RP + + jsr GFX.Open *-------------------------------------- CS.RUN.LOOP >SLEEP @@ -359,7 +365,7 @@ CS.FORTH.Run.File >PUSHW ZPCLBuf >LDA.G hFile - >SYSCALL fgets + >SYSCALL FGetS bcs .9 >LDA.G bTrace @@ -577,7 +583,9 @@ CS.RUN.GetNum >PUSHW ZPCLBufPtr CS.DOEVENT sec rts *-------------------------------------- -CS.QUIT >LDA.G hSList +CS.QUIT jsr GFX.Close + + >LDA.G hSList beq .1 >PUSHA @@ -766,9 +774,11 @@ CheckStackPop4 lda pStack .INB usr/src/bin/forth.s.cl .INB usr/src/bin/forth.s.cp .INB usr/src/bin/forth.s.kw + .INB usr/src/bin/forth.s.gfx *-------------------------------------- CS.END *-------------------------------------- +DEV.GFX .AZ "/dev/gfx" MSG.GREETINGS .AZ "\e[?7h\r\nA2osX-FORTH %d.%d (figFORTH)\r\n" MSG.USAGE .AS "Usage : FORTH