| 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 |
| r3949 | r3950 | |
|---|---|---|
| 20 | 20 | #include "sound/psx.h" |
| 21 | 21 | #include "debugger.h" |
| 22 | 22 | |
| 23 | // RB: there is no longer an opbase handler so the quickload won't work as designed. | |
| 24 | #if 0 | |
| 25 | 23 | static struct |
| 26 | 24 | { |
| 27 | 25 | UINT8 id[ 8 ]; |
| r3949 | r3950 | |
| 81 | 79 | |
| 82 | 80 | free( m_p_psxexe ); |
| 83 | 81 | |
| 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 ); | |
| 86 | 84 | n_stack = m_psxexe_header.s_addr + m_psxexe_header.s_size; |
| 87 | 85 | if( n_stack != 0 ) |
| 88 | 86 | { |
| 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 ); | |
| 91 | 89 | } |
| 92 | 90 | |
| 93 | memory_set_direct_update_handler( | |
| 91 | memory_set_direct_update_handler( space, NULL ); | |
| 94 | 92 | |
| 95 | 93 | return ~0; |
| 96 | 94 | } |
| r3949 | r3950 | |
| 111 | 109 | |
| 112 | 110 | static QUICKLOAD_LOAD( psx_exe_load ) |
| 113 | 111 | { |
| 112 | const address_space *space = cpu_get_address_space( Machine->cpu[0], ADDRESS_SPACE_PROGRAM ); | |
| 113 | ||
| 114 | 114 | if( image_fread( image, &m_psxexe_header, sizeof( m_psxexe_header ) ) != sizeof( m_psxexe_header ) ) |
| 115 | 115 | { |
| 116 | 116 | logerror( "psx_exe_load: invalid exe\n" ); |
| r3949 | r3950 | |
| 147 | 147 | return INIT_FAIL; |
| 148 | 148 | } |
| 149 | 149 | image_fread( image, m_p_psxexe, m_psxexe_header.t_size ); |
| 150 | memory_set_direct_update_handler( | |
| 150 | memory_set_direct_update_handler( space, psx_setopbase ); | |
| 151 | 151 | return INIT_PASS; |
| 152 | 152 | } |
| 153 | #endif | |
| 154 | 153 | |
| 155 | 154 | #define PAD_STATE_IDLE ( 0 ) |
| 156 | 155 | #define PAD_STATE_LISTEN ( 1 ) |
| r3949 | r3950 | |
| 806 | 805 | MDRV_SOUND_ROUTE( 1, "right", 1.00 ) |
| 807 | 806 | |
| 808 | 807 | /* quickload */ |
| 809 | ||
| 808 | ||
| 810 | 809 | MACHINE_DRIVER_END |
| 811 | 810 | |
| 812 | 811 | static MACHINE_DRIVER_START( psxpal ) |
| r3949 | r3950 | |
| 839 | 838 | MDRV_SOUND_ROUTE( 1, "right", 1.00 ) |
| 840 | 839 | |
| 841 | 840 | /* quickload */ |
| 842 | ||
| 841 | ||
| 843 | 842 | MACHINE_DRIVER_END |
| 844 | 843 | |
| 845 | 844 | ROM_START( psj ) |
| Previous | 15994 Revisions | Next |