forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zsnes-1.51-buffer.patch
85 lines (78 loc) · 3.08 KB
/
zsnes-1.51-buffer.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
--- zsnes_1_51/src/initc.c.fortify
+++ zsnes_1_51/src/initc.c
@@ -1464,8 +1464,8 @@
clearmem2();
}
-extern unsigned char BRRBuffer[32];
-extern unsigned char echoon0;
+extern unsigned char BRRBuffer[];
+extern unsigned char echoon0[];
extern unsigned int PHdspsave;
extern unsigned int PHdspsave2;
unsigned char echobuf[90000];
@@ -1479,7 +1479,7 @@
memset(vidmemch4, 0, 4096);
memset(vidmemch8, 0, 4096);
memset(BRRBuffer, 0, PHdspsave);
- memset(&echoon0, 0, PHdspsave2);
+ memset(echoon0, 0, PHdspsave2);
memset(echobuf, 0, 90000);
memset(spcBuffera, 0, 65536*4+4096);
memset(DSPMem, 0, 256);
@@ -1822,7 +1822,7 @@
extern unsigned int nmiprevaddrl, nmiprevaddrh, nmirept, nmiprevline, nmistatus;
extern unsigned char spcnumread, yesoutofmemory;
-extern unsigned char NextLineCache, sramsavedis, sndrot, regsbackup[3019];
+extern unsigned char NextLineCache, sramsavedis, sndrot[], regsbackup[3019];
extern unsigned int Voice0Freq, Voice1Freq, Voice2Freq, Voice3Freq;
extern unsigned int Voice4Freq, Voice5Freq, Voice6Freq, Voice7Freq;
extern unsigned int dspPAdj;
@@ -2621,7 +2621,7 @@
}
sramsavedis = 0;
- memcpy(&sndrot, regsbackup, 3019);
+ memcpy(sndrot, regsbackup, 3019);
if (yesoutofmemory) { asm_call(outofmemfix); }
asm_call(GUIDoReset);
--- zsnes_1_51/src/zstate.c.fortify
+++ zsnes_1_51/src/zstate.c
@@ -99,15 +99,15 @@
copy_func(buffer, &cycpbl, 4);
copy_func(buffer, &cycpblt, 4);
//SNES PPU Register status
- copy_func(buffer, &sndrot, 3019);
+ copy_func(buffer, sndrot, 3019);
}
static void copy_spc_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
{
//SPC stuff, DSP stuff
copy_func(buffer, SPCRAM, PHspcsave);
- copy_func(buffer, &BRRBuffer, PHdspsave);
- copy_func(buffer, &DSPMem, sizeof(DSPMem));
+ copy_func(buffer, BRRBuffer, PHdspsave);
+ copy_func(buffer, DSPMem, sizeof(DSPMem));
}
static void copy_extra_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
@@ -156,7 +156,7 @@
/*
if (buffer) //Rewind stuff
{
- copy_func(&buffer, &echoon0, PHdspsave2);
+ copy_func(&buffer, echoon0, PHdspsave2);
}
*/
}
--- zsnes_1_51/src/gblvars.h.fortify
+++ zsnes_1_51/src/gblvars.h
@@ -33,9 +33,9 @@
extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh;
extern unsigned int tempesi, tempedi, tempedx, tempebp;
extern unsigned int SPCMultA, PHnum2writespc7110reg, PHdspsave2;
-extern unsigned char sndrot, SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
-extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[32], *romdata;
-extern unsigned char curcyc, echoon0, spcnumread, NextLineCache, HIRQNextExe;
+extern unsigned char sndrot[], SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
+extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[], *romdata;
+extern unsigned char curcyc, echoon0[], spcnumread, NextLineCache, HIRQNextExe;
extern unsigned char vidmemch4[4096], vidmemch8[4096], vidmemch2[4096];
extern bool C4Enable, SFXEnable, SA1Enable, SPC7110Enable, SETAEnable, DSP4Enable, spcon;