Oricutron : Joysticks not working

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
jede
Flying Officer
Posts: 191
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Oricutron : Joysticks not working

Post by jede »

Telestrat Joysticks does not work in Oricutron

Code: Select all

; How to emulate joysticks attached to the telestrat
; Options are 'none', 'kbjoy1', 'kbjoy2', 'sdljoyN', 'mouse'
telejoy_a =  kbjoy2
telejoy_b = mouse

; Keys to emulate joystick, set 1
; NOTE: "fire2" is only available on telestrat
kbjoy1_up = 'KP8'
kbjoy1_down = 'KP2'
kbjoy1_left = 'KP4'
kbjoy1_right = 'KP6'
kbjoy1_fire1 = 'KP_ENTER'
kbjoy2_fire2 = 'KP_PLUS'

; Keys to emulate joystick, set 2
kbjoy2_up = 'W'
kbjoy2_down = 'S'
kbjoy2_left = 'A'
kbjoy2_right = 'D'
kbjoy2_fire1 = 'SPACE'
kbjoy2_fire2 = 'N'
If i write kbjoy1 or kbjoy2 or mouse for telejoy_a, oricutron does not get any input. VIA 2 registers does not change. I use a code which work on real hardware.

I am running the last version of oricutron (from github).

Any idea ?
christian
Pilot Officer
Posts: 96
Joined: Sun Nov 24, 2013 9:58 pm

Re: Oricutron : Joysticks not working

Post by christian »

I think the issue is in joy_build_mask() function in joystick.c

If you uncomment the sprintf() call in joy_filter_event() function, you can see the joystick state changing in the title bar of the window.

In the joy_build_mask():
  • the joystick state mask is only build when joyinterface is set to 'ijk', 'pase' or 'altai' in oricutron.cfg not depending of the machine type.
  • the joysitck's state is sent to the port A of the VIA 1 which is not correct in case of Telestrat
If I change

Code: Select all

  if( gimme_port_a )
  {
    oric->via.write_port_a( &oric->via, 0xff, mkmask );
    oric->porta_is_ay = SDL_FALSE;
  } else {
    if( !oric->porta_is_ay )
    {
      oric->via.write_port_a( &oric->via, 0xff, oric->porta_ay );
      oric->porta_is_ay = SDL_TRUE;
    }
  }
by

Code: Select all

  // caution weird hack
  if( gimme_port_a )
  {
    oric->via.write_port_b( &oric->tele_via, 0xff, mkmask );
    oric->porta_is_ay = SDL_FALSE;
  } else {
    if( !oric->porta_is_ay )
    {
      oric->via.write_port_b( &oric->tele_via, 0xff, oric->porta_ay );
      oric->porta_is_ay = SDL_TRUE;
    }
  }
and set joyinterface to 'pase' or 'altai', I can get the joystick's state

I think the joy_buildmask() function should test the oric machine type and set the right port of the right VIA
Post Reply