Hi Yolo!
Really good work. Unfortunately, I’ve not really made much/any progress. I've been focusing on hacking/understanding the harddrivcb (Compact British) rom.
I’ve been watching this youtube clip because at 24:32 the chap manages to successfully calibrate his wheel:
His old settings look like:
OLD CNTSPTRN 1080 PATCEN -98
His new settings look like (after successfully calibrating):
NEW CNTSPTRN 1110 PATCEN 14
I hacked mame to trigger the centre edge after 256 steering wheel values. After calibrating things looked like this for me:
NEW CNTSPTRN 256 PATCEN 0
I concluded that CNTSPTRN is the amount of steering wheel values for 1 complete turn. I was clearly wrong about my 72 theory. I’m not sure where the actual arcade value of 1110 comes from. I guess I’ll just accept that the encoder processor gives you about 1024 values per turn. I can see now from PL1's previous post (Thanks for the post btw!) why you'd get more values out of an optical encoder than just teeth count. The PATCEN thing is to do with straightening up the wheel at the end of the calibration test, if its not dead straight (i.e. to one side of the centre edge) then you get a non-zero number.
Whilst the above is interesting-ish, I realise it doesn’t really help us…
I had observed the centre edge triggering working well in the service menu (You see the steering wheel value get reset to zero each time ‘Centre Edge’ turns green), and you also see the
harddriv_state::hdc68k_wheel_edge_reset_w(uint16_t data) function being called each time a reset happens. However, in-game, when attempting to trigger the centre edge, I had noticed the hdc68k_wheel_edge_reset_w callback never gets called…
You recently wrote about those encoder addresses you’d seen in harddriv.cpp (Good shout by the way!
), and I got excited and added this:-
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_NAME("Encoder Reset")
I removed my code that automatically triggers the Centre Edge reset (That stuff to do with processing the m_hdc68k_wheel_edge flag and setting the result ^= 0x4000 thing in hdc68k_port1_r) , and assigned a key to the new ‘Encoder Reset’ setting so I could just trigger everything manually.
In the service menu, everything worked well (The manual reset set the steering wheel value to zero, and hdc68k_wheel_edge_reset_w() was called). In-game, the manual reset now did result in hdc68k_wheel_edge_reset_w() being called, but it seemed to have no effect on the actual steering. Its like the game just ignores the manual encoder reset whilst being played…. Strange… The game also (when you crash) resets the steering to some weird values (I guess to the nearest centre edge) and doesn’t tell you when its done it...
I also added...
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_NAME("Centre Reset")
And assigned a key to that, but that seemed to have absolutely no effect on anything.
Time to sleep on this for a bit… Its interesting stuff
but frustrating