Welcome!

Final Burn Neo => FBN Development => Topic started by: jan_klaassen on December 16, 2016, 09:46:25 AM

Title: Hi!
Post by: jan_klaassen on December 16, 2016, 09:46:25 AM
Hi! It's me. Long time no see.

It's rather nice to see FBA is still going -- I had no idea. I started to do some work on my old source lately, and you seem to have based yours on an old release with just my neo-geo CD emulation added. So it seems I might have some code you'd like include.

What's your choice of version control system? I use Mercurial myself.

One of the things I wanted to tackle was some cleanup and modernisation. To that effect, Perl is out and Python is in (I'll convert the perl scripts). Here's a python script that removes the annoying and outdated tchar.h rubbish and replaces it with the regular wchar_t equivalents. It leaves untouched a few macros and I think a single function call, so edit the macros in title.h and a few other bits that the compiler will complain about. Name this something.py and run it from your FBA directory. N.B. Make sure to commit any changes or make a backup of your source before running this -- it overwrites all files it modifies.

Code: [Select]
import sys
import os.path
import re


class converter(object):

    def __init__(self):
        self.re_str = re.compile(r'_T\(\s*\"(?P<string>.*?)\"\)')
        self.re_chr = re.compile(r'_T\(\'(?P<string>.*?)\'\)')
        self.re_macro = re.compile(r'_T\((?P<string>[a-zA-Z0-9_()#]*?)\)')
        self.re_tc = re.compile(r'TCHAR')
        self.re_tcs = re.compile(r'_tcs(?P<string>[^(]*)')
        self.re_fnc = re.compile(r'_[a-zA-Z]*?t[a-zA-Z]*?(printf|scanf|fopen|remove|access|asctime)')
        self.re_get = re.compile(r'_f(putt|gett)[a-zA-Z]*?')
        self.re_txt = re.compile(r'_ist(space|digit)')

    def convertfile(self, file):

        def _str(m):
            return 'L"' + m.group('string') + '"'
        def _chr(m):
            return 'L\'' + m.group('string') + '\''
        def _macro(m):
            return m.group('string')
        def _tc(m):
            return 'wchar_t'
        def _tcs(m):
            return 'wcs' + m.group('string')
        def _fnc(m):
            return m.group().replace('t', 'w', 1).replace('_fw', 'fw', 1).replace('_sw', 'sw', 1)
        def _get(m):
            return m.group().replace('_fgett', 'fgetw', 1).replace('_fputt', 'fputw', 1)
        def _txt(m):
            return m.group().replace('_ist', 'isw', 1)

        with open(file + ".tmp", "wt") as nf:
            changes = 0
            with open(file, "rt") as f:
                for line in f:
                    line = line.rstrip()
                    n = 0;
                    m = self.re_str.subn(_str, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_chr.subn(_chr, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_macro.subn(_macro, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_tc.subn(_tc, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_tcs.subn(_tcs, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_fnc.subn(_fnc, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_get.subn(_get, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                    m = self.re_txt.subn(_txt, line)
                    if m[1] > 0:
                        line = m[0]
                        n += 1
                   
                    #if n > 0:
                    #   print(line)
                    changes += n
                    print(line, file=nf)

        if changes > 0:
            os.replace(file + ".tmp", file)
        else:
            os.remove(file + ".tmp")

    def convert(self, srcdir):
        for root, dir, files in os.walk(srcdir):
            print("processing: {root}...".format(root=root))
            for file in files:
                if not (file.endswith(".c") or file.endswith(".cpp") or file.endswith(".h")):
                    continue
                self.convertfile("{root}\\{file}".format(root=root, file=file))


if __name__ == '__main__':

    src = sys.argv[1] if len(sys.argv) == 2 else "src"
    c = converter()
    c.convert(src)
Title: Re: Hi!
Post by: Barry Harris on December 16, 2016, 11:09:36 AM
Hi jan - hope you're keeping well.  :smilie:

We're using SVN on assembla.com. If you want to register an account I'll send an invite through.
Title: Re: Hi!
Post by: iq_132 on December 16, 2016, 04:02:03 PM
Holy cow. Jan_Klaassen is still alive! Welcome back (hopefully). :)
Title: Re: Hi!
Post by: JacKc on December 17, 2016, 03:28:05 AM
Hi Jan :)

Welcome back to the team !
Title: Re: Hi!
Post by: vbt on December 17, 2016, 08:06:47 PM
we count on you Jan :)
Title: Re: Hi!
Post by: jan_klaassen on December 19, 2016, 09:43:38 AM
Thanks for teh nice welcome everyone.
Quote
we count on you Jan
Please don't.  :biggrin:

So, to get down to business. I will install TortoiseSVN then, I guess. (Will PM account.) I'll have to see what's the easiest way of getting my sourcecode to you guys. Maybe bitbucket...

Most of the new stuff in my version is in the GUI. Some will be easy to port, some will be more inevolved. Here's a rough list:


I'm working on a dialog box for the fullscreen settings.

That's a fair amount of stuff, so you'll have to see which parts to incorporate. Given how much our versions have diverged, I'm not sure a 3-way diff will be enough to port much of this, but who knows (I don't have a repository with nost of my changes, though I created a mercurial repository now). I'd  suggest that the person most familiar with yout GUI source code does the porting, with my help.

Other than Neo Geo CD, I didn't do much work on drivers. Neo Geo CD is very much a WIP, and I'll port my changes after I've finished with the things I'm working on (e.g. there's a CD interface for the new cd images).

Here's a screenshot of some of it in action:
Title: Re: Hi!
Post by: Ashura-X on December 20, 2016, 11:10:55 AM
Ohhh!!!! The CPS2 Raster Effects master is back!!!!!

Nice to see you again Jan :)