Quantity only ACE
Posted by: Torchickens
Date: 2019-04-09 10:04:39
The only application I have so far is a simple RAM writer setup:
nop
ld bc,xx??
nop
ld hl,xx??
nop
ld de,xx??
nop
ld l,d
nop
ld (hl),b
nop
ret
This maps as the following items:
(hex:00 item) x1
(any item you want) x(value e.g. 21; Mew)
(hex:00 item) x33
(any item you want) x(address byte 1; big endian e.g. 208)
(hex:00 item) x17
(any item you want) x(address byte 2; big endian e.g. 88)
(hex:00 item) x106
(hex:00 item) x112
(hex:00 item) x201
I know it took 9 items just to write to one RAM address, but counter-intuitively this may actually be more reliable as old methods need you to get specific items, while expanded PC items/bag gives you loads of hex:00 x 00 (which means x256) already.
Where you place these items depends on your bootstrap setup. For things like 4F, 8F we have usually made it at bag item 3. However, with this setup using your stored items as the destination is probably more ideal; we would just have to adjust the bootstrap pointer/party/etc. to the D53B+ region so that it maps to PC items.
Notes:
I recently applied this for a fast method of obtaining the GF 22796 Mew (which if still possible, can be transferred to Pokémon Bank) in Yellow using the SRAM glitch and D36D-D36E (the map script) with Ether x213 as item 42 (you can get Ethers from your Rival name); mapping to D550 (PC item 13 quantity in Yellow, item 14 in Red/Blue).
This was combined with naming the player "GF" and a way of getting Burn Heal x0 (for the 0x0C byte in 0x580C (the representation of 22796 in hexadecimal)) as item 30 quantity and item 31 control your player ID. Using dry underflow glitch we can access the stored PC items. It only took about 10 minutes to get the Mew, but you need more time to fix everything else (i.e. bag and PC inventories, rival name, get rid of your last Q, get Pokédex).
https://www.youtube.com/watch?v=RrfAzewhLW4
Thoughts/any program for this like calling an address?
Edit: Answering my own question, one solution (but probably not the best) may be to just use the RAM writer five times to write below in the same item structure:
ld b,(00)
ld h,(00)
ld l,(00)
call item(00) [little endian]
(ret)
The parameters/instructions in brackets indicate what needs to be adjusted from a x0 quantity. Once this is done, the full routine would fill out.
e.g. the Yellow script for running Hall of Fame
ld b,$16
ld h,$64
ld l,$56
call $3e84
ret
(Thanks Wack0!)
Once that is done, you could probably swap the items up to run them.
Edit 2: Just the only issue with that one is that ld b, is a Bicycle but you could still write x22 to it using the RAM writer (just it would require 6 uses instead of 5).