Welcome, Guest!

Here are some links you may find helpful

MD aladdin sega genesis (1993)- hacking notes

Metal64

Member
Original poster
Aug 3, 2022
14
14
3
I've hacked the original aladdin for sega genesis (1993) extensively for yearss, so I decided to share my findings in here.

-----------------------------------------------------------------------------------------------
initial quantities of lifes in practice mode
0x1b0048
00 35

initial quantities of lifes in normal mode
0x1b0056
00 33

initial quantities of lifes in difficult mode
0x1b0064
00 32

initial quantities of apples in practice mode
0x1aa670
31 35

initial quantities of apples in normal mode
0x1aa67e
31 30

initial quantities of apples in difficult mode
0x1aa68c
30 35

initial quantities of gems (all mode)
0x1aa666
30 30

In the game, the aladdin's life limit is "9" (00 39).
Example: If you want to change the initial life amount in the normal mode from "3" to "7", you will need to use "00 37". Do not use "30 37" (07), as this will glitch the amount of life

apples and gems have a limit of "99" (39 39).

dec to hex
08 = 30 38
18 = 31 38
32 = 33 32
99 = 39 39
--------------------------------------------------------------------------------------------------------------------------

Commands

"START"
Code:
1b3208  0839000500FFF155    BTST #$ 5, $FFF1555.1
1b3219  4e75    rts

"UP"
Code:
1b3212  0839000000FFF156    BTST #$ 0, $FFF1556.1
1b321A 4e75    rts

"DOWN"
Code:
1b321C 0839000100FFF156    BTST #$ 1, $FFF1556.1
1b3224 4e75    rts

"LEFT"
Code:
1b3216 0839000200FFF156    BTST #$ 2, $FFF1556.1
1b322E 4e75    rts

"RIGHT"
Code:
1b3230 0839000300FFF156    BTST #$ 3, $FFF1556.1
1b3238 4e75    rts

"A"
Code:
1b323A 0839000400FFF155    BTST #$ 4, $FFF1555.1
1b3242 4e75    rts

"B"
Code:
1b3244 0839000400FFF156    BTST #$ 4, $FFF1556.1
1b324C 4e75    rts

"C"
Code:
1b324E 0839000500FFF156    BTST #$ 5, $FFF1556.1
1b3256 4e75    rts

Entities Data
Code:
00 - nothing
01 - flagpole
02 -
03 - iago
04 - boss iago
05 - bats
06 - pot thrower
07 - snake 2 stage
08 -
09 -
0a - knife juggler
0b - fish
0c - shiva statue
0d -
0e - snake charmer
0f - snake of the snake charmer
10 - Razoul
11 - cobra jaffar
12 - jaffar
13 - Gazeem
14 - apple thief
15 - stealing apple (power of the apple thief)
16 - skeleton
17 - ghost
18 - cave boss (5 stage)
19 -
1a - red statue
1b -
1c -
1d -  Fazahl
1e - Zagoolien
1f - Hakim
20 -
21-
22 -
23 - pot that give you gem
24 -
25 -
26 -
27 -
28 -
29 - release abu
2a - pot of the pot thrower
2b - 3 stage key to market
2c - spit of the fish
2d - all knifes
2e - projectile of the shiva statues
2f - barrel
30 - fire of cave boss
31 - bones
32 - lava splash
33 -
34 - genie tokens
35 - apples
36 - black lamp
37 - magic lamp (5th stage)
38 -
39 -
3a - gem
3b - gem in the pot
3c - level complete
3d - scrab 1 (2 stage)
3e - scrab dust
3f - scrab halve cutscene
40 - apples
41 - abu token
42 - apples slice
43 - checkpoint
44 - genie heart
45 -
46 - life
47 - flute
48 - flute
49 - flute
4a - flute
4b - flute
4c - flute
4d - jaffar tractor
4e - genie hands spring
4f - genie spring
50 - genie ballon explode
51 - genie ballon ?
52- stationary genie hand plataform
53- rotary genie hand plataform
54- giant rock (rug ride stage)
55- falling block stage 2
56-
57-
58- disappearing blocks
59- spawn ghost
5a-
5b-
5c-
5d-
5e- magic carpet
5f- magic carpet lying down (9 stage)
60- magic carpet (7 stage)
61-
62- plataform sink
63-
64-
65- camel
66-
67- flamingo
68-
69- plataform
6a-
6b-
6c-
6d -
6e-
6f-
70- block
71-
72-
73-
74- plataform cave (waterfall)
75-
76- falling platafom cave
77-
78-
79- spike in the ground (2 stage)
7a-
7b- fire of the cobra jaffar
7c- pot that contain the magic rope
7d- giant rock
7e- peddler’s stall
7f- spit dromedary
80-
81-
82-
83- aladdin
84-
85-
86-
87- merchant
88-
89- rocks of cave plataform
8a- cave boss 1º plataform
8b- cave boss 2º plataform
8c- fire in charcoal
8d-
8e-
8f-
 
  • Like
Reactions: Americandad

Metal64

Member
Original poster
Aug 3, 2022
14
14
3
here is the level order table, credits go to the user Billytime at the gamehacking.org for find it

At offset 004080 in the usa version lies a level order table.
Here is the list of levels:
01 - Agrabah Market
02 - Abu In Agrabah
03 - The Desert
04 - Sultan's Dungeon
05 - Cave of Wonders
06 - Abu In The Cave
07 - The Escape
08 - Rug Ride
09 - Inside The Lamp
0A - Sultan's Palace
0B - Jafar's Palace
0C - Final Boss
0D - Give Up Street Rat (Game Over)

---------------------------------------------------------------------------------------
Sound address

122db5 - flagpole
1b32a5 - menu change
1a9c73 - head pop
1b1353 - ne naw tune (music of preview level)
1af48b - apples
1af24b - gem
1b0d9d - music level complete
1b5199 - apu bonus level music
1abef9 - apple splat
1b5689 - pole slide
1acd3f - flamingo hey!
1acd1b - flamingo hey 2
1add93 - rock bounce
1a9473 - out of apples
1af3d7 - abu tokens
1af4ed - genie tokens
1aeeef - genie heart
1abe9f - sword ching (knife juggler, Fazahl, Razoul, Gazeem)
1ae5a9 - aladdin hurt
1ae699 - continue point (checkpoint)
1a96c5 - low sword
1aecab - gazeem hit 1
1ac209 - gazeem hit 2
1a944f - object throw
--------------------------------------------------------------------------------------------
sound data
Code:
00 - high sword
01 - low sword
02 - no sound (probably silent lamb)
03 - object throw
04 - menu select
05 - flagpole
06 - menu change
07 - head bop
08 - wall hit 2
09 - cloud poof
0a - ne naw tune
0b - apple collect
0c - apple slice
0d - gem collect
0e - jaffar laugh
0f - arab rock 1
10 - arabic rock 2
11 - music level complete
12 - bonus level music
13 - scarab wow
14 - one jump ahead
15 - music stage 1
16 - turban jazz
17 - remove music
19 - music reset
1a - new world
1b - friend like me   
1c - friend like me 2 
1d - rug ride
1e - rug ride 2
1f - ballon pop
20 - sword spinning
21 - sword ching
22 - apple splat
23 - gloomy tune
24 - gloomy tune
25 - gloomy tune
26 - camel jazz
27 - pole slide
29 - rope launch
2a - genie fumes
2b - guards pants
2c - rope appear
2d - yago squawk
2e - honk
2f - landing ooof
31 - aladdin hurt
32 - boss tune
33 - boss tune
34 - boss tune
35 - boss tune
36 - boss tune
37 - skeleton explosion
38 - bones tinkle
39 - clay pot
3a - boxing bell
3b - aladdin push
3c - splash
3d - camel spit
3e - guard beckon
3f - canopy bounce
40 - flamingo hey!
41 - guard hit
42 - guard hit 2
43 - geyser
44 - flamingo hey 2
45 - stone rumble
46 - spring doing 1
47 - spring doing 2
48 - cash registery
49 - prince ali
4a - prince ali 2
4b - honk
4c - fire from coal
4d - stones crumbels
4e - wall spikes
4f - tip toe
50 - rock bounce
51 - out of apples
52 - arabian nigths
53 - earthquake
54 - storytine
55 - drama
56 - mushy one
5a - stopping
5b - win a bonus
5c - starting gun
5d - abu uh oh
5e - oooo
5f - ahhh
60 - eeee
61 - iiee
62 - extra health
63 - continue point (checkpoint)
64 - scarab pickup
65 - body crunch
66 - yeahh
67 - flute pickup
68 - jaffar tractor
69 - wow
6a - gazeem hit 1
6b - gazeem hit 2
6c - jaffar snake
6d - peddle shop
6e - abu waving
70 - coming  out of the checkpoint sound
71 - honkey sound
73 - cloud poof
 
  • Like
Reactions: Americandad

Metal64

Member
Original poster
Aug 3, 2022
14
14
3
the list of the entities function
Code:
0x1CC2
flagpole
00 1A FD 84
 
0x1CC6
00 1A FF 82
 
0x1CCA
iago
00 1A ED 86
 
0x1CCE
boss iago
00 1A ED A6
 
0x1cd2
bat
00 1A E9 C6
 
0x1CD6
pot thrower
00 1A E9 DA
 
0x1CDA
green snake
00 1A E9 C6
 
0x1CDE  solid?
00 1A E7 22
 
0x1CE2
00 1A E7 22
 
0x1CE6
knife juggler
00 1A E9 C6
 
0x1CEE
statue
00 1A E9 A8
 
0x1CF2
00 1A EB 7A
 
0x1CF6
snake of the snake charmer
00 1A E9 C6
 
0x1CFA
snake charmer
00 1A E9 DA
 
0x1CFE
Razoul
00 1A E9 C6
 
0x1D02
jaffar cobra
00 1A F1 10
 
0x1D06
jaffar
00 1A F1 10
 
0x1D0A
?
00 1A E9 C6
 
0x1D0E
apple thief
00 1A EB FE
 
0x1D12
apple thief
00 1A E9 78
 
0x1D16
skeleton
00 1A E9 C6
 
0x1D1A
ghost
00 1A E9 C6
 
0x1D1E
monkey statue red
00 1A EA 48
 
0x1D22
monkey statue red
00 1A EA 48
 
0x1D26
monkey statue red - first
00 1A E9 E0
 
0x1D2A
monkey statue second
00 1A EA 00
 
0x1D2E
monkey statue red - last
00 1A EA 24
 
0x1D32
Fazahl
00 1A E9 C6
 
0x1D36
Zagoolien (hurt by charcoal)
00 1A E7 96
 
0x1D3A
hakim normal
00 1A E7 96
 
0x1D4E
Fazahl
00 1A E9 C6
 
0x1D42
Zagoolien normal
00 1A E7 96
 
0x1D46
hakim standing still
00 1A E7 96
 
0x1D4A
pot that give you gem
00 1A EE CA
 
0x1D4E
?
00 1A EE DE
 
0x1D62
save abu
00 1A F4 00
 
0x1D66
pot
00 1A E9 C6
 
0x1D6A
?
00 1A EB FE
 
0x1D6E
fish spit
00 1A EE 40
 
0x1D72
projectile of knife juggler, Fazahl, Gazeem, Razoul
00 1A EE 40
 
0x1D76
statue projectile
00 1A EE 40
 
0x1D7A
barrel
00 1A ED A8
 
0x1D7E
fire of cave boss
00 1A EE 18
 
0x1D82
skeleton bones
00 1A EE 40
 
0x1D86
lava splash
00 1A EB 7C
 
0x1D8A
?
00 1A F4 A0
 
0x1D8E
genie tokens
00 1A F4 D8
 
0x1D92
?
00 1A F4 68
 
0x1D96
black lamp
00 1A F5 16
 
0x1D9A
3 scrab of the 2 stage
00 1A F3 44
 
0x1D9E
give 150 points
00 1A F4 A0
 
0x1DA2
give 150 points
00 1A F4 A0
 
0x1DA6
gem
00 1A F2 28
 
0x1DAA
gem in the pot
00 1A F2 1E
 
0x1DAE
beat the level
00 1A F3 44
 
0x1DB2
mil pontos  (genie lamp)
00 1A F3 84
 
0x1DB6
scrab
00 1A F2 B0
 
0x1DBA
scrab
00 1A F2 FA
 
0x1DBE
apple
00 01 F4 68
 
0x1DC2
abu token
00 1A F3 C2
 
0x1DC6
apple slice
00 1A F2 64
 
0x1DCA
checkpoint
00 1A E6 4C
 
0x1DCE
genie hearth
00 1A EF 12
 
0x1DD2?
00 1A EE E0
 
0x1DD6
life
00 1A EF 5C
 
0x1DDA
flute next to the apple thief
00 1A EF B0
 
0x1DDE
flute next to Zagoolien 1
00 1A EF DC
 
0x1DE2
flute next to Zagoolien 2
00 1A F0 08
 
0x1DE6
last flute
00 1A F0 34
 
0x1DEA
the penultimate flute (optional)
00 1A F0 60
 
0x1DEE
first flute
00 1A F0 8C
 
0x1DF2
jaffar tractor
00 1A F0 B8
 
0x1DF6
genie hand spring
00 1A FC D2
 
0x1DFA
genie spring
00 1A FC 4E
 
0x1DFE
genie ballon
00 1A F8 F6
 
0x1E02
genie ballon
00 1A F8 F6
 
0x1E06
stationary genie hand plataform
00 1A F7 9E
 
0x1E0A
rotary genie hand plataform
00 1A F7 9E
 
0x1E0E
giant rock of the rug ride
00 1A F7 F2
 
0x1E12
falling block desert stage (1)
00 1A F5 90
 
0x1E16
falling block desert stage (2)
00 1A F5 90
 
0x1E1A
disappearing blocks (sultan dungeon)
00 1A F5 90
 
0x1E1E
disappearing blocks (sultan dungeon)
00 1A F5 90
 
0x1E22
spawn ghost
00 1A E9 C6
 
0x1E26
?
00 1A F5 3E
 
0x1E2A
00 1A F5 4A
 
0x1E2E
00 1A F5 56
 
0x1E32
00 1A F5 62
 
0x1E36
?
00 1A F6 38
 
0x1E3A
?
00 1A F6 AC
 
0x1E3E
00 1A F6 DC
 
0x1E42
00 1A F6 DC
 
0x1E46
plataform sink
00 1A F8 1C
 
0x1E4A
plataform sink
00 1A F8 1C
 
0x1E4E
00 1A F8 94
 
0x1E52
dromedary
00 1A FB F4
 
0x1E56
last dromedary
00 1A FB F4
 
0x1E5A
flamingo
00 1A F7 40
 
0x1E5E
flamingo
00 1A F7 40
 
0x1E62
00 1A F9 78
 
0x1E66
falling plataform (Agrabah Market)
00 1A F9 78
 
0x1E6A
falling plataform (Agrabah Market)
00 1A F9 78
 
0x1E6E
secret plataform (Agrabah Rooftops)
00 1A F9 78
 
0x1E72
?
00 1A EE 40
 
0x1E76
magic rope
00 1A FB 36
 
0x1E7A
magic rope
00 1A FB 36
 
0x1E7E
magic rope
00 1A FB 36
 
0x1E82
magic rope
00 1A FB 36
 
0x1E86
magic rope
00 1A FB 36
 
0x1E8A
magic rope
00 1A FB 36
 
0x1E8E
plataform waterfall
00 1A FA 84
 
0x1E92
waterfall
00 1A FA 84
 
0x1E96
plataform cave
00 1A F9 F6
 
0x1E9A
plataform cave (falling)
00 1A F9 F6
 
0x1E9E
chain ball
00 1A EB DC
 
0x1EA2
spike in the ground (desert)
00 1A EB 7C
 
0x1EA6
spike wall
00 1A EB DC
 
0x1EAA
fire of the cobra jaffar
00 1A E9 D4
 
0x1EAE
pot that contain the magic rope ?
00 1A E9 C6
 
0x1EB2
giant rock
00 1A EB A4
 
0x1EB6
peddler’s stall
00 1A FE 1C
 
0x1EBA
?
00 1B 65 BE
 
0x1EBE
not solid
00 1A BF 9A
 
0x1EC2
apple splat
00 1A BF 8E
 
0x1EC6
iago hit by projectiles
00 1A C0 EE
 
0x1ECA
iago boss hit by projectiles
00 1A C1 02
 
0x1ECE
bat hit by projectiles
00 1A C1 B4
 
0x1ED2
pot trower hit by projectiles
00 1A C4 58
 
0x1ED6
green snake hit by projectiles
00 1A C4 58
 
0x1EDA
? splat
00 1A BF 8E
 
1EDE
?
00 1A BF 8E
 
0x1EE2
knife juggler hit by projectiles
00 1A C4 58
 
0x1EE6
fish hit by projectiles
00 1A C4 58
 
0x1EEA
statue hit by projectiles
00 1A C4 58
 
0x1EEE
? falling
00 1A C6 0E
 
0x1EF2
snake charmer hit by projectiles
00 1A C4 58
 
0x1EF6
snake of the snake charmer hit by projectiles
00 1A C4 58
 
0x1EFA
Razoul hit by projectiles
00 1A C2 BC
 
0x1EFE
cobra jaffar hit by projectiles
00 1A C4 E8
 
0x1F02
jaffar hit by projectiles
00 1A C4 E8
 
0x1F06
gazee dying hit by projectiles
00 1A C1 D0
 
0x1F0A
apple splat
00 1A C6 14
 
0x1F0E
apple thief hit by projectiles
00 1A C4 58
 
0x1F12
skeleton hit by projectiles
00 1A C4 58
 
0x1F16
ghost hit by projectiles
00 1A C4 58
 
0x1F1A
sub boss (5th stage) hit by projectiles
00 1A C4 DE
 
0x1F1E
sub boss (5th stage) hit by projectiles when he in the air
00 1A C4 DE
 
0x1F22
1 monkey statue hit by projectiles
00 1A C4 08
 
0x1F26
2 monkey statue hit by projectiles
00 1A C4 32
 
0x1F2A
3 monkey statue hit by projectiles
00 1A C4 44
 
0x1F2E
Fazahl hit by projectiles
00 1A C3 50
 
0x1F32
Zagoolien walking hit by projectiles
00 1A C3 18
 
0x1F36
Hakim walking hit by projectiles
00 1A C2 E0
 
0x1F3A
Fazahl (stationary)
00 1A C3 50
 
0x1F3E
Zagoolien (stationary) hit by projectiles
00 1A C3 34
 
0x1F42
Hakim (stationary) hit by projectiles
00 1A C2 FC
 
0x1F46
pot that give you gem hit by projectiles
00 1A BF F0
 
0x1F4A
?
00 1A C0 3E
 
0x1F4E
?
00 1A C0 5A
 
0x1F52
?
00 1A C0 76
 
0x1F56
? 150 points
00 1A C0 7C
 
0x1F5A
? save abu
00 1A C0 98
 
0x1F5E
00 1B 65 BE
 
0x1F62
pot hit by projectiles
00 1A C4 58
 
0x1F66
3 stage key to market hit by projectiles
00 1A C6 3C
 
0x1F6A
00 1B 65 BE
 
0x1F6E not solid
all knifes hit by projectiles
00 1A C6 A2
 
0x1F72
projectile of the shiva statues hit by projectiles
00 1A C6 A2
 
0x1F76 not solid
barrel hit by projectiles
00 1A C6 76
 
0x1F7A
fire of the sub boss (5th stage) hit by projectiles
00 1A C6 82
 
0x1F7E
Bones hit by projectiles
00 1A C6 A2

I gonna try to explain what this list is about:
let's take a look in the offset "0x1dbe"
Code:
00 1a f4 68     ori.b      #0x68,(A2)

This code it is referent to the apples function (when you touch a apple you gain 1 apple)

now let's go to the offset "0x1d96"
Code:
00 1a f5 16     ori.b      #0x16,(A2)+

This is the code for the black lamp, when you touch it, the lamp explodes and damages nearby enemies

Now let's go again to the "0x1dbe" offset and change the values of "00 1a f4 68" to "00 1a f5 16". With this change every time that you pick up an apple it will explode like a black lamp. We can change all the entities function with this logic. We can make a projectile of a enemie restore our health, make an enemy sell you items or even make an item like an apple damage you.

more examples:




Everything from 0x06AA to 0x1F81 is actually a huge list of ROM locations.
Some of those offsets (e.g. those that you have found) are pointing to code, which can be disassembled.
 
  • Like
Reactions: Americandad

Metal64

Member
Original poster
Aug 3, 2022
14
14
3
Btw I also made tons of game genie code for this game

here are the codes in case you wanna test them
 
  • Like
Reactions: Americandad

Metal64

Member
Original poster
Aug 3, 2022
14
14
3
So, I was trying to change the spikes on the ground (2 stage) to the green snake, using the method above, but the result was this:
green_snake_bad.gif


technically the spikes are acting like the green snake, but as we can see the sprites arent right.

well, as I previously point out, the offset for the spike on the ground is "1B8250". So, I decided search in the rom for "1B 82 50" as hexadecimal values... the result lead me in the offset "1B6F21"

Code:
001b6f1e 4d f9 00 1b 82 50      lea        (LAB_001b824e+2).l,A6
        001b6f24 61 00 e3 38     bsr.w      FUN_001b525e
        001b6f28 66 08           bne.b      LAB_001b6f32
        001b6f2a 2b 7c 00 12 5a 4c  00 20     move.l     #DAT_00125a4c,(0x20,A5)

If we go to the offset 1B6F21 and change the hex values "1b 82 50" to "1B 80 70" and then we go to the offset 1B6F2D and change the hex values "12 5A 4C" to "12 52 F0", we gonna obtain the desired result.

green_snake_good.gif


I dont know why in the case of the spikes on the grounds we can't use the same method that I used to turn the green snake in iago, but this new method works fine.
 

Make a donation