Skip to content

Commit

Permalink
ram save/load fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xrip committed Oct 10, 2023
1 parent 21fbbd0 commit 2fc4442
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions inc/peanut_gb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4126,19 +4126,16 @@ const char* gb_get_rom_name(struct gb_s* gb, char *title_str)
for(; title_loc <= title_loc+ 24; title_loc++)
{
const char title_char = gb->gb_rom_read(gb, title_loc);
if (title_char == '\0') break;

if(title_char >= ' ' && title_char <= '_')
if((title_char >= '0' && title_char <= '9') || (title_char >= 'A' && title_char <= 'Z'))
{
if(title_char == ' ') {
*title_str = '_';
} else {
*title_str = title_char;
}

title_str++;
}
else
break;
} else {
*title_str = '_';
}
title_str++;
}

*title_str = '\0';
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
const char *rom_filename = (const char *) (XIP_BASE + FLASH_TARGET_OFFSET);
const uint8_t *rom = (const uint8_t *) (XIP_BASE + FLASH_TARGET_OFFSET) + 4096;

static uint8_t __attribute__((aligned(4))) ram[32768];
static uint8_t ram[32768];

static const sVmode *vmode = nullptr;
struct semaphore vga_start_semaphore;
Expand Down

0 comments on commit 2fc4442

Please sign in to comment.