Compare commits
49
Commits
d65db6a049
...
mc64
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81ab3b41e1 | ||
|
|
86d6dd0916 | ||
|
|
d42102d039 | ||
|
|
e8870b4c6c | ||
|
|
ea0c8bc9ba | ||
|
|
1a6c821cfa | ||
|
|
05e4b67858 | ||
|
|
0838c4e310 | ||
|
|
9ad7e292f8 | ||
|
|
b1fbc1c693 | ||
|
|
f809b9b7ea | ||
|
|
b7fef8abe6 | ||
|
|
90b921ac5e | ||
|
|
80fb110391 | ||
|
|
9f922287c6 | ||
|
|
f1ade3b7d3 | ||
|
|
b4f334bbbf | ||
|
|
93c4932309 | ||
|
|
5fc29014f4 | ||
|
|
1aaed55bc7 | ||
|
|
aa39286d9d | ||
|
|
18520d8dc0 | ||
|
|
a45f63e34e | ||
|
|
ec4dc7df62 | ||
|
|
e9a64fb7a8 | ||
|
|
b4b48b195d | ||
|
|
03e2d4a4b8 | ||
|
|
0ec343a727 | ||
|
|
729a410079 | ||
|
|
7ee9d164e2 | ||
|
|
51a2a43520 | ||
|
|
ec7707d4cc | ||
|
|
74ef17d292 | ||
|
|
b95a6ff057 | ||
|
|
f1df180bf8 | ||
|
|
340bbefd06 | ||
|
|
29124377fc | ||
|
|
264e9792a5 | ||
|
|
840c5f1b61 | ||
|
|
ad178dbe4d | ||
|
|
93b6a2460e | ||
|
|
e8191ccbac | ||
|
|
a587990f3e | ||
|
|
781ad9ee6c | ||
|
|
ec3c7c05dc | ||
|
|
6ea0dc74be | ||
|
|
1ec43e8cd7 | ||
|
|
1b1d0c4329 | ||
|
|
1adfa10462 |
No files matched your search
@@ -289,6 +289,18 @@ On the most widespread CPUs the D flag is not cleared upon entering interrupts.
|
||||
|
||||
Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable.
|
||||
|
||||
### `ARNITECH_CONTROLLER`
|
||||
|
||||
For the mc64 Computers and Blades of arnitech only, the `mc64` and `mc64blade` configurations, whose expansion port holds the Arnitech controller at `$DE80`. IOINIT puts CIA #1's TOD on 50 Hz and, if the controller's signature `"ARNI"` is at `$DE80`, sets the TOD from the controller's clock. The Arnitech jump table at `$FF00` (`src/kernal/arnitech/ff00.arnitech_jumptable.s`) wraps the controller's registers, and sends and receives Ethernet frames through the CS8900A of a Network Card at the RR-Net socket, `$DE02-$DE0F`.
|
||||
|
||||
Feature needs about 450 bytes in KERNAL segment, and the page at `$FF00`. Disable on any other machine.
|
||||
|
||||
### `ARNITECH_BLADE`
|
||||
|
||||
For the Blades of arnitech only, the `mc64blade` configuration: a 65816 in 6502 emulation mode with a C64's bank 0, both CIAs, the serial bus, and the Arnitech controller, but no VIC-II, SID, keyboard matrix, or tape. Requires `ARNITECH_CONTROLLER` and `IEC`. The screen editor, the keyboard matrix scan, the VIC-II set-up, and PAL detection are left out. The screen and the keyboard, devices 3 and 0, are the Terminal Card the controller finds by its type, `$04` (`src/kernal/arnitech/arnitech_terminal.s`): CHROUT writes each byte to it, as a glyph while quote or insert mode is on, CHRIN echoes the keys typed and on RETURN reads back the logical line under the cursor, the IRQ moves its keys into the keyboard buffer and its RUN/STOP into `STKEY`, `SCREEN` answers 80x25, and `PLOT` moves its cursor; without one, bytes printed go nowhere and no key comes. The serial bus waits its 1 ms on CIA #1's timer B. CINT puts handlers for the 65816's native-mode interrupts into the RAM under the KERNAL at `$FFE4-$FFEF` (`arnitech_native.s`), and BASIC's cold start loads `"*"` from device 8 and RUNs it before `READY.`, unless RUN/STOP is held (`arnitech_autoboot.s`).
|
||||
|
||||
Feature saves about 1,600 bytes in KERNAL segment, and needs about 15 in BASIC segment. Disable on any other machine.
|
||||
|
||||
## Eye candy
|
||||
|
||||
### `COLORS_BRAND`
|
||||
|
||||
@@ -45,6 +45,7 @@ SRCDIR_KERNAL = $(SRCDIR_COMMON) \
|
||||
src/kernal \
|
||||
src/kernal/,stubs \
|
||||
src/kernal/assets \
|
||||
src/kernal/arnitech \
|
||||
src/kernal/board_crt \
|
||||
src/kernal/board_m65 \
|
||||
src/kernal/board_u64 \
|
||||
@@ -136,6 +137,9 @@ GEN_ZMAC_H = $(DIR_ZMAC_TMP)/doc.inl
|
||||
|
||||
# List of build directories
|
||||
|
||||
DIR_C64 = build/target_c64
|
||||
DIR_MC64 = build/target_mc64
|
||||
DIR_MC64BLADE = build/target_mc64blade
|
||||
DIR_CUS = build/target_custom
|
||||
DIR_GEN = build/target_generic
|
||||
DIR_GENCRT = build/target_generic_crt
|
||||
@@ -149,6 +153,9 @@ DIR_X16 = build/target_cx16
|
||||
# List of config files
|
||||
|
||||
CFG_CUS = src/,,config_custom.s
|
||||
CFG_C64 = src/,,config_c64.s
|
||||
CFG_MC64 = src/,,config_mc64.s
|
||||
CFG_MC64BLADE = src/,,config_mc64blade.s
|
||||
CFG_GEN = src/,,config_generic.s
|
||||
CFG_GENCRT = src/,,config_generic_crt.s
|
||||
CFG_TST38 = src/,,config_testing_38K.s
|
||||
@@ -161,6 +168,9 @@ CFG_U64CRT = src/,,config_ultimate64_crt.s
|
||||
# List of files with generated strings
|
||||
|
||||
GEN_STR_CUS = $(DIR_CUS)/,generated/,packed_strings.s
|
||||
GEN_STR_C64 = $(DIR_C64)/,generated/,packed_strings.s
|
||||
GEN_STR_MC64 = $(DIR_MC64)/,generated/,packed_strings.s
|
||||
GEN_STR_MC64BLADE = $(DIR_MC64BLADE)/,generated/,packed_strings.s
|
||||
GEN_STR_GEN = $(DIR_GEN)/,generated/,packed_strings.s
|
||||
GEN_STR_GENCRT = $(DIR_GENCRT)/,generated/,packed_strings.s
|
||||
GEN_STR_TST38 = $(DIR_TST38)/,generated/,packed_strings.s
|
||||
@@ -208,6 +218,9 @@ TARGET_CHR_ORF = build/chargen_openroms.rom
|
||||
TARGET_CHR_PXL = build/chargen_pxlfont.rom
|
||||
|
||||
TARGET_CUS_B = build/basic_custom.rom
|
||||
TARGET_C64_B = build/basic_c64.rom
|
||||
TARGET_MC64_B = build/basic_mc64.rom
|
||||
TARGET_MC64BLADE_B = build/basic_mc64blade.rom
|
||||
TARGET_GEN_B = build/basic_generic.rom
|
||||
TARGET_GENCRT_B = build/basic_generic_crt.rom
|
||||
TARGET_TST38_B = build/basic_testing_38K.rom
|
||||
@@ -216,6 +229,9 @@ TARGET_U64_B = build/basic_ultimate64.rom
|
||||
TARGET_U64CRT_B = build/basic_ultimate64_crt.rom
|
||||
|
||||
TARGET_CUS_K = build/kernal_custom.rom
|
||||
TARGET_C64_K = build/kernal_c64.rom
|
||||
TARGET_MC64_K = build/kernal_mc64.rom
|
||||
TARGET_MC64BLADE_K = build/kernal_mc64blade.rom
|
||||
TARGET_GEN_K = build/kernal_generic.rom
|
||||
TARGET_GENCRT_K = build/kernal_generic_crt.rom
|
||||
TARGET_TST38_K = build/kernal_testing_38K.rom
|
||||
@@ -231,6 +247,9 @@ TARGET_M65_x_PXL = build/mega65.rom
|
||||
TARGET_X16_x = build/cx16-dummy.rom
|
||||
|
||||
TARGET_LIST_CUS = $(TARGET_CUS_B) $(TARGET_CUS_K)
|
||||
TARGET_LIST_C64 = $(TARGET_C64_B) $(TARGET_C64_K)
|
||||
TARGET_LIST_MC64 = $(TARGET_MC64_B) $(TARGET_MC64_K)
|
||||
TARGET_LIST_MC64BLADE = $(TARGET_MC64BLADE_B) $(TARGET_MC64BLADE_K)
|
||||
TARGET_LIST_GEN = $(TARGET_GEN_B) $(TARGET_GEN_K)
|
||||
TARGET_LIST_GENCRT = $(TARGET_GENCRT_B) $(TARGET_GENCRT_K) $(TARGET_GENCRT_X)
|
||||
TARGET_LIST_TST38 = $(TARGET_TST38_B) $(TARGET_TST38_K)
|
||||
@@ -242,6 +261,9 @@ TARGET_Z80TEST = ./build/cpm/Z80TEST.COM
|
||||
|
||||
TARGET_LIST = $(TARGET_CHR_ORF) \
|
||||
$(TARGET_LIST_CUS) \
|
||||
$(TARGET_LIST_C64) \
|
||||
$(TARGET_LIST_MC64) \
|
||||
$(TARGET_LIST_MC64BLADE) \
|
||||
$(TARGET_LIST_GEN) \
|
||||
$(TARGET_LIST_GENCRT) \
|
||||
$(TARGET_LIST_TST38) \
|
||||
@@ -376,6 +398,12 @@ build/patched_chargen/pxlfont.pcg: $(TOOL_PATCH_CHARGEN) $(TARGET_CHR_PXL)
|
||||
|
||||
$(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_CUS) $(GEN_STR_CUS) $(DIR_CUS)/KERNAL_combined.sym
|
||||
$(DIR_C64)/OUTB_x.BIN $(DIR_C64)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_C64) $(GEN_STR_C64) $(DIR_C64)/KERNAL_combined.sym
|
||||
$(DIR_MC64)/OUTB_x.BIN $(DIR_MC64)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_MC64) $(GEN_STR_MC64) $(DIR_MC64)/KERNAL_combined.sym
|
||||
$(DIR_MC64BLADE)/OUTB_x.BIN $(DIR_MC64BLADE)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_MC64BLADE) $(GEN_STR_MC64BLADE) $(DIR_MC64BLADE)/KERNAL_combined.sym
|
||||
$(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_GEN) $(GEN_STR_GEN) $(DIR_GEN)/KERNAL_combined.sym
|
||||
$(DIR_TST38)/OUTB_x.BIN $(DIR_TST38)/BASIC_combined.vs: \
|
||||
@@ -387,6 +415,12 @@ $(DIR_U64)/OUTB_x.BIN $(DIR_U64)/BASIC_combined.vs: \
|
||||
|
||||
$(DIR_CUS)/OUTK_x.BIN $(DIR_CUS)/KERNAL_combined.vs $(DIR_CUS)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_CUS) $(GEN_STR_CUS)
|
||||
$(DIR_C64)/OUTK_x.BIN $(DIR_C64)/KERNAL_combined.vs $(DIR_C64)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_C64) $(GEN_STR_C64)
|
||||
$(DIR_MC64)/OUTK_x.BIN $(DIR_MC64)/KERNAL_combined.vs $(DIR_MC64)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_MC64) $(GEN_STR_MC64)
|
||||
$(DIR_MC64BLADE)/OUTK_x.BIN $(DIR_MC64BLADE)/KERNAL_combined.vs $(DIR_MC64BLADE)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_MC64BLADE) $(GEN_STR_MC64BLADE)
|
||||
$(DIR_GEN)/OUTK_x.BIN $(DIR_GEN)/KERNAL_combined.vs $(DIR_GEN)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_GEN) $(GEN_STR_GEN)
|
||||
$(DIR_TST38)/OUTK_x.BIN $(DIR_TST38)/KERNAL_combined.vs $(DIR_TST38)/KERNAL_combined.sym: \
|
||||
@@ -445,6 +479,9 @@ $(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_comb
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym
|
||||
|
||||
$(DIR_CUS)/OUTx_x.BIN: $(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/OUTK_x.BIN
|
||||
$(DIR_C64)/OUTx_x.BIN: $(DIR_C64)/OUTB_x.BIN $(DIR_C64)/OUTK_x.BIN
|
||||
$(DIR_MC64)/OUTx_x.BIN: $(DIR_MC64)/OUTB_x.BIN $(DIR_MC64)/OUTK_x.BIN
|
||||
$(DIR_MC64BLADE)/OUTx_x.BIN: $(DIR_MC64BLADE)/OUTB_x.BIN $(DIR_MC64BLADE)/OUTK_x.BIN
|
||||
$(DIR_GEN)/OUTx_x.BIN: $(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/OUTK_x.BIN
|
||||
$(DIR_GENCRT)/OUTx_0.BIN: $(DIR_GENCRT)/OUTB_0.BIN $(DIR_GENCRT)/OUTK_0.BIN
|
||||
$(DIR_TST38)/OUTx_x.BIN: $(DIR_TST38)/OUTB_x.BIN $(DIR_TST38)/OUTK_x.BIN
|
||||
@@ -455,18 +492,27 @@ $(DIR_U64CRT)/OUTx_0.BIN: $(DIR_U64CRT)/OUTB_0.BIN $(DIR_U64CRT)/OUTK_0.BIN
|
||||
$(DIR_X16)/OUTx_0.BIN: $(DIR_X16)/OUTB_0.BIN $(DIR_X16)/OUTK_0.BIN
|
||||
|
||||
$(TARGET_CUS_B): $(DIR_CUS)/OUTx_x.BIN
|
||||
$(TARGET_C64_B): $(DIR_C64)/OUTx_x.BIN
|
||||
$(TARGET_MC64_B): $(DIR_MC64)/OUTx_x.BIN
|
||||
$(TARGET_MC64BLADE_B): $(DIR_MC64BLADE)/OUTx_x.BIN
|
||||
$(TARGET_GEN_B): $(DIR_GEN)/OUTx_x.BIN
|
||||
$(TARGET_TST38_B): $(DIR_TST38)/OUTx_x.BIN
|
||||
$(TARGET_TST60_B): $(DIR_TST60)/OUTx_x.BIN
|
||||
$(TARGET_U64_B): $(DIR_U64)/OUTx_x.BIN
|
||||
|
||||
$(TARGET_CUS_K): $(DIR_CUS)/OUTx_x.BIN
|
||||
$(TARGET_C64_K): $(DIR_C64)/OUTx_x.BIN
|
||||
$(TARGET_MC64_K): $(DIR_MC64)/OUTx_x.BIN
|
||||
$(TARGET_MC64BLADE_K): $(DIR_MC64BLADE)/OUTx_x.BIN
|
||||
$(TARGET_GEN_K): $(DIR_GEN)/OUTx_x.BIN
|
||||
$(TARGET_TST38_K): $(DIR_TST38)/OUTx_x.BIN
|
||||
$(TARGET_TST60_K): $(DIR_TST60)/OUTx_x.BIN
|
||||
$(TARGET_U64_K): $(DIR_U64)/OUTx_x.BIN
|
||||
|
||||
build/symbols_custom.vs: $(DIR_CUS)/BASIC_combined.vs $(DIR_CUS)/KERNAL_combined.vs
|
||||
build/symbols_c64.vs: $(DIR_C64)/BASIC_combined.vs $(DIR_C64)/KERNAL_combined.vs
|
||||
build/symbols_mc64.vs: $(DIR_MC64)/BASIC_combined.vs $(DIR_MC64)/KERNAL_combined.vs
|
||||
build/symbols_mc64blade.vs: $(DIR_MC64BLADE)/BASIC_combined.vs $(DIR_MC64BLADE)/KERNAL_combined.vs
|
||||
build/symbols_generic.vs: $(DIR_GEN)/BASIC_combined.vs $(DIR_GEN)/KERNAL_combined.vs
|
||||
build/symbols_generic_crt.vs: $(DIR_GENCRT)/BASIC_0_combined.vs $(DIR_GENCRT)/KERNAL_0_combined.vs
|
||||
build/symbols_testing_38K.vs: $(DIR_TST38)/BASIC_combined.vs $(DIR_TST38)/KERNAL_combined.vs
|
||||
@@ -480,6 +526,18 @@ $(GEN_STR_CUS): $(TOOL_GENERATE_STRINGS) $(CFG_CUS)
|
||||
@mkdir -p $(DIR_CUS)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_CUS)
|
||||
|
||||
$(GEN_STR_C64): $(TOOL_GENERATE_STRINGS) $(CFG_C64)
|
||||
@mkdir -p $(DIR_C64)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_C64)
|
||||
|
||||
$(GEN_STR_MC64): $(TOOL_GENERATE_STRINGS) $(CFG_MC64)
|
||||
@mkdir -p $(DIR_MC64)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_MC64)
|
||||
|
||||
$(GEN_STR_MC64BLADE): $(TOOL_GENERATE_STRINGS) $(CFG_MC64BLADE)
|
||||
@mkdir -p $(DIR_MC64BLADE)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_MC64BLADE)
|
||||
|
||||
$(GEN_STR_GEN): $(TOOL_GENERATE_STRINGS) $(CFG_GEN)
|
||||
@mkdir -p $(DIR_GEN)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_GEN)
|
||||
@@ -521,6 +579,9 @@ build/,generated/,z80_tables.s: $(TOOL_GENERATE_Z80_TABLES)
|
||||
$(TOOL_GENERATE_Z80_TABLES) -o build/,generated/,z80_tables.s
|
||||
|
||||
GEN_STR_custom = $(GEN_STR_CUS)
|
||||
GEN_STR_c64 = $(GEN_STR_C64)
|
||||
GEN_STR_mc64 = $(GEN_STR_MC64)
|
||||
GEN_STR_mc64blade = $(GEN_STR_MC64BLADE)
|
||||
GEN_STR_generic = $(GEN_STR_GEN)
|
||||
GEN_STR_generic_crt = $(GEN_STR_GENCRT)
|
||||
GEN_STR_testing_38K = $(GEN_STR_TST38)
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
This is a modified version of MEGA65 Open ROMs (https://github.com/MEGA65/open-roms),
|
||||
forked at upstream commit ad178dbe4d48cd6a317737a8e0e7e662f7e33d32.
|
||||
|
||||
Modified by Christian Werner, 2026-10-14, 2026-10-15, 2026-10-17, and 2026-10-18, for the mc64
|
||||
computers of arnitech, a set of Minecraft mods (https://git.susdog.de/chris/arnitech). The
|
||||
fork lives at https://git.susdog.de/chris/open-roms, branch mc64.
|
||||
|
||||
Changes:
|
||||
|
||||
- src/,,config_mc64.s: a new build configuration, copied from src/,,config_c64.s, with its
|
||||
own config ID ($6D), the brand "MC64", and BCD_SAFE_INTERRUPTS turned off.
|
||||
- Makefile: targets for that configuration, build/kernal_mc64.rom and build/basic_mc64.rom,
|
||||
made the same way as the c64 ones.
|
||||
- src/kernal/iec/ciout.s (2026-10-15): CIOUT buffers its byte in TBTCNT, where the send
|
||||
routine takes it from, not in BSOUR (upstream PR #113).
|
||||
- src/kernal/iec/close_iec.s (2026-10-15): CLOSE sends LISTEN, $E0 plus the secondary
|
||||
address, and UNLISTEN; it sent a command ORed with zero page $E0 and no LISTEN.
|
||||
- src/kernal/iec/chkin_iec.s, ckout_iec.s (2026-10-15): CHKIN and CHKOUT take the secondary
|
||||
address from SAT, not from LAT, the logical file numbers.
|
||||
- src/kernal/iec/tksa.s (2026-10-15): TKSA sends the secondary address it is given, without
|
||||
ORing $90 into it (upstream issue #116).
|
||||
- src/kernal/iec/iec_tx_byte.s (2026-10-15): a data byte that no listener holds DATA for
|
||||
sets ST to $80 (device not present) and returns, instead of waiting forever.
|
||||
- src/kernal/iec/close_iec.s (2026-10-15): a CLOSE that finds no device sets ST to $80
|
||||
(device not present), and still frees the file number.
|
||||
- src/kernal/iec/unlsn.s, untlk.s (2026-10-15): UNLSN and UNTLK end with CLK, DATA, and ATN
|
||||
released; UNLSN left CLK pulled, and UNTLK waited for a talker to pull CLK, which after
|
||||
UNTALK none does, and then left CLK pulled.
|
||||
- src/kernal/iec/iec_return.s (2026-10-15): a serial routine that finds no device releases
|
||||
CLK, DATA, and ATN; it left CLK pulled.
|
||||
- src/,,config_mc64.s, src/aliases/,aliases_hardware_arnitech.s, src/kernal/arnitech/
|
||||
(new), Makefile, src/kernal/init/fda3.ioinit.s, CONFIG.md (2026-10-17): a new option,
|
||||
ARNITECH_CONTROLLER, on in the mc64 configuration only. IOINIT sets CIA #1's TOD on 50 Hz
|
||||
and, if the Arnitech controller's signature is at $DE80, from the controller's clock. The
|
||||
Arnitech jump table at $FF00 wraps the controller's registers: "ARNI", a version, an entry
|
||||
count, and JMPs from $FF06 to find a Card by its type and to set the TOD.
|
||||
- assets/8x8font.png (2026-10-18): the first character set draws screen code 35, '#', as the
|
||||
second does; it was blank, and its reverse (163) not its inverse.
|
||||
- src/kernal/screen/chrout_to_screen_code.s (2026-10-18): CHROUT prints PETSCII $E0-$FE as
|
||||
screen codes $60-$7E and $FF (pi) as $5E, as a C64 does; it printed $A0-$BF.
|
||||
- src/kernal/init/e5a0.vicii_init.s, vicii_init_registers.s (new),
|
||||
src/kernal/keyboard/e5b4.* (new), src/kernal/screen/ea24.*, ecf0.* (new),
|
||||
src/kernal/screen/screen_calculate_pnt_user.s (2026-10-18): routines at $E5B4 (take a key
|
||||
from the keyboard buffer) and $EA24 (USER from PNT), and the screen lines' low bytes at
|
||||
$ECF0, where cc65's runtime and ip65 call and read them; vicii_init's work moves out of
|
||||
$E5A0-$E5C8 to make room.
|
||||
- src/,,config_mc64.s (2026-10-18): DOS_WEDGE on, TRANSCENDENTAL_FUNCTIONS off.
|
||||
- src/basic/wedge/wedge_dos.s (2026-10-18): a DOS command sent with @ prints the status the
|
||||
drive gives for it; closing every file first had reset it to OK.
|
||||
- src/kernal/iec/iec_tx_byte.s, iec_tx_command.s (2026-10-18): IRQs are disabled before CLK
|
||||
is released to send a byte; an IRQ in between could hide the listener's EOI
|
||||
acknowledgement and hang the transfer.
|
||||
- src/aliases/,aliases_hardware_arnitech.s, src/kernal/arnitech/arnitech_net.s (new),
|
||||
src/kernal/arnitech/ff00.arnitech_jumptable.s, CONFIG.md (2026-10-18): version 2 of the
|
||||
Arnitech jump table, with JMPs from $FF0C that reset a Network Card's CS8900A at the
|
||||
RR-Net socket, copy its MAC address, and send and receive Ethernet frames through it.
|
||||
- src/,,config_mc64blade.s (new), Makefile (2026-10-18): a second configuration, mc64blade,
|
||||
the Firmware of arnitech's Blades: the mc64 one with its own config ID ($6E), the brand
|
||||
"MC64 BLADE", no tape, programmable keys, joystick cursor, panic screen, or feature list, and
|
||||
ARNITECH_BLADE on; targets build/kernal_mc64blade.rom and build/basic_mc64blade.rom.
|
||||
- src/aliases/,aliases_hardware_arnitech.s, src/kernal/arnitech/arnitech_terminal.s,
|
||||
arnitech_native.s, arnitech_autoboot.s (new), src/kernal/screen/*, src/kernal/keyboard/*,
|
||||
src/kernal/init/*, src/kernal/iostack/e50a.plot.s, f157.chrin.s, f1ca.chrout.s,
|
||||
src/kernal/interrupts/*, src/kernal/time/udtim.s, src/kernal/iec/iec_wait1ms.s,
|
||||
src/basic/init/basic_cold_start_internal.s, src/basic/,imports.s, CONFIG.md (2026-10-18): a
|
||||
new option, ARNITECH_BLADE, on in the mc64blade configuration only. It leaves out the screen
|
||||
editor, the keyboard matrix scan, the VIC-II set-up, PAL detection, and the Cartridge checks;
|
||||
the screen and the keyboard are an Arnitech Terminal Card, the serial bus's 1 ms wait counts
|
||||
on CIA #1's timer B, CINT puts handlers for a 65816's native-mode interrupts under the KERNAL,
|
||||
and BASIC's cold start loads and runs the first program on device 8.
|
||||
- NOTICE: this file.
|
||||
|
||||
The licence terms are unchanged; see LICENSE, COPYING, and COPYING.LESSER.
|
||||
@@ -248,15 +248,15 @@ Floating point mathematical routines - not official, but well known and broadly
|
||||
| `$BC9B` | `QINT` | DONE | From the Microsoft BASIC, original name: QINT |
|
||||
| `$BCCC` | `int_FAC1` | DONE | From the Microsoft BASIC, original name: INT |
|
||||
| `$BCE9` | `clear_FAC1` | DONE | From the Microsoft BASIC, original name: CLRFAC |
|
||||
| `$BCF3` | `FIN` | PARTIAL | Only for 38k memory model + not fully tested yet |
|
||||
| `$BCF3` | `FIN` | PARTIAL | From the Microsoft BASIC Only for 38k memory model |
|
||||
| `$BD7E` | `FINLOG` | DONE | From the Microsoft BASIC, original name: FINLOG |
|
||||
| `$BDDD` | `FOUT` | DONE | From the Microsoft BASIC, original name: FOUT |
|
||||
| `$BF71` | `sqr_FAC1` | DONE | From the Microsoft BASIC, original name: SQR |
|
||||
| `$BF74` | `sqr_FAC2` | DONE | From the Microsoft BASIC, no label |
|
||||
| `$BF78` | `pwr_FAC2_MEM` | DONE | From the Microsoft BASIC, no label |
|
||||
| `$BF7B` | `pwr_FAC2_FAC1` | NOT DONE | |
|
||||
| `$BF7B` | `pwr_FAC2_FAC1` | DONE | From the Microsoft BASIC, original name: FPWRT |
|
||||
| `$BFB4` | `toggle_sign_FAC1` | DONE | From the Microsoft BASIC, original name: NEGOP |
|
||||
| `$BFED` | `exp_FAC1` | NOT DONE | |
|
||||
| `$BFED` | `exp_FAC1` | PARTIAL | From the Microsoft BASIC Only for the 38k model |
|
||||
| `$E043` | `poly1_FAC1` | DONE | From the Microsoft BASIC, original name: POLYX |
|
||||
| `$E059` | `poly2_FAC1` | DONE | From the Microsoft BASIC, original name: POLY |
|
||||
| `$E097` | `rnd_FAC1` | DONE | |
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,129 @@
|
||||
|
||||
;; #CONFIG# ID $64 ; should be 1 byte, different for each config file!
|
||||
|
||||
;
|
||||
; Please read CONFIG.md before modifying this file!
|
||||
;
|
||||
|
||||
; Idea:
|
||||
; Maximum compatibility with the original C64
|
||||
; Original Microsoft BASIC with bugs and all
|
||||
; No customizations of the KERNAL
|
||||
|
||||
|
||||
|
||||
; --- Hardware platform and brand
|
||||
|
||||
;; #CONFIG# PLATFORM_COMMODORE_64 YES
|
||||
;; #CONFIG# BRAND_CUSTOM "C64"
|
||||
|
||||
|
||||
; --- Processor instruction set
|
||||
|
||||
;; #CONFIG# CPU_MOS_6502 YES
|
||||
;; #CONFIG# CPU_DTV_6502 NO
|
||||
;; #CONFIG# CPU_RCW_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65816 NO
|
||||
;; #CONFIG# CPU_CSG_65CE02 NO
|
||||
|
||||
|
||||
; --- Memory model
|
||||
|
||||
;; #CONFIG# MEMORY_MODEL_38K YES
|
||||
;; #CONFIG# MEMORY_MODEL_46K NO
|
||||
;; #CONFIG# MEMORY_MODEL_50K NO
|
||||
;; #CONFIG# MEMORY_MODEL_60K NO
|
||||
|
||||
|
||||
; --- IEC bus configuration
|
||||
|
||||
;; #CONFIG# IEC YES
|
||||
;; #CONFIG# IEC_DOLPHINDOS NO
|
||||
;; #CONFIG# IEC_DOLPHINDOS_FAST NO
|
||||
;; #CONFIG# IEC_JIFFYDOS NO
|
||||
;; #CONFIG# IEC_JIFFYDOS_BLANK NO
|
||||
|
||||
|
||||
; --- Tape deck configuration
|
||||
|
||||
;; #CONFIG# TAPE_NORMAL YES
|
||||
;; #CONFIG# TAPE_TURBO NO
|
||||
;; #CONFIG# TAPE_AUTODETECT NO
|
||||
;; #CONFIG# TAPE_NO_KEY_SENSE NO
|
||||
;; #CONFIG# TAPE_NO_MOTOR_CONTROL NO
|
||||
|
||||
|
||||
; --- Sound support
|
||||
|
||||
;; #CONFIG# SID_2ND_ADDRESS NO
|
||||
;; #CONFIG# SID_3RD_ADDRESS NO
|
||||
;; #CONFIG# SID_D4XX NO
|
||||
;; #CONFIG# SID_D5XX NO
|
||||
;; #CONFIG# SID_D6XX NO
|
||||
;; #CONFIG# SID_D7XX NO
|
||||
|
||||
|
||||
; --- Keyboard settings
|
||||
|
||||
;; #CONFIG# KEYBOARD_C128 NO
|
||||
;; #CONFIG# KEYBOARD_C128_CAPS_LOCK NO
|
||||
;; #CONFIG# KEY_REPEAT_DEFAULT NO
|
||||
;; #CONFIG# KEY_REPEAT_ALWAYS NO
|
||||
;; #CONFIG# KEY_FAST_SCAN YES
|
||||
;; #CONFIG# JOY1_CURSOR YES
|
||||
;; #CONFIG# JOY2_CURSOR YES
|
||||
|
||||
;; #CONFIG# PROGRAMMABLE_KEYS YES
|
||||
|
||||
;; #CONFIG# KEYCMD_RUN "\5FL"
|
||||
|
||||
;; #CONFIG# KEYCMD_F1 "@8$"
|
||||
;; #CONFIG# KEYCMD_F2 "LOAD"
|
||||
;; #CONFIG# KEYCMD_F3 "@9$"
|
||||
;; #CONFIG# KEYCMD_F4 "RUN:"
|
||||
;; #CONFIG# KEYCMD_F5 "@10$"
|
||||
;; #CONFIG# KEYCMD_F6 NO
|
||||
;; #CONFIG# KEYCMD_F7 "@11$"
|
||||
;; #CONFIG# KEYCMD_F8 NO
|
||||
|
||||
;; #CONFIG# KEYCMD_HELP "LIST"
|
||||
|
||||
|
||||
; --- Screen editor
|
||||
|
||||
;; #CONFIG# EDIT_STOPQUOTE YES
|
||||
|
||||
|
||||
; --- Software features
|
||||
|
||||
;; #CONFIG# PANIC_SCREEN YES
|
||||
;; #CONFIG# DOS_WEDGE NO
|
||||
;; #CONFIG# TAPE_WEDGE NO
|
||||
;; #CONFIG# TAPE_HEAD_ALIGN NO
|
||||
;; #CONFIG# BCD_SAFE_INTERRUPTS YES
|
||||
|
||||
|
||||
; --- BASIC features
|
||||
|
||||
;; #CONFIG# ORIGINAL_UNPATCHED_BASIC YES
|
||||
;; #CONFIG# TRANSCENDENTAL_FUNCTIONS YES
|
||||
|
||||
|
||||
; --- Eye candy
|
||||
|
||||
;; #CONFIG# COLORS_BRAND NO
|
||||
;; #CONFIG# BANNER_SIMPLE YES
|
||||
;; #CONFIG# BANNER_FANCY NO
|
||||
;; #CONFIG# SHOW_FEATURES YES
|
||||
|
||||
|
||||
; --- Debug options
|
||||
|
||||
;; #CONFIG# DBG_STUBS_BRK NO
|
||||
;; #CONFIG# DBG_PRINTF NO
|
||||
|
||||
|
||||
; --- Other
|
||||
|
||||
;; #CONFIG# COMPRESSION_LVL_2 NO
|
||||
@@ -0,0 +1,135 @@
|
||||
|
||||
;; #CONFIG# ID $6D ; should be 1 byte, different for each config file!
|
||||
|
||||
;
|
||||
; Please read CONFIG.md before modifying this file!
|
||||
;
|
||||
|
||||
; Idea:
|
||||
; The Firmware of arnitech's mc64 computers, a Minecraft mod
|
||||
; Same as the 'c64' configuration, except:
|
||||
; - the banner names mc64
|
||||
; - BCD_SAFE_INTERRUPTS is off, for IRQ entry timing closer to the original
|
||||
; - ARNITECH_CONTROLLER: IOINIT sets CIA1's TOD on 50 Hz and from the Arnitech controller's clock,
|
||||
; and the Arnitech jump table is at $FF00 (src/kernal/arnitech)
|
||||
; - DOS_WEDGE is on, so the F-keys' '@8$'-style commands work, and TRANSCENDENTAL_FUNCTIONS
|
||||
; is off to make room for it
|
||||
|
||||
|
||||
|
||||
; --- Hardware platform and brand
|
||||
|
||||
;; #CONFIG# PLATFORM_COMMODORE_64 YES
|
||||
;; #CONFIG# BRAND_CUSTOM "MC64"
|
||||
|
||||
|
||||
; --- Processor instruction set
|
||||
|
||||
;; #CONFIG# CPU_MOS_6502 YES
|
||||
;; #CONFIG# CPU_DTV_6502 NO
|
||||
;; #CONFIG# CPU_RCW_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65816 NO
|
||||
;; #CONFIG# CPU_CSG_65CE02 NO
|
||||
|
||||
|
||||
; --- Memory model
|
||||
|
||||
;; #CONFIG# MEMORY_MODEL_38K YES
|
||||
;; #CONFIG# MEMORY_MODEL_46K NO
|
||||
;; #CONFIG# MEMORY_MODEL_50K NO
|
||||
;; #CONFIG# MEMORY_MODEL_60K NO
|
||||
|
||||
|
||||
; --- IEC bus configuration
|
||||
|
||||
;; #CONFIG# IEC YES
|
||||
;; #CONFIG# IEC_DOLPHINDOS NO
|
||||
;; #CONFIG# IEC_DOLPHINDOS_FAST NO
|
||||
;; #CONFIG# IEC_JIFFYDOS NO
|
||||
;; #CONFIG# IEC_JIFFYDOS_BLANK NO
|
||||
|
||||
|
||||
; --- Tape deck configuration
|
||||
|
||||
;; #CONFIG# TAPE_NORMAL YES
|
||||
;; #CONFIG# TAPE_TURBO NO
|
||||
;; #CONFIG# TAPE_AUTODETECT NO
|
||||
;; #CONFIG# TAPE_NO_KEY_SENSE NO
|
||||
;; #CONFIG# TAPE_NO_MOTOR_CONTROL NO
|
||||
|
||||
|
||||
; --- Sound support
|
||||
|
||||
;; #CONFIG# SID_2ND_ADDRESS NO
|
||||
;; #CONFIG# SID_3RD_ADDRESS NO
|
||||
;; #CONFIG# SID_D4XX NO
|
||||
;; #CONFIG# SID_D5XX NO
|
||||
;; #CONFIG# SID_D6XX NO
|
||||
;; #CONFIG# SID_D7XX NO
|
||||
|
||||
|
||||
; --- Keyboard settings
|
||||
|
||||
;; #CONFIG# KEYBOARD_C128 NO
|
||||
;; #CONFIG# KEYBOARD_C128_CAPS_LOCK NO
|
||||
;; #CONFIG# KEY_REPEAT_DEFAULT NO
|
||||
;; #CONFIG# KEY_REPEAT_ALWAYS NO
|
||||
;; #CONFIG# KEY_FAST_SCAN YES
|
||||
;; #CONFIG# JOY1_CURSOR YES
|
||||
;; #CONFIG# JOY2_CURSOR YES
|
||||
|
||||
;; #CONFIG# PROGRAMMABLE_KEYS YES
|
||||
|
||||
;; #CONFIG# KEYCMD_RUN "\5FL"
|
||||
|
||||
;; #CONFIG# KEYCMD_F1 "@8$"
|
||||
;; #CONFIG# KEYCMD_F2 "LOAD"
|
||||
;; #CONFIG# KEYCMD_F3 "@9$"
|
||||
;; #CONFIG# KEYCMD_F4 "RUN:"
|
||||
;; #CONFIG# KEYCMD_F5 "@10$"
|
||||
;; #CONFIG# KEYCMD_F6 NO
|
||||
;; #CONFIG# KEYCMD_F7 "@11$"
|
||||
;; #CONFIG# KEYCMD_F8 NO
|
||||
|
||||
;; #CONFIG# KEYCMD_HELP "LIST"
|
||||
|
||||
|
||||
; --- Screen editor
|
||||
|
||||
;; #CONFIG# EDIT_STOPQUOTE YES
|
||||
|
||||
|
||||
; --- Software features
|
||||
|
||||
;; #CONFIG# PANIC_SCREEN YES
|
||||
;; #CONFIG# DOS_WEDGE YES
|
||||
;; #CONFIG# TAPE_WEDGE NO
|
||||
;; #CONFIG# TAPE_HEAD_ALIGN NO
|
||||
;; #CONFIG# BCD_SAFE_INTERRUPTS NO
|
||||
;; #CONFIG# ARNITECH_CONTROLLER YES
|
||||
|
||||
|
||||
; --- BASIC features
|
||||
|
||||
;; #CONFIG# ORIGINAL_UNPATCHED_BASIC YES
|
||||
;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO
|
||||
|
||||
|
||||
; --- Eye candy
|
||||
|
||||
;; #CONFIG# COLORS_BRAND NO
|
||||
;; #CONFIG# BANNER_SIMPLE YES
|
||||
;; #CONFIG# BANNER_FANCY NO
|
||||
;; #CONFIG# SHOW_FEATURES YES
|
||||
|
||||
|
||||
; --- Debug options
|
||||
|
||||
;; #CONFIG# DBG_STUBS_BRK NO
|
||||
;; #CONFIG# DBG_PRINTF NO
|
||||
|
||||
|
||||
; --- Other
|
||||
|
||||
;; #CONFIG# COMPRESSION_LVL_2 NO
|
||||
@@ -0,0 +1,137 @@
|
||||
|
||||
;; #CONFIG# ID $6E ; should be 1 byte, different for each config file!
|
||||
|
||||
;
|
||||
; Please read CONFIG.md before modifying this file!
|
||||
;
|
||||
|
||||
; Idea:
|
||||
; The Blade Firmware of arnitech's mc64 Blades, a Minecraft mod: the Firmware a Blade always boots
|
||||
; (arnitech's ADR 0030). A Blade is a 65816 in 6502 emulation mode with a C64's bank 0, two CIAs,
|
||||
; the serial bus, and the Arnitech controller, but no VIC-II, SID, keyboard, or tape (ADR 0029).
|
||||
; Same as the 'mc64' configuration, except:
|
||||
; - the banner names the Blade
|
||||
; - ARNITECH_BLADE: no screen editor, keyboard matrix scan, VIC-II set-up, PAL detection, or tape;
|
||||
; the screen and the keyboard, devices 3 and 0, are a Terminal Card (src/kernal/arnitech), the
|
||||
; serial bus waits on a CIA timer, and a reset autoboots LOAD"*",8
|
||||
; - no tape, programmable keys, joystick cursor, panic screen, or feature list
|
||||
|
||||
|
||||
|
||||
; --- Hardware platform and brand
|
||||
|
||||
;; #CONFIG# PLATFORM_COMMODORE_64 YES
|
||||
;; #CONFIG# BRAND_CUSTOM "MC64 BLADE"
|
||||
|
||||
|
||||
; --- Processor instruction set
|
||||
|
||||
;; #CONFIG# CPU_MOS_6502 YES
|
||||
;; #CONFIG# CPU_DTV_6502 NO
|
||||
;; #CONFIG# CPU_RCW_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65C02 NO
|
||||
;; #CONFIG# CPU_WDC_65816 NO
|
||||
;; #CONFIG# CPU_CSG_65CE02 NO
|
||||
|
||||
|
||||
; --- Memory model
|
||||
|
||||
;; #CONFIG# MEMORY_MODEL_38K YES
|
||||
;; #CONFIG# MEMORY_MODEL_46K NO
|
||||
;; #CONFIG# MEMORY_MODEL_50K NO
|
||||
;; #CONFIG# MEMORY_MODEL_60K NO
|
||||
|
||||
|
||||
; --- IEC bus configuration
|
||||
|
||||
;; #CONFIG# IEC YES
|
||||
;; #CONFIG# IEC_DOLPHINDOS NO
|
||||
;; #CONFIG# IEC_DOLPHINDOS_FAST NO
|
||||
;; #CONFIG# IEC_JIFFYDOS NO
|
||||
;; #CONFIG# IEC_JIFFYDOS_BLANK NO
|
||||
|
||||
|
||||
; --- Tape deck configuration
|
||||
|
||||
;; #CONFIG# TAPE_NORMAL NO
|
||||
;; #CONFIG# TAPE_TURBO NO
|
||||
;; #CONFIG# TAPE_AUTODETECT NO
|
||||
;; #CONFIG# TAPE_NO_KEY_SENSE NO
|
||||
;; #CONFIG# TAPE_NO_MOTOR_CONTROL NO
|
||||
|
||||
|
||||
; --- Sound support
|
||||
|
||||
;; #CONFIG# SID_2ND_ADDRESS NO
|
||||
;; #CONFIG# SID_3RD_ADDRESS NO
|
||||
;; #CONFIG# SID_D4XX NO
|
||||
;; #CONFIG# SID_D5XX NO
|
||||
;; #CONFIG# SID_D6XX NO
|
||||
;; #CONFIG# SID_D7XX NO
|
||||
|
||||
|
||||
; --- Keyboard settings
|
||||
|
||||
;; #CONFIG# KEYBOARD_C128 NO
|
||||
;; #CONFIG# KEYBOARD_C128_CAPS_LOCK NO
|
||||
;; #CONFIG# KEY_REPEAT_DEFAULT NO
|
||||
;; #CONFIG# KEY_REPEAT_ALWAYS NO
|
||||
;; #CONFIG# KEY_FAST_SCAN YES
|
||||
;; #CONFIG# JOY1_CURSOR NO
|
||||
;; #CONFIG# JOY2_CURSOR NO
|
||||
|
||||
;; #CONFIG# PROGRAMMABLE_KEYS NO
|
||||
|
||||
;; #CONFIG# KEYCMD_RUN "\5FL"
|
||||
|
||||
;; #CONFIG# KEYCMD_F1 "@8$"
|
||||
;; #CONFIG# KEYCMD_F2 "LOAD"
|
||||
;; #CONFIG# KEYCMD_F3 "@9$"
|
||||
;; #CONFIG# KEYCMD_F4 "RUN:"
|
||||
;; #CONFIG# KEYCMD_F5 "@10$"
|
||||
;; #CONFIG# KEYCMD_F6 NO
|
||||
;; #CONFIG# KEYCMD_F7 "@11$"
|
||||
;; #CONFIG# KEYCMD_F8 NO
|
||||
|
||||
;; #CONFIG# KEYCMD_HELP "LIST"
|
||||
|
||||
|
||||
; --- Screen editor
|
||||
|
||||
;; #CONFIG# EDIT_STOPQUOTE YES
|
||||
|
||||
|
||||
; --- Software features
|
||||
|
||||
;; #CONFIG# PANIC_SCREEN NO
|
||||
;; #CONFIG# DOS_WEDGE YES
|
||||
;; #CONFIG# TAPE_WEDGE NO
|
||||
;; #CONFIG# TAPE_HEAD_ALIGN NO
|
||||
;; #CONFIG# BCD_SAFE_INTERRUPTS NO
|
||||
;; #CONFIG# ARNITECH_CONTROLLER YES
|
||||
;; #CONFIG# ARNITECH_BLADE YES
|
||||
|
||||
|
||||
; --- BASIC features
|
||||
|
||||
;; #CONFIG# ORIGINAL_UNPATCHED_BASIC YES
|
||||
;; #CONFIG# TRANSCENDENTAL_FUNCTIONS NO
|
||||
|
||||
|
||||
; --- Eye candy
|
||||
|
||||
;; #CONFIG# COLORS_BRAND NO
|
||||
;; #CONFIG# BANNER_SIMPLE YES
|
||||
;; #CONFIG# BANNER_FANCY NO
|
||||
;; #CONFIG# SHOW_FEATURES NO
|
||||
|
||||
|
||||
; --- Debug options
|
||||
|
||||
;; #CONFIG# DBG_STUBS_BRK NO
|
||||
;; #CONFIG# DBG_PRINTF NO
|
||||
|
||||
|
||||
; --- Other
|
||||
|
||||
;; #CONFIG# COMPRESSION_LVL_2 NO
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
;
|
||||
; Names of the Arnitech controller's registers, on the expansion port's I/O1 (mc64 only)
|
||||
;
|
||||
; See arnitech's ADR 0023, "The Arnitech controller answers $DE80-$DE9F, and six Card windows
|
||||
; follow it" (https://git.susdog.de/chris/arnitech, docs/adr/0023-arnitech-controller-register-map.md)
|
||||
;
|
||||
|
||||
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
!addr ARNITECH_SIGNATURE = $DE80 ; "ARNI", 4 bytes
|
||||
!addr ARNITECH_VERSION = $DE84
|
||||
!addr ARNITECH_SLOT_COUNT = $DE85 ; Card slots in this Case
|
||||
!addr ARNITECH_IRQ_STATUS = $DE86
|
||||
!addr ARNITECH_IRQ_MASK = $DE87
|
||||
!addr ARNITECH_SLOT_TABLE = $DE88 ; the type of the Card in slots 0-5, $00 for none
|
||||
|
||||
!addr ARNITECH_CLOCK_LATCH = $DE90 ; a read copies the clock into $DE91-$DE9E
|
||||
!addr ARNITECH_CLOCK_TEN = $DE91 ; real time as CIA1's TOD reads it: tenths,
|
||||
!addr ARNITECH_CLOCK_SEC = $DE92 ; seconds,
|
||||
!addr ARNITECH_CLOCK_MIN = $DE93 ; minutes,
|
||||
!addr ARNITECH_CLOCK_HRS = $DE94 ; hours, BCD 1-12, bit 7 PM
|
||||
|
||||
!addr ARNITECH_CARD_WINDOW = $DEA0 ; slot n's Card window at $DEA0 + 16 * n
|
||||
|
||||
; The RR-Net socket: the CS8900A of the Network Card in the lowest slot, in RR-Net order
|
||||
; (arnitech's ADR 0027; Cirrus Logic DS271F5 Table 18, each port's even byte the low one)
|
||||
|
||||
!addr RRNET_PP_POINTER = $DE02 ; PacketPage pointer
|
||||
!addr RRNET_PP_DATA = $DE04 ; PacketPage data port 0
|
||||
!addr RRNET_RX_TX_DATA = $DE08 ; receive and transmit data port 0
|
||||
!addr RRNET_TX_CMD = $DE0C ; write-only
|
||||
!addr RRNET_TX_LENGTH = $DE0E ; write-only
|
||||
}
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
; The Terminal Card, a Blade's screen and keyboard (arnitech's ADR 0031): its type in the Slot
|
||||
; table, and its registers indexed by its Card window's low byte, as ARNI_FINDCARD gives it in X
|
||||
|
||||
!set TERMINAL_CARD_TYPE = $04
|
||||
|
||||
!addr TERMINAL_OUTPUT = $DE00 ; a PETSCII byte, printed as the screen editor prints it
|
||||
!addr TERMINAL_LITERAL = $DE01 ; a byte drawn as its glyph, for quote and insert mode
|
||||
!addr TERMINAL_STATUS = $DE02
|
||||
!addr TERMINAL_KEY = $DE03 ; the next key; a read takes it, $00 if none
|
||||
!addr TERMINAL_COMMAND = $DE04
|
||||
!addr TERMINAL_LINE = $DE05 ; the taken line's next byte, RETURN at its end
|
||||
!addr TERMINAL_COLUMN = $DE06
|
||||
!addr TERMINAL_ROW = $DE07
|
||||
|
||||
!set TERMINAL_KEY_WAITING = %00000001 ; status bits
|
||||
!set TERMINAL_STOP_HELD = %00000010
|
||||
!set TERMINAL_INSERTED = %00001000 ; the last byte was an INS that opened a space
|
||||
|
||||
!set TERMINAL_TAKE_LINE = $01 ; commands
|
||||
!set TERMINAL_RESET = $02
|
||||
!set TERMINAL_INPUT_START = $03
|
||||
|
||||
; The 65816's native-mode vectors, which a Blade reads from the RAM under the KERNAL (ADR 0029)
|
||||
|
||||
!addr NATIVE_VECTORS = $FFE4 ; COP, BRK, ABORT, NMI, reserved, IRQ
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
!addr ADRAY1 = $03 ; $03-$04
|
||||
!addr ADRAY2 = $05 ; $05-$06
|
||||
!addr CHARAC = $07 ; [!] our implementation might be different XXX give more details
|
||||
!addr INTEGR = CHARAC
|
||||
!addr ENDCHR = $08 ; [!] our implementation might be different XXX give more details
|
||||
!addr TRMPOS = $09 ; -- NOT IMPLEMENTED -- [!] on MEGA65 also used by DOS Wedge under MONITOR
|
||||
!addr VERCKB = $0A ; flag used by BASIC, 0 - LOAD, 1 - VERIFY, [!] on MEGA65 also used by DOS Wedge
|
||||
@@ -63,6 +64,8 @@
|
||||
!addr TEMPF2 = $5C ; $5C-$60 BASIC numeric work area
|
||||
!addr DECCNT = $5D ; Number of digits after decimal point
|
||||
!addr TENEXP = $5E ; Exponent count
|
||||
!addr DPTFLG = $5F ; Decimal point flag for FIN
|
||||
!addr EXPSGN = $60 ; Exponent sign for FIN
|
||||
!addr __FAC1 = $61 ; $61-$66 floating point accumulator 1
|
||||
!addr FAC1_exponent = $61
|
||||
!addr FAC1_mantissa = $62 ; $62 - $65
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
;; #ALIAS# SELDEV = KERNAL_0.SELDEV
|
||||
|
||||
;; #ALIAS# blade_autoboot = KERNAL_0.blade_autoboot
|
||||
|
||||
;
|
||||
; MEGA65 specific parts
|
||||
;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - set FAC1 as FAC2 raised to the power of FAC1
|
||||
;
|
||||
; Input:
|
||||
; - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
|
||||
;
|
||||
; Note:
|
||||
; - load FAC2 after FAC1, or mimic the Kernals sign comparison (XXX do we need it?)
|
||||
; - uses exp(x*log(y)) formula to calculate y^x; slow and inaccurate
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
; XXX provide implementation
|
||||
|
||||
pwr_FAC2_FAC1:
|
||||
|
||||
+STUB_IMPLEMENTATION
|
||||
@@ -1,20 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - exponential function, e raised to FAC1 power
|
||||
;
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
; XXX provide implementation
|
||||
|
||||
exp_FAC1:
|
||||
|
||||
+STUB_IMPLEMENTATION
|
||||
@@ -50,6 +50,20 @@ basic_cold_start_internal:
|
||||
; This is for maximum C64 compatibility
|
||||
jsr copy_CHRGET
|
||||
|
||||
}
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
; A Blade starts its program itself: LOAD"*",8 and RUN, unless RUN/STOP is held or the
|
||||
; LOAD fails (arnitech's ADR 0030). Out of direct mode, LOAD's own end RUNs the program.
|
||||
|
||||
jsr blade_autoboot
|
||||
bcs @3
|
||||
lda #$00
|
||||
sta VERCKB
|
||||
sta CURLIN+1
|
||||
jmp cmd_load_no_error
|
||||
@3:
|
||||
}
|
||||
|
||||
; jump into warm start loop
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - imports string to FAC1, ignores spaces
|
||||
;
|
||||
;
|
||||
; Input:
|
||||
; - .A needs to be loaded with first char of the string
|
||||
; - Carry flag must be clear
|
||||
; - string address in $7A/$7B
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 116
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
; NOTE: Currently CHRGET is only available for the 38K model and the equivalent function
|
||||
; does not test for digits to set carry
|
||||
|
||||
FIN_NUMDEC = TEMPF2
|
||||
FIN_DIGIT = TEMPF2 + 1
|
||||
FIN_DECFOUND = TEMPF2 + 2
|
||||
FIN_EXPSIGN = TEMPF2 + 3
|
||||
FIN_EXP = TEMPF2 + 4
|
||||
|
||||
|
||||
FIN:
|
||||
ldx #$00
|
||||
stx SGNFLG ; Sign is positive
|
||||
stx FIN_DECFOUND ; Decimal point not found
|
||||
stx FIN_EXP ; Exponent
|
||||
stx FAC1_exponent ; FAC1 <- 0
|
||||
bcc FIN_loop ; Starting with digit
|
||||
cmp #$2D ; Is minus?
|
||||
bne @1
|
||||
dec SGNFLG
|
||||
bne FIN_next ; Will always branch
|
||||
|
||||
@1: cmp #$2B ; Is plus?
|
||||
beq FIN_next
|
||||
|
||||
FIN_loop:
|
||||
bcs FIN_nonnumeric
|
||||
sec
|
||||
sbc #48 ; Convert to number
|
||||
sta FIN_DIGIT
|
||||
jsr mul10_FAC1
|
||||
lda FIN_DIGIT
|
||||
jsr FINLOG
|
||||
lda FIN_DECFOUND ; Have we passed the decimal sign?
|
||||
bpl FIN_next
|
||||
inc FIN_NUMDEC
|
||||
|
||||
FIN_next:
|
||||
jsr CHRGET
|
||||
+bra FIN_loop
|
||||
|
||||
FIN_nonnumeric:
|
||||
cmp #$2E ; decimal point
|
||||
beq FIN_decimal
|
||||
cmp #$45 ; E
|
||||
beq FIN_exponent
|
||||
FIN_finalize:
|
||||
lda FIN_EXP
|
||||
sec
|
||||
sbc FIN_NUMDEC
|
||||
sta FIN_EXP
|
||||
bmi FIN_div_loop
|
||||
|
||||
FIN_mul_loop:
|
||||
dec FIN_EXP
|
||||
bmi FIN_out
|
||||
jsr mul10_FAC1
|
||||
+bra FIN_mul_loop
|
||||
|
||||
FIN_div_loop:
|
||||
jsr div10_FAC1_p
|
||||
inc FIN_EXP
|
||||
bne FIN_div_loop
|
||||
|
||||
FIN_out:
|
||||
lda SGNFLG
|
||||
sta FAC1_sign
|
||||
rts
|
||||
|
||||
FIN_decimal:
|
||||
lda FIN_DECFOUND
|
||||
bmi FIN_finalize
|
||||
dec FIN_DECFOUND ; Indicate found decimal point
|
||||
sta FIN_NUMDEC ; Number of decimal places = 0
|
||||
+bra FIN_next
|
||||
|
||||
FIN_exponent:
|
||||
ldx #0
|
||||
stx FIN_EXPSIGN
|
||||
jsr CHRGET
|
||||
bcc FIN_exp_loop
|
||||
cmp #$2D ; Is minus?
|
||||
bne @1
|
||||
dec FIN_EXPSIGN
|
||||
bne FIN_exp_next ; Always branches
|
||||
@1: cmp #$2B ; Is plus?
|
||||
beq FIN_exp_next
|
||||
bne FIN_done_exp
|
||||
|
||||
FIN_exp_loop:
|
||||
tax
|
||||
lda FIN_EXP
|
||||
cmp #10
|
||||
bcs FIN_exp_limit
|
||||
asl ; Multiply by 10
|
||||
sta FIN_EXP
|
||||
asl
|
||||
asl
|
||||
clc
|
||||
adc FIN_EXP
|
||||
sta FIN_EXP
|
||||
txa
|
||||
sec
|
||||
sbc #48 ; Convert to number
|
||||
clc
|
||||
adc FIN_EXP
|
||||
sta FIN_EXP
|
||||
|
||||
FIN_exp_next:
|
||||
jsr CHRGET
|
||||
bcc FIN_exp_loop
|
||||
|
||||
FIN_done_exp:
|
||||
lda FIN_EXP
|
||||
bpl FIN_finalize
|
||||
eor #$FF
|
||||
tax
|
||||
inx
|
||||
stx FIN_EXP
|
||||
+bra FIN_finalize
|
||||
|
||||
FIN_exp_limit:
|
||||
ldx FIN_EXPSIGN
|
||||
bmi FIN_zero
|
||||
jmp do_OVERFLOW_error
|
||||
|
||||
FIN_zero:
|
||||
ldx #0
|
||||
stx FAC1_exponent
|
||||
rts
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Just a compatibility jump - our routine is longer than original one
|
||||
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
jmp FIN
|
||||
} else {
|
||||
+STUB_IMPLEMENTATION
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Math package - imports string to FAC1, ignores spaces
|
||||
;
|
||||
; This is verified to be identical to the original Microsoft implementation where it was named FIN.
|
||||
;
|
||||
; Input:
|
||||
; - .A needs to be loaded with first char of the string
|
||||
; - Carry flag must be clear
|
||||
; - string address in $7A/$7B
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 116
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
; NUMBER INPUT IS LEFT IN FAC.
|
||||
; AT ENTRY [TXTPTR] POINTS TO THE FIRST CHARACTER IN A TEXT BUFFER.
|
||||
; THE FIRST CHARACTER IS ALSO IN ACCA. FIN PACKS THE DIGITS
|
||||
; INTO THE FAC AS AN INTEGER AND KEEPS TRACK OF WHERE THE
|
||||
; DECIMAL POINT IS. [DPTFLG] TELL WHETHER A DP HAS BEEN
|
||||
; SEEN. [DECCNT] IS THE NUMBER OF DIGITS AFTER THE DP.
|
||||
; AT THE END [DECCNT] AND THE EXPONENT ARE USED TO
|
||||
; DETERMINE HOW MANY TIMES TO MULTIPLY OR DIVIDE BY TEN
|
||||
; TO GET THE CORRECT NUMBER.
|
||||
|
||||
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
|
||||
FIN:
|
||||
ldy #0 ; Zero FAC1_sign and SGNFLG
|
||||
ldx #10 ; Zero exp and hi bytes
|
||||
FINZLP:
|
||||
sty DECCNT,X ; Zero low bytes
|
||||
dex ; Zero TENEXP and EXPSGN
|
||||
bpl FINZLP ; Zero DECCNT, DPTFLG
|
||||
bcc FINDGQ ; Flags still set from CHRGET
|
||||
cmp #'-' ; A negative sign?
|
||||
bne QPLUS ; No, try plus sign
|
||||
stx SGNFLG ; It's negative
|
||||
beq FINC ; Always branches
|
||||
QPLUS:
|
||||
cmp #'+' ; Plus sign?
|
||||
bne FIN1 ; Yes, skip it
|
||||
FINC:
|
||||
jsr CHRGET
|
||||
FINDGQ:
|
||||
bcc FINDIG
|
||||
FIN1:
|
||||
cmp #'.' ; The decimal point?
|
||||
beq FINDP ; No kidding
|
||||
cmp #'E' ; Exponent follows
|
||||
bne FINE ; No
|
||||
;HERE TO CHECK FOR SIGN OF EXP.
|
||||
jsr CHRGET ; Yes, Get another
|
||||
bcc FNEDG1 ; It is a digit. (Easier than backing up pointer)
|
||||
cmp #$AB ; Minus with sign set (from table)
|
||||
beq FINEC1 ; Negate
|
||||
cmp #'-' ; Minus sign?
|
||||
beq FINEC1
|
||||
cmp #$AA ; Plus with sign set (from table)
|
||||
beq FINEC
|
||||
cmp #'+' ; Plus sign?
|
||||
beq FINEC
|
||||
bne FINEC2
|
||||
FINEC1:
|
||||
ror EXPSGN ; Turn it on
|
||||
FINEC:
|
||||
jsr CHRGET ; Get another
|
||||
FNEDG1:
|
||||
bcc FINEDG ; It is a digit
|
||||
FINEC2:
|
||||
bit EXPSGN
|
||||
bpl FINE
|
||||
lda #0
|
||||
sec
|
||||
sbc TENEXP
|
||||
jmp FINE1
|
||||
FINDP:
|
||||
ror DPTFLG
|
||||
bit DPTFLG
|
||||
bvc FINC
|
||||
FINE:
|
||||
lda TENEXP
|
||||
FINE1:
|
||||
sec
|
||||
sbc DECCNT ; Get number of places to shift
|
||||
sta TENEXP
|
||||
beq FINQNG ; Negate?
|
||||
bpl FINMUL ; Positive so multiply
|
||||
FINDIV:
|
||||
jsr div10_FAC1_p
|
||||
inc TENEXP ; Done?
|
||||
bne FINDIV ; No
|
||||
beq FINQNG ; Yes
|
||||
FINMUL:
|
||||
jsr mul10_FAC1
|
||||
dec TENEXP ; Done
|
||||
bne FINMUL ; No
|
||||
FINQNG:
|
||||
lda SGNFLG
|
||||
bmi NEGXQS ; If positive, Return
|
||||
rts
|
||||
NEGXQS:
|
||||
jmp toggle_sign_FAC1 ; Otherwise, negate and return
|
||||
|
||||
FINDIG:
|
||||
pha
|
||||
bit DPTFLG
|
||||
bpl FINDG1
|
||||
inc DECCNT
|
||||
FINDG1:
|
||||
jsr mul10_FAC1
|
||||
pla ; Get it back
|
||||
sec
|
||||
sbc #'0'
|
||||
jsr FINLOG ; Add it in
|
||||
jmp FINC
|
||||
|
||||
|
||||
} else {
|
||||
+STUB_IMPLEMENTATION
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Math package - add an ASCII digit in A that has been converted to a signed integer to FAC1
|
||||
;
|
||||
; This is verified to be identical to the original Microsoft implementation where it was named FINEDG.
|
||||
;
|
||||
|
||||
; HERE PACK IN THE NEXT DIGIT OF THE EXPONENT.
|
||||
; MULTIPLY THE OLD EXP BY 10 AND ADD IN THE NEXT
|
||||
; DIGIT. NOTE: EXP OVERFLOW IS NOT CHECKED FOR.
|
||||
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
|
||||
FINEDG:
|
||||
lda TENEXP ; Get exp so far
|
||||
cmp #10 ; Will result be >= 100
|
||||
bcc MLEX10
|
||||
lda #100 ; Get 100
|
||||
bit EXPSGN
|
||||
bmi MLEXMI ; If neg exp, no check for overflow
|
||||
jmp overflow_error
|
||||
MLEX10:
|
||||
asl ; Mult by 2 twice
|
||||
asl
|
||||
clc ; Possible shift out of high
|
||||
adc TENEXP ; Like multiplying by five
|
||||
asl ; And now by ten
|
||||
clc
|
||||
ldy #0
|
||||
adc (TXTPTR),Y
|
||||
sec
|
||||
sbc #'0'
|
||||
MLEXMI:
|
||||
sta TENEXP ; Save result
|
||||
jmp FINEC
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - denormalize FAC1 mantissa and adapt its exponent accordingly for division
|
||||
;
|
||||
|
||||
div_FAC1_denorm:
|
||||
|
||||
; Set FACOV to 0, no need for increased precision here
|
||||
|
||||
lda #$00
|
||||
sta FACOV
|
||||
|
||||
; Start by moving whole bytes, if possible
|
||||
|
||||
lda FAC1_mantissa+3
|
||||
bne div_FAC1_denorm_by_bit ; branch if last byte of mantissa is non-zero
|
||||
|
||||
lda FAC1_exponent
|
||||
cmp #$08
|
||||
bcc div_FAC1_denorm_by_bit ; branch if not suitable to increment exponent by 8
|
||||
|
||||
; Increment exponent
|
||||
|
||||
sbc #$08 ; Carry already sec
|
||||
sta FAC1_exponent
|
||||
|
||||
; Move mantissa bytes
|
||||
|
||||
lda FAC1_mantissa+2
|
||||
sta FAC1_mantissa+3
|
||||
lda FAC1_mantissa+1
|
||||
sta FAC1_mantissa+2
|
||||
lda FAC1_mantissa+0
|
||||
sta FAC1_mantissa+1
|
||||
lda #$00
|
||||
sta FAC1_mantissa+0
|
||||
|
||||
beq div_FAC1_denorm ; branch always
|
||||
|
||||
div_FAC1_denorm_by_bit:
|
||||
|
||||
lda FAC1_mantissa+3
|
||||
and #$01
|
||||
bne div_FAC1_denorm_done ; branch if lowest bit of mantissa is already 1
|
||||
|
||||
lda FAC1_exponent
|
||||
beq div_FAC1_denorm_done ; branch if not suitable to decrement exponent
|
||||
|
||||
; Decrement exponent
|
||||
|
||||
dec FAC1_exponent
|
||||
|
||||
; Move mantissa bits
|
||||
|
||||
clc
|
||||
ror FAC1_mantissa+0
|
||||
ror FAC1_mantissa+1
|
||||
ror FAC1_mantissa+2
|
||||
ror FAC1_mantissa+3
|
||||
|
||||
bcc div_FAC1_denorm_by_bit ; branch always
|
||||
|
||||
div_FAC1_denorm_done:
|
||||
|
||||
rts
|
||||
@@ -1,84 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Math package - 32-bit mantissa division, based on code by Verz
|
||||
;
|
||||
; divident: FAC2_mantissa, divisor: FAC1_mantissa (without FACOV), result: FAC2_mantissa, remainder: RESHO
|
||||
; temporary storage: INDEX+0, INDEX+1, INDEX+2, INDEX+3
|
||||
;
|
||||
; RESHO (remainder) should be set to 0 before
|
||||
;
|
||||
; see https://codebase64.org/doku.php?id=base:24bit_division_24-bit_result
|
||||
|
||||
; XXX test this
|
||||
|
||||
div_mantissas:
|
||||
|
||||
ldx #32 ; repeat for each bit
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
div_mantissas_loop:
|
||||
|
||||
; Multiply divident by 2, msb -> Carry
|
||||
|
||||
asl FAC2_mantissa+3
|
||||
rol FAC2_mantissa+2
|
||||
rol FAC2_mantissa+1
|
||||
rol FAC2_mantissa+0
|
||||
|
||||
; Multiply remainder by 2, lsb <- Carry
|
||||
|
||||
rol RESHO+3
|
||||
rol RESHO+2
|
||||
rol RESHO+1
|
||||
rol RESHO+0
|
||||
|
||||
; Subtract divisor from the remainder, result to INDEX and .Y
|
||||
|
||||
sec
|
||||
lda RESHO+3
|
||||
sbc FAC1_mantissa+3
|
||||
sta INDEX+3
|
||||
|
||||
lda RESHO+2
|
||||
sbc FAC1_mantissa+2
|
||||
sta INDEX+2
|
||||
|
||||
lda RESHO+1
|
||||
sbc FAC1_mantissa+1
|
||||
sta INDEX+1
|
||||
|
||||
lda RESHO+0
|
||||
sbc FAC1_mantissa+0
|
||||
|
||||
bcc div_mantissas_skip ; if Carry is not set then divisor did not fit in remainder yet
|
||||
sta INDEX+0
|
||||
|
||||
; Save subtraction result as new remainder
|
||||
|
||||
lda INDEX+3
|
||||
sta RESHO+3
|
||||
|
||||
lda INDEX+2
|
||||
sta RESHO+2
|
||||
|
||||
lda INDEX+1
|
||||
sta RESHO+1
|
||||
|
||||
lda INDEX+0
|
||||
sta RESHO+0
|
||||
|
||||
; Increment result cause divisor fit in 1 times
|
||||
|
||||
inc FAC2_mantissa+3
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
div_mantissas_skip:
|
||||
|
||||
dex
|
||||
bne div_mantissas_loop
|
||||
|
||||
rts
|
||||
@@ -1,16 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Multiply FAC1 by 2, do not normalize
|
||||
;
|
||||
|
||||
mul10_FAC1_mul2:
|
||||
|
||||
; Increment the exponent
|
||||
|
||||
inc FAC1_exponent
|
||||
+beq overflow_error
|
||||
|
||||
rts
|
||||
@@ -1,30 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - helper routines for RESHO manipulation
|
||||
;
|
||||
|
||||
|
||||
muldiv_RESHO_set_0:
|
||||
|
||||
lda #$00
|
||||
sta RESHO+0
|
||||
sta RESHO+1
|
||||
sta RESHO+2
|
||||
sta RESHO+3
|
||||
sta RESHO+4
|
||||
|
||||
rts
|
||||
|
||||
|
||||
muldiv_RESHO_01_add_A:
|
||||
|
||||
clc
|
||||
adc RESHO+0
|
||||
sta RESHO+0
|
||||
bcc @1
|
||||
inc RESHO+1
|
||||
@1:
|
||||
rts
|
||||
@@ -3,8 +3,13 @@
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Math package - The floating point constant -32768
|
||||
;
|
||||
; This is verified to be identical to the original Microsoft implementation where it was named N32768.
|
||||
;
|
||||
; Math package - a constant, for documentation see:
|
||||
; - https://www.c64-wiki.com/wiki/BASIC-ROM
|
||||
; - Computes Mapping the Commodore 64, page 105
|
||||
;
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Math package - copy FAC1 to memory location, do not round
|
||||
;
|
||||
; Input:
|
||||
; - .X - address low byte
|
||||
; - .Y - address high byte
|
||||
;
|
||||
; Output:
|
||||
; - .A - FAC1 exponent
|
||||
;
|
||||
; See also:
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
mov_FAC1_MEM:
|
||||
|
||||
; Original routines use $22/$23 location for a vector too, see here:
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
|
||||
sty INDEX+1
|
||||
stx INDEX+0
|
||||
|
||||
ldy #$00
|
||||
|
||||
; Copy exponent
|
||||
|
||||
lda FAC1_exponent
|
||||
sta (INDEX), y
|
||||
beq mov_FAC1_MEM_end ; for 0 no need to copy anything more
|
||||
|
||||
; Copy first byte of mantissa
|
||||
|
||||
iny
|
||||
lda FAC2_mantissa+3
|
||||
sta (INDEX), y
|
||||
|
||||
; Copy the sign XXX try to optimize this part
|
||||
|
||||
lda FAC1_sign
|
||||
bne @1
|
||||
|
||||
lda FAC2_mantissa+3
|
||||
and #$7F
|
||||
sta (INDEX), y
|
||||
@1:
|
||||
; Copy remaining parts of mantissa
|
||||
|
||||
iny
|
||||
lda FAC2_mantissa+2
|
||||
sta (INDEX), y
|
||||
|
||||
iny
|
||||
lda FAC2_mantissa+1
|
||||
sta (INDEX), y
|
||||
|
||||
iny
|
||||
lda FAC2_mantissa+0
|
||||
sta (INDEX), y
|
||||
|
||||
; Checked, that mov_FAC1_MEM works on real ROM too (at $BBD7),
|
||||
; and clears FACOV in a similar way as mov_FAC1_FAC2 does (not surprising)
|
||||
|
||||
ldy #$00
|
||||
sty FACOV
|
||||
|
||||
mov_FAC1_MEM_end:
|
||||
|
||||
lda FAC1_exponent
|
||||
rts
|
||||
File renamed without changes.
@@ -0,0 +1,74 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Math package - set FAC1 as FAC2 raised to the power of FAC1
|
||||
;
|
||||
; This is verified to be almost identical to the original Microsoft implementation where it was named FPWRT.
|
||||
;
|
||||
; Input:
|
||||
; - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
|
||||
;
|
||||
; Note:
|
||||
; - load FAC2 after FAC1, or mimic the Kernals sign comparison (XXX do we need it?)
|
||||
; - uses exp(x*log(y)) formula to calculate y^x; slow and inaccurate
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
; EXPONENTIATION --- X^Y.
|
||||
; N.B. 0^0=1
|
||||
; FIRST CHECK IF Y=0. IF SO, THE RESULT IS 1.
|
||||
; NEXT CHECK IF X=0. IF SO THE RESULT IS 0.
|
||||
; THEN CHECK IF X.GT.0. IF NOT CHECK THAT Y IS AN INTEGER.
|
||||
; IF SO, NEGATE X, SO THAT LOG DOESN'T GIVE FCERR.
|
||||
; IF X IS NEGATIVE AND Y IS ODD, NEGATE THE RESULT
|
||||
; RETURNED BY EXP.
|
||||
; TO COMPUTE THE RESULT USE X^Y=EXP((Y*LOG(X)).
|
||||
|
||||
!ifdef CONFIG_TRANSCENDENTAL_FUNCTIONS {
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
|
||||
pwr_FAC2_FAC1:
|
||||
|
||||
beq exp_FAC1 ; If FAC1=0, just exponentiate that
|
||||
lda FAC2_exponent ; Is X=0?
|
||||
bne FPWRT1
|
||||
jmp ZEROF1 ; Zero FAC1
|
||||
FPWRT1:
|
||||
ldx #TEMPF3 ; Save for later in a temp
|
||||
ldy #0
|
||||
jsr mov_r_FAC1_MEM
|
||||
; Y=0 already. Good in case no one calls INT
|
||||
lda FAC2_sign
|
||||
bpl FPWR1 ; No problems if X>0
|
||||
jsr int_FAC1 ; Integerize the FAC1
|
||||
lda #TEMPF3 ; Get addr of comperand
|
||||
ldy #0
|
||||
jsr FCOMP ; Equal?
|
||||
bne FPWR1 ; Leave X neg. log will blow him out. A=-1 and Y is irrelevant
|
||||
tya ; Negate X. Make positive
|
||||
ldy INTEGR ; Get evenness
|
||||
FPWR1:
|
||||
jsr mov_FAC2_FAC1_sign ; Alternate entry point
|
||||
tya
|
||||
pha ; Save evenness for later
|
||||
jsr log_FAC1 ; Find log
|
||||
lda #TEMPF3 ; Multiply FAC1 times log(x)
|
||||
ldy #0
|
||||
jsr mul_MEM_FAC1
|
||||
jsr exp_FAC1 ; Exponentiate the FAC1
|
||||
pla
|
||||
lsr ; Is it even=
|
||||
bcc NEGRTS ; Yes. or X>0
|
||||
|
||||
; FALLTHROUGH to toggle_sign_FAC1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Math package - exponential function, e raised to FAC1 power
|
||||
;
|
||||
; This is verified to be almost identical to the original Microsoft implementation where it was named EXP.
|
||||
; The addition is the jmp between the two ROMs
|
||||
;
|
||||
; See also:
|
||||
; - [CM64] Computes Mapping the Commodore 64 - page 117
|
||||
; - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
|
||||
; - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
|
||||
;
|
||||
|
||||
; FIRST SAVE THE ORIGINAL ARGUMENT AND MULTIPLY THE FAC BY
|
||||
; LOG2(E). THE RESULT IS USED TO DETERMINE IF OVERFLOW
|
||||
; WILL OCCUR SINCE EXP(X)=2^(X*LOG2(E)) WHERE
|
||||
; LOG2(E)=LOG(E) BASE 2. THEN SAVE THE INTEGER PART OF
|
||||
; THIS TO SCALE THE ANSWER AT THE END. SINCE
|
||||
; 2^Y=2^INT(Y)*2^(Y-INT(Y)) AND 2^INT(Y) IS EASY TO COMPUTE.
|
||||
; NOW COMPUTE 2^(X*LOG2(E)-INT(X*LOG2(E)) BY
|
||||
; P(LN(2)*(INT(X*LOG2(E))+1)-X) WHERE P IS AN APPROXIMATION
|
||||
; POLYNOMIAL. THE RESULT IS THEN SCALED BY THE POWER OF 2
|
||||
; PREVIOUSLY SAVED.
|
||||
|
||||
!ifdef CONFIG_TRANSCENDENTAL_FUNCTIONS {
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
|
||||
exp_FAC1:
|
||||
|
||||
lda #<const_INV_LOG_2 ; Multiply by log_2(e)
|
||||
ldy #>const_INV_LOG_2
|
||||
jsr mul_MEM_FAC1
|
||||
lda FACOV
|
||||
adc #$50
|
||||
bcc @1
|
||||
jsr INCRND
|
||||
@1 jmp STOLD ; The BASIC ROM ends here so we need to jump to the KERNAL ROM
|
||||
|
||||
} else {
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
} }
|
||||
File renamed without changes.
@@ -0,0 +1,53 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * BASIC_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; This file is under the MIT license, it contains code released by Microsoft Corporation.
|
||||
; See LICENSE for more information.
|
||||
|
||||
; Continuation of the exp function in the BASIC part of KERNAL ROM
|
||||
|
||||
!ifdef CONFIG_TRANSCENDENTAL_FUNCTIONS {
|
||||
!ifdef CONFIG_MEMORY_MODEL_38K {
|
||||
|
||||
STOLD:
|
||||
sta OLDOV
|
||||
jsr mov_FAC1_FAC2 ; To save in FAC2 without ROUND
|
||||
lda FAC1_exponent
|
||||
cmp #$88 ; IF abs(FAC1) >= 128, too big
|
||||
bcc @3
|
||||
|
||||
@2
|
||||
jsr MLDVEX ; overflow or overflow
|
||||
@3
|
||||
jsr int_FAC1
|
||||
lda CHARAC ; Get low part
|
||||
clc
|
||||
adc #$81
|
||||
beq @2 ; overflow or overflow !!
|
||||
sec
|
||||
sbc #1 ; Subtract 1
|
||||
pha ; Save a while
|
||||
ldx #5 ; Prep to swap FAC1 and FAC2
|
||||
@4
|
||||
lda FAC2_exponent,X
|
||||
ldy FAC1_exponent,X
|
||||
sta FAC1_exponent,X
|
||||
sty FAC2_exponent,X
|
||||
dex
|
||||
bpl @4
|
||||
lda OLDOV
|
||||
sta FACOV
|
||||
jsr sub_FAC2_FAC1
|
||||
jsr toggle_sign_FAC1 ; Negate FAC1
|
||||
lda #<poly_exp
|
||||
ldy #>poly_exp
|
||||
jsr poly2_FAC1
|
||||
lda #$00
|
||||
sta ARISGN ; Multiply by positive 1.0
|
||||
pla ; Get scale factor
|
||||
jsr MLDEXP ; Modify FAC1_exponent and check for overflow
|
||||
rts
|
||||
|
||||
}
|
||||
}
|
||||
@@ -152,10 +152,11 @@ wedge_dos_command_confirmed:
|
||||
jsr JOPEN
|
||||
+bcs wedge_dos_basic_error
|
||||
|
||||
; Retrieve status, print it if not OK
|
||||
; Retrieve status through the channel just opened, print it if not OK. Closing it
|
||||
; first would reset the status to OK: CLALL closes every file, and a drive's DOS
|
||||
; says OK once its command channel closes
|
||||
|
||||
jsr JCLALL
|
||||
jsr wedge_dos_status_get
|
||||
jsr wedge_dos_status_get_opened
|
||||
|
||||
lda BUF+0
|
||||
cmp #$30 ; '0'
|
||||
@@ -217,6 +218,10 @@ wedge_dos_status_get:
|
||||
jsr JOPEN
|
||||
+bcs wedge_dos_basic_error
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
wedge_dos_status_get_opened:
|
||||
|
||||
; Set channel for input
|
||||
|
||||
ldx #$0F
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Autoboot of the Blade Firmware (mc64blade only, arnitech's ADR 0030): BASIC's cold start, before
|
||||
; READY., has a Blade LOAD"*",8, the first program on its internal drive's Floppy, and RUNs it.
|
||||
;
|
||||
; Out: carry clear if the program loaded, with X/Y the address after its end; carry set if
|
||||
; RUN/STOP is held on the Terminal Card, or the LOAD failed (no Floppy, no file, no drive).
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
blade_autoboot:
|
||||
|
||||
jsr terminal_find
|
||||
bcs @1
|
||||
lda TERMINAL_STATUS, x
|
||||
and #TERMINAL_STOP_HELD
|
||||
beq @1
|
||||
sec
|
||||
rts
|
||||
@1:
|
||||
lda #$01
|
||||
ldx #<blade_autoboot_name
|
||||
ldy #>blade_autoboot_name
|
||||
jsr JSETNAM
|
||||
lda #$00
|
||||
ldx #$08
|
||||
ldy #$00 ; secondary address 0: to BASIC's start
|
||||
jsr JSETFLS
|
||||
lda #$00 ; LOAD, not VERIFY
|
||||
ldx TXTTAB+0
|
||||
ldy TXTTAB+1
|
||||
jmp JLOAD
|
||||
|
||||
blade_autoboot_name:
|
||||
|
||||
!byte $2A ; "*"
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; The Arnitech controller (mc64 and mc64blade, arnitech's ADR 0023): its signature and its Slot table
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
;
|
||||
; Whether the controller answers: its signature "ARNI" at $DE80, compared with the jump table's.
|
||||
; Out: carry clear if it does, carry set if not. A and X are not kept, Y is.
|
||||
;
|
||||
|
||||
arnitech_check_signature:
|
||||
|
||||
ldx #$03
|
||||
@1:
|
||||
lda ARNITECH_SIGNATURE, x
|
||||
cmp arnitech_jumptable, x
|
||||
bne @2
|
||||
dex
|
||||
bpl @1
|
||||
|
||||
clc
|
||||
rts
|
||||
@2:
|
||||
sec
|
||||
rts
|
||||
|
||||
;
|
||||
; ARNI_FINDCARD, $FF06: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_find_card:
|
||||
|
||||
pha
|
||||
jsr arnitech_check_signature
|
||||
pla
|
||||
bcs @2 ; no controller
|
||||
|
||||
ldx #$00
|
||||
@1:
|
||||
cpx ARNITECH_SLOT_COUNT
|
||||
bcs @2 ; past the last slot, carry set
|
||||
cmp ARNITECH_SLOT_TABLE, x
|
||||
beq @3
|
||||
inx
|
||||
bne @1 ; always taken
|
||||
@2:
|
||||
rts
|
||||
@3:
|
||||
txa
|
||||
pha
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl ; 16 * slot
|
||||
clc
|
||||
adc #<ARNITECH_CARD_WINDOW
|
||||
tax
|
||||
pla
|
||||
rts ; carry clear
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; The 65816's native-mode interrupts on a Blade (mc64blade only, arnitech's ADR 0029 and 0030)
|
||||
;
|
||||
; In native mode the 65816 fetches its vectors from $FFE4-$FFEF, where the KERNAL's jump table
|
||||
; has its JMPs, so a Blade reads them from the RAM under the KERNAL, which CINT fills. A program
|
||||
; that switches to native mode with interrupts on keeps running: the IRQ and NMI handlers save
|
||||
; the registers, the direct page, and the data bank, run the KERNAL's handlers through CINV and
|
||||
; NMINV in 8-bit native mode on direct page 0 and data bank 0, and return with RTI. BRK, COP, and
|
||||
; ABORT go to the BRK handler, which returns to emulation mode and to READY. The code here runs
|
||||
; only on a 65816, so its own opcodes are bytes.
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
native_vectors_init:
|
||||
|
||||
ldx #(__native_vector_table_end - native_vector_table - 1)
|
||||
@1:
|
||||
lda native_vector_table, x
|
||||
sta NATIVE_VECTORS, x ; with the KERNAL banked in, the write reaches the RAM under it
|
||||
dex
|
||||
bpl @1
|
||||
rts
|
||||
|
||||
native_vector_table:
|
||||
|
||||
!word default_brk_handler ; COP
|
||||
!word default_brk_handler ; BRK
|
||||
!word default_brk_handler ; ABORT
|
||||
!word native_nmi ; NMI
|
||||
!word default_brk_handler ; reserved
|
||||
!word native_irq ; IRQ
|
||||
|
||||
__native_vector_table_end:
|
||||
|
||||
;
|
||||
; IRQ and NMI in native mode, with any register widths: the registers go on the stack whole,
|
||||
; then a frame as an IRQ or NMI makes it in emulation mode, whose RTI comes back to native_return.
|
||||
;
|
||||
|
||||
native_irq:
|
||||
|
||||
!byte $C2, $30 ; REP #$30: 16-bit A, X, and Y
|
||||
pha
|
||||
!byte $A9 ; LDA #: the handler's address, less one, for RTS
|
||||
!word native_irq_kernal - 1
|
||||
!byte $80 ; BRA native_save
|
||||
!byte native_save - (* + 1)
|
||||
|
||||
native_nmi:
|
||||
|
||||
!byte $C2, $30 ; REP #$30
|
||||
pha
|
||||
!byte $A9 ; LDA #
|
||||
!word hw_entry_nmi - 1
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
native_save:
|
||||
|
||||
!byte $DA ; PHX
|
||||
!byte $5A ; PHY
|
||||
!byte $8B ; PHB
|
||||
!byte $0B ; PHD
|
||||
tax ; the handler's address, 16 bits
|
||||
!byte $F4, $00, $00 ; PEA $0000
|
||||
!byte $2B ; PLD: direct page 0
|
||||
!byte $E2, $20 ; SEP #$20: 8-bit A
|
||||
lda #$00
|
||||
pha
|
||||
!byte $AB ; PLB: data bank 0
|
||||
|
||||
; The frame the KERNAL's handler returns through: program bank, address, status (8-bit A,
|
||||
; X, and Y, interrupts off)
|
||||
|
||||
pha
|
||||
!byte $F4 ; PEA native_return
|
||||
!word native_return
|
||||
lda #$34
|
||||
pha
|
||||
!byte $DA ; PHX: the handler's address, for RTS
|
||||
!byte $E2, $30 ; SEP #$30: 8-bit X and Y
|
||||
rts
|
||||
|
||||
native_irq_kernal:
|
||||
|
||||
; The KERNAL's IRQ handlers end by pulling Y, X, and A, as hw_entry_irq pushes them
|
||||
|
||||
pha
|
||||
pha
|
||||
pha
|
||||
jmp (CINV)
|
||||
|
||||
native_return:
|
||||
|
||||
!byte $C2, $30 ; REP #$30
|
||||
!byte $2B ; PLD
|
||||
!byte $AB ; PLB
|
||||
!byte $7A ; PLY
|
||||
!byte $FA ; PLX
|
||||
pla
|
||||
rti
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; The network entries of the Arnitech jump table (mc64 and mc64blade, arnitech's ADR 0027):
|
||||
; whole Ethernet frames through the CS8900A at the RR-Net socket, polled, from the Destination
|
||||
; Address to the end of the data, without the CRC. The chip is found by its PacketPage Pointer
|
||||
; and Product ID, so the routines find an RR-Net on any C64 that has one. Register semantics are
|
||||
; the CS8900A datasheet's (Cirrus Logic DS271F5) and its 8-bit mode's (AN181).
|
||||
;
|
||||
; SAL holds the pointer to the frame or buffer, EAL the bytes left, as LOAD and SAVE use them.
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
; PacketPage addresses, all but the Product ID's in page $01
|
||||
CS_PRODUCT_ID = $630E ; at $0000, low byte first
|
||||
CS_RX_CFG = $02 ; bit 6 Skip_1
|
||||
CS_RX_CTL = $04
|
||||
CS_LINE_CTL = $12
|
||||
CS_SELF_CTL = $14 ; bit 6 RESET
|
||||
CS_RX_EVENT = $24 ; bit 8 RxOK
|
||||
CS_SELF_ST = $36 ; bit 7 INITD
|
||||
CS_BUS_ST = $38 ; bit 7 TxBidErr, bit 8 Rdy4TxNOW
|
||||
CS_IA = $58 ; Individual Address, $0158-$015D
|
||||
|
||||
CS_RX_CTL_VALUE = $0D05 ; RxOKA, IndividualA, BroadcastA
|
||||
CS_LINE_VALUE = $00D3 ; SerRxON, SerTxON
|
||||
CS_TX_AFTER_ALL = $C0 ; TxCMD: start once the whole frame is in the chip
|
||||
|
||||
NET_NONE_WAITING = $00
|
||||
NET_NO_CARD = $01
|
||||
NET_NO_ROOM = $02
|
||||
NET_LENGTH_REFUSED = $03
|
||||
NET_TOO_LONG = $04
|
||||
|
||||
;
|
||||
; NET_INIT, $FF0C: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_net_init:
|
||||
|
||||
jsr arnitech_net_probe
|
||||
bcs @2
|
||||
|
||||
lda #CS_SELF_CTL
|
||||
jsr arnitech_net_point
|
||||
lda #$40 ; RESET, which points the PacketPage pointer at $0000
|
||||
sta RRNET_PP_DATA
|
||||
|
||||
lda #CS_SELF_ST
|
||||
jsr arnitech_net_point
|
||||
@1:
|
||||
lda RRNET_PP_DATA
|
||||
bpl @1 ; until INITD
|
||||
|
||||
+phy_trash_a
|
||||
lda #CS_RX_CTL
|
||||
ldx #<CS_RX_CTL_VALUE
|
||||
ldy #>CS_RX_CTL_VALUE
|
||||
jsr arnitech_net_write
|
||||
lda #CS_LINE_CTL
|
||||
ldx #<CS_LINE_VALUE
|
||||
ldy #>CS_LINE_VALUE
|
||||
jsr arnitech_net_write
|
||||
+ply_trash_a
|
||||
|
||||
clc
|
||||
@2:
|
||||
rts
|
||||
|
||||
;
|
||||
; NET_MAC, $FF0F: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_net_mac:
|
||||
|
||||
stx SAL+0
|
||||
sty SAL+1
|
||||
jsr arnitech_net_probe
|
||||
bcs @2
|
||||
|
||||
ldy #$00
|
||||
@1:
|
||||
tya
|
||||
ora #CS_IA ; $58, $5A, $5C
|
||||
jsr arnitech_net_point
|
||||
lda RRNET_PP_DATA+0
|
||||
sta (SAL), y
|
||||
iny
|
||||
lda RRNET_PP_DATA+1
|
||||
sta (SAL), y
|
||||
iny
|
||||
cpy #$06
|
||||
bne @1
|
||||
|
||||
clc
|
||||
@2:
|
||||
rts
|
||||
|
||||
;
|
||||
; NET_SEND, $FF12: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_net_send:
|
||||
|
||||
jsr arnitech_net_args
|
||||
lda #NET_NO_CARD
|
||||
bcs arnitech_net_done
|
||||
|
||||
lda #CS_TX_AFTER_ALL ; TxCMD, which the high byte's write gives the chip
|
||||
sta RRNET_TX_CMD+0
|
||||
lda #$00
|
||||
sta RRNET_TX_CMD+1
|
||||
lda EAL+0 ; TxLength: the bid, at the high byte's write
|
||||
sta RRNET_TX_LENGTH+0
|
||||
lda EAL+1
|
||||
sta RRNET_TX_LENGTH+1
|
||||
|
||||
lda #CS_BUS_ST
|
||||
jsr arnitech_net_point
|
||||
lda RRNET_PP_DATA+0
|
||||
bmi @1 ; TxBidErr
|
||||
lda RRNET_PP_DATA+1
|
||||
lsr ; Rdy4TxNOW into carry
|
||||
lda #NET_NO_ROOM
|
||||
bcc arnitech_net_fail
|
||||
|
||||
clv ; memory to chip
|
||||
jmp arnitech_net_copy ; carry clear
|
||||
@1:
|
||||
lda #NET_LENGTH_REFUSED
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
arnitech_net_fail:
|
||||
|
||||
sec
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
arnitech_net_done:
|
||||
|
||||
rts
|
||||
|
||||
;
|
||||
; NET_RECV, $FF15: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_net_recv:
|
||||
|
||||
jsr arnitech_net_args
|
||||
lda #NET_NO_CARD
|
||||
bcs arnitech_net_done
|
||||
|
||||
lda #CS_RX_EVENT
|
||||
jsr arnitech_net_point
|
||||
lda RRNET_PP_DATA+1 ; reading the event clears it
|
||||
lsr ; RxOK into carry
|
||||
lda #NET_NONE_WAITING
|
||||
bcc arnitech_net_fail
|
||||
|
||||
lda RRNET_RX_TX_DATA+1 ; RxStatus, high byte first, not needed
|
||||
lda RRNET_RX_TX_DATA+0
|
||||
ldx RRNET_RX_TX_DATA+1 ; RxLength, high byte first
|
||||
lda RRNET_RX_TX_DATA+0
|
||||
|
||||
cpx EAL+1
|
||||
bne @1
|
||||
cmp EAL+0
|
||||
beq @2
|
||||
@1:
|
||||
bcs @3 ; longer than the buffer
|
||||
@2:
|
||||
sta EAL+0
|
||||
stx EAL+1
|
||||
pha
|
||||
txa
|
||||
pha
|
||||
bit arnitech_net_copy_end ; an RTS, $60: sets V, chip to memory
|
||||
jsr arnitech_net_copy
|
||||
pla
|
||||
tay
|
||||
pla
|
||||
tax
|
||||
clc
|
||||
rts
|
||||
@3:
|
||||
lda #CS_RX_CFG
|
||||
jsr arnitech_net_point
|
||||
lda RRNET_PP_DATA+0
|
||||
ora #$40 ; Skip_1: the frame is dropped
|
||||
sta RRNET_PP_DATA+0
|
||||
lda #NET_TOO_LONG
|
||||
bne arnitech_net_fail ; branch always
|
||||
|
||||
;
|
||||
; The pointer from the zero page address in A into SAL, the length in X/Y into EAL, and the
|
||||
; chip probed. Out: carry clear if it answers.
|
||||
;
|
||||
|
||||
arnitech_net_args:
|
||||
|
||||
stx EAL+0
|
||||
sty EAL+1
|
||||
tax
|
||||
lda $00, x
|
||||
sta SAL+0
|
||||
lda $01, x
|
||||
sta SAL+1
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
;
|
||||
; Whether the chip answers: the PacketPage Pointer, set to $0000, reads back $3000, as its
|
||||
; bits C-E always read 011b (DS271F5 4.10.5), and the Product ID is at PacketPage $0000, so a
|
||||
; floating bus that reads like the Product ID by chance is no chip. Out: carry clear if it
|
||||
; answers. X and Y are kept.
|
||||
;
|
||||
|
||||
arnitech_net_probe:
|
||||
|
||||
lda #$00
|
||||
sta RRNET_PP_POINTER+0
|
||||
sta RRNET_PP_POINTER+1
|
||||
lda RRNET_PP_POINTER+1
|
||||
cmp #$30
|
||||
bne @1
|
||||
lda RRNET_PP_DATA+0
|
||||
cmp #<CS_PRODUCT_ID
|
||||
bne @1
|
||||
lda RRNET_PP_DATA+1
|
||||
cmp #>CS_PRODUCT_ID
|
||||
bne @1
|
||||
clc
|
||||
rts
|
||||
@1:
|
||||
sec
|
||||
rts
|
||||
|
||||
;
|
||||
; PacketPage register $01xx, xx in A, written with X (low byte) and Y (high byte)
|
||||
;
|
||||
|
||||
arnitech_net_write:
|
||||
|
||||
jsr arnitech_net_point
|
||||
stx RRNET_PP_DATA+0
|
||||
sty RRNET_PP_DATA+1
|
||||
rts
|
||||
|
||||
;
|
||||
; The PacketPage pointer at $01xx, xx in A. X and Y are kept.
|
||||
;
|
||||
|
||||
arnitech_net_point:
|
||||
|
||||
sta RRNET_PP_POINTER+0
|
||||
lda #$01
|
||||
sta RRNET_PP_POINTER+1
|
||||
rts
|
||||
|
||||
;
|
||||
; EAL bytes between the chip's receive and transmit data port and SAL: from the chip with V
|
||||
; set, to it with V clear. Even bytes go through the port's low byte, odd ones through its
|
||||
; high byte. Out: carry clear.
|
||||
;
|
||||
|
||||
arnitech_net_copy:
|
||||
|
||||
ldy #$00
|
||||
@1:
|
||||
lda EAL+0
|
||||
ora EAL+1
|
||||
beq @4
|
||||
tya
|
||||
and #$01
|
||||
tax
|
||||
bvs @2
|
||||
lda (SAL), y
|
||||
cpx #$01 ; plain stores: an indexed one reads the port
|
||||
beq @7 ; first, which takes a byte of a received frame
|
||||
sta RRNET_RX_TX_DATA+0
|
||||
bvc @3 ; branch always
|
||||
@7:
|
||||
sta RRNET_RX_TX_DATA+1
|
||||
bvc @3 ; branch always
|
||||
@2:
|
||||
lda RRNET_RX_TX_DATA, x
|
||||
sta (SAL), y
|
||||
@3:
|
||||
iny
|
||||
bne @5
|
||||
inc SAL+1
|
||||
@5:
|
||||
lda EAL+0
|
||||
bne @6
|
||||
dec EAL+1
|
||||
@6:
|
||||
dec EAL+0
|
||||
jmp @1
|
||||
@4:
|
||||
clc
|
||||
|
||||
arnitech_net_copy_end:
|
||||
|
||||
rts
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; The Terminal Card driver of the Blade Firmware (mc64blade only, arnitech's ADR 0030 and 0031)
|
||||
;
|
||||
; A Blade has no VIC-II and no keyboard: its screen and keyboard, devices 3 and 0, are the
|
||||
; Terminal Card, which holds the 80x25 screen and the screen editor itself. CHROUT writes each
|
||||
; byte to it, as a glyph while quote or insert mode is on; CHRIN echoes the keys typed and, on
|
||||
; RETURN, reads back the logical line under the cursor; the IRQ moves its keys into the keyboard
|
||||
; buffer and its RUN/STOP into STKEY. Quote and insert mode stay the KERNAL's, in QTSW and INSRT,
|
||||
; as the Card cannot see them. With no Terminal Card, bytes printed go nowhere and no key comes.
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Finds the Terminal Card. Out: carry clear and X = its Card window's low byte, carry set if
|
||||
; there is none. A is not kept, Y is.
|
||||
;
|
||||
|
||||
terminal_find:
|
||||
|
||||
lda #TERMINAL_CARD_TYPE
|
||||
jmp arnitech_find_card
|
||||
|
||||
;
|
||||
; CHROUT for device 3. SCHAR holds the byte; CHROUT has saved X, Y, and P.
|
||||
;
|
||||
; Outside quote and insert mode the byte goes to Output. While either is on, every control code
|
||||
; but RETURN, SHIFT+RETURN, and STOP goes to Literal, which draws it as a glyph; so does DEL
|
||||
; while INSRT is not 0, which a DEL between quotes leaves to delete, but INS then opens another
|
||||
; space, as on a C64 (Programmer's Reference Guide, p. 96). RETURN, SHIFT+RETURN, and STOP end
|
||||
; both modes. A glyph drawn counts INSRT down, a quote toggles QTSW, and an INS that
|
||||
; opened a space (status bit 3) counts INSRT up.
|
||||
;
|
||||
|
||||
chrout_terminal:
|
||||
|
||||
jsr terminal_find
|
||||
bcs chrout_terminal_done ; no Terminal Card: the byte goes nowhere
|
||||
|
||||
lda SCHAR
|
||||
and #$60
|
||||
beq chrout_terminal_control ; $00-$1F and $80-$9F are control codes
|
||||
|
||||
lda SCHAR
|
||||
sta TERMINAL_OUTPUT, x
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
chrout_terminal_glyph:
|
||||
|
||||
lda INSRT
|
||||
beq @1
|
||||
dec INSRT
|
||||
@1:
|
||||
lda SCHAR
|
||||
cmp #$22
|
||||
bne chrout_terminal_done
|
||||
lda QTSW
|
||||
eor #$80
|
||||
sta QTSW
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
chrout_terminal_done:
|
||||
|
||||
jmp chrout_done_success
|
||||
|
||||
chrout_terminal_control:
|
||||
|
||||
lda SCHAR
|
||||
cmp #KEY_RETURN
|
||||
beq chrout_terminal_end_modes
|
||||
cmp #KEY_SHIFT_RETURN
|
||||
beq chrout_terminal_end_modes
|
||||
cmp #KEY_STOP
|
||||
beq chrout_terminal_end_modes
|
||||
|
||||
ldy INSRT
|
||||
beq @1
|
||||
cmp #KEY_INS
|
||||
beq chrout_terminal_code ; in the spaces INS opened, INS opens another
|
||||
bne chrout_terminal_literal ; ... and DEL too is a glyph
|
||||
@1:
|
||||
ldy QTSW
|
||||
beq chrout_terminal_code
|
||||
cmp #KEY_DEL
|
||||
beq chrout_terminal_code ; between quotes DEL still deletes
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
chrout_terminal_literal:
|
||||
|
||||
sta TERMINAL_LITERAL, x
|
||||
jmp chrout_terminal_glyph
|
||||
|
||||
chrout_terminal_code:
|
||||
|
||||
sta TERMINAL_OUTPUT, x
|
||||
cmp #KEY_INS
|
||||
bne chrout_terminal_done
|
||||
lda TERMINAL_STATUS, x
|
||||
and #TERMINAL_INSERTED
|
||||
beq chrout_terminal_done
|
||||
inc INSRT
|
||||
bne chrout_terminal_done ; branch always
|
||||
|
||||
chrout_terminal_end_modes:
|
||||
|
||||
sta TERMINAL_OUTPUT, x
|
||||
lda #$00
|
||||
sta QTSW
|
||||
sta INSRT
|
||||
beq chrout_terminal_done ; branch always
|
||||
|
||||
;
|
||||
; CHRIN for device 0, the keyboard. X and Y are kept.
|
||||
;
|
||||
; The first call marks where input starts on the Terminal, echoes each key typed through CHROUT,
|
||||
; and on RETURN has the Card take the logical line under the cursor; it and the calls after
|
||||
; return the line's bytes, then RETURN, which ends it.
|
||||
;
|
||||
|
||||
chrin_terminal:
|
||||
|
||||
stx XSAV
|
||||
+phy_trash_a
|
||||
|
||||
lda CRSW
|
||||
bne chrin_terminal_next ; a line is being returned
|
||||
|
||||
jsr terminal_find
|
||||
bcs chrin_terminal_wait
|
||||
lda #TERMINAL_INPUT_START
|
||||
sta TERMINAL_COMMAND, x
|
||||
|
||||
chrin_terminal_wait:
|
||||
|
||||
lda NDX
|
||||
beq chrin_terminal_wait
|
||||
jsr get_from_keyboard_buffer
|
||||
cmp #KEY_RETURN
|
||||
beq chrin_terminal_take
|
||||
jsr JCHROUT ; the Terminal Card edits
|
||||
jmp chrin_terminal_wait
|
||||
|
||||
chrin_terminal_take:
|
||||
|
||||
jsr terminal_find
|
||||
bcs chrin_terminal_end ; the Card is gone: an empty line
|
||||
lda #TERMINAL_TAKE_LINE
|
||||
sta TERMINAL_COMMAND, x
|
||||
inc CRSW
|
||||
|
||||
chrin_terminal_next:
|
||||
|
||||
jsr terminal_find
|
||||
bcs chrin_terminal_end
|
||||
lda TERMINAL_LINE, x
|
||||
cmp #KEY_RETURN
|
||||
bne chrin_terminal_return
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
chrin_terminal_end:
|
||||
|
||||
lda #$00
|
||||
sta CRSW
|
||||
sta QTSW
|
||||
sta INSRT
|
||||
lda #KEY_RETURN
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
chrin_terminal_return:
|
||||
|
||||
tax
|
||||
+ply_trash_a
|
||||
txa
|
||||
ldx XSAV
|
||||
clc
|
||||
rts
|
||||
|
||||
;
|
||||
; SCNKEY: moves the Terminal Card's keys into the keyboard buffer, while it has room; the rest
|
||||
; wait in the Card.
|
||||
;
|
||||
|
||||
SCNKEY:
|
||||
|
||||
jsr terminal_find
|
||||
bcs @2
|
||||
@1:
|
||||
lda TERMINAL_STATUS, x
|
||||
lsr ; bit 0, a key waiting, into carry
|
||||
bcc @2
|
||||
ldy NDX
|
||||
cpy XMAX
|
||||
bcs @2
|
||||
lda TERMINAL_KEY, x
|
||||
sta KEYD, y
|
||||
inc NDX
|
||||
bne @1 ; branch always
|
||||
@2:
|
||||
rts
|
||||
|
||||
;
|
||||
; The part of UDTIM that reads the STOP key: STKEY is $7F while the Terminal Card's RUN/STOP is
|
||||
; held, $FF otherwise. Y is kept.
|
||||
;
|
||||
|
||||
udtim_terminal_stop:
|
||||
|
||||
jsr terminal_find
|
||||
lda #$00 ; no Terminal Card, no RUN/STOP
|
||||
bcs @1
|
||||
lda TERMINAL_STATUS, x
|
||||
@1:
|
||||
and #TERMINAL_STOP_HELD
|
||||
lsr
|
||||
lsr ; held into carry
|
||||
ror ; ... and into bit 7
|
||||
eor #$FF
|
||||
sta STKEY
|
||||
rts
|
||||
|
||||
;
|
||||
; SCREEN: the Terminal's 80 columns in X and 25 rows in Y.
|
||||
;
|
||||
|
||||
SCREEN:
|
||||
|
||||
ldx #80
|
||||
ldy #25
|
||||
rts
|
||||
|
||||
;
|
||||
; CINT's work on a Blade: the keyboard and the screen as the input and output devices (as
|
||||
; vicii_init does on a C64), the keyboard buffer's size, a reset of the Terminal and of quote and
|
||||
; insert mode, the native-mode vectors, and CIA1's timer A for the jiffy IRQ.
|
||||
;
|
||||
|
||||
cint_terminal:
|
||||
|
||||
jsr clrchn_reset
|
||||
ldx #10
|
||||
stx XMAX
|
||||
lda #$00
|
||||
sta CRSW
|
||||
sta QTSW
|
||||
sta INSRT
|
||||
jsr terminal_find
|
||||
bcs @1
|
||||
lda #TERMINAL_RESET
|
||||
sta TERMINAL_COMMAND, x
|
||||
@1:
|
||||
jsr native_vectors_init
|
||||
jmp setup_pal_ntsc
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; CIA1's TOD from the Arnitech controller's real time (mc64 and mc64blade, arnitech's ADR 0023)
|
||||
;
|
||||
; The controller lays its time out as the TOD reads it, so the copy goes hours first, which stops
|
||||
; the TOD, and tenths last, which starts it. The CIA flips the PM bit when an hour of 12 is
|
||||
; written (VICE does so too), so an hour of 12 has bit 7 flipped first.
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
;
|
||||
; ARNI_SETTOD, $FF09: see ff00.arnitech_jumptable.s
|
||||
;
|
||||
|
||||
arnitech_set_tod:
|
||||
|
||||
lda CIA1_CRA
|
||||
ora #$80 ; TOD on 50 Hz, the mc64's mains
|
||||
sta CIA1_CRA
|
||||
|
||||
; FALLTHROUGH
|
||||
|
||||
;
|
||||
; The copy alone, for IOINIT, which has set CRA already.
|
||||
; Out: carry clear if set, carry set if no controller answers. A and X are not kept, Y is.
|
||||
;
|
||||
|
||||
arnitech_tod_from_clock:
|
||||
|
||||
jsr arnitech_check_signature
|
||||
bcs @2
|
||||
|
||||
lda ARNITECH_CLOCK_LATCH ; copies the clock into $DE91-$DE9E
|
||||
|
||||
ldx ARNITECH_CLOCK_HRS
|
||||
txa
|
||||
and #$7F
|
||||
cmp #$12
|
||||
bne @1
|
||||
txa
|
||||
eor #$80 ; the CIA flips it back
|
||||
tax
|
||||
@1:
|
||||
stx CIA1_TODHRS ; stops the TOD
|
||||
lda ARNITECH_CLOCK_MIN
|
||||
sta CIA1_TODMIN
|
||||
lda ARNITECH_CLOCK_SEC
|
||||
sta CIA1_TODSEC
|
||||
lda ARNITECH_CLOCK_TEN
|
||||
sta CIA1_TODTEN ; starts it
|
||||
|
||||
clc
|
||||
@2:
|
||||
rts
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; The Arnitech jump table (mc64 and mc64blade): thin wrappers over the Arnitech controller's
|
||||
; registers (arnitech's ADR 0023), at fixed addresses. Software finds it by reading "ARNI" at
|
||||
; $FF00 with the KERNAL banked in; on any other KERNAL it uses the registers themselves, which
|
||||
; work the same.
|
||||
; Entries are only ever added, after the last, with the version and count raised; $FF48-$FF80
|
||||
; stay clear, for the stock IRQ entry, CINT, and the KERNAL revision byte.
|
||||
;
|
||||
; $FF00-$FF03 "ARNI"
|
||||
; $FF04 version of the table, $02
|
||||
; $FF05 number of entries
|
||||
;
|
||||
; $FF06 ARNI_FINDCARD - finds the first Card slot holding a Card of a given type
|
||||
; In: A = the Card's type ($01 Redstone Card, $02 Internet Card, $03 Network Card,
|
||||
; $04 Terminal Card; $00 finds an empty slot)
|
||||
; Out: carry clear if found: A = the slot (0-5), X = the low byte of its Card window
|
||||
; ($DEA0 + 16 * slot, so LDA $DE00,X reads the window's first byte);
|
||||
; carry set if no slot holds one, or no controller answers (a Cartridge switched it off)
|
||||
; Y is kept; A and X are not, when none is found
|
||||
;
|
||||
; $FF09 ARNI_SETTOD - sets CIA1's TOD from the controller's real time, as IOINIT does at boot
|
||||
; In: nothing; CIA1's CRB bit 7 must be 0, or the time goes into the TOD alarm
|
||||
; Out: carry clear if set: the TOD on 50 Hz (CIA1 CRA bit 7) and started at the time the
|
||||
; controller's clock latch read; carry set if no controller answers, with the TOD
|
||||
; untouched but on 50 Hz all the same
|
||||
; A and X are not kept, Y is
|
||||
;
|
||||
; Version 2 adds the network: whole Ethernet frames, from the Destination Address to the end of
|
||||
; the data without the CRC, through the CS8900A at the RR-Net socket (arnitech's ADR 0027),
|
||||
; found by its PacketPage Pointer and Product ID. Software polls; ARP and IP are its own.
|
||||
;
|
||||
; $FF0C NET_INIT - resets the chip and sets it to receive frames for its own address and
|
||||
; broadcasts, and to send
|
||||
; In: nothing
|
||||
; Out: carry clear if done; carry set if there is no Network Card
|
||||
; A and X are not kept, Y is
|
||||
;
|
||||
; $FF0F NET_MAC - copies the MAC address: the chip's Individual Address, which a reset sets to
|
||||
; the Network Card's
|
||||
; In: X/Y = the address of 6 bytes for it, low byte in X
|
||||
; Out: carry clear if copied; carry set if there is no Network Card
|
||||
; A, X, and Y are not kept
|
||||
;
|
||||
; $FF12 NET_SEND - sends a frame
|
||||
; In: A = a zero page address holding a pointer to the frame,
|
||||
; X/Y = its length, 14-1514, low byte in X; the chip pads one under 60 bytes
|
||||
; Out: carry clear if sent; carry set if not, with A = 1 no Network Card, 2 no room in
|
||||
; the chip while it holds frames received, 3 the chip refuses the length
|
||||
; A, X, and Y are not kept
|
||||
;
|
||||
; $FF15 NET_RECV - takes the oldest frame received
|
||||
; In: A = a zero page address holding a pointer to a buffer,
|
||||
; X/Y = its length, low byte in X
|
||||
; Out: carry clear if a frame was copied into the buffer, with X/Y = its length, low byte
|
||||
; in X; carry set if not, with A = 0 none waiting, 1 no Network Card, 4 the frame is
|
||||
; longer than the buffer, and is dropped
|
||||
; A is not kept when a frame is copied
|
||||
;
|
||||
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
arnitech_jumptable:
|
||||
|
||||
!byte $41, $52, $4E, $49 ; "ARNI"
|
||||
!byte $02 ; version
|
||||
!byte $06 ; entries
|
||||
|
||||
jmp arnitech_find_card ; $FF06
|
||||
jmp arnitech_set_tod ; $FF09
|
||||
jmp arnitech_net_init ; $FF0C
|
||||
jmp arnitech_net_mac ; $FF0F
|
||||
jmp arnitech_net_send ; $FF12
|
||||
jmp arnitech_net_recv ; $FF15
|
||||
}
|
||||
@@ -14,7 +14,7 @@ chkin_iec:
|
||||
|
||||
; Fail if the file is open for writing (secondary address 1)
|
||||
|
||||
lda LAT, Y
|
||||
lda SAT, Y
|
||||
cmp #$01
|
||||
+beq chkin_file_not_input
|
||||
|
||||
@@ -24,7 +24,7 @@ chkin_iec:
|
||||
jsr TALK
|
||||
+bcs chkinout_device_not_present
|
||||
|
||||
lda LAT, Y
|
||||
lda SAT, Y
|
||||
ora #$60
|
||||
jsr TKSA
|
||||
+bcs chkinout_device_not_present
|
||||
|
||||
@@ -28,9 +28,10 @@ CIOUT:
|
||||
|
||||
ciout_store_in_buffer:
|
||||
|
||||
; Store in the buffer data to be sent next, return
|
||||
; Store in the buffer data to be sent next, return; iec_tx_byte
|
||||
; sends the byte from TBTCNT, so that is our buffer, not BSOUR
|
||||
pla
|
||||
sta BSOUR
|
||||
sta TBTCNT
|
||||
rts
|
||||
|
||||
ciout_send_byte:
|
||||
|
||||
@@ -14,7 +14,7 @@ ckout_iec:
|
||||
|
||||
; Fail if the file is open for reading (secondary address 0)
|
||||
|
||||
lda LAT, Y
|
||||
lda SAT, Y
|
||||
+beq ckout_file_not_output
|
||||
|
||||
; Send LISTEN + SECOND first
|
||||
@@ -23,7 +23,7 @@ ckout_iec:
|
||||
jsr LISTEN
|
||||
+bcs chkinout_device_not_present
|
||||
|
||||
lda LAT, Y
|
||||
lda SAT, Y
|
||||
ora #$60
|
||||
jsr SECOND
|
||||
+bcs chkinout_device_not_present
|
||||
|
||||
@@ -23,11 +23,23 @@ close_iec:
|
||||
jsr iec_close_load
|
||||
jmp close_remove_from_table
|
||||
@1:
|
||||
ora $E0 ; CLOSE command
|
||||
; LISTEN, CLOSE, UNLISTEN - see https://www.pagetable.com/?p=1031
|
||||
lda FAT, y
|
||||
jsr LISTEN
|
||||
bcs close_iec_not_present
|
||||
lda SAT, y
|
||||
ora #$E0 ; CLOSE command
|
||||
sta TBTCNT
|
||||
jsr iec_tx_command
|
||||
bcs close_iec_end
|
||||
bcs close_iec_not_present
|
||||
jsr iec_tx_command_finalize
|
||||
jsr UNLSN
|
||||
jmp close_remove_from_table
|
||||
|
||||
close_iec_not_present:
|
||||
|
||||
; The file is closed all the same; READST says device not present
|
||||
jsr kernalstatus_DEVICE_NOT_FOUND
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ iec_return_success:
|
||||
|
||||
iec_return_DEVICE_NOT_FOUND:
|
||||
|
||||
; Set IEC line to normal idle state
|
||||
jsr iec_set_idle
|
||||
; Nobody answers: release all lines, so the bus is idle - see https://www.pagetable.com/?p=1135
|
||||
jsr iec_release_atn_clk_data
|
||||
|
||||
; BSOUR is certainly not valid anymore
|
||||
lda #$00
|
||||
|
||||
@@ -51,6 +51,25 @@ iec_tx_byte:
|
||||
+phx_trash_a
|
||||
+phy_trash_a
|
||||
|
||||
; A listener holds DATA until we release CLK; if nobody pulls it
|
||||
; within 256us, no device is present - see https://www.pagetable.com/?p=1135
|
||||
ldx #$18
|
||||
@0:
|
||||
lda CIA2_PRA
|
||||
bpl @1 ; branch if DATA is pulled
|
||||
dex
|
||||
bne @0
|
||||
jsr kernalstatus_DEVICE_NOT_FOUND
|
||||
jmp iec_return_DEVICE_NOT_FOUND
|
||||
@1:
|
||||
; Timing is critical from here on - execute on disabled IRQs, from before
|
||||
; CLK is released: an IRQ between the release and the EOI wait would hide
|
||||
; the listener's EOI acknowledgement, and the transfer would hang
|
||||
; The best practice would be to do PHP first, but it seems this is not
|
||||
; what the original ROM does; furthermore, pushing additional bytes to
|
||||
; stack can wreck autostart software loading at $0100
|
||||
sei
|
||||
|
||||
; Notify all devices that we are going to send a byte
|
||||
; and it is going to be a data byte (released ATN)
|
||||
jsr iec_release_atn_clk_data
|
||||
@@ -61,11 +80,7 @@ iec_tx_byte:
|
||||
|
||||
iec_tx_common:
|
||||
|
||||
; Timing is critical here - execute on disabled IRQs
|
||||
; The best practice would be to do PHP first, but it seems this is not
|
||||
; what the original ROM does; furthermore, pushing additional bytes to
|
||||
; stack can wreck autostart software loading at $0100
|
||||
sei
|
||||
; Entered with IRQs disabled, by iec_tx_byte and iec_tx_command
|
||||
|
||||
; Wait till all receivers are ready, they should all release DATA
|
||||
jsr iec_wait_for_data_release
|
||||
|
||||
@@ -32,7 +32,10 @@ iec_tx_command:
|
||||
; (can be busy processing something), we have to wait till they are all
|
||||
; ready (or bored with DOS attack...)
|
||||
; Release back CLK, keep DATA released - to ask devices for status.
|
||||
; From here on IRQs are disabled, as in iec_tx_byte: a listener takes a
|
||||
; talker that waits too long after the release for EOI
|
||||
|
||||
sei
|
||||
jsr iec_release_clk_data
|
||||
|
||||
; Common part of iec_txbyte and iec_tx_common - waits for devices
|
||||
|
||||
@@ -12,6 +12,28 @@
|
||||
; 63 cycles, we need at least 17 full rasters to be 100% sure we wait enough
|
||||
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
; A Blade has no VIC-II: CIA #1's timer B, which only the tape used, counts 1024 cycles once
|
||||
; (a little over 1 ms at the PAL clock of a Blade). Its START bit clears when it runs out;
|
||||
; its ICR flag would not do, as the IRQ handler's read of the ICR clears it
|
||||
|
||||
iec_wait1ms:
|
||||
|
||||
lda #$00
|
||||
sta CIA1_TIMBLO
|
||||
lda #$04
|
||||
sta CIA1_TIMBHI
|
||||
lda #%00011001 ; one-shot, load the latch, start
|
||||
sta CIA1_CRB
|
||||
@2:
|
||||
lda CIA1_CRB
|
||||
lsr
|
||||
bcs @2
|
||||
rts
|
||||
|
||||
} else {
|
||||
|
||||
!ifdef CONFIG_IEC {
|
||||
|
||||
|
||||
@@ -55,3 +77,5 @@ wait_x_bars: ; additional entry point for delay in screen and tape support
|
||||
iec_wait_rts: ; dummy RTS, for very short waits
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -28,8 +28,6 @@ TKSA:
|
||||
; - https://www.lemon64.com/forum/viewtopic.php?t=57694&sid=531ba3592bcffadef2ac8b9162f2e529
|
||||
; - https://www.pagetable.com/?p=1031 (Kernal API description)
|
||||
|
||||
ora #$90
|
||||
|
||||
jmp common_untlk_tksa
|
||||
|
||||
} else {
|
||||
|
||||
@@ -42,7 +42,15 @@ UNLSN:
|
||||
; Buffer empty, send the command
|
||||
lda #$3F
|
||||
|
||||
jmp common_open_close_unlsn_second
|
||||
common_unlsn_untlk: ; common part of UNLSN and UNTLK
|
||||
|
||||
jsr common_open_close_unlsn_second
|
||||
bcs @1
|
||||
|
||||
; The transmission is over: release CLK and DATA too, so the bus is idle - see https://www.pagetable.com/?p=1135
|
||||
jmp iec_release_clk_data
|
||||
@1:
|
||||
rts
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -39,10 +39,11 @@ UNTLK:
|
||||
sta IECPROTO
|
||||
}
|
||||
|
||||
; Buffer empty, send the command
|
||||
; Buffer empty, send the command; the talker releases the bus - see https://www.pagetable.com/?p=1031
|
||||
lda #$5F
|
||||
jmp common_unlsn_untlk
|
||||
|
||||
common_untlk_tksa: ; common part of UNTLK and TKSA
|
||||
common_untlk_tksa: ; the rest of TKSA
|
||||
|
||||
; 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
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; This is a part CINT which initializes screen and keyboard
|
||||
;
|
||||
@@ -49,3 +52,5 @@ cint_screen_keyboard:
|
||||
; Fallthrough/jump to screen clear routine (Computes Mapping the 64 p215)
|
||||
|
||||
jmp clear_screen
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -2,6 +2,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Part of the official Kernal routine, described in:
|
||||
;
|
||||
@@ -37,3 +40,5 @@ cint_legacy_end:
|
||||
; Game 'Operacja Proboszcz' is one example.
|
||||
|
||||
jmp cint_screen_keyboard ; XXX try to fit the code here
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -5,6 +5,9 @@
|
||||
;; #LAYOUT# X16 * #IGNORE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no VIC-II
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Well-known Kernal routine, described in:
|
||||
;
|
||||
@@ -22,43 +25,11 @@ vicii_init:
|
||||
|
||||
} else {
|
||||
|
||||
; Clear everything - turn off sprites (observed hanging around after
|
||||
; running programs and resetting), etc.
|
||||
; The work is elsewhere: $E5B4, inside the 41 bytes it takes, is the
|
||||
; keyboard buffer's well-known entry (e5b4.get_from_keyboard_buffer.s)
|
||||
|
||||
lda #$00
|
||||
ldx #$2E
|
||||
@1:
|
||||
sta __VIC_BASE, x
|
||||
dex
|
||||
bpl @1
|
||||
|
||||
; Set up default IO values
|
||||
; - [CM64] page 129 - VIC_SCROLY
|
||||
; - [CM64] pages 140-144 - VIC_SCROLX
|
||||
; - [CM64] pages 145-146 - VIC_YMCSB
|
||||
|
||||
lda #$1B ; according to [CM64] page 137 some software assumes oldest bit is 0
|
||||
sta VIC_SCROLY
|
||||
lda #$C8
|
||||
sta VIC_SCROLX ; 40 column, etc.
|
||||
lda #$14
|
||||
sta VIC_YMCSB
|
||||
lda #$0F
|
||||
sta VIC_IRQ ; clear all interrupts
|
||||
|
||||
; We use a different colour scheme of white text on all blue by default,
|
||||
; but brand-specific color scheme can also be enabled
|
||||
|
||||
lda #CONFIG_COLOR_BG
|
||||
sta VIC_EXTCOL
|
||||
sta VIC_BGCOL0
|
||||
|
||||
; Setup default I/O devices
|
||||
|
||||
!ifdef CONFIG_IEC {
|
||||
jmp clrchn_reset
|
||||
} else {
|
||||
jmp CLRCHN
|
||||
}
|
||||
jmp vicii_init_registers
|
||||
|
||||
} ; ROM layout
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -45,6 +45,8 @@ hw_entry_reset:
|
||||
; Also, https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image was used
|
||||
; as it shows example startup sequence, to be followe by cartridge creators
|
||||
|
||||
!ifndef CONFIG_ARNITECH_BLADE { ; a Blade has no Cartridges and no VIC-II
|
||||
|
||||
!ifndef ROM_LAYOUT_CRT {
|
||||
|
||||
; C64 PRG p269
|
||||
@@ -57,6 +59,7 @@ hw_entry_reset:
|
||||
ldx #$28
|
||||
stx VIC_SCROLX
|
||||
}
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
; Initialising IO is obviously required. Also indicated by c64 prg p269.
|
||||
jsr JIOINIT
|
||||
|
||||
|
||||
@@ -168,8 +168,18 @@ IOINIT_skip_DOS:
|
||||
jsr setup_irq_timer
|
||||
|
||||
; Enable timer A to run continuously (http://codebase64.org/doku.php?id=base:timerinterrupts)
|
||||
!ifdef CONFIG_ARNITECH_CONTROLLER {
|
||||
|
||||
; ... with the TOD on 50 Hz, the mc64's mains, set from the Arnitech controller's clock
|
||||
ldx #$91
|
||||
stx CIA1_CRA ; $DC0E
|
||||
jsr arnitech_tod_from_clock
|
||||
|
||||
} else {
|
||||
|
||||
ldx #$11
|
||||
stx CIA1_CRA ; $DC0E
|
||||
}
|
||||
|
||||
; Enable timer interrupt
|
||||
ldx #$81
|
||||
|
||||
@@ -13,5 +13,9 @@
|
||||
|
||||
CINT:
|
||||
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
jsr cint_legacy
|
||||
jmp setup_pal_ntsc
|
||||
} else {
|
||||
jmp cint_terminal
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
setup_pal_ntsc:
|
||||
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
lda VIC_RASTER
|
||||
@1:
|
||||
cmp VIC_RASTER
|
||||
@@ -23,6 +25,8 @@ setup_pal_ntsc:
|
||||
cmp #$07
|
||||
bcc setup_ntsc
|
||||
|
||||
} ; a Blade runs at the PAL C64's clock (arnitech's ADR 0029)
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
setup_pal:
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# CRT KERNAL_0 #TAKE
|
||||
;; #LAYOUT# M65 KERNAL_1 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no VIC-II
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; The VIC-II set-up of vicii_init (e5a0.vicii_init.s), moved out of $E5A0-$E5C8
|
||||
; so that $E5B4 is free
|
||||
;
|
||||
|
||||
|
||||
vicii_init_registers:
|
||||
|
||||
; Clear everything - turn off sprites (observed hanging around after
|
||||
; running programs and resetting), etc.
|
||||
|
||||
lda #$00
|
||||
ldx #$2E
|
||||
@1:
|
||||
sta __VIC_BASE, x
|
||||
dex
|
||||
bpl @1
|
||||
|
||||
; Set up default IO values
|
||||
; - [CM64] page 129 - VIC_SCROLY
|
||||
; - [CM64] pages 140-144 - VIC_SCROLX
|
||||
; - [CM64] pages 145-146 - VIC_YMCSB
|
||||
|
||||
lda #$1B ; according to [CM64] page 137 some software assumes oldest bit is 0
|
||||
sta VIC_SCROLY
|
||||
lda #$C8
|
||||
sta VIC_SCROLX ; 40 column, etc.
|
||||
lda #$14
|
||||
sta VIC_YMCSB
|
||||
lda #$0F
|
||||
sta VIC_IRQ ; clear all interrupts
|
||||
|
||||
; We use a different colour scheme of white text on all blue by default,
|
||||
; but brand-specific color scheme can also be enabled
|
||||
|
||||
lda #CONFIG_COLOR_BG
|
||||
sta VIC_EXTCOL
|
||||
sta VIC_BGCOL0
|
||||
|
||||
; Setup default I/O devices
|
||||
|
||||
!ifdef CONFIG_IEC {
|
||||
jmp clrchn_reset
|
||||
} else {
|
||||
jmp CLRCHN
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -47,7 +47,9 @@ default_irq_handler_common:
|
||||
|
||||
} else {
|
||||
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
jsr cursor_blink
|
||||
}
|
||||
jsr JSCNKEY
|
||||
jsr JUDTIM ; update jiffy clock
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@ default_nmi_handler:
|
||||
|
||||
; XXX confirm NMIs from CIA, or no other NMI will arrive!
|
||||
|
||||
!ifdef CONFIG_PLATFORM_COMMODORE_64 {
|
||||
!ifdef CONFIG_PLATFORM_COMMODORE_64 { !ifndef CONFIG_ARNITECH_BLADE { ; a Blade has no Cartridges
|
||||
|
||||
jsr cartridge_check
|
||||
bne @1
|
||||
jmp (ICART_WARM_START)
|
||||
@1:
|
||||
}
|
||||
} }
|
||||
|
||||
; According to C64 Wiki, if STOP key is pressed, the routine assumes warm start request
|
||||
|
||||
|
||||
@@ -9,7 +9,19 @@ default_brk_handler:
|
||||
|
||||
sei ; disable IRQs, to be sure they wont interfere
|
||||
|
||||
!ifdef CONFIG_PLATFORM_COMMODORE_64 {
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
; A Blade's 65816 comes here from BRK, COP, and ABORT in native mode too (arnitech_native.s):
|
||||
; direct page 0, data bank 0, and back to emulation mode
|
||||
|
||||
!byte $F4, $00, $00 ; PEA $0000
|
||||
!byte $2B ; PLD
|
||||
!byte $4B ; PHK
|
||||
!byte $AB ; PLB
|
||||
sec
|
||||
!byte $FB ; XCE
|
||||
|
||||
} else ifdef CONFIG_PLATFORM_COMMODORE_64 {
|
||||
|
||||
ldx #$00
|
||||
sta VIC_SCROLX ; turn the display off - we want as little screen artifacts as possible
|
||||
|
||||
@@ -26,12 +26,39 @@ plot_set:
|
||||
sty PNTR
|
||||
stx TBLX
|
||||
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
jsr screen_calculate_pointers
|
||||
|
||||
} else {
|
||||
|
||||
; On a Blade the cursor is the Terminal Card's, which clamps it to the 80x25 screen;
|
||||
; PNTR and TBLX keep the last place set or read, which is all there is without a Card
|
||||
|
||||
jsr terminal_find
|
||||
bcs plot_get_kept
|
||||
lda PNTR
|
||||
sta TERMINAL_COLUMN, x
|
||||
lda TBLX
|
||||
sta TERMINAL_ROW, x
|
||||
}
|
||||
|
||||
; FALLTROUGH to save one byte on RTS
|
||||
|
||||
plot_get:
|
||||
|
||||
!ifdef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
jsr terminal_find
|
||||
bcs plot_get_kept
|
||||
lda TERMINAL_COLUMN, x
|
||||
sta PNTR
|
||||
lda TERMINAL_ROW, x
|
||||
sta TBLX
|
||||
|
||||
plot_get_kept:
|
||||
}
|
||||
|
||||
ldy PNTR
|
||||
ldx TBLX
|
||||
rts
|
||||
@@ -22,7 +22,11 @@ CHRIN:
|
||||
lda DFLTN
|
||||
|
||||
; Try $00 - keyboard
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
+beq chrin_keyboard
|
||||
} else {
|
||||
+beq chrin_terminal
|
||||
}
|
||||
|
||||
; XXX Try $03 - screen
|
||||
; cmp #$03
|
||||
|
||||
@@ -30,7 +30,11 @@ CHROUT:
|
||||
lda DFLTO
|
||||
|
||||
cmp #$03 ; screen
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
+beq chrout_screen
|
||||
} else {
|
||||
+beq chrout_terminal
|
||||
}
|
||||
|
||||
!ifdef HAS_RS232 {
|
||||
cmp #$02
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
;
|
||||
; Well-known Kernal routine, described in:
|
||||
;
|
||||
; - [CM64] Computes Mapping the Commodore 64 - $E5B4, LP2
|
||||
;
|
||||
; Takes the first key from the keyboard buffer, which must not be empty, and moves the
|
||||
; others up. Out: the key in A. X is kept.
|
||||
;
|
||||
|
||||
|
||||
get_from_keyboard_buffer:
|
||||
|
||||
lda KEYD
|
||||
pha
|
||||
jsr pop_keyboard_buffer
|
||||
pla
|
||||
|
||||
rts
|
||||
@@ -0,0 +1,3 @@
|
||||
cc65's C64 runtime calls $E5B4 (KBDREAD in its cbm_kernal.inc) from cgetc, once the keyboard
|
||||
buffer holds a key, and takes the key from A; so does every cc65 program that reads a key,
|
||||
Contiki's among them.
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Well-known Kernal routine, described in:
|
||||
;
|
||||
@@ -96,4 +99,6 @@ scnkey_toggle_if_needed: ; entry for SCNKEY (TWW/CTR version)
|
||||
sta VIC_YMCSB
|
||||
@1:
|
||||
rts
|
||||
}
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -4,6 +4,9 @@
|
||||
;; #LAYOUT# M65 KERNAL_C #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Keyboard matrix, based on
|
||||
;
|
||||
@@ -93,3 +96,5 @@ __kb_matrix_ctrl:
|
||||
!byte $90,$06,$00,$05,$00,$00,$11,$00
|
||||
!byte $00,$00,$00,$84,$00,$00,$00,$1B
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Extended keyboard matrix for Commodore 128 keyboards, based on
|
||||
;
|
||||
@@ -29,3 +32,5 @@ kb_matrix_128_bucky_filter:
|
||||
!byte %00000000
|
||||
!byte %10000001 ; ALT, NO_SCRL
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Matrix ids of keys which should be repeated regardless of RPTFLG
|
||||
;
|
||||
@@ -25,3 +28,5 @@ __kb_matrix_alwaysrepeat_end:
|
||||
|
||||
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Matrix for retrieving bucky key status on the C64 keyboard
|
||||
;
|
||||
@@ -63,3 +66,5 @@ kb_matrix_bucky_shflag: ; mask to be ORed to SHFLAG to mark key status
|
||||
!byte KEY_FLAG_ALT
|
||||
!byte KEY_FLAG_NO_SCRL
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Matrix for filtering out bucky keys while scanning the C64 keyboard
|
||||
;
|
||||
@@ -23,3 +26,5 @@ kb_matrix_bucky_filter:
|
||||
!byte %00000000
|
||||
!byte %00010000 ; SHIFT (right)
|
||||
!byte %00100100 ; VENDOR + CONTROL
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Matrix for retrieving C64 joystick status and inject is as keyboard event
|
||||
;
|
||||
@@ -40,3 +43,5 @@ kb_matrix_joy_keytab_hi:
|
||||
!byte >__kb_matrix_normal ; right
|
||||
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -4,6 +4,9 @@
|
||||
;; #LAYOUT# M65 KERNAL_C #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Helper table for determining keyboard matrix decoding table on the C64 keyboard
|
||||
;
|
||||
@@ -49,3 +52,5 @@ kb_matrix_lookup:
|
||||
!word $0000 ; %1.110 VENDOR+CTRL
|
||||
!word $0000 ; %1.111 SHIFT+VENDOR+CTRL
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Single row key codes for scanning the C64 keyboard
|
||||
;
|
||||
@@ -25,3 +28,5 @@ kb_matrix_row_keys:
|
||||
!byte %11011111
|
||||
!byte %10111111
|
||||
!byte %01111111
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Helper values to quickly determine row offset from the start of keyboard matrix
|
||||
;
|
||||
@@ -20,3 +23,5 @@ kb_matrix_row_offsets:
|
||||
!byte 5*8
|
||||
!byte 6*8
|
||||
!byte 7*8
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Helper routine - disconnects the keyboard from CIA1_PRB,
|
||||
; leaves $FF in .X (behavior needed in some places)
|
||||
@@ -18,3 +21,5 @@ keyboard_disconnect:
|
||||
}
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Official Kernal routine, described in:
|
||||
;
|
||||
@@ -431,3 +434,5 @@ scnkey_buffer_full:
|
||||
sta KOUNT
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Keyboard scanning routine extension for C128 keyboards
|
||||
;
|
||||
@@ -67,3 +70,5 @@ scnkey_128_no_keys:
|
||||
|
||||
jmp scnkey_no_keys ; pass controll to original routine
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
; Short helper jump-via-vector routine, to set the keyboard matrix
|
||||
|
||||
!ifndef HAS_OPCODES_65CE02 {
|
||||
@@ -11,3 +14,5 @@ scnkey_via_keylog:
|
||||
|
||||
jmp (KEYLOG)
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Keyboard part of the CHRIN routine
|
||||
;
|
||||
@@ -167,3 +170,5 @@ chrkn_keyboard_not_enter:
|
||||
jsr CHROUT
|
||||
jsr pop_keyboard_buffer
|
||||
+bra chrin_keyboard_read
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Keyboard part of the CHRIN routine - programmable keys support
|
||||
; Output: if Carry clear, programmable key was handled
|
||||
@@ -50,3 +53,5 @@ chrin_programmable_keys:
|
||||
rts
|
||||
|
||||
} ; CONFIG_PROGRAMMABLE_KEYS
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - screen support (character output)
|
||||
;
|
||||
@@ -99,3 +102,5 @@ chrout_screen_done:
|
||||
|
||||
jsr cursor_show_if_enabled
|
||||
jmp chrout_done_success
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CLR key handling within CHROUT
|
||||
;
|
||||
@@ -12,3 +15,5 @@ chrout_screen_CLR:
|
||||
|
||||
jsr clear_screen
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - screen support, control codes
|
||||
;
|
||||
@@ -70,3 +73,5 @@ chrout_try_color_loop:
|
||||
|
||||
; Unknown code, or key not requiring any handling
|
||||
jmp chrout_screen_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Cursor keys handling within CHROUT
|
||||
;
|
||||
@@ -61,3 +64,5 @@ chrout_screen_CRSR_LEFT:
|
||||
lda #39
|
||||
sta PNTR
|
||||
bne chrout_screen_CRSR_done ; branch always
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - screen support, DEL key handling
|
||||
;
|
||||
@@ -120,3 +123,5 @@ chrout_screen_del_column_0:
|
||||
|
||||
; Finish with recalculating all the variables
|
||||
bne chrout_screen_del_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; GFX/TXT mode switch handling within CHROUT
|
||||
;
|
||||
@@ -25,3 +28,5 @@ chrout_screen_TXT:
|
||||
lda VIC_YMCSB
|
||||
ora #$02 ; to lower case
|
||||
bne chrout_screen_GFX_TXT_end ; branch always
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; HOME key handling within CHROUT
|
||||
;
|
||||
@@ -12,3 +15,5 @@ chrout_screen_HOME:
|
||||
|
||||
jsr cursor_home
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - screen support, INS key handling
|
||||
;
|
||||
@@ -95,3 +98,5 @@ chrout_screen_ins_copy_loop:
|
||||
|
||||
; Return from loop
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Jumptable for screen control codes support. To improve performance, should be sorted
|
||||
; starting from the least probable routine.
|
||||
@@ -111,3 +114,5 @@ chrout_screen_jumptable:
|
||||
!word chrout_screen_RETURN
|
||||
!word chrout_screen_RETURN
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - screen support, control codes in quote mode
|
||||
;
|
||||
@@ -22,3 +25,5 @@ chrout_screen_quote:
|
||||
adc #$BF ; C=1, so adding $BF + C = add $C0
|
||||
@1:
|
||||
jmp chrout_screen_literal
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; RETURN key handling within CHROUT
|
||||
;
|
||||
@@ -31,3 +34,5 @@ chrout_screen_RETURN:
|
||||
jsr screen_calculate_PNT_USER
|
||||
@1:
|
||||
jmp screen_advance_to_next_line
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; RVS ON/OFF handling within CHROUT
|
||||
;
|
||||
@@ -21,3 +24,5 @@ chrout_screen_RVS_OFF:
|
||||
|
||||
sta RVS
|
||||
jmp chrout_screen_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; SHIFT ON/OFF handling within CHROUT
|
||||
;
|
||||
@@ -21,3 +24,5 @@ chrout_screen_SHIFT_OFF:
|
||||
|
||||
sta MODE
|
||||
jmp chrout_screen_done
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; STOP key handling within CHROUT
|
||||
;
|
||||
@@ -18,3 +21,5 @@ chrout_screen_STOP:
|
||||
sta INSRT
|
||||
jmp chrout_screen_done
|
||||
}
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -2,6 +2,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; CHROUT routine - convert PETSCII to screen code
|
||||
;
|
||||
@@ -9,14 +12,18 @@
|
||||
|
||||
chrout_to_screen_code:
|
||||
|
||||
; Codes $C0-$DF become $40-$5F
|
||||
cmp #$E0
|
||||
bcs @1
|
||||
; Codes $C0-$FE become $40-$7E, and $FF (pi) becomes $5E, as $DE does
|
||||
; (C64 PRG p380-381)
|
||||
cmp #$FF
|
||||
beq @pi
|
||||
cmp #$C0
|
||||
bcc @1
|
||||
|
||||
and #$7F
|
||||
rts ; not high char
|
||||
@pi:
|
||||
lda #$5E
|
||||
rts
|
||||
@1:
|
||||
; Range $20-$3F is unchanged
|
||||
cmp #$40
|
||||
@@ -46,3 +53,5 @@ chrout_to_screen_code:
|
||||
@done:
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Variables used:
|
||||
; - BLNSW (cursor blink switch)
|
||||
@@ -101,3 +104,5 @@ cursor_timer_reset:
|
||||
cursor_blink_end:
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Variables used:
|
||||
; - BLNSW (cursor blink switch)
|
||||
@@ -15,3 +18,5 @@ cursor_enable:
|
||||
sta BLNSW
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Variables used:
|
||||
; - BLNSW (cursor blink switch)
|
||||
@@ -35,3 +38,5 @@ cursor_show:
|
||||
cursor_show_done:
|
||||
|
||||
rts
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Init screen at reset
|
||||
;
|
||||
@@ -19,3 +22,5 @@ init_screen:
|
||||
|
||||
sta $0286
|
||||
jmp clear_screen
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
@@ -3,6 +3,9 @@
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
|
||||
!ifndef CONFIG_ARNITECH_BLADE {
|
||||
|
||||
;
|
||||
; Clear screen and initialise line link table, described in:
|
||||
;
|
||||
@@ -39,3 +42,5 @@ clear_screen:
|
||||
|
||||
; Fall to cursor home routine
|
||||
jmp cursor_home
|
||||
|
||||
} ; CONFIG_ARNITECH_BLADE
|
||||
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user