mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-03-06 21:00:31 +01:00
base for software renderer
This commit is contained in:
parent
c95f7578bb
commit
78f49d061a
4 changed files with 75 additions and 1 deletions
|
@ -177,11 +177,15 @@ bool Init()
|
||||||
CmdFIFO = new FIFO<CmdFIFOEntry>(256);
|
CmdFIFO = new FIFO<CmdFIFOEntry>(256);
|
||||||
CmdPIPE = new FIFO<CmdFIFOEntry>(4);
|
CmdPIPE = new FIFO<CmdFIFOEntry>(4);
|
||||||
|
|
||||||
|
if (!SoftRenderer::Init()) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeInit()
|
void DeInit()
|
||||||
{
|
{
|
||||||
|
SoftRenderer::DeInit();
|
||||||
|
|
||||||
delete CmdFIFO;
|
delete CmdFIFO;
|
||||||
delete CmdPIPE;
|
delete CmdPIPE;
|
||||||
}
|
}
|
||||||
|
@ -228,6 +232,8 @@ void Reset()
|
||||||
CurPolygonRAM = &PolygonRAM[0];
|
CurPolygonRAM = &PolygonRAM[0];
|
||||||
NumVertices = 0;
|
NumVertices = 0;
|
||||||
NumPolygons = 0;
|
NumPolygons = 0;
|
||||||
|
|
||||||
|
SoftRenderer::Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1152,7 +1158,8 @@ void CheckFIFODMA()
|
||||||
|
|
||||||
void VBlank()
|
void VBlank()
|
||||||
{
|
{
|
||||||
// TODO: render
|
// TODO: only do this if a SwapBuffers command was issued
|
||||||
|
SoftRenderer::RenderFrame(CurVertexRAM, CurPolygonRAM, NumPolygons);
|
||||||
|
|
||||||
CurRAMBank = CurRAMBank?0:1;
|
CurRAMBank = CurRAMBank?0:1;
|
||||||
CurVertexRAM = &VertexRAM[CurRAMBank ? 6144 : 0];
|
CurVertexRAM = &VertexRAM[CurRAMBank ? 6144 : 0];
|
||||||
|
|
11
GPU3D.h
11
GPU3D.h
|
@ -53,6 +53,17 @@ void Write8(u32 addr, u8 val);
|
||||||
void Write16(u32 addr, u16 val);
|
void Write16(u32 addr, u16 val);
|
||||||
void Write32(u32 addr, u32 val);
|
void Write32(u32 addr, u32 val);
|
||||||
|
|
||||||
|
namespace SoftRenderer
|
||||||
|
{
|
||||||
|
|
||||||
|
bool Init();
|
||||||
|
void DeInit();
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
void RenderFrame(Vertex* vertices, Polygon* polygons, int npolys);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
55
GPU3D_Soft.cpp
Normal file
55
GPU3D_Soft.cpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
Copyright 2016-2017 StapleButter
|
||||||
|
|
||||||
|
This file is part of melonDS.
|
||||||
|
|
||||||
|
melonDS is free software: you can redistribute it and/or modify it under
|
||||||
|
the terms of the GNU General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with melonDS. If not, see http://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "NDS.h"
|
||||||
|
#include "GPU3D.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace GPU3D
|
||||||
|
{
|
||||||
|
namespace SoftRenderer
|
||||||
|
{
|
||||||
|
|
||||||
|
u8 ColorBuffer[256*192 * 4];
|
||||||
|
|
||||||
|
|
||||||
|
bool Init()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeInit()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
memset(ColorBuffer, 0, 256*192 * 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RenderFrame(Vertex* vertices, Polygon* polygons, int npolys)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,6 +58,7 @@
|
||||||
<Unit filename="GPU2D.h" />
|
<Unit filename="GPU2D.h" />
|
||||||
<Unit filename="GPU3D.cpp" />
|
<Unit filename="GPU3D.cpp" />
|
||||||
<Unit filename="GPU3D.h" />
|
<Unit filename="GPU3D.h" />
|
||||||
|
<Unit filename="GPU3D_Soft.cpp" />
|
||||||
<Unit filename="NDS.cpp" />
|
<Unit filename="NDS.cpp" />
|
||||||
<Unit filename="NDS.h" />
|
<Unit filename="NDS.h" />
|
||||||
<Unit filename="NDSCart.cpp" />
|
<Unit filename="NDSCart.cpp" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue