Weird ZX81 Behavior Cased By ROM

Discussions about Sinclair ZX80 and ZX81 Hardware
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

My primary TS1000 started misbehaving. Whenever I did any sort of INKEY$ loop, it would quit with either error 2 or 4. I thought it was a RAM wobble issue but after lots of contacts cleaned, the problem persisted. I decided to try switching out various ICs and discovered the ROM was the culprit.

The simplest failure example was this:

Code: Select all

10 LET K%=INKEY%
20 IF K%="" THEN GOTO 10
The machine would error out with either a 2 or 4 code. With a different ROM it worked. All my ROMs seem to be the same, as I ran a checksum and they all had the identically value.

Code: Select all

10 FAST
20 LET A = 0
30 FOR B = 0 TO 8191
40 LET A = A + PEEK B
50 NEXT B
55 PRINT “ROM TEST”
60 PRINT A
70 PRINT SQR 0.25
All three had a value of 855106 and printed 0.5 for the squarer root call. So question, why would a bad ROM chip, with its checksums ok, cause this kind of behavior?


Here are pics of each. The Motorola one is the bad ROM.

Sinclair-ROM.png
Motorola-ROM.png
NEC_ROM.png
Last edited by bwinkel67 on Sun Oct 20, 2024 4:42 pm, edited 3 times in total.
User avatar
1024MAK
Posts: 5527
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Weird ZX81 Behavior Cased By ROM

Post by 1024MAK »

I’m not sure why, but your post has no attached pictures...

Note that the forum does have a limit on the file size of attachments.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Spring approaching...
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Re: Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

I changed the pics to PNG....
Moggy
Posts: 3493
Joined: Wed Jun 18, 2008 2:00 pm

Re: Weird ZX81 Behavior Cased By ROM

Post by Moggy »

You have a 622 2nd issue ROM, a final issue 649 and the Motorola one I believe is also a 649.

Some ROM faults can be caused by tarnished pins so try cleaning the ones on the ROM that appears faulty.

More ROM info can be found halfway down this thread courtesy of Mark.

https://www.sinclairzxworld.com/viewtop ... 693#p14693
???????????????????????????PIINKEY$?????RND????????????????????????????????????????????????????????PI????????
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Re: Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

I did clean the pins on the Motorola ROM and no change. It also seems to give the best picture through RF when RAM pack installed. I've noticed over time that if the a RAM wobble occurs, the picture interference gets less. So somehow it seems that ROM is impacted RAM.
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Re: Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

Moggy wrote: Sun Oct 20, 2024 4:50 pm You have a 622 2nd issue ROM, a final issue 649 and the Motorola one I believe is also a 649.
They all have the same checksum...isn't the content in all three the same?
User avatar
1024MAK
Posts: 5527
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Weird ZX81 Behavior Cased By ROM

Post by 1024MAK »

That checksum program will give the same result for both the 622 and 649 ROMs.

550 ROM checksum is 854885 SQR is 1.3591409
550 ROM with hardware bodge is ??? (not tested)
622 ROM checksum is 855106 SQR is 0.5
649 ROM checksum is 855106 SQR is 0.5

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Spring approaching...
User avatar
1024MAK
Posts: 5527
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Weird ZX81 Behavior Cased By ROM

Post by 1024MAK »

The 550 is the first (and original) ROM. It has a bug in the maths routine, hence the silly result for the square root function.

Some ZX81s have a daughter board that corrects the above bug by overriding a single byte with a different value when the Z80 executes it.

Sinclair corrected this bug in the 622 version. But this has a problem with the PAUSE command.

Hence a third (and final) version, 649, which corrects this.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Spring approaching...
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Re: Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

Hmm, then somehow a reordering of instructions could cause the same checksum. Or, some unlikely occurrence of taking away and adding instruction that results int he same value. I'm going to re-try computing the checksum using this modified code:

Code: Select all

10 FAST
20 LET A = 0
30 FOR B = 0 TO 8191
40 LET A = A + ((B+1) * PEEK B)
50 NEXT B
55 PRINT “ROM TEST”
60 PRINT A
70 PRINT SQR 0.25
Last edited by bwinkel67 on Sun Oct 20, 2024 9:33 pm, edited 1 time in total.
bwinkel67
Posts: 164
Joined: Mon Mar 23, 2020 2:38 am

Re: Weird ZX81 Behavior Cased By ROM

Post by bwinkel67 »

So with my new checksum program (maybe more accurately a really primitive hash) the three ROMs now give different value:

ROM 1 = 3424166000
ROM 2 = 3424958100
ROM 3 = 3424957100

Btw, I'm running a somewhat dated EigthyOne (i.e. I downloaded the latest a few years back and I don't tend to update -- I'm running v1.26) and its default seems to be ROM 2. Any reason for that?
Post Reply