initial support for Mega65 extra ROM

This commit is contained in:
FeralChild64 committed 2020-01-10 22:03:10 +01:00
1 parent 7539c6b072
commit 4d56864327
333 files changed
+1747 -289

No files matched your search

+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CHROUT routine - screen support (character output)
@@ -128,3 +129,6 @@ chrout_screen_done:
jsr cursor_show_if_enabled
jmp chrout_done_success
#endif // ROM layout
+5
View File
@@ -1,9 +1,14 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CLR key handling within CHROUT
//
chrout_screen_CLR:
jsr clear_screen
jmp chrout_screen_calc_lptr_done
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CHROUT routine - screen support, control codes
@@ -66,3 +67,6 @@ chrout_try_color_loop:
// Unknown code, or key not requiring any handling
jmp chrout_screen_done
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Cursor keys handling within CHROUT
@@ -53,3 +54,6 @@ chrout_screen_CRSR_LEFT:
lda #39
sta PNTR
bne chrout_screen_CRSR_done // branch always
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CHROUT routine - screen support, DEL key handling
@@ -83,3 +84,6 @@ chrout_screen_del_column_normal:
chrout_screen_del_done:
jmp chrout_screen_calc_lptr_done
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// GFX/TXT mode switch handling within CHROUT
@@ -17,3 +18,6 @@ chrout_screen_TXT:
lda VIC_YMCSB
ora #$02 // to lower case
bne !- // branch always
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// HOME key handling within CHROUT
@@ -8,3 +9,6 @@ chrout_screen_HOME:
jsr cursor_home
jmp chrout_screen_calc_lptr_done
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CHROUT routine - screen support, INS key handling
@@ -91,3 +92,6 @@ chrout_screen_ins_copy_loop:
// Return from loop
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Jumptable for screen control codes support. To improve performance, should be sorted
@@ -116,3 +117,6 @@ chrout_screen_jumptable:
.word chrout_screen_RETURN
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// CHROUT routine - screen support, control codes in quote mode
@@ -18,3 +19,6 @@ chrout_screen_quote:
adc #$BF // C=1, so adding $BF + C = add $C0
!:
jmp chrout_screen_literal
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// RETURN key handling within CHROUT
@@ -27,3 +28,6 @@ chrout_screen_RETURN:
jsr screen_calculate_PNT_USER
!:
jmp screen_advance_to_next_line
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// RVS ON/OFF handling within CHROUT
@@ -15,3 +16,6 @@ chrout_screen_RVS_OFF:
!:
sta RVS
jmp chrout_screen_done
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// SHIFT ON/OFF handling within CHROUT
@@ -15,3 +16,6 @@ chrout_screen_SHIFT_OFF:
lda #$80 // disable SHIFT+VENDOR combination
bne !- // branch always
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// STOP key handling within CHROUT
@@ -16,3 +17,6 @@ chrout_screen_STOP:
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Tabulation keys handling within CHROUT
@@ -37,3 +38,6 @@ chrout_screen_TAB_BW:
#endif // CONFIG_EDIT_TABULATORS
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Variables used:
@@ -78,3 +79,6 @@ cursor_blink_timer_reset:
cursor_blink_end:
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Variables used:
@@ -9,3 +10,6 @@ cursor_enable:
lda #$00
sta BLNSW
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Variables used:
@@ -33,3 +34,6 @@ cursor_show:
cursor_show_end:
rts
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 290
// - [CM64] Compute's Mapping the Commodore 64 - page 215
// - [RG64] C64 Programmers Reference Guide - page 290
// - [CM64] Computes Mapping the Commodore 64 - page 215
//
// CPU registers that has to be preserved (see [RG64]): none
//
@@ -32,3 +33,6 @@ plot_get:
ldy PNTR
ldx TBLX
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Clear screen and initialise line link table, described in:
@@ -28,3 +29,6 @@ clear_screen:
// Fall to cursor home routine
jmp cursor_home
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Home the cursor, described in:
@@ -13,3 +14,6 @@ cursor_home:
sta TBLX // current row
// FALLTROUGH to the next routine
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Set pointer (PNT) to current screen line , described in:
@@ -53,3 +54,6 @@ screen_calculate_USER:
sta USER+1
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Scroll the whole screen up by 1 logical line, described in:
@@ -128,3 +129,6 @@ screen_scroll_up_loop_done:
// Recalculate PNT and USER
jmp screen_calculate_PNT_USER
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Well-known routine, described in:
@@ -32,3 +33,6 @@ screen_clear_line:
// Done
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
@@ -8,6 +9,7 @@
// CPU registers that has to be preserved (see [RG64]): .A
//
SCREEN:
// There are only 2 sane ways to implement this routine,
@@ -17,3 +19,5 @@ SCREEN:
ldx #40 // 40 rows
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_advance_to_next_line:
@@ -17,3 +18,6 @@ screen_advance_to_next_line:
sta PNTR
jmp chrout_screen_calc_lptr_done
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Sets PNTR in a proper range (0-39 or 40-79)
@@ -58,3 +59,6 @@ screen_calculate_lnmx_79:
lda #79
sta LNMX
rts
#endif // ROM layout
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_check_space_ends_line:
@@ -8,3 +10,5 @@ screen_check_space_ends_line:
rts
#endif // ROM layout
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_code_to_petscii:
cmp #$1B
@@ -34,3 +36,6 @@ s2p_adc_40:
s2p_end:
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Get PNTR value clipped to 0-39 range in .Y, sets flags to compare with 0, can trash .A
@@ -14,3 +15,6 @@ screen_get_clipped_PNTR:
!:
cpy #$00
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_get_logical_line_end_ptr:
@@ -22,4 +23,7 @@ screen_get_logical_line_end_79:
screen_get_logical_line_end_39:
ldy #39
rts
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_grow_logical_line_done_scroll:
@@ -138,3 +139,6 @@ screen_grow_logical_line_copy_done:
inx
jsr screen_clear_line
jmp screen_calculate_PNTR_LNMX
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Helper routine to blank screen
@@ -26,3 +27,6 @@ screen_off:
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Helper routine to show screen
@@ -16,3 +17,6 @@ screen_on:
rts
#endif
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_preserve_sal_eal:
@@ -29,3 +30,6 @@ screen_common_sal_eal:
phy_trash_a
phx_trash_a
rts
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
screen_restore_sal_eal:
@@ -23,4 +24,7 @@ screen_restore_sal_eal:
sta SAL+0
jmp screen_common_sal_eal
#endif // ROM layout