Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Sat Nov 11, 2017 11:17 pm

SteveF wrote:Thanks for the update, that's helped but I now get a different build failure:
...
Again, I haven't tried looking into this myself.

No problem. I'm a bit confused as to how I've managed to supply a raw pointer for a shared_ptr elsewhere, but maybe I'm misreading the error message in haste. I'll figure it out.

EDIT: corrected and on master. Should be safe to try building from source again if you fancy it.

SteveF wrote:I'm happy to give your binary a try but I can't see it; am I missing an attachment or something? Please provide idiot-proof instructions on where to look...

I forgot to link to it at all. It's here.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Sat Nov 11, 2017 11:28 pm

Cheers, I tried the binary but I get an error - almost certainly because I'm still on Ubuntu 16.04:

Code: Select all

steven@riemann:/tmp$ ./clksignal
./clksignal: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./clksignal)


(Incidentally, this machine is just using the Intel HD3000 graphics built into the CPU (Sandy Bridge i5-2500K), so it's possible it won't be able to cope with running the emulator anyway. But I appreciate we haven't got to that point yet, and I'm more than happy to help with testing the build process if nothing else.)

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Sat Nov 11, 2017 11:34 pm

SteveF wrote:Cheers, I tried the binary but I get an error - almost certainly because I'm still on Ubuntu 16.04:

Code: Select all

steven@riemann:/tmp$ ./clksignal
./clksignal: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./clksignal)


(Incidentally, this machine is just using the Intel HD3000 graphics built into the CPU (Sandy Bridge i5-2500K), so it's possible it won't be able to cope with running the emulator anyway. But I appreciate we haven't got to that point yet, and I'm more than happy to help with testing the build process if nothing else.)

Coincidentally, my development machine — a 2011 MacBook Air — has an i5 and HD3000 graphics so that may well not be a problem. Hopefully the latest version of the source will build for you, and we can find out for sure.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Sat Nov 11, 2017 11:52 pm

Well there's definitely progress... It now builds fine and having copied what I hope are the right ROMs into the right locations, it starts up and a small window appears - but the contents never redraw, they just show whatever was in that area of the screen "behind" the new window, and if I maximise and un-maximise the window it's black. However, I suspect the emulator is otherwise working, because if I press CTRL-F12 (=CTRL-BREAK, right?) it beeps, and I can get then get further beeps by pressing CTRL-G, and if I type (blind, of course) "SOUND 1,-15,52,200" then I get another sound.

The only output on the terminal which launched the emulator is:

Code: Select all

steven@riemann:~/src/CLK/OSBindings/SDL$ ./clksignal /tmp/MinedOut_E.uef
!!! Skipping 0000
!!! Skipping 0005
!!! Skipping 0000
!!! Skipping 0005


I suspect this won't be very helpful, but I'm not sure what else I can say...

ETA: Probably not useful, but if I press CTRL-G repeatedly, the beep is sometimes a bit stuttery - maybe 1 out of 10 beeps is affected.

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Sun Nov 12, 2017 12:10 am

SteveF wrote:Well there's definitely progress... It now builds fine and having copied what I hope are the right ROMs into the right locations, it starts up and a small window appears - but the contents never redraw, they just show whatever was in that area of the screen "behind" the new window, and if I maximise and un-maximise the window it's black. However, I suspect the emulator is otherwise working, because if I press CTRL-F12 (=CTRL-BREAK, right?) it beeps, and I can get then get further beeps by pressing CTRL-G, and if I type (blind, of course) "SOUND 1,-15,52,200" then I get another sound.

The only output on the terminal which launched the emulator is:

Code: Select all

steven@riemann:~/src/CLK/OSBindings/SDL$ ./clksignal /tmp/MinedOut_E.uef
!!! Skipping 0000
!!! Skipping 0005
!!! Skipping 0000
!!! Skipping 0005


I suspect this won't be very helpful, but I'm not sure what else I can say...

ETA: Probably not useful, but if I press CTRL-G repeatedly, the beep is sometimes a bit stuttery - maybe 1 out of 10 beeps is affected.

Fantastic! I mean, not ideal, obviously, but yeah: that means that the emulator thought it was presenting an Electron and loading Mined Out for you*. And that the audio was working. I can't immediately think of why the display wouldn't appear, but I guess I'm misusing SDL in some subtle way: my process here has simply been to get it working with the Mac port of SDL, then get it building under Linux. My virtual machine refuses to support OpenGL 3.0 so I don't even get as far as a window.

So I guess I'll go back to the manual. I was a big SDL 1.3 user way back when but this is my first usage of 2.0 so my familiarity is relatively low. I should probably also massively expand the range of things I log if I can't find a way to debug more locally.

* "!!! Skipping" emanates from the UEF code, and means it is skipping a chunk of that type — in this case it has decided it doesn't care which tool produced the UEF and is uninterested in the target machine, because right now it can emulate only the one kind applicable to UEF files anyway. It prints it twice because it walks the UEF file preparatory to starting the machine for reasons including determining the proper loading command, then rewinds it for the actual emulation. So the UEF cursor ignores those chunks twice.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Sun Nov 12, 2017 12:28 am

Thanks, I'm glad you're not discouraged!

This is so vague it's probably not helpful, but FWIW: I left the Clock Signal window open all this time and a few minutes ago it suddenly turned solid black, whereas before it was showing a fragment of the rest of my desktop, presumably due to not redrawing properly. I am sure the window had previously been solid black following my maximise-and-unmaximise step, but if it hadn't ended up showing the desktop fragment somehow I wouldn't have noticed anything when it changed to black - it was just sat there in the foreground and suddenly I saw it change to black. I've kicked off a second instance to see if this happens again.

I won't attach a screenshot of the black window as I'm sure you can imagine that for yourself, but here's a freshly started instance just so you can see what I mean by "fragment of the rest of my desktop":
Screenshot from 2017-11-12 00-26-27.png

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Mon Nov 13, 2017 2:29 am

SteveF wrote:Thanks, I'm glad you're not discouraged!

This is so vague it's probably not helpful, but FWIW: I left the Clock Signal window open all this time and a few minutes ago it suddenly turned solid black, whereas before it was showing a fragment of the rest of my desktop, presumably due to not redrawing properly. I am sure the window had previously been solid black following my maximise-and-unmaximise step, but if it hadn't ended up showing the desktop fragment somehow I wouldn't have noticed anything when it changed to black - it was just sat there in the foreground and suddenly I saw it change to black. I've kicked off a second instance to see if this happens again.

I won't attach a screenshot of the black window as I'm sure you can imagine that for yourself, but here's a freshly started instance just so you can see what I mean by "fragment of the rest of my desktop":Screenshot from 2017-11-12 00-26-27.png

I've made one quick attempt to fix it — a guess, nothing more — and added some basic additional debugging but it is starting to sound like I might need to figure out a way to set up a Linux machine that can actually run OpenGL 3.0. Time will tell, I guess. In the meantime I've resolved all GCC build warnings, so that's a bonus.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Mon Nov 13, 2017 7:19 pm

Thanks, I've tried that but it exhibits the same behaviour I'm afraid. The output on the terminal is:

Code: Select all

steven@riemann:~/src/CLK/OSBindings/SDL$ ./clksignal /tmp/MinedOut_E.uef
!!! Skipping 0000
!!! Skipping 0005
Target framebuffer has ID 0
!!! Skipping 0000
!!! Skipping 0005
Window size is 400, 300

I can still do the CTRL-F12 then CTRL-G beeps stuff, so the problem is still only with the display. Let me know if there's anything else you want me to try...

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Mon Nov 13, 2017 7:33 pm

SteveF wrote:Thanks, I've tried that but it exhibits the same behaviour I'm afraid. The output on the terminal is:

Code: Select all

steven@riemann:~/src/CLK/OSBindings/SDL$ ./clksignal /tmp/MinedOut_E.uef
!!! Skipping 0000
!!! Skipping 0005
Target framebuffer has ID 0
!!! Skipping 0000
!!! Skipping 0005
Window size is 400, 300

I can still do the CTRL-F12 then CTRL-G beeps stuff, so the problem is still only with the display. Let me know if there's anything else you want me to try...

I think I'm going to have to try to clear enough hard disk space for a real dual boot to figure this stuff out. Besides an SDL misuse, it's also very possible that I'm using SDL correctly but have made some undefined behaviour-type error that happens to work with the Mac OpenGL driver. Though it's obviously succeeding at creating the OpenGL objects it thinks it needs (shaders, frame buffers, etc), as it would otherwise throw an exception. The logical next step is to add a technically-redundant glClear and see whether the window now at least fills itself in. If you fancy throwing a glClear(GL_COLOR_BUFFER_BIT); on line 294 of OSBindings/SDL/main.cpp then go for it. If that gives a window with empty contents rather than one that doesn't paint at all, then the ball is in the emulated CRT's court.

Don't worry about it if I'm really starting to ask too much though, I'll figure this out one way or another.

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Mon Nov 13, 2017 7:38 pm

ThomasHarte wrote:The logical next step is to add a technically-redundant glClear and see whether the window now at least fills itself in. If you fancy throwing a glClear(GL_COLOR_BUFFER_BIT); on line 294 of OSBindings/SDL/main.cpp then go for it. If that gives a window with empty contents rather than one that doesn't paint at all, then the ball is in the emulated CRT's court.


Without that change, when the emulator starts up the window looks like the screenshot I posted above - it doesn't fill in and part of my desktop shows in the window instead.

If I add 'glClear(GL_COLOR_BUFFER_BIT);' between 'updater.update()' and 'machine->crt_machine()->get_crt()...', the emulator starts up with a black window.

Does that help? I'm happy to try anything else you think would help...

Cheers.

Steve

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Mon Nov 13, 2017 7:50 pm

SteveF wrote:
ThomasHarte wrote:The logical next step is to add a technically-redundant glClear and see whether the window now at least fills itself in. If you fancy throwing a glClear(GL_COLOR_BUFFER_BIT); on line 294 of OSBindings/SDL/main.cpp then go for it. If that gives a window with empty contents rather than one that doesn't paint at all, then the ball is in the emulated CRT's court.


Without that change, when the emulator starts up the window looks like the screenshot I posted above - it doesn't fill in and part of my desktop shows in the window instead.

If I add 'glClear(GL_COLOR_BUFFER_BIT);' between 'updater.update()' and 'machine->crt_machine()->get_crt()...', the emulator starts up with a black window.

Does that help? I'm happy to try anything else you think would help...

Cheers.

Steve

Yes. I think that eliminates what was previously the main theory: misuse of SDL. Either my off-screen frame buffer isn't functioning for some reason, or the process to copy from it to the main frame buffer is failing. So I'll stick my nose back in there. Could be as simple as failure to initialise a piece of state, or accidentally relying on an extension that Apple's driver happens to support, or something like that.

As ever, I'm very optimistic that the answer will present itself soon. In the meantime I'll throw in some additional logging around those things and see whether anything falls out.

[sneaky] EDIT: I've installed a better virtualisation solution, and can reproduce. So hopefully a solution will be forthcoming within the next few days. Some fixes have already gone in, more will likely be forthcoming.

[second sneaky] EDIT: an SDL misuse does actually appear to explain much of the problem, with a mismatched OpenGL context being supplied. Having fixed that there's some sort of issue with one shader in particular, but that seems to be the final obstacle. If I display either the raw composite signal (as if a naive black and white TV set) or the unfiltered RGB (a low-pass filter is usually applied because even monitors have finite bandwidth) then the emulator launches and runs correctly. Only if I enable composite decoding do things cease to function. Probably either an uninitialised value or an inadvertent reliance on non-guaranteed precision or something like that. But the diagnosis is now localised to one single point, albeit one that I frustratingly can't apply either symbolic or caveman logging to.

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Fri Nov 17, 2017 2:17 am

Success! And checked in. But with heavy pre-release caveats:
  • machine configuration options aren't surfaced, at all;
  • the Electron by default loads at its real speed, and acts as though connected to a monitor.
So this might be an opportune moment to try some disk images rather than tapes.

Amongst other things, I'll now make sure all machine options are settable and try to pick smarter defaults, before calling that a genuine first release.

Screen Shot 2017-11-16 at 21.11.45.png

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Fri Nov 17, 2017 10:26 pm

I just built the latest code from your repo and it works for me too. Thanks!

The monitor interlace effect is a bit disconcerting, but it's the realism that attracts me to this emulator and I suspect it will be less noticeable given time to get used to it. I really want to see the TV emulation TBH, that would probably give me the real "first proper computer" nostalgia hit I'm seeking. :-)

Except... Mined Out doesn't load properly from tape. :-( It does load in Elkulator 1.0 (running under Wine), even if I select "normal" speed to make it a fair comparison. Clock Signal loads the title animation OK, but it seems to fail partway though loading the instructions (the little red window shows "Searching" instead of "Loading" and then it just starts showing the files on the tape without loading them).
Screenshot from 2017-11-17 22-15-49.png


I can obviously live without this, but I thought you might be interested. I've attached a copy of it for convenience if you want to take a look. As always, let me know if there's anything I can do to help...
Attachments
MinedOut_E.zip
(9.1 KiB) Downloaded 8 times

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Sun Nov 19, 2017 2:31 am

SteveF wrote:I just built the latest code from your repo and it works for me too. Thanks!

After fixing the SDL misunderstanding I discovered an error in attribute binding with my OpenGL code, specifically supplying the wrong string names to a function. I was just being very, very lucky on the Mac — it just so happens to assign slots in declaration order.

SteveF wrote:The monitor interlace effect is a bit disconcerting, but it's the realism that attracts me to this emulator and I suspect it will be less noticeable given time to get used to it. I really want to see the TV emulation TBH, that would probably give me the real "first proper computer" nostalgia hit I'm seeking. :-)

Being pedantic, it's not so much an effect as it is my best attempt at deinterlacing, given that the Electron is now known to produce an interlaced image. I might be able to do better one day. I think all previous Electron emulators model it as a non-interlaced machine. My previous efforts certainly did.

More importantly: I've checked in a version that can comprehend command-line options, and picks more user-friendly default options. It's very uncommunicative about them at present though. But I needn't be. For the Electron:
  • use --display=composite to connect your display to the Electron via composite video. Or --display=rgb for an RGB connection but that remains the default;
  • use --quickload=yes or --quickload=no to enable or disable artificially-fast tape loading. But yes has now become the default.

SteveF wrote:Except... Mined Out doesn't load properly from tape. :-( It does load in Elkulator 1.0 (running under Wine), even if I select "normal" speed to make it a fair comparison. Clock Signal loads the title animation OK, but it seems to fail partway though loading the instructions (the little red window shows "Searching" instead of "Loading" and then it just starts showing the files on the tape without loading them).
Screenshot from 2017-11-17 22-15-49.png

I can obviously live without this, but I thought you might be interested. I've attached a copy of it for convenience if you want to take a look. As always, let me know if there's anything I can do to help...

I'm looking at it now. There are at least these three features away from calling this a first Linux release:
  • being much more communicative on the command line (what arguments are available? If I haven't installed them, where should the ROMs be?);
  • giving the window an appropriate name — the name of the file you're loading, not the placeholder software name; and
  • joystick input generally. Which doesn't affect the Electron, but right now the Atari 2600 is entirely unusable.
... and it'd be nice to support drag and drop and being a paste target for text, both of which I think SDL allows easily.

So also checking out which error I've made in UEF handling isn't a big addition to the task list. You might or might not see better luck with fast loading — there's no special into-the-file inspection, it's still parsing the audio wave, but if it's something like an uninitialised variable then just using a slightly different code path might be enough.

EDIT: I'm also worried there might be a sound latency problem under SDL due to the mechanism I'm using. So I need to work on that.

Screenshot at 2017-11-18 20-39-31.png

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Sun Nov 19, 2017 6:19 pm

Thanks, I just pulled and built the latest code and --quickload=yes works. The composite video is indeed very nostalgia-inducing. As is making a silly keypress and walking on top of a mine I knew was there. :-)

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Tue Nov 21, 2017 8:36 pm

SteveF wrote:Thanks, I just pulled and built the latest code and --quickload=yes works. The composite video is indeed very nostalgia-inducing. As is making a silly keypress and walking on top of a mine I knew was there. :-)

Cool! So I'm marching on to something that doesn't need my exposition for use, etc, but quick question to you as a Linux user: do you have any expectations as to switching in and out of full-screen mode?

It's a standard window control on the Mac. I'm assuming that because window dressing is whatever you want it to be on X11 and a framless full-screen toggle is not standard, I should idiomatically provide my own control or key combination? Is alt+enter still the thing?

Oh, and don't try to use the Vic-20. It's momentarily broken due to an internal miscommunication about audio sampling rates and a resulting divide-by-zero. It'll be fixed.

(EDIT: Vic-20 fixed, and an alt+enter fullscreen toggle added, along with shift+control+v to paste text. It also in theory gained drag and drop support for changing or adding to the inserted media during the week. So all I want to do now to complete the SDL portion of things is to switch audio output routes as I think I can substantially reduce latency that way. Then it'll be back to emulation quality improvements and/or adding additional machines)

SteveF
Posts: 439
Joined: Fri Aug 28, 2015 8:34 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby SteveF » Wed Nov 22, 2017 8:29 pm

I think F11 is what I'd usually expect to toggle full screen mode. I say that mainly because Firefox uses it. That might be a bit easy to hit accidentally, but since F10 is break I guess it's no worse than that; F11 has no permanent effect, after all.

I have no objection to Alt+Enter as a full screen toggle, especially since you've already done it...

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Thu Nov 23, 2017 1:20 am

SteveF wrote:I think F11 is what I'd usually expect to toggle full screen mode. I say that mainly because Firefox uses it. That might be a bit easy to hit accidentally, but since F10 is break I guess it's no worse than that; F11 has no permanent effect, after all.

I have no objection to Alt+Enter as a full screen toggle, especially since you've already done it...

Cool. I've made some other small adjustments here and there and decided that's sufficient to open to a wider audience. So I'll momentarily segue this discussion to a new thread, given that. can't remove the "Do you own a Mac" part of this thread's title.

EDIT: further discussion now at http://stardot.org.uk/forums/viewtopic.php?t=14100.

User avatar
daveejhitchins
Posts: 3692
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby daveejhitchins » Thu Nov 23, 2017 10:06 am

ThomasHarte wrote:
SteveF wrote:given that. can't remove the "Do you own a Mac" part of this thread's title.
Yes you can! Just Edit your first post - Unless you really don't-want-to change that part of the title?

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

ThomasHarte
Posts: 367
Joined: Sat Dec 23, 2000 5:56 pm

Re: Do you own a Mac, and like your Electron emulators minimal and potentially seizure-inducing?

Postby ThomasHarte » Thu Nov 23, 2017 9:42 pm

daveejhitchins wrote:
ThomasHarte wrote:
SteveF wrote:given that. can't remove the "Do you own a Mac" part of this thread's title.
Yes you can! Just Edit your first post - Unless you really don't-want-to change that part of the title?

Dave H :D

Then I'm acting under a misapprehension. If somebody with that ability wants to merge the two threads, I will edit the title. Otherwise I'll let things be.


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 4 guests