All Uzebox Games Online! (Cuzebox and Emscripten)

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by Jubatian » Tue Apr 17, 2018 5:24 am

nicksen782 wrote:
Mon Apr 16, 2018 8:18 pm
Question does the bootloader (old and new) read the filename or the data from packrom?
The "name of game" field is displayed in the Game Selector (at 0x00E - 0x02D).

A gameinfo.properties file has 4 fields which are actually parsed by Packrom:
  • name: Name of game; 0x00E - 0x02D
  • desc: Game description; 0x153-0x192
  • author: Author of game; 0x02E-0x04D
  • year: Release year; 0x00C-0x00D
The "genre" field isn't used by Packrom and the UZE file doesn't have any field which could be fitting for this. I had never seen it set anything else than zero.

The new bootloader displays the Author and the Year fields. The old bootloader only displays the Author. The game name in both shows in the Game selector, the actual filename is never displayed.

User avatar
Artcfox
Posts: 944
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by Artcfox » Tue Apr 17, 2018 10:01 am

I've set my genre field to the appropriate thing, depending on my game type (platformer or puzzle). I thought some tool used it to display a generic icon if a game specific icon wasn't found, but that might be a future hypothetical tool I am thinking of.

Edit: Nevermind, I guess that was only for the genre field on the wiki, not in the gameinfo.properties file.

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by nicksen782 » Fri Aug 17, 2018 3:06 pm

I have updated the Online Player to CUzeBox 20180817.

Also, I am working on an update to the Online Player. I already have on-screen controls (both gamepads), auto-pause, better bandwidth usage. It's coming soon and will still be compatible with all the previous direct URLs.

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by nicksen782 » Wed Oct 03, 2018 3:00 pm

I've put together some big changes to the Online Player.

All the existing links still work. The old links now do a redirect to the new URL. This would be the new official URL:

https://www.nicksen782.net/UAM5/emu.php

Take a look and let me know what you think. ... Yes, I do know that the on-screen controls do not work so well in Firefox. The rest should would though.

User avatar
L4rry
Posts: 239
Joined: Sun Dec 28, 2014 7:19 am
Location: Cape Town, South Africa

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by L4rry » Thu Oct 04, 2018 8:55 am

nicksen782 wrote:
Wed Oct 03, 2018 3:00 pm
I've put together some big changes to the Online Player.

All the existing links still work. The old links now do a redirect to the new URL. This would be the new official URL:

https://www.nicksen782.net/UAM5/emu.php

Take a look and let me know what you think. ... Yes, I do know that the on-screen controls do not work so well in Firefox. The rest should would though.
Nice work! I like the new color scheme and controller images. The rounded panels also look neat. All the buttons and links pop out better and it seems my eye can find all the important bits easier now. I like the addition of the second controller too. I'm not sure if this is a new or existing feature, but I've just noticed that you make accessible multiple versions of the same game if it's available. That's a pretty awesome feature :)

I did notice though that the 'Debug' and 'Quality' buttons for some reason scale the rendered game screen up and then crops the larger screen to the right and bottom to fit the panel. Not sure if this is what you are referring to when you mention known issues with Firefox. I thought I'd mention it anyway. Here's an example:

Correct Presentation
Screen Shot 2018-10-04 at 9.39.54 AM.png
Screen Shot 2018-10-04 at 9.39.54 AM.png (328.07 KiB) Viewed 1984 times
Scaled and Cropped Presentation
Screen Shot 2018-10-04 at 9.40.01 AM.png
Screen Shot 2018-10-04 at 9.40.01 AM.png (265.03 KiB) Viewed 1984 times

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by nicksen782 » Thu Oct 04, 2018 2:42 pm

@L4rry
Oh great find! The scaling issue. Yes, I am doing an auto-scaling of the emulator canvas in order to fit things better. Seems I'm not correcting the scaling after either the debug or quality button is clicked. I will fix that bug.

The other new features are "Auto-pause" which I use in UAM and is default disabled. The "Stop" will stop a game and the "Reload" will reload that same game but without a fresh download. The "Unload" button clears the cached game completely. Not likely needed but it is there for completeness.

The known bug for Firefox is specifically with the on screen controllers. They work but not correctly. They do work in Chrome though.

The multiple versions thing. Yes, for your game technically I am presenting multiple versions. The database keeps a copy of files required for the game and also which of those files is the default game file. I had 2.0 in there as well as 3.0. That was not the intended intention though. This was the intention. So, I'm working on a game that uses the new bootloader's SD functions. If you want to use those functions then you need to actually start the emulator with the bootloader hex. But the game file itself is also available. By clicking the "Play" button you can restart the emu with either the bootloader or the .uze or other .hex. I was writing some code earlier that could detect the bootloader and the version and I needed a way to easily flip between the straight game and the bootloader enabled version. I develop solely online with this emulator. But yes, I can supply more than one game version. The links right next to the "Play" button are download links too which is also helpful.

So, the emulator is no longer a separate thing. It is an integrated part of UAM now but it has an "Emulator-only" mode which is what you see. I may release UAM publicly once I get some more work done on it. I'm trying to make sure that the design is good.

Feedback is great! Thank you.

EDIT: I fixed the scale bug and it works right in Firefox. I'll need to update the event handler code. The rest of the app should work correct (other than the gamepads in Firefox.)

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by Jubatian » Thu Oct 04, 2018 4:59 pm

Nice stuff. good to see some improvements there! The User Interface certainly looks more polished and intuitive.

It needs some work, though. What I noticed first is that the emulator window seems to not have the right proportions, then messing around with the size of the browser window, I see: It looks like you don't enforce the correct ratio on this part, so depending on the browser window's dimensions, it may end up really wrong (for example even things like Mode 74 being squished so much that it appears to have square pixels).

Controls indeed behave weird in Firefox, although it is nice to have a capability of producing input for both players. Sometimes I had difficulty getting the keyboard to produce input for the game.

For the bootloader it shouldn't be necessary to have the capability to include the new bootloader. The library interfacing it is designed to fall back to an SDSC implementation similar to what is in the old bootloader when the new bootloader isn't available, so within the emulator games should always work regardless of whether there is a bootloader image also loaded or not (the emulator has no fragmentation either, so it is completely transparent in this regard).

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by nicksen782 » Thu Oct 04, 2018 5:29 pm

Jubatian wrote:
Thu Oct 04, 2018 4:59 pm
It needs some work, though. What I noticed first is that the emulator window seems to not have the right proportions, then messing around with the size of the browser window, I see: It looks like you don't enforce the correct ratio on this part, so depending on the browser window's dimensions, it may end up really wrong (for example even things like Mode 74 being squished so much that it appears to have square pixels).
I was trying to scale the page to center and fit in the browser but I don't have it perfect yet. I'll continue to work on it in time.
Jubatian wrote:
Thu Oct 04, 2018 4:59 pm
Controls indeed behave weird in Firefox, although it is nice to have a capability of producing input for both players. Sometimes I had difficulty getting the keyboard to produce input for the game.
Firefox handles events such as keyboard up/down differently than Chrome. Same code gives different results. I really wanted to be able to have the controller for player 2 available. Eventually I will figure this one out.
Jubatian wrote:
Thu Oct 04, 2018 4:59 pm
...so within the emulator games should always work regardless of whether there is a bootloader image also loaded or not (the emulator has no fragmentation either, so it is completely transparent in this regard).
I thought that too but I was not sure. So, for the emulator it really does not make any sense to include the bootloader .hex to load the game? I was still able to perform my tests (thanks for your help earlier on that.) With the bootloader SD API I don't have to worry about fragmentation. However, if the bootloader is not present then I need to find some way of detecting possible fragmentation so at least I can warn the user. Better an error message then some random stuff happening, right? That was my reason for those tests.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by Jubatian » Thu Oct 04, 2018 5:39 pm

nicksen782 wrote:
Thu Oct 04, 2018 5:29 pm
However, if the bootloader is not present then I need to find some way of detecting possible fragmentation so at least I can warn the user. Better an error message then some random stuff happening, right? That was my reason for those tests.
This would only happen on the real hardware, and then even loading games could end up causing weird behavior (if the game .uze itself is fragmented which the old bootloader can't even detect). So on the emulator your game would always work correctly, and of course it would also do so on a Uzebox with the new bootloader (if you used the Bootloader API library's SD functions to interface the card).

Probably the simplest way to do it, which involves the least amount of code is scanning the whole data file, having a magic binary stream at its end. If the magic stream matches, then you can assume the file not being fragmented (at least there is only a very small chance of it being fragmented). You may also use this scan to save quick access pointers to parts of the file so you can seek faster later. Alternatively you could have an actual checksum at the file's end, such as a CRC16 for which the bootloader API has a routine. It is slower, but if the CRC is OK, you can be even more sure that it is not fragmented.

Doing either of these is much lighter than implementing FAT sufficiently to traverse the cluster chain.

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: All Uzebox Games Online! (Cuzebox and Emscripten)

Post by nicksen782 » Thu Oct 04, 2018 6:14 pm

Ah, so, put a string or something at the end of the datafile? It could be known what the offset to that string should be. If the string is not there, then poof! Bad file alert. Do I have this correct? If so, this is a pretty simple test that ought to be easy to implement. And I would run it if the new bootloader isn't detected.

Post Reply

Who is online

Users browsing this forum: nicksen782 and 1 guest