#8076 - Archeious - Tue Jul 01, 2003 5:36 pm
I thought the following code would work but I am getting intermitent skipping.
The bin can be found at http://www.geocities.com/archeious/netwars.bin is you want to see what is going on. Any and all help figuring this out would be great.
Archeious
Quote: |
while (1) { RotateBackground(&bg3,angle,119,79,zoom); //set center of screen inputResponse=process_Input(); WaitForVsync(); if (inputResponse & MAP_MOVERIGHT) { bg3.x_scroll++; bg3.x_display++; if (bg3.x_scroll > 151) { bg3.x_scroll = 136; x+=2; REG_DM3SAD = (u32)bg3.mapData+2; REG_DM3DAD = (u32)bg3.mapData; REG_DM3CNT = 2048 | DMA_16NOW; // width*height / 2 = 2048 test = (u16*)bg3.mapData; for (loop=0;loop<=22;loop++) { test[(loop*32)+16] = myMap->data[(loop*myMap->width)+x+32] | (myMap->data[(loop*myMap->width)+x+33] << 8); } } } if (inputResponse & MAP_MOVELEFT) { bg3.x_scroll--; bg3.x_display++; if (bg3.x_scroll < 121) { bg3.x_scroll = 136; REG_DM3SAD = (u32)bg3.mapData+4094; REG_DM3DAD = (u32)bg3.mapData+4096; REG_DM3CNT = 32*64 | DMA_SOURCE_DECREMENT | DMA_DEST_DECREMENT | DMA_16NOW; // 32 = 8x8/16 bit word } } if (inputResponse & MAP_MOVEDOWN) { bg3.y_scroll++; bg3.y_display++; if (bg3.y_scroll > 111) { bg3.y_scroll = 96; y+=2; REG_DM3SAD = (u32)bg3.mapData+128; REG_DM3DAD = (u32)bg3.mapData; REG_DM3CNT = 32*64 | DMA_16NOW; // 32 = 8x8/16 bit word REG_DM3SAD = (u32)&myMap->data[((y+22)*myMap->width)+x]; REG_DM3DAD = (u32)bg3.mapData+(1408); // 22*64 REG_DM3CNT = 32 | DMA_16NOW; // 32 = 8x8/16 bit word REG_DM3SAD = (u32)&myMap->data[((y+23)*myMap->width)+x]; REG_DM3DAD = (u32)bg3.mapData+(1472); // 23*64 REG_DM3CNT = 32 | DMA_16NOW; // 32 = 8x8/16 bit word */ FONT_printU32(y,0,0); } } if ((inputResponse & MAP_MOVEUP) && bg3.y_display > 0) { bg3.y_scroll--; bg3.y_display--; if (bg3.y_scroll < 81) { bg3.y_scroll = 96; y+=-2; REG_DM3SAD = (u32)bg3.mapData+3968; REG_DM3DAD = (u32)bg3.mapData+4096; REG_DM3CNT = 32*64 | DMA_SOURCE_DECREMENT | DMA_DEST_DECREMENT | DMA_16NOW; // 32 = 8x8/16 bit word REG_DM3SAD = (u32)&myMap->data[(y*myMap->width)+x]; REG_DM3DAD = (u32)bg3.mapData; REG_DM3CNT = 32 | DMA_16NOW; // 32 = 8x8/16 bit word REG_DM3SAD = (u32)&myMap->data[((y+1)*myMap->width)+x]; REG_DM3DAD = (u32)bg3.mapData+64; REG_DM3CNT = 32 | DMA_16NOW; // 32 = 8x8/16 bit word FONT_printU32(y,0,0); } } UpdateBackground(&bg3); CopyOAM(); } |
The bin can be found at http://www.geocities.com/archeious/netwars.bin is you want to see what is going on. Any and all help figuring this out would be great.
Archeious