Page 1 of 1

[Done] Problem with Tailbite 1.4.6 and Windows 7 (x64)

Posted: Mon Jan 17, 2011 2:38 am
by mpz
Hi,

i have two problems with Tailbite 1.4.5, Windows 7 (x64) and i use PB 4.51(x64)

I want to use a interface, but if i create a lib the error message "Reserved_Word_Used_as_Symbol". In the assembler file you find "Extrn rax+344". rax+344 is the clear function and must be deleted in the asm file to make the lib file

Code: Select all

Extrn rax+344
Extrn tailbite_test_p_D3DDevice

Code: Select all

Global *D3DDevice.IDIRECT3DDEVICE9
ProcedureDLL mytest()
  If halleluja = 12  ; dummy only for testing
     *D3DDevice\Clear(0,0,0,0,0,0)
  EndIf
  ProcedureReturn 1
EndProcedure
second problem, the Remark doesnt work with the import function, the error message "duplicate name DEFINE_GUID" appears. If you delet the remarks everythink is fine.

If you need the x64 lib dxguid.lib
http://www.file-upload.net/download-313 ... d.lib.html

Code: Select all

  Import "dxguid.lib" : EndImport

; DEFINE_GUID(GUID_SysKeyboard,$6F1D2B61,$D5A0,$11CF,$BF,$C7,$44,$45,$53,$54,$00,$00)
; DEFINE_GUID(GUID_SysMouse,   $6F1D2B60,$D5A0,$11CF,$BF,$C7,$44,$45,$53,$54,$00,$00)
  
Thanks for you good work. Hope you find the buggs, with Tailbite x86 everythinks works fine and i want to make the x64 lib for my engine too.

Michael

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Mon Jan 17, 2011 11:02 am
by lexvictory
I'll take a look when I get the chance.
For the 2nd snippet, does the problem occur with just that snippet?

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Mon Jan 17, 2011 1:21 pm
by mpz
Hi,

2nt. snipped: my Soucecode has over 20000 lines. If i put the "Import "dxguid.lib" : EndImport" to different places in the code some error message appears and i think the endimport is not working. I think it could be a problem with the import but i don't know it exaclty. i will write a little program to delete all "Extrn rax ******" lines in the asm files and test then to create a new lib file. I inform you if this works or not.

With tailbite 1.4.4 can make a lib file, but the lib file is not working. I get all time missing command error messages (polilink error) from missing commands. 10 commands ar not working (from 120).

If you have beta files i will test it. I think my project has very much lines to find every error...

Greetings Michael

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Mon Jan 17, 2011 3:35 pm
by lexvictory
The extrn rax error shouldn't be too difficult to nail down.
What i meant was, if I put the code within the code tags in a file and make a lib out of it, will i get the error?
If not with those 3 lines you may have to shave as much code off as possible to get a snippet that does it or PM me the code (if its not sensitive)
Comments should be ignored by TB, so I don't know what could be causing it

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Mon Jan 17, 2011 5:18 pm
by mpz
Dear lexvictory

you need only this code. I use the batch options. The error message appears. If you edit the asm file you find the " extrn rax" line. If you delete the line you can start the batch job and everything is fine...
Global *D3DDevice.IDIRECT3DDEVICE9
ProcedureDLL mytest()
If halleluja = 12 ; dummy only for testing
*D3DDevice\Clear(0,0,0,0,0,0)
EndIf
ProcedureReturn 1
EndProcedure
bets regrads michael

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Tue Jan 18, 2011 12:28 am
by mpz
Hi,

here the next importlib error (with x86 no problem), the "extras character online" error.

Code: Select all

 Macro DEFINE_GUID (Name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
    Global Name.guid
    Name\Data1 = l
    Name\Data2 = w1
    Name\Data3 = w2
    Name\Data4[0] = b1
    Name\Data4[1] = b2
    Name\Data4[2] = b3
    Name\Data4[3] = b4
    Name\Data4[4] = b5
    Name\Data4[5] = b6
    Name\Data4[6] = b7
    Name\Data4[7] = b8
  EndMacro 

Import "dxguid.lib" :  EndImport

  DEFINE_GUID(GUID_Joystick   ,$6F1D2B70,$D5A0,$11CF,$BF,$C7,$44,$45,$53,$54,$00,$00)
  DEFINE_GUID(GUID_SysKeyboard,$6F1D2B61,$D5A0,$11CF,$BF,$C7,$44,$45,$53,$54,$00,$00)
  DEFINE_GUID(GUID_SysMouse,   $6F1D2B60,$D5A0,$11CF,$BF,$C7,$44,$45,$53,$54,$00,$00)
 
 ProcedureDLL MyGuid (var) 
   
   If var = 0     
     ProcedureReturn GUID_Joystick\Data1
   ElseIf var = 1
     ProcedureReturn GUID_Joystick\Data2
   ElseIf var = 2
     ProcedureReturn GUID_Joystick\Data3
   ElseIf var = 3
     ProcedureReturn GUID_Joystick\Data4
   EndIf  
      
 EndProcedure 
  
 Debug MyGuid (1)

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Tue Jan 18, 2011 1:14 am
by lexvictory
ok, with the 2nd code, i had an idea:
Try taking out the : character (putting EndImport on another line), and see if it works. If it works doing that then it narrows the problem down to an easier fix

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Tue Jan 18, 2011 1:50 am
by mpz
Hi lexvictory,

the import function, if you use

Code: Select all

Import "dxguid.lib"
EndImport
works.

For the "Extrn rax+" problem have i written the program to delet the false lines:

Code: Select all

 Directory$ =  GetCurrentDirectory() ; Listet alle Einträge auf C:\ auf (ohne die Inhalte aus Unterverzeichnissen)
  If ExamineDirectory(0, Directory$, "*.asm")  
    While NextDirectoryEntry(0)
      Text$ = ""
      FileName$ = DirectoryEntryName(0)
      If DirectoryEntryType(0) = #PB_DirectoryEntry_File
         If ReadFile(0, FileName$ )   ; wenn die Datei geöffnet werden konnte, setzen wir fort...
           While Eof(0) = 0           ; sich wiederholende Schleife bis das Ende der Datei ("end of file") erreicht ist
           find$ = ReadString(0)
              If Left(find$,9) <> "Extrn rax"
                 Text$ + find$ +Chr(13)+Chr(10)     
              EndIf
           Wend
           CloseFile(0)               ; schließen der zuvor geöffneten Datei
         EndIf
          DeleteFile(FileName$ )

         If OpenFile(0, FileName$ )   ; wenn die Datei geöffnet werden konnte, setzen wir fort...
              WriteString(0, Text$ )
         EndIf
      EndIf
    Wend
    FinishDirectory(0)
  EndIf
With this tricks i can make a lib file but i get then a polilink error with 24 commands. I will make an example for that, but not now (i must sleep). It is also an "Extrn " problem of a import function. i check the assembler files. Perhaps i found the problem an we found a solution...

Grretings michael

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Tue Jan 18, 2011 1:53 am
by lexvictory
Don't worry, I know where to look for the bugs now, will get onto it when i have a moment to spare

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Wed Jan 19, 2011 2:30 am
by mpz
Hi,

Here comes a test code for both import problems and to solve them:

file Libx64.pb

Code: Select all

Structure D3DXMATRIX
      _11.f
      _12.f
      _13.f
      _14.f
      _21.f
      _22.f
      _23.f
      _24.f
      _31.f
      _32.f
      _33.f
      _34.f
      _41.f
      _42.f
      _43.f
      _44.f
EndStructure

Import "d3dx9.lib"

     D3DXMatrixRotationX (*pOut.D3DXMATRIX, Angle.f)
     
EndImport    

ProcedureDLL OneX (*Test.D3DXMATRIX, Angle.f)
  
  ProcedureReturn D3DXMatrixRotationX (Test, Angle)
   
EndProcedure 

Global *D3DDevice.IDIRECT3DDEVICE9


ProcedureDLL mytest()
  
  *D3DDevice.IDIRECT3DDEVICE9
  *D3DDevice\Clear(0,0,0,0,0,0)
  
  ProcedureReturn 1
  
EndProcedure

;OneX (*Test.D3DXMATRIX, 10)
First problem the interface -> procedure problem
If you look to the asm code x86 you see in mytest.asm

Code: Select all

format MS COFF

Public PB_mytest


Extrn Libx64_p_D3DDevice


section '.text' code readable executable
in the x64 mytest.asm you see the "Extrn rax+344" if you delete them the asm file works

Code: Select all

format MS64 COFF

Public PB_mytest


Extrn rax+344
Extrn Libx64_p_D3DDevice


section '.text' code readable executable
now the second problem, the wrong import name problem
If you look to the asm code x86 you see in OneX.asm

Code: Select all

format MS COFF

Public PB_OneX


Extrn _D3DXMatrixRotationX@8  ( -> this is the correct importname from the dx9 "d3dx9.lib")

section '.text' code readable executable
in the x64 OneX.asm you see a wrong function name. If you delete "Libx64_" in the the asm file it works, if not you cant use the OneX (*Test.D3DXMATRIX, 10) command, the Polilink error (command name not found) appears. "Libx64" is the name of the pb file

Code: Select all

format MS64 COFF

Public PB_OneX


Extrn Libx64_D3DXMatrixRotationX  ( the correct importname is D3DXMatrixRotationX, you must change it to "Extrn D3DXMatrixRotationX" 


section '.text' code readable executable
my workaround is the "Wrong line ins ASM Killer programm"

Code: Select all

;Wrong line ins ASM Killer programm

kill.s = "Libx64"
 Directory$ =  GetCurrentDirectory() ; Listet alle Einträge auf C:\ auf (ohne die Inhalte aus Unterverzeichnissen)
  If ExamineDirectory(0, Directory$, "*.asm")  
    While NextDirectoryEntry(0)
      Text$ = ""
      FileName$ = DirectoryEntryName(0)
      If DirectoryEntryType(0) = #PB_DirectoryEntry_File
         If ReadFile(0, FileName$ )   ; wenn die Datei geöffnet werden konnte, setzen wir fort...
           While Eof(0) = 0           ; sich wiederholende Schleife bis das Ende der Datei ("end of file") erreicht ist
              find$ = ReadString(0)
             
              find$ = ReplaceString(find$, kill + "_D3DX","D3DX")
             
              If Left(find$,9) <> "Extrn rax"
                 Text$ + find$ +Chr(13)+Chr(10)     
              EndIf
           Wend
           CloseFile(0)               ; schließen der zuvor geöffneten Datei
         EndIf
          DeleteFile(FileName$ )

         If OpenFile(0, FileName$ )   ; wenn die Datei geöffnet werden konnte, setzen wir fort...
              WriteString(0, Text$ )
         EndIf
      EndIf
    Wend
    FinishDirectory(0)
  EndIf
with this workaround i can make my lib...
i hope this help
Michael

Re: Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Thu Jan 20, 2011 8:03 am
by lexvictory
Fixed : http://sourceforge.net/projects/tailbit ... e/download

Also, using Import "some.lib" : EndImport has been added to the known issues; its not easily fixable due to the way TB scans through the asm.

Re: [done] Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Thu Jan 20, 2011 10:21 pm
by mpz
Dear lexvictory,

great work and much thanks! Now everything works fine. The first test lib works and i am working myselve to fix bugs :).

The > Import "some.lib" : EndImport < problem ist easy to solve and so not important to fix.

Greetings Michael

Re: [done] Problems Tailbite 1.4.5 and Windows 7 (x64)

Posted: Thu Jan 20, 2011 10:41 pm
by mpz
Oh,

i think i found the next problem. If you make a float procedure you get only integer numbers back. Please test the following code:

Code: Select all

ProcedureDLL.f MP_RandomFloat(fMin.f, fMax.f) ; Random Float from fMin.f to fMax.f 
  Protected fRandNum.f = Random(100000) / 100000 
  ProcedureReturn fMin + (fMax - fMin) * fRandNum 
EndProcedure 

Code: Select all

For n = 0 To 10
  
  Debug  MP_RandomFloat(-1, 1)
  
Next
with taibite only -1 and in Pb x64 = random floats...

My solution, to make a double from it:

Code: Select all

ProcedureDLL.d MP_RandomFloat(fMin.f, fMax.f) ; Erzeugt einen Zufallswert zwischen fMin.f und fMax.f 
  Protected fRandNum.f = Random(100000) / 100000 
  Double.d = fMin + (fMax - fMin) * fRandNum 
  ProcedureReturn Double 
EndProcedure 

Greeting Michael

Re: Next Problem with Tailbite 1.4.6 and Windows 7 (x64)

Posted: Fri Jan 21, 2011 2:43 am
by lexvictory
I sincerely doubt this is a TB problem:

Code: Select all

Protected fRandNum.f = Random(100000) / 100000
This returns 0!
one of the numbers on the right have side must be a float/double, or it is done as integer division and then converted to a float on assignment

Also, please do NOT post to a topic with an unrelated problem, especially after it has been marked done!

Re: [Done] Problem with Tailbite 1.4.6 and Windows 7 (x64)

Posted: Fri Jan 21, 2011 12:02 pm
by mpz
Dear lexvictory,

if have set it to [Done] again. Sorry for that fault.

The Procedure works in pb, but not with tailbite and so i thought it is a problem. I will check it and will change the prcoedure a little bit, see what happens

Greetings Michael