1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-05 17:32:02 +00:00

Apple ][/][+ and PLASMA16 acting wierd

This commit is contained in:
David Schmenk 2018-01-10 19:10:15 -08:00
parent d1893b69da
commit f2d7593527
7 changed files with 59 additions and 52 deletions

View File

@ -50,9 +50,9 @@ word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
//
// Text screen parameters.
//
byte textcols = 40
byte curshpos = 0
byte cursvpos = 0
//byte textcols = 40
//byte curshpos = 0
//byte cursvpos = 0
//
// Apple 3 console codes.
//
@ -153,8 +153,8 @@ def a1home
return 0
end
def a1gotoxy(x, y)
curshpos = x
cursvpos = y
//curshpos = x
//cursvpos = y
putln
while x
putc(' ')
@ -181,13 +181,13 @@ def a2keypressed
return ^keyboard >= 128
end
def a2home
curshpos = 0
cursvpos = 0
//curshpos = 0
//cursvpos = 0
return call($FC58, 0, 0, 0, 0) // home()
end
def a2gotoxy(x, y)
curshpos = x
cursvpos = y
//curshpos = x
//cursvpos = y
^$24 = x + ^$20
return call($FB5B, y + ^$22, 0, 0, 0)
end
@ -248,14 +248,14 @@ def a3keypressed
return count
end
def a3home
curshpos = 0
cursvpos = 0
//curshpos = 0
//cursvpos = 0
putc(28)
return 0
end
def a3gotoxy(x, y)
curshpos = x
cursvpos = y
//curshpos = x
//cursvpos = y
putc(24)
putc(x)
putc(25)
@ -269,7 +269,7 @@ def a3viewport(left, top, width, height)
//
left = 0
top = 0
width = textcols
width = 40//textcols
height = 24
fin
putc(1) // Reset viewport

View File

@ -26,6 +26,10 @@ predef digitKey(pkey)#0, pointKey(pkey)#0, opKey(pkey)#0
predef enterKey(pkey)#0, copyKey(pkey)#0, chsKey(pkey)#0, memKey(pkey)#0
predef elemsKey(pkey)#0
//
// Run state
//
byte quit = FALSE
//
// Current input
//
byte inputStr[32] = ""
@ -395,11 +399,13 @@ def cmdKey(pkey)#0
// cmdLine = gets(':'|$80)
word d
showStatus("Press 1-9 for fix point digits:")
d = getc - '0'
showStatus("Press 1-9 for fix point digits(Q=Quit):")
d = toupper(getc) - '0'
if d >= 1 and d <= 9
displayFix = d
displayInt = displayWidth - displayFix - 1
elsif d == 'Q' - '0'
quit = TRUE
fin
clearStatus
//
@ -417,7 +423,7 @@ def inputKey#0
byte inkey
word pkeys
while 1
while not quit
pkeys = @keypad
conio:gotoxy(18, 7)
inkey = toupper(getc)
@ -442,7 +448,7 @@ initInput
showStack
showMem
showInput
showStatus("Version 0.5")
showStatus("Version 0.6")
inputKey
conio:gotoxy(0, 22)
done

View File

@ -351,7 +351,6 @@ end
asm crout()#0
LDA #$0D
BNE +
; FALL THROUGH TO COUT
end
//
// CHAR OUT

View File

@ -863,15 +863,15 @@ BRGT INX
CMP ESTKL,X
LDA ESTKH-1,X
SBC ESTKH,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
BRLT INX
LDA ESTKL,X
CMP ESTKL-1,X
LDA ESTKH,X
SBC ESTKH-1,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
IBRNCH LDA IPL
CLC
ADC ESTKL,X

View File

@ -281,8 +281,8 @@ BYE LDY DEFCMD
STA STRBUF,Y
DEY
BPL -
INY ; CLEAR CMDLINE BUFF
STY $01FF
; INY ; CLEAR CMDLINE BUFF
; STY $01FF
CMDENTRY = *
;
; DEACTIVATE 80 COL CARDS
@ -336,17 +336,11 @@ CMDENTRY = *
!WORD CLOSEPARMS
BNE FAIL
;
; CHANGE CMD STRING TO SYSPATH STRING
;
LDA STRBUF
SEC
SBC #$03
STA STRBUF
;
; INIT VM ENVIRONMENT STACK POINTERS
;
; LDA #$00 ; INIT FRAME POINTER
STA PPL
; LDA #$00
STA $01FF ; CLEAR CMDLINE BUFF
STA PPL ; INIT FRAME POINTER
STA IFPL
LDA #$BF
STA PPH
@ -354,6 +348,13 @@ CMDENTRY = *
LDX #$FE ; INIT STACK POINTER (YES, $FE. SEE GETS)
TXS
LDX #ESTKSZ/2 ; INIT EVAL STACK INDEX
;
; CHANGE CMD STRING TO SYSPATH STRING
;
LDA STRBUF
SEC
SBC #$03
STA STRBUF
JMP $2000 ; JUMP TO LOADED SYSTEM COMMAND
;
; PRINT FAIL MESSAGE, WAIT FOR KEYPRESS, AND REBOOT
@ -1374,15 +1375,15 @@ BRGT INX
CMP ESTKL,X
LDA ESTKH-1,X
SBC ESTKH,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
BRLT INX
LDA ESTKL,X
CMP ESTKL-1,X
LDA ESTKH,X
SBC ESTKH-1,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
IBRNCH LDA IPL
CLC
ADC ESTKL,X

View File

@ -1020,15 +1020,15 @@ BRGT INX
CMP ESTKL,X
LDA ESTKH-1,X
SBC ESTKH,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
BRLT INX
LDA ESTKL,X
CMP ESTKL-1,X
LDA ESTKH,X
SBC ESTKH-1,X
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
IBRNCH LDA IPL
CLC
ADC ESTKL,X

View File

@ -130,10 +130,10 @@ BADCPU !TEXT "65C802/65C816 CPU REQUIRED.", 13
;*
;* INITIALIZE STACK
;*
INITSP LDX #$FE
TXS
LDX #$00
STX $01FF
;INITSP LDX #$FE
; TXS
; LDX #$00
; STX $01FF
;*
;* DISCONNECT /RAM
;*
@ -361,8 +361,8 @@ BYE LDY DEFCMD
STA STRBUF,Y
DEY
BPL -
INY ; CLEAR CMDLINE BUFF
STY $01FF
; INY ; CLEAR CMDLINE BUFF
; STY $01FF
CMDENTRY = *
;
; DEACTIVATE 80 COL CARDS
@ -423,17 +423,11 @@ CMDENTRY = *
!WORD CLOSEPARMS
BNE FAIL
;
; CHANGE CMD STRING TO SYSPATH STRING
;
LDA STRBUF
SEC
SBC #$03
STA STRBUF
;
; INIT VM ENVIRONMENT STACK POINTERS
;
; LDA #$00 ; INIT FRAME POINTER
STA PPL
; LDA #$00
STA $01FF ; CLEAR CMDLINE BUFF
STA PPL ; INIT FRAME POINTER
STA IFPL
LDA #$BF
STA PPH
@ -441,6 +435,13 @@ CMDENTRY = *
LDX #$FE ; INIT STACK POINTER (YES, $FE. SEE GETS)
TXS
LDX #ESTKSZ/2 ; INIT EVAL STACK INDEX
;
; CHANGE CMD STRING TO SYSPATH STRING
;
LDA STRBUF
SEC
SBC #$03
STA STRBUF
JMP $2000 ; JUMP TO LOADED SYSTEM COMMAND
;
; PRINT FAIL MESSAGE, WAIT FOR KEYPRESS, AND REBOOT
@ -1245,8 +1246,8 @@ BRGT PLA
SEC
SBC TOS,S
BVS +
BMI BRNCH
BPL NOBRNCH
BMI BRNCH
+ BMI NOBRNCH
BPL BRNCH
BRLT PLA