• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Mugshots

marcc5m

what
1,116
Posts
13
Years
I'm not good with all the posting stuff so I'mma make this short and sweet.
In Pokemon Ruby, a sprite can be displayed on the screen via showpokepic, but it can also be displayed without the box around it, like so:
Code:
showpokepic 0x1 0x1 0x1
hidebox 0x1 0x1 0xF 0xF
pause 0x1
hidepokepic
showpokepic 0xFE 0x2 0x7
hidebox 0x2 0x7 0xE 0xE
This allows for things like mugshots. Here is an example:
DarkGreyV2_119.png


HOWEVER. (You know stuffs about to go down when I say that in all caps) This cannot be done in FireRed. So that is why I am posting this thread. :)
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
cool! is that script for XSE or Pokescript?

I'm sorry, but I'm going to have to give you my XSE speech.

Pokescript is an old, outdated, buggy, and stupid scripting engine used by n00bs, old youtube videos, and Whack a Hack. XSE is a newer, easier, more up-to-date, better scripter than Pokescript. There's more support and documentation on it, and is the main scripting program used. If you try to help script another hack with pokescript, they will tell you the same.

Basically, it's for XSE.
 

marcc5m

what
1,116
Posts
13
Years
I'm sorry, but I'm going to have to give you my XSE speech.

Pokescript is an old, outdated, buggy, and stupid scripting engine used by n00bs, old youtube videos, and Whack a Hack. XSE is a newer, easier, more up-to-date, better scripter than Pokescript. There's more support and documentation on it, and is the main scripting program used. If you try to help script another hack with pokescript, they will tell you the same.

Basically, it's for XSE.

If you are implying that people from WAH are n00bs, you are very much mistaken. I've seen better hacks there in a week than I've seen here all year. Well, other than, like, two.

Anyway, yes it's for XSE. However it only works for Ruby, and as most people hack FireRed and my ASM knowledge is very limited (and also the fact I am way too busy with school to learn it), that's why I posted this thread.
 

AustinWolff

has left
100
Posts
12
Years
sweet! and yah, waaaaay to many people hack fire red, which is way it is nice to play a good old ruby hacked game. BUT for showpokepic, doesnt it show the sprite used in a battle? so for the pic of patrat, is that its battle sprite or did you make a custom sprite for it?
 

droomph

weeb
4,285
Posts
12
Years
sweet! and yah, waaaaay to many people hack fire red, which is way it is nice to play a good old ruby hacked game. BUT for showpokepic, doesnt it show the sprite used in a battle? so for the pic of patrat, is that its battle sprite or did you make a custom sprite for it?

I believe it uses whatever sprite the Pokédex uses, as showpokepic (or whatever) does that (I think).
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
After about two hours tinkering with the ASM, I managed to make a fairly bulky routine that will accomplish what hidebox can do in Ruby/Sapphire. At the expense of hopefully not incurring the wrath of an Admin for bumping a very old thread, I'm posting the hex, since this seems to be something that plenty of people might want to have. Like I said, this routine is a little bulky, because my knowledge of ASM doesn't extend to streamlining code...For me, if it works, it works.

This code is mainly optimized for use with Special 0x18B, which shows the images of the fossils. It also works after showpokepic, but there's a detectable flash of the box appearing and then being hidden. To remedy that, I'm posting another code, with a tiny change, that should work for showpokepic:

For Special 0x18B:
Spoiler:


The last value, .COMP, is part of a timer. For showpokepic, 0x000012AF is the lowest it can be...below that, and routine erases the box before the box even exists. However, the slight flash persists for showpokepic. For special 0x18B, there's absolutely no flash ^^

Edit: COMP absolutely has to be 0x000017FF for Special 0x18B, or the routine won't work.

Double Edit: Words make liars out of us...there actually is a small flash for both. My game must've been running at double speed, so the flash didn't show. Sorry v.v

Triple Edit: I forgot to mention, this is intended to be used with callasm, and used immediately after special 0x18B, like how it's done in Ruby. Make sure to add one to the offset called with callasm!
 
Last edited:

NarutoActor

The rocks cry out to me
1,974
Posts
15
Years
Maybe you can work the code into the special to remove the slight flash, well it works, and here is the hex code if any one is lazy

Spoiler:


For a total length of 40 bytes (hex)

If it doesn't work, first try this code instead before posting about the problem.
Spoiler:
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
The code I made is definitely not a complete solution, but it is a small stepping stone at least. When I was first making the routine, I had been testing it out with showpokepic, and I didn't want to start rooting around in the ASM of each command and breaking something. I'll try and look into integrating this into the special at some point, although I have JPANs hack engine, so it'll end up having to be different for everyone.

If anyone's curious, there's a large block of 64 8x8 white tiles that get created at 0x6008700, which fill up the entire body of the picture. Internally, there's a routine in the game that writes a long string of 11s to make those squares appear. If we could figure out how to toggle between having a string of 11s to a string of 00s, this code could be improved, since it would change the white tiles to become invisible tiles.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Why not write an asm routine that changes all those bytes to 00's, before the image is shown of course.

That's the tricky bit, unfortunately. The routine I currently have works by changing those tiles to 00. But if you do it too soon, then the original ASM will overwrite the changes with 11, and it won't have any effect. That's why I had to make a sort of timer, so the routine would wait a tick before covering up the 11s. That's why there's always a flash, because the 11s have to exist before they can be replaced.

I also don't know where in the original special that the changing-to-11 bit appears. If we found that, it'd be a very simple matter to make a branch, to check if, say, variable 0x8003 was 0x1, and if it is, change those bytes to 00, and continue on with the special. Writing routines always leaves me exhausted, though, so I'll investigate it a little more at some other point, unless someone else figures it out faster.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
That's the tricky bit, unfortunately. The routine I currently have works by changing those tiles to 00. But if you do it too soon, then the original ASM will overwrite the changes with 11, and it won't have any effect. That's why I had to make a sort of timer, so the routine would wait a tick before covering up the 11s. That's why there's always a flash, because the 11s have to exist before they can be replaced.

I also don't know where in the original special that the changing-to-11 bit appears. If we found that, it'd be a very simple matter to make a branch, to check if, say, variable 0x8003 was 0x1, and if it is, change those bytes to 00, and continue on with the special. Writing routines always leaves me exhausted, though, so I'll investigate it a little more at some other point, unless someone else figures it out faster.

Code:
0809D3A0                 BL      sub_080F7750
If you change that to 00 00 00 00 it will not draw the box. Hope this helps.

Edit: Sorry, this is for ShowPokePic. Not the special.
 

NarutoActor

The rocks cry out to me
1,974
Posts
15
Years
Not sure if any of this is useful information, but might as well share it.
The Showpokepic routine is located at 0x0806BB9C
Try calling it using a script, callasm 0x0806BB9D

The routine in hex
Spoiler:


Decomplied it with PKSV
Spoiler:
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
If you guys want to keep using Special 0x18B, I suggest you stop it from drawing the box all together.

Code:
0809D494 @ =============== S U B R O U T I N E =======================================
0809D494
0809D494
0809D494 c3_Special0x18C:                        @ DATA XREF: sp18B_ShowFossilPicture+14o
0809D494                                         @ sp18B_ShowFossilPicture:off_0809D548o ...
0809D494                 PUSH    {R4,R5,LR}
0809D496                 LSLS    R0, R0, #0x18
0809D498                 LSRS    R5, R0, #0x18
0809D49A                 LSLS    R0, R5, #2
0809D49C                 ADDS    R0, R0, R5
0809D49E                 LSLS    R0, R0, #3
0809D4A0                 LDR     R1, =callback3table
0809D4A2                 ADDS    R4, R0, R1
0809D4A4                 MOVS    R1, #8
0809D4A6                 LDRSH   R0, [R4,R1]
0809D4A8                 CMP     R0, #1
0809D4AA                 BEQ     loc_0809D4FC
0809D4AC                 CMP     R0, #1
0809D4AE                 BGT     loc_0809D4BC
0809D4B0                 CMP     R0, #0
0809D4B2                 BEQ     loc_0809D4DE
0809D4B4                 B       loc_0809D4FC
0809D4B4 @ ---------------------------------------------------------------------------
0809D4B6                 .byte    0
0809D4B7                 .byte    0
0809D4B8 off_0809D4B8:   .long callback3table    @ DATA XREF: c3_Special0x18C+Cr
0809D4BC @ ---------------------------------------------------------------------------
0809D4BC
0809D4BC loc_0809D4BC:                           @ CODE XREF: c3_Special0x18C+1Aj
0809D4BC                 CMP     R0, #2
0809D4BE                 BEQ     ClearOAM
0809D4C0                 CMP     R0, #3
0809D4C2                 BEQ     ClearBoxMaybe
0809D4C4                 B       loc_0809D4FC
0809D4C6 @ ---------------------------------------------------------------------------
0809D4C6
0809D4C6 ClearOAM:                               @ CODE XREF: c3_Special0x18C+2Aj
0809D4C6                 MOVS    R0, #0xC
0809D4C8                 LDRSH   R1, [R4,R0]
0809D4CA                 LSLS    R0, R1, #4
0809D4CC                 ADDS    R0, R0, R1
0809D4CE                 LSLS    R0, R0, #2
0809D4D0                 LDR     R1, =oam_pre_buffer
0809D4D2                 ADDS    R0, R0, R1
0809D4D4                 BL      sub_08007280
0809D4D8                 LDR     R0, =0x1B58
0809D4DA                 BL      sub_0800874C
0809D4DE
0809D4DE loc_0809D4DE:                           @ CODE XREF: c3_Special0x18C+1Ej
0809D4DE                 LDRH    R0, [R4,#8]
0809D4E0                 ADDS    R0, #1
0809D4E2                 STRH    R0, [R4,#8]
0809D4E4                 B       loc_0809D4FC
0809D4E4 @ ---------------------------------------------------------------------------
0809D4E6                 .byte    0
0809D4E7                 .byte    0
0809D4E8 off_0809D4E8:   .long oam_pre_buffer    @ DATA XREF: c3_Special0x18C+3Cr
0809D4EC dword_0809D4EC: .long 0x1B58            @ DATA XREF: c3_Special0x18C+44r
0809D4F0 @ ---------------------------------------------------------------------------
0809D4F0
0809D4F0 ClearBoxMaybe:                          @ CODE XREF: c3_Special0x18C+2Ej
[S-HIGHLIGHT]0809D4F0                 LDRB    R0, [R4,#0x12]
0809D4F2                 BL      ClearBoxMaybe[/S-HIGHLIGHT]
0809D4F6                 MOVS    R0, R5
0809D4F8                 BL      del_c3_from_linked_list
0809D4FC
0809D4FC loc_0809D4FC:                           @ CODE XREF: c3_Special0x18C+16j
0809D4FC                                         @ c3_Special0x18C+20j ...
0809D4FC                 POP     {R4,R5}
0809D4FE                 POP     {R0}
0809D500                 BX      R0
0809D500 @ End of function c3_Special0x18C
0809D500
0809D500 @ ---------------------------------------------------------------------------

Code:
0809D504 @ =============== S U B R O U T I N E =======================================
0809D504
0809D504
0809D504 sp18B_ShowFossilPicture:                @ DATA XREF: ROM:special_tableo
0809D504                 PUSH    {R4-R6,LR}
0809D506                 MOV     R6, R8
0809D508                 PUSH    {R6}
0809D50A                 LDR     R0, =(sub_0809D6D4+1)
0809D50C                 BL      sub_081119D4
0809D510                 LSLS    R0, R0, #0x18
0809D512                 LSRS    R0, R0, #0x18
0809D514                 CMP     R0, #1
0809D516                 BEQ     Ret_1
0809D518                 LDR     R0, =(c3_Special0x18C+1)
0809D51A                 BL      position_in_c3_list
0809D51E                 LSLS    R0, R0, #0x18
0809D520                 LSRS    R0, R0, #0x18
0809D522                 CMP     R0, #0xFF
0809D524                 BNE     Ret_0
0809D526                 LDR     R0, =var_8004
0809D528                 LDRH    R0, [R0]
0809D52A                 CMP     R0, #0x8D
0809D52C                 BNE     loc_0809D558
0809D52E                 LDR     R0, =off_083E17C0
0809D530                 BL      sub_08008720
0809D534                 LDR     R0, =unk_083E17A0
0809D536                 MOVS    R1, 0x1D0
0809D53A                 MOVS    R2, #0x20
0809D53C                 BL      use_unfaded_pal_and_a_bit_of_R0
0809D540                 B       loc_0809D572
0809D540 @ ---------------------------------------------------------------------------
0809D542                 .byte    0
0809D543                 .byte    0
0809D544 off_0809D544:   .long sub_0809D6D4+1    @ DATA XREF: sp18B_ShowFossilPicture+6r
0809D548 off_0809D548:   .long c3_Special0x18C+1 @ DATA XREF: sp18B_ShowFossilPicture+14r
0809D54C off_0809D54C:   .long var_8004          @ DATA XREF: sp18B_ShowFossilPicture+22r
0809D550 off_0809D550:   .long off_083E17C0      @ DATA XREF: sp18B_ShowFossilPicture+2Ar
0809D554 off_0809D554:   .long unk_083E17A0      @ DATA XREF: sp18B_ShowFossilPicture+30r
0809D558 @ ---------------------------------------------------------------------------
0809D558
0809D558 loc_0809D558:                           @ CODE XREF: sp18B_ShowFossilPicture+28j
0809D558                 CMP     R0, #0x8E
0809D55A                 BEQ     loc_0809D560
0809D55C
0809D55C Ret_0:                                  @ CODE XREF: sp18B_ShowFossilPicture+20j
0809D55C                 MOVS    R0, #0
0809D55E                 B       End
0809D560 @ ---------------------------------------------------------------------------
0809D560
0809D560 loc_0809D560:                           @ CODE XREF: sp18B_ShowFossilPicture+56j
0809D560                 LDR     R0, =off_083E17D0
0809D562                 BL      sub_08008720
0809D566                 LDR     R0, =unk_083E0F80
0809D568                 MOVS    R1, 0x1D0
0809D56C                 MOVS    R2, #0x20
0809D56E                 BL      use_unfaded_pal_and_a_bit_of_R0
0809D572
0809D572 loc_0809D572:                           @ CODE XREF: sp18B_ShowFossilPicture+3Cj
0809D572                 LDR     R0, =stru_083E0768
0809D574                 LDR     R1, =var_8005
0809D576                 MOV     R8, R1
0809D578                 LDRH    R1, [R1]
0809D57A                 LSLS    R1, R1, #0x13
0809D57C                 MOVS    R2, 0x280000
0809D580                 ADDS    R1, R1, R2
0809D582                 ASRS    R1, R1, #0x10
0809D584                 LDR     R6, =var_8006
0809D586                 LDRH    R2, [R6]
0809D588                 LSLS    R2, R2, #0x13
0809D58A                 MOVS    R3, 0x280000
0809D58E                 ADDS    R2, R2, R3
0809D590                 ASRS    R2, R2, #0x10
0809D592                 MOVS    R3, #0
0809D594                 BL      uns_to_oam_pre_buf
0809D598                 MOVS    R5, R0
0809D59A                 LSLS    R5, R5, #0x18
0809D59C                 LSRS    R5, R5, #0x18
0809D59E                 LDR     R1, =oam_pre_buffer
0809D5A0                 LSLS    R0, R5, #4
0809D5A2                 ADDS    R0, R0, R5
0809D5A4                 LSLS    R0, R0, #2
0809D5A6                 ADDS    R0, R0, R1
0809D5A8                 LDRB    R2, [R0,#5]
0809D5AA                 MOVS    R1, #0xF
0809D5AC                 ANDS    R1, R2
0809D5AE                 MOVS    R2, #0xD0
0809D5B0                 ORRS    R1, R2
0809D5B2                 STRB    R1, [R0,#5]
0809D5B4                 LDR     R0, =(c3_Special0x18C+1)
0809D5B6                 MOVS    R1, #0x50
0809D5B8                 BL      add_to_callback3_list
0809D5BC                 MOVS    R4, R0
0809D5BE                 LSLS    R4, R4, #0x18
0809D5C0                 LSRS    R4, R4, #0x18
0809D5C2                 MOV     R1, R8
[S-HIGHLIGHT]0809D5C4                 LDRB    R0, [R1]        @ x
0809D5C6                 LDRB    R1, [R6]        @ y
0809D5C8                 MOVS    R2, #8          @ width
0809D5CA                 MOVS    R3, #8          @ height
0809D5CC                 BL      DrawBox[/S-HIGHLIGHT]
0809D5D0                 LDR     R2, =callback3table
0809D5D2                 LSLS    R1, R4, #2
0809D5D4                 ADDS    R1, R1, R4
0809D5D6                 LSLS    R1, R1, #3
0809D5D8                 ADDS    R1, R1, R2
0809D5DA                 LSLS    R0, R0, #0x18
0809D5DC                 LSRS    R0, R0, #0x18
0809D5DE                 MOVS    R2, #0
0809D5E0                 STRH    R0, [R1,#0x12]
0809D5E2                 STRH    R2, [R1,#8]
0809D5E4                 STRH    R5, [R1,#0xC]
0809D5E6                 MOVS    R1, #1
0809D5E8                 BL      sub_080F7750
0809D5EC                 MOVS    R0, #0
0809D5EE                 BL      sub_080F67A4
0809D5F2
0809D5F2 Ret_1:                                  @ CODE XREF: sp18B_ShowFossilPicture+12j
0809D5F2                 MOVS    R0, #1
0809D5F4
0809D5F4 End:                                    @ CODE XREF: sp18B_ShowFossilPicture+5Aj
0809D5F4                 POP     {R3}
0809D5F6                 MOV     R8, R3
0809D5F8                 POP     {R4-R6}
0809D5FA                 POP     {R1}
0809D5FC                 BX      R1
0809D5FC @ End of function sp18B_ShowFossilPicture

Simply make a branch to check a variable and don't call the DrawBox function if it matches a certain value. Easy.
 

PokemonMasters

Always Remember Forever&After
389
Posts
11
Years
which part of the script do you put
showpokepic 0x1 0x1 0x1
hidebox 0x1 0x1 0xF 0xF
pause 0x1
hidepokepic
showpokepic 0xFE 0x2 0x7
hidebox 0x2 0x7 0xE 0xE ?
 

supersoursky

Co-Leader of Dark Illusion
42
Posts
11
Years
i dont et any of this how did you get how you get the mugshot when you just basically write the script cansomeone please make a video tutorial of this?
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
i dont et any of this how did you get how you get the mugshot when you just basically write the script cansomeone please make a video tutorial of this?

no, im using ruby, and i was wondering where in a script do you put it in :3

It's a script fragment. You put it wherever you want the mugshot to show. If you don't understand how to script, I'd suggest taking a journey to the Q&A thread in the parent section or to the Tutorials section. I'm sure you'll find something there to guide you along the way. :)
 
Back
Top