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.


1 2
5 6
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15585
Location: 127.0.0.1
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
I really enjoyed this run. I liked how quick it did what it did, I found it almost unbelievable that it disrupted the game so, and so creatively in such a short time. The payload was excellent as well. Comparing this to the "pony" run, I found each of them stood out on their own. This wasn't filled with boring patches, and had a payload which was interesting and "TASy" all its own, which I enjoyed seeing, especially once other games were shown off in addition to the math. The "pony" run got the game developers involved about hacking the game code which was funny in perspective, and shown off a whole new colorful animated screen with its own music. On the other hand though, it was long and boring, and the animation didn't really feel "TASy".
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.
Expert player (2567)
Joined: 12/23/2007
Posts: 830
I also enjoyed it. Thanks for making my Pi day. :)
Recent projects: SMB warpless TAS (2018), SMB warpless walkathon (2019), SMB something never done before (2019), Extra Mario Bros. (best ending) (2020).
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
This is amazing! I love it! Voting Yes because I thought it was both impressive and really entertaining. I wish this could be published somehow, but for now, it would make a great Gruefood Delight candidate.
Spikestuff
They/Them
Editor, Publisher, Expert player (2643)
Joined: 10/12/2011
Posts: 6439
Location: The land down under.
The cake is a pi. I say yes vote as it's humorous interesting and should go with "Executes Arbitrary Code" as a special category especially for a day like this... Also beautiful time ;) Request: Make an extra save state, pi rounded up to 3 decimal places is 3.142 not 3.141 because 5 is after it. 3.14159265359~
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
RachelB
She/Her
Player (129)
Joined: 12/3/2011
Posts: 1579
This is amazing. I think this can easily obsolete the pony movie.
Noxxa
They/Them
Moderator, Expert player (4125)
Joined: 8/14/2009
Posts: 4090
Location: The Netherlands
Great demonstration. I think it's actually much more fun than the previous Total Control Hack run.
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.
Player (213)
Joined: 9/14/2011
Posts: 349
You should have posted this on April's Fool, what a amazing, fabulous TAS! I love it when someone makes 'music move' in his TAS, and this is going to be one of my favorites. Happy pi day, anyway. Here's a reward for you.
Tompa
Any
Editor, Expert player (2215)
Joined: 8/15/2005
Posts: 1941
Location: Mullsjö, Sweden
Truly awesome :D. A lot more enjoyable than any Pokémon I have seen before. Simply lovely. Yes vote.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
I died of laughter pi/pi
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Player (213)
Joined: 9/14/2011
Posts: 349
Wait a minute, is that Conway's Game of Life on 2:46-2:48(YTP)? Oh, FractalFusion, you are such a sensible genius!
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
While I liked the current published TAS for the element of surprise in the end when the screen went black and code started filling the screen (almost like watching The Matrix) this TAS had a much more suitable, widely understandable payload and reaches it faster. Tough call, but I think that there is no other option but to vote Yes, and for Star.
Glitcher
He/Him
Joined: 3/24/2007
Posts: 216
Location: London, U.K.
I guess you could call this the Life of Pi.......kachu. :p It's another interesting hack that goes straight to the goods quicker than the Pony movie. But at the end of the day, I still prefer the latter. What made it so funny is not just the run itself, but all those cracks about Ash being in the Matrix. That just sealed it for me and I wouldn't want anything to obsolete it. I'll give this run a "Meh."
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
For those of you in the cheap seats and missed the awesomeness of this submission: Movie length: 03:14.15 Re-record count: 3141 Submitted at: 2013-03-14 07:14:15 Note: Eastern Daylight Time is UTC-4, which New York and friends are currently observing. In that timezone, the submission was at 3:14:15 AM.
Odongdong wrote:
You should have posted this on April's Fool
No.
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.
Joined: 1/9/2013
Posts: 27
Location: Virginia
This is so awesome that I got out of bed just to come post how awesome it is.
Post subject: Re: Submission Notice
Spikestuff
They/Them
Editor, Publisher, Expert player (2643)
Joined: 10/12/2011
Posts: 6439
Location: The land down under.
Nach wrote:
Odongdong wrote:
You should have posted this on April's Fool
No.
*doesn't care if sarcasm* /me scratches Odongdong shuddup it's a perfect day, tonight (AEST :P).
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Spikestuff
They/Them
Editor, Publisher, Expert player (2643)
Joined: 10/12/2011
Posts: 6439
Location: The land down under.
voting no because it's not submission 3141 (sarcasm obviously)
Nach: This really should've been submission 3141
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Player (213)
Joined: 9/14/2011
Posts: 349
Sorry if I annoyed you, I was overwhelmed by the awesomeness of this speedrun, and temporarily went crazy.
WST
She/Her
Active player (489)
Joined: 10/6/2011
Posts: 1697
Location: RU · ID · AM
I voted yes. Made a post about pi number day in off topic board, but suddenly noticed this… :)
S3&A [Amy amy%] improvement (with Evil_3D & kaan55) — currently in SPZ2 my TAS channel · If I ever come into your dream, I’ll be riding an eggship :)
Reviewer, Active player (287)
Joined: 12/14/2006
Posts: 717
Oddly enough I liked this one, and I usually hate RAM corruption TASes, including the first bootstrap TAS of this game. This one had a lot more fun to it. There's just something great about those dancing pis.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
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...
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.
Joined: 5/14/2007
Posts: 525
Location: Pisces-Cetus filament
I'm loving Pikémon Yellow and think this awesome movie should obsolete bortreb's. Pi vote.
AzumaK wrote: I swear my 1 year old daughter's favorite TASVideo is your R4MI run :3 xxNKxx wrote: ok thanks handsome feos :D Help improving TASVideos!
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
I love you :)
Spikestuff
They/Them
Editor, Publisher, Expert player (2643)
Joined: 10/12/2011
Posts: 6439
Location: The land down under.
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
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
fsvgm777
She/Her
Senior Publisher, Player (226)
Joined: 5/28/2009
Posts: 1213
Location: Luxembourg
No vote for the rather abrupt ending. ..just kidding. This gets very much a Yes vote from me, because this is probably the best way of showing the first few digits of Pi.
Steam Community page - Bluesky profile Oh, I'm just a concerned observer.
1 2
5 6