summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-08-23 15:02:45 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-08-23 15:02:45 +0000
commitdb775ce8ada7ad9545164decf5712ae95f49814f (patch)
tree0eb4c38c12d401e833fbcae26427496e5aba4688 /src/mame
parente850e9bc2eebf037ba431aefd8ccec2d87a41ebc (diff)
Odometer table conversion [O. Galibert]
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/taitojc.c33
-rw-r--r--src/mame/includes/taitojc.h3
2 files changed, 33 insertions, 3 deletions
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 268e7f6e153..4c95e8636e2 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -809,8 +809,35 @@ static WRITE32_HANDLER(f3_share_w)
static WRITE32_HANDLER(jc_output_w)
{
- // speed and brake meter outputs in Densya De Go!
- // logerror("jc_output_w: %08x, %08x %08x\n", offset, data,mem_mask);
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
+ static const double odometer_table[0x100] =
+ {
+ 0.0, 0.3, 0.7, 1.0, 1.4, 1.7, 2.1, 2.4, 2.8, 3.1, 3.4, 3.8, 4.1, 4.5, 4.8, 5.2,
+ 5.5, 5.9, 6.2, 6.6, 6.9, 7.2, 7.6, 7.9, 8.3, 8.6, 9.0, 9.3, 9.7, 10.0, 10.5, 11.1,
+ 11.6, 12.1, 12.6, 13.2, 13.7, 14.2, 14.7, 15.3, 15.8, 16.3, 16.8, 17.4, 17.9, 18.4, 18.9, 19.5,
+ 20.0, 20.6, 21.1, 21.7, 22.2, 22.8, 23.3, 23.9, 24.4, 25.0, 25.6, 26.1, 26.7, 27.2, 27.8, 28.3,
+ 28.9, 29.4, 30.0, 30.6, 31.1, 31.7, 32.2, 32.8, 33.3, 33.9, 34.4, 35.0, 35.6, 36.1, 36.7, 37.2,
+ 37.8, 38.3, 38.9, 39.4, 40.0, 40.6, 41.2, 41.8, 42.4, 42.9, 43.5, 44.1, 44.7, 45.3, 45.9, 46.5,
+ 47.1, 47.6, 48.2, 48.8, 49.4, 50.0, 50.5, 51.1, 51.6, 52.1, 52.6, 53.2, 53.7, 54.2, 54.7, 55.3,
+ 55.8, 56.3, 56.8, 57.4, 57.9, 58.4, 58.9, 59.5, 60.0, 60.7, 61.3, 62.0, 62.7, 63.3, 64.0, 64.7,
+ 65.3, 66.0, 66.7, 67.3, 68.0, 68.7, 69.3, 70.0, 70.5, 71.1, 71.6, 72.1, 72.6, 73.2, 73.7, 74.2,
+ 74.7, 75.3, 75.8, 76.3, 76.8, 77.4, 77.9, 78.4, 78.9, 79.5, 80.0, 80.6, 81.2, 81.8, 82.4, 82.9,
+ 83.5, 84.1, 84.7, 85.3, 85.9, 86.5, 87.1, 87.6, 88.2, 88.8, 89.4, 90.0, 90.6, 91.1, 91.7, 92.2,
+ 92.8, 93.3, 93.9, 94.4, 95.0, 95.6, 96.1, 96.7, 97.2, 97.8, 98.3, 98.9, 99.4, 100.0, 100.5, 101.1,
+ 101.6, 102.1, 102.6, 103.2, 103.7, 104.2, 104.7, 105.3, 105.8, 106.3, 106.8, 107.4, 107.9, 108.4, 108.9, 109.5,
+ 110.0, 110.7, 111.3, 112.0, 112.7, 113.3, 114.0, 114.7, 115.3, 116.0, 116.7, 117.3, 118.0, 118.7, 119.3, 120.0,
+ 120.3, 120.6, 120.9, 121.2, 121.6, 121.9, 122.2, 122.5, 122.8, 123.1, 123.4, 123.8, 124.1, 124.4, 124.7, 125.0,
+ 125.3, 125.6, 125.9, 126.2, 126.6, 126.9, 127.2, 127.5, 127.8, 128.1, 128.4, 128.8, 129.1, 129.4, 129.7, 130.0,
+ };
+
+
+ // printf("jc_output_w: %08x, %08x %08x\n", offset, data,mem_mask);
+ if(offset == 0 && ACCESSING_BITS_16_31)
+ state->m_speed_meter = odometer_table[(data >> 16) & 0xff];
+ else if(offset == 1 && ACCESSING_BITS_16_31)
+ state->m_break_meter = data >> 16; //TODO
+
+ popmessage("%f",state->m_speed_meter);
}
static READ32_HANDLER( jc_lan_r )
@@ -837,7 +864,7 @@ static ADDRESS_MAP_START( taitojc_map, AS_PROGRAM, 32 )
AM_RANGE(0x06800000, 0x06801fff) AM_NOP // unknown
AM_RANGE(0x06a00000, 0x06a01fff) AM_READWRITE(f3_share_r, f3_share_w) AM_SHARE("f3_shared") AM_BASE_MEMBER(taitojc_state,m_f3_shared_ram)
AM_RANGE(0x06c00000, 0x06c0001f) AM_READ(jc_lan_r) AM_WRITENOP // Dangerous Curves
- AM_RANGE(0x06e00000, 0x06e0ffff) AM_WRITE(jc_output_w)
+ AM_RANGE(0x06e00000, 0x06e00007) AM_WRITE(jc_output_w)
AM_RANGE(0x08000000, 0x080fffff) AM_RAM AM_BASE_MEMBER(taitojc_state,m_main_ram)
AM_RANGE(0x10000000, 0x10001fff) AM_READWRITE(dsp_shared_r, dsp_shared_w)
ADDRESS_MAP_END
diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h
index 972c8f465bc..260ac39d99a 100644
--- a/src/mame/includes/taitojc.h
+++ b/src/mame/includes/taitojc.h
@@ -56,6 +56,9 @@ public:
UINT16 m_debug_dsp_ram[0x8000];
UINT8 m_has_dsp_hack;
+
+ double m_speed_meter;
+ UINT16 m_break_meter;
};