Merge pull request #4933 from cam900/huc6270_args

huc6270.cpp, huc6202.cpp : Simplify handlers
This commit is contained in:
R. Belmont 2019-04-29 20:40:30 -04:00 committed by GitHub
commit 17dfeb9b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 28 deletions

View File

@ -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_0 = m_next_pixel_0_cb( 0, 0xffff );
uint16_t data_1 = m_next_pixel_1_cb( 0, 0xffff );
uint16_t data_0 = m_next_pixel_0_cb();
uint16_t data_1 = m_next_pixel_1_cb();
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_1 = m_time_til_next_event_1_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();
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;
@ -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 )
{
@ -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 )
{
@ -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 )
{

View File

@ -31,12 +31,12 @@ public:
auto read_1_callback() { return m_read_1_cb.bind(); }
auto write_1_callback() { return m_write_1_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_READ8_MEMBER( io_read );
DECLARE_WRITE8_MEMBER( io_write );
DECLARE_READ16_MEMBER( next_pixel );
DECLARE_READ16_MEMBER( time_until_next_event );
u8 read(offs_t offset);
void write(offs_t offset, u8 data);
u8 io_read(offs_t offset);
void io_write(offs_t offset, u8 data);
u16 next_pixel();
u16 time_until_next_event();
DECLARE_WRITE_LINE_MEMBER( vsync_changed );
DECLARE_WRITE_LINE_MEMBER( hsync_changed );

View File

@ -77,7 +77,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
g_profiler.start( PROFILER_VIDEO );
/* 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();
}
@ -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 */
{
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;
/* Adjust for pixel clocks per pixel */

View File

@ -108,8 +108,8 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para
{
g_profiler.start( PROFILER_VIDEO );
/* Get next pixel information */
m_pixel_data_a = m_huc6270_a->next_pixel( machine().dummy_space(), 0, 0xffff );
m_pixel_data_b = m_huc6270_b->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();
apply_pal_offs(&m_pixel_data_a);
apply_pal_offs(&m_pixel_data_b);

View File

@ -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;
@ -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;
//}
@ -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;
@ -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);

View File

@ -21,10 +21,10 @@ public:
void set_vram_size(uint32_t vram_size) { m_vram_size = vram_size; }
auto irq() { return m_irq_changed_cb.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_READ16_MEMBER( next_pixel );
inline DECLARE_READ16_MEMBER( time_until_next_event )
u8 read(offs_t offset);
void write(offs_t offset, u8 data);
u16 next_pixel();
inline u16 time_until_next_event()
{
return m_horz_to_go * 8 + m_horz_steps;
}