~ubuntu-branches/ubuntu/wily/mupen64plus/wily

« back to all changes in this revision

Viewing changes to debian/patches/load_vistatus.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann
  • Date: 2011-07-24 14:23:26 UTC
  • mfrom: (10.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110724142326-x9z5qu8j9jecrmod
Tags: 1.99.4+2
* Upload to unstable
* Remove overrides for lintian warning about change to native package
* Update Vcs-* fields to new anonscm.debian.org URLs in debian/control
* Fix spelling of "Flexible" in debian/control (Closes: #633693)
* Mark all targets in debian/rules as phony
* Add some information about the mupen64plus 2.0 vision in debian/NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Set video width and status during savestate load
2
 
 Not setting status and width for video plugins could result in corrupted output
3
 
 in some programs.
4
 
Bug: http://code.google.com/p/mupen64plus/issues/detail?id=169
5
 
Author: Sven Eckelmann <sven@narfation.org>
6
 
 
7
 
---
8
 
diff --git a/main/savestates.c b/main/savestates.c
9
 
index 016b6ca62493e774931cca6f57e1e5b29e1c2a77..7601288d70b42c3346bef6d1150e20d0acb698d3 100644
10
 
--- a/main/savestates.c
11
 
+++ b/main/savestates.c
12
 
@@ -280,6 +280,8 @@ void savestates_load()
13
 
     gzread(f, &rsp_register, sizeof(RSP_register));
14
 
     gzread(f, &si_register, sizeof(SI_register));
15
 
     gzread(f, &vi_register, sizeof(VI_register));
16
 
+    update_vi_status(vi_register.vi_status);
17
 
+    update_vi_width(vi_register.vi_width);
18
 
     gzread(f, &ri_register, sizeof(RI_register));
19
 
     gzread(f, &ai_register, sizeof(AI_register));
20
 
     update_ai_dacrate(ai_register.ai_dacrate);
21
 
diff --git a/memory/memory.c b/memory/memory.c
22
 
index 7d090cabebd687e39db5fedc167f8992bbbcdbdf..a843a49d370d12107e5624f247180a808666f69a 100644
23
 
--- a/memory/memory.c
24
 
+++ b/memory/memory.c
25
 
@@ -2495,16 +2495,14 @@ void write_vi()
26
 
       case 0x0:
27
 
     if (vi_register.vi_status != word)
28
 
       {
29
 
-         vi_register.vi_status = word;
30
 
-         viStatusChanged();
31
 
+         update_vi_status(word);
32
 
       }
33
 
     return;
34
 
     break;
35
 
       case 0x8:
36
 
     if (vi_register.vi_width != word)
37
 
       {
38
 
-         vi_register.vi_width = word;
39
 
-         viWidthChanged();
40
 
+         update_vi_width(word);
41
 
       }
42
 
     return;
43
 
     break;
44
 
@@ -2517,6 +2515,18 @@ void write_vi()
45
 
    *readvi[*address_low] = word;
46
 
 }
47
 
 
48
 
+void update_vi_status(unsigned int word)
49
 
+{
50
 
+    vi_register.vi_status = word;
51
 
+    viStatusChanged();
52
 
+}
53
 
+
54
 
+void update_vi_width(unsigned int word)
55
 
+{
56
 
+    vi_register.vi_width = word;
57
 
+    viWidthChanged();
58
 
+}
59
 
+
60
 
 void write_vib()
61
 
 {
62
 
    int temp;
63
 
@@ -2531,8 +2541,7 @@ void write_vib()
64
 
       + ((*address_low&3)^S8) ) = byte;
65
 
     if (vi_register.vi_status != temp)
66
 
       {
67
 
-         vi_register.vi_status = temp;
68
 
-         viStatusChanged();
69
 
+         update_vi_status(temp);
70
 
       }
71
 
     return;
72
 
     break;
73
 
@@ -2545,8 +2554,7 @@ void write_vib()
74
 
       + ((*address_low&3)^S8) ) = byte;
75
 
     if (vi_register.vi_width != temp)
76
 
       {
77
 
-         vi_register.vi_width = temp;
78
 
-         viWidthChanged();
79
 
+         update_vi_width(temp);
80
 
       }
81
 
     return;
82
 
     break;
83
 
@@ -2575,8 +2583,7 @@ void write_vih()
84
 
                 + ((*address_low&3)^S16) )) = hword;
85
 
     if (vi_register.vi_status != temp)
86
 
       {
87
 
-         vi_register.vi_status = temp;
88
 
-         viStatusChanged();
89
 
+         update_vi_status(temp);
90
 
       }
91
 
     return;
92
 
     break;
93
 
@@ -2587,8 +2594,7 @@ void write_vih()
94
 
                 + ((*address_low&3)^S16) )) = hword;
95
 
     if (vi_register.vi_width != temp)
96
 
       {
97
 
-         vi_register.vi_width = temp;
98
 
-         viWidthChanged();
99
 
+         update_vi_width(temp);
100
 
       }
101
 
     return;
102
 
     break;
103
 
@@ -2610,8 +2616,7 @@ void write_vid()
104
 
       case 0x0:
105
 
     if (vi_register.vi_status != dword >> 32)
106
 
       {
107
 
-         vi_register.vi_status = dword >> 32;
108
 
-         viStatusChanged();
109
 
+         update_vi_status(dword >> 32);
110
 
       }
111
 
     vi_register.vi_origin = dword & 0xFFFFFFFF;
112
 
     return;
113
 
@@ -2619,8 +2624,7 @@ void write_vid()
114
 
       case 0x8:
115
 
     if (vi_register.vi_width != dword >> 32)
116
 
       {
117
 
-         vi_register.vi_width = dword >> 32;
118
 
-         viWidthChanged();
119
 
+         update_vi_width(dword >> 32);
120
 
       }
121
 
     vi_register.vi_v_intr = dword & 0xFFFFFFFF;
122
 
     return;
123
 
diff --git a/memory/memory.h b/memory/memory.h
124
 
index e3f5d3359466f90b375d7d662d0d0bb46e2a6d3c..ab0eeb2ba05e5cde953d4e5419cfa688e1815211 100644
125
 
--- a/memory/memory.h
126
 
+++ b/memory/memory.h
127
 
@@ -423,6 +423,8 @@ void write_pifd();
128
 
 void update_SP();
129
 
 void update_DPC();
130
 
 void update_ai_dacrate(unsigned int word);
131
 
+void update_vi_status(unsigned int word);
132
 
+void update_vi_width(unsigned int word);
133
 
 
134
 
 #endif
135