fixing first two bytes

Got an issue?
kirkjerk
Member
Member
Posts: 7
Joined: Tue Aug 25, 2015 1:32 am
Contact:

fixing first two bytes

Post by kirkjerk »

For my Compute!'s Gazette project, I'd like to make standalone images for all the various programmers.

I've found two ways (c1541 that comes with Vice and then DiskImagery) for my Mac to make new .D64 files containing just the program file in question.

VICE's Autostart feature always runs LOAD "*",8,1 - the trouble is this doesn't work for some of the BASIC programs.

I've been told if you change the first two bytes of a BASIC program to $0801 it should then be loadable, since that's where BASIC programs start (is that true for VIC-20 and C128 as well?)

But I don't know how to change those bytes? Maybe DirMaster if I run a Windows emulator? Any other suggestions, OSX, in C=64, or Windows?

Or general suggestions for my method. I think .D64 images, each runnable by VICE's Autostart, is the friendliest/easiest idea but I'm open to suggestions.


kirkjerk
Member
Member
Posts: 7
Joined: Tue Aug 25, 2015 1:32 am
Contact:

Re: fixing first two bytes

Post by kirkjerk »

(to clarify: I'm trying to make a series of emulator-compatible binary file images (probably .D64 but open to other ideas) each containing a single program file so that when you double click on the image from the host OS (OSX,Windows, etc) VICE's autostart feature will launch the program. Without the user having to type in the load command or navigate a menu launcher.

If I could coerce every program to be LOAD"*",8,1 that would work, or if I had a launcher that could be launched ,8,1 which was then hard coded to load and run a second file in BASIC mode (either the second file in the directory list or I could hardcode the BASIC file to have the same name each time) that might work as well)
User avatar
Melon
Site Admin
Site Admin
Posts: 297
Joined: Thu Apr 10, 2014 7:57 pm
Contact:

Re: fixing first two bytes

Post by Melon »

I usually use the Action Replay tools, @BR and @BW. @BR1201 will read the first directory sector, Track 18 sector 01, which will give you the start track and sector of the first file, you would then @BRTTSS of the first file and mod the start address from there using a @BWTTSS. You could also load the program to a specific address using the AR machine code monitor, LOAD"*",8,0801 then save the program out again using SAVE "TEST",8,0801,END_ADDRESS the END_ADDRESS being what is reported by the AR when loading the program. There's probably something a lot easier though.
.oO( MELON64 - ONE SLiCE AiN'T ENOUGH! )Oo.
TMR
Member
Member
Posts: 42
Joined: Fri May 23, 2014 2:19 pm
Location: Leeds, U.K.
Contact:

Re: fixing first two bytes

Post by TMR »

kirkjerk wrote:I've been told if you change the first two bytes of a BASIC program to $0801 it should then be loadable, since that's where BASIC programs start
Changing the first bytes of the program will just mangle it, but if you have a PRG file sat on your hard disk it's possible to use a hex editor like XVI32 to change the two bytes that are appended before the program itself to alter its load address. The address is stored in low/high byte order.
kirkjerk wrote:(is that true for VIC-20 and C128 as well?)
No, if memory serves the VIC 20 is either $0401 or $1201 depending on RAM size and the C128 is $1C01
Disclaimer: a message board post from this person shouldn't be seen as any kind of indication that a project has been started or is ongoing because as a programmer he has the attention span of... oh look, a squirrel!
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 4 guests