Extensible Loader

How awful :disappointed_relieved:
It could certainly do with a RAM disk in there somewhere :wink:

I like the possibility to see the screenshot and other info before loading.

As this grid is what the people see first, and the showcase for Pokitto, I would like to have 16-color icons. Maybe also bigger icons, four in a row.

Edit: With the 48x48 size of icons there is just space for 4x3 grid with texts on the 220x176 screen, scrolling horizontally.
image

2 Likes

My favourites (in no particular order):

mockup mockup
loader_mockup_03 image

i like the blue iconic version as its something diferent (also might be loading the least amount of data as you have to press into the an info box)
though some future proofing like 16 character titles or something would be nice
and maybe the abilaty to set the 1 bit sprite color

a question i have though could we sort the listing, so our favorite games be on top or on the first page?

I know we talk about the look a lot, but thereā€™s a feature I would really like, and itā€™s deleting and renaming files from the loader

pffs cant delete, create or renaim files as i understand

True. But not all functionality should be crammed into the loader. We should have a file manager app exactly for this purpose. I believe @Vampirics is correct that this is something we need. But it should be an app, not in the core of the loader

yea if sdfilesystem is woking fine now it be an easy program to make, could probebly give it a rough text editor feature, and maybe the bmp viewer stuff aswell

(starts considering just making it myself XD)

2 Likes

PFFS canā€™t delete a file, but we could mark it as hidden. If a file was ā€œdeletedā€ by mistake, this would allow you to undelete without having to implement a recycle bin. On a PC itā€™s easy to see which files are hidden and actually delete them.

For favorites, the read-only or system attributes could be used. When you try to delete these files on a PC it would warn you, preventing you from deleting your favorite games unless you really wanted to.

Edit: Another option would be to use the fileā€™s CRC and make a list of favorites in the EEPROM. If you rename a file or delete it then add it again, it would still know that itā€™s a favorite.

16 colors @ 220x176 means we canā€™t have a framebuffer and rendering the screen requires reading about 14kb of image data scattered around the SD. It can be done, but it might feel slow. :thinking:

Slowness is the last thing we want in the loader. We can also store image and other data in SD in a cache file, as typically the content of SD do not change often, but it is often read.

2 Likes

Today I got the loader to read /sd/loader/boot.pop into RAM then call it.

boot.pop doesnā€™t do much yet, other than refresh the screen continuously in mode 1. Mode 1 takes up too much RAM though, so Iā€™ll probably switch to mode 2 (110x88, 16 colors) or draw directly on the LCD.

The filesystem API has been exposed so itā€™s easy to call from tiny programs in RAM or from games in flash.

Still needs more testing and bug fixing, but ideas are moving out of the ā€œworks theoreticallyā€ category and into ā€œworks.ā€

7 Likes

So your new loader can be looked at as if it is a small OS of sorts?

When you activate the loader, then it behaves more like a bootloader: all it does is load a ā€œkernelā€ (boot.pop) into RAM. Beyond that, Iā€™m not yet sure how OS-like Iā€™ll be able to make it due to the severe RAM constraints.

On the other hand, from a gameā€™s point of view, this loader is just like a ROM API and it can be safely ignored at zero cost. So much so that one of the goals is to maintain compatibility with existing bins. In this situation, itā€™s not like an OS because it isnā€™t running in the background, games are still programmed ā€œbare metalā€.

I see the filesystem API as a bit of a stretch-goal. The priority is to make a modular loader that can do things that a ā€œmonolithicā€ loader canā€™t do in flash.
Games that want to use the loaderā€™s API would do it like this:

    FSAPI &fs = *(FSAPI *) (0x40000 - sizeof(FSAPI));
    fs.init("sd");

    FILE *fp = fs.fopen("/sd/path/to/file.txt", "r");
    if( fp ){
        char buffer[256];
        fs.fread( buffer, 1, 256, fp );
        fs.fclose(fp);
    }
2 Likes

I finally got the details worked out. The FSAPI and ā€œbootloaderā€ is running in Flash, the heap is in SRAM1, data/bss/stack in SRAM2.

That means all of SRAM0 is free! :smiley:

That also means the FSAPI will get along with games since they generally use only SRAM0.

Now to plan/write the ā€œkernel.ā€

5 Likes

That is great!

1 Like

Another progress update:

  • Made a nodejs script that reads a json file with tags and one or more bins and creates a ready-to-run POP file.
  • Basic POP parser, successfully loaded a plugin from the kernel into RAM and called it.
  • Drawing to the screen in Mode 2 (110x88, 16 colors).

Iā€™m thinking of organizing things like this:

  • The ā€œkernelā€ (/loader/boot.pop, 0x10000100 to 0x10002000) can occupy up to ~8kb in RAM. Thatā€™s code and data, including the framebuffer and palette.

  • A ā€œwindow managerā€ (/loader/ui.pop, 0x10002000 to 0x10004000) occupies another 8kb and uses the kernel-provided API for drawing to the framebuffer.

  • Helper/parser pops (/loader/parser/*.pop, 0x10004000 to 0x10007800) can take up to ~14kb for reading POP/GB/MPY/TXT/etc files and provide an API for reading metadata/images to be rendered by ui.pop. These are loaded/unloaded on-demand.

4 Likes

When you get to the point of jumping to the loader, take a look at how it is done in the current loader. The order in which peripherals are shut down and disabling interrupts is pretty critical

1 Like

I have almost no idea what any of this means, but I am very excited that it is happening :slight_smile:

2 Likes

Felipe is just going to bypass the arterior vernacular valve to the solar plexus in order to alleviate the limbic swelling of the poster nasal humbugudrum.

So no need for concern! Two pills and a salt-free diet for 3 days. No Nintendo.

4 Likes

Jumping to the loader? That bit is done by the PokittoLib and works with my loader without any changes. Or do you mean the initialization after the jump?