Skip to content

Commit 922d60e

Browse files
committed
New systems marked not working
------------------------------ Ultraman Cho Toshi Gekisen - Dai Nippon Judan Senso [hammy]
1 parent 35bdacc commit 922d60e

File tree

3 files changed

+367
-1
lines changed

3 files changed

+367
-1
lines changed

src/mame/mame.lst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41966,6 +41966,9 @@ tvdenwad
4196641966
tvdenwam
4196741967
tvdenwat
4196841968

41969+
@source:seibu/banprestomsz80.cpp
41970+
dnjsenso
41971+
4196941972
@source:seibu/bloodbro.cpp
4197041973
bloodbro
4197141974
bloodbroj

src/mame/seibu/banprestoms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// copyright-holders:
33

44
/*
5-
Banpresto medal games with Seibu customs
5+
Banpresto M68K-based medal games with Seibu customs
66
77
Confirmed games (but there are probably several more):
88
Terebi Denwa Doraemon

src/mame/seibu/banprestomsz80.cpp

Lines changed: 363 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,363 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:
3+
4+
/*
5+
Banpresto Z80-based medal games with Seibu customs
6+
7+
SCZ80 PCB
8+
9+
Main components:
10+
- Z84C0006PEC main CPU
11+
- 12.000 MHz XTAL
12+
- 2x LH5168D-80L (near CPU)
13+
- 2x HM6116LK-90 (near a pair of GFX ROMs)
14+
- 2x bank of 8 switches
15+
- SEI0181 9149 ABDB custom
16+
- BP-SC001 TC110G26AF gate array
17+
- SEI0200 TC110G21AF gate array
18+
- HB-52 color DAC
19+
- 2x HM6116LK-90 (near the two gate arrays)
20+
- HM6116LK-90 (near other pair of GFX ROMs)
21+
- OKI M6295
22+
23+
TODO:
24+
- sprites
25+
- visible area
26+
- hopper
27+
- more tilemaps?
28+
*/
29+
30+
#include "emu.h"
31+
32+
#include "seibu_crtc.h"
33+
34+
#include "cpu/z80/z80.h"
35+
#include "machine/nvram.h"
36+
#include "machine/ticket.h"
37+
#include "sound/okim6295.h"
38+
39+
#include "emupal.h"
40+
#include "screen.h"
41+
#include "speaker.h"
42+
#include "tilemap.h"
43+
44+
45+
//namespace {
46+
47+
class banprestomsz80_state : public driver_device
48+
{
49+
public:
50+
banprestomsz80_state(const machine_config &mconfig, device_type type, const char *tag)
51+
: driver_device(mconfig, type, tag),
52+
m_maincpu(*this, "maincpu"),
53+
m_gfxdecode(*this, "gfxdecode"),
54+
m_palette(*this, "palette"),
55+
m_hopper(*this, "hopper"),
56+
m_charram(*this, "charram"),
57+
m_bgram(*this, "bgram")
58+
//m_spriteram(*this, "sprite_ram")
59+
{ }
60+
61+
void banprestomsz80(machine_config &config) ATTR_COLD;
62+
63+
protected:
64+
virtual void video_start() override ATTR_COLD;
65+
66+
private:
67+
required_device<cpu_device> m_maincpu;
68+
required_device<gfxdecode_device> m_gfxdecode;
69+
required_device<palette_device> m_palette;
70+
required_device<hopper_device> m_hopper;
71+
72+
required_shared_ptr<uint8_t> m_charram;
73+
required_shared_ptr<uint8_t> m_bgram;
74+
//required_shared_ptr<uint8_t> m_spriteram;
75+
76+
tilemap_t *m_char_tilemap = nullptr;
77+
tilemap_t *m_bg_tilemap = nullptr;
78+
79+
void output_w(uint8_t data);
80+
void output2_w(uint8_t data);
81+
82+
void charram_w(offs_t offset, uint8_t data);
83+
void bgram_w(offs_t offset, uint8_t data);
84+
85+
TILE_GET_INFO_MEMBER(get_char_tile_info);
86+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
87+
88+
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
89+
90+
void program_map(address_map &map) ATTR_COLD;
91+
void io_map(address_map &map) ATTR_COLD;
92+
};
93+
94+
95+
void banprestomsz80_state::video_start()
96+
{
97+
m_char_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(banprestomsz80_state::get_char_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
98+
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(banprestomsz80_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
99+
100+
m_char_tilemap->set_transparent_pen(0x0f);
101+
m_bg_tilemap->set_transparent_pen(0x0f);
102+
}
103+
104+
105+
void banprestomsz80_state::charram_w(offs_t offset, uint8_t data)
106+
{
107+
m_charram[offset] = data;
108+
m_char_tilemap->mark_tile_dirty(offset / 2);
109+
}
110+
111+
void banprestomsz80_state::bgram_w(offs_t offset, uint8_t data)
112+
{
113+
m_bgram[offset] = data;
114+
m_bg_tilemap->mark_tile_dirty(offset / 2);
115+
}
116+
117+
TILE_GET_INFO_MEMBER(banprestomsz80_state::get_char_tile_info)
118+
{
119+
int const tile = m_charram[2 * tile_index] | ((m_charram[2 * tile_index + 1] & 0x07) << 8);
120+
int const color = m_charram[2 * tile_index + 1] >> 4;
121+
122+
tileinfo.set(2, tile, color, 0);
123+
}
124+
125+
TILE_GET_INFO_MEMBER(banprestomsz80_state::get_bg_tile_info)
126+
{
127+
int const tile = m_bgram[2 * tile_index] | ((m_bgram[2 * tile_index + 1] & 0x07) << 8);
128+
int const color = m_bgram[2 * tile_index + 1] >> 4;
129+
130+
tileinfo.set(1, tile, color, 0);
131+
}
132+
133+
uint32_t banprestomsz80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
134+
{
135+
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
136+
m_char_tilemap->draw(screen, bitmap, cliprect, 0, 0);
137+
138+
return 0;
139+
}
140+
141+
void banprestomsz80_state::output_w(uint8_t data)
142+
{
143+
machine().bookkeeping().coin_lockout_w(0, BIT(data, 0)); // 10 Yen
144+
machine().bookkeeping().coin_lockout_w(1, BIT(data, 1)); // 100 Yen
145+
machine().bookkeeping().coin_lockout_w(2, BIT(data, 2)); // Medal
146+
machine().bookkeeping().coin_counter_w(0, BIT(data, 3)); // 10 Yen
147+
machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // 100 Yen
148+
machine().bookkeeping().coin_counter_w(2, BIT(data, 5)); // Medal
149+
150+
if (data & 0xc0)
151+
logerror("%s output_w bits 6-7 set: %02x\n", machine().describe_context(), data);
152+
}
153+
154+
void banprestomsz80_state::output2_w(uint8_t data)
155+
{
156+
// TODO:
157+
// bit 0: NH-1
158+
// bit 1: AES-505
159+
160+
if (data & 0xfc)
161+
logerror("%s output2_w bits 2-7 set: %02x\n", machine().describe_context(), data);
162+
}
163+
164+
void banprestomsz80_state::program_map(address_map &map)
165+
{
166+
map(0x0000, 0xbfff).rom();
167+
map(0xc000, 0xc7ff).ram().share("nvram");
168+
map(0xc800, 0xcfff).ram();
169+
map(0xd000, 0xdfff).ram();
170+
map(0xe000, 0xe7ff).ram();
171+
map(0xe800, 0xefff).ram().w(FUNC(banprestomsz80_state::charram_w)).share(m_charram);
172+
map(0xf000, 0xf7ff).ram().w(FUNC(banprestomsz80_state::bgram_w)).share(m_bgram);
173+
map(0xf800, 0xffff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
174+
}
175+
176+
// TODO: various writes
177+
void banprestomsz80_state::io_map(address_map &map)
178+
{
179+
map.global_mask(0xff);
180+
181+
map(0x40, 0x40).portr("DSW1");
182+
map(0x41, 0x41).portr("DSW2");
183+
map(0x42, 0x42).portr("IN0");
184+
map(0x43, 0x43).portr("IN1");
185+
map(0x44, 0x44).portr("IN2");
186+
map(0x61, 0x61).w(FUNC(banprestomsz80_state::output_w));
187+
map(0x62, 0x62).w(FUNC(banprestomsz80_state::output2_w));
188+
map(0x80, 0x80).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
189+
}
190+
191+
192+
static INPUT_PORTS_START( dnjsenso )
193+
PORT_START("IN0")
194+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) // 10 Yen
195+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // 100 Yen
196+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // Medal
197+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // Service sw
198+
PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) // also selects in test mode
199+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
200+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
201+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
202+
203+
PORT_START("IN1")
204+
PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_BUTTON1 ) PORT_PLAYER(3) // NH1 sensor (hopper stuck?)
205+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) // 505 HP (hopper line?)
206+
PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_BUTTON3 ) PORT_PLAYER(3) // 505 empty
207+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
208+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(3) // S. Medal out
209+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(3) // G. Medal out
210+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
211+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode
212+
213+
PORT_START("IN2")
214+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME( "Bet 1" )
215+
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME( "Bet 2" )
216+
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME( "Bet 3" )
217+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME( "Bet 4" )
218+
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) PORT_NAME( "Bet 5" )
219+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) PORT_NAME( "Bet 6" )
220+
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) PORT_NAME( "Bet 7" )
221+
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // No effect in test mode
222+
223+
PORT_START("DSW1")
224+
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
225+
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
226+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
227+
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
228+
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
229+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
230+
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
231+
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
232+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
233+
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
234+
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
235+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
236+
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
237+
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
238+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
239+
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
240+
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
241+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
242+
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
243+
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
244+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
245+
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
246+
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
247+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
248+
249+
PORT_START("DSW2")
250+
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
251+
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
252+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
253+
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
254+
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
255+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
256+
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
257+
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
258+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
259+
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
260+
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
261+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
262+
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
263+
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
264+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
265+
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
266+
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
267+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
268+
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
269+
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
270+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
271+
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
272+
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
273+
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
274+
INPUT_PORTS_END
275+
276+
277+
// TODO: maybe not 100% correct
278+
static const gfx_layout charlayout =
279+
{
280+
8,8,
281+
RGN_FRAC(1,1),
282+
4,
283+
{ STEP4(0, 4) },
284+
{ STEP4(3, -1), STEP4(4*4+3, -1) },
285+
{ STEP8(0, 4*8) },
286+
8*8*4
287+
};
288+
289+
static const gfx_layout tilelayout =
290+
{
291+
16,16,
292+
RGN_FRAC(1,1),
293+
4,
294+
{ STEP4(0, 4) },
295+
{ STEP4(3, -1), STEP4(4*4+3, -1), STEP4(4*8*16+3, -1), STEP4(4*8*16+4*4+3, -1) },
296+
{ STEP16(0, 4*8) },
297+
16*16*4
298+
};
299+
300+
301+
static GFXDECODE_START( gfx )
302+
GFXDECODE_ENTRY( "tiles", 0, charlayout, 0x200, 16 )
303+
GFXDECODE_ENTRY( "tiles", 0, tilelayout, 0, 16 )
304+
GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x300, 16 )
305+
GFXDECODE_END
306+
307+
308+
void banprestomsz80_state::banprestomsz80(machine_config &config)
309+
{
310+
// basic machine hardware
311+
Z80(config, m_maincpu, 12_MHz_XTAL / 2);
312+
m_maincpu->set_addrmap(AS_PROGRAM, &banprestomsz80_state::program_map);
313+
m_maincpu->set_addrmap(AS_IO, &banprestomsz80_state::io_map);
314+
m_maincpu->set_vblank_int("screen", FUNC(banprestomsz80_state::irq0_line_hold));
315+
316+
//NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
317+
318+
HOPPER(config, m_hopper, attotime::from_msec(100)); // TODO: period is guessed
319+
320+
// video hardware
321+
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO
322+
screen.set_refresh_hz(60);
323+
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
324+
screen.set_size(32*8, 32*8);
325+
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
326+
screen.set_screen_update(FUNC(banprestomsz80_state::screen_update));
327+
screen.set_palette(m_palette);
328+
329+
GFXDECODE(config, m_gfxdecode, m_palette, gfx);
330+
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x400);
331+
332+
// sound hardware
333+
SPEAKER(config, "mono").front_center();
334+
335+
OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.40); // TODO: check frequency and pin 7.
336+
}
337+
338+
339+
// ウルトラマン超闘士激戦 - 大日本重弾戦争 (Ultraman Chō Tōshi Gekisen - Dai Nippon Jūdan Sensō)
340+
ROM_START( dnjsenso )
341+
ROM_REGION( 0x10000, "maincpu", 0 )
342+
ROM_LOAD( "s83-c01.u0129", 0x00000, 0x10000, CRC(b9cb8a41) SHA1(4ca9c6dd44691e90ac8373fc7e1e6c704cb2f64c) )
343+
344+
ROM_REGION( 0x40000, "sprites", 0 )
345+
ROM_LOAD16_BYTE( "s83-a05.u052", 0x00000, 0x20000, CRC(e7fdc950) SHA1(3fe2839a8a8402aa3ee1e867d249b53a4f5bf7a1) )
346+
ROM_LOAD16_BYTE( "s83-a06.u0510", 0x00001, 0x20000, CRC(d2221ab9) SHA1(168ca7cca0d759e7de9d20f838ed9a303ce7bfa8) )
347+
348+
ROM_REGION( 0x40000, "tiles", 0 )
349+
ROM_LOAD16_BYTE( "s83-a03.u049", 0x00000, 0x20000, CRC(dced1091) SHA1(03cb87330bed98b96c3ef790bc4dafb744e2f3c9) )
350+
ROM_LOAD16_BYTE( "s83-a04.u0410", 0x00001, 0x20000, CRC(7146ab4d) SHA1(f819fbe9cf97ea6cb9b6b545fc2786ba5526fd63) )
351+
352+
ROM_REGION( 0x40000, "oki", 0 )
353+
ROM_LOAD( "s83_a02.u0729", 0x00000, 0x20000, CRC(2de05c7a) SHA1(7df663d8f3274dec2af432eb59fa5e270e51efac) )
354+
355+
ROM_REGION( 0x400, "plds", ROMREGION_ERASE00 )
356+
ROM_LOAD( "scz01b.u017", 0x000, 0x104, NO_DUMP ) // TIBPAL16L8-25CN
357+
ROM_LOAD( "scz02.u061", 0x200, 0x155, NO_DUMP ) // 18CV8-PC25
358+
ROM_END
359+
360+
//} // anonymous namespace
361+
362+
363+
GAME( 1992, dnjsenso, 0, banprestomsz80, dnjsenso, banprestomsz80_state, empty_init, ROT0, "Banpresto", "Ultraman Cho Toshi Gekisen - Dai Nippon Judan Senso", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )

0 commit comments

Comments
 (0)