Shadowgate

From NES Hacker Wiki
Jump to: navigation, search

Shadowgate is a puzzle game with a high-fantasy Medieval theme based on the original Macintosh game. You play a knight who must enter the castle Shadowgate to stop an evil wizard from summoning the Behemoth. It plays just like Deja Vu and Uninvited.

Easy Cheats

Icon Addr Val Cmp Description
Icon-Time.png 04F4 FF - Torch Lasts Forever
Icon-Armor.png 04FA 00 - Shield Won't Melt
How do I use these?

North America

Shadowgate.png

Memory Addresses

0076 - Cursor X
0077 - Cursor Y

00AB - Cursor X
00AC - Cursor Y

00AF - Cursor Position
	00 - Look
	01 - Open
	02 - Use
	03 - Leave
	04 - Take
	05 - Close
	06 - Hit
	07 - Speak
	08 - Card Up
	09 - Card Down
	0A - Self
	0B - Save
	0C-12 - Goods from top to bottom
	13 - Move
	14 - Torch Left
 	15 - Torch Right
	16 - View Window
	17 - View Window From Move
	18 - ?
	19 - Move Window

00B2 - Command Selected
	00 - Look
	01 - Open
	02 - Use
	03 - Leave
	04 - Take
	05 - Close
	06 - Hit
	07 - Speak
	08 - Move
	FF - Empty

00F5 - Controller 1 Poll Press
00F7 - Controller 1 Poll Down

0200-02FF - Sprite Memory

0496-04DB - Goods (See Goods List)

04F4 - Torch 1 Strength (00-3C, Counts down every move, at 0F becomes small)
04F5 - Torch 1 Delay (Counts down, flips at 00)
04F6 - Torch 1 Animation (00 - Large Left, 01 - Large Right, 02 - Small Left, 03 - Small Right)
04F7 - Torch 2 Strength (00-3C, Counts down every move, at 0F becomes small)
04F8 - Torch 2 Delay (Counts down, flips at 00)
04F9 - Torch 2 Animation (00 - Large Left, 01 - Large Right, 02 - Small Left, 03 - Small Right)

04FA - Shield Heat (00-04, 05 - Melts)

0500 - Room Number (See Room List)
0503 - Goods Card Number (00-Spells, 02+ - Goods)
0505 - Number of Items In Goods List (00-07)
0513 - Previous Room (See Room List)
0516 - Torches (00-FF)
053D - Room Number (Copy)

0630-06FF - Text on the screen
0700-075F - Sound Variables

Room List

00 - Outside
01 - Entrance Corridor
02 - Stone Passage
03 - Small Closet
04 - 4-Way Hall
05 - Subterranean Cavern
06 - Waterfall Room
07 - Cave Behind Waterfall
08 - Stinking Room
09 - Dragon Room
0A - Cold Air Room
0B - Two Bridge Room
0C - Specter Room
0D - Epor Room
0E - Granite Wall Room
0F - Mirror Room
10 - Coffin Room
11 - Fire Walkway Room
12 - Troll Bridge Room
13 - Courtyard
14 - Drafty Hallway
15 - Library
16 - Fireplace Room
17 - Laboratory
18 - Garden
19 - Not Used (Possibly Goblin Room?)  
1A - Banquet Hall
1B - Sphinx Room
1C - Observatory
1D - Death (Not a Room)
1E - Bound Woman Room
1F - Hellhound Room
20 - Blue Wyvern Turret
21 - Arched Passageway
22 - Windy Ledge
23 - Leprechaun Gold Balcony
24 - Snake Room
25 - Throne Room
26 - Granite Slab Hallway
27 - Lava Room
28 - Lever Puzzle Cavern
29 - Gargoyle Room
2A - Well Room
2B - River Styx
2C - Skull Door Room
2D - Behemoth Room

Goods List

00 - Torch
01 - Torch
02 - Rug
03 - Torch (Special Torch)
04 - Torch
05 - Sword
06 - Key 3
07 - Stone
08 - Stone
09 - Stone
0A - Stone
0B - Stone
0C - Stone
0D - CoppCoin
0E - CoppCoin
0F - GoldCoin
10 - GoldCoin
11 - Rock
12 - Torch
13 - Torch
14 - Sphere
15 - Torch
16 - Spear
17 - Helmet
18 - Hammer
19 - Shield
1A - Skull
1B - Skull
1C - Bone
1D - Arrow
1E - Bridge
1F - Torch
20 - Cloak
21 - Torch
22 - Torch
23 - Bottle 1
24 - Bottle 2
25 - Scroll 1
26 - Scroll 2
27 - Torch
28 - Torch
29 - Broom
...

Code

Change Rooms

D3C5:AD 00 05  LDA $0500    ; Load the current room into accumulator.
D3C8:8D 13 05  STA $0513    ; Store the current room as the previous room.
D3CB:20 55 D0  JSR $D055    ; Call the routine to get the new room based on the chosen exit.
D3CE:A5 A7     LDA $00A7    ; Load $00A7 into accumulator. Note: Previous calling routine already did this (redundant?)
D3D0:CD 00 05  CMP $0500    ; Compare current room to accumulator.
D3D3:D0 02     BNE $D3D7    ; Branch on result not zero.
D3D5:A5 A8     LDA $00A8    ; Load the new room into the accumulator.
D3D7:8D 00 05  STA $0500    ; Store the new room into the current room.
D3DA:A9 69     LDA #$69     ; Set accumulator to $69.
D3DC:20 F3 CE  JSR $CEF3    ; 
D3DF:A9 68     LDA #$68     ; 
D3E1:20 F3 CE  JSR $CEF3    ; 
D3E4:A9 68     LDA #$68     ; 
D3E6:20 E3 CE  JSR $CEE3    ; 
D3E9:A9 62     LDA #$62     ; 
D3EB:20 F3 CE  JSR $CEF3    ; 
D3EE:20 00 C0  JSR $C000    ; 
D3F1:20 F1 CA  JSR $CAF1    ; 
D3F4:60        RTS          ; Return.

Load New Room Based On Room and Chosen Exit?

D047:18        CLC          ; Clear carry flag.
D048:65 A5     ADC $00A5    ; Add accumulator to $00A5, with carry. I think this is to find the offset
D04A:85 A5     STA $00A5    ; Store the result into $00A5.
D04C:A9 00     LDA #$00     ; Clear accumulator.
D04E:65 A6     ADC $00A6    ; Add accumulator to $00A6, with carry. Why is this done if the accumulator is set to $00 just before?
D050:85 A6     STA $00A6    ; Store the result into $00A6.
D052:A5 A7     LDA $00A7    ; Load $00A7 into accumulator.
D054:60        RTS          ; Return.

Load Exits Into Memory?

D055:A0 00     LDY #$00     ; Clear Y.
D057:B1 A5     LDA ($A5),Y  ; Load ROM memory, offset with Y, into accumulator.
D059:85 A7     STA $00A7    ; Store accumulator into $00A7.
D05B:C8        INY          ; Increment Y.
D05C:B1 A5     LDA ($A5),Y  ; Load ROM memory, offset with Y, into accumulator.
D05E:85 A8     STA $00A8    ; Store accumulator into $00A8.
D060:A9 02     LDA #$02     ; Set accumulator to $02
D062:4C 47 D0  JMP $D047    ; Jump to $D047

Text

00=0
01=1
02=2
03=3
04=4
05=5
06=6
07=7
08=8
09=9
0A=!
0B=?
20=.
23=-
24=·
25=
26=
27=
28=
29=
2A=
2B=
2C=
2D=
2E=
2F=
31=A
32=B
33=C
34=D
35=E
36=F
37=G
38=H
39=I
3A=J
3B=K
3C=L
3D=M
3E=N
3F=O
40=P
41=Q
42=R
43=S
44=T
45=U
46=V
47=W
48=X
49=Y
4A=Z
4B==
4C=:
4D=,
4E=;
4F='
55="