#38150 - Loner - Wed Mar 23, 2005 1:49 am
Hi, i'm new to DS development and i've already developed some demo on the GBA.
here's my questions.
1. In the begining i was thinking that the main screen was the top one on the DS but after some test using ndslib on dualis and i've see that it was the opposite, Is this a problem a problem of ndslib or the emulator? or this is the normal behavior on the DS?
2. Look at this code
The only thing that it do is displaying a tile image on the top screen and 2 diferents one on the layer 0 and 1 on the bottom screen. It work perfectly.
now look at those 2 lines
i'm copying both map data in the same CHAR_BASE_BLOCK so normally it would override some tiles at this location the second time i copy but like i've said it's working perfectly. So i'm wondering if is there something i don't understand with CHAR_BASE_BLOCK. The same thing happen when i set the SCREEN_BASE_BLOCK to 31 for both layer on bottom screen.
3.
I don't really understand those new VRAM bank, my code is working fine even is i put garbage like "2342" in those register, i've even try to put all 4 banks to VRAM_D_SUB_SPRITE and my code was still working normally?
Is there a bug with dualis about those or again i'm not understanding what they do?
Thank you
Long live to the DS community :D
Loner
here's my questions.
1. In the begining i was thinking that the main screen was the top one on the DS but after some test using ndslib on dualis and i've see that it was the opposite, Is this a problem a problem of ndslib or the emulator? or this is the normal behavior on the DS?
2. Look at this code
Code: |
// Set the main screen to mode 2d with bg 0 and 1 active DISPLAY_CR = MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE; // Set the sub screen to mode 2d with bg 0 active SUB_DISPLAY_CR = MODE_0_2D | DISPLAY_BG0_ACTIVE; // Set VRAM BANK VRAM_A_CR = VRAM_ENABLE | VRAM_A_MAIN_BG; VRAM_B_CR = VRAM_ENABLE | VRAM_B_MAIN_SPRITE; VRAM_C_CR = VRAM_ENABLE | VRAM_C_SUB_BG; VRAM_D_CR = VRAM_ENABLE | VRAM_D_SUB_SPRITE; BG0_CR = BG_COLOR_256 | (31<< SCREEN_SHIFT) | (0 << CHAR_SHIFT) | BG_PRIORITY_1; BG1_CR = BG_COLOR_256 | (30 << SCREEN_SHIFT) | (0 << CHAR_SHIFT) | BG_PRIORITY_0; SUB_BG0_CR = BG_COLOR_256 | (31 << SCREEN_SHIFT) | (0 << CHAR_SHIFT); // top screen Layer 0 COPY16((uint16*)splash_pal, (uint16 *)BG_PALETTE_SUB, 256); COPY16((uint16*)splash_map, (uint16* )SCREEN_BASE_BLOCK_SUB(31), 32*24); COPY16((uint16*)splash_raw, (uint16* )CHAR_BASE_BLOCK_SUB(0),372*32); // bottom screen Layer 0 COPY16((uint16*)splash2_pal, (uint16 *)BG_PALETTE, 256); COPY16((uint16*)splash2_map, (uint16* )SCREEN_BASE_BLOCK(31), 32*24); COPY16((uint16*)splash2_raw, (uint16* )CHAR_BASE_BLOCK(0), 503*32); // bottom screen Layer 1 COPY16((uint16*)spl_layer1_map, (uint16* )SCREEN_BASE_BLOCK(30), 32*14); COPY16((uint16*)spl_layer1_raw, (uint16* )CHAR_BASE_BLOCK(0), 192*32); |
The only thing that it do is displaying a tile image on the top screen and 2 diferents one on the layer 0 and 1 on the bottom screen. It work perfectly.
now look at those 2 lines
Code: |
COPY16((uint16*)splash2_raw, (uint16* )CHAR_BASE_BLOCK(0), 503*32);
|
Code: |
COPY16((uint16*)spl_layer1_raw, (uint16* )CHAR_BASE_BLOCK(0), 192*32); |
i'm copying both map data in the same CHAR_BASE_BLOCK so normally it would override some tiles at this location the second time i copy but like i've said it's working perfectly. So i'm wondering if is there something i don't understand with CHAR_BASE_BLOCK. The same thing happen when i set the SCREEN_BASE_BLOCK to 31 for both layer on bottom screen.
3.
Code: |
// Set VRAM BANK
VRAM_A_CR = VRAM_ENABLE | VRAM_A_MAIN_BG; VRAM_B_CR = VRAM_ENABLE | VRAM_B_MAIN_SPRITE; VRAM_C_CR = VRAM_ENABLE | VRAM_C_SUB_BG; VRAM_D_CR = VRAM_ENABLE | VRAM_D_SUB_SPRITE; |
I don't really understand those new VRAM bank, my code is working fine even is i put garbage like "2342" in those register, i've even try to put all 4 banks to VRAM_D_SUB_SPRITE and my code was still working normally?
Is there a bug with dualis about those or again i'm not understanding what they do?
Thank you
Long live to the DS community :D
Loner