Add mapper 581.

This commit is contained in:
NewRisingSun
2025-09-08 18:15:39 +02:00
parent 4c697c7909
commit 92b64e5e06
4 changed files with 56 additions and 3 deletions

View File

@@ -39,11 +39,11 @@ static void sync () {
setmirror(Latch_address &0x02? MI_H: MI_V);
}
void protectLatchBits (uint16 *address, uint8 *newValue, uint8 romValue) { /* Once bit 9 is set, only the inner bank bits can be modified. */
if (Latch_address &0x200) *address = *address &0x01C | Latch_address &~0x01C;
static void trapLatchWrite (uint16 *newAddress, uint8 *newValue, uint8 romValue) { /* Once bit 9 is set, only the inner bank bits can be modified. */
if (Latch_address &0x200) *newAddress = *newAddress &0x01C | Latch_address &~0x01C;
}
void Mapper579_Init (CartInfo *info) {
Latch_init(info, sync, 0x8000, 0xFFFF, protectLatchBits);
Latch_init(info, sync, 0x8000, 0xFFFF, trapLatchWrite);
info->Reset = Latch_power;
}