Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation II Glitch Discussion

Issues with Bad Clone ACE in VC Crystal - Page 1

Issues with Bad Clone ACE in VC Crystal

Posted by: tstwizby
Date: 2018-07-06 03:16:10
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.

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: ISSOtm
Date: 2018-07-06 05:20:13
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?

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: tstwizby
Date: 2018-07-06 11:02:01
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

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: tstwizby
Date: 2018-07-07 00:32:42
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.

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: luckytyphlosion
Date: 2018-07-08 21:15:38
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.

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: tstwizby
Date: 2018-07-09 16:02:50
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:



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!

Re: Issues with Bad Clone ACE in VC Crystal

Posted by: ISSOtm
Date: 2018-07-09 16:55:07
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.