Author Topic: printing w/FBA  (Read 7168 times)

Offline jugoso

  • Newbies
  • *
  • Posts: 21
  • Karma: +0/-0
printing w/FBA
« 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?

Offline iq_132

  • Administrator
  • *****
  • Posts: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: printing w/FBA
« Reply #1 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);


Offline jugoso

  • Newbies
  • *
  • Posts: 21
  • Karma: +0/-0
Re: printing w/FBA
« Reply #2 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
« Last Edit: April 13, 2009, 04:14:48 PM by jugoso »

Offline jugoso

  • Newbies
  • *
  • Posts: 21
  • Karma: +0/-0
Re: printing w/FBA
« Reply #3 on: April 13, 2009, 05:05:45 PM »
No worry. Made a clean install with mingw dev env.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3725
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: printing w/FBA
« Reply #4 on: April 13, 2009, 11:38:58 PM »
Good good. :)


Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: printing w/FBA
« Reply #5 on: April 14, 2009, 02:44:36 AM »
You probably could have used your environment and lowered the optimisation level FWIW.
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 jugoso

  • Newbies
  • *
  • Posts: 21
  • Karma: +0/-0
Re: printing w/FBA
« Reply #6 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)

Offline jugoso

  • Newbies
  • *
  • Posts: 21
  • Karma: +0/-0
Re: printing w/FBA
« Reply #7 on: April 15, 2009, 06:55:02 PM »
Only ANSI build for now. Had to modify (mainly delete (a) ) code from tracklst.cpp