Harmonize home/ with pokegold

This commit is contained in:
Rangi 2020-06-16 15:49:32 -04:00
parent 7b2515d1e4
commit c552390a15
11 changed files with 49 additions and 42 deletions

View File

@ -211,7 +211,7 @@
; Japanese control characters (see home/text.asm)
charmap "<JP_18>", $18 ; "ノ゛"? (ungrammatical)
charmap "<JP_18>", $18 ; "ノ゛" (ungrammatical)
charmap "<NI>", $1d ; "に "
charmap "<TTE>", $1e ; "って"
charmap "<WO>", $1f ; "を "

View File

@ -16,13 +16,13 @@ GameTimer::
ld a, BANK(wGameTime)
ldh [rSVBK], a
call UpdateGameTimer
call .Function
pop af
ldh [rSVBK], a
ret
UpdateGameTimer::
.Function
; Increment the game timer by one frame.
; The game timer is capped at 999:59:59.00.

View File

@ -1,4 +1,5 @@
; Functions to copy data from ROM.
TILES_PER_CYCLE EQU 8
MOBILE_TILES_PER_CYCLE EQU 6
Get2bppViaHDMA::
ldh a, [rLCDC]
@ -31,7 +32,7 @@ FarCopyBytesDouble_DoubleBankSwitch::
rst Bankswitch
ret
UnreferencedOldDMATransfer:
Unreferenced_DMATransfer:
dec c
ldh a, [hBGMapMode]
push af
@ -55,12 +56,12 @@ UnreferencedOldDMATransfer:
ld a, l
and $f0
ldh [rHDMA4], a ; target LSB
; stop when c < 8
; stop when c < TILES_PER_CYCLE
ld a, c
cp $8
cp TILES_PER_CYCLE
jr c, .done
; decrease c by 8
sub $8
; decrease c by TILES_PER_CYCLE
sub TILES_PER_CYCLE
ld c, a
; DMA transfer state
ld a, $f
@ -198,7 +199,7 @@ Request2bpp::
ldh a, [hTilesPerCycle]
push af
ld a, $8
ld a, TILES_PER_CYCLE
ldh [hTilesPerCycle], a
ld a, [wLinkMode]
@ -207,7 +208,7 @@ Request2bpp::
ldh a, [hMobile]
and a
jr nz, .NotMobile
ld a, $6
ld a, MOBILE_TILES_PER_CYCLE
ldh [hTilesPerCycle], a
.NotMobile:
@ -223,7 +224,7 @@ Request2bpp::
ld a, c
ld hl, hTilesPerCycle
cp [hl]
jr nc, .iterate
jr nc, .cycle
ld [wRequested2bpp], a
.wait
@ -242,7 +243,7 @@ Request2bpp::
ldh [hBGMapMode], a
ret
.iterate
.cycle
ldh a, [hTilesPerCycle]
ld [wRequested2bpp], a
@ -272,7 +273,7 @@ Request1bpp::
ldh a, [hTilesPerCycle]
push af
ld a, $8
ld a, TILES_PER_CYCLE
ldh [hTilesPerCycle], a
ld a, [wLinkMode]
@ -281,7 +282,7 @@ Request1bpp::
ldh a, [hMobile]
and a
jr nz, .NotMobile
ld a, $6
ld a, MOBILE_TILES_PER_CYCLE
ldh [hTilesPerCycle], a
.NotMobile:
@ -297,7 +298,7 @@ Request1bpp::
ld a, c
ld hl, hTilesPerCycle
cp [hl]
jr nc, .iterate
jr nc, .cycle
ld [wRequested1bpp], a
.wait
@ -316,7 +317,7 @@ Request1bpp::
ldh [hBGMapMode], a
ret
.iterate
.cycle
ldh a, [hTilesPerCycle]
ld [wRequested1bpp], a
@ -348,7 +349,7 @@ Copy2bpp:
; bank
ld a, b
; bc = c * $10
; bc = c * LEN_2BPP_TILE
push af
swap c
ld a, $f
@ -376,7 +377,7 @@ Copy1bpp::
; bank
ld a, b
; bc = c * $10 / 2
; bc = c * LEN_1BPP_TILE
push af
ld h, 0
ld l, c

View File

@ -21,15 +21,15 @@ Reset::
_Start::
cp $11
jr z, .cgb
xor a
xor a ; FALSE
jr .load
.cgb
ld a, $1
ld a, TRUE
.load
ldh [hCGB], a
ld a, $1
ld a, TRUE
ldh [hSystemBooted], a
Init::
@ -74,7 +74,7 @@ Init::
or c
jr nz, .ByteFill
ld sp, wStack
ld sp, wStackTop
; Clear HRAM
ldh a, [hCGB]
@ -97,7 +97,7 @@ Init::
call ClearSprites
call ClearsScratch
ld a, BANK(GameInit) ; aka BANK(WriteOAMDMACodeToHRAM)
ld a, BANK(WriteOAMDMACodeToHRAM) ; aka BANK(GameInit)
rst Bankswitch
call WriteOAMDMACodeToHRAM
@ -142,7 +142,7 @@ Init::
farcall StartClock
xor a
xor a ; SRAM_DISABLE
ld [MBC3LatchClock], a
ld [MBC3SRamEnable], a
@ -160,7 +160,7 @@ Init::
call DelayFrame
predef InitSGBBorder ; SGB init
predef InitSGBBorder
call InitSound
xor a

View File

@ -15,7 +15,7 @@ LCD::
and a
jr z, .done
; At this point it's assumed we're in WRAM bank 5!
; At this point it's assumed we're in BANK(wLYOverrides)!
push bc
ldh a, [rLY]
ld c, a

View File

@ -116,8 +116,8 @@ RestoreTileBackup::
ret
PopWindow::
ld b, $10
ld de, wMenuFlags
ld b, wMenuHeaderEnd - wMenuHeader
ld de, wMenuHeader
.loop
ld a, [hld]
ld [de], a
@ -148,8 +148,8 @@ CopyMenuData::
ld a, [hli]
ld h, [hl]
ld l, a
ld de, wMenuDataFlags
ld bc, wMenuDataEnd - wMenuDataFlags
ld de, wMenuData
ld bc, wMenuDataEnd - wMenuData
call CopyBytes
pop af
pop bc

View File

@ -81,6 +81,7 @@ DmgToCgbBGPals::
push hl
push de
push bc
ldh a, [rSVBK]
push af
@ -102,6 +103,7 @@ DmgToCgbBGPals::
pop af
ldh [rSVBK], a
pop bc
pop de
pop hl
@ -127,6 +129,7 @@ DmgToCgbObjPals::
push hl
push de
push bc
ldh a, [rSVBK]
push af
@ -148,6 +151,7 @@ DmgToCgbObjPals::
pop af
ldh [rSVBK], a
pop bc
pop de
pop hl

View File

@ -15,7 +15,7 @@ _CheckTrainerBattle::
; Skip the player object.
ld a, 1
ld de, wMapObjects + MAPOBJECT_LENGTH
ld de, wMap1Object
.loop

View File

@ -184,8 +184,8 @@ VBlank1::
call Serve2bppRequest_VBlank
call hTransferVirtualOAM
.done
.done
xor a
ld [wVBlankOccurred], a

View File

@ -31,8 +31,9 @@ UpdateBGMapBuffer::
ldh a, [rVBK]
push af
ld [hSPBuffer], sp
; Relocate the stack pointer to wBGMapBufferPtrs
ld [hSPBuffer], sp
ld hl, wBGMapBufferPtrs
ld sp, hl
@ -80,6 +81,7 @@ endr
jr nz, .next
; Restore the stack pointer
ldh a, [hSPBuffer]
ld l, a
ldh a, [hSPBuffer + 1]

View File

@ -242,14 +242,14 @@ link_battle_record: MACRO
ENDM
trademon: MACRO
\1Species:: db ; wc6d0 | wc702
\1SpeciesName:: ds MON_NAME_LENGTH ; wc6d1 | wc703
\1Nickname:: ds MON_NAME_LENGTH ; wc6dc | wc70e
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
\1DVs:: dw ; wc6fd | wc72f
\1ID:: dw ; wc6ff | wc731
\1CaughtData:: db ; wc701 | wc733
\1Species:: db
\1SpeciesName:: ds MON_NAME_LENGTH
\1Nickname:: ds MON_NAME_LENGTH
\1SenderName:: ds NAME_LENGTH
\1OTName:: ds NAME_LENGTH
\1DVs:: dw
\1ID:: dw
\1CaughtData:: db
\1End::
ENDM