various I/O updates

This commit is contained in:
FeralChild64 committed 2019-10-31 17:16:32 +01:00
1 parent bdcebb554f
commit c03c7abf45
11 files changed
+263 -15

No files matched your search

+1 -1
View File
@@ -132,7 +132,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen support, keyboard does not preserve .Y |
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
| `$FFD5` | `$F49E` | `LOAD` | DONE | |
| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support for memory model 60k |
| `($0330)` | `$F4A5` | `LOAD` | DONE | |
| `$FFD8` | `$F5DD` | `SAVE` | DONE | main routine not done yet |
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
| `$FFDB` | | `SETTIM` | DONE | |
+10 -6
View File
@@ -99,7 +99,11 @@
.label PTR1 = $9E // -- NOT IMPLEMENTED --
.label PTR2 = $9F // -- NOT IMPLEMENTED --
.label TIME = $A0 // $A0-$A2 jiffy clock
#if !CONFIG_IEC_JIFFYDOS
.label TSFCNT = $A3 // temporary variable for tape and IEC, [!] our usage probably differs in details
#else
.label IECPROTO = $A3 // [!] (WIP) 0 = normal, 1 = JiffyDOS, 0xFF = unknown
#endif
.label TBTCNT = $A4 // temporary variable for tape and IEC, [!] our usage probably differs in details
.label CNTDN = $A5 // -- NOT IMPLEMENTED --
.label BUFPNT = $A6 // -- NOT IMPLEMENTED --
@@ -154,8 +158,8 @@
.label LDTBL = $D9 // $D9-$F2 screen line link table, [!] our usage is different XXX give more details
.label USER = $F3 // $F3-$F4 pointer to current color RAM location
.label KEYTAB = $F5 // $F5-$F6 pointer to keyboard lookup table
.label RIBUF = $F7 // $F7-$F8 -- NOT IMPLEMENTED -- XXX WIP
.label ROBUF = $F9 // $F9-$FA -- NOT IMPLEMENTED -- XXX WIP
.label RIBUF = $F7 // $F7-$F8 -- NOT IMPLEMENTED -- (WIP)
.label ROBUF = $F9 // $F9-$FA -- NOT IMPLEMENTED -- (WIP)
// $FB $FB-$FE -- UNUSED -- free for user software
.label BASZPT = $FF // -- NOT IMPLEMENTED --
@@ -202,10 +206,10 @@
.label BITNUM = $298 // -- NOT IMPLEMENTED --
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
#endif
.label RIDBE = $29B // -- NOT IMPLEMENTED -- XXX WIP
.label RIDBS = $29C // -- NOT IMPLEMENTED -- XXX WIP
.label RODBS = $29D // -- NOT IMPLEMENTED -- XXX WIP
.label RODBE = $29E // -- NOT IMPLEMENTED -- XXX WIP
.label RIDBE = $29B // -- NOT IMPLEMENTED -- (WIP)
.label RIDBS = $29C // -- NOT IMPLEMENTED -- (WIP)
.label RODBS = $29D // -- NOT IMPLEMENTED -- (WIP)
.label RODBE = $29E // -- NOT IMPLEMENTED -- (WIP)
.label IRQTMP = $29F // $29F-$2A0 -- NOT IMPLEMENTED --
.label ENABL = $2A1 // -- NOT IMPLEMENTED --
.label TODSNS = $2A2 // -- NOT IMPLEMENTED --
+93
View File
@@ -0,0 +1,93 @@
//
// JiffyDOS protocol support for IEC
//
// XXX finish this
#if CONFIG_IEC_JIFFYDOS
iec_tx_byte_jiffydos:
// JiffyDOS timing regime is very strict - before transmitting anything
// we need to disable sprites and (if screen is not disabled) wait for
// appropriate moment, so that no badline interruption can happen
jsr jiffydos_hide_sprites
jsr jiffydos_wait_line
__jd_check1:
// XXX send byte
// Re-enable sprites
jsr jiffydos_restore_sprites
rts
iec_rx_byte_jiffydos:
// JiffyDOS timing regime is very strict - before transmitting anything
// we need to disable sprites and (if screen is not disabled) wait for
// appropriate moment, so that no badline interruption can happen
jsr jiffydos_hide_sprites
jsr jiffydos_wait_line
// XXX retrieve byte
// Re-enable sprites
jsr jiffydos_restore_sprites
rts
jiffydos_wait_line:
// XXX if screen not disabled, wait for badline to pass
rts
__jd_check2:
jiffydos_hide_sprites:
// XXX implement
rts
jiffydos_restore_sprites:
// XXX implement
rts
.function SAME_PAGE_CHECK(label_1, label_2)
{
#if !PASS_SIZETEST
return (label_1 - label_1 % 256) == (label_2 - label_2 % 256)
#else
return true
#endif
}
.if (!SAME_PAGE_CHECK(__jd_check1, __jd_check2))
{
// To meet the strict JiffyDOS timing, we need to make sure
// it does not span across multiple pages, as this would add
// 1 cycle to some jump instructions - maybe this wont cause
// problems, but better safe than sorry.
.error "JiffyDOS code can't span across multiple pages"
}
#endif // CONFIG_IEC_JIFFYDOS
+37
View File
@@ -0,0 +1,37 @@
//
// IEC part of the SAVE routine
//
#if CONFIG_IEC
save_iec:
/*
// Display SAVING
// XXX jsr lvs_display_saving
// Call device to LISTEN
lda FA
jsr LISTEN
bcs save_iec_dev_not_found // XXX redirecto to load
// Open channel XXX (reserved for file writing)
lda #XXX
jsr iec_cmd_open
bcs // XXX error
// Send file name
jsr lvs_send_file_name
bcs load_iec_error
// XXX finish the implementation
rts
*/
STUB_IMPLEMENTATION()
#endif // CONFIG_IEC
-1
View File
@@ -16,7 +16,6 @@
// On exit, $YYXX is the highest address into which data
// will have been placed.
// XXX add VERIFY support
LOAD:
+18 -1
View File
@@ -10,4 +10,21 @@
//
SAVE:
STUB_IMPLEMENTATION()
// Reset status
jsr kernalstatus_reset
#if CONFIG_MEMORY_MODEL_60K
// We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
#endif
// Check whether we support the requested device
lda FA
#if CONFIG_IEC
jsr iec_check_devnum_lvs
bcc_far save_iec
#endif
jmp lvs_illegal_device_number
-1
View File
@@ -7,7 +7,6 @@
find_fls:
ldy LDTND
beq find_fls_not_found // table empty
!:
dey
bmi find_fls_not_found // no more entries
+18 -2
View File
@@ -73,16 +73,32 @@ lvs_handle_byte_verify:
#if CONFIG_MEMORY_MODEL_60K
// XXX implement this part
// Store byte for comparing
sta TBTCNT
// Retrieve byte from under ROMs and IO if required
php
sei
ldx #$33
stx $01
ldy #0
lda (STAL),y
ldx #$37
stx $01
plp
// Compare with stored byte
cmp TBTCNT
#else
ldy #0
cmp (STAL),y
beq lvs_handle_byte_load_verify_end
#endif
beq lvs_handle_byte_load_verify_end
sec
rts
+25 -1
View File
@@ -7,9 +7,33 @@
#if HAS_RS232
#if CONFIG_MEMORY_MODEL_60K
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
#endif
close_rs232:
// XXX provide implementation for both UP2400 and UP960
// First check how many RS-232 channels are currently allocated.
// If more than one, skip deallocation (other channels still uses the buffer).
jsr rs232_count_channels
bcs close_rs232_end
// Deallocate buffer
inc MEMSIZK+1
inc MEMSIZK+1
// XXX is this needed? check with original ROM what it actually does
lda #$00
sta ROBUF+0
sta ROBUF+1
sta RIBUF+0
sta RIBUF+1
close_rs232_end:
jmp close_remove_from_table
+33 -2
View File
@@ -7,9 +7,40 @@
#if HAS_RS232
#if CONFIG_MEMORY_MODEL_60K
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
#endif
open_rs232:
// XXX provide implementation for both UP2400 and UP9600
// First check how many RS-232 channels are currently allocated.
// If more than one, skip allocation (already allocated).
jsr rs232_count_channels
bcs open_rs232_end
// Allocate buffer
lda MEMSIZK+0
sta ROBUF+0
sta RIBUF+0
dec MEMSIZK+1
lda MEMSIZK+1
sta ROBUF+1 // XXX RIBUF or ROBUF?
dec MEMSIZK+1
lda MEMSIZK+1
sta RIBUF+1 // XXX RIBUF or ROBUF?
lda #$00
sta RIDBE
sta RIDBS
sta RODBS
sta RODBE
open_rs232_end:
jmp open_done_success
+28
View File
@@ -0,0 +1,28 @@
//
// Sets .X to number of open RS-232 channels
// Sets Carry if more than one is open
#if HAS_RS232
rs232_count_channels:
ldx #$00
ldy LDTND
!:
dey
bmi close_rs232_search_done
lda FAT, y
cmp #$02
bne !-
inx
bpl !- // branch always
cpx #$02
rts
#endif