CAFF CMP #$C0
CB01 BNE F3CB20
CB03 JSR F3D8EE
CB06 LDA #$00
CB08 JSR F3FE03
CB0B LDX $45 ; = $0 when leaving first town, $1 when leaving dreadnaught town
CB0D LDA $B4C0,X ; get X or Y coordinate from this table
CB11 SBC #$07 ; subtract 7 to get player position
CB13 STA $27 ; save position
CB15 LDA $B4E0,X ; get X or Y coordinate from second table
CB19 SBC #$07 ; subtract 7 to get player position
CB1B STA $28 ; save position
CB1D JMP L3C0B8
These seem to be the exit-to-overworld coordinates. First byte is first town, second byte is the town by the Dreadnaught building area.
So while $48 is the map ID, $45 seems to be... location ID? It keeps track of what overworld spot you're in. I'm at a disadvantage because I don't know the names of these locations...
0 - Starting Town
1 - Dreadnaught Building Town
2 - Dreadnaught Access Cave (Exits onto cave mouth) *
3 - Island In the Ocean (Exits onto cave mouth, not the single spot of land)
4 - Second Town Castle (right side)
5 - Above Second Town Castle (right side)
6 - Coliseum (on top of)
7 - Plains one tile right of castle in mountains by coliseum
8 - Winding mountain cave area with Stalactites and WzOgres
9 - Outside gold tower on island surrounded by mountains
A - Lake cave above waterfall, trapped by river tiles!
B - On the ocean, between some pincer-shaped mountains
C - Cave in the middle of some plains, mountains to the south. Cave has brains in it.
D - Snow plains cave!
E - Just some spot near some mountains and some plains, where Pudding enemies are?
F - Outside the castle in the mountains by the coliseum (left side)
Well there goes my idea that $45 is holding the entry-level map from the overworld. A bunch of towns are missing and don't call that code block when you exit them.
Was fun to test though.
* Could this be considered a bug, facing right in the cave mouth when exiting these places?