Kill off ZetMemEnd
This commit is contained in:
parent
e32e3092dd
commit
08f7c8f2a8
File diff suppressed because it is too large
Load Diff
|
@ -154,7 +154,6 @@ INT32 FcrashSoundInit()
|
|||
ZetMapArea(0xd000, 0xd7ff, 0, FcrashZ80Ram );
|
||||
ZetMapArea(0xd000, 0xd7ff, 1, FcrashZ80Ram );
|
||||
ZetMapArea(0xd000, 0xd7ff, 2, FcrashZ80Ram );
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
BurnYM2203Init(2, 24000000 / 6, NULL, FcrashSynchroniseStream, FcrashGetTime, 0);
|
||||
|
|
|
@ -1,206 +1,205 @@
|
|||
#include "cps.h"
|
||||
#include "burn_ym2151.h"
|
||||
|
||||
// PSound - Z80
|
||||
static INT32 nPsndZBank = 0;
|
||||
static UINT8 *PsndZRam = NULL;
|
||||
|
||||
INT32 Kodb = 0;
|
||||
|
||||
// Map in the memory for the current 0zx8000-0xc000 bank
|
||||
static INT32 PsndZBankMap()
|
||||
{
|
||||
UINT8 *Bank;
|
||||
UINT32 nOff = (nPsndZBank << 14) + 0x8000;
|
||||
|
||||
if (nOff + 0x4000 > nCpsZRomLen) { // End of bank in out of range
|
||||
nOff = 0;
|
||||
}
|
||||
|
||||
Bank = CpsZRom + nOff;
|
||||
|
||||
// Read and fetch the bank
|
||||
ZetMapArea(0x8000, 0xBFFF, 0, Bank);
|
||||
ZetMapArea(0x8000, 0xBFFF, 2, Bank);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// PSound Z80 memory write
|
||||
void __fastcall PsndZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xF000:
|
||||
BurnYM2151SelectRegister(d);
|
||||
// bprintf(PRINT_NORMAL, "YM2151 select -> %02X\n", d);
|
||||
break;
|
||||
case 0xF001:
|
||||
BurnYM2151WriteRegister(d);
|
||||
// bprintf(PRINT_NORMAL, "YM2151 write -> %02X\n", d);
|
||||
break;
|
||||
case 0xF002:
|
||||
MSM6295Command(0, d);
|
||||
break;
|
||||
case 0xF004: {
|
||||
INT32 nNewBank = d & 0x0f;
|
||||
if (nPsndZBank != nNewBank) {
|
||||
nPsndZBank = nNewBank;
|
||||
PsndZBankMap();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0xF006: // ??? Enable interrupt ???
|
||||
break;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d);
|
||||
#endif
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void __fastcall kodbZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xE000:
|
||||
BurnYM2151SelectRegister(d);
|
||||
break;
|
||||
case 0xE001:
|
||||
BurnYM2151WriteRegister(d);
|
||||
break;
|
||||
case 0xE400:
|
||||
MSM6295Command(0, d);
|
||||
break;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d);
|
||||
#endif
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// PSound Z80 memory read
|
||||
UINT8 __fastcall PsndZRead(UINT16 a)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xF001:
|
||||
return BurnYM2151ReadStatus();
|
||||
case 0xF002:
|
||||
return MSM6295ReadStatus(0);
|
||||
case 0xF008:
|
||||
// bprintf(PRINT_NORMAL, " -- Sound latch read (%i).\n", PsndCode);
|
||||
return PsndCode;
|
||||
case 0xF00A:
|
||||
return PsndFade;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a);
|
||||
#endif
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT8 __fastcall kodbZRead(UINT16 a)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xE001:
|
||||
return BurnYM2151ReadStatus();
|
||||
case 0xE400:
|
||||
return MSM6295ReadStatus(0);
|
||||
case 0xE800:
|
||||
return PsndCode;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a);
|
||||
#endif
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 PsndZInit()
|
||||
{
|
||||
if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data
|
||||
return 1;
|
||||
}
|
||||
if (CpsZRom == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
PsndZRam = (UINT8 *)BurnMalloc(0x800);
|
||||
if (PsndZRam == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
|
||||
if (Kodb) {
|
||||
ZetSetReadHandler(kodbZRead);
|
||||
ZetSetWriteHandler(kodbZWrite);
|
||||
} else {
|
||||
ZetSetReadHandler(PsndZRead);
|
||||
ZetSetWriteHandler(PsndZWrite);
|
||||
}
|
||||
|
||||
// Read and fetch first 0x8000 of Rom
|
||||
ZetMapArea(0x0000,0x7fff,0,CpsZRom);
|
||||
ZetMapArea(0x0000,0x7fff,2,CpsZRom);
|
||||
|
||||
// Map first Bank of Rom to 0x8000-0xc000
|
||||
nPsndZBank=0;
|
||||
PsndZBankMap();
|
||||
|
||||
// Ram
|
||||
ZetMapArea(0xd000,0xd7ff,0,PsndZRam);
|
||||
ZetMapArea(0xd000,0xd7ff,1,PsndZRam);
|
||||
ZetMapArea(0xd000,0xd7ff,2,PsndZRam);
|
||||
|
||||
// Sound chip interfaces
|
||||
ZetMemCallback(0xf000,0xffff,0);
|
||||
ZetMemCallback(0xf000,0xffff,1);
|
||||
|
||||
// In case it tries to fetch other areas
|
||||
ZetMapArea(0xc000,0xcfff,2,CpsZRom);
|
||||
ZetMapArea(0xd800,0xffff,2,CpsZRom);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 PsndZExit()
|
||||
{
|
||||
BurnFree(PsndZRam);
|
||||
|
||||
ZetExit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Scan the current PSound z80 state
|
||||
INT32 PsndZScan(INT32 nAction)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
ZetScan(nAction);
|
||||
|
||||
MSM6295Scan(0, nAction);
|
||||
BurnYM2151Scan(nAction);
|
||||
|
||||
SCAN_VAR(nPsndZBank);
|
||||
|
||||
// Scan Ram
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.szName = "Z80 RAM";
|
||||
ba.Data = PsndZRam;
|
||||
ba.nLen = 0x800;
|
||||
BurnAcb(&ba);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include "cps.h"
|
||||
#include "burn_ym2151.h"
|
||||
|
||||
// PSound - Z80
|
||||
static INT32 nPsndZBank = 0;
|
||||
static UINT8 *PsndZRam = NULL;
|
||||
|
||||
INT32 Kodb = 0;
|
||||
|
||||
// Map in the memory for the current 0zx8000-0xc000 bank
|
||||
static INT32 PsndZBankMap()
|
||||
{
|
||||
UINT8 *Bank;
|
||||
UINT32 nOff = (nPsndZBank << 14) + 0x8000;
|
||||
|
||||
if (nOff + 0x4000 > nCpsZRomLen) { // End of bank in out of range
|
||||
nOff = 0;
|
||||
}
|
||||
|
||||
Bank = CpsZRom + nOff;
|
||||
|
||||
// Read and fetch the bank
|
||||
ZetMapArea(0x8000, 0xBFFF, 0, Bank);
|
||||
ZetMapArea(0x8000, 0xBFFF, 2, Bank);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// PSound Z80 memory write
|
||||
void __fastcall PsndZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xF000:
|
||||
BurnYM2151SelectRegister(d);
|
||||
// bprintf(PRINT_NORMAL, "YM2151 select -> %02X\n", d);
|
||||
break;
|
||||
case 0xF001:
|
||||
BurnYM2151WriteRegister(d);
|
||||
// bprintf(PRINT_NORMAL, "YM2151 write -> %02X\n", d);
|
||||
break;
|
||||
case 0xF002:
|
||||
MSM6295Command(0, d);
|
||||
break;
|
||||
case 0xF004: {
|
||||
INT32 nNewBank = d & 0x0f;
|
||||
if (nPsndZBank != nNewBank) {
|
||||
nPsndZBank = nNewBank;
|
||||
PsndZBankMap();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0xF006: // ??? Enable interrupt ???
|
||||
break;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d);
|
||||
#endif
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void __fastcall kodbZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xE000:
|
||||
BurnYM2151SelectRegister(d);
|
||||
break;
|
||||
case 0xE001:
|
||||
BurnYM2151WriteRegister(d);
|
||||
break;
|
||||
case 0xE400:
|
||||
MSM6295Command(0, d);
|
||||
break;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X -> %02X.\n"), a, d);
|
||||
#endif
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// PSound Z80 memory read
|
||||
UINT8 __fastcall PsndZRead(UINT16 a)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xF001:
|
||||
return BurnYM2151ReadStatus();
|
||||
case 0xF002:
|
||||
return MSM6295ReadStatus(0);
|
||||
case 0xF008:
|
||||
// bprintf(PRINT_NORMAL, " -- Sound latch read (%i).\n", PsndCode);
|
||||
return PsndCode;
|
||||
case 0xF00A:
|
||||
return PsndFade;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a);
|
||||
#endif
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT8 __fastcall kodbZRead(UINT16 a)
|
||||
{
|
||||
switch (a) {
|
||||
case 0xE001:
|
||||
return BurnYM2151ReadStatus();
|
||||
case 0xE400:
|
||||
return MSM6295ReadStatus(0);
|
||||
case 0xE800:
|
||||
return PsndCode;
|
||||
|
||||
#ifdef FBA_DEBUG
|
||||
// default:
|
||||
// bprintf(PRINT_NORMAL, _T("Z80 address %04X read.\n"), a);
|
||||
#endif
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 PsndZInit()
|
||||
{
|
||||
if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data
|
||||
return 1;
|
||||
}
|
||||
if (CpsZRom == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
PsndZRam = (UINT8 *)BurnMalloc(0x800);
|
||||
if (PsndZRam == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
|
||||
if (Kodb) {
|
||||
ZetSetReadHandler(kodbZRead);
|
||||
ZetSetWriteHandler(kodbZWrite);
|
||||
} else {
|
||||
ZetSetReadHandler(PsndZRead);
|
||||
ZetSetWriteHandler(PsndZWrite);
|
||||
}
|
||||
|
||||
// Read and fetch first 0x8000 of Rom
|
||||
ZetMapArea(0x0000,0x7fff,0,CpsZRom);
|
||||
ZetMapArea(0x0000,0x7fff,2,CpsZRom);
|
||||
|
||||
// Map first Bank of Rom to 0x8000-0xc000
|
||||
nPsndZBank=0;
|
||||
PsndZBankMap();
|
||||
|
||||
// Ram
|
||||
ZetMapArea(0xd000,0xd7ff,0,PsndZRam);
|
||||
ZetMapArea(0xd000,0xd7ff,1,PsndZRam);
|
||||
ZetMapArea(0xd000,0xd7ff,2,PsndZRam);
|
||||
|
||||
// Sound chip interfaces
|
||||
ZetMemCallback(0xf000,0xffff,0);
|
||||
ZetMemCallback(0xf000,0xffff,1);
|
||||
|
||||
// In case it tries to fetch other areas
|
||||
ZetMapArea(0xc000,0xcfff,2,CpsZRom);
|
||||
ZetMapArea(0xd800,0xffff,2,CpsZRom);
|
||||
ZetClose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 PsndZExit()
|
||||
{
|
||||
BurnFree(PsndZRam);
|
||||
|
||||
ZetExit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Scan the current PSound z80 state
|
||||
INT32 PsndZScan(INT32 nAction)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
ZetScan(nAction);
|
||||
|
||||
MSM6295Scan(0, nAction);
|
||||
BurnYM2151Scan(nAction);
|
||||
|
||||
SCAN_VAR(nPsndZBank);
|
||||
|
||||
// Scan Ram
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.szName = "Z80 RAM";
|
||||
ba.Data = PsndZRam;
|
||||
ba.nLen = 0x800;
|
||||
BurnAcb(&ba);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,141 +1,140 @@
|
|||
#include "cps.h"
|
||||
// QSound - Z80
|
||||
|
||||
static INT32 nQsndZBank = 0;
|
||||
|
||||
// Map in the memory for the current 0x8000-0xc000 music bank
|
||||
static INT32 QsndZBankMap()
|
||||
{
|
||||
UINT32 nOff;
|
||||
UINT8* Bank;
|
||||
nOff = nQsndZBank << 14;
|
||||
nOff += 0x8000;
|
||||
|
||||
if (Cps1Qs == 0) {
|
||||
if (nOff + 0x4000 > nCpsZRomLen) { // End of bank is out of range
|
||||
nOff = 0;
|
||||
}
|
||||
Bank = CpsZRom + nOff;
|
||||
} else {
|
||||
if (nOff + 0x4000 > (nCpsZRomLen / 2)) {
|
||||
nOff = 0;
|
||||
}
|
||||
Bank = CpsZRom - (nCpsZRomLen / 2) + nOff;
|
||||
}
|
||||
|
||||
// Read and fetch the bank
|
||||
ZetMapArea(0x8000, 0xbfff, 0, Bank);
|
||||
if (Cps1Qs == 0) {
|
||||
ZetMapArea(0x8000, 0xbfff, 2, Bank, CpsZRom + nOff);
|
||||
} else {
|
||||
ZetMapArea(0x8000, 0xbfff, 2, Bank);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT8 QscCmd[2] = {0, 0};
|
||||
|
||||
void __fastcall QsndZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
if (a == 0xd000) {
|
||||
QscCmd[0] = d;
|
||||
return;
|
||||
}
|
||||
if (a == 0xd001) {
|
||||
QscCmd[1] = d;
|
||||
return;
|
||||
}
|
||||
if (a == 0xd002) {
|
||||
QscWrite(d, (QscCmd[0] << 8) | QscCmd[1]);
|
||||
// bprintf(PRINT_NORMAL, _T("QSound command %02X %04X sent.\n"), d, (QscCmd[0] << 8) | QscCmd[1]);
|
||||
return;
|
||||
}
|
||||
if (a == 0xd003) {
|
||||
INT32 nNewBank = d & 0x0f;
|
||||
if (nQsndZBank != nNewBank) {
|
||||
nQsndZBank = nNewBank;
|
||||
QsndZBankMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall QsndZRead(UINT16 a)
|
||||
{
|
||||
if (a == 0xd007) { // return ready all the time
|
||||
return 0x80;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 QsndZInit()
|
||||
{
|
||||
if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data
|
||||
return 1;
|
||||
}
|
||||
if (CpsZRom == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
|
||||
ZetSetReadHandler(QsndZRead);
|
||||
ZetSetWriteHandler(QsndZWrite);
|
||||
|
||||
// Read and fetch first 0x8000 of Rom
|
||||
if (Cps1Qs) {
|
||||
ZetMapArea(0x0000, 0x7FFF, 0, CpsZRom - (nCpsZRomLen / 2));
|
||||
ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area
|
||||
} else {
|
||||
ZetMapArea(0x0000, 0x7FFF, 0 ,CpsZRom);
|
||||
ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom);
|
||||
}
|
||||
|
||||
// Map first Bank of Rom
|
||||
nQsndZBank = 0;
|
||||
QsndZBankMap();
|
||||
|
||||
ZetMapArea(0xC000, 0xCFFF, 0, CpsZRamC0);
|
||||
ZetMapArea(0xC000, 0xCFFF, 1, CpsZRamC0);
|
||||
ZetMapArea(0xC000, 0xCFFF, 2, CpsZRamC0);
|
||||
|
||||
ZetMemCallback(0xD000, 0xEFFF, 0);
|
||||
ZetMemCallback(0xD000, 0xEFFF, 1);
|
||||
|
||||
if (Cps1Qs) {
|
||||
ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area
|
||||
} else {
|
||||
ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom);
|
||||
}
|
||||
|
||||
ZetMapArea(0xF000, 0xFFFF, 0, CpsZRamF0);
|
||||
ZetMapArea(0xF000, 0xFFFF, 1, CpsZRamF0);
|
||||
ZetMapArea(0xF000, 0xFFFF, 2, CpsZRamF0);
|
||||
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 QsndZExit()
|
||||
{
|
||||
ZetExit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Scan the current QSound z80 state
|
||||
INT32 QsndZScan(INT32 nAction)
|
||||
{
|
||||
ZetScan(nAction); // Scan Z80
|
||||
SCAN_VAR(nQsndZBank);
|
||||
|
||||
if (nAction & ACB_WRITE) { // If write, bank could have changed
|
||||
ZetOpen(0);
|
||||
QsndZBankMap();
|
||||
ZetClose();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include "cps.h"
|
||||
// QSound - Z80
|
||||
|
||||
static INT32 nQsndZBank = 0;
|
||||
|
||||
// Map in the memory for the current 0x8000-0xc000 music bank
|
||||
static INT32 QsndZBankMap()
|
||||
{
|
||||
UINT32 nOff;
|
||||
UINT8* Bank;
|
||||
nOff = nQsndZBank << 14;
|
||||
nOff += 0x8000;
|
||||
|
||||
if (Cps1Qs == 0) {
|
||||
if (nOff + 0x4000 > nCpsZRomLen) { // End of bank is out of range
|
||||
nOff = 0;
|
||||
}
|
||||
Bank = CpsZRom + nOff;
|
||||
} else {
|
||||
if (nOff + 0x4000 > (nCpsZRomLen / 2)) {
|
||||
nOff = 0;
|
||||
}
|
||||
Bank = CpsZRom - (nCpsZRomLen / 2) + nOff;
|
||||
}
|
||||
|
||||
// Read and fetch the bank
|
||||
ZetMapArea(0x8000, 0xbfff, 0, Bank);
|
||||
if (Cps1Qs == 0) {
|
||||
ZetMapArea(0x8000, 0xbfff, 2, Bank, CpsZRom + nOff);
|
||||
} else {
|
||||
ZetMapArea(0x8000, 0xbfff, 2, Bank);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT8 QscCmd[2] = {0, 0};
|
||||
|
||||
void __fastcall QsndZWrite(UINT16 a, UINT8 d)
|
||||
{
|
||||
if (a == 0xd000) {
|
||||
QscCmd[0] = d;
|
||||
return;
|
||||
}
|
||||
if (a == 0xd001) {
|
||||
QscCmd[1] = d;
|
||||
return;
|
||||
}
|
||||
if (a == 0xd002) {
|
||||
QscWrite(d, (QscCmd[0] << 8) | QscCmd[1]);
|
||||
// bprintf(PRINT_NORMAL, _T("QSound command %02X %04X sent.\n"), d, (QscCmd[0] << 8) | QscCmd[1]);
|
||||
return;
|
||||
}
|
||||
if (a == 0xd003) {
|
||||
INT32 nNewBank = d & 0x0f;
|
||||
if (nQsndZBank != nNewBank) {
|
||||
nQsndZBank = nNewBank;
|
||||
QsndZBankMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall QsndZRead(UINT16 a)
|
||||
{
|
||||
if (a == 0xd007) { // return ready all the time
|
||||
return 0x80;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 QsndZInit()
|
||||
{
|
||||
if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data
|
||||
return 1;
|
||||
}
|
||||
if (CpsZRom == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
|
||||
ZetSetReadHandler(QsndZRead);
|
||||
ZetSetWriteHandler(QsndZWrite);
|
||||
|
||||
// Read and fetch first 0x8000 of Rom
|
||||
if (Cps1Qs) {
|
||||
ZetMapArea(0x0000, 0x7FFF, 0, CpsZRom - (nCpsZRomLen / 2));
|
||||
ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area
|
||||
} else {
|
||||
ZetMapArea(0x0000, 0x7FFF, 0 ,CpsZRom);
|
||||
ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom);
|
||||
}
|
||||
|
||||
// Map first Bank of Rom
|
||||
nQsndZBank = 0;
|
||||
QsndZBankMap();
|
||||
|
||||
ZetMapArea(0xC000, 0xCFFF, 0, CpsZRamC0);
|
||||
ZetMapArea(0xC000, 0xCFFF, 1, CpsZRamC0);
|
||||
ZetMapArea(0xC000, 0xCFFF, 2, CpsZRamC0);
|
||||
|
||||
ZetMemCallback(0xD000, 0xEFFF, 0);
|
||||
ZetMemCallback(0xD000, 0xEFFF, 1);
|
||||
|
||||
if (Cps1Qs) {
|
||||
ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area
|
||||
} else {
|
||||
ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom);
|
||||
}
|
||||
|
||||
ZetMapArea(0xF000, 0xFFFF, 0, CpsZRamF0);
|
||||
ZetMapArea(0xF000, 0xFFFF, 1, CpsZRamF0);
|
||||
ZetMapArea(0xF000, 0xFFFF, 2, CpsZRamF0);
|
||||
|
||||
ZetClose();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT32 QsndZExit()
|
||||
{
|
||||
ZetExit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Scan the current QSound z80 state
|
||||
INT32 QsndZScan(INT32 nAction)
|
||||
{
|
||||
ZetScan(nAction); // Scan Z80
|
||||
SCAN_VAR(nQsndZBank);
|
||||
|
||||
if (nAction & ACB_WRITE) { // If write, bank could have changed
|
||||
ZetOpen(0);
|
||||
QsndZBankMap();
|
||||
ZetClose();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -129,7 +129,6 @@ INT32 Sf2mdtSoundInit()
|
|||
ZetMapArea(0xd000, 0xd7ff, 0, Sf2mdtZ80Ram );
|
||||
ZetMapArea(0xd000, 0xd7ff, 1, Sf2mdtZ80Ram );
|
||||
ZetMapArea(0xd000, 0xd7ff, 2, Sf2mdtZ80Ram );
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
BurnYM2151Init(3579540);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -212,7 +212,6 @@ static INT32 DrvInit()
|
|||
ZetSetWriteHandler(kontest_write);
|
||||
ZetSetOutHandler(kontest_write_port);
|
||||
ZetSetInHandler(kontest_read_port);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
SN76489AInit(0, 1500000, 0);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,399 +1,398 @@
|
|||
// FB Alpha Mogura Desse driver module
|
||||
// Based on MAME driver by David Haywood
|
||||
|
||||
#include "tiles_generic.h"
|
||||
#include "z80_intf.h"
|
||||
#include "dac.h"
|
||||
|
||||
static UINT8 *AllMem;
|
||||
static UINT8 *MemEnd;
|
||||
static UINT8 *AllRam;
|
||||
static UINT8 *RamEnd;
|
||||
static UINT8 *DrvZ80ROM;
|
||||
static UINT8 *DrvColPROM;
|
||||
static UINT8 *DrvZ80RAM;
|
||||
static UINT8 *DrvGfxRAM;
|
||||
static UINT8 *DrvVidRAM;
|
||||
static UINT8 *DrvGfxROM;
|
||||
|
||||
static UINT32 *DrvPalette;
|
||||
static UINT8 DrvRecalc;
|
||||
|
||||
static UINT8 DrvJoy1[8] = {0, };
|
||||
static UINT8 DrvJoy2[8] = {0, };
|
||||
static UINT8 DrvJoy3[8] = {0, };
|
||||
static UINT8 DrvJoy4[8] = {0, };
|
||||
static UINT8 DrvJoy5[8] = {0, };
|
||||
static UINT8 DrvDiag[1] = { 0 };
|
||||
static UINT8 DrvReset;
|
||||
static UINT8 DrvInputs[6] = {0, };
|
||||
|
||||
static struct BurnInputInfo MoguraInputList[] = {
|
||||
{"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" },
|
||||
{"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" },
|
||||
{"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" },
|
||||
{"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" },
|
||||
{"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" },
|
||||
{"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" },
|
||||
{"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" },
|
||||
{"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" },
|
||||
{"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" },
|
||||
|
||||
{"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" },
|
||||
{"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" },
|
||||
{"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" },
|
||||
{"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" },
|
||||
{"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" },
|
||||
{"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" },
|
||||
{"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" },
|
||||
{"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" },
|
||||
{"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" },
|
||||
|
||||
{"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" },
|
||||
{"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start" },
|
||||
{"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" },
|
||||
{"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" },
|
||||
{"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" },
|
||||
{"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" },
|
||||
{"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" },
|
||||
{"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" },
|
||||
{"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3" },
|
||||
|
||||
{"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" },
|
||||
{"P4 Start", BIT_DIGITAL, DrvJoy5 + 7, "p4 start" },
|
||||
{"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up" },
|
||||
{"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down" },
|
||||
{"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left" },
|
||||
{"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right" },
|
||||
{"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1" },
|
||||
{"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2" },
|
||||
{"P4 Button 3", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 3" },
|
||||
|
||||
{"Reset", BIT_DIGITAL, &DrvReset, "reset" },
|
||||
{"Diagnostics", BIT_DIGITAL, DrvDiag + 0, "diag" },
|
||||
{"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" },
|
||||
{"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service2" },
|
||||
{"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service3" },
|
||||
{"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Mogura)
|
||||
|
||||
inline void MoguraClearOpposites(UINT8* nJoystickInputs)
|
||||
{
|
||||
if ((*nJoystickInputs & 0x03) == 0x03) {
|
||||
*nJoystickInputs &= ~0x03;
|
||||
}
|
||||
if ((*nJoystickInputs & 0x0c) == 0x0c) {
|
||||
*nJoystickInputs &= ~0x0c;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void DrvTileDecode(INT32 offset, INT32 data)
|
||||
{
|
||||
UINT8 *tile = DrvGfxROM + (offset << 2);
|
||||
|
||||
tile[0] = (data >> 6) & 3;
|
||||
tile[1] = (data >> 4) & 3;
|
||||
tile[2] = (data >> 2) & 3;
|
||||
tile[3] = (data >> 0) & 3;
|
||||
}
|
||||
|
||||
void __fastcall mogura_write(UINT16 address, UINT8 data)
|
||||
{
|
||||
if ((address & 0xf000) == 0xe000) {
|
||||
DrvGfxRAM[address & 0xfff] = data;
|
||||
DrvTileDecode(address & 0xfff, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall mogura_write_port(UINT16 port, UINT8 data)
|
||||
{
|
||||
switch (port & 0xff)
|
||||
{
|
||||
case 0x14:
|
||||
DACWrite(0, (data & 0xf0));
|
||||
DACWrite(1, (data & 0x0f) << 4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall mogura_read_port(UINT16 port)
|
||||
{
|
||||
switch (port & 0xff)
|
||||
{
|
||||
case 0x08:
|
||||
return DrvInputs[0];
|
||||
|
||||
case 0x0c:
|
||||
return ~DrvInputs[1];
|
||||
|
||||
case 0x0d:
|
||||
return ~DrvInputs[2];
|
||||
|
||||
case 0x0e:
|
||||
return ~DrvInputs[3];
|
||||
|
||||
case 0x0f:
|
||||
return ~DrvInputs[4];
|
||||
|
||||
case 0x10:
|
||||
return ~DrvInputs[5];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void DrvPaletteInit()
|
||||
{
|
||||
for (INT32 i = 0; i < 0x20; i++)
|
||||
{
|
||||
INT32 bit0,bit1,bit2,r,g,b;
|
||||
|
||||
bit0 = (DrvColPROM[i] >> 0) & 0x01;
|
||||
bit1 = (DrvColPROM[i] >> 1) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 2) & 0x01;
|
||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (DrvColPROM[i] >> 3) & 0x01;
|
||||
bit1 = (DrvColPROM[i] >> 4) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 5) & 0x01;
|
||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = 0;
|
||||
bit1 = (DrvColPROM[i] >> 6) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 7) & 0x01;
|
||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
DrvPalette[((i & 7) << 2) | ((i >> 3) & 3)] = BurnHighCol(r, g, b, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 moguraDACSync()
|
||||
{
|
||||
return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3000000.0000 / (nBurnFPS / 100.0000))));
|
||||
}
|
||||
|
||||
static INT32 DrvDoReset()
|
||||
{
|
||||
memset (AllRam, 0, RamEnd - AllRam);
|
||||
|
||||
ZetOpen(0);
|
||||
ZetReset();
|
||||
ZetClose();
|
||||
|
||||
DACReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 MemIndex()
|
||||
{
|
||||
UINT8 *Next; Next = AllMem;
|
||||
|
||||
DrvZ80ROM = Next; Next += 0x008000;
|
||||
DrvColPROM = Next; Next += 0x000020;
|
||||
|
||||
DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32);
|
||||
|
||||
AllRam = Next;
|
||||
|
||||
DrvGfxROM = Next; Next += 0x004000;
|
||||
DrvGfxRAM = Next; Next += 0x001000;
|
||||
|
||||
DrvVidRAM = Next; Next += 0x001000;
|
||||
|
||||
DrvZ80RAM = Next; Next += 0x002000;
|
||||
|
||||
RamEnd = Next;
|
||||
|
||||
MemEnd = Next;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvInit()
|
||||
{
|
||||
AllMem = NULL;
|
||||
MemIndex();
|
||||
INT32 nLen = MemEnd - (UINT8 *)0;
|
||||
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
|
||||
memset(AllMem, 0, nLen);
|
||||
MemIndex();
|
||||
|
||||
{
|
||||
if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1;
|
||||
|
||||
if (BurnLoadRom(DrvColPROM, 1, 1)) return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);
|
||||
ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);
|
||||
ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM);
|
||||
ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM);
|
||||
ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM);
|
||||
ZetMapArea(0xe000, 0xefff, 0, DrvGfxRAM);
|
||||
// ZetMapArea(0xe000, 0xefff, 1, DrvGfxRAM);
|
||||
ZetMapArea(0xe000, 0xefff, 2, DrvGfxRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 0, DrvVidRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 1, DrvVidRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 2, DrvVidRAM);
|
||||
ZetSetWriteHandler(mogura_write);
|
||||
ZetSetOutHandler(mogura_write_port);
|
||||
ZetSetInHandler(mogura_read_port);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
DACInit(0, 0, 0, moguraDACSync);
|
||||
DACInit(1, 0, 0, moguraDACSync);
|
||||
DACSetRoute(0, 0.50, BURN_SND_ROUTE_LEFT);
|
||||
DACSetRoute(1, 0.50, BURN_SND_ROUTE_RIGHT);
|
||||
|
||||
GenericTilesInit();
|
||||
|
||||
DrvDoReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvExit()
|
||||
{
|
||||
GenericTilesExit();
|
||||
|
||||
ZetExit();
|
||||
DACExit();
|
||||
|
||||
BurnFree (AllMem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void draw_background()
|
||||
{
|
||||
for (INT32 offs = 0; offs < 64 * 32; offs++)
|
||||
{
|
||||
INT32 sx = ((offs ^ 0x20) & 0x3f) << 3;
|
||||
INT32 sy = (offs >> 6) << 3;
|
||||
|
||||
if (sx >= 256) sx ^= 128;
|
||||
if (sx >= 320) continue;
|
||||
|
||||
INT32 code = DrvVidRAM[offs];
|
||||
INT32 color = (DrvVidRAM[offs + 0x800] >> 1) & 7;
|
||||
|
||||
Render8x8Tile(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM);
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 DrvDraw()
|
||||
{
|
||||
if (DrvRecalc) {
|
||||
DrvPaletteInit();
|
||||
DrvRecalc = 0;
|
||||
}
|
||||
|
||||
draw_background();
|
||||
|
||||
BurnTransferCopy(DrvPalette);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvFrame()
|
||||
{
|
||||
if (DrvReset) {
|
||||
DrvDoReset();
|
||||
}
|
||||
|
||||
ZetNewFrame();
|
||||
|
||||
{
|
||||
DrvInputs[0] = 0xff;
|
||||
DrvInputs[1] = 0x00;
|
||||
DrvInputs[2] = 0x00;
|
||||
DrvInputs[3] = 0x00;
|
||||
DrvInputs[4] = 0x00;
|
||||
|
||||
for (INT32 i = 0; i < 8; i++) {
|
||||
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
|
||||
DrvInputs[1] |= (DrvJoy2[i] & 1) << i;
|
||||
DrvInputs[2] |= (DrvJoy3[i] & 1) << i;
|
||||
DrvInputs[3] |= (DrvJoy4[i] & 1) << i;
|
||||
DrvInputs[4] |= (DrvJoy5[i] & 1) << i;
|
||||
}
|
||||
|
||||
DrvInputs[5] = DrvDiag[0] & 1;
|
||||
}
|
||||
|
||||
// Clear Opposites
|
||||
MoguraClearOpposites(&DrvInputs[1]);
|
||||
MoguraClearOpposites(&DrvInputs[2]);
|
||||
MoguraClearOpposites(&DrvInputs[3]);
|
||||
MoguraClearOpposites(&DrvInputs[4]);
|
||||
|
||||
ZetOpen(0);
|
||||
ZetRun(3000000 / 60);
|
||||
ZetRaiseIrq(0);
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
DACUpdate(pBurnSoundOut, nBurnSoundLen);
|
||||
}
|
||||
|
||||
ZetClose();
|
||||
|
||||
if (pBurnDraw) {
|
||||
DrvDraw();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
|
||||
if (pnMin != NULL) {
|
||||
*pnMin = 0x029698;
|
||||
}
|
||||
|
||||
if (nAction & ACB_MEMORY_RAM) {
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.Data = AllRam;
|
||||
ba.nLen = RamEnd-AllRam;
|
||||
ba.szName = "All Ram";
|
||||
BurnAcb(&ba);
|
||||
}
|
||||
|
||||
if (nAction & ACB_DRIVER_DATA) {
|
||||
ZetScan(nAction);
|
||||
|
||||
DACScan(nAction, pnMin);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Mogura Desse
|
||||
|
||||
static struct BurnRomInfo moguraRomDesc[] = {
|
||||
{ "gx141.5n", 0x8000, 0x98e6120d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code
|
||||
|
||||
{ "gx141.7j", 0x0020, 0xb21c5d5f, 2 | BRF_GRA }, // 1 Color Prom
|
||||
};
|
||||
|
||||
STD_ROM_PICK(mogura)
|
||||
STD_ROM_FN(mogura)
|
||||
|
||||
struct BurnDriver BurnDrvMogura = {
|
||||
"mogura", NULL, NULL, NULL, "1991",
|
||||
"Mogura Desse\0", "Konami test board", "Konami", "Miscellaneous",
|
||||
L"\u30E2\u30B0\u30E9\u30C7\u30C3\u30BB\0Mogura Desse\0", NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0,
|
||||
NULL, moguraRomInfo, moguraRomName, NULL, NULL, MoguraInputInfo, NULL,
|
||||
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20,
|
||||
320, 256, 4, 3
|
||||
};
|
||||
// FB Alpha Mogura Desse driver module
|
||||
// Based on MAME driver by David Haywood
|
||||
|
||||
#include "tiles_generic.h"
|
||||
#include "z80_intf.h"
|
||||
#include "dac.h"
|
||||
|
||||
static UINT8 *AllMem;
|
||||
static UINT8 *MemEnd;
|
||||
static UINT8 *AllRam;
|
||||
static UINT8 *RamEnd;
|
||||
static UINT8 *DrvZ80ROM;
|
||||
static UINT8 *DrvColPROM;
|
||||
static UINT8 *DrvZ80RAM;
|
||||
static UINT8 *DrvGfxRAM;
|
||||
static UINT8 *DrvVidRAM;
|
||||
static UINT8 *DrvGfxROM;
|
||||
|
||||
static UINT32 *DrvPalette;
|
||||
static UINT8 DrvRecalc;
|
||||
|
||||
static UINT8 DrvJoy1[8] = {0, };
|
||||
static UINT8 DrvJoy2[8] = {0, };
|
||||
static UINT8 DrvJoy3[8] = {0, };
|
||||
static UINT8 DrvJoy4[8] = {0, };
|
||||
static UINT8 DrvJoy5[8] = {0, };
|
||||
static UINT8 DrvDiag[1] = { 0 };
|
||||
static UINT8 DrvReset;
|
||||
static UINT8 DrvInputs[6] = {0, };
|
||||
|
||||
static struct BurnInputInfo MoguraInputList[] = {
|
||||
{"P1 Coin", BIT_DIGITAL, DrvJoy1 + 0, "p1 coin" },
|
||||
{"P1 Start", BIT_DIGITAL, DrvJoy2 + 7, "p1 start" },
|
||||
{"P1 Up", BIT_DIGITAL, DrvJoy2 + 2, "p1 up" },
|
||||
{"P1 Down", BIT_DIGITAL, DrvJoy2 + 3, "p1 down" },
|
||||
{"P1 Left", BIT_DIGITAL, DrvJoy2 + 0, "p1 left" },
|
||||
{"P1 Right", BIT_DIGITAL, DrvJoy2 + 1, "p1 right" },
|
||||
{"P1 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p1 fire 1" },
|
||||
{"P1 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p1 fire 2" },
|
||||
{"P1 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p1 fire 3" },
|
||||
|
||||
{"P2 Coin", BIT_DIGITAL, DrvJoy1 + 1, "p2 coin" },
|
||||
{"P2 Start", BIT_DIGITAL, DrvJoy3 + 7, "p2 start" },
|
||||
{"P2 Up", BIT_DIGITAL, DrvJoy3 + 2, "p2 up" },
|
||||
{"P2 Down", BIT_DIGITAL, DrvJoy3 + 3, "p2 down" },
|
||||
{"P2 Left", BIT_DIGITAL, DrvJoy3 + 0, "p2 left" },
|
||||
{"P2 Right", BIT_DIGITAL, DrvJoy3 + 1, "p2 right" },
|
||||
{"P2 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p2 fire 1" },
|
||||
{"P2 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p2 fire 2" },
|
||||
{"P2 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p2 fire 3" },
|
||||
|
||||
{"P3 Coin", BIT_DIGITAL, DrvJoy1 + 2, "p3 coin" },
|
||||
{"P3 Start", BIT_DIGITAL, DrvJoy4 + 7, "p3 start" },
|
||||
{"P3 Up", BIT_DIGITAL, DrvJoy4 + 2, "p3 up" },
|
||||
{"P3 Down", BIT_DIGITAL, DrvJoy4 + 3, "p3 down" },
|
||||
{"P3 Left", BIT_DIGITAL, DrvJoy4 + 0, "p3 left" },
|
||||
{"P3 Right", BIT_DIGITAL, DrvJoy4 + 1, "p3 right" },
|
||||
{"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p3 fire 1" },
|
||||
{"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p3 fire 2" },
|
||||
{"P3 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 3" },
|
||||
|
||||
{"P4 Coin", BIT_DIGITAL, DrvJoy1 + 3, "p4 coin" },
|
||||
{"P4 Start", BIT_DIGITAL, DrvJoy5 + 7, "p4 start" },
|
||||
{"P4 Up", BIT_DIGITAL, DrvJoy5 + 2, "p4 up" },
|
||||
{"P4 Down", BIT_DIGITAL, DrvJoy5 + 3, "p4 down" },
|
||||
{"P4 Left", BIT_DIGITAL, DrvJoy5 + 0, "p4 left" },
|
||||
{"P4 Right", BIT_DIGITAL, DrvJoy5 + 1, "p4 right" },
|
||||
{"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 4, "p4 fire 1" },
|
||||
{"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 5, "p4 fire 2" },
|
||||
{"P4 Button 3", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 3" },
|
||||
|
||||
{"Reset", BIT_DIGITAL, &DrvReset, "reset" },
|
||||
{"Diagnostics", BIT_DIGITAL, DrvDiag + 0, "diag" },
|
||||
{"Service 1", BIT_DIGITAL, DrvJoy1 + 4, "service" },
|
||||
{"Service 2", BIT_DIGITAL, DrvJoy1 + 5, "service2" },
|
||||
{"Service 3", BIT_DIGITAL, DrvJoy1 + 6, "service3" },
|
||||
{"Service 4", BIT_DIGITAL, DrvJoy1 + 7, "service4" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Mogura)
|
||||
|
||||
inline void MoguraClearOpposites(UINT8* nJoystickInputs)
|
||||
{
|
||||
if ((*nJoystickInputs & 0x03) == 0x03) {
|
||||
*nJoystickInputs &= ~0x03;
|
||||
}
|
||||
if ((*nJoystickInputs & 0x0c) == 0x0c) {
|
||||
*nJoystickInputs &= ~0x0c;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void DrvTileDecode(INT32 offset, INT32 data)
|
||||
{
|
||||
UINT8 *tile = DrvGfxROM + (offset << 2);
|
||||
|
||||
tile[0] = (data >> 6) & 3;
|
||||
tile[1] = (data >> 4) & 3;
|
||||
tile[2] = (data >> 2) & 3;
|
||||
tile[3] = (data >> 0) & 3;
|
||||
}
|
||||
|
||||
void __fastcall mogura_write(UINT16 address, UINT8 data)
|
||||
{
|
||||
if ((address & 0xf000) == 0xe000) {
|
||||
DrvGfxRAM[address & 0xfff] = data;
|
||||
DrvTileDecode(address & 0xfff, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall mogura_write_port(UINT16 port, UINT8 data)
|
||||
{
|
||||
switch (port & 0xff)
|
||||
{
|
||||
case 0x14:
|
||||
DACWrite(0, (data & 0xf0));
|
||||
DACWrite(1, (data & 0x0f) << 4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall mogura_read_port(UINT16 port)
|
||||
{
|
||||
switch (port & 0xff)
|
||||
{
|
||||
case 0x08:
|
||||
return DrvInputs[0];
|
||||
|
||||
case 0x0c:
|
||||
return ~DrvInputs[1];
|
||||
|
||||
case 0x0d:
|
||||
return ~DrvInputs[2];
|
||||
|
||||
case 0x0e:
|
||||
return ~DrvInputs[3];
|
||||
|
||||
case 0x0f:
|
||||
return ~DrvInputs[4];
|
||||
|
||||
case 0x10:
|
||||
return ~DrvInputs[5];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void DrvPaletteInit()
|
||||
{
|
||||
for (INT32 i = 0; i < 0x20; i++)
|
||||
{
|
||||
INT32 bit0,bit1,bit2,r,g,b;
|
||||
|
||||
bit0 = (DrvColPROM[i] >> 0) & 0x01;
|
||||
bit1 = (DrvColPROM[i] >> 1) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 2) & 0x01;
|
||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (DrvColPROM[i] >> 3) & 0x01;
|
||||
bit1 = (DrvColPROM[i] >> 4) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 5) & 0x01;
|
||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = 0;
|
||||
bit1 = (DrvColPROM[i] >> 6) & 0x01;
|
||||
bit2 = (DrvColPROM[i] >> 7) & 0x01;
|
||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
DrvPalette[((i & 7) << 2) | ((i >> 3) & 3)] = BurnHighCol(r, g, b, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 moguraDACSync()
|
||||
{
|
||||
return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3000000.0000 / (nBurnFPS / 100.0000))));
|
||||
}
|
||||
|
||||
static INT32 DrvDoReset()
|
||||
{
|
||||
memset (AllRam, 0, RamEnd - AllRam);
|
||||
|
||||
ZetOpen(0);
|
||||
ZetReset();
|
||||
ZetClose();
|
||||
|
||||
DACReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 MemIndex()
|
||||
{
|
||||
UINT8 *Next; Next = AllMem;
|
||||
|
||||
DrvZ80ROM = Next; Next += 0x008000;
|
||||
DrvColPROM = Next; Next += 0x000020;
|
||||
|
||||
DrvPalette = (UINT32*)Next; Next += 0x0020 * sizeof(UINT32);
|
||||
|
||||
AllRam = Next;
|
||||
|
||||
DrvGfxROM = Next; Next += 0x004000;
|
||||
DrvGfxRAM = Next; Next += 0x001000;
|
||||
|
||||
DrvVidRAM = Next; Next += 0x001000;
|
||||
|
||||
DrvZ80RAM = Next; Next += 0x002000;
|
||||
|
||||
RamEnd = Next;
|
||||
|
||||
MemEnd = Next;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvInit()
|
||||
{
|
||||
AllMem = NULL;
|
||||
MemIndex();
|
||||
INT32 nLen = MemEnd - (UINT8 *)0;
|
||||
if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
|
||||
memset(AllMem, 0, nLen);
|
||||
MemIndex();
|
||||
|
||||
{
|
||||
if (BurnLoadRom(DrvZ80ROM, 0, 1)) return 1;
|
||||
|
||||
if (BurnLoadRom(DrvColPROM, 1, 1)) return 1;
|
||||
}
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);
|
||||
ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);
|
||||
ZetMapArea(0xc000, 0xdfff, 0, DrvZ80RAM);
|
||||
ZetMapArea(0xc000, 0xdfff, 1, DrvZ80RAM);
|
||||
ZetMapArea(0xc000, 0xdfff, 2, DrvZ80RAM);
|
||||
ZetMapArea(0xe000, 0xefff, 0, DrvGfxRAM);
|
||||
// ZetMapArea(0xe000, 0xefff, 1, DrvGfxRAM);
|
||||
ZetMapArea(0xe000, 0xefff, 2, DrvGfxRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 0, DrvVidRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 1, DrvVidRAM);
|
||||
ZetMapArea(0xf000, 0xffff, 2, DrvVidRAM);
|
||||
ZetSetWriteHandler(mogura_write);
|
||||
ZetSetOutHandler(mogura_write_port);
|
||||
ZetSetInHandler(mogura_read_port);
|
||||
ZetClose();
|
||||
|
||||
DACInit(0, 0, 0, moguraDACSync);
|
||||
DACInit(1, 0, 0, moguraDACSync);
|
||||
DACSetRoute(0, 0.50, BURN_SND_ROUTE_LEFT);
|
||||
DACSetRoute(1, 0.50, BURN_SND_ROUTE_RIGHT);
|
||||
|
||||
GenericTilesInit();
|
||||
|
||||
DrvDoReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvExit()
|
||||
{
|
||||
GenericTilesExit();
|
||||
|
||||
ZetExit();
|
||||
DACExit();
|
||||
|
||||
BurnFree (AllMem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void draw_background()
|
||||
{
|
||||
for (INT32 offs = 0; offs < 64 * 32; offs++)
|
||||
{
|
||||
INT32 sx = ((offs ^ 0x20) & 0x3f) << 3;
|
||||
INT32 sy = (offs >> 6) << 3;
|
||||
|
||||
if (sx >= 256) sx ^= 128;
|
||||
if (sx >= 320) continue;
|
||||
|
||||
INT32 code = DrvVidRAM[offs];
|
||||
INT32 color = (DrvVidRAM[offs + 0x800] >> 1) & 7;
|
||||
|
||||
Render8x8Tile(pTransDraw, code, sx, sy, color, 2, 0, DrvGfxROM);
|
||||
}
|
||||
}
|
||||
|
||||
static INT32 DrvDraw()
|
||||
{
|
||||
if (DrvRecalc) {
|
||||
DrvPaletteInit();
|
||||
DrvRecalc = 0;
|
||||
}
|
||||
|
||||
draw_background();
|
||||
|
||||
BurnTransferCopy(DrvPalette);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvFrame()
|
||||
{
|
||||
if (DrvReset) {
|
||||
DrvDoReset();
|
||||
}
|
||||
|
||||
ZetNewFrame();
|
||||
|
||||
{
|
||||
DrvInputs[0] = 0xff;
|
||||
DrvInputs[1] = 0x00;
|
||||
DrvInputs[2] = 0x00;
|
||||
DrvInputs[3] = 0x00;
|
||||
DrvInputs[4] = 0x00;
|
||||
|
||||
for (INT32 i = 0; i < 8; i++) {
|
||||
DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
|
||||
DrvInputs[1] |= (DrvJoy2[i] & 1) << i;
|
||||
DrvInputs[2] |= (DrvJoy3[i] & 1) << i;
|
||||
DrvInputs[3] |= (DrvJoy4[i] & 1) << i;
|
||||
DrvInputs[4] |= (DrvJoy5[i] & 1) << i;
|
||||
}
|
||||
|
||||
DrvInputs[5] = DrvDiag[0] & 1;
|
||||
}
|
||||
|
||||
// Clear Opposites
|
||||
MoguraClearOpposites(&DrvInputs[1]);
|
||||
MoguraClearOpposites(&DrvInputs[2]);
|
||||
MoguraClearOpposites(&DrvInputs[3]);
|
||||
MoguraClearOpposites(&DrvInputs[4]);
|
||||
|
||||
ZetOpen(0);
|
||||
ZetRun(3000000 / 60);
|
||||
ZetRaiseIrq(0);
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
DACUpdate(pBurnSoundOut, nBurnSoundLen);
|
||||
}
|
||||
|
||||
ZetClose();
|
||||
|
||||
if (pBurnDraw) {
|
||||
DrvDraw();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
|
||||
if (pnMin != NULL) {
|
||||
*pnMin = 0x029698;
|
||||
}
|
||||
|
||||
if (nAction & ACB_MEMORY_RAM) {
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.Data = AllRam;
|
||||
ba.nLen = RamEnd-AllRam;
|
||||
ba.szName = "All Ram";
|
||||
BurnAcb(&ba);
|
||||
}
|
||||
|
||||
if (nAction & ACB_DRIVER_DATA) {
|
||||
ZetScan(nAction);
|
||||
|
||||
DACScan(nAction, pnMin);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Mogura Desse
|
||||
|
||||
static struct BurnRomInfo moguraRomDesc[] = {
|
||||
{ "gx141.5n", 0x8000, 0x98e6120d, 1 | BRF_PRG | BRF_ESS }, // 0 Z80 Code
|
||||
|
||||
{ "gx141.7j", 0x0020, 0xb21c5d5f, 2 | BRF_GRA }, // 1 Color Prom
|
||||
};
|
||||
|
||||
STD_ROM_PICK(mogura)
|
||||
STD_ROM_FN(mogura)
|
||||
|
||||
struct BurnDriver BurnDrvMogura = {
|
||||
"mogura", NULL, NULL, NULL, "1991",
|
||||
"Mogura Desse\0", "Konami test board", "Konami", "Miscellaneous",
|
||||
L"\u30E2\u30B0\u30E9\u30C7\u30C3\u30BB\0Mogura Desse\0", NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING, 4, HARDWARE_PREFIX_KONAMI, GBF_MISC, 0,
|
||||
NULL, moguraRomInfo, moguraRomName, NULL, NULL, MoguraInputInfo, NULL,
|
||||
DrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x20,
|
||||
320, 256, 4, 3
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -335,7 +335,6 @@ static INT32 DrvInit(INT32 game, INT32 sbit)
|
|||
ZetSetOutHandler(enraya4_out_port);
|
||||
ZetSetInHandler(enraya4_in_port);
|
||||
ZetSetWriteHandler(enraya4_write);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
AY8910Init(0, 2000000, nBurnSoundRate, NULL, NULL, NULL, NULL);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -580,7 +580,6 @@ static INT32 DrvInit()
|
|||
ZetMapArea(0x8000, 0x9fff, 2, DrvZ80RAM);
|
||||
ZetSetWriteHandler(cybertnk_sound_write);
|
||||
ZetSetReadHandler(cybertnk_sound_read);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
BurnY8950Init(2, 3579545, DrvSndROM0, 0x40000, DrvSndROM1, 0x80000, NULL, &DrvSynchroniseStream, 0);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1310,7 +1310,6 @@ static INT32 DrvInit(INT32 (*pRomLoadCallback)(), void (*pPaletteUpdate)(), UINT
|
|||
|
||||
ZetSetWriteHandler(dkong_main_write);
|
||||
ZetSetReadHandler(dkong_main_read);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
I8039Init(NULL);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -482,7 +482,6 @@ static INT32 DrvInit()
|
|||
ZetMapArea(0xe000, 0xe3ff, 2, DrvVidRAM);
|
||||
ZetSetWriteHandler(momoko_main_write);
|
||||
ZetSetReadHandler(momoko_main_read);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
ZetInit(1);
|
||||
|
@ -494,7 +493,6 @@ static INT32 DrvInit()
|
|||
ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1);
|
||||
ZetSetWriteHandler(momoko_sound_write);
|
||||
ZetSetReadHandler(momoko_sound_read);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
BurnYM2203Init(2, 1250000, NULL, DrvSynchroniseStream, DrvGetTime, 0);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,365 +1,364 @@
|
|||
// FB Alpha Quiz Olympic driver module
|
||||
// Based on MAME driver by Tomasz Slanina
|
||||
|
||||
#include "burnint.h"
|
||||
#include "z80_intf.h"
|
||||
|
||||
#include "driver.h"
|
||||
extern "C" {
|
||||
#include "ay8910.h"
|
||||
}
|
||||
#include "bitswap.h"
|
||||
|
||||
static UINT8 *Mem, *Rom, *Prom, *RomBank, *VideoRam, *framebuffer;
|
||||
static UINT8 DrvJoy[8], DrvDips, DrvReset;
|
||||
static UINT32 *Palette;
|
||||
static UINT8 port60 = 0, port70 = 0, dirty = 0;
|
||||
|
||||
static INT16* pAY8910Buffer[3];
|
||||
static INT16 *pFMBuffer = NULL;
|
||||
|
||||
static struct BurnInputInfo DrvInputList[] = {
|
||||
{"Coin 1", BIT_DIGITAL, DrvJoy + 0, "p1 coin" },
|
||||
{"Coin 2", BIT_DIGITAL, DrvJoy + 1, "p1 coin2" },
|
||||
{"Start 1", BIT_DIGITAL, DrvJoy + 2, "p1 start" },
|
||||
|
||||
{"P1 Button 1", BIT_DIGITAL, DrvJoy + 3, "p1 fire 1" },
|
||||
{"P1 Button 2", BIT_DIGITAL, DrvJoy + 4, "p1 fire 2" },
|
||||
{"P1 Button 3", BIT_DIGITAL, DrvJoy + 5, "p1 fire 3" },
|
||||
|
||||
{"Reset", BIT_DIGITAL, &DrvReset, "reset" },
|
||||
{"Tilt", BIT_DIGITAL, DrvJoy + 6, "tilt" },
|
||||
{"Dip Switches", BIT_DIPSWITCH, &DrvDips, "dip" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Drv)
|
||||
|
||||
static struct BurnDIPInfo DrvDIPList[] =
|
||||
{
|
||||
// Defaults
|
||||
{0x08, 0xFF, 0xFF, 0x40, NULL},
|
||||
|
||||
{0, 0xFE, 0, 2, "Test mode"},
|
||||
{0x08, 0x01, 0x08, 0x00, "Off"},
|
||||
{0x08, 0x01, 0x08, 0x08, "On"},
|
||||
{0, 0xFE, 0, 2, "Show the answer"}, // look the star
|
||||
{0x08, 0x01, 0x10, 0x00, "Off"},
|
||||
{0x08, 0x01, 0x10, 0x10, "On"},
|
||||
{0, 0xFE, 0, 2, "Coin A"},
|
||||
{0x08, 0x01, 0x40, 0x00, "2 coins 1 credit"},
|
||||
{0x08, 0x01, 0x40, 0x40, "1 coin 1 credit"},
|
||||
};
|
||||
|
||||
STDDIPINFO(Drv)
|
||||
|
||||
|
||||
static void quizo_palette_init()
|
||||
{
|
||||
INT32 i; UINT8 *color_prom = Prom;
|
||||
|
||||
for (i = 0;i < 16;i++)
|
||||
{
|
||||
INT32 bit0,bit1,bit2,r,g,b;
|
||||
|
||||
bit0 = 0;
|
||||
bit1 = (*color_prom >> 0) & 0x01;
|
||||
bit2 = (*color_prom >> 1) & 0x01;
|
||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (*color_prom >> 2) & 0x01;
|
||||
bit1 = (*color_prom >> 3) & 0x01;
|
||||
bit2 = (*color_prom >> 4) & 0x01;
|
||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (*color_prom >> 5) & 0x01;
|
||||
bit1 = (*color_prom >> 6) & 0x01;
|
||||
bit2 = (*color_prom >> 7) & 0x01;
|
||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
Palette[i] = (r << 16) | (g << 8) | b;
|
||||
color_prom++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvDraw()
|
||||
{
|
||||
INT32 x,y;
|
||||
UINT32 *src = (UINT32 *)framebuffer;
|
||||
|
||||
if(dirty)
|
||||
{
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
for(x=0;x<80;x++)
|
||||
{
|
||||
INT32 data=VideoRam[y*80+x];
|
||||
INT32 data1=VideoRam[y*80+x+0x4000];
|
||||
INT32 pix;
|
||||
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+3) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+2) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+1) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+0) + (y * 320))] = Palette[pix&15];
|
||||
}
|
||||
}
|
||||
}
|
||||
dirty = 0;
|
||||
|
||||
for (x = 0; x < 320 * 200; x++) {
|
||||
PutPix(pBurnDraw + x * nBurnBpp, BurnHighCol(src[x]>>16, src[x]>>8, src[x], 0));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void port60_w(UINT16, UINT8 data)
|
||||
{
|
||||
static const UINT8 rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1};
|
||||
|
||||
if (data > 9)
|
||||
{
|
||||
data=0;
|
||||
}
|
||||
|
||||
port60 = data;
|
||||
|
||||
ZetMapArea(0x8000, 0xbfff, 0, RomBank + rombankLookup[data] * 0x4000);
|
||||
ZetMapArea(0x8000, 0xbfff, 2, RomBank + rombankLookup[data] * 0x4000);
|
||||
}
|
||||
|
||||
void __fastcall quizo_write(UINT16 a, UINT8 data)
|
||||
{
|
||||
if (a >= 0xc000) {
|
||||
INT32 bank = (port70 & 8) ? 1 : 0;
|
||||
VideoRam[(a & 0x3fff) + bank * 0x4000] = data;
|
||||
dirty=1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall quizo_out_port(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a & 0xff)
|
||||
{
|
||||
case 0x50:
|
||||
AY8910Write(0, 0, d);
|
||||
break;
|
||||
|
||||
case 0x51:
|
||||
AY8910Write(0, 1, d);
|
||||
break;
|
||||
|
||||
case 0x60:
|
||||
port60_w(0, d);
|
||||
break;
|
||||
|
||||
case 0x70:
|
||||
port70 = d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall quizo_in_port(UINT16 a)
|
||||
{
|
||||
switch (a & 0xff)
|
||||
{
|
||||
case 0x00: // input port 0
|
||||
return (DrvJoy[0] | (DrvJoy[1] << 2) | (DrvJoy[6] << 3) | (DrvJoy[2] << 4)) ^ 0x18;
|
||||
|
||||
case 0x10: // input port 1
|
||||
return (DrvJoy[3] | (DrvJoy[4] << 1) | (DrvJoy[5] << 2)) ^ 0xff;
|
||||
|
||||
case 0x40: // input port 2
|
||||
return DrvDips;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvDoReset()
|
||||
{
|
||||
dirty = 1;
|
||||
port70 = port60 = 0;
|
||||
|
||||
DrvReset = 0;
|
||||
|
||||
ZetOpen(0);
|
||||
ZetReset();
|
||||
ZetClose();
|
||||
|
||||
AY8910Reset(0);
|
||||
|
||||
memset (Rom + 0x4000, 0, 0x0400);
|
||||
memset (VideoRam, 0, 0x8000);
|
||||
memset (framebuffer, 0, 320 * 200 * 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvInit()
|
||||
{
|
||||
Mem = (UINT8*)BurnMalloc(0x30000 + 0x20 + (0x10 * sizeof(INT32)) + 0x3e800);
|
||||
if (Mem == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
pFMBuffer = (INT16 *)BurnMalloc (nBurnSoundLen * 3 * sizeof(INT16));
|
||||
if (pFMBuffer == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Rom = Mem + 0x00000;
|
||||
RomBank = Mem + 0x10000;
|
||||
VideoRam = Mem + 0x28000;
|
||||
Prom = Mem + 0x30000;
|
||||
Palette = (UINT32*)(Mem + 0x30020);
|
||||
framebuffer = Mem + 0x30060;
|
||||
|
||||
if (BurnLoadRom(Rom, 0, 1)) return 1;
|
||||
memcpy (Rom, Rom + 0x4000, 0x4000);
|
||||
|
||||
if (BurnLoadRom(RomBank + 0x00000, 1, 1)) return 1;
|
||||
if (BurnLoadRom(RomBank + 0x08000, 2, 1)) return 1;
|
||||
if (BurnLoadRom(RomBank + 0x10000, 3, 1)) return 1;
|
||||
|
||||
if (BurnLoadRom(Prom, 4, 1)) return 1;
|
||||
|
||||
quizo_palette_init();
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetSetWriteHandler(quizo_write);
|
||||
ZetSetInHandler(quizo_in_port);
|
||||
ZetSetOutHandler(quizo_out_port);
|
||||
ZetMapArea(0x0000, 0x3fff, 0, Rom + 0x0000);
|
||||
ZetMapArea(0x0000, 0x3fff, 2, Rom + 0x0000);
|
||||
ZetMapArea(0x4000, 0x47ff, 0, Rom + 0x4000);
|
||||
ZetMapArea(0x4000, 0x47ff, 1, Rom + 0x4000);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0;
|
||||
pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1;
|
||||
pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2;
|
||||
|
||||
AY8910Init(0, 1342329, nBurnSoundRate, NULL, NULL, NULL, NULL);
|
||||
AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH);
|
||||
|
||||
DrvDoReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvFrame()
|
||||
{
|
||||
if (DrvReset) DrvDoReset();
|
||||
|
||||
ZetOpen(0);
|
||||
ZetRun(4000000 / 60);
|
||||
ZetRaiseIrq(1);
|
||||
ZetClose();
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0);
|
||||
}
|
||||
|
||||
if (pBurnDraw) DrvDraw();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvExit()
|
||||
{
|
||||
BurnFree (Mem);
|
||||
BurnFree (pFMBuffer);
|
||||
|
||||
Mem = Rom = Prom = RomBank = VideoRam = framebuffer = NULL;
|
||||
Palette = NULL;
|
||||
pFMBuffer = NULL;
|
||||
AY8910Exit(0);
|
||||
ZetExit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
|
||||
if (pnMin) { // Return minimum compatible version
|
||||
*pnMin = 0x029521;
|
||||
}
|
||||
|
||||
if (nAction & ACB_VOLATILE) { // Scan volatile ram
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.Data = VideoRam;
|
||||
ba.nLen = 0x08000;
|
||||
ba.szName = "Video Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ba.Data = Rom + 0x4000;
|
||||
ba.nLen = 0x00400;
|
||||
ba.szName = "Main Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ba.Data = framebuffer;
|
||||
ba.nLen = 320 * 200 * 4;
|
||||
ba.szName = "Main Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ZetScan(nAction); // Scan Z80
|
||||
AY8910Scan(nAction, pnMin); // Scan AY8910
|
||||
|
||||
// Scan critical driver variables
|
||||
SCAN_VAR(port60);
|
||||
SCAN_VAR(port70);
|
||||
SCAN_VAR(dirty);
|
||||
|
||||
port60_w(0, port60);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Quiz Olympic
|
||||
|
||||
static struct BurnRomInfo quizoRomDesc[] = {
|
||||
{ "rom1", 0x8000, 0x6731735f, BRF_ESS | BRF_PRG }, // 0 Z80 code
|
||||
|
||||
{ "rom2", 0x8000, 0xa700eb30, BRF_ESS | BRF_PRG }, // 1 Z80 code banks
|
||||
{ "rom3", 0x8000, 0xd344f97e, BRF_ESS | BRF_PRG }, // 2
|
||||
{ "rom4", 0x8000, 0xab1eb174, BRF_ESS | BRF_PRG }, // 3
|
||||
|
||||
{ "82s123", 0x0020, 0xc3f15914, BRF_GRA }, // 4 Color Prom
|
||||
};
|
||||
|
||||
STD_ROM_PICK(quizo)
|
||||
STD_ROM_FN(quizo)
|
||||
|
||||
struct BurnDriver BurnDrvQuizo = {
|
||||
"quizo", NULL, NULL, NULL, "1985",
|
||||
"Quiz Olympic\0", NULL, "Seoul Coin Corp.", "Miscellaneous",
|
||||
L"\uD034\uC988\uC62C\uB9BC\uD53D\0Quiz Olympic\0", NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING, 1, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0,
|
||||
NULL, quizoRomInfo, quizoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo,
|
||||
DrvInit, DrvExit, DrvFrame, NULL, DrvScan, NULL, 0x10,
|
||||
320, 200, 4, 3
|
||||
};
|
||||
|
||||
// FB Alpha Quiz Olympic driver module
|
||||
// Based on MAME driver by Tomasz Slanina
|
||||
|
||||
#include "burnint.h"
|
||||
#include "z80_intf.h"
|
||||
|
||||
#include "driver.h"
|
||||
extern "C" {
|
||||
#include "ay8910.h"
|
||||
}
|
||||
#include "bitswap.h"
|
||||
|
||||
static UINT8 *Mem, *Rom, *Prom, *RomBank, *VideoRam, *framebuffer;
|
||||
static UINT8 DrvJoy[8], DrvDips, DrvReset;
|
||||
static UINT32 *Palette;
|
||||
static UINT8 port60 = 0, port70 = 0, dirty = 0;
|
||||
|
||||
static INT16* pAY8910Buffer[3];
|
||||
static INT16 *pFMBuffer = NULL;
|
||||
|
||||
static struct BurnInputInfo DrvInputList[] = {
|
||||
{"Coin 1", BIT_DIGITAL, DrvJoy + 0, "p1 coin" },
|
||||
{"Coin 2", BIT_DIGITAL, DrvJoy + 1, "p1 coin2" },
|
||||
{"Start 1", BIT_DIGITAL, DrvJoy + 2, "p1 start" },
|
||||
|
||||
{"P1 Button 1", BIT_DIGITAL, DrvJoy + 3, "p1 fire 1" },
|
||||
{"P1 Button 2", BIT_DIGITAL, DrvJoy + 4, "p1 fire 2" },
|
||||
{"P1 Button 3", BIT_DIGITAL, DrvJoy + 5, "p1 fire 3" },
|
||||
|
||||
{"Reset", BIT_DIGITAL, &DrvReset, "reset" },
|
||||
{"Tilt", BIT_DIGITAL, DrvJoy + 6, "tilt" },
|
||||
{"Dip Switches", BIT_DIPSWITCH, &DrvDips, "dip" },
|
||||
};
|
||||
|
||||
STDINPUTINFO(Drv)
|
||||
|
||||
static struct BurnDIPInfo DrvDIPList[] =
|
||||
{
|
||||
// Defaults
|
||||
{0x08, 0xFF, 0xFF, 0x40, NULL},
|
||||
|
||||
{0, 0xFE, 0, 2, "Test mode"},
|
||||
{0x08, 0x01, 0x08, 0x00, "Off"},
|
||||
{0x08, 0x01, 0x08, 0x08, "On"},
|
||||
{0, 0xFE, 0, 2, "Show the answer"}, // look the star
|
||||
{0x08, 0x01, 0x10, 0x00, "Off"},
|
||||
{0x08, 0x01, 0x10, 0x10, "On"},
|
||||
{0, 0xFE, 0, 2, "Coin A"},
|
||||
{0x08, 0x01, 0x40, 0x00, "2 coins 1 credit"},
|
||||
{0x08, 0x01, 0x40, 0x40, "1 coin 1 credit"},
|
||||
};
|
||||
|
||||
STDDIPINFO(Drv)
|
||||
|
||||
|
||||
static void quizo_palette_init()
|
||||
{
|
||||
INT32 i; UINT8 *color_prom = Prom;
|
||||
|
||||
for (i = 0;i < 16;i++)
|
||||
{
|
||||
INT32 bit0,bit1,bit2,r,g,b;
|
||||
|
||||
bit0 = 0;
|
||||
bit1 = (*color_prom >> 0) & 0x01;
|
||||
bit2 = (*color_prom >> 1) & 0x01;
|
||||
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (*color_prom >> 2) & 0x01;
|
||||
bit1 = (*color_prom >> 3) & 0x01;
|
||||
bit2 = (*color_prom >> 4) & 0x01;
|
||||
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
bit0 = (*color_prom >> 5) & 0x01;
|
||||
bit1 = (*color_prom >> 6) & 0x01;
|
||||
bit2 = (*color_prom >> 7) & 0x01;
|
||||
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
|
||||
|
||||
Palette[i] = (r << 16) | (g << 8) | b;
|
||||
color_prom++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvDraw()
|
||||
{
|
||||
INT32 x,y;
|
||||
UINT32 *src = (UINT32 *)framebuffer;
|
||||
|
||||
if(dirty)
|
||||
{
|
||||
for(y=0;y<200;y++)
|
||||
{
|
||||
for(x=0;x<80;x++)
|
||||
{
|
||||
INT32 data=VideoRam[y*80+x];
|
||||
INT32 data1=VideoRam[y*80+x+0x4000];
|
||||
INT32 pix;
|
||||
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+3) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+2) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+1) + (y * 320))] = Palette[pix&15];
|
||||
data>>=1;
|
||||
data1>>=1;
|
||||
pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
|
||||
src[((x*4+0) + (y * 320))] = Palette[pix&15];
|
||||
}
|
||||
}
|
||||
}
|
||||
dirty = 0;
|
||||
|
||||
for (x = 0; x < 320 * 200; x++) {
|
||||
PutPix(pBurnDraw + x * nBurnBpp, BurnHighCol(src[x]>>16, src[x]>>8, src[x], 0));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void port60_w(UINT16, UINT8 data)
|
||||
{
|
||||
static const UINT8 rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1};
|
||||
|
||||
if (data > 9)
|
||||
{
|
||||
data=0;
|
||||
}
|
||||
|
||||
port60 = data;
|
||||
|
||||
ZetMapArea(0x8000, 0xbfff, 0, RomBank + rombankLookup[data] * 0x4000);
|
||||
ZetMapArea(0x8000, 0xbfff, 2, RomBank + rombankLookup[data] * 0x4000);
|
||||
}
|
||||
|
||||
void __fastcall quizo_write(UINT16 a, UINT8 data)
|
||||
{
|
||||
if (a >= 0xc000) {
|
||||
INT32 bank = (port70 & 8) ? 1 : 0;
|
||||
VideoRam[(a & 0x3fff) + bank * 0x4000] = data;
|
||||
dirty=1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void __fastcall quizo_out_port(UINT16 a, UINT8 d)
|
||||
{
|
||||
switch (a & 0xff)
|
||||
{
|
||||
case 0x50:
|
||||
AY8910Write(0, 0, d);
|
||||
break;
|
||||
|
||||
case 0x51:
|
||||
AY8910Write(0, 1, d);
|
||||
break;
|
||||
|
||||
case 0x60:
|
||||
port60_w(0, d);
|
||||
break;
|
||||
|
||||
case 0x70:
|
||||
port70 = d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 __fastcall quizo_in_port(UINT16 a)
|
||||
{
|
||||
switch (a & 0xff)
|
||||
{
|
||||
case 0x00: // input port 0
|
||||
return (DrvJoy[0] | (DrvJoy[1] << 2) | (DrvJoy[6] << 3) | (DrvJoy[2] << 4)) ^ 0x18;
|
||||
|
||||
case 0x10: // input port 1
|
||||
return (DrvJoy[3] | (DrvJoy[4] << 1) | (DrvJoy[5] << 2)) ^ 0xff;
|
||||
|
||||
case 0x40: // input port 2
|
||||
return DrvDips;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static INT32 DrvDoReset()
|
||||
{
|
||||
dirty = 1;
|
||||
port70 = port60 = 0;
|
||||
|
||||
DrvReset = 0;
|
||||
|
||||
ZetOpen(0);
|
||||
ZetReset();
|
||||
ZetClose();
|
||||
|
||||
AY8910Reset(0);
|
||||
|
||||
memset (Rom + 0x4000, 0, 0x0400);
|
||||
memset (VideoRam, 0, 0x8000);
|
||||
memset (framebuffer, 0, 320 * 200 * 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvInit()
|
||||
{
|
||||
Mem = (UINT8*)BurnMalloc(0x30000 + 0x20 + (0x10 * sizeof(INT32)) + 0x3e800);
|
||||
if (Mem == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
pFMBuffer = (INT16 *)BurnMalloc (nBurnSoundLen * 3 * sizeof(INT16));
|
||||
if (pFMBuffer == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Rom = Mem + 0x00000;
|
||||
RomBank = Mem + 0x10000;
|
||||
VideoRam = Mem + 0x28000;
|
||||
Prom = Mem + 0x30000;
|
||||
Palette = (UINT32*)(Mem + 0x30020);
|
||||
framebuffer = Mem + 0x30060;
|
||||
|
||||
if (BurnLoadRom(Rom, 0, 1)) return 1;
|
||||
memcpy (Rom, Rom + 0x4000, 0x4000);
|
||||
|
||||
if (BurnLoadRom(RomBank + 0x00000, 1, 1)) return 1;
|
||||
if (BurnLoadRom(RomBank + 0x08000, 2, 1)) return 1;
|
||||
if (BurnLoadRom(RomBank + 0x10000, 3, 1)) return 1;
|
||||
|
||||
if (BurnLoadRom(Prom, 4, 1)) return 1;
|
||||
|
||||
quizo_palette_init();
|
||||
|
||||
ZetInit(0);
|
||||
ZetOpen(0);
|
||||
ZetSetWriteHandler(quizo_write);
|
||||
ZetSetInHandler(quizo_in_port);
|
||||
ZetSetOutHandler(quizo_out_port);
|
||||
ZetMapArea(0x0000, 0x3fff, 0, Rom + 0x0000);
|
||||
ZetMapArea(0x0000, 0x3fff, 2, Rom + 0x0000);
|
||||
ZetMapArea(0x4000, 0x47ff, 0, Rom + 0x4000);
|
||||
ZetMapArea(0x4000, 0x47ff, 1, Rom + 0x4000);
|
||||
ZetClose();
|
||||
|
||||
pAY8910Buffer[0] = pFMBuffer + nBurnSoundLen * 0;
|
||||
pAY8910Buffer[1] = pFMBuffer + nBurnSoundLen * 1;
|
||||
pAY8910Buffer[2] = pFMBuffer + nBurnSoundLen * 2;
|
||||
|
||||
AY8910Init(0, 1342329, nBurnSoundRate, NULL, NULL, NULL, NULL);
|
||||
AY8910SetAllRoutes(0, 0.50, BURN_SND_ROUTE_BOTH);
|
||||
|
||||
DrvDoReset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvFrame()
|
||||
{
|
||||
if (DrvReset) DrvDoReset();
|
||||
|
||||
ZetOpen(0);
|
||||
ZetRun(4000000 / 60);
|
||||
ZetRaiseIrq(1);
|
||||
ZetClose();
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
AY8910Render(&pAY8910Buffer[0], pBurnSoundOut, nBurnSoundLen, 0);
|
||||
}
|
||||
|
||||
if (pBurnDraw) DrvDraw();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvExit()
|
||||
{
|
||||
BurnFree (Mem);
|
||||
BurnFree (pFMBuffer);
|
||||
|
||||
Mem = Rom = Prom = RomBank = VideoRam = framebuffer = NULL;
|
||||
Palette = NULL;
|
||||
pFMBuffer = NULL;
|
||||
AY8910Exit(0);
|
||||
ZetExit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
||||
{
|
||||
struct BurnArea ba;
|
||||
|
||||
if (pnMin) { // Return minimum compatible version
|
||||
*pnMin = 0x029521;
|
||||
}
|
||||
|
||||
if (nAction & ACB_VOLATILE) { // Scan volatile ram
|
||||
memset(&ba, 0, sizeof(ba));
|
||||
ba.Data = VideoRam;
|
||||
ba.nLen = 0x08000;
|
||||
ba.szName = "Video Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ba.Data = Rom + 0x4000;
|
||||
ba.nLen = 0x00400;
|
||||
ba.szName = "Main Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ba.Data = framebuffer;
|
||||
ba.nLen = 320 * 200 * 4;
|
||||
ba.szName = "Main Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
ZetScan(nAction); // Scan Z80
|
||||
AY8910Scan(nAction, pnMin); // Scan AY8910
|
||||
|
||||
// Scan critical driver variables
|
||||
SCAN_VAR(port60);
|
||||
SCAN_VAR(port70);
|
||||
SCAN_VAR(dirty);
|
||||
|
||||
port60_w(0, port60);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Quiz Olympic
|
||||
|
||||
static struct BurnRomInfo quizoRomDesc[] = {
|
||||
{ "rom1", 0x8000, 0x6731735f, BRF_ESS | BRF_PRG }, // 0 Z80 code
|
||||
|
||||
{ "rom2", 0x8000, 0xa700eb30, BRF_ESS | BRF_PRG }, // 1 Z80 code banks
|
||||
{ "rom3", 0x8000, 0xd344f97e, BRF_ESS | BRF_PRG }, // 2
|
||||
{ "rom4", 0x8000, 0xab1eb174, BRF_ESS | BRF_PRG }, // 3
|
||||
|
||||
{ "82s123", 0x0020, 0xc3f15914, BRF_GRA }, // 4 Color Prom
|
||||
};
|
||||
|
||||
STD_ROM_PICK(quizo)
|
||||
STD_ROM_FN(quizo)
|
||||
|
||||
struct BurnDriver BurnDrvQuizo = {
|
||||
"quizo", NULL, NULL, NULL, "1985",
|
||||
"Quiz Olympic\0", NULL, "Seoul Coin Corp.", "Miscellaneous",
|
||||
L"\uD034\uC988\uC62C\uB9BC\uD53D\0Quiz Olympic\0", NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING, 1, HARDWARE_MISC_PRE90S, GBF_QUIZ, 0,
|
||||
NULL, quizoRomInfo, quizoRomName, NULL, NULL, DrvInputInfo, DrvDIPInfo,
|
||||
DrvInit, DrvExit, DrvFrame, NULL, DrvScan, NULL, 0x10,
|
||||
320, 200, 4, 3
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -569,7 +569,6 @@ static INT32 DrvInit(INT32 (*pRomLoadCallback)(), INT32 game)
|
|||
ZetMapArea(0xf800, 0xffff, 2, DrvZ80RAM);
|
||||
ZetSetWriteHandler(rpunch_sound_write);
|
||||
ZetSetReadHandler(rpunch_sound_read);
|
||||
ZetMemEnd();
|
||||
ZetClose();
|
||||
|
||||
BurnYM2151Init(4000000);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue