| |
HCL
Registered: Feb 2003 Posts: 728 |
Saving files using Kernal
Does anyone know if it's possible to save a file with a different starting adress than the current one?
I just learned some months ago (thanx iopop :) that when using ActionReplay monitor, you can type:
S "MY FILE",8,1000,2000,5000
..and the memory between $1000 and $2000 will be saved, but with the starting adress $5000. Is it possible to achieve this using the Kernal Save ($ffd8 or something..)? |
|
| |
White Flame
Registered: Sep 2002 Posts: 136 |
The KERNAL takes start and end addresses as parameters, and stores the start address at the beginning of the file. You're going to have to open the file and write out the 1st two bytes yourself. After that, either dump the bytes to the file with your own loop, or see if you can jump into the KERNAL SAVE routine at the point after which it saves the SA (which would probably require more setup than simply dumping the bytes yourself). |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
HCL: are you _the_ hcl? just wondering because i didnt expect such a question from you. |
| |
raven Account closed
Registered: Jan 2002 Posts: 137 |
what Krill said ^_^ |
| |
Steppe
Registered: Jan 2002 Posts: 1510 |
Nah, that was me using one of my multiple accounts... ;-) |
| |
HCL
Registered: Feb 2003 Posts: 728 |
> Krill, Raven: are you _the_ hcl? just wondering because i
> didnt expect such a question from you.
Why not? What's your problem? Of course i'm _the_ HCL! Why wouldn't i dare asking such a question?
Thanx White Flame for the answer, which i consider to be; no, the Kernal does not support that feature.
Anyone else? |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
As the kernel is, it cannot do as you want using the SAVE routine.
Why not write your own? It isn't that hard and $0334 is just nice for it. I remember when I was learning to code and didn't have any hardware like AR - closest was a paper clip to reset :) Just add an extra 2 bytes in zp for load address like, after SETLFS and SETNAM has been used, lda #<start, sta ZP, lda #>start, sta ZP+1, lda #<loadad, sta ZP+2, lda #>loadad, sta ZP+3. lda #ZP, ldx #<save+1, ldy #>save+1, jsr SAVE after you have redirected $0332/$0333 (in a wedge type formation) and use the standard file byte writing. Maybe even checking ZP+2 ora ZP+3 and if =0 then write first byte address as start address, else write contents of ZP+2, ZP+3. You could then add some extras to save under IO and ROMs. Should be very short code. |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Ok, thank you very much, i think i have the answer i needed in this topic.
>> Stryyker: Why not write your own?
:), well, i just thought maybe for once i could avoid writing *my own*. The saver was ment for ByteBoozer (released today), and every extra byte in the code will make the cruncher less able to handle large files.
The shortest way, i think, was to transfer the file before saving. Done. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quote: > Krill, Raven: are you _the_ hcl? just wondering because i
> didnt expect such a question from you.
Why not? What's your problem? Of course i'm _the_ HCL! Why wouldn't i dare asking such a question?
Thanx White Flame for the answer, which i consider to be; no, the Kernal does not support that feature.
Anyone else?
Hi David,
well the point is not about you _daring_ to ask such a question but about you as one of the few good c64 coders not knowing about those kernel details. but don't take this as an offence, i was just wondering and, if i was you, would check the kernel myself (preferably a kernel disassembly, of course).
but well, you make me wonder sometimes anyway with what you write in scrolltexts and demo notes, making the impression that it's lame to analyze others' code. i learnt almost everything hacking around in the monitor. but that aside,
just go on producing ruling code =D |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Krill:
Well, you're right.. Of course i probably *could* examine the Kernal and find out the answer myself. But i was short of time, and personally i don't really *like* examining the Kernal, not using it at all :). I just thought that i could use this brilliant web-portal to get the answer quickly!
Btw. *what* scrolltext and notes do you refer to Gunnar? |