ZX81 ROMs 3 types?

Discussions about Sinclair ZX80 and ZX81 Hardware
Lardo Boffin
Posts: 2160
Joined: Sat Nov 26, 2016 2:42 am

Re: ZX81 ROMs 3 types?

Post by Lardo Boffin »

This is getting interesting!
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ROMs 3 types?

Post by 1024MAK »

I’ll be honest and tell you that I’ve not actually looked into the method that the ZXpand uses to ‘page’ out the internal ROM. Although I know which signal line on the edge-connector it uses, the bit I have not looked into is the circuitry on the ZXpand board itself.

Anyway, putting aside the ZXpand for the moment, the other methods are to use a short machine code program to copy the ROM to RAM (assuming 16k bytes of RAM) and then save from there (to a PC as a WAV file or into an emulator). It is also possible to write a machine code program to save the ROM directly without copying to RAM, but that means coping the save to tape routine and modifying it. Not a good idea for an unknown ROM where the code may be located at a different ROM address.

Or if you have a EPROM programmer, use that (if you can find a pin compatible EPROM to select) or make up an adapter using a couple of stamped pin DIL sockets to match a 2764 EPROM. Despite needing a bit of soldering, this may be the easiest and fastest way.

Of course, there will be other ways if you have other mass storage or communication systems for your Zeddy ;)

I won’t have much spare time over the next five days, but should have some time next weekend.

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

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

Re: ZX81 ROMs 3 types?

Post by 1024MAK »

Oh, and these ROMs are SO R@RE that I only had to look at SIX boards before I found one! :lol:
And it’s in a socket :D
ZX81 ROM NEC D2364C 622
ZX81 ROM NEC D2364C 622
ZX81 ROM NEC D2364C 622

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

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Lardo Boffin
Posts: 2160
Joined: Sat Nov 26, 2016 2:42 am

Re: ZX81 ROMs 3 types?

Post by Lardo Boffin »

I had a quick scan through ‘Lardo buys another zeddy’ and ‘Different zeddies’ and counted six 622 ROMs in my photos.
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 ROMs 3 types?

Post by Moggy »

I do know how to extract the contents and save them without the ZXpand then convert to a P file for same as it is how I extracted the Memotech ROMS and involves a faff around with tape save/loading etc which is a pain to be honest so I've dropped Charlie a line to see if there is some way to bypass all this and read the Sinclair ROM whilst running under spand control.

The idea being to then load the two different ROMS to two different addresses in the spand and compare the differences. Thanks to Ian Logan we know the difference between the 550 and 622 ROMs only involved three bytes or so but there seems to be no documentation about the alterations made to this third and final 649 ROM (red faced perhaps about the first one and not wishing to admit to a second cock-up)so it would seem prudent to make an historical record of this final ROMs contents too if only for completeness.
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ROMs 3 types?

Post by 1024MAK »

The next question, is which ROM code is being used in all the emulators? The code from the 622 or the code from the 649? And which code are the disassemblies based on?

It’s best not to assume anything.

The other thing is, this may just be one or two bytes that are different, or maybe some of the code moved by one or two bytes. Functionally it would still be the same as long as the normal entry points were maintained.

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

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 ROMs 3 types?

Post by Moggy »

The listing does mention "some small errors" errors Plural, so whilst functionally the same, mathematically or perhaps logically not the same to the point of causing some computational upset
( I mean this in a true computational sense by those of us who use it as a computer and not some glitch in a game) or why bother with a third issue?

Also the big bang ROM which version is that based on?

I have noticed in Toddy Forth some spurious answers when doing large number fractional division and was assuming it was down to the fact That Toddy uses symmetrical not floored division( quite rightly in my opinion ), I'm now more inclined to suspect the ROM version.

Maths guru Frank O'Hara mentions in one of his articles that the "improved" ROM still contained errors (divisional and rounding ones I seem to recall) with workarounds to solve them in BASIC and seeing as he never mentioned a third ROM we can only assume he is referring to the 622 version and that the 649 ROM addressed those errors. Perhaps some one at Sinclair read his articles (Steven Vickers perhaps) and made the necessary but undocumented changes.

Either way it gives me something to do. :lol:
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 ROMs 3 types?

Post by Moggy »

Right after much faffing around I managed to dump the 2 ROMs which I have attached.

Now the interesting bit...

Obviously I needed to test the images so I first tried Eighty One, ran a ROM check and Eighty One says both ROMs OK with an identical checksum whereas real zeddie says not!

Checksum 877117 for the 649 and 855106 for the 622 or accepted new ROM on real kit, whereas Eighty One shows 855106 for both ROMs.

Suspecting that this was yet another of Eighty Ones quaint little quirks I loaded the ROMS into VB81which said BOTH ROMS were faulty!?
However when looking at the ROM list in VB81 it has a comment after each ROM and I quote..

622ROM crc32 522C37B8 ZX81 3rd revision ZX81B ROM (This is supposedly the second revision but never mind.)

649ROM crc32 4B1DD6E8 Timex Sinclair 1000/ZX81 2nd revision ROM ZX81A ROM yet this is supposed to be the 3rd revision ROM!

And no I didn't mix them up trust me I did the whole bloody process three times just to make sure! and a cursory glance shows a difference in the first few bytes between the two but didn't check further as my old eyes are very tired now.

Both these ROMS seemed to work ok otherwise I ran the 25 anni demo and that was ok so can only conclude something amiss in the emulators.
A cursory check showed a difference in the first few bytes(bytes 2 to 7) but my eyes are tired now so will leave it alone for a while.
So make of them what you will I am now ready for my bed any time soon !!


VERY LATE EDIT. 17/4/23

At the request of another forum member I have included the earlier 550 ZX81 ROM in the zip file
Attachments
550 622 649 ROMS.zip
(20.31 KiB) Downloaded 55 times
Last edited by Moggy on Mon Apr 17, 2023 10:58 am, edited 1 time in total.
User avatar
1024MAK
Posts: 5101
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX81 ROMs 3 types?

Post by 1024MAK »

Thanks Moggy ;) :D 8-)

622ROM.rom and 649ROM.rom - are definitely different.
622ROM.rom and "zx81 version 2 'improved' rom (Sinclair).rom" - different, same differences as above.
649ROM.rom and "zx81 version 2 'improved' rom (Sinclair).rom" - are the SAME.

I think that I got the "zx81 version 2 'improved' rom (Sinclair).rom" file from Geoff Wearmouth's old web site. Or I may have got it from this site...

Image
Image

Anyway, the only differences are in the pause command routine. See the disassembly below (from Geoff Wearmouth's old web site):

Code: Select all

; ---------------------------
; THE 'PAUSE' COMMAND ROUTINE
; ---------------------------

;; PAUSE
L0F32:  CALL    L0EA7           ; routine FIND-INT
        CALL    L02E7           ; routine SET-FAST
        LD      H,B             ;
        LD      L,C             ;
        CALL    L022D           ; routine DISPLAY-P

        LD      (IY+$35),$FF    ; sv FRAMES_hi

        CALL    L0207           ; routine SLOW/FAST
        JR      L0F4B           ; routine DEBOUNCE

; ----------------------
; THE 'BREAK' SUBROUTINE
; ----------------------
;
;

;; BREAK-1
L0F46:  LD      A,$7F           ; read port $7FFE - keys B,N,M,.,SPACE.
        IN      A,($FE)         ;
        RRA                     ; carry will be set if space not pressed.
Compare to this code from "The Complete Timex TS1000 / Sinclair ZX81 ROM Disassembly" by Dr. Ian Logan & Dr. Frank O'Hara:

Code: Select all

THE 'PAUSE' COMMAND ROUTINE

The parameter of the PAUSE command is determined. Fast mode is selected for the period of the PAUSE and the DISPLAY-P routine called.

On returning the correct mode, SLOW or FAST is selected and the value of FRAMES-hi set to hex.FF. A jump to D-BOUNCE is then made.

Note: In the 'unimproved' ROM the value given to FRAMES-hi. was determined by a SET 7, (FRAMES-hi.) instruction and this failed to ensure that the 15th. bit of FRAMES would remain set as the first action of DISPLAY routine is to decrement FRAMES.

0F32 PAUSE	CALL	0EA7,FIND-INT.
		CALL	02E7,SET-FAST
		LD	H,B
		LD	L,C
		CALL	022D,DISPLAY-P
		CALL	0207,SLOW/FAST
		LD	(FRAMES-hi.),+FF
		JR	0F4B,D-BOUNCE

THE 'BREAK-1' SUBROUTINE

The 'break' key is tested.

0F46 BREAK-1	LD	A,+7F
		IN	A,(+FE)
		RRA
I've not disassembled the 622ROM.rom code (yet), far too early in the morning for that!

Mark
Attachments
ZX81_622ROM_vs_version 2 'improved' rom (Sinclair)chopped.png
ZX81_622ROM_vs_version 2 'improved' rom (Sinclair)
ZX81_622ROM_vs_version 2 'improved' rom (Sinclair)
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 ROMs 3 types?

Post by Moggy »

Excellent as always Mark. :ugeek:

Can I just point out an error I made last night(I was very tired) :oops:

I said there was a difference in the first few bytes.

What I meant to say was that the first few byte difference was between the the 622/649 ROMs and the ZPXAND ROM Not between the 622 and 649.

Are you saying the only difference between 622 and 649 is the pause command? I thought the altered PAUSE routine was between the bugged ROM and the 622 ROM. If I remember rightly with the bugged ROM a poke had to be used after PAUSE but not with the 622, surely there has to be a bigger difference between the two later ROMs?

Sorry if I'm not reading this correctly I'm still half asleep. :oops:
Post Reply