summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Osso <mesgnet@yahoo.it>2014-12-02 21:34:54 +0100
committerGravatarGravatar Osso <mesgnet@yahoo.it>2014-12-02 21:34:54 +0100
commitc4b2c68ca41c8ea7711b0a1893ab73d60a136d33 (patch) (github)
treeed254b2f043e513638b1b55ed3d6ef062ce3844e
parentb9d27cd05a054339876a84d6600d2106c14d7449 (diff)
downloadmame-c4b2c68ca41c8ea7711b0a1893ab73d60a136d33.tar.bz2
mame-c4b2c68ca41c8ea7711b0a1893ab73d60a136d33.zip
yunsun16.c: use device address map for the oki (nw)
-rw-r--r--src/mame/drivers/yunsun16.c73
-rw-r--r--src/mame/includes/yunsun16.h35
-rw-r--r--src/mame/video/yunsun16.c10
3 files changed, 64 insertions, 54 deletions
diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c
index f4cf6cd16e0..3ba6d62f969 100644
--- a/src/mame/drivers/yunsun16.c
+++ b/src/mame/drivers/yunsun16.c
@@ -101,15 +101,9 @@ Stephh's notes (based on the games M68000 code and some tests) :
***************************************************************************/
-WRITE16_MEMBER(yunsun16_state::yunsun16_sound_bank_w)
+WRITE8_MEMBER(yunsun16_state::sound_bank_w)
{
- if (ACCESSING_BITS_0_7)
- {
- int bank = data & 3;
- UINT8 *dst = memregion("oki")->base();
- UINT8 *src = dst + 0x80000 + 0x20000 * bank;
- memcpy(dst + 0x20000, src, 0x20000);
- }
+ membank("okibank")->set_entry(data & 3);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, yunsun16_state )
@@ -126,12 +120,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, yunsun16_state )
AM_RANGE(0x80010c, 0x80010f) AM_RAM AM_SHARE("scrollram_1") // Scrolling
AM_RANGE(0x800114, 0x800117) AM_RAM AM_SHARE("scrollram_0") // Scrolling
AM_RANGE(0x800154, 0x800155) AM_RAM AM_SHARE("priorityram") // Priority
- AM_RANGE(0x800180, 0x800181) AM_WRITE(yunsun16_sound_bank_w) // Sound
+ AM_RANGE(0x800180, 0x800181) AM_WRITE8(sound_bank_w, 0x00ff) // Sound
AM_RANGE(0x800188, 0x800189) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound
AM_RANGE(0x8001fe, 0x8001ff) AM_WRITENOP // ? 0 (during int)
AM_RANGE(0x900000, 0x903fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
- AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(yunsun16_vram_1_w) AM_SHARE("vram_1") // Layer 1
- AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(yunsun16_vram_0_w) AM_SHARE("vram_0") // Layer 0
+ AM_RANGE(0x908000, 0x90bfff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Layer 1
+ AM_RANGE(0x90c000, 0x90ffff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Layer 0
AM_RANGE(0x910000, 0x910fff) AM_RAM AM_SHARE("spriteram") // Sprites
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@@ -155,8 +149,8 @@ number 0 on each voice. That sample is 00000-00000.
DRIVER_INIT_MEMBER(yunsun16_state,magicbub)
{
-// remove_mem_write16_handler (0, 0x800180, 0x800181 );
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x800188, 0x800189, write16_delegate(FUNC(yunsun16_state::magicbub_sound_command_w),this));
+ m_maincpu->space(AS_PROGRAM).unmap_write(0x800180, 0x800181);
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x800188, 0x800189, write16_delegate(FUNC(yunsun16_state::magicbub_sound_command_w), this));
}
/***************************************************************************
@@ -179,6 +173,11 @@ static ADDRESS_MAP_START( sound_port_map, AS_IO, 8, yunsun16_state )
AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE("oki", okim6295_device, read, write) // M6295
ADDRESS_MAP_END
+static ADDRESS_MAP_START( oki_map, AS_0, 8, yunsun16_state )
+ AM_RANGE(0x00000, 0x1ffff) AM_ROM
+ AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("okibank")
+ ADDRESS_MAP_END
+
/***************************************************************************
@@ -566,6 +565,19 @@ void yunsun16_state::machine_reset()
m_sprites_scrolldy = -0x0f;
}
+MACHINE_START_MEMBER(yunsun16_state, shocking)
+{
+ machine_start();
+ membank("okibank")->configure_entries(0, 0x80000 / 0x20000, memregion("oki")->base(), 0x20000);
+ membank("okibank")->set_entry(0);
+}
+
+MACHINE_RESET_MEMBER(yunsun16_state, shocking)
+{
+ machine_reset();
+ membank("okibank")->set_entry(0);
+}
+
/***************************************************************************
Magic Bubble
***************************************************************************/
@@ -622,7 +634,9 @@ static MACHINE_CONFIG_START( shocking, yunsun16_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", yunsun16_state, irq2_line_hold)
-
+
+ MCFG_MACHINE_START_OVERRIDE(yunsun16_state, shocking)
+ MCFG_MACHINE_RESET_OVERRIDE(yunsun16_state, shocking)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -640,6 +654,7 @@ static MACHINE_CONFIG_START( shocking, yunsun16_state )
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map)
MACHINE_CONFIG_END
@@ -786,11 +801,8 @@ ROM_START( magicbubb ) /* Found on a YS-0211 PCB like below */
ROM_LOAD( "u22.bin", 0x040000, 0x020000, CRC(7c68df7a) SHA1(88acf9dd43892a790415b418f77d88c747aa84f5) )
ROM_LOAD( "u23.bin", 0x060000, 0x020000, CRC(c7763fc1) SHA1(ed68b3c3c5155073afb7b55d6d92d3057e40df6c) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "u131", 0x000000, 0x040000, CRC(9bdb08e4) SHA1(4d8bdeb9b503b0959a6ae3f3fb3574350b01b1a1) )
- ROM_RELOAD( 0x040000, 0x040000 )
- ROM_RELOAD( 0x080000, 0x040000 )
- ROM_RELOAD( 0x0c0000, 0x040000 )
ROM_END
@@ -862,10 +874,9 @@ ROM_START( paprazzi )
ROM_LOAD( "u22.bin", 0x080000, 0x040000, CRC(436499c7) SHA1(ec1390b6d5656c99d91cf6425d319f4796bcb28a) )
ROM_LOAD( "u23.bin", 0x0c0000, 0x040000, CRC(358280fe) SHA1(eac3cb65fe75bc2da14896734f4a339480b54a2c) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "u131.bin", 0x000000, 0x080000, CRC(bcf7aa12) SHA1(f7bf5258396ed0eb7e85eccf250c6d0a333a4d61) )
- ROM_RELOAD( 0x080000, 0x080000 )
-
+
ROM_END
/***************************************************************************
@@ -892,10 +903,9 @@ ROM_START( shocking )
ROM_LOAD( "yunsun16.u22", 0x080000, 0x040000, CRC(d6db0388) SHA1(f5d8f7740b602c402a8dd6c4ebd357cf15a0dfac) )
ROM_LOAD( "yunsun16.u23", 0x0c0000, 0x040000, CRC(1fa33b2e) SHA1(4aa0dee8d34aac19cf6b7ba3f79ca022ad8d7760) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "yunsun16.131", 0x000000, 0x080000, CRC(d0a1bb8c) SHA1(10f33521bd6031ed73ee5c7be1382165925aa8f8) )
- ROM_RELOAD( 0x080000, 0x080000 )
-
+
ROM_END
ROM_START( shockingk )
@@ -916,10 +926,9 @@ ROM_START( shockingk )
ROM_LOAD( "u22.bin", 0x080000, 0x040000, CRC(59260de1) SHA1(2dd2d7ab93fa751cb9142400a3ff91391477d555) )
ROM_LOAD( "u23.bin", 0x0c0000, 0x040000, CRC(00e4af23) SHA1(a4d23f16748385dd8c87cae3e16593e5a0195c24) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "yunsun16.131", 0x000000, 0x080000, CRC(d0a1bb8c) SHA1(10f33521bd6031ed73ee5c7be1382165925aa8f8) )
- ROM_RELOAD( 0x080000, 0x080000 )
-
+
ROM_END
@@ -949,10 +958,9 @@ ROM_START( bombkick )
ROM_LOAD( "bk_u22", 0x080000, 0x040000, CRC(9538c46c) SHA1(d7d0e167d5abc2ee81eae6fde152b2f5cc716c0e) )
ROM_LOAD( "bk_u23", 0x0c0000, 0x040000, CRC(e3831f3d) SHA1(096658ee5a7b83d774b671c0a38113533c8751d1) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "bk_u131", 0x000000, 0x080000, CRC(22cc5732) SHA1(38aefa4e543ea54e004eee428ee087121eb20905) )
- ROM_RELOAD( 0x080000, 0x080000 )
-
+
ROM_END
ROM_START( bombkicka ) // marked 'Bomb Kick 98'
@@ -973,10 +981,9 @@ ROM_START( bombkicka ) // marked 'Bomb Kick 98'
ROM_LOAD( "bk_u22", 0x080000, 0x040000, CRC(9538c46c) SHA1(d7d0e167d5abc2ee81eae6fde152b2f5cc716c0e) )
ROM_LOAD( "bk_u23", 0x0c0000, 0x040000, CRC(e3831f3d) SHA1(096658ee5a7b83d774b671c0a38113533c8751d1) )
- ROM_REGION( 0x080000 * 2, "oki", 0 ) /* Samples */
+ ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
ROM_LOAD( "bk_u131", 0x000000, 0x080000, CRC(22cc5732) SHA1(38aefa4e543ea54e004eee428ee087121eb20905) )
- ROM_RELOAD( 0x080000, 0x080000 )
-
+
ROM_END
/***************************************************************************
diff --git a/src/mame/includes/yunsun16.h b/src/mame/includes/yunsun16.h
index 0399ed7e3a0..8ae94f9abb0 100644
--- a/src/mame/includes/yunsun16.h
+++ b/src/mame/includes/yunsun16.h
@@ -9,18 +9,25 @@ class yunsun16_state : public driver_device
public:
yunsun16_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_screen(*this, "screen"),
+ m_palette(*this, "palette"),
m_vram_0(*this, "vram_0"),
m_vram_1(*this, "vram_1"),
m_scrollram_0(*this, "scrollram_0"),
m_scrollram_1(*this, "scrollram_1"),
m_priorityram(*this, "priorityram"),
- m_spriteram(*this, "spriteram"),
- m_audiocpu(*this, "audiocpu"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_spriteram(*this, "spriteram") { }
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
/* memory pointers */
required_shared_ptr<UINT16> m_vram_0;
required_shared_ptr<UINT16> m_vram_1;
@@ -36,14 +43,14 @@ public:
int m_sprites_scrolldx;
int m_sprites_scrolldy;
- /* devices */
- optional_device<cpu_device> m_audiocpu;
- DECLARE_WRITE16_MEMBER(yunsun16_sound_bank_w);
+ DECLARE_WRITE8_MEMBER(sound_bank_w);
DECLARE_WRITE16_MEMBER(magicbub_sound_command_w);
- DECLARE_WRITE16_MEMBER(yunsun16_vram_0_w);
- DECLARE_WRITE16_MEMBER(yunsun16_vram_1_w);
+ DECLARE_WRITE16_MEMBER(vram_0_w);
+ DECLARE_WRITE16_MEMBER(vram_1_w);
DECLARE_DRIVER_INIT(magicbub);
- TILEMAP_MAPPER_MEMBER(yunsun16_tilemap_scan_pages);
+ DECLARE_MACHINE_START(shocking);
+ DECLARE_MACHINE_RESET(shocking);
+ TILEMAP_MAPPER_MEMBER(tilemap_scan_pages);
TILE_GET_INFO_MEMBER(get_tile_info_0);
TILE_GET_INFO_MEMBER(get_tile_info_1);
virtual void machine_start();
@@ -52,8 +59,4 @@ public:
UINT32 screen_update_yunsun16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
DECLARE_WRITE_LINE_MEMBER(soundirq);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/video/yunsun16.c b/src/mame/video/yunsun16.c
index 8262efde2c5..293f2d89e00 100644
--- a/src/mame/video/yunsun16.c
+++ b/src/mame/video/yunsun16.c
@@ -38,7 +38,7 @@
#define PAGES_PER_TMAP_X (0x4)
#define PAGES_PER_TMAP_Y (0x4)
-TILEMAP_MAPPER_MEMBER(yunsun16_state::yunsun16_tilemap_scan_pages)
+TILEMAP_MAPPER_MEMBER(yunsun16_state::tilemap_scan_pages)
{
return (row / TILES_PER_PAGE_Y) * TILES_PER_PAGE_X * TILES_PER_PAGE_Y * PAGES_PER_TMAP_X +
(row % TILES_PER_PAGE_Y) +
@@ -67,13 +67,13 @@ TILE_GET_INFO_MEMBER(yunsun16_state::get_tile_info_1)
(attr & 0x20) ? TILE_FLIPX : 0);
}
-WRITE16_MEMBER(yunsun16_state::yunsun16_vram_0_w)
+WRITE16_MEMBER(yunsun16_state::vram_0_w)
{
COMBINE_DATA(&m_vram_0[offset]);
m_tilemap_0->mark_tile_dirty(offset / 2);
}
-WRITE16_MEMBER(yunsun16_state::yunsun16_vram_1_w)
+WRITE16_MEMBER(yunsun16_state::vram_1_w)
{
COMBINE_DATA(&m_vram_1[offset]);
m_tilemap_1->mark_tile_dirty(offset / 2);
@@ -90,9 +90,9 @@ WRITE16_MEMBER(yunsun16_state::yunsun16_vram_1_w)
void yunsun16_state::video_start()
{
- m_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),this),
+ m_tilemap_0 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_0),this),tilemap_mapper_delegate(FUNC(yunsun16_state::tilemap_scan_pages),this),
16,16, TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
- m_tilemap_1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_1),this),tilemap_mapper_delegate(FUNC(yunsun16_state::yunsun16_tilemap_scan_pages),this),
+ m_tilemap_1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(yunsun16_state::get_tile_info_1),this),tilemap_mapper_delegate(FUNC(yunsun16_state::tilemap_scan_pages),this),
16,16, TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
m_tilemap_0->set_scrolldx(-0x34, 0);