RD KONTROL KODZ 00 01 16bit Substring Jump (second byte is the number of the substring to be displayed) 02 03 04 24bit ? 05 8bit Clear Background Graphics 06 8bit Clear Text & reset cursor to top left 07 24bit Fade in 08 24bit Fade out 09 24bit Indent 0A 16bit ? 0B 16bit Load Music (see below for a music chart) 0C 16bit ? 0D 24bit Volume slide 0E 32bit ? 0F 10 16bit SFX 11 16bit Text display speed (00=instantaneous, ff=slowest, 04=normal) 12 16bit Delay (2nd byte is amount of delay) 13 8bit Waitpad 14 32bit SET 15 16bit Random number 16 32bit ADD 17 32bit SUB 18 32bit OR 19 32bit AND 1A 32bit Goto 1B 64bit If/then/goto 1C 48bit if a certain amount of time has passed, jump to xxx (use with 1E) 1D 40bit Choice Thingy 1E 8bit start the clock for 1C 1F 8bit Line Feed (carriage return, whatever you wanna call it) 20 16bit 20 00 - serge (or whatever you name him) 21 22 32bit load graphics 23 8bit ? 24 24bit ? 25 16bit ? 26 16bit ? 27 16bit ? there don't seem to be any 00, 02, 03, 0F, or 21 control codes anywhere in the script. codes i still haven't figured out: 04, 0A, 0C, 0E, 21, 23, 24, 25, 26, 27 07 & 08: FADING (24bit) - byte #1 is the type of fade. 07 is for fading in and 08 is for fading out. - byte #2 controls which BG layer will be faded and how much it'll be faded - if it's anywhere between 60 and 7F, it'll fade BG1 (the layer for graphics under the text) - if it's anywhere between 80 and 9F, it'll fade BG3 (the in-game text BG layer) - the amount of incrementation determines how far the fade will go - ie: 67 is 7 above 60, so it'll fade out 7 steps - after 16 steps, the image will be totally faded. (so why is there a capacity for 32 steps? hmmm?) - maybe because it needs 16 steps, and alloting only four bits to it would allow only 15 steps) - byte #3 controls the speed of the fade. - 00 is the fastest, FF is the slowest - 08 79 FF - fades out BG1 25 steps slowly (i assume) - 08 80 FF - didn't fade anything out - 08 82 FF - faded out two steps slowly - 08 8F FF - faded out all the way slowly - 08 99 50 - faded out all the way (and then some, probably) - 07 90 00 - displays text layer in without any fade (used commonly before starting a screen of text) - 08 F0 28 - took care of both the text and many background layers (it was the intro screen with moving trees, castle, and moon) - 08 50 0A - faded the BG, not the text. the bg did have two layers that needed to be faded though, and this fade took care of them both. - 07 50 1E - faded in a BG castle screen on BG2 - 08 89 14 - fades text out halfway (often times followed by a cleartext for a quick fade effect) 09: Indent (24bit) - this code sets the text cursor to a specified location of the screen. - byte #2 is the x position at which to start the text - byte #3 is the y position (00 is the first line on the screen) 0B: MUSIC (16bit) 00 - silence 01 - day of summer 02 - far promise 03 - girl who stole the star (piano solo) 04 - girl who stole the star 05 - gale 06 - under the moonlight 07 - frozen flame 08 - portal to open grounds 09 - wind ambience 0A - engineroom (?) ambience 0B - sewer drip ambience (borrowed from CT) 0C - footsteps ambience 0D - water / cricket / owl / wolf ambience 0E - final confrontation 0F - sneaking around 10 - water / wind ambience 11 - snakebone mansion 12 - strange presentiment 13 - facing 14 - epilogue 15 - ending 16 - clockworks (?) ambience 17 - wind ambience (borrowed from CT) OD: Volume slide (24bit) - this code has the capability of decreasing or increasing a song's volume to any level over any amount of time. - byte #1 = fade speed (00=immediate, ff=slowest) - byte #2 = volume at end of fade (ff=full, 00=inaudible) 10: SFX (16bit) - byte #2 is the number of the sound effect to be played. 0B - you hitting an enemy 0D - scream 10 - volcano sound 13 - you hitting an enemy 14 - miss! 32 - the rustling you hear when the cats eyes appear, near the beginning of the game 14: SET (32bit) - 14 is a SET for an 8bit RAM address. - to get the RAM address, subtract 0xAB6D from the address in bytes 2 & 3 (little endian) and you'll have the place in a ZSNES savestate file it's at. - seems that it won't work for offsets under C080. i tried C07F and nothing happened to the address in question. - 14 81 C0 92 changed RAM 0x01514 from 78 to 92 0111 1000 w/ 1001 0010 -> 0111 1000 15: Random - generates a random number at the 8bit RAM address supplied in byte 2. 16bit. - 15 81 generates a random number, 00 through FF, at RAM 0x1514. - add 0x1493 to byte 2 to get the target RAM address within a ZSNES savestate. - 15 82 would generate a number at 0x1515. - this is often followed by an 'AND 01' of that address (to get either a 0 or 1) and then an 'if that value==0, goto some offset'. it's an easy way of doing 50/50 randomness. 16: ADD (32bit) - 16 is an arithmatic ADD for the RAM address. - given a RAM address supplied in bytes 2 and 3 (little endian), the 4th byte will become the value at that address. - to get the RAM address, subtract AB6D from the address in bytes 2 & 3 (little endian) and you'll have the place in a ZSNES savestate file it's at. - no carry is performed if the value exceeds FF. - 16 81 C0 0A would change RAM 0x01514 from 78 to 82. 78h+0Ah=82h 17: SUB (32bit) - 17 is an arithmatic SUB for the RAM address. - the fourth byte of the control code is subtracted from the RAM address value. - to get the RAM address, subtract AB6D from the address in bytes 2 & 3 (little endian) and you'll have the place in a ZSNES savestate file it's at. - no carry is performed. simple 8bit math. - 9A changed 78 to DE. 78h-9Ah=DEh 18: OR (32bit) - 18 seems to be an arithmatic OR for an 8bit RAM address specified in the first two bytes - to get the RAM address, subtract AB6D from the address in bytes 2 & 3 (little endian) and you'll have the place in a ZSNES savestate file it's at. - 18 80 C0 02 changed RAM 0x01513 from 00 to 02 0000 0000 | 0000 0010 -> 0000 0010 19: AND (32bit) - 19 is an arithmatic AND for the RAM address. - to get the RAM address, subtract AB6D from the address in bytes 2 & 3 (little endian) and you'll have the place in a ZSNES savestate file it's at. - F0 changed 78 to 70. 0111 1000 & 1111 0000 -> 0111 0000 1A, 1B, 1C, 1D: DIRECT & CONDITIONAL JUMPS - two or three bytes in each of these codes is an address in ram (counting from 0x4127F) to go to, if a certain condition is met or whatever. - these three bytes are in this format: FF 33 01 - go to 0x0133FF past 0x4127F in RAM - because my script is gonna have different destination offsets once i translate it, i'm gonna need to either: - do what i did in wonderboy 6 - go through the game and continuously check and see if each jump is lined up - or make labels and make a function in my encoding program to see what offset each labels happens at, and inset the address into the control code. - 1A: 32bit. go to the three byte address supplied by bytes 2, 3, and 4. format: 1A FF 33 01 1A: control code FF 33 01: bytes of offset (little endian mode) this code will jump to 0x0133FF in the script if (?) condition is met. it might be just a simple goto... - 1B: 64bit. check bytes 5, 6, and 7, and go to the three byte address supplied by bytes 2, 3, and 4 if (?). format: 1B C1 0E 00 E0 00 C0 00 1B: control code C1 0E 00: bytes of offset (little endian mode) E0: ? (i think these four bytes could be the address of the variable to check, to see if a jump should be performed) 00: ? C0: ? 00: ? E0 00 C0 00 - not true in the first scenario E0 00 C0 01 - maybe the var for if you've beaten the first scenario yet? E0 01 C0 01 - these first six are displayed at the beginning of the script. E0 02 C0 01 - E0 03 C0 01 - E0 04 C0 01 - E0 05 C0 01 - E0 06 C0 01 - E2 81 C0 78 - ? - seen a lot in the first 5 to 10% of the game E0 81 C0 78 - ? E1 81 C0 47 - E1 81 C0 1F - E0 0A C0 01 - E0 11 C0 00 - E0 00 C0 00 - E0 08 C0 00 - E0 4D C0 00 - E0 85 C0 00 - E0 11 C0 00 - E0 09 C0 01 - E0 12 C0 00 - i'm assuming the value is 00: e0 00 c0 00 - jumped - equal to? e0 00 c0 01 - jumped e0 00 c0 02 - jumped e0 01 c0 00 - didn't jump (maybe byte 2 is the value to check and byte 4 is part of an address or something?) e0 02 c0 00 - didn't jump e1 00 c0 00 - jumped - not equal to? e1 00 c0 01 - didn't jump e1 01 c0 00 - jumped e1 02 c0 00 - jumped e2 00 c0 00 - jumped - less or equal to? e2 00 c0 01 - jumped e2 01 c0 00 - jumped e3 00 c0 00 - not supported (it made the emulator crash) e2 81 c0 78 is 1514 e2 82 c0 78 is 1515 e0 - ram was 92, code was 92 - didn't jump - jump if unequal to ram? - ram was 92, code was 93 - jumped - ram was 92, code was 91 - jumped e1 - ram 92, code 92 - yes - jump if less or equal to ram? - ram 92, code 93 - no - ram 92, code 91 - yes e2 - ram 92, code 92 - yes - jump if greater or equal to ram? - ram 92, code 93 - yes - ram 92, code 91 - no - 1C: 48bit. - the way this works is that if a certain amount of time (specified by bytes 5 and 6) has passed, it'll jump to the address specified by bytes 2, 3, and 4. - whenever it runs into a 1E, it'll start the clock ticking. - 1D: 32bit. prompt the following text as a choice and go to the three byte address if chosen. format: 1D 44 0F 00 FF 1D: control code 44 0F 00: bytes of offset (little endian mode) FF: ? (is it always FF?) this code will jump to 0x000F44 in the script if this choice is chosen. 22: LOADGFX (32bit) - it seems to handle all sorts of graphic related jobs. - maybe the argument bytes are like a memory address which contains the stuff to be loaded - often times what's loaded is a combination of various BG layers - 0D 0B 00 - fades in the cat eyes on the OBJ layer. - 83 0D 00 - big red flash - 89 0D 00 - flashes the screen when you hit an enemy, and plays the hit SFX. (flashed OBJ and BG2 but not text (BG3)) - 6A 09 00 - queues up the book in the intro screen but doesn't fade it in - 70 09 00 - opens the book (a fade) - D5 09 00 - queues up the moonlight screen in the intro - E8 09 00 - scrolls the moonlight screen upwards and scrolls in the castle screen (intro) - A0 0D 00 - the red flash that happens when you get hit RAM Addresses 1513 - which quests you've completed? 1514 - your energy? starts out at 78. 1515 - enemy's energy? (k) 2000 DEMFORZ