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) if (joy_range > 10)
{ {
--joy_range; --joy_range;
joy_center_x = joy_range/2; joy_center_x = joy_range>>1;
joy_center_y = joy_range/2; joy_center_y = joy_range>>1;
half_joy_range = joy_range>>1;
} }
break; break;
@ -1263,8 +1264,9 @@ void c_interface_parameters()
if (joy_range < 256) if (joy_range < 256)
{ {
++joy_range; ++joy_range;
joy_center_x = joy_range/2; joy_center_x = joy_range>>1;
joy_center_y = joy_range/2; joy_center_y = joy_range>>1;
half_joy_range = joy_range>>1;
} }
break; break;
@ -1316,7 +1318,6 @@ void c_interface_parameters()
cpu65_interrupt(RebootSig); cpu65_interrupt(RebootSig);
} }
#endif #endif
c_initialize_sound_hooks(); c_initialize_sound_hooks();
c_interface_exit(); c_interface_exit();
return; return;
@ -1404,6 +1405,8 @@ void c_interface_parameters()
/* calibrate joystick */ /* calibrate joystick */
if ((ch == 13) && (option == OPT_CALIBRATE)) if ((ch == 13) && (option == OPT_CALIBRATE))
{ {
c_close_joystick();
c_open_joystick();
c_calibrate_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 and center coordinates. assumes that it can write to the interface
screen. screen.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -354,8 +354,6 @@ iie_hires_on_80store_off:
.comm joy_trigger0, 2 .comm joy_trigger0, 2
.comm joy_trigger1, 2 .comm joy_trigger1, 2
.comm joy_trigger2, 2
.comm joy_trigger3, 2
E(read_button0) E(read_button0)
movb SN(joy_button0), %al movb SN(joy_button0), %al
@ -371,44 +369,50 @@ E(read_button2)
E(read_gc0) E(read_gc0)
cmpw $0xFF, joy_trigger0 cmpw $0xFF, joy_trigger0
je read_gc0_cont jle read_gc0_cont
incw joy_trigger0 read_gc0_lo:
movb $0, %al
ret
read_gc0_cont: read_gc0_cont:
incw joy_trigger0
movw joy_trigger0, %ax movw joy_trigger0, %ax
cmpw %ax, SN(joy_x) cmpw %ax, SN(joy_x)
jge read_gc0_ff /* XXXX is this correct? */ jl read_gc0_reset
movb $0, %al
ret
read_gc0_ff:
movb $0xFF, %al movb $0xFF, %al
ret ret
read_gc0_reset:
movw $0xFF, joy_trigger0
jmp read_gc0_lo
E(read_gc1) E(read_gc1)
cmpw $0xFF, joy_trigger1 cmpw $0xFF, joy_trigger1
je read_gc1_cont jle read_gc1_cont
incw joy_trigger1 read_gc1_lo:
read_gc1_cont:
movw joy_trigger1, %ax
cmpw %ax, SN(joy_y)
jge read_gc1_ff
movb $0, %al movb $0, %al
ret 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 movb $0xFF, %al
ret 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) E(iie_read_gc2)
movb $0, %al
ret ret
E(iie_read_gc3) E(iie_read_gc3)
movb $0, %al
ret ret
E(read_gc_strobe) E(read_gc_strobe)
movb $0, joy_trigger0 movw $0, joy_trigger0
movb $0, joy_trigger1 movw $0, joy_trigger1
movb $0, joy_trigger2
movb $0, joy_trigger3
ret ret
E(iie_c080) E(iie_c080)