mirror of
				https://github.com/thornAvery/kep-hack.git
				synced 2025-11-04 20:51:02 +13:00 
			
		
		
		
	More WRAM label cleanup (still needs UNIONs and renaming)
This commit is contained in:
		
							parent
							
								
									5c73cffee6
								
							
						
					
					
						commit
						f9ae7b1240
					
				| 
						 | 
					@ -6900,9 +6900,9 @@ ResetCryModifiers:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
; animates the mon "growing" out of the pokeball
 | 
					; animates the mon "growing" out of the pokeball
 | 
				
			||||||
AnimateSendingOutMon:
 | 
					AnimateSendingOutMon:
 | 
				
			||||||
	ld a, [wPredefRegisters]
 | 
						ld a, [wPredefHL]
 | 
				
			||||||
	ld h, a
 | 
						ld h, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 1]
 | 
						ld a, [wPredefHL + 1]
 | 
				
			||||||
	ld l, a
 | 
						ld l, a
 | 
				
			||||||
	ldh a, [hStartTileID]
 | 
						ldh a, [hStartTileID]
 | 
				
			||||||
	ldh [hBaseTileID], a
 | 
						ldh [hBaseTileID], a
 | 
				
			||||||
| 
						 | 
					@ -6940,9 +6940,9 @@ AnimateSendingOutMon:
 | 
				
			||||||
	jr CopyUncompressedPicToHL
 | 
						jr CopyUncompressedPicToHL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CopyUncompressedPicToTilemap:
 | 
					CopyUncompressedPicToTilemap:
 | 
				
			||||||
	ld a, [wPredefRegisters]
 | 
						ld a, [wPredefHL]
 | 
				
			||||||
	ld h, a
 | 
						ld h, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 1]
 | 
						ld a, [wPredefHL + 1]
 | 
				
			||||||
	ld l, a
 | 
						ld l, a
 | 
				
			||||||
	ldh a, [hStartTileID]
 | 
						ldh a, [hStartTileID]
 | 
				
			||||||
CopyUncompressedPicToHL::
 | 
					CopyUncompressedPicToHL::
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -249,7 +249,7 @@ ToText:
 | 
				
			||||||
	db "To@"
 | 
						db "To@"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BuildFlyLocationsList:
 | 
					BuildFlyLocationsList:
 | 
				
			||||||
	ld hl, wFlyLocationsList - 1
 | 
						ld hl, wFlyAnimUsingCoordList
 | 
				
			||||||
	ld [hl], $ff
 | 
						ld [hl], $ff
 | 
				
			||||||
	inc hl
 | 
						inc hl
 | 
				
			||||||
	ld a, [wTownVisitedFlag]
 | 
						ld a, [wTownVisitedFlag]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -131,7 +131,7 @@ RedrawPartyMenu_::
 | 
				
			||||||
	ld l, a
 | 
						ld l, a
 | 
				
			||||||
	ld de, wEvosMoves
 | 
						ld de, wEvosMoves
 | 
				
			||||||
	ld a, BANK(EvosMovesPointerTable)
 | 
						ld a, BANK(EvosMovesPointerTable)
 | 
				
			||||||
	ld bc, wEvosMoves.end - wEvosMoves
 | 
						ld bc, wEvosMovesEnd - wEvosMoves
 | 
				
			||||||
	call FarCopyData
 | 
						call FarCopyData
 | 
				
			||||||
	ld hl, wEvosMoves
 | 
						ld hl, wEvosMoves
 | 
				
			||||||
	ld de, .notAbleToEvolveText
 | 
						ld de, .notAbleToEvolveText
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,20 +1,20 @@
 | 
				
			||||||
GetPredefPointer::
 | 
					GetPredefPointer::
 | 
				
			||||||
; Store the contents of the register
 | 
					; Back up the contents of the registers (hl, de, bc).
 | 
				
			||||||
; pairs (hl, de, bc) at wPredefRegisters.
 | 
					 | 
				
			||||||
; Then put the bank and address of predef
 | 
					; Then put the bank and address of predef
 | 
				
			||||||
; wPredefID in [wPredefBank] and hl.
 | 
					; wPredefID in [wPredefBank] and hl.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ld a, h
 | 
						ld a, h
 | 
				
			||||||
	ld [wPredefRegisters], a
 | 
						ld [wPredefHL], a
 | 
				
			||||||
	ld a, l
 | 
						ld a, l
 | 
				
			||||||
	ld [wPredefRegisters + 1], a
 | 
						ld [wPredefHL + 1], a
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ld hl, wPredefRegisters + 2
 | 
						ld hl, wPredefDE
 | 
				
			||||||
	ld a, d
 | 
						ld a, d
 | 
				
			||||||
	ld [hli], a
 | 
						ld [hli], a
 | 
				
			||||||
	ld a, e
 | 
						ld a, e
 | 
				
			||||||
	ld [hli], a
 | 
						ld [hli], a
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ASSERT wPredefDE + 2 == wPredefBC
 | 
				
			||||||
	ld a, b
 | 
						ld a, b
 | 
				
			||||||
	ld [hli], a
 | 
						ld [hli], a
 | 
				
			||||||
	ld [hl], c
 | 
						ld [hl], c
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -550,7 +550,7 @@ CheckMapConnections::
 | 
				
			||||||
	ld a, [wXCoord]
 | 
						ld a, [wXCoord]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr nz, .checkEastMap
 | 
						jr nz, .checkEastMap
 | 
				
			||||||
	ld a, [wMapConn3Ptr]
 | 
						ld a, [wWestConnectedMap]
 | 
				
			||||||
	ld [wCurMap], a
 | 
						ld [wCurMap], a
 | 
				
			||||||
	ld a, [wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
 | 
						ld a, [wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
 | 
				
			||||||
	ld [wXCoord], a
 | 
						ld [wXCoord], a
 | 
				
			||||||
| 
						 | 
					@ -587,7 +587,7 @@ CheckMapConnections::
 | 
				
			||||||
	ld a, [wCurrentMapWidth2] ; map width
 | 
						ld a, [wCurrentMapWidth2] ; map width
 | 
				
			||||||
	cp b
 | 
						cp b
 | 
				
			||||||
	jr nz, .checkNorthMap
 | 
						jr nz, .checkNorthMap
 | 
				
			||||||
	ld a, [wMapConn4Ptr]
 | 
						ld a, [wEastConnectedMap]
 | 
				
			||||||
	ld [wCurMap], a
 | 
						ld [wCurMap], a
 | 
				
			||||||
	ld a, [wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
 | 
						ld a, [wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
 | 
				
			||||||
	ld [wXCoord], a
 | 
						ld [wXCoord], a
 | 
				
			||||||
| 
						 | 
					@ -623,7 +623,7 @@ CheckMapConnections::
 | 
				
			||||||
	ld a, [wYCoord]
 | 
						ld a, [wYCoord]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr nz, .checkSouthMap
 | 
						jr nz, .checkSouthMap
 | 
				
			||||||
	ld a, [wMapConn1Ptr]
 | 
						ld a, [wNorthConnectedMap]
 | 
				
			||||||
	ld [wCurMap], a
 | 
						ld [wCurMap], a
 | 
				
			||||||
	ld a, [wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
 | 
						ld a, [wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
 | 
				
			||||||
	ld [wYCoord], a
 | 
						ld [wYCoord], a
 | 
				
			||||||
| 
						 | 
					@ -651,7 +651,7 @@ CheckMapConnections::
 | 
				
			||||||
	ld a, [wCurrentMapHeight2]
 | 
						ld a, [wCurrentMapHeight2]
 | 
				
			||||||
	cp b
 | 
						cp b
 | 
				
			||||||
	jr nz, .didNotEnterConnectedMap
 | 
						jr nz, .didNotEnterConnectedMap
 | 
				
			||||||
	ld a, [wMapConn2Ptr]
 | 
						ld a, [wSouthConnectedMap]
 | 
				
			||||||
	ld [wCurMap], a
 | 
						ld [wCurMap], a
 | 
				
			||||||
	ld a, [wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
 | 
						ld a, [wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
 | 
				
			||||||
	ld [wYCoord], a
 | 
						ld [wYCoord], a
 | 
				
			||||||
| 
						 | 
					@ -937,7 +937,7 @@ LoadTileBlockMap::
 | 
				
			||||||
	dec b
 | 
						dec b
 | 
				
			||||||
	jr nz, .rowLoop
 | 
						jr nz, .rowLoop
 | 
				
			||||||
.northConnection
 | 
					.northConnection
 | 
				
			||||||
	ld a, [wMapConn1Ptr]
 | 
						ld a, [wNorthConnectedMap]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr z, .southConnection
 | 
						jr z, .southConnection
 | 
				
			||||||
	call SwitchToMapRomBank
 | 
						call SwitchToMapRomBank
 | 
				
			||||||
| 
						 | 
					@ -949,13 +949,13 @@ LoadTileBlockMap::
 | 
				
			||||||
	ld e, a
 | 
						ld e, a
 | 
				
			||||||
	ld a, [wNorthConnectionStripDest + 1]
 | 
						ld a, [wNorthConnectionStripDest + 1]
 | 
				
			||||||
	ld d, a
 | 
						ld d, a
 | 
				
			||||||
	ld a, [wNorthConnectionStripWidth]
 | 
						ld a, [wNorthConnectionStripLength]
 | 
				
			||||||
	ldh [hNorthSouthConnectionStripWidth], a
 | 
						ldh [hNorthSouthConnectionStripWidth], a
 | 
				
			||||||
	ld a, [wNorthConnectedMapWidth]
 | 
						ld a, [wNorthConnectedMapWidth]
 | 
				
			||||||
	ldh [hNorthSouthConnectedMapWidth], a
 | 
						ldh [hNorthSouthConnectedMapWidth], a
 | 
				
			||||||
	call LoadNorthSouthConnectionsTileMap
 | 
						call LoadNorthSouthConnectionsTileMap
 | 
				
			||||||
.southConnection
 | 
					.southConnection
 | 
				
			||||||
	ld a, [wMapConn2Ptr]
 | 
						ld a, [wSouthConnectedMap]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr z, .westConnection
 | 
						jr z, .westConnection
 | 
				
			||||||
	call SwitchToMapRomBank
 | 
						call SwitchToMapRomBank
 | 
				
			||||||
| 
						 | 
					@ -967,13 +967,13 @@ LoadTileBlockMap::
 | 
				
			||||||
	ld e, a
 | 
						ld e, a
 | 
				
			||||||
	ld a, [wSouthConnectionStripDest + 1]
 | 
						ld a, [wSouthConnectionStripDest + 1]
 | 
				
			||||||
	ld d, a
 | 
						ld d, a
 | 
				
			||||||
	ld a, [wSouthConnectionStripWidth]
 | 
						ld a, [wSouthConnectionStripLength]
 | 
				
			||||||
	ldh [hNorthSouthConnectionStripWidth], a
 | 
						ldh [hNorthSouthConnectionStripWidth], a
 | 
				
			||||||
	ld a, [wSouthConnectedMapWidth]
 | 
						ld a, [wSouthConnectedMapWidth]
 | 
				
			||||||
	ldh [hNorthSouthConnectedMapWidth], a
 | 
						ldh [hNorthSouthConnectedMapWidth], a
 | 
				
			||||||
	call LoadNorthSouthConnectionsTileMap
 | 
						call LoadNorthSouthConnectionsTileMap
 | 
				
			||||||
.westConnection
 | 
					.westConnection
 | 
				
			||||||
	ld a, [wMapConn3Ptr]
 | 
						ld a, [wWestConnectedMap]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr z, .eastConnection
 | 
						jr z, .eastConnection
 | 
				
			||||||
	call SwitchToMapRomBank
 | 
						call SwitchToMapRomBank
 | 
				
			||||||
| 
						 | 
					@ -985,13 +985,13 @@ LoadTileBlockMap::
 | 
				
			||||||
	ld e, a
 | 
						ld e, a
 | 
				
			||||||
	ld a, [wWestConnectionStripDest + 1]
 | 
						ld a, [wWestConnectionStripDest + 1]
 | 
				
			||||||
	ld d, a
 | 
						ld d, a
 | 
				
			||||||
	ld a, [wWestConnectionStripHeight]
 | 
						ld a, [wWestConnectionStripLength]
 | 
				
			||||||
	ld b, a
 | 
						ld b, a
 | 
				
			||||||
	ld a, [wWestConnectedMapWidth]
 | 
						ld a, [wWestConnectedMapWidth]
 | 
				
			||||||
	ldh [hEastWestConnectedMapWidth], a
 | 
						ldh [hEastWestConnectedMapWidth], a
 | 
				
			||||||
	call LoadEastWestConnectionsTileMap
 | 
						call LoadEastWestConnectionsTileMap
 | 
				
			||||||
.eastConnection
 | 
					.eastConnection
 | 
				
			||||||
	ld a, [wMapConn4Ptr]
 | 
						ld a, [wEastConnectedMap]
 | 
				
			||||||
	cp $ff
 | 
						cp $ff
 | 
				
			||||||
	jr z, .done
 | 
						jr z, .done
 | 
				
			||||||
	call SwitchToMapRomBank
 | 
						call SwitchToMapRomBank
 | 
				
			||||||
| 
						 | 
					@ -1003,7 +1003,7 @@ LoadTileBlockMap::
 | 
				
			||||||
	ld e, a
 | 
						ld e, a
 | 
				
			||||||
	ld a, [wEastConnectionStripDest + 1]
 | 
						ld a, [wEastConnectionStripDest + 1]
 | 
				
			||||||
	ld d, a
 | 
						ld d, a
 | 
				
			||||||
	ld a, [wEastConnectionStripHeight]
 | 
						ld a, [wEastConnectionStripLength]
 | 
				
			||||||
	ld b, a
 | 
						ld b, a
 | 
				
			||||||
	ld a, [wEastConnectedMapWidth]
 | 
						ld a, [wEastConnectedMapWidth]
 | 
				
			||||||
	ldh [hEastWestConnectedMapWidth], a
 | 
						ldh [hEastWestConnectedMapWidth], a
 | 
				
			||||||
| 
						 | 
					@ -2046,32 +2046,32 @@ LoadMapHeader::
 | 
				
			||||||
	jr nz, .copyFixedHeaderLoop
 | 
						jr nz, .copyFixedHeaderLoop
 | 
				
			||||||
; initialize all the connected maps to disabled at first, before loading the actual values
 | 
					; initialize all the connected maps to disabled at first, before loading the actual values
 | 
				
			||||||
	ld a, $ff
 | 
						ld a, $ff
 | 
				
			||||||
	ld [wMapConn1Ptr], a
 | 
						ld [wNorthConnectedMap], a
 | 
				
			||||||
	ld [wMapConn2Ptr], a
 | 
						ld [wSouthConnectedMap], a
 | 
				
			||||||
	ld [wMapConn3Ptr], a
 | 
						ld [wWestConnectedMap], a
 | 
				
			||||||
	ld [wMapConn4Ptr], a
 | 
						ld [wEastConnectedMap], a
 | 
				
			||||||
; copy connection data (if any) to WRAM
 | 
					; copy connection data (if any) to WRAM
 | 
				
			||||||
	ld a, [wMapConnections]
 | 
						ld a, [wMapConnections]
 | 
				
			||||||
	ld b, a
 | 
						ld b, a
 | 
				
			||||||
.checkNorth
 | 
					.checkNorth
 | 
				
			||||||
	bit 3, b
 | 
						bit 3, b
 | 
				
			||||||
	jr z, .checkSouth
 | 
						jr z, .checkSouth
 | 
				
			||||||
	ld de, wMapConn1Ptr
 | 
						ld de, wNorthConnectionHeader
 | 
				
			||||||
	call CopyMapConnectionHeader
 | 
						call CopyMapConnectionHeader
 | 
				
			||||||
.checkSouth
 | 
					.checkSouth
 | 
				
			||||||
	bit 2, b
 | 
						bit 2, b
 | 
				
			||||||
	jr z, .checkWest
 | 
						jr z, .checkWest
 | 
				
			||||||
	ld de, wMapConn2Ptr
 | 
						ld de, wSouthConnectionHeader
 | 
				
			||||||
	call CopyMapConnectionHeader
 | 
						call CopyMapConnectionHeader
 | 
				
			||||||
.checkWest
 | 
					.checkWest
 | 
				
			||||||
	bit 1, b
 | 
						bit 1, b
 | 
				
			||||||
	jr z, .checkEast
 | 
						jr z, .checkEast
 | 
				
			||||||
	ld de, wMapConn3Ptr
 | 
						ld de, wWestConnectionHeader
 | 
				
			||||||
	call CopyMapConnectionHeader
 | 
						call CopyMapConnectionHeader
 | 
				
			||||||
.checkEast
 | 
					.checkEast
 | 
				
			||||||
	bit 0, b
 | 
						bit 0, b
 | 
				
			||||||
	jr z, .getObjectDataPointer
 | 
						jr z, .getObjectDataPointer
 | 
				
			||||||
	ld de, wMapConn4Ptr
 | 
						ld de, wEastConnectionHeader
 | 
				
			||||||
	call CopyMapConnectionHeader
 | 
						call CopyMapConnectionHeader
 | 
				
			||||||
.getObjectDataPointer
 | 
					.getObjectDataPointer
 | 
				
			||||||
	ld a, [hli]
 | 
						ld a, [hli]
 | 
				
			||||||
| 
						 | 
					@ -2094,7 +2094,7 @@ LoadMapHeader::
 | 
				
			||||||
	ld c, a
 | 
						ld c, a
 | 
				
			||||||
	ld de, wWarpEntries
 | 
						ld de, wWarpEntries
 | 
				
			||||||
.warpLoop ; one warp per loop iteration
 | 
					.warpLoop ; one warp per loop iteration
 | 
				
			||||||
	ld b, $04
 | 
						ld b, 4
 | 
				
			||||||
.warpInnerLoop
 | 
					.warpInnerLoop
 | 
				
			||||||
	ld a, [hli]
 | 
						ld a, [hli]
 | 
				
			||||||
	ld [de], a
 | 
						ld [de], a
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,16 +35,16 @@ Predef::
 | 
				
			||||||
GetPredefRegisters::
 | 
					GetPredefRegisters::
 | 
				
			||||||
; Restore the contents of register pairs
 | 
					; Restore the contents of register pairs
 | 
				
			||||||
; when GetPredefPointer was called.
 | 
					; when GetPredefPointer was called.
 | 
				
			||||||
	ld a, [wPredefRegisters + 0]
 | 
						ld a, [wPredefHL]
 | 
				
			||||||
	ld h, a
 | 
						ld h, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 1]
 | 
						ld a, [wPredefHL + 1]
 | 
				
			||||||
	ld l, a
 | 
						ld l, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 2]
 | 
						ld a, [wPredefDE]
 | 
				
			||||||
	ld d, a
 | 
						ld d, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 3]
 | 
						ld a, [wPredefDE + 1]
 | 
				
			||||||
	ld e, a
 | 
						ld e, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 4]
 | 
						ld a, [wPredefBC]
 | 
				
			||||||
	ld b, a
 | 
						ld b, a
 | 
				
			||||||
	ld a, [wPredefRegisters + 5]
 | 
						ld a, [wPredefBC + 1]
 | 
				
			||||||
	ld c, a
 | 
						ld c, a
 | 
				
			||||||
	ret
 | 
						ret
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,3 +102,14 @@ sprite_oam_struct: MACRO
 | 
				
			||||||
\1TileID::     db
 | 
					\1TileID::     db
 | 
				
			||||||
\1Attributes:: db
 | 
					\1Attributes:: db
 | 
				
			||||||
ENDM
 | 
					ENDM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					map_connection_struct: MACRO
 | 
				
			||||||
 | 
					\1ConnectedMap::            db
 | 
				
			||||||
 | 
					\1ConnectionStripSrc::      dw
 | 
				
			||||||
 | 
					\1ConnectionStripDest::     dw
 | 
				
			||||||
 | 
					\1ConnectionStripLength::   db
 | 
				
			||||||
 | 
					\1ConnectedMapWidth::       db
 | 
				
			||||||
 | 
					\1ConnectedMapYAlignment::  db
 | 
				
			||||||
 | 
					\1ConnectedMapXAlignment::  db
 | 
				
			||||||
 | 
					\1ConnectedMapViewPointer:: dw
 | 
				
			||||||
 | 
					ENDM
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -182,12 +182,12 @@ VermilionDock_1dc7c:
 | 
				
			||||||
VermilionDock_EraseSSAnne:
 | 
					VermilionDock_EraseSSAnne:
 | 
				
			||||||
; Fill the area the S.S. Anne occupies in BG map 0 with water tiles.
 | 
					; Fill the area the S.S. Anne occupies in BG map 0 with water tiles.
 | 
				
			||||||
	ld hl, wVermilionDockTileMapBuffer
 | 
						ld hl, wVermilionDockTileMapBuffer
 | 
				
			||||||
	ld bc, (5 * BG_MAP_WIDTH) + SCREEN_WIDTH
 | 
						ld bc, wVermilionDockTileMapBufferEnd - wVermilionDockTileMapBuffer
 | 
				
			||||||
	ld a, $14 ; water tile
 | 
						ld a, $14 ; water tile
 | 
				
			||||||
	call FillMemory
 | 
						call FillMemory
 | 
				
			||||||
	hlbgcoord 0, 10
 | 
						hlbgcoord 0, 10
 | 
				
			||||||
	ld de, wVermilionDockTileMapBuffer
 | 
						ld de, wVermilionDockTileMapBuffer
 | 
				
			||||||
	ld bc, (6 * BG_MAP_WIDTH) / 16
 | 
						lb bc, BANK(wVermilionDockTileMapBuffer), 12
 | 
				
			||||||
	call CopyVideoData
 | 
						call CopyVideoData
 | 
				
			||||||
 | 
					
 | 
				
			||||||
; Replace the blocks of the lower half of the ship with water blocks. This
 | 
					; Replace the blocks of the lower half of the ship with water blocks. This
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue