From 4d568643271b7511e6c4b10b9c13cb46fb4ba37d Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 10 Jan 2020 22:03:10 +0100 Subject: [PATCH] initial support for Mega65 extra ROM --- Makefile | 90 +++++++++++++------ c64/basic/,aliases.s | 1 + c64/basic/,imports.s | 34 ++++--- c64/basic/a408.reason.s | 4 + c64/basic/a453.unknown.s | 6 +- c64/basic/a483.main.s | 8 +- c64/basic/a533.linkprg.s | 6 +- c64/basic/a57c.chrnch.s | 8 +- c64/basic/a644.new.s | 4 + c64/basic/a659.setcharptr.s | 4 + c64/basic/a68e.runc.s | 8 +- c64/basic/a71a.qplop.s | 8 +- c64/basic/a7ae.newstt.s | 10 ++- c64/basic/a7e4.gone.s | 8 +- c64/basic/ab1e.strout.s | 7 +- c64/basic/ad9e.frmevl.s | 4 + c64/basic/ae86.eval.s | 8 +- c64/basic/basic_adray1.s | 4 + c64/basic/basic_adray2.s | 4 + c64/basic/basic_delete_line.s | 5 ++ c64/basic/basic_do_error.s | 7 +- c64/basic/basic_execute_line.s | 9 +- c64/basic/basic_find_line.s | 5 ++ c64/basic/basic_find_next_line.s | 5 ++ c64/basic/basic_follow_link_to_next_line.s | 6 ++ c64/basic/basic_insert_line.s | 5 ++ c64/basic/basic_main_loop.s | 10 ++- c64/basic/basic_parse_line_number.s | 7 +- c64/basic/basic_shift_mem_down.s | 5 ++ c64/basic/basic_shift_mem_up.s | 4 + c64/basic/basic_vector_defaults.s | 8 +- c64/basic/bdcd.linprt.s | 6 +- c64/basic/c000.skip_gap.s | 5 ++ c64/basic/commands/cmd_break.s | 6 ++ c64/basic/commands/cmd_list.s | 5 +- c64/basic/commands/cmd_load.s | 10 ++- c64/basic/commands/cmd_new.s | 5 ++ c64/basic/commands/cmd_rem.s | 5 ++ c64/basic/commands/cmd_run.s | 8 +- c64/basic/commands/cmd_sys.s | 6 ++ c64/basic/commands/cmd_unimplemented.s | 5 ++ c64/basic/do_basic_error.s | 5 ++ c64/basic/e38b.error.s | 8 +- c64/basic/e3bf.init.s | 4 + c64/basic/e453.rvect.s | 4 + c64/basic/fac1_mul.s | 5 ++ c64/basic/init/a000.cold_start_vector.s | 6 +- c64/basic/init/a002.warm_start_vector.s | 7 +- c64/basic/init/basic_cold_start_internal.s | 5 ++ c64/basic/init/basic_warm_start_internal.s | 4 + c64/basic/init/e394.basic_cold_start.s | 10 ++- c64/basic/init/e3b7.basic_warm_start.jmp.s | 5 ++ c64/basic/init/e422.initmsg.jmp.s | 6 +- c64/basic/init/initmsg_bytes_free.s | 4 + c64/basic/init/initmsg_real.s | 4 + c64/basic/init/startup_banner.s | 4 + c64/basic/init_oldtxt.s | 5 ++ c64/basic/injest_comma.s | 5 ++ c64/basic/injest_number.s | 12 ++- c64/basic/pack_word.s | 5 ++ c64/basic/peek_line_pointer_null_check.s | 5 ++ c64/basic/print_integer.s | 5 ++ c64/basic/print_packed_message.s | 5 ++ c64/basic/ready_message.s | 5 ++ c64/basic/rom_revision/a004.identifier.s | 6 +- .../rom_revision/bf52.rom_revision_basic.s | 6 +- .../rom_revision/e4b7.rom_revision_kernal.s | 8 +- c64/basic/select_device.s | 9 +- c64/basic/tokenise_line.s | 4 + c64/basic/under_rom_routines.s | 5 ++ c64/basic/wedge_dos.s | 5 ++ c64/basic/wedge_tape.s | 5 ++ c64/kernal/,disabled/u64_load.s | 4 + c64/kernal/,stubs/e6b6.advance_cursor.s | 4 + c64/kernal/,stubs/e701.previous_line.s | 4 + c64/kernal/,stubs/e716.chrout_screen.s | 4 + c64/kernal/,stubs/e96c.insert_line_at_top.s | 4 + c64/kernal/,stubs/f646.iec_close.s | 5 +- c64/kernal/,stubs/fd90.unknown.s | 4 + c64/kernal/assets/cartridge_signature.s | 6 ++ c64/kernal/assets/e8da.colour_codes.s | 4 + c64/kernal/assets/fd30.vector_defaults.s | 8 +- c64/kernal/assets/irq_timing_hi.s | 4 + c64/kernal/assets/irq_timing_lo.s | 4 + c64/kernal/assets/kernal_messages.s | 4 + c64/kernal/errors.s | 12 ++- c64/kernal/iec/acptr.s | 8 +- c64/kernal/iec/chkin_iec.s | 4 + c64/kernal/iec/chrin_iec.s | 4 + c64/kernal/iec/chrout_iec.s | 4 + c64/kernal/iec/ciout.s | 8 +- c64/kernal/iec/ckout_iec.s | 4 + c64/kernal/iec/close_iec.s | 4 + c64/kernal/iec/clrchn_iec.s | 4 + c64/kernal/iec/iec_check_devnum.s | 4 + c64/kernal/iec/iec_close_load.s | 4 + c64/kernal/iec/iec_cmd_close.s | 4 + c64/kernal/iec/iec_cmd_open.s | 4 + c64/kernal/iec/iec_pull_release.s | 4 + c64/kernal/iec/iec_return.s | 4 + c64/kernal/iec/iec_rx_byte.s | 5 ++ c64/kernal/iec/iec_rx_check_eoi.s | 4 + c64/kernal/iec/iec_send_file_name.s | 4 + c64/kernal/iec/iec_set_idle.s | 4 + c64/kernal/iec/iec_turnaround_to_listen.s | 5 ++ c64/kernal/iec/iec_turnaround_to_talk.s | 5 ++ c64/kernal/iec/iec_tx_byte.s | 4 + c64/kernal/iec/iec_tx_command.s | 4 + c64/kernal/iec/iec_tx_command_finalize.s | 5 ++ c64/kernal/iec/iec_tx_flush.s | 4 + c64/kernal/iec/iec_update_eal_by_y.s | 4 + c64/kernal/iec/iec_wait1ms.s | 6 +- c64/kernal/iec/iec_wait20us.s | 4 + c64/kernal/iec/iec_wait60us.s | 4 + c64/kernal/iec/iec_wait_for_clk_release.s | 4 + c64/kernal/iec/iec_wait_for_data_pull.s | 4 + c64/kernal/iec/iec_wait_for_data_release.s | 4 + c64/kernal/iec/listen.s | 8 +- c64/kernal/iec/load_iec.s | 4 + c64/kernal/iec/open_iec.s | 4 + c64/kernal/iec/save_iec.s | 6 +- c64/kernal/iec/second.s | 8 +- c64/kernal/iec/talk.s | 8 +- c64/kernal/iec/tksa.s | 8 +- c64/kernal/iec/unlsn.s | 8 +- c64/kernal/iec/untlk.s | 10 ++- c64/kernal/iec_fast/burst_cia1_advertise.s | 4 + c64/kernal/iec_fast/burst_cia2_advertise.s | 4 + c64/kernal/iec_fast/burst_soft_advertise.s | 4 + c64/kernal/iec_fast/dolphindos_detect.s | 4 + c64/kernal/iec_fast/dolphindos_load.s | 4 + c64/kernal/iec_fast/jiffydos_bittable.s | 4 + c64/kernal/iec_fast/jiffydos_detect.s | 4 + c64/kernal/iec_fast/jiffydos_load.s | 4 + c64/kernal/iec_fast/jiffydos_prepare.s | 4 + c64/kernal/iec_fast/jiffydos_rx_byte.s | 4 + c64/kernal/iec_fast/jiffydos_tx_byte.s | 4 + c64/kernal/iec_fast/jiffydos_wait_line.s | 4 + c64/kernal/init/cartridge_check.s | 5 ++ c64/kernal/init/cint_screen_keyboard.s | 22 +++-- c64/kernal/init/e518.cint_legacy.s | 8 +- c64/kernal/init/e5a0.setup_vicii.s | 8 +- c64/kernal/init/fce2.hw_entry_reset.s | 5 ++ c64/kernal/init/fd50.ramtas.s | 14 +-- c64/kernal/init/fda3.ioinit.s | 8 +- c64/kernal/init/ff5b.cint.s | 8 +- c64/kernal/init/fffc.vector_reset.s | 5 ++ c64/kernal/init/setup_pal_ntsc.s | 6 +- .../interrupts/ea31.default_irq_handler.s | 5 ++ .../ea7e.ack_cia1_return_from_interrupt.s | 5 ++ .../interrupts/ea81.return_from_interrupt.s | 9 +- .../interrupts/fe47.default_nmi_handler.s | 10 ++- .../interrupts/fe66.default_brk_handler.s | 12 ++- c64/kernal/interrupts/fffa.vector_nmi.s | 5 ++ c64/kernal/interrupts/fffe.vector_irq.s | 5 ++ c64/kernal/interrupts/hw_entry_irq.s | 9 +- c64/kernal/interrupts/hw_entry_nmi.s | 7 +- c64/kernal/iostack/chkinout.s | 4 + c64/kernal/iostack/clall_real.s | 9 +- c64/kernal/iostack/f13e.getin.s | 8 +- c64/kernal/iostack/f157.chrin.s | 8 +- c64/kernal/iostack/f1ca.chrout.s | 10 ++- c64/kernal/iostack/f20e.chkin.s | 8 +- c64/kernal/iostack/f250.ckout.s | 18 +--- c64/kernal/iostack/f291.close.s | 10 ++- c64/kernal/iostack/f32f.clall.jmp.s | 5 ++ c64/kernal/iostack/f333.clrchn.s | 8 +- c64/kernal/iostack/f34a.open.s | 10 ++- c64/kernal/iostack/f49e.load_prep.s | 4 + c64/kernal/iostack/f4a5.load.s | 9 +- c64/kernal/iostack/f5dd.save_prep.s | 4 + c64/kernal/iostack/f5ed.save.s | 8 +- c64/kernal/iostack/findfls.s | 3 + c64/kernal/iostack/getin_real.s | 8 +- c64/kernal/iostack/load_save_common.s | 6 +- c64/kernal/iostack/readst.s | 12 ++- c64/kernal/iostack/setfls.s | 10 ++- c64/kernal/iostack/setmsg.s | 8 +- c64/kernal/iostack/setnam.s | 10 ++- c64/kernal/iostack/settmo.s | 9 +- c64/kernal/jumptable/ff81.jcint.s | 7 +- c64/kernal/jumptable/ff84.jioinit.s | 7 +- c64/kernal/jumptable/ff87.jramtas.s | 7 +- c64/kernal/jumptable/ff8a.jrestor.s | 7 +- c64/kernal/jumptable/ff8d.jvector.s | 7 +- c64/kernal/jumptable/ff90.jsetmsg.s | 7 +- c64/kernal/jumptable/ff93.jsecond.s | 7 +- c64/kernal/jumptable/ff96.jtksa.s | 7 +- c64/kernal/jumptable/ff99.jmemtop.s | 7 +- c64/kernal/jumptable/ff9c.jmembot.s | 7 +- c64/kernal/jumptable/ff9f.jscnkey.s | 7 +- c64/kernal/jumptable/ffa2.jsettmo.s | 7 +- c64/kernal/jumptable/ffa5.jacptr.s | 7 +- c64/kernal/jumptable/ffa8.jciout.s | 7 +- c64/kernal/jumptable/ffab.juntlk.s | 7 +- c64/kernal/jumptable/ffae.junlsn.s | 7 +- c64/kernal/jumptable/ffb1.jlisten.s | 7 +- c64/kernal/jumptable/ffb4.jtalk.s | 7 +- c64/kernal/jumptable/ffb7.jreadst.s | 7 +- c64/kernal/jumptable/ffba.jsetfls.s | 7 +- c64/kernal/jumptable/ffbd.jsetnam.s | 7 +- c64/kernal/jumptable/ffc0.jopen.s | 9 +- c64/kernal/jumptable/ffc3.jclose.s | 9 +- c64/kernal/jumptable/ffc6.jchkin.s | 9 +- c64/kernal/jumptable/ffc9.jckout.s | 9 +- c64/kernal/jumptable/ffcc.jclrchn.s | 9 +- c64/kernal/jumptable/ffcf.jchrin.s | 9 +- c64/kernal/jumptable/ffd2.jchrout.s | 9 +- c64/kernal/jumptable/ffd5.jload.s | 7 +- c64/kernal/jumptable/ffd8.jsave.s | 7 +- c64/kernal/jumptable/ffdb.jsettim.s | 7 +- c64/kernal/jumptable/ffde.jrdtim.s | 7 +- c64/kernal/jumptable/ffe1.jstop.s | 9 +- c64/kernal/jumptable/ffe4.jgetin.s | 9 +- c64/kernal/jumptable/ffe7.jclall.s | 7 +- c64/kernal/jumptable/ffea.judtim.s | 5 ++ c64/kernal/jumptable/ffed.jscreen.s | 5 ++ c64/kernal/jumptable/fff0.jplot.s | 5 ++ c64/kernal/jumptable/fff3.jiobase.s | 7 +- c64/kernal/keyboard/chrin_keyboard.s | 4 + c64/kernal/keyboard/f142.getin_keyboard.s | 4 + c64/kernal/keyboard/f6ed.stop.s | 10 ++- c64/kernal/keyboard/kb_matrix.s | 8 +- c64/kernal/keyboard/kb_matrix_128.s | 6 +- c64/kernal/keyboard/kb_matrix_65.s | 4 + c64/kernal/keyboard/kb_matrix_alwaysrepeat.s | 6 +- c64/kernal/keyboard/kb_matrix_bucky.s | 8 +- c64/kernal/keyboard/kb_matrix_bucky_filter.s | 6 +- c64/kernal/keyboard/kb_matrix_joy.s | 4 + c64/kernal/keyboard/kb_matrix_lookup.s | 4 + c64/kernal/keyboard/kb_matrix_lookup_legacy.s | 4 + c64/kernal/keyboard/kb_matrix_row_keys.s | 6 +- c64/kernal/keyboard/kb_matrix_row_offsets.s | 4 + c64/kernal/keyboard/keyboard_disconnect.s | 4 + c64/kernal/keyboard/pop_keyboard_buffer.s | 4 + c64/kernal/keyboard/programmable_keys.s | 4 + c64/kernal/keyboard/scnkey.s | 8 +- c64/kernal/keyboard/scnkey_128.s | 6 +- c64/kernal/keyboard/scnkey_65.s | 6 +- c64/kernal/keyboard/scnkey_legacy.s | 8 +- c64/kernal/keyboard/scnkey_set_keytab.s | 6 +- c64/kernal/keyboard/udtim_keyboard.s | 4 + c64/kernal/memory/fd15.restor.s | 8 +- c64/kernal/memory/fe25.memtop.s | 8 +- c64/kernal/memory/membot.s | 8 +- c64/kernal/memory/under_rom_routines.s | 5 ++ c64/kernal/memory/vector_real.s | 6 +- c64/kernal/panic.s | 4 + c64/kernal/print/print_features.s | 4 + c64/kernal/print/print_hex_byte.s | 4 + c64/kernal/print/print_kernal_message.s | 4 + c64/kernal/print/print_pal_ntsc.s | 6 +- c64/kernal/print/print_return.s | 4 + c64/kernal/print/print_space.s | 4 + c64/kernal/print/printf.s | 4 + .../rom_revision/ff80.kernal_revision.s | 7 +- c64/kernal/rs232/chkin_rs232_up2400.s | 4 + c64/kernal/rs232/chkin_rs232_up9600.s | 5 ++ c64/kernal/rs232/chrin_rs232_up2400.s | 4 + c64/kernal/rs232/chrin_rs232_up9600.s | 4 + c64/kernal/rs232/chrout_rs232.s | 4 + c64/kernal/rs232/ckout_rs232_up2400.s | 4 + c64/kernal/rs232/ckout_rs232_up9600.s | 4 + c64/kernal/rs232/close_rs232.s | 4 + c64/kernal/rs232/getin_rs232.s | 4 + c64/kernal/rs232/open_rs232.s | 4 + c64/kernal/rs232/rs232_count_channels.s | 4 + c64/kernal/rs232/up9600_disable.s | 4 + c64/kernal/rs232/up9600_enable.s | 6 +- c64/kernal/rs232/up9600_ihitab.s | 4 + c64/kernal/rs232/up9600_ilotab.s | 4 + c64/kernal/rs232/up9600_irq.s | 4 + c64/kernal/rs232/up9600_nmi.s | 4 + c64/kernal/rs232/up9600_rsin.s | 4 + c64/kernal/rs232/up9600_rsout.s | 4 + c64/kernal/screen/chrout_screen.s | 4 + c64/kernal/screen/chrout_screen_clr.s | 5 ++ c64/kernal/screen/chrout_screen_control.s | 4 + c64/kernal/screen/chrout_screen_crsr.s | 4 + c64/kernal/screen/chrout_screen_del.s | 4 + c64/kernal/screen/chrout_screen_gfxtxt.s | 4 + c64/kernal/screen/chrout_screen_home.s | 4 + c64/kernal/screen/chrout_screen_ins.s | 4 + .../screen/chrout_screen_jumptable_codes.s | 4 + c64/kernal/screen/chrout_screen_quote.s | 4 + c64/kernal/screen/chrout_screen_return.s | 4 + c64/kernal/screen/chrout_screen_rvs.s | 4 + c64/kernal/screen/chrout_screen_shift_onoff.s | 4 + c64/kernal/screen/chrout_screen_stop.s | 4 + c64/kernal/screen/chrout_screen_tab.s | 4 + c64/kernal/screen/cursor.s | 4 + c64/kernal/screen/cursor_enable.s | 4 + c64/kernal/screen/cursor_show.s | 4 + c64/kernal/screen/e50a.plot.s | 8 +- c64/kernal/screen/e544.clear_screen.s | 4 + c64/kernal/screen/e566.cursor_home.s | 4 + .../screen/e56c.screen_calculate_pnt_user.s | 4 + c64/kernal/screen/e8ea.screen_scroll_up.s | 4 + c64/kernal/screen/e9ff.screen_clear_line.s | 4 + c64/kernal/screen/screen.s | 4 + .../screen/screen_advance_to_next_line.s | 4 + .../screen/screen_calculate_pntr_lnmx.s | 4 + .../screen/screen_check_space_ends_line.s | 4 + c64/kernal/screen/screen_code_to_petscii.s | 5 ++ c64/kernal/screen/screen_get_cliped_pntr.s | 4 + .../screen/screen_get_logical_line_end_ptr.s | 6 +- c64/kernal/screen/screen_grow_logical_line.s | 4 + c64/kernal/screen/screen_off.s | 4 + c64/kernal/screen/screen_on.s | 4 + c64/kernal/screen/screen_preserve_sal_eal.s | 4 + c64/kernal/screen/screen_restore_sal_eal.s | 4 + c64/kernal/tape/load_tape_normal.s | 4 + c64/kernal/tape/load_tape_turbo.s | 4 + c64/kernal/tape/tape_common.s | 4 + c64/kernal/tape/tape_common_clean_sid.s | 4 + c64/kernal/tape/tape_common_ditch_verify.s | 4 + c64/kernal/tape/tape_common_motor.s | 4 + c64/kernal/tape/tape_common_screen.s | 4 + c64/kernal/tape/tape_normal_get_bit.s | 4 + c64/kernal/tape/tape_normal_get_byte.s | 4 + c64/kernal/tape/tape_normal_get_data.s | 4 + c64/kernal/tape/tape_normal_get_marker.s | 5 ++ c64/kernal/tape/tape_normal_get_pulse.s | 5 ++ c64/kernal/tape/tape_normal_pilot.s | 5 ++ c64/kernal/tape/tape_normal_sync.s | 4 + c64/kernal/tape/tape_turbo_bytestore.s | 4 + c64/kernal/tape/tape_turbo_get_bit.s | 4 + c64/kernal/tape/tape_turbo_get_byte.s | 4 + c64/kernal/tape/tape_turbo_sync.s | 4 + c64/kernal/time/rdtim.s | 9 +- c64/kernal/time/settim.s | 9 +- c64/kernal/time/udtim.s | 8 +- src/build_segment.cc | 10 ++- 333 files changed, 1747 insertions(+), 289 deletions(-) diff --git a/Makefile b/Makefile index 1071b379..c5a6c117 100644 --- a/Makefile +++ b/Makefile @@ -55,11 +55,19 @@ TOOLS_LIST = $(pathsubst src/tools/%,build/tools/%,$(basename $(SRC_TOOLS))) # List of targets -STD_TARGET_LIST = build/kernal_custom.rom build/basic_custom.rom \ - build/kernal_generic.rom build/basic_generic.rom \ - build/kernal_testing.rom build/basic_testing.rom \ - build/kernal_mega65.rom build/basic_mega65.rom \ - build/kernal_ultimate64.rom build/basic_ultimate64.rom \ +STD_TARGET_LIST_CUSTOM = build/kernal_custom.rom build/basic_custom.rom +STD_TARGET_LIST_GENERIC = build/kernal_generic.rom build/basic_generic.rom +STD_TARGET_LIST_TESTING = build/kernal_testing.rom build/basic_testing.rom +STD_TARGET_LIST_ULTIMATE64 = build/kernal_ultimate64.rom build/basic_ultimate64.rom +STD_TARGET_LIST_MEGA65 = build/kernal_mega65.rom_0 \ + build/kernal_mega65.rom_1 \ + build/basic_mega65.rom_0 + +STD_TARGET_LIST = $(STD_TARGET_LIST_CUSTOM) \ + $(STD_TARGET_LIST_GENERIC) \ + $(STD_TARGET_LIST_TESTING) \ + $(STD_TARGET_LIST_MEGA65) \ + $(STD_TARGET_LIST_ULTIMATE64) \ build/chargen.rom EXT_TARGET_LIST = build/mega65.rom @@ -126,9 +134,9 @@ build/target_testing/OUTB.BIN build/target_testing/BASIC_combined.vs: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ c64/,,config_testing.s build/target_testing/KERNAL_combined.sym \ $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTB.BIN build/target_mega65/BASIC_combined.vs: \ +build/target_mega65/OUTB_0.BIN build/target_mega65/BASIC_0_combined.vs: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ - c64/,,config_mega65.s build/target_mega65/KERNAL_combined.sym \ + c64/,,config_mega65.s build/target_mega65/KERNAL_0_combined.sym \ $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ @@ -147,37 +155,41 @@ build/target_testing/OUTK.BIN build/target_testing/KERNAL_combined.vs bu $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_testing.s \ $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTK.BIN build/target_mega65/KERNAL_combined.vs build/target_mega65/KERNAL_combined.sym: \ +build/target_mega65/OUTK_0.BIN build/target_mega65/KERNAL_0_combined.vs build/target_mega65/KERNAL_0_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_mega65.s \ $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTK_1.BIN build/target_mega65/KERNAL_1_combined.vs build/target_mega65/KERNAL_1_combined.sym: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ + c64/,,config_mega65.s \ + $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs build/target_ultimate64/KERNAL_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_ultimate64.s \ $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) -build/target_custom/newrom: build/target_custom/OUTB.BIN build/target_custom/OUTK.BIN -build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN -build/target_testing/newrom: build/target_testing/OUTB.BIN build/target_testing/OUTK.BIN -build/target_mega65/newrom: build/target_mega65/OUTB.BIN build/target_mega65/OUTK.BIN -build/target_ultimate64/newrom: build/target_ultimate64/OUTB.BIN build/target_ultimate64/OUTK.BIN +build/target_custom/newrom: build/target_custom/OUTB.BIN build/target_custom/OUTK.BIN +build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN +build/target_testing/newrom: build/target_testing/OUTB.BIN build/target_testing/OUTK.BIN +build/target_mega65/newrom_0: build/target_mega65/OUTB_0.BIN build/target_mega65/OUTK_0.BIN +build/target_ultimate64/newrom: build/target_ultimate64/OUTB.BIN build/target_ultimate64/OUTK.BIN build/kernal_custom.rom: build/target_custom/newrom build/kernal_generic.rom: build/target_generic/newrom build/kernal_testing.rom: build/target_testing/newrom -build/kernal_mega65.rom: build/target_mega65/newrom +build/kernal_mega65.rom_0: build/target_mega65/newrom_0 build/kernal_ultimate64.rom: build/target_ultimate64/newrom build/basic_custom.rom: build/target_custom/newrom build/basic_generic.rom: build/target_generic/newrom build/basic_testing.rom: build/target_testing/newrom -build/basic_mega65.rom: build/target_mega65/newrom +build/basic_mega65.rom_0: build/target_mega65/newrom_0 build/basic_ultimate64.rom: build/target_ultimate64/newrom build/symbols_custom.vs: build/target_custom/BASIC_combined.vs build/target_custom/KERNAL_combined.vs build/symbols_generic.vs: build/target_generic/BASIC_combined.vs build/target_generic/KERNAL_combined.vs build/symbols_testing.vs: build/target_testing/BASIC_combined.vs build/target_testing/KERNAL_combined.vs -build/symbols_mega65.vs: build/target_mega65/BASIC_combined.vs build/target_mega65/KERNAL_combined.vs +build/symbols_mega65_0.vs: build/target_mega65/BASIC_0_combined.vs build/target_mega65/KERNAL_0_combined.vs build/symbols_ultimate64.vs: build/target_ultimate64/BASIC_combined.vs build/target_ultimate64/KERNAL_combined.vs # Rules - BASIC and KERNAL @@ -190,13 +202,29 @@ build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT) build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs: @mkdir -p build/target_$* @rm -f $@* build/target_$*/BASIC* - @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC) .PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym: @mkdir -p build/target_$* @rm -f $@* build/target_$*/KERNAL* - @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL) + +build/target_mega65/OUTB_0.BIN build/target_mega65/BASIC_0_combined.vs: + @mkdir -p build/target_mega65 + @rm -f $@* build/target_mega65/BASIC_0* + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d build/target_mega65 -l a000 -h e4d2 c64/,,config_mega65.s $(SRCDIR_BASIC) $(GEN_BASIC) + +build/target_mega65/OUTK_0.BIN build/target_mega65/KERNAL_0_combined.vs build/target_mega65/KERNAL_0_combined.sym: + @mkdir -p build/target_mega65 + @rm -f $@* build/target_mega65/KERNAL_0* + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d build/target_mega65 -l e4d3 -h ffff c64/,,config_mega65.s $(SRCDIR_KERNAL) $(GEN_KERNAL) + +build/kernal_mega65.rom_1 build/target_mega65/OUTK_1.BIN build/target_mega65/KERNAL_1_combined.vs build/target_mega65/KERNAL_1_combined.sym: + @mkdir -p build/target_mega65 + @rm -f $@* build/kernal_mega65.rom_1 build/target_mega65/KERNAL_1* + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_1 -i KERNAL_1-mega65 -o OUTK_1.BIN -d build/target_mega65 -l 4000 -h 7fff c64/,,config_mega65.s $(SRCDIR_KERNAL) $(GEN_KERNAL) + @cp build/target_mega65/OUTK_1.BIN build/kernal_mega65.rom_1 .PRECIOUS: build/target_%/newrom build/target_%/newrom: @@ -214,6 +242,15 @@ build/basic_%.rom: build/symbols_%.vs: sort build/target_$*/BASIC_combined.vs build/target_$*/KERNAL_combined.vs | uniq | grep -v "__" > $@ +build/target_mega65/newrom_0: + cat build/target_mega65/OUTB_0.BIN build/target_mega65/OUTK_0.BIN > $@ + +build/kernal_mega65.rom_0: + dd if=build/target_mega65/newrom_0 bs=8192 count=1 skip=2 of=$@ + +build/basic_mega65.rom_0: + dd if=build/target_mega65/newrom_0 bs=8192 count=1 skip=0 of=$@ + build/kernal_hybrid.rom: kernal build/target_generic/OUTK.BIN @echo @echo $(HYBRID_WARNING) @@ -228,12 +265,14 @@ build/symbols_hybrid.vs: build/target_generic/KERNAL_combined.vs # Rules - platform 'Mega 65' specific -build/mega65.rom: build/kernal_mega65.rom build/basic_mega65.rom build/chargen.rom - dd if=/dev/zero bs=4096 count=10 of=build/mega65.rom - cat build/basic_mega65.rom build/chargen.rom build/chargen.rom build/kernal_mega65.rom >> build/mega65.rom - dd if=/dev/zero bs=65536 count=1 of=build/padding - cat build/padding >> build/mega65.rom - rm -f build/padding +build/mega65.rom: build/kernal_0_mega65.rom build/target_mega65/OUTK_1.BIN build/basic_mega65.rom build/chargen.rom + cat build/target_mega65/OUTK_1.BIN > build/mega65.rom + dd if=/dev/zero bs=4096 count=6 of=build/padding1 + cat build/padding1 >> build/mega65.rom + cat build/basic_mega65.rom build/chargen.rom build/chargen.rom build/kernal_0_mega65.rom >> build/mega65.rom + dd if=/dev/zero bs=4096 count=16 of=build/padding2 + cat build/padding2 >> build/mega65.rom + rm -f build/padding* # Rules - tests @@ -256,9 +295,6 @@ test_generic_x128: build/kernal_generic.rom build/basic_generic.rom build/symbol test_testing: build/kernal_testing.rom build/basic_testing.rom build/symbols_testing.vs x64 -kernal build/kernal_testing.rom -basic build/basic_testing.rom -moncommands build/symbols_testing.vs -1 $(TESTTAPE) -8 $(TESTDISK) -test_mega65_vice: build/kernal_mega65.rom build/basic_mega65.rom build/symbols_mega65.vs - x64 -kernal build/kernal_mega65.rom -basic build/basic_mega65.rom -moncommands build/symbols_mega65.vs -1 $(TESTTAPE) -8 $(TESTDISK) - test_mega65: build/mega65.rom ../xemu/build/bin/xmega65.native -dmarev 2 -forcerom -loadrom build/mega65.rom diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index 2726f748..37741819 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -1,3 +1,4 @@ + // // Helper aliases to make the code more readable // Always use double underscore in label names diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s index 525459f4..ebcf56c9 100644 --- a/c64/basic/,imports.s +++ b/c64/basic/,imports.s @@ -1,28 +1,42 @@ // Routines imported from Kernal - our private API -#import "KERNAL_combined.sym" +#if ROM_LAYOUT_STD + #import "KERNAL_combined.sym" +#else + #import "KERNAL_0_combined.sym" +#endif + + +.function KERNAL() +{ +#if ROM_LAYOUT_STD + .return KERNAL +#else + .return KERNAL_0 +#endif +} #if CONFIG_PANIC_SCREEN -.label panic = KERNAL.panic +.label panic = KERNAL().panic #endif -.label hw_entry_reset = KERNAL.hw_entry_reset +.label hw_entry_reset = KERNAL().hw_entry_reset #if CONFIG_DBG_PRINTF -.label printf = KERNAL.printf +.label printf = KERNAL().printf #endif -.label plot_set = KERNAL.plot_set -.label print_hex_byte = KERNAL.print_hex_byte -.label print_return = KERNAL.print_return -.label print_space = KERNAL.print_space +.label plot_set = KERNAL().plot_set +.label print_hex_byte = KERNAL().print_hex_byte +.label print_return = KERNAL().print_return +.label print_space = KERNAL().print_space #if CONFIG_SHOW_FEATURES -.label print_features = KERNAL.print_features +.label print_features = KERNAL().print_features #endif #if CONFIG_SHOW_PAL_NTSC -.label print_pal_ntsc = KERNAL.print_pal_ntsc +.label print_pal_ntsc = KERNAL().print_pal_ntsc #endif diff --git a/c64/basic/a408.reason.s b/c64/basic/a408.reason.s index f7613215..cc75fcb8 100644 --- a/c64/basic/a408.reason.s +++ b/c64/basic/a408.reason.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation REASON: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a453.unknown.s b/c64/basic/a453.unknown.s index ecb53d23..1aef3f04 100644 --- a/c64/basic/a453.unknown.s +++ b/c64/basic/a453.unknown.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation - STUB_IMPLEMENTATION() \ No newline at end of file + STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a483.main.s b/c64/basic/a483.main.s index 40415b24..f15fd4d2 100644 --- a/c64/basic/a483.main.s +++ b/c64/basic/a483.main.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 69, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ MAIN: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a533.linkprg.s b/c64/basic/a533.linkprg.s index 675a794e..fabfd806 100644 --- a/c64/basic/a533.linkprg.s +++ b/c64/basic/a533.linkprg.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Well-known BASIC routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 95 +// - [CM64] Computes Mapping the Commodore 64 - page 95 // - https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 // @@ -89,3 +90,6 @@ linkprg_end_of_line_search: sta OLDTXT+0 jmp linkprg_loop + + +#endif // ROM layout diff --git a/c64/basic/a57c.chrnch.s b/c64/basic/a57c.chrnch.s index 4f462ff6..61e459bb 100644 --- a/c64/basic/a57c.chrnch.s +++ b/c64/basic/a57c.chrnch.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 69, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ CHRNCH: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a644.new.s b/c64/basic/a644.new.s index e4e54f59..0e99bcdb 100644 --- a/c64/basic/a644.new.s +++ b/c64/basic/a644.new.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and real implementation new: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a659.setcharptr.s b/c64/basic/a659.setcharptr.s index b7383332..d0c6dc75 100644 --- a/c64/basic/a659.setcharptr.s +++ b/c64/basic/a659.setcharptr.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation // see: https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 @@ -5,3 +6,6 @@ setcharptr: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a68e.runc.s b/c64/basic/a68e.runc.s index 5daa4b22..13fe9092 100644 --- a/c64/basic/a68e.runc.s +++ b/c64/basic/a68e.runc.s @@ -1,7 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // Well-known BASIC routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 97 +// - [CM64] Computes Mapping the Commodore 64 - page 97 // - https://www.c64-wiki.com/wiki/BASIC-ROM // - https://csdb.dk/forums/?roomid=11&topicid=137233 // @@ -13,7 +14,7 @@ RUNC: // But CSDB claims, that it should 'set current character pointer to start of basic - 1' - this // looks sane, also checked that the original BASIC routine does this (short test program) - // Let's initialize TXTPTR using TXTTAB + // Lets initialize TXTPTR using TXTTAB lda TXTTAB+0 sec @@ -25,3 +26,6 @@ RUNC: sta TXTPTR+1 rts + + +#endif // ROM layout diff --git a/c64/basic/a71a.qplop.s b/c64/basic/a71a.qplop.s index efa99f31..6613fc99 100644 --- a/c64/basic/a71a.qplop.s +++ b/c64/basic/a71a.qplop.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 69, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ QPLOP: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/a7ae.newstt.s b/c64/basic/a7ae.newstt.s index 6dde6ca2..152e22ab 100644 --- a/c64/basic/a7ae.newstt.s +++ b/c64/basic/a7ae.newstt.s @@ -1,18 +1,22 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // Well-known BASIC routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 97 +// - [CM64] Computes Mapping the Commodore 64 - page 97 // - https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 // - https://www.lemon64.com/forum/viewtopic.php?t=70680&sid=3ff66caf7f5fdf2a3c2ff2ee31fc3fd8 // - https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image NEWSTT: - // XXX Real implementation is more complicated, it's actually a part + // XXX Real implementation is more complicated, it iss actually a part // of the BASIC main loop. It is, however, often called by various // utilities to simply run the software which was just loaded or // uncompressed. - // For now, let's cheat a little - this should provide some compatibility: + // For now, lets cheat a little - this should provide some compatibility: jmp cmd_run + + +#endif // ROM layout diff --git a/c64/basic/a7e4.gone.s b/c64/basic/a7e4.gone.s index 547f648a..9d598298 100644 --- a/c64/basic/a7e4.gone.s +++ b/c64/basic/a7e4.gone.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 70, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 70, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ GONE: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/ab1e.strout.s b/c64/basic/ab1e.strout.s index 4ad77a99..01da716d 100644 --- a/c64/basic/ab1e.strout.s +++ b/c64/basic/ab1e.strout.s @@ -1,5 +1,7 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Print string at $YYAA -// Compute's Mapping the 64 p101 +// Computes Mapping the 64 p101 // print string routine @@ -31,3 +33,6 @@ STROUT: pla // XXX can we use plx_trash_a here? tax rts + + +#endif // ROM layout diff --git a/c64/basic/ad9e.frmevl.s b/c64/basic/ad9e.frmevl.s index 2b41983e..a63ec8b2 100644 --- a/c64/basic/ad9e.frmevl.s +++ b/c64/basic/ad9e.frmevl.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation FRMEVL: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/ae86.eval.s b/c64/basic/ae86.eval.s index 423eb01a..b2bf858d 100644 --- a/c64/basic/ae86.eval.s +++ b/c64/basic/ae86.eval.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 70, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 70, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ EVAL: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/basic_adray1.s b/c64/basic/basic_adray1.s index 879a6bce..c23e0256 100644 --- a/c64/basic/basic_adray1.s +++ b/c64/basic/basic_adray1.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation basic_adray1: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/basic_adray2.s b/c64/basic/basic_adray2.s index dbdd00c1..32bfc72f 100644 --- a/c64/basic/basic_adray2.s +++ b/c64/basic/basic_adray2.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation basic_adray2: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/basic_delete_line.s b/c64/basic/basic_delete_line.s index 33a3d5b5..2da34969 100644 --- a/c64/basic/basic_delete_line.s +++ b/c64/basic/basic_delete_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Delete the current BASIC line, which is assumed to have already // been found with basic_find_line. // Really only consists of copying memory down. @@ -80,3 +82,6 @@ basic_delete_line: clc rts + + +#endif // ROM layout diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s index e4525fc6..e3ef4bec 100644 --- a/c64/basic/basic_do_error.s +++ b/c64/basic/basic_do_error.s @@ -1,4 +1,6 @@ -// Compute's Mapping the 64 p93 +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + +// Computes Mapping the 64 p93 basic_do_error: // Save error number @@ -29,3 +31,6 @@ basic_do_error: ldx #$FE txs jmp basic_main_loop + + +#endif // ROM layout diff --git a/c64/basic/basic_execute_line.s b/c64/basic/basic_execute_line.s index e8c2c191..81064f46 100644 --- a/c64/basic/basic_execute_line.s +++ b/c64/basic/basic_execute_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Jump back into the BASIC execute line loop // after first checking that we have a colon // or $00 char @@ -87,7 +89,7 @@ basic_execute_statement: cmp #$7f bcc not_a_token - // It's a token: So get the jump table entry for it, push it on the stack + // It is a token: So get the jump table entry for it, push it on the stack // and then RTS to start it. asl tax @@ -112,7 +114,7 @@ not_a_token: cmp #$3a beq basic_skip_char - // If all else fails, it's a syntax error + // If all else fails, it is a syntax error jmp do_SYNTAX_error basic_skip_char: @@ -365,3 +367,6 @@ basic_command_jump_table: .word cmd_unimplemented-1 .word cmd_unimplemented-1 .word cmd_unimplemented-1 + + +#endif // ROM layout diff --git a/c64/basic/basic_find_line.s b/c64/basic/basic_find_line.s index 3f9ec214..cc35e1bb 100644 --- a/c64/basic/basic_find_line.s +++ b/c64/basic/basic_find_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Find the BASIC line with number LINNUM @@ -79,3 +81,6 @@ more_lines_exist: sta OLDTXT+0 jmp basic_find_line_loop + + +#endif // ROM layout diff --git a/c64/basic/basic_find_next_line.s b/c64/basic/basic_find_next_line.s index c3b86d1d..fc2f5b97 100644 --- a/c64/basic/basic_find_next_line.s +++ b/c64/basic/basic_find_next_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Advance OLDTXT by following the // link to the next line @@ -25,3 +27,6 @@ basic_find_next_line: pla sta OLDTXT+0 rts + + +#endif // ROM layout diff --git a/c64/basic/basic_follow_link_to_next_line.s b/c64/basic/basic_follow_link_to_next_line.s index 1a9b138c..5b32eae9 100644 --- a/c64/basic/basic_follow_link_to_next_line.s +++ b/c64/basic/basic_follow_link_to_next_line.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + basic_follow_link_to_next_line: ldy #0 @@ -21,3 +24,6 @@ basic_follow_link_to_next_line: pla sta OLDTXT+0 rts + + +#endif // ROM layout diff --git a/c64/basic/basic_insert_line.s b/c64/basic/basic_insert_line.s index 17153e32..9eb95955 100644 --- a/c64/basic/basic_insert_line.s +++ b/c64/basic/basic_insert_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Insert the tokenised line stored at $0200. // First work out where in the list to put it // (basic_find_line with the line number can be used to work @@ -98,3 +100,6 @@ line_store_loop: clc rts + + +#endif // ROM layout diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index 55ea6dce..238a9c07 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + basic_main_loop: // XXX - Check if direct or program mode, and get next line of input @@ -24,7 +27,7 @@ read_line_loop: // Not carriage return, so try to append to line so far cpx #80 bcc !+ - // Report STRING TOO LONG error (Compute's Mapping the 64 p93) + // Report STRING TOO LONG error (Computes Mapping the 64 p93) ldx #22 jmp basic_do_error !: @@ -168,8 +171,11 @@ not_a_line: // Put invalid line number in current line number value, // so that we know we are in direct mode - // (Compute's Mapping the 64 p19) + // (Computes Mapping the 64 p19) lda #$FF sta CURLIN+1 jmp basic_execute_statement + + +#endif // ROM layout diff --git a/c64/basic/basic_parse_line_number.s b/c64/basic/basic_parse_line_number.s index c4b9910f..3e1ae801 100644 --- a/c64/basic/basic_parse_line_number.s +++ b/c64/basic/basic_parse_line_number.s @@ -1,4 +1,6 @@ - +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + basic_parse_line_number: jsr injest_number @@ -25,3 +27,6 @@ ml_bad_line_number: sta LINNUM+1 clc rts + + +#endif // ROM layout diff --git a/c64/basic/basic_shift_mem_down.s b/c64/basic/basic_shift_mem_down.s index 8c9f5a15..2daa4fa2 100644 --- a/c64/basic/basic_shift_mem_down.s +++ b/c64/basic/basic_shift_mem_down.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + basic_shift_mem_down_and_relink: // Shift memory down to basic_current_line_pointer // from X bytes further along. @@ -169,3 +172,5 @@ relink_down_loop: clc rts + +#endif // ROM layout diff --git a/c64/basic/basic_shift_mem_up.s b/c64/basic/basic_shift_mem_up.s index e01870a6..763582f2 100644 --- a/c64/basic/basic_shift_mem_up.s +++ b/c64/basic/basic_shift_mem_up.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) basic_shift_mem_up_and_relink: @@ -202,3 +203,6 @@ relink_up_loop: bcs relink_up_next_line rts + + +#endif // ROM layout diff --git a/c64/basic/basic_vector_defaults.s b/c64/basic/basic_vector_defaults.s index a12d2275..6646b345 100644 --- a/c64/basic/basic_vector_defaults.s +++ b/c64/basic/basic_vector_defaults.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Default values for BASIC vectors - described in: // -// - [RG64] C64 Programmer's Reference Guide - pages 68-70 -// - [CM64] Compute's Mapping the Commodore 64 - page 318 +// - [RG64] C64 Programmers Reference Guide - pages 68-70 +// - [CM64] Computes Mapping the Commodore 64 - page 318 // basic_vector_defaults_1: @@ -19,3 +20,6 @@ basic_vector_defaults_2: .word basic_adray1 // ADRAY1 .word basic_adray2 // ADRAY2 + + +#endif // ROM layout diff --git a/c64/basic/bdcd.linprt.s b/c64/basic/bdcd.linprt.s index 7e58bebe..1f104e3b 100644 --- a/c64/basic/bdcd.linprt.s +++ b/c64/basic/bdcd.linprt.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Well-known BASIC routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 116, XXX +// - [CM64] Computes Mapping the Commodore 64 - page 116, XXX // @@ -10,3 +11,6 @@ LINPRT: // XXX This is temporary, to allow some software to work! // To be replaced by real impleementation. jmp print_integer + + +#endif // ROM layout diff --git a/c64/basic/c000.skip_gap.s b/c64/basic/c000.skip_gap.s index 3ad7357c..5d45cdcf 100644 --- a/c64/basic/c000.skip_gap.s +++ b/c64/basic/c000.skip_gap.s @@ -1,3 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Skip the gap between $C000-$DFFF .fill $2000, $00 + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_break.s b/c64/basic/commands/cmd_break.s index 82909193..17673e7d 100644 --- a/c64/basic/commands/cmd_break.s +++ b/c64/basic/commands/cmd_break.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + cmd_stop: ldx #30 // "BREAK" jsr print_packed_message @@ -20,3 +23,6 @@ cmd_stop: cmd_end: jmp basic_main_loop + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_list.s b/c64/basic/commands/cmd_list.s index 6cf022e5..7c79e958 100644 --- a/c64/basic/commands/cmd_list.s +++ b/c64/basic/commands/cmd_list.s @@ -1,5 +1,7 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // LIST basic text. -// XXX - Doesn't currently support line number ranges +// XXX - Does not currently support line number ranges cmd_list: @@ -148,3 +150,4 @@ list_end_of_line: jmp print_return +#endif // ROM layout diff --git a/c64/basic/commands/cmd_load.s b/c64/basic/commands/cmd_load.s index 20e2a501..70cb30df 100644 --- a/c64/basic/commands/cmd_load.s +++ b/c64/basic/commands/cmd_load.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + cmd_load: // Parse filename @@ -7,7 +10,7 @@ cmd_load: // Parse optional device # // Parse optional secondary address - // XXX - C64 BASIC apparently doesn't clear variables after a LOAD in the + // XXX - C64 BASIC apparently does not clear variables after a LOAD in the // middle of a program. For safety, we do. jsr basic_do_clr @@ -77,7 +80,7 @@ got_devicenumber: sta SA jmp cmd_load_got_secondaryaddress !: - // Second parameter is above 255, this can't be a secondary address + // Second parameter is above 255, this can not be a secondary address // Use it as load address instead // XXX temporary syntax, it would be better to use something // XXX like 'LOAD"FILE",8 TO 49152' @@ -126,3 +129,6 @@ load_no_error: // XXX - should run program if LOAD was used in program mode jmp basic_main_loop + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_new.s b/c64/basic/commands/cmd_new.s index 2c3102bf..f4ddf91b 100644 --- a/c64/basic/commands/cmd_new.s +++ b/c64/basic/commands/cmd_new.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + cmd_new: jsr basic_do_new @@ -78,3 +80,6 @@ basic_do_clr: sta STREND+1 rts + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_rem.s b/c64/basic/commands/cmd_rem.s index 24af2e0b..4d6daaa9 100644 --- a/c64/basic/commands/cmd_rem.s +++ b/c64/basic/commands/cmd_rem.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // REM statement just skips to the next line cmd_rem: jmp basic_end_of_line + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_run.s b/c64/basic/commands/cmd_run.s index 6e718c81..310a4d34 100644 --- a/c64/basic/commands/cmd_run.s +++ b/c64/basic/commands/cmd_run.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + cmd_run: // RUN clears all variables jsr basic_do_clr @@ -15,8 +18,11 @@ cmd_goto: jsr basic_parse_line_number jsr basic_find_line bcc !+ - // Line doesn't exist, so report error + // Line does not exist, so report error jmp do_UNDEFD_STATEMENT_error !: // Run it! jmp basic_execute_from_current_line + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_sys.s b/c64/basic/commands/cmd_sys.s index 9f1c637c..b4953c7b 100644 --- a/c64/basic/commands/cmd_sys.s +++ b/c64/basic/commands/cmd_sys.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + cmd_sys: jsr basic_end_of_statement_check @@ -66,3 +69,6 @@ cmd_sys_setup_call: cmd_sys_hack_str: .byte $FF, $AC, $36, $35, $36, $00 + + +#endif // ROM layout diff --git a/c64/basic/commands/cmd_unimplemented.s b/c64/basic/commands/cmd_unimplemented.s index ffdffd96..0252f1ef 100644 --- a/c64/basic/commands/cmd_unimplemented.s +++ b/c64/basic/commands/cmd_unimplemented.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // // Default handler for all not-yet-implemented commands // @@ -154,3 +156,6 @@ cmd_go: cmd_unimplemented: jmp do_NOT_IMPLEMENTED_error + + +#endif // ROM layout diff --git a/c64/basic/do_basic_error.s b/c64/basic/do_basic_error.s index 1135e102..1e388470 100644 --- a/c64/basic/do_basic_error.s +++ b/c64/basic/do_basic_error.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // As many errors are triggered from many places in the BASIC // interprettor, it is important to have an efficicent means of // calling them. @@ -165,3 +167,6 @@ do_basic_error: // XXX - Restore stack depth first? jmp basic_main_loop + + +#endif // ROM layout diff --git a/c64/basic/e38b.error.s b/c64/basic/e38b.error.s index 43954f1d..4d270eba 100644 --- a/c64/basic/e38b.error.s +++ b/c64/basic/e38b.error.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Official BASIC routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - XXX -// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// - [RG64] C64 Programmers Reference Guide - XXX +// - [CM64] Computes Mapping the Commodore 64 - page 69, XXX // // CPU registers that has to be preserved (see [RG64]): XXX // @@ -11,3 +12,6 @@ ERROR: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/e3bf.init.s b/c64/basic/e3bf.init.s index 884154f6..9c63859d 100644 --- a/c64/basic/e3bf.init.s +++ b/c64/basic/e3bf.init.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation INIT: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/e453.rvect.s b/c64/basic/e453.rvect.s index 916e26fd..cc58e236 100644 --- a/c64/basic/e453.rvect.s +++ b/c64/basic/e453.rvect.s @@ -1,5 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // XXX provide documentation and implementation RVECT: STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/basic/fac1_mul.s b/c64/basic/fac1_mul.s index 4b60948f..cd14ce64 100644 --- a/c64/basic/fac1_mul.s +++ b/c64/basic/fac1_mul.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Multiply Floating Point Accumulator by 10 // = 8x + 2x // Implement by shifting MAC left one bit, @@ -95,3 +97,6 @@ f1md2_l1: dey bpl f1md2_l1 rts + + +#endif // ROM layout diff --git a/c64/basic/init/a000.cold_start_vector.s b/c64/basic/init/a000.cold_start_vector.s index 7ed2cb76..7a02167a 100644 --- a/c64/basic/init/a000.cold_start_vector.s +++ b/c64/basic/init/a000.cold_start_vector.s @@ -1,4 +1,8 @@ -// Compute's Mapping the C64 p88 +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + +// Computes Mapping the C64 p88 .word basic_cold_start + +#endif // ROM layout diff --git a/c64/basic/init/a002.warm_start_vector.s b/c64/basic/init/a002.warm_start_vector.s index 63c4d2a5..f909e6b7 100644 --- a/c64/basic/init/a002.warm_start_vector.s +++ b/c64/basic/init/a002.warm_start_vector.s @@ -1,3 +1,8 @@ -// Compute's Mapping the C64 p88 +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + +// Computes Mapping the C64 p88 .word basic_warm_start + + +#endif // ROM layout diff --git a/c64/basic/init/basic_cold_start_internal.s b/c64/basic/init/basic_cold_start_internal.s index a7326089..139e12a6 100644 --- a/c64/basic/init/basic_cold_start_internal.s +++ b/c64/basic/init/basic_cold_start_internal.s @@ -1,8 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Continuation of the BASIC cold start routine // + basic_cold_start_internal: // Setup vectors at $300 @@ -34,3 +36,6 @@ basic_cold_start_internal: // jump into warm start loop jmp basic_warm_start + + +#endif // ROM layout diff --git a/c64/basic/init/basic_warm_start_internal.s b/c64/basic/init/basic_warm_start_internal.s index b271b928..be115d9e 100644 --- a/c64/basic/init/basic_warm_start_internal.s +++ b/c64/basic/init/basic_warm_start_internal.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Continuation of the BASIC cold start routine @@ -27,3 +28,6 @@ basic_warm_start_real: !: jmp basic_main_loop + + +#endif // ROM layout diff --git a/c64/basic/init/e394.basic_cold_start.s b/c64/basic/init/e394.basic_cold_start.s index fe181381..8f59919f 100644 --- a/c64/basic/init/e394.basic_cold_start.s +++ b/c64/basic/init/e394.basic_cold_start.s @@ -1,5 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + // BASIC Cold start entry point -// Compute's Mapping the 64 p211 +// Computes Mapping the 64 p211 basic_cold_start: @@ -17,6 +20,9 @@ basic_cold_start: dey bpl !-- - // Remaining part wouldn't fit here + // Remaining part would not fit here jmp basic_cold_start_internal + + +#endif // ROM layout diff --git a/c64/basic/init/e3b7.basic_warm_start.jmp.s b/c64/basic/init/e3b7.basic_warm_start.jmp.s index 8ebcfbde..0e1f0031 100644 --- a/c64/basic/init/e3b7.basic_warm_start.jmp.s +++ b/c64/basic/init/e3b7.basic_warm_start.jmp.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Clear screen etc, show READY prompt. basic_warm_start: jmp basic_warm_start_real + + +#endif // ROM layout diff --git a/c64/basic/init/e422.initmsg.jmp.s b/c64/basic/init/e422.initmsg.jmp.s index 5bb33656..cdbac7ea 100644 --- a/c64/basic/init/e422.initmsg.jmp.s +++ b/c64/basic/init/e422.initmsg.jmp.s @@ -1,11 +1,15 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Well-known BASIC routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 212 +// - [CM64] Computes Mapping the Commodore 64 - page 212 // // Prints the start-up messages // INITMSG: jmp initmsg_real + + +#endif // ROM layout diff --git a/c64/basic/init/initmsg_bytes_free.s b/c64/basic/init/initmsg_bytes_free.s index d4df557c..03ac32ce 100644 --- a/c64/basic/init/initmsg_bytes_free.s +++ b/c64/basic/init/initmsg_bytes_free.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Print out the amount of free bytes - for the startup banner @@ -19,3 +20,6 @@ initmsg_bytes_free: // Print rest of the start up message ldx #34 jmp print_packed_message + + +#endif // ROM layout diff --git a/c64/basic/init/initmsg_real.s b/c64/basic/init/initmsg_real.s index 8a9d3924..7158d7d6 100644 --- a/c64/basic/init/initmsg_real.s +++ b/c64/basic/init/initmsg_real.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // Routine is too long to fit in the original location @@ -146,3 +147,6 @@ initmsg_real: #endif + + +#endif // ROM layout diff --git a/c64/basic/init/startup_banner.s b/c64/basic/init/startup_banner.s index 7543ef0a..21955b67 100644 --- a/c64/basic/init/startup_banner.s +++ b/c64/basic/init/startup_banner.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // Startup banner, to be displayed during cold start @@ -110,3 +111,6 @@ pre_revision_string: // .byte $0D,$05,$92,$00 #endif + + +#endif // ROM layout diff --git a/c64/basic/init_oldtxt.s b/c64/basic/init_oldtxt.s index 6becf049..a4e42014 100644 --- a/c64/basic/init_oldtxt.s +++ b/c64/basic/init_oldtxt.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + init_oldtxt: @@ -7,3 +9,6 @@ init_oldtxt: sta OLDTXT+1 rts + + +#endif // ROM layout diff --git a/c64/basic/injest_comma.s b/c64/basic/injest_comma.s index 06e50338..b890fd92 100644 --- a/c64/basic/injest_comma.s +++ b/c64/basic/injest_comma.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Consummes a comma in a BASIC code, C set for no coma found @@ -17,3 +19,6 @@ injest_comma: injest_comma_found: clc rts + + +#endif // ROM layout diff --git a/c64/basic/injest_number.s b/c64/basic/injest_number.s index 6266e036..14c97fe2 100644 --- a/c64/basic/injest_number.s +++ b/c64/basic/injest_number.s @@ -1,3 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + // Parse a number from the input buffer at (TXTPTR) // Result is put into FAC1. // TXTPTR is updated with first position after the number. @@ -5,7 +8,7 @@ // XXX - Remember decimal position and exponent, and apply them // after to produce normalised floating point number. -// XXX - Doesn't use routines to access memory under ROMs etc. +// XXX - Does not use routines to access memory under ROMs etc. // This is important, because this routine operates on numbers in BASIC text. ij_not_a_digit: @@ -127,7 +130,7 @@ ij_loop2: // Carry set, so we have overflowed. // We should shift everything right one digit, and increase // the exponent by one. The non-zero exponent tells us that we - // can't fit any more precision in. + // can not fit any more precision in. jsr fac1_mantissa_div2 !: @@ -149,5 +152,6 @@ erase_fac1: sta FACOV rts - - + + +#endif // ROM layout diff --git a/c64/basic/pack_word.s b/c64/basic/pack_word.s index b332d8e2..0157b13b 100644 --- a/c64/basic/pack_word.s +++ b/c64/basic/pack_word.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Pack a word using the simple compression scheme. // This has to be the same implementation as in compress_text.c // because we compress input lines of BASIC to do the tokenisation. @@ -253,3 +255,6 @@ not_a_match: // Not a char that we can pack, so return 0 lda #$00 rts + + +#endif // ROM layout diff --git a/c64/basic/peek_line_pointer_null_check.s b/c64/basic/peek_line_pointer_null_check.s index e71a8d56..a35509ac 100644 --- a/c64/basic/peek_line_pointer_null_check.s +++ b/c64/basic/peek_line_pointer_null_check.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Return C=1 if a pointer in BASIC memory space is NULL, else C=0 // X = ZP pointer to check @@ -32,3 +34,6 @@ peek_line_pointer_null_check: ptr_not_null: sec rts + + +#endif // ROM layout diff --git a/c64/basic/print_integer.s b/c64/basic/print_integer.s index 47d58223..a0aed8fc 100644 --- a/c64/basic/print_integer.s +++ b/c64/basic/print_integer.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Works similar to $BDCD in original C64 BASIC // XXX Should eventually get replaced by a more flexible and optimal routine. // Temp result gets written to $0100-$0104 @@ -142,3 +144,6 @@ number_table_hi: .byte 0,8,1,9,2 .byte 1,6,3,8,4 .byte 3,2,7,6,8 + + +#endif // ROM layout diff --git a/c64/basic/print_packed_message.s b/c64/basic/print_packed_message.s index 2f44a411..71e162da 100644 --- a/c64/basic/print_packed_message.s +++ b/c64/basic/print_packed_message.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // This routine prints messages that have been packed // using the make_error_tables program. // The general idea is to save space in the ROM. @@ -226,3 +228,6 @@ is_uncommon_char: phy_trash_a jmp has_nybl + + +#endif // ROM layout diff --git a/c64/basic/ready_message.s b/c64/basic/ready_message.s index 3a349177..95dbc00f 100644 --- a/c64/basic/ready_message.s +++ b/c64/basic/ready_message.s @@ -1,6 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + + ready_message: // See src/make_error_tables.c for packed message handling // information. ldx #29 jmp print_packed_message + +#endif // ROM layout diff --git a/c64/basic/rom_revision/a004.identifier.s b/c64/basic/rom_revision/a004.identifier.s index 88cbb600..241d37c6 100644 --- a/c64/basic/rom_revision/a004.identifier.s +++ b/c64/basic/rom_revision/a004.identifier.s @@ -1,6 +1,10 @@ -// Compute's Mapping the 64, p89 +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + +// Computes Mapping the 64, p89 // 8 character name // MEGABAS2 = "MEGA BASIC 2" .byte $4D,$45,$47,$41,$42,$41,$53,$32 + +#endif // ROM layout diff --git a/c64/basic/rom_revision/bf52.rom_revision_basic.s b/c64/basic/rom_revision/bf52.rom_revision_basic.s index 8fe574c8..1a1d89bb 100644 --- a/c64/basic/rom_revision/bf52.rom_revision_basic.s +++ b/c64/basic/rom_revision/bf52.rom_revision_basic.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // !!! PROPOSAL ONLY !!! PROPOSAL ONLY !!! NOT FOR USING EXTERNALLY YET !!! @@ -6,7 +7,7 @@ // Do not change! Locations of the following data should be constant - now and forever! // // If you want to integrate Open ROMs support in your emulator, FPGA ccomputer, etc. - this -// is the official way to recognize the ROM and it's revision. +// is the official way to recognize the ROM and its revision. // @@ -30,3 +31,6 @@ rom_revision_basic_string: .byte $00 // marks the end of string __rom_revision_basic_end: + + +#endif // ROM layout diff --git a/c64/basic/rom_revision/e4b7.rom_revision_kernal.s b/c64/basic/rom_revision/e4b7.rom_revision_kernal.s index e98bb1a8..bb11b2f2 100644 --- a/c64/basic/rom_revision/e4b7.rom_revision_kernal.s +++ b/c64/basic/rom_revision/e4b7.rom_revision_kernal.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) // // !!! PROPOSAL ONLY !!! PROPOSAL ONLY !!! NOT FOR USING EXTERNALLY YET !!! @@ -6,14 +7,14 @@ // Do not change! Locations of the following data should be constant - now and forever! // // If you want to integrate Open ROMs support in your emulator, FPGA ccomputer, etc. - this -// is the official way to recognize the ROM and it's revision. +// is the official way to recognize the ROM and its revision. // // $E4B7 // This vector is to be used by non-Kernal ROMs, if they want to - // complain about incompatible ROM releases - don't use it directly, + // complain about incompatible ROM releases - do not use it directly, // use a 'panic' pseudocommand with error code (will be passed using .A) // #P_ERR_ROM_MISMATCH - it should remain stable even between releases @@ -44,3 +45,6 @@ rom_revision_kernal_string: .byte $00 // marks the end of string __rom_revision_kernal_end: + + +#endif // ROM layout diff --git a/c64/basic/select_device.s b/c64/basic/select_device.s index 6d9a2e76..408397b2 100644 --- a/c64/basic/select_device.s +++ b/c64/basic/select_device.s @@ -1,7 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + select_device: - // Take last device number, make sure it's a drive - 8 or above. Above 30, + // Take last device number, make sure it is a drive - 8 or above. Above 30, // although illegal for IEC we also consider a drive, as they exists // drivers assigning these numbers to CBM-DOS capable devices - like some // IEEE-488 carts. @@ -9,11 +11,12 @@ select_device: // If current device is not a drive, set device to 8 (first drive number) // Device number is left in X, for SETFLS Kernal routine - // Note: if tape support is introduced here, make sure DOS wedge won't get broken - ldx FA cpx #$08 bcs !+ ldx #$08 !: rts + + +#endif // ROM layout diff --git a/c64/basic/tokenise_line.s b/c64/basic/tokenise_line.s index 7a642834..54405d93 100644 --- a/c64/basic/tokenise_line.s +++ b/c64/basic/tokenise_line.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // Tokenise a line of BASIC // Stored at $0200 // Length in __tokenise_work1 @@ -267,3 +269,5 @@ done_searching_for_token: lda #$00 rts + +#endif // ROM layout diff --git a/c64/basic/under_rom_routines.s b/c64/basic/under_rom_routines.s index 1027e57a..e4f80525 100644 --- a/c64/basic/under_rom_routines.s +++ b/c64/basic/under_rom_routines.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + // IMPORTANT: // These routines lengths cannot be changed without changing // the aliases for peek_under_roms, poke_under_roms etc @@ -152,3 +154,6 @@ smd1: rts #endif + + +#endif // ROM layout diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index b7292c5d..68e50117 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + #if CONFIG_DOS_WEDGE @@ -256,3 +258,6 @@ wedge_dos_setnam: jmp JSETNAM #endif // CONFIG_DOS_WEDGE + + +#endif // ROM layout diff --git a/c64/basic/wedge_tape.s b/c64/basic/wedge_tape.s index 4edbe8e8..df781320 100644 --- a/c64/basic/wedge_tape.s +++ b/c64/basic/wedge_tape.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0) + #if CONFIG_TAPE_WEDGE @@ -32,3 +34,6 @@ wedge_tape: #endif // CONFIG_TAPE_WEDGE + + +#endif // ROM layout diff --git a/c64/kernal/,disabled/u64_load.s b/c64/kernal/,disabled/u64_load.s index 7b585c1e..2bdc4d73 100644 --- a/c64/kernal/,disabled/u64_load.s +++ b/c64/kernal/,disabled/u64_load.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD // // LOAD routine hook for fast loading via UltiDOS @@ -129,3 +130,6 @@ u64_load_check_status_ok: jmp !- !: rts + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/e6b6.advance_cursor.s b/c64/kernal/,stubs/e6b6.advance_cursor.s index 4e5b7d5f..b9a279ba 100644 --- a/c64/kernal/,stubs/e6b6.advance_cursor.s +++ b/c64/kernal/,stubs/e6b6.advance_cursor.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // XXX provide documentation and implementation STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/e701.previous_line.s b/c64/kernal/,stubs/e701.previous_line.s index 4e5b7d5f..b9a279ba 100644 --- a/c64/kernal/,stubs/e701.previous_line.s +++ b/c64/kernal/,stubs/e701.previous_line.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // XXX provide documentation and implementation STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/e716.chrout_screen.s b/c64/kernal/,stubs/e716.chrout_screen.s index 423ed67b..009d09d4 100644 --- a/c64/kernal/,stubs/e716.chrout_screen.s +++ b/c64/kernal/,stubs/e716.chrout_screen.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Screen CHROUT STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/e96c.insert_line_at_top.s b/c64/kernal/,stubs/e96c.insert_line_at_top.s index f28c13c4..2a42c3c1 100644 --- a/c64/kernal/,stubs/e96c.insert_line_at_top.s +++ b/c64/kernal/,stubs/e96c.insert_line_at_top.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Insert line at top of screen STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/f646.iec_close.s b/c64/kernal/,stubs/f646.iec_close.s index d4d05036..7b4f1ba9 100644 --- a/c64/kernal/,stubs/f646.iec_close.s +++ b/c64/kernal/,stubs/f646.iec_close.s @@ -1,5 +1,8 @@ - +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // IEC close STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/,stubs/fd90.unknown.s b/c64/kernal/,stubs/fd90.unknown.s index 4e5b7d5f..b9a279ba 100644 --- a/c64/kernal/,stubs/fd90.unknown.s +++ b/c64/kernal/,stubs/fd90.unknown.s @@ -1,4 +1,8 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // XXX provide documentation and implementation STUB_IMPLEMENTATION() + + +#endif // ROM layout diff --git a/c64/kernal/assets/cartridge_signature.s b/c64/kernal/assets/cartridge_signature.s index 2b0c5f90..c6aabb98 100644 --- a/c64/kernal/assets/cartridge_signature.s +++ b/c64/kernal/assets/cartridge_signature.s @@ -1,3 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + cartridge_signature: + .byte $C3,$C2,$CD,$38,$30 + + +#endif // ROM layout diff --git a/c64/kernal/assets/e8da.colour_codes.s b/c64/kernal/assets/e8da.colour_codes.s index fdf0b980..89849a12 100644 --- a/c64/kernal/assets/e8da.colour_codes.s +++ b/c64/kernal/assets/e8da.colour_codes.s @@ -1,6 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // CHR$ codes for the 16 colours colour_codes: .byte 144,5,28,159,156,30,31,158 .byte 129,149,150,151,152,153,154,155 + + +#endif // ROM layout diff --git a/c64/kernal/assets/fd30.vector_defaults.s b/c64/kernal/assets/fd30.vector_defaults.s index dd7fa89d..13b01e78 100644 --- a/c64/kernal/assets/fd30.vector_defaults.s +++ b/c64/kernal/assets/fd30.vector_defaults.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Default values for Kernal vectors - described in: // -// - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR) -// - [CM64] Compute's Mapping the Commodore 64 - page 237 +// - [RG64] C64 Programmers Reference Guide - page 293 (RESTOR), 304 (VECTOR) +// - [CM64] Computes Mapping the Commodore 64 - page 237 // vector_defaults: @@ -24,3 +25,6 @@ vector_defaults: .word default_brk_handler // USRCMD .word LOAD // ILOAD .word SAVE // ISAVE + + +#endif // ROM layout diff --git a/c64/kernal/assets/irq_timing_hi.s b/c64/kernal/assets/irq_timing_hi.s index 86cd851c..794dd5cb 100644 --- a/c64/kernal/assets/irq_timing_hi.s +++ b/c64/kernal/assets/irq_timing_hi.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Values for IRQ generation timer - original idea was: @@ -21,3 +22,6 @@ irq_timing_hi: // high bytes .byte >17045 // NTSC .byte >16421 // PAL + + +#endif // ROM layout diff --git a/c64/kernal/assets/irq_timing_lo.s b/c64/kernal/assets/irq_timing_lo.s index 6f6872aa..2d18d4ec 100644 --- a/c64/kernal/assets/irq_timing_lo.s +++ b/c64/kernal/assets/irq_timing_lo.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Values for IRQ generation timer - original idea was: @@ -21,3 +22,6 @@ irq_timing_lo: // low bytes .byte <17045 // NTSC .byte <16421 // PAL + + +#endif // ROM layout \ No newline at end of file diff --git a/c64/kernal/assets/kernal_messages.s b/c64/kernal/assets/kernal_messages.s index a14954c1..5f7712b1 100644 --- a/c64/kernal/assets/kernal_messages.s +++ b/c64/kernal/assets/kernal_messages.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Messages to be prined out by Kernal @@ -110,3 +111,6 @@ __msg_kernalfeatures: .byte $80 + $0D // end of string mark + return #endif // CONFIG_SHOW_FEATURES + + +#endif // ROM layout diff --git a/c64/kernal/errors.s b/c64/kernal/errors.s index 73e6c552..fc8c137a 100644 --- a/c64/kernal/errors.s +++ b/c64/kernal/errors.s @@ -1,5 +1,7 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) -// Kernal error codes are described in 'Commodore 64 Programmer's Reference Guide', page 306 + +// Kernal error codes are described in 'Commodore 64 Programmers Reference Guide', page 306 kernalerror_ROUTINE_TERMINATED: // by a STOP key lda #K_ERR_ROUTINE_TERMINATED @@ -56,14 +58,15 @@ kernalerror_TOP_MEM_RS232: sec rts -// Kernal status codes are described in 'Commodore 64 Programmer's Reference Guide', page 292 + +// Kernal status codes are described in 'Commodore 64 Programmers Reference Guide', page 292 kernalstatus_reset: lda #$00 sta IOSTATUS rts -// The following two statuses are currentl not implemented - and most likely not really needed +// The following two statuses are currently not implemented - and most likely not really needed // kernalstatus_TIMEOUT_WRITE: // lda IOSTATUS @@ -88,3 +91,6 @@ kernalstatus_DEVICE_NOT_FOUND: ora #K_STS_DEVICE_NOT_FOUND sta IOSTATUS rts + + +#endif // ROM layout diff --git a/c64/kernal/iec/acptr.s b/c64/kernal/iec/acptr.s index 2ed7962d..98d44570 100644 --- a/c64/kernal/iec/acptr.s +++ b/c64/kernal/iec/acptr.s @@ -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 274 -// - [CM64] Compute's Mapping the Commodore 64 - page 224/225 +// - [RG64] C64 Programmers Reference Guide - page 274 +// - [CM64] Computes Mapping the Commodore 64 - page 224/225 // // CPU registers that has to be preserved (see [RG64]): .Y // @@ -28,3 +29,6 @@ ACPTR: #else jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/chkin_iec.s b/c64/kernal/iec/chkin_iec.s index b86dee9c..80742876 100644 --- a/c64/kernal/iec/chkin_iec.s +++ b/c64/kernal/iec/chkin_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CHKIN routine @@ -29,3 +30,6 @@ chkin_iec: jmp chkin_set_device #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/chrin_iec.s b/c64/kernal/iec/chrin_iec.s index 93ad7afc..8c216097 100644 --- a/c64/kernal/iec/chrin_iec.s +++ b/c64/kernal/iec/chrin_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CHRIN routine @@ -8,3 +9,6 @@ chrin_iec: // XXX is this really all? jmp JACPTR + + +#endif // ROM layout diff --git a/c64/kernal/iec/chrout_iec.s b/c64/kernal/iec/chrout_iec.s index 38924b76..59263d27 100644 --- a/c64/kernal/iec/chrout_iec.s +++ b/c64/kernal/iec/chrout_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CHROUT routine @@ -10,3 +11,6 @@ chrout_iec: jsr JCIOUT bcc_far chrout_done_success jmp chrout_done_fail + + +#endif // ROM layout diff --git a/c64/kernal/iec/ciout.s b/c64/kernal/iec/ciout.s index 3b92cc14..3edcf734 100644 --- a/c64/kernal/iec/ciout.s +++ b/c64/kernal/iec/ciout.s @@ -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 279/280 -// - [CM64] Compute's Mapping the Commodore 64 - page 224 +// - [RG64] C64 Programmers Reference Guide - page 279/280 +// - [CM64] Computes Mapping the Commodore 64 - page 224 // // CPU registers that has to be preserved (see [RG64]): .X, .Y // @@ -47,3 +48,6 @@ ciout_send_byte: rts #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/ckout_iec.s b/c64/kernal/iec/ckout_iec.s index 662f4840..7f2e882e 100644 --- a/c64/kernal/iec/ckout_iec.s +++ b/c64/kernal/iec/ckout_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CKOUT routine @@ -29,3 +30,6 @@ ckout_iec: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/close_iec.s b/c64/kernal/iec/close_iec.s index 0cdc2801..c2a16c12 100644 --- a/c64/kernal/iec/close_iec.s +++ b/c64/kernal/iec/close_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CLOSE routine @@ -33,3 +34,6 @@ close_iec_end: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/clrchn_iec.s b/c64/kernal/iec/clrchn_iec.s index 84993a0c..ea4e5a6d 100644 --- a/c64/kernal/iec/clrchn_iec.s +++ b/c64/kernal/iec/clrchn_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the CLRCHN routine @@ -28,3 +29,6 @@ clrchn_iec: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_check_devnum.s b/c64/kernal/iec/iec_check_devnum.s index e6ac9c08..c4b9beb2 100644 --- a/c64/kernal/iec/iec_check_devnum.s +++ b/c64/kernal/iec/iec_check_devnum.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Checks whether device number (in .A) is a correct IEC device number @@ -31,3 +32,6 @@ iec_check_devnum_failed: rts #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_close_load.s b/c64/kernal/iec/iec_close_load.s index 5cc8e76a..aba2fa33 100644 --- a/c64/kernal/iec/iec_close_load.s +++ b/c64/kernal/iec/iec_close_load.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Common part of CLOSE and LOAD/SAVE routines for IEC @@ -29,3 +30,6 @@ iec_close_load: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_cmd_close.s b/c64/kernal/iec/iec_cmd_close.s index 126cb04e..3a18f4cf 100644 --- a/c64/kernal/iec/iec_cmd_close.s +++ b/c64/kernal/iec/iec_cmd_close.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Kernal internal IEC routine @@ -21,3 +22,6 @@ iec_cmd_close: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_cmd_open.s b/c64/kernal/iec/iec_cmd_open.s index 78d5364b..5630fa24 100644 --- a/c64/kernal/iec/iec_cmd_open.s +++ b/c64/kernal/iec/iec_cmd_open.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Kernal internal IEC routine @@ -66,3 +67,6 @@ iec_check_channel_openclose: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_pull_release.s b/c64/kernal/iec/iec_pull_release.s index 8be0e851..2924ce36 100644 --- a/c64/kernal/iec/iec_pull_release.s +++ b/c64/kernal/iec/iec_pull_release.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper IEC routines to pull/release certain lines @@ -83,3 +84,6 @@ iec_pull_release_end: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_return.s b/c64/kernal/iec/iec_return.s index b73a8d1f..3141f1dd 100644 --- a/c64/kernal/iec/iec_return.s +++ b/c64/kernal/iec/iec_return.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper routines to return with error/success @@ -39,3 +40,6 @@ iec_return_DEVICE_NOT_FOUND: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_rx_byte.s b/c64/kernal/iec/iec_rx_byte.s index 56d54aa6..06fb768e 100644 --- a/c64/kernal/iec/iec_rx_byte.s +++ b/c64/kernal/iec/iec_rx_byte.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Receive a byte from the IEC bus. // Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc, // http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf (page 11) @@ -155,3 +157,6 @@ iec_rx_end: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_rx_check_eoi.s b/c64/kernal/iec/iec_rx_check_eoi.s index b36d840e..386940e4 100644 --- a/c64/kernal/iec/iec_rx_check_eoi.s +++ b/c64/kernal/iec/iec_rx_check_eoi.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper routine to check for EOI while receiving byte from IEC @@ -33,3 +34,6 @@ iec_rx_check_eoi_confirm: iec_rx_check_eoi_done: rts + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_send_file_name.s b/c64/kernal/iec/iec_send_file_name.s index 72f107bf..46a35577 100644 --- a/c64/kernal/iec/iec_send_file_name.s +++ b/c64/kernal/iec/iec_send_file_name.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Sends file (stream) name to IEC device @@ -42,3 +43,6 @@ iec_send_file_name_done: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_set_idle.s b/c64/kernal/iec/iec_set_idle.s index 4833eba6..0c2b1f7b 100644 --- a/c64/kernal/iec/iec_set_idle.s +++ b/c64/kernal/iec/iec_set_idle.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) #if CONFIG_IEC @@ -12,3 +13,6 @@ iec_set_idle: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_turnaround_to_listen.s b/c64/kernal/iec/iec_turnaround_to_listen.s index f77a5a54..6a2c4094 100644 --- a/c64/kernal/iec/iec_turnaround_to_listen.s +++ b/c64/kernal/iec/iec_turnaround_to_listen.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // According to http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // pages 7--8. // See also https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc @@ -39,3 +41,6 @@ iec_turnaround_to_listen: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_turnaround_to_talk.s b/c64/kernal/iec/iec_turnaround_to_talk.s index 624c648d..0cc73093 100644 --- a/c64/kernal/iec/iec_turnaround_to_talk.s +++ b/c64/kernal/iec/iec_turnaround_to_talk.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // According to http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // pages 7--8. // See also https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc @@ -31,3 +33,6 @@ iec_turnaround_to_talk: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_tx_byte.s b/c64/kernal/iec/iec_tx_byte.s index 91b91abb..5e6a98c8 100644 --- a/c64/kernal/iec/iec_tx_byte.s +++ b/c64/kernal/iec/iec_tx_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc @@ -161,3 +162,6 @@ iec_tx_common_finalize: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_tx_command.s b/c64/kernal/iec/iec_tx_command.s index 04c8a0ca..7d636fab 100644 --- a/c64/kernal/iec/iec_tx_command.s +++ b/c64/kernal/iec/iec_tx_command.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc @@ -41,3 +42,6 @@ iec_tx_command: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_tx_command_finalize.s b/c64/kernal/iec/iec_tx_command_finalize.s index 976fdb93..f0322fcc 100644 --- a/c64/kernal/iec/iec_tx_command_finalize.s +++ b/c64/kernal/iec/iec_tx_command_finalize.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Routine to finalize some IEC commands - which do not end in turnaround and are not followed by others // Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc @@ -22,3 +24,6 @@ iec_tx_command_finalize: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_tx_flush.s b/c64/kernal/iec/iec_tx_flush.s index fdef1d2a..3b870d71 100644 --- a/c64/kernal/iec/iec_tx_flush.s +++ b/c64/kernal/iec/iec_tx_flush.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Flush the IEC output buffer (if not empty) - send byte with EOI // @@ -20,3 +21,6 @@ iec_tx_flush: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_update_eal_by_y.s b/c64/kernal/iec/iec_update_eal_by_y.s index a41a6106..8248345e 100644 --- a/c64/kernal/iec/iec_update_eal_by_y.s +++ b/c64/kernal/iec/iec_update_eal_by_y.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Common EAL update routine @@ -19,3 +20,6 @@ iec_update_EAL_by_Y: // note: Carry has to be set by caller! #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait1ms.s b/c64/kernal/iec/iec_wait1ms.s index 4e05f18e..bcbc48ce 100644 --- a/c64/kernal/iec/iec_wait1ms.s +++ b/c64/kernal/iec/iec_wait1ms.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Wait 1 ms (1000 usec) // // On NTSC this means 1023 cycles (slightly less on PAL, but we have to be sure). -// We can't count on badlines, as the screen might be disabled. +// We cant count on badlines, as the screen might be disabled. // Delay here is implemented using VIC-II raster register. Since one raster is // 63 cycles, we need at least 17 full rasters to be 100% sure we wait enough @@ -31,3 +32,6 @@ wait_x_bars: // additional entry point for delayy in screen and tape support iec_wait_rts: // dummy RTS, for very short waits rts + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait20us.s b/c64/kernal/iec/iec_wait20us.s index 21c5caa5..1056544d 100644 --- a/c64/kernal/iec/iec_wait20us.s +++ b/c64/kernal/iec/iec_wait20us.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) #if CONFIG_IEC @@ -26,3 +27,6 @@ iec_wait20us: // 21 cycles #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait60us.s b/c64/kernal/iec/iec_wait60us.s index 5673d528..e9812926 100644 --- a/c64/kernal/iec/iec_wait60us.s +++ b/c64/kernal/iec/iec_wait60us.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Note: damages .X @@ -31,3 +32,6 @@ iec_wait60us: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait_for_clk_release.s b/c64/kernal/iec/iec_wait_for_clk_release.s index 25a65bd8..a3e038a6 100644 --- a/c64/kernal/iec/iec_wait_for_clk_release.s +++ b/c64/kernal/iec/iec_wait_for_clk_release.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) #if CONFIG_IEC @@ -11,3 +12,6 @@ iec_wait_for_clk_release: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait_for_data_pull.s b/c64/kernal/iec/iec_wait_for_data_pull.s index e4842c61..6635419f 100644 --- a/c64/kernal/iec/iec_wait_for_data_pull.s +++ b/c64/kernal/iec/iec_wait_for_data_pull.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) #if CONFIG_IEC @@ -13,3 +14,6 @@ iec_wait_for_data_pull: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/iec_wait_for_data_release.s b/c64/kernal/iec/iec_wait_for_data_release.s index e75c2ef2..99688ed6 100644 --- a/c64/kernal/iec/iec_wait_for_data_release.s +++ b/c64/kernal/iec/iec_wait_for_data_release.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) #if CONFIG_IEC @@ -12,3 +13,6 @@ iec_wait_for_data_release: rts #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/listen.s b/c64/kernal/iec/listen.s index f7e59c8c..0f408c73 100644 --- a/c64/kernal/iec/listen.s +++ b/c64/kernal/iec/listen.s @@ -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 285 -// - [CM64] Compute's Mapping the Commodore 64 - page 223 +// - [RG64] C64 Programmers Reference Guide - page 285 +// - [CM64] Computes Mapping the Commodore 64 - page 223 // - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc // - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // @@ -33,3 +34,6 @@ LISTEN: jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/load_iec.s b/c64/kernal/iec/load_iec.s index 65db83b3..82976a67 100644 --- a/c64/kernal/iec/load_iec.s +++ b/c64/kernal/iec/load_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the LOAD routine @@ -192,3 +193,6 @@ load_iec_get_addr_byte: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/open_iec.s b/c64/kernal/iec/open_iec.s index a4ff090e..c2c95dfe 100644 --- a/c64/kernal/iec/open_iec.s +++ b/c64/kernal/iec/open_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the OPEN routine @@ -38,3 +39,6 @@ open_iec_done: #endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/save_iec.s b/c64/kernal/iec/save_iec.s index 03923d00..73feeee3 100644 --- a/c64/kernal/iec/save_iec.s +++ b/c64/kernal/iec/save_iec.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // IEC part of the SAVE routine @@ -124,4 +125,7 @@ iec_save_loop_end: rts -#endif // CONFIG_IEC \ No newline at end of file +#endif // CONFIG_IEC + + +#endif // ROM layout diff --git a/c64/kernal/iec/second.s b/c64/kernal/iec/second.s index d1931234..a5a1fb54 100644 --- a/c64/kernal/iec/second.s +++ b/c64/kernal/iec/second.s @@ -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 296 -// - [CM64] Compute's Mapping the Commodore 64 - page 223/224 +// - [RG64] C64 Programmers Reference Guide - page 296 +// - [CM64] Computes Mapping the Commodore 64 - page 223/224 // - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc // // CPU registers that has to be preserved (see [RG64]): .X, .Y @@ -28,3 +29,6 @@ SECOND: jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/talk.s b/c64/kernal/iec/talk.s index f9726d4d..54216edd 100644 --- a/c64/kernal/iec/talk.s +++ b/c64/kernal/iec/talk.s @@ -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 301/302 -// - [CM64] Compute's Mapping the Commodore 64 - page 223 +// - [RG64] C64 Programmers Reference Guide - page 301/302 +// - [CM64] Computes Mapping the Commodore 64 - page 223 // - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc // - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // @@ -46,3 +47,6 @@ common_talk_listen: // common part of TALK and LISTEN jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/tksa.s b/c64/kernal/iec/tksa.s index 9794a7b9..1084121e 100644 --- a/c64/kernal/iec/tksa.s +++ b/c64/kernal/iec/tksa.s @@ -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 302 -// - [CM64] Compute's Mapping the Commodore 64 - page 224 +// - [RG64] C64 Programmers Reference Guide - page 302 +// - [CM64] Computes Mapping the Commodore 64 - page 224 // - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc // // CPU registers that has to be preserved (see [RG64]): .X, .Y @@ -28,3 +29,6 @@ TKSA: jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/unlsn.s b/c64/kernal/iec/unlsn.s index 857956c6..df96b33a 100644 --- a/c64/kernal/iec/unlsn.s +++ b/c64/kernal/iec/unlsn.s @@ -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 303 -// - [CM64] Compute's Mapping the Commodore 64 - page 224 +// - [RG64] C64 Programmers Reference Guide - page 303 +// - [CM64] Computes Mapping the Commodore 64 - page 224 // - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc // - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // @@ -35,3 +36,6 @@ UNLSN: jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec/untlk.s b/c64/kernal/iec/untlk.s index e4bb2717..221d7698 100644 --- a/c64/kernal/iec/untlk.s +++ b/c64/kernal/iec/untlk.s @@ -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 304 -// - [CM64] Compute's Mapping the Commodore 64 - page 224 +// - [RG64] C64 Programmers Reference Guide - page 304 +// - [CM64] Computes Mapping the Commodore 64 - page 224 // - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc // - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // @@ -33,7 +34,7 @@ common_untlk_tksa: // common part of UNTLK and TKSA sta TBTCNT jsr iec_tx_command bcs !+ // branch if error - // XXX - for TKSA, is it really the right place to do a turnaround? I've got some doubts + // XXX - for TKSA, is it really the right place to do a turnaround? I have some doubts // (it forces us to send the TKSA command 'manually' sometimes), but // Luigi Di Fraia (https://luigidifraia.wordpress.com/2017/06/27/codebase64-on-the-kernal-behaviour/) // claims TKSA Kernal routine actually does the turnaround @@ -46,3 +47,6 @@ common_untlk_tksa: // common part of UNTLK and TKSA jmp kernalerror_ILLEGAL_DEVICE_NUMBER #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/burst_cia1_advertise.s b/c64/kernal/iec_fast/burst_cia1_advertise.s index e233c3d6..34cfa431 100644 --- a/c64/kernal/iec_fast/burst_cia1_advertise.s +++ b/c64/kernal/iec_fast/burst_cia1_advertise.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Advertise burst IEC protocol support to the receiver @@ -31,3 +32,6 @@ burst_advertise_done: #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/burst_cia2_advertise.s b/c64/kernal/iec_fast/burst_cia2_advertise.s index 3081f000..c73134dc 100644 --- a/c64/kernal/iec_fast/burst_cia2_advertise.s +++ b/c64/kernal/iec_fast/burst_cia2_advertise.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Advertise burst IEC protocol support to the receiver @@ -55,3 +56,6 @@ burst_advertise_done: #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/burst_soft_advertise.s b/c64/kernal/iec_fast/burst_soft_advertise.s index 90625451..bcbe565c 100644 --- a/c64/kernal/iec_fast/burst_soft_advertise.s +++ b/c64/kernal/iec_fast/burst_soft_advertise.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Advertise burst IEC protocol support to the receiver @@ -26,3 +27,6 @@ burst_advertise_done: #endif + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/dolphindos_detect.s b/c64/kernal/iec_fast/dolphindos_detect.s index 0975785c..75abe6d7 100644 --- a/c64/kernal/iec_fast/dolphindos_detect.s +++ b/c64/kernal/iec_fast/dolphindos_detect.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper routine for JiffyDOS detection @@ -60,3 +61,6 @@ dolphindos_detect_success: #endif // CONFIG_IEC_DOLPHINDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/dolphindos_load.s b/c64/kernal/iec_fast/dolphindos_load.s index 849f3948..9d57239a 100644 --- a/c64/kernal/iec_fast/dolphindos_load.s +++ b/c64/kernal/iec_fast/dolphindos_load.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // DolphinDOS protocol support for IEC - optimized load loop @@ -117,3 +118,6 @@ dolphindos_load_end: #endif // CONFIG_IEC_DOLPHINDOS and not CONFIG_MEMORY_MODEL_60K + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_bittable.s b/c64/kernal/iec_fast/jiffydos_bittable.s index 94e89a39..930e1665 100644 --- a/c64/kernal/iec_fast/jiffydos_bittable.s +++ b/c64/kernal/iec_fast/jiffydos_bittable.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper table for encoding lower nibble for JiffyDOS, @@ -37,3 +38,6 @@ jiffydos_bittable: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_detect.s b/c64/kernal/iec_fast/jiffydos_detect.s index 0058ad87..982590d5 100644 --- a/c64/kernal/iec_fast/jiffydos_detect.s +++ b/c64/kernal/iec_fast/jiffydos_detect.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper routine for JiffyDOS detection @@ -49,3 +50,6 @@ jiffydos_detect_end: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_load.s b/c64/kernal/iec_fast/jiffydos_load.s index bd83e271..d6f4c168 100644 --- a/c64/kernal/iec_fast/jiffydos_load.s +++ b/c64/kernal/iec_fast/jiffydos_load.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // JiffyDOS protocol support for IEC - optimized load loop @@ -168,3 +169,6 @@ jiffydos_load_end: #endif // CONFIG_IEC_JIFFYDOS and not CONFIG_MEMORY_MODEL_60K + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_prepare.s b/c64/kernal/iec_fast/jiffydos_prepare.s index 1dc8f29b..4acf4011 100644 --- a/c64/kernal/iec_fast/jiffydos_prepare.s +++ b/c64/kernal/iec_fast/jiffydos_prepare.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // JiffyDOS transfer preparation routine @@ -27,3 +28,6 @@ jiffydos_prepare: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_rx_byte.s b/c64/kernal/iec_fast/jiffydos_rx_byte.s index cb55f3ec..3b25675f 100644 --- a/c64/kernal/iec_fast/jiffydos_rx_byte.s +++ b/c64/kernal/iec_fast/jiffydos_rx_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // JiffyDOS protocol support for IEC - byte reception @@ -108,3 +109,6 @@ jiffydos_rx_byte_end: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_tx_byte.s b/c64/kernal/iec_fast/jiffydos_tx_byte.s index 26be0860..85c2f0cf 100644 --- a/c64/kernal/iec_fast/jiffydos_tx_byte.s +++ b/c64/kernal/iec_fast/jiffydos_tx_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // JiffyDOS protocol support for IEC - byte transfer @@ -101,3 +102,6 @@ jiffydos_tx_byte_wait_eoi: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/iec_fast/jiffydos_wait_line.s b/c64/kernal/iec_fast/jiffydos_wait_line.s index cf6e9169..a086d3d1 100644 --- a/c64/kernal/iec_fast/jiffydos_wait_line.s +++ b/c64/kernal/iec_fast/jiffydos_wait_line.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // JiffyDOS helper routine to wait for appropriate moment, @@ -32,3 +33,6 @@ jiffydos_wait_line_done: #endif // CONFIG_IEC_JIFFYDOS + + +#endif // ROM layout diff --git a/c64/kernal/init/cartridge_check.s b/c64/kernal/init/cartridge_check.s index 00221fb4..f8705b27 100644 --- a/c64/kernal/init/cartridge_check.s +++ b/c64/kernal/init/cartridge_check.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // c64 prg p263 cartridge_check: @@ -11,3 +13,6 @@ cartridge_check_l1: // FALLTROUGH no_cartridge: rts + + +#endif // ROM layout diff --git a/c64/kernal/init/cint_screen_keyboard.s b/c64/kernal/init/cint_screen_keyboard.s index 0470d710..70dad444 100644 --- a/c64/kernal/init/cint_screen_keyboard.s +++ b/c64/kernal/init/cint_screen_keyboard.s @@ -1,10 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // This is a part CINT which initializes screen and keyboard // // For more details see: -// - [RG64] C64 Programmer's Reference Guide - page 280 -// - [CM64] Compute's Mapping the Commodore 64 - page 242 +// - [RG64] C64 Programmers Reference Guide - page 280 +// - [CM64] Computes Mapping the Commodore 64 - page 242 cint_screen_keyboard: @@ -15,7 +16,7 @@ cint_screen_keyboard: lda #>scnkey_set_keytab sta KEYLOG+1 - // Initialise cursor blink flags (Compute's Mapping the 64 p215) + // Initialise cursor blink flags (Computes Mapping the 64 p215) lda #$01 sta BLNCT @@ -30,7 +31,7 @@ cint_screen_keyboard: #endif - // Set keyboard decode vector (Compute's Mapping the 64 p215) + // Set keyboard decode vector (Computes Mapping the 64 p215) #if CONFIG_LEGACY_SCNKEY @@ -42,10 +43,10 @@ cint_screen_keyboard: bpl !- sta BufferQuantity - // Set key repeat delay (Compute's Mapping the 64 p215) + // Set key repeat delay (Computes Mapping the 64 p215) // Making some numbers up here: Repeat every ~1/10th sec // But require key to be held for ~1/3sec before - // repeating (Compute's Mapping the 64 p58) + // repeating (Computes Mapping the 64 p58) // Not needed for default keyboard scanning code @@ -54,11 +55,11 @@ cint_screen_keyboard: #endif - // Set current colour for text (Compute's Mapping the 64 p215) + // Set current colour for text (Computes Mapping the 64 p215) ldx #$01 // default is light blue ($0E), but we use a different one stx COLOR - // Set maximum keyboard buffer size (Compute's Mapping the 64 p215) + // Set maximum keyboard buffer size (Computes Mapping the 64 p215) ldx #10 stx XMAX @@ -66,6 +67,9 @@ cint_screen_keyboard: ldx #$00 stx MODE - // Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215) + // Fallthrough/jump to screen clear routine (Computes Mapping the 64 p215) jmp clear_screen + + +#endif // ROM layout diff --git a/c64/kernal/init/e518.cint_legacy.s b/c64/kernal/init/e518.cint_legacy.s index 93effe63..8b404300 100644 --- a/c64/kernal/init/e518.cint_legacy.s +++ b/c64/kernal/init/e518.cint_legacy.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Part of the official Kernal routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 280 -// - [CM64] Compute's Mapping the Commodore 64 - page 242 +// - [RG64] C64 Programmers Reference Guide - page 280 +// - [CM64] Computes Mapping the Commodore 64 - page 242 // // CPU registers that has to be preserved (see [RG64]): none // @@ -20,3 +21,6 @@ cint_legacy: // $E518 // Game 'Operacja Proboszcz' is one example. jmp cint_screen_keyboard // XXX try to fit the code here + + +#endif // ROM layout diff --git a/c64/kernal/init/e5a0.setup_vicii.s b/c64/kernal/init/e5a0.setup_vicii.s index 78ab30a9..30958d41 100644 --- a/c64/kernal/init/e5a0.setup_vicii.s +++ b/c64/kernal/init/e5a0.setup_vicii.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Well-known Kernal routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - page 215 +// - [CM64] Computes Mapping the Commodore 64 - page 215 // @@ -20,7 +21,7 @@ setup_vicii: #if !CONFIG_MB_MEGA_65 && !CONFIG_MB_ULTIMATE_64 - // Disable C128 extra keys - just to be sure they won't interfere with anything + // Disable C128 extra keys - just to be sure they will not interfere with anything stx VIC_XSCAN @@ -64,3 +65,6 @@ setup_vicii: // Setup default I/O devices jmp clrchn_reset + + +#endif // ROM layout diff --git a/c64/kernal/init/fce2.hw_entry_reset.s b/c64/kernal/init/fce2.hw_entry_reset.s index 29348a67..ab646e89 100644 --- a/c64/kernal/init/fce2.hw_entry_reset.s +++ b/c64/kernal/init/fce2.hw_entry_reset.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Resources describing the C64 reset sequence: // https://www.c64-wiki.com/wiki/Reset_(Process) @@ -48,3 +50,6 @@ hw_entry_reset: // c64 prg p269 jmp (IBASIC_COLD_START) + + +#endif // ROM layout diff --git a/c64/kernal/init/fd50.ramtas.s b/c64/kernal/init/fd50.ramtas.s index 70cb41c7..9e1b0f9d 100644 --- a/c64/kernal/init/fd50.ramtas.s +++ b/c64/kernal/init/fd50.ramtas.s @@ -1,18 +1,19 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Official Kernal routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 291 -// - [CM64] Compute's Mapping the Commodore 64 - page 237 +// - [RG64] C64 Programmers Reference Guide - page 291 +// - [CM64] Computes Mapping the Commodore 64 - page 237 // // CPU registers that has to be preserved (see [RG64]): none // RAMTAS: - // C64 Programmer's Reference guide p291: + // C64 Programmers Reference guide p291: // Clear $0000-$0101, $0200-$03ff - // PGS: $0000, $0001 are CPU IO ports, so shouldn't get written to + // PGS: $0000, $0001 are CPU IO ports, so should not get written to // How many ways are there to efficiently erase these two pages // of RAM? We would like to avoid any unnecessary byte similarity @@ -26,7 +27,7 @@ RAMTAS: !: sta $0300,Y sta $0200,Y - sta $0002,Y // that's why we don't use .X for index, we do not want zeropage addressing here! + sta $0002,Y // that is why we do not use .X for index, we do not want zeropage addressing here! iny bne !- @@ -81,3 +82,6 @@ ramtas_32k: ldy #$80 bne !- // branch always + + +#endif // ROM layout diff --git a/c64/kernal/init/fda3.ioinit.s b/c64/kernal/init/fda3.ioinit.s index 549e245a..0c08a714 100644 --- a/c64/kernal/init/fda3.ioinit.s +++ b/c64/kernal/init/fda3.ioinit.s @@ -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 285 -// - [CM64] Compute's Mapping the Commodore 64 - page 238 +// - [RG64] C64 Programmers Reference Guide - page 285 +// - [CM64] Computes Mapping the Commodore 64 - page 238 // // CPU registers that has to be preserved (see [RG64]): none // @@ -142,3 +143,6 @@ IOINIT: rts #endif + + +#endif // ROM layout diff --git a/c64/kernal/init/ff5b.cint.s b/c64/kernal/init/ff5b.cint.s index 6f8fe591..e7d0aefa 100644 --- a/c64/kernal/init/ff5b.cint.s +++ b/c64/kernal/init/ff5b.cint.s @@ -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 280 -// - [CM64] Compute's Mapping the Commodore 64 - page 242 +// - [RG64] C64 Programmers Reference Guide - page 280 +// - [CM64] Computes Mapping the Commodore 64 - page 242 // // CPU registers that has to be preserved (see [RG64]): none // @@ -12,3 +13,6 @@ CINT: jsr cint_legacy jmp setup_pal_ntsc + + +#endif // ROM layout diff --git a/c64/kernal/init/fffc.vector_reset.s b/c64/kernal/init/fffc.vector_reset.s index 20545b6c..07ab436f 100644 --- a/c64/kernal/init/fffc.vector_reset.s +++ b/c64/kernal/init/fffc.vector_reset.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFFC - CPU Reset Vector // Uncontrovertial, as it is a CPU requirement, and nothing else. .word hw_entry_reset + + +#endif // ROM layout diff --git a/c64/kernal/init/setup_pal_ntsc.s b/c64/kernal/init/setup_pal_ntsc.s index 101cf716..91b70b58 100644 --- a/c64/kernal/init/setup_pal_ntsc.s +++ b/c64/kernal/init/setup_pal_ntsc.s @@ -1,5 +1,6 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) -// Detect video system (PAL/NTSC), use Graham's method, as it's short and reliable +// Detect video system (PAL/NTSC), use method by Graham, as it is short and reliable // see here: https://codebase64.org/doku.php?id=base:detect_pal_ntsc @@ -59,3 +60,6 @@ setup_irq_timer: // entry point needed by UP9600 and CIA1 burst mod support sta CIA1_TIMAHI // $DC05 rts + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/ea31.default_irq_handler.s b/c64/kernal/interrupts/ea31.default_irq_handler.s index be964c9f..f5380e5e 100644 --- a/c64/kernal/interrupts/ea31.default_irq_handler.s +++ b/c64/kernal/interrupts/ea31.default_irq_handler.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + default_irq_handler: @@ -42,3 +44,6 @@ default_irq_handler_end_tape: // Acknowledge CIA interrupt and return jmp clear_cia1_interrupt_flag_and_return_from_interrupt + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/ea7e.ack_cia1_return_from_interrupt.s b/c64/kernal/interrupts/ea7e.ack_cia1_return_from_interrupt.s index ba5ebfa1..be43f53c 100644 --- a/c64/kernal/interrupts/ea7e.ack_cia1_return_from_interrupt.s +++ b/c64/kernal/interrupts/ea7e.ack_cia1_return_from_interrupt.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // https://csdb.dk/forums/index.php?roomid=11&topicid=5776 // Clear the CIA1 interrupt flag, and then fall through to // the return from interrupt routine @@ -9,3 +11,6 @@ clear_cia1_interrupt_flag_and_return_from_interrupt: ldy CIA1_ICR // FALL THROUGH to $EA81 + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/ea81.return_from_interrupt.s b/c64/kernal/interrupts/ea81.return_from_interrupt.s index 4d22d7ea..c98fdc5a 100644 --- a/c64/kernal/interrupts/ea81.return_from_interrupt.s +++ b/c64/kernal/interrupts/ea81.return_from_interrupt.s @@ -1,8 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // The IRQ is a commonly messed with thing on the C64, // so we need to handle entry points that are commonly // relied upon, including: // $EA31 - Standard IRQ routine -// $EA61 - Check keyboard, but don't update timer? https://github.com/cc65/cc65/issues/324 +// $EA61 - Check keyboard, but do not update timer? https://github.com/cc65/cc65/issues/324 // $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb // Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb) @@ -10,9 +12,12 @@ return_from_interrupt: // Restore registers and return - // Sequence according to Compute's Mapping the 64 p73 + // Sequence according to Computes Mapping the 64 p73 ply_trash_a plx_trash_a pla rti + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/fe47.default_nmi_handler.s b/c64/kernal/interrupts/fe47.default_nmi_handler.s index 9f877bb5..80d22c67 100644 --- a/c64/kernal/interrupts/fe47.default_nmi_handler.s +++ b/c64/kernal/interrupts/fe47.default_nmi_handler.s @@ -1,10 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) default_nmi_handler: - // Implemented according to Compute's Mapping the Commodore 64, page 74 + // Implemented according to Computes Mapping the Commodore 64, page 74 // and to https://www.c64-wiki.com/wiki/Interrupt - // Save registers, sequence according to Compute's Mapping the Commodore 64, page 73 + // Save registers, sequence according to Computes Mapping the Commodore 64, page 73 pha phx_trash_a phy_trash_a @@ -25,8 +26,11 @@ default_nmi_handler: bcs !+ jmp return_from_interrupt // no STOP pressed !: - // STOP + RESTORE - clean the address of the BRK instruction (it's not BRK) first + // STOP + RESTORE - clean the address of the BRK instruction (it is not BRK) first lda #$00 sta CMP0+0 sta CMP0+1 jmp (CBINV) + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/fe66.default_brk_handler.s b/c64/kernal/interrupts/fe66.default_brk_handler.s index 78a63c72..0be9fe7b 100644 --- a/c64/kernal/interrupts/fe66.default_brk_handler.s +++ b/c64/kernal/interrupts/fe66.default_brk_handler.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) default_brk_handler: - // Implemented according to Compute's Mapping the Commodore 64, pages 73-74 + // Implemented according to Computes Mapping the Commodore 64, pages 73-74 - sei // disable IRQs, to be sure they won't interfere + sei // disable IRQs, to be sure they wont interfere ldx #$00 sta VIC_SCROLX // turn the display off - we want as little screen artifacts as possible @@ -13,8 +14,8 @@ default_brk_handler: jsr JRESTOR jsr JIOINIT - // Original routine calls just a part of CINT - but I'm not sure which one. Most likely it - // skips the PAL/NTSC check by calling $E518. I suspect bug in the original ROM, let's + // Original routine calls just a part of CINT - but I am not sure which one. Most likely it + // skips the PAL/NTSC check by calling $E518. I suspect bug in the original ROM, lets // call the whole CINT, just to be sure everything is initialized. jsr CINT @@ -22,3 +23,6 @@ default_brk_handler: cli jmp (IBASIC_WARM_START) + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/fffa.vector_nmi.s b/c64/kernal/interrupts/fffa.vector_nmi.s index 19ee0ad8..af50742b 100644 --- a/c64/kernal/interrupts/fffa.vector_nmi.s +++ b/c64/kernal/interrupts/fffa.vector_nmi.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFFA - CPU NMI Hanlder // Uncontrovertial as this is also a CPU requirement. .word hw_entry_nmi + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/fffe.vector_irq.s b/c64/kernal/interrupts/fffe.vector_irq.s index fd3e136d..1000bac8 100644 --- a/c64/kernal/interrupts/fffe.vector_irq.s +++ b/c64/kernal/interrupts/fffe.vector_irq.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFFE - CPU IRQ Vector. // This is non-controvertial, as it is a 6502 CPU requirement, and we just have to point // it to whatever IRQ routine we make. .word hw_entry_irq + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/hw_entry_irq.s b/c64/kernal/interrupts/hw_entry_irq.s index e043ea0f..8fe45c93 100644 --- a/c64/kernal/interrupts/hw_entry_irq.s +++ b/c64/kernal/interrupts/hw_entry_irq.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + hw_entry_irq: @@ -5,11 +7,11 @@ hw_entry_irq: // so we need to handle entry points that are commonly // relied upon, including: // $EA31 - Standard IRQ routine - // $EA61 - Check keyboard, but don't update timer? https://github.com/cc65/cc65/issues/324 + // $EA61 - Check keyboard, but do not update timer? https://github.com/cc65/cc65/issues/324 // $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb // Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb) - // Save registers, sequence according to Compute's Mapping the Commodore 64, page 73 + // Save registers, sequence according to Computes Mapping the Commodore 64, page 73 pha phx_trash_a phy_trash_a @@ -46,3 +48,6 @@ irq_handler_brk: // Interrupt caused by BRK jmp (CBINV) + + +#endif // ROM layout diff --git a/c64/kernal/interrupts/hw_entry_nmi.s b/c64/kernal/interrupts/hw_entry_nmi.s index ca41e1d0..017e54c2 100644 --- a/c64/kernal/interrupts/hw_entry_nmi.s +++ b/c64/kernal/interrupts/hw_entry_nmi.s @@ -1,7 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + hw_entry_nmi: - sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt + sei // do not allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt #if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS cld // clear decimal flag to allow using it without disabling interrupts @@ -18,3 +20,6 @@ hw_entry_nmi: // Vector not initialized - call default interrupt routine pla jmp default_nmi_handler + + +#endif // ROM layout diff --git a/c64/kernal/iostack/chkinout.s b/c64/kernal/iostack/chkinout.s index c8d3bda8..951a4f92 100644 --- a/c64/kernal/iostack/chkinout.s +++ b/c64/kernal/iostack/chkinout.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Common part of CHKIN and CKOUT @@ -16,3 +17,6 @@ chkinout_file_not_open: ply_trash_a pla jmp kernalerror_FILE_NOT_OPEN + + +#endif // ROM layout diff --git a/c64/kernal/iostack/clall_real.s b/c64/kernal/iostack/clall_real.s index abdd9b69..820d6a88 100644 --- a/c64/kernal/iostack/clall_real.s +++ b/c64/kernal/iostack/clall_real.s @@ -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 281 -// - [CM64] Compute's Mapping the Commodore 64 - page 230 +// - [RG64] C64 Programmers Reference Guide - page 281 +// - [CM64] Computes Mapping the Commodore 64 - page 230 // // CPU registers that has to be preserved (see [RG64]): .Y // @@ -16,7 +17,7 @@ clall_real: // Original routine probably just sets LDTND to 0, but this is not really safe, // so we actually close all the channels; at least IDE64 does the same for - // it's channels, see CLALL description in the IDE64 User's Guide + // its channels, see CLALL description in the IDE64 Users Guide !: ldy LDTND beq !+ @@ -34,3 +35,5 @@ clall_real: // Not sure whether original Kernal does so, but it seems sane to also clear possible errors jmp kernalstatus_reset + +#endif // ROM layout diff --git a/c64/kernal/iostack/f13e.getin.s b/c64/kernal/iostack/f13e.getin.s index 02d68bc3..88e36f11 100644 --- a/c64/kernal/iostack/f13e.getin.s +++ b/c64/kernal/iostack/f13e.getin.s @@ -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 283 -// - [CM64] Compute's Mapping the Commodore 64 - page 227/228 +// - [RG64] C64 Programmers Reference Guide - page 283 +// - [CM64] Computes Mapping the Commodore 64 - page 227/228 // // CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y // @@ -11,3 +12,6 @@ GETIN: jmp getin_real + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f157.chrin.s b/c64/kernal/iostack/f157.chrin.s index f4deafb3..27216162 100644 --- a/c64/kernal/iostack/f157.chrin.s +++ b/c64/kernal/iostack/f157.chrin.s @@ -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 277/278 -// - [CM64] Compute's Mapping the Commodore 64 - page 228 +// - [RG64] C64 Programmers Reference Guide - page 277/278 +// - [CM64] Computes Mapping the Commodore 64 - page 228 // // CPU registers that has to be preserved (see [RG64]): .Y // @@ -46,3 +47,6 @@ chrin_getin: // jump entry for GETIN // Not a supported device jmp lvs_device_not_found_error + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f1ca.chrout.s b/c64/kernal/iostack/f1ca.chrout.s index 5c123847..810b535e 100644 --- a/c64/kernal/iostack/f1ca.chrout.s +++ b/c64/kernal/iostack/f1ca.chrout.s @@ -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 278/279 -// - [CM64] Compute's Mapping the Commodore 64 - page 228 +// - [RG64] C64 Programmers Reference Guide - page 278/279 +// - [CM64] Computes Mapping the Commodore 64 - page 228 // // CPU registers that has to be preserved (see [RG64]): .Y // Additionally we have to preserve .X for out CHRIN and implementation @@ -15,7 +16,7 @@ CHROUT: // Save X and Y values // (Confirmed by writing a test program that X and Y - // don't get modified, in agreement with C64 PRG's + // do not get modified, in agreement with C64 PRG // description of CHROUT) phx_trash_a @@ -74,3 +75,6 @@ chrout_done_success: lda SCHAR clc // indicate success rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f20e.chkin.s b/c64/kernal/iostack/f20e.chkin.s index bd86226c..da373edc 100644 --- a/c64/kernal/iostack/f20e.chkin.s +++ b/c64/kernal/iostack/f20e.chkin.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Official Kernal routines, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 275 -// - [CM64] Compute's Mapping the Commodore 64 - page 229 +// - [RG64] C64 Programmers Reference Guide - page 275 +// - [CM64] Computes Mapping the Commodore 64 - page 229 // // CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213) // @@ -67,3 +68,6 @@ chkin_file_not_input: ply_trash_a pla jmp kernalerror_FILE_NOT_INPUT + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f250.ckout.s b/c64/kernal/iostack/f250.ckout.s index 49a4d6a7..f51c8bbe 100644 --- a/c64/kernal/iostack/f250.ckout.s +++ b/c64/kernal/iostack/f250.ckout.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Official Kernal routines, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 276 -// - [CM64] Compute's Mapping the Commodore 64 - page 229 +// - [RG64] C64 Programmers Reference Guide - page 276 +// - [CM64] Computes Mapping the Commodore 64 - page 229 // // CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213) // @@ -62,15 +63,4 @@ ckout_file_not_output: jmp kernalerror_FILE_NOT_OUTPUT - - - - - - - - - - - - +#endif // ROM layout diff --git a/c64/kernal/iostack/f291.close.s b/c64/kernal/iostack/f291.close.s index c4930447..0a4803c7 100644 --- a/c64/kernal/iostack/f291.close.s +++ b/c64/kernal/iostack/f291.close.s @@ -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 281/282 -// - [CM64] Compute's Mapping the Commodore 64 - page 229/230 +// - [RG64] C64 Programmers Reference Guide - page 281/282 +// - [CM64] Computes Mapping the Commodore 64 - page 229/230 // - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc (IEC command) // // CPU registers that has to be preserved (see [RG64]): none @@ -51,7 +52,10 @@ close_remove_from_table: // Decrement the list size variable dec LDTND - clc // report success - not sure if original CLOSE does this, but it's nevertheless a good practice + clc // report success - not sure if original CLOSE does this, but it is nevertheless a good practice close_end: rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f32f.clall.jmp.s b/c64/kernal/iostack/f32f.clall.jmp.s index f0538e90..69efe881 100644 --- a/c64/kernal/iostack/f32f.clall.jmp.s +++ b/c64/kernal/iostack/f32f.clall.jmp.s @@ -1,6 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Our implementation is longer than the original one, // placing it here would cause a collision with CLRCHN + CLALL: jmp clall_real + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f333.clrchn.s b/c64/kernal/iostack/f333.clrchn.s index ab94909f..ef566281 100644 --- a/c64/kernal/iostack/f333.clrchn.s +++ b/c64/kernal/iostack/f333.clrchn.s @@ -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 282 -// - [CM64] Compute's Mapping the Commodore 64 - page 230 +// - [RG64] C64 Programmers Reference Guide - page 282 +// - [CM64] Computes Mapping the Commodore 64 - page 230 // // CPU registers that has to be preserved (see [RG64]): .Y // @@ -30,3 +31,6 @@ clrchn_reset: // entry needed by setup_vicii sta DFLTO rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f34a.open.s b/c64/kernal/iostack/f34a.open.s index 3dc0e134..d9a843e8 100644 --- a/c64/kernal/iostack/f34a.open.s +++ b/c64/kernal/iostack/f34a.open.s @@ -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 289 -// - [CM64] Compute's Mapping the Commodore 64 - page 230/231 +// - [RG64] C64 Programmers Reference Guide - page 289 +// - [CM64] Computes Mapping the Commodore 64 - page 230/231 // // CPU registers that has to be preserved (see [RG64]): none // @@ -42,7 +43,7 @@ open_has_space: // Update the tables // LAT / FAT / SAT support implemented according to - // 'Compute's Mapping the Commodore 64', page 52 + // 'Computes Mapping the Commodore 64', page 52 lda LA sta LAT, y @@ -76,3 +77,6 @@ open_done_success: clc rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f49e.load_prep.s b/c64/kernal/iostack/f49e.load_prep.s index cc045026..523444a4 100644 --- a/c64/kernal/iostack/f49e.load_prep.s +++ b/c64/kernal/iostack/f49e.load_prep.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // LOAD preparation routine @@ -21,3 +22,6 @@ LOAD_PREP: sty MEMUSS+1 stx MEMUSS+0 jmp (ILOAD) + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f4a5.load.s b/c64/kernal/iostack/f4a5.load.s index 2f173766..c2233541 100644 --- a/c64/kernal/iostack/f4a5.load.s +++ b/c64/kernal/iostack/f4a5.load.s @@ -1,8 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // // Official Kernal routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 286 -// - [CM64] Compute's Mapping the Commodore 64 - page 231 +// - [RG64] C64 Programmers Reference Guide - page 286 +// - [CM64] Computes Mapping the Commodore 64 - page 231 // - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // // CPU registers that has to be preserved (see [RG64]): none @@ -55,3 +57,6 @@ LOAD: #endif jmp lvs_illegal_device_number + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f5dd.save_prep.s b/c64/kernal/iostack/f5dd.save_prep.s index d7cf3f86..a595e1c4 100644 --- a/c64/kernal/iostack/f5dd.save_prep.s +++ b/c64/kernal/iostack/f5dd.save_prep.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // SAVE preparation routine @@ -27,3 +28,6 @@ SAVE_PREP: sta STAL+0 jmp (ISAVE) + + +#endif // ROM layout diff --git a/c64/kernal/iostack/f5ed.save.s b/c64/kernal/iostack/f5ed.save.s index d8d053bf..bd3eb912 100644 --- a/c64/kernal/iostack/f5ed.save.s +++ b/c64/kernal/iostack/f5ed.save.s @@ -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 293/294 -// - [CM64] Compute's Mapping the Commodore 64 - page 231/232 +// - [RG64] C64 Programmers Reference Guide - page 293/294 +// - [CM64] Computes Mapping the Commodore 64 - page 231/232 // - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf // // CPU registers that has to be preserved (see [RG64]): none @@ -28,3 +29,6 @@ SAVE: #endif jmp lvs_illegal_device_number + + +#endif // ROM layout diff --git a/c64/kernal/iostack/findfls.s b/c64/kernal/iostack/findfls.s index 9da38026..07517924 100644 --- a/c64/kernal/iostack/findfls.s +++ b/c64/kernal/iostack/findfls.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Just a helper routine @@ -21,3 +22,5 @@ find_fls_not_found: sec rts + +#endif // ROM layout diff --git a/c64/kernal/iostack/getin_real.s b/c64/kernal/iostack/getin_real.s index 681e2a17..fd2d60c0 100644 --- a/c64/kernal/iostack/getin_real.s +++ b/c64/kernal/iostack/getin_real.s @@ -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 283 -// - [CM64] Compute's Mapping the Commodore 64 - page 227/228 +// - [RG64] C64 Programmers Reference Guide - page 283 +// - [CM64] Computes Mapping the Commodore 64 - page 227/228 // // CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y // @@ -26,3 +27,6 @@ getin_real: #endif // HAS_RS232 jmp chrin_getin + + +#endif // ROM layout diff --git a/c64/kernal/iostack/load_save_common.s b/c64/kernal/iostack/load_save_common.s index a2d31714..95fc9ff2 100644 --- a/c64/kernal/iostack/load_save_common.s +++ b/c64/kernal/iostack/load_save_common.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper functions for various LOAD/VERIFY/SAVE routine variants (IEC / U64 / etc.) @@ -231,7 +232,7 @@ lvs_error_end: lvs_return_last_address: - // Return last address - Compute's Mapping the 64 says without the '+1', + // Return last address - Computes Mapping the 64 says without the '+1', // checked (short test program) on original ROMs that this is really the case ldx EAL+0 ldy EAL+1 @@ -264,3 +265,6 @@ lvs_verify_error: lda #B_ERR_VERIFY sec rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/readst.s b/c64/kernal/iostack/readst.s index 10a7d11f..0c2d29b7 100644 --- a/c64/kernal/iostack/readst.s +++ b/c64/kernal/iostack/readst.s @@ -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 292 -// - [CM64] Compute's Mapping the Commodore 64 - page 239 +// - [RG64] C64 Programmers Reference Guide - page 292 +// - [CM64] Computes Mapping the Commodore 64 - page 239 // // CPU registers that has to be preserved (see [RG64]): .X, .Y // @@ -16,16 +17,19 @@ READST: cmp #$02 bne !+ - // This is RS-232 device - according to 'Compute's Mapping the Commodore 64' page 239 + // This is RS-232 device - according to 'Computes Mapping the Commodore 64' page 239 // it reads status from RSSTAT // XXX 'lda RSSTAT' not possible due to extended scnkey, fix it! lda #$FF rts !: - // According to 'Compute's Mapping the Commodore 64' page 239, it usually retrieves + // According to 'Computes Mapping the Commodore 64' page 239, it usually retrieves // status from IOSTATUS // XXX is it always the case if device is not RS-232 ? lda IOSTATUS rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/setfls.s b/c64/kernal/iostack/setfls.s index d57f770b..64f4ecb5 100644 --- a/c64/kernal/iostack/setfls.s +++ b/c64/kernal/iostack/setfls.s @@ -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 297 -// - [CM64] Compute's Mapping the Commodore 64 - page 238 +// - [RG64] C64 Programmers Reference Guide - page 297 +// - [CM64] Computes Mapping the Commodore 64 - page 238 // // CPU registers that has to be preserved (see [RG64]): .A, .X, .Y // @@ -11,10 +12,13 @@ SETFLS: // There are 6 sane ways to implement this routine, - // I hope this one won't cause similarity to CBM code + // I hope this one will not cause similarity to CBM code sta LA sty SA stx FA rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/setmsg.s b/c64/kernal/iostack/setmsg.s index 87b1125f..60790752 100644 --- a/c64/kernal/iostack/setmsg.s +++ b/c64/kernal/iostack/setmsg.s @@ -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 298 -// - [CM64] Compute's Mapping the Commodore 64 - page 239 +// - [RG64] C64 Programmers Reference Guide - page 298 +// - [CM64] Computes Mapping the Commodore 64 - page 239 // // CPU registers that has to be preserved (see [RG64]): .A, .X, .Y // @@ -11,3 +12,6 @@ SETMSG: sta MSGFLG rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/setnam.s b/c64/kernal/iostack/setnam.s index 78033a3c..42191c4d 100644 --- a/c64/kernal/iostack/setnam.s +++ b/c64/kernal/iostack/setnam.s @@ -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 298/299 -// - [CM64] Compute's Mapping the Commodore 64 - page 238 +// - [RG64] C64 Programmers Reference Guide - page 298/299 +// - [CM64] Computes Mapping the Commodore 64 - page 238 // // CPU registers that has to be preserved (see [RG64]): .A, .X, .Y // @@ -11,10 +12,13 @@ SETNAM: // There are 6 sane ways to implement this routine, - // I hope this one won't cause similarity to CBM code + // I hope this one will not cause similarity to CBM code sta FNLEN sty FNADDR + 1 stx FNADDR + 0 rts + + +#endif // ROM layout diff --git a/c64/kernal/iostack/settmo.s b/c64/kernal/iostack/settmo.s index 16f84c40..f237ef28 100644 --- a/c64/kernal/iostack/settmo.s +++ b/c64/kernal/iostack/settmo.s @@ -1,13 +1,18 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Official Kernal routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 300 -// - [CM64] Compute's Mapping the Commodore 64 - page 239 +// - [RG64] C64 Programmers Reference Guide - page 300 +// - [CM64] Computes Mapping the Commodore 64 - page 239 // // CPU registers that has to be preserved (see [RG64]): .A, .X, .Y // + SETTMO: sta TIMOUT rts + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff81.jcint.s b/c64/kernal/jumptable/ff81.jcint.s index ea93a325..996a3ad1 100644 --- a/c64/kernal/jumptable/ff81.jcint.s +++ b/c64/kernal/jumptable/ff81.jcint.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Initialise screen editor -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp CINT + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff84.jioinit.s b/c64/kernal/jumptable/ff84.jioinit.s index fda7c62c..f80e7374 100644 --- a/c64/kernal/jumptable/ff84.jioinit.s +++ b/c64/kernal/jumptable/ff84.jioinit.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Initialise input/output -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp IOINIT + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff87.jramtas.s b/c64/kernal/jumptable/ff87.jramtas.s index 616021c5..3a948d26 100644 --- a/c64/kernal/jumptable/ff87.jramtas.s +++ b/c64/kernal/jumptable/ff87.jramtas.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Initialise RAM, allocate tape buffer, set screen to $0400 -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp RAMTAS + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff8a.jrestor.s b/c64/kernal/jumptable/ff8a.jrestor.s index 0fa0057e..67480085 100644 --- a/c64/kernal/jumptable/ff8a.jrestor.s +++ b/c64/kernal/jumptable/ff8a.jrestor.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Restore default IO vectors -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp RESTOR + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff8d.jvector.s b/c64/kernal/jumptable/ff8d.jvector.s index cd0b9990..d8aa7536 100644 --- a/c64/kernal/jumptable/ff8d.jvector.s +++ b/c64/kernal/jumptable/ff8d.jvector.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Read/set vectored I/O -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp VECTOR + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff90.jsetmsg.s b/c64/kernal/jumptable/ff90.jsetmsg.s index 7f54b3ac..db47557b 100644 --- a/c64/kernal/jumptable/ff90.jsetmsg.s +++ b/c64/kernal/jumptable/ff90.jsetmsg.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Control KERNAL messages -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SETMSG + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff93.jsecond.s b/c64/kernal/jumptable/ff93.jsecond.s index 6ae355f0..09bd1785 100644 --- a/c64/kernal/jumptable/ff93.jsecond.s +++ b/c64/kernal/jumptable/ff93.jsecond.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Send secondary address after LISTEN -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SECOND + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff96.jtksa.s b/c64/kernal/jumptable/ff96.jtksa.s index 5f710af0..7684d841 100644 --- a/c64/kernal/jumptable/ff96.jtksa.s +++ b/c64/kernal/jumptable/ff96.jtksa.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Send secondary address after talk -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp TKSA + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff99.jmemtop.s b/c64/kernal/jumptable/ff99.jmemtop.s index b6653e94..59857cdf 100644 --- a/c64/kernal/jumptable/ff99.jmemtop.s +++ b/c64/kernal/jumptable/ff99.jmemtop.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // read/set the top of memory -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp MEMTOP + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff9c.jmembot.s b/c64/kernal/jumptable/ff9c.jmembot.s index 8745f99b..39a538d2 100644 --- a/c64/kernal/jumptable/ff9c.jmembot.s +++ b/c64/kernal/jumptable/ff9c.jmembot.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // read/set the bottom of memory -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp MEMBOT + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ff9f.jscnkey.s b/c64/kernal/jumptable/ff9f.jscnkey.s index 5d71d27d..a91699a6 100644 --- a/c64/kernal/jumptable/ff9f.jscnkey.s +++ b/c64/kernal/jumptable/ff9f.jscnkey.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Scan keyboard -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffa2.jsettmo.s b/c64/kernal/jumptable/ffa2.jsettmo.s index 3d82b696..d3819103 100644 --- a/c64/kernal/jumptable/ffa2.jsettmo.s +++ b/c64/kernal/jumptable/ffa2.jsettmo.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Set timeout on serial bus -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SETTMO + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffa5.jacptr.s b/c64/kernal/jumptable/ffa5.jacptr.s index 6446229f..1003f2c3 100644 --- a/c64/kernal/jumptable/ffa5.jacptr.s +++ b/c64/kernal/jumptable/ffa5.jacptr.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Input byte from serial port -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp ACPTR + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffa8.jciout.s b/c64/kernal/jumptable/ffa8.jciout.s index 2838110a..e731ebb4 100644 --- a/c64/kernal/jumptable/ffa8.jciout.s +++ b/c64/kernal/jumptable/ffa8.jciout.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Output byte to serial port -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp CIOUT + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffab.juntlk.s b/c64/kernal/jumptable/ffab.juntlk.s index dc6ebbe0..b56e2056 100644 --- a/c64/kernal/jumptable/ffab.juntlk.s +++ b/c64/kernal/jumptable/ffab.juntlk.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Command serial bus to UNTALK -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp UNTLK + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffae.junlsn.s b/c64/kernal/jumptable/ffae.junlsn.s index 55cab36f..7fdbb0ca 100644 --- a/c64/kernal/jumptable/ffae.junlsn.s +++ b/c64/kernal/jumptable/ffae.junlsn.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Command serial bus to UNLISTEN -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp UNLSN + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffb1.jlisten.s b/c64/kernal/jumptable/ffb1.jlisten.s index e93c9be8..ed8194b1 100644 --- a/c64/kernal/jumptable/ffb1.jlisten.s +++ b/c64/kernal/jumptable/ffb1.jlisten.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Command devices on the serial bus to listen -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp LISTEN + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffb4.jtalk.s b/c64/kernal/jumptable/ffb4.jtalk.s index f94fffd3..f81e4180 100644 --- a/c64/kernal/jumptable/ffb4.jtalk.s +++ b/c64/kernal/jumptable/ffb4.jtalk.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Command serial bus device to talk -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp TALK + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffb7.jreadst.s b/c64/kernal/jumptable/ffb7.jreadst.s index 46fcc2fd..61d01c6d 100644 --- a/c64/kernal/jumptable/ffb7.jreadst.s +++ b/c64/kernal/jumptable/ffb7.jreadst.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Read I/O statusjmp -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp READST + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffba.jsetfls.s b/c64/kernal/jumptable/ffba.jsetfls.s index ec77c14a..f74109bf 100644 --- a/c64/kernal/jumptable/ffba.jsetfls.s +++ b/c64/kernal/jumptable/ffba.jsetfls.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Set logical, first and second addresses -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SETFLS + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffbd.jsetnam.s b/c64/kernal/jumptable/ffbd.jsetnam.s index e0e3871e..eeb753bf 100644 --- a/c64/kernal/jumptable/ffbd.jsetnam.s +++ b/c64/kernal/jumptable/ffbd.jsetnam.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Set file name -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SETNAM + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffc0.jopen.s b/c64/kernal/jumptable/ffc0.jopen.s index 82a5aa1b..404bc2bf 100644 --- a/c64/kernal/jumptable/ffc0.jopen.s +++ b/c64/kernal/jumptable/ffc0.jopen.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // open a logical file -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (IOPEN) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffc3.jclose.s b/c64/kernal/jumptable/ffc3.jclose.s index badb18c8..368ef699 100644 --- a/c64/kernal/jumptable/ffc3.jclose.s +++ b/c64/kernal/jumptable/ffc3.jclose.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // close a specified logical file -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ICLOSE) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffc6.jchkin.s b/c64/kernal/jumptable/ffc6.jchkin.s index b06874ef..9f4472bb 100644 --- a/c64/kernal/jumptable/ffc6.jchkin.s +++ b/c64/kernal/jumptable/ffc6.jchkin.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Open channel for input -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ICHKIN) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffc9.jckout.s b/c64/kernal/jumptable/ffc9.jckout.s index 64ff0481..0a090ec4 100644 --- a/c64/kernal/jumptable/ffc9.jckout.s +++ b/c64/kernal/jumptable/ffc9.jckout.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Open channel for output -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ICKOUT) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffcc.jclrchn.s b/c64/kernal/jumptable/ffcc.jclrchn.s index a207f2e4..a5706482 100644 --- a/c64/kernal/jumptable/ffcc.jclrchn.s +++ b/c64/kernal/jumptable/ffcc.jclrchn.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // close input and output channels -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ICLRCH) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffcf.jchrin.s b/c64/kernal/jumptable/ffcf.jchrin.s index de1ae44e..ad84480a 100644 --- a/c64/kernal/jumptable/ffcf.jchrin.s +++ b/c64/kernal/jumptable/ffcf.jchrin.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Input character from channel -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (IBASIN) + + +#endif // ROM layout \ No newline at end of file diff --git a/c64/kernal/jumptable/ffd2.jchrout.s b/c64/kernal/jumptable/ffd2.jchrout.s index c3f31a0e..e685f773 100644 --- a/c64/kernal/jumptable/ffd2.jchrout.s +++ b/c64/kernal/jumptable/ffd2.jchrout.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Output character to channel -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (IBSOUT) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffd5.jload.s b/c64/kernal/jumptable/ffd5.jload.s index 002e01fd..092653d8 100644 --- a/c64/kernal/jumptable/ffd5.jload.s +++ b/c64/kernal/jumptable/ffd5.jload.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // load RAM from a device -// C64 Programmer's Reference Guide Page 272 +// C64 Programmers Reference Guide Page 272 jmp LOAD_PREP + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffd8.jsave.s b/c64/kernal/jumptable/ffd8.jsave.s index 25f3fbec..f53a236c 100644 --- a/c64/kernal/jumptable/ffd8.jsave.s +++ b/c64/kernal/jumptable/ffd8.jsave.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // SAVE RAM to device -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SAVE_PREP + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffdb.jsettim.s b/c64/kernal/jumptable/ffdb.jsettim.s index 61625a29..c6fb5529 100644 --- a/c64/kernal/jumptable/ffdb.jsettim.s +++ b/c64/kernal/jumptable/ffdb.jsettim.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Set realtime clock -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp SETTIM + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffde.jrdtim.s b/c64/kernal/jumptable/ffde.jrdtim.s index 5a190b14..b269356f 100644 --- a/c64/kernal/jumptable/ffde.jrdtim.s +++ b/c64/kernal/jumptable/ffde.jrdtim.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Read real time clock -// C64 Programmer's Reference Guide Page 273 +// C64 Programmers Reference Guide Page 273 jmp RDTIM + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffe1.jstop.s b/c64/kernal/jumptable/ffe1.jstop.s index 0938b7d1..ac1b2b60 100644 --- a/c64/kernal/jumptable/ffe1.jstop.s +++ b/c64/kernal/jumptable/ffe1.jstop.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Scan stop key -// C64 Programmer's Reference Guide Page 273 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 273 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ISTOP) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffe4.jgetin.s b/c64/kernal/jumptable/ffe4.jgetin.s index feafd28c..e53a9f29 100644 --- a/c64/kernal/jumptable/ffe4.jgetin.s +++ b/c64/kernal/jumptable/ffe4.jgetin.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // Get character from keyboard queue (keyboard buffer) -// C64 Programmer's Reference Guide Page 272 -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// C64 Programmers Reference Guide Page 272 +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (IGETIN) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffe7.jclall.s b/c64/kernal/jumptable/ffe7.jclall.s index 287f85ac..efae3332 100644 --- a/c64/kernal/jumptable/ffe7.jclall.s +++ b/c64/kernal/jumptable/ffe7.jclall.s @@ -1,5 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFE7 - Close all files vector // (http://codebase64.org/doku.php?id=base:kernalreference) -// According to Compute's Mapping the Commodore 64 (pages 74/75), this jump is indirect +// According to Computes Mapping the Commodore 64 (pages 74/75), this jump is indirect jmp (ICLALL) + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffea.judtim.s b/c64/kernal/jumptable/ffea.judtim.s index bccd0603..5d47b17e 100644 --- a/c64/kernal/jumptable/ffea.judtim.s +++ b/c64/kernal/jumptable/ffea.judtim.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFEA - Update jiffy clock vector // (http://codebase64.org/doku.php?id=base:kernalreference) jmp UDTIM + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/ffed.jscreen.s b/c64/kernal/jumptable/ffed.jscreen.s index 8f58f3f2..bf4c0ec7 100644 --- a/c64/kernal/jumptable/ffed.jscreen.s +++ b/c64/kernal/jumptable/ffed.jscreen.s @@ -1,4 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFED - Return screen size (X=columns, Y=rows) // (http://codebase64.org/doku.php?id=base:kernalreference) jmp SCREEN + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/fff0.jplot.s b/c64/kernal/jumptable/fff0.jplot.s index 2a9f782c..8ca58b05 100644 --- a/c64/kernal/jumptable/fff0.jplot.s +++ b/c64/kernal/jumptable/fff0.jplot.s @@ -1,6 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // $FFF0 - Get/Set cursor location vector // (http://codebase64.org/doku.php?id=base:kernalreference) // To set: C=0, to get, C=1 // X=row, Y=column jmp PLOT + + +#endif // ROM layout diff --git a/c64/kernal/jumptable/fff3.jiobase.s b/c64/kernal/jumptable/fff3.jiobase.s index 3250765f..2b84c4ed 100644 --- a/c64/kernal/jumptable/fff3.jiobase.s +++ b/c64/kernal/jumptable/fff3.jiobase.s @@ -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 284 -// - [CM64] Compute's Mapping the Commodore 64 - page 214 +// - [RG64] C64 Programmers Reference Guide - page 284 +// - [CM64] Computes Mapping the Commodore 64 - page 214 // - http://codebase64.org/doku.php?id=base:kernalreference (original source) // // CPU registers that has to be preserved (see [RG64]): .A @@ -17,3 +18,5 @@ ldx #$00 rts + +#endif // ROM layout diff --git a/c64/kernal/keyboard/chrin_keyboard.s b/c64/kernal/keyboard/chrin_keyboard.s index be3efa72..dcff70e4 100644 --- a/c64/kernal/keyboard/chrin_keyboard.s +++ b/c64/kernal/keyboard/chrin_keyboard.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Keyboard part of the CHRIN routine @@ -170,3 +171,6 @@ chrin_programmable_key: bne !- // jumps always #endif // CONFIG_PROGRAMMABLE_KEYS + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/f142.getin_keyboard.s b/c64/kernal/keyboard/f142.getin_keyboard.s index 3e3da159..2afaac04 100644 --- a/c64/kernal/keyboard/f142.getin_keyboard.s +++ b/c64/kernal/keyboard/f142.getin_keyboard.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Well-known Kernal routine, described in: @@ -28,3 +29,6 @@ getin_keyboard: // XXX confirm that here is really a part of GETIN! clc rts + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/f6ed.stop.s b/c64/kernal/keyboard/f6ed.stop.s index 3f41b20a..8aca9a8d 100644 --- a/c64/kernal/keyboard/f6ed.stop.s +++ b/c64/kernal/keyboard/f6ed.stop.s @@ -1,16 +1,17 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Official Kernal routine, described in: // -// - [RG64] C64 Programmer's Reference Guide - page 301 -// - [CM64] Compute's Mapping the Commodore 64 - page 232 +// - [RG64] C64 Programmers Reference Guide - page 301 +// - [CM64] Computes Mapping the Commodore 64 - page 232 // // CPU registers that has to be preserved (see [RG64]): .Y // STOP: // Bit 7 of STKEY contains the state of the STOP key - // (Compute's Mapping the 64, p27) + // (Computes Mapping the 64, p27) // BASIC checks carry flag to indicate STOP or not lda STKEY @@ -26,3 +27,6 @@ stop_pressed: sec lda #$00 rts + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix.s b/c64/kernal/keyboard/kb_matrix.s index b56631a5..ea6a7184 100644 --- a/c64/kernal/keyboard/kb_matrix.s +++ b/c64/kernal/keyboard/kb_matrix.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Keyboard matrix, based on // -// - [RG64] C64 Programmer's Reference Guide - pages 379-381 -// - [CM64] Compute's Mapping the Commodore 64 - pages 38-39 +// - [RG64] C64 Programmers Reference Guide - pages 379-381 +// - [CM64] Computes Mapping the Commodore 64 - pages 38-39 // - http://commodore128.mirkosoft.sk/keyboard.html (C128 extension) // - http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt @@ -58,3 +59,6 @@ __kb_matrix_ctrl: #endif .byte $1C,$00,$1D,$00,$00,$1F,$1E,$00 .byte $90,$06,$00,$05,$00,$00,$11,$00 + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_128.s b/c64/kernal/keyboard/kb_matrix_128.s index 85d09b7b..ac63a0f3 100644 --- a/c64/kernal/keyboard/kb_matrix_128.s +++ b/c64/kernal/keyboard/kb_matrix_128.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Extended keyboard matrix for Commodore 128 keyboards, based on // -// - [CM128] Compute's Mapping the Commodore 128 - page 290 +// - [CM128] Computes Mapping the Commodore 128 - page 290 // - http://commodore128.mirkosoft.sk/keyboard.html // @@ -28,3 +29,6 @@ kb_matrix_128_bucky_filter: #endif // CONFIG_KEYBOARD_C128 and no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_65.s b/c64/kernal/keyboard/kb_matrix_65.s index 58986d02..3e54aec7 100644 --- a/c64/kernal/keyboard/kb_matrix_65.s +++ b/c64/kernal/keyboard/kb_matrix_65.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Extended keyboard matrix for Commodore 65 keyboards, based on @@ -19,3 +20,6 @@ kb_matrix_65_shifted: #endif // CONFIG_KEYBOARD_C65 and no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_alwaysrepeat.s b/c64/kernal/keyboard/kb_matrix_alwaysrepeat.s index ffb80e02..c9b6ea32 100644 --- a/c64/kernal/keyboard/kb_matrix_alwaysrepeat.s +++ b/c64/kernal/keyboard/kb_matrix_alwaysrepeat.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Matrix ids of keys which should be repeated regardless of RPTFLG // // Values based on: -// - [CM64] Compute's Mapping the Commodore 64 - page 58 +// - [CM64] Computes Mapping the Commodore 64 - page 58 // @@ -21,3 +22,6 @@ __kb_matrix_alwaysrepeat_end: #endif // no CONFIG_LEGACY_SCNKEY and no CONFIG_KEY_REPEAT_ALWAYS + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_bucky.s b/c64/kernal/keyboard/kb_matrix_bucky.s index 2d67f574..bdba72cb 100644 --- a/c64/kernal/keyboard/kb_matrix_bucky.s +++ b/c64/kernal/keyboard/kb_matrix_bucky.s @@ -1,10 +1,11 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Matrix for retrieving bucky key status on the C64 keyboard // // Values based on: -// - [CM64] Compute's Mapping the Commodore 64 - pages 58 (SHFLAG), 173 (matrix) -// - [CM128] Compute's Mapping the Commodore 128 - pages 212 (SHFLAG), 290 (matrix) +// - [CM64] Computes Mapping the Commodore 64 - pages 58 (SHFLAG), 173 (matrix) +// - [CM128] Computes Mapping the Commodore 128 - pages 212 (SHFLAG), 290 (matrix) // - https://github.com/MEGA65/c65-specifications/blob/master/c65manualupdated.txt // @@ -83,3 +84,6 @@ kb_matrix_bucky_shflag: // mask to be ORed to SHFLAG to mark key status #endif // no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_bucky_filter.s b/c64/kernal/keyboard/kb_matrix_bucky_filter.s index 0e2a9b36..947a470d 100644 --- a/c64/kernal/keyboard/kb_matrix_bucky_filter.s +++ b/c64/kernal/keyboard/kb_matrix_bucky_filter.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Matrix for filtering out bucky keys while scanning the C64 keyboard // // Values based on: -// - [CM64] Compute's Mapping the Commodore 64 - pags 58 (SHFLAG), 173 (matrix) +// - [CM64] Computes Mapping the Commodore 64 - pags 58 (SHFLAG), 173 (matrix) // @@ -25,3 +26,6 @@ kb_matrix_bucky_filter: #endif // no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_joy.s b/c64/kernal/keyboard/kb_matrix_joy.s index 8f9deaab..06c06fc8 100644 --- a/c64/kernal/keyboard/kb_matrix_joy.s +++ b/c64/kernal/keyboard/kb_matrix_joy.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Matrix for retrieving C64 joystick status and inject is as keyboard event @@ -36,3 +37,6 @@ kb_matrix_joy_keytab_hi: .byte >__kb_matrix_normal // right #endif + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_lookup.s b/c64/kernal/keyboard/kb_matrix_lookup.s index 9e1b8f34..f8bcd988 100644 --- a/c64/kernal/keyboard/kb_matrix_lookup.s +++ b/c64/kernal/keyboard/kb_matrix_lookup.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper table for determining keyboard matrix decoding table on the C64 keyboard @@ -21,3 +22,6 @@ kb_matrix_lookup: .byte $FF // %111 SHIFT+VENDOR+CTRL #endif + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_lookup_legacy.s b/c64/kernal/keyboard/kb_matrix_lookup_legacy.s index 62f2a932..3374c8ee 100644 --- a/c64/kernal/keyboard/kb_matrix_lookup_legacy.s +++ b/c64/kernal/keyboard/kb_matrix_lookup_legacy.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Work out if normal, shifted, control or Vendor modified keyboard. @@ -26,3 +27,6 @@ kb_matrix_lookup: .byte $80 // Vendor + CTRL + SHIFT #endif // CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_row_keys.s b/c64/kernal/keyboard/kb_matrix_row_keys.s index bb4b9afb..6557442a 100644 --- a/c64/kernal/keyboard/kb_matrix_row_keys.s +++ b/c64/kernal/keyboard/kb_matrix_row_keys.s @@ -1,9 +1,10 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Single row key codes for scanning the C64 keyboard // // Values based on: -// - [CM64] Compute's Mapping the Commodore 64 - pags 58 (SHFLAG), 173 (matrix) +// - [CM64] Computes Mapping the Commodore 64 - pags 58 (SHFLAG), 173 (matrix) // @@ -27,3 +28,6 @@ kb_matrix_row_keys: #endif // no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/kb_matrix_row_offsets.s b/c64/kernal/keyboard/kb_matrix_row_offsets.s index efc2ceaf..1f90d00a 100644 --- a/c64/kernal/keyboard/kb_matrix_row_offsets.s +++ b/c64/kernal/keyboard/kb_matrix_row_offsets.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper values to quickly determine row offset from the start of keyboard matrix @@ -21,3 +22,6 @@ kb_matrix_row_offsets: .byte 7*8 #endif // no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/keyboard_disconnect.s b/c64/kernal/keyboard/keyboard_disconnect.s index 1fdae023..34aa2f89 100644 --- a/c64/kernal/keyboard/keyboard_disconnect.s +++ b/c64/kernal/keyboard/keyboard_disconnect.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Helper routine - disconnects the keyboard from CIA1_PRB, @@ -20,3 +21,6 @@ keyboard_disconnect: #endif + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/pop_keyboard_buffer.s b/c64/kernal/keyboard/pop_keyboard_buffer.s index 6f3b172b..142ceb23 100644 --- a/c64/kernal/keyboard/pop_keyboard_buffer.s +++ b/c64/kernal/keyboard/pop_keyboard_buffer.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // Pop key out of keyboard buffer // Disable interrupts while reading from keyboard buffer @@ -20,3 +21,6 @@ pop_keyboard_buffer: cli rts + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/programmable_keys.s b/c64/kernal/keyboard/programmable_keys.s index 1f31d204..791ca3cf 100644 --- a/c64/kernal/keyboard/programmable_keys.s +++ b/c64/kernal/keyboard/programmable_keys.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Command string definitions for programmable keys @@ -123,3 +124,6 @@ programmable_keys_offsets: #endif // CONFIG_PROGRAMMABLE_KEYS + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/scnkey.s b/c64/kernal/keyboard/scnkey.s index 0aadfd93..31f44917 100644 --- a/c64/kernal/keyboard/scnkey.s +++ b/c64/kernal/keyboard/scnkey.s @@ -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 295 -// - [CM64] Compute's Mapping the Commodore 64 - page 220 +// - [RG64] C64 Programmers Reference Guide - page 295 +// - [CM64] Computes Mapping the Commodore 64 - page 220 // // CPU registers that has to be preserved (see [RG64]): none // @@ -488,3 +489,6 @@ via_keylog: #endif // no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/scnkey_128.s b/c64/kernal/keyboard/scnkey_128.s index dbbeecdf..5243f5f8 100644 --- a/c64/kernal/keyboard/scnkey_128.s +++ b/c64/kernal/keyboard/scnkey_128.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Keyboard scanning routine extension for C128 keyboards // -// - [CM128] Compute's Mapping the Commodore 128 - pages 212 (SHFLAG), 290 (matrix) +// - [CM128] Computes Mapping the Commodore 128 - pages 212 (SHFLAG), 290 (matrix) // @@ -65,3 +66,6 @@ scnkey_128_no_keys: #endif // CONFIG_KEYBOARD_C128 and no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/scnkey_65.s b/c64/kernal/keyboard/scnkey_65.s index 5d3f5b58..5afb8adc 100644 --- a/c64/kernal/keyboard/scnkey_65.s +++ b/c64/kernal/keyboard/scnkey_65.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Keyboard scanning routine extension for C65 keyboards // -// - [CM128] Compute's Mapping the Commodore 128 - pages 212 (SHFLAG) +// - [CM128] Computes Mapping the Commodore 128 - pages 212 (SHFLAG) // - https://github.com/MEGA65/c65-specifications/blob/master/c65manualupdated.txt (matrix) // @@ -63,3 +64,6 @@ scnkey_65_done: #endif // CONFIG_KEYBOARD_C65 and no CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/scnkey_legacy.s b/c64/kernal/keyboard/scnkey_legacy.s index fe25392b..50a68480 100644 --- a/c64/kernal/keyboard/scnkey_legacy.s +++ b/c64/kernal/keyboard/scnkey_legacy.s @@ -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 295 -// - [CM64] Compute's Mapping the Commodore 64 - page 220 +// - [RG64] C64 Programmers Reference Guide - page 295 +// - [CM64] Computes Mapping the Commodore 64 - page 220 // // CPU registers that has to be preserved (see [RG64]): none // @@ -527,3 +528,6 @@ KeyRepeatWait: #endif // CONFIG_LEGACY_SCNKEY + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/scnkey_set_keytab.s b/c64/kernal/keyboard/scnkey_set_keytab.s index 6c9a03b1..711b0cdc 100644 --- a/c64/kernal/keyboard/scnkey_set_keytab.s +++ b/c64/kernal/keyboard/scnkey_set_keytab.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Well-known Kernal routine, described in: // -// - [CM64] Compute's Mapping the Commodore 64 - pages 220, 221 +// - [CM64] Computes Mapping the Commodore 64 - pages 220, 221 // @@ -79,3 +80,6 @@ scnkey_toggle_if_needed: // entry for SCNKEY (TWW/CTR version) sta VIC_YMCSB !: rts + + +#endif // ROM layout diff --git a/c64/kernal/keyboard/udtim_keyboard.s b/c64/kernal/keyboard/udtim_keyboard.s index d35f86f6..10fdca11 100644 --- a/c64/kernal/keyboard/udtim_keyboard.s +++ b/c64/kernal/keyboard/udtim_keyboard.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Keyboard part of the UDTIM routine, has to preserve .Y @@ -48,3 +49,6 @@ udtim_keyboard: // unable to, for example, read the space bar status. rts + + +#endif // ROM layout diff --git a/c64/kernal/memory/fd15.restor.s b/c64/kernal/memory/fd15.restor.s index 5e181423..5e2eaf92 100644 --- a/c64/kernal/memory/fd15.restor.s +++ b/c64/kernal/memory/fd15.restor.s @@ -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 293 (RESTOR), 304 (VECTOR) -// - [CM64] Compute's Mapping the Commodore 64 - page 237 +// - [RG64] C64 Programmers Reference Guide - page 293 (RESTOR), 304 (VECTOR) +// - [CM64] Computes Mapping the Commodore 64 - page 237 // // CPU registers that has to be preserved (see [RG64]): none // @@ -22,3 +23,6 @@ VECTOR: // placing it here would cause a collision with VECTOR defaults jmp vector_real + + +#endif // ROM layout diff --git a/c64/kernal/memory/fe25.memtop.s b/c64/kernal/memory/fe25.memtop.s index 960152b0..a5bf1602 100644 --- a/c64/kernal/memory/fe25.memtop.s +++ b/c64/kernal/memory/fe25.memtop.s @@ -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 288 -// - [CM64] Compute's Mapping the Commodore 64 - page 240 +// - [RG64] C64 Programmers Reference Guide - page 288 +// - [CM64] Computes Mapping the Commodore 64 - page 240 // // CPU registers that has to be preserved (see [RG64]): .A // @@ -23,3 +24,6 @@ memtop_set: // for compatibility reasons this has to start at $FE2D stx MEMSIZK+0 rts + + +#endif // ROM layout diff --git a/c64/kernal/memory/membot.s b/c64/kernal/memory/membot.s index 84e6ce44..0da97fdc 100644 --- a/c64/kernal/memory/membot.s +++ b/c64/kernal/memory/membot.s @@ -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 287/288 -// - [CM64] Compute's Mapping the Commodore 64 - page 240 +// - [RG64] C64 Programmers Reference Guide - page 287/288 +// - [CM64] Computes Mapping the Commodore 64 - page 240 // // CPU registers that has to be preserved (see [RG64]): .A // @@ -23,3 +24,6 @@ membot_set: stx MEMSTR+0 rts + + +#endif // ROM layout diff --git a/c64/kernal/memory/under_rom_routines.s b/c64/kernal/memory/under_rom_routines.s index 5e45aa15..a37ca4e7 100644 --- a/c64/kernal/memory/under_rom_routines.s +++ b/c64/kernal/memory/under_rom_routines.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // IMPORTANT: // These routines lengths cannot be changed without changing // the aliases for peek_under_roms, poke_under_roms etc @@ -66,3 +68,6 @@ memmap_allram_routine: __ram_routines_end: #endif // CONFIG_MEMORY_MODEL_60K + + +#endif // ROM layout diff --git a/c64/kernal/memory/vector_real.s b/c64/kernal/memory/vector_real.s index 5b3e4eff..7c9e62b3 100644 --- a/c64/kernal/memory/vector_real.s +++ b/c64/kernal/memory/vector_real.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) vector_real: @@ -6,7 +7,7 @@ vector_real: // address originally used; after calling VECTOR and checking zero page // area afterwards, the address could be found there - // According to 'Compute's Mapping the Commodore 64' page 237, + // According to 'Computes Mapping the Commodore 64' page 237, // the CBM implementation does not disable IRQs - yet, the // 'C64 Programmers Reference Guide' does not contain such // warning and does not mention any preparations needed. @@ -40,3 +41,6 @@ vector_end_loop: bpl vector_restore rts + + +#endif // ROM layout diff --git a/c64/kernal/panic.s b/c64/kernal/panic.s index ef34736a..c12318e6 100644 --- a/c64/kernal/panic.s +++ b/c64/kernal/panic.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Something terrible happened - show the panic screen @@ -72,3 +73,6 @@ kernal_panic_infinite_loop: bne kernal_panic_infinite_loop // branch always #endif // CONFIG_PANIC_SCREEN + + +#endif // ROM layout diff --git a/c64/kernal/print/print_features.s b/c64/kernal/print/print_features.s index 8c958a53..264d6b68 100644 --- a/c64/kernal/print/print_features.s +++ b/c64/kernal/print/print_features.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print configured features on startup banner @@ -12,3 +13,6 @@ print_features: jmp print_kernal_message #endif // CONFIG_SHOW_FEATURES + + +#endif // ROM layout diff --git a/c64/kernal/print/print_hex_byte.s b/c64/kernal/print/print_hex_byte.s index fbb56c85..8b940ee2 100644 --- a/c64/kernal/print/print_hex_byte.s +++ b/c64/kernal/print/print_hex_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print the hex value in .A as two digits @@ -48,3 +49,6 @@ print_hex_byte: !: jmp JCHROUT #endif + + +#endif // ROM layout diff --git a/c64/kernal/print/print_kernal_message.s b/c64/kernal/print/print_kernal_message.s index 6e75e634..848308b3 100644 --- a/c64/kernal/print/print_kernal_message.s +++ b/c64/kernal/print/print_kernal_message.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print one of the standard Kernal messages, index in .X @@ -13,3 +14,6 @@ print_kernal_message: bpl !- // 0 marks end of string and #$7F jmp JCHROUT + + +#endif // ROM layout diff --git a/c64/kernal/print/print_pal_ntsc.s b/c64/kernal/print/print_pal_ntsc.s index ec4ae805..06ec137c 100644 --- a/c64/kernal/print/print_pal_ntsc.s +++ b/c64/kernal/print/print_pal_ntsc.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print video system on startup banner @@ -14,4 +15,7 @@ print_pal_ntsc: !: jmp print_kernal_message -#endif // CONFIG_SHOW_PAL_NTSC \ No newline at end of file +#endif // CONFIG_SHOW_PAL_NTSC + + +#endif // ROM layout diff --git a/c64/kernal/print/print_return.s b/c64/kernal/print/print_return.s index b53e8d6c..856f7fdf 100644 --- a/c64/kernal/print/print_return.s +++ b/c64/kernal/print/print_return.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print the carriage return @@ -6,3 +7,6 @@ print_return: lda #$0D // carriage return code jmp JCHROUT + + +#endif // ROM layout diff --git a/c64/kernal/print/print_space.s b/c64/kernal/print/print_space.s index 48365891..2194d90e 100644 --- a/c64/kernal/print/print_space.s +++ b/c64/kernal/print/print_space.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Print the space character @@ -6,3 +7,6 @@ print_space: lda #$20 // space code jmp JCHROUT + + +#endif // ROM layout diff --git a/c64/kernal/print/printf.s b/c64/kernal/print/printf.s index 44738e47..6c8bba6d 100644 --- a/c64/kernal/print/printf.s +++ b/c64/kernal/print/printf.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // printf()-like routine for simplifying debugging // Prints the literal zero-terminated string that follows, @@ -141,3 +143,5 @@ printf_retreat: #endif // CONFIG_DBG_PRINTF + +#endif // ROM layout diff --git a/c64/kernal/rom_revision/ff80.kernal_revision.s b/c64/kernal/rom_revision/ff80.kernal_revision.s index 0aad2a67..9bdc83c3 100644 --- a/c64/kernal/rom_revision/ff80.kernal_revision.s +++ b/c64/kernal/rom_revision/ff80.kernal_revision.s @@ -1,8 +1,9 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // This byte (hex $FF80, dec 65408) identifies Kernal revision on several machines. Although not all // of the, used it for versioning purpose, here is the list of all the values I could find. Sources: -// - [CM64] Compute's Mapping the Commodore 64 (page 242/243) +// - [CM64] Computes Mapping the Commodore 64 (page 242/243) // - [MM] Marko Mäkelä article, http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/c64/revisions.txt // - [VICE] Checked with ROMs included in VICE emulator // - [XEMU] Checked with ROMs retrieved by XEMU emulator @@ -59,5 +60,9 @@ // - $FF - Commander X16 (emulator r28) // + kernal_revision: .byte $F0 // chosen not to conflict with anything known so far + + +#endif // ROM layout diff --git a/c64/kernal/rs232/chkin_rs232_up2400.s b/c64/kernal/rs232/chkin_rs232_up2400.s index 0fb045b5..646a4b31 100644 --- a/c64/kernal/rs232/chkin_rs232_up2400.s +++ b/c64/kernal/rs232/chkin_rs232_up2400.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CHKIN routine @@ -12,3 +13,6 @@ chkin_rs232: #endif // CONFIG_RS232_UP2400 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/chkin_rs232_up9600.s b/c64/kernal/rs232/chkin_rs232_up9600.s index 40d4e2ac..8072c372 100644 --- a/c64/kernal/rs232/chkin_rs232_up9600.s +++ b/c64/kernal/rs232/chkin_rs232_up9600.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // // RS-232 part of the CHKIN routine @@ -46,3 +48,6 @@ chkin_rs232_nochkin #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/chrin_rs232_up2400.s b/c64/kernal/rs232/chrin_rs232_up2400.s index 252cf2db..4ac6c3dd 100644 --- a/c64/kernal/rs232/chrin_rs232_up2400.s +++ b/c64/kernal/rs232/chrin_rs232_up2400.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CHRIN routine @@ -12,3 +13,6 @@ chrin_rs232: #endif // CONFIG_RS232_UP2400 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/chrin_rs232_up9600.s b/c64/kernal/rs232/chrin_rs232_up9600.s index 0945111d..afc6e489 100644 --- a/c64/kernal/rs232/chrin_rs232_up9600.s +++ b/c64/kernal/rs232/chrin_rs232_up9600.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CHRIN routine @@ -41,3 +42,6 @@ XXX_DOGET4: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/chrout_rs232.s b/c64/kernal/rs232/chrout_rs232.s index 9c3af02f..31938cf0 100644 --- a/c64/kernal/rs232/chrout_rs232.s +++ b/c64/kernal/rs232/chrout_rs232.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CHROUT routine @@ -12,3 +13,6 @@ chrout_rs232: #endif // HAS_RS232 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/ckout_rs232_up2400.s b/c64/kernal/rs232/ckout_rs232_up2400.s index 7cec81d6..a526891e 100644 --- a/c64/kernal/rs232/ckout_rs232_up2400.s +++ b/c64/kernal/rs232/ckout_rs232_up2400.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CKOUT routine @@ -12,3 +13,6 @@ ckout_rs232: #endif // CONFIG_RS232_UP2400 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/ckout_rs232_up9600.s b/c64/kernal/rs232/ckout_rs232_up9600.s index e2877512..4c6a6535 100644 --- a/c64/kernal/rs232/ckout_rs232_up9600.s +++ b/c64/kernal/rs232/ckout_rs232_up9600.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CKOUT routine @@ -21,3 +22,6 @@ ckout_rs232: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/close_rs232.s b/c64/kernal/rs232/close_rs232.s index 52d4bf84..c270f473 100644 --- a/c64/kernal/rs232/close_rs232.s +++ b/c64/kernal/rs232/close_rs232.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the CLOSE routine @@ -40,3 +41,6 @@ close_rs232_end: #endif // HAS_RS232 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/getin_rs232.s b/c64/kernal/rs232/getin_rs232.s index 17215ead..b6a01d29 100644 --- a/c64/kernal/rs232/getin_rs232.s +++ b/c64/kernal/rs232/getin_rs232.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the GETIN routine @@ -12,3 +13,6 @@ getin_rs232: #endif // HAS_RS232 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/open_rs232.s b/c64/kernal/rs232/open_rs232.s index f4b1c0a0..864d8487 100644 --- a/c64/kernal/rs232/open_rs232.s +++ b/c64/kernal/rs232/open_rs232.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 part of the OPEN routine @@ -58,3 +59,6 @@ open_rs232_end: #endif // HAS_RS232 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/rs232_count_channels.s b/c64/kernal/rs232/rs232_count_channels.s index 7e032781..1ff4cb8a 100644 --- a/c64/kernal/rs232/rs232_count_channels.s +++ b/c64/kernal/rs232/rs232_count_channels.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Sets .X to number of open RS-232 channels @@ -24,3 +25,6 @@ rs232_count_channels: #endif + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_disable.s b/c64/kernal/rs232/up9600_disable.s index 80ec3cc4..603a246f 100644 --- a/c64/kernal/rs232/up9600_disable.s +++ b/c64/kernal/rs232/up9600_disable.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Disable UP9600 interface @@ -42,3 +43,6 @@ up9600_disable: // XXX adapt #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_enable.s b/c64/kernal/rs232/up9600_enable.s index f282588c..96a1e893 100644 --- a/c64/kernal/rs232/up9600_enable.s +++ b/c64/kernal/rs232/up9600_enable.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Enable UP9600 interface support @@ -128,6 +129,7 @@ INSTERR rts - - #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout \ No newline at end of file diff --git a/c64/kernal/rs232/up9600_ihitab.s b/c64/kernal/rs232/up9600_ihitab.s index 05310e40..c0eb5793 100644 --- a/c64/kernal/rs232/up9600_ihitab.s +++ b/c64/kernal/rs232/up9600_ihitab.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Timer values for PAL/NTSC - high bytes @@ -16,3 +17,6 @@ up9600_ihitab: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_ilotab.s b/c64/kernal/rs232/up9600_ilotab.s index bede02ea..e6fbf3a0 100644 --- a/c64/kernal/rs232/up9600_ilotab.s +++ b/c64/kernal/rs232/up9600_ilotab.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Timer values for PAL/NTSC - low bytes @@ -16,3 +17,6 @@ up9600_ilotab: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_irq.s b/c64/kernal/rs232/up9600_irq.s index a5a99e0e..f6dc79ac 100644 --- a/c64/kernal/rs232/up9600_irq.s +++ b/c64/kernal/rs232/up9600_irq.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 IRQ handler part @@ -38,3 +39,6 @@ up9600_irq_end: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_nmi.s b/c64/kernal/rs232/up9600_nmi.s index fea3652d..c9945ed3 100644 --- a/c64/kernal/rs232/up9600_nmi.s +++ b/c64/kernal/rs232/up9600_nmi.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // RS-232 NMI handler part @@ -64,3 +65,6 @@ NMIBYTR2 rti #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_rsin.s b/c64/kernal/rs232/up9600_rsin.s index 39009f0c..8151d338 100644 --- a/c64/kernal/rs232/up9600_rsin.s +++ b/c64/kernal/rs232/up9600_rsin.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Get byte from serial interface @@ -41,3 +42,6 @@ up9600_rsin_end: rts #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/rs232/up9600_rsout.s b/c64/kernal/rs232/up9600_rsout.s index fd4e607d..93b847e8 100644 --- a/c64/kernal/rs232/up9600_rsout.s +++ b/c64/kernal/rs232/up9600_rsout.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Put byte to serial interface @@ -54,3 +55,6 @@ rs232_rsout_wait: #endif // CONFIG_RS232_UP9600 + + +#endif // ROM layout diff --git a/c64/kernal/screen/chrout_screen.s b/c64/kernal/screen/chrout_screen.s index 36f80d85..d8dadce8 100644 --- a/c64/kernal/screen/chrout_screen.s +++ b/c64/kernal/screen/chrout_screen.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_clr.s b/c64/kernal/screen/chrout_screen_clr.s index 75be3574..3f3d2599 100644 --- a/c64/kernal/screen/chrout_screen_clr.s +++ b/c64/kernal/screen/chrout_screen_clr.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_control.s b/c64/kernal/screen/chrout_screen_control.s index 05f5f828..ad5cd563 100644 --- a/c64/kernal/screen/chrout_screen_control.s +++ b/c64/kernal/screen/chrout_screen_control.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_crsr.s b/c64/kernal/screen/chrout_screen_crsr.s index 2b8cb339..13f22bd0 100644 --- a/c64/kernal/screen/chrout_screen_crsr.s +++ b/c64/kernal/screen/chrout_screen_crsr.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_del.s b/c64/kernal/screen/chrout_screen_del.s index 2b02b6af..6036228b 100644 --- a/c64/kernal/screen/chrout_screen_del.s +++ b/c64/kernal/screen/chrout_screen_del.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_gfxtxt.s b/c64/kernal/screen/chrout_screen_gfxtxt.s index e523e03b..f1e8486e 100644 --- a/c64/kernal/screen/chrout_screen_gfxtxt.s +++ b/c64/kernal/screen/chrout_screen_gfxtxt.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_home.s b/c64/kernal/screen/chrout_screen_home.s index 7acbbe12..6dc1c559 100644 --- a/c64/kernal/screen/chrout_screen_home.s +++ b/c64/kernal/screen/chrout_screen_home.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_ins.s b/c64/kernal/screen/chrout_screen_ins.s index 3e2b2fbe..dd1e60b6 100644 --- a/c64/kernal/screen/chrout_screen_ins.s +++ b/c64/kernal/screen/chrout_screen_ins.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_jumptable_codes.s b/c64/kernal/screen/chrout_screen_jumptable_codes.s index 321309bc..57252b9f 100644 --- a/c64/kernal/screen/chrout_screen_jumptable_codes.s +++ b/c64/kernal/screen/chrout_screen_jumptable_codes.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_quote.s b/c64/kernal/screen/chrout_screen_quote.s index 7cdf875e..1ddd0c64 100644 --- a/c64/kernal/screen/chrout_screen_quote.s +++ b/c64/kernal/screen/chrout_screen_quote.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_return.s b/c64/kernal/screen/chrout_screen_return.s index 283c4389..40af4342 100644 --- a/c64/kernal/screen/chrout_screen_return.s +++ b/c64/kernal/screen/chrout_screen_return.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_rvs.s b/c64/kernal/screen/chrout_screen_rvs.s index b1f68b76..283c2649 100644 --- a/c64/kernal/screen/chrout_screen_rvs.s +++ b/c64/kernal/screen/chrout_screen_rvs.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_shift_onoff.s b/c64/kernal/screen/chrout_screen_shift_onoff.s index 4f56ebac..b0e0ca57 100644 --- a/c64/kernal/screen/chrout_screen_shift_onoff.s +++ b/c64/kernal/screen/chrout_screen_shift_onoff.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_stop.s b/c64/kernal/screen/chrout_screen_stop.s index 179c217f..7a96d3e1 100644 --- a/c64/kernal/screen/chrout_screen_stop.s +++ b/c64/kernal/screen/chrout_screen_stop.s @@ -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 diff --git a/c64/kernal/screen/chrout_screen_tab.s b/c64/kernal/screen/chrout_screen_tab.s index efc556ca..f07e8d61 100644 --- a/c64/kernal/screen/chrout_screen_tab.s +++ b/c64/kernal/screen/chrout_screen_tab.s @@ -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 diff --git a/c64/kernal/screen/cursor.s b/c64/kernal/screen/cursor.s index 2e2d2748..f901e91a 100644 --- a/c64/kernal/screen/cursor.s +++ b/c64/kernal/screen/cursor.s @@ -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 diff --git a/c64/kernal/screen/cursor_enable.s b/c64/kernal/screen/cursor_enable.s index 09b53906..9ea0c8ca 100644 --- a/c64/kernal/screen/cursor_enable.s +++ b/c64/kernal/screen/cursor_enable.s @@ -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 diff --git a/c64/kernal/screen/cursor_show.s b/c64/kernal/screen/cursor_show.s index 6cd78afe..2e66f5bf 100644 --- a/c64/kernal/screen/cursor_show.s +++ b/c64/kernal/screen/cursor_show.s @@ -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 diff --git a/c64/kernal/screen/e50a.plot.s b/c64/kernal/screen/e50a.plot.s index 014c5c07..d23ea917 100644 --- a/c64/kernal/screen/e50a.plot.s +++ b/c64/kernal/screen/e50a.plot.s @@ -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 diff --git a/c64/kernal/screen/e544.clear_screen.s b/c64/kernal/screen/e544.clear_screen.s index 1ee9bec9..affc4f5f 100644 --- a/c64/kernal/screen/e544.clear_screen.s +++ b/c64/kernal/screen/e544.clear_screen.s @@ -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 diff --git a/c64/kernal/screen/e566.cursor_home.s b/c64/kernal/screen/e566.cursor_home.s index e5c22d17..b66ffb7c 100644 --- a/c64/kernal/screen/e566.cursor_home.s +++ b/c64/kernal/screen/e566.cursor_home.s @@ -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 diff --git a/c64/kernal/screen/e56c.screen_calculate_pnt_user.s b/c64/kernal/screen/e56c.screen_calculate_pnt_user.s index bb24ddfc..9a3ed016 100644 --- a/c64/kernal/screen/e56c.screen_calculate_pnt_user.s +++ b/c64/kernal/screen/e56c.screen_calculate_pnt_user.s @@ -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 diff --git a/c64/kernal/screen/e8ea.screen_scroll_up.s b/c64/kernal/screen/e8ea.screen_scroll_up.s index af216001..169a0783 100644 --- a/c64/kernal/screen/e8ea.screen_scroll_up.s +++ b/c64/kernal/screen/e8ea.screen_scroll_up.s @@ -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 diff --git a/c64/kernal/screen/e9ff.screen_clear_line.s b/c64/kernal/screen/e9ff.screen_clear_line.s index fc347e18..049b5a60 100644 --- a/c64/kernal/screen/e9ff.screen_clear_line.s +++ b/c64/kernal/screen/e9ff.screen_clear_line.s @@ -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 diff --git a/c64/kernal/screen/screen.s b/c64/kernal/screen/screen.s index 6964d141..1f2a4ec6 100644 --- a/c64/kernal/screen/screen.s +++ b/c64/kernal/screen/screen.s @@ -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 diff --git a/c64/kernal/screen/screen_advance_to_next_line.s b/c64/kernal/screen/screen_advance_to_next_line.s index e83be7b4..73b0528c 100644 --- a/c64/kernal/screen/screen_advance_to_next_line.s +++ b/c64/kernal/screen/screen_advance_to_next_line.s @@ -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 diff --git a/c64/kernal/screen/screen_calculate_pntr_lnmx.s b/c64/kernal/screen/screen_calculate_pntr_lnmx.s index b6645ba8..b97e9251 100644 --- a/c64/kernal/screen/screen_calculate_pntr_lnmx.s +++ b/c64/kernal/screen/screen_calculate_pntr_lnmx.s @@ -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 diff --git a/c64/kernal/screen/screen_check_space_ends_line.s b/c64/kernal/screen/screen_check_space_ends_line.s index cbd641f3..59cb427c 100644 --- a/c64/kernal/screen/screen_check_space_ends_line.s +++ b/c64/kernal/screen/screen_check_space_ends_line.s @@ -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 diff --git a/c64/kernal/screen/screen_code_to_petscii.s b/c64/kernal/screen/screen_code_to_petscii.s index 3485a3b9..883afe85 100644 --- a/c64/kernal/screen/screen_code_to_petscii.s +++ b/c64/kernal/screen/screen_code_to_petscii.s @@ -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 diff --git a/c64/kernal/screen/screen_get_cliped_pntr.s b/c64/kernal/screen/screen_get_cliped_pntr.s index 413641ad..8db99846 100644 --- a/c64/kernal/screen/screen_get_cliped_pntr.s +++ b/c64/kernal/screen/screen_get_cliped_pntr.s @@ -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 \ No newline at end of file diff --git a/c64/kernal/screen/screen_get_logical_line_end_ptr.s b/c64/kernal/screen/screen_get_logical_line_end_ptr.s index d396db35..a0588006 100644 --- a/c64/kernal/screen/screen_get_logical_line_end_ptr.s +++ b/c64/kernal/screen/screen_get_logical_line_end_ptr.s @@ -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 \ No newline at end of file + rts + + +#endif // ROM layout diff --git a/c64/kernal/screen/screen_grow_logical_line.s b/c64/kernal/screen/screen_grow_logical_line.s index b16d52b7..65bc33f2 100644 --- a/c64/kernal/screen/screen_grow_logical_line.s +++ b/c64/kernal/screen/screen_grow_logical_line.s @@ -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 diff --git a/c64/kernal/screen/screen_off.s b/c64/kernal/screen/screen_off.s index c8f811d8..572e3394 100644 --- a/c64/kernal/screen/screen_off.s +++ b/c64/kernal/screen/screen_off.s @@ -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 diff --git a/c64/kernal/screen/screen_on.s b/c64/kernal/screen/screen_on.s index 4742321b..508355ce 100644 --- a/c64/kernal/screen/screen_on.s +++ b/c64/kernal/screen/screen_on.s @@ -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 diff --git a/c64/kernal/screen/screen_preserve_sal_eal.s b/c64/kernal/screen/screen_preserve_sal_eal.s index 175c51bc..25e37c94 100644 --- a/c64/kernal/screen/screen_preserve_sal_eal.s +++ b/c64/kernal/screen/screen_preserve_sal_eal.s @@ -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 diff --git a/c64/kernal/screen/screen_restore_sal_eal.s b/c64/kernal/screen/screen_restore_sal_eal.s index cfa85fd9..ad46c66e 100644 --- a/c64/kernal/screen/screen_restore_sal_eal.s +++ b/c64/kernal/screen/screen_restore_sal_eal.s @@ -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 \ No newline at end of file diff --git a/c64/kernal/tape/load_tape_normal.s b/c64/kernal/tape/load_tape_normal.s index d35d59ce..1b77bf5f 100644 --- a/c64/kernal/tape/load_tape_normal.s +++ b/c64/kernal/tape/load_tape_normal.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (normal) part of the LOAD routine @@ -133,3 +134,6 @@ load_tape_normal_payload: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/load_tape_turbo.s b/c64/kernal/tape/load_tape_turbo.s index d70facfc..2ce2a528 100644 --- a/c64/kernal/tape/load_tape_turbo.s +++ b/c64/kernal/tape/load_tape_turbo.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) part of the LOAD routine @@ -136,3 +137,6 @@ load_tape_turbo_loop: #endif // CONFIG_TAPE_TURBO + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_common.s b/c64/kernal/tape/tape_common.s index ee56f8ac..90651acd 100644 --- a/c64/kernal/tape/tape_common.s +++ b/c64/kernal/tape/tape_common.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Common routines for tape support @@ -311,3 +312,6 @@ tape_load_error: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_common_clean_sid.s b/c64/kernal/tape/tape_common_clean_sid.s index fa135bf4..f054e91b 100644 --- a/c64/kernal/tape/tape_common_clean_sid.s +++ b/c64/kernal/tape/tape_common_clean_sid.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Clear the SID settings - for sound effects during LOAD @@ -20,3 +21,6 @@ tape_clean_sid: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_common_ditch_verify.s b/c64/kernal/tape/tape_common_ditch_verify.s index c0c6edb0..8fee8722 100644 --- a/c64/kernal/tape/tape_common_ditch_verify.s +++ b/c64/kernal/tape/tape_common_ditch_verify.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Check if VERIFY asked - if yes, terminate loading @@ -19,3 +20,6 @@ tape_ditch_verify: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_common_motor.s b/c64/kernal/tape/tape_common_motor.s index 800a25df..2526f062 100644 --- a/c64/kernal/tape/tape_common_motor.s +++ b/c64/kernal/tape/tape_common_motor.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Handle tape deck motor @@ -23,3 +24,6 @@ tape_motor_on: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_common_screen.s b/c64/kernal/tape/tape_common_screen.s index f8fb8814..737888f3 100644 --- a/c64/kernal/tape/tape_common_screen.s +++ b/c64/kernal/tape/tape_common_screen.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Handle screen (visible/blanked) + tape deck motor (on/off), @@ -25,3 +26,6 @@ tape_screen_off_motor_on: jmp tape_motor_on #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_get_bit.s b/c64/kernal/tape/tape_normal_get_bit.s index 54f9b969..fdd29b0e 100644 --- a/c64/kernal/tape/tape_normal_get_bit.s +++ b/c64/kernal/tape/tape_normal_get_bit.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (normal) helper routine - bit reading @@ -55,3 +56,6 @@ tape_normal_get_bit_error: #endif // CONFIG_TAPE_NORMAL + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_get_byte.s b/c64/kernal/tape/tape_normal_get_byte.s index d63c1d0d..94634a65 100644 --- a/c64/kernal/tape/tape_normal_get_byte.s +++ b/c64/kernal/tape/tape_normal_get_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (normal) helper routine - byte reading @@ -68,3 +69,6 @@ tape_normal_get_byte_error: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_get_data.s b/c64/kernal/tape/tape_normal_get_data.s index 21972deb..498113bf 100644 --- a/c64/kernal/tape/tape_normal_get_data.s +++ b/c64/kernal/tape/tape_normal_get_data.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (normal) helper routine - data block reading @@ -71,3 +72,6 @@ tape_normal_get_block_done: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_get_marker.s b/c64/kernal/tape/tape_normal_get_marker.s index eaa6c219..fbe40095 100644 --- a/c64/kernal/tape/tape_normal_get_marker.s +++ b/c64/kernal/tape/tape_normal_get_marker.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // // Tape (normal) helper routine - marker reading @@ -21,3 +23,6 @@ tape_normal_get_marker: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_get_pulse.s b/c64/kernal/tape/tape_normal_get_pulse.s index cbddc175..82a41858 100644 --- a/c64/kernal/tape/tape_normal_get_pulse.s +++ b/c64/kernal/tape/tape_normal_get_pulse.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // // Tape (normal) helper routine - pulse reading @@ -39,3 +41,6 @@ tape_normal_get_pulse: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_pilot.s b/c64/kernal/tape/tape_normal_pilot.s index a6f1e577..28b461a6 100644 --- a/c64/kernal/tape/tape_normal_pilot.s +++ b/c64/kernal/tape/tape_normal_pilot.s @@ -1,3 +1,5 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) + // // Tape (turbo) helper routine - handling the pilot @@ -70,3 +72,6 @@ tape_normal_pilot_header: // require 128x $40 pulses #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_normal_sync.s b/c64/kernal/tape/tape_normal_sync.s index 7969f958..b24a0b9a 100644 --- a/c64/kernal/tape/tape_normal_sync.s +++ b/c64/kernal/tape/tape_normal_sync.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) helper routine - synchronization handling @@ -35,3 +36,6 @@ tape_normal_sync_fail: #endif + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_turbo_bytestore.s b/c64/kernal/tape/tape_turbo_bytestore.s index 66c94081..09f793b7 100644 --- a/c64/kernal/tape/tape_turbo_bytestore.s +++ b/c64/kernal/tape/tape_turbo_bytestore.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) helper routine - storing byte uder I/O @@ -38,3 +39,6 @@ __tape_turbo_bytestore_source_end: #endif // CONFIG_TAPE_TURBO + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_turbo_get_bit.s b/c64/kernal/tape/tape_turbo_get_bit.s index a6cf343a..2f616008 100644 --- a/c64/kernal/tape/tape_turbo_get_bit.s +++ b/c64/kernal/tape/tape_turbo_get_bit.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) helper routine - bit reading @@ -36,3 +37,6 @@ tape_turbo_get_bit: #endif // CONFIG_TAPE_TURBO + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_turbo_get_byte.s b/c64/kernal/tape/tape_turbo_get_byte.s index d1ee0ded..ec8683aa 100644 --- a/c64/kernal/tape/tape_turbo_get_byte.s +++ b/c64/kernal/tape/tape_turbo_get_byte.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) helper routine - byte reading @@ -26,3 +27,6 @@ tape_turbo_get_byte: #endif // CONFIG_TAPE_TURBO + + +#endif // ROM layout diff --git a/c64/kernal/tape/tape_turbo_sync.s b/c64/kernal/tape/tape_turbo_sync.s index 1c1aedc6..a81c272c 100644 --- a/c64/kernal/tape/tape_turbo_sync.s +++ b/c64/kernal/tape/tape_turbo_sync.s @@ -1,3 +1,4 @@ +#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0) // // Tape (turbo) helper routine - synchronization handling @@ -54,3 +55,6 @@ tape_turbo_sync_payload: #endif // CONFIG_TAPE_TURBO + + +#endif // ROM layout diff --git a/c64/kernal/time/rdtim.s b/c64/kernal/time/rdtim.s index 37009289..19916b2e 100644 --- a/c64/kernal/time/rdtim.s +++ b/c64/kernal/time/rdtim.s @@ -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 291 -// - [CM64] Compute's Mapping the Commodore 64 - page 232 +// - [RG64] C64 Programmers Reference Guide - page 291 +// - [CM64] Computes Mapping the Commodore 64 - page 232 // // CPU registers that has to be preserved (see [RG64]): none // @@ -11,7 +12,7 @@ RDTIM: // Disable interrupts for the duration of the routine, to prevent - // jiffy clock update while reeading it's values + // jiffy clock update while reeading its values sei // Store the jiffy clock state @@ -25,3 +26,5 @@ RDTIM: cli rts + +#endif // ROM layout diff --git a/c64/kernal/time/settim.s b/c64/kernal/time/settim.s index 0bceeaf8..2c919e01 100644 --- a/c64/kernal/time/settim.s +++ b/c64/kernal/time/settim.s @@ -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 299/300 -// - [CM64] Compute's Mapping the Commodore 64 - page 232 +// - [RG64] C64 Programmers Reference Guide - page 299/300 +// - [CM64] Computes Mapping the Commodore 64 - page 232 // // CPU registers that has to be preserved (see [RG64]): .A, .X, .Y // @@ -11,7 +12,7 @@ SETTIM: // Disable interrupts for the duration of the routine, to prevent - // jiffy clock update while changing it's values + // jiffy clock update while changing its values sei // Store the jiffy clock state @@ -25,3 +26,5 @@ SETTIM: cli rts + +#endif // ROM layout diff --git a/c64/kernal/time/udtim.s b/c64/kernal/time/udtim.s index 01bb3b91..0374cfb6 100644 --- a/c64/kernal/time/udtim.s +++ b/c64/kernal/time/udtim.s @@ -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 303 -// - [CM64] Compute's Mapping the Commodore 64 - pages 27, 232 +// - [RG64] C64 Programmers Reference Guide - page 303 +// - [CM64] Computes Mapping the Commodore 64 - pages 27, 232 // // CPU registers that has to be preserved (see [RG64]): .Y // @@ -43,3 +44,6 @@ udtim_clock_rollover: sta TIME+2 sta TIME+1 beq udtim_time_done // done with clock - will always jump + + +#endif // ROM layout diff --git a/src/build_segment.cc b/src/build_segment.cc index d1dc4e59..67c85dbf 100644 --- a/src/build_segment.cc +++ b/src/build_segment.cc @@ -36,6 +36,7 @@ std::string CMD_outFile = "OUT.BIN"; std::string CMD_outDir = "./out"; std::string CMD_segName = "MAIN"; std::string CMD_segInfo = "(unnamed)"; +std::string CMD_romLayout = "STD"; int CMD_loAddress = 0xC000; int CMD_hiAddress = 0xCFFF; @@ -51,6 +52,7 @@ void printUsage() "usage: build_segment [-a ] [-o ] [-d ]" << "\n" << " [-l ] [-h ]" << "\n" << " [-s ] [-i ]" << "\n" << + " [-r ]" << "\n" << " " << "\n\n"; } @@ -153,7 +155,7 @@ void parseCommandLine(int argc, char **argv) // Retrieve command line options - while ((opt = getopt(argc, argv, "a:o:d:s:i:l:h:")) != -1) + while ((opt = getopt(argc, argv, "a:o:d:s:i:r:l:h:")) != -1) { switch(opt) { @@ -162,6 +164,7 @@ void parseCommandLine(int argc, char **argv) case 'd': CMD_outDir = optarg; break; case 's': CMD_segName = optarg; break; case 'i': CMD_segInfo = optarg; break; + case 'r': CMD_romLayout = optarg; break; case 'l': CMD_loAddress = strtol(optarg, nullptr ,16); break; case 'h': CMD_hiAddress = strtol(optarg, nullptr ,16); break; default: printUsage(); ERROR(); @@ -278,6 +281,7 @@ void calcRoutineSizes() outFile << "\n" << ".segment " << CMD_segName << " [start=$100, min=$100, max=$FFFF]" << "\n"; outFile << "#define SEGMENT_" << CMD_segName << "\n"; + outFile << "#define ROM_LAYOUT_" << CMD_romLayout << "\n"; for (const auto &sourceFile : GLOBAL_sourceFiles) { @@ -481,6 +485,7 @@ void compileSegment() ", outBin=\"" << CMD_outFile << "\", fill]" << "\n"; outFile << "#define SEGMENT_" << CMD_segName << "\n"; + outFile << "#define ROM_LAYOUT_" << CMD_romLayout << "\n"; outFile << ".namespace " << CMD_segName << " {" << "\n\n"; // Write files which only contain definitions (no routines) @@ -694,7 +699,8 @@ void BinningProblem::addToProblem(SourceFile *routine) if (!gapFound) { - ERROR(std::string("start address of fixed address file '") + routine->fileName + "' already occupied"); + ERROR(std::string("start address of fixed address file '") + \ + routine->fileName + "' already occupied or out of range"); } } }