Need for speed - the ROM-patches

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Need for speed - the ROM-patches

Post by Andy Rea »

Thanks for digging that out siggi, i'm gonna patch an image of the ZX81 rom with these and see what happens ;)

Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Need for speed - the ROM-patches

Post by Andy Rea »

Siggi,

I looked with interest at the 3T NMI patch which i shal implement, but was most interested to read at the end of the article about using an 'external' counter to trigger the NMI just twice during SLOW mode, this would require more patching to ensure the alternate AF pair is loaded with $FF so that a single NMI will kick the Vsync or Video routines into action.

Did anybody ever try this ?

Of course it would also mean that 'demo' programs that manipulate the display would no longer work... but a 24% speed increase looks tempting...


Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi »

Andy Rea wrote: Did anybody ever try this ?
Sorry, I don't know (I came later to the team in 2004). But maybe you could ask Peter (at Mahlerts)?

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
zsolt
Posts: 214
Joined: Wed Apr 20, 2011 11:43 am
Location: Fót, Hungary

Re: Need for speed - the ROM-patches

Post by zsolt »

Yesterday I tested the QCOM1-patch and it is very cool :D
the source file of the modified rom and the test programs you can find in the attachment
the source file of the modified rom and the test programs you can find in the attachment
patch_tst.png (11.77 KiB) Viewed 8569 times
Many thanks to Siggi and of course to Ludwig!

What about the FP-patch, mentioned by the editor at the end of the article?
Regards,
Zsolt
Attachments
SG81_b.zip
(80.03 KiB) Downloaded 361 times
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Need for speed - the ROM-patches

Post by Andy Rea »

Cool work as always Zsolt, i'm gonna give those roms a go in the Crazy 17.7Mhz Zeedy and see what results i get with CLCKFREQ.

Thanks for taking the time to do it, saved me the hassle :D

regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi »

zsolt wrote: What about the FP-patch, mentioned by the editor at the end of the article?
I asked Peter about that. Hope he has some information ...

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Need for speed - the ROM-patches

Post by PokeMon »

I have some idea, not proofed now but maybe you can think about.
The CPU takes a HALT and wait for interrupt in SLOW display mode.
This is not very effective.
But CPU does execute any instruction with bit 6 set, so could be used a RET instruction instead of HALT to jump back and continue program work till interrupt comes.
This would add significant process time in slow mode with combination empty DFILE.

So a CALL is needed instead of a JP (HL) and the address on stack to continue BASIC (or machine code) program.
A CALL instead of a JP would add about 8 more cycles (=2 chars) and the RET about 12 more cycles (=3 chars).
This trick would add instruction time of about 27 chars * 1,2 us = 32us per display line (empty screen).
So in one frame could be added process time of about 6ms / frame which is about 30% faster.
In fact the effect is more because the program can calculate in non displayed area till new line (HSYNC) which would add about 10us more, so effect could be up to 40%.
No in true its more because you have to calculate to normal process time in slow mode. Should be double speed minimum.
Worth a try ! ;)

Have to do follwoing changes:
Allow collapse DFILE anyway with more memory
Adapt ROM routines for display
Check of registers used

Maybe this would be a big patch but could give impressive speed in slow mode with some display output (okay full screen make no sense).
So if somebody have time, this would be a great job. :shock:
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi »

siggi wrote:
zsolt wrote: What about the FP-patch, mentioned by the editor at the end of the article?
I asked Peter about that. Hope he has some information ...

Siggi
Peter sent me an old mail (dated 2002) about that topic. Here is the mail from Ludwig:
Hallo Peter,

ich habe mein altes QCOM ganz neu überarbeitet und möchte es
der Öffentlichkeit zur Verfügung stellen. QCOM ist eine BASIC-
Erweiterung, die dem Interpreter die Zeilen-Sucherei abnimmt.

Jetzt existieren 2 Versionen:

QCOM1, die Minimal-Version, bei der man nur 6 Bytes im ROM
patchen muß

QCOM2, die Voll-Version, die nicht ins 8KB-ROM passt.

(QCOM3 ist dann noch ein Zusatz-Programm zu QCOM2 nur fuer
Programme mit berechneten Zeilen-Nummern)

In der ZIP-Datei findest Du Beschreibungen, Quelltexte, fertige ROMs,
XTender2-Dateien und BASIC-Beispiele.

Nicht von mir ist MC2-DEMO, und ich habe zur Assemblierung auch
den Quelltext des ZX81-ROMs von Geoff Wearmouth benutzt.

Ein 'Abfall-Produkt' sind die 2 Patches:

Der 3T-Patch ändert den NMI und gehört zur Kategorie Tips&Tricks.

Der FP-Patch ändert Teile des RST 28H.

Ich musste leider alles mit dem Emulator testen. Bitte teile mir mit, wenn
etwas nicht funktioniert oder unverständlich ist.

Tschüss,

Ludwig
And here is more information. About the FP/RST28 patch only some information (not the source) is given. But I think, it is obsolete with the SG81 rom:
QCOM.zip
(68.58 KiB) Downloaded 380 times
HTH Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Need for speed - the ROM-patches

Post by Andy Rea »

Whilst at Mahlerts enjoying the fantastic company of our German ZX-team Brothers, i had chance to try out CLCKFREQ.P with the SG81_B.ROM as posted by SZOLT above, the folowing results were great knocking a further 42 Frames off an already fast zeddy :D

with a completely normal zx81rom runnung in SuperTurbo i used to score 262 FRAMES

result with SG81_B.ROM
Image

Could this be the fastest Zeddy Alive.

Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Need for speed - the ROM-patches

Post by Andy Rea »

Yes !!!! I've done it... 20Mhz :D

http://www.youtube.com/watch?v=gN4DbRwSXO8

Based very much on the uber Zeddy that is a modified issue 1 board, this one is built on protoboard, has a 40Mhz master Osc, which is divided by 2, for 20Mhxz, by 6 for 6.66Mhz (instead of 6.5) and divided by 12 for 3.25Mhz, it has 128K fast Sram (10 ns, but i reckon 35ns shoudl still work ) some extra logic for clock switching without Glitches.

Gotta try the SG81 rom in it, and the Qcom patches, and recode the wait logic to include Wilf's wait mod... then this sucker will really rock.

Only problem now is that the ay chips require a relatively long write pulse so i'm thinking i will add some auto-wait states for IO activity when running in turbo, this should have minimal impact since as your unlikely to be doing intensive io all the time.

Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
Post Reply