Added broken GPU rendering.
This commit is contained in:
parent
93abc0958f
commit
3fc02d32ef
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,7 @@
|
||||||
#include "arm.h"
|
#include "arm.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "arm11/allocator/vram.h"
|
#include "arm11/allocator/vram.h"
|
||||||
|
#include "arm11/hardware/gpu_init_list.h"
|
||||||
|
|
||||||
|
|
||||||
#define PDN_REGS_BASE (IO_MEM_ARM9_ARM11 + 0x40000)
|
#define PDN_REGS_BASE (IO_MEM_ARM9_ARM11 + 0x40000)
|
||||||
|
@ -235,6 +236,9 @@ void GFX_gpuInit(void)
|
||||||
*((vu32*)0x10401080) = 0x12345678;
|
*((vu32*)0x10401080) = 0x12345678;
|
||||||
*((vu32*)0x104010C0) = 0xFFFFFFF0;
|
*((vu32*)0x104010C0) = 0xFFFFFFF0;
|
||||||
*((vu32*)0x104010D0) = 1;
|
*((vu32*)0x104010D0) = 1;
|
||||||
|
|
||||||
|
GX_processCommandList(29824, (u32*)gpuInitList);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_P3D, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GFX_setFramebufFmt(GfxFbFmt fmtTop, GfxFbFmt fmtBot)
|
void GFX_setFramebufFmt(GfxFbFmt fmtTop, GfxFbFmt fmtBot)
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
# 8 bytes burst with 16 transfers. Total 128 bytes per burst.
|
||||||
|
# Source fixed address and destination incrementing.
|
||||||
|
# Source and destination privileged data access.
|
||||||
|
MOV CCR, SB16 SS64 SAF SP3 DB16 DS64 DAI DP3
|
||||||
|
MOV SAR, 0x10311000
|
||||||
|
MOV DAR, 0x181ABA00
|
||||||
|
|
||||||
|
FLUSHP 14
|
||||||
|
|
||||||
|
|
||||||
|
# Loop until the entire frame has been transferred.
|
||||||
|
LPFE
|
||||||
|
# Wait for single or burst requests.
|
||||||
|
WFP 14, periph
|
||||||
|
|
||||||
|
# LgyFb sometimes (at the end of each scanline?) sends
|
||||||
|
# single requests. Since we can transfer all 8 scanlines
|
||||||
|
# with bursts only we will ignore them.
|
||||||
|
LP 29
|
||||||
|
LDB
|
||||||
|
STB
|
||||||
|
LPENDB
|
||||||
|
LDPB 14
|
||||||
|
STB
|
||||||
|
LPEND
|
||||||
|
SEV 0
|
||||||
|
END
|
|
@ -0,0 +1,36 @@
|
||||||
|
# 8 bytes burst with 4 transfers. Total 32 bytes per burst.
|
||||||
|
# Source fixed address and destination incrementing.
|
||||||
|
# Source and destination privileged data access.
|
||||||
|
MOV CCR, SB4 SS64 SAF SP3 DB4 DS64 DAI DP3
|
||||||
|
MOV SAR, 0x10311000
|
||||||
|
MOV DAR, 0x18400000
|
||||||
|
|
||||||
|
FLUSHP 14
|
||||||
|
|
||||||
|
|
||||||
|
# Loop until the entire frame has been transferred.
|
||||||
|
LPFE
|
||||||
|
# Wait for single or burst requests.
|
||||||
|
WFP 14, periph
|
||||||
|
|
||||||
|
# LgyFb sometimes (at the end of each scanline?) sends
|
||||||
|
# single requests. Since we can transfer all 8 scanlines
|
||||||
|
# with bursts only we will ignore them.
|
||||||
|
LP 7
|
||||||
|
LP 15
|
||||||
|
LDB
|
||||||
|
STB
|
||||||
|
LPENDB
|
||||||
|
ADDH DAR, 0x10
|
||||||
|
LPENDB
|
||||||
|
|
||||||
|
LP 14
|
||||||
|
LDB
|
||||||
|
STB
|
||||||
|
LPENDB
|
||||||
|
LDPB 14
|
||||||
|
STB
|
||||||
|
ADDH DAR, 0x10
|
||||||
|
LPEND
|
||||||
|
SEV 0
|
||||||
|
END
|
|
@ -44,11 +44,181 @@ void LGYFB_init(void)
|
||||||
REG_LGYFB_TOP_STAT = LGYFB_IRQ_MASK;
|
REG_LGYFB_TOP_STAT = LGYFB_IRQ_MASK;
|
||||||
REG_LGYFB_TOP_IRQ = 0;
|
REG_LGYFB_TOP_IRQ = 0;
|
||||||
REG_LGYFB_TOP_ALPHA = 0xFF;
|
REG_LGYFB_TOP_ALPHA = 0xFF;
|
||||||
REG_LGYFB_TOP_CNT = LGYFB_DMA_E | /*LGYFB_OUT_SWIZZLE |*/ LGYFB_OUT_FMT_5551 | LGYFB_ENABLE;
|
REG_LGYFB_TOP_CNT = LGYFB_DMA_E | LGYFB_OUT_SWIZZLE | LGYFB_OUT_FMT_5551 | LGYFB_ENABLE;
|
||||||
|
|
||||||
IRQ_registerHandler(IRQ_CDMA_EVENT0, 13, 0, true, lgyFbDmaIrqHandler);
|
IRQ_registerHandler(IRQ_CDMA_EVENT0, 13, 0, true, lgyFbDmaIrqHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rotateFrame(void)
|
||||||
|
{
|
||||||
|
/*GX_displayTransfer((u32*)0x18400000, 256u<<16 | 256u, (u32*)0x18200000, 256u<<16 | 256u, 3u<<12 | 3u<<8 | 1u<<1);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_PPF, false);*/
|
||||||
|
|
||||||
|
alignas(16) static const u8 firstList[1136] =
|
||||||
|
{
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x10, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x06, 0x03,
|
||||||
|
0x1C, 0x01, 0x2F, 0x80, 0x00, 0x00, 0x03, 0x03, 0xF0, 0xF0, 0x18, 0x01,
|
||||||
|
0xF0, 0xF0, 0x18, 0x01, 0x6E, 0x00, 0x0F, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||||
|
0x16, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x17, 0x01, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x1B, 0x01, 0x0F, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x12, 0x01, 0x3F, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x45, 0x00,
|
||||||
|
0x41, 0x00, 0x3F, 0x80, 0x10, 0x11, 0x11, 0x38, 0x00, 0x90, 0x46, 0x00,
|
||||||
|
0x14, 0xAE, 0x47, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x68, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x2F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x29, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x02, 0x03, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0xCB, 0x02, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x4E, 0xCC, 0x02, 0x7F, 0x00,
|
||||||
|
0x01, 0xF0, 0x07, 0x4E, 0x02, 0x08, 0x02, 0x08, 0x03, 0x18, 0x02, 0x08,
|
||||||
|
0x04, 0x28, 0x02, 0x08, 0x05, 0x38, 0x02, 0x08, 0x06, 0x10, 0x20, 0x4C,
|
||||||
|
0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0xBF, 0x02, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x02, 0x0F, 0x00,
|
||||||
|
0x6E, 0x03, 0x00, 0x00, 0xD6, 0x02, 0x6F, 0x00, 0xA1, 0x0A, 0x00, 0x00,
|
||||||
|
0x68, 0xC3, 0x06, 0x00, 0x64, 0xC3, 0x06, 0x00, 0x62, 0xC3, 0x06, 0x00,
|
||||||
|
0x61, 0xC3, 0x06, 0x00, 0x6F, 0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F,
|
||||||
|
0xBA, 0x02, 0x0F, 0x00, 0x03, 0x00, 0x00, 0x00, 0xBD, 0x02, 0x0F, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x4A, 0x02, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x51, 0x02, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5E, 0x02, 0x01, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x7F, 0x80, 0x00, 0x01, 0x02, 0x03,
|
||||||
|
0x0C, 0x0D, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
|
||||||
|
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x0F, 0x00,
|
||||||
|
0x01, 0x01, 0x00, 0x00, 0x6F, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x29, 0x02, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x02, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x54, 0x02, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xA0,
|
||||||
|
0x89, 0x02, 0x0F, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x01, 0x02, 0x1F, 0x80,
|
||||||
|
0x00, 0x00, 0xFC, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xA0,
|
||||||
|
0xB9, 0x02, 0x0B, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x02, 0x0F, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0xBB, 0x02, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x0F, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xBF, 0x00,
|
||||||
|
0x4D, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x04, 0x01, 0x3F, 0x80, 0x10, 0x00, 0x00, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x10, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x26, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x76, 0x76, 0x01, 0x01, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0F, 0x00, 0x00, 0x01, 0xE4, 0x00,
|
||||||
|
0x00, 0x01, 0x07, 0x00, 0x00, 0x3C, 0x00, 0x80, 0x30, 0x01, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x18, 0x01, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x61, 0x00, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x6A, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x81, 0x00, 0x4F, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x8E, 0x00, 0x0F, 0x00, 0x01, 0x10, 0x01, 0x00, 0x80, 0x00, 0x0B, 0x00,
|
||||||
|
0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x8B, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0xE1, 0x00, 0x0F, 0x00, 0x03, 0x00, 0x03, 0x00, 0xC0, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0xC8, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0xD0, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0xD8, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0xF0, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0xF8, 0x00, 0x4F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0xC0, 0x02, 0x3F, 0x80,
|
||||||
|
0xBF, 0x00, 0x00, 0x3E, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x02, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x80, 0xBF, 0xC1, 0x02, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x88, 0x88, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xD7, 0xA3, 0xBB,
|
||||||
|
0x00, 0x00, 0x80, 0xBF, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0xFF, 0x7F, 0xB0, 0x02, 0x0F, 0x00, 0x00, 0x01, 0x00, 0x00,
|
||||||
|
0x5E, 0x02, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5F, 0x02, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x80, 0x27, 0x02, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x53, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x02, 0x01, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x32, 0x02, 0x0F, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x45, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80, 0x80, 0x3D, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x80, 0x3D, 0x00, 0x00, 0x00, 0xE0, 0x3E, 0x00,
|
||||||
|
0x3E, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80, 0x40, 0x46, 0x00, 0x00,
|
||||||
|
0x00, 0x40, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80,
|
||||||
|
0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x40, 0x46, 0x00, 0x00, 0x00, 0x40, 0x47, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80, 0x00, 0x3F, 0x00, 0x00,
|
||||||
|
0x00, 0xE0, 0x3E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x02, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x53, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x31, 0x02, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x0F, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x10, 0x01, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x63, 0x00, 0x0F, 0x00, 0x78, 0x56, 0x34, 0x12, 0x10, 0x00, 0x0F, 0x00,
|
||||||
|
0x78, 0x56, 0x34, 0x12, 0x10, 0x00, 0x0F, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
alignas(16) static const u8 secondList[448] =
|
||||||
|
{
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x10, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x06, 0x03,
|
||||||
|
0x1C, 0x01, 0x2F, 0x80, 0x00, 0x00, 0x03, 0x03, 0xF0, 0xF0, 0x18, 0x01,
|
||||||
|
0xF0, 0xF0, 0x18, 0x01, 0x6E, 0x00, 0x0F, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||||
|
0x16, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x17, 0x01, 0x0F, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x1B, 0x01, 0x0F, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x12, 0x01, 0x3F, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x45, 0x00,
|
||||||
|
0x41, 0x00, 0x3F, 0x80, 0x10, 0x11, 0x11, 0x38, 0x00, 0x90, 0x46, 0x00,
|
||||||
|
0x14, 0xAE, 0x47, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x68, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x2F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||||
|
0xC0, 0x02, 0x0F, 0x00, 0x00, 0x00, 0x80, 0xBF, 0xC1, 0x02, 0xFF, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x08, 0x3C, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x0A, 0xD7, 0xA3, 0xBB, 0x00, 0x00, 0x80, 0xBF, 0x00, 0x00, 0x80, 0x3F,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x5E, 0x02, 0x02, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x5F, 0x02, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||||
|
0x27, 0x02, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x53, 0x02, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x45, 0x02, 0x01, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x32, 0x02, 0x0F, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x80, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x3E, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x40, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80,
|
||||||
|
0x80, 0x3D, 0x00, 0x00, 0x00, 0xE0, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x40, 0x46, 0x00, 0x00, 0x00, 0x40, 0x45, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80, 0x00, 0x3F, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x33, 0x02, 0x2F, 0x80,
|
||||||
|
0x40, 0x46, 0x00, 0x00, 0x00, 0x40, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x33, 0x02, 0x2F, 0x80, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xE0, 0x3E, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x45, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x53, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x02, 0x0F, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x10, 0x01, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x63, 0x00, 0x0F, 0x00,
|
||||||
|
0x78, 0x56, 0x34, 0x12, 0x10, 0x00, 0x0F, 0x00, 0x78, 0x56, 0x34, 0x12,
|
||||||
|
0x10, 0x00, 0x0F, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool firstRender = false;
|
||||||
|
u32 listSize;
|
||||||
|
const u32 *list;
|
||||||
|
if(firstRender == false)
|
||||||
|
{
|
||||||
|
firstRender = true;
|
||||||
|
|
||||||
|
listSize = 1136;
|
||||||
|
list = (u32*)firstList;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
listSize = 448;
|
||||||
|
list = (u32*)secondList;
|
||||||
|
}
|
||||||
|
/*GX_memoryFill((u32*)0x18180000, 0, 240 * 400 * 2, 0, (u32*)0x18300000, 0, 0x100000, 0);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_PSC0, false);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_PSC1, false);*/
|
||||||
|
GX_processCommandList(listSize, list);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_P3D, false);
|
||||||
|
GX_displayTransfer((u32*)0x18180000, 400u<<16 | 240u, GFX_getFramebuffer(SCREEN_TOP), 400u<<16 | 240u, 3u<<12 | 3u<<8);
|
||||||
|
GFX_waitForEvent(GFX_EVENT_PPF, false);
|
||||||
|
}
|
||||||
|
|
||||||
void LGYFB_processFrame(void)
|
void LGYFB_processFrame(void)
|
||||||
{
|
{
|
||||||
if(atomic_load_explicit(&flag, memory_order_relaxed))
|
if(atomic_load_explicit(&flag, memory_order_relaxed))
|
||||||
|
@ -56,7 +226,7 @@ void LGYFB_processFrame(void)
|
||||||
atomic_store_explicit(&flag, false, memory_order_relaxed);
|
atomic_store_explicit(&flag, false, memory_order_relaxed);
|
||||||
|
|
||||||
// TODO: Do this with the GPU.
|
// TODO: Do this with the GPU.
|
||||||
u16 *fb = GFX_getFramebuffer(SCREEN_TOP) + (160 * 2) + (80 * 2 * 240);
|
/*u16 *fb = GFX_getFramebuffer(SCREEN_TOP) + (160 * 2) + (80 * 2 * 240);
|
||||||
const u64 *data = (u64*)RENDERBUF_TOP;
|
const u64 *data = (u64*)RENDERBUF_TOP;
|
||||||
for(u32 y = 0; y < 160; y++)
|
for(u32 y = 0; y < 160; y++)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +242,8 @@ void LGYFB_processFrame(void)
|
||||||
|
|
||||||
fb--;
|
fb--;
|
||||||
data += 240 / 4;
|
data += 240 / 4;
|
||||||
}
|
}*/
|
||||||
|
rotateFrame();
|
||||||
|
|
||||||
// CDMA takes some cycles to get to stopped state so we will use this time
|
// CDMA takes some cycles to get to stopped state so we will use this time
|
||||||
// to do the frame rotation and restart it later.
|
// to do the frame rotation and restart it later.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# 8 bytes burst with 16 transfers. Total 128 bytes per burst.
|
# 8 bytes burst with 4 transfers. Total 32 bytes per burst.
|
||||||
# Source fixed address and destination incrementing.
|
# Source fixed address and destination incrementing.
|
||||||
# Source and destination privileged data access.
|
# Source and destination privileged data access.
|
||||||
MOV CCR, SB16 SS64 SAF SP3 DB16 DS64 DAI DP3
|
MOV CCR, SB4 SS64 SAF SP3 DB4 DS64 DAI DP3
|
||||||
MOV SAR, 0x10311000
|
MOV SAR, 0x10311000
|
||||||
MOV DAR, 0x181ABA00
|
MOV DAR, 0x18200000
|
||||||
|
|
||||||
FLUSHP 14
|
FLUSHP 14
|
||||||
|
|
||||||
|
@ -16,12 +16,21 @@ LPFE
|
||||||
# LgyFb sometimes (at the end of each scanline?) sends
|
# LgyFb sometimes (at the end of each scanline?) sends
|
||||||
# single requests. Since we can transfer all 8 scanlines
|
# single requests. Since we can transfer all 8 scanlines
|
||||||
# with bursts only we will ignore them.
|
# with bursts only we will ignore them.
|
||||||
LP 29
|
LP 7
|
||||||
|
LP 15
|
||||||
|
LDB
|
||||||
|
STB
|
||||||
|
LPENDB
|
||||||
|
ADDH DAR, 0x10
|
||||||
|
LPENDB
|
||||||
|
|
||||||
|
LP 14
|
||||||
LDB
|
LDB
|
||||||
STB
|
STB
|
||||||
LPENDB
|
LPENDB
|
||||||
LDPB 14
|
LDPB 14
|
||||||
STB
|
STB
|
||||||
|
ADDH DAR, 0x10
|
||||||
LPEND
|
LPEND
|
||||||
SEV 0
|
SEV 0
|
||||||
END
|
END
|
||||||
|
|
|
@ -47,6 +47,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
GFX_init(GFX_RGB5A1, GFX_RGB565);
|
GFX_init(GFX_RGB5A1, GFX_RGB565);
|
||||||
GFX_setBrightness(0x30, 0x30);
|
GFX_setBrightness(0x30, 0x30);
|
||||||
|
GFX_gpuInit();
|
||||||
consoleInit(SCREEN_BOT, NULL, false);
|
consoleInit(SCREEN_BOT, NULL, false);
|
||||||
CODEC_init();
|
CODEC_init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue