summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2021-05-05 20:23:59 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2021-05-05 20:23:59 +0200
commit3bdefe103fe0153d9abc6a3423abffff82364550 (patch)
treedd57b0c7aceba53f597f9b47fdabab27ac674d6c /src/mame/drivers
parentcdca170186a6bdda329692cd046462391e86229d (diff)
hornet.cpp, nwk-tr.cpp: extracted nwk-tr.cpp lan board implementation to a device and hooked it up to thrilldbu in hornet.cpp. It doesn't reset anymore but needs analog controls hook-up
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/hornet.cpp38
-rw-r--r--src/mame/drivers/nwk-tr.cpp169
2 files changed, 39 insertions, 168 deletions
diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp
index 362f282e79b..d38a355e5fb 100644
--- a/src/mame/drivers/hornet.cpp
+++ b/src/mame/drivers/hornet.cpp
@@ -351,16 +351,17 @@ Jumpers set on GFX PCB to scope monitor:
#include "cpu/powerpc/ppc.h"
#include "cpu/sharc/sharc.h"
#include "machine/adc1213x.h"
+#include "machine/ds2401.h"
#include "machine/eepromser.h"
#include "machine/k033906.h"
+#include "machine/konami_gn676_lan.h"
#include "machine/konppc.h"
#include "machine/timekpr.h"
-#include "machine/ds2401.h"
#include "machine/watchdog.h"
-#include "sound/rf5c400.h"
#include "sound/k056800.h"
-#include "video/voodoo.h"
+#include "sound/rf5c400.h"
#include "video/k037122.h"
+#include "video/voodoo.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@@ -405,6 +406,7 @@ public:
{ }
void hornet(machine_config &config);
+ void hornet_lan(machine_config &config);
void terabrst(machine_config &config);
void sscope(machine_config &config);
void sscope2(machine_config &config);
@@ -487,6 +489,7 @@ private:
int jvs_decode_data(uint8_t *in, uint8_t *out, int length);
void jamma_jvs_cmd_exec();
void hornet_map(address_map &map);
+ void hornet_lan_map(address_map &map);
void terabrst_map(address_map &map);
void sscope_map(address_map &map);
void sscope2_map(address_map &map);
@@ -791,6 +794,14 @@ void hornet_state::hornet_map(address_map &map)
map(0x7fc00000, 0x7fffffff).rom().region("user1", 0); /* Program ROM */
}
+void hornet_state::hornet_lan_map(address_map &map)
+{
+ hornet_map(map);
+
+ map(0x7d040000, 0x7d04ffff).rw("gn676_lan", FUNC(konami_gn676_lan_device::lanc1_r), FUNC(konami_gn676_lan_device::lanc1_w));
+ map(0x7d050000, 0x7d05ffff).rw("gn676_lan", FUNC(konami_gn676_lan_device::lanc2_r), FUNC(konami_gn676_lan_device::lanc2_w));
+}
+
void hornet_state::terabrst_map(address_map &map)
{
hornet_map(map);
@@ -1197,6 +1208,15 @@ void hornet_state::hornet(machine_config &config)
m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_HORNET);
}
+void hornet_state::hornet_lan(machine_config &config)
+{
+ hornet(config);
+
+ m_maincpu->set_addrmap(AS_PROGRAM, &hornet_state::hornet_lan_map);
+
+ KONAMI_GN676_LAN(config, "gn676_lan", 0, m_workram);
+}
+
void hornet_state::terabrst(machine_config &config) //todo: add K056800 from I/O board
{
hornet(config);
@@ -1732,13 +1752,13 @@ ROM_END
/*************************************************************************/
-GAME( 1998, gradius4, 0, hornet, gradius4, hornet_state, init_hornet, ROT0, "Konami", "Gradius IV: Fukkatsu (ver JAC)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1998, nbapbp, 0, hornet, nbapbp, hornet_state, init_hornet, ROT0, "Konami", "NBA Play By Play (ver JAA)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1998, nbapbpa, nbapbp, hornet, nbapbp, hornet_state, init_hornet, ROT0, "Konami", "NBA Play By Play (ver AAB)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1998, terabrst, 0, terabrst, terabrst, hornet_state, init_hornet, ROT0, "Konami", "Teraburst (1998/07/17 ver UEL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1998, terabrsta, terabrst, terabrst, terabrst, hornet_state, init_hornet, ROT0, "Konami", "Teraburst (1998/02/25 ver AAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1998, gradius4, 0, hornet, gradius4, hornet_state, init_hornet, ROT0, "Konami", "Gradius IV: Fukkatsu (ver JAC)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1998, nbapbp, 0, hornet, nbapbp, hornet_state, init_hornet, ROT0, "Konami", "NBA Play By Play (ver JAA)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1998, nbapbpa, nbapbp, hornet, nbapbp, hornet_state, init_hornet, ROT0, "Konami", "NBA Play By Play (ver AAB)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1998, terabrst, 0, terabrst, terabrst, hornet_state, init_hornet, ROT0, "Konami", "Teraburst (1998/07/17 ver UEL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1998, terabrsta, terabrst, terabrst, terabrst, hornet_state, init_hornet, ROT0, "Konami", "Teraburst (1998/02/25 ver AAA)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
// identifies as NWK-LC system
-GAME( 1998, thrilldbu, thrilld, hornet, gradius4, hornet_state, init_hornet, ROT0, "Konami", "Thrill Drive (ver UFB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) // resets after checking wheels, needs proper analog inputs, but the reset probably isn't related
+GAME( 1998, thrilldbu, thrilld, hornet_lan, hornet, hornet_state, init_hornet, ROT0, "Konami", "Thrill Drive (ver UFB)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE | MACHINE_NODEVICE_LAN ) // heavy GFX glitches, fails wheel motor test, for now it's possible to get in game by switching "SW:2" to on
// The region comes from the Timekeeper NVRAM, without a valid default all sets except 'xxD, Ver 1.33' will init their NVRAM to UAx versions, the xxD set seems to incorrectly init it to JXD, which isn't a valid
// version, and thus can't be booted. If you copy the NVRAM from another already initialized set, it will boot as UAD.
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp
index 5b46f799321..43eb3965a10 100644
--- a/src/mame/drivers/nwk-tr.cpp
+++ b/src/mame/drivers/nwk-tr.cpp
@@ -273,6 +273,7 @@ Thrill Drive 713A13 - 713A14 -
#include "cpu/sharc/sharc.h"
#include "machine/adc1213x.h"
#include "machine/k033906.h"
+#include "machine/konami_gn676_lan.h"
#include "machine/konppc.h"
#include "machine/timekpr.h"
//#include "machine/x76f041.h"
@@ -324,6 +325,10 @@ public:
void init_racingj();
void init_thrilld();
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
// TODO: Needs verification on real hardware
static const int m_sound_timer_usec = 2400;
@@ -345,11 +350,6 @@ private:
required_shared_ptr<uint32_t> m_generic_paletteram_32;
emu_timer *m_sound_irq_timer;
- int m_fpga_uploaded;
- int m_lanc2_ram_r;
- int m_lanc2_ram_w;
- uint8_t m_lanc2_reg[3];
- std::unique_ptr<uint8_t[]> m_lanc2_ram;
std::unique_ptr<uint32_t[]> m_sharc0_dataram;
std::unique_ptr<uint32_t[]> m_sharc1_dataram;
void paletteram32_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
@@ -361,10 +361,6 @@ private:
void nwktr_k001604_reg_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint8_t sysreg_r(offs_t offset);
void sysreg_w(offs_t offset, uint8_t data);
- uint32_t lanc1_r(offs_t offset);
- void lanc1_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
- uint32_t lanc2_r(offs_t offset, uint32_t mem_mask = ~0);
- void lanc2_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t dsp_dataram0_r(offs_t offset);
void dsp_dataram0_w(offs_t offset, uint32_t data);
uint32_t dsp_dataram1_r(offs_t offset);
@@ -376,13 +372,10 @@ private:
double adc12138_input_callback(uint8_t input);
TIMER_CALLBACK_MEMBER(sound_irq);
- virtual void machine_start() override;
- virtual void machine_reset() override;
+
uint32_t screen_update_lscreen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t screen_update_rscreen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void lanc2_init();
-
void nwktr_map(address_map &map);
void sharc0_map(address_map &map);
void sharc1_map(address_map &map);
@@ -530,148 +523,6 @@ void nwktr_state::sysreg_w(offs_t offset, uint8_t data)
}
-void nwktr_state::lanc2_init()
-{
- m_fpga_uploaded = 0;
- m_lanc2_ram_r = 0;
- m_lanc2_ram_w = 0;
- m_lanc2_ram = std::make_unique<uint8_t[]>(0x8000);
-}
-
-uint32_t nwktr_state::lanc1_r(offs_t offset)
-{
- switch (offset)
- {
- case 0x40/4:
- {
- uint32_t r = 0;
-
- r |= (m_fpga_uploaded) ? (1 << 6) : 0;
- r |= 1 << 5;
-
- return (r) << 24;
- }
-
- default:
- {
- //printf("lanc1_r: %08X, %08X at %08X\n", offset, mem_mask, m_maincpu->pc());
- return 0xffffffff;
- }
- }
-}
-
-void nwktr_state::lanc1_w(offs_t offset, uint32_t data, uint32_t mem_mask)
-{
- //printf("lanc1_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, m_maincpu->pc());
-}
-
-uint32_t nwktr_state::lanc2_r(offs_t offset, uint32_t mem_mask)
-{
- uint32_t r = 0;
-
- if (offset == 0)
- {
- if (ACCESSING_BITS_0_7)
- {
- r |= m_lanc2_ram[m_lanc2_ram_r & 0x7fff];
- m_lanc2_ram_r++;
- }
- else
- {
- r |= 0xffffff00;
- }
- }
-
- if (offset == 4)
- {
- if (ACCESSING_BITS_24_31)
- {
- r |= 0x00000000;
- }
- }
-
- //printf("lanc2_r: %08X, %08X at %08X\n", offset, mem_mask, m_maincpu->pc());
-
- return r;
-}
-
-void nwktr_state::lanc2_w(offs_t offset, uint32_t data, uint32_t mem_mask)
-{
- if (offset == 0)
- {
- if (ACCESSING_BITS_24_31)
- {
- uint8_t value = data >> 24;
-
- value = ((value >> 7) & 0x01) |
- ((value >> 5) & 0x02) |
- ((value >> 3) & 0x04) |
- ((value >> 1) & 0x08) |
- ((value << 1) & 0x10) |
- ((value << 3) & 0x20) |
- ((value << 5) & 0x40) |
- ((value << 7) & 0x80);
-
- m_fpga_uploaded = 1;
- m_lanc2_reg[0] = (uint8_t)(data >> 24);
-
- //printf("lanc2_fpga_w: %02X at %08X\n", value, m_maincpu->pc());
- }
- else if (ACCESSING_BITS_8_15)
- {
- m_lanc2_ram_r = 0;
- m_lanc2_ram_w = 0;
- m_lanc2_reg[1] = (uint8_t)(data >> 8);
- }
- else if (ACCESSING_BITS_16_23)
- {
- if (m_lanc2_reg[0] != 0)
- {
- m_lanc2_ram[2] = (data >> 20) & 0xf;
- m_lanc2_ram[3] = 0;
- }
- m_lanc2_reg[2] = (uint8_t)(data >> 16);
- }
- else if (ACCESSING_BITS_0_7)
- {
- m_lanc2_ram[m_lanc2_ram_w & 0x7fff] = data & 0xff;
- m_lanc2_ram_w++;
- }
- else
- {
- //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, m_maincpu->pc());
- }
- }
- if (offset == 4)
- {
- // TODO: The data below would normally be present on the serialflash at 2G.
-
- if (strcmp(machine().system().name, "thrilld") == 0 ||
- strcmp(machine().system().name, "thrilldb") == 0 ||
- strcmp(machine().system().name, "thrilldbe") == 0)
- {
- m_work_ram[(0x3ffed0/4) + 0] = 0x472a3731; // G*71
- m_work_ram[(0x3ffed0/4) + 1] = 0x33202020; // 3
- m_work_ram[(0x3ffed0/4) + 2] = 0x2d2d2a2a; // --**
- m_work_ram[(0x3ffed0/4) + 3] = 0x2a207878; // *
-
- m_work_ram[(0x3fff40/4) + 0] = 0x47433731; // GC71
- m_work_ram[(0x3fff40/4) + 1] = 0x33000000; // 3
- m_work_ram[(0x3fff40/4) + 2] = 0x19994a41; // JA
- m_work_ram[(0x3fff40/4) + 3] = 0x4100a9b1; // A
- }
- else if (strcmp(machine().system().name, "racingj2") == 0)
- {
- m_work_ram[(0x3ffc80/4) + 0] = 0x47453838; // GE88
- m_work_ram[(0x3ffc80/4) + 1] = 0x38003030; // 8 00
- m_work_ram[(0x3ffc80/4) + 2] = 0x39374541; // 97EA
- m_work_ram[(0x3ffc80/4) + 3] = 0x410058da; // A
- }
- }
-
- //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, m_maincpu->pc());
-}
-
/*****************************************************************************/
TIMER_CALLBACK_MEMBER(nwktr_state::sound_irq)
@@ -729,8 +580,8 @@ void nwktr_state::nwktr_map(address_map &map)
map(0x7d010000, 0x7d01ffff).w(FUNC(nwktr_state::sysreg_w));
map(0x7d020000, 0x7d021fff).rw("m48t58", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write)); // M48T58Y RTC/NVRAM
map(0x7d030000, 0x7d03000f).rw(m_k056800, FUNC(k056800_device::host_r), FUNC(k056800_device::host_w));
- map(0x7d040000, 0x7d04ffff).rw(FUNC(nwktr_state::lanc1_r), FUNC(nwktr_state::lanc1_w));
- map(0x7d050000, 0x7d05ffff).rw(FUNC(nwktr_state::lanc2_r), FUNC(nwktr_state::lanc2_w));
+ map(0x7d040000, 0x7d04ffff).rw("gn676_lan", FUNC(konami_gn676_lan_device::lanc1_r), FUNC(konami_gn676_lan_device::lanc1_w));
+ map(0x7d050000, 0x7d05ffff).rw("gn676_lan", FUNC(konami_gn676_lan_device::lanc2_r), FUNC(konami_gn676_lan_device::lanc2_w));
map(0x7e000000, 0x7e7fffff).rom().region("user2", 0); /* Data ROM */
map(0x7f000000, 0x7f1fffff).rom().region("user1", 0);
map(0x7fe00000, 0x7fffffff).rom().region("user1", 0); /* Program ROM */
@@ -961,6 +812,8 @@ void nwktr_state::nwktr(machine_config &config)
KONPPC(config, m_konppc, 0);
m_konppc->set_num_boards(2);
m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_NWKTR);
+
+ KONAMI_GN676_LAN(config, "gn676_lan", 0, m_work_ram);
}
void nwktr_state::thrilld(machine_config &config)
@@ -978,8 +831,6 @@ void nwktr_state::init_nwktr()
{
m_sharc0_dataram = std::make_unique<uint32_t[]>(0x100000 / 4);
m_sharc1_dataram = std::make_unique<uint32_t[]>(0x100000 / 4);
-
- lanc2_init();
}
void nwktr_state::init_racingj()