Welcome!

Final Burn Neo => FBN Development => Topic started by: jugoso on April 13, 2009, 03:39:49 PM

Title: printing w/FBA
Post by: jugoso on April 13, 2009, 03:39:49 PM
Hey, y'all

Is there an easy way to debug fba in terms of "printf(...)"? I know stdout isn't printed anywhere in windows app, but implementing an extra "console window" is turning out to be a bitch.

Is there an output implemented? how can I use it?
Title: Re: printing w/FBA
Post by: iq_132 on April 13, 2009, 04:00:59 PM
In the makefile (makefile, not makefile.mingw or makefile.vc), enable "Debug".
After that, you print by using bprintf.

be sure to use the format
bprintf (PRINT_NORMAL, _T("stuff you want to print %x"), variables);
Title: Re: printing w/FBA
Post by: jugoso on April 13, 2009, 04:11:55 PM
Tried to re-compile with debugging and had problems:


Code: [Select]
Compiling Musashi MC680x0 core (m68kopnz.c)...
obj/GNU_WIN32/fbads/generated/m68kopnz.c: In function `m68k_op_pea_32_ix':
obj/GNU_WIN32/fbads/generated/m68kopnz.c:2739: error: unable to find a register to spill in class `CREG'
obj/GNU_WIN32/fbads/generated/m68kopnz.c:2739: error: this is the insn:
(call_insn/j:HI 64 63 65 0 src/cpu/m68k/m68kcpu.h:1104 (call (mem:QI (reg/f:SI 3 bx [orig:87 M68KWriteLongDebug ] [87]) [0 S1 A8])
        (const_int 0 [0x0])) 365 {*sibcall_1} (insn_list 61 (insn_list 62 (insn_list 63 (nil))))
    (expr_list:REG_DEAD (reg:SI 1 dx [ value ])
        (expr_list:REG_DEAD (reg:SI 2 cx)
            (expr_list:REG_DEAD (reg/f:SI 3 bx [orig:87 M68KWriteLongDebug ] [87])
                (nil))))
    (expr_list (use (reg:SI 2 cx))
        (expr_list (use (reg:SI 1 dx [ value ]))
            (nil))))
obj/GNU_WIN32/fbads/generated/m68kopnz.c:2739: confused by earlier errors, bailing out
make[2]: *** [obj/GNU_WIN32/fbads/cpu/m68k/m68kopnz.o] Error 1
make[1]: *** [all] Error 2
make: *** [mingw] Error 2

I must confess that I'm not using the "official" mingw env AND that I changed some code here and there, but I don't remember changing the drivers sector (besides some ; that compiler told me were "spare"). I'm using ver029701 and...

Code: [Select]
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

thanks
Title: Re: printing w/FBA
Post by: jugoso on April 13, 2009, 05:05:45 PM
No worry. Made a clean install with mingw dev env.
Title: Re: printing w/FBA
Post by: iq_132 on April 13, 2009, 11:38:58 PM
Good good. :)
Title: Re: printing w/FBA
Post by: Barry Harris on April 14, 2009, 02:44:36 AM
You probably could have used your environment and lowered the optimisation level FWIW.
Title: Re: printing w/FBA
Post by: jugoso on April 15, 2009, 05:35:40 PM
Got some chinese characters in green. Found out I wasn't using _T(), but then again, when using it and including <tchar.h> had some problems:
Code: [Select]
src/libs/p2pSync/p2pSync.cpp:84: error: cannot convert `const wchar_t*' to `
   TCHAR*' in argument passing
only with
bprintf(0,"sync:%d\n",imanintvariable);

which headers should I include (minimal)
Thanks (hope I get it before any replies)
Title: Re: printing w/FBA
Post by: jugoso on April 15, 2009, 06:55:02 PM
Only ANSI build for now. Had to modify (mainly delete (a) ) code from tracklst.cpp