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 - F-zero Maximum Velocity & GP legend | |
Pages: 1 2 3 4 5 6 7 8 9 10Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-05-05 10:49 PM Link | Quote
firemaker:
You could go about disassembling the programming if you feel like it, but that won't help as far as the data is concerned. What I'm talking about with reverse-engineering is changing the data itty-bitty pieces at a time and seeing what changes in the game. Once we can predict what changes will take place depending on how we alter data, we'll have found how t works.

Heian-794:
If you can browse through an emulator's RAM viewer and find the decompressed data, that would be best. If I know what the result is going to be, it will aid in finding out how to get there.
Heian-794

Red Super Koopa
Level: 44

Posts: 795/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-05-05 11:03 PM Link | Quote
BGNG, OK, I've added a bunch more numbers to the tiles so that I can get started transcribing one of the courses. Any help in the order of the tiles, and their relationship to the map views available in VBA would be much appreciated.

The patch I posted earlier has a few of the numbers filled in if you want to give it a try yourself. Have we looked at the Silence coding and seen any patterns which we might expect to see knowing that all the tiles have values one fewer than they do on the other courses?



Tile Molester is awesome! I've got the actual, real colors displayed now -- just jump to where the tileset starts (it's not at the beginning of a line, so scrolling will leave you messed up), load a palette from within the file specifying its location in decimal (just pick a number from the white chart above; mine converted to 3579148), with length 512. Everything looks perfect!


(edited by Heian-794 on 08-05-05 02:34 PM)
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-06-05 06:08 AM Link | Quote
I took a day off, just so you know. No progress has been made on my end of things. I've not opened the ROM in a hex editor, nor have I even viewed the directories in which my project files reside.

I do plan to get into the fray tomorrow, though. I'm just taking a break for now.



EDIT:
Just thinkin' aloud here, but... What if 00 in the track data didn't represent "no course," but represented "no data; ignore this byte and move onto the next one"? That MIGHT be the case, and would certainly explain the peculiarities I mentioned in my previous post. If that turns out to be the way things are, then the data may very well be Huffman... I'll look into that.


(edited by BGNG on 08-05-05 09:28 PM)
Heian-794

Red Super Koopa
Level: 44

Posts: 797/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-06-05 09:12 AM Link | Quote
BGNG, if anyone deserves a day off once in a while, it's you! I myself have no school or work this week and thus have had time to go mad with F-Zero hacking.

Still making a chart with the codes for the tiles, plus adding the numbers to the actual tile graphics.

If 00 represents "no data", or "no change from previous data", that would fit well with the many instances of repeated tiles -- for example, there are not only huge swaths of background 00s, but also 71, 72, 73 (plain track), 40-44 (rough), etc., etc. There are also many regular patterns of four tiles in a square (2x2), forming barriers and recharge pads and the like.


Tile table for your perusal:


Made with Photoshop and a layer of text -- if only I could write the numbers on the actual tiles this easily.


(edited by Heian-794 on 08-06-05 01:21 AM)
firemaker

Level: 26

Posts: 146/247
EXP: 94178
For next: 8097

Since: 03-23-04
From: UK berkshire

Since last post: 17 days
Last activity: 11 days
Posted on 08-06-05 01:50 PM Link | Quote
Another thing we might want to consider is if the game has a checksum that needs a header or something, afterall if it wasn't for a checksum how would the game know when one track ends and the other track begins. maybe it is something to do with the unknown data you found way back with the course names and palletes.

EDIT another thing it could be is encryption.


(edited by firemaker on 08-06-05 04:59 AM)
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: 6335/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 08-06-05 03:29 PM Link | Quote
Well usually the file would have its size defined somewhere, or the game would have a pointer that tells it where the end of the file is. (Mario 64 does this.) That might explain if the game was crashing or extra data was being used near the end of the track but I don't see how it explains the compression problem.

Encryption, I doubt, but it's certainly possible. Checksums would most likely just make the game crash or throw an error if you edited the track at all.
Heian-794

Red Super Koopa
Level: 44

Posts: 798/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-06-05 05:15 PM Link | Quote
Firemaker, I was looking at the last two columns of course data, one of which is "unknown" floor data, after the floor palette, and they seem to be related to whether the floor uses a small 128x128 background like Ancient Mesa and Synobazz, or a buge 1024x1024 background like Bianca City, the other urban-style tracks, and Stark Farm with its different colored trees.

I can't figure out what the numbers *mean* (number of available tiles?), but they match up with the complexity of the floor graphics.

As for encryption, what happens when a single byte or 32-bit number is incremented by one? Since we know the values of the individual tiles, we can see how many positions this increment causes the affected tiles to move.

F-Zero is the first GBA game, so they can't be using some kind of sophisticated new system. And since they weren't having to cram all kinds of movies and graphics into that small space like in GPL and Climax, I can't imagine that they developed some special algorithm. Maybe they just used what worked for them with the SNES.


Edit: Playing around with the map viewer now, and the decompressed track data is right there! The values in VRAM match up exactly with the tile numbers:

Free Image Hosting at www.ImageShack.us

This is a full-screen image; my 1024x768 display is too small to capture all the stuff I wanted to get. Basically VBA shows you where it's loading the map: in this case 0x60004000 (it ends at 0x60007FFF). Going to that part of the VRAM reveals the exact tiles, decompressed. Look at the picture and you'll see part of the course; it's 128 tiles wide and so should the columns be in the RAM viewer (they limit you to 16).

Let's take the bottom line of the picture and its accompanying line at the bottom of the RAM viewer. You can see the lines of 00, followed by 3D 16 19, then a bunch of 73s for the actual track, 18 17 3C 50 for the barrier and its shadow, then more zeroes.

(Note that the map doesn't center on your car -- it loads a big panel of tiles and keeps it there until you cross over into the next panel.)

So we know that the track looks like what it's supposed to look like when uncompressed. And we might expect to find code detaililng where these 128x128 panels begin -- could that be the seeming glitch in the course data?

Also, here's a document on loading map data into VRAM; someone with more expertise than me might get something out of it!

http://www.ngine.de/hamdoc/group__hamlib__tile.html


(edited by Heian-794 on 08-06-05 11:45 AM)
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-06-05 11:41 PM Link | Quote
You're doing excelent research, Heian-794, but I'm afraid you're barking up the wrong tree. The 6000000 range in the GBA's memory map is VRAM. VRAM is, as its name implies, video memory and is only used to draw pixels to the screen. What you've found is where in memory all the tile data is stored once sent to video memory.

We've established before that the track is composed of predifined 8
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

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

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 08-07-05 12:15 AM Link | Quote
I fail to see how the documentation for HAMlib will help for a Nintendo-made game. You'd have better luck with, say, GBATek.
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-07-05 08:21 AM Link | Quote
I deleted the old post that I had here. All it stated was my current progress on hacking the algorithm, which is indeed a unique algorithm created for the game.

Instead of correct my old findings and replace them with my new ones in terms of how the algorithm works, I'll just hold off until I have the specification completed; then I'll post it all at once.

I'm dealing with some peculiar Assembly optimizations, which is making reverse-engineering of this sucker quite a bumpy ride. Fortunately, it's not being very difficult and every problem I've encountered so far has had an easy solution.
Heian-794

Red Super Koopa
Level: 44

Posts: 799/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-07-05 08:42 AM Link | Quote
BGNG, looking forward to your findings!

I've also noticed that there might be instructions for flipping tiles vertically or horizontally. It looked like all the parts that make up a landmine were included, and all the barrier parts are certainly included, but while viewing the map while driving on Fire Field Q5, several tiles are indicated as being flipped vertically, particularly the parts in the middle and lower edges of the mines, and "19 lower right barrier part with open track to bottom right". No idea why this is, but it might affect the compressed course data.

Kawa, I don't know the first thing about actually programming a GBA, and tossed that out in case it turned out to be useful. Found it in a web search for map display information. Didn't know that data was passed through somewhere else before going to VRAM, in fact... ;
firemaker

Level: 26

Posts: 155/247
EXP: 94178
For next: 8097

Since: 03-23-04
From: UK berkshire

Since last post: 17 days
Last activity: 11 days
Posted on 08-07-05 07:42 PM Link | Quote
Originally posted by BGNG
I deleted the old post that I had here. All it stated was my current progress on hacking the algorithm, which is indeed a unique algorithm created for the game.

Instead of correct my old findings and replace them with my new ones in terms of how the algorithm works, I'll just hold off until I have the specification completed; then I'll post it all at once.

I'm dealing with some peculiar Assembly optimizations, which is making reverse-engineering of this sucker quite a bumpy ride. Fortunately, it's not being very difficult and every problem I've encountered so far has had an easy solution.


So let me get this stragiht, nintendo created a whole new algortihm just so that thhey could compress the course data? well all i can say is good luck and i will dig around trying to compare the uncompressed and compressed data
Kyoufu Kawa
I'm not bad. I'm just drawn that way.
Level: 70

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

Since: 03-19-04
From: Catgirl Central

Since last post: 14 hours
Last activity: 13 hours
Posted on 08-07-05 07:53 PM Link | Quote
Originally posted by Heian-794

Kawa, I don't know the first thing about actually programming a GBA, and tossed that out in case it turned out to be useful. Found it in a web search for map display information. Didn't know that data was passed through somewhere else before going to VRAM, in fact... ;
It's cool. Point is, any encoded map data (where encoded can be an array of 16-pixel metatiles, mario-style objects, any form of compression or a combination thereof) -must- be processed and it's just that easy to decode the whole area (could be the whole level) into WRAM before pumping the relevant parts into VRAM. That's why DKC savestates contain recognizable level maps, just to name one
Heian-794

Red Super Koopa
Level: 44

Posts: 803/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-07-05 08:30 PM Link | Quote
I just noticed that back on July 25 (?) when Firemaker posted a chart of tiles, the list of frequently-seen combinations of tiles is basically correct. I could probably whip up a more complete list if it would help, though using the patch and driving around on a course full of numbered tiles would probably be more instructive.

I still can't figure out why the game sometimes uses flipped tiles in place of regular tiles which are equivalent. They did it with the mines and once with the off-course shadows, but some other good spots, such as the barriers in 01/02, 03/04, 05/06, 07/08, 12/13, 14/15, 16/17, 18/19, always seem to use the regular tile rather than flipping the tile that looks like a flipped version of it to begin with.
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-07-05 10:28 PM Link | Quote
Don't worry about it, firemaker. I've got this code in the bag. I'll take care of the rest of the compression biznazz. I've got it right where I want it.

Not that... (no, no; I shouldn't say that.)
Heian-794

Red Super Koopa
Level: 44

Posts: 806/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-07-05 11:11 PM Link | Quote
BGNG, is it something that could eventually lead to a track editor at the single-tile level? Not that 8x8 panels would be so awful. As long as we can make new tracks!

I'm trying to find a good way to synthesize gradients for sky backgrounds. It's too much of a hassle to draw up smoothly flowing values for red, green, and blue, and then convert that to a little-endian double-byte number, so I've been cheating and copying the number over from another color elsewhere in the palette.
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-07-05 11:59 PM Link | Quote
The courses decompress into an array of 8
Heian-794

Red Super Koopa
Level: 44

Posts: 807/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 08-08-05 12:22 AM Link | Quote
That should be fine; will we be able to edit the contents of those panels?

One thing I disliked about the Climax course editor is that while there are 256 elements to play with, a lot of them are nearly redundant (think "booster on left", "booster in center"....) so courses don't have the variety they could have.

Moving panels around should be fine -- eight tiles is nice and small; the ends of them should line up correctly -- but moving panels and being able to edit panels for prearranging would be essentially the same thing as a tile-level editor.
firemaker

Level: 26

Posts: 156/247
EXP: 94178
For next: 8097

Since: 03-23-04
From: UK berkshire

Since last post: 17 days
Last activity: 11 days
Posted on 08-08-05 01:52 AM Link | Quote
Originally posted by BGNG
The courses decompress into an array of 8


(edited by firemaker on 08-07-05 04:56 PM)
BGNG

Snifit
Level: 22

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

Since: 06-03-05

Since last post: 8 days
Last activity: 3 hours
Posted on 08-08-05 01:57 AM Link | Quote
The panels will definately editABLE, but that functionality probably won't be provided in the level editor. If we get one course using its own group of custom panels, and another course using its own... we're likely to run out of panel space in the ROM to hold them all.

However, the panels provided will let us make virutally any shape as-is; including angled stretches, circular turns, jumps, dash plates galore, what-have-you. We won't NEED to make any custom panels.
Pages: 1 2 3 4 5 6 7 8 9 10Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - F-zero Maximum Velocity & GP legend | |


ABII


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



Page rendered in 0.021 seconds.