Bad Dudes (NES) - RAM

From ROM Detectives Wiki
Jump to navigation Jump to search
Label-Main.svgLabel-RAM.svgLabel-ROM.svgLabel-Text.svgLabel-Lua.svg


USA

USA

Bad Dudes - NES - USA.png

Memory Addresses

0100 - Hi Score: x65536
0101 - Hi Score: x256
0102 - Hi Score: x1
010A - Starting Lives/Continues
0204 - Time (00-63) Note: Going above 63 crashes the game.
0205 - P1 Score: x65536
0206 - P1 Score: x256
0207 - P1 Score: x1
0208 - P2 Score: x65536
0209 - P2 Score: x256
020A - P2 Score: x1
0221 - Controller 1 Poll
0223 - Controller 1 Poll
0227 - Power Punch Charging (00-2B) At 2B you're fully charged
023F - Blade / Striker Flag (1 player is 0/1, 2 player is 8D-8C)
02A2 - Weapon
	00  - Fists
	01  - Nunchucks
	02  - Knife
	03  - Bug: Hold knife, but attack with nunchucks
	04+ - Bug: Same as 3, but you always duck when you attack
02A3 - Player Direction (00-Right, 80-Left)
02A4 - Player Y Position x1
02A5 - Player Y Position x256 (Not Used)
02A6 - Player X Position x1
02A7 - Player X Position x256
02A8 - Player Jump Counter
02A9 - Player State
	00 - Idle
	01 - Walking
	02 - Punching Done (Fore Arm)
	05 - Picking Up Item Done
	0B - Back Kicking Done
	0C - Looking Up
	0A - Kicking Done
	11 - Landing
	12 - Landing From Jump Kick
	13 - Landing From Spin Kicking
	13 - Landing From Jumping Up
	18 - Landing From Jumping Down
	19 - Charged
	1A - Walking While Charged
	1E - Standing
	20 - Ducking
	24 - Punching Done (Back Arm)
	82 - Punching (Fore Arm)
	84 - Attacking
	8A - Kicking
	8B - Back Kicking
	8D - Punching Up
	90 - Picking Up Item
	91 - Jumping
	92 - Jump Kicking
	93 - Spin Kicking
	94 - Jumping Up
	95 - Injured
	98 - Jumping Down
	9B - Charged Punching
	A4 - Punching (Back Arm)
02AB - Hit Points (00-0B)
02AC - Player In Air Flag (00-No, 01-Yes)
02B8 - Player Sprite Frame Flipping (03-Right, 43-Left)
02B9 - Player Sprite Frame
02BA - Controller 1 Poll (Only during stages)
02BE - Current Lives (this value overwrites lives when a player dies)
02BF - Continues
02EA - P1 Lives
0316 - P2 Lives

Object Struct
0326 - Sprite mirroring?
0327 - Attack type?
0328 - Y Pos x1
0329 - Y Pos x256 (Not used)
032A - X Pos x1
032B - X Pos x256
032C - Enemy Action (See Table)
032D - Animation Frame
032E - Unknown (Read Only)
032F - Hit Points (Usually bosses)
0330 - Unused?
0331 - Frame offset ?
0332 - Frame offset ?
0333 - ? Affects direction
0334 - ?
0335 - Y position to jump to?
0336 - ?
0337 - Unused?
0338 - Counter used in jumping
0339 - Flag for floor level (00 - Ground, 01 - Top)
033A - Unused?

033B-034F - Object 2
0350-0364 - Object 3
0365-0379 - Object 4
037A-038E - Object 5
038F-03A3 - Object 6
03A4-03B8 - Object 7
03B9-03CD - Object 8
03CE-03E2 - Object 9

Every object, except for the player, counts 

0700-07FF - PPU memory

Enemy Actions

The various actions that enemies and objects perform.

01 - Blue Walking
03 - Blue Ninja Jumping
05 - Blue Injured
07 - Gray Ninja Walking
09 - Gray Ninja Jumping
0D - Red Ninja Jumping
0F - Red Ninja Injured
11 - Blue Idle
15 - Red Ninja Standing
17 - Green Ninja Walking
18 - 
19 - Crash
1A - 
1B - 
1C - 
1D - Green Ninja Injured
1E - 
1F - Coca-Cola
21 - Knife
23 - Nunchucks
25 - Gray Begin Throw High
27 - Gray Throw Caltrop
29 - Cave Stalactite
2B - Cave Stalactite Breaking
2D - Clock
2F - Blue Ninja Punching
31 - Blue Injured
32 - Gray Ninja Throw Low
33 - Gray Ninja Begin Throw Low
34 - Duck Injured
35 - Red Ninja Walking
36 - Red Ninja Punching
37 - Green Swordsman Walking
39 - Green Swordsman Jumping
3A - Green Swordsman Injured
3B - Green Swordsman Attack High
3C - Green Swordsman Begin Attack High
3D - Swordsman Walking
3F - Gray Swordsman Jumping
40 - Swordsman Injured
41 - Gray Swordsman Attacking Low
42 - Gray Swordsman Injured Low
44 - Girl Walking
45 - Girl Jumping
46 - Girl Injured
47 - Girl Flipping
48 - Red Girl Attacking
49 - Blue Girl Kicking
4A - Karvov Walking
4B - Karnov Punching
4C - Karnov Kicking
4D - Karnov Jumping
4E - Karnov Breathing Fire
4F - Karnov Injured
50 - Karnov Breathing Fire While Ducking
52 - Karnov Flipping
53 - Karnov Dying
54 - Dwarf Boss Walking
55 - Dwarf Boss Blocking
56 - Dwarf Boss Jumping
57 - Dwarf Boss Jumping
58 - Dwarf Boss Attacking
59 - Dwarf Boss Injured
5A - Dwarf Boss Dead
5B - Giant Boss Walking
5C - Giant Boss Punching
5E - Giant Boss Arm Drop
5F - Giant Boss Jumping
60 - Giant Boss Spinning
62 - Giant Boss Injured / Dead
63 - Chain Boss Standing
64 - Chain Boss Walking
68 - Chain Boss Punching
69 - Chain Boss Attacking High
6A - Chain Boss Attacking Low
6C - Chain Boss Jumping
6E - Chain Boss Injured / Dead
6F - Bo Boss Walking
70 - Bo Boss Kicking
73 - Bo Boss Spinning
74 - Bo Boss Injured
75 - Bo Boss Dead
76 - Dragon Boss Standing / Walking
77 - Dragon Boss Attacking
7D - Green Karnov Walking
7E - Green Karnov Punching
7F - Green Karnov Kicking
80 - Green Karnov Jumping
81 - Green Karnov Breathing
82 - Green Karnov Injured
83 - Green Karnov Breathing While Ducking
84 - Green Karnov Flipping
85 - Green Karnov Breathing
86 - Green Karnov Dead
87 - Red Giant Boss Walking
88 - Red Giant Boss Punch
8A - Red Giant Boss Arm Drop
8B - Red Giant Boss Jumping
8C - Red Giant Boss Spinning
8E - Red Giant Boss Injured / Dead
8F - Green Ninja Duck Punch
93 - Green Ninja Punching
95 - Girl Standing
96 - Giant Boss Kicking
97 - Red Giant Boss Kicking
98 - Bo Boss Dropping
99 - Blue Ninja Kick
9A - Blue Jump Kick
9C - Gray Ninja Begin Throw High
9B - Gray Ninja Throw High
9D - Red Ninja Walking
9E - Red Ninja w/Nunchucks Attacking
9F - Red Ninja w/Knife Walking
A0 - Red Ninja w/Knife Attacking
A1 - Red Ninja w/Nunchucks Standing
A2 - Red Ninja w/Knife Standing
A3 - Flame Man Running
A4 - Flame Man Standing
A5 - Flame Man Injured
A6 - Dwarf Ninja Walking
A8 - Dwarf Ninja Flipping
A9 - Dwarf Ninja Injured
AA - Dwarf Ninja Attacking
AB - Dwarf Ninja Idle
AC - Gray Dwarf Walking
AD - Gray Dwarf Preparing to Jump Up
AE - Gray Dwarf Flipping
AF - Gray Dwarf Injured
B0 - Gray Dwarf Jump Attack
B1 - Gray Dwarf Standing
B2 - Dog Running
B3 - Dog Looking
B4 - Dog Attacking
B5 - Dog Injured
B6 - Elevator Opening
B7 - Elevator Closing
B9 - Green Ninja Jumpkick
BA - Green Ninja Flipping
BB - Green Ninja Multiplying
BE - Blue Ninja On Pole
C1 - Karnov Fire
C2 - Green Ninja Standing
C3 - Green Ninja Jumping
C6 - Crash

Code

Starting Lives/Continues

This is an excerpt from the game's start up routine where the initial lives and continues are set.

A2FE:A9 03     LDA #$03          ; Load $#03 into A.
A300:8D 0A 01  STA $010A         ; Store A into the Starting Lives/Continues memory space.

Initial Player Info

This routine is called at the beginning of the first level.

C87F:AD 0A 01  LDA $010A         ; Load Starting Lives/Continues into A.
C882:8D BE 02  STA $02BE         ; Store A into Current Player Lives.
C885:8D BF 02  STA $02BF         ; Store A into Continues.
C888:A9 0A     LDA #$0A          ; Load $#0A into A.
C88A:8D AB 02  STA $02AB         ; Store A into Hit Points.
C88D:20 FB C5  JSR $C5FB
C890:20 09 C6  JSR $C609
C893:60        RTS

Next Player

This routine is called after a player dies, and the player needs to be reset.

C5CF:A9 0A     LDA #$0A          ; Load $#0A into A.
C5D1:8D AB 02  STA $02AB         ; Store A into Hit Points.
C5D4:A9 00     LDA #$00          ; Clear A.
C5D6:8D A2 02  STA $02A2         ; Clear the Weapon.
C5D9:8D A3 02  STA $02A3         ; Set Player Direction to right.
C5DC:8D AC 02  STA $02AC         ; Set Player's In Air to ground.
C5DF:20 8F D6  JSR $D68F
C5E2:A9 01     LDA #$01
C5E4:60        RTS

Grabbing Coke

When you grab a coke, you are given 5 extra hit points, but you can't go higher than 10.

87D4:A9 05     LDA #$05          ; Load A with #$05 (Hit Points to Gain)
87D6:18        CLC               ; Clear Carry Flag
87D7:6D AB 02  ADC $02AB         ; Add A to Hit Points
87DA:C9 0A     CMP #$0A          ; If Hit Points <= #$0A Then
87DC:90 02     BCC $87E0         ; Goto $87E0
87DE:A9 0A     LDA #$0A          ; Load A with #$0A
87E0:8D AB 02  STA $02AB         ; Store A into Hit Points.

Load Enemy HP

89A8:B9 83 90  LDA $9083,Y       ; Load from Enemy HP Table, offset Y.
89AB:9D 2F 03  STA $032F,X       ; Store HP into current enemy.

Enemy HP Table

This table contains the hit points of all of the enemy ninjas and bosses.

9083 -    - ?
909A - 02 - Gray Ninja - Caltrops
909C - 02 - Gray Ninja - High Star
909E - 02 - Gray Ninja - Low Star


Japan

Japan

Bad Dudes - NES - Japan.png


Japan (Rev A)

Japan (Rev A)

Bad Dudes (Rev A) - NES - Japan.png

Memory Addresses

0204 - Time
0205 - P1 Score x65536
0206 - P1 Score x256
0207 - P1 Score x1
0292 - Weapon
	00  - Fists
	01  - Nunchucks
	02  - Knife
	03  - Hold knife, but attack with nunchucks
	04+ - Same as 3, but you always duck when you attack
029B - Hit Points
02AE - Lives P1
031F - Enemy 1 Hit Points (Usually bosses)
0334 - Enemy 2 Hit Points
0349 - Enemy 3 Hit Points
035E - Enemy 4 Hit Points
0373 - Enemy 5 Hit Points


Europe

Europe

Bad Dudes - NES - Europe.png

Memory Addresses

0204 - Time
0205 - P1 Score x65536
0206 - P1 Score x256
0207 - P1 Score x1
02A2 - Weapon
	00  - Fists
	01  - Nunchucks
	02  - Knife
	03  - Hold knife, but attack with nunchucks
	04+ - Same as 3, but you always duck when you attack
02AB - Hit Points
02BE - P1 Lives
0328 - Elevator Y
032F - Enemy 1 Hit Points (Usually bosses)
0344 - Enemy 2 Hit Points
0359 - Enemy 3 Hit Points
036E - Enemy 4 Hit Points
0383 - Enemy 5 Hit Points