Pointer-ified the cubeqst CPUs.

This commit is contained in:
Aaron Giles 2008-12-09 14:49:16 +00:00
parent 5bbd1b8e1c
commit 12415fcdcb
3 changed files with 643 additions and 638 deletions

File diff suppressed because it is too large Load Diff

View File

@ -118,29 +118,43 @@ enum
CONFIGURATION STRUCTURE CONFIGURATION STRUCTURE
***************************************************************************/ ***************************************************************************/
typedef void (*cubeqst_dac_w_func)(const device_config *, UINT16);
typedef struct _cubeqst_snd_config cubeqst_snd_config; typedef struct _cubeqst_snd_config cubeqst_snd_config;
struct _cubeqst_snd_config struct _cubeqst_snd_config
{ {
void (*dac_w)(UINT16); cubeqst_dac_w_func dac_w;
const char * sound_data_region; const char * sound_data_region;
}; };
typedef struct _cubeqst_lin_config cubeqst_lin_config;
struct _cubeqst_lin_config
{
const char * rot_cpu_tag;
};
typedef struct _cubeqst_rot_config cubeqst_rot_config;
struct _cubeqst_rot_config
{
const char * lin_cpu_tag;
};
/*************************************************************************** /***************************************************************************
PUBLIC FUNCTIONS PUBLIC FUNCTIONS
***************************************************************************/ ***************************************************************************/
extern READ16_HANDLER( read_sndram ); extern READ16_DEVICE_HANDLER( cubeqcpu_sndram_r );
extern WRITE16_HANDLER( write_sndram ); extern WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w );
extern READ16_HANDLER( read_rotram ); extern READ16_DEVICE_HANDLER( cubeqcpu_rotram_r );
extern WRITE16_HANDLER( write_rotram ); extern WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w );
void cubeqcpu_swap_line_banks(void); void cubeqcpu_swap_line_banks(const device_config *device);
void clear_stack(void); void cubeqcpu_clear_stack(const device_config *device);
UINT8 get_ptr_ram_val(int i); UINT8 cubeqcpu_get_ptr_ram_val(const device_config *device, int i);
UINT32* get_stack_ram(void); UINT32* cubeqcpu_get_stack_ram(const device_config *device);
#endif /* _CUBEQCPU_H */ #endif /* _CUBEQCPU_H */

View File

@ -120,8 +120,8 @@ static VIDEO_UPDATE( cubeqst )
for (y = cliprect->min_y; y <= cliprect->max_y; ++y) for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
{ {
int i; int i;
int num_entries = get_ptr_ram_val(y); int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine->cpu[LINE_CPU], y);
UINT32 *stk_ram = get_stack_ram(); UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine->cpu[LINE_CPU]);
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0); UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT32 pen; UINT32 pen;
@ -249,10 +249,10 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( delayed_bank_swap ) static TIMER_CALLBACK( delayed_bank_swap )
{ {
cpu_push_context(machine->cpu[LINE_CPU]); cpu_push_context(machine->cpu[LINE_CPU]);
cubeqcpu_swap_line_banks(); cubeqcpu_swap_line_banks(machine->cpu[LINE_CPU]);
/* TODO: This is a little dubious */ /* TODO: This is a little dubious */
clear_stack(); cubeqcpu_clear_stack(machine->cpu[LINE_CPU]);
cpu_pop_context(); cpu_pop_context();
} }
@ -384,6 +384,26 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static READ16_HANDLER( read_rotram )
{
return cubeqcpu_rotram_r(space->machine->cpu[ROTATE_CPU], offset, mem_mask);
}
static WRITE16_HANDLER( write_rotram )
{
cubeqcpu_rotram_w(space->machine->cpu[ROTATE_CPU], offset, data, mem_mask);
}
static READ16_HANDLER( read_sndram )
{
return cubeqcpu_sndram_r(space->machine->cpu[SOUND_CPU], offset, mem_mask);
}
static WRITE16_HANDLER( write_sndram )
{
cubeqcpu_sndram_w(space->machine->cpu[SOUND_CPU], offset, data, mem_mask);
}
static ADDRESS_MAP_START( m68k_program_map, ADDRESS_SPACE_PROGRAM, 16 ) static ADDRESS_MAP_START( m68k_program_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_GLOBAL_MASK(0x03ffff) ADDRESS_MAP_GLOBAL_MASK(0x03ffff)
AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_RANGE(0x000000, 0x01ffff) AM_ROM
@ -445,7 +465,7 @@ static MACHINE_RESET( cubeqst )
*/ */
/* Called by the sound CPU emulation */ /* Called by the sound CPU emulation */
static void sound_dac_w(UINT16 data) static void sound_dac_w(const device_config *device, UINT16 data)
{ {
dac_signed_data_16_w(data & 15, (data & 0xfff0) ^ 0x8000); dac_signed_data_16_w(data & 15, (data & 0xfff0) ^ 0x8000);
} }
@ -456,6 +476,16 @@ static const cubeqst_snd_config snd_config =
"soundproms" "soundproms"
}; };
static const cubeqst_rot_config rot_config =
{
"line_cpu"
};
static const cubeqst_lin_config lin_config =
{
"rotate_cpu"
};
/************************************* /*************************************
* *
@ -470,9 +500,11 @@ static MACHINE_DRIVER_START( cubeqst )
MDRV_CPU_ADD("rotate_cpu", CQUESTROT, XTAL_10MHz / 2) MDRV_CPU_ADD("rotate_cpu", CQUESTROT, XTAL_10MHz / 2)
MDRV_CPU_PROGRAM_MAP(rotate_map, 0) MDRV_CPU_PROGRAM_MAP(rotate_map, 0)
MDRV_CPU_CONFIG(rot_config)
MDRV_CPU_ADD("line_cpu", CQUESTLIN, XTAL_10MHz / 2) MDRV_CPU_ADD("line_cpu", CQUESTLIN, XTAL_10MHz / 2)
MDRV_CPU_PROGRAM_MAP(line_sound_map, 0) MDRV_CPU_PROGRAM_MAP(line_sound_map, 0)
MDRV_CPU_CONFIG(lin_config)
MDRV_CPU_ADD("sound_cpu", CQUESTSND, XTAL_10MHz / 2) MDRV_CPU_ADD("sound_cpu", CQUESTSND, XTAL_10MHz / 2)
MDRV_CPU_PROGRAM_MAP(line_sound_map, 0) MDRV_CPU_PROGRAM_MAP(line_sound_map, 0)