retrohackers.com
http://retrohackers.com/

Loader for VIC20 and C64 released
http://retrohackers.com/viewtopic.php?f=14&t=360
Page 1 of 1

Author:  SounDemoN [ Tue Mar 11, 2008 2:42 am ]
Post subject:  Loader for VIC20 and C64 released

I recently decided to release this loader. It should have been done a long time ago but.... Well, I'm lazy :) In short, it's a 1541 compatible loader and there's a VIC20 and C64 version available. It's fast and compatible and very easy to use. Especially the VIC20 version might be of interest because it's the only "proper" loader for VIC that exists. These are the loaders that have been used in almost all of the Dekadence productions.

You can leech it from the new tools page at dekadence64.org:

http://www.dekadence64.org/prodstools.html

Author:  FMan [ Tue Mar 11, 2008 4:41 am ]
Post subject: 

Loads ok, but does it return the last address loaded? Without it depacker fails so this loader cannot be used. Teh installer seems to load to $4000, so why not use that in the example instead of $2000?

Author:  SounDemoN [ Tue Mar 11, 2008 2:56 pm ]
Post subject: 

FMan wrote:
Loads ok, but does it return the last address loaded? Without it depacker fails so this loader cannot be used. Teh installer seems to load to $4000, so why not use that in the example instead of $2000?


It doesn't return the address, but I guess it could easily be checked by reading directly from the loader code:

ldx loader+something
ldy loader+something_else

x and y now contain the last address loaded. I can check later what the something and something_else values should be.

In the example I just wanted to demonstrate that the init routine can go anywhere and it will still work...

Author:  FMan [ Tue Mar 11, 2008 3:31 pm ]
Post subject: 

Yeah, it's cool. :) I tested and it actually loaded my file. Of course, it would not be that difficult to just write the known values to AE/AF, when used to load a particular program.

Author:  SounDemoN [ Wed Mar 12, 2008 12:54 am ]
Post subject: 

SounDemoN wrote:
FMan wrote:
Loads ok, but does it return the last address loaded? Without it depacker fails so this loader cannot be used. Teh installer seems to load to $4000, so why not use that in the example instead of $2000?


It doesn't return the address, but I guess it could easily be checked by reading directly from the loader code:

ldx loader+something
ldy loader+something_else



And the magic numbers are: $a8 and $a9
So if the loader goes to $0100:

lda #$01 ; load file
ldx #<$0801
ldy #>$0801
jsr $0100

ldx $01a8 ; read last address to x and y
ldy $01a9

Now you can initialize whatever ZP values the packer needs... Notice that the value is the address of the last byte written+1. I'm guessing the kernal does the same thing.

Author:  FMan [ Wed Mar 12, 2008 8:14 pm ]
Post subject: 

Cool. Thanks, dude! :D Yes. KERNAL stores last address loaded + 1 in VARTAB (45-46) and EAL (174-175). The information in the progrefguide is wrong, btw, as it says "the last RAM location loaded". :)

Author:  tnt/beyond force [ Thu Mar 13, 2008 12:11 am ]
Post subject: 

FMan wrote:
KERNAL stores last address loaded + 1 in VARTAB (45-46)

No, it doesn't. BASIC does.

Author:  FMan [ Thu Mar 13, 2008 1:44 pm ]
Post subject: 

Right, of course. :) Minor slip. Tanx for correcting. :wink:

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/