FManga
September 11, 2018, 4:26pm
41
@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
jonne
September 11, 2018, 4:27pm
42
You mean a checksum check before loading ?
FManga
September 11, 2018, 4:28pm
43
Right after it reads the first block, yes. Might spare some “white screen of death” headaches.
jonne
September 11, 2018, 4:29pm
44
Next version then. I’m already pushing everything out.
1 Like
jonne
September 11, 2018, 4:33pm
45
See gamedisk thread to get the latest loader.
Pharap
September 11, 2018, 5:35pm
46
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.
Hanski
September 11, 2018, 6:37pm
47
Not quite Just that the loader recognises a py file and is able to start python interpreter if it is found in SD also.
jonne
September 11, 2018, 6:44pm
48
I take it you have all noticed that the source code is in the repo now?
1 Like
FManga
September 11, 2018, 7:16pm
49
Sure… we’re just busy plotting what to do to it now.
Any guidelines? Or everybody just fork it and see what happens?
spinal
September 11, 2018, 7:57pm
50
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
spinal
September 11, 2018, 8:12pm
51
Something completely different?
2 Likes
jonne
September 11, 2018, 8:58pm
52
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
FManga
September 12, 2018, 7:06pm
53
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
jonne
September 12, 2018, 7:39pm
54
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
Pharap
September 12, 2018, 10:25pm
55
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
spinal
September 13, 2018, 6:25am
56
I was quite a fan myself
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
Pharap
September 13, 2018, 6:31am
57
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.)
FManga
September 13, 2018, 10:53am
59
We can have an image of the title text. This would allow titles with different fonts, which could be interesting.