|
|
@@ -32,27 +32,27 @@ void gb_cartridge_scene_menu_submenu_callback(void* context, uint32_t index) {
|
|
|
GBCartridge* app = context;
|
|
|
view_dispatcher_send_custom_event(app->view_dispatcher, index);
|
|
|
}
|
|
|
-static char* rom_option_uppercase(uint32_t index) {
|
|
|
- const char *gameboy_rom_option = gameboy_rom_option_text[index];
|
|
|
- char *gameboy_rom_option_uppercase = (char*)malloc(strlen(gameboy_rom_option) + 1); // +1 para el carácter nulo
|
|
|
+// static char* rom_option_uppercase(uint32_t index) {
|
|
|
+// const char *gameboy_rom_option = gameboy_rom_option_text[index];
|
|
|
+// char *gameboy_rom_option_uppercase = (char*)malloc(strlen(gameboy_rom_option) + 1); // +1 para el carácter nulo
|
|
|
|
|
|
- if (gameboy_rom_option_uppercase) {
|
|
|
- strcpy(gameboy_rom_option_uppercase, gameboy_rom_option);
|
|
|
- toUpperCase(gameboy_rom_option_uppercase);
|
|
|
- } else {
|
|
|
- // Manejo de error en caso de falta de memoria
|
|
|
- return NULL;
|
|
|
- }
|
|
|
+// if (gameboy_rom_option_uppercase) {
|
|
|
+// strcpy(gameboy_rom_option_uppercase, gameboy_rom_option);
|
|
|
+// toUpperCase(gameboy_rom_option_uppercase);
|
|
|
+// } else {
|
|
|
+// // Manejo de error en caso de falta de memoria
|
|
|
+// return NULL;
|
|
|
+// }
|
|
|
|
|
|
- return gameboy_rom_option_uppercase;
|
|
|
-}
|
|
|
-static void gameboy_cartridge_set_rom_option(VariableItem* item) {
|
|
|
- GBCartridge* app = variable_item_get_context(item);
|
|
|
- uint8_t index = variable_item_get_current_value_index(item);
|
|
|
- variable_item_set_current_value_text(item, rom_option_uppercase(index));
|
|
|
- app->gameboy_rom_option_selected_index = gameboy_rom_option_value[index];
|
|
|
- app->gameboy_rom_option_selected_text = (char*)gameboy_rom_option_text[index];
|
|
|
-}
|
|
|
+// return gameboy_rom_option_uppercase;
|
|
|
+// }
|
|
|
+// static void gameboy_cartridge_set_rom_option(VariableItem* item) {
|
|
|
+// GBCartridge* app = variable_item_get_context(item);
|
|
|
+// uint8_t index = variable_item_get_current_value_index(item);
|
|
|
+// variable_item_set_current_value_text(item, rom_option_uppercase(index));
|
|
|
+// app->gameboy_rom_option_selected_index = gameboy_rom_option_value[index];
|
|
|
+// app->gameboy_rom_option_selected_text = (char*)gameboy_rom_option_text[index];
|
|
|
+// }
|
|
|
|
|
|
void gb_cartridge_scene_menu_on_enter(void* context) {
|
|
|
GBCartridge* app = context;
|
|
|
@@ -61,19 +61,20 @@ void gb_cartridge_scene_menu_on_enter(void* context) {
|
|
|
variable_item_list_add(app->submenu, "Dump ROM Cartridge", 1, NULL, NULL);
|
|
|
variable_item_list_add(app->submenu, "Dump RAM Cartridge", 1, NULL, NULL);
|
|
|
|
|
|
- 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));
|
|
|
+ // 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));
|
|
|
|
|
|
|
|
|
variable_item_list_add(app->submenu, "Write RAM", 1, NULL, NULL);
|
|
|
- variable_item_list_add(app->submenu, "Settings", 1, NULL, NULL);
|
|
|
+ // variable_item_list_add(app->submenu, "Settings", 1, NULL, NULL);
|
|
|
|
|
|
variable_item_list_set_enter_callback(app->submenu, gb_cartridge_scene_menu_submenu_callback, app);
|
|
|
|