diff --git a/src/basic/basic_commands_CC/cmd_cold.s b/src/basic/basic_commands_CC/cmd_cold.s index be21a689..e7300a4a 100644 --- a/src/basic/basic_commands_CC/cmd_cold.s +++ b/src/basic/basic_commands_CC/cmd_cold.s @@ -11,4 +11,4 @@ cmd_cold: jsr JCLALL // for extra safety jmp (vector_reset) // hardware CPU vector !: - rts \ No newline at end of file + rts diff --git a/src/basic/basic_commands_CC/helper_ask_if_sure.s b/src/basic/basic_commands_CC/helper_ask_if_sure.s index f68a92f9..92d36947 100644 --- a/src/basic/basic_commands_CC/helper_ask_if_sure.s +++ b/src/basic/basic_commands_CC/helper_ask_if_sure.s @@ -1,4 +1,5 @@ // #LAYOUT# STD * #TAKE +// #LAYOUT# M65 BASIC_1 #TAKE // #LAYOUT# * BASIC_0 #TAKE // #LAYOUT# * * #IGNORE @@ -10,6 +11,14 @@ helper_ask_if_sure: +#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + jsr map_BASIC_1 + jsr_ind VB1__helper_ask_if_sure + jmp map_NORMAL + +#else + // First check, if we are in direct mode,; if not, do not ask ldx CURLIN+1 @@ -63,3 +72,6 @@ helper_ask_if_sure_ok: clc rts + + +#endif // ROM layout diff --git a/src/basic/board_m65/4000.mega65_vectable_basic_1.s b/src/basic/board_m65/4000.mega65_vectable_basic_1.s index 70339ac0..d49ed0fe 100644 --- a/src/basic/board_m65/4000.mega65_vectable_basic_1.s +++ b/src/basic/board_m65/4000.mega65_vectable_basic_1.s @@ -9,6 +9,7 @@ #if SEGMENT_BASIC_0 + // Label definitions .label VB1__INITMSG = $4000 + 2 * 0 @@ -22,6 +23,11 @@ .label VB1__do_restore = $4000 + 2 * 8 .label VB1__cmd_mem_cont = $4000 + 2 * 9 .label VB1__prepare_direct_execution = $4000 + 2 * 10 + .label VB1__helper_ask_if_sure = $4000 + 2 * 11 + +#if CONFIG_DOS_WEDGE + .label VB1__wedge_dos = $4000 + 2 * 12 +#endif #else @@ -38,5 +44,11 @@ .word do_restore .word cmd_mem_cont .word prepare_direct_execution + .word helper_ask_if_sure + +#if CONFIG_DOS_WEDGE + .word wedge_dos +#endif + #endif diff --git a/src/basic/board_m65/mega65_imports.s b/src/basic/board_m65/mega65_imports.s index ac3d8582..9536789f 100644 --- a/src/basic/board_m65/mega65_imports.s +++ b/src/basic/board_m65/mega65_imports.s @@ -12,7 +12,17 @@ .label poke_via_OLDTXT = BASIC_0.proxy_B1_poke_via_OLDTXT .label JCHROUT = BASIC_0.proxy_B1_JCHROUT .label JCLALL = BASIC_0.proxy_B1_JCLALL +#if CONFIG_DOS_WEDGE +.label JCLOSE = BASIC_0.proxy_B1_JCLOSE +.label JOPEN = BASIC_0.proxy_B1_JOPEN +#endif .label JMEMTOP = KERNAL_0.JMEMTOP +.label JSETFLS = KERNAL_0.JSETFLS +.label JSETNAM = KERNAL_0.JSETNAM +.label JGETIN = KERNAL_0.JGETIN +.label JCHKIN = KERNAL_0.JCHKIN +.label JCHRIN = KERNAL_0.JCHRIN +.label JREADST = KERNAL_0.JREADST .label plot_set = KERNAL_0.plot_set .label init_oldtxt = BASIC_0.init_oldtxt .label rom_revision_basic_string = BASIC_0.rom_revision_basic_string @@ -25,3 +35,9 @@ .label do_error_fetch = BASIC_0.do_error_fetch .label do_basic_error = BASIC_0.do_basic_error .label str_rev_question = BASIC_0.str_rev_question +#if CONFIG_DOS_WEDGE +.label fetch_character = BASIC_0.proxy_B1_fetch_character +.label fetch_character_skip_spaces = BASIC_0.proxy_B1_fetch_character_skip_spaces +.label fetch_uint8 = BASIC_0.proxy_B1_fetch_uint8 +.label shell_main_loop = BASIC_0.proxy_B1_shell_main_loop +#endif diff --git a/src/basic/board_m65/mega65_proxies.s b/src/basic/board_m65/mega65_proxies.s index 191f4e81..63c91283 100644 --- a/src/basic/board_m65/mega65_proxies.s +++ b/src/basic/board_m65/mega65_proxies.s @@ -36,6 +36,22 @@ proxy_B1_JCLALL: jsr JCLALL jmp map_BASIC_1 +#if CONFIG_DOS_WEDGE + +proxy_B1_JCLOSE: + + jsr map_NORMAL + jsr JCLOSE + jmp map_BASIC_1 + + +proxy_B1_JOPEN: + + jsr map_NORMAL + jsr JOPEN + jmp map_BASIC_1 + +#endif proxy_B1_JCHROUT: @@ -74,3 +90,30 @@ proxy_B1_print_features: jmp map_BASIC_1 #endif + +#if CONFIG_DOS_WEDGE + +proxy_B1_fetch_character: + + jsr map_NORMAL + jsr fetch_character + jmp map_BASIC_1 + +proxy_B1_fetch_character_skip_spaces: + + jsr map_NORMAL + jsr fetch_character_skip_spaces + jmp map_BASIC_1 + +proxy_B1_fetch_uint8: + + jsr map_NORMAL + jsr fetch_uint8 + jmp map_BASIC_1 + +proxy_B1_shell_main_loop: + + jsr map_NORMAL + jmp shell_main_loop + +#endif diff --git a/src/basic/engine/is_alphanumeric.s b/src/basic/engine/is_alphanumeric.s index 44c61a46..fa85c4c5 100644 --- a/src/basic/engine/is_alphanumeric.s +++ b/src/basic/engine/is_alphanumeric.s @@ -1,4 +1,5 @@ // #LAYOUT# STD * #TAKE +// #LAYOUT# M65 BASIC_1 #TAKE // #LAYOUT# * BASIC_0 #TAKE // #LAYOUT# * * #IGNORE diff --git a/src/basic/engine/select_device.s b/src/basic/engine/select_device.s index ba23425d..20fbc6b4 100644 --- a/src/basic/engine/select_device.s +++ b/src/basic/engine/select_device.s @@ -1,7 +1,9 @@ // #LAYOUT# STD * #TAKE +// #LAYOUT# M65 BASIC_1 #TAKE // #LAYOUT# * BASIC_0 #TAKE // #LAYOUT# * * #IGNORE +// XXX for Mega65, it should be available in BASIC_1 segment only select_device: diff --git a/src/basic/wedge/wedge_dos.s b/src/basic/wedge/wedge_dos.s index 214d6d49..b1a1a555 100644 --- a/src/basic/wedge/wedge_dos.s +++ b/src/basic/wedge/wedge_dos.s @@ -1,4 +1,5 @@ // #LAYOUT# STD * #TAKE +// #LAYOUT# M65 BASIC_1 #TAKE // #LAYOUT# * BASIC_0 #TAKE // #LAYOUT# * * #IGNORE @@ -10,6 +11,14 @@ wedge_dos: +#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + jsr map_BASIC_1 + jsr_ind VB1__wedge_dos + jmp map_NORMAL + +#else + // Prepare buffer - finish it with '0' lda #$00 @@ -354,4 +363,6 @@ wedge_dos_setnam: jmp JSETNAM +#endif // ROM layout + #endif // CONFIG_DOS_WEDGE