1
0
Fork 0

Merge pull request #10 from mewpull/memset32

Implement memset32 and fix compilation errors for storm.h
pull/15/head
galaxyhaxz 2018-06-11 03:26:51 -05:00 committed by GitHub
commit 539e544563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 23 deletions

View File

@ -163,10 +163,10 @@ SNetGetPlayerName(
* *
* Returns TRUE if the function was called successfully and FALSE otherwise. * Returns TRUE if the function was called successfully and FALSE otherwise.
*/ */
BOOL //BOOL
STORMAPI //STORMAPI
SNetGetProviderCaps( //SNetGetProviderCaps(
PCAPS providerCaps); // PCAPS providerCaps);
/* SNetGetTurnsInTransit @ 115 /* SNetGetTurnsInTransit @ 115
* *
@ -306,14 +306,14 @@ typedef struct _storm_head
* *
* Returns TRUE if the function was called successfully and FALSE otherwise. * Returns TRUE if the function was called successfully and FALSE otherwise.
*/ */
BOOL //BOOL
STORMAPI //STORMAPI
SNetInitializeProvider( //SNetInitializeProvider(
DWORD providerName, // DWORD providerName,
client_info *gameClientInfo, // client_info *gameClientInfo,
user_info *userData, // user_info *userData,
battle_info *bnCallbacks, // battle_info *bnCallbacks,
module_info *moduleData); // module_info *moduleData);
BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid); BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid);
@ -354,7 +354,7 @@ typedef struct _s_evt
// @TODO: "type" is unknown. // @TODO: "type" is unknown.
HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT)); //HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT));
int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid); int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid);

14
defs.h
View File

@ -29,18 +29,12 @@
#ifndef IDA_GARBAGE #ifndef IDA_GARBAGE
#define IDA_GARBAGE #define IDA_GARBAGE
// note to self: only works for x86, originally used this way by the devs inline void memset32(void *s, unsigned int c, size_t n)
inline void memset32(void *s, unsigned int i, size_t n)
{ {
__asm { unsigned int *p = (unsigned int *)s;
mov ecx, n for (int i = 0; i < n; i++) {
mov eax, i p[i] = c;
mov edi, s
rep stosd
} }
//for(x = 0; x < n; x++)
// (DWORD)s[x] = i;
} }
typedef __int64 ll; typedef __int64 ll;