Author Topic: Need some help with my libretro port  (Read 47789 times)

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Need some help with my libretro port
« on: March 08, 2015, 09:06:29 AM »
First, thanks for the new release :).
I've been trying for a few hours to update my libretro port of fba with the new sources, but i encountered a strange issue :

Quote
CXX src/burn/drv/sms/smsfmintf.cpp
In file included from src/burn/drv/sms/smsshared.h:14:0,
                 from src/burn/drv/sms/smsfmintf.cpp:7:
src/burn/drv/sms/sms.h:112:16: erreur: expected initializer before ?gg_port_w?
 void _fastcall gg_port_w(UINT16 port, UINT8 data);
                ^
src/burn/drv/sms/sms.h:113:17: erreur: expected initializer before ?gg_port_r?
 UINT8 _fastcall gg_port_r(UINT16 port);
                 ^
src/burn/drv/sms/sms.h:114:16: erreur: expected initializer before ?ggms_port_w?
 void _fastcall ggms_port_w(UINT16 port, UINT8 data);
And so on...

I did not modify any of the sms sources, they are the same as fba stand-alone (actually, anything not libretro related, except an alternate SH-2 emulator from fba-0.2.97.30 for speed you can enable through make parameters, is the same as stand-alone). Googling this kind of error tells me about a missing semi-colon, but i didn't find it, and i don't think that's the issue here, or you wouldn't be able to build the stand-alone. I could remove sms support (actually i did it to check if everything else was fine, and it was), i don't think that many people use fba-libretro to play sms games, but it would still be sad.
« Last Edit: March 08, 2015, 09:13:26 AM by barbudreadmon »

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #1 on: March 08, 2015, 09:32:50 AM »
By the way, you can download my work from https://github.com/libretro/libretro-fba

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Need some help with my libretro port
« Reply #2 on: March 08, 2015, 11:40:42 AM »
oops, I'm sorry, it should have been __fastcall not _fastcall.  Try changing the _fastcall's to __fastcall

best regards,
- dink

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #3 on: March 08, 2015, 12:30:00 PM »
I noticed and tried that already, but it didn't solve the issue.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Need some help with my libretro port
« Reply #4 on: March 08, 2015, 01:03:42 PM »
try putting #include "driver.h" on a new line after #include "z80_intf.h" ?

best regards,
- dink

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Need some help with my libretro port
« Reply #5 on: March 08, 2015, 01:06:14 PM »
Its my first driver, sorry about the troubles!

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #6 on: March 08, 2015, 01:50:42 PM »
No problem, i'm happy if i can help improving it :).
Still the same issue after including driver.h.

But i noticed a few files were able to compile fine (smssound.cpp for example), i checked their include and noticed tiles_generic.h was included before smsshared.h, so i did the same in every files that failed compiling. Some of them got tiles_generic.h after smsshared.h and failed compiling, one of them got burnint.h conflicting with tiles_generic.h so i removed burnint.h.

Now my core build fine, but i still need to test some sms games to make sure everything is ok.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #7 on: March 08, 2015, 01:55:13 PM »
Just moved back with the file where burnint.h and tiles_generic.h were conflicting (smssystem.cpp). The file compile fine if i don't include tiles_generic.h and include burnint.h before smsshared.h.

Offline Romhack

  • Expert
  • *****
  • Posts: 92
  • Karma: +49/-0
Re: Need some help with my libretro port
« Reply #8 on: March 08, 2015, 01:56:23 PM »
FBA header files doesn't have include guard, you need to be careful when including them.
I always wanted to put #pragma once (or standart include guard with #ifdef and #define) on every header file, but I don't know if Barry would like :S

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #9 on: March 08, 2015, 02:01:53 PM »
Then perhaps burnint.h (or tiles_generic.h ?) should be included once before sms.h in smsshared.h, and removed from all other sms files ?

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #10 on: March 08, 2015, 02:05:02 PM »
Actually, having burnint.h included first in the main header file seems mandatory in most (all?) drivers.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #11 on: March 08, 2015, 02:49:46 PM »
sms/gg roms are supposed to run fine on fba stand-alone ? They are not WIP ? I just want to make sure the graphical glitches i get on every sms/gg games comes from my modifications :).

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Need some help with my libretro port
« Reply #12 on: March 08, 2015, 04:33:54 PM »
Theres only 1 or 2 games with graphics glitches, our driver is pretty damn solid :)

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: Need some help with my libretro port
« Reply #13 on: March 08, 2015, 04:58:43 PM »
tiles_generic.h includes burnint.h.

You don't need both. If a driver uses the Generic Tiles module, then include tiles_generic.h, if it access pBurnDraw directly include burnint.h.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: Need some help with my libretro port
« Reply #14 on: March 08, 2015, 05:08:09 PM »
I tried tons of combination for including tiles_generic/burnint, all worked with the graphical glitches, so i finally included tiles_generic in smsshared and did some cleanup on other files. I think those glitches comes from elsewhere. Perhaps the attached screenshot could help find the issue ?