Difference between revisions of "02A3"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code>02A3=1,%1d%</code><br>
+
__NOTOC__
'''Description''': Sets widescreen mode<br>
+
{{OpCode
'''Parameter 1''': Flag<br>
+
| games      = {{Icon|t}}
'''Supports''': GTA3, Vice City, San Andreas<br>
+
| command    = SWITCH_WIDESCREEN
 +
| description = Enables widescreen
 +
| syntax1    = 02A3: enable_widescreen [''int'']
 +
| p1t        = [''int'']
 +
| p1d        = 0 = off, {{hint|1|or any value other than 0}} = on
 +
}}
  
This opcode can create a widescreen in the game. It is mainly used for cutscenes to make it look good. If widescreen is turned on, the HUD and radar will be disabled and the game can not be paused.<br>
+
This opcode enables widescreen by placing two black bars on the top and bottom of the screen. It is used mainly for cutscenes to make it look cinematic. When widescreen is enabled, the HUD, radar, crosshairs, scopes are disabled. In Vice City and San Andreas, the game cannot be paused (even minimizing the game won't pause the game when it usually does), text in the middle bottom of the screen is repositioned, text boxes do not appear visually but can be heard appearing, and the screen is squished.
  
==Flags==
+
Widescreen effect in Vice City:
Flag 0<br>
+
{|class="wikitable"
http://img.photobucket.com/albums/v41/spaceeinstein/Widescreen.png<br>
+
!0 ||1
Turns off widescreen
+
|-
 +
|[[File:VCWidescreenOff.jpg|256px]] ||[[File:VCWidescreenOn.jpg|256px]]
 +
|}
  
Flag 1<br>
+
== Disassembled code ==
http://img.photobucket.com/albums/v41/spaceeinstein/Widescreen1.png<br>
+
These are disassembled code for this opcode both from PC v1.0 US.
Turns on widescreen
+
=== GTA III ===
 +
<syntaxhighlight lang="nasm">
 +
loc_44524F:
 +
    lea    eax, [ebp+10h]                    ; get address of script's current instruction pointer
 +
    mov    ecx, ebp                          ; get address of script for thiscall
 +
    push    1                                ; push 1 for one parameter to collect
 +
    push    eax                              ; push address of script's current instruction pointer
 +
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
 +
    cmp    ds:ScriptParams[0], 0            ; check whether or not value of first parameter is 0
 +
    jz      short loc_445271
 +
    mov    ecx, offset TheCamera            ; get address of TheCamera for thiscall
 +
    call    CCamera::SetWideScreenOn          ; call CCamera::SetWideScreenOn(void)
 +
    jmp    short loc_44527B
 +
loc_445271:
 +
    mov    ecx, offset TheCamera            ; get address of TheCamera for thiscall
 +
    call    CCamera::SetWideScreenOff        ; call CCamera::SetWideScreenOff(void)
 +
loc_44527B:
 +
    xor    al, al                            ; return 0
 +
</syntaxhighlight>
  
==Keywords==
+
=== Vice City ===
toggle, set, widescreen, mode
+
<syntaxhighlight lang="nasm">
[[Category:OpCodes]]
+
loc_457163:
 +
    lea    eax, [ebp+10h]                    ; get address of script's current instruction pointer
 +
    mov    ecx, ebp                          ; get address of script for thiscall
 +
    push    1                                ; push 1 for one parameter to collect
 +
    push    eax                              ; push address of script's current instruction pointer
 +
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
 +
    cmp    ds:ScriptParams[0], 0            ; check whether or not value of first parameter is 0
 +
    jz      short loc_457185
 +
    mov    ecx, offset TheCamera            ; get address of TheCamera for thiscall
 +
    call    CCamera::SetWideScreenOn          ; call CCamera::SetWideScreenOn(void)
 +
    jmp    short loc_45718F
 +
loc_457185:
 +
    mov    ecx, offset TheCamera            ; get address of TheCamera for thiscall
 +
    call    CCamera::SetWideScreenOff        ; call CCamera::SetWideScreenOff(void)
 +
loc_45718F:
 +
    xor    al, al                            ; return 0
 +
</syntaxhighlight>
 +
 
 +
== Keywords ==
 +
set, toggle, widescreen, black bars, border

Latest revision as of 04:29, 24 May 2017

GTA III Vice City San Andreas SWITCH_WIDESCREEN


Description
Enables widescreen
Syntax
02A3: enable_widescreen [int]
Parameter
[int]
0 = off, 1 = on

This opcode enables widescreen by placing two black bars on the top and bottom of the screen. It is used mainly for cutscenes to make it look cinematic. When widescreen is enabled, the HUD, radar, crosshairs, scopes are disabled. In Vice City and San Andreas, the game cannot be paused (even minimizing the game won't pause the game when it usually does), text in the middle bottom of the screen is repositioned, text boxes do not appear visually but can be heard appearing, and the screen is squished.

Widescreen effect in Vice City:

0 1
VCWidescreenOff.jpg VCWidescreenOn.jpg

Disassembled code

These are disassembled code for this opcode both from PC v1.0 US.

GTA III

loc_44524F:
    lea     eax, [ebp+10h]                    ; get address of script's current instruction pointer
    mov     ecx, ebp                          ; get address of script for thiscall
    push    1                                 ; push 1 for one parameter to collect
    push    eax                               ; push address of script's current instruction pointer
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
    cmp     ds:ScriptParams[0], 0             ; check whether or not value of first parameter is 0
    jz      short loc_445271
    mov     ecx, offset TheCamera             ; get address of TheCamera for thiscall
    call    CCamera::SetWideScreenOn          ; call CCamera::SetWideScreenOn(void)
    jmp     short loc_44527B
loc_445271:
    mov     ecx, offset TheCamera             ; get address of TheCamera for thiscall
    call    CCamera::SetWideScreenOff         ; call CCamera::SetWideScreenOff(void)
loc_44527B:
    xor     al, al                            ; return 0

Vice City

loc_457163:
    lea     eax, [ebp+10h]                    ; get address of script's current instruction pointer
    mov     ecx, ebp                          ; get address of script for thiscall
    push    1                                 ; push 1 for one parameter to collect
    push    eax                               ; push address of script's current instruction pointer
    call    CRunningScript::CollectParameters ; call CRunningScript::CollectParameters(uint *,short)
    cmp     ds:ScriptParams[0], 0             ; check whether or not value of first parameter is 0
    jz      short loc_457185
    mov     ecx, offset TheCamera             ; get address of TheCamera for thiscall
    call    CCamera::SetWideScreenOn          ; call CCamera::SetWideScreenOn(void)
    jmp     short loc_45718F
loc_457185:
    mov     ecx, offset TheCamera             ; get address of TheCamera for thiscall
    call    CCamera::SetWideScreenOff         ; call CCamera::SetWideScreenOff(void)
loc_45718F:
    xor     al, al                            ; return 0

Keywords

set, toggle, widescreen, black bars, border