Previous 199869 Revisions Next

r21162 Monday 18th February, 2013 at 15:05:44 UTC by Miodrag Milanović
forgot one (nw)
[src/mess/drivers]psx.c

trunk/src/mess/drivers/psx.c
r21161r21162
4141   DECLARE_DIRECT_UPDATE_MEMBER(psx_setopbase);
4242   DECLARE_DRIVER_INIT(psx);
4343   DECLARE_MACHINE_RESET(psx);
44   inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... );
45   void psxexe_conv32( UINT32 *p_uint32 );
46   int load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len );
47   void cpe_set_register( cpu_device *cpu, int n_reg, int n_value );
48   int load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len );
49   int load_psf( cpu_device *cpu, unsigned char *p_n_file, int n_len );
50   void cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
51   void cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
4452};
4553
4654
4755#define VERBOSE_LEVEL ( 0 )
4856
49INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
57inline void ATTR_PRINTF(3,4) psx1_state::verboselog( int n_level, const char *s_fmt, ... )
5058{
5159   if( VERBOSE_LEVEL >= n_level )
5260   {
r21161r21162
5563      va_start( v, s_fmt );
5664      vsprintf( buf, s_fmt, v );
5765      va_end( v );
58      logerror( "%s: %s", machine.describe_context(), buf );
66      logerror( "%s: %s", machine().describe_context(), buf );
5967   }
6068}
6169
6270
63static void psxexe_conv32( UINT32 *p_uint32 )
71void psx1_state::psxexe_conv32( UINT32 *p_uint32 )
6472{
6573   UINT8 *p_uint8;
6674
r21161r21162
7280      ( p_uint8[ 3 ] << 24 );
7381}
7482
75static int load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
83int psx1_state::load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
7684{
7785   struct PSXEXE_HEADER
7886   {
r21161r21162
165173   return 0;
166174}
167175
168static void cpe_set_register( cpu_device *cpu, int n_reg, int n_value )
176void psx1_state::cpe_set_register( cpu_device *cpu, int n_reg, int n_value )
169177{
170178   if( n_reg < 0x80 && ( n_reg % 4 ) == 0 )
171179   {
r21161r21162
208216   }
209217}
210218
211static int load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
219int psx1_state::load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
212220{
213221   if( n_len >= 4 &&
214222      memcmp( p_n_file, "CPE\001", 4 ) == 0 )
r21161r21162
343351   return 0;
344352}
345353
346static int load_psf( cpu_device *cpu, unsigned char *p_n_file, int n_len )
354int psx1_state::load_psf( cpu_device *cpu, unsigned char *p_n_file, int n_len )
347355{
348356   int n_return;
349357   unsigned long n_crc;
r21161r21162
463471
464472/* ----------------------------------------------------------------------- */
465473
466static void cd_dma_read( psxcd_device *psxcd, UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size )
474void psx1_state::cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size )
467475{
468476   UINT8 *psxram = (UINT8 *) p_n_psxram;
469
477   psxcd_device *psxcd = machine().device<psxcd_device>("cdrom");
470478   psxcd->start_dma(psxram + n_address, n_size*4);
471479}
472480
473static void cd_dma_write( psxcd_device *psxcd, UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size )
481void psx1_state::cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size )
474482{
475483   printf("cd_dma_write?!: addr %x, size %x\n", n_address, n_size);
476484}
r21161r21162
524532
525533   MCFG_PSXCD_ADD("cdrom")
526534   MCFG_PSXCD_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin2))
527   MCFG_PSX_DMA_CHANNEL_READ( "maincpu", 3, psx_dma_read_delegate( FUNC( cd_dma_read ), (psxcd_device *) device ) )
528   MCFG_PSX_DMA_CHANNEL_WRITE( "maincpu", 3, psx_dma_write_delegate( FUNC( cd_dma_write ), (psxcd_device *) device ) )
535   MCFG_PSX_DMA_CHANNEL_READ( "maincpu", 3, psx_dma_read_delegate( FUNC( psx1_state::cd_dma_read ), (psx1_state *) owner ) )
536   MCFG_PSX_DMA_CHANNEL_WRITE( "maincpu", 3, psx_dma_write_delegate( FUNC( psx1_state::cd_dma_write ), (psx1_state *) owner ) )
529537MACHINE_CONFIG_END
530538
531539static MACHINE_CONFIG_START( psxpal, psx1_state )
r21161r21162
559567
560568   MCFG_PSXCD_ADD("cdrom")
561569   MCFG_PSXCD_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin2))
562   MCFG_PSX_DMA_CHANNEL_READ( "maincpu", 3, psx_dma_read_delegate( FUNC( cd_dma_read ), (psxcd_device *) device ) )
563   MCFG_PSX_DMA_CHANNEL_WRITE( "maincpu", 3, psx_dma_write_delegate( FUNC( cd_dma_write ), (psxcd_device *) device ) )
570   MCFG_PSX_DMA_CHANNEL_READ( "maincpu", 3, psx_dma_read_delegate( FUNC( psx1_state::cd_dma_read ), (psx1_state *) owner ) )
571   MCFG_PSX_DMA_CHANNEL_WRITE( "maincpu", 3, psx_dma_write_delegate( FUNC( psx1_state::cd_dma_write ), (psx1_state *) owner ) )
564572MACHINE_CONFIG_END
565573
566574ROM_START( psj )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team