Issues with Expanding Weapon Icons

Tags: #<Tag:0x00007f0e294d92a0> #<Tag:0x00007f0e294d9138>

Hextator’s patch has some problems.

[6/16/2014 8:04:01 PM] Archiblad: man I wish I knew why this was borked
[6/16/2014 8:04:03 PM] Archiblad: http://puu.sh/9wZUi/1d70678fb0.png game gets all glitchy when you just go up and down the shop menus
[6/16/2014 8:06:15 PM] Eric: if you have too many icons
[6/16/2014 8:06:24 PM] Eric: they start to overwrite each other?
[6/16/2014 8:06:28 PM] Eric: idk i feel like I’ve seen it before
[6/16/2014 8:06:32 PM] Cam: Oh
[6/16/2014 8:06:46 PM] Cam: I think I might know what’s going wrong
[6/16/2014 8:06:52 PM] Eric: even if you have alex’s patch
[6/16/2014 8:07:24 PM] Eric: because i think his patch only fixes the bug in the–yeah see that’s what I mean
[6/16/2014 8:07:26 PM] Cam: if you expand the icon sheet
[6/16/2014 8:07:30 PM] Eric: and it’s too much for the memory to handle
[6/16/2014 8:07:33 PM] Cam: it makes the OAM buffer screw up
[6/16/2014 8:07:51 PM] Archiblad: yeah somebody should fix that someday
[6/16/2014 8:07:56 PM] Cam: (this is the kind of thing that I think is more worth paying hextator for)
[6/16/2014 8:07:57 PM] Eric: cough cam go cough
[6/16/2014 8:08:49 PM] Archiblad: http://puu.sh/9x0cb/fc3e75dd5e.png Hahah and then everything turns into the wing clipper
[6/16/2014 8:09:04 PM] Cam: are you just like
[6/16/2014 8:09:05 PM] Eric: i’ve seen that error before
[6/16/2014 8:09:06 PM] Cam: going up and down
[6/16/2014 8:09:07 PM] Cam: repeatedly
[6/16/2014 8:09:08 PM] Archiblad: yeah
[6/16/2014 8:15:01 PM] zahlman: then depending on the order of things in vram
[6/16/2014 8:15:18 PM] zahlman: theoretically one of them could overwrite the section of vram data that’s used for the tile map for the background
[6/16/2014 8:15:29 PM] zahlman: and it would naturally overwrite the beginning of that data -> top of the screen
[6/16/2014 8:15:49 PM] Cam: ah
[6/16/2014 8:16:03 PM] zahlman: and the portrait would be fine because it’s on another layer
[6/16/2014 8:46:16 PM] Cam: http://puu.sh/9x2qW/dcb7d805fd.png as you go up and down
[6/16/2014 8:46:19 PM] Cam: those entire rows of tiles
[6/16/2014 8:46:23 PM] Cam: gradually become weapon icons
[6/16/2014 8:46:28 PM] Cam: when they’re all weapon icons
[6/16/2014 8:46:29 PM] Cam: it bugs
[6/16/2014 8:47:02 PM] zahlman: right, because those rows after the weapon icons aren’t actual tiles, they’re tile maps, amirite
[6/16/2014 8:47:29 PM] Cam: it’s /definitely/ a problem with hextator’s fix
[6/16/2014 8:47:35 PM] zahlman: my guess is it’s coded to load new icons sequentially as needed
[6/16/2014 8:47:37 PM] Cam: he did something funky to make it load custom icons
[6/16/2014 8:47:41 PM] Cam: because
[6/16/2014 8:47:44 PM] zahlman: except it just keeps going, instead of reusing old space
[6/16/2014 8:47:55 PM] zahlman: like
[6/16/2014 8:48:01 PM] zahlman: see how there are 5 icons normally
[6/16/2014 8:48:06 PM] zahlman: corresponding to 5 slots in the menu
[6/16/2014 8:48:16 PM] zahlman: those should be getting treated as like a circular buffer
[6/16/2014 8:48:32 PM] Cam: Oh, I get it
[6/16/2014 8:48:40 PM] Cam: When it comes to an icon that isn’t in the vanilla table
[6/16/2014 8:48:45 PM] Cam: instead of going back into the circle
[6/16/2014 8:48:47 PM] Cam: it reloads it
[6/16/2014 8:49:06 PM] Cam: because the icons that are overwriting stuff
[6/16/2014 8:52:37 PM] Cam: http://puu.sh/9x2Ny/b74d51e218.png this is after opening it once
[6/16/2014 8:53:13 PM] Cam: http://puu.sh/9x2Pu/3cc3347e0d.png this is after going up and down a few times
[6/16/2014 8:53:35 PM] Cam: http://puu.sh/9x2Qx/e66070afca.png this is after the glitch occurs
[6/16/2014 9:03:06 PM] Cam: it seems you’re saying that
[6/16/2014 9:03:26 PM] Cam: when it’s loading the weapon icon bitmap data into VRAM
[6/16/2014 9:03:30 PM] Cam: it’s overwriting some of the “TSA” data
[6/16/2014 9:03:37 PM] Cam: hence why there are random fucked up tiles on the top of the scree
[6/16/2014 9:03:38 PM] Cam: ?
[6/16/2014 9:03:38 PM] zahlman: that’s my best guess
[6/16/2014 9:04:09 PM] zahlman: a weapon icon needs 4 tiles, so it would potentially fuck up 64 tiles worth of screen mapping = 2 whole rows
[6/16/2014 9:15:19 PM] Cam: http://dl.dropboxusercontent.com/u/336940/Software/Hextator’s%20Doc/Media/Games/Reverse%20Engineering/Console/NGBA/Fire%20Emblem/Apps/FEditor%20Adv/asm/FE7/Item%20Icon%20Bug%20Fix/Item%20Icon%20Bug%20Fix.txt

[6/16/2014 9:15:49 PM] zahlman: >bugfix
[6/16/2014 9:15:52 PM] Cam: luckily i was wrong
[6/16/2014 9:15:57 PM] Cam: According to rey
[6/16/2014 9:16:06 PM] Cam: it screwed up for expanded item icons before
[6/16/2014 9:16:16 PM] Cam: like they didn’t work period they all turned into vulneraries
[6/16/2014 9:16:30 PM] Cam: so i guess it sort of did its job?
[6/16/2014 9:17:37 PM] Cam: hmm
[6/16/2014 9:18:08 PM] Cam: wait what
[6/16/2014 9:18:21 PM] Cam: gonna be honest i have no idea wtf this does
[6/16/2014 9:19:05 PM] zahlman: idgi either
[6/16/2014 9:19:43 PM] Cam: presumably 0x80 is the size of the vanilla weapon icons
[6/16/2014 9:19:54 PM] Cam: idk what it does for beyond that
[6/16/2014 9:19:43 PM] Cam: presumably 0x80 is the size of the vanilla weapon icons
[6/16/2014 9:19:54 PM] Cam: idk what it does for beyond that
[6/16/2014 9:19:56 PM] zahlman: it looks like this code is intended to be jumped to by replacing part of the original code with an unconditional branch
[6/16/2014 9:19:59 PM] zahlman: and then it jumps back
[6/16/2014 9:20:20 PM] zahlman: where do you see 0x80
[6/16/2014 9:20:34 PM] zahlman: oh, the cmp
[6/16/2014 9:22:27 PM] zahlman: ok so
[6/16/2014 9:23:51 PM] zahlman: if an icon id >= 0x80 is calculated, it stores 0x02026A50 + 4 x r4 into r5
and then jumps to 0x4DDC in thumb
otherwise it just jumps to 0x4DC4 in thumb
[6/16/2014 9:24:30 PM] zahlman: so that’s a WRAM address
[6/16/2014 9:24:42 PM] zahlman: and it looks like there’s an array with 4 bytes per custom icon
[6/16/2014 9:25:46 PM] Cam: but it’s not just a table with all the custom icons
[6/16/2014 9:25:54 PM] Cam: because it doesn’t subtract out the 0x80
[6/16/2014 9:26:10 PM] Cam: is it just a table with all the icons?
[6/16/2014 9:59:34 PM] Archiblad: okay 6 custom icon test
[6/16/2014 9:59:51 PM] Archiblad: http://puu.sh/9x6Fe/6f41e81aaf.png

[6/16/2014 9:59:53 PM] zahlman: wait jake did it mess up with 11 normal icons?
[6/16/2014 9:59:56 PM] Archiblad: nope
[6/16/2014 10:01:18 PM] Cam: does it mess up if you can’t scroll?
[6/16/2014 10:01:21 PM] Cam: I would assume not
[6/16/2014 10:01:53 PM] Archiblad: nope
[6/16/2014 10:04:58 PM] Archiblad: hold on I want to check something
[6/16/2014 10:05:07 PM] Archiblad: cuz greatlance and battle axe are where vanilla icons would be and the tonic is just over the standard vulnerary
[6/16/2014 10:06:30 PM] Cam: wtf
[6/16/2014 10:06:41 PM] Cam: that
[6/16/2014 10:06:45 PM] Archiblad: it might be anything after the affinity icons
[6/16/2014 10:06:45 PM] Cam: makes no sense
[6/16/2014 10:06:50 PM] Cam: Oh
[6/16/2014 10:06:51 PM] Cam: maybe?
[6/16/2014 10:06:56 PM] Archiblad: that’s what I’m tryna test
[6/16/2014 10:08:41 PM] Cam: so it’s “after the affinity icons”?
[6/16/2014 10:08:44 PM] Archiblad: looks like it
[6/16/2014 10:23:26 PM] Cam: http://puu.sh/9x7Ui/9e36e0880e.png aha
[6/16/2014 10:23:47 PM] Cam: the same kind of issue happens in the status screen
[6/16/2014 10:23:50 PM] Cam: we just
[6/16/2014 10:23:52 PM] Cam: don’t notice
[6/16/2014 10:25:09 PM] Cam: http://puu.sh/9x7Z0/fe3deae95b.png - original, http://puu.sh/9x7ZP/d805d559e2.png - after scrolling
[6/16/2014 10:25:46 PM] Cam: http://puu.sh/9x82f/95af39c0bb.png aha
[6/16/2014 10:26:17 PM] Cam: it breaks the horse/wyvern icon too
[6/16/2014 10:26:32 PM | Edited 10:26:34 PM] Cam: arch do you know offhand/can you check what 0x80 is on the icon table
[6/16/2014 10:27:21 PM] Archiblad: 0x80 is the anima icon
[6/16/2014 10:27:30 PM] Cam: is that the last one
[6/16/2014 10:27:32 PM] Archiblad: yup
[6/16/2014 10:27:34 PM] Archiblad: horse is next
[6/16/2014 10:27:52 PM] Cam: then it’s definitely hextator’s fault
[6/16/2014 10:28:12 PM] Cam: confirmed
[6/16/2014 10:28:15 PM] Cam: it doesn’t do that on the vanilla ROM
[6/16/2014 10:29:13 PM] Cam: http://puu.sh/9x8e6/bff10d2c98.png gdi hex

This was our little trial and error sesh last night. Any icon past 0x80 borks the weapon icon display when being repeatedly reloaded, which results in the glitched shop interface and disappearing icons on the status screen.

1 Like

[quote][8:21:50 PM] Cam: …AHA
[8:21:56 PM] Cam: I’M NOT SURE WHAT I DID
[8:21:57 PM] Cam: BUT I DID IT
[8:22:05 PM] Archiblad: What did you do!
[8:22:09 PM] Cam: this
[8:22:11 PM] Cam: this shouldn’t work
[8:22:13 PM] Cam: if there was a problem
[8:22:16 PM] Cam: with the original code
[8:22:18 PM] Cam: then this shouldn’t work
[8:22:19 PM] Cam: but
[8:22:20 PM] Cam: it does
[8:22:21 PM] Cam: ~~~~~~
[8:22:27 PM] Archiblad: you fixed weapon icons?
[8:22:31 PM] Cam: I think so?
[8:22:34 PM] Archiblad: xDDDDDDD
[8:22:38 PM] Cam: I haven’t tested thoroughly
[8:22:39 PM] Archiblad: what did you do so I can tell hex
[8:22:40 PM] Cam: but it doesn’t
[8:22:40 PM] Cam: work
[8:22:45 PM] Cam: er
[8:22:47 PM] Cam: it doesn’t break
[8:22:50 PM] Cam: the thing is
[8:22:52 PM] Cam: it shouldn’t work
[8:22:53 PM] Cam: either
[8:22:53 PM] CamO_o
[8:22:59 PM] Cam: i literally just
[8:23:01 PM] Cam: made it say
[8:23:15 PM] Cam: well
[8:23:24 PM] Cam: a
cmp r4, #0x80 @
command was turned into
cmp r4, #0xFF @
[8:23:29 PM] Cam: i wanted to see what would happen
[8:23:30 PM] Cam: it uh
[8:23:37 PM] Cam: made the shop unbreak
[8:23:39 PM] Cam: that’s what happened
[8:24:05 PM] Archiblad: if you can make it a patch or tell me what to change
[8:24:09 PM] Archiblad: I’ll go give it a thorough test
[8:25:00 PM] Cam: CB666 should turn from 0x80 to 0xFF
[8:25:01 PM] Cam: i don’t
[8:25:02 PM] Cam: know how it works
[8:25:05 PM] Cam: so
[8:25:56 PM] Archiblad: okaywhat
[8:26:04 PM] Cam: ?
[8:26:07 PM] Archiblad: http://puu.sh/9yiPy/8bb746a53b.png

[8:26:14 PM] Cam: er
[8:26:23 PM] Cam: probably the 0x80 behind it then
[8:26:32 PM] Cam: idk
[8:26:34 PM] Cam: the three roms I tried
[8:26:41 PM] Cam: had three different versions of the code there
[8:26:51 PM] Archiblad: that’s pretty bizarre
[8:27:00 PM] Cam: It’s probably
[8:27:08 PM] Cam: differences between the source
[8:27:09 PM] Cam: and soething else
[8:27:10 PM] Cam: like
[8:27:20 PM] Cam: my test ROM matched the source
[8:27:31 PM] Cam: and then the two versions of the EN ROM I tried had two different routines
[8:27:40 PM] Cam: that were functionally the saem thing but one of them was about 60% more arcane[/quote]

There was one version of the patch that had a 0x7F instead of a 0x80; changing that should do the same thing. If you need help locating the correct bytes, let me know and I’ll help you out.

And, since this solution really should not work, if you run into any weird things like your swords turning into vulneraries, that’s probably why.

1 Like

Team UNDERTROLL success!

EDIT: Or not.

[5:47:34 PM] Archiblad: AWW FUCK
[5:47:37 PM] Archiblad: yeah
[5:47:40 PM] Archiblad: it didn’t work
[5:48:02 PM] Cam: ?
[5:48:04 PM] Archiblad: http://puu.sh/9ykfJ/067a676cf4.png when first loaded the icon works
[5:48:13 PM] Cam: haha
[5:48:18 PM] Cam: let me guess
[5:48:23 PM] Cam: quicksword is not written over a vanilla icon
[5:48:36 PM] Archiblad: when you scroll it loses it
[5:48:37 PM] Archiblad: yeah
[5:48:41 PM] Cam: Alright
[5:48:41 PM] Archiblad: it’s one of the last in my row
[5:48:47 PM] Cam: hm
[5:49:01 PM] Cam: hang on
[5:49:10 PM] Cam: what’s the index of the last icon
[5:49:17 PM] Cam: in the vanilla ROM
[5:49:18 PM] Cam: ?
[5:50:05 PM] Archiblad: AC
[5:50:30 PM] Cam: ok
[5:51:27 PM] Cam: maybe
[5:51:41 PM] Cam: try changing the offset I gave you
[5:51:47 PM] Cam: from 0xFF to 0xAC
[5:53:05 PM] Archiblad: That just gives us the same glitch as before
[5:53:10 PM] Archiblad: but with a different cutoff point
[5:54:06 PM] Cam: ok
[5:54:13 PM] Cam: that’s what i figured
[5:54:14 PM] Cam: damn
[5:54:23 PM] Cam: so i guess i have to figure this out normally -_-
[5:54:47 PM] Archiblad: I’ll see if I can’t clean out some uued icons and change the cutoff to just what I need
[5:54:49 PM] Archiblad: and hope it works
[5:56:21 PM] Cam: if the cutoff is beyond 0xAC it’s probably going to have the original issue
[5:56:25 PM] Cam: where it doesn’t reload them properly
[6:05:13 PM | Edited 6:05:20 PM] Archiblad: it only happens to enemies apparently
[6:06:57 PM] Archiblad: or actually only when it’s their only ite
[6:07:29 PM] Archiblad: or last item maybe
[6:07:34 PM] Cam: …
[6:07:36 PM] Cam: wtf???
[6:07:41 PM] Cam: ???
[6:07:45 PM] Cam: i
[6:07:47 PM] Cam: i
[6:07:48 PM] Cam: wat
[6:08:01 PM] Archiblad: I’m testing with the absolute last icon
[6:08:05 PM] Archiblad: which is 0xCF
[6:09:28 PM] Archiblad: this is bizarre, cuz some are doing it and some aren’t
[6:10:23 PM] Archiblad: or yeah, it’s actually enemy only
[6:10:47 PM] Archiblad: none of them glitch with the players, and it just switches to the nearest icon in memory
[6:11:04 PM] Archiblad: Erik’s seem stable in Tale 3 with the absolute last icon
[6:11:40 PM | Edited 6:12:06 PM] Archiblad: but icon 0xCF works perfectly
[6:12:57 PM] Archiblad: 0xCE does not
[6:13:20 PM] Archiblad: okay there we go now it glitched for a player
[6:13:34 PM] Archiblad: so it was just the icon I was testing
[6:16:03 PM] Archiblad: so 0xB8-0xCE don’t work
[6:18:28 PM] Cam: ???
[6:18:44 PM] Archiblad: I’m guessing the game natively handles 0x00-0xB7
[6:18:51 PM] Cam=: probably
[6:18:58 PM | Edited 6:18:59 PM] Cam: but it works with the last icon…?
[6:19:04 PM] Archiblad: yeah the game loads them once and then can’t find it again
[6:23:12 PM] Archiblad: http://puu.sh/9ynlk/7a9573a260.png first load, http://puu.sh/9ynnJ/ba8aca02f3.png after scrolling down and back once
[6:23:32 PM] Archiblad: the dragonstone is 0xB8

1 Like

[quote][5:44:54 AM] Cam: alright, assuming everything goes to plan
[5:44:46 AM | Edited 5:44:50 AM] Cam: the affected icons for my iibf patch should only be b0-b7
[5:44:54 AM] Cam: i think i know what went wrong
[5:45:04 AM] Cam: with the original
[5:45:24 AM] zahlman: what is iibf
[5:45:29 AM] Cam: item icon bugfix
[5:45:31 AM] zahlman: oh
[5:45:32 AM] Cam: the entire icon flag table goes from 02026A50 to 02026D10
[5:45:56 AM] Cam: and then the list at 02026d10 goes for however many entries (i want to say 33 offhand)
[5:46:16 AM] Cam: so the block of memory from 02026a50 to 02026D30
[5:46:24 AM] Cam: gets wiped as part of default behaviour
[5:46:47 AM] Cam: however, icons beyond 0xB7 have their flags stored past this point
[5:46:50 AM] Cam: and don’t get wiped
[5:47:00 AM] Cam: that’s why they seem to never get reloaded when they should be
[5:47:39 AM | Edited 5:47:46 AM] Cam: the ones at like CF and beyond (wherever else it starts working again) is probably because it encounters some new block of memory that gets wiped for a different reason (D:)
[/quote]

will probably have a fix out in a few hours

1 Like

A fix (as well as further discussion) can be found here

1 Like