neogeo: Split into real models:

* Moved common stuff (mostly video) into a base memory map.
* Split common edge connector inputs into JAMMA and MVS.
* Added clones with different numbers of game slots, edge connector, controller ports, memory card, and speakers.
* Based fixed-software drivers on MV-1 JAMMA board configuration.
* Removed memory card and controller ports from single-PCB games and converted to mono output.
* Coin lockouts/counters still not connected, and LED/EL output isn't suppressed for variants that lack it.

(nw) suppress leading space in RAM option names
This commit is contained in:
Vas Crabb 2018-03-29 12:44:00 +11:00
parent a7262c8358
commit af143199f8
7 changed files with 481 additions and 392 deletions

View File

@ -75,6 +75,10 @@ ram_device::extra_option_vector calculate_extra_options(const char *extra_option
bool done(false);
for (std::string::size_type start = 0, end = options.find_first_of(','); !done; start = end + 1, end = options.find_first_of(',', start))
{
// ignore spaces
while ((end > start) && (options.length() > start) && ((' ' == options[start]) || ('\t' == options[start])))
++start;
// parse the option
std::string ram_option_string(options.substr(start, (end == -1) ? -1 : end - start));
u32 const ram_option = parse_string(ram_option_string.c_str());

File diff suppressed because it is too large Load Diff

View File

@ -886,23 +886,11 @@ void ngcd_state::machine_reset()
void ngcd_state::neocd_main_map(address_map &map)
{
// AM_RANGE(0x000000, 0x00007f) AM_READ_BANK("vectors") // writes will fall through to area below
map(0x000000, 0x1fffff).ram().region("maincpu", 0x00000);
map(0x000000, 0x00007f).r(this, FUNC(ngcd_state::banked_vectors_r));
aes_base_main_map(map);
map(0x000000, 0x1fffff).ram().region("maincpu", 0x00000);
map(0x000000, 0x00007f).r(this, FUNC(ngcd_state::banked_vectors_r)); // writes will fall through to area above
map(0x300000, 0x300000).mirror(0x01fffe).r(m_ctrl1, FUNC(neogeo_control_port_device::ctrl_r));
map(0x320000, 0x320001).mirror(0x01fffe).portr("AUDIO");
map(0x320000, 0x320000).mirror(0x01fffe).w(this, FUNC(ngcd_state::audio_command_w));
map(0x340000, 0x340000).mirror(0x01fffe).r(m_ctrl2, FUNC(neogeo_control_port_device::ctrl_r));
map(0x360000, 0x37ffff).r(this, FUNC(ngcd_state::unmapped_r));
map(0x380000, 0x380001).mirror(0x01fffe).r(this, FUNC(ngcd_state::aes_in2_r));
map(0x380000, 0x38007f).mirror(0x01ff80).w(this, FUNC(ngcd_state::io_control_w)).umask16(0x00ff);
map(0x3a0000, 0x3a001f).mirror(0x01ffe0).r(this, FUNC(ngcd_state::unmapped_r));
map(0x3a0000, 0x3a001f).mirror(0x01ffe0).w("systemlatch", FUNC(hc259_device::write_a3)).umask16(0x00ff);
map(0x3c0000, 0x3c0007).mirror(0x01fff8).r(this, FUNC(ngcd_state::video_register_r));
map(0x3c0000, 0x3c000f).mirror(0x01fff0).w(this, FUNC(ngcd_state::video_register_w));
map(0x3e0000, 0x3fffff).r(this, FUNC(ngcd_state::unmapped_r));
map(0x400000, 0x401fff).mirror(0x3fe000).rw(this, FUNC(ngcd_state::paletteram_r), FUNC(ngcd_state::paletteram_w));
map(0x800000, 0x803fff).rw(this, FUNC(ngcd_state::neocd_memcard_r), FUNC(ngcd_state::neocd_memcard_w));
map(0xc00000, 0xc7ffff).mirror(0x080000).rom().region("mainbios", 0);
map(0xd00000, 0xdfffff).r(this, FUNC(ngcd_state::unmapped_r));
@ -928,7 +916,7 @@ void ngcd_state::neocd_audio_map(address_map &map)
void ngcd_state::neocd_audio_io_map(address_map &map)
{
map(0x00, 0x00).mirror(0xff00).r(this, FUNC(ngcd_state::audio_command_r)).w(m_soundlatch, FUNC(generic_latch_8_device::clear_w));
map(0x00, 0x00).mirror(0xff00).rw(m_soundlatch, FUNC(generic_latch_8_device::read), FUNC(generic_latch_8_device::clear_w));
map(0x04, 0x07).mirror(0xff00).rw(m_ym, FUNC(ym2610_device::read), FUNC(ym2610_device::write));
map(0x08, 0x08).mirror(0xff00).select(0x0010).w(this, FUNC(ngcd_state::audio_cpu_enable_nmi_w));
// banking reads are actually NOP on NeoCD? but some games still access them
@ -1043,6 +1031,7 @@ uint32_t ngcd_state::screen_update_neocd(screen_device &screen, bitmap_rgb32 &bi
MACHINE_CONFIG_START(ngcd_state::neocd)
neogeo_base(config);
neogeo_stereo(config);
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(neocd_main_map)

View File

@ -72,6 +72,10 @@ void neopcb_state::neogeo_postload()
MACHINE_CONFIG_START(neopcb_state::neopcb)
neogeo_arcade(config);
neogeo_mono(config);
MCFG_NEOGEO_CONTROL_EDGE_CONNECTOR_ADD("edge", neogeo_arc_edge, "joy", true)
MCFG_CMC_PROT_ADD("cmc50")
MCFG_PCM2_PROT_ADD("pcm2")
MCFG_PVC_PROT_ADD("pvc")

View File

@ -15,6 +15,7 @@
#include "cpu/z80/z80.h"
#include "sound/2610intf.h"
#include "machine/gen_latch.h"
#include "machine/input_merger.h"
#include "machine/upd1990a.h"
#include "machine/ng_memcard.h"
#include "video/neogeo_spr.h"
@ -31,40 +32,43 @@
#define NEOGEO_VBLANK_IRQ_HTIM (attotime::from_ticks(56+2, NEOGEO_MASTER_CLOCK))
class neogeo_state : public driver_device
class neogeo_base_state : public driver_device
{
public:
neogeo_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_ym(*this, "ymsnd"),
m_sprgen(*this, "spritegen"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_memcard(*this, "memcard"),
m_soundlatch(*this, "soundlatch"),
m_soundlatch2(*this, "soundlatch2"),
m_region_maincpu(*this, "maincpu"),
m_region_sprites(*this, "sprites"),
m_region_fixed(*this, "fixed"),
m_region_fixedbios(*this, "fixedbios"),
m_region_mainbios(*this, "mainbios"),
m_region_audiobios(*this, "audiobios"),
m_region_audiocpu(*this, "audiocpu"),
m_bank_audio_main(*this, "audio_main"),
m_edge(*this, "edge"),
m_ctrl1(*this, "ctrl1"),
m_ctrl2(*this, "ctrl2"),
m_use_cart_vectors(0),
m_use_cart_audio(0),
m_slots(*this, "cslot%u", 1U)
DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status);
DECLARE_CUSTOM_INPUT_MEMBER(get_audio_result);
protected:
neogeo_base_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_ym(*this, "ymsnd")
, m_sprgen(*this, "spritegen")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_memcard(*this, "memcard")
, m_soundlatch(*this, "soundlatch")
, m_soundlatch2(*this, "soundlatch2")
, m_region_maincpu(*this, "maincpu")
, m_region_sprites(*this, "sprites")
, m_region_fixed(*this, "fixed")
, m_region_fixedbios(*this, "fixedbios")
, m_region_mainbios(*this, "mainbios")
, m_region_audiobios(*this, "audiobios")
, m_region_audiocpu(*this, "audiocpu")
, m_bank_audio_main(*this, "audio_main")
, m_edge(*this, "edge")
, m_ctrl1(*this, "ctrl1")
, m_ctrl2(*this, "ctrl2")
, m_use_cart_vectors(0)
, m_use_cart_audio(0)
, m_slots(*this, "cslot%u", 1U)
, m_audionmi(*this, "audionmi")
{ }
DECLARE_READ16_MEMBER(memcard_r);
DECLARE_WRITE16_MEMBER(memcard_w);
DECLARE_WRITE8_MEMBER(audio_command_w);
DECLARE_READ8_MEMBER(audio_command_r);
DECLARE_READ8_MEMBER(audio_cpu_bank_select_r);
DECLARE_WRITE8_MEMBER(audio_cpu_enable_nmi_w);
DECLARE_READ16_MEMBER(unmapped_r);
@ -73,9 +77,6 @@ public:
DECLARE_READ16_MEMBER(video_register_r);
DECLARE_WRITE16_MEMBER(video_register_w);
DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status);
DECLARE_CUSTOM_INPUT_MEMBER(get_audio_result);
TIMER_CALLBACK_MEMBER(display_position_interrupt_callback);
TIMER_CALLBACK_MEMBER(display_position_vblank_callback);
TIMER_CALLBACK_MEMBER(vblank_interrupt_callback);
@ -98,10 +99,12 @@ public:
DECLARE_WRITE_LINE_MEMBER(set_palette_bank);
void neogeo_base(machine_config &config);
void neogeo_stereo(machine_config &config);
void base_main_map(address_map &map);
void audio_io_map(address_map &map);
void audio_map(address_map &map);
protected:
// device overrides
virtual void machine_start() override;
virtual void machine_reset() override;
@ -178,12 +181,8 @@ private:
void create_rgb_lookups();
void set_pens();
void audio_cpu_check_nmi();
// internal state
bool m_recurse;
bool m_audio_cpu_nmi_enabled;
bool m_audio_cpu_nmi_pending;
emu_timer *m_display_position_interrupt_timer;
emu_timer *m_display_position_vblank_timer;
@ -196,6 +195,8 @@ private:
uint16_t get_video_control();
required_device<input_merger_device> m_audionmi;
// color/palette related
std::vector<uint16_t> m_paletteram;
uint8_t m_palette_lookup[32][4];
@ -204,11 +205,11 @@ private:
};
class ngarcade_base_state : public neogeo_state
class ngarcade_base_state : public neogeo_base_state
{
protected:
ngarcade_base_state(const machine_config &mconfig, device_type type, const char *tag)
: neogeo_state(mconfig, type, tag)
: neogeo_base_state(mconfig, type, tag)
, m_save_ram(*this, "saveram")
, m_upd4990a(*this, "upd4990a")
, m_dsw(*this, "DSW")
@ -220,13 +221,15 @@ protected:
virtual DECLARE_WRITE8_MEMBER(io_control_w) override;
DECLARE_WRITE_LINE_MEMBER(set_save_ram_unlock);
DECLARE_WRITE16_MEMBER(save_ram_w);
DECLARE_READ16_MEMBER(in0_r);
DECLARE_READ16_MEMBER(in1_r);
DECLARE_READ16_MEMBER(in0_edge_r);
DECLARE_READ16_MEMBER(in0_edge_joy_r);
DECLARE_READ16_MEMBER(in1_edge_r);
DECLARE_READ16_MEMBER(in1_edge_joy_r);
void neogeo_arcade(machine_config &config);
void neogeo_mono(machine_config &config);
void neogeo_main_map(address_map &map);
void main_map_slot(address_map &map);
private:
required_shared_ptr<uint16_t> m_save_ram;
@ -237,14 +240,14 @@ private:
};
class aes_base_state : public neogeo_state
class aes_base_state : public neogeo_base_state
{
public:
DECLARE_INPUT_CHANGED_MEMBER(aes_jp1);
protected:
aes_base_state(const machine_config &mconfig, device_type type, const char *tag)
: neogeo_state(mconfig, type, tag)
: neogeo_base_state(mconfig, type, tag)
, m_io_in2(*this, "IN2")
{
}
@ -253,7 +256,7 @@ protected:
virtual void machine_start() override;
void aes_main_map(address_map &map);
void aes_base_main_map(address_map &map);
private:
required_ioport m_io_in2;

View File

@ -29560,7 +29560,12 @@ salamandj // GX587 (c) 1986
twinbee // GX412 (c) 1985
@source:neogeo.cpp
neogeo // NeoGeo MVS
neogeo // NeoGeo MV-6F
ng_mv4f // NeoGeo MV-4F
ng_mv2f // NeoGeo MV-2F
ng_mv1 // NeoGeo MV-1
ng_mv1f // NeoGeo MV-1F
ng_mv1fz // NeoGeo MV-1FZ
aes // NeoGeo AES
2020bb // 0030 (c) 1991 SNK / Pallas
2020bba // 0030 (c) 1991 SNK / Pallas

View File

@ -22,7 +22,7 @@
*
*************************************/
void neogeo_state::create_rgb_lookups()
void neogeo_base_state::create_rgb_lookups()
{
static const int resistances[] = {3900, 2200, 1000, 470, 220};
@ -66,7 +66,7 @@ void neogeo_state::create_rgb_lookups()
}
}
void neogeo_state::set_pens()
void neogeo_base_state::set_pens()
{
const pen_t *pen_base = m_palette->pens() + m_palette_bank + (m_screen_shadow ? 0x2000 : 0);
m_sprgen->set_pens(pen_base);
@ -74,27 +74,27 @@ void neogeo_state::set_pens()
}
WRITE_LINE_MEMBER(neogeo_state::set_screen_shadow)
WRITE_LINE_MEMBER(neogeo_base_state::set_screen_shadow)
{
m_screen_shadow = state;
set_pens();
}
WRITE_LINE_MEMBER(neogeo_state::set_palette_bank)
WRITE_LINE_MEMBER(neogeo_base_state::set_palette_bank)
{
m_palette_bank = state ? 0x1000 : 0;
set_pens();
}
READ16_MEMBER(neogeo_state::paletteram_r)
READ16_MEMBER(neogeo_base_state::paletteram_r)
{
return m_paletteram[m_palette_bank + offset];
}
WRITE16_MEMBER(neogeo_state::paletteram_w)
WRITE16_MEMBER(neogeo_base_state::paletteram_w)
{
offset += m_palette_bank;
data = COMBINE_DATA(&m_paletteram[offset]);
@ -123,7 +123,7 @@ WRITE16_MEMBER(neogeo_state::paletteram_w)
*
*************************************/
void neogeo_state::video_start()
void neogeo_base_state::video_start()
{
create_rgb_lookups();
@ -136,7 +136,7 @@ void neogeo_state::video_start()
save_item(NAME(m_paletteram));
save_item(NAME(m_screen_shadow));
save_item(NAME(m_palette_bank));
machine().save().register_postload(save_prepost_delegate(FUNC(neogeo_state::set_pens), this));
machine().save().register_postload(save_prepost_delegate(FUNC(neogeo_base_state::set_pens), this));
set_pens();
}
@ -149,7 +149,7 @@ void neogeo_state::video_start()
*
*************************************/
void neogeo_state::video_reset()
void neogeo_base_state::video_reset()
{
}
@ -161,7 +161,7 @@ void neogeo_state::video_reset()
*
*************************************/
uint32_t neogeo_state::screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
uint32_t neogeo_base_state::screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
// fill with background color first
bitmap.fill(*m_bg_pen, cliprect);
@ -181,7 +181,7 @@ uint32_t neogeo_state::screen_update_neogeo(screen_device &screen, bitmap_rgb32
*
*************************************/
uint16_t neogeo_state::get_video_control()
uint16_t neogeo_base_state::get_video_control()
{
uint16_t ret;
uint16_t v_counter;
@ -221,7 +221,7 @@ uint16_t neogeo_state::get_video_control()
}
void neogeo_state::set_video_control(uint16_t data)
void neogeo_base_state::set_video_control(uint16_t data)
{
if (VERBOSE) logerror("%s: video control write %04x\n", machine().describe_context(), data);
@ -232,7 +232,7 @@ void neogeo_state::set_video_control(uint16_t data)
}
READ16_MEMBER(neogeo_state::video_register_r)
READ16_MEMBER(neogeo_base_state::video_register_r)
{
uint16_t ret;
@ -255,7 +255,7 @@ READ16_MEMBER(neogeo_state::video_register_r)
}
WRITE16_MEMBER(neogeo_state::video_register_w)
WRITE16_MEMBER(neogeo_base_state::video_register_w)
{
/* accessing the LSB only is not mapped */
if (mem_mask != 0x00ff)