mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
model2.cpp: cleanups (nw)
This commit is contained in:
parent
25811d74a8
commit
065879af71
@ -2130,6 +2130,32 @@ ADDRESS_MAP_END
|
||||
|
||||
#define VIDEO_CLOCK XTAL(32'000'000)
|
||||
|
||||
MACHINE_CONFIG_START(model2_state::model2_timers)
|
||||
MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)0)
|
||||
MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)1)
|
||||
MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)2)
|
||||
MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)3)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(model2_state::model2_screen)
|
||||
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
|
||||
MCFG_S24TILE_DEVICE_PALETTE("palette")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
|
||||
// TODO: from System 24, might not be accurate for Model 2
|
||||
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 8192)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(model2_state,model2)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/* original Model 2 */
|
||||
MACHINE_CONFIG_START(model2_state::model2o)
|
||||
MCFG_CPU_ADD("maincpu", I960, 25000000)
|
||||
@ -2150,26 +2176,8 @@ MACHINE_CONFIG_START(model2_state::model2o)
|
||||
MCFG_NVRAM_ADD_1FILL("backup1")
|
||||
MCFG_NVRAM_ADD_1FILL("backup2")
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)0)
|
||||
MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)1)
|
||||
MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)2)
|
||||
MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)3)
|
||||
|
||||
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
|
||||
MCFG_S24TILE_DEVICE_PALETTE("palette")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
|
||||
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) // TODO: from System 24, might not be accurate for Model 2
|
||||
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 8192)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(model2_state,model2)
|
||||
MCFG_FRAGMENT_ADD( model2_timers )
|
||||
MCFG_FRAGMENT_ADD( model2_screen )
|
||||
|
||||
MCFG_SEGAM1AUDIO_ADD(M1AUDIO_TAG)
|
||||
MCFG_SEGAM1AUDIO_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd))
|
||||
@ -2255,26 +2263,8 @@ MACHINE_CONFIG_START(model2_state::model2a)
|
||||
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
|
||||
MCFG_NVRAM_ADD_1FILL("backup1")
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)0)
|
||||
MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)1)
|
||||
MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)2)
|
||||
MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)3)
|
||||
|
||||
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
|
||||
MCFG_S24TILE_DEVICE_PALETTE("palette")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
|
||||
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) // TODO: from System 24, might not be accurate for Model 2
|
||||
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 8192)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(model2_state,model2)
|
||||
MCFG_FRAGMENT_ADD( model2_timers )
|
||||
MCFG_FRAGMENT_ADD( model2_screen )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -2350,26 +2340,8 @@ MACHINE_CONFIG_START(model2_state::model2b)
|
||||
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
|
||||
MCFG_NVRAM_ADD_1FILL("backup1")
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)0)
|
||||
MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)1)
|
||||
MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)2)
|
||||
MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)3)
|
||||
|
||||
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
|
||||
MCFG_S24TILE_DEVICE_PALETTE("palette")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
|
||||
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) // TODO: from System 24, might not be accurate for Model 2
|
||||
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 8192)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(model2_state,model2)
|
||||
MCFG_FRAGMENT_ADD( model2_timers )
|
||||
MCFG_FRAGMENT_ADD( model2_screen )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -2444,26 +2416,8 @@ MACHINE_CONFIG_START(model2_state::model2c)
|
||||
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
|
||||
MCFG_NVRAM_ADD_1FILL("backup1")
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)0)
|
||||
MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)1)
|
||||
MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)2)
|
||||
MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
|
||||
MCFG_TIMER_PTR((uintptr_t)3)
|
||||
|
||||
MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
|
||||
MCFG_S24TILE_DEVICE_PALETTE("palette")
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
|
||||
MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 656, 0/*+69*/, 496/*+69*/, 424, 0/*+25*/, 384/*+25*/) // TODO: from System 24, might not be accurate for Model 2
|
||||
MCFG_SCREEN_UPDATE_DRIVER(model2_state, screen_update_model2)
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 8192)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(model2_state,model2)
|
||||
MCFG_FRAGMENT_ADD( model2_timers )
|
||||
MCFG_FRAGMENT_ADD( model2_screen )
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
|
@ -230,6 +230,7 @@ public:
|
||||
DECLARE_MACHINE_RESET(model2_common);
|
||||
DECLARE_MACHINE_RESET(model2_scsp);
|
||||
uint32_t screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_model2);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(model2_timer_cb);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(model2_interrupt);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(model2c_interrupt);
|
||||
@ -249,6 +250,8 @@ public:
|
||||
|
||||
void model2_3d_frame_end( bitmap_rgb32 &bitmap, const rectangle &cliprect );
|
||||
|
||||
void model2_timers(machine_config &config);
|
||||
void model2_screen(machine_config &config);
|
||||
void daytona(machine_config &config);
|
||||
void indy500(machine_config &config);
|
||||
void manxtt(machine_config &config);
|
||||
|
@ -183,9 +183,8 @@ void MODEL2_FUNC_NAME(int32_t scanline, const extent_t& extent, const m2_poly_ex
|
||||
#endif
|
||||
luma = lumaram[BYTE_XOR_LE(lumabase + (t << 3))];
|
||||
|
||||
// Virtua Striker sets up a luma of 0x40 for flags, fix here.
|
||||
if(luma > 0x3f)
|
||||
luma = 0x3f;
|
||||
// Virtua Striker sets up a luma of 0x40 for national flags on bleachers, fix here.
|
||||
luma = std::min((int)luma,0x3f);
|
||||
|
||||
/* we have the 6 bits of luma information along with 5 bits per color component */
|
||||
/* now build and index into the master color lookup table and extract the raw RGB values */
|
||||
|
Loading…
Reference in New Issue
Block a user