aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index a5a0628..fa82999 100644
--- a/src/main.c
+++ b/src/main.c
@@ -126,11 +126,8 @@ audio_talk(Device *d, u8 b0, u8 w) {
126 // Disable the channel before updating. 126 // Disable the channel before updating.
127 c->data = NULL; 127 c->data = NULL;
128 128
129 // Initialization.
130 c->inc = (44100 << 12) / AUDIO_FREQ;
131 c->pos = 0;
132
133 // Data. 129 // Data.
130 c->pos = 0;
134 c->length = mempeek16(d->dat, 0xa); 131 c->length = mempeek16(d->dat, 0xa);
135 c->length <<= 12; // fixed point. 132 c->length <<= 12; // fixed point.
136 c->data = &d->mem[mempeek16(d->dat, 0xc)]; 133 c->data = &d->mem[mempeek16(d->dat, 0xc)];
@@ -149,8 +146,14 @@ audio_talk(Device *d, u8 b0, u8 w) {
149 146
150 // Pitch 147 // Pitch
151 c->pitch = d->dat[0xf] & 0x7f; 148 c->pitch = d->dat[0xf] & 0x7f;
149
150 // Initialization.
151 c->inc = pitch_table_44100[c->pitch];
152
152 txt_position(0, 0); 153 txt_position(0, 0);
153 txt_printf("note: %d \n", c->pitch); 154 txt_printf("note: %d \n", c->pitch);
155 txt_printf("inc: %ld \n", c->inc);
156 txt_printf("length: %ld \n", c->length >> 12);
154 } 157 }
155} 158}
156 159