Rom hex file help

Discussion about ZX80 / ZX81 Software
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Rom hex file help

Post by Moggy »

stefano wrote:Interesting. On the screen being shifted on the top-right I noticed the same effect on EO, which should be fixable.
The NTSC version does not seem to suffer the same problem, did you try it ? I don't know if there are compatibilty problem mixings the zx81 version and the h4 ROM versions.

The strange thing of a missing inverse attribute on a column is odd.. on did you test the rom on an original zx81 ?

Yes Stefano the visual faults are only apparent on real ZX81 using the ROM image from eighty one, and I have burned three EPROMS (2764 as per original)with this image to make sure it was not a one off.

The display being up and to the right is more apparent on real ZX81 and as for the missing inverse it is almost like half a character wide if you can understand what I mean the letter p used in my example shows the downstroke of the p inverted but not the loop of the p .


I should also add I only use real Zeddy(PAL) on old CRT TV as the original ROM was intended to be used so cannot try NTSC version.

How it works on emulators is of no interest to me only insofar as it effects real equipment and like I said before if no one has a genuine original EPROM from Skywave software to compare with the eighty one image then everything is guesswork.

A screen shot as example please excuse poor camera work.
Attachments
h4th PAL.JPG
(1.32 MiB) Downloaded 373 times
Last edited by Moggy on Wed Nov 05, 2014 5:03 pm, edited 1 time in total.
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Rom hex file help

Post by stefano »

How it works on emulators is of no interest to me only insofar as it effects real equipment.

Yeah, and they're often misleading.. I'd have never worked on a zx81 port for z88dk if I knew how far the xtender emulator was from the real thing !! Nevertheless they can be powerful and comfortable debugging tools if you do not relay on them too much.
EO is surprisingly close to the reality and it's the only thing I can deal with while I'm on a train with a laptop :| ..assembly happened to become my fav crosswords game


At the moment I noticed this:
LD HL,0BB8h -> 3000 decimal, which seems to be a guessed value. ;)
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Rom hex file help

Post by Moggy »

Picture added since last post.
Sorry for massive size I'm really bad at this.


The inverse mask seems to step one pixel width into the letter p.
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Rom hex file help

Post by stefano »

Fascinating :)
You are not using a CCP post-processing mod of some kind, are you ?

In the meantime, I found an interesting point:

; PAL : 592 lines , NTSC: 23h x8 = 280 lines and not 262 (for the pure NTSC standard)
00000071: LD A,4Ah ; <<< 23h in the NTSC version


Try the following:

copy Tree4th.rom h4.rom
debug h4.rom
-e 172 4A
-w
Writing 02000 bytes
-q


It should make the NTSC rom run with a frequency close to the european standards.
choose the value you prefer, 4b should, if I understood it correctly, count 600 lines.

My guess would be 46h, just to shake the things a little more.
Obviouosly you can poke the Husband's version and try to make it change freq. as well.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Rom hex file help

Post by Moggy »

Hi Stefano.

I should add before we go any further that I'm not the cleverest on the forum so things need to be simple for me.

Also I don't use a modern EPROM programmer I use one for the ZX Spectrum being the dinosaur that I am, and it's good for the old 25v devices I come across from time to time.

Whilst I can look at the data to be burned and alter what is needed before burning it is far simpler for to burn a completed image altered in say an hex editor but unfortunately my skills don't run to that. :oops:

I truly am one of the old school real zeddy users doing things as was normal for the period , time stopped still for me when the Beatles split, up so no modern assemblers cross compilers or willem programmers have ever crossed my threshold I do things the hard way :lol:

Many thanks for all the time and effort spent examining this little puzzle by the way Stefano, In am truly grateful and have added this to my small knowledge of all things 81. :D
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Rom hex file help

Post by stefano »

Good.
First of all, you are now my hero .. 8-) no kidding, wow, an eprom programmer and a Speccy makes me remember that boy in the "Wargames" movie, probably it was him inspiring the "McGyver" series !

I still wouldn't exclude the possibility that the roms were buggy also at the beginning, I had very hard times trying to shift the picture left and all my attempts so far resulted in out-of-sync pictures or on a further right shifting !

All the changes I could do were heavily limited by the code size and every time I had to shift full portions to get the same results with equivalents (i.e. JP in place of JR).
All the Counter values I could spot were not to be touched because of the huge shift they'd have resulted.

The picture redrawing code includes the keyboard scanning stuff and its tuning must have been quite hard.

In conclusion, it *is* still possible that the ROMs were modified to be runnable on the emulators but the probability is very low.

At the time it was perfectly acceptable to "tune" a TV monitor to center the picture, and probably also a defect like the missing inverse effect on the rightmost column would have been considered a minor bug.

I do not surrender, but it does not seem to be a thing which can be fixed quickly :roll:
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Rom hex file help

Post by Moggy »

WOW I'm somebodies hero thanks for that stefano. :oops:

I did tell a slight lie though.

I said emulators are not much use to me but I use the block load feature in eighty one to load whatever ROM image or data I want to burn to mem location 50000, save it via spectrum save function Save "" code 50000;4096 for say a 4k ROM , as a WAV file. Put the WAV onto a cassette load into real speccy then point the EPROM burner to location 50000 and burn away!!

I have used a similar method in eighty one also to turn the Memotech z80 assembler and other Memotech units ROM code into P files to use with the ZXpand so instead of getting old gear out of the cupboard the ZXpand becomes whatever Memotech unit I need.

So eighty one has a use for me after all. :lol:


As for the 4th ROM I would take a break from it Stefano it will drive you mad in the end!!
The inverse bug can be worked around as this implementation of forth allows you to define "screens" of a given size and it is no trouble to define a screen with the right most column cut off, though whilst okay displaying graphics in these screens I have had trouble displaying numbers created on the stack when they exceed the boundries of the defined screen.

For example create a small say ten by ten screen and use a DO LOOP to print numbers one to a thousand and a crash follows, but printing 10000 chrs produces a nice scroll effect.

Printing numbers in an undefined screen produces no problems and the screen scrolls in the usual way when the numbers printed get to the screen bottom.

One final point.

The manual shows how to use the so called "clock" of the 81 to use real time time multi tasking.
The clock I set on my 81 gained ten minutes in the first two hours and I worked out the simple tasks I set would result in them being implemented a week too early :lol:

So no nuclear power plant is going to be run with my Zeddy :!:
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Rom hex file help

Post by stefano »

I miss the manual.. is it online ?
This is a great piece of history and.. well probably the ZX81 version is the most amazing version.

By the way I think I have interesting new now !

As before, use DEBUG and edit a copy of the ROM (for you probably it will be the Husband's version).

at the 'minus prompt enter:
-e 183 CD 8d 00 D3 FE D1 C1 F1 E1 C9 3E EA 76 D3 FD
-w
-q

You'll have a patched version, this time slightly shifted on the left side.
I'm postponing a bit the sequence:
00000083: LD A,EAh
00000085: HALT ; Wait for Interrupt
00000086: OUTA (FDh) ; turn off the NMI generator. *** left margin timing begins NOW ***


I got it half/experimentally with EightyOne. I'm not sure of the results on a real machine but confident, though.

I don't think that, if the ROM was patched it happened here.. the 'OUTA/CALL/OUTA' sequence is just too clean.
My patch makes the HALT happen a little later, inside the 'CALLed' portion (which now is entered at 008Dh rather than 0092h), and so also closer to the end of row event.
Notice how big is the shift when only one more instruction (the CALL jump) is executed.

Code: Select all

;    PAL : 592 lines ,  NTSC: 23h x8 = 280 lines and not 262 (for the pure NTSC standard)
00000071:	LD A,4Ah	; <<<   23h in the NTSC version
00000073:	EX AF,AF'
00000074:	PUSH AF
00000075:	PUSH BC
00000076:	PUSH DE
00000077:	LD BC,1809h
0000007A:	LD HL,0098h
0000007D:	LD (FC80h),HL
00000080:	LD HL,(FC6Eh)
00000083:	* LD A,EAh
00000085:	* HALT		; Wait for Interrupt
00000086:	* OUTA (FDh)         ; turn off the NMI generator. *** left margin timing begins NOW ***
00000088:	CALL 0092h
0000008B:	OUTA (FEh)	; Writing any data to this port enables the NMI generator.
0000008D:	POP DE
0000008E:	POP BC
0000008F:	POP AF
00000090:	POP HL
00000091:	RET

                *	< moving the 'HALT' block here shifts the display on the left
00000092:	LD R,A
00000094:	LD A,DDh
00000096:	EI
00000097:	HALT

00000098:	OUTA (FDh)         ; turn off the NMI generator.
0000009A:	INA (FEh)
0000009C:	LD A,1Eh
0000009E:	EX AF,AF'
0000009F:	LD HL,(FC82h)
000000A2:	LD (FC80h),HL
000000A5:	PUSH BC
000000A6:	PUSH AF
000000A7:	LD HL,0000h
000000AA:	LD BC,FEFEh
000000AD:	IN A,(C)		; read keyboard
000000AF:	OR E0h
(...)
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Rom hex file help

Post by stefano »

One more thought about your sentence: "The clock I set on my 81 gained ten minutes in the first two hours .."

Taking in consideration the 50hz/60hz jiffie duration differences:
2 hours = 7200 seconds. If we multiply it by 5 and divide by 6 we get 6000 seconds.. it turns out to be exactly 10 minutes shorter.
Perhaps it is only a coincidence, but it could also be a useful hint :P
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Rom hex file help

Post by Moggy »

stefano wrote:One more thought about your sentence: "The clock I set on my 81 gained ten minutes in the first two hours .."

Taking in consideration the 50hz/60hz jiffie duration differences:
2 hours = 7200 seconds. If we multiply it by 5 and divide by 6 we get 6000 seconds.. it turns out to be exactly 10 minutes shorter.
Perhaps it is only a coincidence, but it could also be a useful hint :P
Hi Stefano here is the manual it was OCRd from the original by a member of the German forum I believe though I could be wrong about that,and whilst it is a great thing to have there seems to be a bit of confusion regarding double precision maths examples and although it shows 64 bit maths capabilities it doesn't tell you how to extract a workable result.

As for the timing differences you mention between PAL and NTSC.

As far as I'm aware the 60htz treeforth ROM is a rip off of the original PAL and has nothing to do with David Husband of Skywave software ( I will stand corrected if anybody knows otherwise without guessing) so anything to do with a multitasking "clock" is based solely on the 50htz PAL ROM (a paragraph from section 15-0 of the manual refers to 50htz timings only ) and it's inaccuracy is down the differing speeds of the oscillators fitted to each 81.
Some run fast (mine) some run slow.

If you ever get to the stage where you create a complete ROM image for eighty one then I will happily burn that to an EPROM and try with the real zeddy, although 2564's are non existent and the 25v 2764's that Skywave also used are a bit hard to find at the moment. ( yes I know 12v versions exist as fitted to the ZXpand but my burner can't use them) :(
Attachments
zx81-forth-manual.rar
ZX81 FORTH manual.
(2.2 MiB) Downloaded 249 times
Post Reply