Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Issues with Bad Clone ACE in VC Crystal  (Read 402 times)

0 Members and 1 Guest are viewing this topic.

tstwizby

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Issues with Bad Clone ACE in VC Crystal
« on: July 06, 2018, 02:16:10 am »
Hello. I am currently trying to perform Bad Clone ACE in Crystal on VC using the stickied guide, and having some issues.

I wrote the following code, executing from PC items:

PP Up x1
Great Ball x1
TM30 x1
Paralyz Heal x65
Awakening x14
Ultra Ball x2
TM 10 x1
etc...

Which should translate to:

ld a,$01
inc b
ld bc, $01DE
dec c
ld b,c
inc c
ld c, $02
ld (bc) a
ret

which I'm pretty sure should have the effect of adding 256 to the current HP of first Pokemon in my party (Quagsire), or else setting its HP to 256 since it normally has 181.

Instead, its HP was set to 99 and all data in the rest of my party was corrupted.

Is there some problem with my code, or is there more likely a problem with my setup for the ACE?

While executing, I have a lv 34 Quagsire that knows Return, Rock Smash, Slam, and Surf and a lv 6 Spearow holding TM 50 that knows Peck and Leer as the only two Pokemon in my party.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #1 on: July 06, 2018, 04:20:13 am »
Your item/ASM translation appears correct.

Your code is modifying DD02, which corresponds to wPartyMon1HP+1 (apparently).
- Which localization (language) are you using?
- Maybe the wrong WRAM bank is loaded?
- Are you missing a prereq somewhere, which would lead execution somewhere else?
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

tstwizby

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #2 on: July 06, 2018, 10:02:01 am »
I'm using the English version, I'm unsure how to check the second, and I don't believe so for the third. I'm following the path, making the appropriate checks (using a max elixer) before viewing, and so on. My reference for the WRAM is this thread, incidentally:

https://forums.glitchcity.info/index.php?topic=1342.0

tstwizby

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #3 on: July 06, 2018, 11:32:42 pm »
I think I've found a solution, after watching this video:

https://www.youtube.com/watch?v=YqD68-2aAjg

The video suggests that under certain conditions it's necessary to set the address in de to point to a terminator character, and sure enough adding

Super Potion x1
X Speed x3

ld de $0134
inc bc

removed all problems and set Quagsire's HP to 1 as expected.

luckytyphlosion

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • JACK-flys are OP
    • View Profile
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #4 on: July 08, 2018, 08:15:38 pm »
Note that I have created an alternate ACE setup which does not require large lists of items, and instead uses box names to construct opcodes. A rough guide can be found here. If you have any questions just let me know and I will help.

tstwizby

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #5 on: July 09, 2018, 03:02:50 pm »
Thanks for the info! I'd seen the section in the stickied guide talking about using box names, but the setup there seems to be an older version that's more complicated and requires far more preparation.

I am a little confused by some of the wording, particularly the 'friendly clone random mon' section:

  • Is it necessary that the bad clone be made as part of the setup process, or can an existing bad clone be used?
  • Does the name have to specifically be ten question marks, or can any bad clone be used?
  • When you say to put a potion at the 'bottom' of the inventory, do you mean just above CANCEL?
  • What is the point of using the Potion in the two places you say to?
  • When executing, is using the Potion something you need to do before using TM15, or is it just the last step from the setup?
  • Finally, when executing, what restrictions/requirements are there on your party/items? Are they the same as for the setup?

I'm also a little confused about writing box code, especially given the seeming dearth of useful opcodes corresponding to characters.

According to https://forums.glitchcity.info/index.php?topic=8117, your code for getting TM40 should translate to:

or $FF
ld ($F880),a
ret nc

Which implies to me that I've been misunderstanding how Echo RAM works. Are the addresses $F880 and $D880 functionally equivalent for both reading and writing, rather than just for reading as I've been assuming?

Assuming that's the case, and that Box names are terminated (as implied by their taking nine bytes of memory despite having eight characters), your setup code should be something like:

call nc, $FB84 (Echo address of last Box 2 name character)
    xor a
    ld d,b
    ret nc
or $FB
call nc, $FB84
    xor a
    ld d,b
    ret nc
ld d,b
pop hl
sub a,e
and a
push af
pop de
ret nc

I don't need to know how this works, since it seems to rely a lot on the previous values of a, hl, and the recent stack, which I'm assuming are all controlled by the setup in some way, but I do want to check and make sure I'm properly understanding it.

Thank you!

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Issues with Bad Clone ACE in VC Crystal
« Reply #6 on: July 09, 2018, 03:55:07 pm »
Echo RAM works by being an actual mirror of WRAM. It's caused by both virtual addresses being routed the same way (to save on hardware costs, mostly)
Hence, they're the same for reading AND writing.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)