Log in

View Full Version : the trick for changing VTSs WITHOUT a dummy-PGC


Lord of the Discs
6th October 2003, 00:36
could be usefull in some cases, so check it out:


First Play PGC Command Table:

1.Pre Command If GPreg<X> = <0> then Goto line# Y
2.Pre Command If GPreg<X> = <1> then Goto line# 4
3.Pre Command If GPreg<X> = <2> then Goto line# 5
4.Pre Command (JumpTT) Jump to Title: (Movie 1)
5.Pre Command (JumpTT) Jump to Title: (Movie 2)
...
(begin of the original command table)
Y.Pre Command (blablabla and whatsoever)


Movie 1 PGC Command Table:
...
(end of the original command table)
Post Command Set GPreg<X> mov <2>
Post Command Call First-Play domain PGC


Movie 2 PGC Command Table:
...
(end of the original command table)
Post Command Set GPreg<X> mov <1>
Post Command Call First-Play domain PGC


Here comes the plain text for "common mortals":

Since you can not jump directly from one VTS to another, the solution
was to use a dummy-PGC in the VMG-domain (before I came ;D). It works,
but it is not easy to add a PGC to already authored DVD.

Actually, you just need the command table from the dummy-PGC, so my idea
is to "borrow a few lines" from the command table of an existing VMG-PGC.
The "First Play PGC" is always present so why not use it?

As you can see in the example above, the trick is to insert the needed
commands at the beginning of the First Play PGCīs command table.

The first one, "If GPreg<X> = <0> then Goto line# Y", cares for the
proper function of the original First Play sequence. (for the "X" you
take any unused GPRM, the "Y" is the new line number from the first of
the original commands and the GPRMs are always 0 when you insert a DVD).

The remaining commands should be changed to fit your needs, the above
example is an endless loop of 2 movies (you can break or jump out if
you want) and should just show how it can be done.

Donīt forget to add the adequate commands at the end of the movies.


Lord of the Discs

Eyes`Only
7th October 2003, 01:09
Nice tip, LoTD.

I checked out your website too, some nice information on it.

Lord of the Discs
7th October 2003, 22:27
Thanks, Eyes`Only,

I found a lot of free knowledge around here, back when I started,
so Iīm just giving some back, in return.

LotD

mdkusr
8th October 2003, 19:20
Yes, this works. Too bad that I found this thread today since I could have used it yesterday when I had to figure it out. Here is an example of the code I used:

This is what the Pre First PGC looks like:
1:Mov GPRM1, 1 #This sets GPRM1 to the value of 1

2:if (GPRM0 == GPRM1) JumpTT Title_1_1 #This compares GPRM0 & 1 and if both = 1, then go to Title_1_1

3:JumpTT Title_1 #If the above is false, then this command gets excuted instead, basically going to my menu title set.

Move to my Title Menu with the 'Play' button. I will only list what the play button does for this post:

1:LinkTailPGC, button=1 #When the play button is pushed, it then links to the 'Post' command of the current PCG

Move now to the Post commands of the current PCG:

1:SetGPRMMD RegisterMode GPRM0=1 #This sets GPRM0 to = GPRM1's value

2:CallSS RSM=1, FP_DOM #This returns control back to the First PCG

Move back to the First PCG now, and the second line will now ring true and instead of defaulting to Title_1, it will now jump to Title_1_1 instead:

1:Mov GPRM1, 1

2:if (GPRM0 == GPRM1) JumpTT Title_1_1 #This time we move to Title_1_1 since this value will be true

3:JumpTT Title_1

Now onto the PCG for Title_1_1 (The movie) Pre:

1:SetSTN audio=1, subpicture-1:OFF, angle=1 #This just sets the default tracks, and makes sure the Subtitles are off by default.

Move on to the Post of the movie PCG now:

1: SetGPRMMD RegisterMode GPRM0=0 #This resets GPRM0 back to the value of 0 before we return to the First PCG.

2 CallSS RSM=1, FP_DOM #This just jumps back to the first PCG again.


Now that we know that GPRM0 has a value of 0 again, the First PCG will skip the jump to Title_1_1 and again head back to my menu in the first VTS. Hopefully this helps someone.

-M

Lord of the Discs
8th October 2003, 22:36
Originally posted by mdkusr

1:SetGPRMMD RegisterMode GPRM0=1 #This sets GPRM0 to = GPRM1's value

This sets GPRM0 to a numerical value of 1 and has nothing to do with
GPRM1. Why donīt you just use "Set GPRM(0) mov (set-val) 1"?

mdkusr
9th October 2003, 00:52
The reason I did it that way is that I only needed to make GPRM0 equal to 1, which means I can then compare it to GPRM1 that has the same value and then use it to make the jump to Title_1_1. Does that make sense? I could have incremented it, but I just gave it a quick and dirty new value of 1 to see how it tests out - simple but effective to see how it works and how to make much more complicated projects. Besides, your math will never screw up if you use this method because it can be of only 1 value - in a complicated project, if you don't have to use math, don't, since you never know what the user is going to do and this can avoid bugs in the case of branching in a way you didn't expect.

The ultimate test is to see if you can do something as complicated as some of those animated videos, that have tons of extras.

-M

Lord of the Discs
9th October 2003, 18:55
Well, for me is the ultimate test to author an arcade game.
Iīm already on it, but must first finish upgrading my PC.

LotD

mdkusr
9th October 2003, 20:02
Funny! I'd like to play it if it works!

By the way, I see what you're saying above. I should use the Mov GPRM0, x command to be correct in my method. I totally agree since it's proper code, and my way is sort of incorrect, yet still gets the job done. I'll change it to your way from now on.

-M

Lord of the Discs
9th October 2003, 20:13
Yes, your command is meant for something else, see here:

http://forum.doom9.org/showthread.php?threadid=61725

And my game will take a few weeks ...

CU, LotD

mdkusr
10th October 2003, 15:53
Let me guess - Dragons Lair 2? :)

I really wish someone would remake Cliff Hanger - http://www.klov.com/game_detail.php?letter=C&game_id=7352 - This was the best LD game made, yet was hard to find.

-M

Lord of the Discs
11th October 2003, 00:57
AFAIK, Dragonīs Lair is more an interactive movie, Iīm talking about
a full-featured game, with levels and scores and so on ...

mdkusr
11th October 2003, 18:36
Wow! Good luck! It seems to me that you don't have enough varibles to work with as you would in a full featured language, but I'd definetly would like to see it.

-M

Lord of the Discs
20th October 2003, 01:19
Just to make my trick less complicated:

If you only want your DVD to play the 1st VTS, then the 2nd and
then stop, and you only have 1 Title (Movie) in each VTS (most
common case), here is the complete navigation for the whole disc:

First Play PGC Command Table:

1.Pre Command If GPreg<X> = <0> then Goto line# 3
2.Pre Command If GPreg<X> = <1> then Goto line# 4
3.Pre Command (JumpTT) Jump to Title: (1)
4.Pre Command (JumpTT) Jump to Title: (2)


Movie 1 PGC Command Table:

1.Post Command Set GPreg<X> mov <1>
2.Post Command Call First-Play domain PGC


Yes, 6 lines in 2 command tables and there you go!

LotD

Eyes`Only
20th October 2003, 02:20
Couldn't the first part be done in 3 lines?

1.Pre Command If GPreg<X> = <0> then Goto line# 3
2.Pre Command (JumpTT) Jump to Title: (2)
3.Pre Command (JumpTT) Jump to Title: (1)

mdkusr
20th October 2003, 04:38
Originally posted by Eyes`Only
Couldn't the first part be done in 3 lines?

1.Pre Command If GPreg<X> = <0> then Goto line# 3
2.Pre Command (JumpTT) Jump to Title: (2)
3.Pre Command (JumpTT) Jump to Title: (1)

Yep - you could and it's even more efficient this way.

-M

Eyes`Only
20th October 2003, 04:51
reminds me of old languages where you had to use goto and stuff.. thank god for modern languages with OOP and powerful loop functions!

Lord of the Discs
20th October 2003, 13:30
Hey guys, youīve done me! :)

Itīs centuries ago since I coded some C64-basic ...

CU, LotD

mdkusr
23rd October 2003, 03:58
C64? Wow, I must be really dating myself if i told you I was writing Basic on CP/M in 1978! :) I had dual 320K floppies, integrated monitor and 64K of mem in 1978! Beat that! Of course, by the time any lang was loaded and the OS, I had about 28K usable unless programming in machine lang, which i was too young to understand at the time, but I did program adventure titles that kept track of inventory (all text) and had roll playing elelments thrown in, but that's too much detail.

-M

PS. I guess i shouldn't get into Pascal the following year and a bit of Fortran? Does anyone remember these old langs?

Lord of the Discs
8th November 2003, 20:19
Originally posted by mdkusr
Funny! I'd like to play it if it works!

-M

Now you can, itīs here:

http://home.arcor.de/josef.braunstein/mygames.htm

Enjoy!

LotD

mdkusr
12th November 2003, 19:36
Played it. It is definitely interesting. So what's the plan? You get shot if you don't blow him up fast enough? :)

-Dan

Lord of the Discs
13th November 2003, 13:54
Weīre getting too far away from "changing VTSs without a dummy-PGC",
so Iīll continue in the other thread about my game, here:

http://forum.doom9.org/showthread.php?threadid=64697

2COOL
13th November 2003, 19:35
Originally posted by Lord of the Discs
could be usefull in some cases, so check it out:


First Play PGC Command Table:

1.Pre Command If GPreg<X> = <0> then Goto line# Y
2.Pre Command If GPreg<X> = <1> then Goto line# 4
3.Pre Command If GPreg<X> = <2> then Goto line# 5
4.Pre Command (JumpTT) Jump to Title: (Movie 1)
5.Pre Command (JumpTT) Jump to Title: (Movie 2)
...
(begin of the original command table)
Y.Pre Command (blablabla and whatsoever)


Movie 1 PGC Command Table:
...
(end of the original command table)
Post Command Set GPreg<X> mov <2>
Post Command Call First-Play domain PGC


Movie 2 PGC Command Table:
...
(end of the original command table)
Post Command Set GPreg<X> mov <1>
Post Command Call First-Play domain PGCThis endless loop edit has been brought up also in this previous guide (http://forum.doom9.org/showthread.php?s=&threadid=61238) though I did it after processing through DVD Shrink. Very similar. Though DVD Shrink had put break commands in the Title PGC Command tables, they could be omitted.

Lord of the Discs
17th January 2004, 19:56
For the case that somebody is still interested:

Originally posted by Eyes`Only
Couldn't the first part be done in 3 lines?

1.Pre Command If GPreg<X> = <0> then Goto line# 3
2.Pre Command (JumpTT) Jump to Title: (2)
3.Pre Command (JumpTT) Jump to Title: (1)
I recently found out that it can be done in only 2 lines:

1.Pre Command If GPreg<X> = <1> then Jump to Title: (2)
2.Pre Command (JumpTT) Jump to Title: (1)

LotD

EDIT: the 1.command is wrong, see my next post, below

maa
18th January 2004, 00:43
Originally posted by Lord of the Discs
[B]1.Pre Command If GPreg<X> = <1> then Jump to Title: (2)

Where on earth did you find that !

I spent an hour one day guessing at the HEX,
are you going to post it ?

cheers

maa

DnGermany
18th January 2004, 20:11
Thanks for the info. I will be using that for sure.

Lord of the Discs
18th January 2004, 20:31
Hold on, guys, it looks like, in this case, one can only
compare with another register, so it would go like this:

1.Pre Command If GPreg<X> != GPreg<Y> then Jump to Title: (2)
2.Pre Command (JumpTT) Jump to Title: (1)

where "Y" is any other unused (thus "0") register.


maa, here are some examples for you:

If GPreg<8> == GPreg<12> then Jump to Title: 1 [30 22 00 00 00 01 08 0c ]
If GPreg<1> != GPreg<4> then Jump to Title: 2 [30 32 00 00 00 02 01 04 ]

and if you donīt want to guess any more, then go
join mpucoderīs site ...

2COOL
18th January 2004, 21:43
You can also compare a GPreg with a SPreg/SPRM to jump to a Title. Here's the setup. ;)

http://www.dvd-replica.com/DVD/jumptt.php?p=3

Here's the SPreg/SPRM layout too if you want to know.

http://www.dvd-replica.com/DVD/sprm.php

maa
19th January 2004, 01:20
Ok - I thought so - the command is not possible, I knew about all the others because of the command robot :

http://www.dvd-replica.com/DVD/prepostcmd.php
(click on a command in one of the boxes)
it creats the HEX online !!

Isn't it great !?!

dnetzero
19th January 2004, 03:07
Nop, Exit, JumpTT, JumpVTS_TT, JumpVTS_PTT, JumpSS, and CallSS cannot be combined with GPRM compare operations where one of the operands is a constant value. In other words, you can do compare GPRM to GPRM and GPRM to SPRM (system parameter register) ONLY with the above instructions.

This is an unfortunate restriction by the DVD specifications (probably more due to the bit allocation of the opcode map matrix so that the number of bytes per instruction is fixed at 8 bytes). If the binary sequence is generated with the opcode map bit pattern, this would cause an invalid instruction. Most DVD players (at least the ones we tested) simply ignore the invalid instruction (same as nop) or worse execute incorrectly with disastrous result (taking the contents of a register instead of its immediate value).

Opcode bit pattern for Compare GPRM/SPRM JumpTT:
30 X2 00 00 00 TT RR SS
where X can be from 1-7 (1 is Bitwise AND, 2 is Equal, 3 is NOT EQUAL, etc).
TT is the title number from 1-127
RR is the first register operand and SS is the second register operand. SS can be either a GPRM or SPRM.

If one forces comparison by value by turning the most significant bit of X2 (compare equal code of 22 becomes A2) according to the opcode map matrix, this is an invalid instruction as clearly defined here (the instruction is marked as INVALID):
http://cvs.sourceforge.net/viewcvs.py/*checkout*/dvd/www/dvdinfo/vmi.html?content-type=text%2Fplain&rev=1.1

High-end authoring software such as Sonic Solutions Scenarist will check for these restrictions and disable the compare constant accordingly. That's why it costs $$$.
IFOEdit does not distinguish 30 A2 00 00 00 TT RR SS as an invalid instruction. It treats it as same as 30 22 00 00 00 TT RR SS.

If you want to save money and understand everything about DVD commands, check out the list of archives (the credit & reference section) at my Unofficial DVD specifications pages. These are the original archives which provide a lot more info and ORIGINAL CONTENTS for FREE (even though the archive looked disorganized and scary, probably abandoned) so you do not have to use mpucoder.

My DVD command set at dvd-replica does indicate that this operation is *NOT* allowed.

Hope this helps. On a site note, when I wrote the unofficial pages for dvd-replica, at least the DVD command set is not as scary as the Intel Pentium instructions, so hopefully less decoding problems.

2COOL
19th January 2004, 03:35
Originally posted by dnetzero
On a site note, when I wrote the unofficial pages for dvd-replica, at least the DVD command set is not as scary as the Intel Pentium instructions, so hopefully less decoding problems. From the start, I had a feeling you had something to with dvd-replica. You really sounded like you definitely knew alot of details concerning the commands. With only 2 posts up to date since Oct 2003, you've certainly been lurking around for a while. Thanks for joining us here at Doom9 dnetzero. :D

maa
19th January 2004, 09:35
@dnetzero,
thanks again for the great site !

dnetzero
19th January 2004, 21:15
Thank you all for your kind words.

Feel free to email me at my web site (use the webmaster address) for any questions/comments/suggestions regarding DVD commands. Due to my current heavy workload, please allow some lag times before my response, usually 1-2 days.

By the way, Happy New Year 2004 (sorry, I am late as usual).
Best Regards