1
1
// doomgeneric for arduino
2
2
3
3
#include " Arduino.h"
4
- #include " Envie_video_coreboot .h"
4
+ #include " Portenta_Video .h"
5
5
6
6
#define sleep _sleep
7
7
@@ -155,7 +155,9 @@ static void DMA2D_Init(uint16_t xsize, uint16_t ysize)
155
155
clut.Size = 0xFF ;
156
156
157
157
#ifdef CORE_CM7
158
- SCB_InvalidateDCache_by_Addr (clut.pCLUT , clut.Size );
158
+ SCB_CleanInvalidateDCache ();
159
+ SCB_InvalidateICache ();
160
+ // SCB_InvalidateDCache_by_Addr(clut.pCLUT, clut.Size);
159
161
#endif
160
162
161
163
HAL_DMA2D_CLUTLoad (&DMA2D_Handle, clut, 1 );
@@ -193,6 +195,9 @@ void DG_Init()
193
195
LCD_Y_Size = stm32_getYSize ();
194
196
195
197
SDRAM.begin (getFramebufferEnd ());
198
+
199
+ stm32_LCD_Clear (0 );
200
+ stm32_LCD_Clear (0 );
196
201
}
197
202
198
203
void DG_OnPaletteReload () {
@@ -224,6 +229,7 @@ static void handleKeyInput()
224
229
#endif
225
230
}
226
231
232
+ #define DEBUG_CM7_VIDEO
227
233
228
234
static void DMA2D_CopyBuffer (uint32_t *pSrc, uint32_t *pDst)
229
235
{
@@ -235,7 +241,7 @@ static void DMA2D_CopyBuffer(uint32_t *pSrc, uint32_t *pDst)
235
241
236
242
destination = (uint32_t )pDst; // + ((yPos * stm32_getXSize()) + xPos) * 4;
237
243
238
- HAL_DMA2D_PollForTransfer (&DMA2D_Handle, 25 ); /* wait for the previous DMA2D transfer to ends */
244
+ HAL_DMA2D_PollForTransfer (&DMA2D_Handle, 200 ); /* wait for the previous DMA2D transfer to ends */
239
245
/* copy the new decoded frame to the LCD Frame buffer*/
240
246
HAL_DMA2D_Start (&DMA2D_Handle, (uint32_t )pSrc, destination, DOOMGENERIC_RESX, DOOMGENERIC_RESY);
241
247
#if defined(CORE_CM7) && !defined(DEBUG_CM7_VIDEO)
@@ -247,7 +253,9 @@ void DG_DrawFrame()
247
253
{
248
254
uint32_t fb = getNextFrameBuffer ();
249
255
#ifdef CORE_CM7
250
- SCB_InvalidateDCache_by_Addr ((uint32_t *)fb, DOOMGENERIC_RESX * DOOMGENERIC_RESY * 4 );
256
+ SCB_CleanInvalidateDCache ();
257
+ SCB_InvalidateICache ();
258
+ // SCB_InvalidateDCache_by_Addr((uint32_t *)fb, DOOMGENERIC_RESX * DOOMGENERIC_RESY * 4);
251
259
#endif
252
260
253
261
DMA2D_CopyBuffer ((uint32_t *)DG_ScreenBuffer, (uint32_t *)fb);
0 commit comments