|
|
| version 1.1, 2003/10/16 17:58:05 | version 1.3, 2003/12/04 06:41:23 |
|---|---|
| Line 2 | Line 2 |
| #include <math.h> | #include <math.h> |
| #include "wavefile.h" | #include "wavefile.h" |
| #include "dosio.h" | #include "dosio.h" |
| #include "bios.h" | |
| #include "sound.h" | #include "sound.h" |
| #include "rhythm.h" | #include "rhythm.h" |
| Line 22 static const char *rhythmfile[RHYTHM_MAX | Line 23 static const char *rhythmfile[RHYTHM_MAX |
| static BOOL pcmload(RHYTHMPCM *pcm, const char *fname, UINT rate) { | static BOOL pcmload(RHYTHMPCM *pcm, const char *fname, UINT rate) { |
| char path[MAX_PATH]; | |
| FILEH fh; | FILEH fh; |
| RIFF_HEADER riff; | RIFF_HEADER riff; |
| BOOL head; | BOOL head; |
| Line 35 static BOOL pcmload(RHYTHMPCM *pcm, cons | Line 37 static BOOL pcmload(RHYTHMPCM *pcm, cons |
| UINT pos; | UINT pos; |
| BYTE work[256]; | BYTE work[256]; |
| fh = file_open_c(fname); | bios_getpath(path, fname, sizeof(path)); |
| fh = file_open_rb(path); | |
| if (fh == FILEH_INVALID) { | if (fh == FILEH_INVALID) { |
| goto pld_err1; | goto pld_err1; |
| } | } |
| Line 79 static BOOL pcmload(RHYTHMPCM *pcm, cons | Line 82 static BOOL pcmload(RHYTHMPCM *pcm, cons |
| goto pld_err2; | goto pld_err2; |
| } | } |
| step = 44100 / rate; | step = 44100 / rate; |
| if (step == 0) { | |
| goto pld_err2; | |
| } | |
| samples = size / 2 / step; | samples = size / 2 / step; |
| if (samples == 0) { | if (samples == 0) { |
| goto pld_err2; | goto pld_err2; |