Main uzebox repo broken and unmaintained

Discuss general Uzebox topics here: features, wish list. nice to have, etc.
User avatar
Artcfox
Posts: 1083
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Main uzebox repo broken and unmaintained

Post by Artcfox » Wed Sep 21, 2022 4:21 am

I fixed the compile error in uzem when using GCC 12, and pushed it to the main repo.

I also verified that uzem compiles and runs properly when built with GCC 12, but it doesn't look like avr-gdb is available on Manjaro ARM, so I tested the remote debugging support using the version of avr-gcc on Debian 11.

If you want to try out remote debugging yourself, here is what I did to get the repo and dependencies installed (note you need to install gdb-avr):

Code: Select all

sudo apt install gcc-avr binutils-avr avr-libc avrdude g++ git libsdl2-dev gdb-avr

git clone https://github.com/Uzebox/uzebox.git
cd uzebox
make
mkdir MY_GAMES
cd MY_GAMES
git clone https://github.com/artcfox/circuit
cd circuit/default
./scratch
That should get you a fully built Uzebox repo, along with a fully built Circuit Puzzle game.

Then in a new Terminal run:

Code: Select all

cd uzebox
./bin/uzem --gdbserver -d MY_GAMES/circuit/default/circuit.uze
This will start the game in the emulator, but it will be paused with the GUI frozen waiting for you to connect to it with avr-gdb (You did `sudo apt install gdb-avr` above, right?)

To connect to it and start debugging, in another new terminal run:

Code: Select all

cd uzebox/MY_GAMES/circuit
avr-gdb default/circuit.elf
Once avr-gdb is running, you'll need to tell it to connect to the remote host (which is actually the localhost):

Code: Select all

target remote localhost:1284
And then you can set breakpoints, list the code, show a backtrace, like normal. You don't have to use the command line gdb, you can use emacs, or whatever IDE you want, as long as you configure it to use the avr-gdb client pointing to your .elf file, and configure the remote target and port properly.

Code: Select all

GNU gdb (GDB) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=avr".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from default/circuit.elf...
(gdb) target remote localhost:1284
Remote debugging using localhost:1284
0x00000000 in __vectors ()
(gdb) l
4914      }
4915
4916      ClearVram();
4917      SetTileTable(tileset);
4918
4919      SetUserRamTilesCount(GAME_USER_RAM_TILES_COUNT);
4920      StopSong();
4921      InitMusicPlayer(patches);
4922      StartSong(midisong);
4923      StopSong();
(gdb) b InitMusicPlayer
Breakpoint 1 at 0xa45a: file ../../../kernel/uzeboxSoundEngine.c, line 295.
(gdb) c
Continuing.

Breakpoint 1, InitMusicPlayer (patchPointersParam=0x803432) at ../../../kernel/uzeboxSoundEngine.c:295
295             patchPointers=patchPointersParam;
(gdb) l
290
291     const Patch *patchPointers;
292
293     void InitMusicPlayer(const Patch *patchPointersParam){
294
295             patchPointers=patchPointersParam;
296
297             masterVolume=DEFAULT_MASTER_VOL;
298
299     #if MIDI_IN == ENABLED
(gdb) bt

You are welcome to use cuzebox and/or uzem, but I don't see cuzebox being a total replacement for uzem, since uzem is still useful for the built in whisper port support (for printing stuff to the console, rather than displaying single numbers at a time as cuzebox does), and for its remote debugging capabilities.

User avatar
danboid
Posts: 238
Joined: Sun Jun 14, 2020 12:14 am

Re: Main uzebox repo broken and unmaintained

Post by danboid » Wed Sep 21, 2022 9:21 pm

Thanks for fixing Uzem and the UB repo build Artcfox!

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

Re: Main uzebox repo broken and unmaintained

Post by Artcfox » Tue Sep 27, 2022 4:22 am

No problem, I'm glad I could help. :)

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

Re: Main uzebox repo broken and unmaintained

Post by Artcfox » Sat Oct 01, 2022 4:15 am

Tonight I cleaned up all of the warnings for all of the tools in the Uzebox repo. There are still some warnings when compiling some of the included roms with avr-gcc, but I'm less concerned about those. This is something that should have probably been done a long time ago!

I tested with GCC 8.3.0 (x86_64) and GCC 12.1.0 (aarch64).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest