BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the community, you simply need to register an account or log into an existing one.

Be sure to check out disposable e-mail services, in case you prefer using one for this site instead of your legit address: http://10minutemail.com/10MinuteMail/

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can see and download all content provided for regular members even without an account!

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Search
 
 

Display results as :
 


Rechercher Advanced Search

December 2017
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar

Country Statistics
Free counters!
LaTeX Generator


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Direct RAM Writes on 6/29/2013, 9:01 am

Bully@WiiPlaza

avatar
 
 
Purpose:

Writing a value to the RAM at a specific address.

Be it 8 digits (32 bit), 4 digits (16 bit) or 2 digits (8 bit). There's no codetype for writing 1 digit called nibble (4 bit).

Since 16 bit and 8 bit writes do not use the whole 8 digits specified for the value, there's room for the possibility of doing serial writes similar to this.

Templates:


32 bit:

TTYYYYYY XXXXXXXX

TT = Codetype:

Base address & address less than 0x81000000 or 0x91000000 04
Base address & address greater than 0x80FFFFFF or 0x90FFFFFF14
Pointer & address less than 0x81000000 or 0x91000000 05
Pointer & address greater than 0x80FFFFFF or 0x90FFFFFF15

YYYYYY
= Address to write to
XXXXXXXX = Value to write

16 bit:

TTYYYYYY ZZZZXXXX

TT = Codetype:

Base address & address less than 0x81000000 or 0x91000000 02
Base address & address greater than 0x80FFFFFF or 0x90FFFFFF12
Pointer & address less than 0x81000000 or 0x91000000 03
Pointer & address greater than 0x80FFFFFF or 0x90FFFFFF13

YYYYYY
= Address to write to
XXXX = Value to write
ZZZZ = Additional writes to perform

8 bit:

TTYYYYYY ZZZZ00XX

TT = Codetype:

Base address & address less than 0x81000000 or 0x91000000 00
Base address & address greater than 0x80FFFFFF or 0x90FFFFFF01
Pointer & address less than 0x81000000 or 0x91000000 10
Pointer & address greater than 0x80FFFFFF or 0x90FFFFFF11

YYYYYY
= Address to write to
XXXX = Value to write
ZZZZ = Additional writes to perform

Example #1:

We want to write to address 81456780 using value 00000001. The maximum we ever need is 000000FF.

Since our value can either be 16 bit, 32 bit or 8 bit we can decide which one we'll use. Depending on how the game's value type is defined you may know what it is. Wink

-> We'll take 8 bit because there's never need to write more than 2 digits.

01456780 00000001


In general:
Using less bit writes is better if you happen to affect other stuff unknowingly.

Example #2:

We're using a pointer with offset 5F0 and want to write to the RAM the value 03FF exactly 5 times in a row.

Obviously, we need 16 bit this time (4 digits!). Using pointer adds 0x10 to the codetype. The offset is calculated by subtracting the pointer value from the starting address. We're doing a serial write (4 additional ones).

120005F0 000403FF

Note:

Addresses on which 32 bit writes are performed should be divisible by 4. Respectively 16 bit by 2 und 8 bit by 1 (which is always possible).

Failing to get it right will only make you look stupid since
they still end up working properly.

Why?
The codehandler implicitly decreases the address until it's finally divisible and performs the write at the new address.

The following codes therefore do the same thing:

047FED0 12345678
047FED1 12345678
047FED2 12345678
047FED3 12345678

Doing a bad bit write has no purpose besides trying to steal credit.
-> Don't even try, you have been warned. Wink

Example #3:

We're writing value 3F812345 to address 801A9F03.


Really that easy?

041A9F03 3F812345

Since the bit write is wrong it'll be changed to

041A9F00 3F812345

implicitly and does NOT act like expected / wanted. The string write codetype would be the way to go since it does allow these cases.

Alternatively, you can take one 8 bit write with 3F, a 16 bit write using 8000 and finally another 8 bit write using 00.

001A9F03 0000003F
021A9F04 00008123
001A9F06 00000045

Quite inconvenient but you'll almost never really need this case.


_________________

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum