News: 11 March 2016 - Forum Rules

Author Topic: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.  (Read 98181 times)

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #20 on: January 31, 2013, 05:48:07 am »
Thanks for replying that quickly !
Ok, you got the arwing model the same way i got it : just grabbed data on the VL-Tone format description example :p
Indeed you are right, i can directly rip the data model from the rom, just need to know where they are located (and SFXEdit could help for that). If you were able to parse the model data with Excel, what was missing you ?
If you plan to get back in the project i would be pleased to help you in figuring a bit more of the format :)


I don't really remember why I failed to find the information. There might have been a slight error in the documentation but I am also not very experienced with hex. If I remember correctly the stage information is the one that points to the 3d models (animated or not), color palettes and everything. It is not horrible but it needs to be done by someone who knows hex more than I do.
SFXEdit can certainly point to the 3D model headers but the amount of information needed to be parsed was huge and doing it by hand would have been very time consuming.

The other problem I think I had was that even if you have the stage information it will point to an object header, that object header has an address in hex and that is where I couldn't move forward. You can find the object header many times in a stage (I would expect) but I was never able to directly read a 3D model with the object header (I ended up somewhere else in the rom). If you do this correctly I think you have all the 3D models you need.
I think that was where I thought there was an error in the documentation but I am not experienced with hex.

I stopped when I couldn't get further assistance from anyone with more knowledge. I posted it in many places (reddit, SF forums) and even left a message for VL-Tone. He also commented that someone (me) had sent him a couple of emails in the last year about it but I never got a response.

I would have no problem with revisiting the project only if I had something to work with. I have no other reason to learn hex so it is just in pause for the moment.

That about sums it up. I'll be back in two weeks so I won't answer anything until then. :)

@Friedslick6
I've read all those but thank you for putting it all together. :D
I do hope this does move forward. I like the Star Fox SNES aesthetics better than the n64 ones.

January 31, 2013, 05:49:16 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Is there any way to decompile the Shockwave executables used on the online editors?

That is exactly what I've been thinking about since Stef brought the topic up again.
« Last Edit: January 31, 2013, 05:53:32 am by dyson132 »

Stef

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #21 on: January 31, 2013, 02:20:00 pm »
I don't really remember why I failed to find the information. There might have been a slight error in the documentation but I am also not very experienced with hex. If I remember correctly the stage information is the one that points to the 3d models (animated or not), color palettes and everything. It is not horrible but it needs to be done by someone who knows hex more than I do.
SFXEdit can certainly point to the 3D model headers but the amount of information needed to be parsed was huge and doing it by hand would have been very time consuming.

The other problem I think I had was that even if you have the stage information it will point to an object header, that object header has an address in hex and that is where I couldn't move forward. You can find the object header many times in a stage (I would expect) but I was never able to directly read a 3D model with the object header (I ended up somewhere else in the rom). If you do this correctly I think you have all the 3D models you need.
I think that was where I thought there was an error in the documentation but I am not experienced with hex.

I stopped when I couldn't get further assistance from anyone with more knowledge. I posted it in many places (reddit, SF forums) and even left a message for VL-Tone. He also commented that someone (me) had sent him a couple of emails in the last year about it but I never got a response.

I would have no problem with revisiting the project only if I had something to work with. I have no other reason to learn hex so it is just in pause for the moment.

That about sums it up. I'll be back in two weeks so I won't answer anything until then. :)

Ok, i understand your point. Indeed if you are not comfortable with hex address you will experience many troubles in re (reverse engineer) the binary data.
I'm used the hex stuff and honestly it already though me a bit of time to just figure the palette format data (which should be easy compared to level data for instance).
I will try to dig a bit further with SFXEdit, try to do some basic data parsers...
I will keep in touch on this post if i got anything interesting to share :)

Friedslick6>
Thanks for grouping these links, i already dig in them but as dyson said, it is great to have them grouped :)

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #22 on: February 08, 2013, 06:58:42 pm »
I'm back. You know what? I'm up for a challenge so let's do it.
First, do you guys recommend a specific Hex Viewer for rom hacking?
I'm on windows 7 x64 and do have a OSX Mountain Lion too.

It might take long but also it might take very little time.

Friedslick6

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #23 on: February 09, 2013, 12:59:36 am »
Here's some good freeware hex editors:
HxD 1.7.7.0
Tiny Hexer v1.8.1.6
XVI32 2.55
I would personally use HxD.
« Last Edit: February 09, 2013, 01:07:29 am by Friedslick6 »

Zoinkity

  • Hero Member
  • *****
  • Posts: 565
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #24 on: February 09, 2013, 01:50:25 am »
If you want one that can do block bit manipulation and search binary with a mask, a nice free one is HexEdit 4.0

For run-of-the-mill tasks HxD is very light and can also run off a USB stick.  Does file comparison too.  It's one of the better free editors out there.  Only quirk with it is that saving the file removes any bookmarks in it, but that might have been fixed in a newer version.

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #25 on: February 09, 2013, 02:48:14 pm »
Cool! Thank you both.
Ok, I'll start and this is ALL for Star Fox - Version 1.0 (US). Most of what I will say has already been discovered or mentioned by VL-Tone, I'm just compiling it and copying from the SFXedit by hand if necessary.
First of all, I've copied the first part of the Corneria 1 hex data with the correct info from SFXEdit so it is easier to read and copy:

Corneria Base
addr: h24510D | objtyp: h86 | lenght:014 | type: Object+behaviour_with_16_bits_coords | x: 000000 | y: 000000 | z: 000000 | ztimer: 000000
objid: h84DD | objname: Corneria_Base | bhaddr: h06873F

Normal arwing [1 of 4]
addr: h32510D | objtyp: h74 | lenght:010 | type: Object/behaviour_with_16_bits_coords | x: -00216 | y: -00312 | z: -00200 | ztimer: 000000
objnum: h02 | objid: h20D3 | objname: Normal_arwing | bhnum: h97 | bhaddr: h21B70A | bhname:?

[Skipped][at addr: h3C510D] Rotates previous object [Skipped]

Normal arwing [2 of 4]
addr: h40510D | objtyp: h74 | lenght:010 | type: Object/behaviour_with_16_bits_coords | x: -00216 | y: -00312 | z: -00200 | ztimer: 000000
objnum: h02 | objid: h20D3 | objname: Normal_arwing | bhnum: h97 | bhaddr: h21B70A | bhname:?

[Skipped][at addr: h4A510D] Rotates previous object [Skipped]
[Skipped][at addr: h4E510D] Use next object (8C) for behavior [Skipped]
[Skipped][at addr: h58510D] desc.: Fox & crew chats: "All ships check in" etc. [Skipped]


Normal arwing [3 of 4]
addr: h5B510D | objtyp: h70 | lenght:007 | type: Object+behaviour_with_8_bits_coords | x: 000400 | y: -00368 | z: 001392 | ztimer: 000000
objnum: hDA | objid: h3CD3 | objname: Normal_arwing | bhnum: hF2 | bhaddr: h11920A | bhname: Use_next_object_(8C)_for_behavior

[Skipped][at addr: h62510D] desc.: Backward and static, shootable, ship sound [Skipped]

Normal arwing [4 of 4]
addr: h65510D | objtyp: h70 | lenght:007 | type: Object+behaviour_with_8_bits_coords | x: -00320 | y: -00560 | z: 001200 | ztimer: 000000
objnum: hDA | objid: h3CD3 | objname: Normal_arwing | bhnum: hF2 | bhaddr: h11920A | bhname: Use_next_object_(8C)_for_behavior

[Skipped][at addr: h6C510D] desc.: Backward and static, shootable, ship sound [Skipped]



So, notice that at the beginning of the stage there are four Arwings of two different types referenced as objid: h20D3 and objid: h3CD3, first two arwings have 16bit coords and the other have 8bit (I also noticed that coord. values have 6 integers if positive and 5 if they are negative because of the sign).
The Arwing objid: h20D3 is mentioned in this thread:
http://acmlm.kafuka.org/archive2/thread.php?id=4730&pl=96583
It is one of the Normal Arwings, and h20D3 is mentioned here:
Quote
At $284B There is a list of about 250 16-bit pointer begining with A1AC F8C0 20D3... These are pointers to a little more than half of the polygon objects used in the game.
VL-Tone had documented almost all of these objects in a txt file but I've never found it, I am sure it is part of the SFXEdit since it would contain the names he had given each model. This is the link where the file used to be: http://pages.infinit.net/voxel/STARFOX_OBJECTS.TXT


VL-Tone also mentions the following value and it also appears on SFXEdit (but is has some text on top of the important stuff which makes it hard to read), notice 20D3 appears a few times at the end of the object header, this is mentioned by VL-Tone and is not wrong, for some reason the last(?) 28 hex values reference their same address:
Quote
Normal arwing (in version 1.0) Object Header
73 F1 11 96 F1 00 00 00 AC 5D 24 00 0E 00 50 00 50 00 13 82 20 D3 20 D3 20 D3 20 D3

Now, this is the part where I get all confused with HEX values. VL-Tone mentions the following in the previously mentioned link:
Quote
The actual data defining the general properties of these objects such as relative size and color set is 28 bytes long and found starting at $2E15 (substract $8000 and add $2E15 to the 16 bit pointers from $2848+ to get the actual ROM position).

So the Corneria Stage adds an object, in this case an Arwing objid: h20D3. This object appears on the list of 250 models mentioned previously but (remember I know very little about hex) when I try to do what VL-Tone mentioned in order to find the "Normal arwing (in version 1.0) Object Header" I get nowhere near the 5520 where it is supposed to be.
This string is a description of everything that is needed to generate the Arwing including the location in the ROM which I am almost sure, is $8F373 , it could be another since there are a few Arwing models in the game.

Later he mentions something that applies to SF2 and I don't have the correct values for SF1:
Quote
After that -20 D3- is the "object pointer". Again do $2E15+$D320-$8000 to get the ROM address, which is actually where this line of data can be found, I don't know why it's
included there since it's implicit, but it seems some objects have different offsets than their own stored there.
How does one do that math? I tried using a few hex calculators and ended up nowhere. That is where I failed. What calculator would you recommend and on what settings?

If anyone does make the conection between correct address mentioned in the stage which is 20D3, correct model construction reference in the model viewer of SFXEdit and how the address $8F373 is mentioned in the ROM file you have all the models in Star Fox SNES.

To do list:
Know how to get from Stage info 20D3 over to Object header at 5520.
Know how to get from Object header at 5520 over to 3D model data at 8F373.

Question: what does $ mean in this context? $8F373 and $2E15 (as I have mentioned before I know very little about working with HEX).
« Last Edit: February 10, 2013, 11:40:03 am by dyson132 »

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #26 on: February 10, 2013, 01:16:37 pm »
It's just one of myriad ways (e.g. &H, 0x) to denote that the numbers that follow are hex instead of decimal.

There is a big difference between 64 and $64.
In the event of a firestorm, the salad bar will remain open.

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #27 on: February 10, 2013, 02:22:27 pm »
It's just one of myriad ways (e.g. &H, 0x) to denote that the numbers that follow are hex instead of decimal.

There is a big difference between 64 and $64.

Thanks! :D
The bad thing about this is that I think I did the calculation correctly then and don't know why I cannot get to the correct address.

(comment about your avatar: "It's like I can touch you!!! xD so funny)


News!
I was trying to find other ways of gathering more info, I used HexEdit and look at what I found in the SFXedit 0.93.exe, in plain text and everything. It's the list of 3Dmodels inside the ROM with each address and the names that VL-Tone gave them, there is the famous 20D3. It is what I had spectulated was in http://pages.infinit.net/voxel/STARFOX_OBJECTS.TXT

Code: [Select]
TXT  f      D   ["15AC", "31AC", "4DAC", "69AC", "85AC", "A1AC", "BDAC", "D9AC", "F5AC", "11AD", "2DAD", "49AD", "65AD", "81AD", "9DAD", "B9AD", "D5AD", "F1AD", "0DAE", "29AE", "45AE", "61AE", "7DAE", "99AE", "B5AE", "D1AE", "EDAE", "09AF", "25AF", "41AF", "5DAF", "79AF", "95AF", "B1AF", "CDAF", "E9AF", "05B0", "21B0", "3DB0", "59B0", "75B0", "91B0", "ADB0", "C9B0", "E5B0", "01B1", "1DB1", "39B1", "55B1", "71B1", "8DB1", "A9B1", "C5B1", "E1B1", "FDB1", "19B2", "35B2", "51B2", "6DB2", "89B2", "A5B2", "C1B2", "DDB2", "F9B2", "15B3", "31B3", "4DB3", "69B3", "85B3", "A1B3", "BDB3", "D9B3", "F5B3", "11B4", "2DB4", "49B4", "65B4", "81B4", "9DB4", "DAB4", "DAB4", "F6B4", "F6B4", "33B5", "4FB5", "6BB5", "87B5", "A3B5", "DBB5", "FCB5", "01B6", "1DB6", "43B6", "7BB6", "80B6", "9CB6", "B8B6", "D4B6", "F0B6", "28B7", "28B7", "44B7", "B4B7", "7CB7", "98B7", "B9B7", "D5B7", "F1B7", "0DB8", "29B8", "45B8", "45B8", "82B8", "9EB8", "BFB8", "DBB8", "F7B8", "13B9", "2FB9", "4BB9", "7FBA", "83B9", "9FB9", "BBB9", "D7B9", "F3B9", "0FBA", "2BBA", "47BA", "63BA", "84BA", "A0BA", "BCBA", "D8BA", "F4BA", "10BB", "2CBB", "48BB", "64BB", "80BB", "9CBB", "B8BB", "D4BB", "F0BB", "0CBC", "28BC", "44BC", "60BC", "7CBC", "98BC", "B4BC", "D0BC", "ECBC", "08BD", "24BD", "40BD", "5CBD", "78BD", "94BD", "B0BD", "CCBD", "E8BD", "04BE", "20BE", "3CBE", "58BE", "74BE", "90BE", "ACBE", "C8BE", "E4BE", "00BF", "1CBF", "38BF", "54BF", "70BF", "8CBF", "A8BF", "C4BF", "E0BF", "FCBF", "18C0", "34C0", "50C0", "6CC0", "88C0", "A4C0", "C0C0", "DCC0", "F8C0", "14C1", "30C1", "4CC1", "68C1", "84C1", "A0C1", "BCC1", "D8C1", "F4C1", "10C2", "2CC2", "48C2", "64C2", "80C2", "9CC2", "B8C2", "D4C2", "F0C2", "0CC3", "28C3", "44C3", "60C3", "7CC3", "98C3", "B4C3", "D0C3", "ECC3", "08C4", "24C4", "40C4", "5CC4", "78C4", "94C4", "B0C4", "CCC4", "E8C4", "04C5", "20C5", "3CC5", "58C5", "74C5", "90C5", "ACC5", "C8C5", "E4C5", "00C6", "1CC6", "38C6", "54C6", "70C6", "8CC6", "A8C6", "C4C6", "E0C6", "FCC6", "18C7", "34C7", "50C7", "6CC7", "88C7", "A4C7", "C0C7", "DCC7", "F8C7", "14C8", "30C8", "4CC8", "68C8", "84C8", "A0C8", "BCC8", "D8C8", "F4C8", "10C9", "2CC9", "48C9", "64C9", "80C9", "9CC9", "B8C9", "D4C9", "F0C9", "0CCA", "28CA", "44CA", "60CA", "7CCA", "98CA", "B4CA", "D0CA", "ECCA", "08CB", "24CB", "40CB", "5CCB", "78CB", "94CB", "B0CB", "CCCB", "E8CB", "04CC", "20CC", "3CCC", "58CC", "74CC", "90CC", "ACCC", "C8CC", "E4CC", "00CD", "1CCD", "38CD", "54CD", "70CD", "8CCD", "A8CD", "C4CD", "E0CD", "FCCD", "18CE", "34CE", "50CE", "6CCE", "88CE", "A4CE", "C0CE", "DCCE", "F8CE", "14CF", "30CF", "4CCF", "68CF", "84CF", "A0CF", "BCCF", "D8CF", "F4CF", "10D0", "2CD0", "48D0", "64D0", "80D0", "9CD0", "B8D0", "D4D0", "F0D0", "0CD1", "28D1", "44D1", "60D1", "7CD1", "98D1", "B4D1", "D0D1", "ECD1", "08D2", "24D2", "40D2", "5CD2", "78D2", "94D2", "B0D2", "CCD2", "E8D2", "04D3", "20D3", "3CD3", "58D3", "74D3", "90D3", "ACD3", "C8D3", "E4D3", "00D4", "1CD4", "38D4", "54D4", "70D4", "8CD4", "A8D4", "C4D4", "E0D4", "FCD4", "18D5", "34D5", "50D5", "6CD5", "88D5", "A4D5", "C0D5", "DCD5", "F8D5", "14D6", "30D6", "4CD6", "68D6", "84D6", "A0D6", "BCD6", "D8D6", "F4D6", "10D7", "2CD7", "48D7", "64D7", "80D7", "9CD7", "B8D7", "D4D7", "F0D7", "0CD8", "28D8", "44D8", "60D8", "7CD8", "98D8", "B4D8", "D0D8", "ECD8", "08D9", "24D9", "40D9", "5CD9", "78D9", "94D9", "B0D9", "CCD9", "E8D9", "04DA", "20DA", "3CDA", "58DA", "74DA", "90DA", "ACDA", "C8DA", "E4DA", "00DB", "1CDB", "38DB", "54DB", "70DB", "8CDB", "A8DB", "C4DB", "E0DB", "FCDB", "18DC", "34DC", "50DC", "6CDC", "88DC", "A4DC", "C0DC", "DCDC", "F8DC", "14DD", "30DD", "4CDD", "68DD", "84DD", "A0DD", "BCDD", "F4DD", "F4DD", "10DE", "2CDE", "48DE", "64DE", "80DE", "9CDE", "B8DE", "D4DE", "F0DE", "0CDF", "28DF", "44DF", "60DF", "7CDF", "98DF", "B4DF", "D0DF", "ECDF", "08E0", "24E0", "40E0", "5CE0", "78E0", "94E0", "B0E0", "CCE0", "E8E0", "04E1", "20E1", "3CE1", "58E1", "74E1", "90E1", "ACE1", "C8E1", "E4E1", "00E2", "1CE2", "38E2", "54E2", "70E2", "8CE2", "A8E2", "C4E2", "E0E2", "FCE2", "18E3", "34E3", "50E3", "6CE3", "88E3", "A4E3", "C0E3", "DCE3", "F8E3", "14E4", "30E4", "4CE4", "68E4", "84E4", "A0E4", "BCE4", "D8E4", "F4E4", "10E5", "2CE5", "48E5", "64E5", "80E5", "9CE5", "B8E5", "D4E5", "F0E5", "0CE6", "28E6", "44E6", "60E6", "7CE6", "98E6", "B4E6", "D0E6", "ECE6", "08E7", "24E7", "40E7", "5CE7", "78E7", "94E7", "B0E7", "CCE7", "E8E7", "04E8", "20E8", "3CE8", "58E8", "74E8", "90E8", ""]         €          STXT  ,à      ,¾   ["", "", "Andross Square", "Black Hole Sprite", "Andross Cube", "", "", "", "", "", "Explosion", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Big Asteroid", "", "", "", "", "", "", "", "", "Nova bomb", "Nova bomb 2", "Explo 2", "Big Explo 3", "Big Explo ", "Big Explo ", "Big Explo ", "Big Explo ", "Big Explo ", "Big Explo ", "nothing?", "nothing?", "nothing?", "ÓGAMEÓ", "ÓOVERÓ", "Alien pilot", "Sparks", "Nothing?", "Flashing antenna", "Bigger Flashing antenna", "Bigger Flashing antenna", "Flashing antenna", "White morphing fire", "Flashing yellow morphing fire", "Flashing blue morphing fire", "Flashing flat blue morphing shot", "Weird flat asteroid sprite (unused?)", "Same but bigger", "Same but even bigger", "Walker with leg broken", "Walker with leg missing", "Walker walking", "Growing column", "Bee!", "Weird antenna", "Antenna top", "Hexagonal multi-missile head", "Hexagonal multi-missile head", "", "Slamming outdoor wall", "Slamming outdoor wall", "Slamming outdoor wall", "Flat four pronged enemy", "Pyramid", "Flat far away ship", "??", "??", "Caterpillar head", "Caterpillar part", "Cloaking Ship", "??", " Caterpillar part", "Caterpillar head part", "Shadow", "blue red pill", "mini ship", "mini ship 2", "mini ship 2", "turret", "Tank track", "Tank track Corner", "Tank track Corner", "mine?", "shaded cone spike", "Launcher hovercraft", "Exploding mine part", "Exploding mine part", "??", "falling column orange", "falling column blue", "column orange (A3 B8)", "Mid level ring", "Magic door! (unused in game)", "Plasma Hydra Boss arms", "Plasma Hydra Boss arms bulging", "Plasma Hydra Boss body", "Plasma Hydra animated claws", "neck/tail for Monarch Dodora Boss", "Monarch Dodora Boss head", "Monarch Dodora body animation", "Monarch Dodora Boss tip of tail", "mini bird", "Egg", "Egg broken top", "Egg broken bottom", "bird boss flapping wing", "bird boss flapping wing", "Motorist", "Large missile", "dart", "Big blue Bonus Archway", "Bonus vertical doorway", "Horiz Arrow sliding door", "Random poly", "scramble line part", "scramble arches", "scramble tunel", "Big walker", "Asteroid flat + enemy", "Weird vent?", "Dancing Insector head", "Dancing Insector Boss leg", "Dancing Insector leg", "Dancing Insector top", "Parrot (Bonus OOTD bird)", "flashing flat blue hexagon", "Shadow small high poly arwing", "Small high poly arwing", "Big high poly arwing", "Lava erruption", "Slot Machine", "Slot Machine Arm", "Training Ring (Flashing blue)", "Andross Cube + pyramids", "Tower top", "Yellow-red flashing shot", "Rock formation (irregular gray shape)", "Four pronged space thing", "Diafragm Door", "Rock reverse faces", "Rock reverse faces and broken", "Rock Crusher Boss part", "Rock Crusher Boss flashing dimple", "Rock Crusher Boss rotating part", "Spinning Core bumpers", "Electric thing under Spinning Core Boss", "Spinning Core Boss top", "Spinning Core flaps up", "Spining Core flaps down", "Spinning Core flaps parts closed", "Spinning Core flaps parts closed", "Black lines", "lines", "lines", "lines", "lines", "lines", "mess", "Armada Battleship entry", "Atomic Base entry", "Atomic Base entry zoom", "Weird black/orange button", "Weird portal", "Weird portal 2", "Weird portal wire frame", "Weird portal wire frame 2", "Flashing yellow stripe", "Black rectangle", "Gray rectangle", "Black large rectangle", "Gray rectangle", "Gray rectangle smaller", "Gray rectangle large", "Inside black tunnel", "Inside gray tunnel", "little tower top", "box with flashing top", "Butterfly", "Attack carrier right launcher", "Attack carrier middle part", "Attack carrier low poly middle", "Attack carrier left shield", "A-carrier top left closing"...
I had to cut it short because it won't fit in the post. Each of these addresses points to the correct info for every 3D model in Star Fox 1 for SNES. What I don't have is the correct formula that points to the correct model. So I have the address in the list which is "20D3" which is called "D320: Normal arwing" (fliped hex values). They should point to h8F373 using the following formula":
Quote
After that -20 D3- is the "object pointer". Again do $2E15+$D320-$8000 to get the ROM address, which is actually where this line of data can be found, I don't know why it's
included there since it's implicit, but it seems some objects have different offsets than their own stored there.

Now I have each address of each model and the reference text from each of them can be found in SFXedit 0.93.exe . I'm guessing this can be used to build the correct formula o to correct my methods.


News 2!

Well, this is kinda disappointing:
Quote
73 F1 11 96 F1 F4 01 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 04 D3 04 D3 04 D3 04 D3 Normal arwing
73 F1 11 96 F1 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 20 D3 20 D3 20 D3 20 D3 Normal arwing
73 F1 11 96 F1 00 00 00 00 00 24 00 0E 00 50 00 50 00 13 82 3C D3 3C D3 3C D3 3C D3 Normal arwing
B3 F2 11 D9 F2 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 7C 80 58 D3 58 D3 58 D3 58 D3 Shadow arwing no right wing
B3 F2 11 D9 F2 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 74 D3 74 D3 74 D3 74 D3

There is the complete list of correct references to each 3D model too. These contain the color palette info, size, etc. First one is the now infamous "20D3" but with other attributes.

Found this too in case it helps anyone:
Quote
=-=-=
SNES Documentation v1.0: Written by Yoshi of Digital Exodus.
=-=-=
0)    "Why write a document like this?" 'Why ask why, code 'till ya die'
1)    Memory Map.


News 3!

Also found the RGB palette he used. Since Star Fox uses a checkerboard pattern made of other colours from a fixed palette, he had to convert every checkerboard color in order to correctly display that "color" in openGL (which is used by shockwave and modern 3D accelerated games). So it would be the info posted by Mattrizzle previously in the thread but converted to openGL RGB values like this:
Quote
rgb( 243, 89, 105 ), rgb( 170, 8, 65 ), "04,11", "3E,1B", "3E,11", "3E,1B", rgb( 137, 129, 109 ), rgb( 170, 251, 251 ), rgb( 105, 219, 251 ),
Notice how he ported the table of Hex valued checkerboard colors into RGB values. Pretty neat really... wow! it seems he did every single permutation possible, this is a huge list!
« Last Edit: February 11, 2013, 05:27:32 pm by dyson132 »

Stef

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #28 on: February 11, 2013, 05:51:09 pm »
Wow glad to see you are back to your project :)
Actually i'm stuck at the exact same point as you, i try to figure where find the object data from the object id in the rom.
Specially this 20D3 arwing object as we do know what data we can expect at the object address.
I even missed the important thread where VL-tones gave the address formula calculation but seems that is not enough to figure it..
I tried to look at the 28 bytes object header but it is quite hard to read it as some text overwrite the values. Anyway even by getting it right i can barely understand the palette address and object number, others values as vertex and faces pointer doesn't make any sense for me...

February 11, 2013, 06:31:56 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Ok i figured how to get the 28 bytes header address from the object id :

object id : $20D3 --> $D320 - $7E00 = $5520
and we find at this address :
73 F1 11 96 F1 00 00 00 AC 5D 24 00 0E 00 50 00 50 00 13 82 20 D3 20 D3 20 D3 20 D3

which correspond to the arwing object header.

I found it only by taking the first object id (15AC --> $AC15) and subtracting address of start for header data ($2E15) which make more sense :)

Well now i have to figure address of vertex data :o

February 11, 2013, 07:05:58 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Figured the object address !

Let take the 5 first bytes in the arwing object header:

73 F1 11 96 F1

We should see these 5 bytes as 2 five digits address :
73 F1 1  and  96 F1 1
Note how the second '1' position should be inverted. I think  they did that to avoid wasting one byte in the header.

The first address is used to find the vertex data :
73 F1 1 --> 1 F1 73
$70200 + $1F173 = $8F373
I have verified that $70200 correspond to the beginning of all object data.

The second address is used to find the face (and BSP tree) data :
96 F1 1 --> 1 F1 96
$70200 + $1F196 = $8F396

That's it ! Now we can rip all SFX models =)
« Last Edit: February 11, 2013, 07:05:58 pm by Stef »

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #29 on: February 11, 2013, 07:58:10 pm »
xD
AWESOME! I've wanted that info for years now! This is great!
I'll reread your message many times now and be back later when I try everything.

By the way, as I mentioned in my previous comment if you open SFXedit 0.93.exe with a Hex editor o in a text editor you will find the list of 3D models and the Stage locations within in plain text! Also, every one of those 28 bit groups that make up a model. Also the conversion for the color palette is there too, there are a few text files in there that should be ripped but I'm guessing there is a better way than doing it by hand.
This is the part that I just mentioned and the list is for every model in SF SNES
Quote
73 F1 11 96 F1 F4 01 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 04 D3 04 D3 04 D3 04 D3 Normal arwing
73 F1 11 96 F1 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 20 D3 20 D3 20 D3 20 D3 Normal arwing
73 F1 11 96 F1 00 00 00 00 00 24 00 0E 00 50 00 50 00 13 82 3C D3 3C D3 3C D3 3C D3 Normal arwing
B3 F2 11 D9 F2 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 7C 80 58 D3 58 D3 58 D3 58 D3 Shadow arwing no right wing
B3 F2 11 D9 F2 00 00 00 B2 5D 24 00 0E 00 50 00 50 00 13 82 74 D3 74 D3 74 D3 74 D3

So you cracked it! Congratulations! I am forever in your debt.



Just to play around, as exists in SFXedit 0.93.exe
Quote
D0BC Big high poly arwing:
01 E0 0C 42 E0 00 00 01 00 00 8C 00 38 00 C8 00 FA 00 13 82 D0 BC D0 BC D0 BC D0 BC Big high poly arwing
Also just noticed that SFXEdit has a VrtxPtr and FacePtr which account for your use of two and a half hex values for location vertex and face values. I would have never noticed that.

Verified in the Rom with your correct calculations.
Quote
01 E0 0C 42 E0 00 00 01 00 00 8C 00 38 00 C8 00 FA 00 13 82 D0 BC D0 BC D0 BC D0 BC

Okay,  I think there is some other offset or something because I cannot find this correct info. I'm doing these calculations manually for the D0BC Big high poly arwing and I'm getting the following:
01 E0 0   -->    0 E0 01    -->    70200+0E001 = 7E201       (Points to something that would have 0 vertex data. Also, there should be a 0C before and after this block or some other separator)
42 E0 C   -->    C E0 42   -->     70200+CE042 = 13E242     (Point anything after EOF)

I'll try and find the correct address from SFXEdit, maybe that could help. :D
Also, do you recommend any good hex calculators for this?
« Last Edit: February 11, 2013, 11:10:13 pm by dyson132 »

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #30 on: February 12, 2013, 01:58:38 am »
Also, do you recommend any good hex calculators for this?

Windows' own built-in calculator is good.

And if you like my avatar, then you'll love this:

http://www.youtube.com/watch?v=pMQ-t3nGzrI
In the event of a firestorm, the salad bar will remain open.

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #31 on: February 12, 2013, 07:16:10 am »
http://www.youtube.com/watch?v=pMQ-t3nGzrI
xD I have the dvd! far too good! Always funny.

@Stef
Look at the method that VL-Tone had posted for finding a reference (not 3D model) which never worked for me:
Quote
$2E15+$D320-$8000
It's dependant on the D320 as an offset and he also mentions that he doesn't know why a 28 byte header has values that point to itself (Arwing does):
Quote
...which is actually where this line of data can be found, I don't know why it's included there since it's implicit, but it seems some objects have different offsets than their own stored there.
so I'm guessing your function works specifically for 20D3 but not for others, I'll try and figure it out today.
There is also one thing that I found interesting, you said the 3D models begin at 70200, I can see they do but then I expected to find an object pointer like this one "00 00 0x xx xx" so the address would be "0 00 00" plus your offset but there is no object reference like that one on VL-Tone big list, so there has to be another offset that was already included in your method or I'm completely wrong!

I'll be back later from work, cya!
« Last Edit: February 12, 2013, 07:32:15 am by dyson132 »

Stef

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #32 on: February 12, 2013, 09:11:12 am »
xD
AWESOME! I've wanted that info for years now! This is great!
I'll reread your message many times now and be back later when I try everything.

By the way, as I mentioned in my previous comment if you open SFXedit 0.93.exe with a Hex editor o in a text editor you will find the list of 3D models and the Stage locations within in plain text! Also, every one of those 28 bit groups that make up a model. Also the conversion for the color palette is there too, there are a few text files in there that should be ripped but I'm guessing there is a better way than doing it by hand.
This is the part that I just mentioned and the list is for every model in SF SNES
So you cracked it! Congratulations! I am forever in your debt.

Thanks :D
I saw what you posted about these list but don't you have access to them through the application ?
When you go to the object viewer you can see the complete object list at the right with a small description.
And if you select an object you can get the 28 byte header at bottom (but not very readable...).
Also you have the level selection with its name and address visible on level editor screen, just in the left column.
I guess plain texts from the exe are here for that.
About the palette color, i already almost figured how they were encoded and as i want to reuses the exact same rendering as the original (with mesh effect) i need to directly interpret it from the ROM data :)

Quote
Just to play around, as exists in SFXedit 0.93.exeAlso just noticed that SFXEdit has a VrtxPtr and FacePtr which account for your use of two and a half hex values for location vertex and face values. I would have never noticed that.

Yeah i saw that, but never understood how to read the value... As numbers and text overlap it was pretty uncommon too.
In the link you were referring :
http://acmlm.kafuka.org/archive2/thread.php?id=4730&pl=96583

VL-Tone already mentioned that first 5 bytes were probably describing vertex & poly data... i just tried to figure how we could read $8F373 from it X'D

Quote
Verified in the Rom with your correct calculations.
Okay,  I think there is some other offset or something because I cannot find this correct info. I'm doing these calculations manually for the D0BC Big high poly arwing and I'm getting the following:
01 E0 0   -->    0 E0 01    -->    70200+0E001 = 7E201       (Points to something that would have 0 vertex data. Also, there should be a 0C before and after this block or some other separator)
42 E0 C   -->    C E0 42   -->     70200+CE042 = 13E242     (Point anything after EOF)

I'll try and find the correct address from SFXEdit, maybe that could help. :D
Also, do you recommend any good hex calculators for this?

Oh you're right, i should have tested on the high poly arwing...
Well i probably missed something ^^ What is strange is that $70200 really looks as the start of the object data.
I will continue my investigations tonight after my job :)


February 12, 2013, 09:23:05 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Quote from: dyson132
Look at the method that VL-Tone had posted for finding a reference (not 3D model) which never worked for me:It's dependant on the D320 as an offset and he also mentions that he doesn't know why a 28 byte header has values that point to itself (Arwing does):so I'm guessing your function works specifically for 20D3 but not for others, I'll try and figure it out today.

The formula given by VL-Tone just seems wrong to me :

$2E15+$D320-$8000 = $8135

I tested and $8135 definitely do not point to the 28 bytes header.

If you take the object 16 number, you'll notice the smallest object value is 15AC --> $AC15
We also know the start of 28 byte object header is located at $2E15. You immediately see the common part in both address so naturally you can think about doing $AC15 - $2E15 to get the offset : $7E00.

It's easy to see that it work as each object address are spaced by 28 bytes :)

Quote
There is also one thing that I found interesting, you said the 3D models begin at 70200, I can see they do but then I expected to find an object pointer like this one "00 00 0x xx xx" so the address would be "0 00 00" plus your offset but there is no object reference like that one on VL-Tone big list, so there has to be another offset that was already included in your method or I'm completely wrong!

By VL-Tone big list, are you talking about the list inside the SFXEdit exe ?
What is weird is that all data are actually contained in the ROM, if VL-Tone figured all address calculations he don't have to store them in SFXEdit program as it can compute them from the ROM. The only reason for that is he wanted to add specific description to some object / data which are absent from the ROM.
Well, i will look more closely in the rom later tonight and kee you informed of my progresses :)
« Last Edit: February 12, 2013, 09:23:05 am by Stef »

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #33 on: February 12, 2013, 12:18:04 pm »
Back from work!

Also you have the level selection with its name and address visible on level editor screen, just in the left column.
I guess plain texts from the exe are here for that.
Exactly, you can read them in the application but not copy/paste them outside. Having them as text files would be useful just as verification for your method. Also, I was curious about maybe finding the "formula" in SFXedit.exe for the correct position of each model in the rom since it is clearly there and it uses these text lists. I did find some formulas in plain text but I don't know why, this shockwave file is not encrypted either. Ultimately all this shows how far VL-Tone had gotten to building an editor, too bad he stopped.

About the palette color, i already almost figured how they were encoded and as i want to reuses the exact same rendering as the original (with mesh effect) i need to directly interpret it from the ROM data.
Sure this is what I wanted too but I can see two methods, the openGL floating point one and the checkerboard one which I know can be done in openGL using fixed color palettes (not floating point colors).

By VL-Tone big list, are you talking about the list inside the SFXEdit exe ?
What is weird is that all data are actually contained in the ROM, if VL-Tone figured all address calculations he don't have to store them in SFXEdit program as it can compute them from the ROM. The only reason for that is he wanted to add specific description to some object / data which are absent from the ROM.
That is why I was dissapointed but my guess is VL-Tone had the lists in order to have everything very clean. SFXEdit was supposed to be a level editor and having the headers in the editor would have been usefull... BUT maybe illegal since it was supposed to be portions of the ROM, also remember he was reverse-engineering it with no prior info and integrating what he had so I guess the lists would have disappeared at some point.
What I did not find in SFXEdit was each model separately so those are read directly from the rom. I wanted to find a few so I could search for the string in the ROM and give you another 3D model with which to solve the offset equation.


News!
I found what seem to be the complete hex values for the following models inside the SFXEdit and if one searches for them in the real ROM then those are the addresses. I think the value next to the name are the flipped bytes you mentioned. Yes! LOCATIONS and MODELS! Some of them seem to have been parsed for better reading
Big high poly arwing 0C E001             -> 01 E0 0C 42 E0 00 00 01 00 00 8C 00 38 00 C8 00 FA 00 13 82 D0 BC D0 BC D0 BC D0 BC Big high poly arwing
Growing column 0C 878B                    -> 8B 87 0C 83 88 00 00 02 6C 61 20 00 3C 01 28 00 4C 01 13 82 49 B4 49 B4 49 B4 49 B4 Growing colum (...careful! this one is animated)
Two sides Blue square 0F C474          -> 74 C4 0F 83 C4 00 00 00 00 00 1C 00 28 00 1C 00 38 00 D8 81 30 CF 30 CF 30 CF 30 CF Two sides Blue square
Attack carrier middle part 0E A030      -> 30 A0 0E 75 A0 00 00 03 EE 69 A0 00 F0 00 B8 01 D8 01 ED 82 64 C2 64 C2 64 C2 64 C2 Attack carrier middle part
Walker walking 0C 82B3                     -> B3 82 0C 91 86 00 00 02 0C 67 80 00 88 01 88 00 A0 00 13 82 2D B4 2D B4 2D B4 2D B4 Walker walking (animated too!)
(Verified headers in SFXEdit and also if they have animations)

So I can now give you 6 model headers with their corresponding locations inside the ROM (1 the already documented Arwing + 5 I found in SFXEdit). With these I'm sure one can make a better equation for the locations.

Big high poly arwing 0C E001
Located at $66201 in the SF SNES ROM
The correct header:
01 E0 0C 42 E0 00 00 01 00 00 8C 00 38 00 C8 00 FA 00 13 82 D0 BC D0 BC D0 BC D0 BC Big high poly arwing

Quote
Big high poly arwing 0C E001
["04"
"04"
"00", "FE", "EC", "00", "FF", "F0", "00", "0A", "08", "00", "02", "32", "38", "10", "23", "0E", "CE", "1B", "09", "E2", "1E", "09", "E2", "14", "F5", "E2", "EC", "09", "EC", "02", "F9", "F3", "FB", "03", "F5", "0F", "03", "F5", "F4", "05", "F6", "0A", "04", "F6", "14", "04", "F6", "F3", "06", "F9", "EE", "06", "F9", "0F", "FD", "F9", "02", "FE", "05", "0F", "0C", "0A", "0C", "30", "30", "17", "23", "1F", "17", "1F", "0B", "0A", "1E", "16", "1E", "22", "16", "1B", "16", "18", "1D", "18", "16", "1C", "19", "17", "1A", "17", "19", "0A", "16", "12", "16", "22", "12", "04", "18", "16", "16", "18", "0D", "18", "04", "0D", "04", "16", "0D", "17", "19", "05", "0C", "19", "17", "13", "23", "17", "0C", "17", "05", "13", "17", "0B", "05", "09", "07", "06", "08", "04", "04", "08", "06", "07", "09", "05", "0C", "05", "19", "15", "03", "16", "16", "03", "15", "17", "03", "14", "14", "03", "17", "17", "10", "01", "01", "10", "11", "10", "17", "16", "00", "01", "11", "16", "17", "02", "03", "02", "17", "16", "02", "03", "20", "16", "03", "03", "17", "21", "21", "20", "03", "0E", "20", "21", "20", "0E", "16", "0F", "21", "17", "0E", "00", "16", "17", "00", "0F", "00", "0E", "0F", "12", "22", "0A", "0B", "23", "13", "0A", "22", "1E", "1F", "23", "0B", "3C", "28", "00", "30", "00", "0C", "28", "06", "36", "00", "04", "44", "3E", "00", "44", "73", "00", "28", "02", "9F", "00", "0C"...
CUT!

Big high poly arwing 0C E001             -> Located at $66201
Growing column 0C 878B                    -> Located at $6098B
Two sides Blue square 0F C474          -> Located at $7C672
Attack carrier middle part 0E A030      -> Located at $7222E
Walker walking 0C 82B3                     -> Located at $604B3
Motorist 0C BD27                                -> Located at $63F27
Flashing wireframe beam 11 98DC     -> Located at $89ADC

I've checked somewhat thoroughly but I may have mistakes.

Also found a somewhat deeper explanation of the colour palette and its use in the SXFEdit at $603B0E, there is a lot more than the following:
Quote
[[#facenumber: 1, #colors: [32, 127, 0, 0], #facevertices: [17, 12, 2, 6], #coloff: 163, #vertorderoff: 167, #facecount: 4], [#facenumber: 2, #colors: [30, 0, 0, 129], #facevertices: [19, 17, 6, 7], #coloff: 175, #vertorderoff: 179, #facecount: 4]..Cut!

XX 3E= Color where XX is Light sourced color from 256 color Palette (16 colors checkerboard combinaisons)
XX 3F= Color where X is from 4-bit pal
XX 40= 32x32 Texture where XX is texture position number flip horiz
XX 41= 64x64 Texture
XX 42= 8x8 Texture
XX 43= 64x16 Texture repeated 4 times
XX 44= 32x8 Texture
XX 45= 32x8 Texture flip horiz
XX 46= 64x64 Texture flip horiz
XX 47= 16x8 Texture
XX 48= 32x32 Texture flip horiz
XX 49= 64x64 Texture Polar Mapping Down Left
XX 4A= 64x64 Texture Polar Mapping Down Right
XX 8X= Animated texture where XXX is anim data offset (18 XXX$ in ROM)

Quote
[symbol,name,length,type,pos]
--if pos=0 then data is locked, if 1 then its editable
--86 Two bytes Object with 16 bits x,y,z pos and ztimer bytes using a behavior defined by a 3 bytes address
 "86": objdef=[#addr:baseadd,#objtyp:theobj,#LEN :14,#z:[3,2],#x:[5,4],#y:[7,6],#zoff:[9,8],#objad:[10,11],#bhaddr:[14,13,12],#objnam:"",#bhname:""]

[ #86:[#addr,"addr:h",6,#ihex,0],[#objtyp,"objtyp:h",2,#ihex,0], [#len,"length:",2,#idec,0], [#objad,"objid:h",4,#ihex,1], [#objname,"objname:",5,#str,1]], [], [#bhaddr,"bhaddr:h",6,#ihex,1],[#x,"x:",5,#sdec16,1], [#y,"y:",5,#sdec16,1], [#zoff,"z:",5,#sdec16,1], [#z,"ztimer:",5,#sdec16,1]]

I can see all these text files inside the EXE but is there any easy way to extract them? I tried the simplest resource extractor I could find and it didn't work.

Stage script using hex:
Quote
"Uses next 8C object as path/behavior", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "00: locks camera", "01: ?", "02: ?", "03: ?", "04: flashing thing?", "05: flashing thing?", "06: flashing thing?", "07: flashing thing?", "08: ?", "09: ?", "0A:", "0B:", "0C:", "0D: black tunnel entry", "0E: black tunnel entry", "0F: Arwing tilted right, fly away forward (level X end).", "10: Arwing tilted left, fly away forward (level X end).", "11: Arwing in middle, fly away forward (level X end).", "12: Arwing in middle, mimicks the player vertical movement and reverse horizontal then fly away forward .", "13: Arwing in middle, mimicks the player vertical movement and reverse horizontal then fly away forward ."...CUT!

VL-Tone seems to be emulating the SNES and Super FX chip in the SFXEdit. There is the "Written by Yoshi of Digital Exodus.v 1" and a whole bunch of docs about the SNES chipset. I think this explains why the SFXEdit has slow framerate even in good hardware, because the framerate would be that of the SNES.
Quote
Jouko Valta (jopi@stekt.oulu.fi).
GTE                  G 65 SC 802 / G 65 SC 816
Microcircuits
CMOS 8/16-Bit Microprocessor Family
Features
   Advanced CMOS design for low power consumption and increased
     noise immunity
   Emulation mode for total software compatibility with 6502 designs
   Full 16-bit ALU, Accumulator, Stack Pointer, and Index Registers
   Direct Register for ''zero page'' addressing
« Last Edit: February 12, 2013, 04:45:27 pm by dyson132 »

Stef

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #34 on: February 12, 2013, 04:43:04 pm »
Nice ! You are right, the SFXEdit exe file contains a lot of hardwired informations., your last post helped me in figuring the address decoding, at least i believe i have it correct now :)

We already had correct for object header address :

Object header address = object id - $7E00    (would be $8000 with a headered rom).

For instance low arwing object id is 20D3 (we have all object id from rom starting at location $284B) :
Object header address = $D320 - $7E00 = $5520

If we look at location $5520 in the rom we indeed find the low poly arwing header :
$5520: 73 F1 11 96 F1 00 00 00 AC 00 0E ....

Now from the header we can get the vertex and poly data location.

The first 2 byte represent the address of vertex data :
73 F1 --> $F173

Third byte refer the bank number (i was wrong here) :
$11

4th and 5th byte represent the address of face data :
96 F1 --> $F196

To compute the final address in the rom you have to use this formula :
((bank number - 1) * $8000) + $200 + address.

So that give us the following address for vertex and face :
vertex address = ($10 * $8000) + $200 +  $F173 = $8F373
face address = (($10 * $8000) + $200 + $F196 = $8F396

Let's use the high poly arwing object id now : $B4BC

Object header address = $BCB4 - $7E00 = $3EB4
header $3EB4: 01 E0 0C 42 E0 ....

Vertex data ($B* $8000) + $200 + $E001 = $66201
Face data ($B* $8000) + $200 + $E042 = $66242

Now it seems accurate, i think we can rip all objects from rom now :)

February 12, 2013, 04:55:30 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
About palette there is an interesting post here about how interpret them :

http://acmlm.kafuka.org/archive2/thread.php?id=6876

I figured almost everything about palette from this post, it was a bit but now it works =)
« Last Edit: February 12, 2013, 04:55:30 pm by Stef »

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #35 on: February 12, 2013, 05:14:30 pm »
Now it seems accurate, i think we can rip all objects from rom now :)
AWESOME! :D
Congrats!
I noticed there are two High Poly Arwings by the way, so I was kinda confused:
Quote
BCD0: Big high poly arwing
BCB4: Small high poly arwing
But yes I think you are very right. :D

About palette there is an interesting post here about how interpret them :
I figured almost everything about palette from this post, it was a bit but now it works =)

Yes, I've seen this but I wanted to show you that the SFXEdit has a bit more info inside in case you need it.
Is it possible to extract this long strings of text from the exe file? I tried the simplest resource extractor I could find and it didn't work.


Testing method for:
Big high poly arwing 0C E001             -> Vertex located at $66201                  -> Verified!
Growing column 0C 878B                    -> Vertex located at $6098B                  -> Verified!
Two sides Blue square 0F C474          -> Vertex located at $7C672                 -> Calculation says 7C674 (off by 2) possible human error (me). BTW, SFX v1.2 has padding between models.
Attack carrier middle part 0E A030      -> Vertex located at $7222E                 -> Calculation says 72230 (off by 2) possible human error (me). BTW, SFX v1.2 has padding between models.
Walker walking 0C 82B3                     -> Vertex located at $604B3                 -> Verified!
Motorist 0C BD27                                -> Vertex located at $63F27                 -> Verified!
Flashing wireframe beam 11 98DC     -> Vertex located at $89ADC                 -> Verified!

Yeap, it seems to work very well! :D


Here is part of the list of objects, I cannot fit all of them here but they are inside SFXEdit as text with [ ] and separators:
Quote
4DAC Andross Square
C9B0 Nova bomb
6DB2 Alien pilot
2DB4 Walker walking
49B4 Growing column
65B4 Bee!
F1B7 Launcher hovercraft
84BA Motorist
60BC Parrot?
48C2 Attack carrier right launcher
64C2 Attack carrier middle part
80C2 Attack carrier low poly middle
9CC2 Attack carrier left shield
B8C2 A-carrier top left closing
D4C2 A-carrier down left closing
F0C2 A-carrier mini-ships
3CC5 Hexagonal mini Hover tank
A4CE Water Dragon body part
C0CE Water Dragon head
DCCE Flower/Dragon part?
F8CE Flower part
14CF Flower part
0CD1 Andross Face Squares
28D1 Andross Face Squares big
44D1 Andross Face morph
E8D2 Shadow arwing
04D3 Normal arwing
20D3 Normal arwing
3CD3 Normal arwing
D0E6 UFO
« Last Edit: February 12, 2013, 06:06:29 pm by dyson132 »

Stef

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #36 on: February 12, 2013, 06:46:23 pm »
AWESOME! :D
Congrats!
I noticed there are two High Poly Arwings by the way, so I was kinda confused:But yes I think you are very right. :D

Thanks for your efforts in ripping from SFXEdit ! that definitely helped in figuring it :)
Yeah i saw about the multiple high poly arwing, i guess there is only scale factor difference between them !

Quote
Yes, I've seen this but I wanted to show you that the SFXEdit has a bit more info inside in case you need it.
Is it possible to extract this long strings of text from the exe file? I tried the simplest resource extractor I could find and it didn't work.

Usually resource extractor should do it, did you tried hexa editor do do it ?
I extracted that with a hexa editor (frhed) :

Code: [Select]
15AC
31AC
4DAC Andross Square
69AC Black Hole Sprite
85AC Andross Cube
A1AC
BDAC
D9AC
F5AC
11AD
2DAD Explosion
49AD
65AD
81AD
9DAD
B9AD
D5AD
F1AD
0DAE
29AE
45AE
61AE
7DAE
99AE
B5AE
D1AE
EDAE
09AF
25AF
41AF
5DAF
79AF
95AF
B1AF
CDAF Big Asteroid
E9AF
05B0
21B0
3DB0
59B0
75B0
91B0
ADB0
C9B0 Nova bomb
E5B0 Nova bomb 2
01B1 Explo 2
1DB1 Big Explo 3
39B1 Big Explo
55B1 Big Explo
71B1 Big Explo
8DB1 Big Explo
A9B1 Big Explo
C5B1 Big Explo
E1B1 nothing?
FDB1 nothing?
19B2 nothing?
35B2 <bh:d3>GAME<bh:d3>
51B2 <bh:d3>OVER<bh:d3>
6DB2 Alien pilot
89B2 Sparks
A5B2 Nothing?
C1B2 Flashing antenna
DDB2 Bigger Flashing antenna
F9B2 Bigger Flashing antenna
15B3 Flashing antenna
31B3 White morphing fire
4DB3 Flashing yellow morphing fire
69B3 Flashing blue morphing fire
85B3 Flashing flat blue morphing shot
A1B3 Weird flat asteroid sprite (unused?)
BDB3 Same but bigger
D9B3 Same but even bigger
F5B3 Walker with leg broken
11B4 Walker with leg missing
2DB4 Walker walking
49B4 Growing column
65B4 Bee!
81B4 Weird antenna
9DB4 Antenna top
DAB4 Hexagonal multi-missile head
DAB4 Hexagonal multi-missile head
F6B4
F6B4 Slamming outdoor wall
33B5 Slamming outdoor wall
4FB5 Slamming outdoor wall
6BB5 Flat four pronged enemy
87B5 Pyramid
A3B5 Flat far away ship
DBB5 ??
FCB5 ??
01B6 Caterpillar head
1DB6 Caterpillar part
43B6 Cloaking Ship
7BB6 ??
80B6  Caterpillar part
9CB6 Caterpillar head part
B8B6 Shadow
D4B6 blue red pill
F0B6 mini ship
28B7 mini ship 2
28B7 mini ship 2
44B7 turret
B4B7 Tank track
7CB7 Tank track Corner
98B7 Tank track Corner
B9B7 mine?
D5B7 shaded cone spike
F1B7 Launcher hovercraft
0DB8 Exploding mine part
29B8 Exploding mine part
45B8 ??
45B8 falling column orange
82B8 falling column blue
9EB8 column orange (A3 B8)
BFB8 Mid level ring
DBB8 Magic door! (unused in game)
F7B8 Plasma Hydra Boss arms
13B9 Plasma Hydra Boss arms bulging
2FB9 Plasma Hydra Boss body
4BB9 Plasma Hydra animated claws
7FBA neck/tail for Monarch Dodora Boss
83B9 Monarch Dodora Boss head
9FB9 Monarch Dodora body animation
BBB9 Monarch Dodora Boss tip of tail
D7B9 mini bird
F3B9 Egg
0FBA Egg broken top
2BBA Egg broken bottom
47BA bird boss flapping wing
63BA bird boss flapping wing
84BA Motorist
A0BA Large missile
BCBA dart
D8BA Big blue Bonus Archway
F4BA Bonus vertical doorway
10BB Horiz Arrow sliding door
2CBB Random poly
48BB scramble line part
64BB scramble arches
80BB scramble tunel
9CBB Big walker
B8BB Asteroid flat + enemy
D4BB Weird vent?
F0BB Dancing Insector head
0CBC Dancing Insector Boss leg
28BC Dancing Insector leg
44BC Dancing Insector top
60BC Parrot (Bonus OOTD bird)
7CBC flashing flat blue hexagon
98BC Shadow small high poly arwing
B4BC Small high poly arwing
D0BC Big high poly arwing
ECBC Lava erruption
08BD Slot Machine
24BD Slot Machine Arm
40BD Training Ring (Flashing blue)
5CBD Andross Cube + pyramids
78BD Tower top
94BD Yellow-red flashing shot
B0BD Rock formation (irregular gray shape)
CCBD Four pronged space thing
E8BD Diafragm Door
04BE Rock reverse faces
20BE Rock reverse faces and broken
3CBE Rock Crusher Boss part
58BE Rock Crusher Boss flashing dimple
74BE Rock Crusher Boss rotating part
90BE Spinning Core bumpers
ACBE Electric thing under Spinning Core Boss
C8BE Spinning Core Boss top
E4BE Spinning Core flaps up
00BF Spinning Core flaps down
1CBF Spinning Core flaps parts closed
38BF Spinning Core flaps parts closed
54BF Black lines
70BF lines
8CBF lines
A8BF lines
C4BF lines
E0BF lines
FCBF mess
18C0 Armada Battleship entry
34C0 Atomic Base entry
50C0 Atomic Base entry zoom
6CC0 Weird black/orange button
88C0 Weird portal
A4C0 Weird portal 2
C0C0 Weird portal wire frame
DCC0 Weird portal wire frame 2
F8C0 Flashing yellow stripe
14C1 Black rectangle
30C1 Gray rectangle
4CC1 Black large rectangle
68C1 Gray rectangle
84C1 Gray rectangle smaller
A0C1 Gray rectangle large
BCC1 Inside black tunnel
D8C1 Inside gray tunnel
F4C1 little tower top
10C2 box with flashing top
2CC2 Butterfly
48C2 Attack carrier right launcher
64C2 Attack carrier middle part
80C2 Attack carrier low poly middle
9CC2 Attack carrier left shield
B8C2 A-carrier top left closing
D4C2 A-carrier down left closing
F0C2 A-carrier mini-ships
0CC3 Yellow flying enemy
28C3 Blue flying enemy
44C3 Enemy wing
60C3 wireframe shielded Arwing
7CC3 wireframe Arwing no right wing
98C3 wireframe Arwing no left wing
B4C3 wireframe Arwing no wings
D0C3 Interlocking doors opening
ECC3 Antenna dish
08C4 Antenna base
24C4 Pylone
40C4 Pylone 2
5CC4 Twin flasher/repair enemy
78C4 Twin flasher item
94C4 Nova bomb item
B0C4 Shield item
CCC4 Wing Repair item
E8C4 unused (filled cube shield)
04C5 mine, blue/red
20C5 Repairing Arwing
3CC5 Hexagonal mini Hover tank
58C5 Enemy with some wireframe
74C5 Morphing boss part (round room)
90C5 Atomic Base core opening
ACC5 Atomic Base core opening 2
C8C5 Half monolyte (white)
E4C5 Atomic base targets
00C6 Atomic base electric arcs
1CC6 Atomic Base beaks
38C6 Exploded polys
54C6 Slot flashing button
70C6 Slot disabled button
8CC6 A-Carrier2 rotating heads
A8C6 A-Carrier2 main head
C4C6 A-Carrier2 tank base
E0C6 Armada ship core stand
FCC6 Armada ship core
18C7 Unknown boss or portal part
34C7 A-Carrier2 tank middle
50C7 A-Carrier2 tank right
6CC7 A-Carrier2 tank left
88C7 Phantron transformation/jumping animation
A4C7 Phantron closed
C0C7 Mountain with antennas
DCC7 Manned pod ship
F8C7 Winged fat ship
14C8 Phantron leg
30C8 Phantron leg
4CC8 Wingling tail enemy
68C8 Small Bonus Archway
84C8 Long cannon tank
A0C8 Mothership part
BCC8 Octogonal tunnel blue
D8C8 Rectangle tunnel orange
F4C8 Letter D orange
10C9 Letter D blue
2CC9 Scenery White box
48C9 Scenery small White box
64C9 Scenery White high rise box
80C9 Scenery White high rise box
9CC9 Galactic rider door
B8C9 Base shooting red/blue rings
D4C9 Metal Crusher right
F0C9 Metal Crusher left
0CCA Metal Crusher again
28CA Space Truck
44CA Boss three prong opening top
60CA Boss three prong opening top
7CCA Hexa orange with black top
98CA Atomic base part
B4CA Web
D0CA Yellow flat octogon
ECCA White prism
08CB Vertical Orange white column
24CB Big mountain with entry
40CB Fake flat mountain entry
5CCB Long orange tunnel
78CB Orange/gray tunnel
94CB Professor Hanger
B0CB Vertical opening interlock doors
CCCB Mountain part orange
E8CB Mountain part blue
04CC Mountain part white
20CC Mountain part 2 orange
3CCC Mountain part 2 blue
58CC Mountain part 2 white
74CC Mountain part 3 orange
90CC
ACCC
C8CC Mountain part 4 orange
E4CC
00CD
1CCD Mountain part 5 orange
38CD
54CD
70CD Mountain part 6 orange
8CCD
A8CD
C4CD Helicopter
E0CD Metal Crusher mines
FCCD Mountain part 7 orange
18CE Little mountain blue
34CE Little mountain white
50CE Flying Fish
6CCE Growing green leaf
88CE Blossoming flower
A4CE Water Dragon/Flower part
C0CE Water Dragon head
DCCE Flower/Dragon part?
F8CE Flower part
14CF Flower part
30CF Two sides Blue square
4CCF Small Flower
68CF Big Flower
84CF Flower part?
A0CF Flower part
BCCF Spider Boss head
D8CF Spider Boss leg
F4CF Spider Boss leg 2
10D0 Big vertical Entryway
2CD0 Long Octo Tunnel
48D0 Diafragm Door Blue
64D0 Interlocking Doors
80D0 ?? part
9CD0 Vertical Creature
B8D0 Flashing White thing
D4D0 Flashing White Monolyte
F0D0 Pale Monolyte
0CD1 Andross Face Squares
28D1 Andross Face Squares big
44D1 Andross Face morph
60D1 Andross Face morph 2
7CD1 Prof Hanger part
98D1 Vertical Tunnel Door
B4D1 Tunnel part
D0D1 Tunnel part orange
ECD1 Tunnel part orange
08D2 Tunnel part orange
24D2 Tunnel part
40D2 Tunnel part orange
5CD2 Tunnel twisting part
78D2 Orange Electronic Cube
94D2 Orange Electronic Column
B0D2 Orange Electronic Column
CCD2 nothing?
E8D2 Shadow arwing
04D3 Normal arwing
20D3 Normal arwing
3CD3 Normal arwing
58D3 Shadow arwing no right wing
74D3 Arwing no right wing
90D3 Shadow arwing no left wing
ACD3 Arwing no left wing
C8D3 Shadow arwing no wings
E4D3 Arwing no wings
00D4 Simple White building
1CD4 Buildings (4) one blue high
38D4 Buildings (3) one orange high
54D4 Buildings (4) all high rise
70D4 Building with Fox logo
8CD4 Great Commander Boss
A8D4 Great Commander Head
C4D4 Great Commander Head
E0D4 Great Commander trunk with rotating arms
FCD4 Great Commander base with opening vent
18D5 Great Commander whole, not animated
34D5 Great Commander part
50D5 Great Commander left arm
6CD5 Great Commander right arm
88D5 Opening Great Commander vent
A4D5 Opening Great Commander vent
C0D5 Explosion crater
DCD5 Explosion crater
F8D5 Unused?
14D6 Unused?
30D6 Some horizontal beam
4CD6 Some horizontal beam
68D6 Beveled White box
84D6 Beveled White square
A0D6 Beveled White beam
BCD6 Beveled White beam
D8D6 Beveled White square
F4D6 Beveled White beam
10D7 Rising Gray beam
2CD7 Rising arch
48D7 Arwing Cockpit
64D7 Big low poly arwing
80D7 Big arwing (no wings)
9CD7 Big arwing (no R wings)
B8D7 Big arwing (no L wings)
D4D7 PHANTRON Kicking
F0D7 PHANTRON part
0CD8 Dropped by some boss
28D8 Rotating Artsy thing
44D8 Rotating Artsy thing
60D8 Box thing
7CD8 Square thing
98D8 Box thing
B4D8 Box thing
D0D8 Box thing high
ECD8 Blue beam white ends
08D9 Hexagonal blue beam
24D9 Enemy ship
40D9 Enemy ship half
5CD9 Enemy Cargo ship
78D9 Enemy Cargo ship
94D9 Enemy Cargo ship<bh:09>
B0D9 Enemy Cargo ship<bh:09>Low poly
CCD9 Enemy Cargo ship<bh:09>Low poly
E8D9 Enemy Cargo ship<bh:09>Low poly
04DA Far away ships (flat)
20DA Interlocking doors
3CDA Interlocking corner doors
58DA Interlocking diagonal doors
74DA Interlocking diagonal doors (s)
90DA Enemy flapping wings and tail
ACDA Boss poly part?
C8DA Boss poly part triangle
E4DA Boss poly part triangle
00DB Boss poly part triangle
1CDB Rising orange beam in tunnel
38DB Enemy ship
54DB Growing missile
70DB Main enemy ship (orange)
8CDB Mini walker
A8DB Ringo enemy
C4DB Enemy with rotating wings
E0DB Growing beam with flashing top
FCDB Sliding door in tunnel
18DC Coins
34DC Flashing Slot Maching knob
50DC Slot Machine Fruit texture
6CDC Hexa tower with flashing top
88DC Origami 1
A4DC Paper plane
C0DC Warning beam (yellow/black)
DCDC Tunnel side Textured Blocks
F8DC Road side Textured Blocks
14DD nothing?
30DD Shootable cone
4CDD High rise with flashing corner
68DD Big low poly Arwing (2)
84DD Corneria Base
A0DD Flat long rectangle
BCDD Random polys
F4DD Part some ship (DD08)
F4DD Part some ship (DD08)
10DE Micro Walker
2CDE Nano Walker
48DE Machine Gun ship
64DE Machine Gun ship Part (gun)
80DE Machine Gun ship Part body
9CDE Space missile mines
B8DE Shieldable enemy
D4DE Shielded enemy
F0DE Shielded enemy 2
0CDF Shielded enemy cloaking
28DF Big launcher tank
44DF Libellule
60DF Other smaller Libellule
7CDF Flashing wireframe beam
98DF Flashing beam
B4DF Flashing beam
D0DF Flashing beam
ECDF Flashing beam
08E0 Flashing beam
24E0 Flashing beam
40E0 Flashing beam
5CE0 Flashing beam
78E0 Flashing beam
94E0 Flashing beam
B0E0 Flashing beam
CCE0 Flashing beam
E8E0 Flashing beam
04E1 Flashing beam (wireframe)
20E1 Flashing beam
3CE1 Flashing beam (wireframe)
58E1 Flashing beam
74E1 Flashing beam (wireframe)
90E1 Flashing beam
ACE1 Ship Entryway (with antennas)
C8E1 Ship Entryway part?
E4E1 Space half arch
00E2 Space half arch big
1CE2 Space other half arch big
38E2 Rotating pod enemy orange
54E2 Rotating pod enemy white
70E2 Rotating pod enemy white
8CE2 Rotating pod enemy blue
A8E2 Rotating pod enemy blue
C4E2 Medium Walker
E0E2 Mini Volcano
FCE2 Big Volcano
18E3 Portable hole
34E3 Cool missile
50E3 Mini Vertical Enemy
6CE3 Main enemy 2 (orange)
88E3 Main enemy 3 big wings
A4E3 Small yellow stingray
C0E3 Small blue stingray
DCE3 Big blue stingray
F8E3 Big red stingray
14E4 Crystal in ground
30E4 Crystal in ground (vertical)
4CE4 Flying crystal
68E4 Hovercar (road level)
84E4 Skii Truck  (road level)
A0E4 ??
BCE4 Some Enemy part
D8E4 Energy yellow ring
F4E4 Mini Fish
10E5 Other Machine gun enemy
2CE5 Swimming creature
48E5 White flat stripe
64E5 Flat thing
80E5 White arrow
9CE5 Tunnel with blue doors
B8E5 Orange tunnel
D4E5 Tunnel with blue doors 2
F0E5 Federation friend ship
0CE6 Federation friend ship (half)
28E6 Mothership part 2
44E6 Mothership center part
60E6 Bonus bird
7CE6 Whale
98E6 Rotating solid beam with direction arrows
B4E6 Andross 2 Evil Face
D0E6 UFO
ECE6 Small yellow tank
08E7 Small blue tank
24E7 Weird asteroid
40E7 Tunnel with yellow door
5CE7 Tunnel with yellow door
78E7 Morphing ground thing
94E7 Bonus doors (yellow)
B0E7 Letter <bh:d3>E<bh:d3> orange
CCE7 Letter <bh:d3>E<bh:d3> blue
E8E7 Letter <bh:d3>E<bh:d3> gray
04E8 Letter <bh:d3>T<bh:d3> orange
20E8 Letter <bh:d3>T<bh:d3> blue
3CE8 Letter <bh:d3>T<bh:d3> gray
58E8 Letter <bh:d3>N<bh:d3> orange
74E8 Letter <bh:d3>H<bh:d3> blue
90E8 Letter <bh:d3>H<bh:d3> gray

The SFXEdit program seems to contains a lot of data ! probably have a whole copy of the rom X'D
The offset by 2 is weird, maybe the 2 extras bytes has specific meaning for the vertex list ? for animated objects or something like that.
Need to test that on more objects :)

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #37 on: February 12, 2013, 07:06:31 pm »
Usually resource extractor should do it, did you tried hexa editor do do it ?
I extracted that with a hexa editor (frhed) :
Nope, didn't work with a normal resource extractor, I tried five of them and they all displayed the same stuff, a few icons and a text about not running under MSDOS.
I just installed frhed, what option did you use to extract and parse them? Maybe I can help a bit more. :D
This is already great actually, solved most of what I wanted to know.

The SFXEdit program seems to contains a lot of data ! probably have a whole copy of the rom X'D

I went through all SFXedit 0.93.exe in hex slowly as to learn a bit of hex too. I noticed two huge sections each made up of at least 5 distinct and very long text files. One of the is the conversion table for the color palettes that is at the end of the "SFXedit 0.93.exe" file and... some rather odd section with ONLY text based values from 0 to 255 in sequence, I think it is the information for all the models. The following is at $73B10A of SFXedit 0.93.exe:
Quote
STXT” r[251, 0, 13, 30, 0, 48, 0, 9, 0, 235, 94, 13, 18, 97, 13, 109, 97, 13, 244, 97, 13, 56, 99, 13, 213, 99, 13, 69, 100, 13, 130, 88, 13, 104, 90, 13, 195, 90, 13, 70, 91, 13, 161, 91, 13, 17, 92, 13, 92, 71, 13, 51, 73, 13, 142, 73, 13, 162, 80, 13, 30, 81, 13, 155, 81, 13, 92, 1, 130, 23, 0, 138, 125, 134, 0, 0, 144, 1, 136, 255, 196, 9, 124, 216, 4, 128, 4, 140, 48, 9, 134, 0, 0, 112, 254, 136, 255, 196, 9, 124, 216, 4, 128, 4, 14



It seems I was right about the complete models there. Looked for the following as text:
Code: [Select]
4, 4, 0, 0, 246, 0, 1, 0, 0, 250, 0Found it at location $83FB6A  of SFXedit 0.93.exe.
It is the Arwing values we know of parsed and converted into decimal to look like that section I had thought was the models. I only checked the first hex values up to the mirrored vertex.
There is another big list in SFXEdit which I'm sure points to each one of thes values in these added lists but I wasn't able to find a method.


Hey Stef I'm left with a newby Hex question:
Why is it that if I use the Windows Calculator (set Hexa and Byte) to convert FF from hex to decimal I get -1 but in some conversion tables it shows up as 255?
I thought Hex values don't include the sign unless stated so as do decimal numbers.
I know about signed and unsigned variables in c++ but I am missing the connection here. I googled and didn't find an answer quickly.
Also, in order to find the Arwing values I has used excel to convert HEX to decimal with values between 0 and 255. I've worked with colors in hex that turn into 0-255.
« Last Edit: February 12, 2013, 09:05:37 pm by dyson132 »

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #38 on: February 13, 2013, 12:17:09 am »
Why is it that if I use the Windows Calculator (set Hexa and Byte) to convert FF from hex to decimal I get -1 but in some conversion tables it shows up as 255?
I thought Hex values don't include the sign unless stated so as do decimal numbers.
I know about signed and unsigned variables in c++ but I am missing the connection here. I googled and didn't find an answer quickly.
Also, in order to find the Arwing values I has used excel to convert HEX to decimal with values between 0 and 255. I've worked with colors in hex that turn into 0-255.

Windows Calculator assumes you're working with signed data. The highest bit for the mode you're working on will always be treated as the sign bit, so if you're working in Byte mode, FF will convert to decimal as -1 instead of 255. (To be clear, this is how signed numbers always work: therefore, a signed byte has a range of -128 to 127 while an unsigned byte has a range of 0 to 255.)

If you're not working with signed data, you'll have an easier time if you just switch to QWord mode. You'll probably never need all 64 bits (16 hex digits) for what you're doing, but at least it won't give you negative numbers when you're not looking for them.
In the event of a firestorm, the salad bar will remain open.

dyson132

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Managed to read Star Fox SNES ROM using VL-Tone guides. I need more info.
« Reply #39 on: February 13, 2013, 04:38:46 am »
Understood.
Thank you Ryusui!
:D

by the way, I had made a thread over at jul.rustedlogic.net where VL-Tone was last seen in case he wanted to add something. Nothing has happened but here is the link
http://jul.rustedlogic.net/thread.php?id=15998

@Stef
I've been thinking about what you said about portions of the ROM inside SFXEdit and I think you are right. Inside SFXEdit I found many doc files about the SNES hardware so I guess he needs those portions of the rom for SFXEdit to work correctly.


@Stef
I was stubborn enough to want to convert the Airwing Big high poly into my c++ application (the same one of my first experiment). I wanted to be able to understand the values better than I do in Hex so I converted every hex value to decimal which wasn't the best idea since some indicators were converted too but I still managed to manually parse almost all the values and the ones that I didn't I have no idea what they are since they lack the structure that I know from "Annotated Deconstruction Of Low Polygon Arwing Object" Version 1. Skipping sections was also possible because the are very localized.

The result it a document that has all the coordenates and I can draw and color most by hand but I don't know what that extra info is for. Also, I wanted to post it here but it is too long and I don't know if you are interested enough to want to review it. Are you?

Here is a sample:

Code: [Select]
// ***Face Data***

         20,    // decimal 20 is $14. Start of Face group (convex shape) ($14)

        /*  // Comments from Annotated Deconstruction Of Low Polygon Arwing Object From The Original StarFox.
            // Not specifically necessary for openGL due to internal rendering functions (it can be set to auto).

            Ns Fn Co NX NY NZ V1 V2 V3...   Ns is the number of sides for this face.
                                            Fn is face number or ID.
            --------------------------      Co is color/texture number, refer to other doc
                                                about the color/texture sets.
                                            NX NY and NZ is the vector of the calculated
                                                normal for this face normalized to 128 (or is it 127?)
                                            Vx refers to the vertex numbers as defined
                                                by the vertex lump list just like the
                                                triangle list (see above)
                                            The number of Vx vertex references is equal
                                                to the number of sides, in this case three.
                                            Supported number of sides are 1 (point),
                                                2 (line),3,4,5,6 and 8 sides.
            Ns Fn Co NX NY NZ V1 V2 V3
            --------------------------
            [03 06 10 A6 5A F7 03 02 0B]    -> This face is a triangle with a gray tint ($10), with a normal vector of (-90,90,9), connecting vertex 3, 2 and 11.
            [FF]                            End of faces group($FF). FF is -1 in decimal
            [14]                            Start of Face group (convex shape). $14 is 20 in decimal
            [03 0E 07 BF 64 D5 0A 0E 07]
            [14]
            [03 0A 00 00 7B 1F 0A 0D 05]
            [03 0B 2C 00 9E AF 08 0D 0A]
            [03 10 00 48 A5 CC 0D 08 05]
            [03 11 01 B0 A2 1D 08 0A 05]
            (sometimes is FE00 and sometimes there is nothing indicating the end?)

        */
   //   Ns   Fn   Co   NX   NY   NZ   V1   V2   V3   Vx (The number of Vx vertex references is equal to Ns, the number of sides )
   // ----|----|----|----|----|----|----|----|----|-----------------------------------------------------------------------------|
         3,   0,  32,-104,  54, -48,  23,  35,  31,
        -1,    // End of faces group($FF). FF is -1 in decimal
        20,   // Start of Face group (convex shape). $14 is 20 in decimal
         4,   6,   0,   0, 106, -70,  28,  25,  23,  26, // Since Ns is 4 this face group has four vertex references, V1,V2, V3 and V4
        -1,
        20,
         3,  14,  18,   0, 123,  31,  23,  25,   5,
         3,  15,  44,   0,-114, -57,  12,  25,  23,
         3,  17,  12, -70,-105,  17,  12,  23,   5,
         3,  19,  14,   0,-123, -31,   5,   9,   7,
         3,  22,  18,   0, 123,  31,   7,   9,   5,
         3,  23,  14,  65, -98, -49,  12,   5,  25,
        -1,
        20,
         3,  45,  32,  93, -79,  34,  11,  35,  19,
         3,   1,  30,-104,  73,  -3,  23,  31,  11,
         3,  18,  28,   6,-103,  74,  19,  23,  11,
         3,  47,  34, 112,  45, -40,  31,  35,  11,
         4,   7,   0,   0,-106,  70,  26,  23,  25,  28,

Here is one of those weird sections, about halfway down this face group
Also I think face id number can only be possitive:

Code: [Select]
         20,
         3,  36,  20,  89,  89, -12,   3,  23,  33,
         3,  26,  18,  57, 113,  -6,  23,   3,  20,
         3,  27,  12, -57,-113,   6,  20,   3,  23,
         3,  16,  30,  13,-116,  50,  19,  35,  23,
         // Something happens here. The sequence y finished with a -1 but something is not initialized a face group, istead of 20 ($14) you find $0
        -1, // I thinks -1 doesn't end the face group, it ends a certain caracteristic of the facegroup since the next values seem to have no Vertex reference
         0,  28,  20,  39,   0,  48,
         0,  57,   0,  66,   0,  75,
         0,  84,   0,  93,   0, 102,
         0, 111,   0, 120,   0,-127,
         0,-118,   0,-109,   0,-100,
         0, -91,   0, -82,   0, -73,
         0, -64,   0, -55,   0, -46,
         0,  56,   2,  -1,  10,   0,
         1,   0,   0,  32, -49,   0,  56, // Doesn't 56 ($38) mean mirrored or something? Is it the ammount Vx equal to Ns -1 ? It seems this is different than before!
         2,  -1,  20,   0,   1,   0,   0,  32, -60,   0,  56,
         2,  -2,  30,   0,   2,   0,   0,  32, -71,   0,  56,
         2,  -3,  40,   0,   2,   0,   0,  32, -82,   0,  56,
         2,  -4,  50,   0,   2,   0,   0,  32, -93,   0,  56,
         2,  -5,  60,   0,   2,   0,   0,  32,-104,   0,  56,
         2,  -6,  70,   0,   2,   0,   0,  32,-115,   0,  56,
         2,  -6,  80,   0,   2,   0,   0,  32,-126,   0,  56,
         2,  -7,  90,   0,   2,   0,   0,  32, 119,   0,  56,
         2,  -8, 100,   0,   2,   0,   0,  32, 108,   0,  56,
         2,  -8, 100,   0,   2,  10,   0,  32,  97,   0,  56,
         2,  -8, 100,   0,   3,  20,   0,  32,  86,   0,  56,
         2,  -8, 100,   0,   3,  30,   0,  32,  75,   0,  56,
         2,  -8, 100,   0,   4,  40,   0,  32,  64,   0,  56,
         2,  -8, 100,   0,   5,  50,   0,  32,  53,   0,  56,
         2,  -8, 100,   0,   5,  60,   0,  32,  42,   0,  56,
         2,  -8, 100,   0,   6,  70,   0,  32,  31,   0,  56,
         2,  -8, 100,   0,   6,  80,   0,  32,  20,   0,  56,
         2,  -8, 100,   0,   7,  90,   0,  32,   9,   0,  56,
         // No idea what happens next.
         2,  -8, 100,   0,   8,  95,   0,  12,  48,   1,2,3,0,20,4,0,0,0,0,127,2,3,0,1,-2,0,56,
        29,-40,70,-30,40,-60,-30,-45,70,-25,45,-15,-25,-45,-55,
        -25,-40,-15,0,40,-60,0,45,-15,5,30,-30,5,30,-50,5,45,-55,5,
        40,-20,10,31,-29,10,31,-51,10,-40,-60,10,-40,-70,10,35,
        -75,10,-35,-95,10,40,-100,10,-35,-25,15,35,-55,15,35,60,
        20,45,-5,25,-45,70,30,-45,5,30,40,-10,30,-40,70,35,-40,50,
        35,40,0,35,12,48,42,11,10,13,42,43,54,53,42,55,42,53,52,54,
        43,52,26,24,16,19,17,25,26,18,19,25,17,16,40,41,28,26,27,
        41,22,23,38,39,38,25,38,41,27,23,28,41,24,26,40,39,40,29,
        50,51,23,51,50,56,55,54,57,23,51,45,57,52,46,48,45,51,21,
        28,23,8,3,28,4,0,3,46,4,7,8,21,15,14,44,50,49,47,53,56,50,
        44,14,22,29,20,29,2,9,2,1,49,44,14,6,14,20,2,29,28,3,0,1,
        53,47,5,30,31,36,37,36,31,32,33,34,60,40,9,8,0,
         4,  68,  16,   0,  68, -121,  1,  20,              //Maybe?
         4,   9,  18,   0,  90,  -90, 40,  41,  28,  29,    //This one fits
        -1,
        20, //Back to structure
« Last Edit: February 14, 2013, 11:55:25 am by dyson132 »