Hi-speed loadings for zx81

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
zsolt
Posts: 214
Joined: Wed Apr 20, 2011 11:43 am
Location: Fót, Hungary

Re: Hi-speed loadings for zx81

Post by zsolt »

HI,
PokeMon wrote:As I played with the tool from decioder (wav player)
I tried again the hlg-WAVs. As You, i used the OTLA/Tools/Wav player. And with OTLA-player did not work. :o
Then i tried a simple WAV (generated by EO) and with OTLA-player did not work. :o :o There was any problem - at first I thought, with my zeddy. :cry:

Then i played the simple WAV with my favourite player (AvRack) and there was no problem :D .
Than i tried again the hlg-WAVs and there was no prolem. :D :D
Then i played with more players: "Windows Media Player" (I don't like it, but almost everyone has), "Media Player Classic" and "Total Commander"'s inbuilt tool - there was no problem. :D :D :D So pls, give a second chance to Hybrid Loader ;) .
PokeMon wrote:your audio is too fast, zsolt. ... Maybe you changed the sampling frequency without adapting values ? ;)
Yes and No. If you take a look at timing diagrams of the loader (you can find in the above attachments) in version 2 i decreased the time of silence between packages (4 or 9 pulses). This is the simplest way to speed up the program loading (up to 35%).
I could do this because the tape loader in ZXOS works with a timeout counter - if it reached zero then evaluates the received package (bit '0' or '1'), and then waits for the next activity on the line. This time was decreased - "don't wait in vain!" :mrgreen:
I made a testprogram (last night), so if you have a little free time to play with, you can check this claim.
The program is in the attachment, and you can create simple WAV files with different silences between packages (values are in samples @22kHz).

The attachment contains the source code of the fastloader section of the HybridLoader too.
PokeMon wrote:Second I can try to load a .p file but can not play and not convert because it just wants a sbb file (whatever this is).
Just choose a .p file by clicking on "Add blocks.." button. It automatically converts to sbb format and enables the buttons at bottom.
OTLA_S1.png
OTLA_S1.png (18.98 KiB) Viewed 4676 times
Zsolt
Attachments
FLGandSWG.zip
(272.08 KiB) Downloaded 183 times
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hi-speed loadings for zx81

Post by PokeMon »

Thanks for reply, I will check end of next week when I am back at home. ;)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hi-speed loadings for zx81

Post by PokeMon »

So now I am testing again with fastloaders.
First the test of the OTLA Loader:
I got it working and it loads good with default values (ZX81) - which is about 5 seconds or a bit more.
I tried to get it faster (has 2 faster options) but did not work with my real Zeddy.
But anyway - loading is successful and quite fast. ;)

After I tried the loaders from Zsolt. I had no success with the hybrid loaders.
Maybe they are tested only with emulators, my real Zeddy doesn't take them.
Maybe my Zeddy is very slow - didn't measure cpu frequency but this can vary due to non quarz oscillator.
I think the ceramic filter has a tolerance of about 10% which could be a frequency somewhere between 2,92 and 3,57 MHz.

But I had success with your SWG4ZX81 Loader with default pause of "30".
Tried 20 - was okay.
Tried 10 - no success
Tried 15 - was okay
I experienced I could down pause time to 11, which worked, 10 doesn't work anymore on my Zeddy.

In the meanwhile I optimized my fastloader with several tricks and also changed the pause times between pulses and between the bits like proposal from Zsolt.
All in all I could do load a real program (SlotMachines.p - found somewhere in the internet and work for 1k Zeddys) with 752 bytes in about 3 seconds all in all including both stages, the slow part with the fastloader code and the fast part with the Slotmachines program to be loaded. I think this is fastest loading routine you ever find. It's well optimized, no DFILE, nearly all bytes in variable section set to zero as a 0 bit is loaded faster than a 1 bit. I think there is no more optimization possible ever. Even the BASIC program isn't loaded full, crapped 3 bytes from the PRINT USR line which is not fully executed. :mrgreen:

So if somebody have time and equipment I would like to let you test the two attached WAV files. The smaller one is about 3.21 seconds duration, the second one is about 3.55 seconds and has more reserve for different Zeddys. I would like to know if both files could be loaded or just the bigger one with longer duration or if there are any other problems.

In the meanwhile I integrated listing function in the ZX81 IDE version and started integrating real BASIC commands. So update will come somewhere at eastern, sunday or monday.

Best Regards,
Karl

Here the superfast version
SlotMachinesV1.wav
(94.18 KiB) Downloaded 189 times
And here with more tolerance
SlotMachinesV2.wav
(104.04 KiB) Downloaded 216 times
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Hi-speed loadings for zx81

Post by Paul »

Hi Karl, both versions load ok on a unmodified Zeddy Issue One, ULA184, 1K and and also with ZXPand attached
Now we would need an API to use it to Save and Load Data Chunks and Basic Progs for Yerzmeys demos ;)
Does it also work when it is recorded on a real tape?

Kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hi-speed loadings for zx81

Post by PokeMon »

Paul wrote: Does it also work when it is recorded on a real tape?
This depends on your tape. If it's good it should work, no problem.
I think maximum frequency is about 15 kHz, minimum frequency is somewhere about 2-5 kHz depending on content.
Paul wrote: Now we would need an API to use it to Save and Load Data Chunks and Basic Progs for Yerzmeys demos ;)
Yes this is the next step for the loader in the IDE. When my memory extension is working. :mrgreen:
Faster and working in the background, activated by hotkey or better self listening for new data.
This will be very convenient for developers to change source on the PC, press one key which transfers automatically new program with highspeed in less than one second without pressing any other key or type load or something like that. Could be used to transfer partly memory parts, no problem at all. ;)
User avatar
zsolt
Posts: 214
Joined: Wed Apr 20, 2011 11:43 am
Location: Fót, Hungary

Re: Hi-speed loadings for zx81

Post by zsolt »

Dear All,

Who knows the differences between the EAR-ports of the different ZX81's issues?

According the circuit diagram is not any difference - but there are. :(
I tried the above two programs (WAVs) with my zx81 and my ts1000 (both motherboards are issue 3). There was no success- sorry Karl.
PokeMon wrote:Maybe my Zeddy is very slow - didn't measure cpu frequency but this can vary due to non quarz oscillator.
I think the ceramic filter has a tolerance of about 10% which could be a frequency somewhere between 2,92 and 3,57 MHz.
I think this +/-10% is too much - this would very distort the size (+/-3 character) and the horizontal position (+/-3 pixel) also of the screen.


So, Who knows the differences..???

Regards,
Zsolt
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hi-speed loadings for zx81

Post by PokeMon »

Well in fact I load my programs with an Issue One Board.
Paul did test same with Issue One.

Unfortunately I don't have an Issue 3 board. Maybe there is a difference which shouldn't be. But maybe this care when fastloading.
Not sure. But I am not convinced as they have to be compatible to audio.
Did you use maximum volume during your tests ?
If program is not loaded, could you cancel the loader by pressing SPACE button ?

Can you use the following WAV for testing ?
This was created with the previous fastloader with output volume reduced during fastloader but not adapting pause values (original timing).
ZX81DEMO.wav
(247.47 KiB) Downloaded 206 times
So what about the pause value I tested with your SWG4ZX81 ?
What value did you use in HLG loader ?
By the way SWG load with pause "15" - which is a shorter WAV file than from the hybrid loader.
So what is the difference ?
SWG is positive. Even with maximum "30" WAV file is short (82k versus 107k with my demo progam include ony 2 small rem lines) ?
User avatar
zsolt
Posts: 214
Joined: Wed Apr 20, 2011 11:43 am
Location: Fót, Hungary

Re: Hi-speed loadings for zx81

Post by zsolt »

PokeMon wrote:Did you use maximum volume during your tests ?
If program is not loaded, could you cancel the loader by pressing SPACE button ?
Can you use the following WAV for testing ?
Yes, it was at max. - you can see on video.
I will try tonight.
PokeMon wrote:So what about the pause value I tested with your SWG4ZX81 ?
What value did you use in HLG loader ?
By the way SWG load with pause "15" - which is a shorter WAV file than from the hybrid loader.
So what is the difference ?
With SWG you tested the silences BETWEEN (and not within) packets, where a packet contains 4 or 9 "standard" pulses.
The HLG v1 uses 30samples between the packets, the v2 uses only 8.
In the fast-section of HLG_v1: '0' = HLS, '1' = HLSSS; and in the HLG_v2: '0' = HLS, '1' = HLSS - where the H= highest value; L = lowest value; S = the silence byte ($80). (I thought that the timing diagrams will be clearer - sorry)

I was thinking a bit, and maybe you are right: the problem may caused by the different time base. Both software works with fixed values ​​for comparison (in fast loader section), and it is a mistake. If the first received bit could be the etalon, which could be compared to the others, then the loader will be independent of the time base (the chewing gum :mrgreen: ). The HLG is re-written, I will test tonight.
Regards,
Zsolt
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hi-speed loadings for zx81

Post by PokeMon »

zsolt wrote: With SWG you tested the silences BETWEEN (and not within) packets, where a packet contains 4 or 9 "standard" pulses.
The HLG v1 uses 30samples between the packets, the v2 uses only 8.
In the fast-section of HLG_v1: '0' = HLS, '1' = HLSSS; and in the HLG_v2: '0' = HLS, '1' = HLSS - where the H= highest value; L = lowest value; S = the silence byte ($80). (I thought that the timing diagrams will be clearer - sorry)
It's not so far as my coding.
I use only HL - no silence or lets say silence has the same coding as L.
So I code it 0=HLL (like you HLS) and 1=HHLLL (like your HLSSS or shorter HLSS).
I never use extra silence between packets, not needed for nothing.
The loader is fast enough to write all data into memory during transfer.

And I use higher sample frequency of 30.000 Hz (I think you use 22.050 Hz).
I do not hope that other sample frequency cause problems on the PC.
So 44/22 kHz are standard values but normally soundcard offers any user sample frequency.

And I use one parity bit after each byte (but no additional silence).

I tried to find out the values by testing much samples and choosed a value with enough distance between low/high values (not best value ever possible).

Regards,
Karl
User avatar
zsolt
Posts: 214
Joined: Wed Apr 20, 2011 11:43 am
Location: Fót, Hungary

Re: Hi-speed loadings for zx81

Post by zsolt »

Hello again,

I tested last weekend:

1.) next release of the SPONZY: the SPONZY DTV - coming soon...

2.) Karl's 3 examples: SlotMachinesV1-V2 and the ZX81DEMO.WAV:
PokeMon wrote:If program is not loaded, could you cancel the loader by pressing SPACE button ?
As you can see on video,

V1: it seems that the fast loader part of the program starts later than data from WAV - the SPACE terminates.
V2: the system collapsed
ZX81DEMO: i tried and did not work, the system restarted.

3.) Hybrid Loader V3

The first byte of a ZX81 program is always $00 (zero), so the fisrt bit also is '0'.
The program stores this 'bit'-value and uses later as reference (to compare with the others).
The ZIP includes the hlg4zeddy.exe , the source code of the fastloader section, and the timing diagram.

Don't forget : the fastloader part runs directly under the RAMTOP.

If you have 16K+ of RAM, but the M1NOT-circuit is not implemented, the highest value for RAMTOP could be 32768 (POKE 16389,128; POKE 16388,0)
If you have 16K+ of RAM, and the M1NOT-circuit is implemented, the highest value for RAMTOP could be 49152 (POKE 16389,192; POKE 16388,0)

Let me know if it works with your zeddy (keep fingers crossed)

Regards,
Zsolt

ps: I measured the clkfreq also of my ZX81 and my TS1000 and got a near standard value: 3,26MHz - see in the attachment.
Attachments
HybridLoaderV3.zip
(332.46 KiB) Downloaded 241 times
ZX81 (8K), ENTERPRISE 128, [ZX SPECTRUM (48K,+,+128K,+2,+2A), TS1000, TS1500, TS2068, Cambridge Z88, PRIMO A64 (red)]
Post Reply