Skip to content

Instantly share code, notes, and snippets.

@inactive123
Created October 10, 2011 15:25
Show Gist options
  • Save inactive123/1275600 to your computer and use it in GitHub Desktop.
Save inactive123/1275600 to your computer and use it in GitHub Desktop.
blit.diff
diff --git a/src/burner/PS3/main.cpp b/src/burner/PS3/main.cpp
index 12753bb..21f3482 100644
--- a/src/burner/PS3/main.cpp
+++ b/src/burner/PS3/main.cpp
@@ -221,8 +221,6 @@ int main(int argc, char **argv)
{
if(bVidRecalcPalette)
{
- audio_check();
- nCurrentFrame++;
VidFrame_RecalcPalette();
}
do{
diff --git a/src/interface/PS3/vid_interface_ps3.cpp b/src/interface/PS3/vid_interface_ps3.cpp
index ed6f17c..3eda11f 100644
--- a/src/interface/PS3/vid_interface_ps3.cpp
+++ b/src/interface/PS3/vid_interface_ps3.cpp
@@ -141,25 +141,6 @@ int VidFrame_RecalcPalette()
}while(r < 256);
bVidRecalcPalette = false;
- pBurnDraw = pVidTransImage;
- nBurnPitch = nVidImageWidth << 1;
- BurnDrvFrame();
- psglRender();
-
- int y = 0;
- do{
- int x = 0;
-
- do{
- ((unsigned int*)pDest)[x] = pVidTransPalette[pSrc[x]];
- x++;
- }while(x < nVidImageWidth);
-
- y++;
- pSrc += nVidImageWidth;
- pDest += nVidImagePitch;
- }while(y < nVidImageHeight);
-
return 0;
}
diff --git a/src/interface/PS3/vid_psgl.cpp b/src/interface/PS3/vid_psgl.cpp
index 7916234..fd837a4 100644
--- a/src/interface/PS3/vid_psgl.cpp
+++ b/src/interface/PS3/vid_psgl.cpp
@@ -553,17 +553,19 @@ void CalculateViewports(void)
vph = DEST_BOTTOM;
setview(vpx, vpy, vpw, vph, nImageWidth, nImageHeight);
}
- VidSCopyImage();
+ uint8_t * dst = (uint8_t *)buffer;
+ VidSCopyImage(dst);
}
void psglRender(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- VidSCopyImage();
+ uint32_t * texture = (uint32_t*)glMapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE, GL_WRITE_ONLY);
+ VidSCopyImage(texture);
+ glUnmapBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE);
frame_count += 1;
- glBufferSubData(GL_TEXTURE_REFERENCE_BUFFER_SCE, 0, (nVidImageWidth * nVidImageHeight) << SCREEN_RENDER_TEXTURE_BPP_SHIFT, buffer);
glTextureReferenceSCE(GL_TEXTURE_2D, 1, nVidImageWidth, nVidImageHeight, 0, SCREEN_RENDER_TEXTURE_PIXEL_FORMAT, nVidImageWidth << SCREEN_RENDER_TEXTURE_BPP_SHIFT, 0);
set_cg_params();
@@ -612,7 +614,8 @@ void psglRenderStretch()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- VidSCopyImage();
+ uint8_t * dst = (uint8_t *)buffer;
+ VidSCopyImage(dst);
}
diff --git a/src/interface/PS3/vid_support-ps3.h b/src/interface/PS3/vid_support-ps3.h
index 693dc43..cffdc63 100644
--- a/src/interface/PS3/vid_support-ps3.h
+++ b/src/interface/PS3/vid_support-ps3.h
@@ -33,8 +33,7 @@ void VidInitInfo();
#define SCREEN_RENDER_TEXTURE_PIXEL_FORMAT BPP_16_SCREEN_RENDER_TEXTURE_PIXEL_FORMAT
#endif
-#define VidSCopyImage() \
- uint8_t * dst = (uint8_t *)buffer; \
+#define VidSCopyImage(dst) \
unsigned int pitch = nVidImageWidth * sizeof(unsigned int); \
uint8_t * ps = pVidImage + (nVidImageLeft << SCREEN_RENDER_TEXTURE_BPP_SHIFT); \
int linesize = nVidImageWidth << SCREEN_RENDER_TEXTURE_BPP_SHIFT; \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment