UzeboxUI - a GUI demo for Uzebox

Use this forum to share and discuss Uzebox games and demos.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

UzeboxUI - a GUI demo for Uzebox

Post by ry755 »

D3thAdd3r wrote: Sat Feb 18, 2023 11:36 pm For me, a gimmicky little desktop and some cooperative multitasking, windows, and mouse support to control flashing of games, and perhaps a VM to run utilities to operate inside the desktop would be awesome.

Probably possible. If someone just bum rushed us with a working Uzebox OS all of a sudden...well, this would be beyond ideal 8-)
Yeah so.... here is UzeboxUI, a buggy mess of a GUI for the Uzebox which I made about 3 years ago but never released. It's much more stable in cuzebox than on real hardware for some reason, I think maybe cuzebox doesn't randomize memory contents on reset and the issue is somewhere with uninitialized data? Not 100% sure.

The code is a mess and was very clearly written by someone who used to have no experience with C :oops: , and it desperately needs some cleanup.
I may get around to rewriting it someday, but for now, here it is in its current state. It's more of a demo rather than anything useful, EmbedVM in this usecase is far too slow to be used for anything outside of little utilities like a calculator.

Screenshot: https://i.imgur.com/aGPHuUc.png

Features:
- External application support with EmbedVM by Clarie Xen, a very unfinished API is provided for creating small UzeboxUI applications
- Dynamic "Apps" submenu loaded and parsed from a text file on the SD card
- Dynamic splash screen loaded on startup from a raw image file on the SD card
- Customizable wallpaper tile (theoretically it should be possible to use a ramtile for this to have a user-designed tile, but this is not currently implemented)

The attached zip file includes the .uze file itself, as well as some little demo programs that run within EmbedVM.

Source code and details: https://github.com/ry755/UzeboxUI
Attachments
UzeboxUI.zip
(21.64 KiB) Downloaded 49 times
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeboxUI - a GUI demo for Uzebox

Post by Artcfox »

Holy crap! That's really awesome. Feels a bit like Mac OS 9. I love that it has apps too. And I can drag the windows around. Very nice!
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: UzeboxUI - a GUI demo for Uzebox

Post by mapes »

Whoa, that is really impressive.

What are the additional limitations it has? Can it run load extra bits on the side like a windowed 'mine sweeper' game'?
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: UzeboxUI - a GUI demo for Uzebox

Post by ry755 »

mapes wrote: Sun Feb 19, 2023 4:31 am Whoa, that is really impressive.

What are the additional limitations it has? Can it run load extra bits on the side like a windowed 'mine sweeper' game'?
Thank you!!

The limitations of what it can run are mostly the limitations of EmbedVM (see its website for details https://embedvm.com/), plus the fact that UzeboxUI only supports a maximum of 10 windows with a maximum of 15 buttons in each window. But I'm sure these limitations could be exceeded with some further optimization. The ATmega644's internal RAM is about 90% used currently (not including the stack). I'm sure some stuff could be moved from the internal RAM to the SPI RAM, perhaps only the window struct for the currently active window should be kept in internal RAM and the rest should be swapped out into the SPI RAM.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: UzeboxUI - a GUI demo for Uzebox

Post by D3thAdd3r »

exploding-head_1f92f.png
exploding-head_1f92f.png (18.97 KiB) Viewed 1104 times
Wow this is so cool, haha minesweeper is a must!

The RAM tiles demo is actually filling reasonably fast, is that all VM? Great work here!
User avatar
danboid
Posts: 1939
Joined: Sun Jun 14, 2020 12:14 am

Re: UzeboxUI - a GUI demo for Uzebox

Post by danboid »

I love it!

It'd be cool to see this working on real hardware and pimp it out a bit. It failed to load on my Uzebox but works fine under cuzebox. It would be amazing if we could squeeze in:

* A minimal text editor. Choosing File -> New would open the text editor.
* A minimal file manager, if only for deleting files off SD but copy and move would be cool too. File -> Load would open this window.
* A telnet client

I see the mouse support is commented out. I don;t have a SNES mouse to test it with even if it did run on my real Uzebox but why is the mouse code commented out?

I presume this code predates mode 80? Could it have been done better in mode 80 instead?
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UzeboxUI - a GUI demo for Uzebox

Post by Artcfox »

danboid wrote: Sun Feb 19, 2023 8:19 am * A minimal file manager, if only for deleting files off SD but copy and move would be cool too.
Just a FYI, deleting files off the SD card can cause fragmentation, which would break a bunch of games that require their level data to be contiguous (for speed purposes) if any of those games were copied to the SD card after the fragmentation took place.

Edit: The best way to restore full speed of a fragmented SD card is to format it with this proprietary tool: https://www.sdcard.org/downloads/formatter/ which only has a Windows and Mac version, because it does some behind the scenes magic to make sure the filesystem parameters match up with the underlying hardware implementation for that specific card. I guess on Linux, one could create a compressed image of the card before copying any files to it, and then use dd to restore the formatted image back.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: UzeboxUI - a GUI demo for Uzebox

Post by ry755 »

danboid wrote: Sun Feb 19, 2023 8:19 am I see the mouse support is commented out. I don;t have a SNES mouse to test it with even if it did run on my real Uzebox but why is the mouse code commented out?
The only SNES mouse I have is a modern Hyperkin one, which as I said in another thread it doesn't seem to work with the Uzebox (or maybe mine is just defective, not sure since I don't have a SNES to test it with). And since iirc cuzebox doesn't emulate a SNES mouse, I had no way of testing it so I just left it commented out.
danboid wrote: Sun Feb 19, 2023 8:19 am I presume this code predates mode 80? Could it have been done better in mode 80 instead?
Honestly the only reason why I used mode 3 was because I was most familiar with it. Does mode 80 have sprites? I only need 1 sprite for the mouse cursor. If it has sprites then yeah mode 80 would probably be better.
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: UzeboxUI - a GUI demo for Uzebox

Post by D3thAdd3r »

Couldn't resist it :geek: Pretty fun set of restrictions, I recommend people take a try at making a simple game(hangman?, battleship?).
uzeui-ttt.jpg
uzeui-ttt.jpg (50.27 KiB) Viewed 1079 times
Source and binary is included.
*ttt.bin needs to be in the directory with uzeboxui ROM
*add "[TicTacToe](TTT BIN);" to your uzeboxui.txt before booting so it shows up in apps(example uzeboxui.txt included)
ui-tic-tac-toe.zip
(2.45 KiB) Downloaded 32 times
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: UzeboxUI - a GUI demo for Uzebox

Post by ry755 »

Awesome!! :D
Post Reply