(MESS) minor cleanup. nw.

This commit is contained in:
Fabio Priuli 2014-01-29 20:44:50 +00:00
parent af4577fc40
commit 18e5ac933b
2 changed files with 13 additions and 19 deletions

View File

@ -217,7 +217,6 @@ void gb_lcd_device::common_start()
machine().primary_screen->register_screen_bitmap(m_bitmap); machine().primary_screen->register_screen_bitmap(m_bitmap);
m_oam = auto_alloc_array_clear(machine(), UINT8, 0x100); m_oam = auto_alloc_array_clear(machine(), UINT8, 0x100);
m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gb_lcd_device::lcd_timer_proc),this));
machine().save().register_postload(save_prepost_delegate(FUNC(gb_lcd_device::videoptr_restore), this)); machine().save().register_postload(save_prepost_delegate(FUNC(gb_lcd_device::videoptr_restore), this));
m_maincpu = machine().device<cpu_device>("maincpu"); m_maincpu = machine().device<cpu_device>("maincpu");
@ -302,6 +301,7 @@ void cgb_lcd_device::videoptr_restore()
void gb_lcd_device::device_start() void gb_lcd_device::device_start()
{ {
common_start(); common_start();
m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gb_lcd_device::lcd_timer_proc),this));
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000); m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
save_pointer(NAME(m_vram), 0x2000); save_pointer(NAME(m_vram), 0x2000);
@ -312,6 +312,7 @@ void gb_lcd_device::device_start()
void mgb_lcd_device::device_start() void mgb_lcd_device::device_start()
{ {
common_start(); common_start();
m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mgb_lcd_device::lcd_timer_proc),this));
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000); m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
save_pointer(NAME(m_vram), 0x2000); save_pointer(NAME(m_vram), 0x2000);
@ -330,6 +331,7 @@ void mgb_lcd_device::device_start()
void sgb_lcd_device::device_start() void sgb_lcd_device::device_start()
{ {
common_start(); common_start();
m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sgb_lcd_device::lcd_timer_proc),this));
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000); m_vram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
save_pointer(NAME(m_vram), 0x2000); save_pointer(NAME(m_vram), 0x2000);
@ -358,6 +360,7 @@ void sgb_lcd_device::device_start()
void cgb_lcd_device::device_start() void cgb_lcd_device::device_start()
{ {
common_start(); common_start();
m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cgb_lcd_device::lcd_timer_proc),this));
m_vram = auto_alloc_array_clear(machine(), UINT8, 0x4000); m_vram = auto_alloc_array_clear(machine(), UINT8, 0x4000);
save_pointer(NAME(m_vram), 0x4000); save_pointer(NAME(m_vram), 0x4000);
@ -1447,7 +1450,7 @@ void gb_lcd_device::increment_scanline()
TIMER_CALLBACK_MEMBER(gb_lcd_device::lcd_timer_proc) TIMER_CALLBACK_MEMBER(gb_lcd_device::lcd_timer_proc)
{ {
static const int sprite_cycles[] = { 0, 8, 20, 32, 44, 52, 64, 76, 88, 96, 108 }; static const int gb_sprite_cycles[] = { 0, 8, 20, 32, 44, 52, 64, 76, 88, 96, 108 };
m_state = param; m_state = param;
@ -1602,7 +1605,7 @@ TIMER_CALLBACK_MEMBER(gb_lcd_device::lcd_timer_proc)
break; break;
case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */ case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */
select_sprites(); select_sprites();
m_sprite_cycles = sprite_cycles[m_sprCount]; m_sprite_cycles = gb_sprite_cycles[m_sprCount];
/* Set Mode 3 lcdstate */ /* Set Mode 3 lcdstate */
m_mode = 3; m_mode = 3;
LCDSTAT = (LCDSTAT & 0xFC) | 0x03; LCDSTAT = (LCDSTAT & 0xFC) | 0x03;
@ -1748,7 +1751,7 @@ void cgb_lcd_device::hdma_trans(UINT16 length)
TIMER_CALLBACK_MEMBER(cgb_lcd_device::lcd_timer_proc) TIMER_CALLBACK_MEMBER(cgb_lcd_device::lcd_timer_proc)
{ {
static const int sprite_cycles[] = { 0, 8, 20, 32, 44, 52, 64, 76, 88, 96, 108 }; static const int cgb_sprite_cycles[] = { 0, 8, 20, 32, 44, 52, 64, 76, 88, 96, 108 };
m_state = param; m_state = param;
@ -1925,7 +1928,7 @@ TIMER_CALLBACK_MEMBER(cgb_lcd_device::lcd_timer_proc)
break; break;
case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */ case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */
select_sprites(); select_sprites();
m_sprite_cycles = sprite_cycles[m_sprCount]; m_sprite_cycles = cgb_sprite_cycles[m_sprCount];
/* Set Mode 3 lcdstate */ /* Set Mode 3 lcdstate */
m_mode = 3; m_mode = 3;
LCDSTAT = (LCDSTAT & 0xFC) | 0x03; LCDSTAT = (LCDSTAT & 0xFC) | 0x03;

View File

@ -13,15 +13,6 @@
#define _NR_GB_VID_REGS 0x40 #define _NR_GB_VID_REGS 0x40
enum
{
GB_VIDEO_DMG = 1,
GB_VIDEO_MGB,
GB_VIDEO_SGB,
GB_VIDEO_CGB
};
struct layer_struct { struct layer_struct {
UINT8 enabled; UINT8 enabled;
UINT8 *bg_tiles; UINT8 *bg_tiles;