comparison minijss/jloadxm.c @ 2471:e0f9200b94ad

Use jsetMaxPatterns for "empty" pattern instead of npatterns.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Apr 2020 03:13:14 +0300
parents b47109fce375
children 609c6bcf0dac
comparison
equal deleted inserted replaced
2470:abc0b42cfbc5 2471:e0f9200b94ad
408 dmfseek(inFile, remainder, SEEK_CUR); 408 dmfseek(inFile, remainder, SEEK_CUR);
409 } 409 }
410 } 410 }
411 411
412 // Allocate the empty pattern 412 // Allocate the empty pattern
413 module->patterns[module->npatterns] = jssAllocatePattern(64, module->nchannels); 413 module->patterns[jsetMaxPatterns] = jssAllocatePattern(64, module->nchannels);
414 414
415 /* Convert song orders list by replacing nonexisting 415 /* Convert song orders list by replacing nonexisting
416 * pattern numbers with pattern number jsetMaxPatterns. 416 * pattern numbers with pattern number jsetMaxPatterns.
417 */ 417 */
418 for (index = 0; index < module->norders; index++) 418 for (index = 0; index < module->norders; index++)
419 { 419 {
420 int tmp = xmH->orderList[index]; 420 int tmp = xmH->orderList[index];
421 if (tmp >= module->npatterns || 421 if (tmp >= module->npatterns ||
422 module->patterns[tmp] == NULL) 422 module->patterns[tmp] == NULL)
423 tmp = module->npatterns; 423 tmp = jsetMaxPatterns;
424 424
425 module->orderList[index] = tmp; 425 module->orderList[index] = tmp;
426 } 426 }
427 427
428 return DMERR_OK; 428 return DMERR_OK;