Hi Jay, how is going the project? Has you advanced on the board, I am very excited about it!
April 17, 2024, 03:28:15 pm
Something odd I noticed, is that in mame when viewing the "Control Inputs" service menu and turning the wheel clockwise, I see the hexadecimal number decrease, not increase...Sounds like the optical data lines (A and B) are swapped, which reverses the axis.
Compact harddrivin service manual (HDC_TM-329_2nd.pdf):
041787-02 Steering Encoder Disk.
043807-02 Centering Encoder Disk.
HDC_TM-329_2nd.pdf, From the "Control Inputs" service menu:
As you turn the steering wheel clockwise, the hexadecimal number should increase and change to zero once every turn.
As you turn the wheel counterclockwise, the number should decrease. Everytime the steering wheel passes the center position,
the words center edge should change from blue to green.
HDC_TM-329_2nd.pdf, from a section near the end about installing a new encoder wheel:
Install the steering wheel with the center spoke down. Make sure the single hole on the centering disk is between the opitcal reader on the centering
PCB so the steering wheel will be correctly centered.
From the Race Drivin' Compact Manual, for the Main Board Memory Map, it says:
OPTO: Optical Steering Wheel Reader
400000 (R) OPTORD Read the Optical Counter
404000 (W) OPTORES Reset the Optical Counter
408000 (W) CENRES Reset the Optical Centre Flag
just want to say ive been following this thread for quite a while.
I have a spare RPI 4 8gb, and it's getting this ASAP.
now i've gotta build a baby dk cab too - really amazing work. I am head over heels for your project.
You mentioned your health and single malt - hope everything is ok and you take care of yourself, tons of old nerds need you now more than ever!
uint16_t harddriv_state::hdc68k_wheel_r()
{
/* grab the new wheel value */
uint16_t new_wheel = m_12badc[0].read_safe(0xffff);
/* hack to display the wheel position */
if (machine().input().code_pressed(KEYCODE_LSHIFT))
popmessage("%04X", new_wheel);
/* if we crossed the center line, latch the edge bit */
if ((m_hdc68k_last_wheel / 0xf00) != (new_wheel / 0xf00))
m_hdc68k_wheel_edge = 1;
/* remember the last value and return the low 8 bits */
m_hdc68k_last_wheel = new_wheel;
return (new_wheel << 8) | 0xff;
}
uint16_t harddriv_state::hdc68k_wheel_r()
{
static const uint16_t g_latchpoint = 0x8000; // Central point for wheel detection.
static int16_t wheel_offset = 0; // Cumulative offset to adjust the wheel position based on game events.
static bool last_wheel_edge = false; // To track the last state of crossing the center.
// Read the current wheel position from the 12-bit ADC port.
uint16_t new_wheel_raw = m_12badc[0].read_safe(0xffff) << 4;
// Apply the cumulative offset to align with the game's perceived center.
uint16_t new_wheel = new_wheel_raw + wheel_offset;
// Edge detection logic to detect being at or crossing the center point using raw ADC data.
if ((m_hdc68k_last_wheel < g_latchpoint && new_wheel_raw >= g_latchpoint) ||
(m_hdc68k_last_wheel > g_latchpoint && new_wheel_raw <= g_latchpoint) ||
new_wheel_raw == g_latchpoint) {
m_hdc68k_wheel_edge = 1; // Set edge flag when at or crossing the center based on raw input.
}
// Check if the wheel edge flag has changed from 1 to 0, as reset by the game.
if (last_wheel_edge && !m_hdc68k_wheel_edge) {
// Calculate the offset adjustment when the wheel is recalibrated.
int16_t new_offset_adjustment = g_latchpoint - new_wheel_raw;
// Apply the adjustment based on the current wheel position relative to the center
if (new_wheel_raw > g_latchpoint) {
// Wheel is to the left, need to decrease raw value towards the center
wheel_offset += abs(new_offset_adjustment); // Use addition to adjust back towards the center
} else {
// Wheel is to the right, need to increase raw value towards the center
wheel_offset -= abs(new_offset_adjustment); // Use subtraction if below the center
}
new_wheel = new_wheel_raw + wheel_offset; // Reapply the updated offset.
}
last_wheel_edge = m_hdc68k_wheel_edge; // Store the last known state of the wheel edge flag.
// Display current wheel information for debugging.
popmessage("Wheel Raw: %04X, Wheel Adjusted: %04X, Edge: %d, Offset: %X",
new_wheel_raw, new_wheel, m_hdc68k_wheel_edge, wheel_offset);
// Store the current wheel value for the next comparison.
m_hdc68k_last_wheel = new_wheel_raw; // Update last_wheel to the raw value to ensure proper comparison next cycle.
// Return the processed wheel value, formatted as required.
return (new_wheel << 4) | 0xff;
}
I'm currently using the iPac 4 in keyboard mode. I've also connected an iPac 2 via USB, and I'm aiming to integrate an extra set of 7 buttons into the system using the iPac 2.Windows sees an IPac as a composite device that has a HID keyboard.
This is way, way more work than I can handle right now.Fair enough, I understand it's a niche ask.
Almost all players I've seen so far are reloading by pointing the gun below the screen to shoot off-limits.Isn't there a small chance they're typically aiming low because it's more work to aim off to the side on modern screens? Personally I tend to just aim off whatever side is closest, with 16:9 screens that's generally the top, I feel like it's a little faster than aiming down and less fatiguing, but I guess it depends on your grip. Sometimes it's nice to switch it up so your wrist doesn't get tired.
16/9 or 4/3 format isn't changing anything, there is no black borders at the bottom, so aiming at the bottom screen border or aiming just below the bottom screen border is just a question of millimeters...
So yes, it's a very, very specific request, not to say for your device only...because it's the 1st time I'm reading about that particular issue in almost a decade.It's a hacked together solution that essentially uses VR tracking to move a mouse cursor around with a tracked guncon. There isn't any gun data to analyse to my knowledge, I can't even get the virtual mouse to show up in DS config so I use the single mouse command to get it working. I doubt you'll be seeing anyone else complaining about it, at the very least.
I'd be curious to know what is your lightgun model/hardware ?