mirror of
https://github.com/zeldaret/ph
synced 2026-07-09 14:05:36 -04:00
Match banner
This commit is contained in:
+5
-1
@@ -485,6 +485,7 @@ bool ReadTitle(const char *language, const char *file, wchar_t *title, size_t ti
|
||||
if (fread(buf, fileSize, 1, fp) != 1) FATAL("Failed to read %s banner title '%s'\n", language, file);
|
||||
fclose(fp);
|
||||
|
||||
memset(title, 0, titleSize);
|
||||
if (!Utf8ToWchar(buf, fileSize, title, titleSize)) return false;
|
||||
return true;
|
||||
}
|
||||
@@ -496,7 +497,6 @@ bool WriteBanner(FILE *fpRom, size_t *pAddress) {
|
||||
|
||||
Banner banner;
|
||||
banner.version = 1;
|
||||
banner.crc;
|
||||
memset(banner.reserved0, 0, sizeof(banner.reserved0));
|
||||
|
||||
fp = fopen(ICON_BITMAP_FILE, "rb");
|
||||
@@ -520,6 +520,10 @@ bool WriteBanner(FILE *fpRom, size_t *pAddress) {
|
||||
if (!ReadTitle("Italian", TITLE_ITA_FILE, banner.italianTitle, sizeof(banner.italianTitle))) return false;
|
||||
if (!ReadTitle("Spanish", TITLE_SPA_FILE, banner.spanishTitle, sizeof(banner.spanishTitle))) return false;
|
||||
|
||||
uint8_t *crcStart = (uint8_t*) &banner + offsetof(Banner, iconBitmap);
|
||||
uint8_t *crcEnd = (uint8_t*) &banner + sizeof(banner);
|
||||
banner.crc = Crc(crcStart, crcEnd - crcStart);
|
||||
|
||||
if (fwrite(&banner, sizeof(banner), 1, fpRom) != 1) FATAL("Failed to write banner\n");
|
||||
address += sizeof(banner);
|
||||
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ typedef struct {
|
||||
/* 0240 */ wchar_t japaneseTitle[0x80];
|
||||
/* 0340 */ wchar_t englishTitle[0x80];
|
||||
/* 0440 */ wchar_t frenchTitle[0x80];
|
||||
/* 0440 */ wchar_t germanTitle[0x80];
|
||||
/* 0440 */ wchar_t italianTitle[0x80];
|
||||
/* 0440 */ wchar_t spanishTitle[0x80];
|
||||
/* 0540 */ wchar_t germanTitle[0x80];
|
||||
/* 0640 */ wchar_t italianTitle[0x80];
|
||||
/* 0740 */ wchar_t spanishTitle[0x80];
|
||||
/* 0540 */
|
||||
} Banner;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user