Index: TODO ================================================================== --- TODO +++ TODO @@ -1,11 +1,7 @@ * Sound effects - * Wave sounds - * Standard sounds - * User sounds - * Compressed wave sounds (?) - * MML sounds + * Compressed wave sounds (?) * Numeric sounds (?) * Game engine features * Multiple connected objects moving as a unit * String data (partially implemented) * A ,PopUp command to use a popup with arguments starting from a mark Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -231,10 +231,13 @@ Switch to the game play. '^Q' Quit. +'^Y' + Sound test. (Does nothing if sound is not configured.) + 'go' Go to the specified level. If the level number is negative, then it is a level order number, otherwise it is a level ID number. Index: class.c ================================================================== --- class.c +++ class.c @@ -526,14 +526,13 @@ if(fl) ParseError("Invalid use of , and = in token\n"); tokent=TF_NAME; tokenv=look_class_name()+0x4000; break; case '!': - // Just ignore sounds for now if(fl) ParseError("Invalid use of , and = in token\n"); tokent=TF_NAME; - tokenv=0x0400; + tokenv=find_user_sound(tokenstr); break; case '%': if(fl&TF_COMMA) ParseError("Invalid use of , in token\n"); tokent=TF_NAME|TF_ABNORMAL|fl; tokenv=OP_LOCAL; @@ -1075,12 +1074,12 @@ } else if(Tokenf(TF_NAME)) { switch(tokenv) { case 0x0000 ... 0x00FF: return NVALUE(tokenv); case 0x0100 ... 0x01FF: return NVALUE(tokenv-0x0200); case 0x0200 ... 0x02FF: return MVALUE(tokenv&255); - case 0x0300 ... 0x03FF: return UVALUE(0,TY_SOUND); - case 0x0400 ... 0x04FF: return UVALUE(0,TY_USOUND); + case 0x0300 ... 0x03FF: return UVALUE(tokenv&255,TY_SOUND); + case 0x0400 ... 0x04FF: return UVALUE(tokenv&255,TY_USOUND); case 0x4000 ... 0x7FFF: return CVALUE(tokenv-0x4000); case OP_STRING: return UVALUE(pool_string(tokenstr),TY_STRING); case OP_BITCONSTANT ... OP_BITCONSTANT_LAST: return NVALUE(1<<(tokenv&31)); case 0xC000 ... 0xFFFF: return MVALUE(tokenv-0xBF00); } Index: default.heromeshrc ================================================================== --- default.heromeshrc +++ default.heromeshrc @@ -184,8 +184,9 @@ ?.?.shift.kp_plus: select 'go',-max_level(); ?.?.ctrl.G: select 'go',-:Go_To_Level where :Go_To_Level=cast(:Go_To_Level as int) and cast(:Go_To_Level as int)>0; ?.?.ctrl.Q: ^Q ?.?.ctrl.S: ^S ?.?.ctrl.T: ^T +?.?.ctrl.Y: ^Y ?.?.shift.ctrl.M: select ':s'; ?.?.f10: select ':x'; Index: edit.c ================================================================== --- edit.c +++ edit.c @@ -1846,10 +1846,13 @@ save_level(); return 1; case '^T': // Level title edit_string(&level_title); return 0; + case '^Y': // Sound test + sound_test(); + return prev; case '^Z': // Cancel rectangle editrect.x0=editrect.y0=editrect.x1=editrect.y1=0; return prev; case '^<': // First corner if((number&63?:64)>pfwidth || (number/64?:64)>pfheight) return prev; Index: edit.doc ================================================================== --- edit.doc +++ edit.doc @@ -225,10 +225,11 @@ CTRL+P Switch to play game (won't auto save) CTRL+Q Quit (won't auto save) CTRL+S Save level CTRL+T Edit level title CTRL+X Clear level (delete all objects) + CTRL+Y Sound test C Set level code number E Edit level strings F Fill grid with current MRU R Clear and resize level W Exchange main/bizarro worlds Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -2735,11 +2735,11 @@ case OP_STRENGTH_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u; break; case OP_STRENGTH_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u&0xFFFF; break; case OP_STRENGTH_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->strength=t1.u; break; case OP_STRENGTH_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->strength=t1.u&0xFFFF; break; case OP_STRING: StackReq(0,1); Push(UVALUE(code[ptr++],TY_STRING)); break; - case OP_SOUND: StackReq(2,0); t2=Pop(); t1=Pop(); break; // Sound not implemented at this time + case OP_SOUND: StackReq(2,0); t2=Pop(); t1=Pop(); set_sound_effect(t1,t2); break; case OP_SUB: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u-t2.u)); break; case OP_SUPER: i=code[1]; code=classes[i]->codes; ptr=get_message_ptr(i,msgvars.msg); if(ptr==0xFFFF) break; break; case OP_SUPER_C: i=code[1]; j=get_message_ptr(i,msgvars.msg); if(j!=0xFFFF) execute_program(classes[i]->codes,j,obj); break; case OP_SWAP: StackReq(2,2); t1=Pop(); t2=Pop(); Push(t1); Push(t2); break; case OP_SWAPWORLD: NoIgnore(); swap_world(); break; Index: game.c ================================================================== --- game.c +++ game.c @@ -1160,10 +1160,13 @@ case '^S': // Save solution if(gameover==1) record_solution(); return 1; case '^T': // Show title modal_draw_popup(level_title); + return prev; + case '^Y': // Sound test + sound_test(); return prev; case '^d': // Describe object describe_at(number-65); return prev; case '^g': // Display global variables Index: game.doc ================================================================== --- game.doc +++ game.doc @@ -141,10 +141,11 @@ CTRL+L List of levels CTRL+Q Quit CTRL+S Save solution CTRL+T Display level title CTRL+X Export move list + CTRL+Y Sound test F1 Replay 1 move F2 Replay 10 moves F3 Replay 100 moves F4 Replay 1000 moves SHIFT+F1 Rewind 1 move Index: sound.c ================================================================== --- sound.c +++ sound.c @@ -195,11 +195,11 @@ l_offset=ftell(fp); l_size=j; if(i>4 && nam[i-4]=='.' && nam[i-3]=='W' && nam[i-1]=='V' && (nam[i-2]=='A' || nam[i-2]=='Z')) { j=nam[i-2]; nam[i-4]=0; if(is_user) { - if(nusersounds>0x03FD) goto done; + if(nusersounds>255) goto done; i=nusersounds++; usersounds=realloc(usersounds,nusersounds*sizeof(WaveSound)); user_sound_names=realloc(user_sound_names,nusersounds*sizeof(Uint8*)); if(!usersounds || !user_sound_names) fatal("Allocation failed\n"); user_sound_names[i]=strdup(nam); @@ -408,11 +408,11 @@ if(main_options['T'] && main_options['v']) { if(mmltuning) printf("mmltempo=%d; mmlvolume=%d; mmltuning[96]=%d\n",(int)mmltempo,(int)mmlvolume,(int)mmltuning[96]); for(i=0;iw-16)/240?:1; scrmax=(nitems+columns-1)/columns; set_cursor(XC_arrow); redraw: