EstebanFuentealba/MALVEKE-Flipper-Zero

IDEA: app that allows you to write new games and files to game boy

Opened this issue · 11 comments

Just imagine the possibilities!

Yes, that's one of the things that need to be implemented.

// TODO: Implements Write ROM
// VariableItem* item = variable_item_list_add(
// app->submenu,
// "Write ROM",
// 2,
// gameboy_cartridge_set_rom_option,
// app);
// app->gameboy_rom_option_selected_index = value_index_uint32(app->gameboy_rom_option_selected_index, gameboy_rom_option_value, 2);
// variable_item_set_current_value_index(item, app->gameboy_rom_option_selected_index);
// variable_item_set_current_value_text(item, rom_option_uppercase(app->gameboy_rom_option_selected_index));

For this, I'm waiting for Flipper Zero to release the RPC over UART functionality to test transfer the ROM from the FZ to ESP32. I'm also hoping they'll solve the issue of transferring files at a higher baud rate since packets are lost when transferring at speeds higher than 230000.

Yeah… ok. Mabye look at the esp flasher for inspiration.

Yes, for writing .sav files, I did something similar

the_savefile = malloc(fileSize); // to be freed by caller
uint8_t* buf_ptr = the_savefile;
size_t read = 0;
while(read < fileSize) {
size_t to_read = fileSize - read;
if(to_read > UINT16_MAX) to_read = UINT16_MAX;
uint16_t now_read = storage_file_read(file, buf_ptr, (uint16_t)to_read);
read += now_read;
buf_ptr += now_read;
}
savefile_size = read;
uart_tx((uint8_t*)the_savefile, savefile_size);
uart_tx((uint8_t*)("\n"), 1);
with_view_model(
app->gb_cartridge_scene_5->view,
GameBoyCartridgeRAMWriteModel * model,
{ model->event_title = "Writing Cartridge..."; },
true);

But since it's a small file, it works fine. However, for GB7GBC ROMs (>= 1MB) GBA (>=4MB), we need to divide packets and transfer them at a higher speed to avoid long delays, and Flipper Zero doesn't handle that very well yet.

Ok I guess that makes sense. Could you possibly make an adapter from the game boy cable that connects to the esp to usb c to connect to the flipper that way? That should have higher transfer speeds.

I mean, that might not be the most portable but it should work.

You might also be able to compress the file into a smaller packet and send them to the esp, which can revert it and write it

for writing roms to a cart i advise to take a look at https://github.com/lesserkuma/FlashGBX/tree/master/FlashGBX
it's the cart flashing software with the highest compatiblity regarding writable carts, especially the cheap ones from aliexpress.

for writing roms to a cart i advise to take a look at https://github.com/lesserkuma/FlashGBX/tree/master/FlashGBX
it's the cart flashing software with the highest compatiblity regarding writable carts, especially the cheap ones from aliexpress.

Hi there! If it's a repo where I got several ideas, like displaying the cartridge logo, we'll draw even more ideas from there. Thanks for contributing! 👍

Why’d you re-open

I closed it by mistake, rewriting ROMs on the cartridges is still on the to-do list.

Ok cool