ROM Hack I need help understanding these D code lines please

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Hello

Before you read any further, I'd like to state one thing. I am a noob at this and have no experience in programming or coding or anything like that for that matter. I understand basics of HEX and Decimals but that's it. With the recent of help, I now understand button triggers.

So with that out of the way, I would like to know why some gateshark codes have these D code lines and why they don't work without it for some reason (usually crashes my game). I will BOLD them to indicate which code line I am talking about. Here we go.

D1000000 00000000
355A120C 0000FFFF

D1000000 10000000
00725AF0 00000063

D3000000 00000000
13955000 C8C80000

D2000000 00000000
4469001C 000003E7

D2000000 10000000
299A0FF0 FFFFFFFF

Those are the D code lines I am trying to figure out. I've looked around and searched for it but still wound up with no answers. Either they are lost to time, I am not looking them up right, or it's just common knowledge to everyone who knows programming, whatever it is, I can't find any info on what they do. Also why do some have a different value like 10000000 instead of just all zeros 00000000. Any help would be appreciated. Thank you.
 

DesuIsSparta

Well-Known Member
Member
Joined
Oct 13, 2015
Messages
580
Trophies
0
XP
1,037
Country
United States
I thought you were talking about the programming language..

Anyway, I used to make gameshark codes way back when I was young.. and it's been a long time. I vaguely recall lines beginning with D as activators/deactivators. They are needed because certain codes require certain memory in games to be activated in order to be available for access. For example, if you're trying to unlock something that isn't available in a game until you progress past a certain checkpoint, entering the cheat can break the game and prevent you from accessing said checkpoint. I know that the Grand Theft Auto series has a lot of cheats like this, where spawning a certain vehicle will cause missions to break and fail.

Also, if you want to make a toggle cheat like infinite health on/off, you need activators/deactivators!
 
  • Like
Reactions: KingAsix

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Well these are gateshark codes not so much as gameshark but thanks anyways. Looks like my search continues since no one knows what they do (yet).
 

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Apparently there is a Cheat Sheet that some of ya'll been holding out on the rest of us. So I am willing to share. Found this at maxconsole. Courtesy of xJam.es

0 Type
Format: 0XXXXXXX YYYYYYYY
Description: 32bit write of YYYYYYYY to 0XXXXXXX.
Simple: Makes the value at address 0XXXXXXX equal the value YYYYYYYY.
Example:

023D6B28 3B9ACA00


1 Type
Format: 1XXXXXXX 0000YYYY
Description: 16bit write of YYYY to 0XXXXXXX.
Simple: Makes the value at address 0XXXXXXX equal the value YYYY.
Example:

023D6B28 00002710


2 Type
Format: 2XXXXXXX 000000YY
Description: 8bit write of YY to 0XXXXXXX.
Simple: Makes the value at address 0XXXXXXX equal the value YY.
Example:

023D6B28 00000032


3 Type
Format: 3XXXXXXXX YYYYYYYY
Description: 32bit if less than.
Simple: If the value at address 0XXXXXXX is less than the value YYYYYYYY.
Example:

323D6B28 10000000


4 Type
Format: 4XXXXXXXX YYYYYYYY
Description: 32bit if greater than.
Simple: If the value at address 0XXXXXXX is greater than the value YYYYYYYY.
Example:

423D6B28 10000000


5 Type
Format: 5XXXXXXXX YYYYYYYY
Description: 32bit if equal to.
Simple: If the value at address 0XXXXXXX is equal to the value YYYYYYYY.
Example:

523D6B28 10000000


6 Type
Format: 3XXXXXXXX YYYYYYYY
Description: 32bit if not equal to.
Simple: If the value at address 0XXXXXXX is not equal to the value YYYYYYYY.
Example:

623D6B28 10000000


7 Type
Format: 7XXXXXXXX 0000YYYY
Description: 16bit if less than.
Simple: If the value at address 0XXXXXXX is less than the value YYYY.
Example:

723D6B28 00005400


8 Type
Format: 8XXXXXXXX 0000YYYY
Description: 16bit if greater than.
Simple: If the value at address 0XXXXXXX is greater than the value YYYY.
Example:

823D6B28 00005400


9 Type
Format: 9XXXXXXXX 0000YYYY
Description: 16bit if equal to.
Simple: If the value at address 0XXXXXXX is equal to the value YYYY.
Example:

923D6B28 00005400


A Type
Format: AXXXXXXXX 0000YYYY
Description: 16bit if not equal to.
Simple: If the value at address 0XXXXXXX is not equal to the value YYYY.
Example:

A23D6B28 00005400


B Type
Format: BXXXXXXX 00000000
Description: Loads offset register.
Simple: Used for pointers, the address at 0XXXXXXX is the offset for all of the following lines.
Example:

B23D6B28 00000000
00002000 0001869F
D2000000 00000000


C Type
Format: C0000000 ZZZZZZZZ
Description: Repeat following lines at specified offset.
Simple: used to write a value to an address, and then continues to write that value Z number of times to all addresses at an offset determined by the (D6, D7, D8, or DC) type following it.
Note: used with the D6, D7, D8, and DC types. C types can not be nested.
Example:

C0000000 00000005
023D6B28 0009896C
DC000000 00000010
D2000000 00000000


D0 Type
Format: D0000000 00000000
Description: ends most recent conditional.
Simple: type 3 through A are all "conditionals," the conditional most recently executed before this line will be terminated by it.
Example:

94000130 FFFB0000
74000100 FF00000C
023D6B28 0009896C
D0000000 00000000


The 7 type line would be terminated.


D1 Type
Format: D1000000 00000000
Description: ends repeat block.
Simple: will end all conditionals within a C type code, along with the C type itself.
Example:

94000130 FFFB0000
C0000000 00000010
8453DA0C 00000200
023D6B28 0009896C
D6000000 00000005
D1000000 00000000


The C line, 8 line, 0 line, and D6 line would be terminated.


D2 Type
Format: D2000000 00000000
Description: ends all conditionals/repeats before it and sets offset and stored to zero.
Simple: ends all lines.
Example:

94000130 FEEF0000
C0000000 00000010
8453DA0C 00000200
023D6B28 0009896C
D6000000 00000005
D2000000 00000000


All lines would terminate.


D3 Type
Format: D3000000 XXXXXXXX
Description: sets offset.
Simple: loads the address X so that lines after can modify the value at address X.
Note: used with the D4, D5, D6, D7, D8, and DC types.
Example:

D3000000 023D6B28


D4 Type
Format: D4000000 YYYYYYYY
Description: adds to the stored address' value.
Simple: adds to the value at the address defined by lines D3, D9, DA, and DB.
Note: used with the D3, D9, DA, DB, DC types.
Example:

D4000000 00000025


D5 Type
Format: D5000000 YYYYYYYY
Description: sets the stored address' value.
Simple: makes the value at the address defined by lines D3, D9, DA, and DB to YYYYYYYY.
Note: used with the D3, D9, DA, DB, and DC types.
Example:

D5000000 34540099


D6 Type
Format: D6000000 XXXXXXXX
Description: 32bit store and increment by 4.
Simple: stores the value at address XXXXXXXX and to addresses in increments of 4.
Note: used with the C, D3, and D9 types.
Example:

D3000000 023D6B28


D7 Type
Format: D7000000 XXXXXXXX
Description: 16bit store and increment by 2.
Simple: stores 2 bytes of the value at address XXXXXXXX and to addresses in increments of 2.
Note: used with the C, D3, and DA types.
Example:

D7000000 023D6B28


D8 Type
Format: D8000000 XXXXXXXX
Description: 8bit store and increment by 1.
Simple: stores 1 byte of the value at address XXXXXXXX and to addresses in increments of 1.
Note: used with the C, D3, and DB types.
Example:

D8000000 023D6B28


D9 Type
Format: D9000000 XXXXXXXX
Description: 32bit load.
Simple: loads the value from address X.
Note: used with the D5 and D6 types.
Example:

D9000000 023D6B28


DA Type
Format: DA000000 XXXXXXXX
Description: 16bit load.
Simple: loads 2 bytes from address X.
Note: used with the D5 and D7 types.
Example:

DA000000 023D6B28


DB Type
Format: DB000000 XXXXXXXX
Description: 8bit load.
Simple: loads 1 byte from address X.
Note: used with the D5 and D8 types.
Example:

DB000000 023D6B28


DC Type
Format: DC000000 VVVVVVVV
Description: 32bit store and increment by V.
Simple: stores the value at address(es) before it and to addresses in increments of V.
Note: used with the C, D3, D5, D9, D8, DB types.
Example:

DC000000 00000100


E Type
Format:
EXXXXXXX UUUUUUUU
YYYYYYYY YYYYYYYY
Description: writes Y to X for U bytes.
Simple: writes the values at Y (Y can be any length) to addresses starting at X, for U. number of bytes.
Example:

E23D6B28 00000010
1244F2F2 02354653
23FEDA20 542FEBC0
D2000000 00000000


Special Codes: Built outsite the ARCode format, The Gateway Team have given us a little bonus.


DD Type
Format: DD000000 XXXXXXXX
Description: triggers the following code on single or combined keypress. Keypress code stops when terminated with D0 Type code. These can be stacked, i.e. A(01)+Left(20) would be 00000021

Keys:
0x00000001=A
0x00000002=B
0x00000004=Select
0x00000008=Start
0x00000010=Right
0x00000020=Left
0x00000040=Up
0x00000080=Down
0x00000100=R
0x00000200=L
0x00000400=X
0x00000800=Y

Example:

DD000000 00000021
1AE40233 000000FF
D0000000 00000000

Not Implemented: These codes are part of the ARCode format but have not been confirmed built by the Gateway Team.


F Type
Format: FXXXXXXX UUUUUUUU
Description: writes from the offset to address at X for U bytes.
Simple: writes from the offset (D3 type) to the address at X for U bytes.
Example:

D3000000 023D6B28
F23D6B2C 00000004
D2000000 00000000
This is what I found so hopefully this will help everyone who's a noob and dumb as soup. Can finally figure out what these commands do now :D
 
  • Like
Reactions: codemartin

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Ok, so I want to try to test something here and so far I am not getting it done right. Game just keeps crashing. So I need help. Here is what I have

00707EBC 00000050 <---This Code indicates how much damage I can do to a enemy per hit. If it is left at the value of 50 it basically registers as a MISS. Any value below 50 freezes the game for some reason.

So I want to control how much damage I can do to the enemy per hit. By either increasing or decreasing the value with buttons. For now I'm just focusing on getting the darn thing to increase by 1 value for now. So here is what I put in.

DD000000 00000004 <---Press Select to activate
D3000000 00707EBC <---Makes it so all lines below
00000000 00000001 <---This line states to increase the loaded address value from above line by 1
D0000000 00000000 <---The end

It looks like it may work but then when I press it in game, it freezes. Obviously I am doing something wrong so I can't seem to figure out what it is. Please help.
 

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Pretty sure that line should be a D-type
Probably D4
So D4000000 00000001
OMG thank you for a response. I felt as if I would never get help. So I have tried it and the game doesn't freeze however it still resorts to last value it was set on. It's as if the code does nothing now :(
 

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
Try ending it with a D2.
No change. It still reads it as if the code does nothing.

Also when I do this code

DD000000 00000008
D8000000 00707EBC
D0000000 00000000

It sets the value to 00. As soon as I hit something of course it crashes. Every time I activate the code via Select, it just keeps setting it to 0 never increasing the value. Is there a way to fix that? Also I have tried it with D2 and removing the third line completely. Still the same.
 

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
I finally got it to work. Yeesh this was hard.

Ok, so apparently D3000000 XXXXXXXX does not effect the value but the address. So when you put in D3000000 into it, any code lines below will have an addition to the address of the code below for example.

D3000000 00000001
00707EBC 00000050

what this is telling the gateshark to do is add 1 to the address offset not the value offset. So it is basically changing your code into

00707EBD 00000050

Same way if you have done it like this

D3000000 10000000
00707EBC 00000050
0A55443D 0000FFFF

In reality it is just changing the codes to

10707EBC 00000050
1A55443D 0000FFFF

So what really need is something that reads it so here is my code

DD000000 00000008 <---Press Start to Activate
DB000000 00707EBC <---Read the value from that address and store it (in this case DB000000 reads only the 8 byte which is 50, not as 0050 or 00000050)
D4000000 00000001 <---Increase the stored value (50) by the value written in D4000000 (in this case 1)
D8000000 00707EBC <---Write the stored value (51) to the address specified (in this case D8000000 writes only the 8 bytes which is 51, so if you need it to write where it's greater than 8 bytes then use D6 or D7)
D2000000 00000000 <---End current code and erase stored value

There we go now it increases value by 1. If I want to change it where it subtracts 1 then I simply change the third code line to D4000000 FFFFFFFF
 

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
D8 Writes the 'Dx data' byte to [XXXXXXXX+offset], and increments the offset by 1.

You didn't have the Dx data set. That can be done using D9, DA, or DB. See: http://doc.kodewerx.org/hacking_nds.html
Where were you three days ago? I spent a good amount of my weekend trying to noobishly think on what I was doing wrong :(
Thanks for the link!
 
  • Like
Reactions: DarkFlare69

kado2999

Active Member
OP
Newcomer
Joined
Jul 15, 2013
Messages
26
Trophies
0
Age
39
XP
135
Country
United States
So I am curious, why would I ever need to use D3000000 if all it does is just change my address offset? I've seen some people use D3000000 but why would you use it if you can just physically add it to the address itself?
 

Samueladi

Active Member
Newcomer
Joined
Apr 25, 2016
Messages
38
Trophies
0
Age
27
XP
236
Country
Indonesia
Hello, i want to ask about this code.

This is the code (gateshark) for Fire Emblem Awakening
All enemy item drop
00199848 E1D11AB2
0019984C E3510000

I would like to ask for the
E1D11AB2 and E3510000. What does the E1 and E3 stand for? Thanks :D
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Lol