Advertisement
nevrdid

FinalBurn Neo rotation fix for minarch

Jan 17th, 2025 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.82 KB | None | 0 0
  1. diff --git a/src/burner/libretro/libretro.cpp b/src/burner/libretro/libretro.cpp
  2. index 3726ec60f..30a6c8cd6 100644
  3. --- a/src/burner/libretro/libretro.cpp
  4. +++ b/src/burner/libretro/libretro.cpp
  5. @@ -78,7 +78,7 @@ INT32 nAudSegLen = 0;
  6.  
  7.  static UINT8* pVidImage              = NULL;
  8.  static bool bVidImageNeedRealloc     = false;
  9. -static bool bRotationDone            = false;
  10. +static bool bRotationDone            = true;
  11.  static int16_t *pAudBuffer           = NULL;
  12.  static char text_missing_files[2048] = "";
  13.  
  14. @@ -1550,8 +1550,46 @@ void retro_run()
  15.         // current frame will be corrupted, let's dupe instead
  16.         pBurnDraw = NULL;
  17.     }
  18. +    // get flags
  19. +    UINT32 flags = BurnDrvGetFlags();
  20. +
  21. +    if (pBurnDraw && flags & BDF_ORIENTATION_VERTICAL) {
  22. +        int y=0;
  23. +
  24. +        UINT8 *pTMP = (UINT8*)malloc(nGameWidth * nGameHeight * nBurnBpp);
  25. +        memcpy(pTMP, pBurnDraw, nGameWidth * nGameHeight * nBurnBpp);
  26. +
  27. +        int newGameWidth = nGameHeight;
  28. +        int newGameHeight = nGameWidth;
  29. +        int newBurnPitch = newGameWidth * nBurnBpp;
  30. +
  31. +       if ((BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL))
  32. +        while (y < newGameHeight) {
  33. +            int x = 0;
  34. +
  35. +           if ( flags & BDF_ORIENTATION_FLIPPED ) {
  36. +                while (x < newGameWidth)
  37. +                {
  38. +                    for (int i = 0; i < nBurnBpp; i++)
  39. +                        pBurnDraw[x * nBurnBpp + y * newBurnPitch + i] = pTMP[(nGameHeight - x - 1) * nBurnPitch + y * nBurnBpp + i];
  40. +                    x++;
  41. +                }
  42. +            } else {
  43. +                while (x < newGameWidth)
  44. +                {
  45. +                    for (int i = 0; i < nBurnBpp; i++)
  46. +                        pBurnDraw[x * nBurnBpp + y * newBurnPitch + i] = pTMP[x * nBurnPitch + (nGameWidth - y - 1) * nBurnBpp + i];
  47. +                    x++;
  48. +                }
  49. +            }
  50. +            y++;
  51. +        }
  52. +        free(pTMP);
  53. +       video_cb(pBurnDraw, newGameWidth, newGameHeight, newBurnPitch);
  54. +    } else {
  55. +       video_cb(pBurnDraw, nGameWidth, nGameHeight, nBurnPitch);
  56. +    }
  57.  
  58. -   video_cb(pBurnDraw, nGameWidth, nGameHeight, nBurnPitch);
  59.  
  60.     bool updated = false;
  61.     if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
  62. @@ -1567,7 +1605,7 @@ void retro_run()
  63.         // change orientation/geometry if vertical mode was toggled on/off
  64.         if (old_nVerticalMode != nVerticalMode)
  65.         {
  66. -           SetRotation();
  67. +           //SetRotation();
  68.             struct retro_system_av_info av_info;
  69.             retro_get_system_av_info(&av_info);
  70.             environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info);
  71. @@ -2184,7 +2222,7 @@ static bool retro_load_game_common()
  72.  
  73.         // Initializing display, autorotate if needed
  74.         BurnDrvGetFullSize(&nGameWidth, &nGameHeight);
  75. -       SetRotation();
  76. +       //SetRotation();
  77.         SetColorDepth();
  78.  
  79.         VideoBufferInit();
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement