Esempio n. 1
0
static void writeHigh(u16 addr, u8 data)
{
	switch (addr & 0xF000) {
	case 0x8000:
		nesSetVrom2KBank(0, data);
		break;
	case 0x9000:
		nesSetVrom2KBank(2, data);
		break;
	case 0xA000:
		nesSetVrom2KBank(4, data);
		break;
	case 0xB000:
		nesSetVrom2KBank(6, data);
		break;

	case 0xC000:
		reg[2] = data;
		updateBanks();
		break;
	case 0xD000:
		reg[3] = data;
		updateBanks();
		break;
	case 0xE000:
		reg[0] = (data & 0x10)>>4;
		reg[1] = data & 0x03;
		updateBanks();
		break;

	case 0xF000:
		nesSetRom16KBank(4, data);
		break;
	}
}
Esempio n. 2
0
static void writeHigh(u16 addr, u8 data)
{
	switch (addr & 0xF000) {
	case 0x9000:
		if (data & 0x10)
			nesSetMirroring(SingleHigh);
		else
			nesSetMirroring(SingleLow);
		break;
	case 0xC000:
	case 0xD000:
	case 0xE000:
	case 0xF000:
		nesSetRom16KBank(4, data);
		break;
	default:
		break;
	}
}
Esempio n. 3
0
static void writeHigh(u16 addr, u8 data)
{
	switch (addr & 0xF800) {
	case 0x8800:
		nesSetVrom2KBank(0, data);
		break;
	case 0x9800:
		nesSetVrom2KBank(2, data);
		break;
	case 0xA800:
		nesSetVrom2KBank(4, data);
		break;
	case 0xB800:
		nesSetVrom2KBank(6, data);
		break;

	case 0xC800:
		if (!irq_toggle) {
			irq_counter = (irq_counter&0x00FF) | (data<<8);
		} else {
			irq_counter = (irq_counter&0xFF00) | data;
		}
		irq_toggle ^= 1;
		nesMapperSetIrqSignalOut(false);
		break;
	case 0xD800:
		irq_enable = data & 0x10;
		irq_toggle = 0;
		nesMapperSetIrqSignalOut(false);
		break;

	case 0xE800:
		nesSetMirroring(static_cast<NesMirroring>(data & 0x03));
		break;

	case 0xF800:
		nesSetRom16KBank(4, data);
		break;
	}
}
Esempio n. 4
0
static void writeHigh(u16 addr, u8 data)
{
	switch (addr & 0xF003) {
	case 0x8000:
		nesSetRom16KBank(4, data);
		break;

	case 0x9000: case 0x9001: case 0x9002:
	case 0xA000: case 0xA001: case 0xA002:
	case 0xB000: case 0xB001: case 0xB002:
		// TODO nes->apu->ExWrite( addr, data);
		break;

	case 0xB003:
		nesSetMirroring(static_cast<NesMirroring>((data >> 3) & 0x03));
		break;

	case 0xC000:
		nesSetRom8KBank(6, data);
		break;

	case 0xD000:
		nesSetVrom1KBank(0, data);
		break;

	case 0xD001:
		nesSetVrom1KBank(1, data);
		break;

	case 0xD002:
		nesSetVrom1KBank(2, data);
		break;

	case 0xD003:
		nesSetVrom1KBank(3, data);
		break;

	case 0xE000:
		nesSetVrom1KBank(4, data);
		break;

	case 0xE001:
		nesSetVrom1KBank(5, data);
		break;

	case 0xE002:
		nesSetVrom1KBank(6, data);
		break;

	case 0xE003:
		nesSetVrom1KBank(7, data);
		break;

	case 0xF000:
		irq_latch = data;
		break;
	case 0xF001:
		irq_enable = data & 0x03;
		if (irq_enable & 0x02) {
			irq_counter = irq_latch;
			irq_clock = 0;
		}
		nesMapperSetIrqSignalOut(false);
		break;
	case 0xF002:
		irq_enable = (irq_enable & 0x01) * 3;
		nesMapperSetIrqSignalOut(false);
		break;
	}
}
Esempio n. 5
0
static void writeLow(u16 addr, u8 data)
{
	if ((addr & 0xE000) == 0x6000)
		nesSetRom16KBank(4, data);
}