1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-10 23:41:35 +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=>[BLU] = -1
memset(rgbScanline, 0, 563 * 3)
//for j = 0 to 191 I seem to have overflowed the stack
j = 0; repeat
for j = 0 to 191
fileio:read(refnum, rgbScanline, 560 * 3)
memset(@ntscCycle, GREY_CHROMA, 24) // Reset chroma cycle
rgbptr = rgbScanline
@ -568,11 +567,10 @@ def rgbImportExport(rgbfile, dhgrfile)#0
errptr = errptr + 3 * 2
next
if flags & MEM_MODE; putc('.'); fin
//if ^$C000 == $83
// break
//fin
//next
j++; until j == 192 or ^$C000 == $83
if ^$C000 == $83
break
fin
next
fileio:close(refnum)
if ^dhgrfile
if flags & MEM_MODE

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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