Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
Acmlm's Board - I2 Archive - - Posts by VL-Tone
Pages: 1 2 3 4 5 6 7 8 9 10
User Post
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 161/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 08-24-05 04:31 AM, in Problem with metedit Link
Originally posted by Bio
The link don't work work


My site was down for a day, the link(s) should work now.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 162/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 08-24-05 05:03 AM, in Problem with metedit Link
The format is pretty complicated, having complete freedom on individual item placement, would generate item data of a different size (this is not unlike compression) and SnowBro put limitations in what you can do when moving items in MetEdit to avoid changing the size of the data. My own Metroid level editor, which is almost finished since about two years, is actually only missing an item editor, and I had plans to implement it in a less limited way, where you could move individual items anywhere, and remove items if the new data size became too big. You can try my (old) Metroid level editor online at http://www.angelfire.com/electronic/dokidoki/zebes.html


(edited by VL-Tone on 08-23-05 08:04 PM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 163/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-06-05 10:39 AM, in Mario 64 - Amazing Stuff Link
Hi there, gotta keep this thread alive...

The image format in Mario 64 and in many other n64 games, is 16-bits per pixel, 5 bits per color channel and 1 bit for alpha, RGBA 5551. To produce my images I used my own program that converts a MIO0 file into an RGBA 8888 (8 bits per channels) RAW file that I open in Photoshop.

For some reason, Photoshop defaults to CMYK color when opening a 4 channel file. I converted the images straight to RGBA color. Unfortunately I recently found out that I it still resulted in colors that are off. So it means that all the images I posted until now have wrong colors Maybe I'm daltonian and I don't know, but I didn't notice it before I'll try to make a batch script to fix them all.

As for my level editor, the version online is not really useful now as the included combos mostly work in other levels. You can move and rotate objects though...

But my own development version did improve. I recently discovered some key commands used in the object layout data.

Take Level 1:

You can find this line in a list in my hacking doc http://pages.infinit.net/voxel/Mario64HackingDoc.txt

[Start ] [ End ] [Entry ]
00405A60 00405FB0 0E000264 -- Bob-Omb's Battlefield

It comes from this command at 2AC10C in ROM:

00 10 00 0E - 00 40 5A 60 - 00 40 5F B0 - 0E 00 02 64 - 07 04 00 00


The "00" command that is 0x10 bytes long loads and warps to a level. The level layout data is loaded in "bank" 0E in RAM. So 405A60 is the address (in ROM) of where the object layout data starts, 405FB0 is the end, usually where a MIO0 file is (and that file is not necessarily used by this level). Now 0000264 is the entry point inside the level layout data. This is where the game starts to read data inside bank 0E in RAM. (these are symbolic RAM banks, not hard-wired).

So 405A60+ 0x264= 405CC4 At this address you get:

1B 04 00 00 --This commands seems to signal the start of MIO0 texture and
geometry loading.
18 0C 00 07 00 3F C2 B0 00 40 5A 60 -- Decompresses a MIO0 file from 3FC2B0
into RAM (bank 07)
1A 0C 00 09 00 32 D0 70 00 33 4B 30 -- Decompresses MIO0 file (textures only?)
18 0C 00 0A 00 2A C6 B0 00 2B 8F 10
18 0C 00 05 00 13 4D 20 00 13 B5 D0
17 0C 00 0C 00 13 B5 D0 00 13 B9 10 -- Copy Geometry layout data from 13B5D0 in
ROM into RAM bank 0C
18 0C 00 06 00 1C 42 30 00 1D 7C 90
17 0C 00 0D 00 1D 7C 90 00 1D 83 10
18 0C 00 08 00 1F 22 00 00 20 08 D0
17 0C 00 0F 00 20 08 D0 00 20 14 10
1D 04 00 00 -- End of RAM loading commands?
25 0C 00 01 00 00 00 01 13 00 2E C0 -- Must point to behavior data...

06 08 00 00 15 00 06 60 -- Command 06 makes the program jumps to somewhere
else in RAM to continue loading.
In this example, it jumps to offset 000660 in bank 15 in RAM, which contains
data copied from 2ABCA0 in ROM.
Bank 15 seems to load a lot of MIO0 files and many objects (command 22, see
below) that are shared by many levels.
To jump back here, command "07040000" is used.
06 08 00 00 15 00 07 6C
06 08 00 00 15 00 09 58

22 08 00 17 16 00 0F E8
22 08 00 36 0E 00 04 40 -- Command 22 is used to load geometry layout data for
objects in levels
In this example, geometry data is loaded from bank 0E in RAM (where this data
is) at offset 000440.
This data is associated with number 36. This is the same number used after by
command 24 to position objects in level
Number 36 for Level 1 is the grill that encloses the Star behind the Chain
Chomp.
Note that objects from other banks can be loaded and many "external" objects
are loaded from bank 15

22 08 00 37 0E 00 04 58
22 08 00 38 0E 00 04 70

1F 08 01 00 0E 00 04 88 -- Command 1F is much like 22, but is used only once
and usually to load all the main geometry data from the main MIO0 file.

06 08 00 00 0E 00 00 00 -- Other jump, this time at the begining of this data
(in bank 0E in RAM), loaded from 405A60 in ROM.
06 08 00 00 0E 00 00 7C
06 08 00 00 0E 00 01 E8

24 18 1F 00 E6 62 03 E8 19 40 00 00 00 87 00 00 00 0A 00 00 13 00 2F 74
--The already explained command 24.
E6 is an object that was defined by command 22 (or 21 which can load data
directly from a bank without geometry layout data)

24 18 1F 00 02 47 0A 7B EA F5 00 00 FF 66 00 00 00 0B 00 00 13 00 07 5C
24 18 1F 00 06 90 0E FB EA 6D 00 00 FF 67 00 00 00 0C 00 00 13 00 07 5C
24 18 1F 00 E6 2C 04 00 F2 E9 00 00 00 6B 00 00 00 0D 00 00 13 00 07 5C
24 18 1F 00 07 BC 03 00 19 DA 00 00 FF 69 00 00 00 0E 00 00 13 00 07 5C
26 08 0A 09 01 0A 00 00 -- I don't know what command 26 is about.
26 08 0B 09 01 0C 00 00
26 08 0C 09 01 0B 00 00
26 08 0D 09 01 0E 00 00
26 08 0E 09 01 0D 00 00
26 08 F0 06 01 32 00 00
26 08 F1 06 01 64 00 00
2E 08 00 00 07 00 E9 58 -- Loads collision data from decompressed MIO0 file
3FC2B0, at offset E958 in bank 07.
39 08 00 00 07 01 10 4C -- Loads smaller object commands from inside the MIO0
file (Coins, trees and other things found in the big list you did)

I don't know much about the rest of the data, it ends up with command "0000",
then it's the geometry layout data for level 1.
30 04 00 00
36 08 00 00 00 03 00 00
31 04 00 00
20 04 00 00
1E 04 00 00
2B 0C 01 00 00 87 E6 62 00 00 19 40
11 08 00 00 80 24 BC D8
12 08 00 01 80 24 BC D8
1C 04 00 00
04 04 00 01
02 04 00 00 --End of level layout data.
00 00 00 00

Now about the geometry layout data, I wont deconstruct the whole data since
I don't know much about it.
The data happens to start at offset 0x0440 in bank 0E.
As you can see in the command up-there: "22 08 00 36 0E 00 04 40", it's the
data to load the grill geometry and associate it with 36.

20 00 03 E8
04 00 00 00
15 04 00 00 07 00 E4 58 -- loads geometry data inside bank 07, starting at
offset E458.
05 00 00 00
01 00 00 00 --End of this object geometry layout data (to end command 22's call)


Ok that's about it as for describing data. (Dang this post is long!)

My development program can now show just about every level including most of it's "24" objects. My programs now look into a folder containing all decompressed MIO0 files from the game. So it can now decode just about everything on the fly. This means an eventual editor could feature the actual objects instead of boxes It also decodes the textures directly from the MIO0 files now so the colors are fixed. For now though, it's very slow to load a whole level and I'm still experimenting. One thing that I have to find is how the different body parts of Mario and other enemies are connected, and it's probably in the geometry layout data. Another important thing missing is the connection between commands 22 and level layout found inside compressed data. Those for which there is a description list.

One last thing, I put all the pictures I posted here in an album that you can see there:
http://pages.infinit.net/voxel/m64index.html

Note, the colors are off



(edited by VL-Tone on 09-06-05 03:05 AM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 164/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-06-05 11:37 AM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
Awesome. Looking at commands 06 and 07 it seems like this is some sort of script code. If you looked at what the game does with the command number you could very well find a jump table pointing to the code of every command.

Any idea how the RAM 'banks' are mapped to real memory addresses? Maybe they're byteswapped or something, like 01 00 23 45 should really be 00 01 45 23. If it was just a straight memory address, it seems pretty odd to stick a zero in there.


Yeah these are called ASM macro-commands, StarFox uses that too.
I don't know exactly how banks are mapped into memory, but from I've looked inside a savestate, banks don't all have the same size. I would guess that their location is always the same though.

I'm not sure what you mean by byte-swapping things though everything I posted is in normal byte order. I cannot find your example "01 00 23 45" in my post, what kind of offset were you talking about?

Edit:

I think I know what you mean HyperHacker...

This is from the command that loads geometry layout data for object type 36.
22 08 00 36 0E 00 04 40

0E is the bank number and 000440 is the offset inside this bank. And I'm %100 sure about it since I use it to decode levels. 000440 is meaningful, it's the offset of the first command of the geometry layout data in bank 0E, and it happens to be the grill that appear when using object type 36. Other offsets precisely match. I did not find the use of this command by messing with it and loading the emulator, I found it by figuring out that those were offsets to geometry layout data inside a specific part of RAM, just by looking at the data. Then I did some experimentation that proved it to me. Most everything described in my last post is tried and tested, except things with question marks



(edited by VL-Tone on 09-06-05 02:57 AM)
(edited by VL-Tone on 09-06-05 03:06 AM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 165/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-07-05 07:57 AM, in Mario 64 - Amazing Stuff Link
HyperHacker, I guess I over-reacted, but I felt a little insulted you thought I have done a byte order mistake, when I fully knew it was impossible, since all offsets matches and are used in my current decoder version... Anyway I don't do byte ordering mistakes anymore!

So like I said, in my example, it's really 0E for the "bank" and 0440 for the offset inside that bank.

Here is something very very interesting that I found...

Take this command: 18 0C 00 07 00 3F C2 B0 00 40 5A 60

It decompresses the main MIO0 file for level 1 (3FC2B0 in ROM) in RAM bank 07, which is always used to store the main geometry data for a particular level. 405A60 is the end of this MIO0 file in ROM.

You can re-point the pointer to the end of the ROM at 800000 for example (don't forget to set the end pointer too), and append a MIO0 file at the end of the ROM. Some emulators may want a ROM with a standard size so you may want to "pad" the rest with "00" or "FF" to get a 12 or 16 megs ROM. It works, I tried it, but you still have to decompress, recompress every-time you make a change...

But here is the very very interesting part: command 17 is just like command 18, except that it copies uncompressed data in RAM...

So try this: At 405CC8 in ROM, change "18 0C 00 07 00 3F C2 B0 00 40 5A 60" to "17 0C 00 07 00 80 00 00 00 81 17 C2". Then append the decompressed version of MIO0 file 3FC2B0 at the end of the ROM (at 800000), pad the rest to get a 12 or 16 megs ROM.

You can then edit the uncompressed version of the MIO0 data right in the ROM!!!

As a quick example, you can change the sign object byte (34) that is found near the starting point. Byte 34 for this sign can be found at 1129B in the MIO0 file (81129B in ROM) . You can change it to something else, like 64 for a breakable box.

The same could be done for almost all other MIO0 files. The only problem with this would be making patches for hack distribution, but still, for now it can be very useful to experiment without having to decompress and recompress data all the time!

(Edit: added an example hack of level 1's MIO0 file)


(edited by VL-Tone on 09-06-05 11:04 PM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 166/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-07-05 09:06 AM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
Awesome. I wonder if that means we could compress things that aren't normally compressed if we run low on ROM space? (Though that would mean adding 24MB of content. )

If bank 7 is always used to hold the current level's layout, and the banks vary in size, then they're probably just various chunks of memory reserved for stuff. I imagine there's a master pointer table somewhere that would tell you the location of each 'bank'.


All the MIO0 files decompressed amount to a little less than 8MB so doing this for all files would get us a 16MB ROM, though you could use the compressed MIO0 file space in the first 8MB for other things. What is the biggest possible size for a n64 ROM? In any case, compressing the resulting ROM or patch using ZIP would probably save us as much space as using MIO0 compression.

Yeah I'm pretty sure there is a table for the "banks" locations, I didn't look for it yet though, one way to find it would be to find where bank 07 is in RAM, then looking for this offset inside the ROM.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 167/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-07-05 10:44 AM, in Mario 64 - Amazing Stuff Link
Originally posted by Nebetsu
VL-Tone: I just want to interrupt the technical mumbo-jumbo and say this:

OMFG WILL J00 HAVE MY CHILDREN??????


Seriously man: Keep up the good work. It's not often that I read a 20 page topic and wish it was MUCH longer.


lol, I'm a man, and hetero at that (oh well do I really have to specify that in a ROM hacking forum?)

So you just read all pages of this topic in one stretch? How much time did it take?

I wish I had more time to spend on this, fortunately I will be able to post more often in September.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 168/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-07-05 12:43 PM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
Hello and welcome to last week. It's September 7th.

I think the max size for an N64 ROM is 32MB; any higher than that and you need to use some bankswapping or something. Though I'm not entirely sure. I doubt we'll be adding that much any time soon anyway.

If you can get me a dump of what would be in this 'bank 7' I can look for it in memory and see if I can find where it starts. From there a pointer table shouldn't be difficult to produce. I doubt it contains any length information though.


I knew that it's September , so what I mean is that I have more time, starting this month, I guess I should have just said that

As for a dump of bank 7, if you are in Level 1, it should contain in RAM the decompressed data found in the MIO0 file found at 3FC2B0 in the ROM. It starts with:

31 8C 31 8C 31 8C 31 8C 31 8C 31 8C 31 8C 31 8C
31 8C 31 8C 31 8C 41 CB 39 89 52 0B 5A 4B 5A 4D
83 51 AC 55 9B D3 A4 15 BD 1B 31 8C 31 8C 31 8C

VL-Tone

Red Cheep-cheep
Level: 23

Posts: 169/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-12-05 08:15 AM, in Mario 64 - Amazing Stuff Link
Originally posted by Cellar Dweller
This may need some more verification, but I think that I have found the location of a copy of the segment table in a savestate. Using a PJ64 format savestate the location is 0x33bb60 in the savestate(subtract 0x75c to get 0x33b404 in RAM). The 7th 32 bit word points to the current level data. The decompression locations for the MIO0 files seem to be dynamic.

It is posible that this may not be the master copy of the segment table.


You mean that this 32-bit word points to a location in RAM that contains the level data? Or does it contains the address of the compress data in ROM which would be 3FC2B0 for level 1?

Also, could you post some of the data found at address 0x33bb60 in a PJ64 savestate so I can find it in my own savestates? Don't ask why, but I don't have access to PJ64...

HyperHacker, look at this picture: http://membres.lycos.fr/nes3d/Mario64InsideCastleRooms2.jpg You'll see where this cloud textured plane comes from. I guess most people don't know this, but if you switch to the head/camera mode and you look inside the entry holes for Rainbow Ride and the Secret star in the sky which is in the opposite wall, you'll see clouds at the bottom.

I removed the level editor link from my sig, because it's far from being up to date, and actually the "combo list" is almost useless since it contains objects from all levels, combined in numeric order. I now know that, for example, object type 36 means something different and needs a different behavior depending on which level you are in. (Command 22 in the object layout data decides what is associated with number 36)

My own internal "evolved" version that can open almost all levels and display objects as they are is really not ready to be published. For one thing it needs a folder containing all decompressed MIO0 files to work.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 170/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-13-05 10:28 AM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
Well where's the most recent public release?


It was the most recent public release on my download page (dating from july). Unless you want a very buggy update, you'll have to wait until I release a useable version. With all my recent discoveries, I have many things to add and test.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 171/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-24-05 01:46 PM, in Mario 64 - Amazing Stuff Link
Well all my pics are gone for now, so I guess there wont be much useless eye-candy left in this thread I will have to build myself a script to change all the images urls in my posts. I hope to fix that in the next week.

Until then, there is still enough textual info for someone to build a usable Super Mario 64 Level editor that can edit shapes and level layouts.
You can look inside http://pages.infinit.net/voxel/Mario64HackingDoc.txt for a few of the basic offsets and format description, but this doc would need to be updated with other info found in this thread. And there may be a couple of things I forgot to post about.

Anyway...BGNG, you are doing great things with both F-Zero and now SM64 DS I wish the n64 version was as neatly organized as the DS version.

I will venture to ask the un-ask-able, why dont you build a SM64 editor? You would obviously do a better job than me. Anyway these days I\\\'m busy and need to take some time off the internet.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 172/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-25-05 02:23 PM, in Mario 64 - Amazing Stuff Link
Cellar Dweller: Wow that's looks neat, continue your great work But ehm...could you put it in context? I don't know how to connect this to what I know about Mario 64. What is the mystery struct?

BGNG : About that BASIC compiler, this is really neat, I assume it will be able to use the touch-screen? You know what would make an ideal DS development tool in my mind? That it include a graphic and sound library manager. A window would contain a list of thumbnails of graphics and sound in your game, and you would be able to import more, copy and paste, and do some basic editing and conversions between native DS graphic and sound formats. You could give them names and refer to them in BASIC code by name or ID number. Anyway it's just an idea, even without that, a BASIC compiler for the DS is just too cool

Super Mario 64 really seems to be optimized for speed and space, it uses what some call "Macro ASM commands". One byte is the opcode and the following bytes are parameters for this particular command. These commands can load things into memory, draw levels and objects, and do just about anything needed in the game logic. Some command jump to other addresses in the ROM, some commands to jump back. Sometimes there is a lot of jumping around, and it really has the overall structure of an ASM program, though it's probably automatically compiled from some higher level language and/or a custom level design tool. Overall it really is close to the way the SNES StarFox works. I read that SM64 originates from late experiments with the FX chip.

I traced back (manually) the main command that loads Level 1 in ROM:

2ABF58: 0C 0C 02 00 00 00 00 09 15 00 04 58

Bank 15 contains data starting at 2ABCA0. So this 0C command makes the program jumps to 0x458 + 2ABCA0. From there it makes another jump using 00 10 00 0E 00 40 5A 60 00 40 5F B0 0E 00 02 64. (it loads data from 405A60 into bank 0E and jumps to offset 0x264 there)

Following the program from there loads the whole level. If you look around 2ABF58, you'll see other 0C 0C commands. Each level seems to be assigned an ID number, for level 1 the number is 9. Others have negative values, like the different modules of the opening and game over sequence. For example FFFFFFF7 (-8 in decimal) is the id for the debug menu. It jumps to offset 0x0268 in bank 15. So if you change 15000458 to 15000268 in the ROM you'll get the debug menu when you enter level 1... It doesn't really work like it should, you can still try it because it gives weird results

Macro ASM commands found at 2ABCA0, 2A6120 and 269EA0 seem to be the heart of the game level loading logic. The first address gets loaded in bank 15 while the two others get alternatively loaded in bank 14. There is a lot of jumping around between those banks and it's hard to track down where the main entry point is. I suspect it's at offset 0 in bank 15 (2ABCA0).

In this area I also found a lot of text:

265980: a lot of text there, seems like classes and routine names (C++?) Just before that there are some uncompressed textures used in the Mario rubber face demo. There is one routine named "yoshi_scene"...

Text at F2E20 seems related to the game engine.
DPRINT OVER mapinfoarea xwx dwy dwz dbgY dangY dbgcode dbgstatus dbgarea dwater
dcheckinfostageinfostage param deffectinfoenemyinfoobj dNULLBG dWALL dBOUND
xTOUCH xTAKEOFF xDIVE xS WATER xU WATER xB WATER xSKY xOUT SCOPE


At F44F0 there is text about more low level stuff like AUTOSEQ AUTOBNK FIXHEAP DMACACHE

at F4DAB you can find this:

RSP SW Version: 2.0D, 04-01-96SGI U64 GFX SW TEAM: S Anderson, S Carr, H Cheng,
K Luster, R Moore, N Pooley, A Srinivasan


Kawa-oneechan I never give you the finger, I expressed my opinion about this, I personally don't like to hack a recently published game. Then other people added their opinions about it, and it caused some backlash reaction to your mention of SM64 DS. So since then I felt bad about it, and it was obvious that you stopped posting in this thread because of this incident.

I expressed that while Nintendo tolerates hacking older games, this is pushing the envelope a little. But, at the same time, I think Nintendo likes that more people learn to program the DS. They've dubbed it the "Developer System" after all. I'm thinking more and more about trying to develop a game for the DS. In any case, I don't want people to stop posting about the DS just because I said that I didn't want to hack SM64 DS. If you continued to post about SM64 DS I wouldn't have said a word about it, I would simply continued to focus on the n64 version.

I suspect that the formats are different. From what I know about it, they probably did a complete remake of the game using data and documentation from the original, unlike the All-Stars and Mario Advance series, which are more or less "ports" of the original code. I think that they wanted to have much more freedom to redo and expand the game by doing that, and they probably designed an improved level editor for it. I suspect that they planned ahead and made it possible to port it for the Revolution. Why would they do that? How about an online multi-player version of Super Mario 64 with up to 64 players? That would be fun!
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 173/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-27-05 09:38 AM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
By 'debug menu' you mean the level selector right?

I wonder how hard it'll be to make an editor for a game that uses scripts to store its level data. :-/

Yes it's the level selector, that thing:


About the limitations imposed by the scripting aspect, a Mario 64 level editor may end up looking like my StarFox level editor (which is currently offline)

Nahhh, SM64 is different. While SF also uses the same kind of commands, they are used as the level is played, and branching can occur in the middle of a level depending on interactions, it makes it harder to represent the levels as they are and edit them. SM64 loads levels at once, even though some jumping may occur, it's a linear process overall. An editor can simply track down object locations as they are decoded, then the editor writes to those location when an object is modified.

But it all depends on how deep we want to edit the game. Ideally, we could create a whole new game using an editor, but yeah getting to that would be hard. But minimally, one could build an editor that can edit the position, rotation, type and other properties of all objects found in a level. One could also build an polygon object editor, where you can move vertices and change textures. So levels would be editable, but like in many level editors, you wouldn't be able to add or delete objects, you wouldn't be able to start from scratch. Same for the polygon editor, you wouldn't be able to add or delete a vertex, or import new models.

Removing any of these limitation on the editor could require a lot more work, and could impair on the ease of use of the editor.

Also there is still the issue of MIO0 files. Changing a 0x18 command into a 0x17 command to load uncompressed data from the ROM is doable, but can be a little complicated to do.

With this method, I was able to achieve this:


Note that it's candy for your eyes only, because there is no IPS patch for it. Anyway it's really too hard to play with the 3d controls and shifting camera and it has some other limitations (no pipes) so I don't intend to spend much more time on this hack. Maybe I'll make a movie if some ask for it, and I can also explain how it was done.

Originally posted by Cellar Dweller
As for being "optimized for speed and space", many of the functions that I have looked at seem to have been compiled by simple compiler, or one with optimizations turned off. There are may places where delay slots could have been taken better advantage of, instructions could have been omited, or instructions reorderd to minimize pipeline stalls.


I was not referring to the way individual functions are compiled, but rather the structure of the level format, and the way it's stored, loaded and rendered. My point was that SM64 DS probably has a more "bloated" structure than the original. They probably made the game much more modular and portable, so they could add new features and retool levels.

I remember reading at the time (in 1996) that Mario 64 was running at 50% the speed on their "emulated" n64 running inside the SGI workstations.

For some reason, I always felt that this early Mario 64 beta screenshot was probably taken directly out of the SGI "emulator" (I'm putting this inside quotes because it's not exactly an emu)


Anyway, Cellar Dweller, back to more serious things Do you know how this 0x18 number connects to the routine? Did you find a table where all those command's "opcodes" are stored?

Also, when you refer to "segments", is it the same thing as what I'm mistakenly call "banks". If so, it means that the segment table is where segment number's memory offsets are stored, to be used when command 0x17 and 0x18 are called? I guess I'll call them segments from now on

So did you find a list of the RAM offsets assigned to each segment? And is it dynamic?
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 174/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-28-05 12:24 PM, in Mario 64 - Amazing Stuff Link
Originally posted by Cellar Dweller
I figured out that it was a function that processed 0x18 commands by decompiling it and by looking at what it did. It calls another function that I had previously decompiled and found out that it loads data from the ROM into RAM and decompresses it. I have not found the main level loading function, but I will be looking for it.

I suggest calling them "segments" because that is what SGI and Nintendo call them. The table of segment base pointers is in a fixed place, but the memory for the decompressed MIO0 files is dynamic. I found the table by searching a savestate for a copy of a decompressed MIO0 file, translating the savestate offset into a RAM address(that was the hard part), and scanning for a copy the pointer. The RSP has its own segment table, and the base pointers must be loaded into it using the graphics command I posted the format of in a previous post(we don't need to to this to edit the level; the game code does it using this table).

One thing that I should point out is that the game code works with virtual address and the hardware and RSP microcode use physical addresses. The N64 CPU and Ultralib support complex virtual memory layouts. SM64 does not use the complex memory management features available, but instead has a simple relationship between physical and virtual addresses. The virtual addresses have the high bit set and the physical addresses have the high bit clear. Virtual and physical addresses are otherwise identical.

EDIT: $%^&$#&^ !!!!
I just found out that not all of the game code is loaded into RAM using the same difference between RAM and ROM addresses. So far, to find the address in RAM of a function found in the ROM I added 0x80245000 to the ROM offset, but this will not work for all code. The loading functions and the table with their addresses has a RAM-ROM difference of 0x80283280.

The jump table is at 0x8038b8b8 in RAM and 0x108638 in ROM.

The last function I posted has the wrong RAM address.


No probalo, I will call them segments from now on.

What is the use of the jump table again?

When you say that the memory for the decompressed MIO0 files is dynamic, do you mean that when a level is loaded, they are stored one after the other without any empty spaces in between? I guess we could run into problems if we start extending the content of MIO0 files. I'm sure that changing the size wouldn't be a problem in itself, but the game could run out of space to store all the MIO0 and data segments. It will be very useful to know how much total RAM is available for segment data. So continue hacking in that direction, it will sure be useful

Originally posted by HyperHacker
I don't see why an editor couldn't keep a copy of the script in memory, and just add or remove object commands, then find space to insert it. It'd be difficult, but I bet it could be done.

Oh yeah, and . How did you get the ? blocks, just a texture hack? (Oh, and there are pipes, as seen in the Bowser courses. )


I didn't say it was impossible, I just said it would be difficult. When you start managing space and delete things around, especially with variable size objects and with a lot of jumping around in the data, you add much more chance of ROM corruption or other problems. Take a look at level 1, as decoded with my "updated" knowledge.

At 2ABF58, 0C 0C 02 00 00 00 00 09 15 00 04 58 command 0x0C assigns number 09 to level 1.
When level 1 is called using number 09, the game jumps to offset 0x458 in segment 0x15 where you can find this:

00 10 00 0E 00 40 5A 60 00 40 5F B0 0E 00 02 64

This command 0x00, like the 17 command, copies decompressed data from the ROM into a RAM segment, but it also makes the script jump to an offset inside that segment. In this case it loads data from 405A60, and jumps to offset 405A60+0x0264.

Here is the rest of the process, with some objects clipped for space considerations.

The first number is the segment number, the seconth is the base offset in ROM of this data, and the third is the offset relative to the base offset. Just add this number to the base offset to find this data in the ROM. In brackets [] is the data found there, and a short description of commands I know about.

sg sgaddr offs [data] --Description
------------------------------------------------------------------------------------------------
0E 405A60 0264 [1B 04 00 00] --Start of RAM loading sequence
0E 405A60 0268 [18 0C 00 07 00 3F C2 B0 00 40 5A 60] --Loads MIO0 file into RAM
0E 405A60 0274 [1A 0C 00 09 00 32 D0 70 00 33 4B 30] --Loads MIO0 file into RAM
0E 405A60 0280 [18 0C 00 0A 00 2A C6 B0 00 2B 8F 10]
0E 405A60 028C [18 0C 00 05 00 13 4D 20 00 13 B5 D0]
0E 405A60 0298 [17 0C 00 0C 00 13 B5 D0 00 13 B9 10] --Loads uncompressed data into RAM
0E 405A60 02A4 [18 0C 00 06 00 1C 42 30 00 1D 7C 90]
0E 405A60 02B0 [17 0C 00 0D 00 1D 7C 90 00 1D 83 10]
0E 405A60 02BC [18 0C 00 08 00 1F 22 00 00 20 08 D0]
0E 405A60 02C8 [17 0C 00 0F 00 20 08 D0 00 20 14 10]
0E 405A60 02D4 [1D 04 00 00] --End of RAM loading sequence
0E 405A60 02D8 [25 0C 00 01 00 00 00 01 13 00 2E C0]
0E 405A60 02E4 [06 08 00 00 15 00 06 60] --Jumps to offset 0x660 in segment 0x15
15 2ABCA0 0660 [22 08 00 8C 0F 00 00 00] --Assigns object from offset 00 in segment to number 0x8C
15 2ABCA0 0668 [22 08 00 C2 0F 00 00 28]
...
Other 0x22 commands from offset 0x670 to 0x708 (clipped)
...
15 2ABCA0 0710 [22 08 00 E1 0F 00 06 6C]
15 2ABCA0 0718 [07 04 00 00] Jumps back to after last 0x06 command was used
0E 405A60 02EC [06 08 00 00 15 00 07 6C] --Jumps (again) from segment 03 to 15
15 2ABCA0 076C [22 08 00 54 0C 00 03 08]
15 2ABCA0 0774 [22 08 00 55 0C 00 03 28]
15 2ABCA0 077C [22 08 00 56 0C 00 00 00]
15 2ABCA0 0784 [07 04 00 00] --Jumps back (again)
0E 405A60 02F4 [06 08 00 00 15 00 09 58]
15 2ABCA0 0958 [22 08 00 64 0D 00 03 58]
...
Other 0x22 commands from offset 0x960 to 0x988 (clipped)
...
15 2ABCA0 0990 [22 08 00 6B 0D 00 00 B8]
15 2ABCA0 0998 [07 04 00 00]
0E 405A60 02FC [22 08 00 17 16 00 0F E8]
0E 405A60 0304 [22 08 00 36 0E 00 04 40]
0E 405A60 030C [22 08 00 37 0E 00 04 58]
0E 405A60 0314 [22 08 00 38 0E 00 04 70]
0E 405A60 031C [1F 08 01 00 0E 00 04 88] --Assign main level geometry to number 0x100?
0E 405A60 0324 [06 08 00 00 0E 00 00 00]
0E 405A60 0000 [24 18 1F 36 05 B0 03 00 01 BE 00 00 01 46 00 00 00 00 00 00 13 00 48 68]
Command 0x24 places an object in the level with a position x,y and z and a rotation, plus other parameters.
0E 405A60 0018 [24 18 1F 37 F7 01 02 CD 04 00 00 00 00 2D 00 00 00 03 00 00 13 00 4B 1C]
0E 405A60 0030 [24 18 1F 00 F7 FE 00 00 F4 03 00 00 00 19 00 00 00 00 00 00 13 00 25 E0]
0E 405A60 0048 [24 18 1F CF F7 15 00 00 F1 9E 00 00 00 1B 00 00 00 00 00 00 13 00 14 78]
0E 405A60 0060 [24 18 1F CA 06 4C 01 2C 12 03 00 00 00 00 00 00 00 28 00 00 13 00 1B 70]
0E 405A60 0078 [07 04 00 00]
0E 405A60 032C [06 08 00 00 0E 00 00 7C]
0E 405A60 007C [24 18 03 00 05 FF 0F 00 EA 47 00 00 00 00 00 00 00 00 00 00 13 00 3A A4]
...
Other 0x24 commands from offset 0x94 to 0x1B4 (clipped)
...
0E 405A60 01CC [24 18 3C 68 0D 48 03 02 19 64 00 00 00 00 00 00 00 01 00 00 13 00 45 80]
0E 405A60 01E4 [07 04 00 00]
0E 405A60 0334 [06 08 00 00 0E 00 01 E8]
0E 405A60 01E8 [24 18 01 56 06 64 10 92 EA 41 00 00 FF 6D 00 00 00 00 00 00 13 00 01 F4]
0E 405A60 0200 [24 18 02 03 F0 5C 00 00 14 65 00 00 00 00 00 00 00 00 00 00 13 00 2A 48]
0E 405A60 0218 [24 18 3F 00 E8 90 03 E8 09 60 00 00 00 00 00 00 03 00 00 00 13 00 3E 8C]
0E 405A60 0230 [24 18 3F 00 E6 38 03 E8 04 E2 00 00 00 00 00 00 04 04 00 00 13 00 3E FC]
0E 405A60 0248 [24 18 3F 7A 06 0E 04 B0 01 2C 00 00 00 00 00 00 05 00 00 00 13 00 3E 3C]
0E 405A60 0260 [07 04 00 00]
0E 405A60 033C [24 18 1F 00 E6 62 03 E8 19 40 00 00 00 87 00 00 00 0A 00 00 13 00 2F 74]
0E 405A60 0354 [24 18 1F 00 02 47 0A 7B EA F5 00 00 FF 66 00 00 00 0B 00 00 13 00 07 5C]
0E 405A60 036C [24 18 1F 00 06 90 0E FB EA 6D 00 00 FF 67 00 00 00 0C 00 00 13 00 07 5C]
0E 405A60 0384 [24 18 1F 00 E6 2C 04 00 F2 E9 00 00 00 6B 00 00 00 0D 00 00 13 00 07 5C]
0E 405A60 039C [24 18 1F 00 07 BC 03 00 19 DA 00 00 FF 69 00 00 00 0E 00 00 13 00 07 5C]
0E 405A60 03B4 [26 08 0A 09 01 0A 00 00] --??
0E 405A60 03BC [26 08 0B 09 01 0C 00 00]
0E 405A60 03C4 [26 08 0C 09 01 0B 00 00]
0E 405A60 03CC [26 08 0D 09 01 0E 00 00]
0E 405A60 03D4 [26 08 0E 09 01 0D 00 00]
0E 405A60 03DC [26 08 F0 06 01 32 00 00]
0E 405A60 03E4 [26 08 F1 06 01 64 00 00]
0E 405A60 03EC [2E 08 00 00 07 00 E9 58] --Loads collision/clipping data from segment 07
0E 405A60 03F4 [39 08 00 00 07 01 10 4C] --Loads other objects layout data inside segment 07
0E 405A60 03FC [30 04 00 00] --??
0E 405A60 0400 [36 08 00 00 00 03 00 00] --Music!! 0x03 is Level 1. 0x11 is Bowser's courses music.
0E 405A60 0408 [31 04 00 00] --??
0E 405A60 040C [20 04 00 00] --??
0E 405A60 0410 [1E 04 00 00] --??
0E 405A60 0414 [2B 0C 01 00 00 87 E6 62 00 00 19 40] --??
0E 405A60 0420 [11 08 00 00 80 24 BC D8] --?? "8024BCD8" is a RAM address right?
0E 405A60 0428 [12 08 00 01 80 24 BC D8] --??
0E 405A60 0430 [1C 04 00 00] --??
0E 405A60 0434 [04 04 00 01] --??
0E 405A60 0438 [02 04 00 00] --End of Level script


The game seems to jump back and forth to segment 0x15 to load and assign enemies to numbers. But there is also a lot of jumping around from and to segment 0x0E to place objects using command 0x24. Maybe there is a reason why there seems to be groups of objects that are accessed like sub-routines, and that messing around with this grouping could lead to problems.

I sound a little negative on this, but your original question was "I wonder how hard it'll be to make an editor for a game that uses scripts to store its level data. :-/". So I gave you a taste of how hard it could be to make an editor

Now about the SMB in SM64 hack. The '?' block and the brick are texture hacks on '!' blocks. The coin '?' blocks contain coins, and the Power '?' blocks contains a red cap. Bricks contains the metal cap, and another type of block, used for the end of level staircase contains the vanishing cap (not seen in my screenshots).

I hacked the decompressed MIO0 data for the '!' textures, then pasted the -uncompressed- data at the end of the 8 megs ROM, with padding to make it a 16 megs ROM. I then went to find the 0x18 command that loaded this MIO0 data, change it to a 0x17 command so it would copy uncompressed data instead, and repointed the offset to where the data was, at 0x800000.

I did pretty much the same for the level layout, copying the uncompressed level 1 MIO0 file after the other uncompressed file at the end of the ROM, since I modified objects found inside the MIO0 file, the ones that are documented in a list somewhere in the thread.

One of the problem is that the cubes are too big for Mario, but I didn't find available objects that where the right size. Anyway it's already too hard to walk straight on platforms even at this size. The size makes the platforms too high for Mario to reach without a double-jump. Also the block are very sensible to trigger, and will explode even with side collision. Blocks with coins disappear and don't come back like others.

Sure I know that there are pipes in SM64 Remember the opening when you first start a new game? The problem is that the MIO0 file that contains the pipe object is not loaded with level 1. Also, pipes in SM64 cannot have a variable height, as is. And lastly, it's hard to stand on those pipes without falling into them as Mario magically avoided to in SMB. My plan was to use logs objects, that I would distort to make them larger, and then hacked the texture so the sides would be green, and the top as a green ring with a black circle. To make higher pipes, I would have stacked them on top of one another. There is also not enough objects space for all blocks in level 1-1.

(Edit: I just found out that command 0x36 loads music for the level! Command 36 for level 1 starts at 0x405E60 in ROM, just change the 03 to something else and have fun!)


(edited by VL-Tone on 09-28-05 03:55 AM)
(edited by VL-Tone on 10-03-05 07:05 PM)
(edited by VL-Tone on 10-03-05 07:08 PM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 175/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-29-05 08:53 AM, in Mario 64 - Amazing Stuff Link
Originally posted by Cellar Dweller
The jump table I mentioned points to the functions that process the level commands. For example, the 0x18th entry points to the function that processes the command to load a compressed file.

I don't think that expanding MIO0 files will be a problem unless they get so big that all of the MIO0 files required by a level will fail to fit into memory. Dynamic memory means that the game code will allocate memory on an as needeed basis, and level data may be placed in different places each time a level is loaded.


So you mean that these jump points are in order, command 0x00 being the first? This is a great discovery then!

About the MIO0 file size, that's what I was saying, changes in individual MIO0 files would not be a problem, but the total size of all segments could be too high. Do you have any idea how much total RAM is available for segment data? As for the segment table, is it reseted each time a level is loaded?

Yesterday I found the command to load music for a level (0x36), the byte defining music for level 1 is at 405E66 in ROM, and normally contains 03. Here is the list of possible values (There may be some little mistakes in it, as I was tired when I made this list)

00-nothing?
01-end level
02-SMB music title
03-Bob-omb's Battlefield
04-Inside Castle walls
05-Dire Dire Rocks
06-Lethal Laval land
07-Bowser battle
08-Snow
09-Slide
0A-Crash
0B-Piranha plant lullaby
0C-Hazy Maze
0D-SMB Star select
0E-Wing cap
0F-Metal cap
10-Bowser Message
11-Bowser course
12-Star catch
13-Ghost Merry-go-round
14-Boss defeat?
15-Star appears
16-Boss fight
17-Take a Key
18-Looping stairs
19-Crashes
1A-Credits song
1B-Crashes
1C-Toad
1D-Peach message
1E-Intro Castle sequence
1F-End fanfare
20-End music
21-Menu
22-Lakitu

Values higher than 22 seem to be silence, but I didn't check higher than 30 so there may be some other tunes (but I doubt it since the other values seem to cover any known songs in the game)


(edited by VL-Tone on 09-28-05 11:55 PM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 176/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 09-30-05 09:06 AM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
Originally posted by VL-Tone
05-Dire Dire Rocks

Docks, not Rocks. Don't suppose you managed to find the RAM address that selects which music to play? I always wanted that, but couldn't find it... (though I suppose I can look again now that I have this list.)


Well I think that the Dire Dire Docks tune Rocks! About the crashing music values, I thought the same, maybe they were used for music that was removed from the beta version. As for the RAM portion that select which music is played, I didn't look for it. I found the 36 command use just by comparing the difference between values in different levels. When I saw that bowser courses had the same values, it became evident to me that it was the music command. You might check for the 0x36th entry in the jump table and try to disassemble the 0x36 command to see what it changes in RAM.

Using the behind Mario cam could be useful to run in straight lines, but it's very hard to see where you are going when playing a SMB level with the equivalent of a first-person-view, the best would be to have the camera sideways. I guess that we'll eventually learn more about how the Lakitu cam works, so that maybe we could avoid unwanted shifts in the view angle.

Thanks stag019 for fixing my list

As for value 0x00, it seems that Peardian is right, by looking at the castle ground level script I saw that it uses value 0x00 for the 0x36 command. I don't know why the birds are not chirping in level 1... Maybe the bird samples are not loaded in level 1?

By the way Peardian, you don't bother us at all, don't hesitate to post again in this thread

tachyon: no the beta shot was not on my site, I hope I didn't make the guy bust his bandwidth by linking the screenshot directly...

Zachio: Thank you for the kind comments,there are much more screenshots that are offline for now, I'm working on fixing that.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 177/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 10-01-05 10:25 AM, in Mario 64 - Amazing Stuff Link
Originally posted by stag019
I've figured, as I've seen it before.
30 pages. This is getting more activity now!
Thanks stag019 for fixing my list
No problem
When I saw that bowser courses had the same values, it became evident to me that it was the music command.
What are the offesets to those levels music? And what other levels do you know?


I'm not sure what is your question, maybe I didn't explain it well. I simply used my level decoder to output the level layout as formated hex. Then I looked for the 0x36 command inside a few levels. I knew that Level 1 had value 0x03 and then found that Bowser's courses all had 0x11 as a parameter. I could have been wrong, but it turns out to be the music command as I thought. Part of my SM 64 hacking has been like that, figuring out commands by looking at them and their context, and trying to guess what they were used for, and I was usually right, since I already did the same for a similar script format and commands in StarFox. Many of these commands crash when you change a parameter to a value that is not valid, so I couldn't just "corrupt" each of them and deal with repeated emu crashes and weirdiness until I found a correct value that could show the function of each commands. Anyway, the jump table Cellar Dweller found, will be very useful, but my "intuition" can also have it's purpose, as it's not always obvious to find the purpose of a command by looking at the ASM that powers it.

Cellar Dweller: I don't know much yet about USF music ripping (yet), do these people have to figure out the actual format of the tunes? Or do they rip out the music playing code and the data without knowing the details of the format? I always suspected that in SM64, music was in MIDI format, or a variation on it. Obviously, the songs were played on a MIDI keyboard and recorded in MIDI format. Part of the Dire Dire Docks song (which rocks ), seem like it was played "live" by Koji Kondo on a pressure sensitive keyboard, as there is a human feel to variations in the intensity of the notes.

Also, I looked at the disassembled code, I noticed the off0x36 and off0x38 at the end, does it mean that command 0x38 also loads music?
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 178/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 10-03-05 12:39 PM, in Mario 64 - Amazing Stuff Link
Originally posted by stag019
Originally posted by VL-Tone
I'm not sure what is your question...

I mean like this:
395FCD=Cool, Cool, Mountain
405E65=Bob-Omb Battlefield
40EAE9=Snowman's Land
42CAFD=Huge Island
42CBAD=Tiny Island
45C2DD=Bowser in the Dark World
46ACAD=Bowser in the Fire Sea
4780F5=Bowser in they Sky
4EB7A4=Whomp's Phorteress

Anyone who can help, please do so.
VL-Tone, how hard would this be to implement in your next version of your editor? That is, if you keep working on it.


oh you mean something like that?
Haunted House
-- 382E31 : [36 08 00 06 00 0A 00 00]

Cool Cool Mountain
-- 395FCD : [36 08 00 00 00 08 00 00]
-- 396035 : [36 08 00 01 00 09 00 00]

Inside Castle
-- 3CFDC9 : [36 08 00 01 00 04 00 00]
-- 3CFEBD : [36 08 00 01 00 04 00 00]
-- 3CFF95 : [36 08 00 01 00 04 00 00]

Hazy Maze Cave
-- 3E6EF9 : [36 08 00 04 00 0C 00 00]

Shifting Sand Land
-- 3FBDED : [36 08 00 00 00 06 00 00]
-- 3FBEC1 : [36 08 00 04 00 0C 00 00]
-- 3FBF0D : [36 08 00 04 00 0C 00 00]

Bob-Omb's Battlefield
-- 405E65 : [36 08 00 00 00 03 00 00]

Snow Man's land
-- 40EAE9 : [36 08 00 00 00 08 00 00]
-- 40EB69 : [36 08 00 04 00 0C 00 00]

Wet Dry World
-- 41A481 : [36 08 00 03 00 0C 00 00]
-- 41A4D5 : [36 08 00 03 00 0C 00 00]

Jolly Roger Bay
-- 424381 : [36 08 00 03 00 05 00 00]
-- 4243E9 : [36 08 00 03 00 05 00 00]

Tiny Huge Island
-- 42CAFD : [36 08 00 00 00 03 00 00]
-- 42CBAD : [36 08 00 00 00 03 00 00]
-- 42CC4D : [36 08 00 04 00 0C 00 00]

Tick Tock Clock
-- 437609 : [36 08 00 01 00 09 00 00]

Rainbow Ride
-- 44A761 : [36 08 00 00 00 09 00 00]

Castle Grounds
-- 454C05 : [36 08 00 00 00 00 00 00]

Bowser 1 Course
-- 45C2DD : [36 08 00 00 00 11 00 00]

Vanish Cap
-- 4613D9 : [36 08 00 00 00 09 00 00]

Bowser's Fire Sea
-- 46ACAD : [36 08 00 00 00 11 00 00]

Secret Aquarium
-- 46C2D1 : [36 08 00 03 00 85 00 00]

Bowser 3 Course
-- 4780F5 : [36 08 00 00 00 11 00 00]

Lethal Lava Land
-- 48D2E9 : [36 08 00 00 00 06 00 00]
-- 48D351 : [36 08 00 04 00 06 00 00]

Dire Dire Docks
-- 495DFD : [36 08 00 03 00 05 00 00]
-- 495E79 : [36 08 00 03 00 05 00 00]

Whomp's Fortress
-- 49E1F9 : [36 08 00 05 00 03 00 00]

Castle Courtyard (may freeze)
-- 4AF835 : [36 08 00 00 00 00 00 00]

Peach's Secret Slide
-- 4B7FD5 : [36 08 00 01 00 09 00 00]

Metal Cap
-- 4BEB3D : [36 08 00 04 00 0C 00 00]

Wing Cap
-- 4C2821 : [36 08 00 00 00 09 00 00]

Bowser 1 Battle Platform
-- 4C4259 : [36 08 00 02 00 07 00 00]

Rainbow Clouds Bonus
-- 4CDADD : [36 08 00 00 00 09 00 00]

Bowser 2 Battle Platform
-- 4CEB25 : [36 08 00 02 00 07 00 00]

Bowser 3 Battle Platform
-- 4D1745 : [36 08 00 02 00 19 00 00]

Tall Tall Mountain
-- 4EB7A9 : [36 08 00 00 00 03 00 00]
-- 4EB815 : [36 08 00 01 00 09 00 00]
-- 4EB861 : [36 08 00 01 00 09 00 00]
-- 4EB8C9 : [36 08 00 01 00 09 00 00]


It seems that more than one 0x36 command can be found in one level. Often, it's used for the hidden slides music. Also while the 6th byte is the song number I identified, the 4th byte is unknown to me, so I'll let you the pleasure of finding it yourself I'm still working on the editor, but maybe it would me more fair to say "I didn't abandon working on it" since I didn't work much on it lately. The main problem is that the newer decoder is incompatible with the editor part, so I would have to make some major changes. Also my new decoder gives me errors while loading some levels, and I didn't feel like debugging it... Anyway until I move to a new host I won't release an update.

Cellar Dweller , that 4th byte must be the one you were talking about. As for MIDI, with what you've said, I'm now pretty sure we'll find MIDI files somewhere inside Mario 64, they may not have the standard MIDI header, since I didn't find any instance of it (it starts with "MThd").

(Edit: forgot to address the part about my editor)

Edit: Forgot to tell you about some finding I made yesterday. I confirmed that Zelda: Ocarina Of Time, does indeed uses the same polygon object format (with a few new commands). I thought it was a given, but it's nice to see it confirmed (looks like I'm replying to myself). There are a whopping 1400+ Yaz0 files inside OOT (is my decoder buggy or there are some big empty spaces found in some of those?).

Anyway Mario 64 fans, don't worry, I won't spend more time on Zelda OOT anytime soon. And to Zelda fans... sorry


(edited by VL-Tone on 10-03-05 03:45 AM)
(edited by VL-Tone on 10-03-05 03:46 AM)
(edited by VL-Tone on 10-03-05 04:02 AM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 179/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 10-04-05 01:22 PM, in Mario 64 - Amazing Stuff Link
Originally posted by HyperHacker
A lot of Nintendo games probably use formats like this.
Any idea why there's 4 music bytes in Tall Tall Mountain?

Yes but not as much as you may think. Along the way, Nintendo switched tools, and most third parties used their own format.

As for why there are four 0x36 commands in Tall Tall Mountain? This is a very interesting question

The first command triggers song 0x03 which is Level 1's song also used in TTM. The three others trigger the slide music... I'm not sure why there are 3 of them. It seems that the level layout data is grouped in 4 main groups. They end or start with 0x31 and 0x20 commands.
Are there 3 way to enter the TTM slide? I don't know yet what enable switching between those groups.

Actually I found something not so far from that, but it's not directly connected to the groups, I cannot find any offsets referring to them.

So what I found is the main use of the 0x26 command. It's used to connect warps, doors and slides!

Let's take a look at part of Cool Cool Mountain (which is easier to understand than TTM)

395F04 [24, 18, 1F, 00, FA, 18, 0D, E8, F6, FF, 00, 00, 00, 8C, 00, 00, 00, 0A, 00, 00, 13, 00, 2F, 74]
395F1C [24, 18, 1F, 00, FF, 4B, 0B, 66, FA, 32, 00, 00, 00, 00, 00, 00, 0F, 1E, 00, 00, 13, 00, 07, 80]
395F34 [24, 18, 1F, 00, F8, C9, 0A, FF, FE, BF, 00, 00, FF, 62, 00, 00, 00, 1F, 00, 00, 13, 00, 07, 5C]
395F4C [24, 18, 1F, 00, 0D, 15, ED, AA, FF, 49, 00, 00, FF, DE, 00, 00, 00, 20, 00, 00, 13, 00, 07, 5C]
395F64 [26, 08, 0A, 05, 01, 0A, 00, 00]
395F6C [26, 08, 14, 05, 02, 14, 00, 00]
395F74 [26, 08, 1E, 05, 02, 0A, 00, 00]
395F7C [26, 08, 1F, 05, 01, 20, 00, 00]
395F84 [26, 08, 20, 05, 01, 1F, 00, 00]
395F8C [26, 08, F0, 06, 01, 33, 00, 00]
395F94 [26, 08, F1, 06, 01, 65, 00, 00]


I included the 0x24 commands that are before the 0x26 series because they are connected to the 0x26 command. These objects have a type byte of 00 so they are invisible, depending on the behavior associated with them, they can be an entry or exit point, a warp, a room transition. The 18th byte of these particular commands identify them, and these id numbers are referred by the 0x26 command.

The first one has id 0x0A and behavior 13002F74 which is the behavior for Mario's start position in the level. Id 0x1E is for the chimney entry, id 0x1F and 0x20 are warps on the broken bridge on top and bottom of the mountain.

The first 0x26 command puts Mario at the starting point of the main level, pointing at the 0x0A position. For some reason, changing the values for this particular command have no effect. I'm not sure if the second command is even used. It warps to the wooden house at the bottom of the slide, like you entered it by the door (which is impossible normally since the door knob disappear when you exit the slide bottom house).

The third command is more interesting , it's the warp to the Penguin Slide.

395F74 [26, 08, 1E, 05, 02, 0A, 00, 00]

1E is the entry point, in the chimney. I don't know the use of the 0x05, it's value can vary in other levels, commonly used values include 0x05, 0x06 and 0x24. The 0x02 (fifth byte) selects the slide level, and 0x0A is the id of the position inside the slide area (which is not the same as the 0x0A position in the main level).

The fourth and fifth commands warp between the two bridges, from position id 0x1F to 0x20 and back. This happens inside the main level as specified by the 0x01 value.
395F7C [26, 08, 1F, 05, 01, 20, 00, 00]
395F84 [26, 08, 20, 05, 01, 1F, 00, 00]

The two last commands are for the level exits,either by dying or taking a star.
395F8C [26, 08, F0, 06, 01, 33, 00, 00]
395F94 [26, 08, F1, 06, 01, 65, 00, 00]

F0 is for successful exits and F1 is for a failed attempt. The 33 and 65 values point to the Cool Cool mountain paintings inside the castle. If you change the 0x01 value to 0x02 you can access paintings found higher in the castle.

So have fun experimenting with changing those values


(edited by VL-Tone on 10-04-05 04:27 AM)
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 180/200
EXP: 64158
For next: 3565

Since: 06-06-04
From: In the Moon!

Since last post: 5 days
Last activity: 2 hours
Posted on 10-06-05 01:41 AM, in Mario 64 - Amazing Stuff Link
Dang my Cable Modem ISP (videotron) has been down all day yesterday...

Anyway the good news is since I didn't have the net to waste my time reading digg.com I did spend some more time on hacking Mario 64...


The result? I found that the 0x26 command can be used to warp at any entry/exit point in the game instantly!

From CCM: 395F84 [26, 08, 20, 05, 01, 1F, 00, 00]

This command will warp from warp 0x20 in the current level area to Course 0x05 (CCM) --> area 0x01 --> entry point 0x1F. Using the good old SMB level number syntax, it could be written as 5-1-1F. At 2ABE8C in the ROM you can see a bunch of 0x0C commands. As I explained somewhere in the thread the 0x0C command assigns id numbers to levels, storing the related pointers. The 0x0C command at 2ABE8C as an id number of FFFFFFFF and this means -1, the negative values are assigned to title screens and menus. Somewhere after that you'll find 0x0C commands with positive id numbers that refers to levels, and the one with id 00000005 is incidentally Cool Cool Mountain.

Also from CCM, the death exit warp is 395F94 [26, 08, F1, 06, 01, 65, 00, 00]

0x06 is the inside of the castle, 0x01 is the first floor area and 0x65 is one of the two exit point from the CCM painting (could we call it Level 6-1-65?). The successful exit point for CCM is 0x33, as defined by a 0x24 command and associated behavior. This means a level could exit to two different locations in the same room as the painting. But like I said, the game can warp to any other exit/entry point in any level.

The only problem I found is when you assign an exit with a success painting exit behavior to a non F0 or F1 0x26 command, it will freeze after playing the animation (just like the Castle courtyard I experimented when swapping painting entry points). Note that the painting entry points doesn't use the 0x26 command.

If you jump from something that is not a real "warp" to a real warp exit point, you may not have time to regain control of Mario before he gets warped by the warp point he's standing on. (by real warps I mean place you stand and fade away) Other than that, you can warp to anywhere in the game.

There are 177 0x26 commands found in the level data. Some may have duplicate "warp to" values, but from a rough estimate there are at least 100-150 different places Mario can warp to.

I made a cool little program that I will probably publish, called "Super Mario 64 Shuffle". It randomize entry and exit points in the game. This can lead to a very fun game (or one that is pretty limited depending on how you are lucky). Every-time you enter a double door or jump into a hole, use a warp or enter a mini game inside you will have a surprise. I didn't randomize the death/completed exits values, but that could be an option. I'm thinking also of adding a "shuffle paintings entries" option too.

Ideally, one could patch the 0x26 command so that it always warps at a random place.

So any-how, more serious applications includes very complex mazes, and the "fight all bosses , one after the other" hack that was requested before.

In other news, I found Yoshi! Well I mean I already found the geometry a while ago, but now I found the 0x24 command that places Yoshi on the top of the castle. The command is at 454ACC, Yoshi type number is 0x55 (for this level only). Its behavior (13 00 45 38) only makes it appear at specific conditions so we'd have to use another behavior to make him visible. Unfortunately I didn't find a behavior (yet) that makes it behave like he should. In the mean time, I found that the butterfly behavior on Yoshi gave very funny results.

at 454ACC in the ROM, replace:
24 18 1F 55 00 00 0C 66 EA 07 00 00 00 00 00 00 00 00 00 00 13 00 45 38
With:
24 18 1F 55 FA D0 01 04 12 38 00 00 00 00 00 00 00 00 00 00 13 00 33 BC

You'll get an epileptic Yoshi hovering above the ground like a butterfly... Very funny! While you are at it, look at the few 0xBB values just before that, used in 0x24 commands, change them all to 0x55... Now you get levitating epileptic Yoshies everywhere on the Castle grounds!

Have fun!

(Edit: Hmmm have I said or did something wrong? None has been replying to this thread since the last 3 days! Should have I provided an IPS patch and/or screenshots? Maybe I offended some by mentioning epilepsy? Ah well I guess that all the usual contributors have better things to do these days...)


(edited by VL-Tone on 10-05-05 04:49 PM)
(edited by VL-Tone on 10-08-05 09:50 PM)
Pages: 1 2 3 4 5 6 7 8 9 10
Acmlm's Board - I2 Archive - - Posts by VL-Tone


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.012 seconds.