11 March 2016 - Forum Rules
Started by dyson132, April 11, 2012, 01:41:57 PM
QuoteThe data for them begins at $18E0A in the ROM ($1900A headered).
Quote from: Stef on February 20, 2013, 04:22:31 AMI only implemented the "13 82" palette right now, do the others palette are often used ? Just to know if i should also add support for them. In this case i will have to parse palette address from the object header.
8542 8542 8542 8544 8544 8546 8548 8548 8552 8552 8552 8554 8556 8558 8560 8560
Quote from: Stef on February 20, 2013, 04:22:31 AMAbout the shadow, i think you are right, they probably use the "shadow" models for that but that mean it almost double all objects transform calculations and rendering !
Quote from: Stef on February 20, 2013, 04:22:31 AMI'm continue my work on the animated data, i almost figured it out I still have some parsing bugs to fix and questions on some point (BSPTree node which do not reference any triangle for instance).I hope to get that this evening after my job day
Quote from: Stef on February 20, 2013, 12:05:00 PMI guess you got your 552 objects from the SFXEdit app, i still not yet found where others objects are located.I could use the SFXEdit addr too but i really want to find them from the rom too
Quote from: Stef on February 20, 2013, 12:05:00 PMThanks for the statistics, that show that, indeed, 1382 is mainly used... i will probably wait to implement the other one :p
Quote from: Stef on February 20, 2013, 12:05:00 PMIt's nice to see the object display in semi wireframe, their method is simple but efficient to display hybrid object
QuoteI agree of course but I think that is far more complicated for me. I'm basically following your progresss and adding a bit of guesswork.I also have this idea. Here is an 720p video I made a few hours ago and I will post it in some forums, reddit and maybe others. I'm thinking somebody with more knowledge might want to help.https://vimeo.com/60089406
QuoteI did the palettes changeable from the start using the headers. They are displayed by object if they correspond to the following four palettes, 8213, 82ed, 83c1, 85e2. VL-Tone mentioned that there were 9 and I'm guessing the ROM has references to them in plain sight.I found those four by setting 8213 as a default, then found some models with colors that I didn't remember from the game and checked if their own palettes worked.
QuoteI am particularly intrigued by the Andross face model because it is VERY fluent compared to some other animations.Also, If anybody knows the texture addresses and sprite addresses let me know.
Quote183D8 -> D881 (59 values Very short!) 18413 -> 1382 (218 values that make up the 109 that were mentioned before in the thread. This is the most common palette in Star Fox SNES)184ED -> ed82 (212 values)185C1 -> c183 (64 values)18681 -> 8184 (265 values)1878A -> 8485 (Could never get it to run, crashed my app)
QuoteAlso, they are consecutive in the ROM meaning no jumping around. I bet they are all there.
Quote from: Stef on February 20, 2013, 06:18:30 PMAfter many work i think i finally figured the animated vertex (my first implementation was partially wrong)... I had to change a bit my structure to adapt to it. If you look into the sources you will see that animated data are not as easy to handle than others type, i hope you will understand my code.Also i fixed some others stuff and tried to parse as many objects i can from the rom, i have now about 550 objects.There is still some bugs i can't figure... data look wrong in some case: some models should have 32 frames but only vertex data for 20 frames is present...Here's the last version of my decoder application, sources are included in the jar file.https://dl.dropbox.com/u/93332624/dev/sfx/sfxObjReader.jar
Quote from: Stef on February 20, 2013, 06:18:30 PMShould not your last palette address be 8A85 instead of 8485 ??
QuoteAs many figured out textures are stored as two 256x256 pages using 4 bits per pixel (they use the same 16 colors palette). The pages are interleaved meaning that for each XY$ byte in hex, X is used for page 1 and Y for page 2.
Quote from: Stef on February 22, 2013, 05:31:52 AMSo now i think we almost have complete object decoding In my object decoder i still have some invalid objects (about 40 over 550) but i don't really care I think i will see texture part later as i am using 4bpp bitmap surface and doing software texture mapping with 4bpp surface is a bit tricky ^^
Quote from: Stef on February 22, 2013, 05:31:52 AMWell now we need to figure a bit more about level decoding ! There is some informations on this so i guess it will be easier.Almost some parts will need to be "hardcoded" as behavior or stuff like that.
Animation 49B4About 16 framesNumber 75Description: Column with a square base and variable height (animation)---------------------------------49B4 Growing columnHeader Address: 3649Bank: cVert. Address: 6098bFace Address: 60a83Vertex Information:38 ($38) X flip vertex list02 Two sides07 00 F6 Side 1 Mirrored [7,0,-10] and [-7,0,-10] accounts for 2 vertexF9 00 0A Side 2 Mirrored [-7,0, 10] and [7,0, 10] accounts for 2 vertex1C ($1C) animated vertex list20 Frame Count $20 means 32 frames (16 more than expected)3F Frame offset $3F = 63+1 = 6400 4800 5100 5A00 6300 6C00 7500 7E00 8700 9000 9900 A200 AB00 B400 BD00 C600 1F00 1D00 1B00 1900 1700 1500 1300 1100 0F00 0D00 0B00 0900 0700 0500 0300 0100 Offset points here, end of some part.// Here begin the Other parts of the model.380207 F1 F6 [7,-15,-10] and [-7,-15,-10] 07 F1 0A [7,-15, 10] and [-7,-15,-10]20 // 16 bits offset jump A3 Frame offset $A3 = 163+1 = 164 // Here I got lost00380207 E7 F607 E7 0A2098 00 38 02 07 DF F6 07 DF 0A20 8D 00 38 02 07 DA F6 07 DA0A 20 82 00 38 02 07 D3 F6 07D3 0A 20 77 00 38 02 07 CC F607 CC 0A 20 6C 00 38 02 07 C3F6 07 C3 0A 20 61 00 38 02 07BA F6 07 BA 0A 20 56 00 38 0207 B1 F6 07 B1 0A 20 4B 00 3802 07 B5 F6 07 B5 0A 20 40 0038 02 07 BE F6 07
Animation 2fb9About 10 frames118Description: Plasma Hydra with wings flapping---------------------------------2fb9 Plasma Hydra Boss bodyHeader Address: 3b2fBank: cVert. Address: 62659Face Address: 62738Vertex Information:04 ($04) Type 04 Non Mirrored0400 00 EC00 D8 F600 14 1E00 00 2838 ($38) X flip vertex list09 9 Mirrored Vertex0A 28 E2 Mirrored19 00 F1 MirroredE4 FB F6 MirroredFA F6 F6 MirroredE2 0A FB MirroredF6 14 00 Mirrored1E 00 0A Mirrored08 FB 0A MirroredF6 0A 0F Mirrored1C ($1C) animated vertex list0A Frame Count $0A means 10 frames (Exactly as expected) 13 Frame offset $13 = 19+1 = 2000 2100 2F00 3D 00 4B00 5900 6700 7500 8300 9100 0402 // Something happens here, its at position 10, The following are 7 transformations?14 14 EC EC14 EC 38011E 2828 20 8E00 0402 14 11 EC EC 11 EC 38 01 1E 2F 24 20 7E 00 04 02 14 0D ED EC 0D ED 38 01 1E 34 1F 20 6E 00 04 02 14 0A EF EC 0A EF 38 01 1E 39 19 20 5E 00 04 02 14 09 F0 EC 09 F0 38 01 1E 3B 15 20 4E 00 04 02 12 07 F0 EE 07 F0 38 01 24 37 15 20 3E 00 04 02 10 06 F0 F0 06 F0 38 01 2A 32 15 20 2E 00 04 02 0B 05 F0 F5 05 F0 38 01 32 25 15 20 1E 00 04 02 05 06 F0 FA 06 F0 38 01 36 16 15 20 0E 00 04 02 08 05 F0 F8 05 F0 38 01 35 1E 15 0C 30 20 19 17 0E 0E 17 19 0F 16 18 18 16 0F 0B 0A 00 13 12 01 12 13 0A 0E 0F 00 0F 0E 05 03 13 01 01 12 03 03 14 13 12 15 03 03 15 14 04 05 02 05 14 02 02 15 04 14 15 02 13 14 11 13 11 08 14 0E 0C 0C 08 11 0C 07 08 0C 0E 00 00 0A 08 10 15 12 0B 09 10 10 0D 0F 10 09 0D 09 06 0D 06 00 0F 06 09 0B 3C 28 06 20 00 14 28 0D 27 00 04 44 2E 00 28 0F 9C 00 04 44 A3 00 44 E3 00 28 13 FD 00 04 44 05 01 44 17 01 14 04 06 0E 00 7B E1 12 13 0A 0B FF 14 03 0D 38 00 8A D1 03 15 14 FF 14 03 04 0C 00 5A 5A 0B 0A 00 03 07 0C 00 A6 5A 0E 0F 00 03 12 12 09 29 88 13 14 11 03 15 0E 7E 0E 09 0C 08 11 03 16 10 6F FA 3D 0C 07 08 04 17 38 13 AC 5D 0C 0E 00 07 04 18 12 13 53 5E 00 0A 08 07 03 19 10 F7 29 88 10 15 12 03 1C 0C 82 0E 09 10 09 0D 03 1D 0E 91 FA 3D 09 06 0D 04 1E 38 ED AC 5D 06 00 0F 0D 04 1F 10 ED 53 5E 06 09 0B 00 FF 14 03 0F
Quote from: dyson132 on February 22, 2013, 10:47:50 AMGreat! Do you happen to have a list of valid objects? How have you determined that an object is or isn't valid?Because it turns out, when I added the textures my program would crash (very probably bad coding by myself)
QuoteI'll see if I can dig up something but I don't see anything but the info VL-Tone had posted on that old forum. The big problem I see here is that now it is more about the timing of the game (ztimer?). I think faking that value would be easy but it would be more accurate to actually emulate the SuperFX. Whats worse is colision detection, where is that? is it just bounding box?
QuoteAnyways, the lack of documentation and proper programming/ROM hacking knowledge (from me) is making this very frustrating so I will not be working too much on this anymore. I will however be reading up and since I have to learn more c++ for work so I will eventually be remaking the code....but I won't leave the thread, I would like very much to see your progress and new codes! I won't disappear, I am easily reachable since I've posted this Star Fox thing in a few places, they all point to a usable email account.And how can I post my source code? someone could very well continue! I made it using openframeworks of_v0073_win_cb_release.I also posted the info and request for help in this thread here: http://www.smwcentral.net/?p=viewthread&t=62544
QuoteHere is something I captured from the latest version I made. This is the version that crashed on some models (not sure if it was only in the corrupt ones).Also notice, I've managed to let the textures pixelate even on high resolutions, I wanted textures with aliasing.
QuoteI tried getting the frames one last time and I hit dead end again. I'm not sure I understand the process and how the information is stored. How does one know which vertex is being "animated" (changed) and how does your frame offset work (practicaly).I changed the examples to two very distinct animations. One is a pillar with variable height over one axis only (easy to draw too) and the other is the Hydra with flapping wings that oddly gives out more info after the "frames". VL-Tone had those frames in the SFXedit 0.93.exe but not in the StarfoxDecoder.dcr , I am thinking they are other kinds of transformations but I am just guessing. Anyways, the Hydra one exceeds the offset assumption. Also, the pillar one only moves 4 vertices of 8, I think it is the easiest example.
Vertex Information:38 ($38) X flip vertex list02 Two sides07 00 F6 Side 1 Mirrored [7,0,-10] and [-7,0,-10] accounts for 2 vertexF9 00 0A Side 2 Mirrored [-7,0, 10] and [7,0, 10] accounts for 2 vertex1C ($1C) animated vertex list20 Frame Count $20 means 32 frames (16 more than expected)3F 00 Frame offset $3F = 63+1 = 6448 0051 005A 0063 00...// Here begin the Other parts of the model.380207 F1 F6 [7,-15,-10] and [-7,-15,-10] 07 F1 0A [7,-15, 10] and [-7,-15,-10]20 // 16 bits offset jump A3 00 Frame offset $A3 = 163+1 = 164 // Here I got lost380207 E7 F607 E7 0A2098 003802...2fb9 Plasma Hydra Boss bodyVertex Information:04 ($04) Type 04 Non Mirrored0400 00 EC00 D8 F600 14 1E00 00 2838 ($38) X flip vertex list09 9 Mirrored Vertex0A 28 E2 Mirrored19 00 F1 MirroredE4 FB F6 MirroredFA F6 F6 MirroredE2 0A FB MirroredF6 14 00 Mirrored1E 00 0A Mirrored08 FB 0A MirroredF6 0A 0F Mirrored1C ($1C) animated vertex list0A Frame Count $0A means 10 frames (Exactly as expected) 13 00 Frame offset $13 = 19+1 = 2021 002F 003D 004B 0059 0067 0075 0083 0091 0004 // here is the correct start for first frame vertex02 // 2 vertex14 14 ECEC 14 EC38 // mirror x01 // 1 vertex1E 28 2820 // jump8E 00 // next is at offset $8E...
Quote from: Stef on February 24, 2013, 12:19:13 PMAnd also your vertex definition fixed :Hope that help you with the animated data =)
Quote from: Stef on February 24, 2013, 12:19:13 PMYou just did some minors mistakes in your decoding.Here's my updated notes about the objects decoding :https://dl.dropbox.com/u/93332624/dev/sfx/objects.txt
QuoteAwesome! Do you happen to know what happens in between the offset? I think that was what confused me since it looks like a lot of bits with little use? Maybe damage data or more atribute for the same model. What do you think about those?
04 // normal vertexXX // vertex numberXX XX XX // vertex dataXX XX XX...1C // animated vertexXX // number of frameXX XX // offset for animated vertex frame 1XX XX // offset for animated vertex frame 2XX XX // offset for animated vertex frame 2.... // offset for animated vertex frame x// frame 0 animated vertex dataXX // vertex typeXX // vertex numberXX XX XX // vertex dataXX XX XX...20 // jumpXX XX // 16 bit offset where to jump to reach end of vertex data// frame 1 animated vertex dataXX // vertex typeXX // vertex numberXX XX XX // vertex dataXX XX XX...20 // jumpXX XX // 16 bit offset where to jump to reach end of vertex data// frame 2 animated vertex dataXX // vertex typeXX // vertex numberXX XX XX // vertex dataXX XX XX...20 // jumpXX XX // 16 bit offset where to jump to reach end of vertex data// frame 3 animated vertex data...
QuoteI couldn't download from that link. Is it correct?
QuoteA few days ago I converted the "frame offset" values from the "49B4 Growing column" and found this. I don't know if it is relevant or anything but I think it might be related to movement on screen. I may be terrible wrong but it might be related with the ztimer.
QuoteThanks Stef! Everything worked perfectly! I've rewritten my vertex code so it includes animations and it is reading the rom correctly. I'll have captures later Everything you've said works very well Also the link now works correctly, maybe it was just a dropbox thing.
QuoteI am left with two questions: is fixed vertex information always before the animated vertex info?I was wondering this in order to connect it with the face info correctly.
QuoteAlso, I still don't get the purpose of stating every offset. Can there be more frames than possible vertex states?For instance, in the "column" example graph I made, in the second half the offsets decrease, and they all point to frame 1. Would this mean that after certain animation frames have been completed repeat frame 1 a few times?I'm guessing this would be useful in some models like the "sea squid" thing where it doesn't push in a permanent loop.
QuoteI also know that there is a special palette ("8590") for "4DAC Andross Square" and "85AC Andross Cube" if used crashed the program (I never saw VL-Tone managing to decode it). This palette points to the big andross face in the texture table and by the way, both of these models are 16 bit coords.I avoided the 20 interchangeable palettes because I didn't know what to do with them but now I discovered that the "64C2 Attack carrier" in Corneria uses this to determine how the sunset affects the color of the ship, Corneria Level 1 and 2 are by day and Level 3 is with the sunset and this is colored using the interchangeable palettes.
QuoteSome faces are made to have two sides, tha is what makes them have that bad flicker. This also happens with faces with textures because the program thinks a texture is another face. This is easy to fix but I prefer it to be visible since that is where the textures will go.
QuoteEven while I had success in loading most models some still appear corrupt for no apparent reason for very few models. I followed the code and it should work.
Quote@StefI will try and help with the stage thing. Where on this are you now?
QuoteHere it is! I have added frame interpolation because I could. I had idea for ages and it works nicely and you can disable it with the keyboard if you want to. https://vimeo.com/60433014Remember you can download the original video which is 60 fps
QuoteStef, how should I post the source code? In a way it is it is permanently on the web.
QuoteOn a side note, I suppose you've read this thread, it is the more obscure one I could find where VL-Tone explains a bit more about the stage info and how it is used:http://arwinglanding.net/forum/index.php?PHPSESSID=te5kqmecnhn3j7ltc3ddlrfkv5&topic=1649.0;nowap
Quote from: Stef on February 26, 2013, 03:01:07 PMYou can have fixed part before and after animated part, you can also have only animated part.
Quote from: Stef on February 26, 2013, 03:01:07 PMCool ! Glad you got it, you implement things really quickly
QuoteAt 7E1FF9 and 7E1FFA is a 16-bit pointer for the starting level pointer, you can use a cheat at this adress to start at any level in a more "normal" way.
QuoteA funny example, if you go into Corneria level 2 and activate these two cheats, 7E16FF:BB and 7E1700:01, you'll loop the part where one of your crew member will get attacked by an enemy
Quote from: dyson132 on February 26, 2013, 04:00:39 PMIf there is any comment about it I would have to say this:I read the vertex data expecting the fixed vertices info to always appear before the animated ones. This is not necessarily true but it was how I started the animation part. Turns out in my case it works and looks correct because the triangle construction in the face section points to certain vertices with values, if the vertices are in different order it wouldn't have animated correctly. So at least in my case the vertex info appears before.Oddly enough, I was curious what would happen if I flip them, almost all objects are affected except the bipeds ( 9CBB, C4E2 and 11B4 and variations.)
QuoteThere are some models which seem oddly corrupt, I'll read every line of them to find out more about the error (D4D7 Phantron Kicking, weird fixed vertex distorts the object).
QuoteAbout the Corneria 1, I think we would be starting this all wrong. In the game, the ship moves using the controller which passes through the SNES chipset and all that which would mean far too many things I don't know (maybe you do). First, I will try to read from the ROM the cinematic before Corneria, that one has a fixed and established set of objects which also happen to be good for measuring the size of the scene (to determine the speed of the ship) nothing weird.Later I will try the game intro scene which might have 1 bounding box as well as a few laser shots combines with a fixed background.What do you think?
QuoteHey that brings me to a question, what do you know about SNES programming? I know nothing!I read a little about the topic and I didn't understand much. I started with the fact that I know that at $6F0F8 in the ROM is the beginning of the Training level info, also I know that according to SFXEdit that level is at $9A6E0D. I tried reading a bit about HiROM and LoROM but no, I don't know anything about this. What I can guess is that in order to read much of the info about the ROM it would be necessary to emulate how memory works in the SNES, otherwise working as I have until now would be enough for me but maybe not for you Stef.VL-Tone has the list of every address but he also mentions stuff like this:If I go to address 7E1FF9 in the ROM Hex Edit tells me that I have gone past the End Of File. So how does one get from WRAM(?) over to the ROM file address?Should I worry about this if I know nothing about real SNES hacking?
QuoteHe also mentions something like the following. ¿What does the colon symbol mean in these cases?
QuoteHere is something I never figured out. How and when do I change between these 4 subpalettes? I thought the light index was supposed to affect the layer of every palette but not the subpalette. I did it for level of palette and it looked ok so I never figured the use of the subpalettes.
QuoteAnyways, here are download links:http://bitshare.com/files/umwcr17c/SNES_Star_Fox_Object_Decoder_ver1.zip.htmlhttp://rapidgator.net/file/81179016/SNES_Star_Fox_Object_Decoder_ver1.zip.htmlhttp://www.4shared.com/zip/41CS6-a8/SNES_Star_Fox_Object_Decoder_v.html
Page created in 0.135 seconds with 20 queries.