You are not logged in.
As you know, in Gold, Silver, and Crystal, certain Pokemon are asleep at certain times of day, like Hoothoot will be asleep if you Headbutt one out of a tree during the day, and Spearow will be asleep if you headbutt one out at night. Even some odd ones like Pidgey being asleep at night, despite not being encounter-able at night and Noctowl, despite not being encounter-able during the day. This becomes a problem for hacks, I tried searching for a table in the rom that contains these few Pokemon, but I can't find anything. Does anyone know where this information might be? That, or if anyone has tried looking for it?
I want to know, because in my hack, I'm replacing Pokemon and I don't want the Pokemon that take up those slots to be only encounter-able at certain times. I figured here would be the place to ask, since Pokecommunity tends to lean more towards GBA hacking.
Set a breakpoint on the opponent id ($d0ed) or opponent sleep counter ($d0fd) and get into any wild battle (the routine is skipped in trainer battles). The former will bring you to the top of the routine, the latter to the bottom:
GOLD: ROMF:689B FA ED D0 ld a,(D0ED) ; opponent id ROMF:689E FE A3 cp a,A3 ; hoothoot ROMF:68A0 28 0E jr z,68B0 ROMF:68A2 FE A4 cp a,A4 ; noctowl ROMF:68A4 28 0A jr z,68B0 ROMF:68A6 FE 10 cp a,10 ; pidgey ROMF:68A8 28 0F jr z,68B9 ROMF:68AA FE 15 cp a,15 ; spearow ROMF:68AC 28 0B jr z,68B9 ROMF:68AE 18 16 jr 68C6 ROMF:68B0 FA 57 D1 ld a,(D157) ; is it night? ROMF:68B3 FE 02 cp a,02 ROMF:68B5 20 0B jr nz,68C2 ROMF:68B7 18 0D jr 68C6 ROMF:68B9 FA 57 D1 ld a,(D157) ; is it day? ROMF:68BC FE 02 cp a,02 ROMF:68BE 28 02 jr z,68C2 ROMF:68C0 18 04 jr 68C6 ROMF:68C2 3E 07 ld a,07 ; counter only uses bottom 3 bits ROMF:68C4 18 01 jr 68C7 ROMF:68C6 AF xor a ROMF:68C7 21 FD D0 ld hl,D0FD ; sleep counter ROMF:68CA 22 ldi (hl),a
Last edited by comet (2012-09-09 05:36:17)
Thank you for your help!
It's not much but a simple "correction" to this.
Between 68B9 and 68BE is actually checked whether it's not night (which you knew but explained "wrong" because it could be morning as well).
No matter, everyone who uses this should be able to figure that on his/her own.
Thanks for the asm by the way. I haven't checked this out myself and feel like my own hack would require something to be done about it.