diff --git a/c64/kernal/chrin_real.s b/c64/kernal/chrin_real.s index cf7f54f6..5e0a7e17 100644 --- a/c64/kernal/chrin_real.s +++ b/c64/kernal/chrin_real.s @@ -82,7 +82,6 @@ not_end_of_input: clc rts - read_from_keyboard: jsr cursor_enable @@ -92,7 +91,7 @@ read_from_keyboard: beq chrin_repeat lda KEYD - cmp #$0d + cmp #$0D bne not_enter jsr cursor_disable @@ -145,8 +144,10 @@ empty_line: rts not_enter: + // Print character lda KEYD + // XXX add support for SHIFT + RUN/STOP ($84) and function keys (should be configurable) jsr CHROUT jsr pop_keyboard_buffer diff --git a/c64/kernal/cint_real.s b/c64/kernal/cint_real.s index 1daf056c..9111700a 100644 --- a/c64/kernal/cint_real.s +++ b/c64/kernal/cint_real.s @@ -68,7 +68,8 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start? jsr setup_vicii // Initialise cursor blink flags (Compute's Mapping the 64 p215) - lda #$00 + lda #$01 + sta BLNCT sta BLNSW // Set keyboard decode vector (Compute's Mapping the 64 p215) diff --git a/c64/kernal/screen/chrout_screen.s b/c64/kernal/screen/chrout_screen.s index 119c11d2..0b447fad 100644 --- a/c64/kernal/screen/chrout_screen.s +++ b/c64/kernal/screen/chrout_screen.s @@ -6,8 +6,6 @@ chrout_screen: - sei // XXX why do we need to disable interrupts? - jsr cursor_hide_if_visible lda SCHAR diff --git a/c64/kernal/screen/chrout_screen_advance_to_next_line.s b/c64/kernal/screen/chrout_screen_advance_to_next_line.s index e62f13e1..323c47e8 100644 --- a/c64/kernal/screen/chrout_screen_advance_to_next_line.s +++ b/c64/kernal/screen/chrout_screen_advance_to_next_line.s @@ -1,8 +1,6 @@ chrout_screen_advance_to_next_line: - // jsr cursor_hide_if_visible - // Go to start of line lda #0 sta PNTR diff --git a/c64/kernal/screen/chrout_screen_control.s b/c64/kernal/screen/chrout_screen_control.s index fe6bfc1f..d028d077 100644 --- a/c64/kernal/screen/chrout_screen_control.s +++ b/c64/kernal/screen/chrout_screen_control.s @@ -158,11 +158,8 @@ chrout_try_HOME: cmp #$13 bne !+ - // XXX try cursor_home instead - lda #$00 - sta PNTR - sta TBLX - jmp chrout_screen_calc_lptr_done + jsr cursor_home + jmp chrout_screen_done !: chrout_try_CLR: @@ -179,21 +176,7 @@ chrout_try_INS: jmp chrout_screen_ins !: -chrout_try_RUN_STOP: - - cmp #$03 - bne !+ - - // XXX - - jmp chrout_screen_done -!: -chrout_try_FKEY: - - // XXX - - // FALLTROUGH - -!: // unknown, LF, or no more actions required +chrout_screen_control_done: + // unknown code or key does not needs jmp chrout_screen_done diff --git a/c64/kernal/screen/cursor.s b/c64/kernal/screen/cursor.s index 69364edd..0221cf18 100644 --- a/c64/kernal/screen/cursor.s +++ b/c64/kernal/screen/cursor.s @@ -28,7 +28,7 @@ cursor_blink: // FALLTROUGH cursor_draw: - jsr screen_calculate_line_pointer // XXX make sure this is not needed and remove the call + jsr screen_calculate_line_pointer // XXX try to make this call not needed ldy PNTR lda (PNT),y diff --git a/c64/kernal/screen/cursor_home.s b/c64/kernal/screen/cursor_home.s index 7d8549a6..bb9d9bd2 100644 --- a/c64/kernal/screen/cursor_home.s +++ b/c64/kernal/screen/cursor_home.s @@ -9,4 +9,4 @@ cursor_home: sta PNTR // x position sta TBLX // y position - jmp screen_set_pointer_to_current_line + jmp screen_calculate_line_pointer diff --git a/c64/kernal/screen/screen_set_pointer_to_current_line.s b/c64/kernal/screen/screen_set_pointer_to_current_line.s deleted file mode 100644 index e6beecfc..00000000 --- a/c64/kernal/screen/screen_set_pointer_to_current_line.s +++ /dev/null @@ -1,35 +0,0 @@ - // Put the address of the screen current line - // into the pointer at $D1 (PNT). - // It must take into account the screen line link table - // (Compute's Mapping the 64 p216) - -screen_set_pointer_to_current_line: - // Get pointer to start of the screen - lda HIBASE - sta PNT+1 - lda #$00 - sta PNT+0 - - // Now advance for the number of lines - ldx TBLX - -sptcl_l2: - // XXX - Should we read the columns per line from - // somewhere? - ldy #<40 - // Double line length if line is linked - lda LDTBL,x - bpl sptcl_l1 - ldy #<80 -sptcl_l1: - tya - clc - adc PNT+0 - lda PNT+1 - adc #>40 - sta PNT+1 - - dex - bpl sptcl_l2 - - rts