Coding

 Reply to this postStart new topic

Playing Videos via SCM

Deji
post Jun 9 2011, 12:53 AM
Post #1


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Playing Videos via SCM


Some credit goes to Sergey81 at Sanny Builder Forums for giving me the idea to investigate. Rest goes to me... mwuhahaa, lol.

SANNY
0A8C: write_memory 0xB5F852 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x748BC5 size 2 value 0x13C virtual_protect 1
0AA5: call 0x747660 num_params 2 pop 2 "movies\\Logo.mpg" 0
0A8C: write_memory 0xC8D4C0 size 1 value 4 virtual_protect 0
003D:
0AA5: call 0x746740 num_params 0 pop 0
0A8C: write_memory 0xBA677B size 1 value 0 virtual_protect 0
0A8C: write_memory 0xB5F852 size 1 value 0 virtual_protect 0


You might be thinking "can I play 700MB avi movies with this". Well, for your information.. you can. Awsum.


--------------------
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 03:21 AM
Post #2


Ameteur Member

Posts: 54
Joined: 8-January 11



@Deji - I still see the video for 1 second only while minimize-maximize the game.

Besides, in original intro movies i have sound only, any idea how to fix this?
Go to the top of the page
 
+Quote Post
Deji
post Jun 9 2011, 04:02 AM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Umm.. That is the problem that occurs from only using this line:
SANNY
0AA5: call 0x747660 num_params 2 pop 2 "movies\\Logo.mpg" 0


Use the whole code I posted to fix.


--------------------
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 04:18 AM
Post #4


Ameteur Member

Posts: 54
Joined: 8-January 11



Well, i use all code from 1st post, here is what happens:
SANNY
{$cleo}
0000:
wait 1000


while true
    wait 0
      
                                                                                                                      
    if
        0AB0:  key_pressed 9      
    then
0A8C: write_memory 0xB5F852 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x748BC5 size 2 value 0x13C virtual_protect 1
0AA5: call 0x747660 num_params 2 pop 2 "movies\\intro.avi" 0
0A8C: write_memory 0xC8D4C0 size 1 value 4 virtual_protect 0
003D:
0AA5: call 0x746740 num_params 0 pop 0
0A8C: write_memory 0xBA677B size 1 value 0 virtual_protect 0
0A8C: write_memory 0xB5F852 size 1 value 0 virtual_protect 0
0A93:
    end
    
    if
        0AB0:  key_pressed 16      
    then
    
wait 600
    end
    
    
end

Game starts, i pressed Tab, game freezes, i hear sound, but no video. I minimize the game by pressing Win button, then maximize it. And now i see video with sound.
For example, the same issue - http://forums.steampowered.com/forums/show...d.php?t=1839482

This post has been edited by ThirteenAG: Jun 9 2011, 04:20 AM
Go to the top of the page
 
+Quote Post
Deji
post Jun 9 2011, 05:22 AM
Post #5


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Well, the code you gave me didn't seem to work... but only because 0AB0 returned false when I was pressing tab... strange. Anyway, this works fine:

SANNY
wait 1000
while true
    wait 0
    if
        0AB0:  key_pressed 1
    then
        0A8C: write_memory 0xB5F852 size 1 value 1 virtual_protect 0
        0A8C: write_memory 0x748BC5 size 2 value 0x13C virtual_protect 1
        0AA5: call 0x747660 num_params 2 pop 2 "movies\\GTAtitles.mpg" 0
        0A8C: write_memory 0xC8D4C0 size 1 value 4 virtual_protect 0
        003D:
        0AA5: call 0x746740 num_params 0 pop 0
        0A8C: write_memory 0xBA677B size 1 value 0 virtual_protect 0
        0A8C: write_memory 0xB5F852 size 1 value 0 virtual_protect 0
        0A93: end_custom_thread
    end
    if
        0AB0:  key_pressed 16
    then
        wait 600
    end
end


What versions of cleo.asi and gta_sa.exe do you have?


--------------------
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 05:53 AM
Post #6


Ameteur Member

Posts: 54
Joined: 8-January 11



I tested it on cleo4 and 1.0us.
In my main version with 1.0us/latest cleo3 that code crashed the game for some reason.
Go to the top of the page
 
+Quote Post
Deji
post Jun 9 2011, 09:57 AM
Post #7


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Well the videos not playing thing seems to be specific to you (since it was happening to the original intro movies). Not sure how to go about fixing that.


--------------------
Go to the top of the page
 
+Quote Post
Silent
post Jun 9 2011, 12:39 PM
Post #8


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



No, it duz not work fine for me aswell tongue.gif CLEO4 and 1.0 US HOODLUM.

@ThirteenAG
On CLEO3 code crashes because of direct string input to 0AA5. On 3, you must use pointer to string instead.
Go to the top of the page
 
+Quote Post
fastman92
post Jun 9 2011, 01:15 PM
Post #9


Trained Member

Posts: 77
Joined: 25-October 10



I want to note that GTA San Andreas has bug, if antialiasing is on then only audio from video will play. Instead of view there will be black screen.

It doesn`t work for me as well. I have CLEO4 and GTA San Andreas v1.0 [US] HOOLDRUM No-CD Fixed EXE

This post has been edited by fastman92: Jun 9 2011, 01:39 PM
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 02:01 PM
Post #10


Ameteur Member

Posts: 54
Joined: 8-January 11



QUOTE (Silent @ Jun 9 2011, 01:39 PM) *
No, it duz not work fine for me aswell tongue.gif CLEO4 and 1.0 US HOODLUM.

@ThirteenAG
On CLEO3 code crashes because of direct string input to 0AA5. On 3, you must use pointer to string instead.

You mean something like this?
SANNY
0AA5: call 0x747660 num_params 2 pop 2 3@s 0
?


QUOTE (fastman92 @ Jun 9 2011, 02:15 PM) *
I want to note that GTA San Andreas has bug, if antialiasing is on then only audio from video will play. Instead of view there will be black screen.

It doesn`t work for me as well. I have CLEO4 and GTA San Andreas v1.0 [US] HOOLDRUM No-CD Fixed EXE

I disabled antialiasing, video shows up. It remains to find how to disable antialiasing via opcodes and turn it back after playing video.
Go to the top of the page
 
+Quote Post
DK22
post Jun 9 2011, 02:32 PM
Post #11


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Nice find, Deji!
Now I wanna to make missions with video-cutscenes smile.gif
Gonna try it tommorow.
Btw, as gtamodding says,
CODE
0xBA6814 - [byte] Antialiasing values:
1 = 0x (off)
2 = 1x
3 = 2x
4 = 3x

Dunno if it read-only, didn't test.

This post has been edited by DK22: Jun 9 2011, 02:33 PM
Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 02:44 PM
Post #12


Ameteur Member

Posts: 54
Joined: 8-January 11



I found the way.
SANNY
{$cleo}
0000:
wait 1000


while true
    wait 0
      
                                                                                                                      
    if
        0AB0:  key_pressed 9      
    then
0A8D: 10@ = read_memory 0xBA6814 size 1 virtual_protect 0
0AA5: call 0x7F8A90 num_params 1 pop 1 1
wait 1000    
0A8C: write_memory 0xB5F852 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x748BC5 size 2 value 0x13C virtual_protect 1
0AA5: call 0x747660 num_params 2 pop 2 "movies\\intro.avi" 0
0A8C: write_memory 0xC8D4C0 size 1 value 4 virtual_protect 0
003D:
0AA5: call 0x746740 num_params 0 pop 0
0A8C: write_memory 0xBA677B size 1 value 0 virtual_protect 0
0A8C: write_memory 0xB5F852 size 1 value 0 virtual_protect 0

while true
wait 0
0A8D: 0@ = read_memory 0xB5F852 size 1 virtual_protect 0
if
0@ == 0
then
0AA5: call 0x7F8A90 num_params 1 pop 1 10@
0A93:
end

end

//0A93:
    end
    
    if
        0AB0:  key_pressed 16      
    then
    
wait 600
    end
    
    
end


This post has been edited by ThirteenAG: Jun 9 2011, 03:05 PM
Go to the top of the page
 
+Quote Post
Silent
post Jun 9 2011, 03:16 PM
Post #13


The master of cut retort

Group Icon

Posts: 239
From: Warsaw, PL
Joined: 21-July 10



QUOTE (ThirteenAG @ Jun 9 2011, 03:01 PM) *
You mean something like this?
SANNY
0AA5: call 0x747660 num_params 2 pop 2 3@s 0
?



Nah. I mean something like this.

SANNY
0A9F: 0@ = current_thread_pointer
000A: 0@ += 0x10
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
000E: 0@ -= @STRING
0AA5: call 0x747660 num_params 2 pop 2 0@ 0

[...]

:STRING
hex
"movies\\intro.avi" 00
end

Go to the top of the page
 
+Quote Post
ThirteenAG
post Jun 9 2011, 03:22 PM
Post #14


Ameteur Member

Posts: 54
Joined: 8-January 11



Yeah, i figured, from this topic - http://sannybuilder.com/forums/viewtopic.php?id=892
Thanks everyone for the help, looks like i'll put "The Introduction" before first cutscene after all. smile.gif
Go to the top of the page
 
+Quote Post
Deji
post Jun 12 2011, 07:53 PM
Post #15


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



QUOTE (Silent @ Jun 9 2011, 04:16 PM) *
Nah. I mean something like this.

SANNY
0A9F: 0@ = current_thread_pointer
000A: 0@ += 0x10
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
000E: 0@ -= @STRING
0AA5: call 0x747660 num_params 2 pop 2 0@ 0

[...]

:STRING
hex
"movies\\intro.avi" 00
end


SANNY
0AA5: call 0x747660 num_params 2 pop 2 3@s 0


Would work fine. As would:
SANNY
0AA5: call 0x747660 num_params 2 pop 2 "movies\\video.mpg" 0


So long as CLEO 4 is being used tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Jun 13 2011, 01:09 AM
Post #16


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



For me, video works as when AA is 3x same as it offed.
But it must be .mpg.
Go to the top of the page
 
+Quote Post
DK22
post Jul 7 2011, 07:44 PM
Post #17


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Sorry for double-post.
I have some problem with this.
When the video ends, then, I see the screen - that screen, that I see after original start videos, and them my game crashes. Seems you posted incorrect jump offset there?
Go to the top of the page
 
+Quote Post
Deji
post Jul 8 2011, 04:37 PM
Post #18


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



It works fine for 1.0 US HOODLUM but it won't work with all exe's. What is the size of yours?


--------------------
Go to the top of the page
 
+Quote Post
DK22
post Jul 8 2011, 04:46 PM
Post #19


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



14 383 616 bytes. Won't work on it?
Go to the top of the page
 
+Quote Post
Deji
post Jul 8 2011, 06:06 PM
Post #20


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



It should. It did with mine. Try this instead (untested):
SANNY
0A8C: write_memory 0xB5F852 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x748BC5 size 2 value 0x137 virtual_protect 1
0AA5: call 0x747660 num_params 2 pop 2 "movies\\Logo.mpg" 0
0A8C: write_memory 0xC8D4C0 size 1 value 4 virtual_protect 0
003D:
0AA5: call 0x746740 num_params 0 pop 0
0A8C: write_memory 0xBA677B size 1 value 0 virtual_protect 0
0A8C: write_memory 0xB5F852 size 1 value 0 virtual_protect 0

If it crashes, post the error information.

Funny thing, SA version 1.1 has that same "audio only" problem in intro movies.


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: