Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:03 09 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICOZX81 - a ZX81 emulator for Raspberry Pi Pico

     Page 3 of 4    
Author Message
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:38am 04 Jan 2025
Copy link to clipboard 
Print this post

@Exile:

I have not been able to find a ready-made .uf2 for "nuke".

"Clear_flash.uf2" is available here in the download from Geoff:

https://geoffg.net/Downloads/picomite/Archive/PicoMite_Firmware%20V5.07.02.zip

Why don't you provide a complete package for download? - it would simplify the project for inexperienced users (like me)...
I had to search for all the files which then simply had to be copied to the Pico... (Therefore also my "ROOT (for copying to Raspberry Pico).zip").

Frank
Edited 2025-01-04 17:59 by Frank N. Furter
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 482
Posted: 09:44am 04 Jan 2025
Copy link to clipboard 
Print this post

Clikable link

link
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 10:30am 05 Jan 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  Why don't you provide a complete package for download?

I did think about this when I made the ZX81_USB_KBD project, but specifically decided against. This is why:

ZX81_USB_KBD is interpreted Python. The file I've written (code.py) relies on the CircuitPython uf2 provided by a third party (circuitpython.org), plus libraries provided by another third party (Adafruit). These third parties regularly update their code as new boards are supported and new version of CircuitPython are released. I think it is better to refer people to the original authors to get up to date versions of the code.

  Frank N. Furter said  I have not been able to find a ready-made .uf2 for "nuke".


The nuke uf2 is available direct from Raspberry Pi Resetting Flash Memory  This is the direct link.

This link has the advantage that it is updated as new chips are released. The uf2 that is currently linked works for both the RP2040 and RP2350. I've updated the ZX81_USB_KBD Readme to include this link.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 10:41am 05 Jan 2025
Copy link to clipboard 
Print this post

  Exile said  I think it is better to refer people to the original authors to get up to date versions of the code.

In principle, you're right! Unfortunately, I have often found projects that failed because they could only be successfully compiled on an unknown, old Arduino IDE or because the libraries had been changed in the meantime and the code was therefore no longer executable.
If I really just want to rebuild a project 1:1, I am always very grateful if ALL the required files are included. If I want to adapt or modify the project, the situation is of course different.

  Exile said  The nuke uf2 is available direct from Raspberry Pi Resetting Flash Memory  This is the direct link.

Thanks a lot!!!

Frank
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 09:30am 14 Jan 2025
Copy link to clipboard 
Print this post

My keyboard and my emulator now have a case:  





I have noticed two things about the emulator so far:

- In the file selection menu, it is difficult to select the correct file, as the next line is often skipped even with a short keystroke.

- I have tried a few programs ( https://github.com/tomwhite/zx81-not-only-30-programs ). Despite RESET (Shift+Shift+1), I often cannot load any other programs. The emulator just won't do it anymore. Only when I perform a hard reset with the button does it work again.

Frank
Edited 2025-01-14 19:32 by Frank N. Furter
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 10:23am 14 Jan 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  
- In the file selection menu, it is difficult to select the correct file, as the next line is often skipped even with a short keystroke.


I'll slow the repeat in the menu down when I make my next release in the next couple of weeks.

  Frank N. Furter said  
- I have tried a few programs ( https://github.com/tomwhite/zx81-not-only-30-programs ). Despite RESET (Shift+Shift+1), I often cannot load any other programs. The emulator just won't do it anymore. Only when I perform a hard reset with the button does it work again.


This is not something that has been reported before, so I need more information to reproduce.

Questions:
a) There are 3 distinct ways to load a ZX81 file in picozx81
 i)   Press F2 and select from the menu,
 ii)  load "filename"
 iii) load "" and select from the menu.
Which one are you using?

b) Can you give an example of a specific .p file that is failing please?

c) The link you provided has ASCII text .bas files as well as a zip of .p files. I presume you are trying to load .p files from the zip in the repo?. The emulator does not support the loading of .bas files

d) The Readme states that the .p files are converted so that they will run on a 1kB ZX81. Are you emulating a 1kB or a 16kB ZX81? The amount of emulated memory is set either in the config.ini file, or through the menu accessed by F7

e) What is the exact behaviour when "The emulator just won't do it anymore". Does it hang, return to the K prompt with a 0/0 message, or something else?

f) The picozx81 Readme has links to many ZX81 programs. Can you load those? There is a massive collection of ZX81 programs at: ZX81 stuff, can you load those successfully?

Thanks,
Ian
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 10:57am 14 Jan 2025
Copy link to clipboard 
Print this post

Hi Ian,

a) I used the 1st way to load the program (Press F2 and select from the menu).

b+c) Yes, I used the .p files from my link above. I can't say at the moment which program it was specifically.

d) I have left the emulator at 1K in the default settings.

e) It return to the K prompt. I'm not sure at the moment whether it didn't occasionally display 0/0. However, nothing was displayed with LIST. Not even with my own programs that I was able to load successfully before.

f) I have only had this problem with the programs from the link above. But I haven't tried that many other programs either.

I have had this problem several times - I will try to write down a procedure that you can reproduce...

Frank
 
v.lenzer
Regular Member

Joined: 04/05/2024
Location: Germany
Posts: 53
Posted: 01:17pm 14 Jan 2025
Copy link to clipboard 
Print this post

Does it work, if You change from 1K to 16K?
Best wishes! Joachim
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 01:55pm 14 Jan 2025
Copy link to clipboard 
Print this post

That is a good point. I downloaded the programs and tried to run them. Some run fine in picozx81 with 1kB, some do not and require 16kB

I also tried the programs with the definitive PC ZX81 emulator "EightyOne". They seem to behave the same way in EightyOne as they do in picozx81.

Toward the end of the book are some quite advanced programs that depend on files being saved with variables defined from previous programs. picozx81 and EightyOne both support this, but the .p files created from the .bas files will not contain the variables. So, for example, Draughts will fail with error 2 at line 160 (undefined variable) on both picozx81 and EightyOne.

I think I need to know the exact file names of the .p files that were tested to investigate further.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:31pm 14 Jan 2025
Copy link to clipboard 
Print this post

Ok, I had created a folder with the name “30_programs_for_the_ZX81_1K”.

I have copied the programs from "https://github.com/tomwhite/zx81-not-only-30-programs/blob/main/web/30-programs.zip" into it.

When I load and start “fruit_machine.p”, the program seems to do something (no idea if it works correctly).

If I then trigger a RESET with F1 and try to load a program from another folder (root), only the “K” appears.

With F2 I see that I am again, or still, in the “30_programs_for_the_ZX81_1K” folder, although I had just left it?!?

Does that help you?

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 09:57pm 14 Jan 2025
Copy link to clipboard 
Print this post

When F1 is pressed the emulator is restarted with its current settings. All of the following remain the same:
 The current emulated computer (ZX80/ZX81),
 The current memory size
 The current emulated TV mode
 The current sound mode etc
 
The current directory is also maintained. This is by design. I will make this more explicit in the documentation.

You can check the current configuration of the emulator by pressing F3. This displays the current directory.

The easiest way to load a file not in the current directory is by pressing F2 and selecting it. When it is loaded the current directory becomes the directory that contains the loaded file. There is also some support for directories when using the LOAD command. For example LOAD "../EEL.P" will load the file "EEL.P" from the parent directory. However, this support is limited, as the ZX81 ROM does not have a concept of directories, and the ZX80 ROM did not even support filenames!

I am still confused as to why you see the K prompt. An attempt to load a file that does not exist should result in error D/0
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:28am 15 Jan 2025
Copy link to clipboard 
Print this post

  Exile said  The easiest way to load a file not in the current directory is by pressing F2 and selecting it. When it is loaded the current directory becomes the directory that contains the loaded file.


Yes, I think I understand - but exactly that no longer works after loading “fruit_machine.p”.

If I then want to load my file in the root, I only get a "K" and with F2 I am not in the root but still in the previous directory.

Only after a reset with the push button does it work again for me.

I will send you the contents of my SD card - then maybe you can try it out.

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 08:34am 15 Jan 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  
I will send you the contents of my SD card - then maybe you can try it out.
Frank

Yes, please send me the zipped contents of the SD Card. I will also need an exact description of the steps you take. That should help to answer the following questions:

1. After you have finished running Fruit machine, what do you do next, press F1, press F2, or something else?
2. What file in root are you trying to load?
3. How are you loading that file? Is it by pressing F2, or by entering LOAD "Filename" at the K prompt?
4. If you are using LOAD at the K prompt, what is the exact string you type in?

Currently I cannot reproduce the problem. I can do the following, which works correctly.

Press F2
Select Fruit-Machine.p
Run it
Press F2
Select Roulette.p
Run it

I can also:
Press F2
Select Fruit-Machine.p
Press F1
Press F2 (note I am still in the directory that contains Fruit-Machine.p, this is by design)
Move to the root directory and select a file
Run that file

What happens on your system if you exactly follow these steps?

  Frank N. Furter said  
If I then want to load my file in the root, I only get a "K" and with F2 I am not in the root but still in the previous directory.

As described above, pressing F1 does not change the current directory, so being in the previous directory if you press F2 after pressing F1 is expected behaviour.

At what point do you get the K, After pressing F1 then typing LOAD "Filename", or something else?

Please feel free to raise an issue on the picozx81 github, if it is easier to discuss there, rather than here.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 08:17am 16 Jan 2025
Copy link to clipboard 
Print this post

Hi Ian,

here are the contents of my SD card.
SD.zip
There are 6 simple programmes in the ROOT:
- catanim
- plotunpl
- prntendl
- sin01
- sin02
- sin03

All programmes work as they should!

I call up the manager with F2, change to the directory "30_programs_for_the_ZX81_1K" and load "fruit_machine.p". Then I start it with RUN.
Then I press F1 and start the manager again with F2. If I now switch to the ROOT, I can no longer start any of the 6 programmes - only the "K" appears.

However, I can still load and start "bombs_away" in the "30_programs_for_the_ZX81_1K" directory?!?

I can only reload the 6 programmes in the ROOT after a RESET with the push button.

Am I doing something wrong?

  Exile said  Please feel free to raise an issue on the picozx81 github, if it is easier to discuss there, rather than here.


I don't have an account with Github...

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 10:44am 16 Jan 2025
Copy link to clipboard 
Print this post

Thank you. I've created an SD Card from your data and run it on my hardware. I can recreate the problem.

The issue was that moving to the root directory within the F2 menu was not handled correctly.

A new uf2 with the issue fixed for the Olimex PC board with RP2040 and HDMI sound is attached. I'll fix it for all board types when I make the next release, which will be in about a week.

Alternatively, if you do not want to load a new uf2 then the workaround is to create a new directory on the SD Card and then copy the 6 files currently in the root directory into that directory. You will then be able to load them.

picozx81_olimexpc_hdmi_sound_rp2040.zip

Thanks for helping to make picozx81 better!  
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 10:47am 16 Jan 2025
Copy link to clipboard 
Print this post

Hi Ian,

I have to thank you!!!        

Frank

P.S.: Can you perhaps also compile a version WITHOUT HDMI sound - with HDMI sound some of my monitors don't work and only show a black picture...

THANKS!
Edited 2025-01-16 21:02 by Frank N. Furter
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 12:01pm 16 Jan 2025
Copy link to clipboard 
Print this post

The attached zip includes 2 uf2: one with and one without hdmi sound.

I've updated the code, so if you press F3 whilst the current directory is the root directory, it displays <ROOT>, rather than blank.


olimex_rp2040.zip
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 12:15pm 16 Jan 2025
Copy link to clipboard 
Print this post

Ok, now it works!  

...can you explain F3 to me again?

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 12:28pm 16 Jan 2025
Copy link to clipboard 
Print this post

F3 displays the current configuration of the emulator. You can check the amount of memory, the computer type, the display resolution etc. Press Escape or Enter to leave it.

F4 pauses the emulator
F5 displays an image of the keyboard

You cannot change anything in the F3 menu. Settings are changed in the F6, F7 and F8 menus.

F6 is for things that can be changed without resetting the ZX81.
F7 is for things that, if changed, will result in the emulator resetting.
F8 is for things that cause the pico to reboot (such as changing the display resolution).
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 12:35pm 16 Jan 2025
Copy link to clipboard 
Print this post

  Exile said  F3 displays the current configuration of the emulator.

Now I understand! The current path is now displayed at the bottom.

  Exile said  I've updated the code, so if you press F3 whilst the current directory is the root directory, it displays <ROOT>, rather than blank.

However, when I start a program from "30_programs_for_the_ZX81_1K", this folder is displayed until it is cut off at the edge of the screen.

Frank
 
     Page 3 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025