Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play - Implement J(x) P(y) - Protected Jump #179

Open
SciLor opened this issue Mar 12, 2018 · 5 comments
Open

Play - Implement J(x) P(y) - Protected Jump #179

SciLor opened this issue Mar 12, 2018 · 5 comments

Comments

@SciLor
Copy link

SciLor commented Mar 12, 2018

The protected jump J(x) P(y) doesn't seem to be implemented, so you can't test script using it.
I am sorry that I cannot test the code on the tiptoi itself. I will test it when I have it here, to know whats the "right" behaviour.

Code

  haus_bild:
  - $playing==1?
  - $playing:=1 J(_haus_bild) P(nop)
  _haus_bild:
  - J(_resetPlaying) P(b) P(wait_1000ms) P(wie_in) P(wait_0200ms) P(bild)

  _resetPlaying:
  - $playing:=0 J(_random) P(nop)
  
  _random:
  - T($r,65535) $random+=$r $random*=25173 $random+=13849 $nextId2:=$random $nextId2%=2 $nextId3:=$random $nextId3%=3

Reaction

Executing:  $2:=1 J(3948) P(60)
Executing:  J(3998) P(4) P(101) P(105) P(99) P(6)
Executing:  $2:=0 J(3997) P(60)
Executing:  T($3,65535) $4+=$3 $4*=25173 $4+=13849 $0:=$4 $0%=2 $1:=$4 $1%=3
State now: $0=1 $1=2 $4=31223
@nomeata
Copy link
Member

nomeata commented Mar 15, 2018

I actually don't fully understand the “protected jump”. Maybe someone should write a proper documentation in the book first :-)

@SciLor
Copy link
Author

SciLor commented Mar 15, 2018

If I have some time to play with it, I will post some infos for you here

@SciLor
Copy link
Author

SciLor commented Mar 18, 2018

I have played around a bit and found following (using the newer tiptoi)

-Only one J(ump) per line is allowed. If multiple Js are found, only the last one is taken.
-You need to place at least one valid P(lay) after a jump or it waits about 2 seconds
-A wav with the length of 1ms is too short, I needed at least 5ms (for my nop)

So the J(ump)-Command just seem to set a register, where to jump after the line.

  a:
  - J(_haus_apfel) P(nop)
  _haus_apfel:
  - P(a) P(wait_1000ms) P(wie_in) P(wait_0200ms) P(apfel) P(wait_1000ms) J(_haus_apfel2) P(nop)
  _haus_apfel2:
  - J(_anything) P(biss_kauen) P(wait_0500ms) P(koestlich) P(wait_1000ms) P(huh_bin_ich_satt)

What the tiptoi plays:
a, wie in, apfel, biss_kauen, koestlich, huh_bin_ich_satt

What your simulation plays:
a, wie in, apfel, (aborted, because you jump immediatelly)

@exolab
Copy link

exolab commented Feb 17, 2020

-You need to place at least one valid P(lay) after a jump or it waits about 2 seconds
-A wav with the length of 1ms is too short, I needed at least 5ms (for my nop)

That fixed all my problems with annoying delays.

If you don't happen to have an ogg lying around, you can generate it like this:

ffmpeg -f lavfi -i anullsrc -t 5ms -ar 22050 -c:a libvorbis audio/5ms.ogg

@nomeata
Copy link
Member

nomeata commented Nov 7, 2020

Now also tracked at #231

tbleher pushed a commit to tbleher/tip-toi-reveng that referenced this issue Dec 1, 2020
The J() command is executed after all other commands in the line have
executed. The 2s pause if no P() follows J() (as documented in
entropia#179 (comment))
is not implemented yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants