Modernized Sega Y-board driver.
This commit is contained in:
parent
eabb6d33ea
commit
5564d3cbb8
@ -1068,11 +1068,9 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
//**************************************************************************
|
||||||
*
|
// GENERIC PORT DEFINITIONS
|
||||||
* Generic port definitions
|
//**************************************************************************
|
||||||
*
|
|
||||||
*************************************/
|
|
||||||
|
|
||||||
static INPUT_PORTS_START( xboard_generic )
|
static INPUT_PORTS_START( xboard_generic )
|
||||||
PORT_START("IO0PORTA")
|
PORT_START("IO0PORTA")
|
||||||
@ -1112,11 +1110,9 @@ INPUT_PORTS_END
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
//**************************************************************************
|
||||||
*
|
// GAME-SPECIFIC PORT DEFINITIONS
|
||||||
* Game-specific port definitions
|
//**************************************************************************
|
||||||
*
|
|
||||||
*************************************/
|
|
||||||
|
|
||||||
static INPUT_PORTS_START( aburner )
|
static INPUT_PORTS_START( aburner )
|
||||||
PORT_INCLUDE( xboard_generic )
|
PORT_INCLUDE( xboard_generic )
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -52,36 +52,87 @@ public:
|
|||||||
m_maincpu(*this, "maincpu"),
|
m_maincpu(*this, "maincpu"),
|
||||||
m_subx(*this, "subx"),
|
m_subx(*this, "subx"),
|
||||||
m_suby(*this, "suby"),
|
m_suby(*this, "suby"),
|
||||||
m_soundcpu(*this, "soundcpu")
|
m_soundcpu(*this, "soundcpu"),
|
||||||
|
m_pdrift_bank(0),
|
||||||
|
m_scanline_timer(NULL),
|
||||||
|
m_irq2_scanline(0),
|
||||||
|
m_timer_irq_state(0),
|
||||||
|
m_vblank_irq_state(0),
|
||||||
|
m_tmp_bitmap(512, 512)
|
||||||
{
|
{
|
||||||
memset(m_analog_data, 0, sizeof(m_analog_data));
|
memset(m_analog_data, 0, sizeof(m_analog_data));
|
||||||
memset(m_misc_io_data, 0, sizeof(m_misc_io_data));
|
memset(m_misc_io_data, 0, sizeof(m_misc_io_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
//protected:
|
// YM2151 chip callbacks
|
||||||
|
WRITE_LINE_MEMBER( sound_cpu_irq );
|
||||||
|
|
||||||
|
// main CPU read/write handlers
|
||||||
|
READ16_MEMBER( analog_r );
|
||||||
|
WRITE16_MEMBER( analog_w );
|
||||||
|
READ16_MEMBER( io_chip_r );
|
||||||
|
WRITE16_MEMBER( io_chip_w );
|
||||||
|
WRITE16_MEMBER( sound_data_w );
|
||||||
|
|
||||||
|
// sound Z80 CPU read/write handlers
|
||||||
|
READ8_MEMBER( sound_data_r );
|
||||||
|
|
||||||
|
// game-specific output handlers
|
||||||
|
void gforce2_output_cb2(UINT16 data);
|
||||||
|
void gloc_output_cb1(UINT16 data);
|
||||||
|
void gloc_output_cb2(UINT16 data);
|
||||||
|
void r360_output_cb2(UINT16 data);
|
||||||
|
void pdrift_output_cb1(UINT16 data);
|
||||||
|
void pdrift_output_cb2(UINT16 data);
|
||||||
|
void rchase_output_cb2(UINT16 data);
|
||||||
|
|
||||||
|
// game-specific driver init
|
||||||
|
DECLARE_DRIVER_INIT(generic);
|
||||||
|
DECLARE_DRIVER_INIT(pdrift);
|
||||||
|
DECLARE_DRIVER_INIT(r360);
|
||||||
|
DECLARE_DRIVER_INIT(gforce2);
|
||||||
|
DECLARE_DRIVER_INIT(rchase);
|
||||||
|
DECLARE_DRIVER_INIT(gloc);
|
||||||
|
|
||||||
|
// video updates
|
||||||
|
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// internal types
|
||||||
|
typedef delegate<void (UINT16)> output_delegate;
|
||||||
|
|
||||||
|
// timer IDs
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
TID_IRQ2_GEN,
|
||||||
|
TID_SOUND_WRITE
|
||||||
|
};
|
||||||
|
|
||||||
|
// device overrides
|
||||||
|
virtual void machine_reset();
|
||||||
|
virtual void video_start();
|
||||||
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||||
|
|
||||||
|
// internal helpers
|
||||||
|
void update_irqs();
|
||||||
|
|
||||||
// devices
|
// devices
|
||||||
required_device<m68000_device> m_maincpu;
|
required_device<m68000_device> m_maincpu;
|
||||||
required_device<m68000_device> m_subx;
|
required_device<m68000_device> m_subx;
|
||||||
required_device<m68000_device> m_suby;
|
required_device<m68000_device> m_suby;
|
||||||
required_device<z80_device> m_soundcpu;
|
required_device<z80_device> m_soundcpu;
|
||||||
|
|
||||||
|
// configuration
|
||||||
|
output_delegate m_output_cb1;
|
||||||
|
output_delegate m_output_cb2;
|
||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
|
UINT16 m_pdrift_bank;
|
||||||
emu_timer * m_scanline_timer;
|
emu_timer * m_scanline_timer;
|
||||||
UINT8 m_analog_data[4];
|
UINT8 m_analog_data[4];
|
||||||
int m_irq2_scanline;
|
int m_irq2_scanline;
|
||||||
UINT8 m_timer_irq_state;
|
UINT8 m_timer_irq_state;
|
||||||
UINT8 m_vblank_irq_state;
|
UINT8 m_vblank_irq_state;
|
||||||
UINT8 m_misc_io_data[0x10];
|
UINT8 m_misc_io_data[0x10];
|
||||||
bitmap_ind16 * m_tmp_bitmap;
|
bitmap_ind16 m_tmp_bitmap;
|
||||||
DECLARE_DRIVER_INIT(pdrift);
|
|
||||||
DECLARE_DRIVER_INIT(r360);
|
|
||||||
DECLARE_DRIVER_INIT(gforce2);
|
|
||||||
DECLARE_DRIVER_INIT(rchase);
|
|
||||||
DECLARE_DRIVER_INIT(gloc);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------- defined in video/segaybd.c -----------*/
|
|
||||||
|
|
||||||
VIDEO_START( yboard );
|
|
||||||
SCREEN_UPDATE_IND16( yboard );
|
|
||||||
|
@ -58,7 +58,7 @@ void segaxbd_state::video_start()
|
|||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// VIDEO STARTUP
|
// VIDEO UPDATE
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
|
@ -39,56 +39,42 @@
|
|||||||
#include "includes/segaybd.h"
|
#include "includes/segaybd.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
//**************************************************************************
|
||||||
*
|
// VIDEO STARTUP
|
||||||
* Video startup
|
//**************************************************************************
|
||||||
*
|
|
||||||
*************************************/
|
|
||||||
|
|
||||||
VIDEO_START( yboard )
|
void segaybd_state::video_start()
|
||||||
{
|
{
|
||||||
segaybd_state *state = machine.driver_data<segaybd_state>();
|
// compute palette info
|
||||||
|
|
||||||
/* compute palette info */
|
|
||||||
segaic16_palette_init(0x2000);
|
segaic16_palette_init(0x2000);
|
||||||
|
|
||||||
/* allocate a bitmap for the yboard layer */
|
// initialize the rotation layer
|
||||||
state->m_tmp_bitmap = auto_bitmap_ind16_alloc(machine, 512, 512);
|
segaic16_rotate_init(machine(), 0, SEGAIC16_ROTATE_YBOARD, 0x000);
|
||||||
|
|
||||||
/* initialize the rotation layer */
|
|
||||||
segaic16_rotate_init(machine, 0, SEGAIC16_ROTATE_YBOARD, 0x000);
|
|
||||||
|
|
||||||
state->save_item(NAME(*state->m_tmp_bitmap));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************
|
//**************************************************************************
|
||||||
*
|
// VIDEO UPDATE
|
||||||
* Video update
|
//**************************************************************************
|
||||||
*
|
|
||||||
*************************************/
|
|
||||||
|
|
||||||
SCREEN_UPDATE_IND16( yboard )
|
UINT32 segaybd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
segaybd_state *state = screen.machine().driver_data<segaybd_state>();
|
// if no drawing is happening, fill with black and get out
|
||||||
rectangle yboard_clip;
|
|
||||||
|
|
||||||
/* if no drawing is happening, fill with black and get out */
|
|
||||||
if (!segaic16_display_enable)
|
if (!segaic16_display_enable)
|
||||||
{
|
{
|
||||||
bitmap.fill(get_black_pen(screen.machine()), cliprect);
|
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw the yboard sprites */
|
// draw the yboard sprites
|
||||||
yboard_clip.set(0, 511, 0, 511);
|
rectangle yboard_clip(0, 511, 0, 511);
|
||||||
segaic16_sprites_draw(screen, *state->m_tmp_bitmap, yboard_clip, 1);
|
segaic16_sprites_draw(screen, m_tmp_bitmap, yboard_clip, 1);
|
||||||
|
|
||||||
/* apply rotation */
|
// apply rotation
|
||||||
segaic16_rotate_draw(screen.machine(), 0, bitmap, cliprect, state->m_tmp_bitmap);
|
segaic16_rotate_draw(machine(), 0, bitmap, cliprect, &m_tmp_bitmap);
|
||||||
|
|
||||||
/* draw the 16B sprites */
|
// draw the 16B sprites
|
||||||
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user