convert chars to signed/unsigned
This commit is contained in:
parent
783d56c72a
commit
8c014802c9
|
@ -35,7 +35,7 @@ set(ENGINE_SOURCES src/log.cpp src/engine/safeReader.cpp src/engine/engine.cpp)
|
|||
add_executable(divorce ${ENGINE_SOURCES} ${AUDIO_SOURCES}
|
||||
src/main.cpp)
|
||||
|
||||
target_link_libraries(divorce ${HAVE_SDL2} z GL GLEW)
|
||||
target_link_libraries(divorce ${HAVE_SDL2} z)
|
||||
|
||||
if (HAVE_JACK)
|
||||
target_link_libraries(divorce ${HAVE_JACK})
|
||||
|
|
|
@ -192,7 +192,7 @@ bool DivEngine::load(void* f, size_t slen) {
|
|||
}
|
||||
ds.version=reader.readC();
|
||||
logI("module version %d (0x%.2x)\n",ds.version,ds.version);
|
||||
char sys=0;
|
||||
unsigned char sys=0;
|
||||
if (ds.version<0x09) {
|
||||
// V E R S I O N -> 3 <-
|
||||
// AWESOME
|
||||
|
|
|
@ -6,10 +6,10 @@ enum DivInstrumentType {
|
|||
};
|
||||
|
||||
struct DivInstrumentFM {
|
||||
char alg, fb, fms, ams, ops;
|
||||
unsigned char alg, fb, fms, ams, ops;
|
||||
struct {
|
||||
char am, ar, dr, mult, rr, sl, tl, dt2, rs, dt, d2r, ssgEnv;
|
||||
char dam, dvb, egt, ksl, sus, vib, ws, ksr; // YMU759
|
||||
unsigned char am, ar, dr, mult, rr, sl, tl, dt2, rs, dt, d2r, ssgEnv;
|
||||
unsigned char dam, dvb, egt, ksl, sus, vib, ws, ksr; // YMU759
|
||||
} op[4];
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
struct DivOrders {
|
||||
char ord[32][128];
|
||||
unsigned char ord[32][128];
|
||||
};
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
struct DivPattern {
|
||||
char data[256][16];
|
||||
unsigned char data[256][16];
|
||||
};
|
||||
|
||||
struct DivChannelData {
|
||||
char effectRows;
|
||||
unsigned char effectRows;
|
||||
// data goes as follows: data[ROW][TYPE]
|
||||
// TYPE is:
|
||||
// 0: note
|
||||
|
@ -12,4 +12,4 @@ struct DivChannelData {
|
|||
// 3: volume
|
||||
// 4-5+: effect/effect value
|
||||
std::vector<DivPattern*> data;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ int SafeReader::read(void* where, size_t count) {
|
|||
return count;
|
||||
}
|
||||
|
||||
char SafeReader::readC() {
|
||||
signed char SafeReader::readC() {
|
||||
#ifdef READ_DEBUG
|
||||
logD("SR: reading char %x:\n",curSeek);
|
||||
#endif
|
||||
|
@ -126,7 +126,7 @@ String SafeReader::readString(size_t stlen) {
|
|||
#endif
|
||||
size_t curPos=0;
|
||||
while (curPos<stlen) {
|
||||
char c=readC();
|
||||
unsigned char c=readC();
|
||||
if (c!=0) ret.push_back(c);
|
||||
curPos++;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ String SafeReader::readString(size_t stlen) {
|
|||
|
||||
String SafeReader::readString() {
|
||||
String ret;
|
||||
char c;
|
||||
unsigned char c;
|
||||
while ((c=readC())!=0) {
|
||||
ret.push_back(c);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class SafeReader {
|
|||
int read(void* where, size_t count);
|
||||
|
||||
// these functions may throw EndOfFileException.
|
||||
char readC();
|
||||
signed char readC();
|
||||
short readS();
|
||||
short readS_BE();
|
||||
int readI();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
struct DivSample {
|
||||
String name;
|
||||
int length, rate;
|
||||
char vol, pitch, depth;
|
||||
signed char vol, pitch;
|
||||
unsigned char depth;
|
||||
short* data;
|
||||
char* data8;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue