mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-12 12:30:07 +00:00
Disable /RAM, fix Viewport call in both VM
This commit is contained in:
parent
f98e7944f6
commit
816399dcdc
@ -26,7 +26,7 @@ const resxhgr2 = $0020
|
||||
predef home, gotoxy, viewport, crout, cout, prstr, cin, rdstr
|
||||
predef syscall, romcall
|
||||
predef markheap, allocheap, allocalignheap, releaseheap, availheap
|
||||
predef memclr, memset, memcpy, xmemcpy, memxcpy
|
||||
predef memset, memcpy, xmemcpy, memxcpy
|
||||
predef uword_isgt, uword_isge, uword_islt, uword_isle
|
||||
predef getpfx, setpfx, newline, online, open, close, read, write, create, destroy
|
||||
;
|
||||
@ -57,7 +57,6 @@ byte hpalignstr[] = "HEAPALLOCALIGN"
|
||||
byte hpallocstr[] = "HEAPALLOC"
|
||||
byte hprelstr[] = "HEAPRELEASE"
|
||||
byte hpavailstr[] = "HEAPAVAIL"
|
||||
;byte memclrstr[] = "MEMCLR"
|
||||
byte memsetstr[] = "MEMSET"
|
||||
byte memcpystr[] = "MEMCPY"
|
||||
byte uisgtstr[] = "ISUGT"
|
||||
@ -78,7 +77,6 @@ word = @hpmarkstr, @markheap
|
||||
word = @hpallocstr,@allocheap
|
||||
word = @hpalignstr,@allocalignheap
|
||||
word = @hprelstr, @releaseheap
|
||||
;word = @memclrstr, @memclr
|
||||
word = @memsetstr, @memset
|
||||
word = @memcpystr, @memcpy
|
||||
word = @uisgtstr, @uword_isgt
|
||||
@ -203,31 +201,6 @@ asm reboot
|
||||
JMP ($FFFC) ; RESET
|
||||
end
|
||||
;
|
||||
; SET MEMORY TO 0
|
||||
; MEMCLR(ADDR, SIZE)
|
||||
;
|
||||
;asm memclr
|
||||
; LDY #$00
|
||||
; LDA ESTKL+1,X
|
||||
; STA DSTL
|
||||
; LDA ESTKH+1,X
|
||||
; STA DSTH
|
||||
; INC ESTKL,X
|
||||
; INC ESTKH,X
|
||||
; TYA
|
||||
;CLRMLP DEC ESTKL,X
|
||||
; BNE +
|
||||
; DEC ESTKH,X
|
||||
; BEQ ++
|
||||
;+ STA (DST),Y
|
||||
; INY
|
||||
; BNE CLRMLP
|
||||
; INC DSTH
|
||||
; BNE CLRMLP
|
||||
;++ INX
|
||||
; RTS
|
||||
;end
|
||||
;
|
||||
; SET MEMORY TO VALUE
|
||||
; MEMSET(ADDR, SIZE, VALUE)
|
||||
;
|
||||
@ -420,18 +393,16 @@ end
|
||||
asm viewport
|
||||
LDA ESTKL+3,X
|
||||
STA $20
|
||||
LDA ESTKL+2,X
|
||||
STA $22
|
||||
LDA ESTKL+1,X
|
||||
STA $21
|
||||
LDA ESTKL,X
|
||||
LDA ESTKL+2,X
|
||||
STA $22
|
||||
CLC
|
||||
ADC $22
|
||||
ADC ESTKL,X
|
||||
STA $23
|
||||
STA $25
|
||||
DEC $25
|
||||
LDA #$00
|
||||
STA $24
|
||||
LDY #$00
|
||||
STY $24
|
||||
LDA $22
|
||||
STX ESP
|
||||
BIT ROMEN
|
||||
JSR $FB5B
|
||||
@ -1162,7 +1133,7 @@ def loadmod(mod)
|
||||
;
|
||||
; Locate bytecode defs in appropriate bank.
|
||||
;
|
||||
if ^MACHID & $30
|
||||
if ^MACHID & $30 == $30
|
||||
defbank = 1
|
||||
defaddr = allocxheap(rld - bytecode)
|
||||
else
|
||||
|
@ -346,8 +346,7 @@ int load_mod(byte *mod)
|
||||
{
|
||||
if (show_state) printf("BYTE");
|
||||
mem_data[addr] = fixup;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (show_state) printf("@$%04X\n", addr);
|
||||
rld += 4;
|
||||
@ -411,7 +410,8 @@ void call(uword pc)
|
||||
interp(mem_data + (mem_data[pc] + (mem_data[pc + 1] << 8)));
|
||||
break;
|
||||
case 3: // LIBRARY STDLIB::VIEWPORT
|
||||
printf("Set Window %d, %d, %d, %d/n", POP, POP, POP, POP);
|
||||
printf("Set Viewport %d, %d, %d, %d\n", esp[3], esp[2], esp[1], esp[0]);
|
||||
esp += 4;
|
||||
PUSH(0);
|
||||
break;
|
||||
case 4: // LIBRARY STDLIB::PUTC
|
||||
@ -466,6 +466,11 @@ void call(uword pc)
|
||||
fflush(stdout);
|
||||
PUSH(0);
|
||||
break;
|
||||
case 11: // LIBRARY STDLIB::PUTNL
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
PUSH(0);
|
||||
break;
|
||||
default:
|
||||
printf("Bad call code\n");
|
||||
}
|
||||
@ -851,7 +856,9 @@ char *stdlib_exp[] = {
|
||||
"GETC",
|
||||
"GETS",
|
||||
"CLS",
|
||||
"GOTOXY"
|
||||
"GOTOXY",
|
||||
"PUTNL",
|
||||
0
|
||||
};
|
||||
|
||||
byte stdlib[] = {
|
||||
@ -877,7 +884,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
stodci("STDLIB", dci);
|
||||
add_mod(dci, 0xFFFF);
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; stdlib_exp[i]; i++)
|
||||
{
|
||||
mem_data[i] = i + 3;
|
||||
stodci(stdlib_exp[i], dci);
|
||||
|
@ -4,13 +4,20 @@
|
||||
;*
|
||||
;**********************************************************
|
||||
;*
|
||||
;* MONITOR SPECIAL LOCATIONS AND PRODOS MLI
|
||||
;* MONITOR SPECIAL LOCATIONS
|
||||
;*
|
||||
CSWL = $36
|
||||
CSWH = $37
|
||||
PROMPT = $33
|
||||
;*
|
||||
;* PRODOS
|
||||
;*
|
||||
PRODOS = $BF00
|
||||
MACHID = $BF98
|
||||
DEVCNT = $BF31 ; GLOBAL PAGE DEVICE COUNT
|
||||
DEVLST = $BF32 ; GLOBAL PAGE DEVICE LIST
|
||||
MACHID = $BF98 ; GLOBAL PAGE MACHINE ID BYTE
|
||||
RAMSLOT = $BF26 ; SLOT 3, DRIVE 2 IS /RAM'S DRIVER VECTOR
|
||||
NODEV = $BF10
|
||||
;*
|
||||
;* HARDWARE ADDRESSES
|
||||
;*
|
||||
@ -50,6 +57,39 @@ ESP = DST+2
|
||||
LDX #$FF
|
||||
TXS
|
||||
;*
|
||||
;* DISCONNECT /RAM
|
||||
;*
|
||||
SEI ; DISABLE /RAM
|
||||
LDA MACHID
|
||||
AND #$30
|
||||
CMP #$30
|
||||
BNE RAMDONE
|
||||
LDA RAMSLOT
|
||||
CMP NODEV
|
||||
BNE RAMCONT
|
||||
LDA RAMSLOT+1
|
||||
CMP NODEV+1
|
||||
BEQ RAMDONE
|
||||
RAMCONT LDY DEVCNT
|
||||
RAMLOOP LDA DEVLST,Y
|
||||
AND #$F3
|
||||
CMP #$B3
|
||||
BEQ GETLOOP
|
||||
DEY
|
||||
BPL RAMLOOP
|
||||
BMI RAMDONE
|
||||
GETLOOP LDA DEVLST+1,Y
|
||||
STA DEVLST,Y
|
||||
BEQ RAMEXIT
|
||||
INY
|
||||
BNE GETLOOP
|
||||
RAMEXIT LDA NODEV
|
||||
STA RAMSLOT
|
||||
LDA NODEV+1
|
||||
STA RAMSLOT+1
|
||||
DEC DEVCNT
|
||||
RAMDONE CLI
|
||||
;*
|
||||
;* INSTALL PAGE 3 VECTORS
|
||||
;*
|
||||
LDY #$20
|
||||
|
@ -2,7 +2,7 @@
|
||||
; Declare all imported modules and their data/functions.
|
||||
;
|
||||
import stdlib
|
||||
predef cls, gotoxy, puts, putc, putnl, getc
|
||||
predef cls, gotoxy, viewport, puts, putc, putnl, getc
|
||||
end
|
||||
|
||||
import testlib
|
||||
@ -15,7 +15,7 @@ predef main
|
||||
;
|
||||
; Declare all global variables for this module.
|
||||
;
|
||||
byte hello[] = "Hello, world.\n\n"
|
||||
byte hello[] = "Hello, world.\n"
|
||||
word defptr = main
|
||||
;
|
||||
; Define functions.
|
||||
@ -31,14 +31,16 @@ def nums
|
||||
word i
|
||||
for i = -10 to 10
|
||||
puti(i)
|
||||
putc('\n')
|
||||
putnl
|
||||
next
|
||||
end
|
||||
|
||||
export def main
|
||||
cls
|
||||
nums
|
||||
viewport(12, 12, 16, 8)
|
||||
ascii
|
||||
viewport(0, 0, 40, 24)
|
||||
gotoxy(15,5)
|
||||
puts(@hello)
|
||||
end
|
||||
@ -50,6 +52,4 @@ export def indirect
|
||||
end
|
||||
|
||||
indirect
|
||||
putc(getc)
|
||||
putnl
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user