Uzebox SD Gameloader V0.4.5

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: Uzebox SD Gameloader V0.4.2!

Post by Kilo »

oh ok.. nice to know :)

So, the function has to be included by the games, right? Not in the bootloader!?

So, what could be the problem if a soft reset doesn't work fine, but a hard reset initialized the card correctly?
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Harty123
Posts: 467
Joined: Wed Jan 12, 2011 9:30 pm
Location: PM, Germany
Contact:

Re: Uzebox SD Gameloader V0.4.2!

Post by Harty123 »

I've changed the Gameloader for Kilo in this way, that I decreased the SPI clock rate and added some waitstates (NOPs) in the SPI read and write procedures in the mmc.s file. This solved the problems of Kilo with the Gameloader..

I've tested it also with some wrong SD cards - some of them work now fine but some other are still wrong as before.

Check the Hex file and source files in the attachment.

Cheers
-Harty
Attachments
bootloader.zip
changed source files
(8.17 KiB) Downloaded 1150 times
Bootloader.hex
Gameloader Beta 0.4.3
(11.15 KiB) Downloaded 1173 times
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: Uzebox SD Gameloader V0.4.2!

Post by DaveyPocket »

Just to throw an idea out, is there a way we can make a self flashing bootloader updater? Like have the bootloader load a normal Uzebox "game". Have this "game" (program) write the new bootloader program in the bootloader space, then reset?
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox SD Gameloader V0.4.2!

Post by uze6666 »

DaveyPocket wrote:Just to throw an idea out, is there a way we can make a self flashing bootloader updater? Like have the bootloader load a normal Uzebox "game". Have this "game" (program) write the new bootloader program in the bootloader space, then reset?
You can't execute SPM instruction anywhere, it must be in the bootloader reserved area. Now, since this area is technically 8K and we only use the upper 4K I'm wondering if placing the writing code in the lower 4K would work... Worth trying sometime.
I've changed the Gameloader for Kilo in this way, that I decreased the SPI clock rate and added some waitstates (NOPs) in the SPI read and write procedures in the mmc.s file. This solved the problems of Kilo with the Gameloader..
I've included those change in the latest gameloader update along the Asciipad controller support. Except one:

Code: Select all

    ldi r24,2
    out _SFR_IO_ADDR(SPSR),r24              ;set double speed
I see you changed r24 to 2, but this value is not supported by the SPSR register.

New version is 0.4.4, main post updated with the latest version.
User avatar
schepers_cp
Posts: 125
Joined: Tue Feb 04, 2014 9:48 pm
Location: netherlands
Contact:

Re: Uzebox SD Gameloader V0.4.4!

Post by schepers_cp »

maybe it sounds weird, but the game loader isn't very friendly to the eye.. in terms of text color and font
if i may do a suggestion to it:

make a small GUI for the game loader, where apps have a icon (based on the genre setting in gameinfo.properties)
for example:
genre 0 = simple game
genre 1 = advanced game
genre 2 = music program
genre 3 = application (like my terminal idea)
genre 4 = hex file
genre 5 = text file

and a small image of what i mean is:
000001.png
000001.png (6.26 KiB) Viewed 20493 times
(made in ms paint)

however, there are downsides too:
- more coding is needed to get it right
- filenames can't be long
- not as much apps/games can be displayed in one screen

tell me what you think about it~ ^_^
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Uzebox SD Gameloader V0.4.4!

Post by CunningFellow »

biggest problem - the bootloader needs to fit into 4096 bytes.

It is currently simple because of necessity.
User avatar
schepers_cp
Posts: 125
Joined: Tue Feb 04, 2014 9:48 pm
Location: netherlands
Contact:

Re: Uzebox SD Gameloader V0.4.4!

Post by schepers_cp »

oh, i didn't took that in mind when posting that idea..

but a text-change from the silver letters to white is possible to make it more readable, right?

and i also wonder what the 'genre' is for in the gameinfo.properties.. :o
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox SD Gameloader V0.4.4!

Post by uze6666 »

Yep, size is the major constraint. Just the graphics you have there eats more than 1/4 of the required 4k! As it stands, most of the 4k is for the code itself and half of it is already in assembler. But yeah, a nicer bootloader is possible and doable, but it's really hard work. At the moment I'd funnel energy on better tools and...more games!! :mrgreen:
Retrogadgets
Posts: 7
Joined: Fri Jun 14, 2013 8:26 pm

Re: Uzebox SD Gameloader V0.4.4! via Avrdude

Post by Retrogadgets »

Finally after several attempts, I have managed to program the bootloader on the atmega644 with Avrdude 5.10

Heres the commands I used from within Windows xp via dos using a UsbtinyIsp v3.0 programmer

avrdude -c usbtiny -p m644p -e -U flash:w:bootl.hex

avrdude -c usbtiny -p m644p -U lfuse:w:0xd7:m -U hfuse:w:0xd2:m -U efuse:w:0xff:m

to set the fuses.

One question re the games, Arkanoid seems to not run out of lives, do the games get updates ?
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox SD Gameloader V0.4.4! via Avrdude

Post by uze6666 »

Retrogadgets wrote:Finally after several attempts, I have managed to program the bootloader on the atmega644 with Avrdude 5.10

Heres the commands I used from within Windows xp via dos using a UsbtinyIsp v3.0 programmer

avrdude -c usbtiny -p m644p -e -U flash:w:bootl.hex

avrdude -c usbtiny -p m644p -U lfuse:w:0xd7:m -U hfuse:w:0xd2:m -U efuse:w:0xff:m

to set the fuses.

One question re the games, Arkanoid seems to not run out of lives, do the games get updates ?
Good news!

I didn't touch Arkanoid in a while. It doesn't have lives or scoring implemented as far as I recall. I may retouch it one day, but there's other priorities for the moment... :)
Post Reply