Skip to content

Commit 316958c

Browse files
committed
swars: Remade do_net_groups_LOGON()
1 parent ea7022a commit 316958c

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

conf/wrappers_game.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ show_net_comms_box W i p
109109
do_net_protocol_select W i i
110110
do_serial_speed_switch W i i
111111
net_unkn_func_32 W i
112+
net_unkn_func_31 W i p
112113
show_net_protocol_box W i p
113114
show_net_faction_box W i p
114115
show_net_team_box W i p

src/fenet.c

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ ubyte net_unkn_func_32(void)
179179
return ret;
180180
}
181181

182+
ubyte net_unkn_func_31(struct TbNetworkSession *p_nsession)
183+
{
184+
ubyte ret;
185+
asm volatile ("call ASM_net_unkn_func_31\n"
186+
: "=r" (ret) : "a" (p_nsession));
187+
return ret;
188+
}
189+
182190
ubyte do_net_INITIATE(ubyte click)
183191
{
184192
#if 0
@@ -232,10 +240,52 @@ ubyte do_net_INITIATE(ubyte click)
232240

233241
ubyte do_net_groups_LOGON(ubyte click)
234242
{
243+
#if 0
235244
ubyte ret;
236245
asm volatile ("call ASM_do_net_groups_LOGON\n"
237246
: "=r" (ret) : "a" (click));
238247
return ret;
248+
#endif
249+
const char *text;
250+
int plyr;
251+
252+
if (nsvc.I.Type == NetSvc_IPX && !byte_1C4A7C) {
253+
LOGWARN("Cannot abort protocol %d - not ready", (int)nsvc.I.Type);
254+
return 0;
255+
}
256+
if (login_control__State == 5)
257+
{
258+
plyr = LbNetworkPlayerNumber();
259+
network_players[plyr].Type = 13;
260+
byte_15516D = -1;
261+
net_INITIATE_button.Text = gui_strings[385];
262+
byte_15516C = -1;
263+
net_groups_LOGON_button.Text = gui_strings[386];
264+
net_unkn_func_33();
265+
}
266+
else if (login_control__State == 6)
267+
{
268+
if (byte_15516C != -1 || nsvc.I.Type != NetSvc_IPX)
269+
{
270+
if (net_unkn_func_31(&unkstruct04_arr[byte_15516C].Session))
271+
{
272+
net_INITIATE_button.Text = gui_strings[387];
273+
if (byte_1C4A6F)
274+
text = gui_strings[520];
275+
else
276+
text = gui_strings[388];
277+
net_groups_LOGON_button.Text = text;
278+
init_variables();
279+
init_agents();
280+
srm_reset_research();
281+
login_control__State = 5;
282+
for (plyr = 0; plyr < 8; plyr++) {
283+
players[plyr].MissionAgents = 15;
284+
}
285+
}
286+
}
287+
}
288+
return 1;
239289
}
240290

241291
TbBool mouse_down_over_unkn1(short x, short y, short width, short height)

src/swars.sx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165435,7 +165435,7 @@ net_unkn_func_30: /* 0x0CD0AC */
165435165435

165436165436

165437165437
/*----------------------------------------------------------------*/
165438-
net_unkn_func_31: /* 0x0CD2EC */
165438+
GLOBAL_FUNC(ASM_net_unkn_func_31) /* 0x0CD2EC */
165439165439
/*----------------------------------------------------------------*/
165440165440
push %ebx
165441165441
push %ecx
@@ -169123,7 +169123,7 @@ GLOBAL_FUNC(ASM_do_net_groups_LOGON) /* 0x0D3274 */
169123169123
sar $0x18,%eax
169124169124
imul $0xda,%eax,%eax
169125169125
add $unkstruct04_arr,%eax
169126-
call net_unkn_func_31
169126+
call ac_net_unkn_func_31
169127169127
test %al,%al
169128169128
je jump_d3381
169129169129
mov EXPORT_SYMBOL(gui_strings)+0x60C,%eax

0 commit comments

Comments
 (0)