Game size problem with bootloader.

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Game size problem with bootloader.

Post by Janka » Sun Mar 10, 2019 7:06 pm

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.)

CunningFellow
Posts: 1174
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Game size problem with bootloader.

Post by CunningFellow » Sun Mar 10, 2019 10:26 pm

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?

User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: Game size problem with bootloader.

Post by Janka » Sun Mar 10, 2019 10:58 pm

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

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Game size problem with bootloader.

Post by Jubatian » Mon Mar 11, 2019 7:49 pm

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.

User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: Game size problem with bootloader.

Post by Janka » 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?

User avatar
L4rry
Posts: 239
Joined: Sun Dec 28, 2014 7:19 am
Location: Cape Town, South Africa

Re: Game size problem with bootloader.

Post by L4rry » Tue Mar 12, 2019 9:59 am

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

User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: Game size problem with bootloader.

Post by Janka » Sat Mar 16, 2019 1:42 am

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.

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

Re: Game size problem with bootloader.

Post by Artcfox » Sun Mar 17, 2019 12:38 am

I remember Uze saying that MMC was never officially supported, since all Uzebox kits shipped with SDSC cards.

User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: Game size problem with bootloader.

Post by Janka » Sun Mar 17, 2019 2:57 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests