mirror of
https://github.com/holub/mame
synced 2025-04-16 05:24:54 +03:00
- nmk16.cpp: added hardware info and corrected ROM labels for Acrobat Mission [Guru]
- paradise.cpp: used finders, templates and other small cleanups
This commit is contained in:
parent
7c4c97e2f5
commit
56e2cdf453
@ -4527,8 +4527,6 @@ createMAMEProjects(_target, _subtarget, "yunsung")
|
||||
files {
|
||||
MAME_DIR .. "src/mame/drivers/nmg5.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/paradise.cpp",
|
||||
MAME_DIR .. "src/mame/includes/paradise.h",
|
||||
MAME_DIR .. "src/mame/video/paradise.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/yunsung8.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/yunsun16.cpp",
|
||||
MAME_DIR .. "src/mame/includes/yunsun16.h",
|
||||
|
@ -4521,11 +4521,11 @@ void nmk16_state::acrobatm(machine_config &config)
|
||||
ymsnd.add_route(2, "mono", 0.50);
|
||||
ymsnd.add_route(3, "mono", 1.20);
|
||||
|
||||
OKIM6295(config, m_oki[0], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is not connected to gnd or +5v!
|
||||
OKIM6295(config, m_oki[0], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is connected to gnd
|
||||
m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map);
|
||||
m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10);
|
||||
|
||||
OKIM6295(config, m_oki[1], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is not connected to gnd or +5v!
|
||||
OKIM6295(config, m_oki[1], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is connected to gnd
|
||||
m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map);
|
||||
m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10);
|
||||
}
|
||||
@ -6278,39 +6278,113 @@ ROM_START( mustangb3 )
|
||||
ROM_LOAD( "u12.bin", 0x00000, 0x20000, CRC(0a28eaca) SHA1(392bd5301904ffb92cf97999e406e238717afa45) )
|
||||
ROM_END
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Acrobat Mission (UPL / Taito, 1991)
|
||||
Hardware info by Guru
|
||||
|
||||
AM91073
|
||||
M6100626A ACROBAT MISSION (sticker)
|
||||
|-------------------------------------------------------------------------|
|
||||
| LA4460 VOL YM2203 6116 4.IC74 1.IC101 52256 |
|
||||
| |
|
||||
| 4558 M6295 |------| 2.IC100 52256 |
|
||||
| AM-05.IC54|NMK004| |
|
||||
| YM3014 |------| |------------------| |
|
||||
| M6295 | 68000 | |
|
||||
| AM-04.IC53 |------------------| |
|
||||
| |
|
||||
| |------| |
|
||||
| |NMK005| |
|
||||
|J |------| 10MHz|
|
||||
|A SW2 |
|
||||
|M 16MHz|
|
||||
|M NMK006 SW1 |
|
||||
|A NMK006 10.IC81 |------| |
|
||||
| NMK006 S2564 |------| |NMK902| 6116 6116 |
|
||||
| |NMK901| 11.IC80 |------| |
|
||||
| S2564 |------| |------| |
|
||||
| |------| |NMK903| 3.IC79 52256 |
|
||||
| |NMK903| |------| |
|
||||
| |------| |------| 52256 |
|
||||
| AM-03.IC8 |NMK009| |
|
||||
| |------||------| 52256 |
|
||||
|NMK007 6116 6116 |NMK008| |
|
||||
|NMK007 6116 6116 |------||------| 52256 |
|
||||
|NMK007 AM01.IC42 |NMK009| |
|
||||
| 12MHz AM02.IC29 |------| |
|
||||
|-------------------------------------------------------------------------|
|
||||
Notes:
|
||||
68000 - Clock 10.000MHz
|
||||
YM2203 - Clock 1.500MHz [12/8]
|
||||
M6295 - 4.000MHz [12/3, both] and sample rate pin 7 LOW (both joined directly to ground)
|
||||
VSync - 56.2057Hz
|
||||
HSync - 15.6251kHz
|
||||
SW1/2 - 8-position DIP switch
|
||||
52256 - Sharp LH52256 32kBx8-bit SRAM
|
||||
6116 - Hitachi HM6116 2kBx8-bit SRAM
|
||||
S2564 - Seiko Instruments Inc. S2564RL-100 8kBx8-bit SRAM
|
||||
NMK901 - NMK custom chip
|
||||
NMK902 - NMK custom chip
|
||||
NMK903 - NMK custom chip
|
||||
NMK004 - Toshiba TMP90C840AF with 8Kbyte internal ROM disguised as a custom chip. Clock input 8.000MHz. Clock output on pin 17 is 2.000MHz
|
||||
NMK005 - NMK custom chip
|
||||
NMK006 - NMK custom resistor array (used on the controls and I/O)
|
||||
NMK007 - NMK custom resistor array (used on the RGB outputs)
|
||||
NMK008 - NMK custom chip
|
||||
NMK009 - NMK custom chip
|
||||
LA4460 - Sanyo LA4460 Audio Power Amplifier
|
||||
4558 - Motorola MC4558 Dual Operational Amplifier
|
||||
YM3014 - Yamaha YM3014 DAC. Serial clock input 1.500MHz [12/8]
|
||||
1.IC101 \
|
||||
2.IC100 / 27C010 128kBx8-bit EPROM (main program)
|
||||
3.IC79 - 27C512 64kBx8-bit EPROM (foreground tiles)
|
||||
4.IC74 - 27C512 64kBx8-bit EPROM (sound program)
|
||||
AM-04.IC53 - 4Mbit mask ROM (OKI M6295 samples)
|
||||
AM-05.IC54 - 4Mbit mask ROM (OKI M6295 samples)
|
||||
AM-03.IC8 - 4Mbit mask ROM (background tiles)
|
||||
AM-01.IC42 - 8Mbit 42 pin mask ROM (sprites)
|
||||
AM-02.IC29 - 4Mbit 40 pin mask ROM (sprites)
|
||||
10.IC81 - Signetics 82S129 bipolar PROM (when removed shows only blank screen and game does not boot)
|
||||
11.IC80 - Signetics 82S135 bipolar PROM (when removed start-up tests pass but does not go in-game
|
||||
and the screen rolls horizontally, then the board resets after a few seconds)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( acrobatm )
|
||||
ROM_REGION( 0x40000, "maincpu", 0 )
|
||||
ROM_LOAD16_BYTE( "02_ic100.bin", 0x00000, 0x20000, CRC(3fe487f4) SHA1(29aba5debcfddff14e584a1c7c5a403e85fc6ec0) )
|
||||
ROM_LOAD16_BYTE( "01_ic101.bin", 0x00001, 0x20000, CRC(17175753) SHA1(738865744badb78a0414ff650a94b97e516d0ea0) )
|
||||
ROM_LOAD16_BYTE( "2.ic100", 0x00000, 0x20000, CRC(3fe487f4) SHA1(29aba5debcfddff14e584a1c7c5a403e85fc6ec0) )
|
||||
ROM_LOAD16_BYTE( "1.ic101", 0x00001, 0x20000, CRC(17175753) SHA1(738865744badb78a0414ff650a94b97e516d0ea0) )
|
||||
|
||||
ROM_REGION( 0x20000, "fgtile", 0 )
|
||||
ROM_LOAD( "03_ic79.bin", 0x000000, 0x10000, CRC(d86c186e) SHA1(2e263d4780f2ba7acc7faa88472c85216fbae6a3) ) // Characters
|
||||
ROM_LOAD( "3.ic79", 0x000000, 0x10000, CRC(d86c186e) SHA1(2e263d4780f2ba7acc7faa88472c85216fbae6a3) ) // Characters
|
||||
|
||||
ROM_REGION( 0x100000, "bgtile", 0 )
|
||||
ROM_LOAD( "09_ic8.bin", 0x000000, 0x100000, CRC(7c12afed) SHA1(ae793e41599355a126cbcce91cd2c9f212d21853) ) // Foreground
|
||||
ROM_LOAD( "am-03.ic8", 0x000000, 0x100000, CRC(7c12afed) SHA1(ae793e41599355a126cbcce91cd2c9f212d21853) ) // Foreground
|
||||
|
||||
ROM_REGION( 0x180000, "sprites", 0 )
|
||||
ROM_LOAD( "07_ic42.bin", 0x000000, 0x100000, CRC(5672bdaa) SHA1(5401a104d72904de19b73125451767bc63d36809) ) // Sprites
|
||||
ROM_LOAD( "08_ic29.bin", 0x100000, 0x080000, CRC(b4c0ace3) SHA1(5d638781d588cfbf4025d002d5a2309049fe1ee5) )
|
||||
ROM_LOAD( "am-01.ic42", 0x000000, 0x100000, CRC(5672bdaa) SHA1(5401a104d72904de19b73125451767bc63d36809) ) // Sprites
|
||||
ROM_LOAD( "am-02.ic29", 0x100000, 0x080000, CRC(b4c0ace3) SHA1(5d638781d588cfbf4025d002d5a2309049fe1ee5) )
|
||||
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 )
|
||||
ROM_LOAD( "04_ic74.bin", 0x00000, 0x10000, CRC(176905fb) SHA1(135a184f44bedd93b293b9124fa0bd725e0ee93b) )
|
||||
ROM_LOAD( "4.ic74", 0x00000, 0x10000, CRC(176905fb) SHA1(135a184f44bedd93b293b9124fa0bd725e0ee93b) )
|
||||
|
||||
ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples
|
||||
ROM_LOAD( "05_ic54.bin", 0x00000, 0x80000, CRC(3b8c2b0e) SHA1(72491da32512823540b67dc5027f21c74af08c7d) ) // 0x20000 - 0x80000 banked
|
||||
ROM_LOAD( "am-05.ic54", 0x00000, 0x80000, CRC(3b8c2b0e) SHA1(72491da32512823540b67dc5027f21c74af08c7d) ) // 0x20000 - 0x80000 banked
|
||||
|
||||
ROM_REGION( 0x80000, "oki2", 0 ) // OKIM6295 samples
|
||||
ROM_LOAD( "06_ic53.bin", 0x00000, 0x80000, CRC(c1517cd4) SHA1(5a91ddc608c7a6fbdd9f93e503d39eac02ef04a4) ) // 0x20000 - 0x80000 banked
|
||||
ROM_LOAD( "am-04.ic53", 0x00000, 0x80000, CRC(c1517cd4) SHA1(5a91ddc608c7a6fbdd9f93e503d39eac02ef04a4) ) // 0x20000 - 0x80000 banked
|
||||
|
||||
ROM_REGION( 0x0200, "proms", 0 )
|
||||
ROM_LOAD( "10_ic81.bin", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown
|
||||
ROM_LOAD( "11_ic80.bin", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown
|
||||
ROM_LOAD( "10.ic81", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // 82S129, unknown purpose
|
||||
ROM_LOAD( "11.ic80", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // 82S135, unknown purpose
|
||||
ROM_END
|
||||
|
||||
/*
|
||||
|
||||
S.B.S. Gomorrah (and Bio-ship Paladin with correct ROMs in place)
|
||||
UPL, 1993
|
||||
S.B.S. Gomorrah / Bio-ship Paladin (UPL, 1993)
|
||||
Hardware info by Guru
|
||||
|
||||
PCB Layout
|
||||
----------
|
||||
@ -6643,8 +6717,8 @@ ROM_END
|
||||
|
||||
/*
|
||||
|
||||
Air Attack
|
||||
Comad, 1996
|
||||
Air Attack (Comad, 1996)
|
||||
Hardware info by Guru
|
||||
|
||||
68000 @ 8MHz
|
||||
Z80A @ 2MHz [8/4]
|
||||
@ -6999,8 +7073,8 @@ ROM_END
|
||||
|
||||
/*
|
||||
|
||||
Gun Nail
|
||||
NMK/Tecmo, 1993
|
||||
Gun Nail (NMK / Tecmo, 1993)
|
||||
Hardware info by Guru
|
||||
|
||||
PCB Layout
|
||||
----------
|
||||
@ -7344,8 +7418,8 @@ ROM_END
|
||||
|
||||
/*
|
||||
|
||||
Rapid Hero
|
||||
NMK, 1994
|
||||
Rapid Hero (NMK, 1994)
|
||||
Hardware info by Guru
|
||||
|
||||
The main board has no ROMs at all except 3 PROMs. There is a plug-in daughter
|
||||
board that holds all the ROMs. It has the capacity for 3 socketed EPROMS and 7x
|
||||
@ -8425,10 +8499,8 @@ ROM_END
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Bubble 2000 (c)1998 Tuning
|
||||
|
||||
Bubble 2000
|
||||
Tuning, 1998
|
||||
Bubble 2000 (Tuning, 1998)
|
||||
Hardware info by Guru
|
||||
|
||||
CPU : TMP68HC000P-10 (68000)
|
||||
SOUND : Z840006 (Z80, 44 pin QFP), YM2151, OKI M6295
|
||||
@ -8530,8 +8602,8 @@ ROM_END
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Hot Bubble
|
||||
Afega, 1998
|
||||
Hot Bubble (Afega, 1998)
|
||||
Hardware info by Guru
|
||||
|
||||
PCB Layout
|
||||
----------
|
||||
@ -8699,8 +8771,8 @@ ROM_END
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Fire Hawk - ESD, 2001
|
||||
---------------------
|
||||
Fire Hawk (ESD, 2001)
|
||||
Hardware info by Guru
|
||||
|
||||
- To enter test mode, hold on button 1 at boot up
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,115 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Luca Elia
|
||||
#ifndef MAME_INCLUDES_PARADISE_H
|
||||
#define MAME_INCLUDES_PARADISE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sound/okim6295.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
class paradise_state : public driver_device
|
||||
{
|
||||
public:
|
||||
paradise_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki2(*this, "oki2"),
|
||||
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_vram_2(*this, "vram_2"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_paletteram(*this, "paletteram"),
|
||||
m_spriteram(*this, "spriteram")
|
||||
{ }
|
||||
|
||||
void penkyi(machine_config &config);
|
||||
void tgtball(machine_config &config);
|
||||
void paradise(machine_config &config);
|
||||
void madball(machine_config &config);
|
||||
void torus(machine_config &config);
|
||||
void penky(machine_config &config);
|
||||
|
||||
void init_torus();
|
||||
void init_paradise();
|
||||
void init_tgtball();
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<okim6295_device> m_oki2;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<uint8_t> m_vram_0;
|
||||
required_shared_ptr<uint8_t> m_vram_1;
|
||||
required_shared_ptr<uint8_t> m_vram_2;
|
||||
required_shared_ptr<uint8_t> m_videoram;
|
||||
required_shared_ptr<uint8_t> m_paletteram;
|
||||
required_shared_ptr<uint8_t> m_spriteram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_tilemap_0 = nullptr;
|
||||
tilemap_t *m_tilemap_1 = nullptr;
|
||||
tilemap_t *m_tilemap_2 = nullptr;
|
||||
|
||||
bitmap_ind16 m_tmpbitmap;
|
||||
uint8_t m_palbank = 0;
|
||||
uint8_t m_priority = 0;
|
||||
uint8_t m_pixbank = 0;
|
||||
int m_sprite_inc = 0;
|
||||
int m_irq_count = 0;
|
||||
|
||||
// common
|
||||
void rombank_w(uint8_t data);
|
||||
void flipscreen_w(uint8_t data);
|
||||
void palette_w(offs_t offset, uint8_t data);
|
||||
void palbank_w(uint8_t data);
|
||||
void vram_0_w(offs_t offset, uint8_t data);
|
||||
void vram_1_w(offs_t offset, uint8_t data);
|
||||
void vram_2_w(offs_t offset, uint8_t data);
|
||||
void pixmap_w(offs_t offset, uint8_t data);
|
||||
void priority_w(uint8_t data);
|
||||
|
||||
// paradise specific
|
||||
void paradise_okibank_w(uint8_t data);
|
||||
|
||||
// torus specific
|
||||
void torus_coin_counter_w(uint8_t data);
|
||||
|
||||
// tgtball specific
|
||||
void tgtball_flipscreen_w(uint8_t data);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_0);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_1);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_2);
|
||||
|
||||
uint32_t screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(irq);
|
||||
|
||||
void update_pix_palbank();
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void base_map(address_map &map);
|
||||
void paradise_io_map(address_map &map);
|
||||
void paradise_map(address_map &map);
|
||||
void tgtball_map(address_map &map);
|
||||
void torus_io_map(address_map &map);
|
||||
void torus_map(address_map &map);
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_PARADISE_H
|
@ -1,320 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Luca Elia
|
||||
/***************************************************************************
|
||||
|
||||
-= Paradise / Target Ball / Torus =-
|
||||
|
||||
driver by Luca Elia (l.elia@tin.it)
|
||||
|
||||
|
||||
Note: if MAME_DEBUG is defined, pressing Z with:
|
||||
|
||||
Q shows the background layer
|
||||
W shows the midground layer
|
||||
E shows the foreground layer
|
||||
R shows the pixmap layer
|
||||
A shows sprites
|
||||
|
||||
There are 4 Fixed 256 x 256 Layers.
|
||||
|
||||
Background tiles are 8x8x4 with a register selecting which
|
||||
color code to use.
|
||||
|
||||
midground and foreground tiles are 8x8x8 with no color code.
|
||||
Then there's a 16 color pixel layer.
|
||||
|
||||
Bog standard 16x16x8 sprites, apparently with no color code nor flipping.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/paradise.h"
|
||||
|
||||
void paradise_state::flipscreen_w(uint8_t data)
|
||||
{
|
||||
flip_screen_set(data ? 0 : 1);
|
||||
}
|
||||
|
||||
void paradise_state::tgtball_flipscreen_w(uint8_t data)
|
||||
{
|
||||
flip_screen_set(data ? 1 : 0);
|
||||
}
|
||||
|
||||
/* Note: Penky updates pixel palette bank register BEFORE actually writing to the paletteram. */
|
||||
void paradise_state::update_pix_palbank()
|
||||
{
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
m_palette->set_pen_color(
|
||||
0x800 + i,
|
||||
m_paletteram[0x200 + m_pixbank + i + (0x800 * 0)],
|
||||
m_paletteram[0x200 + m_pixbank + i + (0x800 * 1)],
|
||||
m_paletteram[0x200 + m_pixbank + i + (0x800 * 2)]);
|
||||
}
|
||||
}
|
||||
|
||||
/* 800 bytes for red, followed by 800 bytes for green & 800 bytes for blue */
|
||||
void paradise_state::palette_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_paletteram[offset] = data;
|
||||
offset %= 0x800;
|
||||
m_palette->set_pen_color(offset, m_paletteram[offset + 0x800 * 0], m_paletteram[offset + 0x800 * 1],
|
||||
m_paletteram[offset + 0x800 * 2]);
|
||||
|
||||
update_pix_palbank();
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Tilemaps
|
||||
|
||||
Offset:
|
||||
|
||||
$000.b Code (Low Bits)
|
||||
$400.b Code (High Bits)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/* Background */
|
||||
void paradise_state::vram_0_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_vram_0[offset] = data;
|
||||
m_tilemap_0->mark_tile_dirty(offset % 0x400);
|
||||
}
|
||||
|
||||
/* 16 color tiles with paradise_palbank as color code */
|
||||
void paradise_state::palbank_w(uint8_t data)
|
||||
{
|
||||
int bank1 = (data & 0x0e) | 1;
|
||||
int bank2 = (data & 0xf0);
|
||||
|
||||
m_pixbank = bank2;
|
||||
|
||||
update_pix_palbank();
|
||||
|
||||
if (m_palbank != bank1)
|
||||
{
|
||||
m_palbank = bank1;
|
||||
m_tilemap_0->mark_all_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(paradise_state::get_tile_info_0)
|
||||
{
|
||||
int code = m_vram_0[tile_index] + (m_vram_0[tile_index + 0x400] << 8);
|
||||
tileinfo.set(1, code, m_palbank, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Midground */
|
||||
void paradise_state::vram_1_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_vram_1[offset] = data;
|
||||
m_tilemap_1->mark_tile_dirty(offset % 0x400);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(paradise_state::get_tile_info_1)
|
||||
{
|
||||
int code = m_vram_1[tile_index] + (m_vram_1[tile_index + 0x400] << 8);
|
||||
tileinfo.set(2, code, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Foreground */
|
||||
void paradise_state::vram_2_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_vram_2[offset] = data;
|
||||
m_tilemap_2->mark_tile_dirty(offset % 0x400);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(paradise_state::get_tile_info_2)
|
||||
{
|
||||
int code = m_vram_2[tile_index] + (m_vram_2[tile_index + 0x400] << 8);
|
||||
tileinfo.set(3, code, 0, 0);
|
||||
}
|
||||
|
||||
/* 256 x 256 bitmap. 4 bits per pixel so every byte encodes 2 pixels */
|
||||
|
||||
void paradise_state::pixmap_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_videoram[offset] = data;
|
||||
|
||||
int x = (offset & 0x7f) << 1;
|
||||
int y = (offset >> 7);
|
||||
|
||||
m_tmpbitmap.pix(y, x + 0) = 0x80f - (data >> 4);
|
||||
m_tmpbitmap.pix(y, x + 1) = 0x80f - (data & 0x0f);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Vide Hardware Init
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
void paradise_state::video_start()
|
||||
{
|
||||
m_tilemap_0 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(paradise_state::get_tile_info_0)), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
|
||||
m_tilemap_1 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(paradise_state::get_tile_info_1)), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
|
||||
m_tilemap_2 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(paradise_state::get_tile_info_2)), TILEMAP_SCAN_ROWS, 8, 8, 0x20, 0x20);
|
||||
|
||||
/* pixmap */
|
||||
m_screen->register_screen_bitmap(m_tmpbitmap);
|
||||
|
||||
m_tilemap_0->set_transparent_pen(0x0f);
|
||||
m_tilemap_1->set_transparent_pen(0xff);
|
||||
m_tilemap_2->set_transparent_pen(0xff);
|
||||
|
||||
save_item(NAME(m_tmpbitmap));
|
||||
save_item(NAME(m_pixbank));
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Sprites Drawing
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/* Sprites / Layers priority */
|
||||
void paradise_state::priority_w(uint8_t data)
|
||||
{
|
||||
m_priority = data;
|
||||
}
|
||||
|
||||
void paradise_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
for (int i = 0; i < m_spriteram.bytes() ; i += m_sprite_inc)
|
||||
{
|
||||
int code = m_spriteram[i + 0];
|
||||
int x = m_spriteram[i + 1];
|
||||
int y = m_spriteram[i + 2] - 2;
|
||||
int attr = m_spriteram[i + 3];
|
||||
|
||||
int flipx = 0; // ?
|
||||
int flipy = 0;
|
||||
|
||||
if (flip_screen())
|
||||
{
|
||||
x = 0xf0 - x; flipx = !flipx;
|
||||
y = 0xf0 - y; flipy = !flipy;
|
||||
}
|
||||
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
|
||||
code + (attr << 8),
|
||||
0,
|
||||
flipx, flipy,
|
||||
x,y, 0xff );
|
||||
|
||||
/* wrap around x */
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
|
||||
code + (attr << 8),
|
||||
0,
|
||||
flipx, flipy,
|
||||
x - 256,y, 0xff );
|
||||
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
|
||||
code + (attr << 8),
|
||||
0,
|
||||
flipx, flipy,
|
||||
x + 256,y, 0xff );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Screen Drawing
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
uint32_t paradise_state::screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int layers_ctrl = -1;
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if (machine().input().code_pressed(KEYCODE_Z))
|
||||
{
|
||||
int mask = 0;
|
||||
if (machine().input().code_pressed(KEYCODE_Q)) mask |= 1;
|
||||
if (machine().input().code_pressed(KEYCODE_W)) mask |= 2;
|
||||
if (machine().input().code_pressed(KEYCODE_E)) mask |= 4;
|
||||
if (machine().input().code_pressed(KEYCODE_R)) mask |= 8;
|
||||
if (machine().input().code_pressed(KEYCODE_A)) mask |= 16;
|
||||
if (mask != 0) layers_ctrl &= mask;
|
||||
}
|
||||
#endif
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
|
||||
if (!(m_priority & 4)) /* Screen blanking */
|
||||
return 0;
|
||||
|
||||
if (m_priority & 1)
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
if (layers_ctrl & 1) m_tilemap_0->draw(screen, bitmap, cliprect, 0, 0);
|
||||
if (layers_ctrl & 2) m_tilemap_1->draw(screen, bitmap, cliprect, 0, 0);
|
||||
if (layers_ctrl & 4) copybitmap_trans(bitmap, m_tmpbitmap, flip_screen(), flip_screen(), 0, 0, cliprect, 0x80f);
|
||||
|
||||
if (m_priority & 2)
|
||||
{
|
||||
if (!(m_priority & 1))
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(bitmap, cliprect);
|
||||
if (layers_ctrl & 8)
|
||||
m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (layers_ctrl & 8)
|
||||
m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0);
|
||||
if (!(m_priority & 1))
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(bitmap, cliprect);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* no pix layer, no tilemap_0, different priority bits */
|
||||
uint32_t paradise_state::screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
|
||||
if (!(m_priority & 2)) /* Screen blanking */
|
||||
return 0;
|
||||
|
||||
if (m_priority & 1)
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
m_tilemap_1->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
if (m_priority & 4)
|
||||
{
|
||||
if (!(m_priority & 1))
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
||||
if (!(m_priority & 1))
|
||||
draw_sprites(bitmap,cliprect);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* I don't know how the priority bits work on this one */
|
||||
uint32_t paradise_state::screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
m_tilemap_0->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_tilemap_1->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user