Ticket #7921: jumbo-midi.patch
File jumbo-midi.patch, 19.3 KB (added by , 22 years ago) |
---|
-
Makefile
diff -urN scummvm/Makefile scummvm-jumbomidi/Makefile
old new 2 2 3 3 CC = gcc 4 4 CFLAGS = -g -Wno-multichar 5 DEFINES = -DUNIX -DHAVE_READLINE -DUSE_TIMIDITY5 DEFINES = -DUNIX -DHAVE_READLINE 6 6 LDFLAGS := 7 7 INCLUDES:= `sdl-config --cflags` 8 8 CPPFLAGS= $(DEFINES) $(INCLUDES) 9 9 LIBS = `sdl-config --libs` -lreadline -lncurses -lhistory 10 10 ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip 11 11 12 INCS = scumm.h scummsys.h stdafx.h 12 INCS = scumm.h scummsys.h stdafx.h mt32patch.h 13 13 14 14 OBJS = actor.o boxes.o costume.o gfx.o object.o resource.o \ 15 15 saveload.o script.o scummvm.o sound.o string.o \ -
imuse.cpp
diff -urN scummvm/imuse.cpp scummvm-jumbomidi/imuse.cpp
old new 25 25 #include "stdafx.h" 26 26 #include "scumm.h" 27 27 #include "sound.h" 28 #include "mt32patch.h" 29 30 /* includes needed for unix midi support through timidity or internal sequencer */ 31 #ifndef WIN32 28 32 29 #ifdef USE_TIMIDITY30 33 #include <sys/time.h> 31 34 #include <unistd.h> 32 35 #include <sys/types.h> … … 40 43 /* Copy-pasted from Timidity */ 41 44 #define SEQ_MIDIPUTC 5 42 45 43 #endif /* USE_TIMIDITY */46 #endif 44 47 45 48 #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) 46 49 … … 155 158 return 0; 156 159 } 157 160 161 void SoundEngine::midiSetDriver(int devicetype, int seq_device) { 162 _midi_driver.DeviceType = devicetype; 163 _midi_driver.SeqDevice = seq_device; 164 _midi_driver.midiInit(); 165 } 166 167 void SoundEngine::midiSetDriver(int devicetype) { 168 _midi_driver.DeviceType = devicetype; 169 _midi_driver.midiInit(); 170 } 171 172 int MidiDriver::connect_to_timidity(int port) { 173 struct hostent *serverhost; 174 struct sockaddr_in sadd; 175 int s; 176 177 serverhost = gethostbyname("localhost"); 178 if (serverhost == NULL) 179 error("Could not resolve host"); 180 sadd.sin_family = serverhost->h_addrtype; 181 sadd.sin_port = htons(port); 182 memcpy(&(sadd.sin_addr), serverhost->h_addr_list[0], serverhost->h_length); 183 184 s = socket(AF_INET,SOCK_STREAM,0); 185 if (s < 0) 186 error("Could not open socket"); 187 if (connect(s, (struct sockaddr *) &sadd, sizeof(struct sockaddr_in)) < 0) 188 error("Could not connect to server"); 189 190 return s; 191 } 192 193 int MidiDriver::open_sequencer_device() { 194 int device; 195 device = (open("/dev/sequencer", O_RDWR, 0)); 196 if (device < 0) { 197 warning("Cannot open sequencer device - using /dev/null (no music will be heard) "); 198 device = (open(("/dev/null"), O_RDWR, 0)); 199 if (device < 0) 200 error("Cannot open /dev/null to dump midi output"); 201 } 202 return device; 203 } 204 205 void MidiDriver::midiInitTimidity() { 206 int s, s2; 207 int len; 208 int dummy, newport; 209 char buf[256]; 210 211 SeqDevice = 0; 212 213 s = connect_to_timidity(7777); 214 len = read(s, buf, 256); 215 buf[len] = '\0'; 216 printf("%s", buf); 217 218 sprintf(buf, "SETBUF %f %f\n", 0.1, 0.15); 219 write(s, buf, strlen(buf)); 220 len = read(s, buf, 256); 221 buf[len] = '\0'; 222 printf("%s", buf); 223 224 sprintf(buf, "OPEN lsb\n"); 225 write(s, buf, strlen(buf)); 226 len = read(s, buf, 256); 227 buf[len] = '\0'; 228 printf("%s", buf); 229 230 sscanf(buf, "%d %d", &dummy, &newport); 231 printf(" => port = %d\n", newport); 232 233 s2 = connect_to_timidity(newport); 234 _mo = (void *) s2; 235 } 236 237 void MidiDriver::midiInitSeq() { 238 int device; 239 device = open_sequencer_device(); 240 _mo = (void *) device; 241 } 242 243 void MidiDriver::midiInitWindows() { 244 #ifdef WIN32 245 if (midiOutOpen((HMIDIOUT*)&_mo, MIDI_MAPPER, NULL, NULL, 0) != MMSYSERR_NOERROR) 246 error("midiOutOpen failed"); 247 #endif 248 } 249 250 void MidiDriver::midiInitNull() { 251 warning("Using the NULL midi driver, no music will be heard"); 252 } 253 254 void MidiDriver::midiInit() { 255 if (MidiInitialized != true) { 256 switch (DeviceType) { 257 case MIDI_NULL: 258 midiInitNull(); 259 break; 260 case MIDI_WINDOWS: 261 midiInitWindows(); 262 break; 263 case MIDI_TIMIDITY: 264 midiInitTimidity(); 265 break; 266 case MIDI_SEQ: 267 midiInitSeq(); 268 break; 269 default: 270 #ifdef WIN32 271 midiInitWindows(); 272 #else 273 DeviceType = 0; 274 midiInitNull(); 275 #endif 276 break; 277 } 278 MidiInitialized = true; 279 } else { 280 error("Midi driver already initialized"); 281 } 282 } 283 284 void MidiDriver::MidiOutSeq(void *a, int b) { 285 int s = (int) a; 286 unsigned char buf[256]; 287 int position = 0; 288 switch (b & 0xF0) { 289 case 0x80: 290 case 0x90: 291 case 0xA0: 292 case 0xB0: 293 case 0xE0: 294 buf[position++] = SEQ_MIDIPUTC; 295 buf[position++] = b; 296 buf[position++] = SeqDevice; 297 buf[position++] = 0; 298 buf[position++] = SEQ_MIDIPUTC; 299 buf[position++] = (b >> 8) & 0x7F; 300 buf[position++] = SeqDevice; 301 buf[position++] = 0; 302 buf[position++] = SEQ_MIDIPUTC; 303 buf[position++] = (b >> 16) & 0x7F; 304 buf[position++] = SeqDevice; 305 buf[position++] = 0; 306 break; 307 case 0xC0: 308 case 0xD0: 309 buf[position++] = SEQ_MIDIPUTC; 310 buf[position++] = b; 311 buf[position++] = SeqDevice; 312 buf[position++] = 0; 313 buf[position++] = SEQ_MIDIPUTC; 314 buf[position++] = (b >> 8) & 0x7F; 315 buf[position++] = SeqDevice; 316 buf[position++] = 0; 317 break; 318 default: 319 fprintf(stderr, "Unknown : %08x\n", b); 320 break; 321 } 322 write(s, buf, position); 323 } 324 325 void MidiDriver::MidiOutWindows(void *a, int b) { 326 #ifdef WIN32 327 midiOutShortMsg((HMIDIOUT) a, b); 328 #endif 329 } 330 331 void MidiDriver::MidiOut(void *a, int b) { 332 if (MidiInitialized != true) { 333 #ifdef WIN32 334 DeviceType = MIDI_WINDOWS; 335 midiInit(); 336 #else 337 DeviceType = MIDI_NULL; 338 midiInit(); 339 #endif 340 } 341 342 if (MidiInitialized == true) { 343 switch (DeviceType) { 344 case MIDI_NULL: 345 break; 346 case MIDI_WINDOWS: 347 MidiOutWindows(a, b); 348 break; 349 case MIDI_TIMIDITY: 350 case MIDI_SEQ: 351 MidiOutSeq(a, b); 352 break; 353 default: 354 error("Invalid midi device type "); 355 break; 356 } 357 } else { 358 warning("Trying to write midi data without the driver being initialized"); 359 } 360 } 361 158 362 /**********************************************************************/ 159 363 160 364 byte *SoundEngine::findTag(int sound, char *tag, int index) { 161 365 byte *ptr = _base_sounds[sound]; 162 366 int32 size,pos; 163 367 368 _using_mt32_translation = (_s->_gameId != GID_TENTACLE); 369 164 370 if (ptr==NULL) { 165 371 debug(1, "SoundEngine::findTag completely failed finding sound %d", sound); 166 372 return 0; … … 914 1120 init_volume_fader(); 915 1121 init_queue(); 916 1122 init_parts(); 917 midiInit();918 919 1123 _initialized = true; 920 1124 921 1125 return 0; … … 2462 2666 } 2463 2667 } 2464 2668 2465 #if defined(WIN32)2466 2467 void SoundEngine::midiInit() {2468 if (midiOutOpen((HMIDIOUT*)&_mo, MIDI_MAPPER, NULL, NULL, 0) != MMSYSERR_NOERROR)2469 error("midiOutOpen failed");2470 }2471 2472 #define MIDI_OUT(a,b) midiOutShortMsg((HMIDIOUT)(a), (b))2473 2474 #elif defined(USE_TIMIDITY)2475 2476 static int connect_to_timidity(int port)2477 {2478 struct hostent *serverhost;2479 struct sockaddr_in sadd;2480 int s;2481 2482 serverhost = gethostbyname("localhost");2483 if (serverhost == NULL)2484 error("Could not resolve host");2485 sadd.sin_family = serverhost->h_addrtype;2486 sadd.sin_port = htons(port);2487 memcpy(&(sadd.sin_addr), serverhost->h_addr_list[0], serverhost->h_length);2488 2489 s = socket(AF_INET,SOCK_STREAM,0);2490 if (s < 0)2491 error("Could not open socket");2492 if (connect(s, (struct sockaddr *) &sadd, sizeof(struct sockaddr_in)) < 0)2493 error("Could not connect to server");2494 2495 return s;2496 }2497 2498 void SoundEngine::midiInit() {2499 int s, s2;2500 int len;2501 int dummy, newport;2502 char buf[256];2503 2504 s = connect_to_timidity(7777);2505 len = read(s, buf, 256);2506 buf[len] = '\0';2507 printf("%s", buf);2508 2509 sprintf(buf, "SETBUF %f %f\n", 0.1, 0.15);2510 write(s, buf, strlen(buf));2511 len = read(s, buf, 256);2512 buf[len] = '\0';2513 printf("%s", buf);2514 2515 sprintf(buf, "OPEN lsb\n");2516 write(s, buf, strlen(buf));2517 len = read(s, buf, 256);2518 buf[len] = '\0';2519 printf("%s", buf);2520 2521 sscanf(buf, "%d %d", &dummy, &newport);2522 printf(" => port = %d\n", newport);2523 2524 s2 = connect_to_timidity(newport);2525 _mo = (void *) s2;2526 }2527 2528 #define DEVICE_NUM 02529 2530 static inline void MIDI_OUT(void *a, int b) {2531 int s = (int) a;2532 unsigned char buf[256];2533 int position = 0;2534 2535 switch (b & 0xF0) {2536 case 0x80:2537 case 0x90:2538 case 0xA0:2539 case 0xB0:2540 case 0xE0:2541 buf[position++] = SEQ_MIDIPUTC;2542 buf[position++] = b;2543 buf[position++] = DEVICE_NUM;2544 buf[position++] = 0;2545 buf[position++] = SEQ_MIDIPUTC;2546 buf[position++] = (b >> 8) & 0x7F;2547 buf[position++] = DEVICE_NUM;2548 buf[position++] = 0;2549 buf[position++] = SEQ_MIDIPUTC;2550 buf[position++] = (b >> 16) & 0x7F;2551 buf[position++] = DEVICE_NUM;2552 buf[position++] = 0;2553 break;2554 case 0xC0:2555 case 0xD0:2556 buf[position++] = SEQ_MIDIPUTC;2557 buf[position++] = b;2558 buf[position++] = DEVICE_NUM;2559 buf[position++] = 0;2560 buf[position++] = SEQ_MIDIPUTC;2561 buf[position++] = (b >> 8) & 0x7F;2562 buf[position++] = DEVICE_NUM;2563 buf[position++] = 0;2564 break;2565 default:2566 fprintf(stderr, "Unknown : %08x\n", b);2567 break;2568 }2569 write(s, buf, position);2570 }2571 2572 #else2573 #define MIDI_OUT(a,b)2574 void SoundEngine::midiInit() { }2575 #endif2576 2577 2669 void SoundEngine::midiPitchBend(byte chan, int16 pitchbend) { 2578 2670 uint16 tmp; 2579 2671 2580 2672 if (_midi_pitchbend_last[chan] != pitchbend) { 2581 2673 _midi_pitchbend_last[chan] = pitchbend; 2582 2674 tmp = (pitchbend<<2) + 0x2000; 2583 MIDI_OUT(_mo, ((tmp>>7)&0x7F)<<16 | (tmp&0x7F)<<8 | 0xE0 | chan);2675 _midi_driver.MidiOut(_midi_driver._mo, ((tmp>>7)&0x7F)<<16 | (tmp&0x7F)<<8 | 0xE0 | chan); 2584 2676 } 2585 2677 } 2586 2678 2587 2679 void SoundEngine::midiVolume(byte chan, byte volume) { 2588 2680 if (_midi_volume_last[chan] != volume) { 2589 2681 _midi_volume_last[chan] = volume; 2590 MIDI_OUT(_mo, volume<<16 | 7<<8 | 0xB0 | chan);2682 _midi_driver.MidiOut(_midi_driver._mo, volume<<16 | 7<<8 | 0xB0 | chan); 2591 2683 } 2592 2684 } 2593 2685 void SoundEngine::midiPedal(byte chan, bool pedal) { 2594 2686 if (_midi_pedal_last[chan] != pedal) { 2595 2687 _midi_pedal_last[chan] = pedal; 2596 MIDI_OUT(_mo, pedal<<16 | 64<<8 | 0xB0 | chan);2688 _midi_driver.MidiOut(_midi_driver._mo, pedal<<16 | 64<<8 | 0xB0 | chan); 2597 2689 } 2598 2690 } 2599 2691 2600 2692 void SoundEngine::midiModWheel(byte chan, byte modwheel) { 2601 2693 if (_midi_modwheel_last[chan] != modwheel) { 2602 2694 _midi_modwheel_last[chan] = modwheel; 2603 MIDI_OUT(_mo, modwheel<<16 | 1<<8 | 0xB0 | chan);2695 _midi_driver.MidiOut(_midi_driver._mo, modwheel<<16 | 1<<8 | 0xB0 | chan); 2604 2696 } 2605 2697 } 2606 2698 2607 2699 void SoundEngine::midiEffectLevel(byte chan, byte level) { 2608 2700 if (_midi_effectlevel_last[chan] != level) { 2609 2701 _midi_effectlevel_last[chan] = level; 2610 MIDI_OUT(_mo, level<<16 | 91<<8 | 0xB0 | chan);2702 _midi_driver.MidiOut(_midi_driver._mo, level<<16 | 91<<8 | 0xB0 | chan); 2611 2703 } 2612 2704 } 2613 2705 2614 2706 void SoundEngine::midiChorus(byte chan, byte chorus) { 2615 2707 if (_midi_chorus_last[chan] != chorus) { 2616 2708 _midi_chorus_last[chan] = chorus; 2617 MIDI_OUT(_mo, chorus<<16 | 93<<8 | 0xB0 | chan);2709 _midi_driver.MidiOut(_midi_driver._mo, chorus<<16 | 93<<8 | 0xB0 | chan); 2618 2710 } 2619 2711 } 2620 2712 2621 2713 void SoundEngine::midiControl0(byte chan, byte value) { 2622 MIDI_OUT(_mo, value<<16 | 0<<8 | 0xB0 | chan);2714 _midi_driver.MidiOut(_midi_driver._mo, value<<16 | 0<<8 | 0xB0 | chan); 2623 2715 } 2624 2716 2625 2717 void SoundEngine::midiProgram(byte chan, byte program) { 2626 MIDI_OUT(_mo, program<<8 | 0xC0 | chan); 2718 if ((chan + 1) != 10) { 2719 // every percussion item seems to be preceded by a patch change. 2720 // this is pointless and just wasts midi_driver time. 2721 if (_using_mt32_translation) { 2722 program = mt32pgm[program]; 2723 } 2724 _midi_driver.MidiOut(_midi_driver._mo, program<<8 | 0xC0 | chan); 2725 } 2627 2726 } 2628 2727 2629 2728 void SoundEngine::midiPan(byte chan, int8 pan) { 2630 2729 if (_midi_pan_last[chan] != pan) { 2631 2730 _midi_pan_last[chan] = pan; 2632 MIDI_OUT(_mo, ((pan-64)&0x7F)<<16 | 10<<8 | 0xB0 | chan);2731 _midi_driver.MidiOut(_midi_driver._mo, ((pan-64)&0x7F)<<16 | 10<<8 | 0xB0 | chan); 2633 2732 } 2634 2733 } 2635 2734 2636 2735 void SoundEngine::midiNoteOn(byte chan, byte note, byte velocity) { 2637 MIDI_OUT(_mo, velocity<<16 | note<<8 | 0x90 | chan);2736 _midi_driver.MidiOut(_midi_driver._mo, velocity<<16 | note<<8 | 0x90 | chan); 2638 2737 } 2639 2738 2640 2739 void SoundEngine::midiNoteOff(byte chan, byte note) { 2641 MIDI_OUT(_mo, note<<8 | 0x80 | chan);2740 _midi_driver.MidiOut(_midi_driver._mo, note<<8 | 0x80 | chan); 2642 2741 } 2643 2742 2644 2743 void SoundEngine::midiSilence(byte chan) { 2645 MIDI_OUT(_mo, (64<<8)|0xB0|chan);2646 MIDI_OUT(_mo, (123<<8)|0xB0|chan);2744 _midi_driver.MidiOut(_midi_driver._mo, (64<<8)|0xB0|chan); 2745 _midi_driver.MidiOut(_midi_driver._mo, (123<<8)|0xB0|chan); 2647 2746 } -
mt32patch.h
diff -urN scummvm/mt32patch.h scummvm-jumbomidi/mt32patch.h
old new 1 uint mt32pgm[128] = 2 { 3 0, 1, 2, 4, 4, 5, 5, 3, 16, 17, 18, 18, 19, 4 19, 20, 21, 6, 6, 6, 7, 7, 7, 8, 8, 62, 63, 5 62, 63, 38, 39, 38, 39, 88, 89, 52, 113, 97, 96, 91, 6 85, 14, 101, 68, 95, 86, 103, 88, 80, 48, 49, 51, 45, 7 40, 40, 42, 42, 43, 46, 46, 24, 25, 26, 27, 104, 32, 8 33, 34, 39, 36, 37, 38, 35, 79, 73, 72, 72, 74, 75, 9 64, 65, 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 10 63, 60, 60, 58, 61, 61, 11, 11, 12, 88, 9, 14, 13, 11 12, 107, 111, 77, 78, 78, 76, 121, 47, 117, 127, 115, 118, 12 116, 118, 94, 115, 9, 55, 124, 123, 125, 126, 127 13 }; 14 -
readme.txt
diff -urN scummvm/readme.txt scummvm-jumbomidi/readme.txt
old new 34 34 35 35 Running: 36 36 -------- 37 Before you run the engine, you need to put the game's datafiles in the same directory as the scummvm executable. The filenames must be in lowercase (monkey2.000 and monkey2.001). 37 Before you run the engine, you need to put the game's datafiles in the same directory as the 38 scummvm executable. The filenames must be in lowercase (monkey2.000 and monkey2.001). 38 39 39 40 You can use Ctrl 0-9 and Shift 0-9 to load and save states. 40 41 Ctrl-z quits, and Ctrl-f runs in fast mode. … … 42 43 Ctrl-s shows memory consumption. 43 44 44 45 45 Playing sound with Timidity: 46 ---------------------------- 47 Start Timidity with the following command line : 48 49 $ timidity -irv 7777 50 51 Then just start ScummVM and you should have sound. 52 53 54 Good Luck, 55 Ludvig Strigeus 56 57 58 46 Playing music in Unix with a sound card 47 --------------------------------------- 48 *Compile ScummVM as per the instructions above 49 *Start ScummVM as follows: 59 50 51 $ scummvm -sX 52 where X is the device number of your midi output (On most cards, 0 is the external midi device 53 and 1 is the internal midi synth. 60 54 55 Be warned, very few cards apart from Soundblaster Live and Soundblaster AWE cards actually have 56 an internal synth that works in Linux! 61 57 62 58 59 Playing music in Unix with Timidity: 60 ---------------------------- 61 *Compile ScummVM as per the instructions above 62 *Make sure you have timidity set up with a set of sounds (see the timidity docs for this) 63 *Start timidity with the following command line: 63 64 65 $ timidity -irv 7777 66 If you get errors about invalid interfaces, make sure you have compiled timidity with the 67 configure option "--enable-server" 64 68 69 *Start ScummVM and you should have music. 65 70 66 71 72 Good Luck, 73 Ludvig Strigeus -
resource.cpp
diff -urN scummvm/resource.cpp scummvm-jumbomidi/resource.cpp
old new 1 1 2 /* ScummVM - Scumm Interpreter 2 3 * Copyright (C) 2001 Ludvig Strigeus 3 4 * … … 522 523 fileSeek(_fileHandle, -8, SEEK_CUR); 523 524 fileRead(_fileHandle,createResource(type, index, size2+8), size2+8); 524 525 return 1; 526 } else { 527 debug(1,"Scumm::readSoundResource found tag '%c%c%c%c' which it wasn't expecting", 528 tag&0xFF, tag>>8, tag>>16, tag>>24); 525 529 } 526 530 } 527 531 -
scumm.h
diff -urN scummvm/scumm.h scummvm-jumbomidi/scumm.h
old new 357 357 RF_USAGE_MAX = RF_USAGE 358 358 }; 359 359 360 enum { 361 MIDI_NULL = 0, 362 MIDI_WINDOWS = 1, 363 MIDI_TIMIDITY = 2, 364 MIDI_SEQ = 3, 365 }; 366 360 367 #define _maxRooms res.num[rtRoom] 361 368 #define _maxScripts res.num[rtScript] 362 369 #define _maxCostumes res.num[rtCostume] … … 686 693 687 694 int _keyPressed; 688 695 696 int _midi_driver; 697 int _midi_seq_device; 689 698 void *_soundDriver; 690 699 691 700 uint16 *_inventory; -
scummvm.cpp
diff -urN scummvm/scummvm.cpp scummvm-jumbomidi/scummvm.cpp
old new 382 382 s++; 383 383 while (*s) { 384 384 switch(tolower(*s)) { 385 #ifndef WIN32 386 case 't': 387 _midi_driver = MIDI_TIMIDITY; 388 goto NextArg; 389 case 's': 390 _midi_driver = MIDI_SEQ; 391 _midi_seq_device = atoi(s+1); 392 goto NextArg; 393 #endif 385 394 case 'b': 386 395 _bootParam = atoi(s+1); 387 396 goto NextArg; … … 396 405 "\tscummvm [-b<num>] game\n" 397 406 "Flags:\n" 398 407 "\tb<num> - start in that room\n" 408 #ifndef WIN32 409 "\tt - use timidity for music output\n" 410 "\ts<num> - use a midi sequencer device <num> for music output\n" 411 #endif 399 412 "\tf - fullscreen mode\n"); 400 413 exit(1); 401 414 } -
sdl.cpp
diff -urN scummvm/sdl.cpp scummvm-jumbomidi/sdl.cpp
old new 565 565 566 566 scumm._gui = &gui; 567 567 scumm.scummMain(argc, argv); 568 568 569 if (scumm._midi_driver == MIDI_SEQ) 570 sound.midiSetDriver(scumm._midi_driver, scumm._midi_seq_device); 571 else 572 sound.midiSetDriver(scumm._midi_driver); 573 569 574 gui.init(&scumm); 570 575 571 576 last_time = SDL_GetTicks(); -
sound.cpp
diff -urN scummvm/sound.cpp scummvm-jumbomidi/sound.cpp
old new 284 284 * is needed. 285 285 */ 286 286 287 static const uint32 sound_tags[] = {287 static const uint32 gmidi_sound_tags[] = { 288 288 MKID('GMD ') 289 289 }; 290 290 291 static const uint32 roland_sound_tags[] = { 292 MKID('ROL ') 293 }; 294 291 295 void Scumm::setupSound() { 292 296 SoundEngine *se = (SoundEngine*)_soundDriver; 293 297 if (se) 294 298 se->_base_sounds = res.address[rtSound]; 295 299 296 _soundTagTable = (byte*)sound_tags; 300 if (_gameId == GID_TENTACLE) { 301 debug(1,"Found DOTT, so using GMIDI sound tagging"); 302 _soundTagTable = (byte*)gmidi_sound_tags; 303 } else { 304 debug(1,"This isn't DOTT, so using Roland sound tagging"); 305 _soundTagTable = (byte*)roland_sound_tags; 306 } 297 307 _numSoundTags = 1; 298 308 _sfxFile = openSfxFile(); 299 309 } -
sound.h
diff -urN scummvm/sound.h scummvm-jumbomidi/sound.h
old new 30 30 struct HookDatas; 31 31 struct SoundEngine; 32 32 33 struct MidiDriver { 34 bool MidiInitialized; 35 int DeviceType; 36 int SeqDevice; 37 void *_mo; /* midi out */ 38 39 void midiInit(); 40 void midiInitTimidity(); 41 void midiInitSeq(); 42 void midiInitWindows(); 43 void midiInitNull(); 44 45 void MidiOut(void *a, int b); 46 void MidiOutSeq(void *a, int b); 47 void MidiOutWindows(void *a, int b); 48 49 int connect_to_timidity(int port); 50 int open_sequencer_device(); 51 }; 52 33 53 struct Part { 34 54 SoundEngine *_se; 35 55 Part *_next, *_prev; … … 236 256 }; 237 257 238 258 struct SoundEngine { 239 void *_mo; /* midi out */240 241 259 byte **_base_sounds; 242 260 243 261 Scumm *_s; … … 247 265 bool _paused; 248 266 bool _active_volume_faders; 249 267 bool _initialized; 268 bool _using_mt32_translation; 269 250 270 byte _volume_fader_counter; 251 271 252 272 uint _queue_end, _queue_pos, _queue_sound; … … 268 288 uint16 _channel_volume_eff[8]; /* NoSave */ 269 289 uint16 _volchan_table[8]; 270 290 291 MidiDriver _midi_driver; 271 292 Player _players[8]; 272 293 SustainingNotes _sustaining_notes[24]; 273 294 VolumeFader _volume_fader[8]; … … 341 362 void midiNoteOn(byte chan, byte note, byte velocity); 342 363 void midiNoteOff(byte chan, byte note); 343 364 void midiSilence(byte chan); 344 void midiInit();345 365 366 void midiSetDriver(int devicetype); 367 void midiSetDriver(int devicetype, int seq_device); 368 346 369 void adjust_priorities(); 347 370 348 371 void fix_parts_after_load();