#145489 - kiwicode - Fri Nov 16, 2007 4:29 pm
Hi all,
I've got a very strange problem and I can't figure out what it might be the cause.
I want to change the value of subscreen's memory ( for example to draw a simple rect ). This is pretty easy and I don't have any problems with it.
The problem occurs when I want to copy the data on every single byte of the subscreen instead of copying it on 2 bytes per time.
After this simple cast I don't see anything blitted on my subscreen!
How can this happen?
I've initialized everything that way:
any ideas?
Thanks in advance.
I've got a very strange problem and I can't figure out what it might be the cause.
I want to change the value of subscreen's memory ( for example to draw a simple rect ). This is pretty easy and I don't have any problems with it.
Code: |
for( int iy = 50; iy < 100; iy ++ ) { for( int ix = 50; ix < 150; ix++ ) { video_buffer[ iy * 256 + ix >> 1 ] = 15 | ( 15 << 8 ); } } |
The problem occurs when I want to copy the data on every single byte of the subscreen instead of copying it on 2 bytes per time.
Code: |
( ( uint8 * )video_buffer )[ iy * 256 + ix ] = 15 | ( 15 << 8 ); |
After this simple cast I don't see anything blitted on my subscreen!
How can this happen?
I've initialized everything that way:
Code: |
videoSetMode( MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D_LAYOUT | DISPLAY_SPR_EXT_PALETTE ); videoSetModeSub( MODE_5_2D | DISPLAY_BG3_ACTIVE ); vramSetBankA(VRAM_A_MAIN_BG); vramSetBankB(VRAM_B_MAIN_SPRITE_0x06400000); vramSetBankC(VRAM_C_SUB_BG); u16* video_buffer = (u16*)BG_BMP_RAM_SUB(2); SUB_BG3_CR = BG_BMP8_256x256 | BG_BMP_BASE(2) | BG_PRIORITY(1); SUB_BG3_XDY = 0; SUB_BG3_XDX = 1 << 8; SUB_BG3_YDX = 0; SUB_BG3_YDY = 1 << 8; |
any ideas?
Thanks in advance.