Skip to content

Commit 62cf50f

Browse files
committed
VIDEO: replace __VIClearFramebuffer asm with actual code
1 parent 4b3240b commit 62cf50f

File tree

3 files changed

+17
-109
lines changed

3 files changed

+17
-109
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ OGCOBJ := \
141141
lwp_messages.o lwp.o lwp_handler.o lwp_stack.o lwp_mutex.o \
142142
lwp_watchdog.o lwp_wkspace.o lwp_objmgr.o lwp_heap.o sys_state.o \
143143
exception_handler.o exception.o irq.o irq_handler.o semaphore.o \
144-
video_asm.o video.o pad.o dvd.o exi.o mutex.o arqueue.o arqmgr.o \
144+
video.o pad.o dvd.o exi.o mutex.o arqueue.o arqmgr.o \
145145
cache_asm.o system.o system_asm.o cond.o \
146146
gx.o gu.o gu_psasm.o gu_ps_concat44.o audio.o cache.o decrementer.o \
147147
message.o card.o aram.o depackrnc.o decrementer_handler.o \

libogc/video.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,6 @@ static vu16* const _viReg = (u16*)0xCC002000;
17301730
extern syssram* __SYS_LockSram(void);
17311731
extern u32 __SYS_UnlockSram(u32 write);
17321732

1733-
extern void __VIClearFramebuffer(void*,u32,u32);
1734-
17351733
extern void udelay(int us);
17361734

17371735
#ifdef _VIDEO_DEBUG
@@ -1854,6 +1852,22 @@ static const struct _timing* __gettiming(u32 vimode)
18541852
}
18551853
}
18561854

1855+
//clear the framebuffer in 64 byte blocks with the specific color
1856+
void __VIClearFramebuffer(void* videoBuffer, u32 length, u32 color)
1857+
{
1858+
//unknown why it gets the block count like this. division by 2560x100?
1859+
u32 block_count = (length >> 8);
1860+
u32 *p = (videoBuffer - 1);
1861+
1862+
while (block_count--) {
1863+
int i;
1864+
1865+
//set 0x40 byte block
1866+
for (i = 0; i < 0x40; ++i)
1867+
*++p = color;
1868+
}
1869+
}
1870+
18571871
#if defined(HW_RVL)
18581872
static inline void __viOpenI2C(u32 channel)
18591873
{

libogc/video_asm.S

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)