Log in

View Full Version : Hightlight button depending on selection


ImAhNoBoDy
22nd February 2013, 02:55
I added 2 buttons to a DVD and would like to know how to have a button highlighted automatically depending on which button was selected. What I want is when you enter the Language/Audio menu, button 1 should be highlighted. If you select either button 1 or 2, button 6 is hightlighted. If you select any buttons from 3 - 6, then button 7 should be highlighted.

The original commands look like this for the menu in PGCEdit:
VTSM 3 , LU 1 (en) , 7 (0:00) 6b. - Chapters: n/a, Programs: 1, Cells: 1

********** pre commands:
1 Set gprm(6) =(mov) 0
2 Set gprm(0) =(mov) 99
3 if ( gprm(0) == gprm(5) ) then { Goto line 12 }
4 Set gprm(0) =(mov) 100
5 if ( gprm(0) == gprm(5) ) then { Goto line 27 }
6 NOP
7 NOP
8 NOP
9 NOP
10 NOP
11 NOP
12 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
13 Set gprm(0) &=(and) 63
14 Set gprm(1) =(mov) 0
15 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1) }
16 Set gprm(1) =(mov) 1
17 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 2048 (button 2) }
18 Set gprm(1) =(mov) 2
19 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 3072 (button 3) }
20 NOP
21 NOP
22 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
23 Set gprm(0) &=(and) 64
24 Set gprm(1) =(mov) 0
25 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 4096 (button 4) }
26 Goto line 28
27 (SetHL_BTN) Set Highlighted Button =(mov) 5120 (button 5)
28 NOP
********** post commands:
********** cell commands:

********** menu buttons commands:
VOB ID 4, Cell ID 1 (First NAV pack LBA=25606)
2 Groups, Select button=0, Action button=0, 6 numerically selectable buttons.
1: Set gprm(2) =(mov) 1 ; LinkPGCN PGC 8
2: Set gprm(2) =(mov) 2 ; LinkPGCN PGC 8
3: Set gprm(2) =(mov) 3 ; LinkPGCN PGC 8
4: Set gprm(2) =(mov) 5 ; LinkPGCN PGC 8
5: LinkPGCN PGC 6
6: Set gprm(0) =(mov) 0 ; LinkPGCN PGC 1
VTSM 3 , LU 1 (en) , 8 (dummy) - Chapters: n/a, Programs: 0, Cells: 0

********** pre commands:
1 Set gprm(5) =(mov) 100
2 Set gprm(0) =(mov) 5
3 if ( gprm(2) != gprm(0) ) then { Goto line 16 }
4 NOP
5 NOP
6 NOP
7 NOP
8 NOP
9 NOP
10 NOP
11 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
12 Set gprm(0) &=(and) 63
13 (SetSTN) Set Sub-picture stream = gprm(0)
14 Goto line 22
15 NOP
16 Set gprm(0) =(mov) 1
17 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 0, on }
18 Set gprm(0) =(mov) 2
19 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 1, on }
20 Set gprm(0) =(mov) 3
21 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 2, on }
22 Set gprm(2) =(mov) 0
23 Set gprm(12) =(mov) sprm(1:Audio stream number)
24 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
25 LinkPGCN PGC 7
********** post commands:
********** cell commands:

I edited the 2 PGC to look like this in PGCEdit:
VTSM 3 , LU 1 (en) , 7 (0:00) 8b. - Chapters: n/a, Programs: 1, Cells: 1

********** pre commands:
1 Set gprm(6) =(mov) 0
2 Set gprm(0) =(mov) 99
3 if ( gprm(0) == gprm(5) ) then { Goto line 12 }
4 Set gprm(0) =(mov) 100
5 if ( gprm(0) == gprm(5) ) then { Goto line 31 }
6 NOP
7 NOP
8 NOP
9 NOP
10 NOP
11 NOP
12 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
13 Set gprm(0) &=(and) 63
14 Set gprm(1) =(mov) 0
15 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1) }
16 Set gprm(1) =(mov) 1
17 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 2048 (button 2) }
18 Set gprm(1) =(mov) 2
19 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 3072 (button 3) }
20 Set gprm(1) =(mov) 3
21 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 4096 (button 4) }
22 Set gprm(1) =(mov) 4
23 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 5120 (button 5) }
24 NOP
25 NOP
26 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
27 Set gprm(0) &=(and) 64
28 Set gprm(1) =(mov) 0
29 if ( gprm(1) == gprm(0) ) then { (SetHL_BTN) Set Highlighted Button =(mov) 6144 (button 6) }
30 Goto line 32
31 (SetHL_BTN) Set Highlighted Button =(mov) 7168 (button 7)
32 NOP
********** post commands:
********** cell commands:

********** menu buttons commands:
VOB ID 4, Cell ID 1 (First NAV pack LBA=25606)
2 Groups, Select button=0, Action button=0, 8 numerically selectable buttons.
1: Set gprm(2) =(mov) 12 ; LinkPGCN PGC 8
2: Set gprm(2) =(mov) 11 ; LinkPGCN PGC 8
3: Set gprm(2) =(mov) 1 ; LinkPGCN PGC 8
4: Set gprm(2) =(mov) 2 ; LinkPGCN PGC 8
5: Set gprm(2) =(mov) 3 ; LinkPGCN PGC 8
6: Set gprm(2) =(mov) 5 ; LinkPGCN PGC 8
7: LinkPGCN PGC 6
8: Set gprm(0) =(mov) 0 ; LinkPGCN PGC 1
VTSM 3 , LU 1 (en) , 8 (dummy) - Chapters: n/a, Programs: 0, Cells: 0

********** pre commands:
1 Set gprm(5) =(mov) 100
2 Set gprm(0) =(mov) 5
3 if ( gprm(2) != gprm(0) ) then { Goto line 16 }
4 NOP
5 NOP
6 NOP
7 NOP
8 NOP
9 NOP
10 NOP
11 Set gprm(0) =(mov) sprm(2:Sub-picture stream number)
12 Set gprm(0) &=(and) 63
13 (SetSTN) Set Sub-picture stream = gprm(0)
14 Goto line 26
15 NOP
16 Set gprm(0) =(mov) 1
17 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 0, on }
18 Set gprm(0) =(mov) 2
19 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 1, on }
20 Set gprm(0) =(mov) 3
21 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Sub-picture stream = 2, on }
22 Set gprm(0) =(mov) 11
23 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 1 }
24 Set gprm(0) =(mov) 12
25 if ( gprm(2) == gprm(0) ) then { (SetSTN) Set Audio stream = 0 }
26 Set gprm(2) =(mov) 0
27 Set gprm(12) =(mov) sprm(1:Audio stream number)
28 Set gprm(13) =(mov) sprm(2:Sub-picture stream number)
29 LinkPGCN PGC 7
********** post commands:
********** cell commands:

I did check other topics on this issue for several days, but couldn't mimic other people's commands. I did try to add "(SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1)" at the beginning of "VTSM 3 , LU 1 (en) , 7", but that didn't work. Right now when you enter the menu, button 6 is highlight and if you select any buttons from 1 - 6 it will highlight button 7. Can anyone help me out? I'm using PGCEdit to edit the commands. Thanks.

r0lZ
23rd February 2013, 13:46
It seems that gprm(5) is the key. In the original authoring (and in your edited version), it is tested, and if it is equal to 100, it jumps to line 27, where button 5 is highlighted. Unfortunately, I don't know what gprm(5) is supposed to hold, and when it is changed, so I can't help much more. But you forgot probably to update it in PGC 8 (or elsewhere later). Perhaps the value of gprm(2) is tested at some point, and if it is 1, 2, 3 or 5, the value of gprm(5) is updated accordingly. Since the values of gprm(2) added by you are 11 and 12, they may be not tested, and the value of gprm(5) is not correctly updated.

Use the trace (with the Watch window opened) to check what's the value of gprm(5) when one of the original subtitle streams is selected, and when a new subtitle is selected. I guess the value will be different. If it's the case, in trace mode, tick the Breakpoints -> GPRM Write Breakpoints -> GPRM 5 option. That will force the trace to stop when gprm(5) is changed. Launch the trace and again select one of the original subtitle stream. Run the trace up to the point where it will stop automatically due to the gprm(5) change. It's probably in that PGC that you have to modify some commands to update gprm(5) according to the values 12 and 13 hold by gprm(2) with your new subtitles.

Good luck!

ImAhNoBoDy
23rd February 2013, 20:58
It seems that gprm(5) is the key. In the original authoring (and in your edited version), it is tested, and if it is equal to 100, it jumps to line 27, where button 5 is highlighted. Unfortunately, I don't know what gprm(5) is supposed to hold, and when it is changed, so I can't help much more. But you forgot probably to update it in PGC 8 (or elsewhere later). Perhaps the value of gprm(2) is tested at some point, and if it is 1, 2, 3 or 5, the value of gprm(5) is updated accordingly. Since the values of gprm(2) added by you are 11 and 12, they may be not tested, and the value of gprm(5) is not correctly updated.

Use the trace (with the Watch window opened) to check what's the value of gprm(5) when one of the original subtitle streams is selected, and when a new subtitle is selected. I guess the value will be different. If it's the case, in trace mode, tick the Breakpoints -> GPRM Write Breakpoints -> GPRM 5 option. That will force the trace to stop when gprm(5) is changed. Launch the trace and again select one of the original subtitle stream.
When I ran trace on the original menu, I saw when I first entered the menu, gprm 5 is the value of 0 and button 4 is highlighted. When I choose any buttons from 1 - 4 it goes to "VTSM 3, 8" and gprm 5 is set to the value of 100 and stays like that when it goes to "VTSM 3, 7", then button 5 is always highlighted anytime I select buttons from 1-4. If I go back to the main menu and go back to the menu the highlight goes to the last button selected.

The same behavior happens on the edited version and the values are exactly the same for gprm 5. I'm not sure what value to change.
Run the trace up to the point where it will stop automatically due to the gprm(5) change. It's probably in that PGC that you have to modify some commands to update gprm(5) according to the values 12 and 13 hold by gprm(2) with your new subtitles.

Good luck!
I know that gprm value is changed when it goes to "VTSM 3, 8", but I don't know what to change it to :( Can you help me out a little more?

There are only 2 other places that gprm 5 is used:
VTSM 3 , LU 1 (en) , 1 (dummy) RootM - Chapters: n/a, Programs: 0, Cells: 0

********** pre commands:
1 (SetHL_BTN) Set Highlighted Button =(mov) 1024 (button 1)
2 Set gprm(0) =(mov) 1
3 NOP
4 if ( gprm(0) == gprm(8) ) then { (SetSTN) Set Audio stream = gprm(12) ; Set Sub-picture stream = gprm(13) }
5 Set gprm(1) =(mov) 0
6 Set gprm(2) =(mov) 0
7 Set gprm(5) =(mov) 0
8 Set gprm(7) =(mov) 0
9 Set gprm(4) =(mov) 0
10 Set gprm(8) =(mov) 0
11 Set gprm(0) =(mov) 999
12 if ( gprm(6) == gprm(0) ) then { LinkPGCN PGC 4 }
13 LinkPGCN PGC 5
********** post commands:
********** cell commands:
VTSM 3 , LU 1 (en) , 3 (dummy) SubPicM - Chapters: n/a, Programs: 0, Cells: 0

********** pre commands:
1 Set gprm(1) =(mov) 0
2 Set gprm(2) =(mov) 0
3 Set gprm(5) =(mov) 99
4 LinkPGCN PGC 7
********** post commands:
********** cell commands:

r0lZ
23rd February 2013, 22:08
Sorry, but no, I can't help more without the DVD.

Are you sure the original DVD works as you want it?

ImAhNoBoDy
24th February 2013, 00:57
Ah, ok.

The original didn't have any buttons for the audio, so I added them. I just wanted to see if I was able to choose an audio stream, then a subtitle stream, and have it highlight the episode button after that. Currently the original just highlights a subtitle in the menu and whatever you choose, it highlights the episode button.

Thanks r0lZ, I will keep figuring it out with what you have already told me. Hopefully I will be able to.