From ab9e1fce3da608b29662f6eb4bbbe7e6811340b5 Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 11 May 2014 18:07:00 +0000 Subject: [PATCH] Added intonation in Currah microspeech --- src/computer.c | 18 ++++++++++++------ src/computer.h | 2 -- src/currah_microspeech.c | 7 +------ src/currah_microspeech.h | 7 ++----- src/spk_ay.c | 10 +++++----- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/computer.c b/src/computer.c index d0254c2..6a1d883 100644 --- a/src/computer.c +++ b/src/computer.c @@ -1928,15 +1928,21 @@ void Z80free_Wr (register word Addr, register byte Value) { // Currah microspeech ouput if((ordenador.currah_active)&&(ordenador.currah_paged)) { + if (Addr==0x3000) { + //printf("write to 3000h\n"); + ordenador.intonation_allophone = 0; + } + + if (Addr==0x3001) { + //printf("write to 3001h\n"); + ordenador.intonation_allophone = 1; + } - //if (Addr==0x3000) {printf("write to 3000h\n");ordenador.intonation_allophone = 0;} - //if (Addr==0x3001) {printf("write to 3001h\n");ordenador.intonation_allophone = 1;} - - if ((Addr==0x1000)&&(!ordenador.currah_status)) //do not accept a new allophone if the previous is not finished + if ((Addr==0x1000)&&(!ordenador.currah_status)) //do not accept a new allophone if the previous is not finished { - //if (Value) printf("Currah output=%0xh\n",Value); + //if (Value) printf("Currah output=%0xh\n",Value); ordenador.current_allophone = (Value&0x3F); - //ordenador.intonation_allophone = (Value&0x40); //to be implemented + ordenador.intonation_allophone = (Value&0x40); //to be implemented ordenador.currah_status = 1; //Currah busy ordenador.allophone_sound_cuantity = 0; return; diff --git a/src/computer.h b/src/computer.h index aae1a8f..c2add64 100644 --- a/src/computer.h +++ b/src/computer.h @@ -229,8 +229,6 @@ struct computer { unsigned char currah_status; // 0: free; 1: busy unsigned char current_allophone; // allophone to be played unsigned char intonation_allophone; - //int currah_env_counter; - //int max_envelop; int allophone_sound_cuantity; //pointer to allophone sample to be played // OSD global variables diff --git a/src/currah_microspeech.c b/src/currah_microspeech.c index 3865fc3..5fa895d 100644 --- a/src/currah_microspeech.c +++ b/src/currah_microspeech.c @@ -41,13 +41,10 @@ void currah_microspeech_init() { ordenador.current_allophone = 0; ordenador.allophone_sound_cuantity = 0; ordenador.intonation_allophone = 0; - //ordenador.currah_env_counter = 0; - //ordenador.max_envelop = MAX_ENVELOP; for (i=0; i= allophone_lenght[ordenador.current_allophone]) //allophone completed + if (ordenador.allophone_sound_cuantity/INTONATION_INCREASE >= allophone_lenght[ordenador.current_allophone]) //allophone completed { - ordenador.allophone_sound_cuantity = allophone_lenght[ordenador.current_allophone]*7/8; //repeat the last part + ordenador.allophone_sound_cuantity = allophone_lenght[ordenador.current_allophone]*7/8*INTONATION_INCREASE; //repeat the last part ordenador.currah_status = 0; //Ready for a new allophone }