News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Problem when resizing sprite  (Read 653 times)

Tailo

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Problem when resizing sprite
« on: February 05, 2019, 12:49:53 pm »
Hello,
I hope you can help me. I will try to explain as best I can the problem that is presented to me.
I am learning to modify graphics in GBA games, and I have started with "DBZ: The Legacy of Goku" because it is quite easy to modify sprites and backrounds in this game. But the problem arises when wanting to resize the portraits of the characters. These have an original size of 32x32 and my intention is to convert them to 64x64. I have already resized other sprites without any problem, but in this case the VRAM does not load the full graphic data.



As you can see, it recognizes a 64x64 sprite, but it only loads x200h bytes of the x800h of the graph and the other remaining x600h bytes take them from the following sprites. The mapping of the chart I have checked hundreds of times and it is correct. I have also changed the number of the Tile to try something different and still loading x200h, the rest is empty.



I don't know what is the problem...

Thanks!

FAST6191

  • Hero Member
  • *****
  • Posts: 2560
    • View Profile
Re: Problem when resizing sprite
« Reply #1 on: February 06, 2019, 08:02:54 am »
By and large most hackers will try to avoid doing this sort of thing unless they absolutely have to, even for something as memory rich as the GBA is (relatively speaking anyway... http://pineight.com/gba/managing-sprite-vram.txt ). Should you manage it for that then you still run the risk of something happening later as it now lacks memory. I have even seen filling in an apparently "blank" tile cause troubles with running out of memory on the DS.

The GBA does not have too much of a "stack" or managed memory for video RAM. To that end my first thoughts are something overwrote it later, or the command set to read in the data to VRAM was shorter than it needed to be -- if it was only expecting a 32x32 tile then the read/copy/dma/whatever command might only have been for that amount of tile data.

Tailo

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Problem when resizing sprite
« Reply #2 on: February 06, 2019, 11:40:35 am »
Thanks for answering.

How clumsy I have been! How I have not noticed? Effectively in the VRAM a white Tile of 8x8 is loaded and it is the one that occupies the entire space.
Will it be a programming error or is it conscientiously placed?
I do not know what result it will have, but I will try to "locate" it and get rid of it.

February 06, 2019, 02:19:26 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Well, after playing with the code of the game for a while, I realized that this white tile fills the VRAM but does not prevent it from loading new sprites, that is, it makes them hollow, so if it is not an impediment to load bytes in VRAM, again I'm in the beginning ... Is it possible that in addition to the attribute, the sprites of the portraits of the characters have prefixed 200h bytes in some way? If not, I can not find an explanation, because there is still a lot of memory to load sprites ... In fact, originally Goku was a 16x32 sprite and I resized it to 32x32 and there is no problem loading your graphic ...

February 08, 2019, 05:26:46 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Although it is not very relevant, I can say that I solved it. It only remains to change it of place.

« Last Edit: February 08, 2019, 05:26:47 pm by Tailo »