'
'                           ___________________________________________
'         _______ _ _ _     \___           ___________________________/
'    /\  (_______) (_) |       /  //  //  /  
'   /  \  _  __  | |_| | _    /  //  //  / << version 0.86 alpha test >>
'  / /\ \| |(__| | | | || \  /  //  //  /  For FreeBASIC (v0.20b or later).
' | |__| | |     | | | |_) )/  //  //  /     
' |_|  |_|_|     |_|_|____//  //  //  /   Original Development by
'  _______________________/  //  //  /___ Adigun Azikiwe Polack for Aura Flow.
' /_____________________________________/
'
'  A  u  r  a      F  l  o  w      L  i  b  r  a  r  y      3
'_________________________________________________________________________
'
' (c)2005-2016 Adigun Azikiwe Polack/Aura Flow.  All Rights Reserved.
'
'
'
'    ____            _           ___  _  __    __  ___          __      __   
'   / __ \___  _____(_)___  ___ |__ \| |/ /   /  |/  /___  ____/ /_  __/ /__ 
'  / /_/ / _ \/ ___/ /_  / / _ \__/ /|   /   / /|_/ / __ \/ __  / / / / / _ \
' / _, _/  __(__  ) / / /_/  __/ __//   |   / /  / / /_/ / /_/ / /_/ / /  __/
'/_/ |_|\___/____/_/ /___/\___/____/_/|_|  /_/  /_/\____/\__,_/\__,_/_/\___/ 
'                                                                            
'
'_________________________________________________________________________
'                        ----- N O T I C E -----
'_________________________________________________________________________
' The following is this piece of source code to this version of AFlib III.
' You are free to look at it to give you some inspiring ideas in your own
' programming in FreeBASIC, but you are *never* to even change or adjust
' any of this source code whatsoever in any way, shape, or form at all.
' EVER.  ;)
'
' The reason for this is to ensure that all of the routines in this source
' code are working as properly as they should in FreeBASIC v0.20b or
' newer.  That is all.
'
' With that said, do enjoy the library and be inspired even more
' greatly than ever!!!  (^-^)//
'_________________________________________________________________________
'
'Special Thanks to Mysoft for the AWESOME Scale2X conversions to FB for
'many sorts of common full-screen graphics modes from 320x200 all the way
'up to 1920x1080 HD, all in 15-, 16-, 24-, and 32-bit color!!!  ;) !!

#include once "fbgfx.bi"
ScreenControl(FB.SET_DRIVER_NAME, "GDI")

Const R2X_GFXres_X_320 = 320
Const R2X_GFXres_Y_200 = 200
Const R2X_GFXres_Y_240 = 240
'_________________________________________________________________________
Const R2X_GFXres_X_400 = 400
Const R2X_GFXres_Y_300 = 300
'_________________________________________________________________________
Const R2X_GFXres_X_512 = 512
Const R2X_GFXres_Y_384 = 384
'_________________________________________________________________________
Const R2X_GFXres_X_640 = 640
Const R2X_GFXres_Y_400 = 400
Const R2X_GFXres_Y_480 = 480
'_________________________________________________________________________
Const R2X_GFXres_X_720 = 720
'_________________________________________________________________________
Const R2X_GFXres_Y_576 = 576
'_________________________________________________________________________
Const R2X_GFXres_X_800 = 800
Const R2X_GFXres_Y_600 = 600
'_________________________________________________________________________
Const R2X_GFXres_X_1024 = 1024
Const R2X_GFXres_Y_768 = 768
'_________________________________________________________________________
Const R2X_GFXres_X_1152 = 1152
Const R2X_GFXres_Y_864 = 864
'_________________________________________________________________________
Const R2X_GFXres_X_1280 = 1280
Const R2X_GFXres_Y_720 = 720
Const R2X_GFXres_Y_800 = 800
Const R2X_GFXres_Y_960 = 960
Const R2X_GFXres_Y_1024 = 1024
'_________________________________________________________________________
Const R2X_GFXres_X_1360 = 1360
'_________________________________________________________________________
Const R2X_GFXres_X_1440 = 1440
Const R2X_GFXres_Y_900 = 900
'_________________________________________________________________________
Const R2X_GFXres_X_1600 = 1600
'_________________________________________________________________________
Const R2X_GFXres_Y_1200 = 1200
'_________________________________________________________________________
Const R2X_GFXres_X_1680 = 1680
Const R2X_GFXres_Y_1050 = 1050
'_________________________________________________________________________
Const R2X_GFXres_X_1920 = 1920
Const R2X_GFXres_Y_1080 = 1080



'-----------------------------------------------------

#define R2X_X_320x200 (R2X_GFXres_X_320 / 2)
#define R2X_Y_320x200 (R2X_GFXres_Y_200 / 2)

#define R2X_X_320x240 (R2X_GFXres_X_320 / 2)
#define R2X_Y_320x240 (R2X_GFXres_Y_240 / 2)

#define R2X_X_400x300 (R2X_GFXres_X_400 / 2)
#define R2X_Y_400x300 (R2X_GFXres_Y_300 / 2)

#define R2X_X_512x384 (R2X_GFXres_X_512 / 2)
#define R2X_Y_512x384 (R2X_GFXres_Y_384 / 2)

#define R2X_X_640x400 (R2X_GFXres_X_640 / 2)
#define R2X_Y_640x400 (R2X_GFXres_Y_400 / 2)

#define R2X_X_640x480 (R2X_GFXres_X_640 / 2)
#define R2X_Y_640x480 (R2X_GFXres_Y_480 / 2)

#define R2X_X_720x480 (R2X_GFXres_X_720 / 2)
#define R2X_Y_720x480 (R2X_GFXres_Y_480 / 2)

#define R2X_X_720x576 (R2X_GFXres_X_720 / 2)
#define R2X_Y_720x576 (R2X_GFXres_Y_576 / 2)

#define R2X_X_800x600 (R2X_GFXres_X_800 / 2)
#define R2X_Y_800x600 (R2X_GFXres_Y_600 / 2)

#define R2X_X_1024x768 (R2X_GFXres_X_1024 / 2)
#define R2X_Y_1024x768 (R2X_GFXres_Y_768 / 2)

#define R2X_X_1152x864 (R2X_GFXres_X_1152 / 2)
#define R2X_Y_1152x864 (R2X_GFXres_Y_864 / 2)

#define R2X_X_1280x600 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x600 (R2X_GFXres_Y_600 / 2)

#define R2X_X_1280x720 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x720 (R2X_GFXres_Y_720 / 2)

#define R2X_X_1280x768 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x768 (R2X_GFXres_Y_768 / 2)

#define R2X_X_1280x800 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x800 (R2X_GFXres_Y_800 / 2)

#define R2X_X_1280x960 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x960 (R2X_GFXres_Y_960 / 2)

#define R2X_X_1280x1024 (R2X_GFXres_X_1280 / 2)
#define R2X_Y_1280x1024 (R2X_GFXres_Y_1024 / 2)

#define R2X_X_1360x768 (R2X_GFXres_X_1360 / 2)
#define R2X_Y_1360x768 (R2X_GFXres_Y_768 / 2)

#define R2X_X_1440x900 (R2X_GFXres_X_1440 / 2)
#define R2X_Y_1440x900 (R2X_GFXres_Y_900 / 2)

#define R2X_X_1600x900 (R2X_GFXres_X_1600 / 2)
#define R2X_Y_1600x900 (R2X_GFXres_Y_900 / 2)

#define R2X_X_1600x1200 (R2X_GFXres_X_1600 / 2)
#define R2X_Y_1600x1200 (R2X_GFXres_Y_1200 / 2)

#define R2X_X_1680x1050 (R2X_GFXres_X_1680 / 2)
#define R2X_Y_1680x1050 (R2X_GFXres_Y_1050 / 2)

#define R2X_X_1920x1080 (R2X_GFXres_X_1920 / 2)
#define R2X_Y_1920x1080 (R2X_GFXres_Y_1080 / 2)

'-----------------------------------------------------

#define R3X_X_720x480 (R2X_GFXres_X_720 / 3)
#define R3X_Y_720x480 (R2X_GFXres_Y_480 / 3)

#define R3X_X_720x576 (R2X_GFXres_X_720 / 3)
#define R3X_Y_720x576 (R2X_GFXres_Y_576 / 3)

#define R3X_X_1152x864 (R2X_GFXres_X_1152 / 3)
#define R3X_Y_1152x864 (R2X_GFXres_Y_864 / 3)

#define R3X_X_1440x900 (R2X_GFXres_X_1440 / 3)
#define R3X_Y_1440x900 (R2X_GFXres_Y_900 / 3)

#define R3X_X_1680x1050 (R2X_GFXres_X_1680 / 3)
#define R3X_Y_1680x1050 (R2X_GFXres_Y_1050 / 3)

#define R3X_X_1920x1080 (R2X_GFXres_X_1920 / 3)
#define R3X_Y_1920x1080 (R2X_GFXres_Y_1080 / 3)

'-----------------------------------------------------



Declare Sub AFlibIII_Resize2X_320x200 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_320x240 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_400x300 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_512x384 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_640x400 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_640x480 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_720x480 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_720x576 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_800x600 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1024x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1152x864 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x600 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x720 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x800 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x960 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1280x1024 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1360x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1440x900 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1600x900 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1600x1200 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1680x1050 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_1920x1080 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )
Declare Sub AFlibIII_Resize2X_auto ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Declare Sub AFlibIII_Resize3X_720x480
Declare Sub AFlibIII_Resize3X_720x576
Declare Sub AFlibIII_Resize3X_1152x864
Declare Sub AFlibIII_Resize3X_1440x900
Declare Sub AFlibIII_Resize3X_1680x1050
Declare Sub AFlibIII_Resize3X_1920x1080
Declare Sub AFlibIII_Resize3X_auto

Declare Sub AFlibIII_Resize4X_auto
Declare Sub AFlibIII_Resize6X_auto
Declare Sub AFlibIII_Resize8X_auto







Declare sub raw_Resize2X_320x200_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_320x200_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_320x240_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_320x240_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_400x300_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_400x300_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_512x384_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_512x384_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_640x400_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_640x400_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_640x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_640x480_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_720x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_720x480_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_720x576_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_720x576_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_800x600_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_800x600_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1024x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1024x768_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1152x864_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1152x864_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x600_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x600_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x720_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x720_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x768_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x800_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x800_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x960_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x960_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x1024_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x1024_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1360x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1360x768_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1440x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1440x900_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1600x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1600x900_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1600x1200_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1600x1200_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1680x1050_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1680x1050_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1920x1080_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1920x1080_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

'--------------------------------------------------------------------------------------------

Declare sub raw_Resize2X_320x200_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_320x200_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_320x240_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_320x240_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_400x300_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_400x300_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_512x384_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_512x384_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_640x400_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_640x400_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_640x480_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_640x480_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_720x480_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_720x480_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_720x576_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_720x576_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_800x600_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_800x600_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1024x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1024x768_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1152x864_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1152x864_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x600_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x600_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x720_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x720_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x768_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x800_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x800_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x960_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x960_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1280x1024_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1280x1024_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1360x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1360x768_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1440x900_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1440x900_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1600x900_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1600x900_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1600x1200_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1600x1200_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1680x1050_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1680x1050_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize2X_1920x1080_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize2X_1920x1080_32_Hstr (Byval PTORG as any ptr,Byval PTDST as any ptr)

'--------------------------------------------------------------------------------------------

Declare sub raw_Resize3X_720x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_720x480_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize3X_720x576_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_720x576_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize3X_1152x864_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_1152x864_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize3X_1440x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_1440x900_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize3X_1680x1050_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_1680x1050_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)

Declare sub raw_Resize3X_1920x1080_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
Declare sub raw_Resize3X_1920x1080_32 (Byval PTORG as any ptr,Byval PTDST as any ptr)





'__________________________________________________________________________
Sub AFlibIII_Resize2X_320x200 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_320x200_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_320x200_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_320x200_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_320x200_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_320x200_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_320x200_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_320x200_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_320x200_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_320x240 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_320x240_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_320x240_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_320x240_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_320x240_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_320x240_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_320x240_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_320x240_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_320x240_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_400x300 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_400x300_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_400x300_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_400x300_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_400x300_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_400x300_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_400x300_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_400x300_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_400x300_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_512x384 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_512x384_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_512x384_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_512x384_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_512x384_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_512x384_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_512x384_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_512x384_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_512x384_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_640x400 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_640x400_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_640x400_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_640x400_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_640x400_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_640x400_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_640x400_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_640x400_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_640x400_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_640x480 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_640x480_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_640x480_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_640x480_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_640x480_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_640x480_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_640x480_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_640x480_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_640x480_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_720x480 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_720x480_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_720x480_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_720x480_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_720x480_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_720x480_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_720x480_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_720x480_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_720x480_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_720x576 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_720x576_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_720x576_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_720x576_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_720x576_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_720x576_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_720x576_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_720x576_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_720x576_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_800x600 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_800x600_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_800x600_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_800x600_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_800x600_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_800x600_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_800x600_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_800x600_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_800x600_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1024x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1024x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1024x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1024x768_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1024x768_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1024x768_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1024x768_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1024x768_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1024x768_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1152x864 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1152x864_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1152x864_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1152x864_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1152x864_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1152x864_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1152x864_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1152x864_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1152x864_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x600 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x600_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x600_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x600_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x600_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x600_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x600_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x600_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x600_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x720 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x720_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x720_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x720_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x720_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x720_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x720_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x720_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x720_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x768_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x768_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x768_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x768_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x768_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x768_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x800 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x800_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x800_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x800_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x800_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x800_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x800_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x800_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x800_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x960 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x960_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x960_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x960_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x960_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x960_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x960_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x960_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x960_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1280x1024 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1280x1024_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1280x1024_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1280x1024_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1280x1024_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1280x1024_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1280x1024_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1280x1024_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1280x1024_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1360x768 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1360x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1360x768_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1360x768_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1360x768_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1360x768_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1360x768_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1360x768_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1360x768_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1440x900 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1440x900_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1440x900_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1440x900_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1440x900_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1440x900_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1440x900_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1440x900_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1440x900_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1600x900 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1600x900_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1600x900_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1600x900_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1600x900_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1600x900_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1600x900_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1600x900_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1600x900_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1600x1200 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1600x1200_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1600x1200_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1600x1200_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1600x1200_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1600x1200_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1600x1200_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1600x1200_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1600x1200_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1680x1050 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1680x1050_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1680x1050_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1680x1050_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1680x1050_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1680x1050_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1680x1050_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1680x1050_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1680x1050_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_1920x1080 ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
If Horiz_ExtraWideRes_Level > 8 then Horiz_ExtraWideRes_Level = 8
If Horiz_ExtraWideRes_Level < 0 then Horiz_ExtraWideRes_Level = 0

Buffer = screenptr
Dim image as any ptr

Gfx_horiz /= 2
Gfx_vert /= 2

image = ImageCreate(Gfx_horiz, Gfx_vert)

For HorizStretch as Integer = 1 to Horiz_ExtraWideRes_Level step 1
  If Horiz_ExtraWideRes_Level <= 0 then Exit For
  Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
  Select Case as Const GFX_depth
    Case 15: raw_Resize2X_1920x1080_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 16: raw_Resize2X_1920x1080_16_Hstr(image+sizeof(fb.image),Buffer)
    Case 24: raw_Resize2X_1920x1080_32_Hstr(image+sizeof(fb.image),Buffer)
    Case 32: raw_Resize2X_1920x1080_32_Hstr(image+sizeof(fb.image),Buffer)
  End Select
Next

Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image
Select Case as Const GFX_depth
  Case 15: raw_Resize2X_1920x1080_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize2X_1920x1080_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize2X_1920x1080_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize2X_1920x1080_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize2X_auto ( Byval Horiz_ExtraWideRes_Level as Integer = 0 )

  Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
  ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

  If GFX_depth < 15 then Exit Sub

  If Gfx_horiz = 320 then
    If Gfx_vert = 200 then AFlibIII_Resize2X_320x200 Horiz_ExtraWideRes_Level
    If Gfx_vert = 240 then AFlibIII_Resize2X_320x240 Horiz_ExtraWideRes_Level
  End if

  If Gfx_horiz = 400 and Gfx_vert = 300 then AFlibIII_Resize2X_400x300 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 512 and Gfx_vert = 384 then AFlibIII_Resize2X_512x384 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 640 then
    If Gfx_vert = 400 then AFlibIII_Resize2X_640x400 Horiz_ExtraWideRes_Level
    If Gfx_vert = 480 then AFlibIII_Resize2X_640x480 Horiz_ExtraWideRes_Level
  End if

  If Gfx_horiz = 720 then
    If Gfx_vert = 480 then AFlibIII_Resize2X_720x480 Horiz_ExtraWideRes_Level
    If Gfx_vert = 576 then AFlibIII_Resize2X_720x576 Horiz_ExtraWideRes_Level
  End if

  If Gfx_horiz = 800 and Gfx_vert = 600 then AFlibIII_Resize2X_800x600 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1024 and Gfx_vert = 768 then AFlibIII_Resize2X_1024x768 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1152 and Gfx_vert = 864 then AFlibIII_Resize2X_1152x864 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1280 then
    If Gfx_vert = 600 then AFlibIII_Resize2X_1280x600 Horiz_ExtraWideRes_Level
    If Gfx_vert = 720 then AFlibIII_Resize2X_1280x720 Horiz_ExtraWideRes_Level
    If Gfx_vert = 768 then AFlibIII_Resize2X_1280x768 Horiz_ExtraWideRes_Level
    If Gfx_vert = 800 then AFlibIII_Resize2X_1280x800 Horiz_ExtraWideRes_Level
    If Gfx_vert = 960 then AFlibIII_Resize2X_1280x960 Horiz_ExtraWideRes_Level
    If Gfx_vert = 1024 then AFlibIII_Resize2X_1280x1024 Horiz_ExtraWideRes_Level
  End if

  If Gfx_horiz = 1360 and Gfx_vert = 768 then AFlibIII_Resize2X_1360x768 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1440 and Gfx_vert = 900 then AFlibIII_Resize2X_1440x900 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1600 then
    If Gfx_vert = 900 then AFlibIII_Resize2X_1600x900 Horiz_ExtraWideRes_Level
    If Gfx_vert = 1200 then AFlibIII_Resize2X_1600x1200 Horiz_ExtraWideRes_Level
  End if

  If Gfx_horiz = 1680 and Gfx_vert = 1050 then AFlibIII_Resize2X_1680x1050 Horiz_ExtraWideRes_Level

  If Gfx_horiz = 1920 and Gfx_vert = 1080 then AFlibIII_Resize2X_1920x1080 Horiz_ExtraWideRes_Level
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_720x480

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_720x480_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_720x480_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_720x480_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_720x480_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_720x576

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_720x576_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_720x576_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_720x576_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_720x576_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_1152x864

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_1152x864_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_1152x864_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_1152x864_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_1152x864_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_1440x900

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_1440x900_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_1440x900_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_1440x900_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_1440x900_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_1680x1050

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_1680x1050_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_1680x1050_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_1680x1050_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_1680x1050_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_1920x1080

Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
Dim buffer as any ptr
ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

If GFX_depth < 15 then Exit Sub
Buffer = screenptr

Dim image as any ptr

Gfx_horiz /= 3
Gfx_vert /= 3

image = ImageCreate(Gfx_horiz, Gfx_vert)
Get (0,0)-(Gfx_horiz - 1, Gfx_vert - 1), image

Select Case as Const GFX_depth
  Case 15: raw_Resize3X_1920x1080_16(image+sizeof(fb.image),Buffer)
  Case 16: raw_Resize3X_1920x1080_16(image+sizeof(fb.image),Buffer)
  Case 24: raw_Resize3X_1920x1080_32(image+sizeof(fb.image),Buffer)
  Case 32: raw_Resize3X_1920x1080_32(image+sizeof(fb.image),Buffer)
End Select

ImageDestroy image
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize3X_auto

  Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
  ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

  If GFX_depth < 15 then Exit Sub

  If Gfx_horiz = 720 then
    If Gfx_vert = 480 then AFlibIII_Resize3X_720x480
    If Gfx_vert = 576 then AFlibIII_Resize3X_720x576
  End if

  If Gfx_horiz = 1152 and Gfx_vert = 864 then AFlibIII_Resize3X_1152x864

  If Gfx_horiz = 1440 and Gfx_vert = 900 then AFlibIII_Resize3X_1440x900

  If Gfx_horiz = 1680 and Gfx_vert = 1050 then AFlibIII_Resize3X_1680x1050

  If Gfx_horiz = 1920 and Gfx_vert = 1080 then AFlibIII_Resize3X_1920x1080
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize4X_auto
  
  AFlibIII_Resize2X_auto
  AFlibIII_Resize2X_auto
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize6X_auto
  
  Dim as Integer Gfx_horiz, Gfx_vert, GFX_depth
  ScreenInfo Gfx_horiz, Gfx_vert, GFX_depth

  If GFX_depth < 15 then Exit Sub

  If Gfx_horiz = 720 then
    If Gfx_vert = 480 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_720x480
    If Gfx_vert = 576 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_720x576
  End if

  If Gfx_horiz = 1152 and Gfx_vert = 864 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_1152x864

  If Gfx_horiz = 1440 and Gfx_vert = 900 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_1440x900
  
  If Gfx_horiz = 1680 and Gfx_vert = 1050 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_1680x1050

  If Gfx_horiz = 1920 and Gfx_vert = 1080 then AFlibIII_Resize2X_auto: AFlibIII_Resize3X_1920x1080
End Sub



'__________________________________________________________________________
Sub AFlibIII_Resize8X_auto
  
  AFlibIII_Resize2X_auto
  AFlibIII_Resize2X_auto
  AFlibIII_Resize2X_auto
End Sub





Private Sub raw_Resize2X_320x200_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x200*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_320x200
    shl EBX,16
    mov CX,R2X_X_320x200
    _R2X16_320x200_NEXTLINE_:
    mov BX,CX
    _R2X16_320x200_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_320x200_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_320x200_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_320x200_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x200*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_320x200    
    mov EBX,R2X_X_320x200
    _R2X32_320x200_NEXTLINE_:
    mov ECX,EBX
    _R2X32_320x200_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_320x200_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_320x200_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_320x240_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x240*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_320x240
    shl EBX,16
    mov CX,R2X_X_320x240
    _R2X16_320x240_NEXTLINE_:
    mov BX,CX
    _R2X16_320x240_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_320x240_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_320x240_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_320x240_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x240*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_320x240    
    mov EBX,R2X_X_320x240
    _R2X32_320x240_NEXTLINE_:
    mov ECX,EBX
    _R2X32_320x240_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_320x240_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_320x240_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_400x300_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_400x300*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_400x300
    shl EBX,16
    mov CX,R2X_X_400x300
    _R2X16_400x300_NEXTLINE_:
    mov BX,CX
    _R2X16_400x300_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_400x300_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_400x300_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_400x300_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_400x300*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_400x300    
    mov EBX,R2X_X_400x300
    _R2X32_400x300_NEXTLINE_:
    mov ECX,EBX
    _R2X32_400x300_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_400x300_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_400x300_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_512x384_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_512x384*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_512x384
    shl EBX,16
    mov CX,R2X_X_512x384
    _R2X16_512x384_NEXTLINE_:
    mov BX,CX
    _R2X16_512x384_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_512x384_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_512x384_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_512x384_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_512x384*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_512x384    
    mov EBX,R2X_X_512x384
    _R2X32_512x384_NEXTLINE_:
    mov ECX,EBX
    _R2X32_512x384_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_512x384_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_512x384_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_640x400_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x400*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_640x400
    shl EBX,16
    mov CX,R2X_X_640x400
    _R2X16_640x400_NEXTLINE_:
    mov BX,CX
    _R2X16_640x400_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_640x400_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_640x400_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_640x400_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x400*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_640x400    
    mov EBX,R2X_X_640x400
    _R2X32_640x400_NEXTLINE_:
    mov ECX,EBX
    _R2X32_640x400_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_640x400_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_640x400_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_640x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x480*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_640x480
    shl EBX,16
    mov CX,R2X_X_640x480
    _R2X16_640x480_NEXTLINE_:
    mov BX,CX
    _R2X16_640x480_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_640x480_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_640x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_640x480_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x480*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_640x480    
    mov EBX,R2X_X_640x480
    _R2X32_640x480_NEXTLINE_:
    mov ECX,EBX
    _R2X32_640x480_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_640x480_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_640x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_720x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x480*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_720x480
    shl EBX,16
    mov CX,R2X_X_720x480
    _R2X16_720x480_NEXTLINE_:
    mov BX,CX
    _R2X16_720x480_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_720x480_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_720x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_720x480_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x480*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_720x480    
    mov EBX,R2X_X_720x480
    _R2X32_720x480_NEXTLINE_:
    mov ECX,EBX
    _R2X32_720x480_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_720x480_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_720x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_720x576_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x576*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_720x576
    shl EBX,16
    mov CX,R2X_X_720x576
    _R2X16_720x576_NEXTLINE_:
    mov BX,CX
    _R2X16_720x576_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_720x576_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_720x576_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_720x576_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x576*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_720x576    
    mov EBX,R2X_X_720x576
    _R2X32_720x576_NEXTLINE_:
    mov ECX,EBX
    _R2X32_720x576_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_720x576_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_720x576_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_800x600_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_800x600*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_800x600
    shl EBX,16
    mov CX,R2X_X_800x600
    _R2X16_800x600_NEXTLINE_:
    mov BX,CX
    _R2X16_800x600_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_800x600_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_800x600_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_800x600_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_800x600*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_800x600    
    mov EBX,R2X_X_800x600
    _R2X32_800x600_NEXTLINE_:
    mov ECX,EBX
    _R2X32_800x600_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_800x600_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_800x600_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1024x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1024x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1024x768
    shl EBX,16
    mov CX,R2X_X_1024x768
    _R2X16_1024x768_NEXTLINE_:
    mov BX,CX
    _R2X16_1024x768_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1024x768_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1024x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1024x768_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1024x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1024x768    
    mov EBX,R2X_X_1024x768
    _R2X32_1024x768_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1024x768_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1024x768_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1024x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1152x864_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1152x864*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1152x864
    shl EBX,16
    mov CX,R2X_X_1152x864
    _R2X16_1152x864_NEXTLINE_:
    mov BX,CX
    _R2X16_1152x864_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1152x864_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1152x864_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1152x864_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1152x864*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1152x864    
    mov EBX,R2X_X_1152x864
    _R2X32_1152x864_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1152x864_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1152x864_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1152x864_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x600_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x600*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x600
    shl EBX,16
    mov CX,R2X_X_1280x600
    _R2X16_1280x600_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x600_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x600_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x600_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x600_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x600*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x600    
    mov EBX,R2X_X_1280x600
    _R2X32_1280x600_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x600_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x600_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x600_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x720_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x720*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x720
    shl EBX,16
    mov CX,R2X_X_1280x720
    _R2X16_1280x720_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x720_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x720_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x720_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x720_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x720*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x720    
    mov EBX,R2X_X_1280x720
    _R2X32_1280x720_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x720_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x720_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x720_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x768
    shl EBX,16
    mov CX,R2X_X_1280x768
    _R2X16_1280x768_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x768_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x768_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x768_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x768    
    mov EBX,R2X_X_1280x768
    _R2X32_1280x768_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x768_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x768_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x800_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x800*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x800
    shl EBX,16
    mov CX,R2X_X_1280x800
    _R2X16_1280x800_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x800_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x800_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x800_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x800_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x800*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x800    
    mov EBX,R2X_X_1280x800
    _R2X32_1280x800_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x800_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x800_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x800_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x960_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x960*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x960
    shl EBX,16
    mov CX,R2X_X_1280x960
    _R2X16_1280x960_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x960_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x960_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x960_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x960_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x960*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x960    
    mov EBX,R2X_X_1280x960
    _R2X32_1280x960_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x960_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x960_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x960_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x1024_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x1024*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x1024
    shl EBX,16
    mov CX,R2X_X_1280x1024
    _R2X16_1280x1024_NEXTLINE_:
    mov BX,CX
    _R2X16_1280x1024_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x1024_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1280x1024_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x1024_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x1024*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x1024    
    mov EBX,R2X_X_1280x1024
    _R2X32_1280x1024_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1280x1024_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x1024_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1280x1024_NEXTLINE_
  end asm
  
end sub



Private Sub raw_Resize2X_1360x768_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1360x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1360x768
    shl EBX,16
    mov CX,R2X_X_1360x768
    _R2X16_1360x768_NEXTLINE_:
    mov BX,CX
    _R2X16_1360x768_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1360x768_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1360x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1360x768_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1360x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1360x768    
    mov EBX,R2X_X_1360x768
    _R2X32_1360x768_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1360x768_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1360x768_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1360x768_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1440x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1440x900*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1440x900
    shl EBX,16
    mov CX,R2X_X_1440x900
    _R2X16_1440x900_NEXTLINE_:
    mov BX,CX
    _R2X16_1440x900_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1440x900_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1440x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1440x900_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1440x900*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1440x900    
    mov EBX,R2X_X_1440x900
    _R2X32_1440x900_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1440x900_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1440x900_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1440x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x900*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1600x900
    shl EBX,16
    mov CX,R2X_X_1600x900
    _R2X16_1600x900_NEXTLINE_:
    mov BX,CX
    _R2X16_1600x900_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1600x900_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1600x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x900_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x900*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1600x900    
    mov EBX,R2X_X_1600x900
    _R2X32_1600x900_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1600x900_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1600x900_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1600x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x1200_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x1200*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1600x1200
    shl EBX,16
    mov CX,R2X_X_1600x1200
    _R2X16_1600x1200_NEXTLINE_:
    mov BX,CX
    _R2X16_1600x1200_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1600x1200_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1600x1200_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x1200_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x1200*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1600x1200    
    mov EBX,R2X_X_1600x1200
    _R2X32_1600x1200_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1600x1200_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1600x1200_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1600x1200_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1680x1050_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1680x1050*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1680x1050
    shl EBX,16
    mov CX,R2X_X_1680x1050
    _R2X16_1680x1050_NEXTLINE_:
    mov BX,CX
    _R2X16_1680x1050_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1680x1050_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1680x1050_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1680x1050_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1680x1050*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1680x1050    
    mov EBX,R2X_X_1680x1050
    _R2X32_1680x1050_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1680x1050_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1680x1050_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1680x1050_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1920x1080_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1920x1080*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1920x1080
    shl EBX,16
    mov CX,R2X_X_1920x1080
    _R2X16_1920x1080_NEXTLINE_:
    mov BX,CX
    _R2X16_1920x1080_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1920x1080_NEXTPOINT_
    add EDI,PILI
    sub EBX,65536    
    jnz _R2X16_1920x1080_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_1920x1080_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1920x1080*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1920x1080    
    mov EBX,R2X_X_1920x1080
    _R2X32_1920x1080_NEXTLINE_:
    mov ECX,EBX
    _R2X32_1920x1080_NEXTPOINT_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1920x1080_NEXTPOINT_
    add EDI,PILI
    dec EDX
    jnz _R2X32_1920x1080_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize2X_320x200_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x200*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_320x200
    shl EBX,16
    mov CX,R2X_X_320x200
    _R2X16_320x200_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_320x200_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_320x200_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_320x200_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_320x200_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x200*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_320x200    
    mov EBX,R2X_X_320x200
    _R2X32_320x200_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_320x200_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_320x200_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_320x200_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_320x240_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x240*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_320x240
    shl EBX,16
    mov CX,R2X_X_320x240
    _R2X16_320x240_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_320x240_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_320x240_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_320x240_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_320x240_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_320x240*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_320x240    
    mov EBX,R2X_X_320x240
    _R2X32_320x240_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_320x240_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_320x240_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_320x240_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_400x300_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_400x300*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_400x300
    shl EBX,16
    mov CX,R2X_X_400x300
    _R2X16_400x300_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_400x300_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_400x300_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_400x300_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_400x300_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_400x300*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_400x300    
    mov EBX,R2X_X_400x300
    _R2X32_400x300_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_400x300_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_400x300_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_400x300_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_512x384_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_512x384*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_512x384
    shl EBX,16
    mov CX,R2X_X_512x384
    _R2X16_512x384_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_512x384_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_512x384_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_512x384_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_512x384_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_512x384*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_512x384    
    mov EBX,R2X_X_512x384
    _R2X32_512x384_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_512x384_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_512x384_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_512x384_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_640x400_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x400*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_640x400
    shl EBX,16
    mov CX,R2X_X_640x400
    _R2X16_640x400_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_640x400_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_640x400_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_640x400_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_640x400_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x400*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_640x400    
    mov EBX,R2X_X_640x400
    _R2X32_640x400_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_640x400_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_640x400_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_640x400_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_640x480_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x480*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_640x480
    shl EBX,16
    mov CX,R2X_X_640x480
    _R2X16_640x480_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_640x480_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_640x480_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_640x480_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_640x480_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_640x480*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_640x480    
    mov EBX,R2X_X_640x480
    _R2X32_640x480_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_640x480_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_640x480_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_640x480_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_720x480_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x480*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_720x480
    shl EBX,16
    mov CX,R2X_X_720x480
    _R2X16_720x480_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_720x480_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_720x480_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_720x480_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_720x480_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x480*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_720x480    
    mov EBX,R2X_X_720x480
    _R2X32_720x480_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_720x480_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_720x480_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_720x480_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_720x576_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x576*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_720x576
    shl EBX,16
    mov CX,R2X_X_720x576
    _R2X16_720x576_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_720x576_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_720x576_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_720x576_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_720x576_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_720x576*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_720x576    
    mov EBX,R2X_X_720x576
    _R2X32_720x576_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_720x576_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_720x576_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_720x576_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_800x600_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_800x600*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_800x600
    shl EBX,16
    mov CX,R2X_X_800x600
    _R2X16_800x600_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_800x600_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_800x600_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_800x600_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_800x600_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_800x600*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_800x600    
    mov EBX,R2X_X_800x600
    _R2X32_800x600_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_800x600_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_800x600_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_800x600_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1024x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1024x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1024x768
    shl EBX,16
    mov CX,R2X_X_1024x768
    _R2X16_1024x768_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1024x768_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1024x768_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1024x768_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1024x768_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1024x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1024x768    
    mov EBX,R2X_X_1024x768
    _R2X32_1024x768_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1024x768_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1024x768_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1024x768_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1152x864_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1152x864*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1152x864
    shl EBX,16
    mov CX,R2X_X_1152x864
    _R2X16_1152x864_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1152x864_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1152x864_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1152x864_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1152x864_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1152x864*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1152x864    
    mov EBX,R2X_X_1152x864
    _R2X32_1152x864_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1152x864_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1152x864_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1152x864_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x600_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x600*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x600
    shl EBX,16
    mov CX,R2X_X_1280x600
    _R2X16_1280x600_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x600_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x600_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x600_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x600_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x600*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x600    
    mov EBX,R2X_X_1280x600
    _R2X32_1280x600_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x600_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x600_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x600_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x720_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x720*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x720
    shl EBX,16
    mov CX,R2X_X_1280x720
    _R2X16_1280x720_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x720_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x720_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x720_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x720_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x720*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x720    
    mov EBX,R2X_X_1280x720
    _R2X32_1280x720_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x720_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x720_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x720_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x768
    shl EBX,16
    mov CX,R2X_X_1280x768
    _R2X16_1280x768_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x768_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x768_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x768_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x768_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x768    
    mov EBX,R2X_X_1280x768
    _R2X32_1280x768_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x768_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x768_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x768_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x800_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x800*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x800
    shl EBX,16
    mov CX,R2X_X_1280x800
    _R2X16_1280x800_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x800_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x800_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x800_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x800_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x800*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x800    
    mov EBX,R2X_X_1280x800
    _R2X32_1280x800_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x800_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x800_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x800_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x960_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x960*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x960
    shl EBX,16
    mov CX,R2X_X_1280x960
    _R2X16_1280x960_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x960_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x960_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x960_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x960_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x960*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x960    
    mov EBX,R2X_X_1280x960
    _R2X32_1280x960_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x960_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x960_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x960_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1280x1024_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x1024*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1280x1024
    shl EBX,16
    mov CX,R2X_X_1280x1024
    _R2X16_1280x1024_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1280x1024_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1280x1024_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1280x1024_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1280x1024_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1280x1024*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1280x1024    
    mov EBX,R2X_X_1280x1024
    _R2X32_1280x1024_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1280x1024_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1280x1024_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1280x1024_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1360x768_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1360x768*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1360x768
    shl EBX,16
    mov CX,R2X_X_1360x768
    _R2X16_1360x768_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1360x768_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1360x768_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1360x768_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1360x768_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1360x768*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1360x768    
    mov EBX,R2X_X_1360x768
    _R2X32_1360x768_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1360x768_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1360x768_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1360x768_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1440x900_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1440x900*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1440x900
    shl EBX,16
    mov CX,R2X_X_1440x900
    _R2X16_1440x900_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1440x900_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1440x900_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1440x900_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1440x900_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1440x900*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1440x900    
    mov EBX,R2X_X_1440x900
    _R2X32_1440x900_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1440x900_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1440x900_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1440x900_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1600x900_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x900*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1600x900
    shl EBX,16
    mov CX,R2X_X_1600x900
    _R2X16_1600x900_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1600x900_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1600x900_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1600x900_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x900_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x900*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1600x900    
    mov EBX,R2X_X_1600x900
    _R2X32_1600x900_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1600x900_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1600x900_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1600x900_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1600x1200_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x1200*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1600x1200
    shl EBX,16
    mov CX,R2X_X_1600x1200
    _R2X16_1600x1200_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1600x1200_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1600x1200_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1600x1200_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1600x1200_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1600x1200*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1600x1200    
    mov EBX,R2X_X_1600x1200
    _R2X32_1600x1200_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1600x1200_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1600x1200_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1600x1200_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1680x1050_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1680x1050*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1680x1050
    shl EBX,16
    mov CX,R2X_X_1680x1050
    _R2X16_1680x1050_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1680x1050_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1680x1050_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1680x1050_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1680x1050_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1680x1050*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1680x1050    
    mov EBX,R2X_X_1680x1050
    _R2X32_1680x1050_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1680x1050_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1680x1050_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1680x1050_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize2X_1920x1080_16_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1920x1080*2)*ESZ
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R2X_Y_1920x1080
    shl EBX,16
    mov CX,R2X_X_1920x1080
    _R2X16_1920x1080_NEXTLINE_HSTR_:
    mov BX,CX
    _R2X16_1920x1080_NEXTPOINT_HSTR_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    mov [EDI],EAX
    mov [EDI+PILI],EAX
    add EDI,OPIB
    dec BX
    jnz _R2X16_1920x1080_NEXTPOINT_HSTR_
    sub EBX,65536    
    jnz _R2X16_1920x1080_NEXTLINE_HSTR_
  end asm
  
end sub


Private Sub raw_Resize2X_1920x1080_32_Hstr (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*2
  const PILI = (R2X_X_1920x1080*2)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R2X_Y_1920x1080    
    mov EBX,R2X_X_1920x1080
    _R2X32_1920x1080_NEXTLINE_HSTR_:
    mov ECX,EBX
    _R2X32_1920x1080_NEXTPOINT_HSTR_:
    lodsd    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    add EDI,OPIB
    dec ECX
    jnz _R2X32_1920x1080_NEXTPOINT_HSTR_
    dec EDX
    jnz _R2X32_1920x1080_NEXTLINE_HSTR_
  end asm

end sub


Private Sub raw_Resize3X_720x480_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_720x480*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_720x480
    shl EBX,16
    mov CX,R3X_X_720x480
    _R3X16_720x480_NEXTLINE_:
    mov BX,CX
    _R3X16_720x480_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_720x480_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_720x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_720x480_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_720x480*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_720x480    
    mov EBX,R3X_X_720x480
    _R3X32_720x480_NEXTLINE_:
    mov ECX,EBX
    _R3X32_720x480_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_720x480_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_720x480_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_720x576_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_720x576*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_720x576
    shl EBX,16
    mov CX,R3X_X_720x576
    _R3X16_720x576_NEXTLINE_:
    mov BX,CX
    _R3X16_720x576_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_720x576_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_720x576_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_720x576_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_720x576*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_720x576    
    mov EBX,R3X_X_720x576
    _R3X32_720x576_NEXTLINE_:
    mov ECX,EBX
    _R3X32_720x576_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_720x576_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_720x576_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1152x864_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1152x864*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_1152x864
    shl EBX,16
    mov CX,R3X_X_1152x864
    _R3X16_1152x864_NEXTLINE_:
    mov BX,CX
    _R3X16_1152x864_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_1152x864_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_1152x864_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1152x864_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1152x864*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_1152x864    
    mov EBX,R3X_X_1152x864
    _R3X32_1152x864_NEXTLINE_:
    mov ECX,EBX
    _R3X32_1152x864_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_1152x864_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_1152x864_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1440x900_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1440x900*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_1440x900
    shl EBX,16
    mov CX,R3X_X_1440x900
    _R3X16_1440x900_NEXTLINE_:
    mov BX,CX
    _R3X16_1440x900_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_1440x900_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_1440x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1440x900_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1440x900*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_1440x900    
    mov EBX,R3X_X_1440x900
    _R3X32_1440x900_NEXTLINE_:
    mov ECX,EBX
    _R3X32_1440x900_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_1440x900_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_1440x900_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1680x1050_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1680x1050*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_1680x1050
    shl EBX,16
    mov CX,R3X_X_1680x1050
    _R3X16_1680x1050_NEXTLINE_:
    mov BX,CX
    _R3X16_1680x1050_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_1680x1050_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_1680x1050_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1680x1050_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1680x1050*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_1680x1050    
    mov EBX,R3X_X_1680x1050
    _R3X32_1680x1050_NEXTLINE_:
    mov ECX,EBX
    _R3X32_1680x1050_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_1680x1050_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_1680x1050_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1920x1080_16 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 2
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1920x1080*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov BX,R3X_Y_1920x1080
    shl EBX,16
    mov CX,R3X_X_1920x1080
    _R3X16_1920x1080_NEXTLINE_:
    mov BX,CX
    _R3X16_1920x1080_NEXTPOINT_:
    lodsw
    mov DX,AX
    shl EAX,16
    mov AX,DX    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
 
    add EDI,OPIB
    dec BX
    jnz _R3X16_1920x1080_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    sub EBX,65536    
    jnz _R3X16_1920x1080_NEXTLINE_
  end asm
  
end sub


Private Sub raw_Resize3X_1920x1080_32 (Byval PTORG as any ptr, Byval PTDST as any ptr)
  
  #define ESZ 4
  
  const OPI = ESZ
  const OPIB = OPI*3
  const PILI = (R3X_X_1920x1080*3)*ESZ
  const PILIB = PILI+OPI
  
  asm
    mov ESI,[PTORG]
    mov EDI,[PTDST]
    mov EDX,R3X_Y_1920x1080    
    mov EBX,R3X_X_1920x1080
    _R3X32_1920x1080_NEXTLINE_:
    mov ECX,EBX
    _R3X32_1920x1080_NEXTPOINT_:
    lodsd    
    
    mov [EDI],EAX
    mov [EDI+OPI],EAX
    mov [EDI+PILI],EAX
    mov [EDI+PILIB],EAX
    mov [EDI+PILIB+OPI],EAX
    
    mov [EDI+OPI*2],EAX
    mov [EDI+PILI*2],EAX
    mov [EDI+PILIB*2],EAX
    mov [EDI+PILIB+PILI],EAX
   
    add EDI,OPIB
    dec ECX
    jnz _R3X32_1920x1080_NEXTPOINT_
    add EDI,PILI
    add EDI,PILI
    dec EDX
    jnz _R3X32_1920x1080_NEXTLINE_
  end asm
  
end sub