Force LgyFb to insert 16 pixels of padding horizontally. Makes tiled output finally work.
This commit is contained in:
parent
31da2d7f62
commit
63f03cd824
|
@ -19,8 +19,8 @@
|
|||
#define LGYFB_DMA_E (1u<<15)
|
||||
#define LGYFB_UNK (1u<<16)
|
||||
|
||||
// REG_LGYFB_SIZE
|
||||
#define LGYFB_SIZE(v, h) (((v) - 1)<<16 | ((h) - 1))
|
||||
// REG_LGYFB_SIZE width and hight
|
||||
#define LGYFB_SIZE(w, h) (((h) - 1)<<16 | ((w) - 1))
|
||||
|
||||
// REG_LGYFB_STAT and REG_LGYFB_IRQ
|
||||
#define LGYFB_IRQ_DMA_REQ (1u)
|
||||
|
|
|
@ -51,20 +51,18 @@ void LGYFB_init(void)
|
|||
{
|
||||
if(DMA330_run(0, program)) return;
|
||||
|
||||
REG_LGYFB_TOP_SIZE = LGYFB_SIZE(160u, 240u);
|
||||
// Insert 16 pixels padding horizontally to fit the texture.
|
||||
REG_LGYFB_TOP_SIZE = LGYFB_SIZE(256u, 160u);
|
||||
REG_LGYFB_TOP_STAT = LGYFB_IRQ_MASK;
|
||||
REG_LGYFB_TOP_IRQ = 0;
|
||||
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);
|
||||
}
|
||||
|
||||
void rotateFrame(void)
|
||||
{
|
||||
GX_displayTransfer((u32*)0x18400000, 160u<<16 | 256u, (u32*)0x18200000, 160u<<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,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# 8 bytes burst with 4 transfers. Total 32 bytes per burst.
|
||||
# 8 bytes burst with 16 transfers. Total 128 bytes per burst.
|
||||
# Source fixed address and destination incrementing.
|
||||
# Source and destination unprivileged, non-secure data access.
|
||||
MOV CCR, SB4 SS64 SAF SP2 DB4 DS64 DAI DP2
|
||||
MOV CCR, SB16 SS64 SAF SP2 DB16 DS64 DAI DP2
|
||||
MOV SAR, 0x10311000
|
||||
MOV DAR, 0x18400000
|
||||
MOV DAR, 0x18200000
|
||||
|
||||
FLUSHP 14
|
||||
|
||||
|
@ -16,21 +16,12 @@ LPFE
|
|||
# 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, 0x20
|
||||
LPENDB
|
||||
|
||||
LP 14
|
||||
LP 31
|
||||
LDB
|
||||
STB
|
||||
LPENDB
|
||||
LDPB 14
|
||||
STB
|
||||
ADDH DAR, 0x20
|
||||
LPEND
|
||||
WMB
|
||||
SEV 0
|
||||
|
|
|
@ -36,7 +36,7 @@ void clearScreens(void)
|
|||
|
||||
void updateScreens(void)
|
||||
{
|
||||
GX_textureCopy((u32*)RENDERBUF_TOP, 0, (u32*)GFX_getFramebuffer(SCREEN_TOP),
|
||||
GX_textureCopy(RENDERBUF_TOP, 0, GFX_getFramebuffer(SCREEN_TOP),
|
||||
0, SCREEN_SIZE_TOP + SCREEN_SIZE_BOT);
|
||||
GFX_waitForEvent(GFX_EVENT_PPF, true); // Texture copy
|
||||
GFX_swapFramebufs();
|
||||
|
|
Loading…
Reference in New Issue