1
0
Fork 0

Merge branch 'svn/trunk' r4284

This commit is contained in:
Patryk Obara 2019-11-12 16:13:13 +01:00
commit 43170ff1c2
2 changed files with 7 additions and 6 deletions

View file

@ -267,7 +267,7 @@ bool CDROM_Interface_Image::SetDevice(char* path, int forceCD)
// print error message on dosbox console
char buf[MAX_LINE_LENGTH];
snprintf(buf, MAX_LINE_LENGTH, "Could not load image file: %s\n", path);
snprintf(buf, MAX_LINE_LENGTH, "Could not load image file: %s\r\n", path);
Bit16u size = (Bit16u)strlen(buf);
DOS_WriteFile(STDOUT, (Bit8u*)buf, &size);
return false;

View file

@ -1086,14 +1086,14 @@ void Chip::WriteBD( Bit8u val ) {
#define REGOP( _FUNC_ ) \
index = ( ( reg >> 3) & 0x20 ) | ( reg & 0x1f ); \
if ( OpOffsetTable[ index ] ) { \
Operator* regOp = (Operator*)( ((char *)this ) + OpOffsetTable[ index ] ); \
Operator* regOp = (Operator*)( ((char *)this ) + OpOffsetTable[ index ]-1 ); \
regOp->_FUNC_( this, val ); \
}
#define REGCHAN( _FUNC_ ) \
index = ( ( reg >> 4) & 0x10 ) | ( reg & 0xf ); \
if ( ChanOffsetTable[ index ] ) { \
Channel* regChan = (Channel*)( ((char *)this ) + ChanOffsetTable[ index ] ); \
Channel* regChan = (Channel*)( ((char *)this ) + ChanOffsetTable[ index ]-1 ); \
regChan->_FUNC_( this, val ); \
}
@ -1444,7 +1444,7 @@ void InitTables( void ) {
//Add back the bits for highest ones
if ( i >= 16 )
index += 9;
ChanOffsetTable[i] = (Bit16u)(index*sizeof(DBOPL::Channel));
ChanOffsetTable[i] = 1+(Bit16u)(index*sizeof(DBOPL::Channel));
}
//Same for operators
for ( Bitu i = 0; i < 64; i++ ) {
@ -1460,11 +1460,12 @@ void InitTables( void ) {
OpOffsetTable[i] = ChanOffsetTable[chNum]+(Bit16u)(opNum*sizeof(DBOPL::Operator));
}
#if 0
DBOPL::Chip* chip = 0;
//Stupid checks if table's are correct
for ( Bitu i = 0; i < 18; i++ ) {
Bit32u find = (Bit16u)( &(chip->chan[ i ]) );
for ( Bitu c = 0; c < 32; c++ ) {
if ( ChanOffsetTable[c] == find ) {
if ( ChanOffsetTable[c] == find+1 ) {
find = 0;
break;
}
@ -1476,7 +1477,7 @@ void InitTables( void ) {
for ( Bitu i = 0; i < 36; i++ ) {
Bit32u find = (Bit16u)( &(chip->chan[ i / 2 ].op[i % 2]) );
for ( Bitu c = 0; c < 64; c++ ) {
if ( OpOffsetTable[c] == find ) {
if ( OpOffsetTable[c] == find+1 ) {
find = 0;
break;
}