Previous 15994 Revisions Next

r3950 Sunday 21st December, 2008 at 09:30:13 UTC by smf
resurrected psx exe loading.
[src/mess/drivers]psx.c

src/mess/drivers/psx.c
r3949r3950
2020#include "sound/psx.h"
2121#include "debugger.h"
2222
23// RB: there is no longer an opbase handler so the quickload won't work as designed.
24#if 0
2523static struct
2624{
2725   UINT8 id[ 8 ];
r3949r3950
8179
8280      free( m_p_psxexe );
8381
84      cpu_set_reg(machine->cpu[0],  MIPS_PC, m_psxexe_header.pc0 );
85      cpu_set_reg(machine->cpu[0],  MIPS_R28, m_psxexe_header.gp0 );
82      cpu_set_reg( space->machine->cpu[0], PSXCPU_PC, m_psxexe_header.pc0 );
83      cpu_set_reg( space->machine->cpu[0], PSXCPU_R28, m_psxexe_header.gp0 );
8684      n_stack = m_psxexe_header.s_addr + m_psxexe_header.s_size;
8785      if( n_stack != 0 )
8886      {
89         cpu_set_reg(machine->cpu[0],  MIPS_R29, n_stack );
90         cpu_set_reg(machine->cpu[0],  MIPS_R30, n_stack );
87         cpu_set_reg( space->machine->cpu[0], PSXCPU_R29, n_stack );
88         cpu_set_reg( space->machine->cpu[0], PSXCPU_R30, n_stack );
9189      }
9290
93      memory_set_direct_update_handler( 0, NULL );
91      memory_set_direct_update_handler( space, NULL );
9492
9593      return ~0;
9694   }
r3949r3950
111109
112110static QUICKLOAD_LOAD( psx_exe_load )
113111{
112   const address_space *space = cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM );
113
114114   if( image_fread( image, &m_psxexe_header, sizeof( m_psxexe_header ) ) != sizeof( m_psxexe_header ) )
115115   {
116116      logerror( "psx_exe_load: invalid exe\n" );
r3949r3950
147147      return INIT_FAIL;
148148   }
149149   image_fread( image, m_p_psxexe, m_psxexe_header.t_size );
150   memory_set_direct_update_handler( 0, psx_setopbase );
150   memory_set_direct_update_handler( space, psx_setopbase );
151151   return INIT_PASS;
152152}
153#endif
154153
155154#define PAD_STATE_IDLE ( 0 )
156155#define PAD_STATE_LISTEN ( 1 )
r3949r3950
806805   MDRV_SOUND_ROUTE( 1, "right", 1.00 )
807806
808807   /* quickload */
809//   MDRV_QUICKLOAD_ADD(psx_exe_load, "exe,psx", 0)
808   MDRV_QUICKLOAD_ADD(psx_exe_load, "exe,psx", 0)
810809MACHINE_DRIVER_END
811810
812811static MACHINE_DRIVER_START( psxpal )
r3949r3950
839838   MDRV_SOUND_ROUTE( 1, "right", 1.00 )
840839
841840   /* quickload */
842//   MDRV_QUICKLOAD_ADD(psx_exe_load, "exe,psx", 0)
841   MDRV_QUICKLOAD_ADD(psx_exe_load, "exe,psx", 0)
843842MACHINE_DRIVER_END
844843
845844ROM_START( psj )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team