The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script Recreating MissingNo (https://www.pokecommunity.com/showthread.php?t=384528)

DarkPsychic December 1st, 2016 1:34 PM

Recreating MissingNo
 
Hello all,
I have been working on creating a script for MissingNo and its form changes based on the players name.
The problem I have is the players name is at 0x0300500C-F which is dynamic ram.
I know that the pointer to the 8byte Player name is 4bytes and has to be fetched in this sequence 0x0300500F-C.
Ergo:
0x0300500F= ??1byte
0x0300500E= ??1byte
0x0300500D= ??1byte
0x0300500C= ??1byte
[LEFT] Total = ?? ?? ?? ?? 4byte = Pointer to 8byte Player name with 8th-byte being FF padding
0x0300500?= F E D C

After getting the pointer then it comes to checking the 3rd, 5th and 7th slot characters and comparing them to the values of "W = D1, w = EB, X = D2, x = EC, Y = D3, y = ED". (which I got from the Character encoding in GenIII).

As in Red&Blue MissingNo will always come in its base form and others are determined by these: W/w= Kabutops Fossil, X/x= Aerodactyl Fossil and Y/y= Ghost.

At the moment I'm simply trying to get it to work with a "green-script" in A-map and hook it all into a Wild battle.
Might do a custom basic "old man" script to have it set a flag, then have this script check it.

I was able to get to the 0x0300500F-C but couldn't figure out how to take those bytes align them into a pointer again an then go to where the players name is being held...

Any help or advice would be appreciated.

Update:
So I went about trying to use ASM rather than trying to compile at run time.
After looking at Hackmew's tut again I made my own routine to place the players name on vars 0x8000-0x8003 respectively.
Code:

.text
.align 2
.thumb
.thumb_func
.global

main:
    push {r0-r3, lr}
    ldr r0, .PLAYER_DATA
    ldr r0, [r0]        //load the pointer stored at r0 into r0
    ldr r1, .VAR        //var 0x8000
    ldm r0!, {r2-r3}    //load 2 words from given pointer at r0 into r2-r3 = 8bytes
    stm r1!, {r2-r3}    //store 2 words from r2-r3 onto vars 0x8000-0x8003
    pop {r0-r3, pc}

.align 2

.PLAYER_DATA:
.word 0x0300500C

.VAR:
.word 0x020370B8


This might be useful for something else as well.

I'm still not sure how to go about checking the 3rd, 5th and 7th slot;
Then changing the Wild chance rate based off the six possible characters,
Not to mention the unaccounted possible combinations of the 3 name character slots and the six usable characters....

I figure ASM might be the best way to go about it.
If that's the case then tossing in the ability to multiply the 6th item in the bag by 128(decimal) and giving
not only MissingNo but all its forms some kind of special custom ability... But this first hahaha
Will keep this post updated as I see it gets views, just need some more help with ideas on how to go about it.


All times are GMT -8. The time now is 9:18 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.