Merge pull request #660 from mid-kid/master

Make the map setup commands match the actual function names better
This commit is contained in:
Rangi
2020-01-04 20:08:43 -05:00
committed by GitHub
24 changed files with 233 additions and 225 deletions

View File

@@ -1,6 +1,6 @@
; Audio interfaces.
MapSetup_Sound_Off::
InitSound::
push hl
push de
push bc
@@ -8,11 +8,11 @@ MapSetup_Sound_Off::
ldh a, [hROMBank]
push af
ld a, BANK(_MapSetup_Sound_Off)
ld a, BANK(_InitSound)
ldh [hROMBank], a
ld [MBC3RomBank], a
call _MapSetup_Sound_Off
call _InitSound
pop af
ldh [hROMBank], a
@@ -71,7 +71,7 @@ PlayMusic::
ldh a, [hROMBank]
push af
ld a, BANK(_PlayMusic) ; aka BANK(_MapSetup_Sound_Off)
ld a, BANK(_PlayMusic) ; aka BANK(_InitSound)
ldh [hROMBank], a
ld [MBC3RomBank], a
@@ -83,7 +83,7 @@ PlayMusic::
jr .end
.nomusic
call _MapSetup_Sound_Off
call _InitSound
.end
pop af
@@ -359,7 +359,8 @@ PlayMapMusic::
pop hl
ret
EnterMapMusic::
PlayMapMusicBike::
; If the player's on a bike, play the bike music instead of the map music
push hl
push de
push bc

View File

@@ -272,9 +272,9 @@ Request1bpp::
ldh a, [hTilesPerCycle]
push af
ld a, $8
ldh [hTilesPerCycle], a
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, .NotMobile

View File

@@ -1,6 +1,6 @@
Reset::
di
call MapSetup_Sound_Off
call InitSound
xor a
ldh [hMapAnims], a
call ClearPalettes
@@ -162,7 +162,7 @@ Init::
predef InitSGBBorder ; SGB init
call MapSetup_Sound_Off
call InitSound
xor a
ld [wMapMusic], a
jp GameInit

View File

@@ -338,6 +338,12 @@ JoyTextDelay::
ret
WaitPressAorB_BlinkCursor::
; Show a blinking cursor in the lower right-hand
; corner of a textbox and wait until A or B is
; pressed.
;
; NOTE: The cursor has to be shown before calling
; this function or no cursor will be shown at all.
ldh a, [hMapObjectIndexBuffer]
push af
ldh a, [hObjectStructIndexBuffer]
@@ -373,6 +379,9 @@ SimpleWaitPressAorB::
ret
PromptButton::
; Show a blinking cursor in the lower right-hand
; corner of a textbox and wait until A or B is
; pressed, afterwards, play a sound.
ld a, [wLinkMode]
and a
jr nz, .link

View File

@@ -381,11 +381,11 @@ LoadMapAttributes::
call CopyMapPartialAndAttributes
call SwitchToMapScriptsBank
call ReadMapScripts
xor a ; do not skip object_events
xor a ; do not skip object events
call ReadMapEvents
ret
LoadMapAttributes_SkipPeople::
LoadMapAttributes_SkipObjects::
call CopyMapPartialAndAttributes
call SwitchToMapScriptsBank
call ReadMapScripts
@@ -657,7 +657,7 @@ ClearObjectStructs::
jr nz, .loop
ret
RestoreFacingAfterWarp::
GetWarpDestCoords::
call GetMapScriptsBank
rst Bankswitch
@@ -685,7 +685,7 @@ endr
call .backup
.skip
farcall GetCoordOfUpperLeftCorner
farcall GetMapScreenCoords
ret
.backup
@@ -1438,7 +1438,7 @@ SaveScreen::
.vertical
ld b, SCREEN_META_WIDTH
ld c, SCREEN_META_HEIGHT - 1
jr SaveScreen_LoadNeighbor
jr SaveScreen_LoadConnection
.left
ld de, wScreenSave + 1
@@ -1450,9 +1450,9 @@ SaveScreen::
.horizontal
ld b, SCREEN_META_WIDTH - 1
ld c, SCREEN_META_HEIGHT
jr SaveScreen_LoadNeighbor
jr SaveScreen_LoadConnection
LoadNeighboringBlockData::
LoadConnectionBlockData::
ld hl, wOverworldMapAnchor
ld a, [hli]
ld h, [hl]
@@ -1464,7 +1464,7 @@ LoadNeighboringBlockData::
ld b, SCREEN_META_WIDTH
ld c, SCREEN_META_HEIGHT
SaveScreen_LoadNeighbor::
SaveScreen_LoadConnection::
.row
push bc
push hl
@@ -1481,7 +1481,6 @@ SaveScreen_LoadNeighbor::
ld e, a
jr nc, .okay
inc d
.okay
pop hl
ldh a, [hConnectionStripLength]
@@ -2260,7 +2259,7 @@ GetFishingGroup::
pop de
ret
LoadTileset::
LoadMapTileset::
push hl
push bc

View File

@@ -39,7 +39,7 @@ CloseText::
ld a, $90
ldh [hWY], a
call ReplaceKrisSprite
farcall ReturnFromMapSetupScript
farcall InitMapNameSign
farcall LoadOverworldFont
ret