diff --git a/src/basic/assets/table_ti_hi.s b/src/basic/assets/table_ti_hi.s index becbe187..e0615a58 100644 --- a/src/basic/assets/table_ti_hi.s +++ b/src/basic/assets/table_ti_hi.s @@ -8,9 +8,22 @@ table_TI_hi: +#if !CONFIG_RS232_UP9600 + .byte $20 // 10 hours = 2169000 ticks .byte $03 // 1 hour = 216000 ticks .byte $00 // 10 minutes = 36000 ticks .byte $00 // 1 minute = 3600 ticks .byte $00 // 10 seconds = 600 ticks .byte $00 // 1 second = 60 ticks + +#else + + .byte $23 // 10 hours = 2304000 ticks + .byte $03 // 1 hour = 230400 ticks + .byte $00 // 10 minutes = 38400 ticks + .byte $00 // 1 minute = 3840 ticks + .byte $00 // 10 seconds = 640 ticks + .byte $00 // 1 second = 64 ticks + +#endif \ No newline at end of file diff --git a/src/basic/assets/table_ti_lo.s b/src/basic/assets/table_ti_lo.s index 5b3368cb..4f7ef5ae 100644 --- a/src/basic/assets/table_ti_lo.s +++ b/src/basic/assets/table_ti_lo.s @@ -8,9 +8,22 @@ table_TI_lo: +#if !CONFIG_RS232_UP9600 + .byte $80 // 10 hours = 2169000 ticks .byte $C0 // 1 hour = 216000 ticks .byte $A0 // 10 minutes = 36000 ticks .byte $10 // 1 minute = 3600 ticks .byte $58 // 10 seconds = 600 ticks .byte $3C // 1 second = 60 ticks + +#else + + .byte $00 // 10 hours = 2304000 ticks + .byte $00 // 1 hour = 230400 ticks + .byte $00 // 10 minutes = 38400 ticks + .byte $00 // 1 minute = 3840 ticks + .byte $80 // 10 seconds = 640 ticks + .byte $40 // 1 second = 64 ticks + +#endif diff --git a/src/basic/assets/table_ti_mid.s b/src/basic/assets/table_ti_mid.s index 5515a733..22b38fb8 100644 --- a/src/basic/assets/table_ti_mid.s +++ b/src/basic/assets/table_ti_mid.s @@ -8,9 +8,22 @@ table_TI_mid: +#if !CONFIG_RS232_UP9600 + .byte $F5 // 10 hours = 2169000 ticks .byte $4B // 1 hour = 216000 ticks .byte $8C // 10 minutes = 36000 ticks .byte $0E // 1 minute = 3600 ticks .byte $02 // 10 seconds = 600 ticks .byte $00 // 1 second = 60 ticks + +#else + + .byte $28 // 10 hours = 2304000 ticks + .byte $84 // 1 hour = 230400 ticks + .byte $96 // 10 minutes = 38400 ticks + .byte $0F // 1 minute = 3840 ticks + .byte $02 // 10 seconds = 640 ticks + .byte $00 // 1 second = 64 ticks + +#endif diff --git a/src/basic/engine_variables/array_create.s b/src/basic/engine_variables/array_create.s index d63dd62b..14d4a750 100644 --- a/src/basic/engine_variables/array_create.s +++ b/src/basic/engine_variables/array_create.s @@ -10,7 +10,9 @@ array_create: jsr fetch_variable_name bcs_16 do_SYNTAX_error - // It will be easier if we first perform garbage collecion (arrays are not declared often) + // XXX check if the array already exists + + // It will be easier if we first perform garbage collection (arrays are not declared often) jsr varstr_garbage_collect diff --git a/src/kernal/assets/irq_timing_hi.s b/src/kernal/assets/irq_timing_hi.s index b884d60b..69547d41 100644 --- a/src/kernal/assets/irq_timing_hi.s +++ b/src/kernal/assets/irq_timing_hi.s @@ -22,5 +22,21 @@ irq_timing_hi: // high bytes +#if !CONFIG_RS232_UP9600 + .byte >17045 // NTSC .byte >16421 // PAL + +#else + +// +// Timer values needed by UP9600 +// +// Original driver code by Daniel Dallman with Bo Zimmerman adaptations, +// these causes the tick to be generated 64 times per second +// + + .byte $42 // NTSC + .byte $40 // PAL + +#endif \ No newline at end of file diff --git a/src/kernal/assets/irq_timing_lo.s b/src/kernal/assets/irq_timing_lo.s index 5043d2ba..3760f444 100644 --- a/src/kernal/assets/irq_timing_lo.s +++ b/src/kernal/assets/irq_timing_lo.s @@ -22,5 +22,21 @@ irq_timing_lo: // low bytes +#if !CONFIG_RS232_UP9600 + .byte <17045 // NTSC .byte <16421 // PAL + +#else + +// +// Timer values needed by UP9600 +// +// Original driver code by Daniel Dallman with Bo Zimmerman adaptations, +// these causes the tick to be generated 64 times per second +// + + .byte $95 // NTSC + .byte $25 // PAL + +#endif \ No newline at end of file diff --git a/src/kernal/keyboard/scnkey.s b/src/kernal/keyboard/scnkey.s index cd0cb7a5..c48f847b 100644 --- a/src/kernal/keyboard/scnkey.s +++ b/src/kernal/keyboard/scnkey.s @@ -327,7 +327,11 @@ scnkey_got_key: // .Y should now contain the key offset in matrix pointed by KEY // // Besides - since I am the one who writes the code, I will make the values exactly how I like them :D +#if !CONFIG_RS232_UP9600 lda #$16 +#else + lda #$18 +#endif sta DELAY // FALLTROUGH diff --git a/src/kernal/rs232/up9600_ihitab.s b/src/kernal/rs232/up9600_ihitab.s deleted file mode 100644 index 43b53bd7..00000000 --- a/src/kernal/rs232/up9600_ihitab.s +++ /dev/null @@ -1,21 +0,0 @@ -// #LAYOUT# STD * #TAKE -// #LAYOUT# * KERNAL_0 #TAKE -// #LAYOUT# * * #IGNORE - -// -// Timer values for PAL/NTSC - high bytes -// - -// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations - - -#if CONFIG_RS232_UP9600 - - -up9600_ihitab: - - .byte $42 - .byte $40 - - -#endif // CONFIG_RS232_UP9600 diff --git a/src/kernal/rs232/up9600_ilotab.s b/src/kernal/rs232/up9600_ilotab.s deleted file mode 100644 index 5492bedf..00000000 --- a/src/kernal/rs232/up9600_ilotab.s +++ /dev/null @@ -1,21 +0,0 @@ -// #LAYOUT# STD * #TAKE -// #LAYOUT# * KERNAL_0 #TAKE -// #LAYOUT# * * #IGNORE - -// -// Timer values for PAL/NTSC - low bytes -// - -// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations - - -#if CONFIG_RS232_UP9600 - - -up9600_ilotab: - - .byte $95 - .byte $25 - - -#endif // CONFIG_RS232_UP9600 diff --git a/src/kernal/time/udtim.s b/src/kernal/time/udtim.s index 2fafdf53..44913c57 100644 --- a/src/kernal/time/udtim.s +++ b/src/kernal/time/udtim.s @@ -28,10 +28,18 @@ UDTIM: udtim_rollover_check: lda TIME+0 +#if !CONFIG_RS232_UP9600 cmp #$4F +#else + cmp #$54 +#endif bcc udtim_keyboard lda TIME+1 - cmp #$1A +#if !CONFIG_RS232_UP9600 + cmp #$1A +#else + cmp #$60 +#endif bcc udtim_keyboard // FALLTROUGH