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
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Mario 64 - Amazing Stuff | |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
BGNG

Snifit
Level: 22

Posts: 71/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-23-05 09:53 PM Link | Quote
I just looked it up... Essentially, UV mapping is the lazy man's version of texture mapping. If you take a 3D model and "unwrap" it so all the polygons are in the same plane, stick a texture over it, then "wrap" it back the way it once was, you end up with a textured model.

The U parameter is the horizontal texture coordinate; ranging from 0 to 1, starting on the left. The V parameter is the vertical texture coordinate; ranging from 0 to 1, starting on the bottom. As far as I can tell, those are the limits of the parameters' values.
__________

ST Mapping, on the other hand, doesn't have those limitations. S is the horizontal coordinate (with 0 at the left) and T is the vertical coordinate (with 0 on the bottom) and any parameters are relative to the origin. Any value with an absolute value greater than 1 will simply repeat the texture. So to map a texture across a polygon twice horizontally, you would use (0, 0) on the bottom-left corner, and (2, 1) on the top-right. Of course, there's also the (0, 1) and (2, 0) for the other corners.

OpenGL supports both styles, I believe, but ST is the most often used. The Nintendo 64, I also believe, uses OpenGL.
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

Posts: 1690/2481
EXP: 3008456
For next: 7355

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 06-24-05 12:24 AM Link | Quote
Originally posted by BGNG
The Nintendo 64, I also believe, uses OpenGL.
That would be fun. I for one am quite sure the DS does.

Goes fine with the SNES>GBA,N64>DS analogy, if you think about it...
BGNG

Snifit
Level: 22

Posts: 73/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-24-05 12:47 AM Link | Quote
I'm using OpenGL for my other project. Surprisingly, F-Zero X doesn't use any lighting on the course polygons. It's just that the fog is so close that it looks shaded.

Also, does Super Mario 64 apply lighting to course polygons? I can't recall off the top of my head.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5209/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 06-24-05 12:55 AM Link | Quote
I'd appreciate whatever info you have about what parts of the decompressed MIO0 files mean what. This will help me narrow down my search for other data.

Also I bet I know why they called it MIO0. MarIO compression spec, version 0.
BGNG

Snifit
Level: 22

Posts: 75/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-24-05 12:59 AM Link | Quote
Off-topic, but what about Yaz0 which is used in the Zelda games? YAmauchi's Zelda compression specification 0?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5219/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 06-24-05 05:41 AM Link | Quote
I was trying to think of that, couldn't come up with anything. That sounds about right though.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 61/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 06-24-05 10:29 AM Link | Quote
My bet is on Yet Another Zelda

Kitten Yiffer: It's ok I forgot to reply in my last StarFox editor thread too Glad you like the StarFox editor, don't worry I won't abandon it. Still ask a random average person if he knows or played StarFox and most of them won't know or only vaguely remember. Ask for Super Mario 64 and it's another thing...

There is more than the flower beds having the wrong texture, look at the green bridge, it uses the same grass textures. There are like 8 main groups of polygons in the level. The cannon rock-textured base and the flower beds and other objects are part of the same group on which I assigned a single texture. Obviously there are sub-groups that should have each their own textures.

HyperHacker you got really good data posted at the start of this thread, it was not so uninteresting I guess my discoveries shifted to focus. Maybe you can repost some of it to continue the effort?

What will be needed to have correct textures support is the routine that loads them in texture RAM and/or the offset table for each levels. The S,T coordinates seem to point to the textures loaded in the texture cache and the texture setup can be composed of many 32x32 or 64x64 tiles from arbitrary MIO0 files. For now I got around that using a hack by using S,T coordinates on single 32x32 tiles, scaled back

BGNG I don't think that the n64 uses OpenGL I'm pretty sure, it had to much overhead to be used on a console at the time. Having custom libraries fitted to the Flipper chip probably got them much more speed. Most n64 emulators though use OpenGL but they got some translation code going on translating native GPU calls to OpenGL. If anyone can find a (legal) doc that tells that the n64 used OpenGL I would be more than happy to see it, but I would also be very surprised.

SM64 does apply lighting to course polygons, the game would have looked very plain without it. But it's only simple ambient light shading.

Shockwave can use OpenGL, Direct X or a software renderer, but doesn't provide complete control.

I'm not sure if I understand the difference between U,V and S,T yet, is the only difference the fact that the texture repeats when the coord is greater than one? Because this is very easy to deal with, and that looks like what I did (I turned on the repeating texture property).

If anyone can run the 1964 emulator (I cannot run it on my alien computer), I read it can show and save textures in RAM, could anyone please dump the textures loaded for Level 1 and/or the outside castle?

HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5243/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 06-24-05 11:45 AM Link | Quote
Well, if you know of any RAM addresses related to the textures, I have a real N64 and Gameshark I can use to find what code reads to/writes from them. I don't know a way to do it for reads from the ROM though.

You should post the offsets of the files that contained those backgrounds and textures. If pointers to them can be found in the level headers, that would tell us a lot about how the game loads them. (Recall the pointer table format; pointers to the start and end of level data, some unknown pointers, then several in a repeating float-pointer-pointer format. It's very interesting.)

Again, also, I'd like to know as much as possible about the layout of the files with level data. It'd be a huge help to find other data within them.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 62/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 06-24-05 05:00 PM Link | Quote
Well HyperHacker, I should have reread your first posts in detail instead of asking you to repost parts of them

The textures I used are from 32D070...

This is from one of your first posts in this thread:
Originally posted by HyperHacker

...
405CD0 - 00405A60 pointer to 2 bytes past the end of level 1 layout file (no file here O_o)
405CD4 - 1A0C0009
405CD8 - 0032D070 pointer to GFX (bars, wall, etc)
405CDC - 00334B30 pointer to GFX (textures)
405CE0 - 180C000A if changed, PJ64 just kinda stops O_o (tried 1810000A and 1808000A)
405CE4 - 002AC6B0 pointer to GFX (clouds, water)
...



So yes HyperHacker you were really into something there...

Change 0032D070 to 0031E1D0 at 405CD7 in the ROM and here is what you get:
(Edit: In reversed bytes order you have to change 320070D0 to 3100D0E1 at 405CD7)


Yes, it's Level 1 with Lethal LavaLand textures from 31E1D0! I chose this one because it's also a texture-only MIO0 file filled with 32x32 tiles and it's only slightly bigger. So it's official, these are pointers determining which textures to load for level 1. I also tried to change 180C000A to 180C000B (always try to hack lowest significant bytes first) and the game didn't crash, but had a garbled background instead of the clouds. Since 002AC6B0 is referring to the cloud bg graphics MIO0 file, it shows that 180C000A is linked to the next referred texture.

So have fun with address 405CD8!


(edited by VL-Tone on 06-24-05 08:02 AM)
(edited by VL-Tone on 06-25-05 07:44 PM)
(edited by VL-Tone on 10-27-05 12:15 AM)
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 230/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 06-24-05 05:43 PM Link | Quote
The pointers to vertices/textures are 32 bits according to the files I have. I have also found out that the FD commands point to textures in thier last 32 bits. Looking at the decoded bob-omb battlefield file, I tried to find the texture images that the FD command pointed to. I found that if the high byte of the 32 bit pointer was 07, like the vertex pointers, a texture could be found in the same file at the location pointed to by the lower 24 bits of the pointer.

I think that the high byte if the pointer indicates which of the loaded files contains the texture/vertices and the game code repoints them to the decoded location in RAM before sending the commands to the RCP.

EDIT:
FD 10 00 00 09 00 48 00

0 : FD = command to set the location and format of a texture image
1 : format/pixel size fffpp000
f = format
RGBA = 000 (there are other options)
p = storage size of 1 texel
16 bits = 10 (other options too)
0 = unused
2 - 3 : "width" minus one in the lower 12 bits-- I am not sure why this is zero.
4 - 7 : pointer

E6 00 00 00 00 00 00 00

This is just makes the RDP wait until it is not using any textures, or something like that, in preparation for loading the texture image. It has no parameters.

F3 (00 0,0 00) 07 (7F F)(1 00)

0 : F3 = command to load the texture into the texture memory along with more settings
1 - 3 : the s, t coordinates of the upper left corner of the texture tile in fixed point format
4 : the tile number on the lower 3 bits
5 - 7 : the s coordinate of the lower right corner of the texture tile and some sort of fixed point slope



These are low level drawing commands that are the product of a higher level API. In other words, the drawing was done with the Ultralib functions/macros and the resulting low level drawing list was compressed.


(edited by Cellar Dweller on 06-24-05 10:17 AM)
BGNG

Snifit
Level: 22

Posts: 76/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-24-05 10:27 PM Link | Quote
I've played Starfox! Never beat it on level 3, though. Andross always killed me and I hate the boss in Venom Airspace. Hard to hit.

If N64 doesn't use OpenGL, then it's something based off of OpenGL. I've noticed the same peculiarities for "close polygon" clipping in my own programming; things which are only present in OpenGL. Most emulators, as I am aware, actually use Direct3D.

And it's kinda peculiar to see trees growing out of solidified lava...
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 63/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 06-24-05 10:37 PM Link | Quote
That's really really great info Cellar Dweller

Even before you added things in your edit I produced this from the first info you told about the FD command:

At last the sub groups have their own textures... still you can see a few problems with some triangles, I'm not sure about the bug yet, I guess it has something to do with CW vs CCW vertex ordering. Or maybe it's just a stupid bug in my decoder

Now with the added info, I guess I'll have the outside of the castle fully textured soon

(Edit: replying to BGNG)

BGNG Yeah route 3 is hard, the trick is to get to Andross with the Hyper Blaster weapon.

Maybe there is really something akin to OpenGL in the n64 , but keep in mind that there are not 1000's of ways to deal with basic issues in 3d, and that most 3d engines have many similarities. Still, since the n64 started as software on a SGI workstation, it's not impossible that OpenGL was used first, then retrofitted in a custom manner to get the most out of the GPU.



(edited by VL-Tone on 06-24-05 01:47 PM)
(edited by VL-Tone on 10-27-05 12:18 AM)
BGNG

Snifit
Level: 22

Posts: 79/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-25-05 12:55 AM Link | Quote
To apply the texturing to the sky, you'll need a technique similar to a sky box, but more like a "sky plane."

Based on the look of the look of the textures used for the backgrounds, I would say you can probably get away with drawing a single square first with depth testing disabled. Just have it loop horizontally like, maybe four times depending on the angle of the camera. That'd be the azimuth. Then have it scroll vertically depending on the angle of elevation.


That's kinda cryptic, but here's the run down:

Camera azimuth: φ
Camera elevation: θ
Center's S coordinate: ( φ - Int( φ / π ) * π ) / π
Center's T coordinate: 1 / ( θ + π )

I think that's right... Surely it can be optimized... Then, of course, you'll have to compensate for the angle of perspective and aspect ratio. That's usually π / 4 for the vertical distance.

If you get the gist of that, then you're a genius... I can't really think of a better way to explain it.
Imajin

Buster Beetle
Level: 34

Posts: 414/452
EXP: 234863
For next: 18788

Since: 03-15-04
From: Kingdom of Zeal

Since last post: 39 days
Last activity: 53 days
Posted on 06-25-05 09:20 PM Link | Quote
Woah... though I'm confused by alot of the 3d explanation (Why I stick to 2d, I guess ) this is incredibly cool.
And with the Lethal Lava Land textures, I assume that it's also possible to do the opposite, that is, edit Lethal Lava Land to have the Grass Texture set?
BGNG

Snifit
Level: 22

Posts: 86/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-25-05 09:45 PM Link | Quote
Looks like there's more to it than I thought. Looking at the first sky texture you poted, VL-Tone, the bottom has that "looking down at it" look to it, so the texture must somehow be parsed and applied to a sky box. Additionally, looking at the second texture you posted, there's only one moon. That means the texture is stretched accross the entire 2π of the azimuth. And since the Big Boo's Haunt background is somewhat shorter than the others, I would wager it has the "top" and "bottom" of the sky cube cut off of it.

So we'll have to analyze the textures and the game pretty closely to find out exactly what to do.
Squash Monster

New Age Retro Hippie
Togateiru Fohku Kohgeki!!
GRUNGE no HAMSTER otona bite
Peace love and turnpike!

Level: 40

Posts: 616/677
EXP: 430507
For next: 10802

Since: 03-15-04
From: Maryland (of the Country Between Canada and Mexico)

Since last post: 5 hours
Last activity: 5 hours
Posted on 06-26-05 01:16 AM Link | Quote
As far as I know, the Lethal Lava Land texture trick was the best three byte hack in the history of ROM hacking. You folks are doing some really impressive work.

Oddly, when I tried it, the number at 405CD8 was different. Changing it gave me a rather random crop of textures that I didn't recognize instead. What ROM version is everybody using?

Earlier in the thread, it was mentioned that changing this geometry doesn't change Mario's behavior. Any word on what actually does?
stag019

Snifit
Level: 23

Posts: 19/299
EXP: 62259
For next: 5464

Since: 06-10-05
From: C:\Documents and Settings\stag019\Desktop

Since last post: 9 days
Last activity: 7 hours
Posted on 06-26-05 01:47 AM Link | Quote
Originally posted by Squash Monster
As far as I know, the Lethal Lava Land texture trick was the best three byte hack in the history of ROM hacking. You folks are doing some really impressive work.

Oddly, when I tried it, the number at 405CD8 was different. Changing it gave me a rather random crop of textures that I didn't recognize instead. What ROM version is everybody using?

Earlier in the thread, it was mentioned that changing this geometry doesn't change Mario's behavior. Any word on what actually does?
Squash Monster, that is probably because your rom is in BADC byte order. The one they're working with is ABCD. And most of those textures you're seeing are from inside the castle. If you look in a cannon you see the night sky painting. I zipped some pictures here -> http://host.picturewizard.com/2005-6/335674/sm64.zip
Anyways in BADC order, you change 3100d0e1.


(edited by stag019 on 06-25-05 04:47 PM)
(edited by stag019 on 06-25-05 04:50 PM)
BGNG

Snifit
Level: 22

Posts: 87/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-26-05 03:01 AM Link | Quote
The byte ordering is called "normal" and "byte-swapped," and is casued by differentiation in the different backup units. The normal byte-ordering is called Z64 after the backup unit and byte-swapped is called V64 after its respective backup unit.

V64 cannot be worked with very easily, so you'd need to get a utility to unswap the bytes and convert it to Z64 format. You can get those at Dextrose.
__________

Originally posted by Squash Monster:
As far as I know, the Lethal Lava Land texture trick was the best three byte hack in the history of ROM hacking. You folks are doing some really impressive work.

In F-Zero X, you can change all of a level's textures by changing but 1 byte. Take a look.
VL-Tone

Red Cheep-cheep
Level: 23

Posts: 64/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 06-26-05 04:42 AM Link | Quote
BGNG I tried to understand that all night and failled!

No actually I get the gist of it but I wouldn't call myself a genius I was about to point out that tiling the texture would generate too many moons or suns.Anyhow I prefered to apply the sky texture inside a big sphere.

In reverse byte order the texture hack is change 320070D0 to 3100D0E1 at 405CD7 in the ROM I'll edit the other post.

I tried to get accurate textures on the castle and on level 1 all night and failed to get good enough results. I can get some parts looking good but some other parts get screwed. It has something to do with the relative scaling of the textures. Anyone can suggest a way to interpret the 16-bit fixed point numbers used as texture coordinates from the ROM and transform them into useable S,T coords? I can see I'm not that far from having it right but I'm missing something...Maybe the coords used in the F3 command sets the relative scale of the texture? What are they used for anyway?

(I may add pictures to this post)
(Edit: well I added pictures)





Yeah aside from the texture scale problems, the princess picture is missing. I just won't add it up until the rest of the textures appear normally

I may have gotten better results than this before, but I kept trying different things like ignoring bits etc.


(edited by VL-Tone on 06-25-05 09:15 PM)
(edited by VL-Tone on 10-27-05 12:19 AM)
BGNG

Snifit
Level: 22

Posts: 88/276
EXP: 56579
For next: 1771

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 06-26-05 06:55 AM Link | Quote
And I see you're still not a big fan of back-face culling...
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - Mario 64 - Amazing Stuff | |


ABII


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



Page rendered in 0.018 seconds.