Difference between revisions of "BobscreenTest"

From Sega Retro

(current template isn't coping well with that one, new template is - nicely done)
Line 1: Line 1:
<includeonly>{{#vardefine:hscale|{{#switch:{{#mediadimensions:{{{1}}}}}
+
<includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
 
| 256 × 224 = 1.25 <!--Mega Drive-->
 
| 256 × 224 = 1.25 <!--Mega Drive-->
 
| 160 × 144 = 1.2 <!--Game Gear-->
 
| 160 × 144 = 1.2 <!--Game Gear-->
| 352 × 224 = 0.9 <!--Saturn-->
+
| 352 × 224 = (320/352) <!--Saturn-->
| 704 × 448 = 0.9 <!--Saturn-->
+
| 704 × 448 = (640/704) <!--Saturn-->
| 352 × 240 = 0.9 <!--Saturn PAL-->
+
| 352 × 240 = (320/352) <!--Saturn PAL-->
| 704 × 480 = 0.9 <!--Saturn PAL-->
+
| 704 × 480 = (640/704) <!--Saturn PAL-->
| 224 × 224 = 1.43 <!--Saturn PAL-->
+
| 224 × 224 = (320/224) <!--Bank Panic-->
| 240 × 224 = 1.32 <!--Super Locomotive-->
+
| 240 × 224 = (320/240) <!--Super Locomotive-->
 
| 288 × 224 = 1 <!--Flashgal, appears to use square pixels.-->
 
| 288 × 224 = 1 <!--Flashgal, appears to use square pixels.-->
 +
| 384 × 496 = (372/384) <!--Vertical arcade (e.g. Gain Ground)-->
 
| 1
 
| 1
}}}}{{#vardefine:vscale|{{#switch:{{#mediadimensions:{{{1}}}}}
+
}}}}}}{{#vardefine:vscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
 
| 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)-->
 
| 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)-->
 
| 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)-->
 
| 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)-->
 
| 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)-->
 
| 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)-->
 +
| 224 × 240 = (320/240) <!--Vertical arcade (e.g. Water Match)-->
 
| 512 × 448 = 0.8 <!--PlayStation 2-->
 
| 512 × 448 = 0.8 <!--PlayStation 2-->
| 512 × 480 = 0.8 <!--Astron Belt-->
+
| 512 × 480 = (384/480) <!--Astron Belt-->
 
| 224 × 288 = 1 <!--Pengo, square pixels.-->
 
| 224 × 288 = 1 <!--Pengo, square pixels.-->
 +
| 496 × 384 = (372/384) <!--Model 1/2 (e.g. Virtua Fighter)-->
 
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}}
 
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}}
}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}}
+
}}}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}}
 
| 512 × 192 = yes <!--Master System-->
 
| 512 × 192 = yes <!--Master System-->
 
| 496 × 192 = yes <!--Master System (cropped)-->
 
| 496 × 192 = yes <!--Master System (cropped)-->
 
| no
 
| no
 
}}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}}
 
}}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}}
}}{{#if:{{{height|}}} | {{#vardefine:bsheight|{{{height|}}}}} {{#vardefine:bswidth|{{h2w|{{{1}}}|{{#expr:{{{height|}}}}}/{{#var:vscale}}}}}}
+
}}{{#if:{{{height|}}} | {{#vardefine:bsheight|{{{height|}}}}} {{#vardefine:bswidth|{{#expr:({{h2w|{{{1}}}|{{#expr:{{{height|}}}}}/{{#var:vscale}}}})*{{#var:hscale}}}}}}
 
}}{{#if:{{{width|}}}{{{height|}}} || {{#ifexpr:({{#mediawidth:{{{1}}}}}*{{#var:hscale}})<{{#ifeq:{{#var:is3d}}|yes|641|321}}
 
}}{{#if:{{{width|}}}{{{height|}}} || {{#ifexpr:({{#mediawidth:{{{1}}}}}*{{#var:hscale}})<{{#ifeq:{{#var:is3d}}|yes|641|321}}
 
| {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}}
 
| {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}}
Line 29: Line 32:
 
}}{{#vardefine:rawwidth|{{#expr:trunc({{#var:bswidth}}/{{#var:hscale}})}}}}{{#ifeq:{{#var:is3d}}|yes|{{#vardefine:bswidth|{{#expr:{{#var:bswidth}}/2}}}}}}
 
}}{{#vardefine:rawwidth|{{#expr:trunc({{#var:bswidth}}/{{#var:hscale}})}}}}{{#ifeq:{{#var:is3d}}|yes|{{#vardefine:bswidth|{{#expr:{{#var:bswidth}}/2}}}}}}
 
{{#var:bswidth}},{{#var:bsheight}}
 
{{#var:bswidth}},{{#var:bsheight}}
<div class="bobscreen" style="width:{{#var:bswidth}}px; height:{{#var:bsheight}}px; outline:red solid 1px; display:inline-block; text-align:center; overflow:hidden;">
+
<div class="bobscreen" style="width:{{#var:bswidth}}px; height:{{#var:bsheight}}px; display:inline-block; text-align:center; overflow:hidden;">
<div style="transform:scale({{#var:hscale}},{{#var:vscale}}); transform-origin:0% 0%; outline:green solid 1px; width:{{#var:rawwidth}}px !important;">
+
<div style="transform:scale({{#var:hscale}},{{#var:vscale}}); transform-origin:0% 0%; width:{{#var:rawwidth}}px !important;">
 
[[File:{{{1}}}|{{#var:rawwidth}}px]]
 
[[File:{{{1}}}|{{#var:rawwidth}}px]]
 
</div></div></includeonly><noinclude>
 
</div></div></includeonly><noinclude>
Line 55: Line 58:
 
{|class="prettytable"
 
{|class="prettytable"
 
! Code || Raw image || Output
 
! Code || Raw image || Output
 +
|-
 +
| <nowiki>{{bobscreenTest|Gain Ground Title.png}}</nowiki>
 +
| [[File:Gain Ground Title.png]]
 +
| {{bobscreenTest|Gain Ground Title.png|height=320}}
 +
|-
 +
| <nowiki>{{bobscreenTest|Virtua Fighter Title.png}}</nowiki>
 +
| [[File:Virtua Fighter Title.png]]
 +
| {{bobscreenTest|Virtua Fighter Title.png}}
 
|-
 
|-
 
| <nowiki>{{bobscreenTest|AlteredBeast PS2 title.png}}</nowiki>
 
| <nowiki>{{bobscreenTest|AlteredBeast PS2 title.png}}</nowiki>

Revision as of 15:43, 20 July 2018


This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio.

Usage

{{bobscreen|MagicalPuzzlePopils title.png}}

returns

192,144

MagicalPuzzlePopils title.png

This is how the game appears on an actual Sega Game Gear. The original image taken from an emulator is below:

MagicalPuzzlePopils title.png

Options

{{bobscreenTest|MagicalPuzzlePopils title.png|width=120}}

returns

120,90

MagicalPuzzlePopils title.png

"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not.

Examples

Code Raw image Output
{{bobscreenTest|Gain Ground Title.png}} Gain Ground Title.png

239.28125,320

Gain Ground Title.png

{{bobscreenTest|Virtua Fighter Title.png}} Virtua Fighter Title.png

320,239.28125

Virtua Fighter Title.png

{{bobscreenTest|AlteredBeast PS2 title.png}} AlteredBeast PS2 title.png

320,224

AlteredBeast PS2 title.png

{{bobscreenTest|BladeEagle title.png}} BladeEagle title.png

256,192

BladeEagle title.png

{{bobscreenTest|OutRun3D title.png}} OutRun3D title.png

256,192

OutRun3D title.png

{{bobscreenTest|Scd titlescreen.png}} Scd titlescreen.png

320,224

Scd titlescreen.png

{{bobscreenTest|MagicalPuzzlePopils title.png}} MagicalPuzzlePopils title.png

192,144

MagicalPuzzlePopils title.png

{{bobscreenTest|MagicalPuzzlePopils title.png|width=120}} MagicalPuzzlePopils title.png

120,90

MagicalPuzzlePopils title.png

{{bobscreenTest|WinterHeat title.png}} WinterHeat title.png

320,240

WinterHeat title.png

{{bobscreenTest|Clockwork Knight Title.png}} ClockworkKnightUSPAL Title.png

320,224

ClockworkKnightUSPAL Title.png

{{bobscreenTest|NiGHTS title.png}} NiGHTS title.png

320,224

NiGHTS title.png

{{bobscreenTest|NiGHTS title.png|width=320}} NiGHTS title.png

320,224

NiGHTS title.png

{{bobscreenTest|VirtuaFighter 32X Widescreen2.png|forcewidescreen=yes}} VirtuaFighter 32X Widescreen2.png

320,179.2

VirtuaFighter 32X Widescreen2.png

{{bobscreenTest|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes}} VirtuaFighter 32X Widescreen2 PAL.png

320,192

VirtuaFighter 32X Widescreen2 PAL.png

{{bobscreenTest|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|width=200}} VirtuaFighter 32X Widescreen2 PAL.png

200,120

VirtuaFighter 32X Widescreen2 PAL.png

{{bobscreenTest|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|height=240}} VirtuaFighter 32X Widescreen2 PAL.png

400,240

VirtuaFighter 32X Widescreen2 PAL.png

{{bobscreenTest|Deep Scan.png}} Deep Scan.png

224,320

Deep Scan.png

{{bobscreenTest|Deep Scan.png|height=320}} Deep Scan.png

224,320

Deep Scan.png

{{bobscreenTest|Deep Scan.png|width=200}} Deep Scan.png

200,285

Deep Scan.png

{{bobscreenTest|Alex Kidd in Miracle World Title.png}} Alex Kidd in Miracle World Title.png

256,192

Alex Kidd in Miracle World Title.png

{{bobscreenTest|Outrun2spsdxscreen.png|width=320}} Outrun2spsdxscreen.png

320,189

Outrun2spsdxscreen.png