Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Stars race wizard habitat ranges advantage points
Re: Stars race wizard habitat ranges advantage points Fri, 01 May 2020 09:31 Go to previous messageGo to previous message
raptor is currently offline raptor

 
Chief Warrant Officer 1
Creator of StarsWine
Created StarsWine

Messages: 138
Registered: June 2014
I don't know if this will help, but I used IDA to disassemble Stars! and then exported it to Ghidra to use its free decompiler. Below is the resulting code from the race wizard page 4, which may provide some insights for the pesky point calculations:

word __stdcall16far
RaceWizardDlg4(int param_1,int param_1_00,int param_3,uint param_4,int param_5,undefined2 param_6)

{
  undefined2 uVar1;
  undefined *puVar2;
  int iVar3;
  undefined *puVar4;
  int unaff_SI;
  RECT *pRVar5;
  word *pwVar6;
  byte local_292;
  word local_3a;
  word local_38;
  RECT local_36;
  word local_2e;
  PAINTSTRUCT local_2c;
  word local_c;
  RECT local_a;
  
  if (param_4 == 0xf) {
    uVar1 = BEGINPAINT();
    GETCLIENTRECT();
    _DrawRaceAdvantagePoints();
    SELECTOBJECT();
    SETBKCOLOR();
    GETDLGITEM();
    GETWINDOWRECT();
    SCREENTOCLIENT();
    GETDLGITEM();
    GETWINDOWRECT();
    pwVar6 = &local_a.right;
    SCREENTOCLIENT();
    local_36.right = local_a.right;
    local_36.bottom = local_a.bottom;
    _ExpandRc(&local_36,(int *)(_dyArial8 + 2),(int)_dyArial8 >> 1,(int)pwVar6);
    local_36.top = local_36.top - 4;
    __Draw3dFrame(uVar1,&local_36,(word *)0xffff,(int)pwVar6);
    _CchGetString(0x112,(uint)&_szWork,(undefined *)pwVar6);
    TEXTOUT();
    GETCLIENTRECT();
    local_a.top = local_36.bottom + 0xc;
    local_a.left = local_a.left + 0xc;
    local_a.right = local_a.right - 0xc;
    GETDLGITEM();
    GETWINDOWRECT();
    pRVar5 = &local_36;
    SCREENTOCLIENT();
    local_a.bottom = local_36.top - 6;
    __Draw3dFrame(uVar1,&local_a,(word *)0xffff,(int)pRVar5);
    puVar2 = _CchGetString(0x113,(uint)&_szWork,(undefined *)pRVar5);
    TEXTOUT();
    iVar3 = _GetRaceStat((int)&_vplr,0xe,(int)puVar2);
    local_3a = (iVar3 + 0x5c) * 3;
    local_38 = 0;
    local_c = 0;
    while ((int)local_c < 3) {
      puVar4 = _CchGetString(local_3a,(uint)(&local_292 + local_38),puVar2);
      local_38 = (word)(puVar4 + local_38);
      local_c = local_c + 1;
      local_3a = local_3a + 1;
    }
    _ExpandRc(&local_a,(int *)(-2 - _dyArial8),-((int)_dyArial8 >> 1),(int)puVar2);
    local_a.top = local_a.top + 4;
    DRAWTEXT();
    _rcCargo = local_a.left;
    WORD_b6c9_23a0 = local_a.top;
    WORD_b6c9_23a2 = local_a.right;
    WORD_b6c9_23a4 = local_a.bottom;
    ENDPAINT();
  }
  else {
    if (param_4 == 0x14) {
      GETCLIENTRECT();
      FILLRECT();
    }
    else {
      if (param_4 == 0x19) {
        local_c = 0x10f;
        while (((int)local_c < 0x119 && (iVar3 = GETDLGITEM(), iVar3 != param_1))) {
          local_c = local_c + 1;
        }
        if ((0x118 < (int)local_c) && (param_1_00 != 6)) {
          return 0;
        }
        SETBKCOLOR();
        return 0;
      }
      if (param_4 == 0x110) {
        _SetRCWTitle();
        iVar3 = _GetRaceStat((int)&_vplr,0xe,0x118);
        iVar3 = iVar3 + 0x10f;
        CHECKRADIOBUTTON();
        if (_fRCWReadOnly != 0) {
          local_c = 0x10f;
          do {
            GETDLGITEM();
            ENABLEWINDOW();
            local_c = local_c + 1;
          } while ((int)local_c < 0x119);
        }
        _StickyDlgPos(param_5,(int)&_ptStickyRaceDlg,(word *)&UNK_b6c9_0001,iVar3);
      }
      else {
        if (param_4 != 0x111) {
          return 0;
        }
        if (param_3 == 0x76) {
          WINHELP();
        }
        else {
          local_c = 0;
          while (((int)local_c < 4 && (*(int *)((int)&_rgidRaceBtn + local_c * 2) != param_3))) {
            local_c = local_c + 1;
          }
          if (3 < (int)local_c) {
            if (param_1_00 != 0) {
              return 0;
            }
            if ((uint)param_3 < 0x10f) {
              return 0;
            }
            if (0x118 < (uint)param_3) {
              return 0;
            }
            _SetRaceStat((int)&_vplr,0xe,param_3 + -0x10f,unaf
...

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New game?
Next Topic: Stars! on Pi 4
Goto Forum:
  


Current Time: Mon Apr 29 06:09:54 EDT 2024