#8432 - whodoo - Thu Jul 10, 2003 1:26 pm
Something is gettin wrong when Im tryin to use mosaic on a background..
the code for this:
#define SetMosaic(bh,bv,oh,ov) ((bh)+(bv<<4)+(oh<<8)+(ov<<12))
and then..
REG_BG1CNT=0x40;
SetMosaic(2,2,0,0);
the backgroun disappears and all I see is a buncha green squares..whats wrong?
#8433 - Quirky - Thu Jul 10, 2003 1:36 pm
A bunch of squares sounds like an accurate desciption of the mosiac effect :)
You've got the right idea, I think, setting bit 6 of the bg register. You just need to ramp up the mosiac register (0x400004C). I have used this code with success before:
for (i = 0; i < 16; i++) {
wait_vsync();
REG_MOSAIC = SetMosaic(i,i,0,0);
}
#8434 - whodoo - Thu Jul 10, 2003 2:03 pm
hehe but it?s about..20 small squares (mabye 8x8)..on some random places on the screen..and the rest of the screen is black..
#8435 - whodoo - Thu Jul 10, 2003 2:07 pm
only a part of the background is being changed and the rest turns black
#8638 - night_ - Thu Jul 17, 2003 1:56 am
Code: |
[quote]REG_BG1CNT=0x40; [/quote] |
this line does not only set bit 6 of the register to 1, but sets all other bits to 0. What you probably wanna do is to OR the register with 0x40 and assign the result to the register again:
Code: |
REG_BG1CNT=REG_BG1CNT| 0x40; |
which ist the same as :
#8656 - whodoo - Thu Jul 17, 2003 1:08 pm
with the original code I see about 20 small 8x8 blocks on the screen..
if I use
REG_BG1CNT|=0x40;
nothing?s happening, I see the background without mosaic..
#8657 - whodoo - Thu Jul 17, 2003 1:17 pm
gah silly little me, I found a missed line in my BG-code :) thanks anyways works fine now