cuzebox runs great on my TV box

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: cuzebox runs great on my TV box

Post by Artcfox »

Yes, but please don't link to any test version. It doesn't quit properly (you have to force quit it if you switch away from it), and you need a separate file manager in order to add new games to the hardcoded game path. The touch controls are only for the buttons, and you have to hold the phone flat to use it, because the D-pad is controlled using the accelerometer. :lol: If someone really wants to find them, they can look in the thread so they have the full context.

It really was just a super-rough proof of concept port that I was hoping to pass off to someone who does Android development to polish up, similarly to what happened when I first ported Uzem to asm.js using the Emscripten compiler.

Interesting, I figure it won't be long before Apple removes the ability to run x86 binaries, the same way they removed Rosetta after a while with their last processor switch.

If you use the latest Emscripten to compile a built-in game, it should run fast enough to play on a phone. You'll just need to connect a keyboard USB-OTG, or Bluetooth I presume) in order to play it.

Edit: See the attachment for an example. Note that you can't just double-click the .html file and expect it to work, you need to serve it from a web server. You can run this command in the directory to serve it:

Code: Select all

python3 -m http.server 8080
and then open http://127.0.0.1:8080/cuzebox.html (or use your real IP address to access it from your phone).
Attachments
emscripten_cuzebox_unicorn.zip
You can't double-click the .html file, you need to serve it from a web server. You can run this command in the directory to serve it: python3 -m http.server 8080 and then open http://127.0.0.1:8080/cuzebox.html (or use your real IP address to access it from your phone)
(73.36 KiB) Downloaded 164 times
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: cuzebox runs great on my TV box

Post by danboid »

I've never tried Emscripten and I'm sure it works fine for running cuzebox but personally I have an aversion to using browsers whereever I can. I know it gets silly when you have 16 GB RAM but its something I still do and its one of the man reasons why I use Kate instead of VS Code. Hence, if I was a Mac user I'd be working out how to build a macOS version of CUzebox.

Who knows, it could magically just build by running make if you have Xcode and SDL (installed from MacPorts or whatever) installed. Do no Mac users read these forums?

Disclaimer: OK so I did actually buy the first iMac, I still own an eMac for some reason and I have had Hackintosh installs in the past but Linux is so much faster and more configurable than macOS (or OSX as it was then) that I cut it out of my life several years ago and I'm totally out of touch with macOS now. I can't be bothered to try build cuzebox under macOS myself and I don't want to have to support macOS, it doesn't support me. Plus I have no access to an M1(+) Mac.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: cuzebox runs great on my TV box

Post by Artcfox »

Emscripten is a compiler, whose output is a .wasm file. Apparently you don't actually need a web browser to run it. I haven't tried it out yet, but it looks like Wasmer might be able to take that .wasm file and give us native executables for every platform (that don't require a runtime at all): https://wasmer.io/posts/wasm-as-univers ... xecutables

They say there is a performance hit, but if loading it up in a web browser can run it at full speed on my phone, you probably wouldn't notice it on an actual computer, plus if Wasmer actually works, it would be a real native executable.

Just as a test, download and extract that .zip I created and try it out in your browser. You can hit F3, and the OpenGL context inside the window will automatically resize itself. If it's between not supporting OS X at all, versus providing multiple options for running the WASM version, I think it would be wise to give people those options.
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: cuzebox runs great on my TV box

Post by danboid »

DA has bought a X96 Max+ TV box like me. He mainly wants to use it for emulators so I recommended he install CoreELEC.

I gave him these instructions to get started with running CE on an X96 Max+ TV box in an unrelated thread so I thought I'd reproduce them here for anyone else who wants a nice cheap home media / emulators / low power server as its a bit more on topic here.

Great to hear your TV box has finally arrived! Yes, it is super compact. I can easily fit the TV box, its PSU and a BT keyboard/trackpad in a single coat pocket and still have room for other stuff and its not an overly large or unusual size inner coat pocket.

The very first thing you shoud do is boot the stock Android and check the model under Settings -> System -> About phone. After that you may never want to bother booting the stock Android ever again, you most likely / I recommend you try booting the latest CoreELEC nightly off a microSD card.

First you want to download the latest CE nightly amlogic-ng 21 generic image from here:

https://relkai.coreelec.org/?dir=Amlogic-ng/ce-21

eg

https://relkai.coreelec.org/Amlogic-ng/ ... ric.img.gz

gunzip it and transfer to a sd with your fave imaging program, I use the gnome disk tools image writer usually.

After writing the image you need to copy the correct .dtb file for your TV box into the root dir of the COREELEC partition of the SD card. You need to copy device_trees/sm1_s905x3_4g_1gbit.dtb to dtb.img in the root dir of that partition.

When you want to boot off the microSD for the first time on an Amlogic TV box you'll need to insert the SD card then insert a paper clip or something into the AV socket and hold it down as you insert the power and continue to hold it down for a few secs to enable multi-boot mode so you can boot off SD or USB. You should only need to do this once.

You can install CE onto the internal eMMC storage if you want, after booting it from SD:

https://discourse.coreelec.org/t/how-to ... -tool/7630
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: cuzebox runs great on my TV box

Post by D3thAdd3r »

Waiting on a microSD and I'll try it out. Got a package that comes with a little wireless USB dongle keyboard/touchpad, and sort of a gamepad, and so far it feels pretty nice. Hoping to play CUzeBox with it, but probably needs some input mapping functionality added.
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: cuzebox runs great on my TV box

Post by danboid »

I presume that all the Kodi / CE emulator plugins are lifted from retroarch. There is already a port of Uzem to libretro but the same hasn't been done for cuzebox yet. Might this be something you'd look into after you've got Uzenet working?

Of course you can alternately just type `make` to build cuzebox under Armbian (after installing libsdl2-dev) but I prefer CoreELEC for running emulators personally so a Kodi/CE cuzebox plugin would be nice to have.
User avatar
Jubatian
Posts: 1561
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: cuzebox runs great on my TV box

Post by Jubatian »

A bit old thread, just maybe useful still.

The performance of the emulator is dominated by two things in my experience. One is the AVR ALU emulation (on this my guess is that around a 700MHz P3 should be the minimum to do it), the other is getting the display data onto the screen. Surprising as it is, it may take half of the emulator's CPU usage! This also means that on slow targets, the F2 toggle can help quite a bit (lowers the resolution).
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: cuzebox runs great on my TV box

Post by danboid »

Jubatian wrote: Thu Mar 14, 2024 9:13 pm This also means that on slow targets, the F2 toggle can help quite a bit (lowers the resolution).
I shall try F2 next time I test cuzebox on my VisionFive2. I've not got it to build yet. It'd be funny, but also unlikely, if cuzebox runs faster under rv64 Haiku than rv64 Linux.
Post Reply