Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Saving files from $A000 + to disk without screwing the source data
2007-07-30 07:50
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.
2007-07-30 08:04
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.
2007-07-30 08:14
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.
2007-07-30 08:21
chatGPZ

Registered: Dec 2001
Posts: 11386
o_O
2007-07-30 08:40
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.
2007-07-30 08:40
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

2007-07-30 20:15
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.
2007-08-19 12:17
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.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
marley
Shogoon/Elysium/MSL
rexbeng
Jazzcat/Onslaught
Guests online: 125
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.051 sec.