@Radu79 Being able to put login on SD card or not will mean that this project will be interesting for others or just me. My goal is to have a Gameboy-like behavior - keep a game on the card, if possible several games, and just change the game without the need to hook the device to the computer. THAT'S IT! Everything I mentioned is the things I have found or considered.
@ESP_Sprite, you understood correctly! I don't mind going Odroid-Go way but I only found information about burning data on the flash not how to do the binary and booting from it. Can you please give good info on how to do that?
Game ROM on SD card
Re: Game ROM on SD card
Which is why I suggested zlib. You can have all your files in a zip archive and use it to extract the files you need. If he wants to keep the game logic too on the card, then the best way is to implement it as a scripting language. I would suggest Pawn, as it can load precompiled scripts so there is no need to waste time parsing the script.ESP_Sprite wrote: ↑Wed Nov 25, 2020 3:19 amRadu: I think you're reading too much into this. As far as I understand, Nezvers' goal is to have a game console like device where the end user can plunk a game as a single file onto an SD-card, insert it into the console and play it. The single file contains both assets (images, sprites, sounds, whatnot) as well as the game logic. This is the end goal; development of the game is a separate issue.
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: Game ROM on SD card
nezvers wrote: ↑Wed Nov 25, 2020 11:16 am@Radu79 Being able to put login on SD card or not will mean that this project will be interesting for others or just me. My goal is to have a Gameboy-like behavior - keep a game on the card, if possible several games, and just change the game without the need to hook the device to the computer. THAT'S IT! Everything I mentioned is the things I have found or considered.
@ESP_Sprite, you understood correctly! I don't mind going Odroid-Go way but I only found information about burning data on the flash not how to do the binary and booting from it. Can you please give good info on how to do that?
I think the Odroid code has some logic on how to do that. Alternatively, you may be able to use the ESP-IDF OTA code, perhaps the Arduino OTA subsystem is also compatible. Only issue I can spot is that getting the ESP32 to boot into an alternative binary on demand may need a modification of the bootloader - although I know you can get the ESP-IDF OTA logic to only boot once into a new binary by indicating the binary 'doesn't work' - the bootloader will revert to the old code then. That probably already gives you the behaviour you want.
If you're okay going the ESP-IDF OTA route, you can read through here - keep in mind you would load the 'update' data from the big game blob on your SD-card instead of over the air (by calling ota_begin/ota_write/ota_end), and that you use the 'application rollback' feature to go back to your main app after you exit the game.
Re: Game ROM on SD card
Am I understanding the idea right? Need to have 2 partitions - one active firmware with OTA code and the second as a buffer for changed firmware and esp32 will send the new update itself to that buffer. If so it seems like a super perfect solution.
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: Game ROM on SD card
Yep, that's more-or-less how it works.
Re: Game ROM on SD card
I found how I can set up partitions from Arduino IDE and how to send a new program through OTA.
But I can't find how esp32 can do it to itself.
But I can't find how esp32 can do it to itself.
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: Game ROM on SD card
So that's where the ESP-IDF functions esp_ota_begin/esp_ota_write/esp_ota_end come in - you can start an update by using esp_ota_begin, then feed any data to esp_ota_write, and finally end with esp_ota_end. So in your case, you could open the game 'ROM' file using the standard fopen calls and read data using fread (or whatever the Arduino equivalent is) and feed that to esp_ota_write manually. Close with esp_ota_end and you should be good. (One disclaimer: I'm not actually 100% sure Arduino and ESP-IDF OTA is entirely compatible; if you run into issues, that may be something to look into.)
Re: Game ROM on SD card
Oh, that sounds pretty simple. Now I know where to look.
I think I will be using Visual Code for IDF.
I think I will be using Visual Code for IDF.
Re: Game ROM on SD card
@nezvers did you make any progress on this and can you share some results? I would be interested in how you solved this.
Who is online
Users browsing this forum: Bing [Bot] and 26 guests