From c756043e5509d0a94f60fc45f01745b1fd6671f5 Mon Sep 17 00:00:00 2001 From: Alex Marshall Date: Sat, 24 Jan 2015 15:12:59 -0800 Subject: Not found should actually return not found --- src/emu/audit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/emu/audit.c b/src/emu/audit.c index c8ca031243b..e02ddbcc77b 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -382,6 +382,7 @@ media_auditor::summary media_auditor::summarize(const char *name, astring *strin else string->catprintf("NOT FOUND (%s)\n", shared_device->shortname()); } + best_new_status = NOTFOUND; break; case audit_record::SUBSTATUS_NOT_FOUND_NODUMP: -- cgit v1.2.3 From e3ec10eb4c53b6abd6cb3ee0019ab2277b3f471b Mon Sep 17 00:00:00 2001 From: Alex Marshall Date: Sat, 24 Jan 2015 15:13:59 -0800 Subject: Don't error if there is just an incorrect ROM --- src/emu/ui/selgame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/ui/selgame.c b/src/emu/ui/selgame.c index 19e83a7dd54..5183b1b5275 100644 --- a/src/emu/ui/selgame.c +++ b/src/emu/ui/selgame.c @@ -157,7 +157,7 @@ void ui_menu_select_game::inkey_select(const ui_menu_event *menu_event) media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST); // if everything looks good, schedule the new driver - if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED) + if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED || summary == media_auditor::INCORRECT) { machine().manager().schedule_new_driver(*driver); machine().schedule_hard_reset(); -- cgit v1.2.3 From e8b343f79ec0710de687b83538a5c4c24a4e47c0 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 3 Feb 2015 00:35:04 +0100 Subject: Fixed natural keyboard input on all platforms for SDL2 builds. (nw) --- src/osd/sdl/input.c | 12 ++++++++---- src/osd/sdl/testkeys.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c index 0fdb881fb9a..48a30c5d874 100644 --- a/src/osd/sdl/input.c +++ b/src/osd/sdl/input.c @@ -1758,7 +1758,10 @@ void sdlinput_poll(running_machine &machine) devinfo = generic_device_find_index( keyboard_list, keyboard_map.logical[0]); #endif devinfo->keyboard.state[OSD_SDL_INDEX_KEYSYM(&event.key.keysym)] = 0x80; -#if (!SDLMAME_SDL2) +#if (SDLMAME_SDL2) + if (event.key.keysym.sym < 0x20) + ui_input_push_char_event(machine, sdl_window_list->m_target, event.key.keysym.sym); +#else ui_input_push_char_event(machine, sdl_window_list->m_target, (unicode_char) event.key.keysym.unicode); #endif break; @@ -1859,7 +1862,7 @@ void sdlinput_poll(running_machine &machine) int cx, cy; osd_ticks_t click = osd_ticks() * 1000 / osd_ticks_per_second(); sdl_window_info *window = GET_FOCUS_WINDOW(&event.button); - if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_down_event(machine, window->m_target, cx, cy); // FIXME Parameter ? @@ -1893,7 +1896,7 @@ void sdlinput_poll(running_machine &machine) int cx, cy; sdl_window_info *window = GET_FOCUS_WINDOW(&event.button); - if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_up_event(machine, window->m_target, cx, cy); } @@ -1918,7 +1921,7 @@ void sdlinput_poll(running_machine &machine) int cx=-1, cy=-1; sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion); - if (window != NULL && window->renderer().xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) ui_input_push_mouse_move_event(machine, window->m_target, cx, cy); } break; @@ -1947,6 +1950,7 @@ void sdlinput_poll(running_machine &machine) case SDL_TEXTINPUT: if (*event.text.text) { + printf("char %c\n", *event.text.text); sdl_window_info *window = GET_FOCUS_WINDOW(&event.text); unicode_char result; if (window != NULL ) diff --git a/src/osd/sdl/testkeys.c b/src/osd/sdl/testkeys.c index 409e43307e1..6282fa6b8eb 100644 --- a/src/osd/sdl/testkeys.c +++ b/src/osd/sdl/testkeys.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) printf("ITEM_ID_XY %s 0x%x 0x%x %s\n", lookup_key_name(sdl_lookup, event.key.keysym.scancode), (int) event.key.keysym.scancode, - 0, //(int) event.key.keysym.unicode, + (int) event.key.keysym.sym, ""); lasttext[0] = 0; #else @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) printf("ITEM_ID_XY %s 0x%x 0x%x %s\n", lookup_key_name(sdl_lookup, event.key.keysym.scancode), (int) event.key.keysym.scancode, - 0, //(int) event.key.keysym.unicode, + (int) event.key.keysym.sym, lasttext); #else memset(buf, 0, 19); -- cgit v1.2.3 From c9829f91b7488f4e7bd71b4d2dabcca9cc8e8c24 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 3 Feb 2015 00:42:00 +0100 Subject: Make sure testkeys ends up in $(BIN). (nw) --- src/osd/sdl/sdl.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index b208adca5df..8adab97289b 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -894,7 +894,7 @@ $(LIBOSD): $(OSDOBJS) #------------------------------------------------- TOOLS += \ - testkeys$(EXE) + $(BIN)testkeys$(EXE) $(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c @echo Compiling $<... @@ -903,7 +903,7 @@ $(SDLOBJ)/testkeys.o: $(SDLSRC)/testkeys.c TESTKEYSOBJS = \ $(SDLOBJ)/testkeys.o \ -testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN) +$(BIN)testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN) @echo Linking $@... $(LD) $(LDFLAGS) $^ $(BASELIBS) -o $@ -- cgit v1.2.3 From 2e8389c9786c3df2b34d2509cf60e88bf7596c32 Mon Sep 17 00:00:00 2001 From: arbee Date: Mon, 2 Feb 2015 21:55:20 -0500 Subject: Fix SDL build breakage (nw) --- src/osd/sdl/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c index 48a30c5d874..b2fa6b1da1b 100644 --- a/src/osd/sdl/input.c +++ b/src/osd/sdl/input.c @@ -1862,7 +1862,7 @@ void sdlinput_poll(running_machine &machine) int cx, cy; osd_ticks_t click = osd_ticks() * 1000 / osd_ticks_per_second(); sdl_window_info *window = GET_FOCUS_WINDOW(&event.button); - if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_down_event(machine, window->m_target, cx, cy); // FIXME Parameter ? @@ -1896,7 +1896,7 @@ void sdlinput_poll(running_machine &machine) int cx, cy; sdl_window_info *window = GET_FOCUS_WINDOW(&event.button); - if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_up_event(machine, window->m_target, cx, cy); } @@ -1921,7 +1921,7 @@ void sdlinput_poll(running_machine &machine) int cx=-1, cy=-1; sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion); - if (window != NULL && window->xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) + if (window != NULL && window->renderer().xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) ui_input_push_mouse_move_event(machine, window->m_target, cx, cy); } break; -- cgit v1.2.3 From d80aa44688ebb14791a07271cbd3227e11ff2802 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 3 Feb 2015 14:24:25 +0100 Subject: i had to revert this part, it doesn't work (incompatible or not needed anymore after Fabio's UI improvements) --- src/emu/ui/selgame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/ui/selgame.c b/src/emu/ui/selgame.c index 5183b1b5275..19e83a7dd54 100644 --- a/src/emu/ui/selgame.c +++ b/src/emu/ui/selgame.c @@ -157,7 +157,7 @@ void ui_menu_select_game::inkey_select(const ui_menu_event *menu_event) media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST); // if everything looks good, schedule the new driver - if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED || summary == media_auditor::INCORRECT) + if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED) { machine().manager().schedule_new_driver(*driver); machine().schedule_hard_reset(); -- cgit v1.2.3 From fc541a77e1d81f4bb275141b8d37c4132ecd1806 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 3 Feb 2015 15:41:49 +0100 Subject: added led matrix for testing --- src/mess/drivers/wildfire.c | 10 ++++- src/mess/layout/wildfire.lay | 98 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/src/mess/drivers/wildfire.c b/src/mess/drivers/wildfire.c index 3ba07f12202..c54ad7e6dcf 100644 --- a/src/mess/drivers/wildfire.c +++ b/src/mess/drivers/wildfire.c @@ -16,7 +16,7 @@ // master clock is a single stage RC oscillator: R=?K, C=?pf, // S2150 default frequency is 850kHz -#define MASTER_CLOCK (850000) +#define MASTER_CLOCK (850000/4) class wildfire_state : public driver_device @@ -38,6 +38,7 @@ public: UINT16 m_leds_cache[0x10]; UINT8 m_leds_decay[0x100]; + DECLARE_READ8_MEMBER(read_k); DECLARE_WRITE8_MEMBER(write_d); DECLARE_WRITE16_MEMBER(write_a); @@ -127,6 +128,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(wildfire_state::leds_decay_tick) ***************************************************************************/ +READ8_MEMBER(wildfire_state::read_k) +{ + // ? + return 0xf; +} + WRITE8_MEMBER(wildfire_state::write_d) { m_d = data; @@ -188,6 +195,7 @@ static MACHINE_CONFIG_START( wildfire, wildfire_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", AMI_S2150, MASTER_CLOCK) MCFG_AMI_S2000_READ_I_CB(IOPORT("IN1")) + MCFG_AMI_S2000_READ_K_CB(READ8(wildfire_state, read_k)) MCFG_AMI_S2000_WRITE_D_CB(WRITE8(wildfire_state, write_d)) MCFG_AMI_S2000_WRITE_A_CB(WRITE16(wildfire_state, write_a)) diff --git a/src/mess/layout/wildfire.lay b/src/mess/layout/wildfire.lay index 781e5caf014..d71f2abb6a6 100644 --- a/src/mess/layout/wildfire.lay +++ b/src/mess/layout/wildfire.lay @@ -8,6 +8,10 @@ + + + + @@ -22,5 +26,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 16a11112eba00a4895d2ef731597d3654ae124e1 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 3 Feb 2015 18:09:14 +0100 Subject: wink.c: added save state support (nw) --- src/mame/drivers/wink.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c index 3e7a8975669..1fbfc478c9f 100644 --- a/src/mame/drivers/wink.c +++ b/src/mame/drivers/wink.c @@ -22,15 +22,21 @@ class wink_state : public driver_device public: wink_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode"), + m_videoram(*this, "videoram") { } + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_shared_ptr m_videoram; + tilemap_t *m_bg_tilemap; UINT8 m_sound_flag; UINT8 m_tile_bank; + DECLARE_WRITE8_MEMBER(bgram_w); DECLARE_WRITE8_MEMBER(player_mux_w); DECLARE_WRITE8_MEMBER(tile_banking_w); @@ -41,15 +47,17 @@ public: DECLARE_READ8_MEMBER(prot_r); DECLARE_WRITE8_MEMBER(prot_w); DECLARE_READ8_MEMBER(sound_r); - DECLARE_DRIVER_INIT(wink); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + DECLARE_DRIVER_INIT(wink); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); + UINT32 screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(wink_sound); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_gfxdecode; }; @@ -331,6 +339,12 @@ INTERRUPT_GEN_MEMBER(wink_state::wink_sound) m_sound_flag ^= 0x80; } +void wink_state::machine_start() +{ + save_item(NAME(m_sound_flag)); + save_item(NAME(m_tile_bank)); +} + void wink_state::machine_reset() { m_sound_flag = 0; @@ -431,5 +445,5 @@ DRIVER_INIT_MEMBER(wink_state,wink) ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0); } -GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) -GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) +GAME( 1985, wink, 0, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) +GAME( 1985, winka, wink, wink, wink, wink_state, wink, ROT0, "Midcoin", "Wink (set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) -- cgit v1.2.3 From 84c053f76edc337823133ab64c46e492d6a28d12 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 3 Feb 2015 19:31:11 +0100 Subject: Reowrked the -video soft driver so it works like accel and opengl. That will enable the move of some now identical functions back to window.c. (nw) --- src/osd/sdl/drawsdl.c | 212 ++++++++++++++++++++++++++------------------------ src/osd/sdl/input.c | 6 +- src/osd/sdl/window.c | 35 ++++----- src/osd/sdl/window.h | 19 ++++- 4 files changed, 147 insertions(+), 125 deletions(-) diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 48ac2d596ba..2d9719f4afb 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -64,8 +64,8 @@ public: #endif m_yuv_lookup(NULL), m_yuv_bitmap(NULL), - m_hw_scale_width(0), - m_hw_scale_height(0), + //m_hw_scale_width(0), + //m_hw_scale_height(0), m_last_hofs(0), m_last_vofs(0), m_old_blitwidth(0), @@ -114,8 +114,6 @@ public: // if we leave scaling to SDL and the underlying driver, this // is the render_target_width/height to use - int m_hw_scale_width; - int m_hw_scale_height; int m_last_hofs; int m_last_vofs; int m_old_blitwidth; @@ -135,7 +133,7 @@ struct sdl_scale_mode const char *sdl_scale_mode; /* what to use as a hint ? */ #endif int pixel_format; /* Pixel/Overlay format */ - void (*yuv_blit)(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); + void (*yuv_blit)(const UINT16 *bitmap, UINT8 *ptr, const int pitch, const UINT32 *lookup, const int width, const int height); }; //============================================================ @@ -151,10 +149,14 @@ static void drawsdl_exit(void); // YUV overlays -static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); -static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); -static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); -static void yuv_RGB_to_YUY2X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch); +static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height); +static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height); +static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height); +static void yuv_RGB_to_YUY2X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height); // Static declarations @@ -163,8 +165,8 @@ static int shown_video_info = 0; static const sdl_scale_mode scale_modes[] = { - { "none", 0, 0, 0, 0, SDL_DOUBLEBUF, 0, 0 }, - { "async", 0, 0, 0, 0, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 }, + { "none", 0, 0, 1, 1, SDL_DOUBLEBUF, 0, 0 }, + { "async", 0, 0, 1, 1, SDL_DOUBLEBUF | SDL_ASYNCBLIT, 0, 0 }, { "yv12", 1, 1, 1, 1, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12 }, { "yv12x2", 1, 1, 2, 2, 0, SDL_YV12_OVERLAY, yuv_RGB_to_YV12X2 }, { "yuy2", 1, 1, 1, 1, 0, SDL_YUY2_OVERLAY, yuv_RGB_to_YUY2 }, @@ -174,7 +176,7 @@ static const sdl_scale_mode scale_modes[] = #else static const sdl_scale_mode scale_modes[] = { - { "none", 0, 0, 0, 0, DRAW2_SCALEMODE_NEAREST, 0, 0 }, + { "none", 0, 0, 1, 1, DRAW2_SCALEMODE_NEAREST, 0, 0 }, { "hwblit", 1, 0, 1, 1, DRAW2_SCALEMODE_LINEAR, 0, 0 }, { "hwbest", 1, 0, 1, 1, DRAW2_SCALEMODE_BEST, 0, 0 }, { "yv12", 1, 1, 1, 1, DRAW2_SCALEMODE_NEAREST, SDL_PIXELFORMAT_YV12, yuv_RGB_to_YV12 }, @@ -280,8 +282,13 @@ void sdl_info::setup_texture(int tempwidth, int tempheight) m_yuv_bitmap = NULL; } + fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format); + if (sdl_sm->is_scale) { + int m_hw_scale_width =0; + int m_hw_scale_height = 0; + window().m_target->compute_minimum_size(m_hw_scale_width, m_hw_scale_height); if (video_config.prescale) { @@ -291,15 +298,9 @@ void sdl_info::setup_texture(int tempwidth, int tempheight) /* This must be a multiple of 2 */ m_hw_scale_width = (m_hw_scale_width + 1) & ~1; } - } - - if (sdl_sm->is_yuv) - m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height); - - fmt = (sdl_sm->pixel_format ? sdl_sm->pixel_format : mode.format); + if (sdl_sm->is_yuv) + m_yuv_bitmap = global_alloc_array(UINT16, m_hw_scale_width * m_hw_scale_height); - if (sdl_sm->is_scale) - { int w = m_hw_scale_width * sdl_sm->mult_w; int h = m_hw_scale_height * sdl_sm->mult_h; @@ -355,9 +356,6 @@ void sdl_info::yuv_overlay_init() //return 1; } - m_hw_scale_width = minimum_width; - m_hw_scale_height = minimum_height; - if (!shown_video_info) { osd_printf_verbose("YUV Mode : %s\n", sdl_sm->name); @@ -546,10 +544,8 @@ int sdl_info::create(int width, int height) if (!m_sdlsurf) return 1; - window().m_width = m_sdlsurf->w; window().m_height = m_sdlsurf->h; - if (sm->is_yuv) yuv_overlay_init(); @@ -589,10 +585,11 @@ void sdl_info::resize(int width, int height) m_sdlsurf = SDL_SetVideoMode(width, height, 0, SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags); + window().m_width = m_sdlsurf->w; window().m_height = m_sdlsurf->h; - if (sdl_sm->is_yuv) + if (sdl_sm->is_yuv) { yuv_overlay_init(); } @@ -670,13 +667,6 @@ int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt) return 0; if (*yt<0 || *xt >= window().m_blitheight) return 0; - if (!sm->is_scale) - { - return 1; - } - /* Rescale */ - *xt = (*xt * m_hw_scale_width) / window().m_blitwidth; - *yt = (*yt * m_hw_scale_height) / window().m_blitheight; return 1; } @@ -686,12 +676,7 @@ int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt) void sdl_info::set_target_bounds() { - const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; - - if (!sm->is_scale) - window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); - else - window().m_target->set_bounds(m_hw_scale_width, m_hw_scale_height); + window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); } //============================================================ @@ -703,12 +688,12 @@ int sdl_info::draw(UINT32 dc, int update) const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; UINT8 *surfptr; INT32 pitch; - int bpp; Uint32 rmask, gmask, bmask; #if (SDLMAME_SDL2) Uint32 amask; #endif INT32 vofs, hofs, blitwidth, blitheight, ch, cw; + int bpp; if (video_config.novideo) { @@ -750,6 +735,12 @@ int sdl_info::draw(UINT32 dc, int update) SDL_LockYUVOverlay(m_yuvsurf); surfptr = m_yuvsurf->pixels[0]; // (UINT8 *) m_yuv_bitmap; pitch = m_yuvsurf->pitches[0]; // (UINT8 *) m_yuv_bitmap; +#if 0 + printf("abcd %d\n", m_yuvsurf->h); + printf("abcd %d %d %d\n", m_yuvsurf->pitches[0], m_yuvsurf->pitches[1], m_yuvsurf->pitches[2]); + printf("abcd %p %p %p\n", m_yuvsurf->pixels[0], m_yuvsurf->pixels[1], m_yuvsurf->pixels[2]); + printf("abcd %ld %ld\n", m_yuvsurf->pixels[1] - m_yuvsurf->pixels[0], m_yuvsurf->pixels[2] - m_yuvsurf->pixels[1]); +#endif } else surfptr = (UINT8 *)m_sdlsurf->pixels; @@ -832,24 +823,47 @@ int sdl_info::draw(UINT32 dc, int update) window().m_primlist->acquire_lock(); - // render to it - if (!sm->is_yuv) - { - int mamewidth, mameheight; + int mamewidth, mameheight; - if (!sm->is_scale) - { - mamewidth = blitwidth; - mameheight = blitheight; #if !SDLMAME_SDL2 + if (!sm->is_yuv) + { surfptr += ((vofs * pitch) + (hofs * bpp)); -#endif + mamewidth = blitwidth; //m_sdlsurf->w; + mameheight = blitheight; //m_sdlsurf->h; } else { - mamewidth = m_hw_scale_width; - mameheight = m_hw_scale_height; + mamewidth = m_yuvsurf->w / sm->mult_w; + mameheight = m_yuvsurf->h / sm->mult_h; } +#else + Uint32 fmt = 0; + int access = 0; + SDL_QueryTexture(m_texture_id, &fmt, &access, &mamewidth, &mameheight); + mamewidth /= sm->mult_w; + mameheight /= sm->mult_h; +#endif + //printf("w h %d %d %d %d\n", mamewidth, mameheight, blitwidth, blitheight); + + // rescale bounds + float fw = (float) mamewidth / (float) blitwidth; + float fh = (float) mameheight / (float) blitheight; + + // FIXME: this could be a lot easier if we get the primlist here! + // Bounds would be set fit for purpose and done! + + for (render_primitive *prim = window().m_primlist->first(); prim != NULL; prim = prim->next()) + { + prim->bounds.x0 *= fw; + prim->bounds.x1 *= fw; + prim->bounds.y0 *= fh; + prim->bounds.y1 *= fh; + } + + // render to it + if (!sm->is_yuv) + { switch (rmask) { case 0x0000ff00: @@ -881,8 +895,8 @@ int sdl_info::draw(UINT32 dc, int update) { assert (m_yuv_bitmap != NULL); assert (surfptr != NULL); - software_renderer::draw_primitives(*window().m_primlist, m_yuv_bitmap, m_hw_scale_width, m_hw_scale_height, m_hw_scale_width); - sm->yuv_blit((UINT16 *)m_yuv_bitmap, this, surfptr, pitch); + software_renderer::draw_primitives(*window().m_primlist, m_yuv_bitmap, mamewidth, mameheight, mamewidth); + sm->yuv_blit((UINT16 *)m_yuv_bitmap, surfptr, pitch, m_yuv_lookup, mamewidth, mameheight); } window().m_primlist->release_lock(); @@ -992,32 +1006,29 @@ void sdl_info::yuv_init() } } -static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) +//UINT32 *lookup = sdl->m_yuv_lookup; + +static void yuv_RGB_to_YV12(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height) { int x, y; - UINT8 *dest_y; - UINT8 *dest_u; - UINT8 *dest_v; - UINT16 *src; - UINT16 *src2; - UINT32 *lookup = sdl->m_yuv_lookup; UINT8 *pixels[3]; int u1,v1,y1,u2,v2,y2,u3,v3,y3,u4,v4,y4; /* 12 */ pixels[0] = ptr; - pixels[1] = ptr + pitch * sdl->m_hw_scale_height; - pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 4; + pixels[1] = ptr + pitch * height; + pixels[2] = pixels[1] + pitch * height / 4; - for(y=0;ym_hw_scale_height;y+=2) + for(y=0;ym_hw_scale_width) ; - src2=src + sdl->m_hw_scale_width; + const UINT16 *src=bitmap + (y * width) ; + const UINT16 *src2=src + width; - dest_y = pixels[0] + y * pitch; - dest_v = pixels[1] + (y>>1) * pitch / 2; - dest_u = pixels[2] + (y>>1) * pitch / 2; + UINT8 *dest_y = pixels[0] + y * pitch; + UINT8 *dest_v = pixels[1] + (y>>1) * pitch / 2; + UINT8 *dest_u = pixels[2] + (y>>1) * pitch / 2; - for(x=0;xm_hw_scale_width;x+=2) + for(x=0;x>Y1SHIFT) & 0xff; @@ -1051,31 +1062,34 @@ static void yuv_RGB_to_YV12(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch } } -static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) +static void yuv_RGB_to_YV12X2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height) { /* this one is used when scale==2 */ unsigned int x,y; - UINT16 *dest_y; - UINT8 *dest_u; - UINT8 *dest_v; - UINT16 *src; int u1,v1,y1; UINT8 *pixels[3]; pixels[0] = ptr; - pixels[1] = ptr + pitch * sdl->m_hw_scale_height * 2; - pixels[2] = pixels[1] + pitch * sdl->m_hw_scale_height / 2; + pixels[1] = ptr + pitch * height * 2; +#if (SDLMAME_SDL2) + int p2 = (pitch >> 1); +#else + int p2 = (pitch + 7) & ~ 7;; + p2 = (p2 >> 1); +#endif + pixels[2] = pixels[1] + p2 * height; - for(y=0;ym_hw_scale_height;y++) + for(y=0;ym_hw_scale_width) ; + const UINT16 *src = bitmap + (y * width) ; - dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch); - dest_v = pixels[1] + y * pitch / 2; - dest_u = pixels[2] + y * pitch / 2; - for(x=0;xm_hw_scale_width;x++) + UINT16 *dest_y = (UINT16 *)(pixels[0] + 2 * y * pitch); + UINT8 *dest_v = pixels[1] + y * p2; + UINT8 *dest_u = pixels[2] + y * p2; + for(x=0;xm_yuv_lookup[src[x]]; + v1 = lookup[src[x]]; y1 = (v1 >> Y1SHIFT) & 0xff; u1 = (v1 >> USHIFT) & 0xff; v1 = (v1 >> VSHIFT) & 0xff; @@ -1088,23 +1102,20 @@ static void yuv_RGB_to_YV12X2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pit } } -static void yuv_RGB_to_YUY2(UINT16 *bitmap, sdl_info *sdl, UINT8 *ptr, int pitch) +static void yuv_RGB_to_YUY2(const UINT16 *bitmap, UINT8 *ptr, const int pitch, \ + const UINT32 *lookup, const int width, const int height) { /* this one is used when scale==2 */ unsigned int y; - UINT32 *dest; - UINT16 *src; - UINT16 *end; UINT32 p1,p2,uv; - UINT32 *lookup = sdl->m_yuv_lookup; - int yuv_pitch = pitch/4; + const int yuv_pitch = pitch/4; - for(y=0;ym_hw_scale_height;y++) + for(y=0;ym_hw_scale_width) ; - end=src+sdl->m_hw_scale_width; + const UINT16 *src=bitmap + (y * width) ; + const UINT16 *end=src+width; - dest = (UINT32 *) ptr; + UINT32 *dest = (UINT32 *) ptr; dest += y * yuv_pitch; for(; srcm_yuv_lookup; int yuv_pitch = pitch / 4; - for(y=0;ym_hw_scale_height;y++) + for(y=0;ym_hw_scale_width) ; - end=src+sdl->m_hw_scale_width; + const UINT16 *src=bitmap + (y * width) ; + const UINT16 *end=src+width; - dest = (UINT32 *) ptr; + UINT32 *dest = (UINT32 *) ptr; dest += (y * yuv_pitch); for(; srcrenderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_down_event(machine, window->m_target, cx, cy); // FIXME Parameter ? @@ -1896,7 +1896,7 @@ void sdlinput_poll(running_machine &machine) int cx, cy; sdl_window_info *window = GET_FOCUS_WINDOW(&event.button); - if (window != NULL && window->renderer().xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.button.x,event.button.y, &cx, &cy) ) { ui_input_push_mouse_up_event(machine, window->m_target, cx, cy); } @@ -1921,7 +1921,7 @@ void sdlinput_poll(running_machine &machine) int cx=-1, cy=-1; sdl_window_info *window = GET_FOCUS_WINDOW(&event.motion); - if (window != NULL && window->renderer().xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) + if (window != NULL && window->xy_to_render_target(event.motion.x, event.motion.y, &cx, &cy) ) ui_input_push_mouse_move_event(machine, window->m_target, cx, cy); } break; diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c index d0a555d48e5..f5919efab44 100644 --- a/src/osd/sdl/window.c +++ b/src/osd/sdl/window.c @@ -55,8 +55,6 @@ #define ASSERT_WINDOW_THREAD() ASSERT_USE(window_threadid) #define ASSERT_MAIN_THREAD() ASSERT_USE(main_threadid) -#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid) - // minimum window dimension #define MIN_WINDOW_DIM 200 @@ -141,14 +139,9 @@ private: // PROTOTYPES //============================================================ -static OSDWORK_CALLBACK( draw_video_contents_wt ); -static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt ); -static OSDWORK_CALLBACK( sdlwindow_resize_wt ); -static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt ); static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window); static void sdlwindow_sync(void); -static void *complete_create_wt(void *param, int threadid); static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view); //============================================================ @@ -483,7 +476,7 @@ void sdl_window_info::blit_surface_size(int window_width, int window_height) // (main thread) //============================================================ -static OSDWORK_CALLBACK( sdlwindow_resize_wt ) +OSDWORK_CALLBACK( sdl_window_info::sdlwindow_resize_wt ) { worker_param * wp = (worker_param *) param; sdl_window_info * window = wp->window(); @@ -517,7 +510,7 @@ void sdl_window_info::window_resize(INT32 width, INT32 height) // (window thread) //============================================================ -static OSDWORK_CALLBACK( sdlwindow_clear_surface_wt ) +OSDWORK_CALLBACK( sdl_window_info::sdlwindow_clear_surface_wt ) { worker_param *wp = (worker_param *) param; sdl_window_info *window = wp->window(); @@ -547,7 +540,7 @@ void sdl_window_info::window_clear() // (main thread) //============================================================ -static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt ) +OSDWORK_CALLBACK( sdl_window_info::sdlwindow_toggle_full_screen_wt ) { worker_param *wp = (worker_param *) param; sdl_window_info *window = wp->window(); @@ -583,7 +576,7 @@ void sdl_window_info::toggle_full_screen(running_machine &machine) execute_async_wait(&sdlwindow_toggle_full_screen_wt, worker_param(machine, this)); } -static OSDWORK_CALLBACK( destroy_all_textures_wt ) +OSDWORK_CALLBACK( sdl_window_info::destroy_all_textures_wt ) { worker_param *wp = (worker_param *) param; @@ -703,6 +696,10 @@ static OSDWORK_CALLBACK( sdlwindow_update_cursor_state_wt ) return NULL; } +int sdl_window_info::xy_to_render_target(int x, int y, int *xt, int *yt) +{ + return renderer().xy_to_render_target(x, y, xt, yt); +} //============================================================ // sdlwindow_video_window_create @@ -753,13 +750,13 @@ int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monit { osd_work_item *wi; - wi = osd_work_item_queue(work_queue, &complete_create_wt, (void *) wp, 0); + wi = osd_work_item_queue(work_queue, &sdl_window_info::complete_create_wt, (void *) wp, 0); sdlwindow_sync(); result = *((int *) (osd_work_item_result)(wi)); osd_work_item_release(wi); } else - result = *((int *) complete_create_wt((void *) wp, 0)); + result = *((int *) sdl_window_info::complete_create_wt((void *) wp, 0)); // handle error conditions if (result == 1) @@ -780,7 +777,7 @@ error: // (main thread) //============================================================ -static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt ) +OSDWORK_CALLBACK( sdl_window_info::sdlwindow_video_window_destroy_wt ) { worker_param * wp = (worker_param *) param; sdl_window_info * window = wp->window(); @@ -1075,7 +1072,7 @@ static void set_starting_view(running_machine &machine, int index, sdl_window_in // (window thread) //============================================================ -static OSDWORK_CALLBACK( complete_create_wt ) +OSDWORK_CALLBACK( sdl_window_info::complete_create_wt ) { worker_param * wp = (worker_param *) param; sdl_window_info * window = wp->window(); @@ -1139,7 +1136,7 @@ static OSDWORK_CALLBACK( complete_create_wt ) // (window thread) //============================================================ -static void measure_fps(sdl_window_info *window, UINT32 dc, int update) +void sdl_window_info::measure_fps(UINT32 dc, int update) { const unsigned long frames_skip4fps = 100; static int64_t lastTime=0, sumdt=0, startTime=0; @@ -1154,7 +1151,7 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update) t0 = osd_ticks(); - window->renderer().draw(dc, update); + renderer().draw(dc, update); frames++; currentTime = osd_ticks(); @@ -1181,7 +1178,7 @@ static void measure_fps(sdl_window_info *window, UINT32 dc, int update) } } -static OSDWORK_CALLBACK( draw_video_contents_wt ) +OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt ) { UINT32 dc = 0; int update = 1; @@ -1203,7 +1200,7 @@ static OSDWORK_CALLBACK( draw_video_contents_wt ) else { if( video_config.perftest ) - measure_fps(window, dc, update); + window->measure_fps(dc, update); else window->renderer().draw(dc, update); } diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h index 5ed3143c4ab..552be888fde 100644 --- a/src/osd/sdl/window.h +++ b/src/osd/sdl/window.h @@ -57,6 +57,8 @@ private: sdl_window_info *m_window; }; +#define OSDWORK_CALLBACK(name) void *name(void *param, ATTR_UNUSED int threadid) + class sdl_window_info { public: @@ -116,7 +118,7 @@ public: void pick_best_mode(int *fswidth, int *fsheight); int index() const { return m_index; } - osd_renderer &renderer() { return *m_renderer; } + int xy_to_render_target(int x, int y, int *xt, int *yt); // Pointer to next window sdl_window_info * m_next; @@ -167,6 +169,10 @@ public: { m_renderer = renderer; } + + static OSDWORK_CALLBACK( complete_create_wt ); +protected: + osd_renderer &renderer() { return *m_renderer; } private: void constrain_to_aspect_ratio(int *window_width, int *window_height, int adjustment); @@ -178,6 +184,17 @@ private: int m_index; osd_renderer * m_renderer; + // static callbacks ... + + static OSDWORK_CALLBACK( sdlwindow_resize_wt ); + static OSDWORK_CALLBACK( draw_video_contents_wt ); + static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt ); + static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt ); + static OSDWORK_CALLBACK( sdlwindow_clear_surface_wt ); + static OSDWORK_CALLBACK( destroy_all_textures_wt ); + + void measure_fps(UINT32 dc, int update); + }; struct sdl_draw_info -- cgit v1.2.3 From 7082eabacaed7fdf9099d0e428556bcca1da1cb4 Mon Sep 17 00:00:00 2001 From: mamehaze Date: Tue, 3 Feb 2015 20:58:02 +0000 Subject: new WORKING game PuzzLove [Manuel Assoni] --- src/mame/drivers/silvmil.c | 113 ++++++++++++++++++++++++++++++++++++++++++++- src/mame/mame.lst | 1 + src/mame/video/decospr.c | 27 ++++++++++- src/mame/video/decospr.h | 5 ++ 4 files changed, 143 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/silvmil.c b/src/mame/drivers/silvmil.c index 17de8700866..8f8c4744260 100644 --- a/src/mame/drivers/silvmil.c +++ b/src/mame/drivers/silvmil.c @@ -261,6 +261,85 @@ static INPUT_PORTS_START( silvmil ) PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) /* Verified */ INPUT_PORTS_END + +static INPUT_PORTS_START( puzzlove ) + PORT_START("P1_P2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) + + PORT_START("COIN") + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW") + PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + + + static const gfx_layout tlayout = { 16,16, @@ -352,6 +431,10 @@ static MACHINE_CONFIG_START( silvmil, silvmil_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( puzzlove, silvmil ) + MCFG_DEVICE_MODIFY("spritegen") + MCFG_DECO_SPRITE_BOOTLEG_TYPE(1) +MACHINE_CONFIG_END ROM_START( silvmil ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ @@ -405,6 +488,33 @@ ROM_START( silvmil ) ROM_LOAD16_BYTE( "d-20_u56.bin", 0x100001, 0x80000, CRC(e67c2c7d) SHA1(cddfd6a3d934e71853af62e3d2bf312618c9b4ff) ) ROM_END +ROM_START( puzzlove ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ + ROM_LOAD16_BYTE( "3.u3", 0x00000, 0x40000, CRC(826c8472) SHA1(54f1a9fa0431de840d6fce466e09098a8d601660) ) + ROM_LOAD16_BYTE( "4.u2", 0x00001, 0x40000, CRC(64ddc708) SHA1(60b29f8cd5dd654be34452fd197a77abc872e63d) ) + + ROM_REGION( 0x20000, "audiocpu", 0 ) /* z80 */ + ROM_LOAD( "1.uz02", 0x00000, 0x20000, CRC(3077e7f3) SHA1(e2bf634a2166e1851486a801e74a7ec0d4599c28) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* samples */ + ROM_LOAD( "2.uz11", 0x00000, 0x40000, CRC(4c06ec68) SHA1(3cfca1c98e73c65a45b65d43e012c5529572c057) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "10.u41", 0x000000, 0x20000, CRC(7200f878) SHA1(27c6389f802f6e0af0210e2b01788914c0eb1d04) ) + ROM_CONTINUE ( 0x080000,0x20000 ) + ROM_CONTINUE ( 0x040000,0x20000 ) + ROM_CONTINUE ( 0x0c0000,0x20000 ) + ROM_LOAD16_BYTE( "9.u42", 0x000001, 0x20000, CRC(21b1b297) SHA1(0f589d1c62d0f79b1379e4444b119bdc4cc70cfb) ) + ROM_CONTINUE ( 0x080001,0x20000 ) + ROM_CONTINUE ( 0x040001,0x20000 ) + ROM_CONTINUE ( 0x0c0001,0x20000 ) + + ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */ + ROM_LOAD16_BYTE( "5.u53", 0x000000, 0x80000, CRC(8707d5a0) SHA1(05480ac34982a4e4768b7f3fccd2e557ca4b2545) ) + ROM_LOAD16_BYTE( "6.u54", 0x000001, 0x80000, CRC(60a6d614) SHA1(0693c08c51d6b3a05373c9999f01b0b8d23a1c89) ) + ROM_LOAD16_BYTE( "7.u55", 0x100000, 0x80000, CRC(0f2ea5c4) SHA1(4cb46fc6272e3cc14dfdcd7831157433ee7cf247) ) + ROM_LOAD16_BYTE( "8.u56", 0x100001, 0x80000, CRC(037dcd3d) SHA1(fcdf604710518982e0b4acc81a56fa703d0c9407) ) +ROM_END void silvmil_state::tumblepb_gfx1_rearrange() { @@ -432,4 +542,5 @@ DRIVER_INIT_MEMBER(silvmil_state,silvmil) tumblepb_gfx1_rearrange(); } -GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) +GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) +GAME( 1994, puzzlove, 0, puzzlove,puzzlove,silvmil_state, silvmil, ROT0, "Para", "PuzzLove", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ae6cbfd6348..906ed2353b1 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10479,6 +10479,7 @@ crospang // (c) 1998 F2 System heuksun // (c) 1998 Oksan / F2 System bestri // (c) F2 System silvmil // (c) 1995 Para +puzzlove // (c) 1994 Para funybubl // (c) 1999 In Chang Electronic Co funybublc // (c) 1999 Comad Industries dcheese // (c) 1993 HAR diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c index 79af988b378..96940c008dc 100644 --- a/src/mame/video/decospr.c +++ b/src/mame/video/decospr.c @@ -150,6 +150,7 @@ decospr_device::decospr_device(const machine_config &mconfig, const char *tag, d device_video_interface(mconfig, *this), m_gfxregion(0), m_is_bootleg(false), + m_bootleg_type(0), m_x_offset(0), m_y_offset(0), m_flipallx(0), @@ -232,7 +233,16 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & { sprite = spriteram[offs + 1]; y = spriteram[offs]; - flash = y & 0x1000; + + if (m_is_bootleg && (m_bootleg_type == 1)) + { + flash = y & 0x0400; + } + else + { + flash = y & 0x1000; + } + w = y & 0x0800; @@ -258,7 +268,20 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & fx = y & 0x2000; fy = y & 0x4000; - multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ + + int tempwidth = 0; + + if (m_is_bootleg && (m_bootleg_type==1)) // puzzlove + { + tempwidth = (y & 0x1000) >> 12; + tempwidth |= (y & 0x0200) >> 8; + } + else + { + tempwidth |= (y & 0x0600) >> 9; + } + + multi = (1 << (tempwidth)) - 1; /* 1x, 2x, 4x, 8x height */ /* bootleg support (esd16.c) */ if (flipscreen) x = ((x&0x1ff) - m_x_offset)&0x1ff; diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index 8df47bdb7cd..1725320cd12 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -21,6 +21,7 @@ public: static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast(device).m_pri_cb = callback; } static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast(device).m_col_cb = callback; } static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast(device).m_is_bootleg = is_bootleg; } + static void set_bootleg_type(device_t &device, int bootleg_type) { downcast(device).m_bootleg_type = bootleg_type; } static void set_flipallx(device_t &device, int flipallx) { downcast(device).m_flipallx = flipallx; } static void set_transpen(device_t &device, int transpen) { downcast(device).m_transpen = transpen; } static void set_offsets(device_t &device, int x_offset, int y_offset) @@ -55,6 +56,7 @@ protected: // used by various bootleg / clone chips. bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used) + int m_bootleg_type; // for Puzzlove, has sprite bits moved around (probably to prevent board swaps) int m_x_offset, m_y_offset; // used by various bootlegs int m_flipallx; // used by esd16.c - hedpanio, multchmp , and nmg5.c int m_transpen; // used by fncywld (tumbleb.c) @@ -80,6 +82,9 @@ extern const device_type DECO_SPRITE; #define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \ decospr_device::set_is_bootleg(*device, _boot); +#define MCFG_DECO_SPRITE_BOOTLEG_TYPE(_bootleg_type) \ + decospr_device::set_bootleg_type(*device, _bootleg_type); + #define MCFG_DECO_SPRITE_FLIPALLX(_flip) \ decospr_device::set_flipallx(*device, _flip); -- cgit v1.2.3