OK, I better get all of this down while it's still fresh(-ish) in my mind...
So as I said, I was working on making a driveable Dwarf Tank for TfW, which worked out splendidly, by the way. Since you can't normally use the Chocobo underground, and the Tank would only be underground, and the chocobo has a motion pattern a lot like what I wanted for the tank (sprites only move when you move, not constantly like all other vehicles, and also travels on land instead of hovering), I decided to make the Tank a special-case exception for the Chocobo.
So first of all, this - you know how if you hack the chocobo into the Underworld, it's invisible? This has nothing to do with the game's lack of ability to display the chocobo underground. No, despite the fact that there is no way in the normal game to ride a Chocobo in the Underworld, the developers decided to put in a special check in the chocobo initialization code that says:
Is the current world Overworld?
If not, skip the following code (which displays the chocobo sprites).
The code looks like this if you're in the Overworld:
$15/B3EA AD 01 17 LDA $1701 [$15:1701]; load current map
$15/B3ED D0 06 BNE $06 [$B3F5] ; if not 00, skip the following three ops
$15/B3EF A5 AD LDA $AD [$00:06AD]
$15/B3F1 C9 10 CMP #$10 ; (don't know, but it's irrelevant for this discussion)
$15/B3F3 F0 03 BEQ $03 [$B3F8] ; jump to sprite loading code (note that this is one of the ops skipped if current map is not 00)
$15/B3F8 AD 04 17 LDA $1704 [$15:1704]; load current mode of transport
$15/B3FB C9 01 CMP #$01 ; is is chocobo?
$15/B3FD F0 27 BEQ $27 [$B426] ; if so, skip to chocobo sprite loading routine
...And like this if you're in the Underworld/moon:
$15/B3EA AD 01 17 LDA $1701 [$15:1701]; load current map
$15/B3ED D0 06 BNE $06 [$B3F5] ; if not 00, skip to 15b3f5
$15/B3F5 4C B5 B4 JMP $B4B5 [$15:B4B5]; jump to 15b4b5
$15/B4B5 AB PLB
$15/B4B6 6B RTL ; end
for proof of concept, open a vanilla ROM and ride a chocobo (in the Overworld), then open Geiger's hex editor and change 1701 to anything besides 00. the chocobo will disappear. Likewise if you hack a chocobo into the underworld, then change 1701 to 00, the chocobo will appear.
You can also EA out the D0 06 at $15/B3ED in order to permanently make the chocobo visible in any world!
OK, now some stuff about vehicle travel as it relates to world map tile properties...
So we know from Yousei (and expanded on by several, including your humble narrator) that world map tile properties are stored in ROM beginning at A0A80 (ROM w/o header), and that it's 0x100 bytes per world.
Whenever a world map is loaded, those properties are loaded into EDB-FDA in RAM.
Now, the first byte of each of the two-byte tile properties contains all of the "travelability" data. Any time you try to move (press the D-Pad), the game compares the travelability of the terrain of the tile in the indicated direction against the travelability of your current method of transportation. That's right, there is a (small) table of travelability that contains an entry for each vehicle. This table is at 2AE6 (ROM w/o header) through 2AED. One byte per vehicle. 2AE6 (the entry for "no vehicle") is actually a dummy, I think, because there's a special case string of code for "no vehicle." all vehicles, though (including both chocobos), use this table to determine if they can travel on a particular piece of terrain.
By default, the table reads:
vehicle index travelability byte default value
-------------- -- ---- --
Yellow Chocobo 01 2AE7 02
Black Chocobo 02 2AE8 04
Hovercraft 03 2AE9 10
Enterprise 04 2AEA 20
Falcon 05 2AEB 20
Big Whale 06 2AEC 80
Ship 07 2AED FF
So, you see, it is possible to make the Enterprise and the Falcon subject to travel over disparate terrain rules... in case that's something you're interested in doing.
Another interesting thing about this information: there's a special case exception for how to proceed if you're in the Underworld and the "mystic silver" flag is not set. And, it can be changed separately for the Enterprise and the Falcon!
For the Enterprise:
$00/AA05 AD 04 17 LDA $1704 [$00:1704]; load current method of transportation
$00/AA08 C9 05 CMP #$05 ; is it Falcon?
$00/AA0A D0 0C BNE $0C [$AA18] ; if not, skip to next check
$00/AA18 C9 04 CMP #$04 ; is it Enterprise?
$00/AA1A D0 0C BNE $0C [$AA28] ; if not skip to travelability check
$00/AA1C AD 81 12 LDA $1281 [$00:1281]
$00/AA1F 29 04 AND #$04 ; check if "Yang Destroyed Cannon" flag is set (I guess after this point, the Enterprise is ready to fly underground)
$00/AA21 F0 05 BEQ $05 [$AA28] ; if not, skip to travelability check
$00/AA23 A9 01 LDA #$01 ; if so, then for the sake of travelability check, pretend we're on a yellow chocobo
$00/AA25 4C 2D AA JMP $AA2D [$00:AA2D]; jump to travelability check
For the Falcon:
$00/AA05 AD 04 17 LDA $1704 [$00:1704]; Load current method of transportation
$00/AA08 C9 05 CMP #$05 ; is it Falcon?
$00/AA0A D0 0C BNE $0C [$AA18] ; if not, skip to next check
$00/AA0C AD 87 12 LDA $1287 [$00:1287]
$00/AA0F 29 02 AND #$02 ; check if "Heat Shielding the Falcon" flag is set
$00/AA11 F0 15 BEQ $15 [$AA28] ; if not, skip to travelability check
$00/AA13 A9 01 LDA #$01 ; if so, then for the sake of travelability check, pretend we're on a yellow chocobo
$00/AA15 4C 2D AA JMP $AA2D [$00:AA2D]; jump to travelability check
If you study the tile properties of the Underworld, you'll see that most of them are set to "Chocobo can Travel." Because, by default, there are no chocobos in the Underworld, the developers were free to use this bit for "special case airship travelability." So when the right flags are set, the Enterprise and/or Falcon can fly over extra terrain (specifically, magma).
Manipulation of this code enables us to change 1) which flag controls exapanded underworld travel (for each vehicle), as well as 2) Which vehicle to "travel as" when the specified flag is set.
For the purpose of TfW, I changed the latter of each to 04 and 05, respectively, since there will be no "application of mystic silver" in my game, but there will be a chocobo (or, more precisely, a Tank). Then I just changed the Underworld tile properties so that airships have no problem flying anywhere, but chocobos (tanks) can only travel over land.