draft API for OpenGL shito in libui

This commit is contained in:
Arisotura 2019-03-31 21:15:45 +02:00
parent b9703d2e8f
commit 75f8cbf953
4 changed files with 27 additions and 4 deletions

View File

@ -159,7 +159,7 @@ void ARM::SetupCodeMem(u32 addr)
//NDS::ARM7GetMemRegion(addr, false, &CodeMem); //NDS::ARM7GetMemRegion(addr, false, &CodeMem);
} }
} }
extern u64 vbltime;
void ARMv5::JumpTo(u32 addr, bool restorecpsr) void ARMv5::JumpTo(u32 addr, bool restorecpsr)
{ {
if (restorecpsr) if (restorecpsr)
@ -180,6 +180,16 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr)
if (R[15]==0x0204BE5E) printf("recvfrom() ret:%d errno:%d %08X\n", R[0], NDS::ARM9Read32(0x217F398), addr); if (R[15]==0x0204BE5E) printf("recvfrom() ret:%d errno:%d %08X\n", R[0], NDS::ARM9Read32(0x217F398), addr);
if (R[15]==0x0205038A) printf("sgrecvfrom() ret:%d errno:%d %08X\n", R[0], NDS::ARM9Read32(0x217F398), addr); if (R[15]==0x0205038A) printf("sgrecvfrom() ret:%d errno:%d %08X\n", R[0], NDS::ARM9Read32(0x217F398), addr);
if (addr==0x02050379 || addr==0x0205036D) printf("morp %08X->%08X, %d\n", R[15], addr, R[7]);*/ if (addr==0x02050379 || addr==0x0205036D) printf("morp %08X->%08X, %d\n", R[15], addr, R[7]);*/
/*if (addr==0x020B5F14) printf("VRAM UNMAP %02X %08X\n", R[0], R[15]);
if (addr==0x020B5FAC) printf("VRAM MAP %2X %08X\n", R[0], R[15]);
if (addr==0x0209F860) printf("VRAM BLORP %02X %08X\n", R[0], R[15]);
if (addr==0x02005A34) printf("VAZAVAZORP %08X. VCOUNT=%d\n", R[15], NDS::ARM9Read16(0x04000006));
if (addr==0x0209FBEC) printf("COUILLON. %08X %08X\n", R[0], R[1]);
if (addr==0x02004AA8) printf("ANEBATE 1 %d\n", NDS::ARM9Read16(0x04000006));
if (addr==0x020058C8) printf("ANEBATE 2 %d\n", NDS::ARM9Read16(0x04000006));
if (addr==0x02005398) printf("ANEBATE 3 %d %d\n", NDS::ARM9Read16(0x04000006), (u32)(NDS::ARM9Timestamp-vbltime));
if (addr==0x02005A5C) printf("PLAFORP %d\n", NDS::ARM9Read16(0x04000006));
if (addr==0x209FBDC) printf("ROLOLORP\n");*/
u32 oldregion = R[15] >> 24; u32 oldregion = R[15] >> 24;
u32 newregion = addr >> 24; u32 newregion = addr >> 24;
@ -508,6 +518,8 @@ void ARMv5::Execute()
} }
else else
AddCycles_C(); AddCycles_C();
//if (R[15]>=0x02005A5C && R[15]<=0x02005A84) printf("NORP %08X %d\n", R[15]-8, NDS::ARM9Read16(0x04000006));
} }
// TODO optimize this shit!!! // TODO optimize this shit!!!

View File

@ -20,7 +20,7 @@
#include <string.h> #include <string.h>
#include "NDS.h" #include "NDS.h"
#include "GPU.h" #include "GPU.h"
u64 vbltime;
namespace GPU namespace GPU
{ {
@ -811,7 +811,7 @@ void StartScanline(u32 line)
else else
{ {
if (VCount == 192) if (VCount == 192)
{ {//printf("- VBLANK -\n");vbltime=NDS::ARM9Timestamp;
// VBlank // VBlank
DispStat[0] |= (1<<0); DispStat[0] |= (1<<0);
DispStat[1] |= (1<<0); DispStat[1] |= (1<<0);

View File

@ -1532,7 +1532,7 @@ void debug(u32 param)
// printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]); // printf("VRAM %c: %02X\n", 'A'+i, GPU::VRAMCNT[i]);
FILE* FILE*
shit = fopen("debug/lmnts.bin", "wb"); shit = fopen("debug/card.bin", "wb");
for (u32 i = 0x02000000; i < 0x02400000; i+=4) for (u32 i = 0x02000000; i < 0x02400000; i+=4)
{ {
u32 val = ARM7Read32(i); u32 val = ARM7Read32(i);

View File

@ -599,6 +599,17 @@ _UI_EXTERN void uiDrawTextLayoutSetColor(uiDrawTextLayout *layout, int startChar
_UI_EXTERN void uiDrawText(uiDrawContext *c, double x, double y, uiDrawTextLayout *layout); _UI_EXTERN void uiDrawText(uiDrawContext *c, double x, double y, uiDrawTextLayout *layout);
// OpenGL support
// TODO for later: allow using OpenGL inside a uiWindow or uiArea
typedef struct uiGLContext uiGLContext;
_UI_EXTERN uiGLContext *uiGLNewContext(uiControl* c);
_UI_EXTERN void uiGLMakeContextCurrent(uiGLContext* ctx);
_UI_EXTERN void *uiGLGetProcAddress(const char* proc);
_UI_ENUM(uiModifiers) { _UI_ENUM(uiModifiers) {
uiModifierCtrl = 1 << 0, uiModifierCtrl = 1 << 0,
uiModifierAlt = 1 << 1, uiModifierAlt = 1 << 1,