1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-08-08 09:25:19 +00:00

BIG update to expand eval stack to 32. These are the dependencies:

This commit is contained in:
David Schmenk
2024-12-27 10:10:11 -08:00
parent b776452157
commit ad03eff0eb
11 changed files with 42 additions and 44 deletions

View File

@@ -540,8 +540,7 @@ def rgbImportExport(rgbfile, dhgrfile)#0
rgbErr=>[GRN] = -1 rgbErr=>[GRN] = -1
rgbErr=>[BLU] = -1 rgbErr=>[BLU] = -1
memset(rgbScanline, 0, 563 * 3) memset(rgbScanline, 0, 563 * 3)
//for j = 0 to 191 I seem to have overflowed the stack for j = 0 to 191
j = 0; repeat
fileio:read(refnum, rgbScanline, 560 * 3) fileio:read(refnum, rgbScanline, 560 * 3)
memset(@ntscCycle, GREY_CHROMA, 24) // Reset chroma cycle memset(@ntscCycle, GREY_CHROMA, 24) // Reset chroma cycle
rgbptr = rgbScanline rgbptr = rgbScanline
@@ -568,11 +567,10 @@ def rgbImportExport(rgbfile, dhgrfile)#0
errptr = errptr + 3 * 2 errptr = errptr + 3 * 2
next next
if flags & MEM_MODE; putc('.'); fin if flags & MEM_MODE; putc('.'); fin
//if ^$C000 == $83 if ^$C000 == $83
// break break
//fin fin
//next next
j++; until j == 192 or ^$C000 == $83
fileio:close(refnum) fileio:close(refnum)
if ^dhgrfile if ^dhgrfile
if flags & MEM_MODE if flags & MEM_MODE

View File

@@ -2,7 +2,7 @@ import cmdsys
// //
// Useful values for everyone // Useful values for everyone
// //
const _SYSVER_ = $0211 // Version built against const _SYSVER_ = $0220 // Version built against
const FALSE = 0 const FALSE = 0
const TRUE = not FALSE const TRUE = not FALSE
const NULL = 0 const NULL = 0

View File

@@ -1,4 +1,4 @@
import longjmp import longjmp
const t_except = $0140 const t_except = $0180
predef except(env), throw(env, retval) predef except(env), throw(env, retval)
end end

View File

@@ -18,10 +18,10 @@ end
const jitcomp = $03E2 const jitcomp = $03E2
const jitcodeptr = $03E4 const jitcodeptr = $03E4
const codemax = $BEE0 const codemax = $BEE0
const estkh8 = $C000 const estkh8 = $A000
const estkh = $00C0 const estkh = $00A0
const estkl8 = $D000 const estkl8 = $C000
const estkl = $00D0 const estkl = $00C0
const ifpl8 = $E000 const ifpl8 = $E000
const ifph8 = $E100 const ifph8 = $E100
const jmptmp = $00E6 const jmptmp = $00E6

View File

@@ -18,10 +18,10 @@ end
const jitcomp = $03E2 const jitcomp = $03E2
const jitcodeptr = $03E4 const jitcodeptr = $03E4
const codemax = $BEE0 const codemax = $BEE0
const estkh8 = $C000 const estkh8 = $A000
const estkh = $00C0 const estkh = $00A0
const estkl8 = $D000 const estkl8 = $C000
const estkl = $00D0 const estkl = $00C0
const ifp8 = $E000 const ifp8 = $E000
const ifpl8 = $E000 const ifpl8 = $E000
const ifph8 = $E100 const ifph8 = $E100

View File

@@ -24,8 +24,8 @@ export byte fbrCount = 0
// Zero Page VM state and 6502 stack // Zero Page VM state and 6502 stack
// //
struc t_vm struc t_vm
byte estkhi[$10] byte estkhi[$20]
byte estklo[$10] byte estklo[$20]
word ifp word ifp
word pp word pp
byte hwsp byte hwsp
@@ -55,7 +55,7 @@ asm fbrSwap(saveVM, restoreVM)#0
STX ESP STX ESP
TSX TSX
STX HWSP STX HWSP
LDY #$26 LDY #$46
- LDA ESTK,Y - LDA ESTK,Y
STA (DST),Y STA (DST),Y
LDA (SRC),Y LDA (SRC),Y
@@ -86,7 +86,7 @@ asm fbrLoad(loadVM)#0
STA SRCL STA SRCL
LDA ESTKH,X LDA ESTKH,X
STA SRCH STA SRCH
LDY #$26 LDY #$46
- LDA (SRC),Y - LDA (SRC),Y
STA ESTK,Y STA ESTK,Y
DEY DEY

View File

@@ -41,14 +41,14 @@ byte curstar, buzz
//asm spkrTone(pitch, duration)#0 //asm spkrTone(pitch, duration)#0
byte _spkrTone[] byte _spkrTone[]
byte = $86, $E5 // STX ESP byte = $86, $E5 // STX ESP
byte = $B4, $C0 // LDY ESTKH,X byte = $B4, $A0 // LDY ESTKH,X
byte = $B5, $D0 // LDA ESTKL,X byte = $B5, $C0 // LDA ESTKL,X
byte = $F0, $01 // BEQ +1 byte = $F0, $01 // BEQ +1
byte = $C8 // INY byte = $C8 // INY
byte = $85, $08 // STA DSTL byte = $85, $08 // STA DSTL
byte = $84, $09 // STY DSTH byte = $84, $09 // STY DSTH
byte = $B4, $C1 // LDY ESTKL+1,X byte = $B4, $A1 // LDY ESTKL+1,X
byte = $B5, $D1 // LDA ESTKL+1,X byte = $B5, $C1 // LDA ESTKL+1,X
byte = $F0, $01 // BEQ +1 byte = $F0, $01 // BEQ +1
byte = $C8 // INY byte = $C8 // INY
byte = $85, $E7 // STA TMPL byte = $85, $E7 // STA TMPL

View File

@@ -62,18 +62,18 @@ byte brk = 0
byte _get_estack = $8A // TXA byte _get_estack = $8A // TXA
byte = $49, $FF // EOR #$FF byte = $49, $FF // EOR #$FF
byte = $38 // SEC byte = $38 // SEC
byte = $69, $10 // ADC #$10 byte = $69, $20 // ADC #$20
byte = $C9, $11 // CMP #$11 byte = $C9, $21 // CMP #$21
byte = $90, $02 // BCC +2 byte = $90, $02 // BCC +2
byte = $A2, $10 // LDX #ESTKSZ/2 byte = $A2, $20 // LDX #ESTKSZ/2
byte = $CA // DEX byte = $CA // DEX
byte = $95 // STA byte = $95 // STA
byte _estkl = $D0 // ESTKL,X byte _estkl = $C0 // ESTKL,X
byte = $A9, $00 // LDA #$00 byte = $A9, $00 // LDA #$00
byte = $95 // STA byte = $95 // STA
byte _estkh = $C0 // ESTKH,X byte _estkh = $A0 // ESTKH,X
byte = $60 // RTS byte = $60 // RTS
byte _reset_estack = $A2, $10 // LDX #ESTKSZ/2 byte _reset_estack = $A2, $20 // LDX #ESTKSZ/2
byte = $60 // RTS byte = $60 // RTS
// //
// FORTH dictionary layout // FORTH dictionary layout
@@ -1022,7 +1022,7 @@ def _execword_(dentry)#0
fin fin
W = _cfa_(dentry) W = _cfa_(dentry)
(*W)()#0 (*W)()#0
if (@_get_estack)()#1 > 16 if (@_get_estack)()#1 > 32
puts("Stack over/underflow\n") puts("Stack over/underflow\n")
_quit_ _quit_
fin fin
@@ -1946,7 +1946,7 @@ def _prstack_#0
byte depth byte depth
for depth = 1 to (@_get_estack)()#1 for depth = 1 to (@_get_estack)()#1
val = ^(_estkl + 16 - depth) | (^(_estkh + 16 - depth) << 8) val = ^(_estkl + 32 - depth) | (^(_estkh + 32 - depth) << 8)
puti(val); putc(' ') puti(val); putc(' ')
next next
end end
@@ -2100,9 +2100,9 @@ end
// //
// Start FORTH // Start FORTH
// //
puts("FORTH for PLASMA 2.1\n") puts("FORTH for PLASMA 2.20\n")
if cmdsys:sysver < $0201 if cmdsys:sysver < $0220
puts("PLASMA >= 2.01 required\n") puts("PLASMA >= 2.20 required\n")
return return
fin fin
// //

View File

@@ -9,9 +9,9 @@ SRCH = SRC+1
DST = SRC+2 DST = SRC+2
DSTL = DST DSTL = DST
DSTH = DST+1 DSTH = DST+1
ESGUARD = $BE ESGUARD = $9E
ESTKSZ = $20 ESTKSZ = $40
ESTK = $C0 ESTK = $A0
ESTKH = ESTK ESTKH = ESTK
ESTKL = ESTK+ESTKSZ/2 ESTKL = ESTK+ESTKSZ/2
VMZP = ESTK+ESTKSZ VMZP = ESTK+ESTKSZ

View File

@@ -25,10 +25,10 @@ const jitcodeptr = $A0F4
const sinterp = $A0F6 const sinterp = $A0F6
const xinterp = $A0F8 const xinterp = $A0F8
const jitinterp = $A0FA const jitinterp = $A0FA
const estkh8 = $C000 const estkh8 = $A000
const estkh = $00C0 const estkh = $00A0
const estkl8 = $D000 const estkl8 = $C000
const estkl = $00D0 const estkl = $00C0
const ifpl8 = $E000 const ifpl8 = $E000
const ifph8 = $E100 const ifph8 = $E100
const jmptmp = $00E6 const jmptmp = $00E6

View File

@@ -62,7 +62,7 @@ typedef uint16_t address;
* 6502 memory map * 6502 memory map
*/ */
#define MEM6502_SIZE 0x00010000 #define MEM6502_SIZE 0x00010000
#define ESTK_SIZE 16 #define ESTK_SIZE 32
#define CMDLINE_STR 0x01FF #define CMDLINE_STR 0x01FF
#define CMDLINE_BUF 0x0200 #define CMDLINE_BUF 0x0200
#define SYSPATH_STR 0x0280 #define SYSPATH_STR 0x0280