From 03b99176cee257928406dee540435dd68defbec9 Mon Sep 17 00:00:00 2001 From: cyberwarriorx Date: Fri, 2 Mar 2007 03:02:53 +0000 Subject: [PATCH] -Changed a few functions' arguments to const since they don't get modified(Thanks for Dmitry Krutskih for the patches) --- desmume/src/GPU.c | 14 +++++++------- desmume/src/GPU.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/desmume/src/GPU.c b/desmume/src/GPU.c index 4d7d41120..650fe39ed 100644 --- a/desmume/src/GPU.c +++ b/desmume/src/GPU.c @@ -383,7 +383,7 @@ INLINE BOOL withinRect (u8 x,u8 y, u16 startX, u16 startY, u16 endX, u16 endY) // Now assumes that *draw and *effect are different from 0 when called, so we can avoid // setting some values twice -void renderline_checkWindows(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL *draw, BOOL *effect) +void renderline_checkWindows(const GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL *draw, BOOL *effect) { struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; WINCNT * wcnt = &gpu->dispx_st->dispx_WINCNT; @@ -446,7 +446,7 @@ void renderline_checkWindows(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL *draw, BOOL // PIXEL RENDERING /*****************************************************************************/ -INLINE BOOL renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 color,u16 x, u16 y) { +INLINE BOOL renderline_setFinalColor(const GPU *gpu, u32 passing, u8 bgnum, u8 *dst, u16 color, u16 x, u16 y) { BOOL windowDraw = TRUE, windowEffect = TRUE ; MISCCNT * msccnt = &gpu->dispx_st->dispx_MISC; /* window priority: insides, if no rule, check outside */ @@ -538,7 +538,7 @@ INLINE BOOL renderline_setFinalColor(GPU *gpu,u32 passing,u8 bgnum,u8 *dst,u16 c /*****************************************************************************/ /* render a text background to the combined pixelbuffer */ -INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG, u16 YBG, u16 LG) +INLINE void renderline_textBG(const GPU * gpu, u8 num, u8 * dst, u32 Y, u16 XBG, u16 YBG, u16 LG) { struct _BGxCNT * bgCnt = &(gpu->dispx_st)->dispx_BGxCNT[num].bits; struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; @@ -895,12 +895,12 @@ void lineExtRot(GPU * gpu, u8 num, u16 l, u8 * DST) 256); } -void textBG(GPU * gpu, u8 num, u8 * DST) +void textBG(const GPU * gpu, u8 num, u8 * DST) { u32 i; for(i = 0; i < gpu->BGSize[num][1]; ++i) { - renderline_textBG(gpu, num, DST + i*gpu->BGSize[num][0], i, 0, i, gpu->BGSize[num][0]); + renderline_textBG(gpu, num, DST + i*gpu->BGSize[num][0]*2, i, 0, i, gpu->BGSize[num][0]); } } @@ -908,14 +908,14 @@ void rotBG(GPU * gpu, u8 num, u8 * DST) { u32 i; for(i = 0; i < gpu->BGSize[num][1]; ++i) - rotBG2(gpu, num, DST + i*gpu->BGSize[num][0], i, 0, 0, 256, 0, 0, 256, gpu->BGSize[num][0]); + rotBG2(gpu, num, DST + i*gpu->BGSize[num][0]*2, i, 0, 0, 256, 0, 0, 256, gpu->BGSize[num][0]); } void extRotBG(GPU * gpu, u8 num, u8 * DST) { u32 i; for(i = 0; i < gpu->BGSize[num][1]; ++i) - extRotBG2(gpu, num, DST + i*gpu->BGSize[num][0], i, 0, 0, 256, 0, 0, 256, gpu->BGSize[num][0]); + extRotBG2(gpu, num, DST + i*gpu->BGSize[num][0]*2, i, 0, 0, 256, 0, 0, 256, gpu->BGSize[num][0]); } diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index 10018afe2..4b529a08a 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -571,7 +571,7 @@ GPU * GPU_Init(u8 l); void GPU_Reset(GPU *g, u8 l); void GPU_DeInit(GPU *); -void textBG(GPU * gpu, u8 num, u8 * DST); +void textBG(const GPU * gpu, u8 num, u8 * DST); //Draw text based background void rotBG(GPU * gpu, u8 num, u8 * DST); void extRotBG(GPU * gpu, u8 num, u8 * DST); void sprite1D(GPU * gpu, u16 l, u8 * dst, u8 * prioTab);