Win64

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agoodman
    Adept
    • Jan 2011
    • 114

    Win64

    not sure if anyone cares but I did this:

    --- main-win.c.orig Fri Dec 24 05:14:00 2010
    +++ src\main-win.c Mon Jan 03 19:44:36 2011
    @@ -3983,7 +3983,7 @@
    term_data *td;

    /* Acquire proper "term_data" info */
    - td = (term_data *)GetWindowLong(hWnd, 0);
    + td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);

    BeginPaint(hWnd, &ps);

    @@ -4028,7 +4028,7 @@
    #endif /* USE_SAVER */

    /* Acquire proper "term_data" info */
    - td = (term_data *)GetWindowLong(hWnd, 0);
    + td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);

    /* Handle message */
    switch (uMsg)
    @@ -4036,7 +4036,11 @@
    /* XXX XXX XXX */
    case WM_NCCREATE:
    {
    - SetWindowLong(hWnd, 0, (LONG)(my_td));
    +#ifdef _WIN64
    + SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
    +#else
    + SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
    +#endif
    break;
    }

    @@ -4366,7 +4370,7 @@


    /* Acquire proper "term_data" info */
    - td = (term_data *)GetWindowLong(hWnd, 0);
    + td = (term_data *)GetWindowLongPtr(hWnd, GWLP_USERDATA);

    /* Process message */
    switch (uMsg)
    @@ -4374,7 +4378,11 @@
    /* XXX XXX XXX */
    case WM_NCCREATE:
    {
    - SetWindowLong(hWnd, 0, (LONG)(my_td));
    +#ifdef _WIN64
    + SetWindowLongPtr(hWnd, GWLP_USERDATA, my_td);
    +#else
    + SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG)(my_td));
    +#endif
    break;
    }

    and it compiles and runs natively in Win7 x64. I would make it a formal contribution but, as I said, I don't know that anyone really cares since it runs fine in 32bit mode on Win64... I mostly did it just to see if my windoze C coding was as rusty as I thought it was (it was... it took me much longer to do that than it should have)
  • APWhite
    Adept
    • Jul 2007
    • 244

    #2
    Adam? You old nasty borg programmer. I thought you died of starvation in town looking for potions of CCW.
    St George Chiropractor
    Angband Borg Homepage

    Comment

    • agoodman
      Adept
      • Jan 2011
      • 114

      #3
      Hey Andrew, I thought you were gone too when your old web page died. I just found the new address today. Somehow seeing you continue developing the borg makes the world a little more "right" ;-)

      Comment

      • d_m
        Angband Devteam member
        • Aug 2008
        • 1517

        #4
        Originally posted by agoodman
        I would make it a formal contribution but, as I said, I don't know that anyone really cares since it runs fine in 32bit mode on Win64... I mostly did it just to see if my windoze C coding was as rusty as I thought it was (it was... it took me much longer to do that than it should have)
        The current dev team is relatively short on Windows experience (we have about 1.5 windows devs as opposed to ~5 *nix devs) so I have gone ahead and tested this (with mingw + WINE) and committed it into staging.

        Thanks for the patch!
        linux->xterm->screen->pmacs

        Comment

        • APWhite
          Adept
          • Jul 2007
          • 244

          #5
          Originally posted by agoodman
          Hey Andrew, I thought you were gone too when your old web page died. I just found the new address today. Somehow seeing you continue developing the borg makes the world a little more "right" ;-)
          Well, I'm glad to see you here. It has been like 10 yrs or so. We moved from SD to ST George UT this fall.

          When you get a chance, I could use some help with the 320 code. The borg compiles fine and can do some low level things like check power, flow codes, and things that are contained in the borg itself. But it can't seem to interact with the game code. When the borg sends a command to the game, the game does not interpret the keypress correctly.

          APWhite
          St George Chiropractor
          Angband Borg Homepage

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎