Some questions about uzebox

What is a Uzebox? How can I get one? Check here!
Post Reply
john101
Posts: 18
Joined: Sat Mar 16, 2013 8:04 am

Some questions about uzebox

Post by john101 »

here is some steps from another post to uzebox newbie:
As for getting started right after building and have the Uzebox work just like the kits I sell:
1)connect AVRISP to the Uzebox and power up
2)open AvrStudio
3)assuming you have a "virgin" atmega644 chip, you'll need to program the fuses: follow these instructions:http://uzebox.org/forums/viewtopic.php? ... 20&start=0
4)download the bootloader hex from same forum topic as 3)
5)program bootloader in AvrStudio, menu should appear on Console
6)put .Uze files on sd card
7)reset console... Voila! :)
but I have question about
4)download the bootloader hex from same forum topic as 3)
It is said there is a internal bootloader in atmega644 chip(ISP works depend on), here the bootloader is the uzebox special bootloader,not the original one?
5)program bootloader in AvrStudio, menu should appear on Console
here the bootloader is uzebox special bootloader, in fact it is a program that search in sd card to find if there are any games, if so
print the game name on screen, then waiting for user input?
6)put .Uze files on sd card
what is .UZE files? Is it some special format include lots of game?
From the tutorial , a game is compiled into hex files ( c codes and other image \ sound files after converting), (a)if .UZE composed of lots of such files?(b) or .UZE files include game logic and related material, the game kernal load it and run it?
as I know (a) means the kernal and game is in one project, (b) the kernal acts like some "interpreter" as basic?
if (a), what is the relation between the bootloader and game? does the bootloader loads another game program after itself?
User avatar
Janka
Posts: 214
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: Some questions about uzebox

Post by Janka »

john101 wrote:It is said there is a internal bootloader in atmega644 chip(ISP works depend on), here the bootloader is the uzebox special bootloader,not the original one?
The ISP doesn't need a bootloader. It even works on chips without bootloader support (like the ATtiny series). The ISP is some special unit inside the chip which interfaces the chips's SPI interface to the parallel programming logic inside the chip. Think of it as a parallel<->serial shift register..

The ATmega644 comes with erased flash out of the factory. It has "bootloader support", meaning you can set the reset vector either to 0x0000 or another location (0xf000 is common) by programming a fuse. This, in addition to the "self programming" feature allows to have an unaltered application binary at 0x0000, which may be used either with or without having the additional bootloader binary at 0xf000 in the chip. That "bootloader" binary at 0xf000 is meant to be completely custom made. It may even be bigger than 4k, only the entry point has to be at 0xf000.
here the bootloader is uzebox special bootloader, in fact it is a program that search in sd card to find if there are any games, if so print the game name on screen, then waiting for user input?
Any booloader is application specific and "special". It may take the software to flash into the other parts of the flash ROM from an RS232 interface, USB or SD card, like the Uzebox does, or something completely different.
what is .UZE files? Is it some special format include lots of game?
An uze file is a single game binary along with name and author information. The lines displayed in the bootloader screen menu.
From the tutorial , a game is compiled into hex files ( c codes and other image \ sound files after converting), (a)if .UZE composed of lots of such files?(b) or .UZE files include game logic and related material, the game kernal load it and run it?
A hex file is a hex dump of a binary file. Hex files describe which addresses should contain which data bytes. Look into it yourself.

Each game hex file, binary file, uze file contains *one game* including the kernel. Each game compiles and links it's own special kernel, mostly depending on the video mode it uses. It doesn't make much sense to have an universal kernel binary as the ROM size is very limited.
as I know (a) means the kernal and game is in one project, (b) the kernal acts like some "interpreter" as basic?
The kernel is a collection of library routines which do the most common tasks in the uzebox, like updating the screen and playing music, in an efficient way. You don't have to use these routines. In fact, you don't even need the kernel. You can implement all routines in your game project and in fact, many uzeboxers do and offer their changes as new modes to the original kernel.
if (a), what is the relation between the bootloader and game? does the bootloader loads another game program after itself?
It programs the selected game binary into the lower part of the flash ROM, then starts the game's built-in kernel by jumping to 0x0000. After that, you can remove the SD card and the power and the game is still there. The bootloader, too, it's still accessible by pressing the START button on reset.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Some questions about uzebox

Post by uze6666 »

Hi there, welcome to the Uzebox community!

A couple precisions to Janka's excellent answers:
what is .UZE files? Is it some special format include lots of game?

An uze file is a single game binary along with name and author information. The lines displayed in the bootloader screen menu.
The HEX file is really a text file in a special format that must be parsed by a tool before being programmed on a chip. It can not contain any additional metadata. This was a problem with the GameLoader (the SD card bootloader) because, beside being "costly" to parse in the limited 4k of the bootloader, we wanted to display the name of game and author. So the .UZE file format was created, which is the binary representation of the HEX file plus a 512 bytes header. In this header we can have metadata like the game name's etc.
as I know (a) means the kernal and game is in one project, (b) the kernal acts like some "interpreter" as basic?

The kernel is a collection of library routines which do the most common tasks in the uzebox, like updating the screen and playing music, in an efficient way. You don't have to use these routines. In fact, you don't even need the kernel. You can implement all routines in your game project and in fact, many uzeboxers do and offer their changes as new modes to the original kernel.
Well, you do need the kernel, but you do not have to care about it since it will automatically be compiled, added to your games and then do the common tasks in the background.
john101
Posts: 18
Joined: Sat Mar 16, 2013 8:04 am

Re: Some questions about uzebox

Post by john101 »

Thank you very much for quick and clear reply.
After that, you can remove the SD card and the power and the game is still there. The bootloader, too, it's still accessible by pressing the START button on reset.
So the bootloader works like this

Code: Select all

 detect if a SD card exists, 
    if so the bootloader load all game name ,waiting for user input,
    otherwise detect if in ROM address 0000, a burned game exists, 
    if so , jump to address 0000, 
    if no sd card and burned game, 
    warning and die?

Uzebox is an interesting project, now I am adding something to it.
(1) adding wireless support, I have find an pdf file
"BUILDING A DIY VIDEO TRANSMITTER", This micro video transmitter was designed by the DIY radio and micro TV artist Tetsuo Kogawa. His website (http://anarchy.translocal.jp/) is full of great info on DIY radio, and all credit for this circuit goes to him
after reading this tutorial,it is very easy to add wireless support to Uzebox.
(2)using some acceleration sensor tired on user's arm, and a simple micro controller( analysis the signal from the sensor using some algorithms to detect user gestures , then send it to another micro controller through wireless, the 2nd micro controller imitate a SNES interface and send the result to ATMEGA644.
(1) is very simple, I have done it in one day, (2) is a little bit hard.
Do you think it is useful ?
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Some questions about uzebox

Post by D3thAdd3r »

(1) I don't know what kind of wireless support you want to add, peripherals only? I don't see that transmitter as useful for internet play since it would still have to be converted to ethernet or such still.

(2) That could be useful but does sound like a lot of work to me. Getting a mouse and keyboard on Uzebox is probably easier and more useful.
Post Reply