flat assembler
Message board for the users of flat assembler.

Index > Windows > help with n64 plugin specs

Author
Thread Post new topic Reply to topic
cubeoid



Joined: 22 Jan 2007
Posts: 19
cubeoid 10 Mar 2007, 15:22
hi im porting zilmars no_audio plugin to fasm from c
but it doesnt work can any one help

here is the function (its for a dll)

in c
-----------------------------------------
Code:
typedef struct {
        WORD Version;        /* Should be set to 0x0101 */
        WORD Type;           /* Set to PLUGIN_TYPE_AUDIO */
        char Name[100];      /* Name of the DLL */

        /* If DLL supports memory these memory options then set them to TRUE or FALSE
           if it does not support it */
        BOOL NormalMemory;   /* a normal BYTE array */ 
        BOOL MemoryBswaped;  /* a normal BYTE array where the memory has been pre
                                  bswap on a dword (32 bits) boundry */
} PLUGIN_INFO;

DLLEXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo ){ 
        PluginInfo->Version = 0x0101;
        PluginInfo->Type    = PLUGIN_TYPE_AUDIO;
        sprintf(PluginInfo->Name,"No Sound");
        PluginInfo->NormalMemory  = TRUE;
        PluginInfo->MemoryBswaped = TRUE;
}    


here is what i wrote in fasm

Code:
struct PLUGIN_INFO
  Version        dw ?
  Type           dw ?
  Name           db 100 dup (?)
  NormalMemory   dd ?
  MemoryBswaped  dd ?
 ends

PLUGIN_INFO PluginInfo

proc GetDllInfo PluginInfo
mov [PluginInfo.Version], 0101H
mov [PluginInfo.Type],PLUGIN_TYPE_AUDIO
mov [PluginInfo.Name],0
mov[PluginInfo.NormalMemory],TRUE
mov[PluginInfo.MemoryBswaped],TRUE

ret
endp      


i dont know how i should write it in fasm (i know my code is wrong)
can anyone help
Post 10 Mar 2007, 15:22
View user's profile Send private message Reply with quote
Garthower



Joined: 21 Apr 2006
Posts: 158
Location: Ukraine
Garthower 11 Mar 2007, 03:36
Use can try this:

Code:
struct PLUGIN_INFO 
  Version        dw ? 
  Type           dw ? 
  Name           db 100 dup (?) 
  NormalMemory   dd ? 
  MemoryBswaped  dd ? 
 ends 

PLUGIN_INFO PluginInfo 

proc GetDllInfo PluginInfo

mov [PluginInfo.Version], 0101H 
mov [PluginInfo.Type],PLUGIN_TYPE_AUDIO 
stdcall lstrcpyA,PluginInfo.Name,DLLName
mov[PluginInfo.NormalMemory],TRUE 
mov[PluginInfo.MemoryBswaped],TRUE 

ret 

DLLName db 'No Sound',0

endp     


But is better will already declare in advance filled structure in section of data, and then it simply to copy to the necessary address.
Post 11 Mar 2007, 03:36
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.