Skip to content

Commit

Permalink
No longer depend on cheats, other fixes
Browse files Browse the repository at this point in the history
A high point is that the Open Door of Time flag is now present and the Rainbow Bridge spawn mechanics are (mostly) implemented. Open Forest is now done in a better way.
  • Loading branch information
AmazingAmpharos committed Apr 14, 2018
1 parent db72816 commit 10bb5c8
Show file tree
Hide file tree
Showing 12 changed files with 413 additions and 417 deletions.
6 changes: 3 additions & 3 deletions BaseClasses.py
Expand Up @@ -6,7 +6,7 @@

class World(object):

def __init__(self, shuffle, bridge, open_forest, place_dungeon_items, check_beatable_only):
def __init__(self, shuffle, bridge, open_forest, open_door_of_time, place_dungeon_items, check_beatable_only):
self.shuffle = shuffle
self.bridge = bridge
self.dungeons = []
Expand All @@ -21,9 +21,9 @@ def __init__(self, shuffle, bridge, open_forest, place_dungeon_items, check_beat
self._location_cache = {}
self.required_locations = []
self.check_beatable_only = check_beatable_only
self.place_dungeon_items = place_dungeon_items # configurable in future
self.place_dungeon_items = place_dungeon_items
self.open_forest = open_forest
self.open_door_of_time = False
self.open_door_of_time = open_door_of_time
self.can_take_damage = True
self.spoiler = Spoiler(self)

Expand Down
3 changes: 3 additions & 0 deletions EntranceRandomizer.py
Expand Up @@ -49,6 +49,9 @@ def start():
Mido no longer blocks the path to the Deku Tree and
the Kokiri boy no longer blocks the path out of the forest.
''', action='store_true')
parser.add_argument('--open_door_of_time', help='''\
The Door of Time is open from the beginning of the game.
''', action='store_true')
parser.add_argument('--nodungeonitems', help='''\
Remove Maps and Compasses from Itempool, replacing them by
empty slots.
Expand Down
5 changes: 5 additions & 0 deletions Gui.py
Expand Up @@ -56,6 +56,8 @@ def open_readme():
suppressRomCheckbutton = Checkbutton(checkBoxFrame, text="Do not create patched Rom", variable=suppressRomVar)
openForestVar = IntVar()
openForestCheckbutton = Checkbutton(checkBoxFrame, text="Open Forest", variable=openForestVar)
openDoorVar = IntVar()
openDoorCheckbutton = Checkbutton(checkBoxFrame, text="Open Door of Time", variable=openDoorVar)
dungeonItemsVar = IntVar()
dungeonItemsCheckbutton = Checkbutton(checkBoxFrame, text="Place Dungeon Items (Compasses/Maps)", onvalue=0, offvalue=1, variable=dungeonItemsVar)
beatableOnlyVar = IntVar()
Expand All @@ -64,6 +66,7 @@ def open_readme():
createSpoilerCheckbutton.pack(expand=True, anchor=W)
suppressRomCheckbutton.pack(expand=True, anchor=W)
openForestCheckbutton.pack(expand=True, anchor=W)
openDoorCheckbutton.pack(expand=True, anchor=W)
dungeonItemsCheckbutton.pack(expand=True, anchor=W)
beatableOnlyCheckbutton.pack(expand=True, anchor=W)

Expand Down Expand Up @@ -128,6 +131,7 @@ def generateRom():
guiargs.create_spoiler = bool(createSpoilerVar.get())
guiargs.suppress_rom = bool(suppressRomVar.get())
guiargs.open_forest = bool(openForestVar.get())
guiargs.open_door_of_time = bool(openDoorVar.get())
guiargs.nodungeonitems = bool(dungeonItemsVar.get())
guiargs.beatableonly = bool(beatableOnlyVar.get())
guiargs.rom = romVar.get()
Expand Down Expand Up @@ -166,6 +170,7 @@ def generateRom():
if args.nodungeonitems:
dungeonItemsVar.set(int(not args.nodungeonitems))
openForestVar.set(int(args.open_forest))
openDoorVar.set(int(args.open_door_of_time))
beatableOnlyVar.set(int(args.beatableonly))
if args.count:
countVar.set(str(args.count))
Expand Down
7 changes: 5 additions & 2 deletions ItemList.py
Expand Up @@ -11,6 +11,7 @@
alwaysitems = (['Kokiri Sword', 'Boomerang', 'Lens of Truth', 'Hammer', 'Iron Boots', 'Goron Tunic', 'Zora Tunic', 'Hover Boots', 'Mirror Shield', 'Stone of Agony', 'Fire Arrows', 'Ice Arrows', 'Light Arrows', 'Dins Fire', 'Farores Wind', 'Nayrus Love', 'Rupee (1)'] + ['Progressive Hookshot'] * 2 + ['Deku Shield'] * 4 + ['Hylian Shield'] * 2 + ['Ice Trap'] * 6 +
['Progressive Strength Upgrade'] * 3 + ['Progressive Scale'] * 2 + ['Piece of Heart'] * 16 + ['Recovery Heart'] * 11 + ['Rupees (5)'] * 13 + ['Rupees (20)'] * 2 + ['Rupees (50)'] * 6 + ['Rupees (200)'] * 5 + ['Bow'] * 3 + ['Slingshot'] * 3 + ['Bomb Bag'] * 3 + ['Bottle'] * 2 + ['Bottle with Letter'] + ['Bottle with Milk'] +
['Bombs (5)'] * 2 + ['Bombs (10)'] * 2 + ['Bombs (20)'] + ['Bombchus (5)'] + ['Bombchus (10)'] * 3 + ['Bombchus (20)'] + ['Arrows (5)'] + ['Arrows (10)'] * 6 + ['Arrows (30)'] * 6 + ['Deku Nuts (5)'] + ['Deku Nuts (10)'] + ['Progressive Wallet'] * 2 + ['Deku Stick Capacity'] * 2 + ['Deku Nut Capacity'] * 2)
notmapcompass = ['Rupees (5)'] * 20
songlist = ['Zeldas Lullaby', 'Eponas Song', 'Suns Song', 'Sarias Song', 'Song of Time', 'Song of Storms', 'Minuet of Forest', 'Prelude of Light', 'Bolero of Fire', 'Serenade of Water', 'Nocturne of Shadow', 'Requiem of Spirit']
skulltulla_locations = (['GS1', 'GS2', 'GS3', 'GS4', 'GS5', 'GS6', 'GS7', 'GS8', 'GS9', 'GS10', 'GS11', 'GS12', 'GS13', 'GS14', 'GS15', 'GS16', 'GS17', 'GS18', 'GS19', 'GS20'] +
['GS21', 'GS22', 'GS23', 'GS24', 'GS25', 'GS26', 'GS27', 'GS28', 'GS29', 'GS30', 'GS31', 'GS32', 'GS33', 'GS34', 'GS35', 'GS36', 'GS37', 'GS38', 'GS39', 'GS40'] +
Expand Down Expand Up @@ -77,18 +78,20 @@ def generate_itempool(world):


# set up item pool
(pool, placed_items) = get_pool_core()
(pool, placed_items) = get_pool_core(world.place_dungeon_items)
world.itempool = ItemFactory(pool)
for (location, item) in placed_items:
world.push_item(location, ItemFactory(item), False)
world.get_location(location).event = True

fill_songs(world)

def get_pool_core():
def get_pool_core(dungeon_items):
pool = []
placed_items = []

if not dungeon_items:
pool.extend(notmapcompass)
pool.extend(alwaysitems)

return (pool, placed_items)
Expand Down
4 changes: 2 additions & 2 deletions Main.py
Expand Up @@ -21,7 +21,7 @@ def main(args, seed=None):
start = time.clock()

# initialize the world
world = World(args.shuffle, args.bridge, args.open_forest, not args.nodungeonitems, args.beatableonly)
world = World(args.shuffle, args.bridge, args.open_forest, args.open_door_of_time, not args.nodungeonitems, args.beatableonly)
logger = logging.getLogger('')
if seed is None:
random.seed(None)
Expand Down Expand Up @@ -82,7 +82,7 @@ def main(args, seed=None):

def copy_world(world):
# ToDo: Not good yet
ret = World(world.shuffle, world.bridge, world.open_forest, world.place_dungeon_items, world.check_beatable_only)
ret = World(world.shuffle, world.bridge, world.open_forest, world.open_door_of_time, world.place_dungeon_items, world.check_beatable_only)
ret.seed = world.seed
ret.can_take_damage = world.can_take_damage
create_regions(ret)
Expand Down
66 changes: 62 additions & 4 deletions Notes/OoT_hex_edit.txt
Expand Up @@ -98,7 +98,7 @@ ADDIU a1, a1, 0x0059 [24A50059]

Y: ADDIU t2, t2, 0x005C [254A005C] #Text ID for Gold Gauntlets

BNE t2, a1, Z [1545000B] #Is the item Gold Gauntlets?
BNE t2, a1, Z [1545000C] #Is the item Gold Gauntlets?

ANDI t2, t2, 0x0000 [314A0000]

Expand Down Expand Up @@ -492,7 +492,7 @@ ANDI a1, a1, 0x0000 [30A50000]

ADDIU a1, a1, 0x004B [24A5004B]

R: J 0x1BF73 [0201BF73]
R: J 0x1BF73 [0801BF73]

Save file adjustments:

Expand All @@ -517,10 +517,11 @@ SB A1, 0x0B3F (S1) [A2250B3F] #Owl at Hyrule Castle

SB T0, 0x0EDC (S1) [A2280EDC] #Navi at Master Sword pedestal
SB A1, 0x0EDD (S1) [A2250EDD] #Have been an adult before
SB A1, 0x0EEC (S1) [A2250EEC] #Sheik doesn't talk after becomming adult
SB A1, 0x0EED (S1) [A2250EED] #Sheik doesn't talk after becomming adult
SB T8, 0x0EF9 (S1) [A2380EF9] #Saria at start
SB A1, 0x00A7 (S1) [A22500A7] #Start with Light Medallion
SB T0, 0x0EE0 (S1) [A2280EE0] #Owl in front of Lost Woods
SB T8, 0x020E (S1) [A238020E] #Gerudo Training Grounds key pester

ADDIU A1, R0, 0x01FF [240501FF]
ADDIU T7, R0, 0x01FB [240F01FB]
Expand All @@ -537,8 +538,65 @@ SB T9, 0x0F1A (S1) [A2390F1A] #Darunia in Fire Temple
ADDIU T0, R0, 0x1020 [24081020]
ADDIU T9, R0, 0x002C [2419002C]
ADDIU T8, R0, 0x0049 [24180049]
ADDIU T7, R0, 0x0002 [240F0002]
ADDIU A1, R0, 0x0040 [24050040]

SH T0, 0x0ED4 [A6280ED4] #Deku Tree is opened from the start
SB T9, 0x0081 (S1) [A2390081] #Sold Out in Lens of Truth slot
SB T8, 0x00F6 (S1) [A23800F6] #Quiet Navi in Dodongo's Cavern
SB T7, 0x003F (S1) [A22F003F] #Ocarina memory game starts at final stage
SB A1, 0x0A42 (S1) [A2250A42] #Navi in adult Sacred Forest Meadow

JR $31 [03E00008]

DMA function:

A0: 03480000
A1: 80400000
A2: 00001000
T6: 80401000

LUI A0, 0x0348
LUI A1, 8040
ADDIU A2, R0, 0x1000
JAL 0x8000085C
ADDIU T6, A1, 0x1000

Start at 0x8000E70 (ROM 0x1A70)


SW RA 0x001C (SP) [AFBF001C]
LUI A0, 0x0348 [3C040348]
LUI A1, 0x8040 [3C058040]
ADDIU A2, R0, 0x1000 [24061000]
JAL 0x8000085C [0C000217]
ADDIU T6, A1, 0x1000 [24AE1000]
JAL 0x80400800 [0C100200]
LUI V0, 0x0000 [3C020000]

At 0x80400800
ADDIU V0, V0, 0x7430 [24427430]
LUI T6, 0x0001 [3C0E0001]
ADDIU T6, T6, 0xD390 [25CED390]
LUI A1, 0x8001 [3C058001]
ADDIU A1, A1, 0xB140 [24A5B140]
SUBU A2, T6, V0 [01C23023]
JR $31 [03E00008]

For "open" Rainbow Bridge:

LBU A1, 0x0EDC (S1) [92250EDC]
ORI A1, A1, 0x0020 [34A50020]
SB A1, 0x0EDC (S1) [A2250EDC]

For Mido out of the way:

LBU A1, 0x0ED5 (S1) [92250ED5]
ORI A1, A1, 0x0001 [34A50001]
SB A1, 0x0ED5 (S1) [A2250ED5]

For open Door of Time:

JR $31 [03E00008]
LBU A1, 0x0EDC (S1) [92250EDC]
ORI A1, A1, 0x0008 [34A50008]
SB A1, 0x0EDC (S1) [A2250EDC]
124 changes: 72 additions & 52 deletions Notes/Prog_equip_cheat_format.txt
Expand Up @@ -1004,7 +1004,7 @@ Initial Save file
80400648 00A2
80400649 0025
8040064A 000E
8040064B 00EC
8040064B 00ED
8040064C 00A2
8040064D 0038
8040064E 000E
Expand All @@ -1017,71 +1017,91 @@ Initial Save file
80400655 0028
80400656 000E
80400657 00E0
80400658 0024
80400659 0005
8040065A 0001
8040065B 00FF
80400658 00A2
80400659 0038
8040065A 0002
8040065B 000E
8040065C 0024
8040065D 000F
8040065D 0005
8040065E 0001
8040065F 00FB
8040065F 00FF
80400660 0024
80400661 0018
80400662 0007
80400663 00FF
80400661 000F
80400662 0001
80400663 00FB
80400664 0024
80400665 0019
80400666 0000
80400667 0004
80400665 0018
80400666 0007
80400667 00FF
80400668 0024
80400669 0008
80400669 0019
8040066A 0000
8040066B 0030
8040066C 00A6
8040066D 0025
8040066E 000E
8040066F 00E2
8040066B 0004
8040066C 0024
8040066D 0008
8040066E 0000
8040066F 0030
80400670 00A6
80400671 002F
80400671 0025
80400672 000E
80400673 00E8
80400673 00E2
80400674 00A6
80400675 0038
80400675 002F
80400676 000E
80400677 00EA
80400678 00A2
80400679 0028
80400677 00E8
80400678 00A6
80400679 0038
8040067A 000E
8040067B 00E7
8040067B 00EA
8040067C 00A2
8040067D 0039
8040067E 000F
8040067F 001A
80400680 0024
80400681 0008
80400682 0010
80400683 0020
8040067D 0028
8040067E 000E
8040067F 00E7
80400680 00A2
80400681 0039
80400682 000F
80400683 001A
80400684 0024
80400685 0019
80400686 0000
80400687 002C
80400685 0008
80400686 0010
80400687 0020
80400688 0024
80400689 0018
80400689 0019
8040068A 0000
8040068B 0049
8040068C 00A6
8040068D 0028
8040068E 000E
8040068F 00D4
80400690 00A2
80400691 0039
8040068B 002C
8040068C 0024
8040068D 0018
8040068E 0000
8040068F 0049
80400690 0024
80400691 000F
80400692 0000
80400693 0081
80400694 00A2
80400695 0038
80400693 0002
80400694 0024
80400695 0005
80400696 0000
80400697 00F6
80400698 0003
80400699 00E0
8040069A 0000
8040069B 0008
80400697 0040
80400698 00A6
80400699 0028
8040069A 000E
8040069B 00D4
8040069C 00A2
8040069D 0039
8040069E 0000
8040069F 0081
804006A0 00A2
804006A1 0038
804006A2 0000
804006A3 00F6
804006A4 00A2
804006A5 002F
804006A6 0000
804006A7 003F
804006A8 00A2
804006A9 0025
804006AA 000A
804006AB 0042
804006AC 0003
804006AD 00E0
804006AE 0000
804006AF 0008
16 changes: 4 additions & 12 deletions Notes/todo_list.txt
@@ -1,23 +1,15 @@
Todo List:

Implement ROM side mechanics necessary for the Rainbow Bridge requirement dropdown to have correct mechanical function.
Implement mechanical support for the All Dungeons Rainbow Bridge setting.

Implement an "Open Door of Time" flag.
Clean up the code to remove various artifacts from lttpr. Likely just remove all the entrance shuffle stuff as it's not coming anytime soon if I'm being real.

Clean up the code to remove various artifacts from lttpr. Likely just remove all the entrance shuffle stuff as it's not coming anytime soon if I'm being real. Write a new README.
Finish progressive item code for gfx of held up item.

Add a flag for no subscreen delay on ROM side.

Finish progressive item code for gfx of held up item. Shift code to 0x803AF1C0 to remove expansion pak requirement and write code into RAM sometime when loading the game instead of relying on gameshark cheat hack.

Fix "Poacher's Saw" Bug.

Look into what causes the DM gate to be opened early.
Implement text box speedups, removing as many as possible slower character drawing, disables of instant text, and disables of B button text scrolling as possible.

Deferred to post-1.0:

Likely will have to deal with checksum correction at some point.

Figure out a good way to add Biggoron Sword to the shuffle.

Recode great fairies substantially for the following ideal behavior (note: Likely post 1.0, seems VERY difficult):
Expand Down

0 comments on commit 10bb5c8

Please sign in to comment.