Added a temporary way to get to the PSX RAM as a couple of share1 lookups remained. (nw)

This commit is contained in:
smf- 2013-04-21 19:50:00 +00:00
parent 60e5dd269b
commit dcf65bad9a
5 changed files with 34 additions and 12 deletions

View File

@ -1670,6 +1670,26 @@ void psxcpu_device::set_ram_size(device_t &device, UINT32 ram_size)
}
//-------------------------------------------------
// ram_size - temporary kludge to allow
// access to the current ram size
//-------------------------------------------------
UINT32 psxcpu_device::ram_size()
{
return m_ram_size;
}
//-------------------------------------------------
// ram - temporary kludge to allow
// access to the current ram
//-------------------------------------------------
UINT32 *psxcpu_device::ram()
{
return m_ram;
}
//-------------------------------------------------
// device_start - start up the device
//-------------------------------------------------

View File

@ -173,6 +173,9 @@ public:
static psxcpu_device *getcpu( device_t &device, const char *cputag );
UINT32 ram_size();
UINT32 *ram();
protected:
psxcpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);

View File

@ -666,7 +666,7 @@ public:
void hyperbbc_lamp_callback( int data );
void mamboagg_output_callback( int offset, int data );
void punchmania_output_callback( int offset, int data );
required_device<cpu_device> m_maincpu;
required_device<psxcpu_device> m_maincpu;
};
void ATTR_PRINTF(3,4) ksys573_state::verboselog( int n_level, const char *s_fmt, ... )
@ -1462,7 +1462,7 @@ void ksys573_state::sys573_vblank(screen_device &screen, bool vblank_state)
{
/* patch out security-plate error */
UINT32 *p_n_psxram = (UINT32 *)memshare("share1")->ptr();
UINT32 *p_n_psxram = m_maincpu->ram();
/* install cd */
@ -1486,7 +1486,8 @@ void ksys573_state::sys573_vblank(screen_device &screen, bool vblank_state)
{
/* patch out security-plate error */
UINT32 *p_n_psxram = (UINT32 *)memshare("share1")->ptr();
UINT32 *p_n_psxram = m_maincpu->ram();
/* 8001f850: jal $8003221c */
if( p_n_psxram[ 0x1f850 / 4 ] == 0x0c00c887 )
{

View File

@ -1101,7 +1101,7 @@ public:
void namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
void namcos12_sub_irq( screen_device &screen, bool vblank_state );
void system11gun_install( );
required_device<cpu_device> m_maincpu;
required_device<psxcpu_device> m_maincpu;
};
inline void ATTR_PRINTF(3,4) namcos12_state::verboselog( int n_level, const char *s_fmt, ... )
@ -1193,7 +1193,7 @@ void namcos12_state::namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, IN
INT32 n_ramleft;
// TODO: the check for going past the end of ram should be in dma.c
UINT32 m_n_psxramsize = 0x400000;
UINT32 m_n_psxramsize = m_maincpu->ram_size();
if(m_has_tektagt_dma && !m_n_dmaoffset)
{

View File

@ -51,7 +51,7 @@ public:
void cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
void cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
DECLARE_QUICKLOAD_LOAD_MEMBER( psx_exe_load );
required_device<cpu_device> m_maincpu;
required_device<psxcpu_device> m_maincpu;
};
@ -146,9 +146,8 @@ int psx1_state::load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len
logerror( "psx_exe_load: sp %08x\n", psxexe_header->s_addr );
logerror( "psx_exe_load: len %08x\n", psxexe_header->s_size );
memory_share *share = memshare("share1");
p_ram = (UINT8 *)share->ptr();
n_ram = share->bytes();
p_ram = (UINT8 *)m_maincpu->ram();
n_ram = m_maincpu->ram_size();
p_psxexe = p_n_file + sizeof( struct PSXEXE_HEADER );
@ -250,9 +249,8 @@ int psx1_state::load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
( (int)p_n_file[ n_offset + 6 ] << 16 ) |
( (int)p_n_file[ n_offset + 7 ] << 24 );
memory_share *share = memshare("share1");
UINT8 *p_ram = (UINT8 *)share->ptr();
UINT32 n_ram = share->bytes();
UINT8 *p_ram = (UINT8 *)m_maincpu->ram();
UINT32 n_ram = m_maincpu->ram_size();
n_offset += 8;