# GameSlots - save multi games at the same time

**URL:** <https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664>\
**Category:** Arcade\
**Tags:** make, tool\
**Created:** [March 21, 2023, 5:02pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664 "2023-03-21T17:02:44Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 10, 2023, 7:36pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/21 "2023-04-10T19:36:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 10, 2023, 7:37pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/22 "2023-04-10T19:37:24Z")

</div>

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

> [@usertheusernamer](#):
>
> I now get an error that says “Slot Init Failed!”

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

> [@usertheusernamer](#):
>
> - Save settings from other games, it isn’t necessary but it’ll be nice to have your progress for example for an RPG game be kept when loading other games.

- 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?

> [@usertheusernamer](#):
>
> SD card support, the MicroPython (Or should I say CircuitPython, that was in boot\_out.txt) firmware does support it out of the box and you can easily put the files there (Boot takes more time to initialize SD card) so maybe it’s possible to add SD card support?

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

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 11, 2023, 4:24pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/23 "2023-04-11T16:24:35Z")

</div>

> [@AqeeAqee](#):
>
> > [@usertheusernamer](#):
> >
> > I now get an error that says “Slot Init Failed!”
> 
> - 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.

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

> [@AqeeAqee](#):
>
> > [@usertheusernamer](#):
> >
> > - Save settings from other games, it isn’t necessary but it’ll be nice to have your progress for example for an RPG game be kept when loading other games.
> 
> - 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?

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.

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 11, 2023, 4:26pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/24 "2023-04-11T16:26:23Z")

</div>

> [@AqeeAqee](#):
>
> And the Meowbit SD slot pins order is very odd.

I think [this image](https://cdn.shopify.com/s/files/1/0193/0946/1603/articles/1589774766259-b8f26331-7b6d-4866-8a43-c9c155916fda_1771x.png?v=1640682385) 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?](https://www.kittenbot.cc/products/meowbit-wireless-sd-module)

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 11, 2023, 6:18pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/25 "2023-04-11T18:18:09Z")

</div>

Thanks for more informations.

> [@EpicKitty](#):
>
> 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”)

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?

> [@EpicKitty](#):
>
> 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.

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

> [@EpicKitty](#):
>
> I think [this image](https://cdn.shopify.com/s/files/1/0193/0946/1603/articles/1589774766259-b8f26331-7b6d-4866-8a43-c9c155916fda_1771x.png?v=1640682385) 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?](https://www.kittenbot.cc/products/meowbit-wireless-sd-module)

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](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/6f23eaa59a75b69eb71d564f48a04892fe23930f.png)  
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.

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 11, 2023, 6:50pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/26 "2023-04-11T18:50:05Z")

</div>

> [@AqeeAqee](#):
>
> 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?

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](https://www.youtube.com/watch?v=G5s4-Kak49o) if you will like to know more)

> [@AqeeAqee](#):
>
> Yes, the Setteings I metioned all the time, is of this extension, or data it writen in flash.

It’s an extension that lets you save data to the flash, [Here’s the implementation of how it saves to flash.](https://github.com/microsoft/pxt-common-packages/tree/master/libs/settings)

> [@AqeeAqee](#):
>
> 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.

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.](https://github.com/KittenBot/micropython_meowbit) (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.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 11, 2023, 10:10pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/27 "2023-04-11T22:10:38Z")

</div>

> [@EpicKitty](#):
>
> 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](https://www.youtube.com/watch?v=G5s4-Kak49o) if you will like to know more)

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

> [@EpicKitty](#):
>
> It’s an extension that lets you save data to the flash, [Here’s the implementation of how it saves to flash.](https://github.com/microsoft/pxt-common-packages/tree/master/libs/settings)

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.

> [@EpicKitty](#):
>
> 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.](https://github.com/KittenBot/micropython_meowbit) (The latest commit is also about the SD card support)

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.

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 12, 2023, 4:01pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/28 "2023-04-12T16:01:24Z")

</div>

> [@AqeeAqee](#):
>
> 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).

Ah, makes sense. Thank you for the information!

> [@AqeeAqee](#):
>
> 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.

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

> [@AqeeAqee](#):
>
> 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.

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.

> [@EpicKitty](#):
>
> Also, are you planning to make the code for GameSlots public? I’d like to contribute and add new features.

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

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 12, 2023, 5:40pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/29 "2023-04-12T17:40:56Z")

</div>

> [@EpicKitty](#):
>
> So the data is written directly into the UF2 file? (Not the bootloader but the game that’s loaded in)

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.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 12, 2023, 7:41pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/30 "2023-04-12T19:41:20Z")

</div>

> [@EpicKitty](#):
>
> so I understand if you’re still not able to implement the SD card support for the MeowBit.

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.

> [@EpicKitty](#):
>
> Also, are you planning to make the code for GameSlots public? I’d like to contribute and add new features.

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.

---

<div class="post-metadata">

**Author:** ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)\
**Post date:** [April 13, 2023, 4:47pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/31 "2023-04-13T16:47:31Z")

</div>

> [@AqeeAqee](#):
>
> 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.

There’s another device called [Adafruit PyGamer](https://www.adafruit.com/product/4242) 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?

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 13, 2023, 6:29pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/32 "2023-04-13T18:29:35Z")

</div>

> [@EpicKitty](#):
>
> There’s another device called [Adafruit PyGamer](https://www.adafruit.com/product/4242) which also has a MicroSD card and it’s said that they’re used for storing files, images, audio, etc.

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

> [@EpicKitty](#):
>
> 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?

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

---

<div class="post-metadata">

**Author:** ![hugov](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hugov](https://forum.makecode.com/u/hugov)\
**Post date:** [April 13, 2023, 8:39pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/33 "2023-04-13T20:39:46Z")

</div>

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

[https://it.aliexpress.com/i/1005005034578220.html](https://it.aliexpress.com/i/1005005034578220.html)

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 13, 2023, 10:28pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/34 "2023-04-13T22:28:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pigpigeons\_r\_c00l](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pigpigeons_r_c00l/32/12313_2.png) [@pigpigeons\_r\_c00l](https://forum.makecode.com/u/pigpigeons_r_c00l)\
**Post date:** [April 14, 2023, 4:45pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/35 "2023-04-14T16:45:42Z")

</div>

its not doing any thing

---

<div class="post-metadata">

**Author:** ![pigpigeons\_r\_c00l](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pigpigeons_r_c00l/32/12313_2.png) [@pigpigeons\_r\_c00l](https://forum.makecode.com/u/pigpigeons_r_c00l)\
**Post date:** [April 14, 2023, 4:46pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/36 "2023-04-14T16:46:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hugov](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hugov](https://forum.makecode.com/u/hugov)\
**Post date:** [April 14, 2023, 9:10pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/37 "2023-04-14T21:10:01Z")

</div>

Thanks, Vincent!

---

<div class="post-metadata">

**Author:** ![hugov](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hugov](https://forum.makecode.com/u/hugov)\
**Post date:** [April 14, 2023, 9:13pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/38 "2023-04-14T21:13:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 14, 2023, 10:50pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/40 "2023-04-14T22:50:14Z")

</div>

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/](https://github.com/AqeeAqee/GameSlots/tree/main/ConsoleOriginalFiles/ThinkBox/)

---

<div class="post-metadata">

**Author:** ![hugov](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hugov](https://forum.makecode.com/u/hugov)\
**Post date:** [April 16, 2023, 10:16pm UTC](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664/41 "2023-04-16T22:16:34Z")

</div>

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

Tks!

[Previous page](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664.md?page=1)

[Next page](https://forum.makecode.com/t/gameslots-save-multi-games-at-the-same-time/18664.md?page=3)
