UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Reply
 
Thread Tools
Old 8th Feb 2021, 10:16 pm   #541
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

I've just had a preliminary glance at it and I see that where the original code converted any character code below 32 or above 127 to a 'dot' you have broadened the scope so that it tries to print everything as ASCII.

The problem is that some characters aren't designed to be displayed, instead they may move the cursor to some other place on the screen or cause other odd effects so that is why the author of the original code filtered out those codes (and file viewers like HxD usually do the same, convert non-printable characters to a 'dot'.

Don't get too hung up on trying to display the PROM content as ASCII. For certain PROMs like the BASIC 1 of 2 PROM which do contain a lot of text, the ASCII readout shows you instantly that everything is kind of working, but what you are really aiming for is to get the hex readout to be byte-for-byte identical to the hex readout of the original file.

I had a quick look at some of the differences between my screenshot - taken from the original code loaded into HxD - and your screenshot of the code - I'm still not quite sure how you got the code out of your reader into a file to then load into HxD?

Anyway - taking just one recurring byte from the original fragment that I posted, '1C', which occurs in a number of locations. Looking at the same locations in your snapshot they contain all different values, which is a shame - if they all contained the same wrong value we could have indulged in a bit of Bletchley style codebreaking to figure out how they were being jumbled up (two databits swpapped over, possibly) but it's nothing that obvious.
SiriusHardware is offline   Reply With Quote
Old 8th Feb 2021, 10:24 pm   #542
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by ScottishColin View Post
I open the serial monitor and watch it run, then cut and paste.
Paste it where? Into Notepad or something then save it as a file? And then load it into HxD?

Hxd isn't very clever about recognising various types of file, by default, it assumes files are raw binary even if they are actually ASCII hex or Intel Hex.

Just try this:

Temporarily reduce the loop count from 2048 to just 256, so it only reads out the first part of the PROM. Compare the 256 bytes the reader has displayed with the first 256 bytes in the fragment I posted. Do the hex numbers match?
SiriusHardware is offline   Reply With Quote
Old 8th Feb 2021, 10:33 pm   #543
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

Better look - they match now.

1c224a564c201e001824427e42424200
7c22223c22227c001c22404040221c00
78242222222478007e40407840407e00
7e404078404040001c22404e42221c00
4040427e424242001c08080808081c00
0e040404044438004244487048444200
4040404040407e0042665a5a42424200
4262524a464242001824424242241800
7c42427c40404000182442424a241a00
7c42427c484442003c42403c02423c00
3e080808080808004242424242423c00
42424224241818004242425a5a664200
00402418244242002222221c08080800
7e02041820407e003c20202020203c00
00402010080402003c04040404043c00
00081c2a08080808000010207f201000
ScottishColin is offline   Reply With Quote
Old 8th Feb 2021, 10:41 pm   #544
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

1c 22 4a 56 4c 20 1e 00 18 24 42 7e 42 42 42 00
7c 22 22 3c 22 22 7c 00 1c 22 40 40 40 22 1c 00
78 24 22 22 22 24 78 00 7e 40 40 78 40 40 7e 00
7e 40 40 78 40 40 40 00 1c 22 40 4e 42 22 1c 00
40 42 42 7e 42 42 42 00 1c 08 08 08 08 08 1c 00
0e 04 04 04 04 44 38 00 42 44 48 70 48 44 42 00
40 40 40 40 40 40 7e 00 42 66 5a 5a 42 42 42 00
42 62 52 4a 46 42 42 00 18 24 42 42 42 24 18 00
7c 42 42 7c 40 40 40 00 18 24 42 42 4a 24 1a 00
7c 42 42 7c 48 44 42 00 3c 42 40 3c 02 42 3c 00
3e 08 08 08 08 08 08 00 42 42 42 42 42 42 3c 00
42 42 42 24 24 18 18 00 42 42 42 5a 5a 66 42 00
00 42 24 18 24 42 42 00 22 22 22 1c 08 08 08 00
7e 02 04 18 20 40 7e 00 3c 20 20 20 20 20 3c 00
00 40 20 10 08 04 02 00 3c 04 04 04 04 04 3c 00
00 08 1c 2a 08 08 08 08 00 00 10 20 7f 20 10 00


Here's a better text for comparison.

Colin.
ScottishColin is offline   Reply With Quote
Old 8th Feb 2021, 10:53 pm   #545
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Ah! That's better! The reader is actually working perfectly, it's just that HxD was trying to read your ASCII HEX file as a raw binary file.

You can make the reader sketch space the bytes out like that by making this small mod. (Maybe you already did?)

Code:
//    for (y = 0; y < 16; y++)
      {
        Serial.print(hex[ (d[y] & 0xF0) >> 4  ]);
        Serial.print(hex[ (d[y] & 0x0F)       ]);
	Serial.print(" "); // <------ added space between columns 
      }
What you need now is something which CAN read ASCII hex and convert it to raw binary, same format as the original files online are in. Once you have it in that form, HxD will be able to load it correctly and I believe it can load more than one file and compare them one against the other.

Any suggestions for a file format converter, ASCII hex to plain binary, anyone?
SiriusHardware is offline   Reply With Quote
Old 8th Feb 2021, 10:58 pm   #546
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,043
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by ScottishColin View Post
1c 22 4a 56 4c 20 1e 00 18 24 42 7e 42 42 42 00
7c 22 22 3c 22 22 7c 00 1c 22 40 40 40 22 1c 00
78 24 22 22 22 24 78 00 7e 40 40 78 40 40 7e 00
7e 40 40 78 40 40 40 00 1c 22 40 4e 42 22 1c 00
40 42 42 7e 42 42 42 00 1c 08 08 08 08 08 1c 00
0e 04 04 04 04 44 38 00 42 44 48 70 48 44 42 00
40 40 40 40 40 40 7e 00 42 66 5a 5a 42 42 42 00
42 62 52 4a 46 42 42 00 18 24 42 42 42 24 18 00
7c 42 42 7c 40 40 40 00 18 24 42 42 4a 24 1a 00
7c 42 42 7c 48 44 42 00 3c 42 40 3c 02 42 3c 00
3e 08 08 08 08 08 08 00 42 42 42 42 42 42 3c 00
42 42 42 24 24 18 18 00 42 42 42 5a 5a 66 42 00
00 42 24 18 24 42 42 00 22 22 22 1c 08 08 08 00
7e 02 04 18 20 40 7e 00 3c 20 20 20 20 20 3c 00
00 40 20 10 08 04 02 00 3c 04 04 04 04 04 3c 00
00 08 1c 2a 08 08 08 08 00 00 10 20 7f 20 10 00


Here's a better text for comparison.

Colin.
Well that looks good compared to characters-2.901447-10.bin which shows that you're reading the PROM correctly!
Could you make a checksum by adding the bytes together to make a checksum and displaying it in hex?.
Slothie is online now   Reply With Quote
Old 8th Feb 2021, 11:01 pm   #547
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by SiriusHardware View Post
Ah! That's better! The reader is actually working perfectly, it's just that HxD was trying to read your ASCII HEX file as a raw binary file.

You can make the reader sketch space the bytes out like that by making this small mod. (Maybe you already did?)

Code:
//    for (y = 0; y < 16; y++)
      {
        Serial.print(hex[ (d[y] & 0xF0) >> 4  ]);
        Serial.print(hex[ (d[y] & 0x0F)       ]);
	Serial.print(" "); // <------ added space between columns 
      }
What you need now is something which CAN read ASCII hex and convert it to raw binary, same format as the original files online are in. Once you have it in that form, HxD will be able to load it correctly and I believe it can load more than one file and compare them one against the other.

Any suggestions for a file format converter, ASCII hex to plain binary, anyone?
That code to add a space is actually what I did. You have no idea how pleased this all makes me. I can write scripting languages like REXX until the cows come home, but the Arduino language being based on c/c++ is what put me off all these years.

It shouldn't have.
ScottishColin is offline   Reply With Quote
Old 8th Feb 2021, 11:08 pm   #548
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Good, because we'll be letting you fly solo eventually.

That Mega will be one of the most powerful experimental / diagnostic tools you could ever have once you really get the hang of it.
SiriusHardware is offline   Reply With Quote
Old 8th Feb 2021, 11:13 pm   #549
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

For conversion of ASCII Hex to raw binary, it would be almost incredible if something like that did not already exist for Linux - I know you probably run a Windows PC but I expect all your Rasberry Pis run Linux.

Do you have Python installed on your PC? It's quite likely someone has written a Python utility to do it as well.

...Or maybe you can even write such a thing in REXX, which I confess I have never heard of.

Anyway, I think you owe yourself a beer. I bet you wish you had hung on to the PROMs now.
SiriusHardware is offline   Reply With Quote
Old 8th Feb 2021, 11:18 pm   #550
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,043
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by SiriusHardware View Post
Any suggestions for a file format converter, ASCII hex to plain binary, anyone?
You could try this online converter https://tomeko.net/online_tools/hex_to_file.php?lang=en

The page also suggests a windows program, although usual warnings about running .EXE files downloaded from the net apply!
Slothie is online now   Reply With Quote
Old 8th Feb 2021, 11:46 pm   #551
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Could alternatively modify the reader sketch to generate Intel Hex rather than plain ASCII hex, because HxD can 'Import' Intel Hex?

Then it would be possible to cut+paste the Intel Hex code generated by the reader into a plain text editor, save it as a file and import that file (as Intel Hex) into HxD.
SiriusHardware is offline   Reply With Quote
Old 9th Feb 2021, 11:03 am   #552
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

Fyi - reading a ROM with a Pi.

https://zedstarr.com/2021/02/09/read...mpression=true
ScottishColin is offline   Reply With Quote
Old 9th Feb 2021, 12:12 pm   #553
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

If I load the output from my program and the characters-2.901447-10.bin file, there are some small differences. For example at offset CO, my output is Hex 00 and in the bin files, it is 42. There are other examples - at 1C0, my output is 0E and the bin file is 3C.

Any ideas?

*** EDIT *** interestingly all the differences are in the first character of each 16 character dump from the ROM - there are about 6 in total.

Colin.
ScottishColin is offline   Reply With Quote
Old 9th Feb 2021, 12:15 pm   #554
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by Slothie View Post
Quote:
Originally Posted by SiriusHardware View Post
Any suggestions for a file format converter, ASCII hex to plain binary, anyone?
You could try this online converter https://tomeko.net/online_tools/hex_to_file.php?lang=en

The page also suggests a windows program, although usual warnings about running .EXE files downloaded from the net apply!
Thanks - the online version worked nicely. I'm not into download random .EXE files either.
ScottishColin is offline   Reply With Quote
Old 9th Feb 2021, 1:02 pm   #555
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Are the differences consistent? Do you get the same incorrect characters in the same places every time?
SiriusHardware is offline   Reply With Quote
Old 9th Feb 2021, 1:11 pm   #556
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

Also - are you sure those differences are present in the original reader readout, and not just being introduced by the online converter?

You should be able to scroll up and down the output from the reader in the Arduino serial monitor, to inspect all of its output.
SiriusHardware is offline   Reply With Quote
Old 9th Feb 2021, 1:14 pm   #557
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 7,061
Default Re: Non-working Commodore PET 3016

I'm wondering if, when you 'cut' the output from the reader, you are collecting a few extra (invisible) bits and pieces which are confusing the online converter. What do you paste the output into? It needs to be a plain text editor like Notepad, not a 'word processor' like Wordpad.
SiriusHardware is offline   Reply With Quote
Old 9th Feb 2021, 1:24 pm   #558
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

First difference - I have 00, .bin has 42 at C0

Second difference - I have 80, .bin has 04 at 240

Third difference - I have A0, .bin has 08 at 2C0

Fourth difference - I have 0F, .bin has FF at 3C0

Fifth difference - I have 18, .bin has 40 at 440

Sixth difference - I have 0E, .bin has 3C at 5C0

Seventh difference - I have 40, .bin has 42 at 640

Eighth difference - I have A0, .bin has 42 at 6C0

Ninth difference - I have 0F, .bin has FF at 7C0
ScottishColin is offline   Reply With Quote
Old 9th Feb 2021, 1:24 pm   #559
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

Quote:
Originally Posted by SiriusHardware View Post
I'm wondering if, when you 'cut' the output from the reader, you are collecting a few extra (invisible) bits and pieces which are confusing the online converter. What do you paste the output into? It needs to be a plain text editor like Notepad, not a 'word processor' like Wordpad.
I paste into Notepad++
ScottishColin is offline   Reply With Quote
Old 9th Feb 2021, 1:27 pm   #560
ScottishColin
Heptode
 
Join Date: May 2012
Location: Perth, Scotland
Posts: 647
Default Re: Non-working Commodore PET 3016

OK - give me time. I've looked at the original Arduino output on the screen and it's looking better.

Is there any way to output the Arduino output to a file instead of me having to cut and paste?
ScottishColin is offline   Reply With Quote
Reply

Thread Tools



All times are GMT. The time now is 3:00 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright ©2002 - 2021, Paul Stenning.