| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Loading and saving to disk using kernel
Assume: Machine booted from cart. Cart ROM at $8000-$bfff. IO at $Dxxx and KERNAL at $e000-$ffff
What calls do I have to do to use KERNEL load/save?
What RAM and ZP will be trashed by this?
How will it affect my IRQs? (I have CIA1 and raster IRQs running via $0314/15) |
|
... 23 posts hidden. Click here to view all posts.... |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
I saved a file with this routine from codebase:
https://codebase64.org/doku.php?id=base:saving_a_file
That works fine.
But when I want to load it again via
https://codebase64.org/doku.php?id=base:loading_a_file
it never returns from JSR $FFD5. It gets stuck in some loop at $EE30.
I'm not using any ZP adresses above $8f. But I did disable timer interrupts earlier:
lda #$7f
sta $dc0d
sta $dd0d
lda $dc0d
lda $dd0d
Enabling them before calling the load routine doesn't seem to help. I also disabled raster IRQs before calling the routine:
sei
lda #0
sta $d01a
inc $d019
lda #$37
sta $01 ;I used $fffe and $ffff, so this should be fine
The call to the load routine is done from main.
Does anybody have an idea why the load routine doesn't return and/or suggestions what I could try? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11291 |
i'd try calling the IORESET (or whatever its called) kernal call before, if that does the trick strip it down :) |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
Thanks, but calling $FDA3 (IOINIT) doesn't help. |
| |
oziphantom
Registered: Oct 2014 Posts: 488 |
have you made an intentional or unintentional modifications to dd02/3 |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
Intentional no, unintentional unlikely. |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
dd02 and dd03 was my thought also initially but $fda3 resets those.
Perhaps you have fiddled with the IEC bits in $dd00 and left the bus in a bad state? The drive could be hanging waiting for something to complete perhaps? |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
It looks a bit as if something went wrong while saving the file, althoug no error was returned. When I try to load the file directly from Basic after a cold start with load "*",8 or load "*",8,1 the same problem happens. |
| |
tlr
Registered: Sep 2003 Posts: 1762 |
Well, then it was a red herring... |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
It was a bug in my code that calls the save routine (as you probably already suspected). Sorry about that. Thanks for your suggestions. They still helped me. |
| |
Krill
Registered: Apr 2002 Posts: 2940 |
Care to explain what exactly the bug was? Could help others to prevent a similar error. =) |
Previous - 1 | 2 | 3 | 4 - Next |