Browse Source

Use OPCODE for the RETURN and CONTINUE opcodes.

master
Reece H. Dunn 8 years ago
parent
commit
f2bb482782
3 changed files with 10 additions and 10 deletions
  1. 3
    3
      src/libespeak-ng/compiledata.c
  2. 4
    4
      src/libespeak-ng/synthdata.c
  3. 3
    3
      src/libespeak-ng/synthesize.h

+ 3
- 3
src/libespeak-ng/compiledata.c View File

CompileToneSpec(); CompileToneSpec();
break; break;
case kCONTINUE: case kCONTINUE:
*prog_out++ = i_CONTINUE;
*prog_out++ = OPCODE_CONTINUE;
DecThenCount(); DecThenCount();
break; break;
case kRETURN: case kRETURN:
*prog_out++ = i_RETURN;
*prog_out++ = OPCODE_RETURN;
DecThenCount(); DecThenCount();
break; break;
case kINCLUDE: case kINCLUDE:
if (if_level > 0) if (if_level > 0)
error("Missing ENDIF"); error("Missing ENDIF");
if ((prog_out > prog_buf) && (if_stack[0].returned == 0)) if ((prog_out > prog_buf) && (if_stack[0].returned == 0))
*prog_out++ = i_RETURN;
*prog_out++ = OPCODE_RETURN;
break; break;
} }
break; break;

+ 4
- 4
src/libespeak-ng/synthdata.c View File

// This instruction is followed by addWav(), 2 more words // This instruction is followed by addWav(), 2 more words
return 4; return 4;
} }
if (instn2 == i_CONTINUE)
if (instn2 == OPCODE_CONTINUE)
return 3; return 3;
return 2; return 2;
} }
// instructions with no operand // instructions with no operand
switch (data) switch (data)
{ {
case i_RETURN:
case OPCODE_RETURN:
end_flag = 1; end_flag = 1;
break; break;
case i_CONTINUE:
case OPCODE_CONTINUE:
break; break;
default: default:
InvalidInstn(ph, instn); InvalidInstn(ph, instn);
param_sc = phdata->sound_param[instn2] = (instn >> 4) & 0xff; param_sc = phdata->sound_param[instn2] = (instn >> 4) & 0xff;
prog++; prog++;


if (prog[1] != i_CONTINUE) {
if (prog[1] != OPCODE_CONTINUE) {
if (instn2 < 2) { if (instn2 < 2) {
// FMT() and WAV() imply Return // FMT() and WAV() imply Return
end_flag = 1; end_flag = 1;

+ 3
- 3
src/libespeak-ng/synthesize.h View File



// instructions // instructions


#define i_RETURN 0x0001
#define i_CONTINUE 0x0002
#define i_NOT 0x0003
#define OPCODE_RETURN 0x0001
#define OPCODE_CONTINUE 0x0002


// Group 0 instrcutions with 8 bit operand. These values go into bits 8-15 of the instruction // Group 0 instrcutions with 8 bit operand. These values go into bits 8-15 of the instruction
#define i_CHANGE_PHONEME 0x01 #define i_CHANGE_PHONEME 0x01
// conditions and jumps // conditions and jumps
#define i_CONDITION 0x2000 #define i_CONDITION 0x2000
#define i_OR 0x1000 // added to i_CONDITION #define i_OR 0x1000 // added to i_CONDITION
#define i_NOT 0x0003


#define i_JUMP 0x6000 #define i_JUMP 0x6000
#define i_JUMP_FALSE 0x6800 #define i_JUMP_FALSE 0x6800

Loading…
Cancel
Save