mirror of
https://github.com/holub/mame
synced 2025-06-07 21:33:45 +03:00
Merge pull request #4933 from cam900/huc6270_args
huc6270.cpp, huc6202.cpp : Simplify handlers
This commit is contained in:
commit
17dfeb9b8c
@ -34,12 +34,12 @@ huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, d
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ16_MEMBER( huc6202_device::next_pixel )
|
u16 huc6202_device::next_pixel()
|
||||||
{
|
{
|
||||||
uint16_t data = huc6270_device::HUC6270_BACKGROUND;
|
uint16_t data = huc6270_device::HUC6270_BACKGROUND;
|
||||||
|
|
||||||
uint16_t data_0 = m_next_pixel_0_cb( 0, 0xffff );
|
uint16_t data_0 = m_next_pixel_0_cb();
|
||||||
uint16_t data_1 = m_next_pixel_1_cb( 0, 0xffff );
|
uint16_t data_1 = m_next_pixel_1_cb();
|
||||||
|
|
||||||
if ( data_0 == huc6270_device::HUC6270_SPRITE && data_1 == huc6270_device::HUC6270_SPRITE )
|
if ( data_0 == huc6270_device::HUC6270_SPRITE && data_1 == huc6270_device::HUC6270_SPRITE )
|
||||||
{
|
{
|
||||||
@ -152,10 +152,10 @@ READ16_MEMBER( huc6202_device::next_pixel )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ16_MEMBER( huc6202_device::time_until_next_event )
|
u16 huc6202_device::time_until_next_event()
|
||||||
{
|
{
|
||||||
uint16_t next_event_clocks_0 = m_time_til_next_event_0_cb( 0, 0xffff );
|
uint16_t next_event_clocks_0 = m_time_til_next_event_0_cb();
|
||||||
uint16_t next_event_clocks_1 = m_time_til_next_event_1_cb( 0, 0xffff );
|
uint16_t next_event_clocks_1 = m_time_til_next_event_1_cb();
|
||||||
|
|
||||||
return std::min( next_event_clocks_0, next_event_clocks_1 );
|
return std::min( next_event_clocks_0, next_event_clocks_1 );
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ WRITE_LINE_MEMBER( huc6202_device::hsync_changed )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ8_MEMBER( huc6202_device::read )
|
u8 huc6202_device::read(offs_t offset)
|
||||||
{
|
{
|
||||||
uint8_t data = 0xFF;
|
uint8_t data = 0xFF;
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ READ8_MEMBER( huc6202_device::read )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WRITE8_MEMBER( huc6202_device::write )
|
void huc6202_device::write(offs_t offset, u8 data)
|
||||||
{
|
{
|
||||||
switch ( offset & 7 )
|
switch ( offset & 7 )
|
||||||
{
|
{
|
||||||
@ -269,7 +269,7 @@ WRITE8_MEMBER( huc6202_device::write )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ8_MEMBER( huc6202_device::io_read )
|
u8 huc6202_device::io_read(offs_t offset)
|
||||||
{
|
{
|
||||||
if ( m_io_device )
|
if ( m_io_device )
|
||||||
{
|
{
|
||||||
@ -282,7 +282,7 @@ READ8_MEMBER( huc6202_device::io_read )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WRITE8_MEMBER( huc6202_device::io_write )
|
void huc6202_device::io_write(offs_t offset, u8 data)
|
||||||
{
|
{
|
||||||
if ( m_io_device )
|
if ( m_io_device )
|
||||||
{
|
{
|
||||||
|
@ -31,12 +31,12 @@ public:
|
|||||||
auto read_1_callback() { return m_read_1_cb.bind(); }
|
auto read_1_callback() { return m_read_1_cb.bind(); }
|
||||||
auto write_1_callback() { return m_write_1_cb.bind(); }
|
auto write_1_callback() { return m_write_1_cb.bind(); }
|
||||||
|
|
||||||
DECLARE_READ8_MEMBER( read );
|
u8 read(offs_t offset);
|
||||||
DECLARE_WRITE8_MEMBER( write );
|
void write(offs_t offset, u8 data);
|
||||||
DECLARE_READ8_MEMBER( io_read );
|
u8 io_read(offs_t offset);
|
||||||
DECLARE_WRITE8_MEMBER( io_write );
|
void io_write(offs_t offset, u8 data);
|
||||||
DECLARE_READ16_MEMBER( next_pixel );
|
u16 next_pixel();
|
||||||
DECLARE_READ16_MEMBER( time_until_next_event );
|
u16 time_until_next_event();
|
||||||
DECLARE_WRITE_LINE_MEMBER( vsync_changed );
|
DECLARE_WRITE_LINE_MEMBER( vsync_changed );
|
||||||
DECLARE_WRITE_LINE_MEMBER( hsync_changed );
|
DECLARE_WRITE_LINE_MEMBER( hsync_changed );
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
{
|
{
|
||||||
g_profiler.start( PROFILER_VIDEO );
|
g_profiler.start( PROFILER_VIDEO );
|
||||||
/* Get next pixel information */
|
/* Get next pixel information */
|
||||||
m_pixel_data = m_next_pixel_data_cb( 0, 0xffff );
|
m_pixel_data = m_next_pixel_data_cb();
|
||||||
g_profiler.stop();
|
g_profiler.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
|
|
||||||
/* Ask our slave device for time until next possible event */
|
/* Ask our slave device for time until next possible event */
|
||||||
{
|
{
|
||||||
uint16_t next_event_clocks = m_time_til_next_event_cb( 0, 0xffff );
|
uint16_t next_event_clocks = m_time_til_next_event_cb();
|
||||||
int event_hpos, event_vpos;
|
int event_hpos, event_vpos;
|
||||||
|
|
||||||
/* Adjust for pixel clocks per pixel */
|
/* Adjust for pixel clocks per pixel */
|
||||||
|
@ -108,8 +108,8 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
{
|
{
|
||||||
g_profiler.start( PROFILER_VIDEO );
|
g_profiler.start( PROFILER_VIDEO );
|
||||||
/* Get next pixel information */
|
/* Get next pixel information */
|
||||||
m_pixel_data_a = m_huc6270_a->next_pixel( machine().dummy_space(), 0, 0xffff );
|
m_pixel_data_a = m_huc6270_a->next_pixel();
|
||||||
m_pixel_data_b = m_huc6270_b->next_pixel( machine().dummy_space(), 0, 0xffff );
|
m_pixel_data_b = m_huc6270_b->next_pixel();
|
||||||
apply_pal_offs(&m_pixel_data_a);
|
apply_pal_offs(&m_pixel_data_a);
|
||||||
apply_pal_offs(&m_pixel_data_b);
|
apply_pal_offs(&m_pixel_data_b);
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ inline void huc6270_device::next_horz_state()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READ16_MEMBER( huc6270_device::next_pixel )
|
u16 huc6270_device::next_pixel()
|
||||||
{
|
{
|
||||||
uint16_t data = HUC6270_SPRITE;
|
uint16_t data = HUC6270_SPRITE;
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ READ16_MEMBER( huc6270_device::next_pixel )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//inline READ16_MEMBER( huc6270_device::time_until_next_event )
|
//inline u16 huc6270_device::time_until_next_event()
|
||||||
//{
|
//{
|
||||||
// return m_horz_to_go * 8 + m_horz_steps;
|
// return m_horz_to_go * 8 + m_horz_steps;
|
||||||
//}
|
//}
|
||||||
@ -596,7 +596,7 @@ inline void huc6270_device::handle_dma()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( huc6270_device::read )
|
u8 huc6270_device::read(offs_t offset)
|
||||||
{
|
{
|
||||||
uint8_t data = 0x00;
|
uint8_t data = 0x00;
|
||||||
|
|
||||||
@ -633,7 +633,7 @@ READ8_MEMBER( huc6270_device::read )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WRITE8_MEMBER( huc6270_device::write )
|
void huc6270_device::write(offs_t offset, u8 data)
|
||||||
{
|
{
|
||||||
LOG("%s: huc6270 write %02x <- %02x ", machine().describe_context(), offset, data);
|
LOG("%s: huc6270 write %02x <- %02x ", machine().describe_context(), offset, data);
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@ public:
|
|||||||
void set_vram_size(uint32_t vram_size) { m_vram_size = vram_size; }
|
void set_vram_size(uint32_t vram_size) { m_vram_size = vram_size; }
|
||||||
auto irq() { return m_irq_changed_cb.bind(); }
|
auto irq() { return m_irq_changed_cb.bind(); }
|
||||||
|
|
||||||
DECLARE_READ8_MEMBER( read );
|
u8 read(offs_t offset);
|
||||||
DECLARE_WRITE8_MEMBER( write );
|
void write(offs_t offset, u8 data);
|
||||||
DECLARE_READ16_MEMBER( next_pixel );
|
u16 next_pixel();
|
||||||
inline DECLARE_READ16_MEMBER( time_until_next_event )
|
inline u16 time_until_next_event()
|
||||||
{
|
{
|
||||||
return m_horz_to_go * 8 + m_horz_steps;
|
return m_horz_to_go * 8 + m_horz_steps;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user