various I/O updates
This commit is contained in:
1 parent
bdcebb554f
commit
c03c7abf45
11 files changed
+263
-15
No files matched your search
@@ -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 |
|
| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen support, keyboard does not preserve .Y |
|
||||||
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
|
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
|
||||||
| `$FFD5` | `$F49E` | `LOAD` | 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 |
|
| `$FFD8` | `$F5DD` | `SAVE` | DONE | main routine not done yet |
|
||||||
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
|
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
|
||||||
| `$FFDB` | | `SETTIM` | DONE | |
|
| `$FFDB` | | `SETTIM` | DONE | |
|
||||||
|
|||||||
@@ -99,7 +99,11 @@
|
|||||||
.label PTR1 = $9E // -- NOT IMPLEMENTED --
|
.label PTR1 = $9E // -- NOT IMPLEMENTED --
|
||||||
.label PTR2 = $9F // -- NOT IMPLEMENTED --
|
.label PTR2 = $9F // -- NOT IMPLEMENTED --
|
||||||
.label TIME = $A0 // $A0-$A2 jiffy clock
|
.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
|
.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 TBTCNT = $A4 // temporary variable for tape and IEC, [!] our usage probably differs in details
|
||||||
.label CNTDN = $A5 // -- NOT IMPLEMENTED --
|
.label CNTDN = $A5 // -- NOT IMPLEMENTED --
|
||||||
.label BUFPNT = $A6 // -- 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 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 USER = $F3 // $F3-$F4 pointer to current color RAM location
|
||||||
.label KEYTAB = $F5 // $F5-$F6 pointer to keyboard lookup table
|
.label KEYTAB = $F5 // $F5-$F6 pointer to keyboard lookup table
|
||||||
.label RIBUF = $F7 // $F7-$F8 -- NOT IMPLEMENTED -- XXX WIP
|
.label RIBUF = $F7 // $F7-$F8 -- NOT IMPLEMENTED -- (WIP)
|
||||||
.label ROBUF = $F9 // $F9-$FA -- NOT IMPLEMENTED -- XXX WIP
|
.label ROBUF = $F9 // $F9-$FA -- NOT IMPLEMENTED -- (WIP)
|
||||||
// $FB $FB-$FE -- UNUSED -- free for user software
|
// $FB $FB-$FE -- UNUSED -- free for user software
|
||||||
.label BASZPT = $FF // -- NOT IMPLEMENTED --
|
.label BASZPT = $FF // -- NOT IMPLEMENTED --
|
||||||
|
|
||||||
@@ -202,10 +206,10 @@
|
|||||||
.label BITNUM = $298 // -- NOT IMPLEMENTED --
|
.label BITNUM = $298 // -- NOT IMPLEMENTED --
|
||||||
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
|
.label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED --
|
||||||
#endif
|
#endif
|
||||||
.label RIDBE = $29B // -- NOT IMPLEMENTED -- XXX WIP
|
.label RIDBE = $29B // -- NOT IMPLEMENTED -- (WIP)
|
||||||
.label RIDBS = $29C // -- NOT IMPLEMENTED -- XXX WIP
|
.label RIDBS = $29C // -- NOT IMPLEMENTED -- (WIP)
|
||||||
.label RODBS = $29D // -- NOT IMPLEMENTED -- XXX WIP
|
.label RODBS = $29D // -- NOT IMPLEMENTED -- (WIP)
|
||||||
.label RODBE = $29E // -- NOT IMPLEMENTED -- XXX WIP
|
.label RODBE = $29E // -- NOT IMPLEMENTED -- (WIP)
|
||||||
.label IRQTMP = $29F // $29F-$2A0 -- NOT IMPLEMENTED --
|
.label IRQTMP = $29F // $29F-$2A0 -- NOT IMPLEMENTED --
|
||||||
.label ENABL = $2A1 // -- NOT IMPLEMENTED --
|
.label ENABL = $2A1 // -- NOT IMPLEMENTED --
|
||||||
.label TODSNS = $2A2 // -- NOT IMPLEMENTED --
|
.label TODSNS = $2A2 // -- NOT IMPLEMENTED --
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
// On exit, $YYXX is the highest address into which data
|
// On exit, $YYXX is the highest address into which data
|
||||||
// will have been placed.
|
// will have been placed.
|
||||||
|
|
||||||
// XXX add VERIFY support
|
|
||||||
|
|
||||||
LOAD:
|
LOAD:
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,21 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
SAVE:
|
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
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
find_fls:
|
find_fls:
|
||||||
|
|
||||||
ldy LDTND
|
ldy LDTND
|
||||||
beq find_fls_not_found // table empty
|
|
||||||
!:
|
!:
|
||||||
dey
|
dey
|
||||||
bmi find_fls_not_found // no more entries
|
bmi find_fls_not_found // no more entries
|
||||||
|
|||||||
@@ -73,16 +73,32 @@ lvs_handle_byte_verify:
|
|||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
#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
|
#else
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
cmp (STAL),y
|
cmp (STAL),y
|
||||||
beq lvs_handle_byte_load_verify_end
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
beq lvs_handle_byte_load_verify_end
|
||||||
|
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,33 @@
|
|||||||
#if HAS_RS232
|
#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:
|
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
|
jmp close_remove_from_table
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,40 @@
|
|||||||
#if HAS_RS232
|
#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:
|
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
|
jmp open_done_success
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in new issue
Block a user