mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-02-20 17:29:11 +00:00
Revert to working version
This commit is contained in:
parent
f99ea46957
commit
9435425246
@ -46,7 +46,7 @@ byte valstr[] = '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
//
|
||||
asm fbrSwap(saveVM, restoreVM)
|
||||
!SOURCE "vmsrc/plvmzp.inc"
|
||||
HWSP = IPY
|
||||
HWSP = IPY
|
||||
LDA ESTKL,X
|
||||
STA SRCL
|
||||
LDA ESTKH,X
|
||||
@ -66,11 +66,14 @@ asm fbrSwap(saveVM, restoreVM)
|
||||
STA ESTK,Y
|
||||
DEY
|
||||
BPL -
|
||||
TXA
|
||||
+ TXA
|
||||
TAY
|
||||
- LDA $100,Y
|
||||
STA (DST),Y
|
||||
LDA (SRC),Y
|
||||
INY
|
||||
BNE -
|
||||
LDY HWSP
|
||||
- LDA (SRC),Y
|
||||
STA $100,Y
|
||||
INY
|
||||
BNE -
|
||||
@ -108,7 +111,7 @@ end
|
||||
export def fbrInit(numPool)
|
||||
byte i
|
||||
word pool
|
||||
|
||||
|
||||
if numPool >= MAX_FIBERS
|
||||
numPool = MAX_FIBERS
|
||||
fin
|
||||
@ -144,7 +147,7 @@ end
|
||||
//
|
||||
export def fbrStop(fid)
|
||||
byte i
|
||||
|
||||
|
||||
//
|
||||
// Don't STOP fiber 0 (avoid deadlock)
|
||||
//
|
||||
@ -179,7 +182,7 @@ end
|
||||
export def fbrStart(defaddr, param)
|
||||
byte i
|
||||
word vmstate
|
||||
|
||||
|
||||
for i = fbrMax downto 1
|
||||
if fbrState[i] == FIBER_FREE
|
||||
//
|
||||
@ -202,7 +205,7 @@ export def fbrStart(defaddr, param)
|
||||
// This allows a fiber to return and it will fall into fbrExit
|
||||
//
|
||||
vmstate->hwsp = $FB
|
||||
vmstate=>$FE = @fbrExit - 1
|
||||
vmstate=>$FE = @fbrExit - 1
|
||||
vmstate=>$FC = defaddr - 1
|
||||
//
|
||||
// Link into RUN list
|
||||
@ -222,7 +225,7 @@ end
|
||||
//
|
||||
export def fbrYield
|
||||
byte prev
|
||||
|
||||
|
||||
//
|
||||
// Swap to text fiber if this isn't the only fiber RUNning
|
||||
//
|
||||
@ -237,7 +240,7 @@ end
|
||||
//
|
||||
export def fbrHalt
|
||||
byte i
|
||||
|
||||
|
||||
//
|
||||
// Cannot HALT fiber 0 (avoid deadlock)
|
||||
//
|
||||
@ -284,7 +287,7 @@ end
|
||||
|
||||
def fbrTest(fid, param)
|
||||
byte i
|
||||
|
||||
|
||||
for i = 1 to param
|
||||
puth(fid); putc($0D)
|
||||
fbrYield
|
||||
|
Loading…
x
Reference in New Issue
Block a user