#168971 - Drovor - Sun Jun 07, 2009 1:17 am
I'm trying to make a simple dynamic "minimap" type display for my 3D application on the DS (3D on main, minimap on sub). The 3D hardware seems to be fairly independent of the memory so I've managed to get fairly far without getting into memory management (aside from mapping 1 VRAM bank as texture memory), the sub screen has basically been a debug console so far.
My goal is to be able to draw a large minimap on the sub screen dynamically (probably per-pixel) as needed based on a tile-based 2D array I have already created (and displayed on the 3D hardware).
Since it was my original plan to write the pixels directly going around the 2D hardware seemed to make sense so I was looking at some examples at dev-scene and here which use the framebuffer directly in videoSetMode(MODE_FB0); but I haven't been able to get that to work on the sub screen at this point (also to future proof the code I suspect utilizing the 2D hardware at some point will be a good idea so...).
I began reading Pataters guide to try and get an idea for how the "videoSetMode" calls should be used. I have integrated some of his code and have a PNG image displayed on the sub screen. But I'm not sure how to modify the pixels directly after assigning while in this mode ( videoSetModeSub(MODE_5_2D | DISPLAY_BG3_ACTIVE); )
The backgrounds are copied with a call to dmaCopyHalfWords at memory address BG_BMP_RAM( ... ), should I be able to assign values to that memory directly, or would it be best to create a temporary array and use dmaCopyHalfWords to write it into the BG ram?
Can I still access the framebuffer directly after the BG is drawn like with MODE_FB0?
Finally... maybe all of this is the wrong approach for what I'm trying to do, so any links or alternative ideas would be greatly appreciated.
My goal is to be able to draw a large minimap on the sub screen dynamically (probably per-pixel) as needed based on a tile-based 2D array I have already created (and displayed on the 3D hardware).
Since it was my original plan to write the pixels directly going around the 2D hardware seemed to make sense so I was looking at some examples at dev-scene and here which use the framebuffer directly in videoSetMode(MODE_FB0); but I haven't been able to get that to work on the sub screen at this point (also to future proof the code I suspect utilizing the 2D hardware at some point will be a good idea so...).
I began reading Pataters guide to try and get an idea for how the "videoSetMode" calls should be used. I have integrated some of his code and have a PNG image displayed on the sub screen. But I'm not sure how to modify the pixels directly after assigning while in this mode ( videoSetModeSub(MODE_5_2D | DISPLAY_BG3_ACTIVE); )
The backgrounds are copied with a call to dmaCopyHalfWords at memory address BG_BMP_RAM( ... ), should I be able to assign values to that memory directly, or would it be best to create a temporary array and use dmaCopyHalfWords to write it into the BG ram?
Can I still access the framebuffer directly after the BG is drawn like with MODE_FB0?
Finally... maybe all of this is the wrong approach for what I'm trying to do, so any links or alternative ideas would be greatly appreciated.