Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mindstormpro3 opened this issue Dec 8, 2023 · 11 comments
Open
Labels

Comments

@mindstormpro3
Copy link

Just imagine the possibilities!

@EstebanFuentealba EstebanFuentealba added the enhancement New feature or request label Dec 8, 2023
@EstebanFuentealba
Copy link
Owner

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.

@mindstormpro3
Copy link
Author

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

@EstebanFuentealba
Copy link
Owner

EstebanFuentealba commented Dec 8, 2023

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.

@mindstormpro3
Copy link
Author

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.

@mindstormpro3
Copy link
Author

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

@mindstormpro3
Copy link
Author

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

@hmax42
Copy link

hmax42 commented Dec 17, 2023

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.

@EstebanFuentealba
Copy link
Owner

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! 👍

@mindstormpro3
Copy link
Author

Why’d you re-open

@EstebanFuentealba
Copy link
Owner

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

@mindstormpro3
Copy link
Author

Ok cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants