ClockSignal.... the emulator

I’ve recently discovered this emulator and it runs great on my 2020 M1 Mac Mini (I prefer how it functions, even moreso than other multi-emulators, like MAME). However, it is portable to other non-Mac platforms (such as Linux) and I’d love to see it made available for Haiku. I’d do it myself (assuming it was nothing harder than doing a build for Haiku), but there seem to be no direct instructions/steps on how to do so.

Read the BUILD.txt file, it contains the prerequisites (doesn´t look too bad for Haiku porting, at first sight) and build instructions. Start with the instructions for Linux and work your way from there.

It builds fine. Scons is in HaikuDepot, so it’s just a download and go type of thing. Unless you want to change the directories it uses (probably a good idea).

I don’t know how well it works, though.

You said it builds fine, but you don’t know how well it works? You mean how well the emulation works for different platforms it supports or how well ClockSignal (the emulator itself) works in Haiku?

Yes. It runs (with a file supplied, otherwise it crashes). I was able to move the little guy with the cursor keys, but I couldn’t figure out what keys did things like Reset, Select, etc. In fact, it started Maze Craze with a game already in progress, which Maze Craze doesn’t do.

After I wrote the reply (unrelated aside: I was unable to upload the screen shot using Web+), I went back to ClockSignal and the little man would no longer move.

I only spent about five minutes with it, so, that’s not a whole lot of time to say anything definitive.

I’m running into issues. The only “OSBindings/SDL” I can find is in the CLK source code folder. I direct Terminal to that directory, type “scons” and it tries to do stuff and apparently fails. I end up with a red directory prompt.

I could really use a little guidance in this. I just installed Haiku R1 Beta4 (official build, not nightly) and then, after the first fail, I decided to try installing SDL (which I realized was not likely installed). But I’m not sure I installed the right one from HaikuDepot. I think it also updated Haiku, itself. But, upon rebooting and going to the OSBindings/SDL directory and typing scons again… I got the same result!

Some step-by-step instructions would help…

Run HaikuDepot
Under the Show menu, make sure Develop packages has a check mark next to it
In Search terms, type sdl2
Install libsdl2 and libsdl2_devel

For good measure, install everything else that starts with sdl2_ and has a status of Available (except for sdl2_pango and sdl_pango_devel)

Then go to OSBindings/SDL and type scons

I wisely installed SDL2, instead of SDL (older; version 1?) but apparently not enough, as you’ve mentioned. I also did a Haiku update, which installed a ton of stuff (92 items, including a few new things), so that will probably help when I boot up Haiku again later today/tonight.

You could also try the Qt port (the SDL2 one crashed on my at launch) with QtCreator.

You have to give it a ROM (or whatever you’re trying to run) name when you run it on Terminal, otherwise it crashes. It’s not very graceful, that way.

I haven’t tried building the Qt port, but I suspect it might be a bit nicer than the SDL2 one.

1 Like

Ok I built ClockSignal successfully, finally figured out that I needed a ROM file that was not included (well, it’s included in the Mac version) and needed to point ClockSignal to a specific location to execute it. THEN, everything booted up good. Except… it’s thinking the middle (scroll wheel) “button” is the left mouse button! And setting Haiku to treat the mouse as a 2 button or even a 1 button mouse didn’t solve the problem. I had to physically assign the left mouse button as the 3rd (middle; scroll wheel) button, so that it would work correctly in my emulated Atari ST environment. But then it makes the mouse button arrangement totally different in Haiku, since now the middle scroll wheel is the left mouse button! ARRRGH!

And, the emulated environment is really sluggish! I looked and all four cores (well, the Pentium G4560 has 2 cores and 4 threads) were literally maxed out the entire time! Anyone else seeing this same thing? Any idea why?

My guess is that it’s not quite ready, yet. For Atari ST/TT stuff, I use Hatari.
It would be nice if HaikuDepot had Stella, Hatari, A7800, and Atari800, though. It would make my life easier.

SDL2 uses OpenGL, which means software rendering on Haiku, and most games just let it try to render as fast as possible even for 2D. There are other SDL2 apps that will use up all of the CPU time; For example LBreakoutHD uses pretty much all of the CPU unless you go into the settings and enable the framerate limiter and then it behaves better. Perhaps this software has a framerate setting?

That makes sense, but I said the environment was sluggish. In other words the mouse pointer wasn’t moving smoothly. Like frames were being skipped or something. The only other example I have is on my 2020 M1 Mac Mini which runs ClockSignal perfectly smoothly. Of course the M1 blows the doors off a lot of Intel CPUs, but… I assumed SDL2 on a 2017 Intel Pentium G4560 would still run decently.

I assume there is a difference between using all the CPU because you need it (and it’s not enough) and hogging all the CPU because that’s just what you do and you could easily do with a lot less. But if the latter was the case, why is the ST mouse pointer so stodgy?

Is SDL2 known for hogging so much CPU it negatively affects the app it’s working for? In other words, is SDL2 sapping so much CPU, there isn’t enough for Haiku, itself, to draw the mouse smoothly? Of course… hmm… when I disengage the ST mouse, so that I can use the Haiku mouse again, the Haiku mouse works perfectly fine (smoothly). So, I think it’s strictly related to just the ST rendering environment. I’m going to have to see if the CPU use drops when I disengage the ST mouse or only after I quit ClockSignal period.

Ok, just ran it again and ClockSignal hogs 90-95% of the CPU for the Atari ST instance, as soon as it starts. When I enable the the ST mouse, there is little difference, it appears. However, I ran Pulse and disabled all but one core. And the ST environment was so horrible (CPU totally taxed), I was barely able to even free the Haiku mouse! With 2 cores, some headroom is barely available for Haiku, but when the ST environment was enabled, the cores were totally maxed. So, now we see that demand is legitimate… but is it SDL2 itself (that’s just the way it is), Haiku’s implementation of SDL2 (how SDL2 functions within Haiku) or Haiku’s limitations with SDL2 (Haiku isn’t coded properly to handle SDL2 efficiently)? I ask this, because we know that Haiku’s networking is not the most efficient (download speed on the Internet), so maybe that extends to other aspects as well. Just trying to make sense of this situation…

It wouldn’t surprise me if it wasn’t at least partially the Haiku implementation of SDL2. In my experience, things that use SDL have no trouble using joysticks, but things that rely on SDL2 will not see joysticks (or gamepads, etc.) at all.

So, there are probably other things that aren’t quite working.

Just found this…

How do I get/create the Qt version of ClockSignal?

Not in Haiku atm, but qmake . in the Qt source directory should do the job also.

Once I’ve done that (which you obviously already have), where do I put the ROMs, and disks? Do I just double-click on the icon to run it or do I need to still run it via the Terminal?