PS2 NES Mappers Supported by SNESticle

SumavisionQ5

Forum Noob
By disassembling the PS2 version binary of SNESticle using IDA Pro, we obtained the following function:

```c
const char *__fastcall sub_140AD8(int a1)
{
const char *v1; // $v1
int v2; // $v0

v1 = "MMC5";
if ( a1 != 5 )
{
if ( a1 >= 6 )
{
v1 = "ColorDreams";
if ( a1 == 11 )
return v1;
if ( a1 >= 12 )
{
v1 = "GNROM";
if ( a1 == 66 )
return v1;
if ( a1 < 67 )
{
v2 = 15;
v1 = "100-in-1";
}
else
{
v2 = 255;
v1 = "Famicom Disk System";
}
}
else
{
v1 = "AOROM";
if ( a1 == 7 )
return v1;
v2 = 9;
v1 = "MMC2";
}
}
else
{
v1 = "UNROM";
if ( a1 == 2 )
return v1;
if ( a1 >= 3 )
{
v1 = "CNROM";
if ( a1 == 3 )
return v1;
v2 = 4;
v1 = "MMC3";
}
else
{
v1 = "None";
if ( !a1 )
return v1;
v2 = 1;
v1 = "MMC1";
}
}
if ( a1 != v2 )
return "<unknown>";
}
return v1;
}
```

After analyzing this with ChatGPT, we get the following result:

---

### ✅ Summary: This function corresponds to the following mapper name logic:

| Mapper ID | Name |
| --------- | ------------------- |
| 0 | None |
| 1 | MMC1 |
| 2 | UNROM |
| 3 | CNROM |
| 4 | MMC3 |
| 5 | MMC5 |
| 7 | AOROM |
| 9 | MMC2 |
| 11 | ColorDreams |
| 15 | 100-in-1 |
| 66 | GNROM |
| 255 | Famicom Disk System |
| Others | <unknown> |

---

### Additional Notes:

* This style of implementation might be the result of compiler optimization (e.g., transforming a switch-case or table lookup into a decision tree).
* If you want the function to be clearer or easier to extend, you can rewrite it as a `struct` table or a switch-case.

---

### ️ Example: Rewritten as a Lookup Table (more suitable for future patching)

```c
typedef struct {
int mapper;
const char* name;
} MapperEntry;

static const MapperEntry mapper_table[] = {
{0, "None"},
{1, "MMC1"},
{2, "UNROM"},
{3, "CNROM"},
{4, "MMC3"},
{5, "MMC5"},
{7, "AOROM"},
{9, "MMC2"},
{11, "ColorDreams"},
{15, "100-in-1"},
{66, "GNROM"},
{255, "Famicom Disk System"},
};

const char* get_mapper_name(int mapper)
{
for (int i = 0; i < sizeof(mapper_table)/sizeof(mapper_table[0]); i++) {
if (mapper_table.mapper == mapper)
return mapper_table.name;
}
return "<unknown>";
}
```

This version is more readable and easier to maintain.

---

After testing, it was found that although SNESticle supports the above mappers, its compatibility is mediocre. Aside from mappers 0, 1, 2, 3, 4, 5, and 15, others are technically supported but in practice are poorly compatible. Even for the relatively compatible mapper 4, it fails to run games like *Teenage Mutant Ninja Turtles III*.

By disassembling other parts of the code using IDA Pro, it was also discovered that although SNESticle supports FDS (requires placing `disksys.rom` in the same folder as the FDS files), its support is very poor—most FDS games fail to run, with only a handful actually working.
 
And here's another tip for running games:
The filename can not be too long!
If your ROM's filename is too long, it can not accepted by SNEStilce.
 
Back
Top