[mupen64plus-video-glide64mk2] 51/60: Fix negative frame_buffer indices
Sven Eckelmann
ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:16:17 UTC 2015
This is an automated email from the git hooks/post-receive script.
ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-video-glide64mk2.
commit 568972534358719f59744214adff43dbd8cf6bb1
Author: Sven Eckelmann <sven at narfation.org>
Date: Sat May 2 10:42:48 2015 +0200
Fix negative frame_buffer indices
---
debian/changelog | 2 +
.../fix_negative_framebuffers_indices.patch | 108 +++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 111 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 8ff24cb..c51e8f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ mupen64plus-video-glide64mk2 (2.5-1) UNRELEASED; urgency=medium
path_max_war.patch, s3tc_removal.patch, shader_reset.patch
- Add revert_forced_linux_flto_jobserver.patch, Remove forced
flto=jobserver on linux
+ - Add fix_negative_framebuffers_indices.patch, Fix negative
+ frame_buffer indices
-- Sven Eckelmann <sven at narfation.org> Sat, 20 Sep 2014 11:04:52 +0200
diff --git a/debian/patches/fix_negative_framebuffers_indices.patch b/debian/patches/fix_negative_framebuffers_indices.patch
new file mode 100644
index 0000000..2401087
--- /dev/null
+++ b/debian/patches/fix_negative_framebuffers_indices.patch
@@ -0,0 +1,108 @@
+Description: Fix negative frame_buffer indices
+Origin: upstream, https://github.com/mupen64plus/mupen64plus-video-glide64mk2/commit/129ab881be8dd43e262d02dbe8b391c982a02800
+Author: Richard Goedeken<Richard at fascinationsoftware.com>
+
+---
+diff --git a/src/Glide64/rdp.cpp b/src/Glide64/rdp.cpp
+index 0393225079afe2a4f5dcf4d0f2ef15012af79dea..579a7858e9126c3b0c59830ac2332a337d26c53e 100644
+--- a/src/Glide64/rdp.cpp
++++ b/src/Glide64/rdp.cpp
+@@ -489,7 +489,7 @@ static void CopyFrameBuffer (GrBuffer_t buffer = GR_BUFFER_BACKBUFFER)
+ wxUint32 stride = info.strideInBytes>>1;
+
+ int read_alpha = settings.frame_buffer & fb_read_alpha;
+- if ((settings.hacks&hack_PMario) && rdp.frame_buffers[rdp.ci_count-1].status != ci_aux)
++ if ((settings.hacks&hack_PMario) && rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status != ci_aux)
+ read_alpha = FALSE;
+ int x_start = 0, y_start = 0, x_end = width, y_end = height;
+ if (settings.hacks&hack_BAR)
+@@ -1002,7 +1002,7 @@ static void rdp_texrect()
+ return;
+ }
+
+- if ((settings.ucode == ucode_PerfectDark) && (rdp.frame_buffers[rdp.ci_count-1].status == ci_zcopy))
++ if ((settings.ucode == ucode_PerfectDark) && rdp.ci_count > 0 && (rdp.frame_buffers[rdp.ci_count-1].status == ci_zcopy))
+ {
+ pd_zcopy ();
+ LRDP("Depth buffer copied.\n");
+@@ -1109,7 +1109,7 @@ static void rdp_texrect()
+ if ((settings.ucode == ucode_PerfectDark) && (rdp.maincimg[1].addr != rdp.maincimg[0].addr) && (rdp.timg.addr >= rdp.maincimg[1].addr) && (rdp.timg.addr < (rdp.maincimg[1].addr+rdp.ci_width*rdp.ci_height*rdp.ci_size)))
+ {
+ if (fb_emulation_enabled)
+- if (rdp.frame_buffers[rdp.ci_count-1].status == ci_copy_self)
++ if (rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_copy_self)
+ {
+ //FRDP("Wrong Texrect. texaddr: %08lx, cimg: %08lx, cimg_end: %08lx\n", rdp.timg.addr, rdp.maincimg[1], rdp.maincimg[1]+rdp.ci_width*rdp.ci_height*rdp.ci_size);
+ LRDP("Wrong Texrect.\n");
+@@ -2309,7 +2309,7 @@ static void rdp_fillrect()
+ return;
+ }
+ int pd_multiplayer = (settings.ucode == ucode_PerfectDark) && (rdp.cycle_mode == 3) && (rdp.fill_color == 0xFFFCFFFC);
+- if ((rdp.cimg == rdp.zimg) || (fb_emulation_enabled && rdp.frame_buffers[rdp.ci_count-1].status == ci_zimg) || pd_multiplayer)
++ if ((rdp.cimg == rdp.zimg) || (fb_emulation_enabled && rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_zimg) || pd_multiplayer)
+ {
+ LRDP("Fillrect - cleared the depth buffer\n");
+ if (fullscreen)
+@@ -2415,7 +2415,7 @@ static void rdp_fillrect()
+ {
+ wxUint32 color = rdp.fill_color;
+
+- if ((settings.hacks&hack_PMario) && rdp.frame_buffers[rdp.ci_count-1].status == ci_aux)
++ if ((settings.hacks&hack_PMario) && rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_aux)
+ {
+ //background of auxiliary frame buffers must have zero alpha.
+ //make it black, set 0 alpha to plack pixels on frame buffer read
+@@ -2628,7 +2628,7 @@ static void rdp_settextureimage()
+ rdp.s2dex_tex_loaded = TRUE;
+ rdp.update |= UPDATE_TEXTURE;
+
+- if (rdp.frame_buffers[rdp.ci_count-1].status == ci_copy_self && (rdp.timg.addr >= rdp.cimg) && (rdp.timg.addr < rdp.ci_end))
++ if (rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_copy_self && (rdp.timg.addr >= rdp.cimg) && (rdp.timg.addr < rdp.ci_end))
+ {
+ if (!rdp.fb_drawn)
+ {
+@@ -2975,7 +2975,7 @@ static void rdp_setcolorimage()
+ rdp.ocimg = rdp.cimg;
+ rdp.cimg = segoffset(rdp.cmd1) & BMASK;
+ rdp.ci_width = (rdp.cmd0 & 0xFFF) + 1;
+- if (fb_emulation_enabled)
++ if (fb_emulation_enabled && rdp.ci_count > 0)
+ rdp.ci_height = rdp.frame_buffers[rdp.ci_count-1].height;
+ else if (rdp.ci_width == 32)
+ rdp.ci_height = 32;
+@@ -2997,7 +2997,7 @@ static void rdp_setcolorimage()
+ {
+ if (!rdp.cur_image)
+ {
+- if (fb_hwfbe_enabled && rdp.ci_width <= 64)
++ if (fb_hwfbe_enabled && rdp.ci_width <= 64 && rdp.ci_count > 0)
+ OpenTextureBuffer(rdp.frame_buffers[rdp.ci_count - 1]);
+ else if (format > 2)
+ rdp.skip_drawing = TRUE;
+@@ -3030,7 +3030,7 @@ static void rdp_setcolorimage()
+ SwapOK = FALSE;
+ if (fb_hwfbe_enabled)
+ {
+- if (rdp.copy_ci_index && (rdp.frame_buffers[rdp.ci_count-1].status != ci_zimg))
++ if (rdp.copy_ci_index && rdp.ci_count > 0 && (rdp.frame_buffers[rdp.ci_count-1].status != ci_zimg))
+ {
+ int idx = (rdp.frame_buffers[rdp.ci_count].status == ci_aux_copy) ? rdp.main_ci_index : rdp.copy_ci_index;
+ FRDP("attempt open tex buffer. status: %s, addr: %08lx\n", CIStatus[rdp.frame_buffers[idx].status], rdp.frame_buffers[idx].addr);
+@@ -3433,7 +3433,7 @@ void DetectFrameBufferUsage ()
+ if (rdp.black_ci_index > 0 && rdp.black_ci_index < rdp.copy_ci_index)
+ rdp.frame_buffers[rdp.black_ci_index].status = ci_main;
+
+- if (rdp.frame_buffers[rdp.ci_count-1].status == ci_unknown)
++ if (rdp.ci_count > 0 && rdp.frame_buffers[rdp.ci_count-1].status == ci_unknown)
+ {
+ if (rdp.ci_count > 1)
+ rdp.frame_buffers[rdp.ci_count-1].status = ci_aux;
+@@ -3441,7 +3441,7 @@ void DetectFrameBufferUsage ()
+ rdp.frame_buffers[rdp.ci_count-1].status = ci_main;
+ }
+
+- if ((rdp.frame_buffers[rdp.ci_count-1].status == ci_aux) &&
++ if (rdp.ci_count > 0 && (rdp.frame_buffers[rdp.ci_count-1].status == ci_aux) &&
+ (rdp.frame_buffers[rdp.main_ci_index].width < 320) &&
+ (rdp.frame_buffers[rdp.ci_count-1].width > rdp.frame_buffers[rdp.main_ci_index].width))
+ {
diff --git a/debian/patches/series b/debian/patches/series
index 9bd37d9..c3d06bd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
revert_forced_linux_flto_jobserver.patch
+fix_negative_framebuffers_indices.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-video-glide64mk2.git
More information about the Pkg-games-commits
mailing list