summaryrefslogtreecommitdiff
path: root/engine/games
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2018-08-25 22:23:45 -0400
committerGitHub <noreply@github.com>2018-08-25 22:23:45 -0400
commit3eacab563d0e1ab5557c2443556a7a5e58d14cad (patch)
tree3d747166409fdc94f0fd1aa760693a7ee5bd2156 /engine/games
parent89681d231611938a791f4256e602c88c2f9aa3e1 (diff)
parentb2adcd6d6ff91efc764a6ecc65147be7b9cda9e8 (diff)
Merge pull request #555 from Rangi42/ldh
Use real labels for HRAM instead of constants, and the ldh instruction
Diffstat (limited to 'engine/games')
-rw-r--r--engine/games/card_flip.asm40
-rw-r--r--engine/games/dummy_game.asm14
-rw-r--r--engine/games/slot_machine.asm18
-rw-r--r--engine/games/unown_puzzle.asm24
4 files changed, 48 insertions, 48 deletions
diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm
index 805a3ca71..ce85b60a4 100644
--- a/engine/games/card_flip.asm
+++ b/engine/games/card_flip.asm
@@ -147,10 +147,10 @@ _CardFlip:
ld de, SFX_TRANSACTION
call PlaySFX
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call CardFlip_PrintCoinBalance
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call WaitSFX
call .Increment
ret
@@ -162,7 +162,7 @@ _CardFlip:
.ChooseACard:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 0
lb bc, 12, 9
call CardFlip_FillGreenBox
@@ -172,13 +172,13 @@ _CardFlip:
call AddNTimes
ld [hl], CARDFLIP_LIGHT_ON
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld c, 20
call DelayFrames
hlcoord 2, 0
call PlaceCardFaceDown
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld c, 20
call DelayFrames
hlcoord 2, 6
@@ -190,7 +190,7 @@ _CardFlip:
ld [wCardFlipWhichCard], a
.loop
call JoyTextDelay
- ld a, [hJoyLast]
+ ldh a, [hJoyLast]
and A_BUTTON
jr nz, .next
ld de, SFX_KINESIS
@@ -242,7 +242,7 @@ _CardFlip:
call CardFlip_UpdateCoinBalanceDisplay
.betloop
call JoyTextDelay
- ld a, [hJoyLast]
+ ldh a, [hJoyLast]
and A_BUTTON
jr nz, .betdone
call ChooseCard_HandleJoypad
@@ -261,7 +261,7 @@ _CardFlip:
.CheckTheCard:
xor a
- ld [hVBlankCounter], a
+ ldh [hVBlankCounter], a
call CardFlip_UpdateCursorOAM
call WaitSFX
ld de, SFX_CHOOSE_A_CARD
@@ -311,7 +311,7 @@ _CardFlip:
jr c, .KeepTheCurrentDeck
call CardFlip_InitTilemap
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call CardFlip_ShuffleDeck
ld hl, .CardsShuffledText
call PrintText
@@ -396,7 +396,7 @@ GetCoordsOfChosenCard:
PlaceCardFaceDown:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld de, .FaceDownCardTilemap
lb bc, 6, 5
call CardFlip_CopyToBox
@@ -412,7 +412,7 @@ PlaceCardFaceDown:
CardFlip_DisplayCardFaceUp:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
push hl
push hl
; Flip the card face up.
@@ -458,7 +458,7 @@ CardFlip_DisplayCardFaceUp:
pop hl
; Pointless CGB check
- ld a, [hCGB]
+ ldh a, [hCGB]
and a
ret z
@@ -519,7 +519,7 @@ CardFlip_PrintCoinBalance:
CardFlip_InitTilemap:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld a, $29
@@ -607,7 +607,7 @@ CardFlip_ShiftDigitsLeftTwoPixels:
CardFlip_BlankDiscardedCardSlot:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld a, [wCardFlipFaceUpCard]
ld e, a
ld d, 0
@@ -1327,10 +1327,10 @@ ChooseCard_HandleJoypad:
CardFlip_UpdateCursorOAM:
call ClearSprites
- ld a, [hCGB]
+ ldh a, [hCGB]
and a
jr nz, .skip
- ld a, [hVBlankCounter]
+ ldh a, [hVBlankCounter]
and $4
ret nz
@@ -1560,7 +1560,7 @@ ENDM
dsprite 1, 0, 1, 0, $00, 0 | X_FLIP | Y_FLIP | PRIORITY
CardFlip_InitAttrPals:
- ld a, [hCGB]
+ ldh a, [hCGB]
and a
ret z
@@ -1594,16 +1594,16 @@ CardFlip_InitAttrPals:
ld a, $1
call CardFlip_FillBox
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
- ld [rSVBK], a
+ ldh [rSVBK], a
ld hl, .palettes
ld de, wBGPals1
ld bc, 9 palettes
call CopyBytes
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
ret
.palettes
diff --git a/engine/games/dummy_game.asm b/engine/games/dummy_game.asm
index c500dbf66..b637dd6a1 100644
--- a/engine/games/dummy_game.asm
+++ b/engine/games/dummy_game.asm
@@ -28,14 +28,14 @@ _DummyGame:
xor a
call ByteFill
xor a
- ld [hSCY], a
- ld [hSCX], a
- ld [rWY], a
+ ldh [hSCY], a
+ ldh [hSCX], a
+ ldh [rWY], a
ld [wJumptableIndex], a
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld a, LCDC_DEFAULT
- ld [rLCDC], a
+ ldh [rLCDC], a
ld a, $e4
call DmgToCgbBGPals
ld a, $e0
@@ -200,7 +200,7 @@ endr
ret
.RevealAll:
- ld a, [hJoypadPressed]
+ ldh a, [hJoypadPressed]
and A_BUTTON
ret z
xor a
@@ -500,7 +500,7 @@ DummyGame_InterpretJoypad_AnimateCursor:
cp $7
jr nc, .quit
call JoyTextDelay
- ld hl, hJoypadPressed ; $ffa3
+ ld hl, hJoypadPressed
ld a, [hl]
and A_BUTTON
jr nz, .pressed_a
diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm
index 0e7a566b9..72f9c400f 100644
--- a/engine/games/slot_machine.asm
+++ b/engine/games/slot_machine.asm
@@ -167,7 +167,7 @@ Slots_GetPals:
ld a, %11100100
call DmgToCgbBGPals
lb de, %11100100, %11100100
- ld a, [hCGB]
+ ldh a, [hCGB]
and a
jr nz, .cgb
lb de, %11000000, %11100100
@@ -214,7 +214,7 @@ SlotsLoop:
ld a, [wTextDelayFrames]
and $7
ret nz
- ld a, [rBGP]
+ ldh a, [rBGP]
xor %00001100
call DmgToCgbBGPals
ret
@@ -343,7 +343,7 @@ SlotsAction_WaitStart:
.proceed
call SlotsAction_Next
xor a
- ld [hJoypadSum], a
+ ldh [hJoypadSum], a
ret
SlotsAction_WaitReel1:
@@ -365,7 +365,7 @@ SlotsAction_WaitStopReel1:
call Slots_LoadReelState
call SlotsAction_Next
xor a
- ld [hJoypadSum], a
+ ldh [hJoypadSum], a
SlotsAction_WaitReel2:
ld hl, hJoypadSum
ld a, [hl]
@@ -385,7 +385,7 @@ SlotsAction_WaitStopReel2:
call Slots_LoadReelState
call SlotsAction_Next
xor a
- ld [hJoypadSum], a
+ ldh [hJoypadSum], a
SlotsAction_WaitReel3:
ld hl, hJoypadSum
ld a, [hl]
@@ -405,7 +405,7 @@ SlotsAction_WaitStopReel3:
call Slots_LoadReelState
call SlotsAction_Next
xor a
- ld [hJoypadSum], a
+ ldh [hJoypadSum], a
ret
SlotsAction_FlashIfWin:
@@ -429,7 +429,7 @@ SlotsAction_FlashScreen:
srl a
ret z
- ld a, [rOBP0]
+ ldh a, [rOBP0]
xor $ff
ld e, a
ld d, a
@@ -2042,7 +2042,7 @@ Slots_AnimateGolem:
xor $ff
inc a
ld [hl], a
- ld [hSCY], a
+ ldh [hSCY], a
ret
.restart
@@ -2050,7 +2050,7 @@ Slots_AnimateGolem:
add hl, bc
xor a
ld [hl], a
- ld [hSCY], a
+ ldh [hSCY], a
ret
Slots_AnimateChansey:
diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm
index 40c6527d9..f6bbd18d2 100644
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -4,15 +4,15 @@ PUZZLE_VOID EQU $ef
puzcoord EQUS "* 6 +"
_UnownPuzzle:
- ld a, [hInMenu]
+ ldh a, [hInMenu]
push af
ld a, $1
- ld [hInMenu], a
+ ldh [hInMenu], a
call ClearBGPalettes
call ClearTileMap
call ClearSprites
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call DisableLCD
ld hl, wc608 ; includes wPuzzlePieces
ld bc, wc7e8 - wc608
@@ -38,15 +38,15 @@ _UnownPuzzle:
call UnownPuzzle_UpdateTilemap
call PlaceStartCancelBox
xor a
- ld [hSCY], a
- ld [hSCX], a
- ld [rWY], a
+ ldh [hSCY], a
+ ldh [hSCX], a
+ ldh [rWY], a
ld [wJumptableIndex], a
ld [wHoldingUnownPuzzlePiece], a
ld [wUnownPuzzleCursorPosition], a
ld [wUnownPuzzleHeldPiece], a
ld a, %10010011
- ld [rLCDC], a
+ ldh [rLCDC], a
call WaitBGMap
ld b, SCGB_UNOWN_PUZZLE
call GetSGBLayout
@@ -66,7 +66,7 @@ _UnownPuzzle:
ld a, [wHoldingUnownPuzzlePiece]
and a
jr nz, .holding_piece
- ld a, [hVBlankCounter]
+ ldh a, [hVBlankCounter]
and $10
jr z, .clear
.holding_piece
@@ -81,12 +81,12 @@ _UnownPuzzle:
.quit
pop af
- ld [hInMenu], a
+ ldh [hInMenu], a
call ClearBGPalettes
call ClearTileMap
call ClearSprites
ld a, LCDC_DEFAULT
- ld [rLCDC], a
+ ldh [rLCDC], a
ret
InitUnownPuzzlePiecePositions:
@@ -185,10 +185,10 @@ UnownPuzzleJumptable:
dw .Function
.Function:
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
and START
jp nz, UnownPuzzle_Quit
- ld a, [hJoyPressed]
+ ldh a, [hJoyPressed]
and A_BUTTON
jp nz, UnownPuzzle_A
ld hl, hJoyLast