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