WIP : fix joystick parameters

This commit is contained in:
Aaron Culliney 2013-12-08 16:57:02 -08:00
parent 71d5367875
commit 3340997798
3 changed files with 33 additions and 26 deletions

View File

@ -1129,8 +1129,9 @@ void c_interface_parameters()
if (joy_range > 10)
{
--joy_range;
joy_center_x = joy_range/2;
joy_center_y = joy_range/2;
joy_center_x = joy_range>>1;
joy_center_y = joy_range>>1;
half_joy_range = joy_range>>1;
}
break;
@ -1263,8 +1264,9 @@ void c_interface_parameters()
if (joy_range < 256)
{
++joy_range;
joy_center_x = joy_range/2;
joy_center_y = joy_range/2;
joy_center_x = joy_range>>1;
joy_center_y = joy_range>>1;
half_joy_range = joy_range>>1;
}
break;
@ -1316,7 +1318,6 @@ void c_interface_parameters()
cpu65_interrupt(RebootSig);
}
#endif
c_initialize_sound_hooks();
c_interface_exit();
return;
@ -1404,6 +1405,8 @@ void c_interface_parameters()
/* calibrate joystick */
if ((ch == 13) && (option == OPT_CALIBRATE))
{
c_close_joystick();
c_open_joystick();
c_calibrate_joystick();
}

View File

@ -120,7 +120,7 @@ static void c_calculate_pc_joystick_parms()
}
/* -------------------------------------------------------------------------
c_calibrate_pcjoystick() - calibrates joystick. determines extreme
c_calibrate_pc_joystick() - calibrates joystick. determines extreme
and center coordinates. assumes that it can write to the interface
screen.
------------------------------------------------------------------------- */

View File

@ -354,8 +354,6 @@ iie_hires_on_80store_off:
.comm joy_trigger0, 2
.comm joy_trigger1, 2
.comm joy_trigger2, 2
.comm joy_trigger3, 2
E(read_button0)
movb SN(joy_button0), %al
@ -371,44 +369,50 @@ E(read_button2)
E(read_gc0)
cmpw $0xFF, joy_trigger0
je read_gc0_cont
incw joy_trigger0
jle read_gc0_cont
read_gc0_lo:
movb $0, %al
ret
read_gc0_cont:
incw joy_trigger0
movw joy_trigger0, %ax
cmpw %ax, SN(joy_x)
jge read_gc0_ff /* XXXX is this correct? */
movb $0, %al
ret
read_gc0_ff:
jl read_gc0_reset
movb $0xFF, %al
ret
read_gc0_reset:
movw $0xFF, joy_trigger0
jmp read_gc0_lo
E(read_gc1)
cmpw $0xFF, joy_trigger1
je read_gc1_cont
incw joy_trigger1
read_gc1_cont:
movw joy_trigger1, %ax
cmpw %ax, SN(joy_y)
jge read_gc1_ff
jle read_gc1_cont
read_gc1_lo:
movb $0, %al
ret
read_gc1_ff:
read_gc1_cont:
incw joy_trigger1
movw joy_trigger1, %ax
cmpw %ax, SN(joy_y)
jl read_gc1_reset
movb $0xFF, %al
ret
read_gc1_reset:
movw $0xFF, joy_trigger0
jmp read_gc1_lo
/* HACK not doing anything... */
/* NOTE : Game Controller axis 2 & 3 is not hooked up on a normal //e */
E(iie_read_gc2)
movb $0, %al
ret
E(iie_read_gc3)
movb $0, %al
ret
E(read_gc_strobe)
movb $0, joy_trigger0
movb $0, joy_trigger1
movb $0, joy_trigger2
movb $0, joy_trigger3
movw $0, joy_trigger0
movw $0, joy_trigger1
ret
E(iie_c080)