Register - Login
Views: 99380637
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-23-22 11:33:53 PM
Jul - General Game/ROM Hacking - [N64] Differences between N64, V64, Z64 and internal programming New poll - New thread - New reply
Next newer thread | Next older thread
ShenoxVII

(in all seriousness, you're a prick)
Level: 24


Posts: 35/111
EXP: 75917
For next: 2208

Since: 10-09-10


Since last post: 9.0 years
Last activity: 9.0 years

Posted on 12-20-10 11:41:10 PM Link | Quote
Some stuff you will need to know.

Depending on the operating system to work, consider the byte order of numeric data types that use multiple bytes. There are two different formats, called "Little Endian and Big Endian."

"Little Endian" means that the least significant byte is stored in the lowest address of memory and the most significant byte in the highest.

Thus, a 4-byte Long Int
Byte2 Byte3 Byte1 Byte0

be stored in memory as follows:
Base Address +0 ===> Byte0
Base Address +1 ===> Byte1
Base Address +2 ===> Byte2
Base Address +3 ===> Byte3

Intel processors (used in most personal computers) and DEC Alpha RISC are "Little Endian."

In the format "Big Endian" the most significant byte is stored in the lowest address byte of memory and less weight in the highest address.
Int Long before, now would be stored as follows:

Base Address +0 ===> Byte3
Base Address +1 ===> Byte2
Base Address +2 ===> Byte1
Base Address +3 ===> Byte0

Most UNIX systems, the Internet protocol TCP, Motorola 680x0 processors (and, therefore, the Macintosh), Hewlett-Packard PA-RISC and Sun SuperSPARC are "Big Endian". The MIPS processor Silicon Graphics and IBM / Motorola PowerPC are able to understand both systems, so they are said to be "bi-endian."

What order is best?

Because of the historical rivalry between the PC and Mac, the question of the ordination of bytes has been widely discussed. Both systems have advantages and disadvantages that follow.

In the "Little Endian", the assembly instructions to choose 1, 2, 4 or a larger number of bytes from the same way: first reading the low byte, which is in the offset (offset) 0.

In addition, the 1:1 ratio between the offset and the number of byte math routines causes are easier to implement.

In the "Big Endian", by having the most significant byte first, you can check directly if the number is positive or negative only checking the first byte (remember that the sign is stored in the first bit) and without need to know the length of the number.
This form of representation matches the order in which the numbers are written, so the routines to convert between numbering systems are more efficient than if undertaken in "Little Endian."

To know the different formats
When running a program, you may need to get it tell the difference between the two formats and act accordingly when you are using.

If you want a program to run on multiple platforms to be taken into account if they use the same format, and if different tailor the program to it. Otherwise, if the binary files used the program does not work, taking the wrong values.

The TCP protocol uses the format "Big Endian", so that systems that use "Little Endian" to convert the data to create the TCP / IP.

The formats "Little Endian and Big Endian" can be applied in addition to the management of bytes, the management of bits.

In a byte, a system that uses "Little Endian" has the least significant bit in the first bit and bit more weight in the last bit. In a "Big Endian", the high order bit will be in the first bit and the lowest weight in the past.

When applied to the management of both bytes and bits, taking advantage of each, we find systems that use the format "Big Endian" for the bytes and the "Little Endian" for the management of internally bits each byte, or vice versa.

Change from one format to another
To change from one format to another, we can build a function to swap the bytes. The procedure is simple:
Original Format -> ABCD
Format Changed -> DCBA
Moreover, given the symmetry between them, serves the same function for spending "Little Endian" to "Big Endian" as "Big Endian" a "Little Endian."
void Swap (long int * a)
{
long int b0, b1, b2, b3;
b0 = (* a) &0x000000FF;
b1 = ((* a) & 0x0000FF00)>> 8;
b2 = ((* a) & 0x00FF0000)>> 16;
b3 = ((* a) & 0xFF000000)>> 24;
* A = (b0 <<24) | (b1 <<16) | (b2 <<8) | b3;
}

/ * More efficient version * /
void Intercambio2 (long int * a)
{
* A =(((* a) & 0x000000FF) <<24) | ((((* a) & 0x0000FF00)>> 8) <<16) | \
((((* A) & 0x00FF0000)>> 16) <<8) | (((* a) & 0xFF000000)>> 24);
}


N64 (Little Endian) simplemte this extention is to save the data with this sequence

If I want to keep this format n64: AA BB CC DD / / EE FF GG HH / / II JJ KK LL
What I do is this: AA BB CC DD / / EE FF GG HH / / II JJ KK LL

Not that easy because we do not understand yet another example
Original Format
Address / / Value
1000 ------ AA
------ 1001 BB
------ 1002 CC
DD ------ 1003

N64 Format
Address / / Value
1000 ------ DD
------ 1001 CC
------ 1002 BB
------ 1003 AA

And every change must be 4 by 4 just in case see the above screenshot which compare the 3 formats

V64 (Bytewapped): Like the other format is just save the information in this way

If I want to keep this format n64: AA BB CC DD / / EE FF GG HH / / II JJ KK LL
What I do is this: AA BB CC DD / / EE FF GG HH / / II JJ KK LL

Bone is changing the sequence of 2 values, another example xD

Original Format
Address / / Value
1000 ------ AA
------ 1001 BB
------ 1002 CC
DD ------ 1003

V64 Format
Address / / Value
1000 ------ BB
------ 1001 AA
DD ------ 1002
------ 1003 CC

Note that the values are exchanged 2 by 2 to analyze the image above to see the difference

Z64 (Big Endian) simplemte this extention is to save the data in its original form without changing the sequence or anything like that

If I want to keep this format n64: AA BB CC DD / / EE FF GG HH / / II JJ KK LL
What I do is this: AA BB CC DD / / EE FF GG HH / / II JJ KK LL

Nothing fancy, so this extension is the most recommended for hackroms and the like for easy editing, but in any case there hexadecimal editors automatically rearrange the alignment of bytes if you specify them and when I talk about alignment byte bytewapped I mean, Little and big endian


(Thanks to my friend henry for details]

Internal programming Roms

We continue with the explanation entendimo now that it's the extensions, now the question arises where the Roma language are scheduled? because the response is in MIPS Assembler because if they read a little history of the console, the console processor is a 64-bit MIPS

The creators of the emulators are familiar with the MIPS language and what they do is emulate a virtual console that recognizes that format, like microsoft windows EXE for use MASM Assembler, remember that not a single assembler language are many and each with a different syntax

To see such as the MIPS assembler will show you a picture, using the display command Nemu64 and the other with a program called ELF Mutilator



Well, this is a good bit of information to put on these forums, I hope it helps or informs someone someday.
Also for people who may still not understand how v64, z64, and n64 are different (Check image if you don't) it basically is the difference from n64, z64, and v64 are that the bytes are switched around. Say you have rom.z64 in the title for example in a hex editor the bytes will be correctly matched to resemble a ACII value of the rom's internal name. Let's say it's ROM EXAMPLE, okay so if we look at it if it's in .v64 format it would be like MEXAEOL PMR or something, then in n64 it will be a little bit closer like REM OMXALEP or something.
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - [N64] Differences between N64, V64, Z64 and internal programming New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

27 database queries.
Query execution time:  0.211637 seconds
Script execution time:  0.007627 seconds
Total render time:  0.219264 seconds


TidyHTML vomit below
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 2 column 301 - Warning: unescaped & or unknown entity "&page"
line 119 column 11 - Warning: <form> isn't allowed in <table> elements
line 118 column 10 - Info: <table> previously mentioned
line 120 column 11 - Warning: missing <tr>
line 120 column 119 - Warning: missing </font> before </td>
line 124 column 16 - Warning: plain text isn't allowed in <tr> elements
line 120 column 11 - Info: <tr> previously mentioned
line 125 column 68 - Warning: missing </nobr> before </td>
line 141 column 68 - Warning: missing </nobr> before <tr>
line 147 column 35 - Warning: missing <tr>
line 147 column 50 - Warning: missing </font> before </td>
line 148 column 37 - Warning: unescaped & or unknown entity "&id"
line 147 column 237 - Warning: missing </font> before </table>
line 149 column 35 - Warning: missing <tr>
line 149 column 50 - Warning: missing </font> before </td>
line 149 column 91 - Warning: missing </font> before </table>
line 156 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 158 column 9 - Warning: missing <tr>
line 176 column 13 - Warning: missing <tr>
line 177 column 102 - Warning: unescaped & or unknown entity "&postid"
line 238 column 3967 - Warning: unescaped & or unknown entity "&0x000000FF"
line 322 column 17 - Warning: missing <tr>
line 322 column 17 - Warning: discarding unexpected <table>
line 325 column 35 - Warning: missing <tr>
line 325 column 50 - Warning: missing </font> before </td>
line 325 column 91 - Warning: missing </font> before </table>
line 327 column 35 - Warning: missing <tr>
line 327 column 50 - Warning: missing </font> before </td>
line 328 column 37 - Warning: unescaped & or unknown entity "&id"
line 327 column 237 - Warning: missing </font> before </table>
line 329 column 17 - Warning: discarding unexpected </textarea>
line 329 column 28 - Warning: discarding unexpected </form>
line 329 column 35 - Warning: discarding unexpected </embed>
line 329 column 43 - Warning: discarding unexpected </noembed>
line 329 column 53 - Warning: discarding unexpected </noscript>
line 329 column 64 - Warning: discarding unexpected </noembed>
line 329 column 74 - Warning: discarding unexpected </embed>
line 329 column 82 - Warning: discarding unexpected </table>
line 329 column 90 - Warning: discarding unexpected </table>
line 331 column 9 - Warning: missing </font> before <table>
line 343 column 25 - Warning: discarding unexpected </font>
line 352 column 37 - Warning: discarding unexpected </font>
line 330 column 1 - Warning: missing </center>
line 120 column 63 - Warning: <img> lacks "alt" attribute
line 125 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 125 column 93 - Warning: <img> lacks "alt" attribute
line 141 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 141 column 98 - Warning: <img> lacks "alt" attribute
line 148 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 160 column 11 - Warning: <img> lacks "alt" attribute
line 161 column 22 - Warning: <img> lacks "alt" attribute
line 161 column 63 - Warning: <img> lacks "alt" attribute
line 161 column 112 - Warning: <img> lacks "alt" attribute
line 161 column 162 - Warning: <img> lacks "alt" attribute
line 162 column 11 - Warning: <img> lacks "alt" attribute
line 172 column 15 - Warning: <img> lacks "alt" attribute
line 305 column 6242 - Warning: <img> lacks "alt" attribute
line 315 column 7089 - Warning: <img> lacks "alt" attribute
line 328 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 328 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 328 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 337 column 25 - Warning: <img> lacks "alt" attribute
line 342 column 267 - Warning: <img> lacks "alt" attribute
line 149 column 50 - Warning: trimming empty <font>
line 322 column 17 - Warning: trimming empty <tr>
line 325 column 50 - Warning: trimming empty <font>
line 125 column 68 - Warning: <nobr> is not approved by W3C
line 141 column 68 - Warning: <nobr> is not approved by W3C
line 177 column 27 - Warning: <nobr> is not approved by W3C
Info: Document content looks like HTML5
Info: No system identifier in emitted doctype
Tidy found 70 warnings and 0 errors!


The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier to maintain
compared with using <FONT> elements.

You are recommended to use CSS to control line wrapping.
Use "white-space: nowrap" to inhibit wrapping in place
of inserting <NOBR>...</NOBR> into the markup.

About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium

Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md