Kernal SAVE routine now works

This commit is contained in:
FeralChild64 committed 2019-11-07 20:09:37 +01:00
1 parent dd09e2432e
commit 0e28f89806
13 files changed
+30 -49

No files matched your search

+4 -1
View File
@@ -1,6 +1,9 @@
# open-roms
A project to create unencumbered open-source ROMs for use on selected retro computers. For the current status check [this document](STATUS.md)
A project to create unencumbered open-source ROMs for use on selected retro computers. Besides this manifest, the following documents are available:
* [implementation status](STATUS.md) of various APIs and functionalities
* [configuration options](CONFIG.md) for those willing to compile their own, customized build
# Problem Statement and Motivation
+5 -8
View File
@@ -1,13 +1,13 @@
# New features
Here are the features of the Open ROMs not found in the original ROMs from the 80s (many of them are [configurable](CONFIG.md)):
Here are the features of the Open ROMs not found in the original ROMs from the 80s (many of them are [configurable](CONFIG.md) during compilation):
* improved keyboard scanning, resistant to ghosting and joystick interference (one variant even supports multi-keyy rollover), supports additional C128 keys
* joystick can be used to move text cursor
* pre-defined function keys
* uses RAM under ROM and I/O: 61438 bytes free
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses, configured addresses
* wark start due to BRK prints out the instruction address
* extended `LOAD` command
* start/end addresses are displayed, in the Final cartridge style
@@ -24,7 +24,7 @@ NOTE: extra features and their syntax can change in the future!
The following ROM features are currently missing and are not planned due to space considerations:
* full tape support - VERIFY, SAVE, sequential files; tape is considered a legacy medium, so it's support is going to be limited
* mock 6551 emulation - this inly slows down the RS-232 support for original ROMs, probably noone needs it
* mock 6551 emulation - this only complicates the RS-232 support for original ROMs, probably noone needs it
The following ROM features are currently missing:
@@ -33,7 +33,6 @@ The following ROM features are currently missing:
* BASIC expression parsing
* floating point routines
* tape (normal mode) support
* IEC support for SAVE
* RS-232 support
* NMI handling is incomplete
@@ -54,8 +53,6 @@ For the current status of the low memory location implementation andd usage chec
### Official BASIC routines
Note: vectors at `$0300` are not supported yet - for now only the locations below can be used!
<br />
| Entry | Unofficial | Name | Status | Remarks |
@@ -140,7 +137,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| `$FFD5` | `$F49E` | `LOAD` | DONE | |
| `($0330)` | `$F4A5` | `LOAD` | DONE | |
| `$FFD8` | `$F5DD` | `SAVE` | DONE | |
| `($0332)` | `$F5ED` | `SAVE` | PARTIAL | not fully tested yet |
| `($0332)` | `$F5ED` | `SAVE` | DONE | |
| `$FFDB` | | `SETTIM` | DONE | |
| `$FFDE` | | `RDTIM` | DONE | |
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
@@ -169,7 +166,7 @@ Not all of them - only these we want to have implemented.
| `$E544` | clear screen | DONE | |
| `$E50C` | set cursor position | PARTIAL | |
| `$E566` | home cursor | NOT DONE | |
| `$E5A0` | setup VIC II & IO | DONE | |
| `$E5A0` | setup VIC II & I/O | DONE | |
| `$E6B6` | advance cursor | NOT DONE | |
| `$E701` | previous line | NOT DONE | |
| `$E716` | screen CHROUT | NOT DONE | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -24
View File
@@ -4,20 +4,12 @@
//
// XXX this is untested!
// also test STAL/EAL - Open ROMs vs hybrid vs original
#if CONFIG_IEC
save_iec_dev_not_found:
jmp lvs_device_not_found_error
save_iec_error:
jmp lvs_device_not_found_error // XXX find a better error
save_iec:
@@ -40,7 +32,7 @@ save_iec:
// Send file name
jsr iec_send_file_name
bcs save_iec_error
bcs save_iec_dev_not_found
// Call device to LISTEN once again
lda FA
@@ -50,9 +42,9 @@ save_iec:
lda #$61 // open channel / data (p3) , required according to p13
sta TBTCNT
jsr iec_tx_command
bcs save_iec_error
bcs save_iec_dev_not_found
// Save start address XXX optimize this
// Save start address
lda STAL+0
sta TBTCNT
clc
@@ -63,31 +55,26 @@ save_iec:
clc
jsr iec_tx_byte
jsr lvs_setup_MEMUSS
ldy #$00
iec_save_loop:
// Retrieve byte to send
#if CONFIG_MEMORY_MODEL_60K
ldx #<STAL+0
ldx #<MEMUSS+0
jsr peek_under_roms
#else // CONFIG_MEMORY_MODEL_38K
lda (STAL),y
lda (MEMUSS),y
#endif
// Check if end of saving
ldx STAL+0
cpx EAL+0
bne !+
ldx STAL+1
cpx EAL+1
beq iec_save_loop_end
!:
// Send the byte and do next iteration
// Send the byte
sta TBTCNT
clc
jsr iec_tx_byte
jsr lvs_advance_STAL
jmp iec_save_loop
// Next iteration
jsr lvs_advance_MEMUSS_check_EAL
bne iec_save_loop
iec_save_loop_end:
+9 -12
View File
@@ -77,16 +77,6 @@ lvs_handle_byte_verify:
#if CONFIG_IEC
lvs_advance_STAL:
// Advance pointer
inc STAL+0
bne !+
inc STAL+1
!:
rts
lvs_advance_EAL:
// Advance pointer
@@ -98,7 +88,15 @@ lvs_advance_EAL:
#endif
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO || CONFIG_IEC
lvs_setup_MEMUSS:
lda STAL+0
sta MEMUSS+0
lda STAL+1
sta MEMUSS+1
rts
lvs_advance_MEMUSS_check_EAL:
@@ -224,7 +222,6 @@ lvs_display_saving:
iny
bne !- // jump alwayys
!:
jsr print_return
rts
+1 -4
View File
@@ -210,10 +210,7 @@ tape_handle_header:
!:
// Setup MEMUSS (see Mapping the C64, page 36)
lda STAL+0
sta MEMUSS+0
lda STAL+1
sta MEMUSS+1
jsr lvs_setup_MEMUSS
// Print LOADING and start address