aboutsummaryrefslogtreecommitdiffstats
path: root/engine/slop_menu.asm
diff options
context:
space:
mode:
authorAsh Ketchum <no-reply@sl0p.foo>2026-07-15 02:08:54 +0200
committerAsh Ketchum <no-reply@sl0p.foo>2026-07-15 02:08:54 +0200
commit297203b2c127c232c83fd5ffb9c8a91b761bcc70 (patch)
treee313939b4b7c0fcacf44442aaa6b3642c7c146be /engine/slop_menu.asm
parentmenu: SL0P MENU scaffolding with WARP as a submenu (diff)
downloadpokeyellow-297203b2c127c232c83fd5ffb9c8a91b761bcc70.tar.gz
pokeyellow-297203b2c127c232c83fd5ffb9c8a91b761bcc70.tar.xz
pokeyellow-297203b2c127c232c83fd5ffb9c8a91b761bcc70.zip
menu: cheat suite - MONEY, BADGES, DEX, MAXTEAM + ITEMS submenu
SL0P MENU grows to 7 entries: WARP - town warp submenu HEAL - full party HP + status MONEY - set cash to 999999 BADGES - all 8 gym badges DEX - mark every Pokemon owned+seen MAXTEAM - whole party to Lv100, perfect DVs, maxed EVs, 999 stats/HP ITEMS - submenu: give x99 of Master/Ultra Ball, Rare Candy, Full Restore, Max Revive, Max Elixer, PP Up, Nugget (stacks via GiveItem) All verified live: money 999999, badges FF, dex filled, party Lv100/999/FFFF DVs, Master Ball x99 in the bag.
Diffstat (limited to 'engine/slop_menu.asm')
-rw-r--r--engine/slop_menu.asm245
1 files changed, 203 insertions, 42 deletions
diff --git a/engine/slop_menu.asm b/engine/slop_menu.asm
index 56c8e8c5..140dc04b 100644
--- a/engine/slop_menu.asm
+++ b/engine/slop_menu.asm
@@ -1,35 +1,35 @@
-; SL0P MENU - a top-level menu opened with SELECT in the overworld (hooked in
-; home/overworld.asm). Table-driven so it's easy to grow: each entry has a name
-; in SlopMenuText and a handler in SlopMenuHandlers. A handler returns:
-; carry SET -> a map warp was started; exit the menu and let it proceed
+; SL0P MENU - a top-level cheat menu opened with SELECT in the overworld
+; (hooked in home/overworld.asm). Table-driven: each entry has a name in
+; SlopMenuText and a handler in SlopMenuHandlers. A handler returns:
+; carry SET -> a map warp was started; exit the menu and let it proceed
; carry CLEAR -> return to the SL0P menu (redraw)
-; Handlers may be submenus (WarpSubmenu) or direct actions (SlopHealParty).
+; Handlers may be submenus (WarpSubmenu, GiveItemSubmenu) or direct actions.
;
; To add an entry: add a "NAME" line to SlopMenuText, a `dw Handler` to
; SlopMenuHandlers, and bump SLOP_MENU_COUNT.
-DEF SLOP_MENU_COUNT EQU 2
+DEF SLOP_MENU_COUNT EQU 7
SECTION "Slop Menu", ROMX
SlopMenu::
; ---- open the menu display (shared by the top menu and every submenu) ----
ldh a, [hUILayoutFlags]
- set BIT_SINGLE_SPACED_LINES, a ; single-spaced list text
- set BIT_DOUBLE_SPACED_MENU, a ; single-spaced cursor
+ set BIT_SINGLE_SPACED_LINES, a
+ set BIT_DOUBLE_SPACED_MENU, a
ldh [hUILayoutFlags], a
ld a, $ff
- ld [wUpdateSpritesEnabled], a ; hide the overworld sprites
+ ld [wUpdateSpritesEnabled], a
call ClearSprites
.redraw
call ClearScreen
- hlcoord 5, 1
+ hlcoord 5, 0
ld de, SlopMenuTitle
call PlaceString
- hlcoord 4, 3
+ hlcoord 4, 2
lb bc, SLOP_MENU_COUNT + 2, 11
call TextBoxBorder
- hlcoord 6, 4
+ hlcoord 6, 3
ld de, SlopMenuText
call PlaceString
call SlopMenuShow
@@ -40,7 +40,7 @@ SlopMenu::
ld [wMenuJoypadPollCount], a
ld a, 5
ld [wTopMenuItemX], a
- ld a, 4
+ ld a, 3
ld [wTopMenuItemY], a
ld a, PAD_A | PAD_B
ld [wMenuWatchedKeys], a
@@ -61,10 +61,10 @@ SlopMenu::
ld l, a
ld de, .afterHandler
push de
- jp hl ; call [hl]; returns to .afterHandler
+ jp hl
.afterHandler
- jr c, .exitProceed ; handler started a warp -> let it run
- jr .redraw ; otherwise back to the SL0P menu
+ jr c, .exitProceed
+ jr .redraw
.exitProceed
call SlopMenuRestoreFlags
ret
@@ -82,8 +82,7 @@ SlopMenuRestoreFlags:
ldh [hUILayoutFlags], a
ret
-; push wTileMap into VRAM and switch on the menu window display (mirrors the
-; tail of DisplayTextIDInit) so a box drawn into wTileMap is actually shown.
+; push wTileMap into VRAM and switch on the menu window display
SlopMenuShow:
ld b, HIGH(vBGMap1)
call CopyScreenTileBufferToVRAM
@@ -98,17 +97,25 @@ SlopMenuTitle:
db "SL0P MENU@"
SlopMenuText:
db "WARP"
- next "HEAL@"
+ next "HEAL"
+ next "MONEY"
+ next "BADGES"
+ next "DEX"
+ next "MAXTEAM"
+ next "ITEMS@"
SlopMenuHandlers:
dw WarpSubmenu
dw SlopHealParty
+ dw SlopMaxCash
+ dw SlopAllBadges
+ dw SlopDex
+ dw SlopMaxTeam
+ dw GiveItemSubmenu
-; ---------------------------------------------------------------------------
-; WARP submenu: a town list. On A, start a fly-warp to the chosen map (no
-; BIT_USED_FLY, so no bird) and return carry set. On B, return carry clear.
-; The display was already set up by SlopMenu.
-; ---------------------------------------------------------------------------
+; ===========================================================================
+; WARP submenu
+; ===========================================================================
DEF WARP_COUNT EQU 13
WarpSubmenu:
@@ -151,10 +158,10 @@ WarpSubmenu:
ld [wDestinationMap], a
ld hl, wStatusFlags6
set BIT_FLY_WARP, [hl]
- scf ; carry set = warp started
+ scf
ret
.cancel
- and a ; carry clear = back to SL0P menu
+ and a
ret
WarpTitleText1:
@@ -181,11 +188,71 @@ WarpMapTable:
db SAFFRON_CITY, ROUTE_4, ROUTE_10
-; ---------------------------------------------------------------------------
-; HEAL action: restore every party member to full HP and clear status.
-; Returns carry clear (back to the SL0P menu).
-; ---------------------------------------------------------------------------
-; party_struct offsets: curHP +$01 (BE), status +$04, maxHP +$22 (BE), size $2C
+; ===========================================================================
+; ITEMS submenu: give 99 of the chosen item (stacks via GiveItem)
+; ===========================================================================
+DEF GIVE_COUNT EQU 8
+
+GiveItemSubmenu:
+ call ClearScreen
+ hlcoord 6, 0
+ ld de, GiveTitleText
+ call PlaceString
+ hlcoord 1, 1
+ lb bc, GIVE_COUNT + 2, 16
+ call TextBoxBorder
+ hlcoord 3, 2
+ ld de, GiveItemText
+ call PlaceString
+ call SlopMenuShow
+ xor a
+ ld [wCurrentMenuItem], a
+ ld [wLastMenuItem], a
+ ld [wMenuWatchMovingOutOfBounds], a
+ ld [wMenuJoypadPollCount], a
+ ld a, 2
+ ld [wTopMenuItemX], a
+ ld [wTopMenuItemY], a
+ ld a, PAD_A | PAD_B
+ ld [wMenuWatchedKeys], a
+ ld a, GIVE_COUNT - 1
+ ld [wMaxMenuItem], a
+ call HandleMenuInput
+ bit B_PAD_B, a
+ jr nz, .back
+ ld a, [wCurrentMenuItem]
+ ld e, a
+ ld d, 0
+ ld hl, GiveItemTable
+ add hl, de
+ ld b, [hl]
+ ld c, 99
+ call GiveItem
+.back
+ and a
+ ret
+
+GiveTitleText:
+ db "GIVE x99@"
+GiveItemText:
+ db "MASTER BALL"
+ next "ULTRA BALL"
+ next "RARE CANDY"
+ next "FULL RESTORE"
+ next "MAX REVIVE"
+ next "MAX ELIXER"
+ next "PP UP"
+ next "NUGGET@"
+GiveItemTable:
+ db MASTER_BALL, ULTRA_BALL, RARE_CANDY, FULL_RESTORE
+ db MAX_REVIVE, MAX_ELIXER, PP_UP, NUGGET
+
+
+; ===========================================================================
+; Direct-action cheats (return carry clear -> back to the SL0P menu)
+; ===========================================================================
+
+; HEAL: full HP + clear status for the whole party.
SlopHealParty:
ld a, [wPartyCount]
and a
@@ -193,31 +260,125 @@ SlopHealParty:
ld c, a
ld hl, wPartyMon1
.loop
- push hl ; save mon base
+ push hl
ld de, $04
add hl, de
xor a
- ld [hl], a ; status = 0
+ ld [hl], a ; status = 0
pop hl
push hl
ld de, $22
- add hl, de ; -> maxHP
+ add hl, de ; -> maxHP
ld a, [hli]
- ld b, a ; maxHP hi
- ld e, [hl] ; maxHP lo
+ ld b, a
+ ld e, [hl]
ld d, b
- pop hl ; mon base
+ pop hl
push hl
- inc hl ; -> curHP hi
+ inc hl ; -> curHP
ld a, d
ld [hli], a
ld a, e
- ld [hl], a ; curHP = maxHP
- pop hl ; mon base
+ ld [hl], a
+ pop hl
+ ld de, $2C
+ add hl, de
+ dec c
+ jr nz, .loop
+.done
+ and a
+ ret
+
+; MONEY: 999999 (BCD)
+SlopMaxCash:
+ ld a, $99
+ ld [wPlayerMoney], a
+ ld [wPlayerMoney + 1], a
+ ld [wPlayerMoney + 2], a
+ and a
+ ret
+
+; BADGES: all 8
+SlopAllBadges:
+ ld a, $ff
+ ld [wObtainedBadges], a
+ and a
+ ret
+
+; DEX: mark every Pokemon owned + seen (19-byte flag arrays; last byte = 7 bits)
+SlopDex:
+ ld hl, wPokedexOwned
+ call .fill
+ ld hl, wPokedexSeen
+ call .fill
+ and a
+ ret
+.fill
+ ld c, 18
+.floop
+ ld a, $ff
+ ld [hli], a
+ dec c
+ jr nz, .floop
+ ld [hl], $7f
+ ret
+
+; MAXTEAM: level 100, perfect DVs, maxed EVs, 999 stats + HP, exp = lvl 100
+SlopMaxTeam:
+ ld a, [wPartyCount]
+ and a
+ jr z, .done
+ ld c, a
+ ld hl, wPartyMon1
+.loop
+ push bc
+ push hl
+ ; current HP (+$01) = 999
+ inc hl
+ ld a, $03
+ ld [hli], a
+ ld a, $E7
+ ld [hl], a
+ pop hl
+ push hl
+ ; exp (+$0E) = 1,000,000
+ ld de, $0E
+ add hl, de
+ ld a, $0F
+ ld [hli], a
+ ld a, $42
+ ld [hli], a
+ ld a, $40
+ ld [hli], a
+ ; EVs (+$11..$1A) = FFFF x5, then DVs (+$1B..$1C) = FFFF -> 12 bytes of $FF
+ ld b, 12
+.ffloop
+ ld a, $ff
+ ld [hli], a
+ dec b
+ jr nz, .ffloop
+ pop hl
+ push hl
+ ; level (+$21) = 100
+ ld de, $21
+ add hl, de
+ ld a, 100
+ ld [hli], a
+ ; maxHP + 4 stats (+$22..$2B) = 999 x5
+ ld b, 5
+.statloop
+ ld a, $03
+ ld [hli], a
+ ld a, $E7
+ ld [hli], a
+ dec b
+ jr nz, .statloop
+ pop hl
ld de, $2C
- add hl, de ; next mon
+ add hl, de
+ pop bc
dec c
jr nz, .loop
.done
- and a ; carry clear = back to SL0P menu
+ and a
ret