From 7d7df26c7e2ea4e640d1829471b2af5252a7677a Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Fri, 24 Jan 2014 01:30:41 +0000 Subject: [PATCH] OCD on PCE. --- src/burn/drv/pce/pce.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/burn/drv/pce/pce.cpp b/src/burn/drv/pce/pce.cpp index c38e04f8e..78fc3d4a4 100644 --- a/src/burn/drv/pce/pce.cpp +++ b/src/burn/drv/pce/pce.cpp @@ -39,7 +39,6 @@ static UINT8 *PCECartRAM; static UINT8 *PCEUserRAM; static UINT8 *PCECDBRAM; - static UINT32 *DrvPalette; UINT8 PCEPaletteRecalc; @@ -63,7 +62,6 @@ static INT32 pce_sf2 = 0; static INT32 pce_sf2_bank; static UINT8 bram_locked = 1; - INT32 PceGetZipName(char** pszName, UINT32 i) { static char szFilename[MAX_PATH]; @@ -218,29 +216,32 @@ static void pce_write(UINT32 address, UINT8 data) h6280_irq_status_w(address & 0x3ff, data); return; - case 0x1ff800: - + case 0x1ff800: // cd system + { switch( address & 0xf ) { - case 0x07: /* BRAM unlock / CD status */ - if ( data & 0x80 ) + case 0x07: /* BRAM unlock / CD status */ { - bram_locked = 0; + if (data & 0x80) + { + bram_locked = 0; + } } break; } + bprintf(0,_T("CD write %x:%x\n"), address, data ); - // cd system + } return; } if ((address >= 0x1ee000) && (address <= 0x1ee7ff)) { -// bprintf(0,_T("bram write %x:%x\n"), address & 0x7ff, data ); - if (!bram_locked) - { - PCECDBRAM[address & 0x7FF] = data; - } - return; +// bprintf(0,_T("bram write %x:%x\n"), address & 0x7ff, data ); + if (!bram_locked) + { + PCECDBRAM[address & 0x7FF] = data; + } + return; } @@ -249,13 +250,10 @@ static void pce_write(UINT32 address, UINT8 data) static UINT8 pce_read(UINT32 address) { - address &= 0x1fffff; switch (address & ~0x3ff) { - - case 0x1fe000: return vdc_read(0, address); @@ -311,11 +309,12 @@ static UINT8 pce_read(UINT32 address) } if ((address >= 0x1ee000) && (address <= 0x1ee7ff)) { - // bprintf(0,_T("bram read %x:%x\n"), address,address & 0x7ff ); - return PCECDBRAM[address & 0x7ff]; + // bprintf(0,_T("bram read %x:%x\n"), address,address & 0x7ff ); + return PCECDBRAM[address & 0x7ff]; } bprintf(0,_T("Unknown read %x\n"), address ); + return 0; }