Page 1 of 1

Game size problem with bootloader.

Posted: Sun Mar 10, 2019 7:06 pm
by Janka
Hi, long time no see.

Someone pushed me a bit and I nearly completed my Würgertime game (only sound effects are missing) in the last months. It runs fine in Uzem but no luck on the real machine. Right after flashing it from the SD card into the µC, there's more or less video and audio garbage instead of the gameplay.

Through some experimenting, I found out the problem is the size of the game. A running test version packrom says is 53040 bytes in size (53552 bytes uze file size). But one with just 53056 bytes (53568 uze file size) fails. What puzzles me there are other games on the SD card, for example Donkey Kong with an uze file size of 61790 bytes, which run just fine.

What's the trick?

(After flashing the .hex via ISP, the game runs fine of course, but I'd prefer to have a bigger audience than those people who own an ISP programmer.)

Re: Game size problem with bootloader.

Posted: Sun Mar 10, 2019 10:26 pm
by CunningFellow
2^16 - 2^12 = 61440 is the hard limit on game size I think.

Do you have any "Sections" that maybe colliding with the bootloader?

Re: Game size problem with bootloader.

Posted: Sun Mar 10, 2019 10:58 pm
by Janka
So, as I thought the limit is 60K.

This is from the current version:

Code: Select all

packrom Wuergertime.hex Wuergertime.uze ../gameinfo.properties
        Packing file: Wuergertime.hex
        Game Name: Wuergertime
        Author: Jan Kandziora
        Year: 2012
        CRC32: 0xc263e2f7
        Program size: 55928 

Wuergertime.elf  :
section                      size      addr
.data                         154   8388864
.text                       55774         0
.bss                         3780   8389018
.comment                       17         0
.note.gnu.avr.deviceinfo       60         0
.debug_aranges               2736         0
.debug_info                 47308         0
.debug_abbrev               10774         0
.debug_line                 29509         0
.debug_frame                 7796         0
.debug_str                   9726         0
.debug_loc                  43228         0
.debug_ranges                2648         0
Total                      213510

Re: Game size problem with bootloader.

Posted: Mon Mar 11, 2019 7:49 pm
by Jubatian
Hi Janka,

Yes, the hard limit is 61440 bytes (or 61952 for .uze files), I don't know why you are experiencing that problem uploading the game. Which version of the bootloader do you have by the way? There might be some bug lurking somewhere in there.

Re: Game size problem with bootloader.

Posted: Tue Mar 12, 2019 12:04 am
by Janka
Yes, you may be right. I've tried more games and found Zooming Secretary has the same problem on this Uzebox.
It's Uzebox game loader 0.4.2.

Where do I get a working boot loader and how do I flash it with avrdude on Linux?

Re: Game size problem with bootloader.

Posted: Tue Mar 12, 2019 9:59 am
by L4rry
Janka wrote: Tue Mar 12, 2019 12:04 am Yes, you may be right. I've tried more games and found Zooming Secretary has the same problem on this Uzebox.
It's Uzebox game loader 0.4.2.

Where do I get a working boot loader and how do I flash it with avrdude on Linux?
That boot loader is outdated yes. The latest bootloader (v5) is linked at the bottom of the first post of this topic: http://uzebox.org/forums/viewtopic.php? ... 405#p27659

Executing the following command should load the boot loader for you. Just replace the '-c' flag value with whatever programmer you are using:

Code: Select all

avrdude -c usbasp -p m644 -P usb -v -U flash:w:Bootloader5.hex

Re: Game size problem with bootloader.

Posted: Sat Mar 16, 2019 1:42 am
by Janka
Ok, it works. Thanks all!

What is a bit sad is MMC compatibility is lost. It just says "INSERT SD CARD".

I say this because I have a pile of old 16MB and 32MB MMC cards which had no other use than Uzebox and SD2IEC.

Re: Game size problem with bootloader.

Posted: Sun Mar 17, 2019 12:38 am
by Artcfox
I remember Uze saying that MMC was never officially supported, since all Uzebox kits shipped with SDSC cards.

Re: Game size problem with bootloader.

Posted: Sun Mar 17, 2019 2:57 am
by Janka
It's not a problem, I will figure it out how to get MMC running myself, or I ask Snowcat for help. SD2IEC does both. Though, no code size restraints over there.