VXAce Trying to make 16:9 support

I thought about making both 4:3 and 16:9 modes support with ability to change them during the game.
So, I could find scripts to pass 640x480 limit (from Hime) and make camera centered on small maps (from Yanfly), but there's two problems that makes the game look wrong -
first - tiles draw distance is short for widescreen resolution, it can be seen by black stripe or some parallax.
and second - player camera position is not centred, because camera position depends on tileset resolution or half of it.
Also I tried to change resolution during the game using event with script, but resolution looks incorrect until I transfer to the same or different map.

AspectRatios.png

I couldn't find any helpful script and I also can't write script myself. So can you help me with this?
search the forums for the RGD engine by invwindy.
I thought about making both 4:3 and 16:9 modes support with ability to change them during the game.
So, I could find scripts to pass 640x480 limit (from Hime) and make camera centered on small maps (from Yanfly), but there's two problems that makes the game look wrong -
first - tiles draw distance is short for widescreen resolution, it can be seen by black stripe or some parallax.
and second - player camera position is not centred, because camera position depends on tileset resolution or half of it.
Also I tried to change resolution during the game using event with script, but resolution looks incorrect until I transfer to the same or different map.

View attachment 331374

I couldn't find any helpful script and I also can't write script myself. So can you help me with this?

Hi @Timofey_Rusanov ,

Is your resolution size evenly divisible by 32 pixels (RPG Maker Ace’s tile size)? I know when you use a resolution that’s not, it can cause display issues because of it. Maybe give that a try.
Hi again. Sorry I didn't wrote anything for long time, it's personal reasons.

So, yesterday I used Cam Slide Control by Galv in my demo, camera is locked on playable character, but it slowly sliding to player and I don't like it. When I disable it, camera following to player instantly, but camera isn't locked to player. Here's example of work Cam Slide Control script with enabled sliding camera...

1741324802650.png


search the forums for the RGD engine by invwindy.
I was already using it, but RGD offers more than just tileset fixes for custom resolutions. I believe that it could be fixed with some script.

Is your resolution size evenly divisible by 32 pixels (RPG Maker Ace’s tile size)? I know when you use a resolution that’s not, it can cause display issues because of it. Maybe give that a try.
I'd like to do that, but I'm a proponent of using native screen resolution. With Fullscreen+ by Zeus81 (it's upscaling game's screen) I can run game in native 1920x1080 (upscaled 854x480).
I think you understand my intentions. Besides, I'm making this for those who'd like to play in true 16:9 or record it without need to stretch 4:3.
I used Lune Smooth Camera Sliding instead of Cam Slide Control to make camera "always centred" with 0.03125 speed of slide. Although I find out that camera that follows to player can be moved from center with this script (I've set 1.95 instead of 2.0 to make camera centered in 854x480)...

Ruby:
class Game_Player < Game_Character
  def center_x  
    ((Graphics.width / 32).floor - 1) / 1.95
  end
end

And I know about script that fixes map scrolling for 640x360 users, but it fixes vertical scrolling only, so I edited this script to fix horizontal scrolling only.

Ruby:
#===============================================================================
# Map Scroll Glitch Fix v1.0 by wltr3565 (RMVX ACE only)
#
# In widescreen resolution (640x360) the bottom of the map shows up some upmost
# part of the map. This one fixes this.
# But it's only for 640x360 for now, so if there's need for fixing in many
# aspects, let me know. It's rare for an RM game to have a different resolution
# other from either 544x416 or 640x480.
#
# Just paste this above main, and as above as possible above other custom
# scripts.
#===============================================================================
class Game_Map
  def scroll_right(distance)
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width
      @parallax_x += distance if @parallax_loop_x
    else
      last_x = @display_x
      @display_x = [@display_x + distance, width - screen_tile_x, width - screen_tile_x - (Graphics.width % 32 * 1.0 / 32)].min
      @parallax_x += @display_x - last_x
    end
  end
 
  def set_display_pos(x, y)
    x = [0, [x, width - screen_tile_x].min].max unless loop_horizontal?
    y = [0, [y, height - screen_tile_y].min].max unless loop_vertical?
    @display_x = (x + width) % width
    @display_y = (y + height) % height
    @display_x = (x + width) % width -  (Graphics.width % 32 * 1.0 / 32) if @display_x >= @map.width - 12
    @parallax_x = x
    @parallax_y = y
  end
end

Everything was OK, but there's only one problem I couldn't fix. I told already that I'm using Yanfly's script to make camera centred on small maps, so this script is incompatible with map scroll fix script that I've edited, because if I move player to right, map is moving out of center to right and I don't see right side of the map because of its size (17x13).

1741586624147.png
make camera centered on small maps (from Yanfly)
Out of curiosity what script is that.
I do not see any script from Yanfly that does that.
Out of curiosity what script is that.
I do not see any script from Yanfly that does that.
It's Ace Core Engine from Yanfly.
There's a feature named "Screen Resolution Size".
It says "The screen can now be resized from 544×416 with ease and still support maps that are smaller than 544×416. Maps smaller than 544×416 will be centered on the screen without having sprites jumping all over the place.".
It's Ace Core Engine from Yanfly.
There's a feature named "Screen Resolution Size".
It says "The screen can now be resized from 544×416 with ease and still support maps that are smaller than 544×416. Maps smaller than 544×416 will be centered on the screen without having sprites jumping all over the place.".
But you said " to make camera centered on small maps". That's not what that scripts does. the map is centered because a map smaller than the resolution would cause some issues from the default program settings.
The Yanfly Core script simply allows you to resize the game screen to another resolution (which should be in multiples of 32)
17 * 32 = 544
13 * 32 = 416

So not the Camera, just the sprites.
This is an intended fix because if your map was 17x13 and the resolution was 640 x 480, then the sprites on the map would jump around as you moved. Yanfly's Core script helps fix that by centering the map and making the rest a black border.
1741615238121.png
map is centered because a map smaller than the resolution
That's what I need, make small maps located at center of screen and make them filled with black "zones".
Yanfly's Core script helps fix that by centering the map and making the rest a black border.
But anyway, it looks more better than without Yanfly's script, and I believe that issue with using both scripts can be fixed. I don't want to make big maps (with more than width 20 or 27 tiles) that contains small interiors and fill them with black tiles.
I could finally combine Game_Map codes from Yanfly and wltr3565 scripts, so small maps are still staying on center of screen with highest resolution and camera doesn't get out of the map's end. And, I could also fix problem with tiles' drawing on custom screen sizes which aren't divisible by 32, like 854x480 or 640x360; I had to change something in code from unknown scripter. Here's finished script below.

Ruby:
=begin
#===============================================================================
 Title: Unlimited Resolution
 Date: Jun 6, 2014
--------------------------------------------------------------------------------
 ** Change log
 Jun 6, 2014
   - Kaelan: fixed several bugs in the Plane class which prevented the sprite
     from being modified correctly. Patched for compatibility with Victor's
     Fogs and Overlays script. Include this after his script.
 Apr 20, 2014
   - added Kaelan's suggestion for disposing the viewport when done with it
 Nov 6, 2013
   - added some plane modifications to fix parallax images
 Oct 24, 2013
   - Initial release
--------------------------------------------------------------------------------   
 ** Terms of Use
 * Free
--------------------------------------------------------------------------------
 ** Description
 
 This script modifies Graphics.resize_screen to overcome the 640x480 limitation.
 It also includes some code to properly display maps that are smaller than the
 screen size.
 
 Now you can have arbitrarily large game resolutions.
 
--------------------------------------------------------------------------------
 ** Installation
 
 You should place this script above all custom scripts
 
--------------------------------------------------------------------------------
 ** Usage

 As usual, simply resize your screen using the script call
 
   Graphics.resize_screen(width, height)

--------------------------------------------------------------------------------
 ** Credits
 
 Unknown author for overcoming the 640x480 limitation
 Lantier, from RMW forums for posting the snippet above
 Esrever for handling the viewport
 Jet, for the custom Graphics code
 FenixFyre, for the Plane class fix
 Kaelan, for several bug fixes

#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_UnlimitedResolution"] = true
#===============================================================================
# ** Configuration
#===============================================================================
class << SceneManager
 
  alias resolution_run run
  def run(*args, &block)
    Graphics.ensure_sprite
    resolution_run(*args, &block)
  end
end

module Graphics
 
  @@super_sprite = Sprite.new
  @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1)
 
  class << self
    alias :th_large_screen_resize_screen :resize_screen
    
    def freeze(*args, &block)
      @@super_sprite.bitmap = snap_to_bitmap
    end
    
    def transition(time = 10, filename = nil, vague = nil)
      if filename
        @@super_sprite.bitmap = Bitmap.new(filename)
      end
      @@super_sprite.opacity = 255
      incs = 255.0 / time
      time.times do |i|
        @@super_sprite.opacity = 255.0 - incs * i
        Graphics.wait(1)
      end
      @@super_sprite.bitmap.dispose if @@super_sprite.bitmap
      reform_sprite_bitmap
      Graphics.brightness = 255
    end
    
    def reform_sprite_bitmap
      @@super_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
      @@super_sprite.bitmap.fill_rect(@@super_sprite.bitmap.rect, Color.new(0, 0, 0, 255))
    end
    
    def fadeout(frames)
      incs = 255.0 / frames
      frames.times do |i|
        i += 1
        Graphics.brightness = 255 - incs * i
        Graphics.wait(1)
      end
    end
    
    def fadein(frames)
      incs = 255.0 / frames
      frames.times do |i|
        Graphics.brightness = incs * i
        Graphics.wait(1)
      end
    end

    def brightness=(i)
      @@super_sprite.opacity = 255.0 - i
    end
    
    def brightness
      255 - @@super_sprite.opacity
    end
    
    def ensure_sprite
      if @@super_sprite.disposed?
        @@super_sprite = Sprite.new
        @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1)
        reform_sprite_bitmap
      end
    end
  end
 
  #-----------------------------------------------------------------------------
  # Unknown Scripter. Copied from http://pastebin.com/sM2MNJZj
  #-----------------------------------------------------------------------------
  def self.resize_screen(width, height)
    wt, ht = width.divmod(32), height.divmod(32)
    #wt.last + ht.last == 0 || fail('Incorrect width or height')
    wh = -> w, h, off = 1 { [w + off, h + off].pack('l2').scan /.{4}/ }
    w, h = wh.(width, height)
    ww, hh = wh.(width, height, 32)
    www, hhh = wh.(wt.first.succ, ht.first.succ)
    base = 0x10000000  # fixed?
    mod = -> adr, val { DL::CPtr.new(base + adr)[0, val.size] = val }
    mod.(0x195F, "\x90" * 5)  # ???
    mod.(0x19A4, h)
    mod.(0x19A9, w)
    mod.(0x1A56, h)
    mod.(0x1A5B, w)
    mod.(0x20F6, w)
    mod.(0x20FF, w)
    mod.(0x2106, h)
    mod.(0x210F, h)
    # speed up y?
    #mod.(0x1C5E3, h)
    #mod.(0x1C5E8, w)
    zero = [0].pack ?l
    mod.(0x1C5E3, zero)
    mod.(0x1C5E8, zero)
    mod.(0x1F477, h)
    mod.(0x1F47C, w)
    mod.(0x211FF, hh)
    mod.(0x21204, ww)
    mod.(0x21D7D, hhh[0])
    mod.(0x21E01, www[0])
    mod.(0x10DEA8, h)
    mod.(0x10DEAD, w)
    mod.(0x10DEDF, h)
    mod.(0x10DEF0, w)
    mod.(0x10DF14, h)
    mod.(0x10DF18, w)
    mod.(0x10DF48, h)
    mod.(0x10DF4C, w)
    mod.(0x10E6A7, w)
    mod.(0x10E6C3, h)
    mod.(0x10EEA9, w)
    mod.(0x10EEB9, h)
    th_large_screen_resize_screen(width, height)
  end
end

#===============================================================================
# Esrever's code from
# http://www.rpgmakervxace.net/topic/100-any-chance-of-higher-resolution-or-larger-sprite-support/page-2#entry7997
#===============================================================================
class Game_Map

  #--------------------------------------------------------------------------
  # overwrite method: scroll_down
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    last_y = @display_y
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance if @parallax_loop_y
    else
      dh = Graphics.height > height * 32 ? height : screen_tile_y + Graphics.height % 32 * 1.0 / 32
      @display_y = [@display_y + distance, height - dh].min
      @parallax_y += @display_y - last_y
    end
    @fog_y += loop_vertical? ? distance : @display_y - last_y if @fog_y
  end

  #--------------------------------------------------------------------------
  # overwrite method: scroll_right
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    last_x = @display_x
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance if @parallax_loop_x
    else
      dw = Graphics.width > width * 32 ? width : screen_tile_x + Graphics.width % 32 * 1.0 / 32
      @display_x = [@display_x + distance, width - dw].min
      @parallax_x += @display_x - last_x
    end
    @fog_x += loop_horizontal? ? distance : @display_x - last_x if @fog_x
  end

  #--------------------------------------------------------------------------
  # overwrite method: set_display_pos
  #--------------------------------------------------------------------------
  def set_display_pos(x, y)
    x = [0, [x, width - screen_tile_x].min].max unless loop_horizontal?
    y = [0, [y, height - screen_tile_y].min].max unless loop_vertical?
    @display_x = (x + width) % width
    @display_y = (y + height) % height
    @display_x = (x + width) % width - (Graphics.width % 32 * 1.0 / 32) if @display_x >= @map.width - 12
    @display_y = (y + height) % height - (Graphics.height % 32 * 1.0 / 32) if @display_y >= @map.height - 12
    @parallax_x = x
    @parallax_y = y
  end

 
end # Game_Map

#==============================================================================
# ■ Spriteset_Map
#==============================================================================
class Spriteset_Map

  #--------------------------------------------------------------------------
  # overwrite method: create_viewports
  #--------------------------------------------------------------------------
  def create_viewports
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    @viewport1 = Viewport.new(dx, dy, dw, dh)
    @viewport2 = Viewport.new(dx, dy, dw, dh)
    @viewport3 = Viewport.new(dx, dy, dw, dh)
    @viewport2.z = 50
    @viewport3.z = 100
  end

  #--------------------------------------------------------------------------
  # new method: update_viewport_sizes
  #--------------------------------------------------------------------------
  def update_viewport_sizes
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    rect = Rect.new(dx, dy, dw, dh)
    for viewport in [@viewport1, @viewport2, @viewport3]
      viewport.rect = rect
    end
  end

end # Spriteset_Map

#-------------------------------------------------------------------------------
# FenixFyre's custom Plane, simply drawing a sprite. Needs to do something about
# the y-axis
#-------------------------------------------------------------------------------
class Plane
  attr_reader :ox, :oy
 
  alias :th_unlimited_resolution_initialize :initialize
  def initialize(viewport = nil)
    th_unlimited_resolution_initialize(viewport)
    @sprite = Sprite.new(viewport)
    @bitmap = nil
    @ox = 0
    @oy = 0
  end

  def method_missing(symbol, *args)
    @sprite.method(symbol).call(*args)
  end
 
  def bitmap=(bitmap)
    @bitmap = bitmap
    refresh
  end
 
  alias :th_unlimited_resolution_dispose :dispose
  def dispose
    th_unlimited_resolution_dispose
    @sprite.dispose if @sprite
    @sprite = nil
  end
 
  def bitmap
    @sprite.bitmap
  end
 
  def ox=(ox)
    w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width
    @ox = ox % w
    @sprite.ox = @ox
  end
 
  def oy=(oy)
    h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height
    @oy = oy % h
    @sprite.oy = @oy
  end
 
  def blend_type=(blend_type)
    @blend_type = blend_type
    @sprite.blend_type = blend_type
  end
 
  def opacity=(opacity)
    @opacity = opacity
    @sprite.opacity = opacity
  end
 
  def z=(z)
    @z = z
    @sprite.z = z
  end
 
  def tone=(tone)
    @tone = tone
    @sprite.tone = tone
  end
 
  def visible=(visible)
    @visible = visible
    @sprite.visible = visible
  end
 
  def refresh
    return if @bitmap.nil?
    w = @sprite.viewport != nil ? @sprite.viewport.rect.width : Graphics.width
    h = @sprite.viewport != nil ? @sprite.viewport.rect.height : Graphics.height
    if @sprite.bitmap != nil
      @sprite.bitmap.dispose
    end
    @sprite.bitmap = Bitmap.new(w * 2, h * 2)
      
    max_x = (w*2) / @bitmap.width
    max_y = (h*2) / @bitmap.height
            
    for x in 0..max_x
      for y in 0..max_y
        @sprite.bitmap.blt(x * @bitmap.width, y * @bitmap.height,
         @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height))
      end
    end

  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map < Scene_Base

  #--------------------------------------------------------------------------
  # alias method: post_transfer
  #--------------------------------------------------------------------------
  alias scene_map_post_transfer_ace post_transfer
  def post_transfer
    @spriteset.update_viewport_sizes
    scene_map_post_transfer_ace
  end

end # Scene_Map

I couldn't figure out yet how to make camera centred on player with no depending on tiles' size, and without using Raizen's script with smooth camera sliding.
I was also thinking about making game menu that doesn't fit to the screen's size, I mean make menu with desired size being maintained regardless of the screen size. I didn't try to make any changes yet, but I believe that'll be easy.
I finally made something I wanted. I made update on script I had to edit. There'll be fixed unknown scripter's code with correct tiles' drawing in custom resolutions (I fixed it incorrectly earlier), latest version of FenixFyre's Plane script (1.3.5) that fixes parallax movement in custom resolutions and some changed default scripts... They are blurry battle background that depends of user's resolution, centred Game Over screen on various resolutions, and, finally, centred camera on player with no depending on tiles' size (that means I'm not going to use Raizen's camera scrolling script anymore).

Ruby:
=begin
================================================================================
 Title: Unlimited Resolution
 Date: Jun 6, 2014
--------------------------------------------------------------------------------
 ** Change log
 Nov 12, 2025
   - Timofey Rusanov: adapted script with overcoming the 640x480 limitation to
     make support of non 32 multipile resolutions with borrowed part of Gabz's
     code. Updated Esrever's code with borrowed Yanfly's code. Combined
     Esrever's code with code from wltr3565 to make bottom of the maps not to
     show up some upmost part of the maps. Made right side of the maps not to
     show up some leftmost part of the maps with changing part of the code from
     wltr3565. Borrowed Yanfly's codes for determining the distance of the
     events to the player relative to the center of the screen and for making
     battlers centred on the screen. Made blurry battle background dependable
     on user's resolution. Made Game Over screen centered. Updated FenixFyre's
     Plane code with latest version (1.3.5) of script. Made camera always
     centered with custom resolutions.
 Jun 6, 2014
   - Kaelan: fixed several bugs in the Plane class which prevented the sprite
     from being modified correctly. Patched for compatibility with Victor's
     Fogs and Overlays script. Include this after his script.
 Apr 20, 2014
   - added Kaelan's suggestion for disposing the viewport when done with it
 Nov 6, 2013
   - added some plane modifications to fix parallax images
 Oct 24, 2013
   - Initial release
--------------------------------------------------------------------------------
 ** Terms of Use
 * Free
--------------------------------------------------------------------------------
 ** Description
 
 This script modifies Graphics.resize_screen to overcome the 640x480 limitation.
 It also includes some code to properly display maps that are smaller than the
 screen size.
 
 Now you can have arbitrarily large game resolutions.
 
--------------------------------------------------------------------------------
 ** Installation
 
 You should place this script above all custom scripts
 
--------------------------------------------------------------------------------
 ** Usage

 As usual, simply resize your screen using the script call
 
   Graphics.resize_screen(width, height)

--------------------------------------------------------------------------------
 ** Credits
 
 Unknown author, for overcoming the 640x480 limitation
 Lantier (from RMW forums), for posting the snippet above
 Esrever, for handling the viewport (borrowed from Yanfly's script)
 Jet, for the custom Graphics code
 FenixFyre, for the Plane class fix
 Kaelan, for several bug fixes
 Tsukihime (known as Hime formerly), for gathering various scripts and fixes
 wltr3565, for map scroll glitch fix
 Gabz, for some fix from overcoming the 640x480 limitation script
 Timofey Rusanov, for updating some old scripts, gathering and combining other
 ones and making edit on some scripts.
 Yanfly, for their part of Core Engine Ace script

================================================================================
=end

$imported = {} if $imported.nil?
$imported["TH_UnlimitedResolution"] = true

#===============================================================================
# ** Configuration
#===============================================================================

class << SceneManager
 
  alias resolution_run run
  def run(*args, &block)
    Graphics.ensure_sprite
    resolution_run(*args, &block)
  end
end

module Graphics
 
  @@super_sprite = Sprite.new
  @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1)
 
  class << self
    alias :th_large_screen_resize_screen :resize_screen
 
    def freeze(*args, &block)
      @@super_sprite.bitmap = snap_to_bitmap
    end
 
    def transition(time = 10, filename = nil, vague = nil)
      if filename
        @@super_sprite.bitmap = Bitmap.new(filename)
      end
      @@super_sprite.opacity = 255
      incs = 255.0 / time
      time.times do |i|
        @@super_sprite.opacity = 255.0 - incs * i
        Graphics.wait(1)
      end
      @@super_sprite.bitmap.dispose if @@super_sprite.bitmap
      reform_sprite_bitmap
      Graphics.brightness = 255
    end
 
    def reform_sprite_bitmap
      @@super_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
      @@super_sprite.bitmap.fill_rect(@@super_sprite.bitmap.rect, Color.new(0, 0, 0, 255))
    end
 
    def fadeout(frames)
      incs = 255.0 / frames
      frames.times do |i|
        i += 1
        Graphics.brightness = 255 - incs * i
        Graphics.wait(1)
      end
    end
 
    def fadein(frames)
      incs = 255.0 / frames
      frames.times do |i|
        Graphics.brightness = incs * i
        Graphics.wait(1)
      end
    end

    def brightness=(i)
      @@super_sprite.opacity = 255.0 - i
    end
 
    def brightness
      255 - @@super_sprite.opacity
    end
 
    def ensure_sprite
      if @@super_sprite.disposed?
        @@super_sprite = Sprite.new
        @@super_sprite.z = (2 ** (0.size * 8 - 2) - 1)
        reform_sprite_bitmap
      end
    end
  end
 
  #-----------------------------------------------------------------------------
  # Unknown Scripter. Copied from http://pastebin.com/sM2MNJZj
  #-----------------------------------------------------------------------------
  def self.resize_screen(width, height)
    wt, ht = width.divmod(32), height.divmod(32)
    #wt.last + ht.last == 0 || fail('Incorrect width or height')
    wh = -> w, h, off = 0 { [w + off, h + off].pack('l2').scan /.{4}/ }
    w, h = wh.(width, height)
    ww, hh = wh.(width, height, 32)
    www, hhh = wh.(wt.first.succ, ht.first.succ, 1)
    base = 0x10000000  # fixed?
    mod = -> adr, val { DL::CPtr.new(base + adr)[0, val.size] = val }
    mod.(0x195F, "\x90" * 5)  # ???
    mod.(0x19A4, h)
    mod.(0x19A9, w)
    mod.(0x1A56, h)
    mod.(0x1A5B, w)
    mod.(0x20F6, w)
    mod.(0x20FF, w)
    mod.(0x2106, h)
    mod.(0x210F, h)
    # speed up y?
    #mod.(0x1C5E3, h)
    #mod.(0x1C5E8, w)
    zero = [0].pack ?l
    mod.(0x1C5E3, zero)
    mod.(0x1C5E8, zero)
    mod.(0x1F477, h)
    mod.(0x1F47C, w)
    mod.(0x211FF, hh)
    mod.(0x21204, ww)
    mod.(0x21D7D, hhh[0])
    mod.(0x21E01, www[0])
    #mod.(0x10DEA8, h)
    #mod.(0x10DEAD, w)
    mod.(0x10DEDF, h)
    mod.(0x10DEF0, w)
    mod.(0x10DF14, h)
    mod.(0x10DF18, w)
    mod.(0x10DF48, h)
    mod.(0x10DF4C, w)
    #mod.(0x10E6A7, w)
    #mod.(0x10E6C3, h)
    mod.(0x10EEA9, w)
    mod.(0x10EEB9, h)
    th_large_screen_resize_screen(width, height)
  end
end

#===============================================================================
# Esrever's code from
# http://www.rpgmakervxace.net/topic/100-any-chance-of-higher-resolution-or-larger-sprite-support/page-2#entry7997
#===============================================================================

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map

  #--------------------------------------------------------------------------
  # overwrite method: scroll_down
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    last_y = @display_y
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance if @parallax_loop_y
    else
      dh = Graphics.height > height * 32 ? height : screen_tile_y + Graphics.height % 32 * 1.0 / 32
      @display_y = [@display_y + distance, height - dh].min
      @parallax_y += @display_y - last_y
    end
    @fog_y += loop_vertical? ? distance : @display_y - last_y if @fog_y
  end

  #--------------------------------------------------------------------------
  # overwrite method: scroll_right
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    last_x = @display_x
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance if @parallax_loop_x
    else
      dw = Graphics.width > width * 32 ? width : screen_tile_x + Graphics.width % 32 * 1.0 / 32
      @display_x = [@display_x + distance, width - dw].min
      @parallax_x += @display_x - last_x
    end
    @fog_x += loop_horizontal? ? distance : @display_x - last_x if @fog_x
  end

  #--------------------------------------------------------------------------
  # overwrite method: set_display_pos
  #--------------------------------------------------------------------------
  def set_display_pos(x, y)
    x = [0, [x, width - screen_tile_x].min].max unless loop_horizontal?
    y = [0, [y, height - screen_tile_y].min].max unless loop_vertical?
    @display_x = (x + width) % width
    @display_y = (y + height) % height
    @display_x = (x + width) % width - (Graphics.width % 32 * 1.0 / 32) if @display_x >= @map.width - 12
    @display_y = (y + height) % height - (Graphics.height % 32 * 1.0 / 32) if @display_y >= @map.height - 12
    @parallax_x = x
    @parallax_y = y
  end

end # Game_Map

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map

  #--------------------------------------------------------------------------
  # overwrite method: create_viewports
  #--------------------------------------------------------------------------
  def create_viewports
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    @viewport1 = Viewport.new(dx, dy, dw, dh)
    @viewport2 = Viewport.new(dx, dy, dw, dh)
    @viewport3 = Viewport.new(dx, dy, dw, dh)
    @viewport2.z = 50
    @viewport3.z = 100
  end

  #--------------------------------------------------------------------------
  # new method: update_viewport_sizes
  #--------------------------------------------------------------------------
  def update_viewport_sizes
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    rect = Rect.new(dx, dy, dw, dh)
    for viewport in [@viewport1, @viewport2, @viewport3]
      viewport.rect = rect
    end
  end

end # Spriteset_Map

#-------------------------------------------------------------------------------
# FenixFyre's custom Plane, simply drawing a sprite. It's an updated version
# that have no problems with parallaxes in custom resolutions.
#-------------------------------------------------------------------------------

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# To remove any artifacts / conflicts with the original, we alias it then remove
# the original tie.
RGSS3Plane = Plane
Object.send(:remove_const, :Plane)
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Rect#to_a
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class Rect
  def to_a
    [self.x, self.y, self.width, self.height]
  end
end
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Bitmap
#   Saves a bitmap's name, for future reference.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class Bitmap
  alias fyx_initialize_save_name initialize
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # initialize
  #   Instantiate a bitmap's name, if given one.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def initialize(*argv, &argb)
    @name = ''
    if name = argv.find {|arg| arg.is_a?(String) }
      @name = name
    end
    fyx_initialize_save_name(*argv, &argb)
  end
  attr_reader :name
end
 
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Cache
#   Add in Plane caching, to speed up processing at the slight cost of memory.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
module Cache
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # Cache::plane_cache
  #   Convenience method, to not have to type it out in the below methods.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def self.plane_cache
    @plane_cache ||= {}
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # Cache::plane
  #   Get a cached plane bitmap.
  #   key : Object  ( most likely an Array e.g. [Rect, String] )
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def self.plane(key)
    return plane_cache[key]
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # Cache::add_plane
  #   Add a tiled plane bitmap to the cache.
  #   key : Object ( see above )
  #   bmp : Bitmap
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def self.add_plane(key, bmp)
    plane_cache[key] = bmp
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # Cache::has_plane?
  #   Check for a cached plane bitmap.
  #   key : Object ( see above )
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def self.has_plane?(key)
    plane_cache[key].is_a?(Bitmap) && !plane_cache[key].disposed?
  end
 
  class << self; alias clear_b4_fyx_plane_cache clear; end
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # Cache::clear
  #   See original documentation.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def self.clear
    plane_cache.each_value {|v| v.dispose unless v.nil? || v.disposed? }
    plane_cache.clear
    clear_b4_fyx_plane_cache
  end
end
 
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Plane
#   Tiles a bitmap across either the window rect, or a given viewport's rect.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class Plane
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # initialize
  #   Setup an allocated instance of Plane.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def initialize(v = nil)
    @sprite = Sprite.new(v)
    @bitmap = nil
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # dispose
  #   Free an instance of Plane.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def dispose
    @sprite.bitmap.dispose unless bitmap_disposed?
    @sprite.dispose unless disposed?
    return nil
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # bitmap_disposed?
  #   Check whether this instance of Plane's bitmap has been freed.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def bitmap_disposed?
    disposed? || @sprite.bitmap.nil? || @sprite.bitmap.disposed?
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # disposed?
  #   Check whether this instance of Plane has been freed.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def disposed?
    @sprite.nil? || @sprite.disposed?
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # ox=
  #   Set the offset x of this instance of Plane.
  #   val : Integer
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def ox=(val)
    error_disposed if disposed?
    return if bitmap_disposed?
 
    @sprite.ox = (val % (@bitmap.nil? ? 1 : @bitmap.width))
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # oy=
  #   Set the offset y of this instance of Plane.
  #   val : Integer
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def oy=(val)
    error_disposed if disposed?
    return if bitmap_disposed?
 
    @sprite.oy = (val % (@bitmap.nil? ? 1 : @bitmap.height))
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # bitmap
  #   Get the tile bitmap of this instance of Plane.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def bitmap
    @bitmap
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # viewport=
  #   Set the viewport, and refresh if the vrect has changed.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def viewport=(v)
    error_disposed if disposed?
    r = v.nil? ? Rect.new(0, 0, Graphics.width, Graphics.height) : v.rect
    b = r != vrect
    ret = @sprite.viewport = v
    self.bitmap = @bitmap if b
    return ret
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # bitmap=
  #   Set the tile bitmap of this instance of Plane.
  #   bmp : Bitmap
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def bitmap=(bmp)
    error_disposed if disposed?
    if bmp.nil?
      @sprite.bitmap = nil
      return @bitmap = nil
    end
 
    w, h = vrect.width, vrect.height
 
    nw = bmp.width <= 100 ? 2 : 3
    nh = bmp.height <= 100 ? 2 : 3
 
    dx = [(w / bmp.width).ceil, 1].max * nw
    dy = [(h / bmp.height).ceil, 1].max * nh
 
    bw = dx * bmp.width
    bh = dy * bmp.height
 
    @bitmap = bmp
    key = [vrect.to_a, bmp.name]
    if Cache.has_plane?(key)
      @sprite.bitmap = Cache.plane(key)
    else
      @sprite.bitmap = Bitmap.new(bw, bh)
 
      dx.times do |x|
        dy.times do |y|
          @sprite.bitmap.blt(x * bmp.width, y * bmp.height, @bitmap, @bitmap.rect)
        end
      end
      Cache.add_plane(key, @sprite.bitmap)
    end
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # method_missing
  #   Here we let any methods not found in this class be redirected to our
  #   underlying sprite.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def method_missing(sym, *argv, &argb)
    if @sprite.respond_to?(sym)
      error_disposed if disposed?
      return @sprite.send(sym, *argv, &argb)
    end
    super(sym, *argv, &argb)
  end
 
  # private methods from here down
  private
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # error_disposed
  #   If this plane (and it's underlying sprite) has been freed, then throw an
        #   RGSSError describing a disposed Plane.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def error_disposed
    raise RGSSError, 'disposed Plane', caller
  end
 
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # vrect
  #   Get the view rect of this instance of Plane, which depends on if the
  #   viewport has been set or not.
  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  def vrect
    @sprite.viewport.nil? ? Rect.new(0, 0, Graphics.width, Graphics.height) :
    @sprite.viewport.rect
  end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base

  #--------------------------------------------------------------------------
  # alias method: post_transfer
  #--------------------------------------------------------------------------
  alias scene_map_post_transfer_ace post_transfer
  def post_transfer
    @spriteset.update_viewport_sizes
    scene_map_post_transfer_ace
  end

end # Scene_Map

#-------------------------------------------------------------------------------
# Some Yanfly's codes
#-------------------------------------------------------------------------------

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character
 
  #--------------------------------------------------------------------------
  # overwrite method: near_the_screen?
  #--------------------------------------------------------------------------
  def near_the_screen?(dx = nil, dy = nil)
    dx = [Graphics.width, $game_map.width * 256].min/32 - 5 if dx.nil?
    dy = [Graphics.height, $game_map.height * 256].min/32 - 5 if dy.nil?
    ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
    ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
    ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  end
 
end # Game_Event

#==============================================================================
# ■ Game_Troop
#==============================================================================

class Game_Troop < Game_Unit
 
  #--------------------------------------------------------------------------
  # overwrite method: setup
  #--------------------------------------------------------------------------
  def setup(troop_id)
    clear
    @troop_id = troop_id
    @enemies = []
    troop.members.each do |member|
      next unless $data_enemies[member.enemy_id]
      enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
      enemy.hide if member.hidden
      enemy.screen_x = member.x + (Graphics.width - 544)/2
      enemy.screen_y = member.y + (Graphics.height - 416)
      @enemies.push(enemy)
    end
    init_screen_tone
    make_unique_names
  end
 
end # Game_Troop

#==============================================================================
# ** CHANGED Game_Player
#------------------------------------------------------------------------------
#  This one's making camera centred in any screen resolution.
#==============================================================================

class Game_Player < Game_Character

  def center_x
    (Graphics.width / 2 - 16) / 32.0
  end

  def center_y
    (Graphics.height / 2 - 16) / 32.0
  end

end

#==============================================================================
# ** CHANGED Spriteset_Battle
#------------------------------------------------------------------------------
#  This one's making blurry background for any screen resolution.
#==============================================================================

class Spriteset_Battle

  def create_blurry_background_bitmap
    source = SceneManager.background_bitmap
    bitmap = Bitmap.new(Graphics.width, Graphics.height)
    bitmap.stretch_blt(bitmap.rect, source, source.rect)
    bitmap.radial_blur(120, 16)
    bitmap
  end

end

#==============================================================================
# ** CHANGED Scene_Gameover
#------------------------------------------------------------------------------
#  This is for higher resolutions.
#==============================================================================

class Scene_Gameover < Scene_Base

  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("GameOver")
    center_sprite(@sprite)
  end

  def center_sprite(sprite)
    sprite.ox = sprite.bitmap.width / 2
    sprite.oy = sprite.bitmap.height / 2
    sprite.x = Graphics.width / 2
    sprite.y = Graphics.height / 2
  end

end

Honestly, that script is still not finished, it's all because of broken freeze and transition effects in custom Graphics code from Jet. It can be seen when battle starts. Frozen picture turns into black screen, and transition effect shows something like alpha mask.
Their script is still available here. It'll be pleasure if somebody are going to fix that bug.
If it's not hard, I'd also like to see transition effect centred on screen with highest resolution.

And what I talked about early, windows' size in 640 pixels...

Ruby:
##############
# Pause Menu #
##############

class Window_MenuCommand < Window_Command

  def initialize
    super(0, 0)
    update_placement
    select_last
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -240
  end

end

class Scene_Menu < Scene_MenuBase

  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.x = Graphics.width / 2 -160 - @gold_window.width
    @gold_window.y = Graphics.height - @gold_window.height
  end

end

class Window_MenuStatus < Window_Selectable

  def initialize(x, y)
    super(x, y, window_width, window_height)
    update_placement
    @pending_index = -1
    refresh
  end

  def window_width
    return 480
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 +80
  end

end

###############
# Help Window #
###############

class Window_Help < Window_Base

  def initialize(line_number = 2)
    super(0, 0, 640, fitting_height(line_number))
    update_placement
  end

  def update_placement
    self.x = (Graphics.width - width) / 2
  end

end

##############
# Items Menu #
##############

class Window_ItemCategory < Window_HorzCommand

  def initialize
    super(0, 0)
    update_placement
  end

  def window_width
    return 640
  end

  def update_placement
    self.x = (Graphics.width - width) / 2
  end

end

class Window_ItemList < Window_Selectable

  def initialize(x, y, width, height)
    super
    update_placement
    @category = :none
    @data = []
  end

  def update_placement
    self.width = 640
    self.x = (Graphics.width - width) / 2
  end

end

###############
# Skills Menu #
###############

class Window_SkillCommand < Window_Command

  def initialize(x, y)
    super(x, y)
    update_placement
    @actor = nil
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -240
  end

end

class Window_SkillStatus < Window_Base

  def initialize(x, y)
    super(x, y, window_width, fitting_height(4))
    update_placement
    @actor = nil
  end

  def window_width
    return 480
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 +80
  end

end

class Window_SkillList < Window_Selectable

  def initialize(x, y, width, height)
    super
    update_placement
    @actor = nil
    @stype_id = 0
    @data = []
  end

  def update_placement
    self.width = 640
    self.x = (Graphics.width - width) / 2
  end

end

##################
# Equipment Menu #
##################

class Window_EquipStatus < Window_Base

  def initialize(x, y)
    super(x, y, window_width, window_height)
    update_placement
    @actor = nil
    @temp_actor = nil
    refresh
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -216
  end

end

class Window_EquipCommand < Window_HorzCommand

  def initialize(x, y, width)
    super(x, y)
    update_placement
  end

  def window_width
    return 432
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 +104
  end

end

class Window_EquipSlot < Window_Selectable

  def initialize(x, y, width)
    super(x, y, width, window_height)
    update_placement
    @actor = nil
    refresh
  end

  def update_placement
    self.width = 432
    create_contents
    self.x = (Graphics.width - width) / 2 +104
  end

end

###############
# Status Menu #
###############

class Window_Status < Window_Selectable

  def initialize(actor)
    super(0, 0, 640, Graphics.height)
    update_placement
    @actor = actor
    refresh
    activate
  end

  def update_placement
    self.x = (Graphics.width - width) / 2
  end

end

#############
# Save Menu #
#############

class Window_SaveFile < Window_Base

  def initialize(height, index)
    super(0, index * height, 640, height)
    update_placement
    @file_index = index
    refresh
    @selected = false
  end

  def update_placement
    self.x = (Graphics.width - width) / 2
  end

end

############
# Messages #
############

class Window_Message < Window_Base
 
  def update_placement
    self.width = 640
    create_contents
    self.x = (Graphics.width - self.width) / 2
    @position = $game_message.position
    self.y = @position * (Graphics.height - height) / 2
    @gold_window.y = y > 0 ? 0 : Graphics.height - @gold_window.height
  end

end

##########
# Choice #
##########

class Window_ChoiceList < Window_Command

  def update_placement
    self.width = [max_choice_width + 12, 96].max + padding * 2
    self.width = [width, Graphics.width].min
    self.height = fitting_height($game_message.choices.size)
    self.x = Graphics.width / 2 +320 - width
    if @message_window.y >= Graphics.height / 2
      self.y = @message_window.y - height
    else
      self.y = @message_window.y + @message_window.height
    end
  end

end

############
# Key Item #
############

class Window_KeyItem < Window_ItemList

  def initialize(message_window)
    @message_window = message_window
    super(0, 0, 640, fitting_height(4))
    self.openness = 0
    deactivate
    set_handler(:ok,     method(:on_ok))
    set_handler(:cancel, method(:on_cancel))
  end

  def update_placement
    self.x = (Graphics.width - self.width) / 2
    if @message_window.y >= Graphics.height / 2
      self.y = 0
    else
      self.y = Graphics.height - height
    end
  end

end

#####################
# Message Scrolling #
#####################

class Window_ScrollText < Window_Base

  def initialize
    super(0, 0, 640, Graphics.height)
    self.x = (Graphics.width - self.width) / 2
    self.opacity = 0
    self.arrows_visible = false
    hide
  end

end

#########
# Timer #
#########

class Sprite_Timer < Sprite
  def update_position
    self.x = Graphics.width / 2 +320 - self.bitmap.width
    self.y = 0
    self.z = 200
  end
end

############
# Map Name #
############

class Window_MapName < Window_Base

  def initialize
    super(0, 0, window_width, fitting_height(1))
    update_placement
    self.opacity = 0
    self.contents_opacity = 0
    @show_count = 0
    refresh
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -200
  end

end

########################################
# Commands for the Party in the Battle #
########################################

class Window_PartyCommand < Window_Command

  def initialize
    super(0, 0)
    update_placement
    self.openness = 0
    deactivate
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -256
  end

end

###########################################################
# Drawing of Party Members and Their Status in the Battle #
###########################################################

class Window_BattleStatus < Window_Selectable

  def initialize
    super(0, 0, window_width, window_height)
    update_placement
    refresh
    self.openness = 0
  end

  def window_width
    return 512
  end

  def update_placement
    self.x = Graphics.width / 2
  end

end

class Window_Base < Window
 
  def draw_actor_icons(actor, x, y, width = 96)
    icons = (actor.state_icons + actor.buff_icons)[0, 2]
    icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  end

end

###################################
# Certain Actions for Chosen Hero #
###################################

class Scene_Battle < Scene_Base
 
    def create_status_window
    @status_window = Window_BattleStatus.new
    @status_window.x = Graphics.width / 2 -192
  end
 
  def create_actor_command_window
    @actor_command_window = Window_ActorCommand.new
    @actor_command_window.viewport = @info_viewport
    @actor_command_window.set_handler(:attack, method(:command_attack))
    @actor_command_window.set_handler(:skill,  method(:command_skill))
    @actor_command_window.set_handler(:guard,  method(:command_guard))
    @actor_command_window.set_handler(:item,   method(:command_item))
    @actor_command_window.set_handler(:cancel, method(:prior_command))
    @actor_command_window.x = Graphics.width / 2 +320
  end

end

################
# Enemy Select #
################

class Window_BattleEnemy < Window_Selectable

  def initialize(info_viewport)
    super(0, info_viewport.rect.y, window_width, fitting_height(4))
    refresh
    self.visible = false
    @info_viewport = info_viewport
  end

  def window_width
    return 512
  end

  def show
    if @info_viewport
      width_remain = Graphics.width / 2 +320 - width
      self.x = width_remain
      @info_viewport.rect.width = width_remain
      select(0)
    end
    super
  end

end

#############################################
# Descriptions of the Actions in the Battle #
#############################################

class Window_BattleLog < Window_Selectable

  def initialize
    super(0, 0, window_width, window_height)
    update_placement
    self.z = 200
    self.opacity = 0
    @lines = []
    @num_wait = 0
    create_back_bitmap
    create_back_sprite
    refresh
  end

  def window_width
    return 640
  end

  def create_back_sprite
    @back_sprite = Sprite.new
    @back_sprite.bitmap = @back_bitmap
    @back_sprite.x = Graphics.width / 2 -320
    @back_sprite.y = y
    @back_sprite.z = z - 1
  end

  def update_placement
    self.x = (Graphics.width - width) / 2
  end

end

########
# Shop #
########

class Window_ShopCommand < Window_HorzCommand

  def initialize(window_width, purchase_only)
    @purchase_only = purchase_only
    super(0, 0)
    update_placement
  end

  def window_width
    return 480
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -80
  end

end

class Scene_Shop < Scene_MenuBase

  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.viewport = @viewport
    @gold_window.x = Graphics.width / 2 +320 - @gold_window.width
    @gold_window.y = @help_window.height
  end

  def create_dummy_window
    wy = @command_window.y + @command_window.height
    wh = Graphics.height - wy
    @dummy_window = Window_Base.new(0, wy, 640, wh)
    @dummy_window.x = Graphics.width / 2 -320
    @dummy_window.viewport = @viewport
  end

end

class Window_ShopBuy < Window_Selectable

  def initialize(x, y, height, shop_goods)
    super(x, y, window_width, height)
    update_placement
    @shop_goods = shop_goods
    @money = 0
    refresh
    select(0)
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -168
  end

end

class Window_ShopNumber < Window_Selectable

  def initialize(x, y, height)
    super(x, y, window_width, height)
    update_placement
    @item = nil
    @max = 1
    @price = 0
    @number = 1
    @currency_unit = Vocab::currency_unit
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -168
  end

end

class Window_ShopStatus < Window_Base

  def initialize(x, y, width, height)
    super(x, y, width, height)
    update_placement
    @item = nil
    @page_index = 0
    refresh
  end

  def update_placement
    self.width = 336
    create_contents
    self.x = (Graphics.width - width) / 2 +152
  end

end

##############
# Debug Menu #
##############

class Window_DebugLeft < Window_Selectable

  def initialize(x, y)
    super(x, y, window_width, window_height)
    update_placement
    refresh
    self.top_row = @@last_top_row
    select(@@last_index)
    activate
  end

  def update_placement
    self.x = (Graphics.width - width) / 2 -238
  end

end

class Scene_Debug < Scene_MenuBase

  def create_right_window
    wx = Graphics.width / 2 -156
    @right_window = Window_DebugRight.new(wx, 0, 476)
    @right_window.set_handler(:cancel, method(:on_right_cancel))
    @left_window.right_window = @right_window
  end

end

Along with them I'm using Resolution Selection script from Dekita that I've set up for using 640x480, 640x360 and 854x480 resolutions, and Fullscreen++ script form Zeus81 to resize the game screen to fit my monitor's resolution. I also used Full Screen Promt from Bigace360 and combined it with Dekita's script to make another option in title screen, to switch between windowed and fullscreen modes (there are combinations of Alt+Enter option named legacy and modern option with Fullscreen++ from Zeus81).
At the end of the work I do plan on publish demo project in Steam Workshop, for those who'll need to make/play games with 16:9 support/resolution.
I already made demo and it can be downloaded from here -

It's only beta version, because there still are some issues, and I'm not sure I'm gonna fix them so soon (it's all because I'm bad in scripting).
If you didn't understand something during the checking my demo, sorry, I'm not perfect in English yet.

If someone's reading it, I'd like to see this thread somewhere in Ruby Game System (RGSS) Scripts. Can somebody please move this thread?
"Bug" Report: Works using your Game.ConfigSettings but throws an error using any other one.
Clip.JPG

Solution: Copy demo config to own project.

Notes:
Clip2.JPG

Therefore view distance has been extended vertically as well as horizontally.
Edit: 27x15 > 26.5x15, turns out to be slightly smaller.
I suppose I found out how to fix it.
Lines 90 and 91 need to be changed to...

Ruby:
  sprite.ox = sprite.width / 2
  sprite.oy = sprite.height / 2

I've moved this thread to RGSSx Scripts In Development. Thank you.

@Timofey_Rusanov If you want a thread moved in the future, please report it so that a mod is sure to see your request.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-16-9-support.175409/