GameSlots - save multi games at the same time

Thanks for you nice tutorial !
This will help all GameSolts users (keep away from my poor english edition LOL.)

1 Like

Thanks for your trying and like it, so happy that you feel it is useful !

  • This error never appeared on my Moewbit, only occured on one of my cusom Arcade console, and fixed with a capacitance. Let me know pls if it appear again, better with more info you know, that will helped on my debug.
  • This is possible on technical, but I can’t image the usecase. Can you descript it more detail about what situation it be used, and how?
  • SD card support is possible too. The reason I didn’t save games on SD is: not most Arcade device have a SD slot, though SD capacity is much larger. (And the Meowbit SD slot pins order is very odd.)
    On the contrary, almost all Arcade console have a W25Q chip(for microPython, I guess).

All in all, thanks for you bug report and feature sugestions, maybe I will implement them some day in the future. :smile:

3 Likes

I think the settings extension (Allows you to save data) is maybe interfering with the data of GameSlots. Also the first time I went to the slot menu every slot had a weird name (like @@@@@@ and ^|$_______) and some of the games I saved didn’t have a name (Maybe because the UF2 file had a ā€œ(1)ā€ in the name? Like ā€œarcade-pong (1).uf2ā€)

In the extensions menu in the MakeCode Arcade editor there’s an extension called Settings, that gives you blocks where you can read and write strings/numbers/arrays/JSON to the flash memory. So with that you can store things like highscore and how many lives you have, then the next time you turn on your device the highscore and lives are still the same as before. The extension also is mostly coded in C++ (I saw the files in the explorer) and that allows it to save to flash.

1 Like

I think this image contains all the pins, (The one above with SCL and SDA is most likely for the screen, but the one with 4 of those in the center is the SD Card) and maybe why the pins are so weirdly ordered is because for easier support for KittenBot’s Wireless SD Module?

1 Like

Thanks for more informations.

As far as I know the setting extension never write anything outside the Setting area, so need not be worry about interfer by it. As to wired name at first time, I guess maybe there is not a valid game/app in flash, maybe I should add more restrict conditions, eg: return ā€œā€ if not a valid game/app. Have you saw this except the first time?

Yes, the Setteings I metioned all the time, is of this extension, or data it writen in flash.

This image has some error, and it mislead me for a while at beginning playing with Meowbit. The P19&P20 never connected to golden edge, but to the SD slot instead. BTW, there’s no screen pins on this map, screen and the ex-flash chip are sharing SPI2. The SPI3 be connected to SD slot, but not in an order like this:
image
So it can never read/write a regular SD card. Only the custom SDWireless card works with it. In another words, Meowbit SD slot can only works as a SPI slot, not a valid SD slot.

3 Likes

That happened the first I went to the slot menu. I did add a ā€œmain.pyā€ file (for the MicroPython firmware) and deleted it, but the way Windows deleted it is that it actually edits the file to say that it doesn’t exist (it still exists, but is invisible. This gets overwritten when other files get created, watch Vsauce’s video if you will like to know more)

It’s an extension that lets you save data to the flash, Here’s the implementation of how it saves to flash.

But how did the MicroPython firmware do it? It’s also a UF2 file (It doesn’t overwrite the bootloader) and the code of it is public on Github repository. (The latest commit is also about the SD card support)

Also, are you planning to make the code for GameSlots public? I’d like to contribute and add new features.

2 Likes

MicroPython use ex-flash also, and create default py files from the beginning of it, so the first GameSlot could be the ocupied by these files, whether you deleted them or not. This also ther reason I didn’t ā€œformatā€ the ex-flash when install or first running, make it possible to switch MicroPython and Games back and forth(as long as NOT storage games in beginning slots).

I had read them, it save data in 32KB flash, from 0x08008000 to 0x0800FFFF. GameSlots only read/write these data thoroughly, have nothing to do with logic inside Setting extension. And it will not write anything in bootloader/game/ex-flash either.

I should give you a big thanks for this question. Sorry I didn’t try SD feature on Micropython of Meowbit before cause I think it’s impossible to work with wrong pin order. Then I have a quick test, you are right, it did work. But why? After some more investigate, I found it work under F4’s AF12 mode(SDIO), and I supposed it works under AF6 mode(SPI), I didn’t expect at all, that even the clk defined at different pins. Thanks for your question again, it give me big chance to correct my misunderstanding.

2 Likes

Ah, makes sense. Thank you for the information!

So the data is written directly into the UF2 file? (Not the bootloader but the game that’s loaded in)

No problem! It seems like the SD card support implementation is actually written in MicroPython, so I understand if you’re still not able to implement the SD card support for the MeowBit.

Also just to confirm, have you read this? Just wondering.

1 Like

No. Data is written in 32KB flash, from 0x08008000 to 0x0800FFFF. Or say, the total 512KB flash Mainly devided into 3 block: first 32KB is bootloader, 2nd 32KB is Settings data, the rest 448KB all are game. The GameSlots backup the data from 2nd 32KB to the end of flash(Settings+Game), into exFlash. And vice versa, when restore game back to flash.

2 Likes

Yes, I can be implement techically, but as I said before it seams only Meowbit had a build-in SD card, so I probably will not do it for only one product, except I have plenty free time someday.

I did see this, but I havn’t an answer right now. I do like to share code with Makecode team or all members in this forum. But recently I saw some seller announce they worked out the ā€œ3Dā€ feature, which screen shot is the raycasting( maybe the @mmoskal edition). I just don’t let them using in commerial without any permission. And the other reason is, I add many codes, and there are many test/debug/my custom code, that should clear before share, it take times.

2 Likes

There’s another device called Adafruit PyGamer which also has a MicroSD card and it’s said that they’re used for storing files, images, audio, etc.

[Unrelated to your message] Also I’ve found a bug on GameSlots where if the game makes it reset itself (With the reset/restart block) it actually resets to the bootloader or the slots menu, is it possible to fix this?

1 Like

PyGamer is with a different chip, SAMD51, should be coding in totally another framework/project.

Actually the gameover do a reset after you press the button, if you entered GameSlots, you must pressing A btn at that time, cause A+Reset=GameSlots, right? An Easy workaround is press B or other btn else when gameover dialog appeared. :sweat_smile:

3 Likes

Guys, where could I find a bootloader for this console model:

https://it.aliexpress.com/i/1005005034578220.html

2 Likes

Maybe I can help you to make one. The chip it using(STM32F412RET6) is the same with one of my custom Arcade console.

2 Likes

its not doing any thing

2 Likes

This is the first time hugov has posted — let’s welcome him to our community

1 Like

Thanks, Vincent!

1 Like

Really? My 7-year-old daughter, who is learning to develop with MakeCode, and I would be very grateful…

1 Like

To make a ThinkBox edition for you (by replace the hardware configs of my bootloader), send all files in your U-drive, and other resource of this product(official link, manual, uf2 files, if you have) to anywhere that I can download pls.

Or create a PR on https://github.com/AqeeAqee/GameSlots/tree/main/ConsoleOriginalFiles/ThinkBox/

1 Like

AqeeAqee, it’s done. Files placed in the folder
GameSlots/ConsoleOriginalFiles/ThinkBox/

Tks!

2 Likes