Changed #include dependencies again.
Fixed a bug in GPU (xfin could be greater than LG causing a segfault). Moved GPUs from NDS to global.
This commit is contained in:
parent
de4acb537f
commit
e82af37a36
|
@ -28,6 +28,8 @@
|
|||
#include "nds/video.h"
|
||||
|
||||
extern BOOL click;
|
||||
Screen MainScreen;
|
||||
Screen SubScreen;
|
||||
|
||||
//#define DEBUG_TRI
|
||||
|
||||
|
@ -660,6 +662,8 @@ INLINE void textBG2(GPU * gpu, u8 num, u16 * DST, u16 X, u16 Y, u16 LG)
|
|||
mapinfo += 32*32;
|
||||
u8 * ligne = (u8 * )tile + (((*mapinfo)&0x3FF)*0x20) + (((*mapinfo)& 0x800 ? (7*4)-yoff : yoff));
|
||||
u16 xfin = x + (8 - (xoff&7));
|
||||
if (xfin > LG)
|
||||
xfin = LG;
|
||||
|
||||
if((*mapinfo)& 0x400)
|
||||
{
|
||||
|
@ -711,6 +715,8 @@ INLINE void textBG2(GPU * gpu, u8 num, u16 * DST, u16 X, u16 Y, u16 LG)
|
|||
mapinfo += 32*32;
|
||||
u8 * ligne = (u8 * )tile + (((*mapinfo)&0x3FF)*0x40) + (((*mapinfo)& 0x800 ? (7*8)-yoff : yoff));
|
||||
u16 xfin = x + (8 - (xoff&7));
|
||||
if (xfin > LG)
|
||||
xfin = LG;
|
||||
|
||||
if((*mapinfo)& 0x400)
|
||||
{
|
||||
|
@ -1460,3 +1466,13 @@ void sprite2D(GPU * gpu, u16 l, u16 * dst, u8 * prioTab)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenInit(void) {
|
||||
MainScreen.gpu = GPUInit(0);
|
||||
SubScreen.gpu = GPUInit(1);
|
||||
}
|
||||
|
||||
void ScreenDeInit(void) {
|
||||
GPUDeInit(MainScreen.gpu);
|
||||
GPUDeInit(SubScreen.gpu);
|
||||
}
|
||||
|
|
|
@ -105,6 +105,17 @@ extern size sprSizeTab[4][4];
|
|||
extern s8 mode2type[8][4];
|
||||
extern void (*modeRender[8][4])(GPU * gpu, u8 num, u16 l, u16 * DST);
|
||||
|
||||
typedef struct {
|
||||
GPU * gpu;
|
||||
u16 offset;
|
||||
} Screen;
|
||||
|
||||
extern Screen MainScreen;
|
||||
extern Screen SubScreen;
|
||||
|
||||
void ScreenInit(void);
|
||||
void ScreenDeInit(void);
|
||||
|
||||
INLINE void GPU_ligne(GPU * gpu, u16 * buffer, u16 l)
|
||||
{
|
||||
u16 * dst = buffer + l*256;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef ARM_CPU
|
||||
#define ARM_CPU
|
||||
|
||||
#include "MMU.hpp"
|
||||
#include "types.h"
|
||||
|
||||
#include "bits.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue