Пример #1
0
void __fastcall tmntZ80Write(unsigned short wordValue,unsigned char val)
{
	if (wordValue==0x9000)
	{
		UPD7759ResetWrite(val & 2);
//		bprintf(PRINT_NORMAL, _T("\nZ80: write %d to UPD7759 reset"), val & 2);
		tmnt_soundlatch = val;
	}
	if ((wordValue>=0xb000) && (wordValue<=0xb00d))
	{
//		printf("\nZ80: write %d to K007232 %d",val,0xb000 - wordValue);
		//ZetNmi();
	//	ZetLowerIrq();
	}
	if (wordValue==0xc000)
	{
		BurnYM2151SelectRegister(val);
	}
	if (wordValue==0xc001)
	{
		BurnYM2151WriteRegister(val);
	}
	if (wordValue==0xd000)
	{
		UPD7759PortWrite(val);
//		bprintf(PRINT_NORMAL, _T("\nZ80: write %d to UPD7759_0_message"), val);
	}
	if (wordValue==0xe000)
	{
		UPD7759StartWrite(val);
//		bprintf(PRINT_NORMAL, _T("\nZ80: write %d to UPD7759_0_start"), val);
	}
}
Пример #2
0
void __fastcall vfive_v25_write(UINT32 address, UINT8 data)
{
	switch (address)
	{
		case 0x00000:
			BurnYM2151SelectRegister(data);
		return;

		case 0x00001:
			BurnYM2151WriteRegister(data);
		return;
	}
}
Пример #3
0
void __fastcall vfive_v25_write(unsigned int address, unsigned char data)
{
	switch (address)
	{
		case 0x00000:
			BurnYM2151SelectRegister(data);
		return;

		case 0x00001:
			BurnYM2151WriteRegister(data);
		return;
	}
}
Пример #4
0
void __fastcall shippumdZ80Write(UINT16 nAddress, UINT8 nValue)
{
	switch (nAddress) {
		case 0xE000:
			BurnYM2151SelectRegister(nValue);
			break;
		case 0xE001:
			BurnYM2151WriteRegister(nValue);
			break;
		case 0xE004:
			MSM6295Command(0, nValue);
			break;
	}
}
Пример #5
0
void __fastcall shippumdZ80Write(unsigned short nAddress, unsigned char nValue)
{
	switch (nAddress) {
		case 0xE000:
			BurnYM2151SelectRegister(nValue);
			break;
		case 0xE001:
			BurnYM2151WriteRegister(nValue);
			break;
		case 0xE004:
			MSM6295Command(0, nValue);
			break;
	}
}
Пример #6
0
void __fastcall snowbro2WriteWord(UINT32 sekAddress, UINT16 wordValue)
{
	switch (sekAddress) {
		case 0x300000:								// Set GP9001 VRAM address-pointer
			ToaGP9001SetRAMPointer(wordValue);
			break;

		case 0x300004:
		case 0x300006:
			ToaGP9001WriteRAM(wordValue, 0);
			break;

		case 0x300008:
			ToaGP9001SelectRegister(wordValue);
			break;

		case 0x30000C:
			ToaGP9001WriteRegister(wordValue);
			break;

		case 0x600000:
			MSM6295Command(0, wordValue & 0xFF);
			break;
		case 0x700030: {
			INT32 nBankOffset = (wordValue & 0x01) << 18;
			MSM6295SampleInfo[0][0] = MSM6295ROM + nBankOffset;
			MSM6295SampleData[0][0] = MSM6295ROM + nBankOffset;
			MSM6295SampleInfo[0][1] = MSM6295ROM + nBankOffset + 0x0100;
			MSM6295SampleData[0][1] = MSM6295ROM + nBankOffset + 0x10000;
			MSM6295SampleInfo[0][2] = MSM6295ROM + nBankOffset + 0x0200;
			MSM6295SampleData[0][2] = MSM6295ROM + nBankOffset + 0x20000;
			MSM6295SampleInfo[0][3] = MSM6295ROM + nBankOffset + 0x0300;
			MSM6295SampleData[0][3] = MSM6295ROM + nBankOffset + 0x30000;
			break;
		}

		case 0x500000:
			BurnYM2151SelectRegister(wordValue);
			break;
		case 0x500002:
			BurnYM2151WriteRegister(wordValue);
			break;

		default: {
//			printf("Attempt to write word value %x to location %x\n", wordValue, sekAddress);
		}
	}
}
Пример #7
0
void supratk_write(unsigned short address, unsigned char data)
{
	switch (address)
	{
		case 0x5fc0:
			K052109RMRDLine = data & 0x08;
		return;

		case 0x5fc4:
			videobank = data;
		return;

		case 0x5fd0:
			BurnYM2151SelectRegister(data);
		return;

		case 0x5fd1:
			BurnYM2151WriteRegister(data);
		return;
	}

	if ((address & 0xf800) == 0x0000) {
		if (videobank & 0x02) {
			DrvPalRAM[((videobank & 4) << 9) + address] = data;
			return;
		} else if (videobank & 0x01) {
			K053245Write(0, address, data);
			return;
		}
		DrvBankRAM[address] = data;
		return;
	}

	if ((address & 0xfff0) == 0x5fa0) {
		K053244Write(0, address & 0x0f, data);
		return;
	}

	if ((address & 0xfff0) == 0x5fb0) {
		K053251Write(address & 0x0f, data);
		return;
	}

	if ((address & 0xc000) == 0x4000) {
		K052109Write(address & 0x3fff, data);
		return;
	}
}
Пример #8
0
void __fastcall kbash_v25_write(UINT32 address, UINT8 data)
{
	switch (address)
	{
		case 0x04000:
			BurnYM2151SelectRegister(data);
		return;

		case 0x04001:
			BurnYM2151WriteRegister(data);
		return;

		case 0x04002:
			MSM6295Command(0, data);
		return;
	}
}
Пример #9
0
void __fastcall mahoudaiZ80Write(UINT16 nAddress, UINT8 nValue)
{
//	bprintf(PRINT_NORMAL, "Z80 attempted to write address %04X with value %02X.\n", nAddress, nValue);

	switch (nAddress) {
		case 0xE000:
			BurnYM2151SelectRegister(nValue);
			break;
		case 0xE001:
			BurnYM2151WriteRegister(nValue);
			break;
		case 0xE004:
			MSM6295Command(0, nValue);
//			bprintf(PRINT_NORMAL, "OKI M6295 command %02X sent\n", nValue);
			break;
	}
}
Пример #10
0
void __fastcall dogyuun_v25_write(unsigned int address, unsigned char data)
{
	switch (address)
	{
		case 0x00000:
			BurnYM2151SelectRegister(data);
		return;

		case 0x00001:
			BurnYM2151WriteRegister(data);
		return;

		case 0x00004:
			MSM6295Command(0, data);
		return;
	}
}
Пример #11
0
void __fastcall aliens_sound_write(UINT16 address, UINT8 data)
{
	if ((address & 0xfff0) == 0xe000) {
		K007232WriteReg(0, address & 0x0f, data);
		return;
	}

	switch (address)
	{
		case 0xa000:
			BurnYM2151SelectRegister(data);
		return;

		case 0xa001:
			BurnYM2151WriteRegister(data);
		return;
	}
}
Пример #12
0
void __fastcall snowbro2WriteByte(UINT32 sekAddress, UINT8 byteValue)
{
	switch (sekAddress) {
		case 0x600001:
			MSM6295Command(0, byteValue);
			break;

		case 0x500001:
			BurnYM2151SelectRegister(byteValue);
			break;
		case 0x500003:
			BurnYM2151WriteRegister(byteValue);
			break;

		default: {
//			printf("Attempt to write byte value %x to location %x\n", byteValue, sekAddress);
		}
	}
}
Пример #13
0
void __fastcall RastanZ80Write(unsigned short a,unsigned char d)
{
	switch (a)
	{
	case 0xb000:
		{
		UINT8 *rom = MSM5205ROM;
		int len = 0x10000;
		int start = d << 8;
		int end;

		/* look for end of sample */
		end = (start + 3) & ~3;
		while (end < len && *((unsigned int *)(&rom[end])) != 0x08080808)
			end += 4;

		MSM5205Play(start,(end-start)*2,0);
		}
		return;
	case 0xc000:
		return;
	case 0xd000:
		return;
	case 0x9000:
		BurnYM2151SelectRegister(d);
		return;
	case 0x9001:
		BurnYM2151WriteRegister(d);
		return;
	case 0xa000:
		tc0140_slave_port_w(d);
		return;
	case 0xa001:
		tc0140_slave_comm_w(d);
		return;
	default:
		bprintf(PRINT_NORMAL, _T("z80write %x\n"),a);
	}


}
Пример #14
0
void __fastcall battlegZ80Write(UINT16 nAddress, UINT8 nValue)
{
//	printf("z80 wrote %4X with %2X\n", nAddress, nValue);
	switch (nAddress) {
		case 0xE000:
			BurnYM2151SelectRegister(nValue);
			break;
		case 0xE001:
			BurnYM2151WriteRegister(nValue);
			break;

		case 0xE004:
			MSM6295Command(0, nValue);
			break;

		case 0xE006:
			MSM6295SampleInfo[0][0] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleData[0][0] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[0][1] = MSM6295ROM + ((nValue & 0xF0) << 12) + 0x0100;
			MSM6295SampleData[0][1] = MSM6295ROM + ((nValue & 0xF0) << 12);
			break;
		case 0xE008:
			MSM6295SampleInfo[0][2] = MSM6295ROM + ((nValue & 0x0F) << 16) + 0x0200;
			MSM6295SampleData[0][2] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[0][3] = MSM6295ROM + ((nValue & 0xF0) << 12) + 0x0300;
			MSM6295SampleData[0][3] = MSM6295ROM + ((nValue & 0xF0) << 12);
			break;

		case 0xE00A: {
			drvZ80Bankswitch(nValue);
			break;
  		}

		case 0xE00C:
			// Once a sound command is processed, it is written to this address
			// printf("z80 wrote %4X -> %2X\n", nAddress, nValue);
			break;

	}
}
Пример #15
0
void __fastcall scontra_sound_write(unsigned short address, unsigned char data)
{
	if ((address & 0xfff0) == 0xb000) {
		K007232WriteReg(0, address & 0x0f, data);
		return;
	}

	switch (address)
	{
		case 0xc000:
			BurnYM2151SelectRegister(data);
		return;

		case 0xc001:
			BurnYM2151WriteRegister(data);
		return;

		case 0xf000:
			scontra_snd_bankswitch_w(data);
		return;
	}
}
Пример #16
0
void __fastcall parodius_sound_write(UINT16 address, UINT8 data)
{
	switch (address)
	{
		case 0xf800:
			BurnYM2151SelectRegister(data);
		return;

		case 0xf801:
			BurnYM2151WriteRegister(data);
		return;

		case 0xfa00:
			nCyclesDone[1] += ZetRun(100);
			ZetNmi();
		return;
	}

	if (address >= 0xfc00 && address <= 0xfc2f) {
		K053260Write(0, address & 0x3f, data);
	}
}
Пример #17
0
void __fastcall twinhawkZ80Write(unsigned short a,unsigned char d)
{
	switch (a)
	{
	case 0xe000:
		BurnYM2151SelectRegister(d);
		return;
	case 0xe001:
		BurnYM2151WriteRegister(d);
		return;
	case 0xe200:
		tc0140_slave_port_w(d);
		return;
	case 0xe201:
		tc0140_slave_comm_w(d);
		return;
	case 0xf200:
		twinhawkBankSwitch(0,d);
	default:
		return;
	}
}
Пример #18
0
void __fastcall Sf2mdtZ80Write(UINT16 a, UINT8 d)
{
	switch (a) {
		case 0xd800: {
			BurnYM2151SelectRegister(d);
			return;
		}
		
		case 0xd801: {
			BurnYM2151WriteRegister(d);
			return;
		}
		
		case 0xe000: {
			MSM5205SetRoute(0, (d & 0x20) ? 0 : 0.25, BURN_SND_ROUTE_BOTH);
			MSM5205SetRoute(1, (d & 0x10) ? 0 : 0.25, BURN_SND_ROUTE_BOTH);
			
			Sf2mdtZ80BankAddress = (d & Sf2mdtNumZ80Banks) * 0x4000;
			ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + Sf2mdtZ80BankAddress);
			ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + Sf2mdtZ80BankAddress);
			return;
		}
		
		case 0xe400: {
			Sf2mdtSampleBuffer1 = d;
			return;
		}
		
		case 0xe800: {
			Sf2mdtSampleBuffer2 = d;
			return;
		}
		
		default: {
			bprintf(PRINT_NORMAL, _T("Z80 #1 Write => %04X, %02X\n"), a, d);
		}
	}
}
Пример #19
0
void __fastcall batriderZOut(UINT16 nAddress, UINT8 nValue)
{
	nAddress &= 0xFF;
    
	switch (nAddress) {
            
            // The 68000 expects to read back the sound command it sent
		case 0x40:
			RamShared[4] = nValue;
			break;
		case 0x42:
			RamShared[5] = nValue;
			break;
            
		case 0x44:								// ???
		case 0x46:								// Acknowledge interrupt
			break;
            
		case 0x80:
			BurnYM2151SelectRegister(nValue);
			break;
		case 0x81:
			BurnYM2151WriteRegister(nValue);
			break;
            
		case 0x82:
			MSM6295Command(0, nValue);
			break;
		case 0x84:
			MSM6295Command(1, nValue);
			break;
            
		case 0x88: {
			drvZ80Bankswitch(nValue);
			break;
            
		case 0xC0:
			MSM6295SampleInfo[0][0] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleData[0][0] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[0][1] = MSM6295ROM + ((nValue & 0xF0) << 12) + 0x0100;
			MSM6295SampleData[0][1] = MSM6295ROM + ((nValue & 0xF0) << 12);
			break;
		case 0xC2:
			MSM6295SampleInfo[0][2] = MSM6295ROM + ((nValue & 0x0F) << 16) + 0x0200;
			MSM6295SampleData[0][2] = MSM6295ROM + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[0][3] = MSM6295ROM + ((nValue & 0xF0) << 12) + 0x0300;
			MSM6295SampleData[0][3] = MSM6295ROM + ((nValue & 0xF0) << 12);
			break;
		case 0xC4:
			MSM6295SampleInfo[1][0] = MSM6295ROM + 0x0100000 + ((nValue & 0x0F) << 16);
			MSM6295SampleData[1][0] = MSM6295ROM + 0x0100000 + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[1][1] = MSM6295ROM + 0x0100000 + ((nValue & 0xF0) << 12) + 0x0100;
			MSM6295SampleData[1][1] = MSM6295ROM + 0x0100000 + ((nValue & 0xF0) << 12);
			break;
		case 0xC6:
			MSM6295SampleInfo[1][2] = MSM6295ROM + 0x0100000 + ((nValue & 0x0F) << 16) + 0x0200;
			MSM6295SampleData[1][2] = MSM6295ROM + 0x0100000 + ((nValue & 0x0F) << 16);
			MSM6295SampleInfo[1][3] = MSM6295ROM + 0x0100000 + ((nValue & 0xF0) << 12) + 0x0300;
			MSM6295SampleData[1][3] = MSM6295ROM + 0x0100000 + ((nValue & 0xF0) << 12);
			break;
		}
	}
}