Top 3 Awesome Posts by # of thumbs up over past 24 hours

Moderators:

  • JeffMan
  • And our supermoderators and administrators.

Mr. Saturn sprite Control Code Lexicon - Updated 8/25/4

Blue Antoid

  • dragon
  • pkhack
Heya, dudes. Blue Antoid here, pretending to get something accomplished. Got a job for all y'all, so listen up.

First, some old news. For the past several months, we've been delving deep into the horrors of the game's programming. One day, we kind of stumbled upon the data that actually controls reading the text! This lead to the discovery of the Control Code parser, the program that links to all the subroutines used by every CC in the text. This discovery hasn't helped us one bit in terms of figuring out what codes do - we may be trauma-resistant, but not so much to try to figure out effects based on reading the pure, compiled ASM. Well, excluding Mike, anyway. XD However, one thing this has done for us is show us exactly which codes the game uses. And, thereby, which ones we don't know.

Which brings us to the task before us. When the new site goes up (don't you people read the website anymore? Well, I suppose you wouldn't. ;D), one of the things we'd like to have ready is the brand new Control Code Lexicon to replace the Chrestomathy - mostly because the term's more accurate. (A lexicon is an entire dictionary, where a chrestomathy is a short selection of understood material. It sounds cooler, anyway. Try it. Lexicon. Chrestomathy. "Lexicon" is by default awesomer because it has an X in it. "Chrestomathy" is like pronouncing a brick. )

What follows is a list of all the codes we don't know. Our job is to figure out exactly what is they do. So, what can you do? Experiment. Play. Plug the codes into the ROM. Make things explode. Search for examples of codes already in the ROM. And if you find something cool, post it here. Simple as that. Don't feel discouraged, or just think that those of us with badges are the only ones who can figure it out. It doesn't take a l33t h4x0r to figure out a little bit of control code goodness. In fact, most of us - myself, GuyInSummers, michael_cayer, to name a few - probably wouldn't be where we are to day without all the CC experimentation we subjected ourselves to in those early years. So give it a shot. Never know where it'll take you.

(Note: If we already know any of these, or something's missing from this list, let me know so I can fix it. I had the sort of icky feeling that I was using outdated documentation when I made this... :o)

http://pkhack.fobby.net/misc/txt/lexicon.txt <--><-->;[/code]

  • Aces
  • dragon
  • pkhack
  • artistorm
  • hax
/me pretends to help ;D

sprite EBisumaru

    [01] clears the current line and I think [0C xx] and [0D xx] are like [0E xx], except they do it for the [1b 00] and [1b 01] variables.

    sprite Mr. Tenda

    I'm responsible for Rule 15!

    • pkhack
    • dragon
    there is no 1F D2 XX Sad (photographer code)

    Blue Antoid

    • dragon
    • pkhack
    Yeah, exactly, Mr. Tenda. There's no photoman code there because we know it already. These are the codes we don't know. ;D

    As for the [01] code, EBisumaru, yeah, it's been long believed to clear the window, but I have yet to see any situation in which it works.

    We also know somewhat what [1B 00], [1B 01], [1B 04], [0C XX], [0D XX], and [0E XX] do, but it's all nasty memory-juggling stuff. GIS has done some hardcore poking at them, so I'll let him handle the explanations for those when he has the time.

    sprite Mr. Tenda

    I'm responsible for Rule 15!

    • pkhack
    • dragon
    whoops. I was wondering where a lot of other ones were too Twisted Evil

    sprite FaulkFan420

      I'll help as much as I can.

      sprite Mr. Tenda

      I'm responsible for Rule 15!

      • pkhack
      • dragon
      Mr. Tenda wrote on September 23, 2003 04:27 PM
      Okay, some useful control codes for you!11! Especially useful if you want to make your own flyover-type scene and don't want to spend days figuring out how to do it!

      * 1F EF XX XX - Changes the camera (or "view") of the screen to focus on sprite XX XX, created by 1F 15 (or a character number). In other words, it will treat sprite XX XX like the party in that it will follow it around the screen.
      * 1F 13 XX 01 - This control code restores your party back to the center of the screen. You need to use it multiple times for every member of your party. The XX is the character number you want to restore back to the camera's center. You don't need to use this with temporary party members (IE: Pokey, King, Dungeon Man...)
      * 1F ED - I'm not exactly sure what this code does, but I know that if you don't use it that your party will be teleported (in a glitchy way) on top of some sprite that is nearby when the text block is over if the camera switched to another sprite in the block of text.
      * 1F E8 FF - This code is not unlike 1F E5 FF in that it restricts movement of the player. But, this code is used when the camera is focused on another sprite. So if you want a teleport in your flyover or flyover-type scene you need to put this after it.
      * 1F E9 40 01 - I don't know exactly what this does but if you don't use it, you cannot move the party when the text block is over. You have to use 1F 61 after it.


      Okay, now you're probably going WTF but for those who aren't here is an example of how to use these codes and the order how useful huh!

      [1F E5 FF 1F 68 04 0B 00 1F EB FF 06 1F 15 A6 01 0C 00 01 1F EF A6 01 1F E9 40 01 1F 61 10 6A 1F 1F A6 01 06 1F 69 1F 13 01 01 1F 13 02 01 1F 13 03 01 1F 13 04 01 1F ED 1F EC FF 01 18 01 01]@That was a basic example of a flyover type scene![13 05 0B 00 02]

      (Note how flag $000B was set so that enemies wouldn't get in the way and make it look funny.)
      (This only works if you have Ness, Paula, Jeff, and Poo in your party. I did it this way so it would be a good example.)


      This should explain 1F EF XX XX and 1F E8 FF, and at least give you a hint for 1F ED and 1F E9 XX XX.

      By the way, how can 1F EF XX XX be unknown and 1F 13 XX XX be known? They are very closely related. (EDIT: for anyone interested, 1F 13 changes the facing direction of a character (putting it back to the center of the screen must be a side effect))

      sprite EBisumaru

        Blue Antoid wrote on Fri, 14 May 2004 13:47
        We also know somewhat what [1B 00], [1B 01], [1B 04], [0C XX], [0D XX], and [0E XX] do, but it's all nasty memory-juggling stuff. GIS has done some hardcore poking at them, so I'll let him handle the explanations for those when he has the time.

        Actually, it's pretty simple. Those three 1B NN codes are as variables; you put them after the code you want to use them with or the code that you want to fill it. For codes that use this data, you have to put a 00 where you want the 1B NN data.

        Quote:
        [15:00:12] <EBisumaru> Thus, [1f 52 03][1b 04][0e 00][1b 04][0b 05][1b 03 e9 63 c7 00][00]@Wrong code.[13][02]
        [15:00:27] <ElPenguino> ?
        [15:00:38] <EBisumaru> That's a keypadlock, if you will
        [15:00:52] <EBisumaru> (The key is 5)
        [15:01:11] <ElPenguino> ????????
        [15:01:59] <EBisumaru> You enter 5 into the number chooser, you go to $C763E9. You enter something else, you get [00]@Wrong code.[13 02]
        [15:02:54] <ElPenguino> oic

        I had to fight 128 JeffMans to get the Video Relaxant

        • dragon
        • donor5
        • pkhack
        • nerd
        • 1128
        • artistorm
        • poe
        • walkthrough
        • hax
        • boxes
        Yeye, I found a few myself. (I'm not certain of these, but what the heck, I'll post them anyways.)

        1F A0 = The person you are talking to faces up for a moment.
        1F A1 = The person you are talking to faces down for a moment.

        Yeah. Go me.

        sprite EBisumaru

          I figured some of these out.

          [18 07 xx xx xx xx xx] - something to do with setting t/f flag
          [1c 0f] - prints some variable, used for stats increasements (including HP and PP), saved game brokened message, damage, etc., probably set by machine code
          [0e xx][19 11 yy][0d 00] - loads symbol in position xx of character yy's name into memory
          [1c 03 00] - prints string in memory
          [1c 13 xx yy] - if xx is 00, call battle anim yy (obviously there is more to this code, but I haven't figured out the other part yet)
          [1d 00 xx yy] - adds item yy to char xx's inventory, somehow puts the character who got it where [19 10 01] can get it
          [1d 0a xx] - returns price of item xx (used with variable codes)
          [1d 0b xx] - sets true flag false if item xx is permanent

          Blue Antoid

          • dragon
          • pkhack
          Hey, good job, guys. Keep it coming! Very Happy

          One thing I'd known earlier but forgotten:
          [1F E6 XX XX] (Delay Appearance of TPT Entry)

          A good example of this is in the Onett Flyover itself. The game uses this code to hide the taxi cab from appearing as you pass over the hotel. This code should be used right after a teleport (or, theoretically, before a movement pattern would bring it into view, though that hasn't been tested). The TPT entry number placed in XX XX will not appear until the text block finishes parsing.

          Also, a correction on [1F 13 XX YY]. This code changes the direction a party character is facing. XX is the character number, and YY is direction. (1 is up, going clockwise along the 8 cardinal points.)

          sprite L

            Attention Gentlemen! It appears that, judging from the decades of research I've been conducting into any Control Code topic, every last one of them appears to peter out after only 20+ posts.

            sprite Shy

            Hate Fairy

            • dragon
            That problem definately gets worse when people like you actively take them off-topic.

            sprite ChrisDavis

            • donor1
            • wallpaper
            :/ Man these things sure take a while. <--Sarcasm

            • hardtrivia1
            • fun
            • dragon
            • aoe
            • boxes
            • donor5
            • pkhack
            • devteam
            • DINO RAMPAGE!
            Hey, you're forgetting the original control code topic; the one which recorded the discovery of many of today's known CCs. IIRC, that one went on for five or six pages, until it hit a forum switch.

            Blue Antoid

            • dragon
            • pkhack
            Less complainy, more worky. It takes so long since nobody's experimenting with these things and posting about it. ;D

            sprite animepark13

              hey i am not very good with discovering control codes so i was wondering if i could make a request... that being translations of the other 2 flyovers like the way the first one was done http://pkhack.fobby.net/down/docs/flyover_code.txt please?

              Blue Antoid

              • dragon
              • pkhack
              Heh heh. Technically, since this is a sticky topic, I suppose this doesn't count as a "bump" per se. ;D

              In any case, I've updated the codelist to the most recent version, and I've uploaded the progress so far on the Lexicon. This is probably not the form it's going to take in the end - I'd like it to be a lot more visually engaging, and the overall tone of the text will probably be less technical-manual-esque, but this is what I've got going so far. If anyone would care to write any entries on particular control codes, we'd be happy to accept them. You will be duly credited on the site. (But please, please, PLEASE refer to the terminology notes topic beforehand!)

              http://pkhack.fobby.net/misc/txt/lexicon.txt <-- WIP Lexicon descriptions for each control code. Last updated 8/25/4 by Blue Antoid.

              http://pkhack.fobby.net/misc/txt/codelist.txt <-- Codelist file for JHack's text editor. Last updated 8/25/4 by Blue Antoid.

              sprite GuyInSummers

              • dragon
              • boxes
              • pkhack
              I'd like to mention http://pkhack.fobby.net/misc/stdarg.htm as well. It's a work in progress; it's supposed to have all possible arguments for all control codes, with descriptions. Unfortunately, after I got through the descriptions of all the possible text windows (didn't quite finish, actually) I got completely sick of it, so if you guys could help with that too, it'd be great.

              sprite SoulBlazer X

                What are the codes that allow you to make cinematics (that involve screen movement) and palette changing codes (the one that does the Moonside palette, specifically)?

                sprite michael_cayer

                pkhack

                • eb0hack
                • ch4
                • hax
                [0F] = Increment secondary memory of the currently active window.
                [18 0D XX 01] = Display status window for character XX, complete with statistics. Seems the 01 is a parameter, but only 01 and 02 have specific code... and 02 doesn't do anything codewise. Odd.
                [1F 05] = Disable music changes caused by crossing sector boundaries.
                [1F 06] = Enable music changes caused by crossing sector boundaries.
                [1F 81 XX YY] = Check if character XX can use item YY, and store result in the working memory of the currently active window.

                sprite EBPlayer1028

                  Somehow I feel that [1f 32] is the next font after [1f 31]...
                  but I tried it and it isn't. Sad
                  Oh, wait, scratch that.

                  sprite SoulBlazer X

                    What control codes could you use to make a cutscene, with a moving screen and fadeouts and screen appearances in certain places without your party in the middle of the screen? I found no such codes in the CCC.

                    sprite animepark13

                      all i can think about for that situation is to use the [1F EB FF 06] to make all of the characters invisible, and than insert a flyover code or something for the camera movements
                      o yea you might need [1F E5 FF] to lock player controll

                      sprite michael_cayer

                      pkhack

                      • eb0hack
                      • ch4
                      • hax
                      Some more codes:

                      [19 19 XX YY] - In character XX's inventory, load the item number of the item in slot YY (slots numbered 01-0E). Store this number in argumentative memory and the character number in working memory.

                      [1B 05] - Copy Active Memory to WRAM.
                      [1B 06] - Copy WRAM to Active Memory.

                      Storage addresses for the previous two:
                      ---------------------------------------
                      7E97CC + 7E97CE = Working
                      7E97D0 + 7E97D2 = Argumentative
                      7E97D4 = Secondary

                      sprite animepark13

                        does anyone know the locaion of the data for the winters and dalaam flyovers... i would like to look into it since i would like to incorporate editing those into my hack to make a nice flyover for the beggining of my hack

                        sprite GuyInSummers

                        • dragon
                        • boxes
                        • pkhack
                        [1F D0 XX] - Look at each broken item in Jeff's inventory and determine if Jeff's IQ is sufficient to fix it. If the code comes across a fixable broken item, remove the broken item from Jeff's inventory and replace it with the fixed item. Put the number of the broken item in argumentary memory and the number of the new, fixed item in working memory. There is a XX% chance that this code will work, otherwise it will do nothing.

                        I'm pretty confident, but testing is always appreciated.

                        sprite michael_cayer

                        pkhack

                        • eb0hack
                        • ch4
                        • hax
                        [01] = Same as [00], except for one change: it does nothing if the X coordinate where text is being drawn is 0. (So multiple newlines aren't possible with [01]).

                        [1D 0B XX] = Get one half of the cost of item XX, and store it in working memory. (In other words, the selling price). Stated here because both codelist and lexicon incorrectly state it as a permanence check... O_o

                        Corrections:
                        In [1D 00 XX YY], working memory is set to the number of the character that received the item.
                        In [1D 0E XX YY], working memory is set to the number of the character that received the item, and argumentative memory is set to the number of items in the inventory after giving the item.

                        sprite GuyInSummers

                        • dragon
                        • boxes
                        • pkhack
                        A recent period of internet deprivation gave me time to come up with a few cool CCs.

                        1F 83 XX YY: Equip character $XX with the $YYth item in his or her inventory.
                        1D 15 XX XX: Multiply $XXXX by the number of characters in the party, and store in Working Memory.

                        Also, some random notes...
                        1C 14 XX and 1C 15 XX both return 1, 2, or 3. This corresponds to "he", "she", and "it." Dunno why or how.
                        [01]@[1c 0e]'s offense[00] went up by [1c 0f]! <-- Use of 1C 0F. *shrug*

                        sprite EBisumaru

                          Possibly, they're the numbers of party members or enemies.

                          sprite EBPlayer1028

                            Did you figure out [1c 0f] yet?
                            Oh, wait, scratch that.

                            sprite GuyInSummers

                            • dragon
                            • boxes
                            • pkhack
                            Hmm... looking like [19 1F] is "Load the number of the current action target into working memory. As such, either 19 1E or 19 20 is a pretty good candidate for doing the same with the curret action performer.

                            And for something I'm more sure about, [19 21 XX] is looking like 'Set the T/F flag if item XX is a beverage'.

                            sprite EBisumaru

                              There's an error - the code [1F 66 xx yy zz zz zz zz]'s description should read as follows: Activate hotspot yy in slot xx to text zz. Only one hotspot at a time can work in a slot, and the game seems to use only 01 and 02 for the slots. I don't know if others will work.

                              sprite EBPlayer1028

                                I have a feeling that [1c 0f] means to go to the level up hex values.
                                Maybe so, because the text tells me that...
                                Just a guess.
                                Oh, wait, scratch that.

                                sprite NLA

                                • pkhack
                                Um, not meaning to try and revive a dead topic (is this dead yet?), but I figured out something about the 1f 15 movement code, I think.

                                Like, if you have a 1f 15 code in a block of text, and then you have the 1f 61 to activate all prepared movements, and then the block ends, you will not be able to move. Such was the case with my recent experience with the flyover code... don't ask. The way to avoid being stuck to your spot once the block of text is done, I THINK, is to use the control code that removes the 1f 15-generated sprite XX XX by style YY, followed by 1f 61, after each time you're planning on using multiple 1f 15 codes. So, basically, "[1f 15 6a 00 24 00 01][1f 61][1f 1f 6a 00 01]". I'm just going out on a limb, but I did this and I was no longer stuck to the floor. Just hoping to clarify that.

                                sprite Cat Lover

                                  [1C 0F] has to do with losing a save file. For example:
                                  [01]@We're very sorry...[03][00]@but the record of adventure number [1C 0F] has been lost...[13][02]

                                  EDIT:Just read whole thread. Appearently, 1c 0f has to do with stats or maybe some memory juggling stuff. @_@

                                  sprite Mr. Tenda

                                  I'm responsible for Rule 15!

                                  • pkhack
                                  • dragon
                                  It looks like it retrieves a value in memory or gives you your save file number.

                                  sprite Cat Lover

                                    Has to be memory. It does Save Files and Battle Stats. Now how do we use this to our advantage?

                                    sprite Greyn

                                      I originally posted this in the faq, but maybe that isn't the correct place for it? Confused
                                      I looked everywhere for the control code that makes the screen shake, like when the meteorite lands and wakes ness up, and coudn't find it. Is it unknown? I just found this guide on hex editing (never tried to learn it before) so if you guys have any tips for finding out which one it is please let me know.

                                      I had to fight 128 JeffMans to get the Video Relaxant

                                      • dragon
                                      • donor5
                                      • pkhack
                                      • nerd
                                      • 1128
                                      • artistorm
                                      • poe
                                      • walkthrough
                                      • hax
                                      • boxes
                                      According to flyover_code.txt:

                                      1F 15 6A 00 24 00 01 - This code shakes the screen violently.

                                      sprite Greyn

                                        Thanks very much

                                        Spooky Mook!!

                                        Why do you wear that stupid human suit?

                                        • donor5
                                        • artistorm
                                        • fotw
                                        • fanvatar3
                                        • ch1
                                        • starman
                                        • Obama
                                        Is anyone familliar with the lowdown on the [19 22 xx xx yy yy][1f 13 xx xx] codes?

                                        If not, listen up!

                                        The first set of x's range from characters 01-04 (the members of the chosen four) 05, 06, 07 (Pokey, Picky, King... you get the picture. Any character that's in your party.

                                        The second number can be either 01 or 02. Use 01 when turning to face another character in the party, followed by filling in the yy yy values with the character number and 00.

                                        Use 02 when facing a TPT entry, and fill in the yy yy with the appropriate entry.

                                        When paired with the [19 22..] codes, fill in the first xx of [1f 13...] with the character number, followed by a 00.


                                        Sorry if this is old news. It's just that it's not listed in the description. Razz
                                        Welcome aboard the crazy trip
                                        Circle of fools say “hi”

                                        sprite Revival Of Buzz Buzz

                                          0F is a short pause in the text that dosen't wait for the player.

                                          This has been discovered through some testings in the first scene of the game.
                                          http://video.google.com/videoplay?docid=3543161691381895251&hl=en

                                          sprite BlueStone

                                            It says in the lexicon that 0F increments the secondary memory by 1.

                                            sprite Tomato

                                            Translator & PK h4x0r

                                            • MatoSnake
                                            Has the true use of [0B XX] ever been confirmed? The chrestoaldsfj says that it's not for sure, but that was written years ago.

                                            EDIT: Also, are there no [0C ...] or [0D ...] codes at all?

                                            EDIT2: OK, i see we assume they're memory/variable-related. Wish we had better documentation on everything.

                                            sprite Tomato

                                            Translator & PK h4x0r

                                            • MatoSnake
                                            For a lot of the documentation of these control codes, they start talking about working memory, secondary memory, argumentative memory, and just "memory". Is there any overlap with these usages? How does this memory stuff work?

                                            sprite michael_cayer

                                            pkhack

                                            • eb0hack
                                            • ch4
                                            • hax
                                            The documentation seems to be a tad disorganized on this point, so here's some aggregated bits of information:
                                            • There is a table in WRAM from 7E8650 to 7E88DF, with eight entries, each 0x52 bytes long. Each entry corresponds to a currently-open window, and contains window statistics.
                                            • Corollary: The game will probably explode if you try to open nine distinct text windows at once.
                                            • Some of these statistics are the ones you'd expect, like which windows.txt window it is, position, size, text drawing position, etc.
                                            • Each window also has several variables that are used by the text system. Here follows the list of them, by location:
                                              • Root address + 0x17 (4 bytes): Working memory
                                              • Root address + 0x1B (4 bytes): Argumentary memory
                                              • Root address + 0x1F (2 bytes): Secondary memory
                                              • Root address + 0x21 (4 bytes): Working memory storage
                                              • Root address + 0x25 (4 bytes): Argumentary memory storage
                                              • Root address + 0x29 (2 bytes): Secondary memory storage
                                            • "Argumentary" and "argumentative" are used interchangeably in the documentation.
                                            • The first three are referred to as "active memory" - if I recall correctly, these are the values that many of the control codes use.
                                            • The second three are referred to as "storage memory" - if I recall correctly, this space is just convenient built-in space to backup values for a while.
                                            • I really should verify the recollections of the previous two points.
                                            • These variables are used by the text system for "variable-passing" functionality in control codes, as well as for the true/false flag.

                                            References:
                                            http://pkhack.fobby.net/misc/txt/7E8650_0x52_byte_structure.txt
                                            http://pkhack.fobby.net/misc/1bnotes_current.txt
                                            http://pkhack.fobby.net/misc/ccasm/memory_functions.txt

                                            sprite Tomato

                                            Translator & PK h4x0r

                                            • MatoSnake
                                            We really need a brain exploding smiley Shocked

                                            sprite Tomato

                                            Translator & PK h4x0r

                                            • MatoSnake
                                            This is related to the variable handling stuff, so I'm putting this here. Here's code I'm trying to get to work. I want to be able to select any enemy group # using a number chooser and then fight that group.

                                            @Choose enemy group number:[LINE]                [1F 52 03][1B 04][1F 23 00 00]

                                            That line works just fine. Except that since none of the windows are closed, battle looks crazy. So I naturally want to close the windows, right?

                                            @Choose enemy group number:[LINE]                [1F 52 03][1B 04][CLOSEALLWIN][1F 23 00 00]


                                            By putting that code between 1b 04 and the battle code, the battle code no longer knows what's going on and makes me fight enemy group 0, which is random crazy garbage (3 starmen + crazy garbage stuff).

                                            Is there a way to store the variable, close the windows, then reload the variable? I can't find any good up to date CC lists with descriptions of how the CCs work.

                                            (Also, the problem isn't related to my program's CC parser, don't worry.)