RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Any progress being made with ZX81 emulation?

    Scheduled Pinned Locked Moved Help and Support
    zx81lr-81
    28 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Folly @JimmyFromTheBay
      last edited by Folly

      @JimmyFromTheBay

      You probably have downloaded the file incorrectly.
      Check the file with a text editor to see if it is good and will show no html garbage.

      If it looks OK it still can be wrong as sometimes windows will put wrong line endings in a text file so that can also be an issue.

      Let me know what you find.

      PS
      Remove the file and RetroPie-Setup should work again.

      J 2 Replies Last reply Reply Quote 0
      • J
        JimmyFromTheBay @Folly
        last edited by

        @Folly Ah yes: I'd right-clicked on your link and clicked "Save As", but that gave me a file with a whole load of invisible gibberish in it. I just pasted it in to Notepad manually and that worked, it installed and it runs 48K games. (Now I just need to figure out how to make it fullscreen.)

        Brilliant, many thanks :)

        Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

        F 1 Reply Last reply Reply Quote 0
        • J
          JimmyFromTheBay @Folly
          last edited by

          @Folly (Did it work in fullscreen for you? I get it in a little corner less than a quarter of the screen, I can make it a bit bigger or smaller with Alt-R but still off-centre. F11 does nothing.)

          Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

          F 1 Reply Last reply Reply Quote 0
          • F
            Folly @JimmyFromTheBay
            last edited by Folly

            @JimmyFromTheBay

            Good to hear that it's working even without adding dependancies.
            Here are the options you can use.

            help.png

            In the runcommand I added -f for fullscreen.
            For me that worked but seems that it doesn't work on the RPI.
            You might want to experiment with adding the resolution, something like adding :
            -800x600
            If it still doesn't work then try to match the boot up resolution in the startup dialog box.

            Let me know if you find a solution then I will add that to the module-script.

            edit:
            -b might also do the trick.

            J 1 Reply Last reply Reply Quote 0
            • F
              Folly @JimmyFromTheBay
              last edited by Folly

              @JimmyFromTheBay

              I remember that you can also use resolution variables in the runcommand.
              You might want to give that a try.
              So use :
              -%XRES%x%YRES%
              instead of :
              -800x600

              edit:
              For me this option doesn't work on a regular pc, not sure why.

              J 1 Reply Last reply Reply Quote 0
              • J
                JimmyFromTheBay @Folly
                last edited by

                @Folly No luck so far. I'd already tried adjusting the resolution in the runcommand window but it made no difference, and matching the runcommand resolution to the commandline resolution didn't help any.

                The -b flag did make a small improvement - it no longer crops off the bottom of the screen in H.E.R.O. - but the window is still small and stuck in the top left corner. And as you note the -f flag does nothing either.

                Will keep trying stuff. I've no idea what some of the options do, like "TAGULA".

                Incidentally, I briefly got excited because I thought this emulator would also run ZX80 games (which nothing on my Pi currently will), but I can't get it to do anything even though I've set the -o flag and the ZX80 ROM is in the emulator's folder - it just crashes back to ES. If I put the ZX80 game files in the ZX81 ROM folder it does boot, but only to the "K" prompt, the games don't load. Tantalisingly close!

                Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                1 Reply Last reply Reply Quote 0
                • J
                  JimmyFromTheBay @Folly
                  last edited by JimmyFromTheBay

                  @Folly So, this is getting weird. If I use this commandline:

                  sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -1920x1080 %ROM%; popd"
                  

                  It now occupies my whole screen, but it looks like this - shoved over to the left and still only using a small amount of screen area.

                  sz1.jpg

                  Adding the -b flag makes no difference.

                  sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -b -1920x1080 %ROM%; popd"
                  

                  But if I add the -f flag:

                  sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f -1920x1080 %ROM%; popd"
                  

                  it suddenly centres itself, with a couple of big bars at the sides, BUT it displays the black parts in a "stipply" and much lighter grey shade, like it had been really badly photocopied and printed out on a printer very low on ink.

                  sz2.jpg

                  If I add BOTH flags, it acts the same as if I'd added none, or just the -b.

                  But if I use the -f flag and then press Alt-R, it goes back to the -b version, ie it reverts to proper black but shifts the screen off-centre again.

                  This is really peculiar. All the parts are in there but they just won't come together...

                  Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    Folly @JimmyFromTheBay
                    last edited by Folly

                    @JimmyFromTheBay

                    Not sure if it will work but you could try to use xinit like this :
                    sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd"

                    Maybe using matchbox-windows-manager could also help but I need to test.

                    Not at my RPI right now.
                    If I have the time I will try it on my RPI.

                    J 1 Reply Last reply Reply Quote 0
                    • J
                      JimmyFromTheBay @Folly
                      last edited by JimmyFromTheBay

                      @Folly said in Any progress being made with ZX81 emulation?:

                      sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd"

                      Bingo! Centred horizontally and a decent size, but it's cropping the bottom off H.E.R.O. again.

                      sz3.jpg

                      But if I add -b to the -f, we get the whole screen, albeit it's still not vertically centred or occupying anything like the full space. Playable and fairly tidy (the -b introduces a bit of scrappiness on the top and right edges), though, definitely the best yet.

                      sz4.jpg

                      Other games are perfectly centred, though, so it looks like this is a H.E.R.O. problem. Easily solved by having two versions in EMULATORS.CFG.

                      sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd"
                      sz81hero = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f -b %ROM%; popd"
                      

                      Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                      F 1 Reply Last reply Reply Quote 1
                      • F
                        Folly @JimmyFromTheBay
                        last edited by

                        @JimmyFromTheBay

                        Good to hear that it's almost OK.
                        Seems it could be some sort of a 16:9 / 4:3 issue.
                        Will have to think about it.
                        Might be that I find a better solution.
                        Then I will let you know.

                        J 1 Reply Last reply Reply Quote 0
                        • J
                          JimmyFromTheBay @Folly
                          last edited by JimmyFromTheBay

                          @Folly Many thanks yet again :) Would editing the script to something like this called sz80.sh

                          #!/usr/bin/env bash
                          
                          # This file is part of The RetroPie Project
                          #
                          # The RetroPie Project is the legal property of its developers, whose names are
                          # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
                          #
                          # See the LICENSE.md file at the top-level directory of this distribution and
                          # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
                          #
                          
                          rp_module_id="sz80"
                          rp_module_desc="Sinclair ZX80 emulator"
                          rp_module_help="ROM Extensions: .o .p .80 .81\n\nCopy your ZX80 roms to $romdir/zx80\n\n
                              Exit          - Exit emulator (F10)\n
                              Reset         - Reset emulator (F12)\n\n
                          Read the README files for more information\n
                              
                          "
                          rp_module_licence="GPL2 https://github.com/SegHaxx/sz81/blob/main/README"
                          rp_module_repo="git https://github.com/SegHaxx/sz81.git main"
                          rp_module_section="exp"
                          
                          function sources_sz81() {
                              gitPullOrClone
                          }
                          
                          function build_sz81() {
                              make clean
                              make
                              md_ret_require="$md_build/sz81"
                          }
                          
                          function install_sz81() {
                              md_ret_files=(
                                  "."
                              )
                          }
                          
                          function configure_sz81() {
                              mkRomDir "zx80"
                              defaultRAConfig "zx80"
                          
                              addEmulator 1 "$md_id" "zx80" "pushd $md_inst; $md_inst/sz81 -f %ROM%; popd"
                              addSystem "zx80"
                          }
                          

                          Install another instance of it labelled SZ80 that might run the ZX80 games? (I have really zero idea how scripts work.)

                          Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                          F 4 Replies Last reply Reply Quote 0
                          • F
                            Folly @JimmyFromTheBay
                            last edited by

                            @JimmyFromTheBay said in Any progress being made with ZX81 emulation?:

                            Would editing the script to something like this

                            Nice try, though I would try to do both zx80 and zx81 in one script.
                            However, the difficult part would be the config file.
                            If the same emulator is used for both systems and the same config file is used then if will not always boot into the proper system.
                            So when you select zx80 you want to boot into zx80 and not in zx81.
                            It's the same vice-versa, got it ?

                            I will have a look if we can use separate configs.

                            1 Reply Last reply Reply Quote 0
                            • F
                              Folly @JimmyFromTheBay
                              last edited by

                              @JimmyFromTheBay

                              BTW.
                              Did you try altering the video-mode in the runcommand launch menu for displaying the emulator screen properly or better ?

                              J 1 Reply Last reply Reply Quote 0
                              • F
                                Folly @JimmyFromTheBay
                                last edited by Folly

                                @JimmyFromTheBay said in Any progress being made with ZX81 emulation?:

                                (I have really zero idea how scripts work.)

                                I would suggest you read this :
                                https://www.freecodecamp.org/news/how-to-learn-linux-terminal-as-a-beginner/
                                and this :
                                https://www.freecodecamp.org/news/shell-scripting-crash-course-how-to-write-bash-scripts-in-linux/

                                There are many more sites on the internet to find.

                                Terminal commands can be used in a bash script.
                                RetroPie is a collection of bash scripts and are basically tied together.
                                For beginners the most difficult part is how these scripts work.
                                I had the same issue when starting to write module-scripts.
                                (A module-script is basically 1 script of the collection of RetroPie scripts.)
                                The most important thing is to recognize that a module-script contains functions and also that it uses functions.
                                Also variable are used.
                                These functions and variables are made and used to simplify the scripts so they can be used in more module-scripts.
                                Most functions can be found in the RetroPie-Setup/scriptmodules/helpers.sh.
                                That is basically the summary.

                                Have a look and hopefully you will understand it better now.

                                You can experiment with it testing just 1 function in a module-script.
                                Lets say you only want to test the function sources_sz81 from the sz81.sh :

                                function sources_sz81() {
                                    gitPullOrClone
                                }
                                

                                Then you can go into the terminal and do :

                                cd
                                cd Retropie-Setup
                                sudo ./retropie_packages sz81 sources
                                

                                It will then download the sz81 source code, using the gitPullOrClone function, and places it in :
                                ~/RetroPie-Setup/tmp/build/sz81
                                If you want to remove source code for sz81 then you can use :

                                sudo ./retropie_packages sz81 clean
                                

                                You can just do a test in the sources_sz81 function and replace gitPullOrClone with something like :

                                echo "hello world"
                                

                                Then if you do :

                                sudo ./retropie_packages sz81 sources
                                

                                Instead it will output :
                                hello world

                                So you can test every function one by one (and add stuff in there just to test) :

                                sudo ./retropie_packages sz81 depends (if it's there)
                                sudo ./retropie_packages sz81 sources
                                sudo ./retropie_packages sz81 build
                                sudo ./retropie_packages sz81 install
                                sudo ./retropie_packages sz81 configure
                                sudo ./retropie_packages sz81 clean
                                

                                This, however, will execute all functions in one go :

                                sudo ./retropie_packages sz81
                                

                                Just like when running it from the retropie_setup.

                                1 Reply Last reply Reply Quote 1
                                • F
                                  Folly @JimmyFromTheBay
                                  last edited by Folly

                                  @JimmyFromTheBay

                                  Seems it wasn't possible to make one script because of not being able to load the config as an option.
                                  So I created a separate module-script for zx80 just like you suggested :
                                  https://github.com/FollyMaddy/RetroPie-Share/blob/main/00-scriptmodules-00/emulators/sz80.sh

                                  It patches the source code to make use of a different config directory (.sz80 instead of sz81)

                                  Read the help.
                                  First time it will boot in zx81 by default.
                                  Change the it by clicking the config icon inside the emulator and save the config.

                                  J 1 Reply Last reply Reply Quote 1
                                  • J
                                    JimmyFromTheBay @Folly
                                    last edited by

                                    @Folly Works! Fantastic! ZX80 games! Thank you! :)

                                    Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      JimmyFromTheBay @Folly
                                      last edited by

                                      @Folly said in Any progress being made with ZX81 emulation?:

                                      @JimmyFromTheBay

                                      BTW.
                                      Did you try altering the video-mode in the runcommand launch menu for displaying the emulator screen properly or better ?

                                      Yes, can't get it to make any difference.

                                      Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                      F 2 Replies Last reply Reply Quote 1
                                      • F
                                        Folly @JimmyFromTheBay
                                        last edited by

                                        @JimmyFromTheBay

                                        I tested hero and had exactly the same image.
                                        I will add that second option to the script that you suggested.

                                        1 Reply Last reply Reply Quote 1
                                        • F
                                          Folly @JimmyFromTheBay
                                          last edited by

                                          @JimmyFromTheBay

                                          A suggestion is to read the manual.
                                          It can be found in the folder manual in the source.

                                          Found that it can also do Chroma.
                                          So games that have color will work too.

                                          Here are some examples :
                                          Wall.png
                                          Rebound.png

                                          In the Makefile you can also add more, ZXPAND is an example which is an external addon.
                                          It seems to be working but I do not know yet where to put the SD-card files

                                          J 1 Reply Last reply Reply Quote 0
                                          • J
                                            JimmyFromTheBay @Folly
                                            last edited by

                                            @Folly Ooh, getting ZXPAND in would be great, because then Zedragon II would work, and maybe the DK'Tronics version of Space Invaders by Jeff Minter.

                                            Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                            F 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.