Page 1 of 1

Bug with copying map structure

Posted: Tue Jul 19, 2011 5:46 pm
by PrincieD
Hi,

It appears theres problems with TailBite and copying maps, the following code causes TailBite to fail:

CopySkin.asm
line: 31
error code: -108
error string: Illegal Instruction

Code: Select all

Structure skinProperties
  value.s
  resType.i
  resData.i
  resDataSize.i
EndStructure

Structure skinStates
  Map property.skinProperties()
EndStructure

Structure skinComponents
  Map state.skinStates()
EndStructure

Structure skins
  name.s
  author.s
  date.s
  version.s
  url.s
  Map component.skinComponents()
EndStructure

Global NewList skin.skins()

ProcedureDLL CopySkin(Skin.i) ; Returns a copy of the specified skin
  
  ForEach skin()
    If @skin() = Skin
      
      tskin.skins
      tskin = skin()
      
      LastElement(skin())
      If AddElement(skin()) <> 0
        skin() = tskin
        ProcedureReturn @skin()
      EndIf
      
      ProcedureReturn 0
      
    EndIf
  Next
  
  ProcedureReturn 0
  
EndProcedure
Thanks!

Chris.

Re: Bug with copying map structure

Posted: Tue Jul 19, 2011 6:13 pm
by ABBKlaus
its a missing macro. Will be hard to implement in TB but i will try it when it find some time ;-)

Code: Select all

macro MP0_Setup{
  LEA    eax,[esp]
  PUSH   s_skins
  PUSH   eax
  CALL  _SYS_InitDynamicStructure@8
}
BTW : your Linked List has to be initialised in the init-function, something like this :

Code: Select all

ProcedureDLL CopySkin_Init()
  Global NewList skin.skins()
EndProcedure

Re: Bug with copying map structure

Posted: Tue Jul 19, 2011 6:54 pm
by PrincieD
ABBKlaus wrote:its a missing macro. Will be hard to implement in TB but i will try it when it find some time
Thanks ABBKlaus :)
ABBKlaus wrote:BTW : your Linked List has to be initialised in the init-function, something like this :
Yes I know (all lists are defined in ProGUI_Init), just wanted to show you the copy map error but thanks anyway.

Chris.