Difference between revisions of "02A3"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
{{OpCode
 
{{OpCode
| ini        = 02A3=1,%1d%
+
| games      = {{Icon|t}}
| description = Sets widescreen mode
+
| command    = SWITCH_WIDESCREEN
| p1          = Flag
+
| description = Enables widescreen
| game        = GTA3, Vice City, San Andreas
+
| syntax1    = 02A3: enable_widescreen [''int'']
| native      = [[SET_WIDESCREEN_BORDERS]]
+
| p1t        = [''int'']
 +
| p1d        = 0 = off, {{hint|1|or any value other than 0}} = on
 
}}
 
}}
This opcode can enable widescreen mode in the game. It is mainly used for cutscenes to make it look like a movie. If widescreen is enabled, the HUD and radar will be disabled and the game can not be paused.
 
  
==Flags==
+
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.
'''Flag 0''': Disables widescreen<br>
 
'''Flag 1''': Enables widescreen
 
[[Image:Widescreen.png|none|Widescreen]]
 
  
==Keywords==
+
Widescreen effect in Vice City:
 +
{|class="wikitable"
 +
!0 ||1
 +
|-
 +
|[[File:VCWidescreenOff.jpg|256px]] ||[[File:VCWidescreenOn.jpg|256px]]
 +
|}
 +
 
 +
== Disassembled code ==
 +
These are disassembled code for this opcode both from PC v1.0 US.
 +
=== 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>
 +
 
 +
=== Vice City ===
 +
<syntaxhighlight lang="nasm">
 +
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
 
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