New Spectrum emulator - ZEsarUX


25 posts
by Higgy » Thu Feb 12, 2015 1:49 pm
Hello all,

I spotted a post from the Pi Homepage, which was from the developer of this emulator:

http://sourceforge.net/projects/zesarux/ - ZEsarUX

I hope the developer does not mind me posting this. I will remove if requested, but I think fellow RPi users hoping to have a great alternative to the original hardware will like this.

I got it running on my spare early Pi (256Mb), but had some issues getting alsa sound working. I had a USB keyboard & 4-button Competition Pro plugged in, which seemed to be detected.

Looks like the developer is working on this emulator, so it can only get better!
I had issues with Fuse & Unreal working from command line. Crackling sound on one, and not being able to sort out screen size and USB joystick controls on the other.
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by chernandezba » Sat Feb 14, 2015 8:52 am
Hi
I'm Cesar Hernandez, the developer of ZEsarUX. I'm very happy to see you have tested the emulator and also your joystick works :)
Which rpi model you have? I've tested with model B
Does the sound work? With my rpi, sound works with alsa, but is not perfect yet
Cpu speed is like on a real spectrum, but with real video mode off
I really like to have feedback and suggestions from other users. You can contact me by email chernandezba at hotmail.com

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by Higgy » Sun Feb 15, 2015 10:06 pm
Hello Cesar,

I have just tried ZXsarUX (latest files) on my new RPI 2!
There is sound in-game. I did notice some sound 'clicking' or static. I think one of the other Spectrum emulators had something similar?
One thing I noticed, the cursor keys on the USB keyboard don't work in your menu? I have to navigate up/down using joystick.
Is there a way of configuring the joystick buttons? I am using a USB Competition Pro joystick, and the main fire button is 'MENU' and one of the smaller buttons is 'fire'.
Also what are the various flag options to run the emulator? I see there are --disableborder --ao alsa --zoom 1 --fullscreen

Many thanks for your hard work,

Sean
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by chernandezba » Mon Mar 02, 2015 11:35 pm
Hi
Sorry for the delay
About sound... Yes, it's not perfect yet but I'm working on it.
About cursors... Have you tried the cursors on the numeric keypad of the keyboard?
Joystick... Can be redefined on hardware menu, real joystick settings
And about command line options... Try --help and --experthelp

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by dudleydes » Wed Mar 11, 2015 4:05 pm
Many thanks for this great Speccy emulator. It's the first that provides sound through HDMI and lets me configure my PS3 controller. I noticed that I needed to reconfigure my controller each time I launched the emu but I have fixed this by altering the source code and rebuilding.

A couple of points though.

When I start Jetpac from the console, the initial options menu appears as it should (see below):

Image

If I launch Jetpac from EmulationStation, the text is replaced with strange characters (see screenshot below).
jetpac-from-es.png
jetpac-from-es.png (49.78 KiB) Viewed 2118 times


Is there a way to fix this? If so, I would have to say that ZEsarUX should be the Speccy emulator of choice for the Retropie project.

Finally, when I exit the emu back to the console, the resolution doesn't seem to reset itself so that the command prompt takes up most of the width of the screen. Should this be happening?

Once again, many thanks for your hard work.
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by Higgy » Wed Mar 11, 2015 9:34 pm
Hi,

I have been in communication with the dev Cesar. And yes it is a becoming a great emulator and it's early days! I hope he does not mind me answering your questions:

Regarding the CMD prompt when exiting, this is a known problem and will be fixed later.

Regarding configuring the controller / settings, yes the emulator does not save setting at exit. But a config file is created called .zesaruxrc on your home directory.

ZEsarUX reads this upon loading, and Cesar has very recently added a config option to set joystick hardware interface (I always use Kempston).

Here is an example with instructions below:

--joystickevent -0 left
--joystickevent +0 right
--joystickevent 0 fire
--joystickevent 1 exit menu
--joystickemulated "OPQA Space" or you can use "Kempston" "Sinclair" etc


--joystickevent but evt Set a joystick button or axis to an event
If button (not axis), must be specified with its number, without sign, for example: 2
If axis, must be specified with its number and sign, for example: +2 or -2
Event must be one of: Up Down Left Right Fire EscMenu Enter Quickload NumSelect NumAction
--joystickkeybt but key Set a joystick button or axis to a key pressed
If button (not axis), must be specified with its number, without sign, for example: 2
If axis, must be specified with its number and sign, for example: +2 or -2
Key must be an ascii character number or a character included in escaped quotes, like: 13 (for enter) or \'q\'
--joystickkeyev evt key Define a key pressed when a joystick event is generated
Event must be one of: Up Down Left Right Fire EscMenu Enter Quickload NumSelect NumAction
Key must be an ascii character number or a character included in escaped quotes, like: 13 (for enter) or \'q\'

Cheers
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by Higgy » Wed Mar 11, 2015 9:50 pm
Oh I forgot to say, you need to complie from the latest Snapshot (which you probably have done if you were recompiling with PS3 controller), as the v2 download does not have some of the latest options.
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by chernandezba » Wed Mar 11, 2015 10:42 pm
Hi

Thanks Higgy for answering the questions :)
I don't know emulation station, but that screenshot seems to be the ncurses (text) driver of the emulator. So it seems the X11 or the fbdev driver is not available or compiled

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by dudleydes » Mon Mar 16, 2015 1:16 pm
Higgy wrote:Regarding configuring the controller / settings, yes the emulator does not save setting at exit. But a config file is created called .zesaruxrc on your home directory.

ZEsarUX reads this upon loading, and Cesar has very recently added a config option to set joystick hardware interface (I always use Kempston).


Thanks for this, Higgy. It looks promising for further configuration possibilities. I've rebuilt ZEsarUX using the latest snapshot to take advantage of these new options.

I successfully managed to configure the controls for Chuckie Egg by using the Joystick to Keys option in Real joystick emulation within ZEsarUX. When I tried to do this by editing the config file, I had no luck. These are the lines I added:
Code: Select all
--joystickkeybt 4 \'2\'
--joystickkeybt 6 \'w\'
--joystickkeybt 7 \'9\'
--joystickkeybt 5 \'0\'
--joystickkeybt 14 \'z\'
What am I doing wrong?

chernandezba wrote:I don't know emulation station, but that screenshot seems to be the ncurses (text) driver of the emulator. So it seems the X11 or the fbdev driver is not available or compiled

EmulationStation (http://www.emulationstation.org/) is a graphical front-end for a multi-emulator system such as Retropie (http://blog.petrockblock.com/retropie/). I'm afraid I don't know much how EmulationStation works. If I can integrate ZEsarUX into it, then I will ask the Retropie developers to include it as the default Speccy emulator as it offers the best joystick support AFAIK.

I have tried to use the --vo flag using first xwindows and then fbdev without luck in either case. I have installed xf86vidmode and xxf86vm drivers as suggested in the INSTALL file. Is it possible to use either of these?

BTW ZEsarUX works great from the console without having to specify a video driver.
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by Higgy » Mon Mar 16, 2015 2:32 pm
What joystick interface did you select in your config file?

The commands you wrote look OK.

I am having a nightmare trying to get mine working again. I had to re-flash RetroPie as I was getting 'black screen and choose' when booting up on my 256mb RPi. I use RetroPie as a base because of the recently improved Fuse.

I can't get zesarux to read my config file now? and I get a Pulse hardware initialisation error.

I am not a Pi / Linux expert and it is really annoying when you can't get a setup working again. Spent many hours getting nowhere. :( Maybe need a break and try again in a day or so?
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by chernandezba » Mon Mar 16, 2015 10:44 pm
Hi

The scaped quotes are only for options on command line so the program needs to read the quotes and the Linux shell deletes them when are not scaped.
So in the configuration file, options look like:
--joystickkeybt 4 '2'

About video driver... Can you post the results of:
./configure
./zesarux --verbose 3
(On console and on emulation station)

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by chernandezba » Tue Mar 17, 2015 8:37 am
Higgy wrote:What joystick interface did you select in your config file?

I can't get zesarux to read my config file now? and I get a Pulse hardware initialisation error.



Run ZEsarUX only with this command line option:

--debugconfigfile

It will show you on console what is reading from configuration file. If you use the fbdev driver, the emulator window may also hide those messages. So, run with the null video driver to show them:

--debugconfigfile --vo null

About pulse error, run the emulator with:
--verbose 4 --vo null

To see all debug messages


I am not a Pi / Linux expert and it is really annoying when you can't get a setup working again. Spent many hours getting nowhere. :( Maybe need a break and try again in a day or so?


Fell free to contact me here or by email and I will help you.

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by dudleydes » Tue Mar 17, 2015 12:04 pm
Thanks for clarifying the syntax for the config file but I'm still not getting the controller mappings to work. I tried to run the --joystickkeybt flag directly from the command line and I got the following message.
Code: Select all
Maximum defined joystick to keys defined (8)
For the record, here is the command I used
Code: Select all
~/zesarux-code/zesarux --tape ~/RetroPie/roms/zxspectrum/ChuckieEgg.tzx --joystickkeybt 4 \'q\' --joystickkeybt 6 \'a\' --joystickkeybt 7 \'o\' --joystickkeybt 5 \'p\' --joystickkeybt 14 \'m\'
I have attached the output from commands you suggested executed from the console and EmulationStation (ES).
Attachments
zesarux.zip
(15.15 KiB) Downloaded 64 times
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by chernandezba » Tue Mar 17, 2015 12:55 pm
dudleydes wrote:Thanks for clarifying the syntax for the config file but I'm still not getting the controller mappings to work. I tried to run the --joystickkeybt flag directly from the command line and I got the following message.
Code: Select all
Maximum defined joystick to keys defined (8)
For the record, here is the command I used
Code: Select all
~/zesarux-code/zesarux --tape ~/RetroPie/roms/zxspectrum/ChuckieEgg.tzx --joystickkeybt 4 \'q\' --joystickkeybt 6 \'a\' --joystickkeybt 7 \'o\' --joystickkeybt 5 \'p\' --joystickkeybt 14 \'m\'
I have attached the output from commands you suggested executed from the console and EmulationStation (ES).


Hi

On the command line there are 5 joystickkeybt options, so I suppose there are at least 4 more on the configuration file. So you must delete some of them...

About logs... on configure script, the usual drivers are compiled:

Enabled Video output drivers: stdout caca xwindows fbdev null
Disabled Video output drivers: curses aa cocoa
Enabled Audio output drivers: dsp alsa pulse null
Disabled Audio output drivers: coreaudio


Running ZEsarUX, from console, have framebuffer driver available:

Info: Init XWindows Video Driver
Error: xwindows driver. Error opening display
Info: Init Fbdev Video Driver
Info: Setting framebuffer size to: 256x192
Info: fbdev info: real 256x192, virtual 1824X984, 24 bpp fbdev_screensize: 5384448
Debug: Ok video driver i:1 fbdev


But from emulationstation, fbdev is not available:
Info: Init XWindows Video Driver
Error: xwindows driver. Error opening display
Info: Init Fbdev Video Driver
Error: Error: cannot open framebuffer device.

I don't know why... Maybe the emulationstation locks the device or is not available for any other reason. XWindows is not available either...

So the emulator fallbacks to the cacalib video driver:
Info: Init cacalib Video Driver

It's a text-based driver...

I will try emulationstation when I have time to see what happens here.

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by dudleydes » Tue Mar 17, 2015 3:54 pm
Hi Cesar

I am still having no luck with the --joystickkeybt flag. I launched ZEsarUX with the following command to see if I could get Hen-House Harry to move left and right in Chuckie Egg. The ./zesaruxrc config file was empty.
Code: Select all
./zesarux --fullscreen --joystickkeybt 7 \'9\' --joystickkeybt 5 \'0\'
I've been looking into EmulationStation and I understand that ES uses SDL2 for windowing and OpenGL ES for drawing. The Linux framebuffer is not directly involved which may explain the unavailability of fbdev.
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by chernandezba » Tue Mar 17, 2015 4:25 pm
dudleydes wrote:Hi Cesar

I am still having no luck with the --joystickkeybt flag. I launched ZEsarUX with the following command to see if I could get Hen-House Harry to move left and right in Chuckie Egg. The ./zesaruxrc config file was empty.
Code: Select all
./zesarux --fullscreen --joystickkeybt 7 \'9\' --joystickkeybt 5 \'0\'
I've been looking into EmulationStation and I understand that ES uses SDL2 for windowing and OpenGL ES for drawing. The Linux framebuffer is not directly involved which may explain the unavailability of fbdev.


Well the best thing to do is to look at the "Joystick to key" menu and see if buttons 7 and 5 are assigned.
Also, you can enter to 48k basic (without loading the game) and press these buttons and see if these characters 9 or 0 appears on the screen.

About sdl... well, ES may use SDL. But I don't know why on console fbdev works and not on ES... As I said, maybe fb is locked.

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by chernandezba » Tue Mar 24, 2015 8:27 am
Hi

I have added SDL support to ZEsarUX. Can you try it on ES?
As always, only on the snapshot version... Stable 2.1 version will be released soon ;)

Cheers
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by dudleydes » Tue Mar 24, 2015 9:17 pm
Thank you for this latest snapshot.

ZEsarUX works in ES! I've set the vo flag to sdl to remove a xwindows driver error in the console though ZEsarUX works fine without it.

One minor bug remains. If I boot into ES and try to launch a tape, I get an error that says ZEsarUX was unable to open rom file 48.rom. I have found a workaround. If I exit ES, start ZEsarUX from the command line, close it and restart ES, then tapes will launch without a problem.

I did notice that there is now a mouse cursor in the left hand corner when ZEsarUX starts up. Is there a way of removing it?

I have also fixed the issue regarding remapping the controls. Reading through the expert help, I noticed that the --joystickkeybt flag is dependent on the real joystick type, which, in my case, is Kempston. This explains why it was not working. Instead, I have used the --joystickkeyev flag which works.

Thank you for your hard work and a speedy solution for ES.
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by Higgy » Tue Mar 24, 2015 10:46 pm
Nice work guys.

Is the mouse cursor something to do with SDL?
Can the Fuse patch that is used to remove the mouse cursor also be utilised?
The patch was detailed on the RetroPie fuse.sh on Github?

UPDATE - Here is patch info (sorry but I don't understand it at all. I would love to integrate the patch into normal Fuse and install on Raspbian along with ZEsarUX :) )

https://github.com/petrockblog/RetroPie-Setup/commit/d4c22886904683ff8115bb4cd24b73c906599bac
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by chernandezba » Wed Mar 25, 2015 9:58 am
dudleydes wrote:Thank you for this latest snapshot.



Thanks to you to test it :)


ZEsarUX works in ES! I've set the vo flag to sdl to remove a xwindows driver error in the console though ZEsarUX works fine without it.



Great!



One minor bug remains. If I boot into ES and try to launch a tape, I get an error that says ZEsarUX was unable to open rom file 48.rom. I have found a workaround. If I exit ES, start ZEsarUX from the command line, close it and restart ES, then tapes will launch without a problem.



The rom file is always looked at the current directory or at the install directory. So, if you are, for example, in path:
/home/user
And run zesarux like this:
/home/user/bin/zesarux

It won't find the rom file. So, you have two possible solutions:
1) Always set the current folder to where the program and rom files are located
or
2) Do a make install. So the binary program and rom files go to another prefixed directories. You can set the install directory on the configure script, with the setting: --prefix




I did notice that there is now a mouse cursor in the left hand corner when ZEsarUX starts up. Is there a way of removing it?



Removed on the fullscreen mode. Try the last snapshot ;)



I have also fixed the issue regarding remapping the controls. Reading through the expert help, I noticed that the --joystickkeybt flag is dependent on the real joystick type, which, in my case, is Kempston. This explains why it was not working. Instead, I have used the --joystickkeyev flag which works.



Well, that is not really true. As the emulator says, "-joystickkeybt flag is dependent on the real joystick type", so, real joystick means the joystick you plug on the usb port. The settings --joystickkeybt and --joystickevent use the first parameter as the button number from you real joystick button. So, for example, if you set the Fire button from the button number 5 on your Logitech joystick, on another different joystick, like Microsoft joystick, the Fire button may come from the button number 9...
But --joystickkeyev assigns a defined button event (for example Fire event, which you previously redefined as button number 5) to
act as a key press, like '0'.
Tell me if you understand it now ;)



Thank you for your hard work and a speedy solution for ES.


Thanks to you. I will try it soon on ES...
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by chernandezba » Wed Mar 25, 2015 10:00 am
Higgy wrote:Nice work guys.

Is the mouse cursor something to do with SDL?
Can the Fuse patch that is used to remove the mouse cursor also be utilised?
The patch was detailed on the RetroPie fuse.sh on Github?

UPDATE - Here is patch info (sorry but I don't understand it at all. I would love to integrate the patch into normal Fuse and install on Raspbian along with ZEsarUX :) )

https://github.com/petrockblog/RetroPie-Setup/commit/d4c22886904683ff8115bb4cd24b73c906599bac



Thanks! Disabled mouse cursor on SDL fullscreen mode. Try the last snapshot ;)
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by chernandezba » Wed Mar 25, 2015 11:35 am
UPDATE: Disabling mouse pointer is not always done on SDL fullscreen. Instead, you have a new command line option --disablemousepointer to hide it
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am
by Higgy » Wed Mar 25, 2015 12:16 pm
I am glad that was of help, and you were very quick to implement. :D
Posts: 91
Joined: Sun Jun 29, 2014 7:12 pm
by dudleydes » Fri Mar 27, 2015 5:28 pm
Thanks for the latest snapshot. I now have everything working as I would like and successfully tested configuring controls for a number of games.

In my initial build, I had changed the joystick_emulation variable in the file joystick.c to Kempston. This time I left it unchanged so now the --joystickkeybt option seems to be working.

The --disablemousepointer option also works and the mouse cursor has gone.

I have found that shell scripts are the best way to launch Spectrum games from EmulationStation. This way, I can have games pre-configured for my controller. Also, I was able to fix the 48.rom not found error by adding a cd command to my script to change the working directory to where the rom file is. If you would like to know more about the shell scripts I'm using, then let me know.

The only minor point remaining is that when using joystickkeybt flags, messages are written to the console saying which keys are being pressed. I tried using a --verbose 0 flag but that had no effect. Is there a way of suppressing these messages as they don't tell me much as well as being untidy?

Please let me know when the next stable version will be released and I'll ask the Retropie devs if they will include ZEsarUX in their latest build.
Posts: 44
Joined: Sun May 18, 2014 12:19 pm
by chernandezba » Sat Mar 28, 2015 11:42 pm
Hi

Great to see emulator works perfect for you :)
I will check those messages written to console; on snapshot versions I check a lot of pieces of code writing messages to console. I will suppress it

About next version, maybe in a few weeks, two or three, or maybe a month ( but not more ;) )

I will be very happy to see ZEsarUX on Retropie; tell me if you need some help about it.

Thanks a lot!
Cesar
Posts: 46
Joined: Sat Feb 14, 2015 8:44 am