C64 and ML

Discuss anything related to the VIC
Post Reply
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

C64 and ML

Post by Disc Master I »

Hi,
Does anyone here know enough about ML and the workings of the C64? I asked this question on Lemon64, but the answer that was given didn't work, so I thought I'd try here since the Vic and C64 are similar.

I have a 1581 drive set as drive 10 and have an official Loadstar Compleat CD which includes all Loadstar issues in d64 and d81 format. I've been trying to convert the d81 images to 1581 floppies. That part works, but the probelm is when I try to load the disk. It begins to load then crashes because something within the LS loading program looks to drive 8. I am looking for information on how to edit the disks so that when Loadstar is booted it runs off my device 10. What would be best is if it is possible with a hex program or something to edit the code and have it load off of whatever drive it is started on. I was told that is possible, but again what the person over at Lemon gave me as instructions didn't work.

Can anyone here help me? I'm not a ML programmer, but the information using a hex edit program on a PC to a d64 image was easy for me to follow as I've used Hex edit programs before. Anyhow, if anyone can help me I'd appreciate it.

Sincerely,
John
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Oi, that sounds like a tough question. Let's assume that the code looks something like this:

Code: Select all

.2000 A9 01      LDA #$01  ; logical file number
.2002 A2 08      LDX #$08  ; device number
.2004 A0 00      LDY #$01  ; secondary address
.2006 20 BA FF   JSR $FFBA ; set up logical file
.2009 A9 xx      LDA #$xx
.200b A2 xx      LDX #$xx
.200d A0 xx      LDY #$xx
.2010 20 BD FF   JSR $FFBD ; set up file name
.2013 A9 00      LDA #$00  ; load (not verify)
.2015 20 D5 FF   JSR $FFD5 ; LOAD RAM from device
If the only place that needs rewriting is one loader, it is doable, but if files are loaded here and there on the whole disk, it probably is an "impossible" task.

What you/we need to do is replace the LDX #$08 with LDX $BA. Notice the difference in argument - one is an absolute/immediate number while the other one is a reference to a memory address, in this case a zero page address saying which device was last used.

Thus, in a hex editor, you should look for A2 08 and replace with A6 BA. I would think it is easier to do that in a machine code monitor, now when you have a clue how the code you should search for looks like. By the way, everything I've written applies to a VIC-20 too, with the possible exception for the position in memory ($2000) I used as an example where the code would be found.

I guess you have something else as device 8, which prevents you from putting your 1581 as this unit? If that other device is switched off, in theory you should be able to software change the drive number just like you do on the 1541 series:

OPEN 1,8,15:PRINT#1,"M-W";CHR$(119);CHR$(0);$CHR$(2);$CHR(8+32);CHR$(8+64):CLOSE 1

where 8 obviously is the new device number. This was not what you asked for, but it is the easy answer I can give without digging deep into the Loadstar loader.

Good luck, although I think rearranging your drives will be easier than rewriting the software.
Anders Carlsson

Image Image Image Image Image
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

I really want a 1581 but I don't know why...

the best drive I've ever used was the indus gt.
High Scores, Links, and Jeff's Basic Games page.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I used to want a 1581 because it would load faster and eat 3.5" disks, but today I'm not too keen anymore. There is a build-your-own kit if you have a 3.5" PC drive and is handy with electronics which will make a Commodore compatible 3.5" drive. I posted the link on Vintage Computer forum before, but can dig it up here too if anyone is interested.
Anders Carlsson

Image Image Image Image Image
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

I'd like to get the CMD 3.5" drive. The one that can use high density 3.5" floppies.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

I would like a more efficient way to save programs. I hate to damage my disk drive. I am the type who like to back up my work every 10 seconds because my VICs have always been prone to crashing when I hit the RUN STOP/RESTORE combo.

Is there a way to hack a zip drive or something so I have a fast boot hard drive?
High Scores, Links, and Jeff's Basic Games page.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Jeff-20 wrote:Is there a way to hack a zip drive or something so I have a fast boot hard drive?
Umm.. maybe something along 64HDD or IDE64 could work with the VIC. I don't know about Zip drives nor how standalone intelligent these interfaces are, but it is a good place to start looking for information and ideas, particulary if you think you can solder your own circuit boards and is creative in these areas.
Anders Carlsson

Image Image Image Image Image
Post Reply