Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - DarkPikachu

#1
For those who don't know, Mr. Legend & Watcher is a god hack for Mr. Game & Watch by the author YellowWollywogOverload.

For a while I was puzzled at a random occurrence that happened while having a fun match against a Lv9 L&W CPU
I wasn't sure how, but L&W somehow managed to turn my character forward (facing the camera)


these images were taken back in 2017, and hardly anyone knew how to do this.
just over 3 years later, this mystery has finally been solved.

the move by Mr. L&W that does this is the backwards-areal (turtle)

now you can all enjoy a new avenue of Brawl hacking to venture down :D

EDIT: note that this is not revolutionary, just something I've not seen commonly talked about. ;)
#2
Programming / Explaining emissive mapping and TEVs
March 19, 2019, 03:12:57 PM
Decided to come out of my hole on Smashboards and make a quick guide towards dealing with emissive maps.

Now note, I'm by no means an expert on TEVs (I refuse to call them shaders, because that's not what they are)
in fact, I'm really only just learning about them...
Really all I'm doing here is just basic mapping which is very easy.
Harder stuff like bloom, while possible, I'm not sure how to do.

Just recently I released a new version of my signature hack Dark Pikachu version 4.6 which makes use of a fake (constant color Intensity) emissive map to achieve this without a memory overflow:


basically how this fake map works exactly is you have the emissive map:

and the color you want it to show in the material's Constant Color 2 (basically the image functions as an alpha channel for this color)

note that Constant Color 2 is delegated by the TEV stage applying the emissive map (stage1 in this case)
in order: stage0 | stage1 | stage2 | stage3

note that stage1 was added and is completely custom

it takes the output from stage0, adds Constant Color 2 * TextureColor, and clamps the result
stage0 just applies shading to the diffuse map (untouched from the original TEV)
stages 2 and 3 are for finalization (also untouched) (not too sure how they work)

now if you want to use a REAL emissive map like this:

all you need to do is change B and C of stage1 to multiply the TextureColor by the TextureAlpha: (rather than the Constant Color by the TextureColor like the fake one does)


I couldn't use a real emissive map at original quality because it would cause a memory overflow causing the Wii to freeze,
but I WAS able to get it working by downscaling the emissive maps by 50%
but here I thought the scaling would automatically apply the size difference and upscale...
I ended up being wrong, and as such, the emissive map is repeated here:

at least it works like it's supposed to :P

now note the entire image is green (including the transparent parts), so it looks no different from the fake version
but that's where the similarities stop as the fake version can't mix colors.

if you still need a little extra info as to how TEVs actually work, basically they just iterate over each stage in order and apply the equation noted in the Output Function.

here's a rough mock-up I did to help me understand Pikachu's TEV0:

note that the values supplied below the stage() function are just best guess values for testing
there's other stuff that could be done to it, such as comparison operations, but I never really needed that

so note that OutputColor is treated as a register with a default value of 0.0
Python doesn't inherently support vectors, let alone vector maths, so this was really all I could do without writing a complex vector class.
but the operations are still the same as what I have above:
(0,1,2) + (3,4,5) = (3,5,7)
(0,1,2) * 2 = (0,2,4)

for even more detailed information, you can follow BlackJax96's old notes here:
https://forums.kc-mm.com/index.php?topic=39649.msg801235#msg801235

hopefully this helps shed some detail on a topic that's not so well covered :)

EDIT: Update!
HOOOOO BOY this one took some real effort to get working:



so for the main texture, in order to optimize it AND make it look good, I had to separate the RGB and A channels
how I did that was a CMPR image for the RGB, and an IA4 image for the alpha:
RGB + A =
and then of course overlay the RGB5A3 emissive texture to achieve the glow

the reason I used CMPR+IA4 instead of RGB5A3 is because of the bit difference on alpha
RGB4A3 only has 8 shades of alpha
IA4 has 16 shades of alpha
and of course
CMPR only has 2 shades of alpha (GIF quality alpha)

so with CMPR I actually get ~RGB565 quality with a smaller data print
add 16 shades of alpha to that and the reduced quality is almost unnoticable

as a result of this, I had to write a separate TEV to merge the channels AND overlay the emission:

TEV0 is the original emissive TEV from the full RGBA8 version
TEV3 is the new version that references the alpha map in stage0, and applies it to the RGB map in stage1 before adding the emissive map in stage2 with the finalizations in stages 3 and 4

the material layout also adds the alpha map as a texture slot:

so yeah stage0 references TexMap2, stage1 -> TexMap0, stage2 -> TexMap1
(I wanted to keep compatibility so I wouldn't have to touch the emissive stage)

so yeah, REAL emissive map fully working in Brawl
here's the hack btw if anyone wants to play with it:
https://mega.nz/#!M0ASkSAa!Vj5T4I3A92uG5XGFTj3yoQ3TKEw3L7rX7eP7JLyQwQo
as well as the full quality version:
https://mega.nz/#!l4ZnzAQA!cHOYoJ2f-dUDa9fEkeiqY-k2jlL8f4ON7YXp-Zb1yPM
and the fake version:
https://mega.nz/#!Y9gjzKab!rVwEL5KIXDFUrUEwEIZCx9rLZotL81A67Ce_sMtHmJs
hopefully these serve as some good examples to help you guys get a feel for TEVs ;)
#3
April 5 2013 - 12:00 Midnight

I've finally managed to run SSBM with individual files (NO ISO) off of my USB.

here's what you need:
- Configurable USB Loader with DIOS MIOS (I have version 2.2)
- a Melee ISO
- a USB with at least 1.5GB free (SD gets copied to USB)

to install Configurable USB loader with DIOS MIOS:
first off, you'll need to download WAD Manager
and you'll need a revision of IOS249 as a WAD
you will also need to download the latest version of DIOS MIOS

place the USB loader in your SD:/apps directory with the folder "usb-loader" on your SD root.

to install DM, the download should contain an EXE and a WAD.
(you'll be needing the EXE for later)

load up WAD Manager and select IOS236.
locate the DM WAD and install it.

you can skip IOS249 installation if you already have a non-stub IOS, but if not:
reload WAD Manager and select IOS250
locate the WAD for IOS249 and install it.


Preparing your USB:
IMPORTANT: make sure your drive is formatted to FAT32
(it's required by DIOS MIOS)

now it's time to use that EXE I've mentioned earlier "DMToolbox.exe"

load that up and browse for your SSBM ISO.

set the output directory to 'USB:games' and the format to "Extracted"

this will install Melee's files on the drive

once finished, insert your SD and USB into your wii, boot up the loader, and run your game :)

I didn't need to set anything to get it working ;)


NOTE: be sure to keep your drive defragmented, otherwise you will experiance alot of load-time.
(gameplay doesn't seem to be bamfed)

sorry for my directions being horrible... >_<
I'm only on my wii

I'll fix them up in time :)
#4
Programming / Universal Model Converter - beta testing
December 11, 2012, 07:55:14 PM

UMC Official Development Thread


UMC is literally what it's name stands for.

UMC, when finished, will be able to convert models from one format to another format.
that being said, that "format" can be whatever desired format is supported by UMC's plugins

right now UMC is still in it's basic development stages, and currently only supports a model with a material color and vertex colors.
multi-channel vertex colors and UV's are supported, but not displayed... yet

I'm still working on getting the internal format to support more...

the conversion process may seem fast, but it's actually quite slow...
once new knowledge is found out, it will be implamented to improve performance.

I'll be starting a google project and post a download upon the release of dev5.

until then, you can keep an eye on the progress  ;)
#5
Model Imports / Tcll5850's imports/creations
January 23, 2012, 07:42:52 PM
I don't have very much and all of mine are still WIP...
but I'll get it eventually XD

Note: I refuse to build an import for a character if disables the other choices for that character
(what's the freakin point then) >:(

Pachirisu (Import):

^the true very first image I took... (not UL'd anywhere else)
compair it with this image to see the animation:


and this shows them both in their WalkSlow animations...


sadly, I'm currently unable to duplicate this ;_;
(my first attempt from the images above died with my last SD card) T.T


Riku (Creation):




Dark Pikachu v5 (Recreation):
(no image yet)


Melee Pichu (Import):
sadly, the only images I have are useless conversions:


I'm building a seperate lvl1 DAT2OBJ converter to perfect the results before working on it for UMC

other Melee imports:
Roy
Dr Mario
Mewtwo
Young Link
Giga Bowser
#6
Programming / NOTES: DAT Resource thread (Reformatted)
January 23, 2012, 11:19:20 AM
I'm actually reserving this thread until I get net on my compy...
you can always use my old resource thread for reference...

@Mods: I'd like this thread to be pinned below my MDL0 thread plz :)
#7
Programming / UMC/UGC/UGE Future Ideas (discussion)
January 21, 2012, 06:34:11 PM
yes... out with the spoilers :P

UMC will be having it's name changed by UMC5x

UMC3x (2nd release) will support multiple models and viewports (should be able to load .blend files fully)
UMC4x will be able to support scipts and logic
UMC5x will be changed to Universal Game Converter and support many more aspects such as audio
~UMC6x will be another name change to UG Editor

so there's my future plans for where this thing is going...

other ideas:

-input support for game controllers
-real time edit/play (not supported by verts or other primary things)
-dynamic data generation (gives a different experience and feel) <- not really much to simply explain...

I'll note more once I think of them... :P

tell me what ideas you may have that you'd like me to implement :)
#8
Programming / NOTES: MDL0 Resource Thread (reformatted)
January 21, 2012, 12:11:06 PM
reserved for unknown reasoning...

I might use it later :P
#9
Programming / blender mdl0 importer (reboot)
January 08, 2012, 07:20:49 PM
I'll only be working on the importer for now...

I'm not getting any help from 5 forums in the matter of generating the Group, Next, and Prev ID's in the relocation offsets...


anyways...
I'd like to do this because IK this converter's gonna take a few years just to get the basic GUI structure working... >_>

but...
you can import the model into blender 2.49 (the version I'm working on),
save a blend file and open it with 2.60 to export a 3DS.
(blender 2.60's exporter is fully functional) ;)
#10
Help / riivolution (advanced) help needed
January 08, 2012, 01:39:33 PM
ok...
so in quick description, what I'm trying to do is hack melee using brawl...

I can get the loaders to work just fine:
main.dol (replacement)
fst.bin (replacement)
appldr.bin (addition)
appldr.bin (apploader.img replacement)
header.bin (addition)
header.bin (boot.bin replacement)

but whenever I try to add any other files,
the option disappears from the selection screen...

does anyone know what's going on here?? :/
#11
Help / dual layer disk error (it has happened)
October 31, 2011, 01:33:03 PM
yes, I too am victim to the lowly error, and my wii can no longer read brawl... -.-*
or can it??

the error happened to me just a few weeks after installing IOS58 which is the USB2.0 driver to allow my flash drive to be used with WiiXplorer...

I say a few weeks because I had to use a friend's brawl disk (that used to work on my wii) to figure it out...
I've tried about 3 brawl disks before coming to a final conclusion...

so I'm thinking IOS58 had to've caused the error as I havn't installed anything else...
so what if I remove the IOS??
will that restore brawl readability??

I'll have to experiment with my wii to figure it out... >_>

I'm thinking IOS58 may be interfering with IOS249 and replacing DLD readability with USB2.0 readability...
#12
Programming / MDL0 Resource discussion thread
October 12, 2011, 02:51:03 PM
IDK why I didn't think of this sooner, but here it is.

this is the thread where people can freely discuss stuff pertaining to my resource thread:
http://forums.kc-mm.com/index.php?topic=28748.0

so if you have any info, OR comments, please post them here :)

EDIT:
if you have any questions and/or thoughts as to the format, don't be shy. ;)
#13
Programming / HB app request (HB internet browser)
September 28, 2011, 05:51:41 PM
I already know this project is going to be huge.
but I hope to get something started on it as this seems to have a pretty large demand on it >_>

I'm going to rewrite my ideas for this here.
(from what was in my hex editor thread)

HB Net Browser ideas:
-download files to SD or USB storage (choose destination to download to)
-allow updates from adobe, java, and other content managers.
-allow chat boxes and other non-working resources to work
-allow toolbars and add-ons
-allow multiple tabs
-temporary files and cookies directory
-back buffer length dependant on free space or user set length
-remember login info on all sites
-if Kbd is USB, disable the virtual Kbd
-no char limit

yes I know it's a bit demanding on memory...
if I have free memory, I want to use quite a good section of it for page quality and user conveinence.

although delete the info that's not being used anymore ;)
I want to use alot of space, but not too much.

you can give some memory usage definition settings for those who'd like to use less memory than me ;)

such as the back buffer limit I stated above
you should allow an override setting to allow a back buffer of maybe 10 pages
I prefer IE's buffer of I think 30-50 pages

I'd the browser to be as much like IE as possible
#14
Programming / HB app request (HxD Hex Editor)
September 27, 2011, 12:22:27 PM
I'm actually surprized this isn't out yet...
(about as surprized as a scientific calculator not being out)

anyways...
I'm making a request toward a hex editor for HBC
(hopefully something like HxD)

reason being is my compy's taken down and I won't always be at the library due to gas
(we have a closer library, but they only have 3 compys with no chance of getting on them)
so all I have is my wii.
#15
Programming / I have a propositional question
August 12, 2011, 02:51:34 PM
I'm giving you guys 2 votes for a top and 2nd top format ;)
and with the option to change your vote ;D

rmbr though...
this is for AFTER I finish my DAE plugin,
so I may not get to it for QUITE a while :|
#16
this is the unofficial thread for my BIGGEST brawl project

I promised Melee Pichu, and I ment it (:<
http://brawlimports.proboards.com/index.cgi?action=display&board=123145&thread=23&page=1

a few other images:
current conversion:


shadow model:
#17
Programming / NOTES: DAT Resource Thread
August 09, 2011, 11:03:46 PM
please don't post in this thread while it's unlocked...

I'm posting completely new notes as my old notes are kinda out-of-date... heh

thank you :)
#18
this thread will have a full description of the MDL0 file format (better than the wiki)
this post will focus on v9, while the others will be using specs from v9 for the other versions.
Please PM me if you have any new info. Thank you :)

the MDL0 header defines the basis for the MDL0 standards
Global MDL0 Header:
0x00: 'MDL0'
0x04: string table offset
0x08: version
0x0C: BRES offset


the Resource List structure is determined by the MDL0 version:
Lists:
0x00(4): Definitions List
0x04(4): Bones List
0x08(4): Vertices List
0x0C(4): Normals List
0x10(4): Colors List
0x14(4): UV Points List
0x18(4): Materials List
0x1C(4): Nodes List
0x20(4): Objects List
0x24(4): Textures List
0x28(4): Pallets List


the Local Header: gives info about the MDL0
Local Header:
0x2C(4): Name Offset
0x30(4): properties length
0x34(4): properties Offset
0x38(4): unknown (0)
0x3C(4): unknown (0)
0x40(4): Vertices count
0x44(4): Faces count
0x48(4): unknown (0)
0x4C(4): Link count
0x50(4): unknown (0x01010000)
0x54(4): properties length (copy??)
0x58(24): Bounds


Sections (Lists):
-Definitions
-Bones
-Vertices
-Normals
-Colors
-UV's
-Materials
-Nodes
-Objects
-Textures
-Pallets

after the header comes the Links which link to the bones, Definitions, materials, etc...
0x00(4): count
0x04(4*count): ID


If a model has 7 bones, 13 weights,
and bones 0 and 3 are dummy's the Links would look like this:
00000001 00000002 00000004 00000005
00000006 FFFFFFFF FFFFFFFF FFFFFFFF
FFFFFFFF FFFFFFFF FFFFFFFF 00000000
00000003


so the Links to weighted bones come first, then it's the dummy bones.

the Link index in the bones would index to it's weighted position here...
eg:
bone 0's index would be 11
bone 5's index would be somewhere w/in the weight links (say... 8)
and if bone 6's index is 10, I'm assuming bone 5 would use both 8 and 9
(all the weighted bones own at least 1 weighted index)

after that comes the resource group table.
the List offsets (in the header) point to the group data,
and the data offset + the list offset points to the data
eg: Object_Data = (Objects_List+data_offset)

here's what the relocation group data looks like:

relocation group header:
0x00(4): block length
0x04(4): number of offsets

resource group offsets:
0x00(2): Group ID
0x02(2): pad
0x04(2): Prev ID
0x06(2): Next ID
0x08(4): string offset
0x0C(4): data offset


directly after the resource groups comes the Textures (the references)
we'll deal with those later...
let's just cover the sectioning data for now :)



Definitions:
these aren't front-forward in 3D applications...
(same as the Links)

but basically... they link the data between ojects, materials, and bone weights.
BJ knows about how they work.

Type 1:
0x00(1): '01' (Stop command)

stops the read process

Type 2:
0x00(1): '02'
0x01(2): Bone index
0x03(2): Parent Bone ID

will add description later

Type 3:
0x00(1): '03'
0x01(2): ID
0x03(1): Weight Count
0x04(2): Bone Table index
0x06(4): Weight
-0x0A(2): Bone Table index
-0x0C(4): Weight

these hold the weights for the bone with this weight ID (not the bone ID),
and are also used for returning the bone matrix
(the bone matrices are used for generating the transformed vertices)

Type 4:
0x00(1): '04'
0x01(2): Object index
0x03(2): Material index
0x05(2): Bone index
0x07(1): unknown

will add description later
all I know is it's for material linkage

Type 5:
0x00(1): '05'
0x01(2): ID
0c03(2): Bone ID

used for bones with single or no influence



Bones:
the bones here don't really act for anything but animation.
they control a vert's position in a 3D vector space based on it's influence (it's weight) to that bone.

however, IK bone chains are kind of a special case...
these deal with 1 bone acting as a muscle (when scaled),
causing a chain of say... 3 bones to move along with it.
(such as bones in a finger, a leg, or an arm)

the muscle bone is basically a dummy bone...
all the influences are affected by the bones this bone controls.


0x00(4): Block Length
0x04(4): MDL0 Offset
0x08(4): String Offset
0x0C(4): Bone ID
0x10(4): Link index (use the list if -1)
0x14(4): Flags (not all are known)
0x18(4): Pad 1
0x1C(4): Pad 2
0x20(12): Scale
0x2C(12): Rotation
0x38(12): Translation
0x44(24): Bounds
0x5C(4): Parent Offset
0x60(4): Child Offset
0x64(4): Next Offset
0x68(4): Previous Offset
0x6C(4): Bone Strings/Properties Offset (part2)

0x70(48): BindMatrix 4x3
0xA0(48): InverseBindMatrix 4x3

Flags:
0001 - NoTransform
0002 - FixedTranslation
0004 - FixedRotation
0008 - FixedScale
000C - unknown
000F - unknown

0010 - unknown

0100 - unknown
0200 - HasGeometry
0300 - unknown

'031F' appears to be the typical flags



Vertices:
vertices are one of the main building blocks of a model.
they control what the model looks like, how it will move when animated, along with other things

The verts follow the global vector header defined here:

Global Vector Header:
0x00(4): Block size
0x04(4): MDL0 Offset
0x08(4): Data Offset
0x0C(4): String Offset
0x10(4): Index ID
0x14(4): Has Bounding Box
0x18(4): Data type
0x1C(1): Entry Stride
0x1D(1): Divizor
0x1E(2): Entry count

0x20(4): Bounds (+padding)


the data type further defines how the data is read:
0: u8 / pow(2.0,Divizor)
1: s8 / pow(2.0,Divizor)
2: u16 / pow(2.0,Divizor)
3: s16 / pow(2.0,Divizor)
4: float




Normals:
the normals control basically which direction the texture will display on a polygon.
there are other advanced features I've seen in the MDL0 format that appear to be controlled by nodes

the normals follow the same data format as the verts



Colors:
these would be your typical vertex colors in 3D applications.
these are actually a seperate instance from materials that work to re-define a material color.


0x00(4): Block size
0x04(4): MDL0 Offset
0x08(4): Data Offset
0x0C(4): String Offset
0x10(4): Index ID
0x14(4): Has Alpha
0x18(4): Format
0x1C(1): Entry Stride
0x1D(1): unknown
0x1E(2): Entry count


the color formatting is further defined here:

Formats:
0: RGB565
1: RGB8
2: RGBX8 (24bit RGB??)
3: RGBA4
4: RGBA6
5: RGBA8




UV's:
the UV's control the position of a texture on a polygon.
there are seperate channels (up to 8) to control the positioning for different textures.
(for say... using the same model with different textures to be used as costumes)

these also follow the vert data format.



Materials:
the materials alone don't control much but color, texturization, and speculation.
most of the magic is done by the shaders contained w/in the material.
the shaders control a slue of things from making a model appear like glass to renderring fur.
the shaders also control the shadow cast of a model.

very little is known about the MDL0 data though
0x00(4): Block size
0x04(4): MDL0 Offset
0x08(4): String Offset
0x0C(4): ID
0x10(4): unknown
0x14(1): Texture count
0x15(1): Layer count
0x16(1): Shader Type (same on linked Node)
0x17(1): unknown
0x18(4): Normal settings
0x1C(1): unknown
0x1D(1): unknown
0x1E(1): Shader Texture layers (max 10)
0x1F(1): unknown
0x20(4): unknown
0x24(4): unknown
0x28(4): Node offset (references the linked Node)
0x2C(4): Texture count
0x30(4): Layer offset
0x34(4): unknown
0x38(4): offset to Shader registers
0x3C(4): unknown offset


these are some of the settings for the above data:
shader types:
0: unknown
1: light/glow*
2: Toon
3: Lambert
4: metal*
5: reflective*
6: environ.*
7: Phong
8+: unknown
(all parameters marked with * don't exist in 3D applications)

normal settings:
0: double sided
1: display inside
2: dispay outside
3: display none


the shader actually starts just after the pading after the material header,
and ends after the registers.

the Shader registers are located directly at that offset.
it normally has a TEV structure just after a few settings.
after that structure comes 3 structures that set the registers (hi and lo),
set the null register values (I think),
and set the texture reference values.

after that comes 1 or 2 XF blocks that define the texture layers.
(1 XF block per texture layer)

There's still further documentation to come on these. >_>



Nodes:
Not too much is known about the data here either...

the nodes control alot of similarities to the shaders,
but the nodes can handle more on the fine detailing end, where as the shaders can't.

what the nodes control can be a range of things dealing with the visual element...
(color, hue, sat, clarity, specularity, texture affection, and a whole bunch of other things)
there are also logic nodes that are controlled by scripts to control how they work.
(image timing, color blinking, and other things)

Header:
0x00(4): Block Length
0x04(4): MDL0 Offset
0x08(4): Node ID
0x0C(1): Shader type
0x0D(3): RES0 - RES2
0x10(8): TREF0 - TREF7
0x18(8): padding


currently known structures:
(data follows the wii format code)

FE Mask'00000F'
F# - KSel[#]

FE Mask'FFFFF0'
F# - KSel[#]
2# - Tref[#]
C# - ColEnv[#]
D# - ColEnv[#] (optional)
C# - AlpEnv[#]
D# - AlpEnv[#] (optional)
1# - Cmd[#]
1# - Cmd[#] (optional)


FE Mask'00FFE3' (defined in the shaders (materials))
41 - CMODE0
42 - CMODE1
00 - unk (optional)

I'll be deleting this block when I can get to a compy.
known codes: '61 ##'

#define IND_MTXA0_ID    0x00000006
#define IND_MTXB0_ID    0x00000007
#define IND_MTXC0_ID    0x00000008
#define IND_MTXA1_ID    0x00000009
#define IND_MTXB1_ID    0x0000000a
#define IND_MTXC1_ID    0x0000000b
#define IND_MTXA2_ID    0x0000000c
#define IND_MTXB2_ID    0x0000000d
#define IND_MTXC2_ID    0x0000000e
#define IND_IMASK_ID    0x0000000f
#define IND_CMD0_ID     0x00000010
#define IND_CMD1_ID     0x00000011
#define IND_CMD2_ID     0x00000012
#define IND_CMD3_ID     0x00000013
#define IND_CMD4_ID     0x00000014
#define IND_CMD5_ID     0x00000015
#define IND_CMD6_ID     0x00000016
#define IND_CMD7_ID     0x00000017
#define IND_CMD8_ID     0x00000018
#define IND_CMD9_ID     0x00000019
#define IND_CMDA_ID     0x0000001a
#define IND_CMDB_ID     0x0000001b
#define IND_CMDC_ID     0x0000001c
#define IND_CMDD_ID     0x0000001d
#define IND_CMDE_ID     0x0000001e
#define IND_CMDF_ID     0x0000001f

#define RAS1_SS0_ID     0x00000025
#define RAS1_SS1_ID     0x00000026
#define RAS1_IREF_ID    0x00000027

#define RAS1_TREF0_ID 0x00000028
#define RAS1_TREF1_ID 0x00000029
#define RAS1_TREF2_ID 0x0000002a
#define RAS1_TREF3_ID 0x0000002b
#define RAS1_TREF4_ID 0x0000002c
#define RAS1_TREF5_ID 0x0000002d
#define RAS1_TREF6_ID 0x0000002e
#define RAS1_TREF7_ID 0x0000002f

#define PE_ZMODE_ID         0x00000040
#define PE_CMODE0_ID        0x00000041
#define PE_CMODE1_ID        0x00000042
#define PE_CONTROL_ID       0x00000043
#define PE_TOKEN_ID         0x00000047
#define PE_TOKEN_INT_ID     0x00000048

#define TEV_COLOR_ENV_0_ID 0x000000c0
#define TEV_ALPHA_ENV_0_ID 0x000000c1
#define TEV_COLOR_ENV_1_ID 0x000000c2
#define TEV_ALPHA_ENV_1_ID 0x000000c3
#define TEV_COLOR_ENV_2_ID 0x000000c4
#define TEV_ALPHA_ENV_2_ID 0x000000c5
#define TEV_COLOR_ENV_3_ID 0x000000c6
#define TEV_ALPHA_ENV_3_ID 0x000000c7
#define TEV_COLOR_ENV_4_ID 0x000000c8
#define TEV_ALPHA_ENV_4_ID 0x000000c9
#define TEV_COLOR_ENV_5_ID 0x000000ca
#define TEV_ALPHA_ENV_5_ID 0x000000cb
#define TEV_COLOR_ENV_6_ID 0x000000cc
#define TEV_ALPHA_ENV_6_ID 0x000000cd
#define TEV_COLOR_ENV_7_ID 0x000000ce
#define TEV_ALPHA_ENV_7_ID 0x000000cf
#define TEV_COLOR_ENV_8_ID 0x000000d0
#define TEV_ALPHA_ENV_8_ID 0x000000d1
#define TEV_COLOR_ENV_9_ID 0x000000d2
#define TEV_ALPHA_ENV_9_ID 0x000000d3
#define TEV_COLOR_ENV_A_ID 0x000000d4
#define TEV_ALPHA_ENV_A_ID 0x000000d5
#define TEV_COLOR_ENV_B_ID 0x000000d6
#define TEV_ALPHA_ENV_B_ID 0x000000d7
#define TEV_COLOR_ENV_C_ID 0x000000d8
#define TEV_ALPHA_ENV_C_ID 0x000000d9
#define TEV_COLOR_ENV_D_ID 0x000000da
#define TEV_ALPHA_ENV_D_ID 0x000000db
#define TEV_COLOR_ENV_E_ID 0x000000dc
#define TEV_ALPHA_ENV_E_ID 0x000000dd
#define TEV_COLOR_ENV_F_ID 0x000000de
#define TEV_ALPHA_ENV_F_ID 0x000000df
#define TEV_REGISTERL_0_ID 0x000000e0
#define TEV_REGISTERH_0_ID 0x000000e1
#define TEV_REGISTERL_1_ID 0x000000e2
#define TEV_REGISTERH_1_ID 0x000000e3
#define TEV_REGISTERL_2_ID 0x000000e4
#define TEV_REGISTERH_2_ID 0x000000e5
#define TEV_REGISTERL_3_ID 0x000000e6
#define TEV_REGISTERH_3_ID 0x000000e7

#define TEV_FOG_PARAM_0_ID  0x000000ee
#define TEV_FOG_PARAM_1_ID  0x000000ef
#define TEV_FOG_PARAM_2_ID  0x000000f0
#define TEV_FOG_PARAM_3_ID  0x000000f1
#define TEV_FOG_COLOR_ID    0x000000f2

#define TEV_ALPHAFUNC_ID 0x000000f3
#define TEV_Z_ENV_0_ID 0x000000f4
#define TEV_Z_ENV_1_ID 0x000000f5
#define TEV_KSEL_0_ID 0x000000f6
#define TEV_KSEL_1_ID 0x000000f7
#define TEV_KSEL_2_ID 0x000000f8
#define TEV_KSEL_3_ID 0x000000f9
#define TEV_KSEL_4_ID 0x000000fa
#define TEV_KSEL_5_ID 0x000000fb
#define TEV_KSEL_6_ID 0x000000fc
#define TEV_KSEL_7_ID 0x000000fd





Objects:
this is where all the data is combined.
the objects basically define a model space, and link all the model and material data
in MDL0 files, the objects hold the faces (polygons) that link the verts, normals, and UV's

objects also allow parenting to other objects, and are usually parented to bones

Header:
0x00(4): Block Size
0x04(4): MDL0 offset
0x08(4): Bone table ID (if -1, use weight table)
0x0C(8): CP format specs (hi and lo)
0x14(4): XF Normal specs
0x18(4): attributes block size
0x1C(4): attribute flags
0x20(4): attributes offset
0x24(4): data Size
0x28(4): data Size (copy??)
0x2C(4): data offset
0x30(4): XF format specs
0x34(4): Unknown (Always 0x00000000)
0x38(4): String offset
0x3C(4): ID
0x40(4): Number of vertices
0x44(4): Number of faces

0x48(2): vert input
0x4A(2): Normal input
0x4C(2): Color0 input
0x4E(2): Color1 input
0x50(2): UV0 input
0x52(2): UV1 input
0x54(2): UV2 input
0x56(2): UV3 input
0x58(2): UV4 input
0x5A(2): UV5 input
0x5C(2): UV6 input
0x5E(2): UV7 input

0x60(4): Weight table offset (0x64 in v11 MDL0's)

Weight table
0x00(4): Number of weights
0x##(2): Weight ID


the attributes come after the Weight table and define alot of what's in te header:
they also follow the wii format code
note: this is what's actually used (not the data in the header)
attribute definitions:
08 00 = host - colors, normals, and textures
08 10 = unknown
08 20 = unknown
08 30 = SetMatricesA
08 40 = SetMatricesB
08 50 = CP hi
08 60 = CP lo
08 70 = UVAT Group 0
08 80 = UVAT Group 1
08 90 = UVAT Group 2


up next is the Primitives
the Primitives contain data that's used either for transform puposes,
or geometric purposes.


Primitive Types:
20 - vert transform
28 - Normal transform
30 - UV transform
38 - Light transform

80 - Quads
90 - Triangles
98 - Tristrip
A0 - Trifan
A8 - Lines
B0 - Linestrip
B8 - Points


chunks of data are defined to hold the transform primitives before the geometry primitives.

vert/normal transform primitives work as such:
0x00(1): '20' or '28'
0x01(2): weight ID
0x03(.5): unknown
0x03.5(1.5): index/12

as for the facepoints,
the length of the facepoint is defined by the CP list.

here's an example CP list:
[1,0,1,0,0,0,0,0,0,3,3,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
this would define a facepoint with a length of 9 ('## ## #### #### ## ####')

here's how it works:
the CP hi defines the:
-vertex/Normal transform
-UV0 transform
...
-UV7 transform
-Vertex index
-Normal index
-Color0 index
-Color1 index


the CP lo defines the:
-UV0 index
...
-UV7 index
- vert mtx array
- normal mtx array
- UV mtx array
- light mtx array
- NBT
- Max number of attributes
- end marker (0xff)


the values in the above list determine the length of the read values in the facepoints:
0 - null
1 - direct (memory access)
2 - 8bit index
3 - 16bit index




Textures:
soon...
(I need to find my notes)



Pallets:
I will come back to these

_______________________________________________________________________________________

I should get alot more filled in as I go ;)
I'll be covering alot more info than the wiki, as you can already see :)
just give me some time is all
#19
Programming / Tcll's resource box
July 07, 2011, 02:59:59 AM
sup peeps :D

I'm a python programmer like 404,
I use Python 2.7 since it has more support for python 3x, but isn't as demanding.
(PyOpenGL is also slower for Python 3x)




HexEdit Pro 5.0 - A professional hex editor, built by Andrew, with template support and many more features used for viewing and testing the data structures of a file.
For more information, go to https://github.com/AndrewWPhillips/HexEdit/tree/master/HexEdit
For color-highlighting support download and replace BinaryFileFormat.dtd in the program directory.
Templates I've built for HexEdit Pro 4.0:

DAT (HAL Labs) - coming soon
MDL0 - removed
TEX0 - removed
REFT - removed
REFF - todo
REL - todo

^ these will be merged into a single template for NW4R once the link returns
you'll have to manually apply the template or create symlinks for each filetype because HexEdit doesn't have template mapping functionality

template installation instructions

EDIT:
sorry everything's kinda disappeared, this stuff will return I promise
just been having numerous issues with big corporations screwing me in various ways
I'm working on solutions of my own, so just be patient ;)

as for why I've removed most of the old entries from the table, the sources were either lost or are too old to be of any relevance.
some were also on 4Shared, which is a service I've dropped (along with Mediafire).
#20
General Hacking Discussion / HexEdit 4.0 beta
May 19, 2011, 12:54:42 AM
until the HexEdit link gets fixed,
this is posted here to keep everyone from bugging me about it
(not that it's happened very often) >_>

Quote from: Tcll on May 17, 2011, 08:32:43 PM
HexEdit 40 beta (recommended suggestion)
download: http://www.box.net/shared/dmgiblxee9

free, no known bugs, and many new features.
HexEdit's built-in template editor makes it easy to view the data of different files
you can get templates (made for smash hacking) here:
http://brawlimports.proboards.com/index.cgi?board=templates
a screenshot: :)


the next version I release will be able to highlight the hex values in different colors
(defined by the template)

the screenshot is actually my MDL0 template loading a version11 mdl0
brawl uses version9 mdl0s



EDIT:
I'll be releasing any templates I make here :)
well, more like notifying about the release >_>