810 code type (MDW)

Started by daffydude, June 09, 2010, 01:23:11 AM

Previous topic - Next topic

daffydude

hi guys I am working on my first code (Yaa)
it is in the 810 range. I poke it and it works. so i tried saving the GCT code as 04 and it dose not work?
I am not using any poniters and it is not ASM. any ideas

Tnx

daffydude

 ;D Thank you Sir, sorry for the no0b ? i just got my Gecko
tNx

dcx2

This might help.

http://wiird.l0nk.org/codetypes.html

The language on the document is a little awkward...I was actually thinking about re-writing the code type doc and fixing some errors.  Anyway...

Quoteba : Base Address. Set at 0x80000000 each time the code handler is executed. Each time the ba is added to a code address, the code handler do : address = address + (ba & 0xFE000000). You can modify it, however if you do, don't forget to reset it to its original value after.

...

CT : Code Type. Range from 0 to 7. It's the 3 first bits of the first number of a code. Because of this, you'll notice that in the codes all the CT are actually multiplied by 2 : CT1 : 2..., CT2 : 4... CT3 : 6...,..., CT7 : E... . The fourth bit is used to tell the code handler to use the pointer instead of the base address. That means that you'll know if the base address is used by looking at the first number of a code. If it's even it's the base address, if it's odd it's the pointer.

CST : Code Sub Type. It's the 3 first bits of the second number of a code. Because of this, you'll notice that in the codes all the CST are actually multiplied by 2 : CST1 : 2..., CST2 : 4... CST3 : 6...,..., CST7 : E... . The fourth bit is actually a part of the address (____).

Because of the 1 in 81000000 memory range, you need to set the fourth bit of the second hex digit.  That makes an 04 code into an 05 code.  If you were writing to 90000000 or 92000000, you could still use 04 code type, assuming you changed ba as needed.  91... and 93... will require the 05 code type *and* changing the ba.

The PO does not have that restriction.  You can stick anything into the PO and the 14 code type will go there.

daffydude