comparison realtec.c @ 1261:f13f51e9f9f2

Improve hacky name parsing code to handle Whac a Critter/Mallet Legend
author Michael Pavone <pavone@retrodev.com>
date Thu, 02 Mar 2017 22:22:54 -0800
parents 23c94f5266d1
children 11ac0b511cff
comparison
equal deleted inserted replaced
1260:cad1642baf66 1261:f13f51e9f9f2
70 memcpy(r->rom_space + i, rom + 0x7E000, 8*1024); 70 memcpy(r->rom_space + i, rom + 0x7E000, 8*1024);
71 } 71 }
72 byteswap_rom(512*1024, (uint16_t *)r->rom_space); 72 byteswap_rom(512*1024, (uint16_t *)r->rom_space);
73 73
74 uint8_t *name_start = NULL, *name_end = NULL; 74 uint8_t *name_start = NULL, *name_end = NULL;
75 for (int i = 0x90; i < 0xE0; i++) 75 for (int i = 0x94; i < 0xE0; i++)
76 { 76 {
77 if (name_start) { 77 if (name_start) {
78 if (rom[i] < ' ' || rom[i] > 0x80 || !memcmp(rom+i, "ARE", 3)) { 78 if (rom[i] < ' ' || rom[i] > 0x80 || !memcmp(rom+i, "ARE", 3) || !memcmp(rom+i, "are", 3)) {
79 name_end = rom+i; 79 name_end = rom+i;
80 break; 80 break;
81 } 81 }
82 } else if (rom[i] > ' ' && rom[i] < 0x80) { 82 } else if (rom[i] > ' ' && rom[i] < 0x80 && rom[i] != ':') {
83 name_start = rom + i; 83 name_start = rom + i;
84 } 84 }
85 } 85 }
86 if (name_start && !name_end) { 86 if (name_start && !name_end) {
87 name_end = rom + 0xE0; 87 name_end = rom + 0xE0;