#22567 - immortalninjak - Thu Jun 24, 2004 11:13 am
hey ho,
I'm having trouble switching from mode 0-4
to start I have 3 bgs in mode 0:
I then mess around with the sprites and scroll the bgs so I reset the scrolling regiters:
before chaging to mode4:
However this does not seem to work. The screen appears blue repeating the first pixel over and over.
Using the map viewer in VBA it shows that everything is ok, with the corretly loaded bg and mode set.
If the code above is used seperatly everything is ok.
Only when I switch from mode 0 to 4 do I get this problem.
Any ideas?
thank you
I'm having trouble switching from mode 0-4
to start I have 3 bgs in mode 0:
Code: |
SetMode(MODE_0 | OBJ_ENABLE | OBJ_MAP_1D);
bg0clear.number = 0; bg0clear.charBaseBlock = 0; bg0clear.screenBaseBlock = 24; bg0clear.colorMode = BG_COLOR_256; bg0clear.size = TEXTBG_SIZE_256x256; bg0clear.mosaic = 0; bg0clear.x_scroll = 0; bg0clear.y_scroll = 0; bg0clear.priority = BG_P2; bg1title.number = 1; bg1title.charBaseBlock = 0; bg1title.screenBaseBlock = 16; bg1title.colorMode = BG_COLOR_256; bg1title.size = TEXTBG_SIZE_256x256; bg1title.mosaic = 0; bg1title.x_scroll = 200; bg1title.y_scroll = 247; bg1title.priority = BG_P1; bg2scroll.number = 2; bg2scroll.charBaseBlock = 0; bg2scroll.screenBaseBlock = 8; bg2scroll.colorMode = BG_COLOR_256; bg2scroll.size = TEXTBG_SIZE_256x256; bg2scroll.mosaic = 0; bg2scroll.x_scroll = 0; bg2scroll.y_scroll = 0; bg1title.priority = BG_P3; EnableBackground(&bg0clear); EnableBackground(&bg1title); EnableBackground(&bg2scroll); |
I then mess around with the sprites and scroll the bgs so I reset the scrolling regiters:
Code: |
REG_BG2HOFS =0;
REG_BG2VOFS =0; REG_BG0HOFS =0; REG_BG0VOFS =0; REG_BG1HOFS =0; REG_BG1VOFS =0; |
before chaging to mode4:
Code: |
SetMode(MODE_4 | BG2_ENABLE | OBJ_ENABLE | OBJ_MAP_1D);
for (int i = 0; i < 256; i++){ BGPaletteMem[i] = into1Palette[i]; } REG_DMA3SAD = (u32) &(into1Data[0]); REG_DMA3DAD = 0x6000000; REG_DMA3CNT = 9600 | DMA_32NOW; |
However this does not seem to work. The screen appears blue repeating the first pixel over and over.
Using the map viewer in VBA it shows that everything is ok, with the corretly loaded bg and mode set.
If the code above is used seperatly everything is ok.
Only when I switch from mode 0 to 4 do I get this problem.
Any ideas?
thank you