Skip to content

Commit bbb80b7

Browse files
committed
Added experimental support for neocd homebrew titles.
1 parent 1cea09a commit bbb80b7

10 files changed

Lines changed: 165 additions & 37 deletions

File tree

scripts/target/hbmame/hbmame.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ files {
666666
MAME_DIR .. "src/hbmame/video/neogeo.cpp",
667667
MAME_DIR .. "src/hbmame/drivers/neogeo_noslot.cpp",
668668
MAME_DIR .. "src/hbmame/video/neogeo_spr.cpp",
669-
MAME_DIR .. "src/hbmame/machine/ng_memcard.cpp",
669+
MAME_DIR .. "src/hbmame/machine/hbng_memcard.cpp",
670670
MAME_DIR .. "src/hbmame/bus/neogeo/prot.cpp",
671671
MAME_DIR .. "src/hbmame/bus/neogeo/banked_cart.cpp",
672672
MAME_DIR .. "src/hbmame/bus/neogeo_ctrl/ctrl.cpp",
@@ -675,7 +675,6 @@ files {
675675
MAME_DIR .. "src/hbmame/bus/neogeo_ctrl/dial.cpp",
676676
MAME_DIR .. "src/hbmame/bus/neogeo_ctrl/irrmaze.cpp",
677677
MAME_DIR .. "src/hbmame/bus/neogeo_ctrl/kizuna4p.cpp",
678-
-- MAME_DIR .. "src/mame/drivers/neogeocd.cpp",
679678
}
680679

681680
createHBMAMEProjects(_target, _subtarget, "nichibutsu")
@@ -850,6 +849,13 @@ files {
850849
MAME_DIR .. "src/hbmame/drivers/snk6502.cpp",
851850
MAME_DIR .. "src/mame/snk/snk6502_a.cpp",
852851
MAME_DIR .. "src/mame/snk/snk6502_v.cpp",
852+
MAME_DIR .. "src/hbmame/drivers/neogeocd.cpp",
853+
MAME_DIR .. "src/mame/shared/megacdcd.cpp",
854+
MAME_DIR .. "src/mame/snk/neogeo_spr.cpp",
855+
MAME_DIR .. "src/mame/snk/neogeo.cpp",
856+
MAME_DIR .. "src/mame/snk/neogeo_v.cpp",
857+
MAME_DIR .. "src/devices/bus/neogeo/slot.cpp",
858+
MAME_DIR .. "src/mame/snk/ng_memcard.cpp",
853859
}
854860

855861
createHBMAMEProjects(_target, _subtarget, "sony")

src/hbmame/drivers/neogeo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ void neogeo_state::neogeo_arcade(machine_config &config)
982982
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_ticks(3244030, NEOGEO_MASTER_CLOCK));
983983
UPD4990A(config, m_upd4990a);
984984
NVRAM(config, "saveram", nvram_device::DEFAULT_ALL_0);
985-
NG_MEMCARD(config, "memcard");
985+
HBNG_MEMCARD(config, "memcard");
986986
}
987987

988988
void neogeo_state::mvs(machine_config &config)

src/hbmame/drivers/neogeocd.cpp

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// license:GPL_2.0
2+
// copyright-holders:Robbbert
3+
#include "../mame/snk/neogeocd.cpp"
4+
5+
namespace {
6+
7+
class ngcd_hb : public ngcd_state
8+
{
9+
public:
10+
ngcd_hb(const machine_config &mconfig, device_type type, const char *tag)
11+
: ngcd_state(mconfig, type, tag)
12+
, m_cdrom(*this, "cdrom")
13+
{ }
14+
15+
void neocd_hb(machine_config &config);
16+
17+
private:
18+
required_device<cdrom_image_device> m_cdrom;
19+
};
20+
21+
22+
void ngcd_hb::neocd_hb(machine_config &config)
23+
{
24+
neogeo_base(config);
25+
neogeo_stereo(config);
26+
27+
m_maincpu->set_addrmap(AS_PROGRAM, &ngcd_hb::neocd_main_map);
28+
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &ngcd_hb::neocd_vector_map);
29+
30+
m_audiocpu->set_addrmap(AS_PROGRAM, &ngcd_hb::neocd_audio_map);
31+
m_audiocpu->set_addrmap(AS_IO, &ngcd_hb::neocd_audio_io_map);
32+
33+
m_screen->set_screen_update(FUNC(ngcd_hb::screen_update));
34+
35+
// temporary until things are cleaned up
36+
LC89510_TEMP(config, m_tempcdc); // cd controller
37+
m_tempcdc->set_cdrom_tag("cdrom");
38+
m_tempcdc->set_is_neoCD(true);
39+
m_tempcdc->set_type1_interrupt_callback(FUNC(ngcd_hb::interrupt_callback_type1));
40+
m_tempcdc->set_type2_interrupt_callback(FUNC(ngcd_hb::interrupt_callback_type2));
41+
m_tempcdc->set_type3_interrupt_callback(FUNC(ngcd_hb::interrupt_callback_type3));
42+
43+
NVRAM(config, "saveram", nvram_device::DEFAULT_ALL_0);
44+
45+
NEOGEO_CONTROL_PORT(config, m_ctrl1, neogeo_controls, "joy", false);
46+
NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_controls, "joy", false);
47+
48+
CDROM(config, m_cdrom).set_interface("cdrom");
49+
m_cdrom->add_region("cdrom");
50+
51+
m_ym->set_addrmap(0, &ngcd_hb::neocd_ym_map);
52+
}
53+
54+
55+
#define NEOCDZ_BIOS \
56+
ROM_REGION16_BE( 0x80000, "mainbios", 0 ) \
57+
ROM_SYSTEM_BIOS( 0, "official", "Official BIOS" ) \
58+
ROMX_LOAD("neocd.bin", 0x00000, 0x80000, CRC(df9de490) SHA1(7bb26d1e5d1e930515219cb18bcde5b7b23e2eda), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(0)) \
59+
ROM_SYSTEM_BIOS( 1, "unibios32", "Universe BIOS (Hack, Ver. 3.2)" ) \
60+
ROMX_LOAD("uni-bioscd32.rom", 0x00000, 0x80000, CRC(0ffb3127) SHA1(5158b728e62b391fb69493743dcf7abbc62abc82), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1)) \
61+
ROM_SYSTEM_BIOS( 2, "unibios33", "Universe BIOS (Hack, Ver. 3.3)" ) \
62+
ROMX_LOAD("uni-bioscd33.rom", 0x00000, 0x80000, CRC(ff3abc59) SHA1(5142f205912869b673a71480c5828b1eaed782a8), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2)) \
63+
ROM_REGION( 0x20000, "spritegen:zoomy", 0 ) \
64+
ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) )
65+
66+
ROM_START( cd_blueandr )
67+
NEOCDZ_BIOS
68+
DISK_REGION( "cdrom" )
69+
DISK_IMAGE_READONLY( "blueandr", 0, SHA1(1e3ea5255c8df92dfdebe060b9a72d8d3fd140dd) )
70+
ROM_END
71+
72+
ROM_START( cd_galx )
73+
NEOCDZ_BIOS
74+
DISK_REGION( "cdrom" )
75+
DISK_IMAGE_READONLY( "galaxian", 0, SHA1(00edb916464653c14dba6920d2b96867dbb486d1) )
76+
ROM_END
77+
78+
ROM_START( cd_galx2 )
79+
NEOCDZ_BIOS
80+
DISK_REGION( "cdrom" )
81+
DISK_IMAGE_READONLY( "galaxian2", 0, SHA1(ecaf39c082393ab3274661c7b2386067cf297c01) )
82+
ROM_END
83+
84+
ROM_START( cd_midnight )
85+
NEOCDZ_BIOS
86+
DISK_REGION( "cdrom" )
87+
DISK_IMAGE_READONLY( "midnight", 0, SHA1(209a3717709d82a5e4fdab30457e0e1894bc24e6) )
88+
ROM_END
89+
90+
ROM_START( cd_pong )
91+
NEOCDZ_BIOS
92+
DISK_REGION( "cdrom" )
93+
DISK_IMAGE_READONLY( "pong", 0, SHA1(5f2a993bce41f18e6562e0c113cc08fd7bc8060f) )
94+
ROM_END
95+
96+
ROM_START( cd_rickdx )
97+
NEOCDZ_BIOS
98+
DISK_REGION( "cdrom" )
99+
DISK_IMAGE_READONLY( "rickdx", 0, SHA1(e55a576b7bfabe1b71aff8f0febd8a4963d3104f) )
100+
ROM_END
101+
102+
ROM_START( cd_ssrpg )
103+
NEOCDZ_BIOS
104+
DISK_REGION( "cdrom" )
105+
DISK_IMAGE_READONLY( "ssrpg", 0, SHA1(2bc6a30d305c52e9189efe9840d34370ed260300) )
106+
ROM_END
107+
108+
} // anonymous namespace
109+
110+
GAME( 2026, cd_blueandr, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "Kaiju Wasp", "Blue and Red Fight the Robots v1.7 (CD)", MACHINE_SUPPORTS_SAVE )
111+
GAME( 2023, cd_galx, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "tcdev", "Galaxians (CD)", MACHINE_SUPPORTS_SAVE )
112+
GAME( 2023, cd_galx2, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "tcdev", "Galaxians 2 (CD)", MACHINE_SUPPORTS_SAVE )
113+
GAME( 2026, cd_midnight, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "Z-team", "Midnight Wanderers (CD)", MACHINE_SUPPORTS_SAVE )
114+
GAME( 2023, cd_pong, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "unk", "Pong (CD)", MACHINE_SUPPORTS_SAVE )
115+
GAME( 2026, cd_rickdx, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "Z-team", "Rick Dangerous DX (CD)", MACHINE_SUPPORTS_SAVE )
116+
GAME( 2016, cd_ssrpg, neocdz, neocd_hb, neocd, ngcd_hb, init_neocdz, ROT0, "Apocalypse", "Samurai Spirits RPG (English) (CD)", MACHINE_SUPPORTS_SAVE )
117+
118+

src/hbmame/hbmame.lst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6657,6 +6657,16 @@ wakuwk7e
66576657
whpe
66586658
wjammere
66596659

6660+
@source:neogeocd.cpp
6661+
neocdz
6662+
cd_blueandr
6663+
cd_galx
6664+
cd_galx2
6665+
cd_midnight
6666+
cd_pong
6667+
cd_rickdx
6668+
cd_ssrpg
6669+
66606670
@source:ngdoubledr.cpp
66616671
doubledr01
66626672
doubledr02

src/hbmame/includes/neogeo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "machine/watchdog.h"
1010
#include "sound/ymopn.h"
1111
#include "machine/upd1990a.h"
12-
#include "machine/ng_memcard.h"
12+
#include "machine/hbng_memcard.h"
1313
#include "machine/gen_latch.h"
1414
#include "video/neogeo_spr.h"
1515
#include "imagedev/snapquik.h"
@@ -335,7 +335,7 @@ class neogeo_state : public driver_device
335335
optional_shared_ptr<u16 > m_save_ram;
336336
required_device<screen_device> m_screen;
337337
optional_device<palette_device> m_palette;
338-
optional_device<ng_memcard_device> m_memcard;
338+
optional_device<hbng_memcard_device> m_memcard;
339339
optional_ioport m_dsw;
340340
optional_ioport m_trackx;
341341
optional_ioport m_tracky;
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
#include "emu.h"
1212
#include "emuopts.h"
13-
#include "ng_memcard.h"
13+
#include "hbng_memcard.h"
1414

1515
// device type definition
16-
DEFINE_DEVICE_TYPE(NG_MEMCARD, ng_memcard_device, "ng_memcard", "NeoGeo Memory Card")
16+
DEFINE_DEVICE_TYPE(HBNG_MEMCARD, hbng_memcard_device, "hbng_memcard", "HB NeoGeo Memory Card")
1717

1818
//-------------------------------------------------
1919
// ng_memcard_device - constructor
2020
//-------------------------------------------------
2121

22-
ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
23-
: device_t(mconfig, NG_MEMCARD, tag, owner, clock),
22+
hbng_memcard_device::hbng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
23+
: device_t(mconfig, HBNG_MEMCARD, tag, owner, clock),
2424
device_memcard_image_interface(mconfig, *this)
2525
{
2626
}
@@ -31,7 +31,7 @@ ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *
3131
// device_start - device-specific startup
3232
//-------------------------------------------------
3333

34-
void ng_memcard_device::device_start()
34+
void hbng_memcard_device::device_start()
3535
{
3636
save_item(NAME(m_memcard_data));
3737
}
@@ -41,7 +41,7 @@ void ng_memcard_device::device_start()
4141
with the given index
4242
-------------------------------------------------*/
4343

44-
std::pair<std::error_condition, std::string> ng_memcard_device::call_load()
44+
std::pair<std::error_condition, std::string> hbng_memcard_device::call_load()
4545
{
4646
if(length() != 0x800)
4747
return std::make_pair(image_error::INVALIDLENGTH, "Unsupported memory card size (only 2K cards are supported)");
@@ -54,13 +54,13 @@ std::pair<std::error_condition, std::string> ng_memcard_device::call_load()
5454
return std::make_pair(std::error_condition(), std::string());
5555
}
5656

57-
void ng_memcard_device::call_unload()
57+
void hbng_memcard_device::call_unload()
5858
{
5959
fseek(0, SEEK_SET);
6060
fwrite(m_memcard_data, 0x800);
6161
}
6262

63-
std::pair<std::error_condition, std::string> ng_memcard_device::call_create(int format_type, util::option_resolution *format_options)
63+
std::pair<std::error_condition, std::string> hbng_memcard_device::call_create(int format_type, util::option_resolution *format_options)
6464
{
6565
memset(m_memcard_data, 0, 0x800);
6666

@@ -72,12 +72,12 @@ std::pair<std::error_condition, std::string> ng_memcard_device::call_create(int
7272
}
7373

7474

75-
u8 ng_memcard_device::read(offs_t offset)
75+
u8 hbng_memcard_device::read(offs_t offset)
7676
{
7777
return m_memcard_data[offset];
7878
}
7979

80-
void ng_memcard_device::write(offs_t offset, u8 data)
80+
void hbng_memcard_device::write(offs_t offset, u8 data)
8181
{
8282
m_memcard_data[offset] = data;
8383
}
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@
1010

1111
#pragma once
1212

13-
#ifndef __NG_MEMCARD_H__
14-
#define __NG_MEMCARD_H__
15-
16-
//**************************************************************************
17-
// INTERFACE CONFIGURATION MACROS
18-
//**************************************************************************
19-
20-
#define MCFG_NEOGEO_MEMCARD_ADD(_tag) \
21-
MCFG_DEVICE_ADD(_tag, NG_MEMCARD, 0)
13+
#ifndef __HBNG_MEMCARD_H__
14+
#define __HBNG_MEMCARD_H__
2215

2316
/***************************************************************************
2417
FUNCTION PROTOTYPES
@@ -27,11 +20,11 @@
2720

2821
// ======================> ng_memcard_device
2922

30-
class ng_memcard_device : public device_t, public device_memcard_image_interface
23+
class hbng_memcard_device : public device_t, public device_memcard_image_interface
3124
{
3225
public:
3326
// construction/destruction
34-
ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
27+
hbng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
3528

3629
virtual bool is_reset_on_load() const noexcept override { return false; }
3730
virtual const char *file_extensions() const noexcept override { return "neo"; }
@@ -54,7 +47,7 @@ class ng_memcard_device : public device_t, public device_memcard_image_interfac
5447

5548

5649
// device type definition
57-
DECLARE_DEVICE_TYPE(NG_MEMCARD, ng_memcard_device)
50+
DECLARE_DEVICE_TYPE(HBNG_MEMCARD, hbng_memcard_device)
5851

5952

6053
#endif /* __NG_MEMCARD_H__ */

src/mame/snk/neogeo.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@
557557
#include "softlist_dev.h"
558558
#include "speaker.h"
559559

560-
#include "irrmaze.lh"
560+
//#include "irrmaze.lh"
561561
#include "neogeo.lh"
562562

563563
#define LOG_VIDEO_SYSTEM (1U << 1)
@@ -1801,7 +1801,7 @@ void neogeo_base_state::audio_io_map(address_map &map)
18011801
map(0x0c, 0x0c).mirror(0xff00).w(m_soundlatch2, FUNC(generic_latch_8_device::write));
18021802
}
18031803

1804-
1804+
#if 0
18051805

18061806
/*************************************
18071807
*
@@ -1882,7 +1882,7 @@ static INPUT_PORTS_START( neogeo_mvs6 )
18821882
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) // sense: 6-slot
18831883
INPUT_PORTS_END
18841884

1885-
1885+
#endif
18861886

18871887
INPUT_PORTS_START( aes )
18881888
PORT_START("IN2")
@@ -1972,7 +1972,7 @@ void neogeo_base_state::neogeo_stereo(machine_config &config)
19721972
m_ym->add_route(2, "speaker", 0.98, 1);
19731973
}
19741974

1975-
1975+
#if 0
19761976
void neogeo_base_state::neogeo_memcard(machine_config &config)
19771977
{
19781978
NG_MEMCARD(config, m_memcard);
@@ -2119,7 +2119,7 @@ void mvs_led_state::mv1_fixed(machine_config &config)
21192119
NEOGEO_CONTROL_PORT(config, m_ctrl2, neogeo_arc_pin15, nullptr, true);
21202120
}
21212121

2122-
2122+
#endif
21232123

21242124
void aes_base_state::machine_start()
21252125
{
@@ -2146,7 +2146,7 @@ void aes_state::device_post_load()
21462146
if (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0)
21472147
m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base);
21482148
}
2149-
2149+
#if 0
21502150
// NTSC region
21512151
void aes_state::aes_ntsc(machine_config &config)
21522152
{
@@ -2487,7 +2487,7 @@ void mvs_state::irrmaze(machine_config &config)
24872487

24882488
NEOGEO_CTRL_EDGE_CONNECTOR(config, m_edge, neogeo_arc_edge_irrmaze, "irrmaze", false);
24892489

2490-
config.set_default_layout(layout_irrmaze);
2490+
//config.set_default_layout(layout_irrmaze);
24912491

24922492
cartslot_fixed(config, "rom");
24932493
}
@@ -12253,3 +12253,5 @@ GAME( 2005, lasthope, neogeo, neobase, neogeo, mvs_led_state, empty_ini
1225312253

1225412254
// NEOBITZ
1225512255
// Knight's Chance (c)2014 - MVS/AES
12256+
#endif
12257+

src/mame/snk/neogeocd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ngcd_state : public aes_base_state
7777
virtual void machine_start() override ATTR_COLD;
7878
virtual void machine_reset() override ATTR_COLD;
7979

80-
private:
80+
//private:
8181
optional_device<lc89510_temp_device> m_tempcdc;
8282
required_shared_ptr<uint8_t> m_z80_ram;
8383
required_shared_ptr<uint8_t> m_adpcm_ram;
@@ -331,7 +331,7 @@ void ngcd_state::control_w(address_space &space, offs_t offset, uint16_t data, u
331331
// is there some way to enable write protection on the RAM vector area or is it some IRQ masking issue?
332332
// the games still write to the normal address for this too?
333333
// writes 00 / 01 / ff
334-
printf("MapVectorTable? %04x %04x\n",data,mem_mask);
334+
//printf("MapVectorTable? %04x %04x\n",data,mem_mask);
335335

336336
//m_bank_vectors->set_entry(data == 0 ? 0 : 1);
337337
m_use_cart_vectors = (data == 0 ? 0 : 1);

0 commit comments

Comments
 (0)