[solved]Loader stops working properly with more than ~80 .bin files

@Pharap: I was thinking of a simple (tagged?) binary header, not text. Something more strict so as to not need much of a parser at all. We’d use a simple program to pack the bin/image together and set a name.

@jonne: This might be useful:

	if (counter==0){
	    uint32_t acc=0;
	    union {
		uint8_t b[4];
		uint32_t w;
	    } u;
	    u.w = 0;
	    for (int i=0; i < (8<<2); ){
		acc += u.w;
		u.b[0] = data[i++];
		u.b[1] = data[i++];
		u.b[2] = data[i++];
		u.b[3] = data[i++];
	    }
	    if( (!acc && u.w == 0) || (-acc != u.w) ){
		errorPopup("CHECKSUM ERROR");
		return 1;
	    }
	}
1 Like

You mean a checksum check before loading ?

Right after it reads the first block, yes. Might spare some “white screen of death” headaches.

Next version then. I’m already pushing everything out.

1 Like

See gamedisk thread to get the latest loader.

I can live with that, as long as it’s relatively simple.


Just throwing some ideas out there…

What about something like this:

// Basic header
4 FormatVersion
4 ExpectedSize
// Contents/Index
4 NumberOfSections
// Section index entry
{
	4 SectionID
	4 SectionSize
	4 AbsoluteFileOffset
}
// Section
{
	// Section header
	4 SectionID
	4 SectionSize
	// Section data
	* SectionData
}

And then we designate the section ids to special kinds of sections.
E.g.

  • “CODE” (0x434F4445) for code section
  • “LICN” (0x4C49434E) for licence section
  • “TITL” (0x5449544C) for the game name
  • “DESC” (0x44455343) for the game’s description

By having the ‘contents page’, it makes it easier to seek to specific bits of information.
You can load the whole contents page into memory and then just seek as and when you want a specific section.

And code would look something like:

enum class SectionID : std::uint32_t =
{
	Unknown = 0x00000000,
	Code = 0x434F4445,
	// or Code = makeSectionId('C', 'O', 'D', 'E')
	// or even Code = "CODE"_section
	Licence = 0x4C49434E,
	Title = 0x5449544C,
	Description = 0x44455343,
};

struct IndexEntry
{
	SectionID section;
	std::uint32_t size;
	std::uint32_t offset;
};

struct SectionHeader
{
	SectionID section;
	std::uint32_t size;
};

class Section
{
private:
	SectionHeader header;
	char * buffer;
	
public:
	
	// etc
};

Or, how about Minecraft’s NBT tags?
Basically they’re like a binary equivalent of JSON.

Or we can mix both.
Use the earlier thing for the main structure and NBT tags for encoding information in specific sections.

Not quite :wink: Just that the loader recognises a py file and is able to start python interpreter if it is found in SD also.

I take it you have all noticed that the source code is in the repo now?

1 Like

Sure… we’re just busy plotting what to do to it now. :stuck_out_tongue:
Any guidelines? Or everybody just fork it and see what happens?

Cool, I won’t be updating anything until after my qbert game is done. I learned that lesson the the GBA/DS homebrew days.

1 Like

Something completely different?

Dsision

2 Likes

In the immortal words of Yogi Berra: “when you come to a fork in the road, you take it”

Yea. So just try to add stuff and see if you can make it work

2 Likes

I like where you’re going. Have to take the Pokitto’s screen and ram limitations into consideration, though.

If we replace all text with icons, we can remove the fonts and print code from the loader.
The settings tab could then be moved to an external app? Just thinking out loud.

1 Like

Completely doable. We can use a config/workbench/desktop utility program that can switch the loader.

So the idea is: boot to loader, load the utility program, utility program changes the loader to your “coverflow” version etc.

2 Likes

The DSi menu has always been one of my favourites.
Fancy enough to be interesting but simple enough to not gobble too many resources:

I like the 3DS menu too, but I think it’s too much of a resource gobbler to work for the Pokitto.

1 Like

I was quite a fan myself :stuck_out_tongue:

I have never liked having icons without text though, but I bet the text functions can be minimised a little, I don’t know how the fonts are stored, but as they are 8*8 or so, then 1bpp, using only a minimal character set could save some space.

2 Likes

You’re secretly just posting these images to show off that you like to make homebrew, aren’t you? :P

(I’m half and half on the text issue.)

Secretly? :innocent:

1 Like

We can have an image of the title text. This would allow titles with different fonts, which could be interesting.