summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mamehaze <mamehaze@users.noreply.github.com>2015-02-26 14:21:57 +0000
committer mamehaze <mamehaze@users.noreply.github.com>2015-02-26 14:21:57 +0000
commitdb37f431a4fd682b7bfa656131628533a8d3bd34 (patch)
treecf8e4e7ffc25d82f0198bbee9a8489e22232f57e
parent72aacc18c6ec227ac798bd556e2ed9a48efc9cde (diff)
improvements to monkelf (bootleg of avspirit), now playable [iq_132]
-rw-r--r--src/mame/drivers/megasys1.c15
-rw-r--r--src/mame/includes/megasys1.h2
-rw-r--r--src/mame/video/megasys1.c50
3 files changed, 64 insertions, 3 deletions
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index b0251dedad0..45da5d1c344 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -4104,6 +4104,19 @@ DRIVER_INIT_MEMBER(megasys1_state,monkelf)
m_rom_maincpu[0x00744/2] = 0x4e71; // weird check, 0xe000e R is a port-based trap?
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe0000, 0xe000f, read16_delegate(FUNC(megasys1_state::monkelf_input_r),this));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x44000, 0x443ff, write16_delegate(FUNC(megasys1_state::megasys1_vregs_monkelf_w),this));
+
+ // convert bootleg priority format to standard
+ {
+ int i;
+ UINT8 *ROM = memregion("proms")->base();
+
+ for (i = 0x1fe; i >= 0; i -= 2) {
+ ROM[i+0] = ROM[i+1] = (ROM[i/2] >> 4) & 0x0f;
+ }
+ }
+
+ megasys1_priority_create();
}
/*************************************
@@ -4134,7 +4147,7 @@ GAME( 1990, rodlandj, rodland, system_A, rodland, megasys1_state, rod
GAME( 1990, rodlandjb,rodland, system_A, rodland, driver_device, 0, ROT0, "bootleg","Rod-Land (Japan bootleg)", 0 )
GAME( 1991, avspirit, 0, system_B, avspirit, megasys1_state, avspirit, ROT0, "Jaleco", "Avenging Spirit", 0 )
GAME( 1990, phantasm, avspirit, system_A, phantasm, megasys1_state, phantasm, ROT0, "Jaleco", "Phantasm (Japan)", 0 )
-GAME( 1990, monkelf, avspirit, system_B, avspirit, megasys1_state, monkelf, ROT0, "bootleg","Monky Elf (Korean bootleg of Avenging Spirit)", GAME_NOT_WORKING )
+GAME( 1990, monkelf, avspirit, system_B, avspirit, megasys1_state, monkelf, ROT0, "bootleg","Monky Elf (Korean bootleg of Avenging Spirit)", 0 )
GAME( 1991, edf, 0, system_B, edf, megasys1_state, edf, ROT0, "Jaleco", "E.D.F. : Earth Defense Force", 0 )
GAME( 1991, edfu, edf, system_B, edf, megasys1_state, edf, ROT0, "Jaleco", "E.D.F. : Earth Defense Force (North America)", 0 )
GAME( 1991, edfbl, edf, system_Bbl, edf, megasys1_state, edfbl, ROT0, "bootleg","E.D.F. : Earth Defense Force (bootleg)", GAME_NO_SOUND )
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h
index 85d8dfc19bf..1bcc68f6b3f 100644
--- a/src/mame/includes/megasys1.h
+++ b/src/mame/includes/megasys1.h
@@ -102,6 +102,7 @@ public:
DECLARE_WRITE16_MEMBER(megasys1_scrollram_1_w);
DECLARE_WRITE16_MEMBER(megasys1_scrollram_2_w);
DECLARE_WRITE16_MEMBER(megasys1_vregs_A_w);
+ DECLARE_WRITE16_MEMBER(megasys1_vregs_monkelf_w);
DECLARE_READ16_MEMBER(megasys1_vregs_C_r);
DECLARE_WRITE16_MEMBER(megasys1_vregs_C_w);
DECLARE_WRITE16_MEMBER(megasys1_vregs_D_w);
@@ -145,6 +146,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(megasys1B_scanline);
inline void scrollram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int which);
void create_tilemaps();
+ void megasys1_priority_create();
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect);
void rodlandj_gfx_unmangle(const char *region);
void jitsupro_gfx_unmangle(const char *region);
diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c
index 3abd0c191d8..fa654fc8364 100644
--- a/src/mame/video/megasys1.c
+++ b/src/mame/video/megasys1.c
@@ -447,7 +447,49 @@ WRITE16_MEMBER(megasys1_state::megasys1_vregs_A_w)
}
+/* Used by monkelf */
+WRITE16_MEMBER(megasys1_state::megasys1_vregs_monkelf_w)
+{
+ UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
+
+ switch (offset)
+ {
+ case 0x000/2 : m_active_layers = new_data; break;
+
+ case 0x008/2+0 : m_scrollx[2] = new_data; break;
+ case 0x008/2+1 : m_scrolly[2] = new_data; break;
+ case 0x008/2+2 : megasys1_set_vreg_flag(2, new_data); break;
+
+ // code in routine $280 does this. protection?
+ case 0x200/2+0 : m_scrollx[0] = new_data - (((new_data & 0x0f) > 0x0d) ? 0x10 : 0); break;
+ case 0x200/2+1 : m_scrolly[0] = new_data; break;
+ case 0x200/2+2 : megasys1_set_vreg_flag(0, new_data); break;
+
+ // code in routine $280 does this. protection?
+ case 0x208/2+0 : m_scrollx[1] = new_data - (((new_data & 0x0f) > 0x0b) ? 0x10 : 0); break;
+ case 0x208/2+1 : m_scrolly[1] = new_data; break;
+ case 0x208/2+2 : megasys1_set_vreg_flag(1, new_data); break;
+
+ case 0x100/2 : m_sprite_flag = new_data; break;
+
+ case 0x300/2 : m_screen_flag = new_data;
+ if (m_audiocpu)
+ {
+ if (new_data & 0x10)
+ m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ else
+ m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+ }
+ break;
+ case 0x308/2 : soundlatch_word_w(space,0,new_data,0xffff);
+ m_audiocpu->set_input_line(4, HOLD_LINE);
+ break;
+
+ default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
+ }
+
+}
/* Used by MS1-C only */
@@ -739,8 +781,7 @@ static const struct priority priorities[] =
the bottom layer's opaque pens, but above its transparent
pens.
*/
-
-PALETTE_INIT_MEMBER(megasys1_state,megasys1)
+void megasys1_state::megasys1_priority_create()
{
const UINT8 *color_prom = memregion("proms")->base();
int pri_code, offset, i, order;
@@ -900,6 +941,11 @@ PALETTE_INIT_MEMBER(megasys1_state,megasys1)
}
+PALETTE_INIT_MEMBER(megasys1_state,megasys1)
+{
+ megasys1_priority_create();
+}
+