Quantity only arbitrary code execution: Difference between revisions

From Glitch City Wiki
Jump to navigation Jump to search
Content added Content deleted
>Torchickens
No edit summary
>Torchickens
Line 5: Line 5:
==Code==
==Code==
<tt>
<tt>
nop
nop<br>
ld bc,xx??
ld bc,xx??<br>
nop
nop<br>
ld hl,xx??
ld hl,xx??<br>
nop
nop<br>
ld de,xx??
ld de,xx??<br>
nop
nop<br>
ld l,d
ld l,d<br>
nop
nop<br>
ld (hl),b
ld (hl),b<br>
nop
nop<br>
ret
ret<br>
</tt>
</tt>


Line 30: Line 30:
*(hex:00 item) x112
*(hex:00 item) x112
*(hex:00 item) x201
*(hex:00 item) x201



==Credits==
==Credits==

Revision as of 10:32, 2 March 2020

Though bulky, the player can use a RAM writer with arbitrary code execution with item quantities, as an alternative method to using items. This can be ideal for the expanded inventory, due to it having many hex:00 items. However, it takes more space.

The player must be careful when swapping the hex:00 items with each other, as this attempts to merge the stacks the player has. Instead, the player may want to switch a different item in the desired place, before switching the hex:00 into that place.

Code

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

Credits

  • Torchickens (Evie)