Skip to content

Commit

Permalink
Fixed loading crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Jun 10, 2016
1 parent ca92424 commit 20e569e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions opl/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Generator::Generator(int sampleRate,
m_regBD = 0;
memset(m_ins, 0, sizeof(unsigned short)*NUM_OF_CHANNELS);
memset(m_pit, 0, sizeof(unsigned char)*NUM_OF_CHANNELS);
memset(m_four_op_category, 0, NUM_OF_CHANNELS);
memset(m_four_op_category, 0, NUM_OF_CHANNELS*2);

unsigned p=0;
for(unsigned b=0; b<18; ++b) m_four_op_category[p++] = 0;
Expand All @@ -85,8 +85,9 @@ Generator::Generator(int sampleRate,

chip.Init(sampleRate);

for(unsigned a=0; a< 18; ++a) chip.WriteReg(0xB0+Channels[a], 0x00);
for(unsigned a=0; a< sizeof(data)/sizeof(*data); a+=2)
for(unsigned a=0; a< 18; ++a)
chip.WriteReg(0xB0+Channels[a], 0x00);
for(unsigned a=0; a<sizeof(data)/sizeof(*data); a+=2)
chip.WriteReg(data[a], data[a+1]);

chip.WriteReg(0x0BD, m_regBD = (DeepTremoloMode*0x80
Expand All @@ -111,7 +112,6 @@ Generator::Generator(int sampleRate,
case 5: nextfour += 23-9-2; break;
}
}

Silence();
}

Expand Down
2 changes: 1 addition & 1 deletion opl/generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public slots:

unsigned char m_regBD;

char m_four_op_category[NUM_OF_CHANNELS];
char m_four_op_category[NUM_OF_CHANNELS*2];
// 1 = quad-master, 2 = quad-slave, 0 = regular
// 3 = percussion BassDrum
// 4 = percussion Snare
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
#define VERSION_H

#define PROGRAM_NAME "FM Bank Editor by Wohlstand"
#define VERSION "1.1.0"
#define VERSION "1.1.1"

#endif // VERSION_H

0 comments on commit 20e569e

Please sign in to comment.