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: 1264
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Need for speed - the ROM-patches

Post by Andy Rea » Sat Mar 17, 2012 7:28 pm

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

Andy
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

User avatar
Andy Rea
Posts: 1264
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Need for speed - the ROM-patches

Post by Andy Rea » Sat Mar 17, 2012 8:02 pm

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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

User avatar
siggi
Posts: 752
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi » Sat Mar 17, 2012 10:50 pm

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
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
zsolt
Posts: 153
Joined: Wed Apr 20, 2011 10:43 am
Location: Fót, Hungary

Re: Need for speed - the ROM-patches

Post by zsolt » Mon Mar 19, 2012 6:38 pm

Yesterday I tested the QCOM1-patch and it is very cool :D
patch_tst.png
the source file of the modified rom and the test programs you can find in the attachment
patch_tst.png (11.77 KiB) Viewed 2782 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 72 times

User avatar
Andy Rea
Posts: 1264
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Need for speed - the ROM-patches

Post by Andy Rea » Mon Mar 19, 2012 10:04 pm

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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

User avatar
siggi
Posts: 752
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi » Tue Mar 20, 2012 8:29 am

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
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
PokeMon
Posts: 2128
Joined: Sat Sep 17, 2011 5:48 pm

Re: Need for speed - the ROM-patches

Post by PokeMon » Tue Mar 20, 2012 6:25 pm

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: 752
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Need for speed - the ROM-patches

Post by siggi » Wed Mar 21, 2012 10:03 pm

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 60 times
HTH Siggi
My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
Andy Rea
Posts: 1264
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Need for speed - the ROM-patches

Post by Andy Rea » Mon Mar 26, 2012 9:33 pm

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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

User avatar
Andy Rea
Posts: 1264
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Need for speed - the ROM-patches

Post by Andy Rea » Wed Sep 26, 2012 7:36 pm

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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests