Mercurial > repos > blastem
comparison io.c @ 1144:be3df2d8530a
Increment TH counter on low to high transitions rather than high to low transitions for six button controllers. Fixes Charles MacDonald's SMS six button controller demo
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 03 Jan 2017 20:43:35 -0800 |
parents | fe8c79f82c22 |
children | 3e24de8d8073 |
comparison
equal
deleted
inserted
replaced
1143:d4d770cfbc62 | 1144:be3df2d8530a |
---|---|
1296 //check if TH has changed | 1296 //check if TH has changed |
1297 if ((old_output & TH) ^ (output & TH)) { | 1297 if ((old_output & TH) ^ (output & TH)) { |
1298 if (current_cycle >= port->device.pad.timeout_cycle) { | 1298 if (current_cycle >= port->device.pad.timeout_cycle) { |
1299 port->device.pad.th_counter = 0; | 1299 port->device.pad.th_counter = 0; |
1300 } | 1300 } |
1301 if (!(output & TH)) { | 1301 if ((output & TH)) { |
1302 port->device.pad.th_counter++; | 1302 port->device.pad.th_counter++; |
1303 } | 1303 } |
1304 port->device.pad.timeout_cycle = current_cycle + TH_TIMEOUT; | 1304 port->device.pad.timeout_cycle = current_cycle + TH_TIMEOUT; |
1305 } | 1305 } |
1306 break; | 1306 break; |
1387 input = port->input[GAMEPAD_EXTRA]; | 1387 input = port->input[GAMEPAD_EXTRA]; |
1388 } else { | 1388 } else { |
1389 input = port->input[GAMEPAD_TH1]; | 1389 input = port->input[GAMEPAD_TH1]; |
1390 } | 1390 } |
1391 } else { | 1391 } else { |
1392 if (port->device.pad.th_counter == 3) { | 1392 if (port->device.pad.th_counter == 2) { |
1393 input = port->input[GAMEPAD_TH0] | 0xF; | 1393 input = port->input[GAMEPAD_TH0] | 0xF; |
1394 } else if(port->device.pad.th_counter == 4) { | 1394 } else if(port->device.pad.th_counter == 3) { |
1395 input = port->input[GAMEPAD_TH0] & 0x30; | 1395 input = port->input[GAMEPAD_TH0] & 0x30; |
1396 } else { | 1396 } else { |
1397 input = port->input[GAMEPAD_TH0] | 0xC; | 1397 input = port->input[GAMEPAD_TH0] | 0xC; |
1398 } | 1398 } |
1399 } | 1399 } |