| |
Richard
Registered: Dec 2001 Posts: 621 |
Saving files from $A000 + to disk without screwing the source data
I'm working on a tool that can help me save separate bits of data for use with the Freeload tape master tool, but I am suffering with a problem with the disk save routine.
When I save data between $0800-$a000 there is no problem here, but if I save data from $a000+ after loading, the memory is not full of data, but garbage. I want the program to save a picture bitmap from $e000-$ff40, but again I get garbage.
The routine is as follows:
;DISK SAVE ROUTINE
;SAVEAREAS
SEI
SAVER LDA #$36
STA $01
CLI
LDA #$00
LDX #$08
;LDY #$FF
JSR $FFBA
LDA #$01
FILENAME_LOW LDX #<A_NAME
FILENAME_HI LDY #>A_NAME
JSR $FFBD
STARTADDRESS_LOW LDA #<A_LOW
STARTADDRESS_HI LDX #>A_LOW
STA $23
STX $24
LDA #$23
ENDADDRESS_LOW LDX #<A_HI
ENDADDRESS_HI LDY #>A_HI
JSR $FFD8
LDA $37
STA $01
CLI
RTS
Please can you help me correct this routine so that I can save memory from $A000 and higher without screwing up the garbage. Or maybe set up the load address for the data, so that it can load to a specific address like $a000 + :)
Thanks. |
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
the basic rom is visible by default at $a000-$c000. with some luck its enough to do an lda #$36 sta $01 BEFORE saving (this will turn off the basic rom, so the ram will be visible), and then you can re-enable basic with lda #$37 sta $01 afterwards. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
As for saving data below the KERNAL ROM I don't think it's possible using the KERNAL routines (duh). But I've never used them, so I might be wrong. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
o_O |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
right, I didnt read carefully... a000-c000 is possible, e000-fff is not. krill has released a saveroutine in fixup #01 which hopefully will do the trick. |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Kernal save doesn't need basic, but it needs kernal.
Here is byte for byte disk writing code you can use:
Saving from one memory location, loading to another!
Just wrap the lda (zp),y calls with something like
sei
ldx #$34
stx $01
lda (zp),y
ldx #$37
stx $01
cli
|
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
If you wish to save under the kernel rom then write each byte to file yourself. It only takes a dozen or two lines of code. |
| |
THE TEA DRINKER
Registered: Jul 2005 Posts: 39 |
Not because I'm expert.
I have used lda#$40 to transfer sample data from $exxx-$fxxx to another location.
I had problems with lda#$35/34/36 when using memory $exxx-fxxx but when I change it to lda#$40 it did work after that for my transfer sample routine.
If I used lda#$other number than the 40 in $exxx-$fxxx it would make a noise and not playing the sample correctly and the sample data for me did changes and there came some bad noise.
|