Ticket #8146: midisfx.patch

File midisfx.patch, 3.4 KB (added by Kirben, 21 years ago)
Line 
1Index: simon/items.cpp
2===================================================================
3RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
4retrieving revision 1.36
5diff -r1.36 items.cpp
61053c1053
7< getVarOrWord();
8---
9> _midi_sfx = getVarOrWord();
101550a1551,1553
11> if (_game == GAME_SIMON1DOS)
12> playSting(a);
13> else
14Index: simon/midi.cpp
15===================================================================
16RCS file: /cvsroot/scummvm/scummvm/simon/midi.cpp,v
17retrieving revision 1.17
18diff -r1.17 midi.cpp
1964c64,73
20< void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music)
21---
22> void MidiPlayer::read_all_songs_old(File *in, uint music, uint16 size)
23> {
24> _currentSong = _songs;
25>
26> _lastDelay = 0;
27>
28> read_one_song(in, &_songs[0], music, size);
29> }
30>
31> void MidiPlayer::read_mthd(File *in, Song *s, bool old, uint music, uint16 size)
32100a110,112
33> if (size)
34> t->data_size = size - 8;
35> else
36126c138
37< void MidiPlayer::read_one_song(File *in, Song *s, uint music)
38---
39> void MidiPlayer::read_one_song(File *in, Song *s, uint music, uint16 size)
40139c151
41< read_mthd(in, s, false, music);
42---
43> read_mthd(in, s, false, music, size);
44143c155
45< read_mthd(in, s, true, music);
46---
47> read_mthd(in, s, true, music, size);
48283a296
49> #if 0
50300a314
51> #endif
52Index: simon/midi.h
53===================================================================
54RCS file: /cvsroot/scummvm/scummvm/simon/midi.h,v
55retrieving revision 1.7
56diff -r1.7 midi.h
5735a36
58> void read_all_songs_old (File *in, uint music, uint16 size);
5979c80
60< void read_mthd(File *in, Song *s, bool old, uint music);
61---
62> void read_mthd(File *in, Song *s, bool old, uint music, uint16 size);
6381c82
64< void read_one_song(File *in, Song *s, uint music);
65---
66> void read_one_song(File *in, Song *s, uint music, uint16 size = 0);
67Index: simon/simon.cpp
68===================================================================
69RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
70retrieving revision 1.118
71diff -r1.118 simon.cpp
72809c809
73< if (_game == GAME_SIMON1WIN )
74---
75> if (_game == GAME_SIMON1WIN)
76828a829,864
77> }
78>
79> void SimonState::readSting(uint a)
80> {
81> char filename[11];
82> uint16 size;
83>
84> _mus_file = new File();
85>
86> sprintf(filename, "stings%i.mus", a);
87>
88> _mus_file->open(filename, _gameDataPath);
89>
90> if (!_mus_file->isOpen())
91> return;
92>
93> size = _mus_file->readUint16LE();
94>
95> _mus_offsets = (uint16 *)malloc(size);
96>
97> _mus_file->seek(0, SEEK_SET);
98>
99> if (_mus_file->read(_mus_offsets, size) != size)
100> error("Cannot read offsets");
101> }
102>
103> void SimonState::playSting(uint a)
104> {
105> readSting(_midi_sfx);
106>
107> midi.shutdown();
108> _mus_file->seek(_mus_offsets[a], SEEK_SET);
109> midi.read_all_songs_old(_mus_file, a, _mus_offsets[a+1] - _mus_offsets[a]);
110>
111> midi.initialize();
112> midi.play();
113Index: simon/simon.h
114===================================================================
115RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
116retrieving revision 1.39
117diff -r1.39 simon.h
118102a103,108
119> File *_mus_file;
120> uint16 *_mus_offsets;
121>
122> void SimonState::readSting(uint a);
123> void SimonState::playSting(uint a);
124>
125248a255
126> uint _midi_sfx;
127Index: simon/vga.cpp
128===================================================================
129RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
130retrieving revision 1.24
131diff -r1.24 vga.cpp
1321603a1604,1606
133> if (_game == GAME_SIMON1DOS)
134> playSting(a);
135> else
136