

A Game Genie code for the bug fix is YANOUGIA. change the destination of the beq so it skips over the bogus lda $07). To fix the bug, change the byte at ROM offset 61C8B from 05 to 07 (i.e. If there were a dungeon with an encounter table index of 128 or greater that was accessible by ship, you could encounter the remaining five enemies (all of which are in encounter table 02), but the encounter tables used by the game don't go that high. The four enemies that you can encounter via the Shrine of Breaking Waves method are in encounter table 01. The only such area that you can move directly into the sea from is the Shrine of Breaking Waves.

As a result, the only time a table other than table 00 gets used is when you have an encounter immediately upon moving from an area with an encounter table index of 64 or greater. So each step you take on the ocean, the game uses the index of the previous encounter table divided by 64 as the current encounter table. The uninitialized variable $07 contains the index of the encounter table that was checked on the previous step. nes ROM image):ġ8/9C5A: AD 45 A2 lda $A245 lo byte of ptr to world map encounter tableġ8/9C5F: AD 46 A2 lda $A246 hi byte of ptr to world map encounter tableġ8/9C64: A5 42 lda $42 player's X position in map squaresġ8/9C6C: A5 43 lda $43 player's Y position in map squaresġ8/9C73: B1 00 lda ($00),y read packed encounter table indexesġ8/9C75: AE 15 05 ldx $0515 current vehicle (0 = on foot, 1 = ship, 2 = balloon)ġ8/9C7C: 29 3F and #$3F the land encounter table is in the lower 6 bitsġ8/9C81: A5 07 lda $07 bug! this variable hasn't been initialized yetġ8/9C86: 29 03 and #$03 the sea encounter table is in the upper 2 bits The bugged code starts in bank 18, address 9C5A (offset 61C6A in a headered. The encounter zones for each roughly screen-sized section of world map (16 by 16 squares) are packed into a single byte, with the land encounter table index in the lower 6 bits and the sea encounter table index in the upper 2 bits. The reason so many sea enemies don't appear anywhere, while others only appear under specific and strange conditions is, not surprisingly, because of a bug in the code that calculates what encounter zone you're in.
