Making compute's gazette VIC turbodisk for ROM

Basic and Machine Language

Moderator: Moderators

User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Making compute's gazette VIC turbodisk for ROM

Post by eslapion »

Here is a challenge for a good programmer.

I sold a couple of expanders for the VIC but mine has a feature that nobody asked for so far. It has 2kbytes of NVRAM at IO2 and IO3.

This allows me to put in it either the Rabbit tape accelerator or to use a specially modified version of the installer for VIC turbodisk which will put it in there. At this range of address, turbodisk is nice because it will never conflict with anything you might want to load, including ROM images that go into BLK5.

The sad part is, however, that VIC turbodisk was designed to be relocatable because the VIC can have many different memory configurations, yet turbodisk needs to store some information in RAM in order to operate fine and this information is stored in the same region of memory as the code. This makes it impossible to put the piece of software in ROM.

I believe just about the only information that is stored in RAM is the filename of the file being loaded.

Is there anyone out there who can modify this machine laguage code so Turbodisk will store its needed information in the cassette buffer instead of the place it normally does ?

In other words, can anyone make VIC turbodisk ROM compatible ?
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

How big is it? Maybe you can copy the whole program to the tape buffer?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Hm, where does Commodore Basic normally store the file name? On the stack? Maybe it is possible to modify the program to do the same.
Anders Carlsson

Image Image Image Image Image
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

Boray wrote:How big is it? Maybe you can copy the whole program to the tape buffer?
Forget that one, Turbodisk uses most of the 2k available at IO2 and IO3... just the fact that I need both tells you that's its more than 1k.

And in the end, even if it did fit in the tape buffer, that does not prevent it from being lost when you turn off the computer which is the point of putting it in ROM.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

carlsson wrote:Hm, where does Commodore Basic normally store the file name? On the stack? Maybe it is possible to modify the program to do the same.
That would also be a nice solution. But so far... nobody has even taken a look at it...

If I ask that, it's because everyone has access to this and can take a look at it. VIC turbodisk and Turbotape was published in july 1985 in the Compute's gazette.

A disk image containing all the software of that issue is available here: ftp://arnold.c64.org/pub/magazines/Gaze ... 5jul85.zip

Also, I "suspect" only the filename is stored in that area but I may be totally wrong.

Only a good machine language programmer can tell for sure and I am not one.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

eslapion wrote:just the fact that I need both tells you that's its more than 1k.
Well forgive me for my ignorance then... But I normally don't have a vic-20 memory map in front of me all of the time. Just tried to be helpful... You didn't say that the program used all of the 2k either... just that you were going to use that space...
eslapion wrote:And in the end, even if it did fit in the tape buffer, that does not prevent it from being lost when you turn off the computer which is the point of putting it in ROM.
I was thinking that you could copy it to ram and run it after that with one sys, just like our disk util cart does...
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

I downloaded the Jul. '85 version of Turbodisk at arnold.c64.org, and made a quick shot at it. Turbodisk resides in the last 5 pages of the available RAM. The very last page is used as sector buffer. So the whole code only needs 1K, but ...

1. The filename is copied into the code, that is transferred into the 1541. That can't be easily altered.

2. Turbodisk doesn't work with the 1571.

3. Within VICE, Turbodisk made transmission errors in PAL (NTSC was ok.)

Aren't there other fast loaders which might more suited?

Michael
ruud
Vic 20 Devotee
Posts: 245
Joined: Wed Aug 04, 2004 11:26 pm

Post by ruud »

Hallo Michael,

Regarding the filename: what about copying the piece of code to RAM first, then copy the filenam to it and then copy the whole from RAM to disk?

Regarding the 1571: have you tried to put it in VIC-20 mode first? (if that exists at all)

Code: Select all

    ___
   / __|__
  / /  |_/     Met vriendelijke groet, Ruud Baltissen
  \ \__|_\
   \___|       URL: www.baltissen.org

User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

Mike wrote:I downloaded the Jul. '85 version of Turbodisk at arnold.c64.org, and made a quick shot at it. Turbodisk resides in the last 5 pages of the available RAM. The very last page is used as sector buffer. So the whole code only needs 1K, but ...

1. The filename is copied into the code, that is transferred into the 1541. That can't be easily altered.

2. Turbodisk doesn't work with the 1571.

3. Within VICE, Turbodisk made transmission errors in PAL (NTSC was ok.)

Aren't there other fast loaders which might more suited?

Michael
First, thank you for this fantastic insight. Its an excellent strart.

Second, VIC turbodisk may not work with a 1571 for an unknown reason but it does work well with a 1541 (obviously) and a 1541-II.

Why it wouldn't work in PAL is probably just a question of slightly different timing.

If its just a question of the filename being incorporated in the code sent to the floppy drive then I think it should be easy to tell the routine that transfers this code to send everything that is in the ROM before the filename, then, the part that contains the filename (in the cassette buffer ?) then the part that is after the filename in the ROM...

Obviously what I presently use is a modified version of the installer that puts Turbodisk at $9800 instead of the normally used last 5 pages of available Basic RAM. Presently, I am forced to have NVRAM there because of the way this software works.

I don't know much but this is truly the one and only disk accelerator I know for the VIC. The fact that it can so easily be relocated is what made possible the usage I have for it now.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

ruud wrote:Regarding the filename: what about copying the piece of code to RAM first, then copy the filenam to it and then copy the whole from RAM to disk?
One of the reason why Turbodisk is so versatile the way I use it right now is because all the RAM it uses is at IO2 and IO3, this software will never have a memory conflict with what it is trying to load. All I have to do to activate it when I turn on the VIC is type SYS152*256 or SYS38912.

I suspect, let's say I use 2k of RAM in whatever block and then put the filename in it, well, what if the data being loaded goes into that same memory area? Not to mention the fact that it forces you to designate an area of memory as been safe for this usage.

If you have a software that loads in multiple parts then you could be in trouble with part of what you already loaded being destroyed by that 2k section of data being regenerated in a utilized area.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Marko Mäkelä wrote a fastloader, which Albert of Pu-239 improved on in VIMM, to which there is assembly source code available. See bottom of this page:

http://www.cs.tut.fi/~albert/Pu-239/vimm/ and download vimm-src.lha.

Perhaps there are other, even better fastloaders out there, but it could be a good start. I might look into loader.asm to see what it does and if it can be used separately.
Anders Carlsson

Image Image Image Image Image
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

carlsson wrote:Marko Mäkelä wrote a fastloader, which Albert of Pu-239 improved on in VIMM, to which there is assembly source code available. See bottom of this page:

http://www.cs.tut.fi/~albert/Pu-239/vimm/ and download vimm-src.lha.

Perhaps there are other, even better fastloaders out there, but it could be a good start. I might look into loader.asm to see what it does and if it can be used separately.
That is just beyond my abilities with ML programming.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I had a brief look into the code yesterday, and I think it is doable. I haven't made any testing yet though, and the fast loader is implemented as part of an IRQ routine, but I don't think it is important. I'll let you know if I manage to make a standalone turbo program out of it.
Anders Carlsson

Image Image Image Image Image
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

carlsson wrote:I had a brief look into the code yesterday, and I think it is doable. I haven't made any testing yet though, and the fast loader is implemented as part of an IRQ routine, but I don't think it is important. I'll let you know if I manage to make a standalone turbo program out of it.
yesssssssss
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

So far, I manage to crash the 1541 CPU when uploading the drive part. Dunno why, I have just reordered parts of the code.

Except for the little detail it doesn't work at all for the moment, the assembled code size is 1046 bytes + load address. However that includes a number of self-modifying memory locations (i.e. it should run in RAM). Once I get it to function, I will look into how to separate the code part (ROM) from data part (RAM)
Anders Carlsson

Image Image Image Image Image
Post Reply