Merge pull request #685 from mid-kid/master

Moshi moshi? minoru enhansumentsu desu
This commit is contained in:
mid-kid
2020-02-21 21:11:36 +01:00
committed by GitHub
108 changed files with 774 additions and 774 deletions

View File

@@ -1,34 +1,34 @@
LoadTileMapToTempTileMap::
; Load wTileMap into wTempTileMap
LoadTilemapToTempTilemap::
; Load wTilemap into wTempTilemap
ldh a, [rSVBK]
push af
ld a, BANK(wTempTileMap)
ld a, BANK(wTempTilemap)
ldh [rSVBK], a
hlcoord 0, 0
decoord 0, 0, wTempTileMap
ld bc, wTileMapEnd - wTileMap
decoord 0, 0, wTempTilemap
ld bc, wTilemapEnd - wTilemap
call CopyBytes
pop af
ldh [rSVBK], a
ret
Call_LoadTempTileMapToTileMap::
SafeLoadTempTilemapToTilemap::
xor a
ldh [hBGMapMode], a
call LoadTempTileMapToTileMap
call LoadTempTilemapToTilemap
ld a, 1
ldh [hBGMapMode], a
ret
LoadTempTileMapToTileMap::
; Load wTempTileMap into wTileMap
LoadTempTilemapToTilemap::
; Load wTempTilemap into wTilemap
ldh a, [rSVBK]
push af
ld a, BANK(wTempTileMap)
ld a, BANK(wTempTilemap)
ldh [rSVBK], a
hlcoord 0, 0, wTempTileMap
hlcoord 0, 0, wTempTilemap
decoord 0, 0
ld bc, wTileMapEnd - wTileMap
ld bc, wTilemapEnd - wTilemap
call CopyBytes
pop af
ldh [rSVBK], a

View File

@@ -1,6 +1,5 @@
PrinterReceive::
homecall _PrinterReceive
ret
AskSerial::

View File

@@ -14,6 +14,7 @@ ClearJoypad::
ret
Joypad::
; This is called automatically every frame in VBlank.
; Read the joypad register and translate it to something more
; workable for use in-game. There are 8 buttons, so we can use
; one byte to contain all player input.
@@ -294,7 +295,7 @@ JoyWaitAorB::
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
ret nz
call RTC
call UpdateTimeAndPals
jr .loop
WaitButton::
@@ -412,7 +413,7 @@ PromptButton::
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
jr nz, .received_input
call RTC
call UpdateTimeAndPals
ld a, $1
ldh [hBGMapMode], a
call DelayFrame

View File

@@ -93,7 +93,7 @@ GetMapSceneID::
OverworldTextModeSwitch::
call LoadMapPart
call FarCallSwapTextboxPalettes
call SwapTextboxPalettes
ret
LoadMapPart::
@@ -1157,7 +1157,7 @@ ScrollMapUp::
ld de, wBGMapBuffer
call BackupBGMapRow
ld c, 2 * SCREEN_WIDTH
call FarCallScrollBGMapPalettes
call ScrollBGMapPalettes
ld a, [wBGMapAnchor]
ld e, a
ld a, [wBGMapAnchor + 1]
@@ -1172,7 +1172,7 @@ ScrollMapDown::
ld de, wBGMapBuffer
call BackupBGMapRow
ld c, 2 * SCREEN_WIDTH
call FarCallScrollBGMapPalettes
call ScrollBGMapPalettes
ld a, [wBGMapAnchor]
ld l, a
ld a, [wBGMapAnchor + 1]
@@ -1195,7 +1195,7 @@ ScrollMapLeft::
ld de, wBGMapBuffer
call BackupBGMapColumn
ld c, 2 * SCREEN_HEIGHT
call FarCallScrollBGMapPalettes
call ScrollBGMapPalettes
ld a, [wBGMapAnchor]
ld e, a
ld a, [wBGMapAnchor + 1]
@@ -1210,7 +1210,7 @@ ScrollMapRight::
ld de, wBGMapBuffer
call BackupBGMapColumn
ld c, 2 * SCREEN_HEIGHT
call FarCallScrollBGMapPalettes
call ScrollBGMapPalettes
ld a, [wBGMapAnchor]
ld e, a
and %11100000

View File

@@ -194,7 +194,7 @@ MenuBoxCoord2Tile::
ld b, a
Coord2Tile::
; Return the address of wTileMap(c, b) in hl.
; Return the address of wTilemap(c, b) in hl.
xor a
ld h, a
ld l, b
@@ -221,7 +221,7 @@ MenuBoxCoord2Attr::
ld b, a
Coord2Attr::
; Return the address of wAttrMap(c, b) in hl.
; Return the address of wAttrmap(c, b) in hl.
xor a
ld h, a
ld l, b
@@ -237,6 +237,6 @@ Coord2Attr::
xor a
ld b, a
add hl, bc
bccoord 0, 0, wAttrMap
bccoord 0, 0, wAttrmap
add hl, bc
ret

View File

@@ -140,7 +140,7 @@ Unreferenced_Function3ed7::
Function3eea::
push hl
push bc
ld de, wAttrMap - wTileMap
ld de, wAttrmap - wTilemap
add hl, de
inc b
inc b
@@ -165,7 +165,7 @@ Unreferenced_Function3efd::
.fill_attr
push hl
push bc
ld de, wAttrMap - wTileMap
ld de, wAttrmap - wTilemap
add hl, de
inc b
inc b
@@ -178,7 +178,7 @@ Unreferenced_Function3efd::
ret
Function3f20::
hlcoord 0, 0, wAttrMap
hlcoord 0, 0, wAttrmap
ld b, 6
ld c, 20
call Function3f35

View File

@@ -125,10 +125,10 @@ GetPokemonName::
ld e, a
ld h, 0
ld l, a
add hl, hl ; hl = hl * 4
add hl, hl ; hl = hl * 4
add hl, de ; hl = (hl*4) + de
add hl, hl ; hl = (5*hl) + (5*hl)
add hl, hl
add hl, hl
add hl, de
add hl, hl
ld de, PokemonNames
add hl, de
@@ -185,13 +185,13 @@ GetTMHMName::
ld hl, .HMText
ld bc, .HMTextEnd - .HMText
jr .asm_34a1
jr .copy
.TM:
ld hl, .TMText
ld bc, .TMTextEnd - .TMText
.asm_34a1
.copy
ld de, wStringBuffer1
call CopyBytes
@@ -205,20 +205,20 @@ GetTMHMName::
; HM numbers start from 51, not 1
pop af
ld a, c
jr c, .asm_34b9
jr c, .not_hm
sub NUM_TMS
.asm_34b9
.not_hm
; Divide and mod by 10 to get the top and bottom digits respectively
ld b, "0"
.mod10
sub 10
jr c, .asm_34c2
jr c, .done_mod
inc b
jr .mod10
.asm_34c2
add 10
.done_mod
add 10
push af
ld a, b
ld [de], a

View File

@@ -319,10 +319,10 @@ ReloadSpritesNoPalettes::
call DelayFrame
ret
FarCallSwapTextboxPalettes::
homecall SwapTextboxPalettes
SwapTextboxPalettes::
homecall _SwapTextboxPalettes
ret
FarCallScrollBGMapPalettes::
homecall ScrollBGMapPalettes
ScrollBGMapPalettes::
homecall _ScrollBGMapPalettes
ret

View File

@@ -1,4 +1,4 @@
RTC::
UpdateTimeAndPals::
; update time and time-sensitive palettes
; rtc enabled?

View File

@@ -273,13 +273,13 @@ Serial_ExchangeLinkMenuSelection::
ret
Serial_PrintWaitingTextAndSyncAndExchangeNybble::
call LoadTileMapToTempTileMap
call LoadTilemapToTempTilemap
callfar PlaceWaitingText
call WaitLinkTransfer
jp Call_LoadTempTileMapToTileMap
jp SafeLoadTempTilemapToTilemap
Serial_SyncAndExchangeNybble::
call LoadTileMapToTempTileMap
call LoadTilemapToTempTilemap
callfar PlaceWaitingText
jp WaitLinkTransfer

View File

@@ -17,16 +17,16 @@ PushLYOverrides::
ld [wRequested2bpp], a
ret
_InitSpriteAnimStruct::
InitSpriteAnimStruct::
ld [wSpriteAnimIDBuffer], a
ldh a, [hROMBank]
push af
ld a, BANK(InitSpriteAnimStruct)
ld a, BANK(_InitSpriteAnimStruct)
rst Bankswitch
ld a, [wSpriteAnimIDBuffer]
call InitSpriteAnimStruct
call _InitSpriteAnimStruct
pop af
rst Bankswitch

View File

@@ -19,12 +19,12 @@ FillBoxWithByte::
jr nz, .row
ret
ClearTileMap::
; Fill wTileMap with blank tiles.
ClearTilemap::
; Fill wTilemap with blank tiles.
hlcoord 0, 0
ld a, " "
ld bc, wTileMapEnd - wTileMap
ld bc, wTilemapEnd - wTilemap
call ByteFill
; Update the BG Map.
@@ -35,10 +35,10 @@ ClearTileMap::
ClearScreen::
ld a, PAL_BG_TEXT
hlcoord 0, 0, wAttrMap
hlcoord 0, 0, wAttrmap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
jr ClearTileMap
jr ClearTilemap
Textbox::
; Draw a text box at hl with room for b lines of c characters each.
@@ -99,7 +99,7 @@ TextboxBorder::
TextboxPalette::
; Fill text box width c height b at hl with pal 7
ld de, wAttrMap - wTileMap
ld de, wAttrmap - wTilemap
add hl, de
inc b
inc b
@@ -422,7 +422,7 @@ LineFeedChar::
CarriageReturnChar::
pop hl
push de
ld bc, -wTileMap + $10000
ld bc, -wTilemap + $10000
add hl, bc
ld de, -SCREEN_WIDTH
ld c, 1

View File

@@ -61,7 +61,7 @@ CopyTilemapAtOnce::
jr .CopyTilemapAtOnce
; unused
farcall HDMATransferAttrMapAndTileMapToWRAMBank3
farcall HDMATransferAttrmapAndTilemapToWRAMBank3
ret
.CopyTilemapAtOnce:
@@ -83,7 +83,7 @@ CopyTilemapAtOnce::
di
ld a, BANK(vTiles3)
ldh [rVBK], a
hlcoord 0, 0, wAttrMap
hlcoord 0, 0, wAttrmap
call .StackPointerMagic
ld a, BANK(vTiles0)
ldh [rVBK], a

View File

@@ -1,6 +1,6 @@
; Functions relating to the timer interrupt and the real-time-clock.
AskTimer::
Unreferenced_Timer::
push af
ldh a, [hMobile]
and a
@@ -195,7 +195,7 @@ InitTime::
farcall _InitTime
ret
PanicResetClock::
ClearClock::
call .ClearhRTC
call SetClock
ret

View File

@@ -114,7 +114,7 @@ WaitTop::
ret
UpdateBGMap::
; Update the BG Map, in thirds, from wTileMap and wAttrMap.
; Update the BG Map, in thirds, from wTilemap and wAttrmap.
ldh a, [hBGMapMode]
and a
@@ -159,7 +159,7 @@ UpdateBGMap::
ld a, 1
ldh [rVBK], a
hlcoord 0, 0, wAttrMap
hlcoord 0, 0, wAttrmap
call .update
ld a, 0
@@ -234,7 +234,7 @@ THIRD_HEIGHT EQU SCREEN_HEIGHT / 3
; Rows of tiles in a third
ld a, SCREEN_HEIGHT / 3
; Discrepancy between wTileMap and BGMap
; Discrepancy between wTilemap and BGMap
ld bc, BG_MAP_WIDTH - (SCREEN_WIDTH - 1)
.row

View File

@@ -6,7 +6,7 @@ RefreshScreen::
rst Bankswitch
call ReanchorBGMap_NoOAMUpdate
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
call LoadFonts_NoOAMUpdate
pop af
@@ -32,7 +32,7 @@ CloseText::
xor a
ldh [hBGMapMode], a
call OverworldTextModeSwitch
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
xor a
ldh [hBGMapMode], a
call SafeUpdateSprites
@@ -52,20 +52,20 @@ OpenText::
call ReanchorBGMap_NoOAMUpdate ; clear bgmap
call SpeechTextbox
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap ; anchor bgmap
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap ; anchor bgmap
call LoadFonts_NoOAMUpdate ; load font
pop af
rst Bankswitch
ret
_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap::
_OpenAndCloseMenu_HDMATransferTilemapAndAttrmap::
ldh a, [hOAMUpdate]
push af
ld a, $1
ldh [hOAMUpdate], a
farcall OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
farcall OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
pop af
ldh [hOAMUpdate], a