refactor(rom): share Mega Drive external RAM descriptor fields (#16984)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-05 15:41:15 +08:00
1 parent d1ff1a070a
commit 2b0f0fa154
1 file changed
+9 -19
+9 -19
View File
@@ -721,25 +721,15 @@ const parseMegaDriveImage = (
},
rom: busRange(romStart, romEnd),
ram: busRange(ramStart, ramEnd),
external_ram: externalPresent
? {
present: true,
raw_hex: hexBytes(externalRaw),
type: externalType,
battery_backed: knownExternal?.battery ?? null,
access: knownExternal?.access ?? null,
start: externalStart,
end: externalEnd,
}
: {
present: false,
raw_hex: hexBytes(externalRaw),
type: null,
battery_backed: null,
access: null,
start: null,
end: null,
},
external_ram: {
present: externalPresent,
raw_hex: hexBytes(externalRaw),
type: externalPresent ? externalType : null,
battery_backed: externalPresent ? (knownExternal?.battery ?? null) : null,
access: externalPresent ? (knownExternal?.access ?? null) : null,
start: externalPresent ? externalStart : null,
end: externalPresent ? externalEnd : null,
},
image_bytes: image.length,
smd_blocks: smd?.blocks ?? null,
} satisfies MegaDriveRomMetadata;