| 22 | |
| 23 | #ifndef DAEDALUS_PSP |
| 24 | static inline CRefPtr<CNativeTexture> LoadFrameBuffer(u32 origin) |
| 25 | { |
| 26 | u32 width = Memory_VI_GetRegister( VI_WIDTH_REG ); |
| 27 | if( width == 0 ) |
| 28 | { |
| 29 | //DAEDALUS_ERROR("Loading 0 size frame buffer?"); |
| 30 | return NULL; |
| 31 | } |
| 32 | |
| 33 | if( origin <= width*2 ) |
| 34 | { |
| 35 | //DAEDALUS_ERROR("Loading small frame buffer not supported"); |
| 36 | return NULL; |
| 37 | } |
| 38 | //ToDO: We should use uViWidth+1 and uViHeight+1 |
| 39 | #define FB_WIDTH 320 |
| 40 | #define FB_HEIGHT 240 |
| 41 | |
| 42 | DAEDALUS_ASSERT(g_CI.Size == G_IM_SIZ_16b,"32b frame buffer is not supported"); |
| 43 | //DAEDALUS_ASSERT((uViWidth+1) == FB_WIDTH,"Variable width is not handled"); |
| 44 | //DAEDALUS_ASSERT((uViHeight+1) == FB_HEIGHT,"Variable height is not handled"); |
| 45 | |
| 46 | TextureInfo ti; |
| 47 | |
| 48 | ti.SetSwapped (0); |
| 49 | ti.SetPalette (0); |
| 50 | ti.SetTlutAddress (TLUT_BASE); |
| 51 | ti.SetTLutFormat (kTT_RGBA16); |
| 52 | ti.SetFormat (0); |
| 53 | ti.SetSize (2); |
| 54 | |
| 55 | ti.SetLoadAddress (origin - width*2); |
| 56 | ti.SetWidth (FB_WIDTH); |
| 57 | ti.SetHeight (FB_HEIGHT); |
| 58 | ti.SetPitch (width << 2 >> 1); |
| 59 | |
| 60 | return gRenderer->LoadTextureDirectly(ti); |
| 61 | } |
| 62 | |
| 63 | //Borrowed from StrmnNrmn's N64js |
| 64 | static inline void DrawFrameBuffer(u32 origin, const CNativeTexture * texture) |
no test coverage detected