MAke some fixes for real hardware (STA LCRWEN+BNK2) doesn't work

This commit is contained in:
David Schmenk 2014-05-17 19:46:17 -07:00
parent 2c9986fd25
commit c43dba71b1
2 changed files with 34 additions and 91 deletions

View File

@ -4,7 +4,6 @@ const memmap = $BF58
const sysfile = $0280 const sysfile = $0280
byte syshalt[] = "SYSTEM HALTED..." byte syshalt[] = "SYSTEM HALTED..."
byte perr byte perr
; ;
; Utility functions ; Utility functions
; ;
@ -77,57 +76,6 @@ SETMLP DEC ESTKL,X
++ INX ++ INX
RTS RTS
end end
;
; COPY MEMORY
; MEMCPY(DSTADDR, SRCADDR, SIZE)
;
asm memcpy
LDY #$00
LDA ESTKL,X
BNE +
LDA ESTKH,X
BEQ MEMEXIT
+ LDA ESTKL+2,X
STA DSTL
LDA ESTKH+2,X
STA DSTH
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
INC ESTKH,X
CPYLP LDA (SRC),Y
STA (DST),Y
INC DSTL
BNE +
INC DSTH
+ INC SRCL
BNE +
INC SRCH
+ DEC ESTKL,X
BNE CPYLP
DEC ESTKH,X
BNE CPYLP
MEMEXIT INX
INX
RTS
end
;
; CHAR OUT
; COUT(CHAR)
;
asm cout
LDA ESTKL,X
ORA #$80
BIT ROMEN
JSR $FDED
BIT LCRDEN+LCBNK2
RTS
end
;
; CHAR IN
; RDKEY()
;
asm cin asm cin
BIT ROMEN BIT ROMEN
STX ESP STX ESP
@ -164,9 +112,6 @@ asm prstr
+ BIT LCRDEN+LCBNK2 + BIT LCRDEN+LCBNK2
RTS RTS
end end
def crout
cout($0D)
end
; ;
; ProDOS routines ; ProDOS routines
; ;

View File

@ -137,29 +137,26 @@ RAMDONE CLI
JSR PRODOS ; OPEN AUTORUN JSR PRODOS ; OPEN AUTORUN
!BYTE $C8 !BYTE $C8
!WORD OPENPARMS !WORD OPENPARMS
BCC + BNE NOAUTO
JMP NOAUTO LDA REFNUM
+ LDA REFNUM
STA NLPARMS+1 STA NLPARMS+1
JSR PRODOS JSR PRODOS
!BYTE $C9 !BYTE $C9
!WORD NLPARMS !WORD NLPARMS
BCC + BNE NOAUTO
JMP NOAUTO LDA REFNUM
+ LDA REFNUM
STA READPARMS+1 STA READPARMS+1
JSR PRODOS JSR PRODOS
!BYTE $CA !BYTE $CA
!WORD READPARMS !WORD READPARMS
BCC + BNE NOAUTO
JMP NOAUTO LDX READPARMS+6
+ LDX READPARMS+6
STX $0280 STX $0280
JSR PRODOS JSR PRODOS
!BYTE $CC !BYTE $CC
!WORD CLOSEPARMS !WORD CLOSEPARMS
JMP CMDEXEC ; CALL CM JMP CMDEXEC
NOAUTO JMP BYE NOAUTO JMP BYE ; LOAD DEFAULT
AUTORUN !BYTE 7 AUTORUN !BYTE 7
!TEXT "AUTORUN" !TEXT "AUTORUN"
OPENPARMS !BYTE 3 OPENPARMS !BYTE 3
@ -226,6 +223,9 @@ BYE LDY DEFCMD
STA $0280,Y STA $0280,Y
DEY DEY
BNE - BNE -
BEQ CMDEXEC
DEFCMD !BYTE 3
!TEXT "CMD"
;* ;*
;* MOVE REST OF CMD FROM LANGUAGE CARD ;* MOVE REST OF CMD FROM LANGUAGE CARD
;* ;*
@ -240,17 +240,20 @@ CMDEXEC STY SRCL
STA (DST),Y STA (DST),Y
INY INY
BNE - BNE -
INC SRCL INC SRCH
INC DSTL INC DSTH
LDA SRCL LDA SRCH
CMP #$E0 CMP #$D4 ; #$E0
BNE - BNE -
;* ;*
;* DEACTIVATE 80 COL CARDS ;* DEACTIVATE 80 COL CARDS
;* ;*
LDX #$FE
TXS
BIT ROMEN BIT ROMEN
LDY #4 LDY #4
- LDA DISABLE80,Y - LDA DISABLE80,Y
ORA #$80
JSR $FDED JSR $FDED
DEY DEY
BPL - BPL -
@ -258,10 +261,6 @@ CMDEXEC STY SRCL
BIT $C051 BIT $C051
BIT $C058 BIT $C058
JSR $FC58 ; HOME JSR $FC58 ; HOME
JMP START
DISABLE80 !BYTE 21, 13, '1', 26, 13
DEFCMD !BYTE 3
!TEXT "CMD"
;* ;*
;* JUMP TO INTERPRETER ;* JUMP TO INTERPRETER
;* ;*
@ -269,24 +268,23 @@ START LDA #$00
STA IFPL STA IFPL
LDA #$BF LDA #$BF
STA IFPH STA IFPH
LDX #$FF
TXS
LDX #ESTKSZ/2 LDX #ESTKSZ/2
!SOURCE "cmdexec.a" !SOURCE "cmdexec.a"
DISABLE80 !BYTE 21, 13, '1', 26, 13
} }
;* ;*
;* ENTER INTO BYTECODE INTERPRETER ;* ENTER INTO BYTECODE INTERPRETER
;* ;*
INTERP STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD INTERP BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
PLA PLA
STA IPL STA IPL
PLA PLA
STA IPH STA IPH
LDY #$01 LDY #$01
BNE FETCHOP BNE FETCHOP
IINTRP STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD IINTRP BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
PLA PLA
STA TMPL STA TMPL
PLA PLA
@ -299,8 +297,8 @@ IINTRP STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA IPL STA IPL
DEY DEY
BEQ FETCHOP BEQ FETCHOP
IINTRPX STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD IINTRPX BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
PLA PLA
STA TMPL STA TMPL
PLA PLA
@ -1774,8 +1772,8 @@ CALL +INC_IP
STA IPL STA IPL
PLA PLA
STA IPH STA IPH
STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
JMP NEXTOP JMP NEXTOP
; ;
CALLX +INC_IP CALLX +INC_IP
@ -1801,8 +1799,8 @@ CALLX +INC_IP
STA IPL STA IPL
PLA PLA
STA IPH STA IPH
STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
JMP NEXTOPX JMP NEXTOPX
;* ;*
;* INDIRECT CALL TO ADDRESS (NATIVE CODE) ;* INDIRECT CALL TO ADDRESS (NATIVE CODE)
@ -1825,8 +1823,8 @@ ICAL LDA ESTKL,X
STA IPL STA IPL
PLA PLA
STA IPH STA IPH
STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
JMP NEXTOP JMP NEXTOP
; ;
ICALX LDA ESTKL,X ICALX LDA ESTKL,X
@ -1849,8 +1847,8 @@ ICALX LDA ESTKL,X
STA IPL STA IPL
PLA PLA
STA IPH STA IPH
STA LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
STA LCRWEN+LCBNK2 BIT LCRWEN+LCBNK2
JMP NEXTOPX JMP NEXTOPX
;* ;*
;* ENTER FUNCTION WITH FRAME SIZE AND PARAM COUNT ;* ENTER FUNCTION WITH FRAME SIZE AND PARAM COUNT