All your base are belong to pi.
Download package (C++ input parser and script file): http://tasvideos-moviefiles.googlecode.com/files/piscript.zip
Information that is even more technical than what is covered here: Forum/Posts/342003

Goals

  • Pi
  • Pi
  • Pi

About the TAS

Well, this TAS is a bit different. Instead of ponies, you get pi.

What in the name of pi is going on

To hijack program control, you need two things:
  • A way to divert the program counter (PC) into RAM.
  • A way to write the right program.
Conventional thinking (such as in p4wn3r's 1:09.63 TAS) has shown that the address D36D-D36E is a well-used gateway to send the PC into RAM. Just put any 16-bit number there (little-endian) and the PC will jump to whatever it says when you close the menu. Furthermore, using memory-manipulation glitches such as switching Pokemon beyond the 6th position, and switching and tossing glitched items, you can pretty much write whatever you want from D16A onward. And how do you switch Pokemon beyond the 6th position, if such a thing is even imaginable? Just do a reset at the right time while saving and it will overwrite the Pokemon counter so the game thinks you have 255 Pokemon.
I inject the following sequence into D366 (don't ask): 22 00 76 00 F0 F5 D4 50 D3
Provided that the bytes from D350 to D365 are all 00 (which they are), these 9 bytes will magically hijack the GB and give you complete control of everything you ever wanted, only limited by the GB's hardware. Other sequences including shorter ones exist but I chose this sequence to be as fast as possible. To help out, the rival is given a completely illogical name.
Once the sequence is planted, I close the menu. The game reads D350 off the gateway address and thinks that it is a valid ROM address and so jumps there. The sequence and all future programs are craftily hacked together in a way that is hard to describe casually, so I'll just say this: given enough room (which I have more than enough of), you can write a very simple RAM-writing program. Congrats, you can now write whatever you want.
The payload (final program), which is only 152 bytes long, is a simple VRAM manipulator. It starts out by writing into the tile bank at positions F3-F7 the 8x8 tiles for pi, pi upside down, decimal point, zero, and one, where the last 3 are in Pokemon font (they were somehow erased after leaving the menu; none of the other digits were harmed). The program then enters an input-interactive state where you can feed it key input which can change the tile map. For this TAS, visible tilemap is practially divided into two spaces: topspace (top 12 rows) and bottomspace (bottom 6 rows). The two columns on both sides are unusable. For technical reasons, the bottomspace effectively extends below the bottom of the screen by two rows.
It works somewhat like this (0x means hexadecimal):
  • Feeding it a number from 0x00 to 0xED writes to a cache (at D600) representing the bottomspace (8 rows by 16 columns). Each number writes the tile for either pi or pi upside down in the cache at a given position. The cache exists in order to sync the bottomspace input. To perform a do-nothing-visible action, feed it the number 0xED. It writes off the bottom of the screen.
  • Feeding it the number 0xEE dumps the cache into bottomspace and clears it with the all-black tile.
  • Feeding it the number 0xEF ends the program. It fakes a GB crash and sends itself into an infinite loop.
  • Feeding it a number from 0xF0 to 0xFF writes directly to topspace (12 rows by 16 columns). Each number writes its own value (tile values F5-FF which are decimal point and digits) to the first available position in topspace. It writes serially (left to right, then top to bottom).
There is no guarantee that VRAM writing occurs in a safe (to a real GB) manner; it does not check for status of FF40-FF41 (for reference, pages 51-53 of http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf ).
Anyway, scripting VRAM to do what I want is a bit too hard to do entirely with manual hex-editing, so I wrote a simple C++ parser that converts ANSI (ASCII) into input. This allows me to use a text editor instead, and organize the script using characters that the parser ignores.

About the script used

I did my best to sync the "actions" of the tiles with the background music. First, note that dumping cache to bottomspace and writing directly to topspace cannot occur on the same frame, so they must be at least one frame apart.
Second, placing the frame on which the tile appears and the frame on which the peak of a sound effect first occurs on the same frame is not guaranteed to be perceived as sync. The human brain does not work that way. From my own testing, it seems best for the frame on which the tile appears to occur 5 or 6 frames back. Results may vary by person, state of mind, and method of encoding of course.
The normal beat window is 15 frames (this is the width between the first two notes of the Pokemon music when you start in the bedroom). This means that, when syncing to a 15-frame beat, each frame is limited to dumping 14 tiles into VRAM. Some notes occur with a window of 7-8 frames; I can pull this off early on, but I decided that later on it was too much of a hassle to maintain so I ignored those notes.
I threw in a few references to pi, games, or mathematical stuff that can easily be represented by dot matrix display. Otherwise, there's not much else to talk about. For more information about technical details, see this post: Forum/Posts/342003.
Well anyway, enjoy the TAS and help yourself to some pi. It's a neat soundclip from the Hard n' Phirm song "Pi"; however, you shouldn't look for the rest of the song or its music video unless you are willing to lose a few brain cells. You can also listen to "Mathematical Pi" if you wish.
Happy Pi Day!

Nach: Accepting as improvement to existing run.


Hoandjzj
He/Him
Experienced player (659)
Joined: 4/6/2010
Posts: 240
This is so awesome! :D
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Next we need to award 3.14 pesos to whoever can give us a mathematical formula that when you run Pi through it, it generates the BGM we heard.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Spikestuff wrote:
Nach wrote:
I'd like to note that we've currently had 3 ponies respond to this submission, and one of those ponies responded multiple times, which sort of makes the amount of pony responses to a potentially pony obsoleting run a bit above 3...
Hey, hey, hey... slash cat :3
Well on that note, this screenshot is taken from the Bionic Commando level where you can be a cat burglar:
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Synahel
She/Her
Former player
Joined: 1/19/2011
Posts: 260
Location: France
This is why I love this site, damnit I don't have words to describe the awesomeness, happy Pi-day!
NitroGenesis
He/Him
Editor, Experienced player (556)
Joined: 12/24/2009
Posts: 1873
1998 film was better, voting no
YoungJ1997lol wrote:
Normally i would say Yes, but thennI thought "its not the same hack" so ill stick with meh.
Editor, Experienced player (860)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Way better than the total-control movie. Voting YES so that this movie obsoletes it.
Joined: 2/18/2010
Posts: 156
Location: home
Voting yes for dancing pi's
My user name is rather long, feel free to call me by htwt or tape.
Skilled player (1743)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Wait, why is this using a somewhat obsoleted emulator? If this gets accepted, what's the point of this other Pokemon Yellow run being made in BizHawk? I'm confused.
Noxxa
They/Them
Moderator, Expert player (4128)
Joined: 8/14/2009
Posts: 4090
Location: The Netherlands
jlun2 wrote:
Wait, why is this using a somewhat obsoleted emulator? If this gets accepted, what's the point of this other Pokemon Yellow run being made in BizHawk? I'm confused.
VBA is not deprecated.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Former player
Joined: 3/27/2010
Posts: 270
I definitely agree to voting yes on this, as well as voting to obsolete le publication here. They're both great in each others own way. Taking into account the movies themselves, instead of the pi references :p ... The current publication (see above) takes way too long in my opinion to get its result compared to this one. I will say that it was more mind blowing than this one, but that was because it was the first time I/we have ever seen something like that. Not to mention, we have dancing pi symbols. Que pi: πππππππππππππππππππππππππππππππππππππππππππ
Joined: 4/24/2012
Posts: 129
Location: Atlanta, GA
Huge yes vote, and it should obsolete the "Total Control" movie, for sure.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Torn338 wrote:
They're both great in their own way. However, on their own merits, the current publication takes way too long in my opinion to get its result compared to this one.
Thanks. Excellent reason for obsoletion instead of two separate publications.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Player (12)
Joined: 11/23/2012
Posts: 94
I love this video. The punchline (pi) has the same "I don't think the programmers intended this" quality as ponies, but without the handicap of being associated with a fandom which contains some very annoying and pushy fans (thank God said fandom contains some really awesome fans who don't make me feel like a sinner because I watched two random episodes and decided it didn't click with me). The video also has the magnificent qualities of being short, sweet, and brisk in tempo. All of those pi digits appearing at the top, and all of the dancing pi's at the bottom doing a thousand different things. . . it's not just one punchline (look! Pinkie Pie's cutie mark! And pony music!) but several. Overall, this movie doesn't seem as likely to make the viewer feel trolled as the previous movie, and if for some reason they hate pi, they wasted 3 minutes tops. I vote yes. Publish this TODAY.
Editor, Player (54)
Joined: 12/25/2004
Posts: 634
Location: Aguascalientes, Mexico
I had many laughs & giggles while seeing this video. Totally enjoyed it :)
I'm the best in the Universe! Remember that!
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
mathgrant wrote:
if for some reason they hate pi, they wasted 3 minutes tops.
For your name, your utterly failed math. No, you waste Pi minutes.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Player (12)
Joined: 11/23/2012
Posts: 94
Nach wrote:
mathgrant wrote:
if for some reason they hate pi, they wasted 3 minutes tops.
For your name, your utterly failed math. No, you waste Pi minutes.
If you hate pi, you probably won't watch the entire run. So maybe you've wasted two minutes, tops. That's about how long it takes for pi to appear.
LSK
Joined: 4/17/2006
Posts: 159
I think it's time for TASvideos to branch out. The time has come for galleries of - not just games being played fast, but true art - art made within the game itself!
RachelB
She/Her
Player (132)
Joined: 12/3/2011
Posts: 1579
I just skipped the first minute, since everything before that is just starting the game. Accounting for the time to start the video, and locate the part where it gets interesting, 3 minutes sounds about right.
Editor, Skilled player (1537)
Joined: 7/9/2010
Posts: 1319
I voted yes. This run is short enough not to get boring and in the end there's also more happening, not just a picture.
Favorite animal: STOCK Gt(ROSA)26Sortm1.1(rtTA,EGFP)Nagy Grm7Tg(SMN2)89Ahmb Smn1tm1Msd Tg(SMN2*delta7)4299Ahmb Tg(tetO-SMN2,-luc)#aAhmb/J YouTube Twitch
Skilled player (1743)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Mothrayas wrote:
VBA is not deprecated.
Ok. Still..what's the point of "Masterjun's GBC Pokémon Yellow in 01:11.06" which according to the comments, is pretty much identical to the current published run but done in BizHawk if VBA is totally fine with GB(C) games?
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
jlun2 wrote:
Mothrayas wrote:
VBA is not deprecated.
Ok. Still..what's the point of "Masterjun's GBC Pokémon Yellow in 01:11.06" which according to the comments, is pretty much identical to the current published run but done in BizHawk if VBA is totally fine with GB(C) games?
The more accurate the emulation the better. Gambatte has some of the best DMG and CGB emulation available. A more accurate emulator run cannot be obsoleted by a less accurate emulator run. But the opposite is true.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Skilled player (1743)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Nach wrote:
The more accurate the emulation the better. Gambatte has some of the best DMG and CGB emulation available. A more accurate emulator run cannot be obsoleted by a less accurate emulator run. But the opposite is true.
Why wasn't this done in BizHawk then? VBA isn't even listed as a preferred emulator for GB/GBC/SGB games.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
jlun2 wrote:
Why wasn't this done in BizHawk then?
That's a question for FractalFusion.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
AnS
Emulator Coder, Experienced player (728)
Joined: 2/23/2006
Posts: 682
Oh come on, this hysteria about more accurate emulation is killing all the fun.
Joined: 11/20/2011
Posts: 27
Location: UK
This run goes to the point much faster than the pony run. It was really a torture for me to watch the whole pony run, because it took too much time to hack. Yes vote from me.