You are not logged in.
The 'pokepic' macro shows a Pokémon portrait, like when you look at the starters' balls. The portrait box is gray, palette entry 0. I'd like it to use entry 7, same as the Start menu and text boxes, because it would work even at night or in dark caves. Can someone please point me to where the color is coming from? Thank you.
You know, I've never looked into how the g/s/c functions that handle these kind of things are, but I'd start be tracking down what sets the box area to palette 0. It's going to be something that is writting to the tile attribute area in Vram bank 1, between 9800 and 9fff, depending on which of the two backgroun maps is being used. Since the box is drawn in the middle of the screen you can just set a bp on 1:9a00 and 1:9e00 and you should notice the lower two bits of addresses around there being zeroed. You're probably going to end up in some vblank routine but you can use it to backtrack what requested that palette change and hopefully end up finding the game's "higher level" function that you can use for this kind of stuff instead of rewriting those values in vram in a dirty way.
Last edited by Crystal_ (2016-10-27 11:43:32)
Okay, so when Pokepic calls MenuBox, it ends up calling TextBoxPalette, which fills "text box width c height b at hl with pal 7". But shortly after that, "ld b, SCGB_POKEPIC; call GetSGBLayout" sets it to 0.
SCGB_POKEPIC indexes into a jumptable which ends up doing "ld hl, PalPacket_9b96; ld de, BlkPacket_9b56; ld a, SCGB_08; ld [SGBPredef], a; [...] call Function9809". I haven't studied how Function9809 works yet.
I had traced this sequence before, but editing the bytes after PalPacket_9b96 didn't seem to have any effect, so I posted this question.
I'd be interested if you can explain how that works, but my immediate problem is solved. I've removed the GetSGBLayout layout call and replaced it with a call to a routine based on LoadOW_BGPal7 (which loads the palette for Flash in slot 7) but for a grayscale palette. Shouldn't be too hard to make this new routine load the Pokémon's palette, which would be even better than grayscale.
Thanks for your help!
Last edited by Rangi (2016-10-27 14:58:44)