Did you want to do a Flash injection, but your SWF dimensions are too large or too small for your WAD? Not to worry, as I have a solution.
It turns out the SWF dimensions aren't the problem, but rather the display field it gets played from. In the Back To Nature/Flash Placeholder WAD, the ortho_rect (orthogonal rectangle) config function in config.XXX.pcf and config.XXX.wide.pcf is what determines the display field to play the SWF. XXX represents a region like NTSC, PAL or EURGB60. By default, the "frame buffer size" ÷ 2 makes up the X and Y values for the display field [ -X +Y +X -Y ], therefore the SWF file has its ratio scaled to best fit the values.
The frame buffer size for a 4:3 screen is 608 x 456, whereas a 16:9 screen is 832 x 456. If the ortho_rect values never changed, those are the maximum dimensions of any SWF file for the WAD to play it. But again, you're not limited from SWF dimensions.
Determining the ortho_rect values for any SWF dimension requires a few algebraic math calculations, and programs like FriishProduce do not have (or accurately make) these calculations at the moment. This is why I spent some time to make this ortho_rect calculator, to help generate these values for you. The goal is to make Flash injections work for any compatible SWF, no matter what dimensions they have. You will need to enter the SWF dimensions and the frame buffer size to get your result. I made it with Google Sheets to not only make it accessible, but also make it an easy way to code the calculator for online use without making a website. It is also robust, meaning the calculator will recognize invalid input, negative integer input, recognizing zero as the input, or recognizing the input is blank; this ensures flawless calculation while correcting you on any mistakes.
All you'll need to do is make a copy of the sheet to use it. Once you have the results, you copy the cell of the ortho_rect values and replace the old data from all config.XXX.pcf and config.XXX.wide.pcf files from your WAD's region folder. For instance, if your region is set for the United States, you go to the US folder and change all of the mentioned files in each language folder.
Here's the link to the calculator:
https://docs.google.com/spreadsheets/d/1g9YJ5EliA0bM5tOhmvItdZF-ZQ4SyibPC9hMxu06LYE/
Additional information is also documented on the program's main page. There will be two available calculators each in their own sheet.
Huge credit to @Darker27 who originally discovered this concept before me.
Hope this helps with your Flash injections! You're also free to ask any questions relating to the calculator if necessary.
Edit: FriishProduce-WME v1.6.1.1 has ported my calculations as one of many "zoom" options.
It turns out the SWF dimensions aren't the problem, but rather the display field it gets played from. In the Back To Nature/Flash Placeholder WAD, the ortho_rect (orthogonal rectangle) config function in config.XXX.pcf and config.XXX.wide.pcf is what determines the display field to play the SWF. XXX represents a region like NTSC, PAL or EURGB60. By default, the "frame buffer size" ÷ 2 makes up the X and Y values for the display field [ -X +Y +X -Y ], therefore the SWF file has its ratio scaled to best fit the values.
The frame buffer size for a 4:3 screen is 608 x 456, whereas a 16:9 screen is 832 x 456. If the ortho_rect values never changed, those are the maximum dimensions of any SWF file for the WAD to play it. But again, you're not limited from SWF dimensions.
###############################################################################
# Comments (text preceded by #) and line breaks will be ignored
include config/US/EN/config.enUS.pcf
###############################################################################
efb_size 640 456
xfb_size 640 456
vi_origin 25 12 # ( VI_MAX_WIDTH_NTSC - vi_size.x ) / 2, ( VI_MAX_HEIGHT_NTSC - vi_size.y ) / 2
vi_size 670 456
anti_aliasing off
# vi_filter # use default
ortho_rect -304 +228 +304 -228 # left top right bottom (608 x 456)
###############################################################################
# frame_buffer_size 608 456
# window_rect -304 +228 +304 -228 # left top right bottom
# display_rect 0 0 608 456 # xmin ymin xmax ymax
###############################################################################
# Comments (text preceded by #) and line breaks will be ignored
include config/US/EN/config.enUS.pcf
###############################################################################
efb_size 640 456
xfb_size 640 456
vi_origin 25 12 # ( VI_MAX_WIDTH_NTSC - vi_size.x ) / 2, ( VI_MAX_HEIGHT_NTSC - vi_size.y ) / 2
vi_size 670 456
anti_aliasing off
# vi_filter # use default
ortho_rect -304 +228 +304 -228 # left top right bottom (608 x 456)
###############################################################################
# frame_buffer_size 608 456
# window_rect -304 +228 +304 -228 # left top right bottom
# display_rect 0 0 608 456 # xmin ymin xmax ymax
###############################################################################
Determining the ortho_rect values for any SWF dimension requires a few algebraic math calculations, and programs like FriishProduce do not have (or accurately make) these calculations at the moment. This is why I spent some time to make this ortho_rect calculator, to help generate these values for you. The goal is to make Flash injections work for any compatible SWF, no matter what dimensions they have. You will need to enter the SWF dimensions and the frame buffer size to get your result. I made it with Google Sheets to not only make it accessible, but also make it an easy way to code the calculator for online use without making a website. It is also robust, meaning the calculator will recognize invalid input, negative integer input, recognizing zero as the input, or recognizing the input is blank; this ensures flawless calculation while correcting you on any mistakes.
All you'll need to do is make a copy of the sheet to use it. Once you have the results, you copy the cell of the ortho_rect values and replace the old data from all config.XXX.pcf and config.XXX.wide.pcf files from your WAD's region folder. For instance, if your region is set for the United States, you go to the US folder and change all of the mentioned files in each language folder.
Here's the link to the calculator:
https://docs.google.com/spreadsheets/d/1g9YJ5EliA0bM5tOhmvItdZF-ZQ4SyibPC9hMxu06LYE/
Additional information is also documented on the program's main page. There will be two available calculators each in their own sheet.
Huge credit to @Darker27 who originally discovered this concept before me.
Hope this helps with your Flash injections! You're also free to ask any questions relating to the calculator if necessary.
Edit: FriishProduce-WME v1.6.1.1 has ported my calculations as one of many "zoom" options.
Last edited by ZodiaKGalXy,






