aboutsummaryrefslogtreecommitdiffstats
path: root/fw/pseudo/oc_command_surface.c
blob: 8b2122c4d9bc08bea5d3981827cb627c85f7a256 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// OC TA command surface, decompiled with restored names, prototypes and types.
// Source: psp_out/versions_win/ta_50-0-0-1_cbd47c59.bin
// Handlers resolved from fw/cmdmaps/oc.json; loc_* labels mapped to their
// containing function. Generated by fw/ta_surface.py.

// ================ cmd 0x2 @ 0x401750 ================
int __fastcall oc_cmd02(void *ctx, struct ta_params *params)
{
  if ( oc_cmd02__h1(ctx, params: (struct ta_params *)((char *)ctx + 1)) != 0 )
  {
    *(_BYTE *)ctx = 0;
    *((_BYTE *)ctx + 1) = 0;
  }
  return 0;
}

// ================ cmd 0x1 @ 0x401768 ================
int __fastcall oc_cmd01(void *ctx, struct ta_params *params)
{
  int v3; // r6
  int v4; // r0
  _DWORD *v5; // r5
  int v6; // r0
  int v7; // r2
  struct ta_params *v8; // r1
  char v10; // [sp+17h] [bp-1h] BYREF

  v3 = oc_cmd01__h1(ctx: (void *)0x20, params: (struct ta_params *)1);
  if ( v3 == 0 )
  {
    v4 = oc_cmd01__h3(ctx: (void *)0xE, params: nullptr);
    if ( v4 != 0 )
    {
      v5 = (_DWORD *)v4;
      v7 = off_401824[1];
      v6 = *off_401824;
      *(_BYTE *)v5 = *(_QWORD *)off_401824;
      v5[1] = v7;
      *((_BYTE *)v5 + 3) = HIBYTE(v6);
      *((_BYTE *)v5 + 2) = BYTE2(v6);
      *((_BYTE *)v5 + 1) = BYTE1(v6);
      oc_lib_thunk_tailjump(a1: (int)(v5 + 2));
      ((void (__fastcall *)(_DWORD *, int, int *, int, char *, int, int, int))loc_40133C)(
        a1: v5,
        a2: 14,
        a3: (int *)off_40181C,
        a4: 48,
        a5: (char *)ctx + 8,
        a6: 48,
        a7: 48,
        a8: 1);
      v10 = 1;
      if ( *((_BYTE *)ctx + 6) == 0 || (v3 = 5, oc_sysdrv_rpc_3158(a1: (int)&v10) == 0) && v10 != 1 )
        v3 = 0;
      oc_cmd01__h2(ctx: v5, params: v8);
    }
    else
    {
      return 2;
    }
  }
  return v3;
}