Fix BASIC
This commit is contained in:
1 parent
c5a028c8c6
commit
9e6a96f93a
4 files changed
+60
-29
No files matched your search
+12
-13
@@ -1,21 +1,20 @@
|
|||||||
; configuration
|
; configuration
|
||||||
CONFIG_2A := 1
|
CONFIG_2A := 1
|
||||||
CONFIG_SCRTCH_ORDER := 2
|
CONFIG_SCRTCH_ORDER := 2
|
||||||
|
|
||||||
; zero page
|
; zero page
|
||||||
ZP_START0 = $00
|
ZP_START0 = $00
|
||||||
ZP_START1 = $02
|
ZP_START1 = $02
|
||||||
ZP_START2 = $0C
|
ZP_START2 = $0C
|
||||||
ZP_START3 = $62
|
ZP_START3 = $62
|
||||||
ZP_START4 = $6D
|
ZP_START4 = $6D
|
||||||
|
|
||||||
; extra/override ZP variables
|
; extra/override ZP variables
|
||||||
USR := GORESTART ; XXX
|
USR := GORESTART ; XXX
|
||||||
|
|
||||||
; constants
|
; constants
|
||||||
SPACE_FOR_GOSUB := $3E
|
SPACE_FOR_GOSUB := $3E
|
||||||
STACK_TOP := $FA
|
STACK_TOP := $FA
|
||||||
WIDTH := 40
|
WIDTH := 40
|
||||||
WIDTH2 := 30
|
WIDTH2 := 30
|
||||||
|
RAMSTART2 := $0400
|
||||||
RAMSTART2 := $0400
|
|
||||||
@@ -204,9 +204,17 @@ L4098:
|
|||||||
ldx #TEMPST
|
ldx #TEMPST
|
||||||
stx TEMPPT
|
stx TEMPPT
|
||||||
.ifndef CONFIG_CBM_ALL
|
.ifndef CONFIG_CBM_ALL
|
||||||
|
.ifdef KILIAN
|
||||||
|
lda #<$BC00
|
||||||
|
sta MEMSIZ
|
||||||
|
lda #>$BC00
|
||||||
|
sta MEMSIZ+1
|
||||||
|
jmp L4106
|
||||||
|
.else
|
||||||
lda #<QT_MEMORY_SIZE
|
lda #<QT_MEMORY_SIZE
|
||||||
ldy #>QT_MEMORY_SIZE
|
ldy #>QT_MEMORY_SIZE
|
||||||
jsr STROUT
|
jsr STROUT
|
||||||
|
.endif
|
||||||
.ifdef APPLE
|
.ifdef APPLE
|
||||||
jsr INLINX
|
jsr INLINX
|
||||||
.else
|
.else
|
||||||
|
|||||||
@@ -13,5 +13,20 @@ int getChar(void) {
|
|||||||
|
|
||||||
int c = getchar();
|
int c = getchar();
|
||||||
|
|
||||||
|
// Specifically send FF for EOF to trigger echo cancellation
|
||||||
|
if (c == EOF) {
|
||||||
|
return 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BASIC expects CR always
|
||||||
|
if (c == '\n') {
|
||||||
|
return '\r';
|
||||||
|
}
|
||||||
|
|
||||||
|
// BASIC is uppercase only
|
||||||
|
if (c >= 'a' && c <= 'z') {
|
||||||
|
c = c - 'a' + 'A';
|
||||||
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
+25
-16
@@ -26,25 +26,34 @@ uint8_t readMemory(uint16_t address, uint8_t *ram, uint8_t *rom) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void writeMemory(uint16_t address, uint8_t value, uint8_t *ram) {
|
void writeMemory(uint16_t address, uint8_t value, uint8_t *ram) {
|
||||||
if ((address < RAM_SIZE && address < IO_BASE) || address >= ROM_BASE) {
|
/* Normal RAM */
|
||||||
if (address < ROM_BASE && ram[IO_BASE + ROM_BANKED_OUT] != 0) {
|
if (address < IO_BASE) {
|
||||||
|
ram[address] = value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ROM area */
|
||||||
|
if (address >= ROM_BASE) {
|
||||||
|
if (ram[IO_BASE + ROM_BANKED_OUT] != 0) {
|
||||||
ram[address] = value;
|
ram[address] = value;
|
||||||
}
|
}
|
||||||
} else {
|
return;
|
||||||
uint16_t _address = address - IO_BASE;
|
}
|
||||||
switch (_address) {
|
|
||||||
case SCREEN_ADDRESS: {
|
|
||||||
putChar(value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ROM_BANKED_OUT: {
|
|
||||||
ram[IO_BASE + ROM_BANKED_OUT] = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
/* I/O area */
|
||||||
break;
|
uint16_t _address = address - IO_BASE;
|
||||||
}
|
|
||||||
|
switch (_address) {
|
||||||
|
case SCREEN_ADDRESS:
|
||||||
|
putChar(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_BANKED_OUT:
|
||||||
|
ram[IO_BASE + ROM_BANKED_OUT] = value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user