Skip to content

Commit b940ebd

Browse files
committed
Address Copilot review: OOB dummy ROM, CI test path, document RAM map
Made-with: Cursor
1 parent f4a23bb commit b940ebd

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ jobs:
199199
else
200200
LDFLAGS=""
201201
fi
202-
$CC -O2 -Wall -o test_memory_map test/tools/test_memory_map.c $LDFLAGS
203-
./test_memory_map ./${{ matrix.config.artifact }}
202+
$CC -O2 -Wall -o test/tools/test_memory_map test/tools/test_memory_map.c $LDFLAGS
203+
./test/tools/test_memory_map ./${{ matrix.config.artifact }}
204204
205205
- name: RetroAchievements rc_libretro E2E test
206206
if: ${{ !matrix.config.emscripten && !matrix.config.android && !matrix.config.cross && runner.os != 'Windows' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Local E2E test build (downloads rcheevos tarball)
22
/build/
33

4+
# Legacy local path (older CI recipe); keep ignored if present
5+
/test_memory_map
6+
47
# Build artifacts
58
*.o
69
*.so

libretro.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,13 @@ bool retro_load_game(const struct retro_game_info *info)
998998
JaguarReset();
999999

10001000
/* Advertise the Jaguar memory map so frontends (RetroArch, etc.) can
1001-
* resolve emulated addresses to host buffers. Required for rcheevos. */
1001+
* resolve emulated addresses to host buffers. Required for rcheevos.
1002+
*
1003+
* rcheevos defines one logical system-RAM region for RC_CONSOLE_ATARI_JAGUAR:
1004+
* $000000-$1FFFFF (see rcheevos consoleinfo). RetroAchievements addresses for
1005+
* Jaguar are authored in that space. GPU-style paths mirror 2 MiB within
1006+
* $000000-$7FFFFF in JaguarReadByte, but M68K direct access in this core is
1007+
* only linear $000000-$1FFFFF without those mirrors (m68k_read_memory_*). */
10021008
{
10031009
static struct retro_memory_descriptor descs[1];
10041010
static struct retro_memory_map memmap;

test/tools/test_memory_map.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ static void *load_sym(void *handle, const char *name)
107107
*/
108108
static uint8_t *make_dummy_rom(size_t *size_out)
109109
{
110-
size_t sz = 8192;
110+
/* 0x2000 bytes is not enough: we patch instructions at file offset 0x2000 (8 KiB). */
111+
size_t sz = 12288;
111112
uint8_t *rom = calloc(1, sz);
112113
if (!rom) { perror("calloc"); exit(1); }
113114

test/tools/test_rcheevos_e2e.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void *load_sym(void *handle, const char *name)
103103

104104
static uint8_t *make_dummy_rom(size_t *size_out)
105105
{
106-
size_t sz = 8192;
106+
size_t sz = 12288;
107107
uint8_t *rom = calloc(1, sz);
108108
if (!rom) { perror("calloc"); exit(1); }
109109
rom[0x404] = 0x00; rom[0x405] = 0x80;

0 commit comments

Comments
 (0)