Multiple bug fixes - stabilize scroll & shell

This commit is contained in:
stid 2020-01-20 13:51:37 -08:00
parent f56e35cb4e
commit 1796e04cd1
3 changed files with 13 additions and 10 deletions

View File

@ -74,8 +74,8 @@ initIRQ: {
sta Cia.C2DDRA sta Cia.C2DDRA
// SET UP THE 6510 LINES // SET UP THE 6510 LINES
lda #%11100111 // MOTOR ON, HIRAM LOWRAM CHAREN HIGH lda #%00110111 // MOTOR OFF, HIRAM LOWRAM CHAREN HIGH
sta MC6502.ZR1 // set 1110 0111, motor off, enable I/O, enable KERNAL, Disable BASIC sta MC6502.ZR1 // set 1110 0111, motor off, enable I/O, enable KERNAL, Enable BASIC
lda #%00101111 // set 0010 1111, 0 = input, 1 = output lda #%00101111 // set 0010 1111, 0 = input, 1 = output
sta MC6502.ZR0 // save the 6510 I/O port direction register sta MC6502.ZR0 // save the 6510 I/O port direction register

View File

@ -9,7 +9,6 @@
// ////// MACROS ////////////////////////////////////////// // ////// MACROS //////////////////////////////////////////
// ======================================================== // ========================================================
* = * "Device: Video" * = * "Device: Video"
// -------------------------------------------------------- // --------------------------------------------------------
@ -228,16 +227,16 @@ sendChar: {
ldy MemMap.VIDEO.CursorCol ldy MemMap.VIDEO.CursorCol
cpy #COLUMN_NUM // Is this > col num? cpy #COLUMN_NUM // Is this > col num?
bcc noEndOfLine bcc noEndOfLine
jsr screenNewLine // Yes? Add new list first jsr screenNewLine // Yes? Add new line first
ldy #1 lda #1
cpy MemMap.VIDEO.ScrollUpTriggered cmp MemMap.VIDEO.ScrollUpTriggered
bne noScrollTriggered bne noScrollTriggered
// Compensate Scroll // Compensate Scroll
sec sec
lda MemMap.VIDEO.TempVideoPointer lda MemMap.VIDEO.TempVideoPointer
sbc #1 sbc #40
sta MemMap.VIDEO.TempVideoPointer sta MemMap.VIDEO.TempVideoPointer
bcs !+ bcs !+
dec MemMap.VIDEO.TempVideoPointer+1 dec MemMap.VIDEO.TempVideoPointer+1
@ -249,8 +248,8 @@ sendChar: {
// This is a backspace // This is a backspace
cmp #BS cmp #BS
bne !+ bne !+
lda #' ' lda #' '
sta (MemMap.VIDEO.TempVideoPointer), y sta (MemMap.VIDEO.TempVideoPointer), y
ply ply
jmp exit jmp exit

View File

@ -17,6 +17,8 @@
.const CR = $0d .const CR = $0d
.const BS = $14 .const BS = $14
.const MAX_CMD_BUFFER = 40
// ======================================================== // ========================================================
// ////// METHODS ///////////////////////////////////////// // ////// METHODS /////////////////////////////////////////
// ======================================================== // ========================================================
@ -47,6 +49,8 @@ loop: {
beq backspace beq backspace
inputChar: inputChar:
jsr WozShell.push // Char in Buffer jsr WozShell.push // Char in Buffer
cpy #MAX_CMD_BUFFER
beq loop
PrintChar() PrintChar()
jmp loop jmp loop
backspace: backspace:
@ -71,7 +75,7 @@ toDebug: {
push: { push: {
ldy MemMap.SHELL.pos ldy MemMap.SHELL.pos
iny iny
cpy #127 cpy #MAX_CMD_BUFFER
beq done beq done
sty MemMap.SHELL.pos sty MemMap.SHELL.pos
sta MemMap.SHELL.buffer, y sta MemMap.SHELL.buffer, y