Author Topic: Help needed on libretro port  (Read 1570 times)

Offline Twinaphex

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
Help needed on libretro port
« on: January 27, 2013, 02:21:25 PM »
Hi there,

we've run into a really awkward issue now with the libretro port on big-endian consoles, and I was hoping I'd be able to get some help from some of the FBA dev old-hands here (I know some at least use FBA libretro on their PS3s such as CaptainCPS-X).

A lot of games now seem to be 'stuck' at Service mode - it seems either one of the DIP switches in control of Service Mode or a 'Service button' itself is being 'pressed down' forever and it's impossible to 'release' it.

This happens with a couple of games I can think of:
- All the Psikyo SH2 games
- Darius 2/Taito
- Konami games like Simpsons ,etc.

Looking at libretro.cpp in src/burner/libretro the way it is now, can you guys see anything that I might be doing wrong on the input side? I did a major revision in terms of how input is hooked up so I'm doubly unsure as to whether I screwed it up or not. Me and ToadKing have taken a long and hard look at it but ever since 0.2.97.28 (latest SVN) it seems we can no longer get this to work properly. Either we did something wrong or something in FBA changed that caused this.

PS: One of my co-developers (ToadKing) would really appreciate it if he could be made a 'Watcher' on the repo so that he can look at some of the changes that have occurred. He is going to register on this forum and post here later. Is adding him to the "Watch' list something that can be considered?
« Last Edit: January 27, 2013, 02:23:40 PM by Twinaphex »

Offline Toad King

  • Newbies
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Help needed on libretro port
« Reply #1 on: January 27, 2013, 02:30:00 PM »
I've done testing on the Wii port, and at least in tgm2 test mode menu it says the test mode button is always being pressed, and in darius2 it just displays a color test pattern after the bios startup flashes, even when I remove all libretro code for pressing the test mode button. I'm not sure why only the test mode button is being pressed, but I'm fairly confident it wasn't a bug introduced by our code.

Offline BritneysPAIRS

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +4/-32
Re: Help needed on libretro port
« Reply #2 on: January 27, 2013, 08:03:39 PM »
I fixed lots of these a year ago or so on the XBOX....about 50-100 or so...also alot of games where rotated the wrong way cause of a few coding typos in the source code....

I am not sure about the latest version as I only ported the new drivers over, but I can dig though old pms and messages if you want to find the games and cpps effected but there where many.

Emulators like Final Burn Legends you had to go in manually to stop this or rotate the screen they where happy enough to do so at the time. Im sure I handed a few over to IQ

PS
also many of these where on a game by game basis and someone finding them, the testers did the job of finding them all which was probably 3 months of testing over time by dail on our forum. So thanks dail for that
« Last Edit: January 27, 2013, 08:05:24 PM by BritneysPAIRS »

Offline kev

  • FBA Dev
  • ******
  • Posts: 270
  • Karma: +34/-0
Re: Help needed on libretro port
« Reply #3 on: January 27, 2013, 08:26:49 PM »
The frontend code looks ok to me (although that's just from looking at it, neither my PS3 or 360 have any debug facilities)

I guess it could be a missing byteswap on e.g. line 740 of d_psikyo.cpp, etc. Or just as likely its somewhere in the EEPROM code as it seems with at least the games I checked in your list they are all doing something with EEPROMRead and their dipswitches.  It could just as also be somewhere else, it's quite difficult to tell without debugging. Maybe lantus can help?

Offline lantus

  • Expert
  • *****
  • Posts: 151
  • Karma: +30/-0
Re: Help needed on libretro port
« Reply #4 on: January 29, 2013, 10:16:34 AM »
its not a driver related endian issue as far as i can tell. its gotta be in your input handler code

two things i would check:

- what does the driver .ini file look like? compared to that of a win32/xbox360 one?
- what happens when you start commenting out part of your input handler code?

Offline Twinaphex

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
Re: Help needed on libretro port
« Reply #5 on: January 29, 2013, 11:39:22 PM »
its not a driver related endian issue as far as i can tell. its gotta be in your input handler code

two things i would check:

- what does the driver .ini file look like? compared to that of a win32/xbox360 one?
- what happens when you start commenting out part of your input handler code?

Yeah you're right - I confirmed now that the issue is with libretro.cpp - I pulled back the
old FBA 0.2.97.26 source, copied and pasted the current libretro.cpp over to that directory
and I get the very same issues with that.

So now I just need to do a binary search and find out what is actually causing it.

Diff to libretro.cpp can be viewed here - perhaps that sheds some clues -

https://github.com/libretro/fba-libretro/commit/85e911805a47792c4de16168e8ced264a6cb2cb8

Offline Twinaphex

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +8/-0
Re: Help needed on libretro port
« Reply #6 on: January 31, 2013, 01:17:10 AM »
We finally found the screwup -

https://github.com/libretro/fba-libretro/commit/282ba163afa382aba986cbb5e50c65fee2d999d4

Went over and over the codebase and this just kept passing me by - then ToadKing got a hunch after a few hours and finally it got fixed.

Got to love these one-liner bugs that screw everything up.

Treblewinner, kev or anyone else - could you commit this change to upstream, or do you need a proper diff patch for it? It's just a one-line change.