JOric

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
Dbug
Site Admin
Posts: 4943
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

dreamseal wrote: Sun Feb 02, 2025 10:15 am
Dbug wrote: Mon Jan 20, 2025 2:48 pm How how hard would it be to add a PAUSE button to stop the emulation?
The latest version now has a pause button.

I also added an icon for toggling between the sharp pixels and the blurry pixels. This is experimental at the moment, mainly so people can try toggling it to see the difference within different games. Not sure if I'll retain that icon.
Works nicely :)

Yesterday I saw Jibe's last Wolfenstein test, and for this type of RGB graphics, it could be beneficial to have some mode where the content is not stretch to the full size of the screen, because the RGB lines become way too visible and basically the effect stops working.
User avatar
dreamseal
Pilot Officer
Posts: 107
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Dbug wrote: Sun Feb 02, 2025 11:11 am Works nicely :)

Yesterday I saw Jibe's last Wolfenstein test, and for this type of RGB graphics, it could be beneficial to have some mode where the content is not stretch to the full size of the screen, because the RGB lines become way too visible and basically the effect stops working.
I see what you mean. Perhaps rather than having the blur/unblur icon, I could have an icon that toggles through different screen sizes, with full stretch being the largest.
User avatar
Dbug
Site Admin
Posts: 4943
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

Could work :)
jsk
Officer Cadet
Posts: 46
Joined: Mon Jun 29, 2020 10:11 pm

Re: JOric

Post by jsk »

Let me know how to play with the localhost variant when it's ready! ;-)

Btw: I tend to use the simpliest web-server, either my home-grown, or just

python3 -m http.server 8080

I'm allergic to config-files... :-D

Usually, even for static stuff, CORS/security is working better when run from server, otherwise I prefer to edit files locally and just reload the file:///... in the browser! (No deployment...)

I guess, I too need to add a proxy-functionality to get around cors, but basically just a script with wget, lol
dreamseal wrote: Tue Jan 28, 2025 3:36 pm
jsk wrote: Mon Jan 27, 2025 6:40 pm As for running locally, no need to be fancy and pack up, it could be as simple as a ./w script that starts a simple python webserver just serving files (unless more fancy stuff needed). This is often my goto-solution.
I'm currently using a web server called "Simple Web Server" which I've found to be very easy to set up and configure. It is lacking a little with regards to documentation of some of the more powerful features, but I've been able to work things out with trial and error. Last night I was playing around with implementing a server side JS script specifically for local web server proxying when using Simple Web Server. It seems to work. It is basically an equivalent script to the CORS proxy that I have running in Cloudflare. So I have it fully working locally under http://localhost/ now, including the ?url= option. I will push these changes soon after a little tidy up. Some of the JavaScript APIs that JOric uses require certain response headers to be set, which is another thing that both Cloudflare and the Simple Web Server config is doing for me, but it turns out that for localhost, it doesn't need to be https for those browser APIs to work, i.e. it can be http, meaning that people won't have to fiddle with setting up SSL certificates if they're running a webserver locally.
jsk wrote: Mon Jan 27, 2025 6:40 pm One problem I have now is that when I generate a new .tap file and want to run it in my "web-oric" (oricutron) it's difficult as need to clear cashes, and it's local cash, otherwise it keeps using the old cash one. I find the javascript code (by other?) little inprenetable. Anyway, nothing you need to solve, per se.
I know exactly what you mean. I follow up a new deployment of JOric with a purge of the Cloudflare cache on the server side, and then I need to do a force refresh in the browser after that as well. And for the local Simple Web Server script that I'm using for my local setup, one issue I'm working through at the moment is that this new proxy script I've written isn't setting the appropriate caching headers, so I think the browser is caching things that I don't want it to. I should have that resolved later today though.
User avatar
dreamseal
Pilot Officer
Posts: 107
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

jsk wrote: Thu Feb 06, 2025 10:50 am Let me know how to play with the localhost variant when it's ready! ;-)
I've just switched to working on a Github Action for performing a "release" in response to a version tag being pushed to the repo. Part of that action will be to zip up the web content, name it with the version, and upload the artifact as a proper release within the github repo.

I'll let you know when that is working.

I'll then need to type up some instructions for how the content can be used with a web server.
jsk wrote: Thu Feb 06, 2025 10:50 am Btw: I tend to use the simpliest web-server, either my home-grown, or just

python3 -m http.server 8080

I'm allergic to config-files... :-D
Yeah, I like to use as simple approach as possible as well. I was previously using the standard nodejs http server, where you run it within the folder you want to serve, but that didn't support setting HTTP response headers, which is a requirement for JOric. Some of the browser APIs I am using (e.g. SharedArrayBuffer) will not work by default when simply loaded using a file URL, or web server that doesn't set certain response headers. This is why I switched to Simple Web Server. It has Windows, Mac and Linux downloads.

To make it as easy as possible, I have now added config files within the appropriate folders within my repo that Simple Web Server will automatically see and use, so in theory people will not need to set that up themselves, when using Simple Web Server locally that is. These config files tell Simple Web Server to set the appropriate response headers and to install the local version of the proxy script. The release zips that my "release" Github Action will create will have those included. It would then be in theory as easy as unzipping the zip and pointing Simple Web Server at the extracted folder.

It might be possible to include similar config files for other web servers that are automatically recognised. I'll take a look at what the python3 http.server uses for configuring HTTP response headers.
jsk wrote: Thu Feb 06, 2025 10:50 am Usually, even for static stuff, CORS/security is working better when run from server, otherwise I prefer to edit files locally and just reload the file:///... in the browser! (No deployment...)
I have my local web server pointing at the build output when I run builds locally, so I just run a build then refresh in the browser.
User avatar
dreamseal
Pilot Officer
Posts: 107
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

jsk wrote: Thu Feb 06, 2025 10:50 am Let me know how to play with the localhost variant when it's ready! ;-)
I now have the github release zip packaging working. The following release page will always have the latest version:

https://github.com/lanceewing/joric/releases/latest

Unfortunately, the steps are not quite as easy as I mentioned in my last post, as turning on automatic recognition of the embedded .swshtaccess config files is required as a manual step, but its still fairly straightforward with Simple Web Server. Here are the steps:

1. Download the release ZIP of joric, e.g.: https://github.com/lanceewing/joric/rel ... 1.0.14.zip

2. Extract the joric ZIP into a folder.

3. Download Simple Web Server for your platform from here: https://simplewebserver.org/download.html

4. Start up Simple Web Server

5. Click "New Server" button in bottom right corner

6. For the folder path, choose the folder that contains the index.html file from the extracted joric ZIP

7. Choose your port number. It works with port 80, so that is what I use, but could be anything, e.g. 8080, 8081, etc.

8. Expand the "Advanced Rules" section and tick the "Enable .swshtaccess configuration files" checkbox.

9. Click the "Create Server" button in the bottom right. This will start up the web server..

10. Now go to the web browser and access localhost on the port you chose. It should load the JOric home screen. Scroll to the right to choose a game.

It is the .swshtaccess files within the joric ZIP that automatically take case of the rest of the Simple Web Server configuration. These are the relative paths if you're interested in seeing what they do:

./.swshtaccess
./html/.swshtaccess
./worker/.swshtaccess

They mostly do the same thing, which is to add the "Cross-Origin-Opener-Policy" and "Cross-Origin-Embedder-Policy" HTTP response headers that are required to active some of the Javascript APIs. The top level .swshtaccess file also sets up the localhost equivalent of the CORS proxy.

Let me know how you get on with that. I'm not sure I can make the steps much easier, due the requirement to set those HTTP response headers.
Last edited by dreamseal on Sun Feb 09, 2025 10:26 pm, edited 1 time in total.
jsk
Officer Cadet
Posts: 46
Joined: Mon Jun 29, 2020 10:11 pm

Re: JOric

Post by jsk »

dreamseal wrote: Sat Feb 08, 2025 9:28 am
jsk wrote: Thu Feb 06, 2025 10:50 am Let me know how to play with the localhost variant when it's ready! ;-)
I now have the github release zip packaging working. The following is the latest version:

https://github.com/lanceewing/joric/rel ... v1.0.7.zip

Unfortunately, the steps are not quite as easy as I mentioned in my last post, as turning on automatic recognition of the embedded .swshtaccess config files is required as a manual step, but its still fairly straightforward with Simple Web Server. Here are the steps:

1. Download the release ZIP of joric, e.g.: https://github.com/lanceewing/joric/rel ... v1.0.7.zip

2. Extract the joric ZIP into a folder.

3. Download Simple Web Server for your platform from here: https://simplewebserver.org/download.html

4. Start up Simple Web Server

5. Click "New Server" button in bottom right corner

6. For the folder path, choose the folder that contains the index.html file from the extracted joric ZIP

7. Choose your port number. It works with port 80, so that is what I use, but could be anything, e.g. 8080, 8081, etc.

8. Expand the "Advanced Rules" section and tick the "Enable .swshtaccess configuration files" checkbox.

9. Click the "Create Server" button in the bottom right. This will start up the web server..

10. Now go to the web browser and access localhost on the port you chose. It should load the JOric home screen. Scroll to the right to choose a game.

It is the .swshtaccess files within the joric ZIP that automatically take case of the rest of the Simple Web Server configuration. These are the relative paths if you're interested in seeing what they do:

./.swshtaccess
./html/.swshtaccess
./worker/.swshtaccess

They mostly do the same thing, which is to add the "Cross-Origin-Opener-Policy" and "Cross-Origin-Embedder-Policy" HTTP response headers that are required to active some of the Javascript APIs. The top level .swshtaccess file also sets up the localhost equivalent of the CORS proxy.

Let me know how you get on with that. I'm not sure I can make the steps much easier, due the requirement to set those HTTP response headers.
I see that simple webserver is built on electron (nodes+GUI), sadly enough I'm not using GUIs, only command line.

Github freaks out at the size of the size of the "simple webserver" - I think it's lite 4GB+ so downloading from Thailand fails towards the end always. Same with OSDK (oric sdk, lol)

In any case....

I tried to use the phttp just to server the files, but I guess (?) at startup it's dependent on response from the "programs" (JavaScript script file) which is a nodejs/electron server side function.

To bypass this I'd hoped that I'd just be able to access http:/localhost:8000/#basic for example, but no oric is rendered the screen is all blank in all cases.

I'll see if I can get this going with using a simple plain nodejs-webserver.

It seems it's all intriguingly interconnected. Maybe also being an <script ld+Json app etc,

Also, I see gwt is used (as it's java). Haven't used gwt since "google wave", I guess it's more "stable" now. lol

Anyway, I would have thought it should just have worked if to start the emulator and load a static tap-file without any more stuff going on, that should not be CORS-related?

Cheers,
Jonas
User avatar
dreamseal
Pilot Officer
Posts: 107
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

jsk wrote: Sat Feb 08, 2025 10:05 pm Anyway, I would have thought it should just have worked if to start the emulator and load a static tap-file without any more stuff going on, that should not be CORS-related?
Unfortunately, it won't run at all without the following two HTTP response headers being set by the web server in every response:

Code: Select all

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentialless
To make it work with something like a nodejs http server, the nodejs code will need to set those two headers in the responses. Without those headers being set, you'll get something like the following error in the web browser console:

Uncaught ReferenceError: SharedArrayBuffer is not defined
at new emu_joric_gwt_GwtKeyboardMatrix_GwtKeyboardMatrix__V

JOric uses SharedArrayBuffer for multiple things (keyboard events, graphics, sound). Browsers disable it by default for security reasons:

https://developer.mozilla.org/en-US/doc ... quirements

The page needs to be cross origin isolated in order for those APIs to become available for use:

https://developer.mozilla.org/en-US/doc ... inIsolated
Post Reply