#5078 - lordmetroid - Sun Apr 20, 2003 9:17 am
I'm trying to make an automatic upload of the tiles that aren't allready in VRAM with my dynamic tile engine... however it doesn't seem to work... perhaps it's my pointer arithemtics that is faulty...
I got this, from various files but paste it together so it will be easier to see:
mge2d_manager_upload[896] is a database over what physical tiles to upload
mge2d_manager_upload_num keeps track of where in the database we are active
*mge2d_manager_tiledata a pointer to the tiles in ROM
mge2d_manager_physical2logical[896] a Database over what VRAM tileslot number has what ROM tilenumber
What happends is that it only uploads one tile of the three that is in the upload database, and it is the last one which should place itself on tileslot 0 however there isn't even a trace of the other 3 in the DB... if I change 0x20=> 0x40 then it ends up uploading the last tile in the DB to tileslot 0 but noone else.
What am I doing wrong?
please help...
[/quote][/code]
_________________
*Spam*
Open Solutions for an open mind, www.areta.org
Areta is an organization of coders codeing mostly open source project, but there is alot of sections like GBA dev, Language learning communities, RPG communities, etc...
I got this, from various files but paste it together so it will be easier to see:
Code: |
#define MEM_VRAM ((volatile u16*)0x6000000) u16 mge2d_manager_upload[896], mge2d_manager_upload_num, *mge2d_manager_tiledata, mge2d_manager_physical2logical[896]; REG_DM3DAD = (u32)(MEM_VRAM + 0x20*mge2d_manager_upload[mge2d_manager_upload_num-1]); REG_DM3SAD = (u32)(mge2d_manager_tiledata + 0x40*mge2d_manager_physical2logical[mge2d_manager_upload[mge2d_manager_upload_num-1]]); REG_DM3CNT = 16 | SET_TRANSFER_32BIT | SET_SYNC_VBLANK | SET_ENABLE; |
mge2d_manager_upload[896] is a database over what physical tiles to upload
mge2d_manager_upload_num keeps track of where in the database we are active
*mge2d_manager_tiledata a pointer to the tiles in ROM
mge2d_manager_physical2logical[896] a Database over what VRAM tileslot number has what ROM tilenumber
What happends is that it only uploads one tile of the three that is in the upload database, and it is the last one which should place itself on tileslot 0 however there isn't even a trace of the other 3 in the DB... if I change 0x20=> 0x40 then it ends up uploading the last tile in the DB to tileslot 0 but noone else.
What am I doing wrong?
please help...
[/quote][/code]
_________________
*Spam*
Open Solutions for an open mind, www.areta.org
Areta is an organization of coders codeing mostly open source project, but there is alot of sections like GBA dev, Language learning communities, RPG communities, etc...