gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > too many VRAM BG MEM yet? uh !

#8450 - RaBBi - Thu Jul 10, 2003 11:39 pm

Hello,

I keep on learning gba dev since 4 days now, with HAM.

I'm working on tiles mode and try to show a 256x256 bmp (125 unique colors).

I converted it by gfx2gba 0.13 > OK

But when I load it, the emulator returns me a error message :

Code:
assertion failed: (( I+CNT)x32)
in file: memory.c
at line: +299
message: HAM_MEMALLOCVRAM BG MEM FULL..DEALLOCATLE FIRST


It seems the SIZEOF tiles array is too big (25216) for the memory...

I had a sprite so I think it took too memory, so I disabled it, but I always have this message...

When I re-think that there are 128 simultaneous sprites at a time...
I'm still sceptic about it, if just one pic take the whole mem ^^

Can anyone take time to make a point on tiles memory please ?
than U
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#8459 - Cyberman - Fri Jul 11, 2003 5:16 am

It's not likely the case you are allocating too much memory for your tiles. Very unlikely. You are using 256 color tiles what background layer are you using? You have 394 tiles used for a 32x32 array of tiles (they are 8x8). You must be using BG 0 or B1 if you aren't then.. that could be your problem, well IS your problem.

If you are using visual ham (I recomend this) then you should set a break point wheree you load the tile data and step to that.. continue on into the code tell you get the exception thrown Just a suggestion :)

Cyb

#8461 - RaBBi - Fri Jul 11, 2003 7:38 am

Hi,

I'm using mode(0), and BG1 to display tiles (I reserved BG0 to display debug test for the moment ^^).

In fact, after optimization under gfx2gba, it announces me I have 788 (which is double of 394) tiles used for a 32x32 array of tiles, not 394 as what you say.

Does the problem comes from that point ?

I must precise that the picture tiled comes from GBA game : Golden Sun 2, and the mode and bg used to display this is the same way I use (but I fail lol)
It's not to steal graphs from this game, just for test ^^
They have 959 tiles as I see in MapViewer from VBA.

I'll try to set a break point, it's a great idea, thank U but Debug is not yet familiar for me ^^

I'll put here the array lengths to show you what I get :

Code:
/*
 * 32x32 map data
 */
const unsigned short ciel_Map[1024]

const unsigned short ciel_Palette[256]

//
// ciel (50432 uncompressed bytes)
//
const unsigned char ciel_Tiles[50432]


EDIT: i tried to set a break point on line I suppose to crash but I didn't find how in VHAM 2.2...
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^