From 70df24ae4cf45560856642373cc0ae9be0739dd2 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 12 Oct 2025 19:02:23 +0200 Subject: [PATCH 01/17] dump mine --- src/mame/mame.lst | 1 + src/mame/skeleton/digijet.cpp | 42 ++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index de539c86e7204..72eb7ef3635af 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -43457,6 +43457,7 @@ digiblst @source:skeleton/digijet.cpp digijet +digijet90 @source:skeleton/digilog320.cpp digilog320 diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 4edd7268640de..b63449054f7b3 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -7,9 +7,35 @@ Skeleton driver for the Volkswagen Digijet series of automotive ECUs The Digijet Engine Control Unit (ECU) was used in Volkswagen vehicles - from the early 1980s. - - Currently, the only dump is from a 1985 Volkswagen Vanagon (USA CA). + from the 1980s. + + CPU: MAF 80A39HL + ROM: ST M2764AF6 + ADC0809CCN + LM2901 + SN74LS373N + SN74LS00N + XTAL 7.372 MHz + + _________________________ + | 7 A 0 | + | 4 D 8 | + C 3 C 0 7 | + O 7 9 4 | + N L2 3 0 | + N M0 M2764AF6 X 0 | + | 91 80A39HL | + |________________________| + + Connector + 3 GND + 6 GND + 7 GND + 9 GND + 10 GND + 16 GND + 17 GND + 18 GND **************************************************************************/ @@ -65,8 +91,14 @@ ROM_START( digijet ) ROM_LOAD( "vanagon_85_usa_ca.bin", 0x000, 0x800, CRC(2ed7c4c5) SHA1(ae48d8892b44fe76b48bcefd293c15cd47af3fba) ) // Volkswagen Vanagon, 1985, USA, California ROM_END +ROM_START( digijet2 ) + ROM_REGION( 0x2000, I8049_TAG, 0 ) + ROM_LOAD( "fabb05_03_03.bin", 0x0000, 0x2000, CRC(8c96bcdf) SHA1(73b26914cd15ca3a5e0d7427de9ce4b4e311fb00) ) // Volkswagen 1990, Germany +ROM_END + } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -CONS( 1985, digijet, 0, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +CONS( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +CONS( 1990, digijet90, 0, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) From 21cabc8cfedc89bb05b8bd87412db8bbca9d8bcb Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 12 Oct 2025 19:33:52 +0200 Subject: [PATCH 02/17] io map --- src/mame/skeleton/digijet.cpp | 37 +++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index b63449054f7b3..46927ab226406 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -28,14 +28,25 @@ |________________________| Connector + 1 RPM + 2 Coolant temperture 3 GND + 4 Throttle switch + 5 Lambda sensor 6 GND 7 GND 9 GND 10 GND + 12 Injectors + 13 Ignition + 14 Air in temperature + 15 Air amount 16 GND 17 GND 18 GND + 19 Air sensor power + 20 Fuel pump + 22 GND **************************************************************************/ @@ -63,6 +74,7 @@ class digijet_state : public driver_device } void digijet(machine_config &config); + void digijet90(machine_config &config); private: required_device m_maincpu; @@ -70,10 +82,20 @@ class digijet_state : public driver_device virtual void machine_start() override { } virtual void machine_reset() override { } void io_map(address_map &map) ATTR_COLD; + void io_map90(address_map &map) ATTR_COLD; }; void digijet_state::io_map(address_map &map) { + map(0x32,0x32).noprw();; + map(0x33,0x33).nopr();; + map(0x3f,0x3f).noprw();; +} + +void digijet_state::io_map90(address_map &map) +{ + map(0x37,0x37).noprw();; + map(0x38,0x38).nopr();; } static INPUT_PORTS_START( digijet ) @@ -86,12 +108,19 @@ void digijet_state::digijet(machine_config &config) m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); } +void digijet_state::digijet90(machine_config &config) +{ + /* basic machine hardware */ + I8049(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map90); +} + ROM_START( digijet ) ROM_REGION( 0x800, I8049_TAG, 0 ) ROM_LOAD( "vanagon_85_usa_ca.bin", 0x000, 0x800, CRC(2ed7c4c5) SHA1(ae48d8892b44fe76b48bcefd293c15cd47af3fba) ) // Volkswagen Vanagon, 1985, USA, California ROM_END -ROM_START( digijet2 ) +ROM_START( digijet90 ) ROM_REGION( 0x2000, I8049_TAG, 0 ) ROM_LOAD( "fabb05_03_03.bin", 0x0000, 0x2000, CRC(8c96bcdf) SHA1(73b26914cd15ca3a5e0d7427de9ce4b4e311fb00) ) // Volkswagen 1990, Germany ROM_END @@ -99,6 +128,6 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -CONS( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -CONS( 1990, digijet90, 0, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +CONS( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +CONS( 1990, digijet90, 0, 0, digijet90, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) From 45393910b9731cecc0c9696b4e174a3f150ad391 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 15 Oct 2025 22:12:54 +0200 Subject: [PATCH 03/17] adc channel documentation --- src/mame/skeleton/digijet.cpp | 56 +++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 46927ab226406..15948ccf944a7 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -29,23 +29,28 @@ Connector 1 RPM - 2 Coolant temperture + 2 Coolant temperture (ADC IN2) 3 GND - 4 Throttle switch + 4 Throttle switch (T0) 5 Lambda sensor - 6 GND + 6 GND Air sensor 7 GND 9 GND 10 GND - 12 Injectors - 13 Ignition - 14 Air in temperature - 15 Air amount + 11 Injector (P1.5) + 12 Injector (P1.5) + 13 Ignition Power + 14 Air in temperature (ADC IN3) + 15 Air amount (ADC IN0) 16 GND 17 GND 18 GND 19 Air sensor power - 20 Fuel pump + 20 Fuel pump (P1.4) + 21 Fuel pump (P1.4) + 22 GND + 23 Injector (P1.5) + 24 Injector (P1.5) 22 GND **************************************************************************/ @@ -77,12 +82,17 @@ class digijet_state : public driver_device void digijet90(machine_config &config); private: - required_device m_maincpu; + required_device m_maincpu; virtual void machine_start() override { } virtual void machine_reset() override { } void io_map(address_map &map) ATTR_COLD; void io_map90(address_map &map) ATTR_COLD; + + uint8_t p1_r(); + void p1_w(uint8_t data); + uint8_t p2_r(); + void p2_w(uint8_t data); }; void digijet_state::io_map(address_map &map) @@ -98,6 +108,26 @@ void digijet_state::io_map90(address_map &map) map(0x38,0x38).nopr();; } +uint8_t digijet_state::p1_r() +{ + return 0xff; +}; + +void digijet_state::p1_w(uint8_t data) +{ + popmessage("p1 %02x", data); +}; + +uint8_t digijet_state::p2_r() +{ + return 0xff; +}; + +void digijet_state::p2_w(uint8_t data) +{ + popmessage("p2 %02x", data); +}; + static INPUT_PORTS_START( digijet ) INPUT_PORTS_END @@ -106,6 +136,10 @@ void digijet_state::digijet(machine_config &config) /* basic machine hardware */ I8049(config, m_maincpu, XTAL(11'000'000)); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); + m_maincpu->p1_in_cb().set(FUNC(digijet_state::p1_r)); + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); + m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); + m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); } void digijet_state::digijet90(machine_config &config) @@ -113,6 +147,10 @@ void digijet_state::digijet90(machine_config &config) /* basic machine hardware */ I8049(config, m_maincpu, XTAL(7'372'800)); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map90); + m_maincpu->p1_in_cb().set(FUNC(digijet_state::p1_r)); + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); + m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); + m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); } ROM_START( digijet ) From 954b896e3e6f9df8eb4e25e2d17cf92f33731873 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 15 Oct 2025 23:42:01 +0200 Subject: [PATCH 04/17] adc --- src/mame/skeleton/digijet.cpp | 44 ++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 15948ccf944a7..106b000dfec3f 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -35,6 +35,7 @@ 5 Lambda sensor 6 GND Air sensor 7 GND + 8 not populated (P1.3) 9 GND 10 GND 11 Injector (P1.5) @@ -75,6 +76,7 @@ class digijet_state : public driver_device digijet_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, I8049_TAG) + , m_io_adc(*this, "ADC%u", 0U) { } @@ -83,16 +85,19 @@ class digijet_state : public driver_device private: required_device m_maincpu; + required_ioport_array<4> m_io_adc; virtual void machine_start() override { } virtual void machine_reset() override { } void io_map(address_map &map) ATTR_COLD; void io_map90(address_map &map) ATTR_COLD; - uint8_t p1_r(); void p1_w(uint8_t data); uint8_t p2_r(); void p2_w(uint8_t data); + uint8_t read_adc(); + + uint8_t m_adc_channel = 0; }; void digijet_state::io_map(address_map &map) @@ -104,31 +109,52 @@ void digijet_state::io_map(address_map &map) void digijet_state::io_map90(address_map &map) { - map(0x37,0x37).noprw();; - map(0x38,0x38).nopr();; + map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); } -uint8_t digijet_state::p1_r() +uint8_t digijet_state::read_adc() { - return 0xff; + return m_io_adc[m_adc_channel]->read(); }; void digijet_state::p1_w(uint8_t data) { - popmessage("p1 %02x", data); + //bool m_int = BIT(data,0); + //bool unkn = BIT(data,3); + bool fuel = BIT(data,4); + bool inject = BIT(data,5); + //bool watchdog = BIT(data,6); + popmessage("fuel %01x inj %01x",fuel,inject); }; uint8_t digijet_state::p2_r() { + // bits 5 and 6 are the lambda sensor + // 3, 4 and 7 are floating return 0xff; }; void digijet_state::p2_w(uint8_t data) { - popmessage("p2 %02x", data); + m_adc_channel = data & 0x07; }; static INPUT_PORTS_START( digijet ) +PORT_START("ADC0") +PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_NAME("Air amount") + +PORT_START("ADC1") +PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_NAME("Ignition") + +PORT_START("ADC2") +PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_NAME("Coolant temperature") + +PORT_START("ADC3") +PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_NAME("Air temperature") + +PORT_START("THROTTLE") +PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + INPUT_PORTS_END void digijet_state::digijet(machine_config &config) @@ -136,10 +162,10 @@ void digijet_state::digijet(machine_config &config) /* basic machine hardware */ I8049(config, m_maincpu, XTAL(11'000'000)); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); - m_maincpu->p1_in_cb().set(FUNC(digijet_state::p1_r)); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); + m_maincpu->t0_in_cb().set_ioport("THROTTLE"); } void digijet_state::digijet90(machine_config &config) @@ -147,10 +173,10 @@ void digijet_state::digijet90(machine_config &config) /* basic machine hardware */ I8049(config, m_maincpu, XTAL(7'372'800)); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map90); - m_maincpu->p1_in_cb().set(FUNC(digijet_state::p1_r)); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); + m_maincpu->t0_in_cb().set_ioport("THROTTLE"); } ROM_START( digijet ) From c44d5d97b1519293d1ef92654a87898cac10fe33 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 16 Oct 2025 12:53:19 +0200 Subject: [PATCH 05/17] consolidate io map, add layout --- src/mame/layout/vw.lay | 28 ++++++++++++++++++++++++++++ src/mame/skeleton/digijet.cpp | 26 +++++++++++++------------- 2 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 src/mame/layout/vw.lay diff --git a/src/mame/layout/vw.lay b/src/mame/layout/vw.lay new file mode 100644 index 0000000000000..d1c166c13340b --- /dev/null +++ b/src/mame/layout/vw.lay @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 106b000dfec3f..aab9caf605804 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -65,6 +65,7 @@ #include "emu.h" #include "cpu/mcs48/mcs48.h" +#include "vw.lh" namespace { @@ -90,26 +91,25 @@ class digijet_state : public driver_device virtual void machine_start() override { } virtual void machine_reset() override { } void io_map(address_map &map) ATTR_COLD; - void io_map90(address_map &map) ATTR_COLD; void p1_w(uint8_t data); uint8_t p2_r(); void p2_w(uint8_t data); uint8_t read_adc(); + void start_adc(uint8_t data); uint8_t m_adc_channel = 0; }; void digijet_state::io_map(address_map &map) { - map(0x32,0x32).noprw();; - map(0x33,0x33).nopr();; - map(0x3f,0x3f).noprw();; + map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); + map(0x30, 0x3f).w(FUNC(digijet_state::start_adc)); } -void digijet_state::io_map90(address_map &map) +void digijet_state::start_adc(address_map &map) { - map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); + ; } uint8_t digijet_state::read_adc() @@ -119,12 +119,12 @@ uint8_t digijet_state::read_adc() void digijet_state::p1_w(uint8_t data) { - //bool m_int = BIT(data,0); - //bool unkn = BIT(data,3); + bool irq = BIT(data,0); + bool unkn = BIT(data,3); bool fuel = BIT(data,4); bool inject = BIT(data,5); - //bool watchdog = BIT(data,6); - popmessage("fuel %01x inj %01x",fuel,inject); + bool watchdog = BIT(data,6); + popmessage("irq %01x unk %01x fuel %01x inj %01x wd %01x",irq,unkn,fuel,inject,watchdog); }; uint8_t digijet_state::p2_r() @@ -172,7 +172,7 @@ void digijet_state::digijet90(machine_config &config) { /* basic machine hardware */ I8049(config, m_maincpu, XTAL(7'372'800)); - m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map90); + m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); @@ -193,5 +193,5 @@ ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -CONS( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) -CONS( 1990, digijet90, 0, 0, digijet90, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +GAMEL( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW, layout_vw ) +GAMEL( 1990, digijet90, 0, 0, digijet90, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW, layout_vw ) From 2b369c6b8f574bf061e16c78bd0063eb5e87676a Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 16 Oct 2025 20:18:50 +0200 Subject: [PATCH 06/17] save adc --- src/mame/skeleton/digijet.cpp | 42 ++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index aab9caf605804..eef05283cf43b 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -69,14 +69,12 @@ namespace { -#define I8049_TAG "i8049" - class digijet_state : public driver_device { public: digijet_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) - , m_maincpu(*this, I8049_TAG) + , m_maincpu(*this, "maincpu") , m_io_adc(*this, "ADC%u", 0U) { } @@ -88,9 +86,10 @@ class digijet_state : public driver_device required_device m_maincpu; required_ioport_array<4> m_io_adc; - virtual void machine_start() override { } + virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override { } void io_map(address_map &map) ATTR_COLD; + void prg_map(address_map &map) ATTR_COLD; void p1_w(uint8_t data); uint8_t p2_r(); @@ -98,18 +97,19 @@ class digijet_state : public driver_device uint8_t read_adc(); void start_adc(uint8_t data); - uint8_t m_adc_channel = 0; + uint8_t m_adc_channel = 0x07; + }; -void digijet_state::io_map(address_map &map) +void digijet_state::machine_start() { - map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); - map(0x30, 0x3f).w(FUNC(digijet_state::start_adc)); + save_item(NAME(m_adc_channel)); } -void digijet_state::start_adc(address_map &map) +void digijet_state::io_map(address_map &map) { - ; + map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); + map(0x30, 0x3f).w(FUNC(digijet_state::start_adc)); } uint8_t digijet_state::read_adc() @@ -117,14 +117,19 @@ uint8_t digijet_state::read_adc() return m_io_adc[m_adc_channel]->read(); }; +void digijet_state::start_adc(uint8_t data) +{ + ; +} + void digijet_state::p1_w(uint8_t data) { bool irq = BIT(data,0); bool unkn = BIT(data,3); bool fuel = BIT(data,4); bool inject = BIT(data,5); - bool watchdog = BIT(data,6); - popmessage("irq %01x unk %01x fuel %01x inj %01x wd %01x",irq,unkn,fuel,inject,watchdog); + //bool watchdog = BIT(data,6); + popmessage("irq %01x unk %01x fuel %01x inj %01x",irq,unkn,fuel,inject); }; uint8_t digijet_state::p2_r() @@ -137,6 +142,7 @@ uint8_t digijet_state::p2_r() void digijet_state::p2_w(uint8_t data) { m_adc_channel = data & 0x07; + popmessage("p2 %04x",data); }; static INPUT_PORTS_START( digijet ) @@ -161,7 +167,9 @@ void digijet_state::digijet(machine_config &config) { /* basic machine hardware */ I8049(config, m_maincpu, XTAL(11'000'000)); + m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); @@ -172,7 +180,9 @@ void digijet_state::digijet90(machine_config &config) { /* basic machine hardware */ I8049(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); @@ -180,12 +190,12 @@ void digijet_state::digijet90(machine_config &config) } ROM_START( digijet ) - ROM_REGION( 0x800, I8049_TAG, 0 ) + ROM_REGION( 0x800, "maincpu", 0 ) ROM_LOAD( "vanagon_85_usa_ca.bin", 0x000, 0x800, CRC(2ed7c4c5) SHA1(ae48d8892b44fe76b48bcefd293c15cd47af3fba) ) // Volkswagen Vanagon, 1985, USA, California ROM_END ROM_START( digijet90 ) - ROM_REGION( 0x2000, I8049_TAG, 0 ) + ROM_REGION( 0x2000, "maincpu", 0 ) ROM_LOAD( "fabb05_03_03.bin", 0x0000, 0x2000, CRC(8c96bcdf) SHA1(73b26914cd15ca3a5e0d7427de9ce4b4e311fb00) ) // Volkswagen 1990, Germany ROM_END @@ -193,5 +203,5 @@ ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -GAMEL( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW, layout_vw ) -GAMEL( 1990, digijet90, 0, 0, digijet90, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW, layout_vw ) +CONS( 1985, digijet, digijet90, 0, digijet, digijet, digijet_state, empty_init, "Volkswagen", "Digijet", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) +CONS( 1990, digijet90, 0, 0, digijet90, digijet, digijet_state, empty_init, "Volkswagen", "Digijet (1990)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW ) From 09ccbb6fea4b7a5fd86543fad2d7bc22422d7110 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 12:05:40 +0100 Subject: [PATCH 07/17] rpm timer --- src/mame/skeleton/digijet.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index eef05283cf43b..b0d92f7286f41 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz /************************************************************************* - drivers/digijet.cpp + skeleton/digijet.cpp Skeleton driver for the Volkswagen Digijet series of automotive ECUs @@ -28,7 +28,7 @@ |________________________| Connector - 1 RPM + 1 Engine RPM 2 Coolant temperture (ADC IN2) 3 GND 4 Throttle switch (T0) @@ -59,11 +59,14 @@ /* TODO: - - Everything + - Create a layout that shows the fuel pump, distributor and fuel injectors + - Hook up RPM to interrupt + - Figure out how the ADC is accessed */ #include "emu.h" #include "cpu/mcs48/mcs48.h" +#include "machine/timer.h" #include "vw.lh" @@ -94,6 +97,7 @@ class digijet_state : public driver_device void p1_w(uint8_t data); uint8_t p2_r(); void p2_w(uint8_t data); + TIMER_DEVICE_CALLBACK_MEMBER( rpm_int ); uint8_t read_adc(); void start_adc(uint8_t data); @@ -145,6 +149,12 @@ void digijet_state::p2_w(uint8_t data) popmessage("p2 %04x",data); }; +TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) +{ + m_maincpu->set_input_line(MCS48_INPUT_IRQ, ASSERT_LINE); + m_maincpu->set_input_line(MCS48_INPUT_IRQ, CLEAR_LINE); +} + static INPUT_PORTS_START( digijet ) PORT_START("ADC0") PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_NAME("Air amount") @@ -174,6 +184,8 @@ void digijet_state::digijet(machine_config &config) m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); + + TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s } void digijet_state::digijet90(machine_config &config) @@ -187,6 +199,8 @@ void digijet_state::digijet90(machine_config &config) m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); + + TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s } ROM_START( digijet ) From 26b06b6deb91d5886c2dacca343fcad38f1acc65 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 12:26:43 +0100 Subject: [PATCH 08/17] blinky --- src/mame/layout/vw.lay | 5 ++++- src/mame/skeleton/digijet.cpp | 15 +++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/mame/layout/vw.lay b/src/mame/layout/vw.lay index d1c166c13340b..9beae63807d62 100644 --- a/src/mame/layout/vw.lay +++ b/src/mame/layout/vw.lay @@ -7,7 +7,10 @@ debugging display for Digijet ECU - + + + + diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index b0d92f7286f41..136ac873838b8 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -128,12 +128,15 @@ void digijet_state::start_adc(uint8_t data) void digijet_state::p1_w(uint8_t data) { - bool irq = BIT(data,0); - bool unkn = BIT(data,3); + bool unkn = BIT(data,3); bool fuel = BIT(data,4); bool inject = BIT(data,5); - //bool watchdog = BIT(data,6); - popmessage("irq %01x unk %01x fuel %01x inj %01x",irq,unkn,fuel,inject); + bool watchdog = BIT(data,6); + + machine().output().set_value("led_fuel", fuel); + machine().output().set_value("led_inject", inject); + machine().output().set_value("led_unkn", unkn); + machine().output().set_value("led_wd", watchdog); }; uint8_t digijet_state::p2_r() @@ -186,6 +189,8 @@ void digijet_state::digijet(machine_config &config) m_maincpu->t0_in_cb().set_ioport("THROTTLE"); TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s + + config.set_default_layout(layout_vw); } void digijet_state::digijet90(machine_config &config) @@ -201,6 +206,8 @@ void digijet_state::digijet90(machine_config &config) m_maincpu->t0_in_cb().set_ioport("THROTTLE"); TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s + + config.set_default_layout(layout_vw); } ROM_START( digijet ) From eed4efb45a152ac3696e3333581f392fec316a38 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 12:29:17 +0100 Subject: [PATCH 09/17] labels --- src/mame/layout/vw.lay | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/src/mame/layout/vw.lay b/src/mame/layout/vw.lay index 9beae63807d62..b7ccf1f7a8934 100644 --- a/src/mame/layout/vw.lay +++ b/src/mame/layout/vw.lay @@ -19,13 +19,42 @@ debugging display for Digijet ECU + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + From 990c5427edf8a7e45006c537cda8f3e02748848d Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 16:07:18 +0100 Subject: [PATCH 10/17] remove wd led --- src/mame/layout/vw.lay | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/mame/layout/vw.lay b/src/mame/layout/vw.lay index b7ccf1f7a8934..7e5a3d3abe304 100644 --- a/src/mame/layout/vw.lay +++ b/src/mame/layout/vw.lay @@ -20,41 +20,37 @@ debugging display for Digijet ECU - + - + - - + + - - - - + + - + - - - - + + From 7d1ca13b1559d6aa8e73dc573d67262e1eb08883 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 16:18:17 +0100 Subject: [PATCH 11/17] watchdog timer --- src/mame/skeleton/digijet.cpp | 53 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 136ac873838b8..51ffeb3f899b7 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -67,6 +67,7 @@ #include "emu.h" #include "cpu/mcs48/mcs48.h" #include "machine/timer.h" +#include "machine/watchdog.h" #include "vw.lh" @@ -78,6 +79,7 @@ class digijet_state : public driver_device digijet_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_watchdog(*this, "watchdog") , m_io_adc(*this, "ADC%u", 0U) { } @@ -87,6 +89,7 @@ class digijet_state : public driver_device private: required_device m_maincpu; + required_device m_watchdog; required_ioport_array<4> m_io_adc; virtual void machine_start() override ATTR_COLD; @@ -96,47 +99,47 @@ class digijet_state : public driver_device void p1_w(uint8_t data); uint8_t p2_r(); - void p2_w(uint8_t data); TIMER_DEVICE_CALLBACK_MEMBER( rpm_int ); - uint8_t read_adc(); + uint8_t read_adc(offs_t offset); void start_adc(uint8_t data); - uint8_t m_adc_channel = 0x07; - + bool m_rpm = false; }; void digijet_state::machine_start() { - save_item(NAME(m_adc_channel)); -} + save_item(NAME(m_rpm)); +}; void digijet_state::io_map(address_map &map) { map(0x30, 0x3f).r(FUNC(digijet_state::read_adc)); map(0x30, 0x3f).w(FUNC(digijet_state::start_adc)); -} +}; -uint8_t digijet_state::read_adc() +uint8_t digijet_state::read_adc(offs_t offset) { - return m_io_adc[m_adc_channel]->read(); + return m_io_adc[offset & 0x03]->read(); }; void digijet_state::start_adc(uint8_t data) { ; -} +}; void digijet_state::p1_w(uint8_t data) { - bool unkn = BIT(data,3); + bool check = BIT(data,3); bool fuel = BIT(data,4); bool inject = BIT(data,5); bool watchdog = BIT(data,6); - machine().output().set_value("led_fuel", fuel); - machine().output().set_value("led_inject", inject); - machine().output().set_value("led_unkn", unkn); - machine().output().set_value("led_wd", watchdog); + machine().output().set_value("led_fuel", !fuel); + machine().output().set_value("led_inject", !inject); + machine().output().set_value("led_check", !check); + + if (watchdog) + m_watchdog->watchdog_reset(); }; uint8_t digijet_state::p2_r() @@ -146,16 +149,10 @@ uint8_t digijet_state::p2_r() return 0xff; }; -void digijet_state::p2_w(uint8_t data) -{ - m_adc_channel = data & 0x07; - popmessage("p2 %04x",data); -}; - TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) { - m_maincpu->set_input_line(MCS48_INPUT_IRQ, ASSERT_LINE); - m_maincpu->set_input_line(MCS48_INPUT_IRQ, CLEAR_LINE); + m_maincpu->set_input_line(MCS48_INPUT_IRQ, m_rpm ? CLEAR_LINE : ASSERT_LINE); + m_rpm = !m_rpm; } static INPUT_PORTS_START( digijet ) @@ -185,10 +182,11 @@ void digijet_state::digijet(machine_config &config) m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); - m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); - TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s + WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // ??? + + TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000r/m * 2 (m_rpm toggle) / 60s config.set_default_layout(layout_vw); } @@ -202,10 +200,11 @@ void digijet_state::digijet90(machine_config &config) m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); - m_maincpu->p2_out_cb().set(FUNC(digijet_state::p2_w)); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); - TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000/60)); // 1000rpm / 60s + WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // 0.68uF * 10kOhm + + TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000rpm / 60s config.set_default_layout(layout_vw); } From 0c11a22ff0c6c2b971ca16686504db377d880d85 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 19:01:54 +0100 Subject: [PATCH 12/17] ins and documentation --- src/mame/skeleton/digijet.cpp | 49 +++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 51ffeb3f899b7..dae0e61af4b30 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -35,12 +35,12 @@ 5 Lambda sensor 6 GND Air sensor 7 GND - 8 not populated (P1.3) + 8 Check engine (not populated) (P1.3) 9 GND 10 GND 11 Injector (P1.5) 12 Injector (P1.5) - 13 Ignition Power + 13 Ignition (ADC IN1) 14 Air in temperature (ADC IN3) 15 Air amount (ADC IN0) 16 GND @@ -52,15 +52,14 @@ 22 GND 23 Injector (P1.5) 24 Injector (P1.5) - 22 GND + 25 GND **************************************************************************/ /* TODO: - - Create a layout that shows the fuel pump, distributor and fuel injectors - - Hook up RPM to interrupt + - Map RPM to an input and the interrupt speed - Figure out how the ADC is accessed */ @@ -117,14 +116,20 @@ void digijet_state::io_map(address_map &map) map(0x30, 0x3f).w(FUNC(digijet_state::start_adc)); }; +void digijet_state::prg_map(address_map &map) +{ + map(0x000, 0x7ff).rom().region("maincpu", 0); +}; + uint8_t digijet_state::read_adc(offs_t offset) { - return m_io_adc[offset & 0x03]->read(); + return m_io_adc[offset & 0x03]->read(); //FIXME this is a hack + // The address lines connected to the ADC are A8-A11 but those can't be accessed externally by this CPU }; void digijet_state::start_adc(uint8_t data) { - ; + ;// Connected to the START pin is the CPUs WR and the CPUs RD to the ADC OE and ALE }; void digijet_state::p1_w(uint8_t data) @@ -145,8 +150,10 @@ void digijet_state::p1_w(uint8_t data) uint8_t digijet_state::p2_r() { // bits 5 and 6 are the lambda sensor - // 3, 4 and 7 are floating - return 0xff; + // 4 and 7 are floating + uint8_t out = 0x9f; + //out << LAMBDA1 LAMBDA2 + return out; }; TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) @@ -157,27 +164,34 @@ TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) static INPUT_PORTS_START( digijet ) PORT_START("ADC0") -PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_NAME("Air amount") +PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Air amount") PORT_START("ADC1") -PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_NAME("Ignition") +PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Ignition") PORT_START("ADC2") -PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_NAME("Coolant temperature") +PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Coolant temperature") PORT_START("ADC3") -PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_NAME("Air temperature") +PORT_BIT( 0xff, 0x80, IPT_PADDLE_V ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Air temperature") -PORT_START("THROTTLE") +PORT_START("LAMBDA1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) +PORT_START("LAMBDA2") +PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) + +PORT_START("THROTTLE") +PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + INPUT_PORTS_END void digijet_state::digijet(machine_config &config) { /* basic machine hardware */ - I8049(config, m_maincpu, XTAL(11'000'000)); + I8039(config, m_maincpu, XTAL(11'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &digijet_state::prg_map); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); @@ -194,8 +208,9 @@ void digijet_state::digijet(machine_config &config) void digijet_state::digijet90(machine_config &config) { /* basic machine hardware */ - I8049(config, m_maincpu, XTAL(7'372'800)); + I8039(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_PROGRAM, &digijet_state::prg_map); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); @@ -215,7 +230,7 @@ ROM_START( digijet ) ROM_END ROM_START( digijet90 ) - ROM_REGION( 0x2000, "maincpu", 0 ) + ROM_REGION( 0x2000, "maincpu", 0 ) // repeats itself 4 times ROM_LOAD( "fabb05_03_03.bin", 0x0000, 0x2000, CRC(8c96bcdf) SHA1(73b26914cd15ca3a5e0d7427de9ce4b4e311fb00) ) // Volkswagen 1990, Germany ROM_END From 207ae2e56bbc9ae804e1b8c897ecdc2c40dbe1f0 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 20:10:02 +0100 Subject: [PATCH 13/17] lambda in --- src/mame/skeleton/digijet.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index dae0e61af4b30..41084d6d4df04 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -144,7 +144,9 @@ void digijet_state::p1_w(uint8_t data) machine().output().set_value("led_check", !check); if (watchdog) + { m_watchdog->watchdog_reset(); + } }; uint8_t digijet_state::p2_r() @@ -152,7 +154,8 @@ uint8_t digijet_state::p2_r() // bits 5 and 6 are the lambda sensor // 4 and 7 are floating uint8_t out = 0x9f; - //out << LAMBDA1 LAMBDA2 + out |= (this->ioport("LAMBDA1")->read() << 5); + out |= (this->ioport("LAMBDA2")->read() << 6); return out; }; From 839f7b6740da7ee9c6eb441640c1b2dcec90b29d Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 21:02:05 +0100 Subject: [PATCH 14/17] cpu can disable the interrupts by an AND gate --- src/mame/skeleton/digijet.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 41084d6d4df04..957545098a971 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -59,7 +59,6 @@ /* TODO: - - Map RPM to an input and the interrupt speed - Figure out how the ADC is accessed */ @@ -79,6 +78,7 @@ class digijet_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_watchdog(*this, "watchdog") + , m_rpm_timer(*this, "rpm") , m_io_adc(*this, "ADC%u", 0U) { } @@ -89,6 +89,7 @@ class digijet_state : public driver_device private: required_device m_maincpu; required_device m_watchdog; + required_device m_rpm_timer; required_ioport_array<4> m_io_adc; virtual void machine_start() override ATTR_COLD; @@ -103,11 +104,13 @@ class digijet_state : public driver_device void start_adc(uint8_t data); bool m_rpm = false; + bool m_interrupt_enable = true; }; void digijet_state::machine_start() { save_item(NAME(m_rpm)); + save_item(NAME(m_interrupt_enable)); }; void digijet_state::io_map(address_map &map) @@ -134,11 +137,14 @@ void digijet_state::start_adc(uint8_t data) void digijet_state::p1_w(uint8_t data) { + bool blockint = BIT(data, 0); bool check = BIT(data,3); bool fuel = BIT(data,4); bool inject = BIT(data,5); bool watchdog = BIT(data,6); + m_interrupt_enable = blockint; + machine().output().set_value("led_fuel", !fuel); machine().output().set_value("led_inject", !inject); machine().output().set_value("led_check", !check); @@ -161,8 +167,14 @@ uint8_t digijet_state::p2_r() TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) { - m_maincpu->set_input_line(MCS48_INPUT_IRQ, m_rpm ? CLEAR_LINE : ASSERT_LINE); - m_rpm = !m_rpm; + if (m_interrupt_enable) { + m_maincpu->set_input_line(MCS48_INPUT_IRQ, m_rpm ? CLEAR_LINE : ASSERT_LINE); + m_rpm = !m_rpm; + } else { + m_maincpu->set_input_line(MCS48_INPUT_IRQ, CLEAR_LINE); + m_rpm = false; + } + } static INPUT_PORTS_START( digijet ) @@ -187,6 +199,9 @@ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_START("THROTTLE") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) +PORT_START("RPM") +PORT_BIT( 0xff, 0x80, IPT_PEDAL3 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Engine RPM") + INPUT_PORTS_END void digijet_state::digijet(machine_config &config) @@ -203,7 +218,7 @@ void digijet_state::digijet(machine_config &config) WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // ??? - TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000r/m * 2 (m_rpm toggle) / 60s + TIMER(config, m_rpm_timer).configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000r/m * 2 (m_rpm toggle) / 60s config.set_default_layout(layout_vw); } @@ -222,7 +237,7 @@ void digijet_state::digijet90(machine_config &config) WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // 0.68uF * 10kOhm - TIMER(config, "rpm").configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000rpm / 60s + TIMER(config, m_rpm_timer).configure_periodic(FUNC(digijet_state::rpm_int), attotime::from_hz(1000*2/60)); // 1000r/m * 2 (m_rpm toggle) / 60s config.set_default_layout(layout_vw); } From a26f5d296381f06ee3385b5f974fa360d40db454 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 28 Oct 2025 22:30:13 +0100 Subject: [PATCH 15/17] replace p2 with lambda --- src/mame/skeleton/digijet.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 957545098a971..ab532e4b5a23d 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -98,7 +98,7 @@ class digijet_state : public driver_device void prg_map(address_map &map) ATTR_COLD; void p1_w(uint8_t data); - uint8_t p2_r(); + TIMER_DEVICE_CALLBACK_MEMBER( rpm_int ); uint8_t read_adc(offs_t offset); void start_adc(uint8_t data); @@ -155,16 +155,6 @@ void digijet_state::p1_w(uint8_t data) } }; -uint8_t digijet_state::p2_r() -{ - // bits 5 and 6 are the lambda sensor - // 4 and 7 are floating - uint8_t out = 0x9f; - out |= (this->ioport("LAMBDA1")->read() << 5); - out |= (this->ioport("LAMBDA2")->read() << 6); - return out; -}; - TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) { if (m_interrupt_enable) { @@ -190,11 +180,12 @@ PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_START("ADC3") PORT_BIT( 0xff, 0x80, IPT_PADDLE_V ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Air temperature") -PORT_START("LAMBDA1") -PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) +PORT_START("LAMBDA") +PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) +PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) +PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) +PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_START("LAMBDA2") -PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_START("THROTTLE") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) @@ -213,7 +204,7 @@ void digijet_state::digijet(machine_config &config) m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); - m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); + m_maincpu->p2_in_cb().set_ioport("LAMBDA"); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // ??? @@ -232,7 +223,7 @@ void digijet_state::digijet90(machine_config &config) m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); - m_maincpu->p2_in_cb().set(FUNC(digijet_state::p2_r)); + m_maincpu->p2_in_cb().set_ioport("LAMBDA"); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(68)); // 0.68uF * 10kOhm From 4e2e4010c63806972fd0e3ed0badef26ef7100e3 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 17 Dec 2025 23:23:33 +0100 Subject: [PATCH 16/17] run srcclean --- src/mame/skeleton/digijet.cpp | 94 +++++++++++++++++------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index ab532e4b5a23d..4c45f1f94b1e1 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -10,56 +10,56 @@ from the 1980s. CPU: MAF 80A39HL - ROM: ST M2764AF6 - ADC0809CCN - LM2901 - SN74LS373N - SN74LS00N - XTAL 7.372 MHz - - _________________________ - | 7 A 0 | - | 4 D 8 | - C 3 C 0 7 | - O 7 9 4 | - N L2 3 0 | - N M0 M2764AF6 X 0 | - | 91 80A39HL | - |________________________| - - Connector - 1 Engine RPM - 2 Coolant temperture (ADC IN2) - 3 GND - 4 Throttle switch (T0) - 5 Lambda sensor - 6 GND Air sensor - 7 GND - 8 Check engine (not populated) (P1.3) - 9 GND - 10 GND - 11 Injector (P1.5) - 12 Injector (P1.5) - 13 Ignition (ADC IN1) - 14 Air in temperature (ADC IN3) - 15 Air amount (ADC IN0) - 16 GND - 17 GND - 18 GND - 19 Air sensor power - 20 Fuel pump (P1.4) - 21 Fuel pump (P1.4) - 22 GND - 23 Injector (P1.5) - 24 Injector (P1.5) - 25 GND + ROM: ST M2764AF6 + ADC0809CCN + LM2901 + SN74LS373N + SN74LS00N + XTAL 7.372 MHz + + _________________________ + | 7 A 0 | + | 4 D 8 | + C 3 C 0 7 | + O 7 9 4 | + N L2 3 0 | + N M0 M2764AF6 X 0 | + | 91 80A39HL | + |________________________| + + Connector + 1 Engine RPM + 2 Coolant temperture (ADC IN2) + 3 GND + 4 Throttle switch (T0) + 5 Lambda sensor + 6 GND Air sensor + 7 GND + 8 Check engine (not populated) (P1.3) + 9 GND + 10 GND + 11 Injector (P1.5) + 12 Injector (P1.5) + 13 Ignition (ADC IN1) + 14 Air in temperature (ADC IN3) + 15 Air amount (ADC IN0) + 16 GND + 17 GND + 18 GND + 19 Air sensor power + 20 Fuel pump (P1.4) + 21 Fuel pump (P1.4) + 22 GND + 23 Injector (P1.5) + 24 Injector (P1.5) + 25 GND **************************************************************************/ /* TODO: - - Figure out how the ADC is accessed + - Figure out how the ADC is accessed */ #include "emu.h" @@ -148,7 +148,7 @@ void digijet_state::p1_w(uint8_t data) machine().output().set_value("led_fuel", !fuel); machine().output().set_value("led_inject", !inject); machine().output().set_value("led_check", !check); - + if (watchdog) { m_watchdog->watchdog_reset(); @@ -202,7 +202,7 @@ void digijet_state::digijet(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &digijet_state::prg_map); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); - + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set_ioport("LAMBDA"); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); @@ -221,7 +221,7 @@ void digijet_state::digijet90(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &digijet_state::prg_map); m_maincpu->set_addrmap(AS_IO, &digijet_state::io_map); - + m_maincpu->p1_out_cb().set(FUNC(digijet_state::p1_w)); m_maincpu->p2_in_cb().set_ioport("LAMBDA"); m_maincpu->t0_in_cb().set_ioport("THROTTLE"); From 8dd7c1a4dd70e627faf5cfe51ebe7da12e3e4f5d Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Thu, 18 Dec 2025 22:22:47 +0100 Subject: [PATCH 17/17] indent inputs --- src/mame/skeleton/digijet.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/mame/skeleton/digijet.cpp b/src/mame/skeleton/digijet.cpp index 4c45f1f94b1e1..2148340669cd5 100644 --- a/src/mame/skeleton/digijet.cpp +++ b/src/mame/skeleton/digijet.cpp @@ -168,31 +168,30 @@ TIMER_DEVICE_CALLBACK_MEMBER(digijet_state::rpm_int) } static INPUT_PORTS_START( digijet ) -PORT_START("ADC0") -PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Air amount") + PORT_START("ADC0") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Air amount") -PORT_START("ADC1") -PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Ignition") + PORT_START("ADC1") + PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Ignition") -PORT_START("ADC2") -PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Coolant temperature") + PORT_START("ADC2") + PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Coolant temperature") -PORT_START("ADC3") -PORT_BIT( 0xff, 0x80, IPT_PADDLE_V ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Air temperature") + PORT_START("ADC3") + PORT_BIT( 0xff, 0x80, IPT_PADDLE_V ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_NAME("Air temperature") -PORT_START("LAMBDA") -PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) -PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) -PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("LAMBDA") + PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -PORT_START("THROTTLE") -PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) - -PORT_START("RPM") -PORT_BIT( 0xff, 0x80, IPT_PEDAL3 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Engine RPM") + PORT_START("THROTTLE") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) + PORT_START("RPM") + PORT_BIT( 0xff, 0x80, IPT_PEDAL3 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(25) PORT_NAME("Engine RPM") INPUT_PORTS_END void digijet_state::digijet(machine_config &config)