Compare commits

...
39 Commits
Author SHA1 Message Date
chris 81ab3b41e1 fix(arnitech): INS in insert mode opens another space
In the spaces INS opened the Terminal driver sent INS to Literal, which
drew it as a glyph. On a C64 the INST key "inserts spaces normally" in
insert mode and shows as a reverse character only in quote mode
(Programmer's Reference Guide, the screen editor, p. 96), so INS now
goes to Output there and counts INSRT up when it opened a space.
2026-10-18 12:05:12 +02:00
chris 86d6dd0916 docs(arnitech): the network entries find the chip by its PacketPage Pointer too 2026-10-18 10:13:21 +02:00
chris d42102d039 docs(arnitech): ARNI_FINDCARD lists the Terminal Card, type $04 2026-10-18 10:13:21 +02:00
chris e8870b4c6c docs(arnitech): the controller's code is in the mc64blade build too
ARNITECH_CONTROLLER is on in mc64 and mc64blade, so the headers of the
controller's, the TOD's, and the network's code, the jump table's, and
CONFIG.md no longer say mc64 only.
2026-10-18 10:13:13 +02:00
chris ea0c8bc9ba style(init): mark the end of the reset's ARNITECH_BLADE block 2026-10-18 10:12:18 +02:00
chris 1a6c821cfa fix(arnitech): the network entries also check the PacketPage Pointer
Without a chip the RR-Net's ports read the floating bus, which can read like
the Product ID by chance. The probe now also reads back the PacketPage
Pointer it set to $0000: on a CS8900A its bits C-E always read 011b
(DS271F5 4.10.5), so the high byte reads $30. Seven bytes.
2026-10-18 10:04:44 +02:00
chris 05e4b67858 fix(arnitech): NET_SEND writes the chip's data port with plain stores
The copy loop wrote each byte with STA RRNET_RX_TX_DATA,X, and an indexed
store reads its address first. Reads of RxTxData take the bytes of a received
frame (AN181), so on a real CS8900A each byte sent took one of a frame the
program had started reading. The loop now stores to the port's low or high
byte by address, as ip65's and Contiki's drivers do; reads stay indexed, which
read once.
2026-10-18 10:04:40 +02:00
chris 0838c4e310 docs: the ARNITECH_BLADE option and the mc64blade configuration 2026-10-18 08:57:01 +02:00
chris 9ad7e292f8 feat(arnitech): a Blade autoboots the first program on device 8
With ARNITECH_BLADE, BASIC's cold start calls blade_autoboot before READY.: it
loads "*" from device 8 to BASIC's start, as LOAD"*",8 does, and BASIC then
ends that LOAD as a program's, which RUNs what it loaded. RUN/STOP held on the
Terminal Card, no Floppy, or no file goes on to READY.
2026-10-18 08:57:01 +02:00
chris b1fbc1c693 feat(init): no Cartridge or VIC-II at a Blade's reset and NMI
A Blade has no expansion port for Cartridges and no VIC-II: with
ARNITECH_BLADE the reset neither looks for a Cartridge nor blanks the screen,
and the NMI handler looks for no Cartridge.
2026-10-18 08:57:01 +02:00
chris f809b9b7ea feat(arnitech): the Terminal Card is a Blade's screen and keyboard
With ARNITECH_BLADE the screen editor, the keyboard matrix scan, and the VIC-II
set-up are left out, and devices 3 and 0 are the Terminal Card the Arnitech
controller finds by its type, $04. CHROUT writes each byte to its Output, or
to its Literal while quote or insert mode is on, keeping QTSW and INSRT as the
screen editor does. CHRIN marks where input starts, echoes the keys typed, and
on RETURN has the Card take the logical line under the cursor and reads it
back. SCNKEY moves the Card's keys into the keyboard buffer up to XMAX, UDTIM
sets STKEY from its RUN/STOP, SCREEN answers 80x25, PLOT moves and reads its
cursor, and CINT resets it and puts the native-mode vectors in place. With no
Terminal Card, bytes printed go nowhere and no key comes.
2026-10-18 08:57:01 +02:00
chris b7fef8abe6 feat(arnitech): handlers for a 65816's native-mode interrupts on a Blade
A Blade reads the 65816's native-mode vectors from the RAM under the KERNAL
at $FFE4-$FFEF. native_vectors_init puts handlers' addresses there: IRQ and
NMI save A, X, and Y at full width, the direct page, and the data bank, push
the frame an emulation-mode interrupt makes, and run the KERNAL's handlers
through CINV and NMINV in 8-bit native mode, whose RTI comes back to restore
everything. BRK, COP, and ABORT go to the BRK handler, which on a Blade first
sets the direct page and data bank to 0 and returns to emulation mode.
2026-10-18 08:57:01 +02:00
chris 90b921ac5e feat(init): a Blade is PAL without detecting it
With ARNITECH_BLADE, setup_pal_ntsc skips the raster wait that tells PAL from
NTSC, which would hang with no VIC-II, and sets PAL: a Blade runs at the PAL
C64's clock.
2026-10-18 08:57:01 +02:00
chris 80fb110391 feat(iec): on a Blade the 1 ms wait counts on CIA1's timer B
A Blade has no VIC-II whose raster lines iec_wait1ms could count, so with
ARNITECH_BLADE it runs CIA1's timer B, which only the tape used, once for 1024
cycles, and waits for its START bit to clear. Its ICR flag would not do, as
the IRQ handler's read of the ICR clears it.
2026-10-18 08:57:01 +02:00
chris 9f922287c6 feat(config): the mc64blade configuration and its Makefile targets
The Blade Firmware of arnitech's Blades: the mc64 configuration with its own
ID ($6E), the brand "MC64 BLADE", and no tape, programmable keys, joystick
cursor, panic screen, or feature list. Its new ARNITECH_BLADE option does
nothing yet. The targets build/kernal_mc64blade.rom and
build/basic_mc64blade.rom are made the same way as mc64's.
2026-10-18 08:35:45 +02:00
chris f1ade3b7d3 docs(notice): list the IEC IRQ fix 2026-10-18 08:16:40 +02:00
chris b4f334bbbf fix(iec): disable IRQs before releasing CLK to send a byte
iec_tx_byte and iec_tx_command released CLK and only then disabled IRQs. An
IRQ in between took about 500 cycles, longer than a listener's EOI wait and
acknowledgement, so the talker waited for an acknowledgement that had come and
gone, and a LOAD over the bus hung after its file name. Which byte an IRQ hit
depended on where the build placed the code.
2026-10-18 08:16:40 +02:00
chris 93c4932309 docs(notice): list the changes of 2026-10-18 2026-10-18 07:37:45 +02:00
chris 5fc29014f4 docs(config): ARNITECH_CONTROLLER also covers the network entries 2026-10-18 07:37:45 +02:00
chris 1aaed55bc7 feat(arnitech): network entries NET_INIT, NET_MAC, NET_SEND, NET_RECV at $FF0C-$FF15
Version 2 of the Arnitech jump table, with 6 entries: whole Ethernet frames
through the CS8900A at the RR-Net socket (arnitech's ADR 0027), found by its
Product ID and polled, from the CS8900A datasheet's PacketPage registers and
its 8-bit mode. NET_INIT resets the chip and turns on receiving its own and
broadcast frames and sending; NET_MAC copies the Individual Address; NET_SEND
bids and writes a frame; NET_RECV copies the oldest frame received, or drops
one longer than the buffer with Skip_1. Carry is the result, with an error
code in A, and the pointer and count go in SAL and EAL.
2026-10-18 07:36:43 +02:00
chris aa39286d9d fix(wedge): print a DOS command's status, not the OK after closing it
@<command> closed every file before it read the status, and a drive says
00, OK once its command channel closes, so @S: never showed FILES SCRATCHED.
It now reads the status through the channel it sent the command on.
2026-10-18 07:27:18 +02:00
chris 18520d8dc0 feat(config): the DOS wedge on in mc64, the transcendental functions off
The wedge's @, @$, and @<command> read the error channel, list a directory,
and send DOS commands from direct mode, so the F-keys' @8$-style commands work.
BASIC has room for it only without the transcendental functions, which stay
?NOT IMPLEMENTED until BASIC evaluates functions at all.
2026-10-18 07:27:18 +02:00
chris a45f63e34e feat(kernal): $E5B4, $EA24, and $ECF0 at their well-known addresses
cc65's C64 runtime and ip65 call past the jump table: $E5B4 takes the first
key from the keyboard buffer (cgetc), $EA24 points USER at the colour RAM of
PNT's line (cursor positioning), and $ECF0 holds the low bytes of the screen
lines' addresses (ip65's VT100 code), as Mapping the Commodore 64 describes
them. vicii_init's work moves out of $E5A0-$E5C8 to free $E5B4, and on the
standard layout PNT and USER are worked out through the routine at $EA24.
2026-10-18 07:24:08 +02:00
chris ec4dc7df62 fix(screen): CHROUT prints PETSCII $E0-$FF as screen codes $60-$7E and pi
PETSCII $E0-$FE became the reverse screen codes $A0-$BE. A C64 prints them as
$60-$7E, as it does $A0-$BE, and $FF, pi, as $5E, as it does $DE (C64
Programmer's Reference Guide, appendices B and C).
2026-10-18 07:20:45 +02:00
chris e9a64fb7a8 fix(chargen): draw the '#' of the upper case and graphics set
Screen code 35 was blank in the first character set, and its reverse (163)
was not its inverse. It now has the second set's '#', whose reverse the
first set already held, as both sets of a C64 share screen codes 32-63.
2026-10-18 07:20:45 +02:00
chris b4b48b195d NOTICE: list the Arnitech controller option 2026-10-17 02:17:45 +02:00
chris 03e2d4a4b8 Arnitech controller: the TOD set at boot, and a jump table at $FF00
A new option, ARNITECH_CONTROLLER, on in the mc64 configuration only.
IOINIT starts timer A with CIA #1's TOD on 50 Hz, the mc64's mains, and
if the Arnitech controller's signature "ARNI" is at $DE80, latches its
clock and copies its real time into the TOD, hours first and tenths
last, flipping bit 7 of an hour of 12 first, since the CIA flips it
back when 12 is written. Without the signature the TOD is left alone.

The Arnitech jump table at $FF00: "ARNI", version $01, two entries, and
JMPs from $FF06: $FF06 finds the first Card slot holding a Card of the
type in A (carry clear, the slot in A, its Card window's low byte in
X; carry set if none or no controller), $FF09 sets the TOD as IOINIT
does. $FF48-$FF80 stay clear. The code is in new files under
src/kernal/arnitech; other configurations build as before.
2026-10-17 02:17:45 +02:00
chris 0ec343a727 NOTICE: list the serial-bus fixes that leave the bus released 2026-10-15 14:21:36 +02:00
chris 729a410079 Serial bus: UNLSN, UNTLK, and a missing device leave the bus released
UNLSN ended through iec_set_idle, which pulls CLK, so the C64 kept
holding CLK after UNLISTEN. UNTLK waited for the talker to pull CLK,
which no device does after UNTALK, timed out, and left CLK pulled with
carry set. And a serial routine that found no device also left CLK
pulled. A fastloader that waits for the drive to pull CLK after the
KERNAL's UNLSN (Turrican's) then went on too early.

The contract (Michael Steil, "Commodore Peripheral Bus: Part 4",
https://www.pagetable.com/?p=1135): at the end of a transmission the
sender releases CLK and the receivers release DATA, so the bus is idle
again, and the controller releases ATN after each command; after
UNTALK "the current talker will then release the bus" (Part 2,
https://www.pagetable.com/?p=1031). UNLSN and UNTLK now share their end
and release CLK and DATA; the device-not-present exit releases ATN, CLK,
and DATA. Commodore's ROMs leave the same lines in the same scenarios,
as differential tests in arnitech show.

Not reported upstream (https://github.com/MEGA65/open-roms).
2026-10-15 14:21:36 +02:00
chris 7ee9d164e2 NOTICE: list the CLOSE fix for a device that does not answer 2026-10-15 02:50:48 +02:00
chris 51a2a43520 CLOSE: a device that does not answer sets ST to device not present
When LISTEN or the CLOSE command found no device on the serial bus,
close_iec freed the file number but left ST as it was, so READST after
the CLOSE said 0.

The contract: every device on the bus must answer ATN by pulling DATA,
and when none does the result is DEVICE NOT PRESENT (Michael Steil,
"Commodore Peripheral Bus: Part 2", https://www.pagetable.com/?p=1031);
the C64 Programmer's Reference Guide's READST reports that as ST bit 7
($80). close_iec now sets that bit when LISTEN or the CLOSE command
fails, and still frees the file number. Commodore's ROMs give the same
ST in the same scenario, as a differential test in arnitech shows.

Not reported upstream (https://github.com/MEGA65/open-roms).
2026-10-15 02:50:48 +02:00
chris ec7707d4cc NOTICE: list the serial-bus fix for a byte with no listener 2026-10-15 02:32:03 +02:00
chris 74ef17d292 Serial bus: a data byte with no listener says DEVICE NOT PRESENT
iec_tx_byte never checked that anyone was listening. With no listener,
DATA stays released, so the wait for listeners to be ready returned at
once, and a byte sent with EOI then waited forever for an EOI
acknowledgement that never came. UNLSN, which sends the byte CIOUT holds
back with EOI, hung the C64 after CHKOUT to a channel the drive refuses
(DOS 2.6 leaves the bus when no write channel is open), or to a channel
a CLOSE 15 has closed.

The contract (Michael Steil, "Commodore Peripheral Bus: Part 4",
https://www.pagetable.com/?p=1135): a listener holds DATA until the
talker releases CLK; if at the beginning of a byte no receiver pulls
DATA within 256 us, that is a DEVICE NOT PRESENT error. The C64
Programmer's Reference Guide's READST gives it as ST bit 7 ($80).
iec_tx_byte now waits up to about 256 us for DATA to be pulled, and
without it sets ST $80 and returns with DEVICE NOT PRESENT. Commodore's
ROMs give the same ST in the same scenarios, as a differential test in
arnitech shows.

Not reported upstream (https://github.com/MEGA65/open-roms).
2026-10-15 02:31:56 +02:00
chris b95a6ff057 NOTICE: list the serial-bus fixes of 2026-10-15
CIOUT's buffer, CLOSE's LISTEN/CLOSE/UNLISTEN, CHKIN's and CHKOUT's
secondary address, and TKSA's secondary address.
2026-10-15 02:19:08 +02:00
chris f1df180bf8 TKSA: send the secondary address the caller gives
TKSA ORed the accumulator with $90 before sending it. Its callers pass
the secondary address plus $60, as the routine's own comment asks, so
TKSA turned a TALK secondary address $60-$6F into $F0-$FF, the OPEN
command, on the bus.

The contract (C64 Programmer's Reference Guide, TKSA; Michael Steil,
"Commodore Peripheral Bus: Part 2", https://www.pagetable.com/?p=1031,
which gives TKSA's argument as A = $60 + secondary address): TKSA sends
the byte in A as the secondary address to the device told to TALK.
TKSA now sends A as it is.

Upstream: https://github.com/MEGA65/open-roms/issues/116 (bug 1)
2026-10-15 02:18:55 +02:00
chris 340bbefd06 CHKIN, CHKOUT: address the channel by the file's secondary address
chkin_iec and ckout_iec read the secondary address from LAT, the table
of logical file numbers, instead of SAT, the table of secondary
addresses. A file whose number differed from its secondary address,
such as OPEN 3,8,2, was read from or written to the wrong channel, and
the read-only and write-only checks tested the file number.

The contract (Michael Steil, "Commodore Peripheral Bus: Part 2",
https://www.pagetable.com/?p=1031): CHKIN sends TALK and CHKOUT sends
LISTEN, each followed by the secondary address OPEN was given; Compute!'s
Mapping the Commodore 64 (p. 52) keeps the logical file numbers at
$0259 (LAT) and the secondary addresses at $026D (SAT). Both routines
now read SAT.

Not reported upstream (https://github.com/MEGA65/open-roms); it may be
what upstream issue #117's OPEN 1,8,0,"$" test met:
https://github.com/MEGA65/open-roms/issues/117
2026-10-15 02:17:03 +02:00
chris 29124377fc CLOSE: send LISTEN, CLOSE, UNLISTEN to a serial device
close_iec sent its CLOSE command under ATN without first addressing the
device with LISTEN and without UNLISTEN after it, and built the command
with ORA $E0 (zero page) instead of ORA #$E0, so the byte it sent was
the secondary address ORed with whatever $E0 held. The drive never
learned of the CLOSE, so a file written on a channel was never written
to the disk.

The contract (Michael Steil, "Commodore Peripheral Bus: Part 2",
https://www.pagetable.com/?p=1031): CLOSE of a file on a serial device
sends LISTEN, then $E0 plus the secondary address, then UNLISTEN.
close_iec now does that, as iec_close_load already does for LOAD.

Not reported upstream (https://github.com/MEGA65/open-roms).
2026-10-15 02:15:38 +02:00
chris 264e9792a5 CIOUT: buffer the byte where iec_tx_byte sends it from
CIOUT kept the byte to send next in BSOUR ($95), but iec_tx_byte, which
CIOUT and iec_tx_flush (called by UNLSN, UNTLK, LISTEN, TALK) use to
send it, transmits TBTCNT ($A4). So every byte CHROUT sent to a serial
device was whatever TBTCNT held, and a file written with CHKOUT and
CHROUT held the wrong bytes.

The contract (C64 Programmer's Reference Guide, CIOUT): CIOUT sends a
byte to the listening device, always holding one back so that the last
byte goes with EOI when UNLSN ends the transfer. CIOUT now buffers the
byte in TBTCNT, the one-line fix of upstream PR #113; changing the send
path to read BSOUR would also move LOAD's and SAVE's bytes.

Upstream: https://github.com/MEGA65/open-roms/pull/113
2026-10-15 02:15:38 +02:00
chris 840c5f1b61 Add the mc64 configuration, the Firmware of arnitech's mc64
A copy of the c64 configuration with its own ID ($6D), the brand "MC64",
and BCD_SAFE_INTERRUPTS off, plus its Makefile targets
build/kernal_mc64.rom and build/basic_mc64.rom, made the same way as the
c64 ones. NOTICE says who modified the fork, when, and what changed.
2026-10-14 18:32:24 +02:00
103 changed files with 2000 additions and 71 deletions

No files matched your search

+12
View File
@@ -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`
+41
View File
@@ -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 \
@@ -137,6 +138,8 @@ 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
@@ -151,6 +154,8 @@ DIR_X16 = build/target_cx16
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
@@ -164,6 +169,8 @@ CFG_U64CRT = src/,,config_ultimate64_crt.s
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
@@ -212,6 +219,8 @@ 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
@@ -221,6 +230,8 @@ 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
@@ -237,6 +248,8 @@ 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)
@@ -249,6 +262,8 @@ 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) \
@@ -385,6 +400,10 @@ $(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: \
@@ -398,6 +417,10 @@ $(DIR_CUS)/OUTK_x.BIN $(DIR_CUS)/KERNAL_combined.vs $(DIR_CUS)/KERNAL_combined.s
$(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: \
@@ -457,6 +480,8 @@ $(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_comb
$(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
@@ -468,6 +493,8 @@ $(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
@@ -475,6 +502,8 @@ $(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
@@ -482,6 +511,8 @@ $(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
@@ -499,6 +530,14 @@ $(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)
@@ -541,6 +580,8 @@ build/,generated/,z80_tables.s: $(TOOL_GENERATE_Z80_TABLES)
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)
+73
View File
@@ -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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

+135
View File
@@ -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
+137
View File
@@ -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
+64
View File
@@ -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
}
+2
View File
@@ -33,6 +33,8 @@
;; #ALIAS# SELDEV = KERNAL_0.SELDEV
;; #ALIAS# blade_autoboot = KERNAL_0.blade_autoboot
;
; MEGA65 specific parts
;
@@ -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
+8 -3
View File
@@ -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
+40
View File
@@ -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 ; "*"
}
+64
View File
@@ -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
}
+106
View File
@@ -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
}
+308
View File
@@ -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
}
+261
View File
@@ -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
}
+58
View File
@@ -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
}
+2 -2
View File
@@ -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
+3 -2
View File
@@ -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:
+2 -2
View File
@@ -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
+14 -2
View File
@@ -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
+2 -2
View File
@@ -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
+20 -5
View File
@@ -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
+3
View File
@@ -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
+24
View File
@@ -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
-2
View File
@@ -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 {
+9 -1
View File
@@ -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 {
+3 -2
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+8 -37
View File
@@ -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
+3
View File
@@ -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
+10
View File
@@ -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
+4
View File
@@ -13,5 +13,9 @@
CINT:
!ifndef CONFIG_ARNITECH_BLADE {
jsr cint_legacy
jmp setup_pal_ntsc
} else {
jmp cint_terminal
}
+4
View File
@@ -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:
+56
View File
@@ -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
+27
View File
@@ -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
+4
View File
@@ -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
+4
View File
@@ -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
+3
View File
@@ -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.
+6 -1
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+12 -3
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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
+5
View File
@@ -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 the cursor, described in:
;
@@ -17,3 +20,5 @@ cursor_home:
sta TBLX ; current row
; FALLTROUGH to the next routine
} ; 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 {
;
; Set pointer (PNT) to current screen line , described in:
;
@@ -23,3 +26,5 @@ screen_calculate_pointers:
jsr screen_calculate_PNT_USER
jmp screen_calculate_PNTR_LNMX
} ; 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 {
;
; Scroll the whole screen up by 1 logical line, described in:
;
@@ -130,3 +133,5 @@ screen_scroll_up_loop_done:
; Recalculate PNT and USER
jmp screen_calculate_PNT_USER
} ; 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 {
;
; Well-known routine, described in:
;
@@ -36,3 +39,5 @@ screen_clear_line:
; Done
rts
} ; CONFIG_ARNITECH_BLADE
+2
View File
@@ -0,0 +1,2 @@
cc65's C64 runtime calls $EA24 (UPDCRAMPTR in its cbm_kernal.inc) after PLOT has set the cursor,
for USER to follow PNT, before it stores a character's colour through USER.
@@ -0,0 +1,29 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal routine, described in:
;
; - [CM64] Computes Mapping the Commodore 64 - $EA24
;
; Sets USER to the colour RAM location of PNT's screen line. Screen RAM starts on a
; kilobyte boundary, as the VIC-II fetches it, so the line's place within its kilobyte
; is its place in the colour RAM.
;
screen_calculate_USER:
lda PNT+0
sta USER+0
lda PNT+1
and #$03
ora #>COLOR_RAM
sta USER+1
rts
} ; CONFIG_ARNITECH_BLADE
+2
View File
@@ -0,0 +1,2 @@
ip65's VT100 emulation (drivers/c64vt100.s) reads the low byte of a screen line's address from
$ECF0, indexed by the line number.
@@ -0,0 +1,22 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal table, described in:
;
; - [CM64] Computes Mapping the Commodore 64 - $ECF0
;
; The low bytes of the 25 screen lines' addresses, 40 bytes apart
;
screen_line_lo_bytes:
!for line, 0, 24 {
!byte <(line * 40)
}
} ; CONFIG_ARNITECH_BLADE
+6 -1
View File
@@ -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 {
;
; Official Kernal routine, described in:
;
@@ -50,4 +53,6 @@ SCREEN:
pla
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 {
screen_advance_to_next_line:
@@ -21,3 +24,5 @@ screen_advance_to_next_line:
sta PNTR
jmp chrout_screen_calc_lptr_done
} ; CONFIG_ARNITECH_BLADE
+13 -2
View File
@@ -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 {
;
; Set pointers PNT and USER to current screen line
;
@@ -26,7 +29,7 @@ screen_calculate_PNT_USER_from_X: ; entry point for screen_clear_line
; Add 40 to PNT for every line
cpx #$00
beq screen_calculate_USER
beq @3
@1:
lda #40
clc
@@ -37,8 +40,13 @@ screen_calculate_PNT_USER_from_X: ; entry point for screen_clear_line
@2:
dex
bne @1
@3:
; FALLTROUGH
!ifdef ROM_LAYOUT_STD {
jmp screen_calculate_USER ; at its well-known address, $EA24
} else {
screen_calculate_USER:
@@ -54,3 +62,6 @@ screen_calculate_USER:
sta USER+1
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 {
;
; Sets PNTR in a proper range (0-39 or 40-79)
; Sets LNMX to 39 or 79
@@ -62,3 +65,5 @@ screen_calculate_lnmx_79:
lda #79
sta LNMX
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 {
screen_check_space_ends_line:
@@ -12,3 +15,5 @@ screen_check_space_ends_line:
cmp #$20
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 {
;
; Helper routine - check character in .A, toggles quote flag if needed
;
@@ -19,3 +22,5 @@ screen_check_toggle_quote:
lda #$22 ; restore previous .A valuee
@1:
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 {
;
; Screen code to PETSCII conversion - see:
;
@@ -70,3 +73,5 @@ s2p_adc_C0:
adc #$C0 ; Carry already clear
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 {
;
; Get PNTR value clipped to 0-39 range in .Y, sets flags to compare with 0, can trash .A
;
@@ -18,3 +21,5 @@ screen_get_clipped_PNTR:
@1:
cpy #$00
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 {
screen_get_logical_line_end_ptr:
@@ -27,3 +30,5 @@ screen_get_logical_line_end_39:
ldy #39
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 {
screen_grow_logical_line_done_scroll:
@@ -142,3 +145,5 @@ screen_grow_logical_line_copy_done:
inx
jsr screen_clear_line
jmp screen_calculate_PNTR_LNMX
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -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 {
;
; Helper routine to blank screen
;
@@ -31,3 +34,5 @@ screen_off:
rts
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -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 {
;
; Helper routine to show screen
;
@@ -22,3 +25,5 @@ screen_on:
rts
}
} ; CONFIG_ARNITECH_BLADE
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff. Show more