Pet basic-2 save different than C64?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Pet basic-2 save different than C64?

Francesco Messineo
Hi all,
some more fun with the 3032 today.
For PC-CBM communications, I use a PC64 cable and cbmlink software.

http://www.zimmers.net/anonftp/pub/cbm/crossplatform/transfer/CBM-to-PC/

On the C64 I've typed the basic loader to then send an image of the
server (cbmlink-cbmprg zip archive), then, after the server was
running, I sent a relocatable version of the server (cbmlink-cbmbasic
zip archive) and saved that to disk. It's a clever way to relocate a
small machine code program by the way.
On the C64, I saved this relocatable version on disk, before running
it, and it worked fine, it's 3 disk blocks.
Today I was trying the same procedure with the PET, typed the basic
loader in, saved it to a couple of tapes, so I don't have to type it
anymore, loaded the machine language non relocatable program with it,
then loaded the basic relocatable version.
Now, I tried to save this on tape, it's only 530 bytes (532 including
the start address), but the tape started to go on forever. It should
take about 11 seconds to save it.
So what's the matter with it? I'm not very familiar with the PET (I
was born with a VIC-20, then C64) but it seems it shouldn't be that
much different in this respect. Is the save routine broken in some
subtle way or my PET is?
By the way, I could save the non-relocatable version directly from the
PET monitor, almost same size and it takes a few seconds.
Thanks
Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Marko Mäkelä
Hi all,

On Mon, Feb 06, 2017 at 04:32:58PM +0100, Francesco Messineo wrote:
>For PC-CBM communications, I use a PC64 cable and cbmlink software.
>
>http://www.zimmers.net/anonftp/pub/cbm/crossplatform/transfer/CBM-to-PC/

Great to see that old technology still in use. :) Maybe some day I
should try to port it to the Raspberry Pi. Maybe for an authentic
feeling, use inline assembly and a setuid binary that would directly
bit-bang the GPIO registers, like it was before /dev/parport was
introduced to Linux.

>So what's the matter with it? I'm not very familiar with the PET (I
>was born with a VIC-20, then C64) but it seems it shouldn't be that
>much different in this respect. Is the save routine broken in some
>subtle way or my PET is?

What if you type just SAVE right after reset? Would it hang too?

Side note: About 31 years ago I got a broken 6510 in a C64 after
hot-swapping tape drives to work around the azimuth angle trouble when
copying tapes.  Everything else worked, but the SAVE command would cause
the computer to hang. And guess if I had a backup of what was
overwritten before I realized that it is hung? :) I guess that reads or
writes of the on-chip I/O register would randomly fail, causing the
KERNAL to be replaced with RAM in the memory map. Because screen was
blanked during tape I/O, there was really no way to tell that it was
hung.

>By the way, I could save the non-relocatable version directly from the
>PET monitor, almost same size and it takes a few seconds.

Maybe the issue is that the end address vectors are wrong, and you are
saving much more data? I am not that familiar with the PET either, and I
gave away my PET collection over 7 years ago. Perhaps you could try to
reproduce this on VICE?

Best regards,

        Marko

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Francesco Messineo
On Mon, Feb 6, 2017 at 5:12 PM, Marko Mäkelä <[hidden email]> wrote:

> Hi all,
>
> On Mon, Feb 06, 2017 at 04:32:58PM +0100, Francesco Messineo wrote:
>>
>> For PC-CBM communications, I use a PC64 cable and cbmlink software.
>>
>> http://www.zimmers.net/anonftp/pub/cbm/crossplatform/transfer/CBM-to-PC/
>
>
> Great to see that old technology still in use. :) Maybe some day I should
> try to port it to the Raspberry Pi. Maybe for an authentic feeling, use
> inline assembly and a setuid binary that would directly bit-bang the GPIO
> registers, like it was before /dev/parport was introduced to Linux.

well, that would be another thing entirely :)
IMHO the way to go is with small microcontroller-based sd card
adapters. Everyone but me got one...
I'm happy with old 5.25" floppies actually. They're reliable enough
for me. Old tapes are quite another story so far :/

>
>> So what's the matter with it? I'm not very familiar with the PET (I
>> was born with a VIC-20, then C64) but it seems it  shouldn't be that
>> much different in this respect. Is the save routine broken in some
>> subtle way or my PET is?
>
>
> What if you type just SAVE right after reset? Would it hang too?

I didn't try, but when I entered the basic loader from keyboard, I
could save it just fine on a few tapes.
It seems it's just that particular program or something breaks after
the cbmlink "server" is started.
So I'll try first to disable the cbmlink server before I try to save it again.

>
> Side note: About 31 years ago I got a broken 6510 in a C64 after
> hot-swapping tape drives to work around the azimuth angle trouble when
> copying tapes.  Everything else worked, but the SAVE command would cause the
> computer to hang. And guess if I had a backup of what was overwritten before
> I realized that it is hung? :) I guess that reads or writes of the on-chip
> I/O register would randomly fail, causing the KERNAL to be replaced with RAM
> in the memory map. Because screen was blanked during tape I/O, there was
> really no way to tell that it was hung.

I have an 8500 that does just this. I'm not going to swap it with my
last spare though.
It hangs when trying a save to tape.

>
>> By the way, I could save the non-relocatable version directly from the PET
>> monitor, almost same size and it takes a few seconds.
>
>
> Maybe the issue is that the end address vectors are wrong, and you are
> saving much more data? I am not that familiar with the PET either, and I

this could be very well the cause, but I can't understand why. A LIST
shows no extra garbage or lines.

Thanks
Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Ethan Dicks
In reply to this post by Francesco Messineo
On Mon, Feb 6, 2017 at 10:32 AM, Francesco Messineo
<[hidden email]> wrote:
> Hi all,
> some more fun with the 3032 today...
> Today I was trying the same procedure with the PET, typed the basic
> loader in, saved it to a couple of tapes, so I don't have to type it
> anymore, loaded the machine language non relocatable program with it,
> then loaded the basic relocatable version....

The save and load routines in all PETs do work slightly differently
than the VIC-20 and C-64.  In operational terms, I always saved
anything that was not a plain-old BASIC program from TIM.  This
included ML fragments in the Cassette #2 buffer (at $033A) and stuff
in upper memory, and any BASIC-ML combo programs.  SAVE works when
it's _just_ the visible lines of BASIC.  Similarly, LOAD does not do
relocation, and LOAD "",1,1 doesn't do _exactly_ the same thing on a
PET as on a VIC-20 or C-64.

Short answer is if it's not BASIC, use TIM to save it.  LOAD will load
it back in to wherever it was saved from.  No need for the equivalent
of LOAD"*",8,1 on a PET.

-ethan

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Francesco Messineo
Hi Ethan,

On Mon, Feb 6, 2017 at 7:24 PM, Ethan Dicks <[hidden email]> wrote:

> On Mon, Feb 6, 2017 at 10:32 AM, Francesco Messineo
> <[hidden email]> wrote:
>> Hi all,
>> some more fun with the 3032 today...
>> Today I was trying the same procedure with the PET, typed the basic
>> loader in, saved it to a couple of tapes, so I don't have to type it
>> anymore, loaded the machine language non relocatable program with it,
>> then loaded the basic relocatable version....
>
> The save and load routines in all PETs do work slightly differently
> than the VIC-20 and C-64.  In operational terms, I always saved
> anything that was not a plain-old BASIC program from TIM.  This
> included ML fragments in the Cassette #2 buffer (at $033A) and stuff
> in upper memory, and any BASIC-ML combo programs.  SAVE works when
> it's _just_ the visible lines of BASIC.  Similarly, LOAD does not do
> relocation, and LOAD "",1,1 doesn't do _exactly_ the same thing on a
> PET as on a VIC-20 or C-64.
>
> Short answer is if it's not BASIC, use TIM to save it.  LOAD will load
> it back in to wherever it was saved from.  No need for the equivalent
> of LOAD"*",8,1 on a PET.

thanks a lot for the explanation! Indeed I'm going to try to save it
from the TIM later. I hope to have good results fiinally!
I think either the C2N I'm using or the tapes have some issues.
Writing anything on a fresh part of a tape works reliably. Ovewriting
something results in nothing read back.
I've found a similar belt to restore a second C2N, so I'll see if this
one works better.

Does anyone have a good suggestion to restore the gold-plated edge
connectors? The ones on this pet are badly worn out, the gold plating
has gone away on large parts. The connection is reliable enough with
the gold-plated connectors (like the one I built the PC64 cable with),
but the original C2N connector is already too unreliable to start with
:)
I've had good results on the tape#2 connector on my 3032 which isn't
gold-plated but just tinned. The tape#1 is unreliable in this
semi-gold-plating with holes state.

Thanks
Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Rhialto
In reply to this post by Ethan Dicks
On Mon 06 Feb 2017 at 13:24:20 -0500, Ethan Dicks wrote:
> The save and load routines in all PETs do work slightly differently
> than the VIC-20 and C-64.  

Another difference is, if I remember correctly, that it is assumed you
won't save any addresses over $8000 to/from tape. So the high address
bit is used as an end flag or something like that.

> -ethan
-Olaf.
--
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/xs4all.nl    -- are condemned to reinvent it. Poorly.

signature.asc (465 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Francesco Messineo
In reply to this post by Francesco Messineo
On Mon, Feb 6, 2017 at 7:35 PM, Francesco Messineo
<[hidden email]> wrote:

> Hi Ethan,
>
> On Mon, Feb 6, 2017 at 7:24 PM, Ethan Dicks <[hidden email]> wrote:
>> On Mon, Feb 6, 2017 at 10:32 AM, Francesco Messineo
>> <[hidden email]> wrote:
>>> Hi all,
>>> some more fun with the 3032 today...
>>> Today I was trying the same procedure with the PET, typed the basic
>>> loader in, saved it to a couple of tapes, so I don't have to type it
>>> anymore, loaded the machine language non relocatable program with it,
>>> then loaded the basic relocatable version....

turns out that if I disable the cbmlink "server" before saving the
program, all is fine.
Somehow the cbmlink hooks to something that makes a save never ending,
even if issued from TIM.

Another thing learned. And burned one TIP29 too. Always Always Always
power off before even moving the tape connector plugged into the PET.
Also changed a belt inside another C2N, but it doesn't even read the
tapes made with the first one... Oh well, life is too short for
everything.

Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

William Levak
In reply to this post by Francesco Messineo
On Mon, 6 Feb 2017, Francesco Messineo wrote:

The PET loader is non-relocatable.  It assumes a start address of 1024.
The address in the program is actually at 1025-6, with a zero at 1024.

The C64 does not save the zero, and saves the actual address as the first
two bytes of the program. This is incompatible with the PET.

If you want to transfer BASIC programs to the PET, use Commodore's PET
Emulator on the C64. It will load C64 programs correctly, but will save
them Compatible with the PET.

[hidden email]
SDF Public Access UNIX System - http://sdf.lonestar.org

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

William Levak
In reply to this post by Francesco Messineo
On Mon, 6 Feb 2017, Francesco Messineo wrote:

> Does anyone have a good suggestion to restore the gold-plated edge
> connectors? The ones on this pet are badly worn out, the gold plating
> has gone away on large parts. The connection is reliable enough with
> the gold-plated connectors (like the one I built the PC64 cable with),
> but the original C2N connector is already too unreliable to start with
> :)
> I've had good results on the tape#2 connector on my 3032 which isn't
> gold-plated but just tinned. The tape#1 is unreliable in this
> semi-gold-plating with holes state.

If the connectors are just dirty, you can clean them with a non-abrasive
eraser and alcohol.  If they are scratched up, you can put a layer of
solder on them. If part of the circuit trace is gone, they will have to be
replaced. They used to make stick-on circuit traces. This was a foil trace
with glue on the bottom side.  On the cassette connector, the stick-on
glue will probably not hold up.  You should use super-glue to apply these.

NOTE: On some of the earlier PETs, the top and bottom traces of
the cassette connector were not connected together. On these I had to
drill a small hole through the board on each contact, and solder a small
wire from top to bottom.

[hidden email]
SDF Public Access UNIX System - http://sdf.lonestar.org

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Francesco Messineo
On Tue, Feb 7, 2017 at 4:13 PM, William Levak <[hidden email]> wrote:
> On Mon, 6 Feb 2017, Francesco Messineo wrote:
>

>> I've had good results on the tape#2 connector on my 3032 which isn't
>> gold-plated but just tinned. The tape#1 is unreliable in this
>> semi-gold-plating with holes state.
>
>
> If the connectors are just dirty, you can clean them with a non-abrasive
> eraser and alcohol.  If they are scratched up, you can put a layer of solder
> on them. If part of the circuit trace is gone, they will have to be
> replaced. They used to make stick-on circuit traces. This was a foil trace
> with glue on the bottom side.  On the cassette connector, the stick-on glue
> will probably not hold up.  You should use super-glue to apply these.

the gold plating is scratched, but cleaning the contact made a good
improvement so I won't apply tin on it for now. Both sides are
connected together but the original C2N connector has contacts only on
the top side (you wonder why Commodore did save even on this aspect!)
and the contacts appear to be just tin plated or worse nickel plated.
Next step (if I really want to throw away my time) is trying to align
both my C2N to read reliably the same tapes. So far, tapes written by
one appear empty on the other.

Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

William Levak
On Tue, 7 Feb 2017, Francesco Messineo wrote:

> the gold plating is scratched, but cleaning the contact made a good
> improvement so I won't apply tin on it for now. Both sides are
> connected together but the original C2N connector has contacts only on
> the top side (you wonder why Commodore did save even on this aspect!)
> and the contacts appear to be just tin plated or worse nickel plated.
> Next step (if I really want to throw away my time) is trying to align
> both my C2N to read reliably the same tapes. So far, tapes written by
> one appear empty on the other.

The original C2N had the contacts on the other side.  They are also not
very reliable.  On some of our early C2Ns we replaced the connector with a
standard card edge connector, and used a shell from a "D" connector. This
gave us the equivalent of the connector that Commodore used on later tape
drives.

There are adjusting screws on the head.  You need a commercially recorded
tape and an oscilloscope to do the alignment.  Without these you can do it
by trial and error. If can get a tape from someone, you can just adjust
the head so that it reads that tape.

[hidden email]
SDF Public Access UNIX System - http://sdf.lonestar.org

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Francesco Messineo
On Fri, Feb 10, 2017 at 6:22 PM, William Levak <[hidden email]> wrote:

> On Tue, 7 Feb 2017, Francesco Messineo wrote:
>
>> the gold plating is scratched, but cleaning the contact made a good
>> improvement so I won't apply tin on it for now. Both sides are
>> connected together but the original C2N connector has contacts only on
>> the top side (you wonder why Commodore did save even on this aspect!)
>> and the contacts appear to be just tin plated or worse nickel plated.
>> Next step (if I really want to throw away my time) is trying to align
>> both my C2N to read reliably the same tapes. So far, tapes written by
>> one appear empty on the other.
>
>
> The original C2N had the contacts on the other side.  They are also not very
> reliable.  On some of our early C2Ns we replaced the connector with a
> standard card edge connector, and used a shell from a "D" connector. This
> gave us the equivalent of the connector that Commodore used on later tape
> drives.
>
> There are adjusting screws on the head.  You need a commercially recorded
> tape and an oscilloscope to do the alignment.  Without these you can do it
> by trial and error. If can get a tape from someone, you can just adjust the
> head so that it reads that tape.

I've actually aligned the other tape drive pretty well with a program
I've found for the C64.
It obviously can see only the digital version of the signal, but the
alignment with one of my old tapes was successfull. It can read now
very reliably those tapes (and the ones written with my other C2N
too).

That will allow me to save some PET programs until I find a better
storage solution for it.
Frank

       Message was sent through the cbm-hackers mailing list
Reply | Threaded
Open this post in threaded view
|

Re: Pet basic-2 save different than C64?

Groepaz
On Friday 10 February 2017, 18:28:39 Francesco Messineo
<[hidden email]> wrote:

> I've actually aligned the other tape drive pretty well with a program
> I've found for the C64.
> It obviously can see only the digital version of the signal, but the
> alignment with one of my old tapes was successfull. It can read now
> very reliably those tapes (and the ones written with my other C2N
> too).

this one could perhaps be ported to the PET even:
https://csdb.dk/release/?id=45413

and no, no oscilloscope needed :)

--

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ar.pokefinder.org

No matter what the anticipated result, there will always be someone eager to
(a) misinterpret it, (b) fake it, or (c) believe it happened according to his
own pet theory.



       Message was sent through the cbm-hackers mailing list