;; #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 }