Emulator
Description
Uzebox has its own emulator called Uzem. You can use it for both kernel and games development.
Features:
- Multi-platform (Linux, Windows and MacOS)
- Implements the CPU atmega644 used by Uzebox
- Video and Sound using [www.libsdl.org/ SDL]
- Mouse (Uzebox supports SNES mouse)
- SDCard (for the Gameloader)
- GDB Server
Building
Prerequisites
- GCC compiler and SDL
- Windows: Download them from http://www.mingw.org/ and http://www.libsdl.org
- Linux:
- Ubuntu: sudo apt-get install build-essential libsdl1.2-dev
- OpenSuse: sudo zypper install -t pattern devel_C_C++ SDL-devel
- Fedora: yum install gcc gcc-c++ SDL-devel
- Mac OS X: Download them from Xcode and http://www.libsdl.org
Download
Get the last Uzebox version from http://code.google.com/p/uzebox/
Note: If you are going to download from the SVN server, the current development tree is the branch rev_beta5
Compiling
- Unpack it
- Open a command line terminal, go to the tools/emulator/ directory
- To see the available options, type make help
- Type make for the default options
This process will create two executables: uzem and uzemdbg. Important: The uzemdbg is only used for the Emulator development, it generates a lot of debugging messages and is very slow.
Using
Just run the emulator in the command line and pass the game (iHex file) as parameter: uzem path/to/your/game.hex
To see all the options available run: uzem --help
GDB
Uzem implements an internal GDB server (originally based on simulavr) making it an important tool to develop Uzebox games.
The following examples are using the game Arkanoid.
Execute uzem with the option -d and the game file:
$ ./uzem -d ../../demos/Arkanoid/default/Arkanoid.hex
NOTE THIS IS AN EXPERIMENTAL BRANCH OF THE UZEBOX EMULATOR
PLEASE SEE THE FORUM FOR MORE DETAILS: http://uzebox.org/forums
Loading Hex Image...
Waiting on port 1284 for gdb client to connect...
Uzem will start and wait for the GDB client to connect.
avr-gdb
Details | |
Site: | |
OS: | Windows, Linux and MacOS |
Type: | Command line |
This is the official gnu gdb client [1]. Build the game and from the same directory run avr-gdb passing the elf file as parameter:
1. $>cd demos/Arkanoid/default/ 2. $>make 3. $>avr-gdb Arkanoid.elf
You will be in a prompt like this: (gdb) Then connect to the Uzem
4. (gdb)target remote localhost:1284
You don't need to use the GDB command "run". You are already with the debugger session started, but still stopped at the first instruction as you can see:
Remote debugging using localhost:1284 0x00000000 in __vectors ()
Refer to GDB manual for more informations about the available commands.