summaryrefslogtreecommitdiff
path: root/engine/debug/debug_menu.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-15 13:35:39 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-15 13:35:39 -0400
commit4b4ad9894eb165de673346348493e02d83549746 (patch)
tree20c078b267b5b35055f30e64e726931e63031166 /engine/debug/debug_menu.asm
parent87f24a885d888411d715171d75163bd59a609b41 (diff)
Disassemble the BLUEMONS.GB debug ROM
Diffstat (limited to 'engine/debug/debug_menu.asm')
-rw-r--r--engine/debug/debug_menu.asm115
1 files changed, 115 insertions, 0 deletions
diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm
new file mode 100644
index 00000000..02280db0
--- /dev/null
+++ b/engine/debug/debug_menu.asm
@@ -0,0 +1,115 @@
+DebugMenu:
+IF DEF(_DEBUG)
+ call ClearScreen
+
+ ld hl, DebugPlayerName
+ ld de, wPlayerName
+ ld bc, NAME_LENGTH
+ call CopyData
+
+ ld hl, DebugRivalName
+ ld de, wRivalName
+ ld bc, NAME_LENGTH
+ call CopyData
+
+ call LoadFontTilePatterns
+ call LoadHpBarAndStatusTilePatterns
+ call ClearSprites
+ call RunDefaultPaletteCommand
+
+ hlcoord 5, 6
+ ld b, 3
+ ld c, 9
+ call TextBoxBorder
+
+ hlcoord 7, 7
+ ld de, DebugMenuOptions
+ call PlaceString
+
+ ld a, 3 ; medium speed
+ ld [wOptions], a
+
+ ld a, A_BUTTON | B_BUTTON | START
+ ld [wMenuWatchedKeys], a
+ xor a
+ ld [wMenuJoypadPollCount], a
+ inc a
+ ld [wMaxMenuItem], a
+ ld a, 7
+ ld [wTopMenuItemY], a
+ dec a
+ ld [wTopMenuItemX], a
+ xor a
+ ld [wCurrentMenuItem], a
+ ld [wLastMenuItem], a
+ ld [wMenuWatchMovingOutOfBounds], a
+
+ call HandleMenuInput
+ bit BIT_B_BUTTON, a
+ jp nz, DisplayTitleScreen
+
+ ld a, [wCurrentMenuItem]
+ and a ; FIGHT?
+ jp z, TestBattle
+
+ ; DEBUG
+ ld hl, wd732
+ set 1, [hl]
+ jp StartNewGameDebug
+
+DebugPlayerName:
+ db "Tom@"
+
+DebugRivalName:
+ db "Juerry@"
+
+DebugMenuOptions:
+ db "FIGHT"
+ next "DEBUG@"
+ELSE
+ ret
+ENDC
+
+TestBattle:
+.loop
+ call GBPalNormal
+
+ ; Don't mess around
+ ; with obedience.
+ ld a, 1 << BIT_EARTHBADGE
+ ld [wObtainedBadges], a
+
+ ld hl, wFlags_D733
+ set BIT_TEST_BATTLE, [hl]
+
+ ; Reset the party.
+ ld hl, wPartyCount
+ xor a
+ ld [hli], a
+ dec a
+ ld [hl], a
+
+ ; Give the player a
+ ; level 20 Rhydon.
+ ld a, RHYDON
+ ld [wcf91], a
+ ld a, 20
+ ld [wCurEnemyLVL], a
+ xor a
+ ld [wMonDataLocation], a
+ ld [wCurMap], a
+ call AddPartyMon
+
+ ; Fight against a
+ ; level 20 Rhydon.
+ ld a, RHYDON
+ ld [wCurOpponent], a
+
+ predef InitOpponent
+
+ ; When the battle ends,
+ ; do it all again.
+ ld a, 1
+ ld [wUpdateSpritesEnabled], a
+ ldh [hAutoBGTransferEnabled], a
+ jr .loop