stm32_sam.cpp 172 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703
  1. #include "stm32_sam.h"
  2. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  3. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4. ////////////////////////////////////////////////////////////////////////////////////////////
  5. //
  6. // All
  7. //
  8. ////////////////////////////////////////////////////////////////////////////////////////////
  9. char input[256 + 1] = {0}; //tab39445
  10. //standard sam sound
  11. unsigned char wait1 = 7;
  12. unsigned char wait2 = 6;
  13. unsigned char A, X, Y;
  14. unsigned char mem44;
  15. unsigned char mem47;
  16. unsigned char mem49;
  17. unsigned char mem39;
  18. unsigned char mem50;
  19. unsigned char mem51;
  20. unsigned char mem53;
  21. unsigned char mem56;
  22. unsigned char mem59 = 0;
  23. unsigned char phonemeIndexOutput[60]; //tab47296
  24. unsigned char stressOutput[60]; //tab47365
  25. unsigned char phonemeLengthOutput[60]; //tab47416
  26. // contains the soundbuffer position
  27. int bufferpos;
  28. ////////////////////////////////////////////////////////////////////////////////////////////
  29. //
  30. // Sam Tabs
  31. //
  32. ////////////////////////////////////////////////////////////////////////////////////////////
  33. //tab40672
  34. const unsigned char stressInputTable[] = {'*', '1', '2', '3', '4', '5', '6', '7', '8'};
  35. //tab40682
  36. const unsigned char signInputTable1[] = {
  37. ' ', '.', '?', ',', '-', 'I', 'I', 'E', 'A', 'A', 'A', 'A', 'U', 'A', 'I', 'E', 'U',
  38. 'O', 'R', 'L', 'W', 'Y', 'W', 'R', 'L', 'W', 'Y', 'M', 'N', 'N', 'D', 'Q', 'S', 'S',
  39. 'F', 'T', '/', '/', 'Z', 'Z', 'V', 'D', 'C', '*', 'J', '*', '*', '*', 'E', 'A', 'O',
  40. 'A', 'O', 'U', 'B', '*', '*', 'D', '*', '*', 'G', '*', '*', 'G', '*', '*', 'P', '*',
  41. '*', 'T', '*', '*', 'K', '*', '*', 'K', '*', '*', 'U', 'U', 'U'};
  42. //tab40763
  43. const unsigned char signInputTable2[] = {
  44. '*', '*', '*', '*', '*', 'Y', 'H', 'H', 'E', 'A', 'H', 'O', 'H', 'X', 'X', 'R', 'X',
  45. 'H', 'X', 'X', 'X', 'X', 'H', '*', '*', '*', '*', '*', '*', 'X', 'X', '*', '*', 'H',
  46. '*', 'H', 'H', 'X', '*', 'H', '*', 'H', 'H', '*', '*', '*', '*', '*', 'Y', 'Y', 'Y',
  47. 'W', 'W', 'W', '*', '*', '*', '*', '*', '*', '*', '*', '*', 'X', '*', '*', '*', '*',
  48. '*', '*', '*', '*', '*', '*', '*', 'X', '*', '*', 'L', 'M', 'N'};
  49. //loc_9F8C
  50. const unsigned char flags[] = {
  51. 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0x84, 0x84, 0xA4,
  52. 0xA4, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x44, 0x44, 0x44, 0x44, 0x44, 0x4C,
  53. 0x4C, 0x4C, 0x48, 0x4C, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x44, 0x44,
  54. 0x48, 0x40, 0x4C, 0x44, 0x00, 0x00, 0xB4, 0xB4, 0xB4, 0x94, 0x94, 0x94, 0x4E, 0x4E,
  55. 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4E, 0x4B, 0x4B, 0x4B, 0x4B,
  56. 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x80, 0xC1, 0xC1
  57. };
  58. //??? flags overlap flags2
  59. //loc_9FDA
  60. const unsigned char flags2[] = {
  61. 0x80, 0xC1, 0xC1, 0xC1, 0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  62. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x08, 0x0C, 0x08, 0x04, 0x40,
  63. 0x24, 0x20, 0x20, 0x24, 0x00, 0x00, 0x24, 0x20, 0x20, 0x24, 0x20, 0x20, 0x00, 0x20, 0x00, 0x00,
  64. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00,
  65. 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  66. //tab45616???
  67. const unsigned char phonemeStressedLengthTable[] = {
  68. 0x00, 0x12, 0x12, 0x12, 8, 0xB, 9, 0xB, 0xE, 0xF, 0xB, 0x10, 0xC, 6, 6, 0xE,
  69. 0xC, 0xE, 0xC, 0xB, 8, 8, 0xB, 0xA, 9, 8, 8, 8, 8, 8, 3, 5,
  70. 2, 2, 2, 2, 2, 2, 6, 6, 8, 6, 6, 2, 9, 4, 2, 1,
  71. 0xE, 0xF, 0xF, 0xF, 0xE, 0xE, 8, 2, 2, 7, 2, 1, 7, 2, 2, 7,
  72. 2, 2, 8, 2, 2, 6, 2, 2, 7, 2, 4, 7, 1, 4, 5, 5};
  73. //tab45536???
  74. const unsigned char phonemeLengthTable[] = {
  75. 0, 0x12, 0x12, 0x12, 8, 8, 8, 8, 8, 0xB, 6, 0xC, 0xA, 5, 5, 0xB, 0xA, 0xA, 0xA, 9,
  76. 8, 7, 9, 7, 6, 8, 6, 7, 7, 7, 2, 5, 2, 2, 2, 2, 2, 2, 6, 6,
  77. 7, 6, 6, 2, 8, 3, 1, 0x1E, 0xD, 0xC, 0xC, 0xC, 0xE, 9, 6, 1, 2, 5, 1, 1,
  78. 6, 1, 2, 6, 1, 2, 8, 2, 2, 4, 2, 2, 6, 1, 4, 6, 1, 4, 0xC7, 0xFF};
  79. /*
  80. Ind | phoneme | flags |
  81. -----|---------|----------|
  82. 0 | * | 00000000 |
  83. 1 | .* | 00000000 |
  84. 2 | ?* | 00000000 |
  85. 3 | ,* | 00000000 |
  86. 4 | -* | 00000000 |
  87. VOWELS
  88. 5 | IY | 10100100 |
  89. 6 | IH | 10100100 |
  90. 7 | EH | 10100100 |
  91. 8 | AE | 10100100 |
  92. 9 | AA | 10100100 |
  93. 10 | AH | 10100100 |
  94. 11 | AO | 10000100 |
  95. 17 | OH | 10000100 |
  96. 12 | UH | 10000100 |
  97. 16 | UX | 10000100 |
  98. 15 | ER | 10000100 |
  99. 13 | AX | 10100100 |
  100. 14 | IX | 10100100 |
  101. DIPHTONGS
  102. 48 | EY | 10110100 |
  103. 49 | AY | 10110100 |
  104. 50 | OY | 10110100 |
  105. 51 | AW | 10010100 |
  106. 52 | OW | 10010100 |
  107. 53 | UW | 10010100 |
  108. 21 | YX | 10000100 |
  109. 20 | WX | 10000100 |
  110. 18 | RX | 10000100 |
  111. 19 | LX | 10000100 |
  112. 37 | /X | 01000000 |
  113. 30 | DX | 01001000 |
  114. 22 | WH | 01000100 |
  115. VOICED CONSONANTS
  116. 23 | R* | 01000100 |
  117. 24 | L* | 01000100 |
  118. 25 | W* | 01000100 |
  119. 26 | Y* | 01000100 |
  120. 27 | M* | 01001100 |
  121. 28 | N* | 01001100 |
  122. 29 | NX | 01001100 |
  123. 54 | B* | 01001110 |
  124. 57 | D* | 01001110 |
  125. 60 | G* | 01001110 |
  126. 44 | J* | 01001100 |
  127. 38 | Z* | 01000100 |
  128. 39 | ZH | 01000100 |
  129. 40 | V* | 01000100 |
  130. 41 | DH | 01000100 |
  131. unvoiced CONSONANTS
  132. 32 | S* | 01000000 |
  133. 33 | SH | 01000000 |
  134. 34 | F* | 01000000 |
  135. 35 | TH | 01000000 |
  136. 66 | P* | 01001011 |
  137. 69 | T* | 01001011 |
  138. 72 | K* | 01001011 |
  139. 42 | CH | 01001000 |
  140. 36 | /H | 01000000 |
  141. 43 | ** | 01000000 |
  142. 45 | ** | 01000100 |
  143. 46 | ** | 00000000 |
  144. 47 | ** | 00000000 |
  145. 55 | ** | 01001110 |
  146. 56 | ** | 01001110 |
  147. 58 | ** | 01001110 |
  148. 59 | ** | 01001110 |
  149. 61 | ** | 01001110 |
  150. 62 | ** | 01001110 |
  151. 63 | GX | 01001110 |
  152. 64 | ** | 01001110 |
  153. 65 | ** | 01001110 |
  154. 67 | ** | 01001011 |
  155. 68 | ** | 01001011 |
  156. 70 | ** | 01001011 |
  157. 71 | ** | 01001011 |
  158. 73 | ** | 01001011 |
  159. 74 | ** | 01001011 |
  160. 75 | KX | 01001011 |
  161. 76 | ** | 01001011 |
  162. 77 | ** | 01001011 |
  163. SPECIAL
  164. 78 | UL | 10000000 |
  165. 79 | UM | 11000001 |
  166. 80 | UN | 11000001 |
  167. 31 | Q* | 01001100 |
  168. */
  169. ////////////////////////////////////////////////////////////////////////////////////////////
  170. //
  171. // RenderTabs
  172. //
  173. ////////////////////////////////////////////////////////////////////////////////////////////
  174. const unsigned char tab48426[5] = {0x18, 0x1A, 0x17, 0x17, 0x17};
  175. const unsigned char tab47492[] = {0, 0, 0xE0, 0xE6, 0xEC, 0xF3, 0xF9, 0, 6, 0xC, 6};
  176. const unsigned char amplitudeRescale[] = {
  177. 0,
  178. 1,
  179. 2,
  180. 2,
  181. 2,
  182. 3,
  183. 3,
  184. 4,
  185. 4,
  186. 5,
  187. 6,
  188. 8,
  189. 9,
  190. 0xB,
  191. 0xD,
  192. 0xF,
  193. 0 //17 elements?
  194. };
  195. // Used to decide which phoneme's blend lengths. The candidate with the lower score is selected.
  196. // tab45856
  197. const unsigned char blendRank[] = {0, 0x1F, 0x1F, 0x1F, 0x1F, 2, 2, 2, 2, 2,
  198. 2, 2, 2, 2, 5, 5, 2, 0xA, 2, 8,
  199. 5, 5, 0xB, 0xA, 9, 8, 8, 0xA0, 8, 8,
  200. 0x17, 0x1F, 0x12, 0x12, 0x12, 0x12, 0x1E, 0x1E, 0x14, 0x14,
  201. 0x14, 0x14, 0x17, 0x17, 0x1A, 0x1A, 0x1D, 0x1D, 2, 2,
  202. 2, 2, 2, 2, 0x1A, 0x1D, 0x1B, 0x1A, 0x1D, 0x1B,
  203. 0x1A, 0x1D, 0x1B, 0x1A, 0x1D, 0x1B, 0x17, 0x1D, 0x17, 0x17,
  204. 0x1D, 0x17, 0x17, 0x1D, 0x17, 0x17, 0x1D, 0x17, 0x17, 0x17};
  205. // Number of frames at the end of a phoneme devoted to interpolating to next phoneme's final value
  206. //tab45696
  207. const unsigned char outBlendLength[] = {0, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  208. 4, 4, 3, 2, 4, 4, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
  209. 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 0, 1, 0, 1, 0, 5,
  210. 5, 5, 5, 5, 4, 4, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2,
  211. 0, 1, 2, 0, 2, 2, 0, 1, 3, 0, 2, 3, 0, 2, 0xA0, 0xA0};
  212. // Number of frames at beginning of a phoneme devoted to interpolating to phoneme's final value
  213. // tab45776
  214. const unsigned char inBlendLength[] = {0, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  215. 4, 4, 3, 3, 4, 4, 3, 3, 3, 3, 3, 1, 2, 3, 2, 1,
  216. 3, 3, 3, 3, 1, 1, 3, 3, 3, 2, 2, 3, 2, 3, 0, 0,
  217. 5, 5, 5, 5, 4, 4, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2,
  218. 0, 3, 2, 0, 2, 2, 0, 2, 3, 0, 3, 3, 0, 3, 0xB0, 0xA0};
  219. // Looks like it's used as bit flags
  220. // High bits masked by 248 (11111000)
  221. //
  222. // 32: S* 241 11110001
  223. // 33: SH 226 11100010
  224. // 34: F* 211 11010011
  225. // 35: TH 187 10111011
  226. // 36: /H 124 01111100
  227. // 37: /X 149 10010101
  228. // 38: Z* 1 00000001
  229. // 39: ZH 2 00000010
  230. // 40: V* 3 00000011
  231. // 41: DH 3 00000011
  232. // 43: ** 114 01110010
  233. // 45: ** 2 00000010
  234. // 67: ** 27 00011011
  235. // 70: ** 25 00011001
  236. // tab45936
  237. const unsigned char sampledConsonantFlags[] = {
  238. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  239. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xF1, 0xE2, 0xD3, 0xBB, 0x7C, 0x95, 1, 2,
  240. 3, 3, 0, 0x72, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  241. 0, 0, 0, 0, 0, 0, 0, 0x1B, 0, 0, 0x19, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  242. //tab45056
  243. unsigned char freq1data[] = {
  244. 0x00, 0x13, 0x13, 0x13, 0x13, 0xA, 0xE, 0x12, 0x18, 0x1A, 0x16, 0x14, 0x10, 0x14, 0xE, 0x12,
  245. 0xE, 0x12, 0x12, 0x10, 0xC, 0xE, 0xA, 0x12, 0xE, 0xA, 8, 6, 6, 6, 6, 0x11,
  246. 6, 6, 6, 6, 0xE, 0x10, 9, 0xA, 8, 0xA, 6, 6, 6, 5, 6, 0,
  247. 0x12, 0x1A, 0x14, 0x1A, 0x12, 0xC, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  248. 6, 6, 6, 6, 6, 6, 6, 6, 6, 0xA, 0xA, 6, 6, 6, 0x2C, 0x13};
  249. //tab451356
  250. unsigned char freq2data[] = {0x00, 0x43, 0x43, 0x43, 0x43, 0x54, 0x48, 0x42, 0x3E, 0x28,
  251. 0x2C, 0x1E, 0x24, 0x2C, 0x48, 0x30, 0x24, 0x1E, 0x32, 0x24,
  252. 0x1C, 0x44, 0x18, 0x32, 0x1E, 0x18, 0x52, 0x2E, 0x36, 0x56,
  253. 0x36, 0x43, 0x49, 0x4F, 0x1A, 0x42, 0x49, 0x25, 0x33, 0x42,
  254. 0x28, 0x2F, 0x4F, 0x4F, 0x42, 0x4F, 0x6E, 0x00, 0x48, 0x26,
  255. 0x1E, 0x2A, 0x1E, 0x22, 0x1A, 0x1A, 0x1A, 0x42, 0x42, 0x42,
  256. 0x6E, 0x6E, 0x6E, 0x54, 0x54, 0x54, 0x1A, 0x1A, 0x1A, 0x42,
  257. 0x42, 0x42, 0x6D, 0x56, 0x6D, 0x54, 0x54, 0x54, 0x7F, 0x7F};
  258. //tab45216
  259. unsigned char freq3data[] = {0x00, 0x5B, 0x5B, 0x5B, 0x5B, 0x6E, 0x5D, 0x5B, 0x58, 0x59,
  260. 0x57, 0x58, 0x52, 0x59, 0x5D, 0x3E, 0x52, 0x58, 0x3E, 0x6E,
  261. 0x50, 0x5D, 0x5A, 0x3C, 0x6E, 0x5A, 0x6E, 0x51, 0x79, 0x65,
  262. 0x79, 0x5B, 0x63, 0x6A, 0x51, 0x79, 0x5D, 0x52, 0x5D, 0x67,
  263. 0x4C, 0x5D, 0x65, 0x65, 0x79, 0x65, 0x79, 0x00, 0x5A, 0x58,
  264. 0x58, 0x58, 0x58, 0x52, 0x51, 0x51, 0x51, 0x79, 0x79, 0x79,
  265. 0x70, 0x6E, 0x6E, 0x5E, 0x5E, 0x5E, 0x51, 0x51, 0x51, 0x79,
  266. 0x79, 0x79, 0x65, 0x65, 0x70, 0x5E, 0x5E, 0x5E, 0x08, 0x01};
  267. ////////////////////////////////////////////////////////////////////////////////////////////
  268. //
  269. // Reciter
  270. //
  271. ////////////////////////////////////////////////////////////////////////////////////////////
  272. unsigned char inputtemp[256]; // secure copy of input tab36096
  273. ////////////////////////////////////////////////////////////////////////////////////////////
  274. //
  275. // Render
  276. //
  277. ////////////////////////////////////////////////////////////////////////////////////////////
  278. //timetable for more accurate c64 simulation
  279. int timetable[5][5] = {
  280. {162, 167, 167, 127, 128},
  281. {226, 60, 60, 0, 0},
  282. {225, 60, 59, 0, 0},
  283. {200, 0, 0, 54, 55},
  284. {199, 0, 0, 54, 54}};
  285. unsigned oldtimetableindex;
  286. const unsigned char ampl1data[] = {0, 0, 0, 0, 0, 0xD, 0xD, 0xE, 0xF, 0xF, 0xF, 0xF,
  287. 0xF, 0xC, 0xD, 0xC, 0xF, 0xF, 0xD, 0xD, 0xD, 0xE, 0xD, 0xC,
  288. 0xD, 0xD, 0xD, 0xC, 9, 9, 0, 0, 0, 0, 0, 0,
  289. 0, 0, 0xB, 0xB, 0xB, 0xB, 0, 0, 1, 0xB, 0, 2,
  290. 0xE, 0xF, 0xF, 0xF, 0xF, 0xD, 2, 4, 0, 2, 4, 0,
  291. 1, 4, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0,
  292. 0, 0xC, 0, 0, 0, 0, 0xF, 0xF};
  293. const unsigned char ampl2data[] = {
  294. 0, 0, 0, 0, 0, 0xA, 0xB, 0xD, 0xE, 0xD, 0xC, 0xC, 0xB, 9, 0xB, 0xB, 0xC, 0xC, 0xC, 8,
  295. 8, 0xC, 8, 0xA, 8, 8, 0xA, 3, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5,
  296. 3, 4, 0, 0, 0, 5, 0xA, 2, 0xE, 0xD, 0xC, 0xD, 0xC, 8, 0, 1, 0, 0, 1, 0,
  297. 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0xA, 0, 0, 0xA, 0, 0, 0};
  298. const unsigned char ampl3data[] = {0, 0, 0, 0, 0, 8, 7, 8, 8, 1, 1, 0, 1, 0, 7, 5,
  299. 1, 0, 6, 1, 0, 7, 0, 5, 1, 0, 8, 0, 0, 3, 0, 0,
  300. 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0xE, 1,
  301. 9, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  302. 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 5, 0, 0x13, 0x10};
  303. //tab42240
  304. const signed char sinus[256] = {
  305. 0, 3, 6, 9, 12, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46,
  306. 49, 51, 54, 57, 60, 63, 65, 68, 71, 73, 76, 78, 81, 83, 85, 88,
  307. 90, 92, 94, 96, 98, 100, 102, 104, 106, 107, 109, 111, 112, 113, 115, 116,
  308. 117, 118, 120, 121, 122, 122, 123, 124, 125, 125, 126, 126, 126, 127, 127, 127,
  309. 127, 127, 127, 127, 126, 126, 126, 125, 125, 124, 123, 122, 122, 121, 120, 118,
  310. 117, 116, 115, 113, 112, 111, 109, 107, 106, 104, 102, 100, 98, 96, 94, 92,
  311. 90, 88, 85, 83, 81, 78, 76, 73, 71, 68, 65, 63, 60, 57, 54, 51,
  312. 49, 46, 43, 40, 37, 34, 31, 28, 25, 22, 19, 16, 12, 9, 6, 3,
  313. 0, -3, -6, -9, -12, -16, -19, -22, -25, -28, -31, -34, -37, -40, -43, -46,
  314. -49, -51, -54, -57, -60, -63, -65, -68, -71, -73, -76, -78, -81, -83, -85, -88,
  315. -90, -92, -94, -96, -98, -100, -102, -104, -106, -107, -109, -111, -112, -113, -115, -116,
  316. -117, -118, -120, -121, -122, -122, -123, -124, -125, -125, -126, -126, -126, -127, -127, -127,
  317. -127, -127, -127, -127, -126, -126, -126, -125, -125, -124, -123, -122, -122, -121, -120, -118,
  318. -117, -116, -115, -113, -112, -111, -109, -107, -106, -104, -102, -100, -98, -96, -94, -92,
  319. -90, -88, -85, -83, -81, -78, -76, -73, -71, -68, -65, -63, -60, -57, -54, -51,
  320. -49, -46, -43, -40, -37, -34, -31, -28, -25, -22, -19, -16, -12, -9, -6, -3};
  321. //tab42496
  322. const unsigned char rectangle[] = {
  323. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  324. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  325. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  326. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  327. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  328. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  329. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  330. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
  331. 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  332. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  333. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  334. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  335. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  336. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  337. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  338. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  339. 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
  340. 0x70};
  341. //random data ?
  342. const unsigned char sampleTable[0x500] = {
  343. //00
  344. 0x38,
  345. 0x84,
  346. 0x6B,
  347. 0x19,
  348. 0xC6,
  349. 0x63,
  350. 0x18,
  351. 0x86,
  352. 0x73,
  353. 0x98,
  354. 0xC6,
  355. 0xB1,
  356. 0x1C,
  357. 0xCA,
  358. 0x31,
  359. 0x8C,
  360. 0xC7,
  361. 0x31,
  362. 0x88,
  363. 0xC2,
  364. 0x30,
  365. 0x98,
  366. 0x46,
  367. 0x31,
  368. 0x18,
  369. 0xC6,
  370. 0x35,
  371. 0xC,
  372. 0xCA,
  373. 0x31,
  374. 0xC,
  375. 0xC6
  376. //20
  377. ,
  378. 0x21,
  379. 0x10,
  380. 0x24,
  381. 0x69,
  382. 0x12,
  383. 0xC2,
  384. 0x31,
  385. 0x14,
  386. 0xC4,
  387. 0x71,
  388. 8,
  389. 0x4A,
  390. 0x22,
  391. 0x49,
  392. 0xAB,
  393. 0x6A,
  394. 0xA8,
  395. 0xAC,
  396. 0x49,
  397. 0x51,
  398. 0x32,
  399. 0xD5,
  400. 0x52,
  401. 0x88,
  402. 0x93,
  403. 0x6C,
  404. 0x94,
  405. 0x22,
  406. 0x15,
  407. 0x54,
  408. 0xD2,
  409. 0x25
  410. //40
  411. ,
  412. 0x96,
  413. 0xD4,
  414. 0x50,
  415. 0xA5,
  416. 0x46,
  417. 0x21,
  418. 8,
  419. 0x85,
  420. 0x6B,
  421. 0x18,
  422. 0xC4,
  423. 0x63,
  424. 0x10,
  425. 0xCE,
  426. 0x6B,
  427. 0x18,
  428. 0x8C,
  429. 0x71,
  430. 0x19,
  431. 0x8C,
  432. 0x63,
  433. 0x35,
  434. 0xC,
  435. 0xC6,
  436. 0x33,
  437. 0x99,
  438. 0xCC,
  439. 0x6C,
  440. 0xB5,
  441. 0x4E,
  442. 0xA2,
  443. 0x99
  444. //60
  445. ,
  446. 0x46,
  447. 0x21,
  448. 0x28,
  449. 0x82,
  450. 0x95,
  451. 0x2E,
  452. 0xE3,
  453. 0x30,
  454. 0x9C,
  455. 0xC5,
  456. 0x30,
  457. 0x9C,
  458. 0xA2,
  459. 0xB1,
  460. 0x9C,
  461. 0x67,
  462. 0x31,
  463. 0x88,
  464. 0x66,
  465. 0x59,
  466. 0x2C,
  467. 0x53,
  468. 0x18,
  469. 0x84,
  470. 0x67,
  471. 0x50,
  472. 0xCA,
  473. 0xE3,
  474. 0xA,
  475. 0xAC,
  476. 0xAB,
  477. 0x30
  478. //80
  479. ,
  480. 0xAC,
  481. 0x62,
  482. 0x30,
  483. 0x8C,
  484. 0x63,
  485. 0x10,
  486. 0x94,
  487. 0x62,
  488. 0xB1,
  489. 0x8C,
  490. 0x82,
  491. 0x28,
  492. 0x96,
  493. 0x33,
  494. 0x98,
  495. 0xD6,
  496. 0xB5,
  497. 0x4C,
  498. 0x62,
  499. 0x29,
  500. 0xA5,
  501. 0x4A,
  502. 0xB5,
  503. 0x9C,
  504. 0xC6,
  505. 0x31,
  506. 0x14,
  507. 0xD6,
  508. 0x38,
  509. 0x9C,
  510. 0x4B,
  511. 0xB4
  512. //A0
  513. ,
  514. 0x86,
  515. 0x65,
  516. 0x18,
  517. 0xAE,
  518. 0x67,
  519. 0x1C,
  520. 0xA6,
  521. 0x63,
  522. 0x19,
  523. 0x96,
  524. 0x23,
  525. 0x19,
  526. 0x84,
  527. 0x13,
  528. 8,
  529. 0xA6,
  530. 0x52,
  531. 0xAC,
  532. 0xCA,
  533. 0x22,
  534. 0x89,
  535. 0x6E,
  536. 0xAB,
  537. 0x19,
  538. 0x8C,
  539. 0x62,
  540. 0x34,
  541. 0xC4,
  542. 0x62,
  543. 0x19,
  544. 0x86,
  545. 0x63
  546. //C0
  547. ,
  548. 0x18,
  549. 0xC4,
  550. 0x23,
  551. 0x58,
  552. 0xD6,
  553. 0xA3,
  554. 0x50,
  555. 0x42,
  556. 0x54,
  557. 0x4A,
  558. 0xAD,
  559. 0x4A,
  560. 0x25,
  561. 0x11,
  562. 0x6B,
  563. 0x64,
  564. 0x89,
  565. 0x4A,
  566. 0x63,
  567. 0x39,
  568. 0x8A,
  569. 0x23,
  570. 0x31,
  571. 0x2A,
  572. 0xEA,
  573. 0xA2,
  574. 0xA9,
  575. 0x44,
  576. 0xC5,
  577. 0x12,
  578. 0xCD,
  579. 0x42
  580. //E0
  581. ,
  582. 0x34,
  583. 0x8C,
  584. 0x62,
  585. 0x18,
  586. 0x8C,
  587. 0x63,
  588. 0x11,
  589. 0x48,
  590. 0x66,
  591. 0x31,
  592. 0x9D,
  593. 0x44,
  594. 0x33,
  595. 0x1D,
  596. 0x46,
  597. 0x31,
  598. 0x9C,
  599. 0xC6,
  600. 0xB1,
  601. 0xC,
  602. 0xCD,
  603. 0x32,
  604. 0x88,
  605. 0xC4,
  606. 0x73,
  607. 0x18,
  608. 0x86,
  609. 0x73,
  610. 8,
  611. 0xD6,
  612. 0x63,
  613. 0x58
  614. //100
  615. ,
  616. 7,
  617. 0x81,
  618. 0xE0,
  619. 0xF0,
  620. 0x3C,
  621. 7,
  622. 0x87,
  623. 0x90,
  624. 0x3C,
  625. 0x7C,
  626. 0xF,
  627. 0xC7,
  628. 0xC0,
  629. 0xC0,
  630. 0xF0,
  631. 0x7C,
  632. 0x1E,
  633. 7,
  634. 0x80,
  635. 0x80,
  636. 0,
  637. 0x1C,
  638. 0x78,
  639. 0x70,
  640. 0xF1,
  641. 0xC7,
  642. 0x1F,
  643. 0xC0,
  644. 0xC,
  645. 0xFE,
  646. 0x1C,
  647. 0x1F
  648. //120
  649. ,
  650. 0x1F,
  651. 0xE,
  652. 0xA,
  653. 0x7A,
  654. 0xC0,
  655. 0x71,
  656. 0xF2,
  657. 0x83,
  658. 0x8F,
  659. 3,
  660. 0xF,
  661. 0xF,
  662. 0xC,
  663. 0,
  664. 0x79,
  665. 0xF8,
  666. 0x61,
  667. 0xE0,
  668. 0x43,
  669. 0xF,
  670. 0x83,
  671. 0xE7,
  672. 0x18,
  673. 0xF9,
  674. 0xC1,
  675. 0x13,
  676. 0xDA,
  677. 0xE9,
  678. 0x63,
  679. 0x8F,
  680. 0xF,
  681. 0x83
  682. //140
  683. ,
  684. 0x83,
  685. 0x87,
  686. 0xC3,
  687. 0x1F,
  688. 0x3C,
  689. 0x70,
  690. 0xF0,
  691. 0xE1,
  692. 0xE1,
  693. 0xE3,
  694. 0x87,
  695. 0xB8,
  696. 0x71,
  697. 0xE,
  698. 0x20,
  699. 0xE3,
  700. 0x8D,
  701. 0x48,
  702. 0x78,
  703. 0x1C,
  704. 0x93,
  705. 0x87,
  706. 0x30,
  707. 0xE1,
  708. 0xC1,
  709. 0xC1,
  710. 0xE4,
  711. 0x78,
  712. 0x21,
  713. 0x83,
  714. 0x83,
  715. 0xC3
  716. //160
  717. ,
  718. 0x87,
  719. 6,
  720. 0x39,
  721. 0xE5,
  722. 0xC3,
  723. 0x87,
  724. 7,
  725. 0xE,
  726. 0x1C,
  727. 0x1C,
  728. 0x70,
  729. 0xF4,
  730. 0x71,
  731. 0x9C,
  732. 0x60,
  733. 0x36,
  734. 0x32,
  735. 0xC3,
  736. 0x1E,
  737. 0x3C,
  738. 0xF3,
  739. 0x8F,
  740. 0xE,
  741. 0x3C,
  742. 0x70,
  743. 0xE3,
  744. 0xC7,
  745. 0x8F,
  746. 0xF,
  747. 0xF,
  748. 0xE,
  749. 0x3C
  750. //180
  751. ,
  752. 0x78,
  753. 0xF0,
  754. 0xE3,
  755. 0x87,
  756. 6,
  757. 0xF0,
  758. 0xE3,
  759. 7,
  760. 0xC1,
  761. 0x99,
  762. 0x87,
  763. 0xF,
  764. 0x18,
  765. 0x78,
  766. 0x70,
  767. 0x70,
  768. 0xFC,
  769. 0xF3,
  770. 0x10,
  771. 0xB1,
  772. 0x8C,
  773. 0x8C,
  774. 0x31,
  775. 0x7C,
  776. 0x70,
  777. 0xE1,
  778. 0x86,
  779. 0x3C,
  780. 0x64,
  781. 0x6C,
  782. 0xB0,
  783. 0xE1
  784. //1A0
  785. ,
  786. 0xE3,
  787. 0xF,
  788. 0x23,
  789. 0x8F,
  790. 0xF,
  791. 0x1E,
  792. 0x3E,
  793. 0x38,
  794. 0x3C,
  795. 0x38,
  796. 0x7B,
  797. 0x8F,
  798. 7,
  799. 0xE,
  800. 0x3C,
  801. 0xF4,
  802. 0x17,
  803. 0x1E,
  804. 0x3C,
  805. 0x78,
  806. 0xF2,
  807. 0x9E,
  808. 0x72,
  809. 0x49,
  810. 0xE3,
  811. 0x25,
  812. 0x36,
  813. 0x38,
  814. 0x58,
  815. 0x39,
  816. 0xE2,
  817. 0xDE
  818. //1C0
  819. ,
  820. 0x3C,
  821. 0x78,
  822. 0x78,
  823. 0xE1,
  824. 0xC7,
  825. 0x61,
  826. 0xE1,
  827. 0xE1,
  828. 0xB0,
  829. 0xF0,
  830. 0xF0,
  831. 0xC3,
  832. 0xC7,
  833. 0xE,
  834. 0x38,
  835. 0xC0,
  836. 0xF0,
  837. 0xCE,
  838. 0x73,
  839. 0x73,
  840. 0x18,
  841. 0x34,
  842. 0xB0,
  843. 0xE1,
  844. 0xC7,
  845. 0x8E,
  846. 0x1C,
  847. 0x3C,
  848. 0xF8,
  849. 0x38,
  850. 0xF0,
  851. 0xE1
  852. //1E0
  853. ,
  854. 0xC1,
  855. 0x8B,
  856. 0x86,
  857. 0x8F,
  858. 0x1C,
  859. 0x78,
  860. 0x70,
  861. 0xF0,
  862. 0x78,
  863. 0xAC,
  864. 0xB1,
  865. 0x8F,
  866. 0x39,
  867. 0x31,
  868. 0xDB,
  869. 0x38,
  870. 0x61,
  871. 0xC3,
  872. 0xE,
  873. 0xE,
  874. 0x38,
  875. 0x78,
  876. 0x73,
  877. 0x17,
  878. 0x1E,
  879. 0x39,
  880. 0x1E,
  881. 0x38,
  882. 0x64,
  883. 0xE1,
  884. 0xF1,
  885. 0xC1
  886. //200
  887. ,
  888. 0x4E,
  889. 0xF,
  890. 0x40,
  891. 0xA2,
  892. 2,
  893. 0xC5,
  894. 0x8F,
  895. 0x81,
  896. 0xA1,
  897. 0xFC,
  898. 0x12,
  899. 8,
  900. 0x64,
  901. 0xE0,
  902. 0x3C,
  903. 0x22,
  904. 0xE0,
  905. 0x45,
  906. 7,
  907. 0x8E,
  908. 0xC,
  909. 0x32,
  910. 0x90,
  911. 0xF0,
  912. 0x1F,
  913. 0x20,
  914. 0x49,
  915. 0xE0,
  916. 0xF8,
  917. 0xC,
  918. 0x60,
  919. 0xF0
  920. //220
  921. ,
  922. 0x17,
  923. 0x1A,
  924. 0x41,
  925. 0xAA,
  926. 0xA4,
  927. 0xD0,
  928. 0x8D,
  929. 0x12,
  930. 0x82,
  931. 0x1E,
  932. 0x1E,
  933. 3,
  934. 0xF8,
  935. 0x3E,
  936. 3,
  937. 0xC,
  938. 0x73,
  939. 0x80,
  940. 0x70,
  941. 0x44,
  942. 0x26,
  943. 3,
  944. 0x24,
  945. 0xE1,
  946. 0x3E,
  947. 4,
  948. 0x4E,
  949. 4,
  950. 0x1C,
  951. 0xC1,
  952. 9,
  953. 0xCC
  954. //240
  955. ,
  956. 0x9E,
  957. 0x90,
  958. 0x21,
  959. 7,
  960. 0x90,
  961. 0x43,
  962. 0x64,
  963. 0xC0,
  964. 0xF,
  965. 0xC6,
  966. 0x90,
  967. 0x9C,
  968. 0xC1,
  969. 0x5B,
  970. 3,
  971. 0xE2,
  972. 0x1D,
  973. 0x81,
  974. 0xE0,
  975. 0x5E,
  976. 0x1D,
  977. 3,
  978. 0x84,
  979. 0xB8,
  980. 0x2C,
  981. 0xF,
  982. 0x80,
  983. 0xB1,
  984. 0x83,
  985. 0xE0,
  986. 0x30,
  987. 0x41
  988. //260
  989. ,
  990. 0x1E,
  991. 0x43,
  992. 0x89,
  993. 0x83,
  994. 0x50,
  995. 0xFC,
  996. 0x24,
  997. 0x2E,
  998. 0x13,
  999. 0x83,
  1000. 0xF1,
  1001. 0x7C,
  1002. 0x4C,
  1003. 0x2C,
  1004. 0xC9,
  1005. 0xD,
  1006. 0x83,
  1007. 0xB0,
  1008. 0xB5,
  1009. 0x82,
  1010. 0xE4,
  1011. 0xE8,
  1012. 6,
  1013. 0x9C,
  1014. 7,
  1015. 0xA0,
  1016. 0x99,
  1017. 0x1D,
  1018. 7,
  1019. 0x3E,
  1020. 0x82,
  1021. 0x8F
  1022. //280
  1023. ,
  1024. 0x70,
  1025. 0x30,
  1026. 0x74,
  1027. 0x40,
  1028. 0xCA,
  1029. 0x10,
  1030. 0xE4,
  1031. 0xE8,
  1032. 0xF,
  1033. 0x92,
  1034. 0x14,
  1035. 0x3F,
  1036. 6,
  1037. 0xF8,
  1038. 0x84,
  1039. 0x88,
  1040. 0x43,
  1041. 0x81,
  1042. 0xA,
  1043. 0x34,
  1044. 0x39,
  1045. 0x41,
  1046. 0xC6,
  1047. 0xE3,
  1048. 0x1C,
  1049. 0x47,
  1050. 3,
  1051. 0xB0,
  1052. 0xB8,
  1053. 0x13,
  1054. 0xA,
  1055. 0xC2
  1056. //2A0
  1057. ,
  1058. 0x64,
  1059. 0xF8,
  1060. 0x18,
  1061. 0xF9,
  1062. 0x60,
  1063. 0xB3,
  1064. 0xC0,
  1065. 0x65,
  1066. 0x20,
  1067. 0x60,
  1068. 0xA6,
  1069. 0x8C,
  1070. 0xC3,
  1071. 0x81,
  1072. 0x20,
  1073. 0x30,
  1074. 0x26,
  1075. 0x1E,
  1076. 0x1C,
  1077. 0x38,
  1078. 0xD3,
  1079. 1,
  1080. 0xB0,
  1081. 0x26,
  1082. 0x40,
  1083. 0xF4,
  1084. 0xB,
  1085. 0xC3,
  1086. 0x42,
  1087. 0x1F,
  1088. 0x85,
  1089. 0x32
  1090. //2C0
  1091. ,
  1092. 0x26,
  1093. 0x60,
  1094. 0x40,
  1095. 0xC9,
  1096. 0xCB,
  1097. 1,
  1098. 0xEC,
  1099. 0x11,
  1100. 0x28,
  1101. 0x40,
  1102. 0xFA,
  1103. 4,
  1104. 0x34,
  1105. 0xE0,
  1106. 0x70,
  1107. 0x4C,
  1108. 0x8C,
  1109. 0x1D,
  1110. 7,
  1111. 0x69,
  1112. 3,
  1113. 0x16,
  1114. 0xC8,
  1115. 4,
  1116. 0x23,
  1117. 0xE8,
  1118. 0xC6,
  1119. 0x9A,
  1120. 0xB,
  1121. 0x1A,
  1122. 3,
  1123. 0xE0
  1124. //2E0
  1125. ,
  1126. 0x76,
  1127. 6,
  1128. 5,
  1129. 0xCF,
  1130. 0x1E,
  1131. 0xBC,
  1132. 0x58,
  1133. 0x31,
  1134. 0x71,
  1135. 0x66,
  1136. 0,
  1137. 0xF8,
  1138. 0x3F,
  1139. 4,
  1140. 0xFC,
  1141. 0xC,
  1142. 0x74,
  1143. 0x27,
  1144. 0x8A,
  1145. 0x80,
  1146. 0x71,
  1147. 0xC2,
  1148. 0x3A,
  1149. 0x26,
  1150. 6,
  1151. 0xC0,
  1152. 0x1F,
  1153. 5,
  1154. 0xF,
  1155. 0x98,
  1156. 0x40,
  1157. 0xAE
  1158. //300
  1159. ,
  1160. 1,
  1161. 0x7F,
  1162. 0xC0,
  1163. 7,
  1164. 0xFF,
  1165. 0,
  1166. 0xE,
  1167. 0xFE,
  1168. 0,
  1169. 3,
  1170. 0xDF,
  1171. 0x80,
  1172. 3,
  1173. 0xEF,
  1174. 0x80,
  1175. 0x1B,
  1176. 0xF1,
  1177. 0xC2,
  1178. 0,
  1179. 0xE7,
  1180. 0xE0,
  1181. 0x18,
  1182. 0xFC,
  1183. 0xE0,
  1184. 0x21,
  1185. 0xFC,
  1186. 0x80,
  1187. 0x3C,
  1188. 0xFC,
  1189. 0x40,
  1190. 0xE,
  1191. 0x7E
  1192. //320
  1193. ,
  1194. 0,
  1195. 0x3F,
  1196. 0x3E,
  1197. 0,
  1198. 0xF,
  1199. 0xFE,
  1200. 0,
  1201. 0x1F,
  1202. 0xFF,
  1203. 0,
  1204. 0x3E,
  1205. 0xF0,
  1206. 7,
  1207. 0xFC,
  1208. 0,
  1209. 0x7E,
  1210. 0x10,
  1211. 0x3F,
  1212. 0xFF,
  1213. 0,
  1214. 0x3F,
  1215. 0x38,
  1216. 0xE,
  1217. 0x7C,
  1218. 1,
  1219. 0x87,
  1220. 0xC,
  1221. 0xFC,
  1222. 0xC7,
  1223. 0,
  1224. 0x3E,
  1225. 4
  1226. //340
  1227. ,
  1228. 0xF,
  1229. 0x3E,
  1230. 0x1F,
  1231. 0xF,
  1232. 0xF,
  1233. 0x1F,
  1234. 0xF,
  1235. 2,
  1236. 0x83,
  1237. 0x87,
  1238. 0xCF,
  1239. 3,
  1240. 0x87,
  1241. 0xF,
  1242. 0x3F,
  1243. 0xC0,
  1244. 7,
  1245. 0x9E,
  1246. 0x60,
  1247. 0x3F,
  1248. 0xC0,
  1249. 3,
  1250. 0xFE,
  1251. 0,
  1252. 0x3F,
  1253. 0xE0,
  1254. 0x77,
  1255. 0xE1,
  1256. 0xC0,
  1257. 0xFE,
  1258. 0xE0,
  1259. 0xC3
  1260. //360
  1261. ,
  1262. 0xE0,
  1263. 1,
  1264. 0xDF,
  1265. 0xF8,
  1266. 3,
  1267. 7,
  1268. 0,
  1269. 0x7E,
  1270. 0x70,
  1271. 0,
  1272. 0x7C,
  1273. 0x38,
  1274. 0x18,
  1275. 0xFE,
  1276. 0xC,
  1277. 0x1E,
  1278. 0x78,
  1279. 0x1C,
  1280. 0x7C,
  1281. 0x3E,
  1282. 0xE,
  1283. 0x1F,
  1284. 0x1E,
  1285. 0x1E,
  1286. 0x3E,
  1287. 0,
  1288. 0x7F,
  1289. 0x83,
  1290. 7,
  1291. 0xDB,
  1292. 0x87,
  1293. 0x83
  1294. //380
  1295. ,
  1296. 7,
  1297. 0xC7,
  1298. 7,
  1299. 0x10,
  1300. 0x71,
  1301. 0xFF,
  1302. 0,
  1303. 0x3F,
  1304. 0xE2,
  1305. 1,
  1306. 0xE0,
  1307. 0xC1,
  1308. 0xC3,
  1309. 0xE1,
  1310. 0,
  1311. 0x7F,
  1312. 0xC0,
  1313. 5,
  1314. 0xF0,
  1315. 0x20,
  1316. 0xF8,
  1317. 0xF0,
  1318. 0x70,
  1319. 0xFE,
  1320. 0x78,
  1321. 0x79,
  1322. 0xF8,
  1323. 2,
  1324. 0x3F,
  1325. 0xC,
  1326. 0x8F,
  1327. 3
  1328. //3a0
  1329. ,
  1330. 0xF,
  1331. 0x9F,
  1332. 0xE0,
  1333. 0xC1,
  1334. 0xC7,
  1335. 0x87,
  1336. 3,
  1337. 0xC3,
  1338. 0xC3,
  1339. 0xB0,
  1340. 0xE1,
  1341. 0xE1,
  1342. 0xC1,
  1343. 0xE3,
  1344. 0xE0,
  1345. 0x71,
  1346. 0xF0,
  1347. 0,
  1348. 0xFC,
  1349. 0x70,
  1350. 0x7C,
  1351. 0xC,
  1352. 0x3E,
  1353. 0x38,
  1354. 0xE,
  1355. 0x1C,
  1356. 0x70,
  1357. 0xC3,
  1358. 0xC7,
  1359. 3,
  1360. 0x81,
  1361. 0xC1
  1362. //3c0
  1363. ,
  1364. 0xC7,
  1365. 0xE7,
  1366. 0,
  1367. 0xF,
  1368. 0xC7,
  1369. 0x87,
  1370. 0x19,
  1371. 9,
  1372. 0xEF,
  1373. 0xC4,
  1374. 0x33,
  1375. 0xE0,
  1376. 0xC1,
  1377. 0xFC,
  1378. 0xF8,
  1379. 0x70,
  1380. 0xF0,
  1381. 0x78,
  1382. 0xF8,
  1383. 0xF0,
  1384. 0x61,
  1385. 0xC7,
  1386. 0,
  1387. 0x1F,
  1388. 0xF8,
  1389. 1,
  1390. 0x7C,
  1391. 0xF8,
  1392. 0xF0,
  1393. 0x78,
  1394. 0x70,
  1395. 0x3C
  1396. //3e0
  1397. ,
  1398. 0x7C,
  1399. 0xCE,
  1400. 0xE,
  1401. 0x21,
  1402. 0x83,
  1403. 0xCF,
  1404. 8,
  1405. 7,
  1406. 0x8F,
  1407. 8,
  1408. 0xC1,
  1409. 0x87,
  1410. 0x8F,
  1411. 0x80,
  1412. 0xC7,
  1413. 0xE3,
  1414. 0,
  1415. 7,
  1416. 0xF8,
  1417. 0xE0,
  1418. 0xEF,
  1419. 0,
  1420. 0x39,
  1421. 0xF7,
  1422. 0x80,
  1423. 0xE,
  1424. 0xF8,
  1425. 0xE1,
  1426. 0xE3,
  1427. 0xF8,
  1428. 0x21,
  1429. 0x9F
  1430. //400
  1431. ,
  1432. 0xC0,
  1433. 0xFF,
  1434. 3,
  1435. 0xF8,
  1436. 7,
  1437. 0xC0,
  1438. 0x1F,
  1439. 0xF8,
  1440. 0xC4,
  1441. 4,
  1442. 0xFC,
  1443. 0xC4,
  1444. 0xC1,
  1445. 0xBC,
  1446. 0x87,
  1447. 0xF0,
  1448. 0xF,
  1449. 0xC0,
  1450. 0x7F,
  1451. 5,
  1452. 0xE0,
  1453. 0x25,
  1454. 0xEC,
  1455. 0xC0,
  1456. 0x3E,
  1457. 0x84,
  1458. 0x47,
  1459. 0xF0,
  1460. 0x8E,
  1461. 3,
  1462. 0xF8,
  1463. 3
  1464. //420
  1465. ,
  1466. 0xFB,
  1467. 0xC0,
  1468. 0x19,
  1469. 0xF8,
  1470. 7,
  1471. 0x9C,
  1472. 0xC,
  1473. 0x17,
  1474. 0xF8,
  1475. 7,
  1476. 0xE0,
  1477. 0x1F,
  1478. 0xA1,
  1479. 0xFC,
  1480. 0xF,
  1481. 0xFC,
  1482. 1,
  1483. 0xF0,
  1484. 0x3F,
  1485. 0,
  1486. 0xFE,
  1487. 3,
  1488. 0xF0,
  1489. 0x1F,
  1490. 0,
  1491. 0xFD,
  1492. 0,
  1493. 0xFF,
  1494. 0x88,
  1495. 0xD,
  1496. 0xF9,
  1497. 1
  1498. //440
  1499. ,
  1500. 0xFF,
  1501. 0,
  1502. 0x70,
  1503. 7,
  1504. 0xC0,
  1505. 0x3E,
  1506. 0x42,
  1507. 0xF3,
  1508. 0xD,
  1509. 0xC4,
  1510. 0x7F,
  1511. 0x80,
  1512. 0xFC,
  1513. 7,
  1514. 0xF0,
  1515. 0x5E,
  1516. 0xC0,
  1517. 0x3F,
  1518. 0,
  1519. 0x78,
  1520. 0x3F,
  1521. 0x81,
  1522. 0xFF,
  1523. 1,
  1524. 0xF8,
  1525. 1,
  1526. 0xC3,
  1527. 0xE8,
  1528. 0xC,
  1529. 0xE4,
  1530. 0x64,
  1531. 0x8F
  1532. ////460
  1533. ,
  1534. 0xE4,
  1535. 0xF,
  1536. 0xF0,
  1537. 7,
  1538. 0xF0,
  1539. 0xC2,
  1540. 0x1F,
  1541. 0,
  1542. 0x7F,
  1543. 0xC0,
  1544. 0x6F,
  1545. 0x80,
  1546. 0x7E,
  1547. 3,
  1548. 0xF8,
  1549. 7,
  1550. 0xF0,
  1551. 0x3F,
  1552. 0xC0,
  1553. 0x78,
  1554. 0xF,
  1555. 0x82,
  1556. 7,
  1557. 0xFE,
  1558. 0x22,
  1559. 0x77,
  1560. 0x70,
  1561. 2,
  1562. 0x76,
  1563. 3,
  1564. 0xFE,
  1565. 0
  1566. //480
  1567. ,
  1568. 0xFE,
  1569. 0x67,
  1570. 0,
  1571. 0x7C,
  1572. 0xC7,
  1573. 0xF1,
  1574. 0x8E,
  1575. 0xC6,
  1576. 0x3B,
  1577. 0xE0,
  1578. 0x3F,
  1579. 0x84,
  1580. 0xF3,
  1581. 0x19,
  1582. 0xD8,
  1583. 3,
  1584. 0x99,
  1585. 0xFC,
  1586. 9,
  1587. 0xB8,
  1588. 0xF,
  1589. 0xF8,
  1590. 0,
  1591. 0x9D,
  1592. 0x24,
  1593. 0x61,
  1594. 0xF9,
  1595. 0xD,
  1596. 0,
  1597. 0xFD,
  1598. 3,
  1599. 0xF0
  1600. //4a0
  1601. ,
  1602. 0x1F,
  1603. 0x90,
  1604. 0x3F,
  1605. 1,
  1606. 0xF8,
  1607. 0x1F,
  1608. 0xD0,
  1609. 0xF,
  1610. 0xF8,
  1611. 0x37,
  1612. 1,
  1613. 0xF8,
  1614. 7,
  1615. 0xF0,
  1616. 0xF,
  1617. 0xC0,
  1618. 0x3F,
  1619. 0,
  1620. 0xFE,
  1621. 3,
  1622. 0xF8,
  1623. 0xF,
  1624. 0xC0,
  1625. 0x3F,
  1626. 0,
  1627. 0xFA,
  1628. 3,
  1629. 0xF0,
  1630. 0xF,
  1631. 0x80,
  1632. 0xFF,
  1633. 1
  1634. //4c0
  1635. ,
  1636. 0xB8,
  1637. 7,
  1638. 0xF0,
  1639. 1,
  1640. 0xFC,
  1641. 1,
  1642. 0xBC,
  1643. 0x80,
  1644. 0x13,
  1645. 0x1E,
  1646. 0,
  1647. 0x7F,
  1648. 0xE1,
  1649. 0x40,
  1650. 0x7F,
  1651. 0xA0,
  1652. 0x7F,
  1653. 0xB0,
  1654. 0,
  1655. 0x3F,
  1656. 0xC0,
  1657. 0x1F,
  1658. 0xC0,
  1659. 0x38,
  1660. 0xF,
  1661. 0xF0,
  1662. 0x1F,
  1663. 0x80,
  1664. 0xFF,
  1665. 1,
  1666. 0xFC,
  1667. 3
  1668. //4e0
  1669. ,
  1670. 0xF1,
  1671. 0x7E,
  1672. 1,
  1673. 0xFE,
  1674. 1,
  1675. 0xF0,
  1676. 0xFF,
  1677. 0,
  1678. 0x7F,
  1679. 0xC0,
  1680. 0x1D,
  1681. 7,
  1682. 0xF0,
  1683. 0xF,
  1684. 0xC0,
  1685. 0x7E,
  1686. 6,
  1687. 0xE0,
  1688. 7,
  1689. 0xE0,
  1690. 0xF,
  1691. 0xF8,
  1692. 6,
  1693. 0xC1,
  1694. 0xFE,
  1695. 1,
  1696. 0xFC,
  1697. 3,
  1698. 0xE0,
  1699. 0xF,
  1700. 0,
  1701. 0xFC};
  1702. ////////////////////////////////////////////////////////////////////////////////////////////
  1703. //
  1704. // Render
  1705. //
  1706. ////////////////////////////////////////////////////////////////////////////////////////////
  1707. unsigned char pitches[256]; // tab43008
  1708. unsigned char frequency1[256];
  1709. unsigned char frequency2[256];
  1710. unsigned char frequency3[256];
  1711. unsigned char amplitude1[256];
  1712. unsigned char amplitude2[256];
  1713. unsigned char amplitude3[256];
  1714. unsigned char sampledConsonantFlag[256]; // tab44800
  1715. ////////////////////////////////////////////////////////////////////////////////////////////
  1716. //
  1717. // Sam
  1718. //
  1719. ////////////////////////////////////////////////////////////////////////////////////////////
  1720. unsigned char stress[256]; //numbers from 0 to 8
  1721. unsigned char phonemeLength[256]; //tab40160
  1722. unsigned char phonemeindex[256];
  1723. ////////////////////////////////////////////////////////////////////////////////////////////
  1724. //
  1725. // ReciterTabs
  1726. //
  1727. ////////////////////////////////////////////////////////////////////////////////////////////
  1728. //some flags
  1729. const unsigned char tab36376[] = {
  1730. 0, 0, 0, 0, 0, 0, 0, 0, // 0-7
  1731. 0, 0, 0, 0, 0, 0, 0, 0, // 8-15
  1732. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  1733. 0, 2, 2, 2, 2, 2, 2, 130, // ' ', '!'
  1734. 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
  1735. 3, 3, 2, 2, 2, 2, 2, 2, 2, 192, 168, 176, 172, 192, 160, 184, // '@', 'A'
  1736. 160, 192, 188, 160, 172, 168, 172, 192, 160, 160, 172, 180, 164, 192, 168, 168,
  1737. 176, 192, 188, 0, 0, 0, 2, 0, // 'X', 'Y', 'Z', '[',
  1738. 32, 32, 155, 32, 192, 185, 32, 205, 163, 76, 138, 142};
  1739. const unsigned char rules[] = {
  1740. ']', 'A' | 0x80, ' ', '(', 'A', '.', ')', '=',
  1741. 'E', 'H', '4', 'Y', '.', ' ' | 0x80, '(', 'A',
  1742. ')', ' ', '=', 'A', 'H' | 0x80, ' ', '(', 'A',
  1743. 'R', 'E', ')', ' ', '=', 'A', 'A', 'R' | 0x80,
  1744. ' ', '(', 'A', 'R', ')', 'O', '=', 'A',
  1745. 'X', 'R' | 0x80, '(', 'A', 'R', ')', '#', '=',
  1746. 'E', 'H', '4', 'R' | 0x80, ' ', '^', '(', 'A',
  1747. 'S', ')', '#', '=', 'E', 'Y', '4', 'S' | 0x80,
  1748. '(', 'A', ')', 'W', 'A', '=', 'A', 'X' | 0x80,
  1749. '(', 'A', 'W', ')', '=', 'A', 'O', '5' | 0x80,
  1750. ' ', ':', '(', 'A', 'N', 'Y', ')', '=',
  1751. 'E', 'H', '4', 'N', 'I', 'Y' | 0x80, '(', 'A',
  1752. ')', '^', '+', '#', '=', 'E', 'Y', '5' | 0x80,
  1753. '#', ':', '(', 'A', 'L', 'L', 'Y', ')',
  1754. '=', 'U', 'L', 'I', 'Y' | 0x80, ' ', '(', 'A',
  1755. 'L', ')', '#', '=', 'U', 'L' | 0x80, '(', 'A',
  1756. 'G', 'A', 'I', 'N', ')', '=', 'A', 'X',
  1757. 'G', 'E', 'H', '4', 'N' | 0x80, '#', ':', '(',
  1758. 'A', 'G', ')', 'E', '=', 'I', 'H', 'J' | 0x80,
  1759. '(', 'A', ')', '^', '%', '=', 'E', 'Y' | 0x80,
  1760. '(', 'A', ')', '^', '+', ':', '#', '=',
  1761. 'A', 'E' | 0x80, ' ', ':', '(', 'A', ')', '^',
  1762. '+', ' ', '=', 'E', 'Y', '4' | 0x80, ' ', '(',
  1763. 'A', 'R', 'R', ')', '=', 'A', 'X', 'R' | 0x80,
  1764. '(', 'A', 'R', 'R', ')', '=', 'A', 'E',
  1765. '4', 'R' | 0x80, ' ', '^', '(', 'A', 'R', ')',
  1766. ' ', '=', 'A', 'A', '5', 'R' | 0x80, '(', 'A',
  1767. 'R', ')', '=', 'A', 'A', '5', 'R' | 0x80, '(',
  1768. 'A', 'I', 'R', ')', '=', 'E', 'H', '4',
  1769. 'R' | 0x80, '(', 'A', 'I', ')', '=', 'E', 'Y',
  1770. '4' | 0x80, '(', 'A', 'Y', ')', '=', 'E', 'Y',
  1771. '5' | 0x80, '(', 'A', 'U', ')', '=', 'A', 'O',
  1772. '4' | 0x80, '#', ':', '(', 'A', 'L', ')', ' ',
  1773. '=', 'U', 'L' | 0x80, '#', ':', '(', 'A', 'L',
  1774. 'S', ')', ' ', '=', 'U', 'L', 'Z' | 0x80, '(',
  1775. 'A', 'L', 'K', ')', '=', 'A', 'O', '4',
  1776. 'K' | 0x80, '(', 'A', 'L', ')', '^', '=', 'A',
  1777. 'O', 'L' | 0x80, ' ', ':', '(', 'A', 'B', 'L',
  1778. 'E', ')', '=', 'E', 'Y', '4', 'B', 'U',
  1779. 'L' | 0x80, '(', 'A', 'B', 'L', 'E', ')', '=',
  1780. 'A', 'X', 'B', 'U', 'L' | 0x80, '(', 'A', ')',
  1781. 'V', 'O', '=', 'E', 'Y', '4' | 0x80, '(', 'A',
  1782. 'N', 'G', ')', '+', '=', 'E', 'Y', '4',
  1783. 'N', 'J' | 0x80, '(', 'A', 'T', 'A', 'R', 'I',
  1784. ')', '=', 'A', 'H', 'T', 'A', 'A', '4',
  1785. 'R', 'I', 'Y' | 0x80, '(', 'A', ')', 'T', 'O',
  1786. 'M', '=', 'A', 'E' | 0x80, '(', 'A', ')', 'T',
  1787. 'T', 'I', '=', 'A', 'E' | 0x80, ' ', '(', 'A',
  1788. 'T', ')', ' ', '=', 'A', 'E', 'T' | 0x80, ' ',
  1789. '(', 'A', ')', 'T', '=', 'A', 'H' | 0x80, '(',
  1790. 'A', ')', '=', 'A', 'E' | 0x80,
  1791. ']', 'B' | 0x80, ' ', '(', 'B', ')', ' ', '=',
  1792. 'B', 'I', 'Y', '4' | 0x80, ' ', '(', 'B', 'E',
  1793. ')', '^', '#', '=', 'B', 'I', 'H' | 0x80, '(',
  1794. 'B', 'E', 'I', 'N', 'G', ')', '=', 'B',
  1795. 'I', 'Y', '4', 'I', 'H', 'N', 'X' | 0x80, ' ',
  1796. '(', 'B', 'O', 'T', 'H', ')', ' ', '=',
  1797. 'B', 'O', 'W', '4', 'T', 'H' | 0x80, ' ', '(',
  1798. 'B', 'U', 'S', ')', '#', '=', 'B', 'I',
  1799. 'H', '4', 'Z' | 0x80, '(', 'B', 'R', 'E', 'A',
  1800. 'K', ')', '=', 'B', 'R', 'E', 'Y', '5',
  1801. 'K' | 0x80, '(', 'B', 'U', 'I', 'L', ')', '=',
  1802. 'B', 'I', 'H', '4', 'L' | 0x80, '(', 'B', ')',
  1803. '=', 'B' | 0x80,
  1804. ']', 'C' | 0x80, ' ', '(', 'C', ')', ' ', '=',
  1805. 'S', 'I', 'Y', '4' | 0x80, ' ', '(', 'C', 'H',
  1806. ')', '^', '=', 'K' | 0x80, '^', 'E', '(', 'C',
  1807. 'H', ')', '=', 'K' | 0x80, '(', 'C', 'H', 'A',
  1808. ')', 'R', '#', '=', 'K', 'E', 'H', '5' | 0x80,
  1809. '(', 'C', 'H', ')', '=', 'C', 'H' | 0x80, ' ',
  1810. 'S', '(', 'C', 'I', ')', '#', '=', 'S',
  1811. 'A', 'Y', '4' | 0x80, '(', 'C', 'I', ')', 'A',
  1812. '=', 'S', 'H' | 0x80, '(', 'C', 'I', ')', 'O',
  1813. '=', 'S', 'H' | 0x80, '(', 'C', 'I', ')', 'E',
  1814. 'N', '=', 'S', 'H' | 0x80, '(', 'C', 'I', 'T',
  1815. 'Y', ')', '=', 'S', 'I', 'H', 'T', 'I',
  1816. 'Y' | 0x80, '(', 'C', ')', '+', '=', 'S' | 0x80, '(',
  1817. 'C', 'K', ')', '=', 'K' | 0x80, '(', 'C', 'O',
  1818. 'M', 'M', 'O', 'D', 'O', 'R', 'E', ')',
  1819. '=', 'K', 'A', 'A', '4', 'M', 'A', 'H',
  1820. 'D', 'O', 'H', 'R' | 0x80, '(', 'C', 'O', 'M',
  1821. ')', '=', 'K', 'A', 'H', 'M' | 0x80, '(', 'C',
  1822. 'U', 'I', 'T', ')', '=', 'K', 'I', 'H',
  1823. 'T' | 0x80, '(', 'C', 'R', 'E', 'A', ')', '=',
  1824. 'K', 'R', 'I', 'Y', 'E', 'Y' | 0x80, '(', 'C',
  1825. ')', '=', 'K' | 0x80,
  1826. ']', 'D' | 0x80, ' ', '(', 'D', ')', ' ', '=',
  1827. 'D', 'I', 'Y', '4' | 0x80, ' ', '(', 'D', 'R',
  1828. '.', ')', ' ', '=', 'D', 'A', 'A', '4',
  1829. 'K', 'T', 'E', 'R' | 0x80, '#', ':', '(', 'D',
  1830. 'E', 'D', ')', ' ', '=', 'D', 'I', 'H',
  1831. 'D' | 0x80, '.', 'E', '(', 'D', ')', ' ', '=',
  1832. 'D' | 0x80, '#', ':', '^', 'E', '(', 'D', ')',
  1833. ' ', '=', 'T' | 0x80, ' ', '(', 'D', 'E', ')',
  1834. '^', '#', '=', 'D', 'I', 'H' | 0x80, ' ', '(',
  1835. 'D', 'O', ')', ' ', '=', 'D', 'U', 'W' | 0x80,
  1836. ' ', '(', 'D', 'O', 'E', 'S', ')', '=',
  1837. 'D', 'A', 'H', 'Z' | 0x80, '(', 'D', 'O', 'N',
  1838. 'E', ')', ' ', '=', 'D', 'A', 'H', '5',
  1839. 'N' | 0x80, '(', 'D', 'O', 'I', 'N', 'G', ')',
  1840. '=', 'D', 'U', 'W', '4', 'I', 'H', 'N',
  1841. 'X' | 0x80, ' ', '(', 'D', 'O', 'W', ')', '=',
  1842. 'D', 'A', 'W' | 0x80, '#', '(', 'D', 'U', ')',
  1843. 'A', '=', 'J', 'U', 'W' | 0x80, '#', '(', 'D',
  1844. 'U', ')', '^', '#', '=', 'J', 'A', 'X' | 0x80,
  1845. '(', 'D', ')', '=', 'D' | 0x80,
  1846. ']', 'E' | 0x80, ' ', '(', 'E', ')', ' ', '=',
  1847. 'I', 'Y', 'I', 'Y', '4' | 0x80, '#', ':', '(',
  1848. 'E', ')', ' ', '=' | 0x80, '\'', ':', '^', '(',
  1849. 'E', ')', ' ', '=' | 0x80, ' ', ':', '(', 'E',
  1850. ')', ' ', '=', 'I', 'Y' | 0x80, '#', '(', 'E',
  1851. 'D', ')', ' ', '=', 'D' | 0x80, '#', ':', '(',
  1852. 'E', ')', 'D', ' ', '=' | 0x80, '(', 'E', 'V',
  1853. ')', 'E', 'R', '=', 'E', 'H', '4', 'V' | 0x80,
  1854. '(', 'E', ')', '^', '%', '=', 'I', 'Y',
  1855. '4' | 0x80, '(', 'E', 'R', 'I', ')', '#', '=',
  1856. 'I', 'Y', '4', 'R', 'I', 'Y' | 0x80, '(', 'E',
  1857. 'R', 'I', ')', '=', 'E', 'H', '4', 'R',
  1858. 'I', 'H' | 0x80, '#', ':', '(', 'E', 'R', ')',
  1859. '#', '=', 'E', 'R' | 0x80, '(', 'E', 'R', 'R',
  1860. 'O', 'R', ')', '=', 'E', 'H', '4', 'R',
  1861. 'O', 'H', 'R' | 0x80, '(', 'E', 'R', 'A', 'S',
  1862. 'E', ')', '=', 'I', 'H', 'R', 'E', 'Y',
  1863. '5', 'S' | 0x80, '(', 'E', 'R', ')', '#', '=',
  1864. 'E', 'H', 'R' | 0x80, '(', 'E', 'R', ')', '=',
  1865. 'E', 'R' | 0x80, ' ', '(', 'E', 'V', 'E', 'N',
  1866. ')', '=', 'I', 'Y', 'V', 'E', 'H', 'N' | 0x80,
  1867. '#', ':', '(', 'E', ')', 'W', '=' | 0x80, '@',
  1868. '(', 'E', 'W', ')', '=', 'U', 'W' | 0x80, '(',
  1869. 'E', 'W', ')', '=', 'Y', 'U', 'W' | 0x80, '(',
  1870. 'E', ')', 'O', '=', 'I', 'Y' | 0x80, '#', ':',
  1871. '&', '(', 'E', 'S', ')', ' ', '=', 'I',
  1872. 'H', 'Z' | 0x80, '#', ':', '(', 'E', ')', 'S',
  1873. ' ', '=' | 0x80, '#', ':', '(', 'E', 'L', 'Y',
  1874. ')', ' ', '=', 'L', 'I', 'Y' | 0x80, '#', ':',
  1875. '(', 'E', 'M', 'E', 'N', 'T', ')', '=',
  1876. 'M', 'E', 'H', 'N', 'T' | 0x80, '(', 'E', 'F',
  1877. 'U', 'L', ')', '=', 'F', 'U', 'H', 'L' | 0x80,
  1878. '(', 'E', 'E', ')', '=', 'I', 'Y', '4' | 0x80,
  1879. '(', 'E', 'A', 'R', 'N', ')', '=', 'E',
  1880. 'R', '5', 'N' | 0x80, ' ', '(', 'E', 'A', 'R',
  1881. ')', '^', '=', 'E', 'R', '5' | 0x80, '(', 'E',
  1882. 'A', 'D', ')', '=', 'E', 'H', 'D' | 0x80, '#',
  1883. ':', '(', 'E', 'A', ')', ' ', '=', 'I',
  1884. 'Y', 'A', 'X' | 0x80, '(', 'E', 'A', ')', 'S',
  1885. 'U', '=', 'E', 'H', '5' | 0x80, '(', 'E', 'A',
  1886. ')', '=', 'I', 'Y', '5' | 0x80, '(', 'E', 'I',
  1887. 'G', 'H', ')', '=', 'E', 'Y', '4' | 0x80, '(',
  1888. 'E', 'I', ')', '=', 'I', 'Y', '4' | 0x80, ' ',
  1889. '(', 'E', 'Y', 'E', ')', '=', 'A', 'Y',
  1890. '4' | 0x80, '(', 'E', 'Y', ')', '=', 'I', 'Y' | 0x80,
  1891. '(', 'E', 'U', ')', '=', 'Y', 'U', 'W',
  1892. '5' | 0x80, '(', 'E', 'Q', 'U', 'A', 'L', ')',
  1893. '=', 'I', 'Y', '4', 'K', 'W', 'U', 'L' | 0x80,
  1894. '(', 'E', ')', '=', 'E', 'H' | 0x80,
  1895. ']', 'F' | 0x80, ' ', '(', 'F', ')', ' ', '=',
  1896. 'E', 'H', '4', 'F' | 0x80, '(', 'F', 'U', 'L',
  1897. ')', '=', 'F', 'U', 'H', 'L' | 0x80, '(', 'F',
  1898. 'R', 'I', 'E', 'N', 'D', ')', '=', 'F',
  1899. 'R', 'E', 'H', '5', 'N', 'D' | 0x80, '(', 'F',
  1900. 'A', 'T', 'H', 'E', 'R', ')', '=', 'F',
  1901. 'A', 'A', '4', 'D', 'H', 'E', 'R' | 0x80, '(',
  1902. 'F', ')', 'F', '=' | 0x80, '(', 'F', ')', '=',
  1903. 'F' | 0x80,
  1904. ']', 'G' | 0x80, ' ', '(', 'G', ')', ' ', '=',
  1905. 'J', 'I', 'Y', '4' | 0x80, '(', 'G', 'I', 'V',
  1906. ')', '=', 'G', 'I', 'H', '5', 'V' | 0x80, ' ',
  1907. '(', 'G', ')', 'I', '^', '=', 'G' | 0x80, '(',
  1908. 'G', 'E', ')', 'T', '=', 'G', 'E', 'H',
  1909. '5' | 0x80, 'S', 'U', '(', 'G', 'G', 'E', 'S',
  1910. ')', '=', 'G', 'J', 'E', 'H', '4', 'S' | 0x80,
  1911. '(', 'G', 'G', ')', '=', 'G' | 0x80, ' ', 'B',
  1912. '#', '(', 'G', ')', '=', 'G' | 0x80, '(', 'G',
  1913. ')', '+', '=', 'J' | 0x80, '(', 'G', 'R', 'E',
  1914. 'A', 'T', ')', '=', 'G', 'R', 'E', 'Y',
  1915. '4', 'T' | 0x80, '(', 'G', 'O', 'N', ')', 'E',
  1916. '=', 'G', 'A', 'O', '5', 'N' | 0x80, '#', '(',
  1917. 'G', 'H', ')', '=' | 0x80, ' ', '(', 'G', 'N',
  1918. ')', '=', 'N' | 0x80, '(', 'G', ')', '=', 'G' | 0x80,
  1919. ']', 'H' | 0x80, ' ', '(', 'H', ')', ' ', '=',
  1920. 'E', 'Y', '4', 'C', 'H' | 0x80, ' ', '(', 'H',
  1921. 'A', 'V', ')', '=', '/', 'H', 'A', 'E',
  1922. '6', 'V' | 0x80, ' ', '(', 'H', 'E', 'R', 'E',
  1923. ')', '=', '/', 'H', 'I', 'Y', 'R' | 0x80, ' ',
  1924. '(', 'H', 'O', 'U', 'R', ')', '=', 'A',
  1925. 'W', '5', 'E', 'R' | 0x80, '(', 'H', 'O', 'W',
  1926. ')', '=', '/', 'H', 'A', 'W' | 0x80, '(', 'H',
  1927. ')', '#', '=', '/', 'H' | 0x80, '(', 'H', ')',
  1928. '=' | 0x80,
  1929. ']', 'I' | 0x80, ' ', '(', 'I', 'N', ')', '=',
  1930. 'I', 'H', 'N' | 0x80, ' ', '(', 'I', ')', ' ',
  1931. '=', 'A', 'Y', '4' | 0x80, '(', 'I', ')', ' ',
  1932. '=', 'A', 'Y' | 0x80, '(', 'I', 'N', ')', 'D',
  1933. '=', 'A', 'Y', '5', 'N' | 0x80, 'S', 'E', 'M',
  1934. '(', 'I', ')', '=', 'I', 'Y' | 0x80, ' ', 'A',
  1935. 'N', 'T', '(', 'I', ')', '=', 'A', 'Y' | 0x80,
  1936. '(', 'I', 'E', 'R', ')', '=', 'I', 'Y',
  1937. 'E', 'R' | 0x80, '#', ':', 'R', '(', 'I', 'E',
  1938. 'D', ')', ' ', '=', 'I', 'Y', 'D' | 0x80, '(',
  1939. 'I', 'E', 'D', ')', ' ', '=', 'A', 'Y',
  1940. '5', 'D' | 0x80, '(', 'I', 'E', 'N', ')', '=',
  1941. 'I', 'Y', 'E', 'H', 'N' | 0x80, '(', 'I', 'E',
  1942. ')', 'T', '=', 'A', 'Y', '4', 'E', 'H' | 0x80,
  1943. '(', 'I', '\'', ')', '=', 'A', 'Y', '5' | 0x80,
  1944. ' ', ':', '(', 'I', ')', '^', '%', '=',
  1945. 'A', 'Y', '5' | 0x80, ' ', ':', '(', 'I', 'E',
  1946. ')', ' ', '=', 'A', 'Y', '4' | 0x80, '(', 'I',
  1947. ')', '%', '=', 'I', 'Y' | 0x80, '(', 'I', 'E',
  1948. ')', '=', 'I', 'Y', '4' | 0x80, ' ', '(', 'I',
  1949. 'D', 'E', 'A', ')', '=', 'A', 'Y', 'D',
  1950. 'I', 'Y', '5', 'A', 'H' | 0x80, '(', 'I', ')',
  1951. '^', '+', ':', '#', '=', 'I', 'H' | 0x80, '(',
  1952. 'I', 'R', ')', '#', '=', 'A', 'Y', 'R' | 0x80,
  1953. '(', 'I', 'Z', ')', '%', '=', 'A', 'Y',
  1954. 'Z' | 0x80, '(', 'I', 'S', ')', '%', '=', 'A',
  1955. 'Y', 'Z' | 0x80, 'I', '^', '(', 'I', ')', '^',
  1956. '#', '=', 'I', 'H' | 0x80, '+', '^', '(', 'I',
  1957. ')', '^', '+', '=', 'A', 'Y' | 0x80, '#', ':',
  1958. '^', '(', 'I', ')', '^', '+', '=', 'I',
  1959. 'H' | 0x80, '(', 'I', ')', '^', '+', '=', 'A',
  1960. 'Y' | 0x80, '(', 'I', 'R', ')', '=', 'E', 'R' | 0x80,
  1961. '(', 'I', 'G', 'H', ')', '=', 'A', 'Y',
  1962. '4' | 0x80, '(', 'I', 'L', 'D', ')', '=', 'A',
  1963. 'Y', '5', 'L', 'D' | 0x80, ' ', '(', 'I', 'G',
  1964. 'N', ')', '=', 'I', 'H', 'G', 'N' | 0x80, '(',
  1965. 'I', 'G', 'N', ')', ' ', '=', 'A', 'Y',
  1966. '4', 'N' | 0x80, '(', 'I', 'G', 'N', ')', '^',
  1967. '=', 'A', 'Y', '4', 'N' | 0x80, '(', 'I', 'G',
  1968. 'N', ')', '%', '=', 'A', 'Y', '4', 'N' | 0x80,
  1969. '(', 'I', 'C', 'R', 'O', ')', '=', 'A',
  1970. 'Y', '4', 'K', 'R', 'O', 'H' | 0x80, '(', 'I',
  1971. 'Q', 'U', 'E', ')', '=', 'I', 'Y', '4',
  1972. 'K' | 0x80, '(', 'I', ')', '=', 'I', 'H' | 0x80,
  1973. ']', 'J' | 0x80, ' ', '(', 'J', ')', ' ', '=',
  1974. 'J', 'E', 'Y', '4' | 0x80, '(', 'J', ')', '=',
  1975. 'J' | 0x80,
  1976. ']', 'K' | 0x80, ' ', '(', 'K', ')', ' ', '=',
  1977. 'K', 'E', 'Y', '4' | 0x80, ' ', '(', 'K', ')',
  1978. 'N', '=' | 0x80, '(', 'K', ')', '=', 'K' | 0x80,
  1979. ']', 'L' | 0x80, ' ', '(', 'L', ')', ' ', '=',
  1980. 'E', 'H', '4', 'L' | 0x80, '(', 'L', 'O', ')',
  1981. 'C', '#', '=', 'L', 'O', 'W' | 0x80, 'L', '(',
  1982. 'L', ')', '=' | 0x80, '#', ':', '^', '(', 'L',
  1983. ')', '%', '=', 'U', 'L' | 0x80, '(', 'L', 'E',
  1984. 'A', 'D', ')', '=', 'L', 'I', 'Y', 'D' | 0x80,
  1985. ' ', '(', 'L', 'A', 'U', 'G', 'H', ')',
  1986. '=', 'L', 'A', 'E', '4', 'F' | 0x80, '(', 'L',
  1987. ')', '=', 'L' | 0x80,
  1988. ']', 'M' | 0x80, ' ', '(', 'M', ')', ' ', '=',
  1989. 'E', 'H', '4', 'M' | 0x80, ' ', '(', 'M', 'R',
  1990. '.', ')', ' ', '=', 'M', 'I', 'H', '4',
  1991. 'S', 'T', 'E', 'R' | 0x80, ' ', '(', 'M', 'S',
  1992. '.', ')', '=', 'M', 'I', 'H', '5', 'Z' | 0x80,
  1993. ' ', '(', 'M', 'R', 'S', '.', ')', ' ',
  1994. '=', 'M', 'I', 'H', '4', 'S', 'I', 'X',
  1995. 'Z' | 0x80, '(', 'M', 'O', 'V', ')', '=', 'M',
  1996. 'U', 'W', '4', 'V' | 0x80, '(', 'M', 'A', 'C',
  1997. 'H', 'I', 'N', ')', '=', 'M', 'A', 'H',
  1998. 'S', 'H', 'I', 'Y', '5', 'N' | 0x80, 'M', '(',
  1999. 'M', ')', '=' | 0x80, '(', 'M', ')', '=', 'M' | 0x80,
  2000. ']', 'N' | 0x80, ' ', '(', 'N', ')', ' ', '=',
  2001. 'E', 'H', '4', 'N' | 0x80, 'E', '(', 'N', 'G',
  2002. ')', '+', '=', 'N', 'J' | 0x80, '(', 'N', 'G',
  2003. ')', 'R', '=', 'N', 'X', 'G' | 0x80, '(', 'N',
  2004. 'G', ')', '#', '=', 'N', 'X', 'G' | 0x80, '(',
  2005. 'N', 'G', 'L', ')', '%', '=', 'N', 'X',
  2006. 'G', 'U', 'L' | 0x80, '(', 'N', 'G', ')', '=',
  2007. 'N', 'X' | 0x80, '(', 'N', 'K', ')', '=', 'N',
  2008. 'X', 'K' | 0x80, ' ', '(', 'N', 'O', 'W', ')',
  2009. ' ', '=', 'N', 'A', 'W', '4' | 0x80, 'N', '(',
  2010. 'N', ')', '=' | 0x80, '(', 'N', 'O', 'N', ')',
  2011. 'E', '=', 'N', 'A', 'H', '4', 'N' | 0x80, '(',
  2012. 'N', ')', '=', 'N' | 0x80,
  2013. ']', 'O' | 0x80, ' ', '(', 'O', ')', ' ', '=',
  2014. 'O', 'H', '4', 'W' | 0x80, '(', 'O', 'F', ')',
  2015. ' ', '=', 'A', 'H', 'V' | 0x80, ' ', '(', 'O',
  2016. 'H', ')', ' ', '=', 'O', 'W', '5' | 0x80, '(',
  2017. 'O', 'R', 'O', 'U', 'G', 'H', ')', '=',
  2018. 'E', 'R', '4', 'O', 'W' | 0x80, '#', ':', '(',
  2019. 'O', 'R', ')', ' ', '=', 'E', 'R' | 0x80, '#',
  2020. ':', '(', 'O', 'R', 'S', ')', ' ', '=',
  2021. 'E', 'R', 'Z' | 0x80, '(', 'O', 'R', ')', '=',
  2022. 'A', 'O', 'R' | 0x80, ' ', '(', 'O', 'N', 'E',
  2023. ')', '=', 'W', 'A', 'H', 'N' | 0x80, '#', '(',
  2024. 'O', 'N', 'E', ')', ' ', '=', 'W', 'A',
  2025. 'H', 'N' | 0x80, '(', 'O', 'W', ')', '=', 'O',
  2026. 'W' | 0x80, ' ', '(', 'O', 'V', 'E', 'R', ')',
  2027. '=', 'O', 'W', '5', 'V', 'E', 'R' | 0x80, 'P',
  2028. 'R', '(', 'O', ')', 'V', '=', 'U', 'W',
  2029. '4' | 0x80, '(', 'O', 'V', ')', '=', 'A', 'H',
  2030. '4', 'V' | 0x80, '(', 'O', ')', '^', '%', '=',
  2031. 'O', 'W', '5' | 0x80, '(', 'O', ')', '^', 'E',
  2032. 'N', '=', 'O', 'W' | 0x80, '(', 'O', ')', '^',
  2033. 'I', '#', '=', 'O', 'W', '5' | 0x80, '(', 'O',
  2034. 'L', ')', 'D', '=', 'O', 'W', '4', 'L' | 0x80,
  2035. '(', 'O', 'U', 'G', 'H', 'T', ')', '=',
  2036. 'A', 'O', '5', 'T' | 0x80, '(', 'O', 'U', 'G',
  2037. 'H', ')', '=', 'A', 'H', '5', 'F' | 0x80, ' ',
  2038. '(', 'O', 'U', ')', '=', 'A', 'W' | 0x80, 'H',
  2039. '(', 'O', 'U', ')', 'S', '#', '=', 'A',
  2040. 'W', '4' | 0x80, '(', 'O', 'U', 'S', ')', '=',
  2041. 'A', 'X', 'S' | 0x80, '(', 'O', 'U', 'R', ')',
  2042. '=', 'O', 'H', 'R' | 0x80, '(', 'O', 'U', 'L',
  2043. 'D', ')', '=', 'U', 'H', '5', 'D' | 0x80, '(',
  2044. 'O', 'U', ')', '^', 'L', '=', 'A', 'H',
  2045. '5' | 0x80, '(', 'O', 'U', 'P', ')', '=', 'U',
  2046. 'W', '5', 'P' | 0x80, '(', 'O', 'U', ')', '=',
  2047. 'A', 'W' | 0x80, '(', 'O', 'Y', ')', '=', 'O',
  2048. 'Y' | 0x80, '(', 'O', 'I', 'N', 'G', ')', '=',
  2049. 'O', 'W', '4', 'I', 'H', 'N', 'X' | 0x80, '(',
  2050. 'O', 'I', ')', '=', 'O', 'Y', '5' | 0x80, '(',
  2051. 'O', 'O', 'R', ')', '=', 'O', 'H', '5',
  2052. 'R' | 0x80, '(', 'O', 'O', 'K', ')', '=', 'U',
  2053. 'H', '5', 'K' | 0x80, 'F', '(', 'O', 'O', 'D',
  2054. ')', '=', 'U', 'W', '5', 'D' | 0x80, 'L', '(',
  2055. 'O', 'O', 'D', ')', '=', 'A', 'H', '5',
  2056. 'D' | 0x80, 'M', '(', 'O', 'O', 'D', ')', '=',
  2057. 'U', 'W', '5', 'D' | 0x80, '(', 'O', 'O', 'D',
  2058. ')', '=', 'U', 'H', '5', 'D' | 0x80, 'F', '(',
  2059. 'O', 'O', 'T', ')', '=', 'U', 'H', '5',
  2060. 'T' | 0x80, '(', 'O', 'O', ')', '=', 'U', 'W',
  2061. '5' | 0x80, '(', 'O', '\'', ')', '=', 'O', 'H' | 0x80,
  2062. '(', 'O', ')', 'E', '=', 'O', 'W' | 0x80, '(',
  2063. 'O', ')', ' ', '=', 'O', 'W' | 0x80, '(', 'O',
  2064. 'A', ')', '=', 'O', 'W', '4' | 0x80, ' ', '(',
  2065. 'O', 'N', 'L', 'Y', ')', '=', 'O', 'W',
  2066. '4', 'N', 'L', 'I', 'Y' | 0x80, ' ', '(', 'O',
  2067. 'N', 'C', 'E', ')', '=', 'W', 'A', 'H',
  2068. '4', 'N', 'S' | 0x80, '(', 'O', 'N', '\'', 'T',
  2069. ')', '=', 'O', 'W', '4', 'N', 'T' | 0x80, 'C',
  2070. '(', 'O', ')', 'N', '=', 'A', 'A' | 0x80, '(',
  2071. 'O', ')', 'N', 'G', '=', 'A', 'O' | 0x80, ' ',
  2072. ':', '^', '(', 'O', ')', 'N', '=', 'A',
  2073. 'H' | 0x80, 'I', '(', 'O', 'N', ')', '=', 'U',
  2074. 'N' | 0x80, '#', ':', '(', 'O', 'N', ')', '=',
  2075. 'U', 'N' | 0x80, '#', '^', '(', 'O', 'N', ')',
  2076. '=', 'U', 'N' | 0x80, '(', 'O', ')', 'S', 'T',
  2077. '=', 'O', 'W' | 0x80, '(', 'O', 'F', ')', '^',
  2078. '=', 'A', 'O', '4', 'F' | 0x80, '(', 'O', 'T',
  2079. 'H', 'E', 'R', ')', '=', 'A', 'H', '5',
  2080. 'D', 'H', 'E', 'R' | 0x80, 'R', '(', 'O', ')',
  2081. 'B', '=', 'R', 'A', 'A' | 0x80, '^', 'R', '(',
  2082. 'O', ')', ':', '#', '=', 'O', 'W', '5' | 0x80,
  2083. '(', 'O', 'S', 'S', ')', ' ', '=', 'A',
  2084. 'O', '5', 'S' | 0x80, '#', ':', '^', '(', 'O',
  2085. 'M', ')', '=', 'A', 'H', 'M' | 0x80, '(', 'O',
  2086. ')', '=', 'A', 'A' | 0x80,
  2087. ']', 'P' | 0x80, ' ', '(', 'P', ')', ' ', '=',
  2088. 'P', 'I', 'Y', '4' | 0x80, '(', 'P', 'H', ')',
  2089. '=', 'F' | 0x80, '(', 'P', 'E', 'O', 'P', 'L',
  2090. ')', '=', 'P', 'I', 'Y', '5', 'P', 'U',
  2091. 'L' | 0x80, '(', 'P', 'O', 'W', ')', '=', 'P',
  2092. 'A', 'W', '4' | 0x80, '(', 'P', 'U', 'T', ')',
  2093. ' ', '=', 'P', 'U', 'H', 'T' | 0x80, '(', 'P',
  2094. ')', 'P', '=' | 0x80, '(', 'P', ')', 'S', '=' | 0x80,
  2095. '(', 'P', ')', 'N', '=' | 0x80, '(', 'P', 'R',
  2096. 'O', 'F', '.', ')', '=', 'P', 'R', 'O',
  2097. 'H', 'F', 'E', 'H', '4', 'S', 'E', 'R' | 0x80,
  2098. '(', 'P', ')', '=', 'P' | 0x80,
  2099. ']', 'Q' | 0x80, ' ', '(', 'Q', ')', ' ', '=',
  2100. 'K', 'Y', 'U', 'W', '4' | 0x80, '(', 'Q', 'U',
  2101. 'A', 'R', ')', '=', 'K', 'W', 'O', 'H',
  2102. '5', 'R' | 0x80, '(', 'Q', 'U', ')', '=', 'K',
  2103. 'W' | 0x80, '(', 'Q', ')', '=', 'K' | 0x80, ']', 'R' | 0x80,
  2104. ' ', '(', 'R', ')', ' ', '=', 'A', 'A',
  2105. '5', 'R' | 0x80, ' ', '(', 'R', 'E', ')', '^',
  2106. '#', '=', 'R', 'I', 'Y' | 0x80, '(', 'R', ')',
  2107. 'R', '=' | 0x80, '(', 'R', ')', '=', 'R' | 0x80,
  2108. ']', 'S' | 0x80, ' ', '(', 'S', ')', ' ', '=',
  2109. 'E', 'H', '4', 'S' | 0x80, '(', 'S', 'H', ')',
  2110. '=', 'S', 'H' | 0x80, '#', '(', 'S', 'I', 'O',
  2111. 'N', ')', '=', 'Z', 'H', 'U', 'N' | 0x80, '(',
  2112. 'S', 'O', 'M', 'E', ')', '=', 'S', 'A',
  2113. 'H', 'M' | 0x80, '#', '(', 'S', 'U', 'R', ')',
  2114. '#', '=', 'Z', 'H', 'E', 'R' | 0x80, '(', 'S',
  2115. 'U', 'R', ')', '#', '=', 'S', 'H', 'E',
  2116. 'R' | 0x80, '#', '(', 'S', 'U', ')', '#', '=',
  2117. 'Z', 'H', 'U', 'W' | 0x80, '#', '(', 'S', 'S',
  2118. 'U', ')', '#', '=', 'S', 'H', 'U', 'W' | 0x80,
  2119. '#', '(', 'S', 'E', 'D', ')', '=', 'Z',
  2120. 'D' | 0x80, '#', '(', 'S', ')', '#', '=', 'Z' | 0x80,
  2121. '(', 'S', 'A', 'I', 'D', ')', '=', 'S',
  2122. 'E', 'H', 'D' | 0x80, '^', '(', 'S', 'I', 'O',
  2123. 'N', ')', '=', 'S', 'H', 'U', 'N' | 0x80, '(',
  2124. 'S', ')', 'S', '=' | 0x80, '.', '(', 'S', ')',
  2125. ' ', '=', 'Z' | 0x80, '#', ':', '.', 'E', '(',
  2126. 'S', ')', ' ', '=', 'Z' | 0x80, '#', ':', '^',
  2127. '#', '(', 'S', ')', ' ', '=', 'S' | 0x80, 'U',
  2128. '(', 'S', ')', ' ', '=', 'S' | 0x80, ' ', ':',
  2129. '#', '(', 'S', ')', ' ', '=', 'Z' | 0x80, '#',
  2130. '#', '(', 'S', ')', ' ', '=', 'Z' | 0x80, ' ',
  2131. '(', 'S', 'C', 'H', ')', '=', 'S', 'K' | 0x80,
  2132. '(', 'S', ')', 'C', '+', '=' | 0x80, '#', '(',
  2133. 'S', 'M', ')', '=', 'Z', 'U', 'M' | 0x80, '#',
  2134. '(', 'S', 'N', ')', '\'', '=', 'Z', 'U',
  2135. 'M' | 0x80, '(', 'S', 'T', 'L', 'E', ')', '=',
  2136. 'S', 'U', 'L' | 0x80, '(', 'S', ')', '=', 'S' | 0x80,
  2137. ']', 'T' | 0x80, ' ', '(', 'T', ')', ' ', '=',
  2138. 'T', 'I', 'Y', '4' | 0x80, ' ', '(', 'T', 'H',
  2139. 'E', ')', ' ', '#', '=', 'D', 'H', 'I',
  2140. 'Y' | 0x80, ' ', '(', 'T', 'H', 'E', ')', ' ',
  2141. '=', 'D', 'H', 'A', 'X' | 0x80, '(', 'T', 'O',
  2142. ')', ' ', '=', 'T', 'U', 'X' | 0x80, ' ', '(',
  2143. 'T', 'H', 'A', 'T', ')', '=', 'D', 'H',
  2144. 'A', 'E', 'T' | 0x80, ' ', '(', 'T', 'H', 'I',
  2145. 'S', ')', ' ', '=', 'D', 'H', 'I', 'H',
  2146. 'S' | 0x80, ' ', '(', 'T', 'H', 'E', 'Y', ')',
  2147. '=', 'D', 'H', 'E', 'Y' | 0x80, ' ', '(', 'T',
  2148. 'H', 'E', 'R', 'E', ')', '=', 'D', 'H',
  2149. 'E', 'H', 'R' | 0x80, '(', 'T', 'H', 'E', 'R',
  2150. ')', '=', 'D', 'H', 'E', 'R' | 0x80, '(', 'T',
  2151. 'H', 'E', 'I', 'R', ')', '=', 'D', 'H',
  2152. 'E', 'H', 'R' | 0x80, ' ', '(', 'T', 'H', 'A',
  2153. 'N', ')', ' ', '=', 'D', 'H', 'A', 'E',
  2154. 'N' | 0x80, ' ', '(', 'T', 'H', 'E', 'M', ')',
  2155. ' ', '=', 'D', 'H', 'A', 'E', 'N' | 0x80, '(',
  2156. 'T', 'H', 'E', 'S', 'E', ')', ' ', '=',
  2157. 'D', 'H', 'I', 'Y', 'Z' | 0x80, ' ', '(', 'T',
  2158. 'H', 'E', 'N', ')', '=', 'D', 'H', 'E',
  2159. 'H', 'N' | 0x80, '(', 'T', 'H', 'R', 'O', 'U',
  2160. 'G', 'H', ')', '=', 'T', 'H', 'R', 'U',
  2161. 'W', '4' | 0x80, '(', 'T', 'H', 'O', 'S', 'E',
  2162. ')', '=', 'D', 'H', 'O', 'H', 'Z' | 0x80, '(',
  2163. 'T', 'H', 'O', 'U', 'G', 'H', ')', ' ',
  2164. '=', 'D', 'H', 'O', 'W' | 0x80, '(', 'T', 'O',
  2165. 'D', 'A', 'Y', ')', '=', 'T', 'U', 'X',
  2166. 'D', 'E', 'Y' | 0x80, '(', 'T', 'O', 'M', 'O',
  2167. ')', 'R', 'R', 'O', 'W', '=', 'T', 'U',
  2168. 'M', 'A', 'A', '5' | 0x80, '(', 'T', 'O', ')',
  2169. 'T', 'A', 'L', '=', 'T', 'O', 'W', '5' | 0x80,
  2170. ' ', '(', 'T', 'H', 'U', 'S', ')', '=',
  2171. 'D', 'H', 'A', 'H', '4', 'S' | 0x80, '(', 'T',
  2172. 'H', ')', '=', 'T', 'H' | 0x80, '#', ':', '(',
  2173. 'T', 'E', 'D', ')', '=', 'T', 'I', 'X',
  2174. 'D' | 0x80, 'S', '(', 'T', 'I', ')', '#', 'N',
  2175. '=', 'C', 'H' | 0x80, '(', 'T', 'I', ')', 'O',
  2176. '=', 'S', 'H' | 0x80, '(', 'T', 'I', ')', 'A',
  2177. '=', 'S', 'H' | 0x80, '(', 'T', 'I', 'E', 'N',
  2178. ')', '=', 'S', 'H', 'U', 'N' | 0x80, '(', 'T',
  2179. 'U', 'R', ')', '#', '=', 'C', 'H', 'E',
  2180. 'R' | 0x80, '(', 'T', 'U', ')', 'A', '=', 'C',
  2181. 'H', 'U', 'W' | 0x80, ' ', '(', 'T', 'W', 'O',
  2182. ')', '=', 'T', 'U', 'W' | 0x80, '&', '(', 'T',
  2183. ')', 'E', 'N', ' ', '=' | 0x80, '(', 'T', ')',
  2184. '=', 'T' | 0x80,
  2185. ']', 'U' | 0x80, ' ', '(', 'U', ')', ' ', '=',
  2186. 'Y', 'U', 'W', '4' | 0x80, ' ', '(', 'U', 'N',
  2187. ')', 'I', '=', 'Y', 'U', 'W', 'N' | 0x80, ' ',
  2188. '(', 'U', 'N', ')', '=', 'A', 'H', 'N' | 0x80,
  2189. ' ', '(', 'U', 'P', 'O', 'N', ')', '=',
  2190. 'A', 'X', 'P', 'A', 'O', 'N' | 0x80, '@', '(',
  2191. 'U', 'R', ')', '#', '=', 'U', 'H', '4',
  2192. 'R' | 0x80, '(', 'U', 'R', ')', '#', '=', 'Y',
  2193. 'U', 'H', '4', 'R' | 0x80, '(', 'U', 'R', ')',
  2194. '=', 'E', 'R' | 0x80, '(', 'U', ')', '^', ' ',
  2195. '=', 'A', 'H' | 0x80, '(', 'U', ')', '^', '^',
  2196. '=', 'A', 'H', '5' | 0x80, '(', 'U', 'Y', ')',
  2197. '=', 'A', 'Y', '5' | 0x80, ' ', 'G', '(', 'U',
  2198. ')', '#', '=' | 0x80, 'G', '(', 'U', ')', '%',
  2199. '=' | 0x80, 'G', '(', 'U', ')', '#', '=', 'W' | 0x80,
  2200. '#', 'N', '(', 'U', ')', '=', 'Y', 'U',
  2201. 'W' | 0x80, '@', '(', 'U', ')', '=', 'U', 'W' | 0x80,
  2202. '(', 'U', ')', '=', 'Y', 'U', 'W' | 0x80,
  2203. ']', 'V' | 0x80, ' ', '(', 'V', ')', ' ', '=',
  2204. 'V', 'I', 'Y', '4' | 0x80, '(', 'V', 'I', 'E',
  2205. 'W', ')', '=', 'V', 'Y', 'U', 'W', '5' | 0x80,
  2206. '(', 'V', ')', '=', 'V' | 0x80,
  2207. ']', 'W' | 0x80, ' ', '(', 'W', ')', ' ', '=',
  2208. 'D', 'A', 'H', '4', 'B', 'U', 'L', 'Y',
  2209. 'U', 'W' | 0x80, ' ', '(', 'W', 'E', 'R', 'E',
  2210. ')', '=', 'W', 'E', 'R' | 0x80, '(', 'W', 'A',
  2211. ')', 'S', 'H', '=', 'W', 'A', 'A' | 0x80, '(',
  2212. 'W', 'A', ')', 'S', 'T', '=', 'W', 'E',
  2213. 'Y' | 0x80, '(', 'W', 'A', ')', 'S', '=', 'W',
  2214. 'A', 'H' | 0x80, '(', 'W', 'A', ')', 'T', '=',
  2215. 'W', 'A', 'A' | 0x80, '(', 'W', 'H', 'E', 'R',
  2216. 'E', ')', '=', 'W', 'H', 'E', 'H', 'R' | 0x80,
  2217. '(', 'W', 'H', 'A', 'T', ')', '=', 'W',
  2218. 'H', 'A', 'H', 'T' | 0x80, '(', 'W', 'H', 'O',
  2219. 'L', ')', '=', '/', 'H', 'O', 'W', 'L' | 0x80,
  2220. '(', 'W', 'H', 'O', ')', '=', '/', 'H',
  2221. 'U', 'W' | 0x80, '(', 'W', 'H', ')', '=', 'W',
  2222. 'H' | 0x80, '(', 'W', 'A', 'R', ')', '#', '=',
  2223. 'W', 'E', 'H', 'R' | 0x80, '(', 'W', 'A', 'R',
  2224. ')', '=', 'W', 'A', 'O', 'R' | 0x80, '(', 'W',
  2225. 'O', 'R', ')', '^', '=', 'W', 'E', 'R' | 0x80,
  2226. '(', 'W', 'R', ')', '=', 'R' | 0x80, '(', 'W',
  2227. 'O', 'M', ')', 'A', '=', 'W', 'U', 'H',
  2228. 'M' | 0x80, '(', 'W', 'O', 'M', ')', 'E', '=',
  2229. 'W', 'I', 'H', 'M' | 0x80, '(', 'W', 'E', 'A',
  2230. ')', 'R', '=', 'W', 'E', 'H' | 0x80, '(', 'W',
  2231. 'A', 'N', 'T', ')', '=', 'W', 'A', 'A',
  2232. '5', 'N', 'T' | 0x80, 'A', 'N', 'S', '(', 'W',
  2233. 'E', 'R', ')', '=', 'E', 'R' | 0x80, '(', 'W',
  2234. ')', '=', 'W' | 0x80,
  2235. ']', 'X' | 0x80, ' ', '(', 'X', ')', ' ', '=',
  2236. 'E', 'H', '4', 'K', 'R' | 0x80, ' ', '(', 'X',
  2237. ')', '=', 'Z' | 0x80, '(', 'X', ')', '=', 'K',
  2238. 'S' | 0x80,
  2239. ']', 'Y' | 0x80, ' ', '(', 'Y', ')', ' ', '=',
  2240. 'W', 'A', 'Y', '4' | 0x80, '(', 'Y', 'O', 'U',
  2241. 'N', 'G', ')', '=', 'Y', 'A', 'H', 'N',
  2242. 'X' | 0x80, ' ', '(', 'Y', 'O', 'U', 'R', ')',
  2243. '=', 'Y', 'O', 'H', 'R' | 0x80, ' ', '(', 'Y',
  2244. 'O', 'U', ')', '=', 'Y', 'U', 'W' | 0x80, ' ',
  2245. '(', 'Y', 'E', 'S', ')', '=', 'Y', 'E',
  2246. 'H', 'S' | 0x80, ' ', '(', 'Y', ')', '=', 'Y' | 0x80,
  2247. 'F', '(', 'Y', ')', '=', 'A', 'Y' | 0x80, 'P',
  2248. 'S', '(', 'Y', 'C', 'H', ')', '=', 'A',
  2249. 'Y', 'K' | 0x80, '#', ':', '^', '(', 'Y', ')',
  2250. '=', 'I', 'Y' | 0x80, '#', ':', '^', '(', 'Y',
  2251. ')', 'I', '=', 'I', 'Y' | 0x80, ' ', ':', '(',
  2252. 'Y', ')', ' ', '=', 'A', 'Y' | 0x80, ' ', ':',
  2253. '(', 'Y', ')', '#', '=', 'A', 'Y' | 0x80, ' ',
  2254. ':', '(', 'Y', ')', '^', '+', ':', '#',
  2255. '=', 'I', 'H' | 0x80, ' ', ':', '(', 'Y', ')',
  2256. '^', '#', '=', 'A', 'Y' | 0x80, '(', 'Y', ')',
  2257. '=', 'I', 'H' | 0x80,
  2258. ']', 'Z' | 0x80, ' ', '(', 'Z', ')', ' ', '=',
  2259. 'Z', 'I', 'Y', '4' | 0x80, '(', 'Z', ')', '=',
  2260. 'Z' | 0x80, 'j' | 0x80};
  2261. const unsigned char rules2[] = {
  2262. '(', 'A', ')', '=' | 0x80, '(', '!', ')', '=',
  2263. '.' | 0x80, '(', '"', ')', ' ', '=', '-', 'A',
  2264. 'H', '5', 'N', 'K', 'W', 'O', 'W', 'T',
  2265. '-' | 0x80, '(', '"', ')', '=', 'K', 'W', 'O',
  2266. 'W', '4', 'T', '-' | 0x80, '(', '#', ')', '=',
  2267. ' ', 'N', 'A', 'H', '4', 'M', 'B', 'E',
  2268. 'R' | 0x80, '(', '$', ')', '=', ' ', 'D', 'A',
  2269. 'A', '4', 'L', 'E', 'R' | 0x80, '(', '%', ')',
  2270. '=', ' ', 'P', 'E', 'R', 'S', 'E', 'H',
  2271. '4', 'N', 'T' | 0x80, '(', '&', ')', '=', ' ',
  2272. 'A', 'E', 'N', 'D' | 0x80, '(', '\'', ')', '=' | 0x80,
  2273. '(', '*', ')', '=', ' ', 'A', 'E', '4',
  2274. 'S', 'T', 'E', 'R', 'I', 'H', 'S', 'K' | 0x80,
  2275. '(', '+', ')', '=', ' ', 'P', 'L', 'A',
  2276. 'H', '4', 'S' | 0x80, '(', ',', ')', '=', ',' | 0x80,
  2277. ' ', '(', '-', ')', ' ', '=', '-' | 0x80, '(',
  2278. '-', ')', '=' | 0x80, '(', '.', ')', '=', ' ',
  2279. 'P', 'O', 'Y', 'N', 'T' | 0x80, '(', '/', ')',
  2280. '=', ' ', 'S', 'L', 'A', 'E', '4', 'S',
  2281. 'H' | 0x80, '(', '0', ')', '=', ' ', 'Z', 'I',
  2282. 'Y', '4', 'R', 'O', 'W' | 0x80, ' ', '(', '1',
  2283. 'S', 'T', ')', '=', 'F', 'E', 'R', '4',
  2284. 'S', 'T' | 0x80, ' ', '(', '1', '0', 'T', 'H',
  2285. ')', '=', 'T', 'E', 'H', '4', 'N', 'T',
  2286. 'H' | 0x80, '(', '1', ')', '=', ' ', 'W', 'A',
  2287. 'H', '4', 'N' | 0x80, ' ', '(', '2', 'N', 'D',
  2288. ')', '=', 'S', 'E', 'H', '4', 'K', 'U',
  2289. 'N', 'D' | 0x80, '(', '2', ')', '=', ' ', 'T',
  2290. 'U', 'W', '4' | 0x80, ' ', '(', '3', 'R', 'D',
  2291. ')', '=', 'T', 'H', 'E', 'R', '4', 'D' | 0x80,
  2292. '(', '3', ')', '=', ' ', 'T', 'H', 'R',
  2293. 'I', 'Y', '4' | 0x80, '(', '4', ')', '=', ' ',
  2294. 'F', 'O', 'H', '4', 'R' | 0x80, ' ', '(', '5',
  2295. 'T', 'H', ')', '=', 'F', 'I', 'H', '4',
  2296. 'F', 'T', 'H' | 0x80, '(', '5', ')', '=', ' ',
  2297. 'F', 'A', 'Y', '4', 'V' | 0x80, ' ', '(', '6',
  2298. '4', ')', ' ', '=', 'S', 'I', 'H', '4',
  2299. 'K', 'S', 'T', 'I', 'Y', ' ', 'F', 'O',
  2300. 'H', 'R' | 0x80, '(', '6', ')', '=', ' ', 'S',
  2301. 'I', 'H', '4', 'K', 'S' | 0x80, '(', '7', ')',
  2302. '=', ' ', 'S', 'E', 'H', '4', 'V', 'U',
  2303. 'N' | 0x80, ' ', '(', '8', 'T', 'H', ')', '=',
  2304. 'E', 'Y', '4', 'T', 'H' | 0x80, '(', '8', ')',
  2305. '=', ' ', 'E', 'Y', '4', 'T' | 0x80, '(', '9',
  2306. ')', '=', ' ', 'N', 'A', 'Y', '4', 'N' | 0x80,
  2307. '(', ':', ')', '=', '.' | 0x80, '(', ';', ')',
  2308. '=', '.' | 0x80, '(', '<', ')', '=', ' ', 'L',
  2309. 'E', 'H', '4', 'S', ' ', 'D', 'H', 'A',
  2310. 'E', 'N' | 0x80, '(', '=', ')', '=', ' ', 'I',
  2311. 'Y', '4', 'K', 'W', 'U', 'L', 'Z' | 0x80, '(',
  2312. '>', ')', '=', ' ', 'G', 'R', 'E', 'Y',
  2313. '4', 'T', 'E', 'R', ' ', 'D', 'H', 'A',
  2314. 'E', 'N' | 0x80, '(', '?', ')', '=', '?' | 0x80, '(',
  2315. '@', ')', '=', ' ', 'A', 'E', '6', 'T' | 0x80,
  2316. '(', '^', ')', '=', ' ', 'K', 'A', 'E',
  2317. '4', 'R', 'I', 'X', 'T' | 0x80, ']', 'A' | 0x80};
  2318. //26 items. From 'A' to 'Z'
  2319. // positions for mem62 and mem63 for each character
  2320. const unsigned char tab37489[] = {0, 149, 247, 162, 57, 197, 6, 126, 199, 38, 55, 78, 145,
  2321. 241, 85, 161, 254, 36, 69, 45, 167, 54, 83, 46, 71, 218};
  2322. const unsigned char tab37515[] = {125, 126, 126, 127, 128, 129, 130, 130, 130, 132, 132, 132, 132,
  2323. 132, 133, 135, 135, 136, 136, 137, 138, 139, 139, 140, 140, 140};
  2324. void STM32SAM::Output8BitAry(int index, unsigned char ary[5]) {
  2325. int k;
  2326. uint32_t bufferposOld = bufferpos;
  2327. bufferpos += timetable[oldtimetableindex][index];
  2328. oldtimetableindex = index;
  2329. int sample_uS = bufferpos - bufferposOld;
  2330. uint32_t f = 0;
  2331. // write a little bit in advance
  2332. for(k = 0; k < 5; k++) {
  2333. // buffer[bufferpos / 50 + k] = ary[k];
  2334. // f = micros() + sample_uS / (_STM32SAM_SPEED + 1);
  2335. // while(micros() < f) {
  2336. // };
  2337. f = sample_uS / (_STM32SAM_SPEED + 1);
  2338. furi_delay_us(f);
  2339. SetAUDIO(ary[k]);
  2340. // delayMicroseconds(sample_uS / 5 );
  2341. }
  2342. // SetAUDIO(ary[0]);
  2343. }
  2344. void STM32SAM::Output8Bit(int index, unsigned char A) {
  2345. unsigned char ary[5] = {A, A, A, A, A};
  2346. Output8BitAry(index, ary);
  2347. }
  2348. //written by me because of different table positions.
  2349. // mem[47] = ...
  2350. // 168=pitches
  2351. // 169=frequency1
  2352. // 170=frequency2
  2353. // 171=frequency3
  2354. // 172=amplitude1
  2355. // 173=amplitude2
  2356. // 174=amplitude3
  2357. unsigned char STM32SAM::Read(unsigned char p, unsigned char Y) {
  2358. switch(p) {
  2359. case 168:
  2360. return pitches[Y];
  2361. case 169:
  2362. return frequency1[Y];
  2363. case 170:
  2364. return frequency2[Y];
  2365. case 171:
  2366. return frequency3[Y];
  2367. case 172:
  2368. return amplitude1[Y];
  2369. case 173:
  2370. return amplitude2[Y];
  2371. case 174:
  2372. return amplitude3[Y];
  2373. }
  2374. // Serial1.println("Error reading to tables");
  2375. return 0;
  2376. }
  2377. void STM32SAM::Write(unsigned char p, unsigned char Y, unsigned char value) {
  2378. switch(p) {
  2379. case 168:
  2380. pitches[Y] = value;
  2381. return;
  2382. case 169:
  2383. frequency1[Y] = value;
  2384. return;
  2385. case 170:
  2386. frequency2[Y] = value;
  2387. return;
  2388. case 171:
  2389. frequency3[Y] = value;
  2390. return;
  2391. case 172:
  2392. amplitude1[Y] = value;
  2393. return;
  2394. case 173:
  2395. amplitude2[Y] = value;
  2396. return;
  2397. case 174:
  2398. amplitude3[Y] = value;
  2399. return;
  2400. }
  2401. //Serial1.println("Error writing to tables\n");
  2402. }
  2403. // -------------------------------------------------------------------------
  2404. //Code48227
  2405. // Render a sampled sound from the sampleTable.
  2406. //
  2407. // Phoneme Sample Start Sample End
  2408. // 32: S* 15 255
  2409. // 33: SH 257 511
  2410. // 34: F* 559 767
  2411. // 35: TH 583 767
  2412. // 36: /H 903 1023
  2413. // 37: /X 1135 1279
  2414. // 38: Z* 84 119
  2415. // 39: ZH 340 375
  2416. // 40: V* 596 639
  2417. // 41: DH 596 631
  2418. //
  2419. // 42: CH
  2420. // 43: ** 399 511
  2421. //
  2422. // 44: J*
  2423. // 45: ** 257 276
  2424. // 46: **
  2425. //
  2426. // 66: P*
  2427. // 67: ** 743 767
  2428. // 68: **
  2429. //
  2430. // 69: T*
  2431. // 70: ** 231 255
  2432. // 71: **
  2433. //
  2434. // The SampledPhonemesTable[] holds flags indicating if a phoneme is
  2435. // voiced or not. If the upper 5 bits are zero, the sample is voiced.
  2436. //
  2437. // Samples in the sampleTable are compressed, with bits being converted to
  2438. // bytes from high bit to low, as follows:
  2439. //
  2440. // unvoiced 0 bit -> X
  2441. // unvoiced 1 bit -> 5
  2442. //
  2443. // voiced 0 bit -> 6
  2444. // voiced 1 bit -> 24
  2445. //
  2446. // Where X is a value from the table:
  2447. //
  2448. // { 0x18, 0x1A, 0x17, 0x17, 0x17 };
  2449. //
  2450. // The index into this table is determined by masking off the lower
  2451. // 3 bits from the SampledPhonemesTable:
  2452. //
  2453. // index = (SampledPhonemesTable[i] & 7) - 1;
  2454. //
  2455. // For voices samples, samples are interleaved between voiced output.
  2456. // Code48227()
  2457. void STM32SAM::RenderSample(unsigned char* mem66) {
  2458. int tempA;
  2459. // current phoneme's index
  2460. mem49 = Y;
  2461. // mask low three bits and subtract 1 get value to
  2462. // convert 0 bits on unvoiced samples.
  2463. A = mem39 & 7;
  2464. X = A - 1;
  2465. // store the result
  2466. mem56 = X;
  2467. // determine which offset to use from table { 0x18, 0x1A, 0x17, 0x17, 0x17 }
  2468. // T, S, Z 0 0x18
  2469. // CH, J, SH, ZH 1 0x1A
  2470. // P, F*, V, TH, DH 2 0x17
  2471. // /H 3 0x17
  2472. // /X 4 0x17
  2473. // get value from the table
  2474. mem53 = tab48426[X];
  2475. mem47 = X; //46016+mem[56]*256
  2476. // voiced sample?
  2477. A = mem39 & 248;
  2478. if(A == 0) {
  2479. // voiced phoneme: Z*, ZH, V*, DH
  2480. Y = mem49;
  2481. A = pitches[mem49] >> 4;
  2482. // jump to voiced portion
  2483. goto pos48315;
  2484. }
  2485. Y = A ^ 255;
  2486. pos48274:
  2487. // step through the 8 bits in the sample
  2488. mem56 = 8;
  2489. // get the next sample from the table
  2490. // mem47*256 = offset to start of samples
  2491. A = sampleTable[mem47 * 256 + Y];
  2492. pos48280:
  2493. // left shift to get the high bit
  2494. tempA = A;
  2495. A = A << 1;
  2496. //48281: BCC 48290
  2497. // bit not set?
  2498. if((tempA & 128) == 0) {
  2499. // convert the bit to value from table
  2500. X = mem53;
  2501. //mem[54296] = X;
  2502. // output the byte
  2503. Output8Bit(1, (X & 0x0f) * 16);
  2504. // if X != 0, exit loop
  2505. if(X != 0) goto pos48296;
  2506. }
  2507. // output a 5 for the on bit
  2508. Output8Bit(2, 5 * 16);
  2509. //48295: NOP
  2510. pos48296:
  2511. X = 0;
  2512. // decrement counter
  2513. mem56--;
  2514. // if not done, jump to top of loop
  2515. if(mem56 != 0) goto pos48280;
  2516. // increment position
  2517. Y++;
  2518. if(Y != 0) goto pos48274;
  2519. // restore values and return
  2520. mem44 = 1;
  2521. Y = mem49;
  2522. return;
  2523. unsigned char phase1;
  2524. pos48315:
  2525. // handle voiced samples here
  2526. // number of samples?
  2527. phase1 = A ^ 255;
  2528. Y = *mem66;
  2529. do {
  2530. //pos48321:
  2531. // shift through all 8 bits
  2532. mem56 = 8;
  2533. //A = Read(mem47, Y);
  2534. // fetch value from table
  2535. A = sampleTable[mem47 * 256 + Y];
  2536. // loop 8 times
  2537. //pos48327:
  2538. do {
  2539. //48327: ASL A
  2540. //48328: BCC 48337
  2541. // left shift and check high bit
  2542. tempA = A;
  2543. A = A << 1;
  2544. if((tempA & 128) != 0) {
  2545. // if bit set, output 26
  2546. X = 26;
  2547. Output8Bit(3, (X & 0xf) * 16);
  2548. } else {
  2549. //timetable 4
  2550. // bit is not set, output a 6
  2551. X = 6;
  2552. Output8Bit(4, (X & 0xf) * 16);
  2553. }
  2554. mem56--;
  2555. } while(mem56 != 0);
  2556. // move ahead in the table
  2557. Y++;
  2558. // continue until counter done
  2559. phase1++;
  2560. } while(phase1 != 0);
  2561. // if (phase1 != 0) goto pos48321;
  2562. // restore values and return
  2563. A = 1;
  2564. mem44 = 1;
  2565. *mem66 = Y;
  2566. Y = mem49;
  2567. return;
  2568. }
  2569. // RENDER THE PHONEMES IN THE LIST
  2570. //
  2571. // The phoneme list is converted into sound through the steps:
  2572. //
  2573. // 1. Copy each phoneme <length> number of times into the frames list,
  2574. // where each frame represents 10 milliseconds of sound.
  2575. //
  2576. // 2. Determine the transitions lengths between phonemes, and linearly
  2577. // interpolate the values across the frames.
  2578. //
  2579. // 3. Offset the pitches by the fundamental frequency.
  2580. //
  2581. // 4. Render the each frame.
  2582. //void Code47574()
  2583. void STM32SAM::Render() {
  2584. unsigned char phase1 = 0; //mem43
  2585. unsigned char phase2 = 0;
  2586. unsigned char phase3 = 0;
  2587. unsigned char mem66 = 0;
  2588. unsigned char mem38 = 0;
  2589. unsigned char mem40 = 0;
  2590. unsigned char speedcounter = 0; //mem45
  2591. unsigned char mem48 = 0;
  2592. int i;
  2593. if(phonemeIndexOutput[0] == 255) return; //exit if no data
  2594. A = 0;
  2595. X = 0;
  2596. mem44 = 0;
  2597. // CREATE FRAMES
  2598. //
  2599. // The length parameter in the list corresponds to the number of frames
  2600. // to expand the phoneme to. Each frame represents 10 milliseconds of time.
  2601. // So a phoneme with a length of 7 = 7 frames = 70 milliseconds duration.
  2602. //
  2603. // The parameters are copied from the phoneme to the frame verbatim.
  2604. // pos47587:
  2605. do {
  2606. // get the index
  2607. Y = mem44;
  2608. // get the phoneme at the index
  2609. A = phonemeIndexOutput[mem44];
  2610. mem56 = A;
  2611. // if terminal phoneme, exit the loop
  2612. if(A == 255) break;
  2613. // period phoneme *.
  2614. if(A == 1) {
  2615. // add rising inflection
  2616. A = 1;
  2617. mem48 = 1;
  2618. //goto pos48376;
  2619. AddInflection(mem48, phase1);
  2620. }
  2621. /*
  2622. if (A == 2) goto pos48372;
  2623. */
  2624. // question mark phoneme?
  2625. if(A == 2) {
  2626. // create falling inflection
  2627. mem48 = 255;
  2628. AddInflection(mem48, phase1);
  2629. }
  2630. // pos47615:
  2631. // get the stress amount (more stress = higher pitch)
  2632. phase1 = tab47492[stressOutput[Y] + 1];
  2633. // get number of frames to write
  2634. phase2 = phonemeLengthOutput[Y];
  2635. Y = mem56;
  2636. // copy from the source to the frames list
  2637. do {
  2638. frequency1[X] = freq1data[Y]; // F1 frequency
  2639. frequency2[X] = freq2data[Y]; // F2 frequency
  2640. frequency3[X] = freq3data[Y]; // F3 frequency
  2641. amplitude1[X] = ampl1data[Y]; // F1 amplitude
  2642. amplitude2[X] = ampl2data[Y]; // F2 amplitude
  2643. amplitude3[X] = ampl3data[Y]; // F3 amplitude
  2644. sampledConsonantFlag[X] =
  2645. sampledConsonantFlags[Y]; // phoneme data for sampled consonants
  2646. pitches[X] = pitch + phase1; // pitch
  2647. X++;
  2648. phase2--;
  2649. } while(phase2 != 0);
  2650. mem44++;
  2651. } while(mem44 != 0);
  2652. // -------------------
  2653. //pos47694:
  2654. // CREATE TRANSITIONS
  2655. //
  2656. // Linear transitions are now created to smoothly connect the
  2657. // end of one sustained portion of a phoneme to the following
  2658. // phoneme.
  2659. //
  2660. // To do this, three tables are used:
  2661. //
  2662. // Table Purpose
  2663. // ========= ==================================================
  2664. // blendRank Determines which phoneme's blend values are used.
  2665. //
  2666. // blendOut The number of frames at the end of the phoneme that
  2667. // will be used to transition to the following phoneme.
  2668. //
  2669. // blendIn The number of frames of the following phoneme that
  2670. // will be used to transition into that phoneme.
  2671. //
  2672. // In creating a transition between two phonemes, the phoneme
  2673. // with the HIGHEST rank is used. Phonemes are ranked on how much
  2674. // their identity is based on their transitions. For example,
  2675. // vowels are and diphthongs are identified by their sustained portion,
  2676. // rather than the transitions, so they are given low values. In contrast,
  2677. // stop consonants (P, B, T, K) and glides (Y, L) are almost entirely
  2678. // defined by their transitions, and are given high rank values.
  2679. //
  2680. // Here are the rankings used by SAM:
  2681. //
  2682. // Rank Type Phonemes
  2683. // 2 All vowels IY, IH, etc.
  2684. // 5 Diphthong endings YX, WX, ER
  2685. // 8 Terminal liquid consonants LX, WX, YX, N, NX
  2686. // 9 Liquid consonants L, RX, W
  2687. // 10 Glide R, OH
  2688. // 11 Glide WH
  2689. // 18 Voiceless fricatives S, SH, F, TH
  2690. // 20 Voiced fricatives Z, ZH, V, DH
  2691. // 23 Plosives, stop consonants P, T, K, KX, DX, CH
  2692. // 26 Stop consonants J, GX, B, D, G
  2693. // 27-29 Stop consonants (internal) **
  2694. // 30 Unvoiced consonants /H, /X and Q*
  2695. // 160 Nasal M
  2696. //
  2697. // To determine how many frames to use, the two phonemes are
  2698. // compared using the blendRank[] table. The phoneme with the
  2699. // higher rank is selected. In case of a tie, a blend of each is used:
  2700. //
  2701. // if blendRank[phoneme1] == blendRank[phomneme2]
  2702. // // use lengths from each phoneme
  2703. // outBlendFrames = outBlend[phoneme1]
  2704. // inBlendFrames = outBlend[phoneme2]
  2705. // else if blendRank[phoneme1] > blendRank[phoneme2]
  2706. // // use lengths from first phoneme
  2707. // outBlendFrames = outBlendLength[phoneme1]
  2708. // inBlendFrames = inBlendLength[phoneme1]
  2709. // else
  2710. // // use lengths from the second phoneme
  2711. // // note that in and out are SWAPPED!
  2712. // outBlendFrames = inBlendLength[phoneme2]
  2713. // inBlendFrames = outBlendLength[phoneme2]
  2714. //
  2715. // Blend lengths can't be less than zero.
  2716. //
  2717. // Transitions are assumed to be symetrical, so if the transition
  2718. // values for the second phoneme are used, the inBlendLength and
  2719. // outBlendLength values are SWAPPED.
  2720. //
  2721. // For most of the parameters, SAM interpolates over the range of the last
  2722. // outBlendFrames-1 and the first inBlendFrames.
  2723. //
  2724. // The exception to this is the Pitch[] parameter, which is interpolates the
  2725. // pitch from the CENTER of the current phoneme to the CENTER of the next
  2726. // phoneme.
  2727. //
  2728. // Here are two examples. First, For example, consider the word "SUN" (S AH N)
  2729. //
  2730. // Phoneme Duration BlendWeight OutBlendFrames InBlendFrames
  2731. // S 2 18 1 3
  2732. // AH 8 2 4 4
  2733. // N 7 8 1 2
  2734. //
  2735. // The formant transitions for the output frames are calculated as follows:
  2736. //
  2737. // flags ampl1 freq1 ampl2 freq2 ampl3 freq3 pitch
  2738. // ------------------------------------------------
  2739. // S
  2740. // 241 0 6 0 73 0 99 61 Use S (weight 18) for transition instead of AH (weight 2)
  2741. // 241 0 6 0 73 0 99 61 <-- (OutBlendFrames-1) = (1-1) = 0 frames
  2742. // AH
  2743. // 0 2 10 2 66 0 96 59 * <-- InBlendFrames = 3 frames
  2744. // 0 4 14 3 59 0 93 57 *
  2745. // 0 8 18 5 52 0 90 55 *
  2746. // 0 15 22 9 44 1 87 53
  2747. // 0 15 22 9 44 1 87 53
  2748. // 0 15 22 9 44 1 87 53 Use N (weight 8) for transition instead of AH (weight 2).
  2749. // 0 15 22 9 44 1 87 53 Since N is second phoneme, reverse the IN and OUT values.
  2750. // 0 11 17 8 47 1 98 56 * <-- (InBlendFrames-1) = (2-1) = 1 frames
  2751. // N
  2752. // 0 8 12 6 50 1 109 58 * <-- OutBlendFrames = 1
  2753. // 0 5 6 5 54 0 121 61
  2754. // 0 5 6 5 54 0 121 61
  2755. // 0 5 6 5 54 0 121 61
  2756. // 0 5 6 5 54 0 121 61
  2757. // 0 5 6 5 54 0 121 61
  2758. // 0 5 6 5 54 0 121 61
  2759. //
  2760. // Now, consider the reverse "NUS" (N AH S):
  2761. //
  2762. // flags ampl1 freq1 ampl2 freq2 ampl3 freq3 pitch
  2763. // ------------------------------------------------
  2764. // N
  2765. // 0 5 6 5 54 0 121 61
  2766. // 0 5 6 5 54 0 121 61
  2767. // 0 5 6 5 54 0 121 61
  2768. // 0 5 6 5 54 0 121 61
  2769. // 0 5 6 5 54 0 121 61
  2770. // 0 5 6 5 54 0 121 61 Use N (weight 8) for transition instead of AH (weight 2)
  2771. // 0 5 6 5 54 0 121 61 <-- (OutBlendFrames-1) = (1-1) = 0 frames
  2772. // AH
  2773. // 0 8 11 6 51 0 110 59 * <-- InBlendFrames = 2
  2774. // 0 11 16 8 48 0 99 56 *
  2775. // 0 15 22 9 44 1 87 53 Use S (weight 18) for transition instead of AH (weight 2)
  2776. // 0 15 22 9 44 1 87 53 Since S is second phoneme, reverse the IN and OUT values.
  2777. // 0 9 18 5 51 1 90 55 * <-- (InBlendFrames-1) = (3-1) = 2
  2778. // 0 4 14 3 58 1 93 57 *
  2779. // S
  2780. // 241 2 10 2 65 1 96 59 * <-- OutBlendFrames = 1
  2781. // 241 0 6 0 73 0 99 61
  2782. A = 0;
  2783. mem44 = 0;
  2784. mem49 = 0; // mem49 starts at as 0
  2785. X = 0;
  2786. while(1) //while No. 1
  2787. {
  2788. // get the current and following phoneme
  2789. Y = phonemeIndexOutput[X];
  2790. A = phonemeIndexOutput[X + 1];
  2791. X++;
  2792. // exit loop at end token
  2793. if(A == 255) break; //goto pos47970;
  2794. // get the ranking of each phoneme
  2795. X = A;
  2796. mem56 = blendRank[A];
  2797. A = blendRank[Y];
  2798. // compare the rank - lower rank value is stronger
  2799. if(A == mem56) {
  2800. // same rank, so use out blend lengths from each phoneme
  2801. phase1 = outBlendLength[Y];
  2802. phase2 = outBlendLength[X];
  2803. } else if(A < mem56) {
  2804. // first phoneme is stronger, so us it's blend lengths
  2805. phase1 = inBlendLength[X];
  2806. phase2 = outBlendLength[X];
  2807. } else {
  2808. // second phoneme is stronger, so use it's blend lengths
  2809. // note the out/in are swapped
  2810. phase1 = outBlendLength[Y];
  2811. phase2 = inBlendLength[Y];
  2812. }
  2813. Y = mem44;
  2814. A = mem49 + phonemeLengthOutput[mem44]; // A is mem49 + length
  2815. mem49 = A; // mem49 now holds length + position
  2816. A = A + phase2; //Maybe Problem because of carry flag
  2817. //47776: ADC 42
  2818. speedcounter = A;
  2819. mem47 = 168;
  2820. phase3 = mem49 - phase1; // what is mem49
  2821. A = phase1 + phase2; // total transition?
  2822. mem38 = A;
  2823. X = A;
  2824. X -= 2;
  2825. if((X & 128) == 0)
  2826. do //while No. 2
  2827. {
  2828. //pos47810:
  2829. // mem47 is used to index the tables:
  2830. // 168 pitches[]
  2831. // 169 frequency1
  2832. // 170 frequency2
  2833. // 171 frequency3
  2834. // 172 amplitude1
  2835. // 173 amplitude2
  2836. // 174 amplitude3
  2837. mem40 = mem38;
  2838. if(mem47 == 168) // pitch
  2839. {
  2840. // unlike the other values, the pitches[] interpolates from
  2841. // the middle of the current phoneme to the middle of the
  2842. // next phoneme
  2843. unsigned char mem36, mem37;
  2844. // half the width of the current phoneme
  2845. mem36 = phonemeLengthOutput[mem44] >> 1;
  2846. // half the width of the next phoneme
  2847. mem37 = phonemeLengthOutput[mem44 + 1] >> 1;
  2848. // sum the values
  2849. mem40 = mem36 + mem37; // length of both halves
  2850. mem37 += mem49; // center of next phoneme
  2851. mem36 = mem49 - mem36; // center index of current phoneme
  2852. A = Read(
  2853. mem47, mem37); // value at center of next phoneme - end interpolation value
  2854. //A = mem[address];
  2855. Y = mem36; // start index of interpolation
  2856. mem53 = A - Read(mem47, mem36); // value to center of current phoneme
  2857. } else {
  2858. // value to interpolate to
  2859. A = Read(mem47, speedcounter);
  2860. // position to start interpolation from
  2861. Y = phase3;
  2862. // value to interpolate from
  2863. mem53 = A - Read(mem47, phase3);
  2864. }
  2865. //Code47503(mem40);
  2866. // ML : Code47503 is division with remainder, and mem50 gets the sign
  2867. // calculate change per frame
  2868. signed char m53 = (signed char)mem53;
  2869. mem50 = mem53 & 128;
  2870. unsigned char m53abs = abs(m53);
  2871. mem51 = m53abs % mem40; //abs((char)m53) % mem40;
  2872. mem53 = (unsigned char)((signed char)(m53) / mem40);
  2873. // interpolation range
  2874. X = mem40; // number of frames to interpolate over
  2875. Y = phase3; // starting frame
  2876. // linearly interpolate values
  2877. mem56 = 0;
  2878. //47907: CLC
  2879. //pos47908:
  2880. while(1) //while No. 3
  2881. {
  2882. A = Read(mem47, Y) + mem53; //carry alway cleared
  2883. mem48 = A;
  2884. Y++;
  2885. X--;
  2886. if(X == 0) break;
  2887. mem56 += mem51;
  2888. if(mem56 >= mem40) //???
  2889. {
  2890. mem56 -= mem40; //carry? is set
  2891. //if ((mem56 & 128)==0)
  2892. if((mem50 & 128) == 0) {
  2893. //47935: BIT 50
  2894. //47937: BMI 47943
  2895. if(mem48 != 0) mem48++;
  2896. } else
  2897. mem48--;
  2898. }
  2899. //pos47945:
  2900. Write(mem47, Y, mem48);
  2901. } //while No. 3
  2902. //pos47952:
  2903. mem47++;
  2904. //if (mem47 != 175) goto pos47810;
  2905. } while(mem47 != 175); //while No. 2
  2906. //pos47963:
  2907. mem44++;
  2908. X = mem44;
  2909. } //while No. 1
  2910. //goto pos47701;
  2911. //pos47970:
  2912. // add the length of this phoneme
  2913. mem48 = mem49 + phonemeLengthOutput[mem44];
  2914. // ASSIGN PITCH CONTOUR
  2915. //
  2916. // This subtracts the F1 frequency from the pitch to create a
  2917. // pitch contour. Without this, the output would be at a single
  2918. // pitch level (monotone).
  2919. // don't adjust pitch if in sing mode
  2920. if(!singmode) {
  2921. // iterate through the buffer
  2922. for(i = 0; i < 256; i++) {
  2923. // subtract half the frequency of the formant 1.
  2924. // this adds variety to the voice
  2925. pitches[i] -= (frequency1[i] >> 1);
  2926. }
  2927. }
  2928. phase1 = 0;
  2929. phase2 = 0;
  2930. phase3 = 0;
  2931. mem49 = 0;
  2932. speedcounter = 72; //sam standard speed
  2933. // RESCALE AMPLITUDE
  2934. //
  2935. // Rescale volume from a linear scale to decibels.
  2936. //
  2937. //amplitude rescaling
  2938. for(i = 255; i >= 0; i--) {
  2939. amplitude1[i] = amplitudeRescale[amplitude1[i]];
  2940. amplitude2[i] = amplitudeRescale[amplitude2[i]];
  2941. amplitude3[i] = amplitudeRescale[amplitude3[i]];
  2942. }
  2943. Y = 0;
  2944. A = pitches[0];
  2945. mem44 = A;
  2946. X = A;
  2947. mem38 = A - (A >> 2); // 3/4*A ???
  2948. // PROCESS THE FRAMES
  2949. //
  2950. // In traditional vocal synthesis, the glottal pulse drives filters, which
  2951. // are attenuated to the frequencies of the formants.
  2952. //
  2953. // SAM generates these formants directly with sin and rectangular waves.
  2954. // To simulate them being driven by the glottal pulse, the waveforms are
  2955. // reset at the beginning of each glottal pulse.
  2956. //finally the loop for sound output
  2957. //pos48078:
  2958. while(1) {
  2959. // get the sampled information on the phoneme
  2960. A = sampledConsonantFlag[Y];
  2961. mem39 = A;
  2962. // unvoiced sampled phoneme?
  2963. A = A & 248;
  2964. if(A != 0) {
  2965. // render the sample for the phoneme
  2966. RenderSample(&mem66);
  2967. // skip ahead two in the phoneme buffer
  2968. Y += 2;
  2969. mem48 -= 2;
  2970. } else {
  2971. // simulate the glottal pulse and formants
  2972. unsigned char ary[5];
  2973. unsigned int p1 =
  2974. phase1 * 256; // Fixed point integers because we need to divide later on
  2975. unsigned int p2 = phase2 * 256;
  2976. unsigned int p3 = phase3 * 256;
  2977. int k;
  2978. for(k = 0; k < 5; k++) {
  2979. signed char sp1 = (signed char)sinus[0xff & (p1 >> 8)];
  2980. signed char sp2 = (signed char)sinus[0xff & (p2 >> 8)];
  2981. signed char rp3 = (signed char)rectangle[0xff & (p3 >> 8)];
  2982. signed int sin1 = sp1 * ((unsigned char)amplitude1[Y] & 0x0f);
  2983. signed int sin2 = sp2 * ((unsigned char)amplitude2[Y] & 0x0f);
  2984. signed int rect = rp3 * ((unsigned char)amplitude3[Y] & 0x0f);
  2985. signed int mux = sin1 + sin2 + rect;
  2986. mux /= 32;
  2987. mux += 128; // Go from signed to unsigned amplitude
  2988. ary[k] = mux;
  2989. p1 += frequency1[Y] * 256 / 4; // Compromise, this becomes a shift and works well
  2990. p2 += frequency2[Y] * 256 / 4;
  2991. p3 += frequency3[Y] * 256 / 4;
  2992. }
  2993. // output the accumulated value
  2994. Output8BitAry(0, ary);
  2995. speedcounter--;
  2996. if(speedcounter != 0) goto pos48155;
  2997. Y++; //go to next amplitude
  2998. // decrement the frame count
  2999. mem48--;
  3000. }
  3001. // if the frame count is zero, exit the loop
  3002. if(mem48 == 0) return;
  3003. speedcounter = speed;
  3004. pos48155:
  3005. // decrement the remaining length of the glottal pulse
  3006. mem44--;
  3007. // finished with a glottal pulse?
  3008. if(mem44 == 0) {
  3009. pos48159:
  3010. // fetch the next glottal pulse length
  3011. A = pitches[Y];
  3012. mem44 = A;
  3013. A = A - (A >> 2);
  3014. mem38 = A;
  3015. // reset the formant wave generators to keep them in
  3016. // sync with the glottal pulse
  3017. phase1 = 0;
  3018. phase2 = 0;
  3019. phase3 = 0;
  3020. continue;
  3021. }
  3022. // decrement the count
  3023. mem38--;
  3024. // is the count non-zero and the sampled flag is zero?
  3025. if((mem38 != 0) || (mem39 == 0)) {
  3026. // reset the phase of the formants to match the pulse
  3027. phase1 += frequency1[Y];
  3028. phase2 += frequency2[Y];
  3029. phase3 += frequency3[Y];
  3030. continue;
  3031. }
  3032. // voiced sampled phonemes interleave the sample with the
  3033. // glottal pulse. The sample flag is non-zero, so render
  3034. // the sample for the phoneme.
  3035. RenderSample(&mem66);
  3036. goto pos48159;
  3037. } //while
  3038. // The following code is never reached. It's left over from when
  3039. // the voiced sample code was part of this loop, instead of part
  3040. // of RenderSample();
  3041. //pos48315:
  3042. int tempA;
  3043. phase1 = A ^ 255;
  3044. Y = mem66;
  3045. do {
  3046. //pos48321:
  3047. mem56 = 8;
  3048. A = Read(mem47, Y);
  3049. //pos48327:
  3050. do {
  3051. //48327: ASL A
  3052. //48328: BCC 48337
  3053. tempA = A;
  3054. A = A << 1;
  3055. if((tempA & 128) != 0) {
  3056. X = 26;
  3057. // mem[54296] = X;
  3058. bufferpos += 150;
  3059. //
  3060. //
  3061. // buffer[bufferpos / 50] = (X & 15) * 16;
  3062. //
  3063. //
  3064. } else {
  3065. //mem[54296] = 6;
  3066. X = 6;
  3067. bufferpos += 150;
  3068. //
  3069. // buffer[bufferpos / 50] = (X & 15) * 16;
  3070. //
  3071. //
  3072. }
  3073. for(X = wait2; X > 0; X--)
  3074. ; //wait
  3075. mem56--;
  3076. } while(mem56 != 0);
  3077. Y++;
  3078. phase1++;
  3079. } while(phase1 != 0);
  3080. // if (phase1 != 0) goto pos48321;
  3081. A = 1;
  3082. mem44 = 1;
  3083. mem66 = Y;
  3084. Y = mem49;
  3085. return;
  3086. }
  3087. // Create a rising or falling inflection 30 frames prior to
  3088. // index X. A rising inflection is used for questions, and
  3089. // a falling inflection is used for statements.
  3090. void STM32SAM::AddInflection(unsigned char mem48, unsigned char phase1) {
  3091. //pos48372:
  3092. // mem48 = 255;
  3093. //pos48376:
  3094. // store the location of the punctuation
  3095. mem49 = X;
  3096. A = X;
  3097. int Atemp = A;
  3098. // backup 30 frames
  3099. A = A - 30;
  3100. // if index is before buffer, point to start of buffer
  3101. if(Atemp <= 30) A = 0;
  3102. X = A;
  3103. // FIXME: Explain this fix better, it's not obvious
  3104. // ML : A =, fixes a problem with invalid pitch with '.'
  3105. while((A = pitches[X]) == 127) X++;
  3106. pos48398:
  3107. //48398: CLC
  3108. //48399: ADC 48
  3109. // add the inflection direction
  3110. A += mem48;
  3111. phase1 = A;
  3112. // set the inflection
  3113. pitches[X] = A;
  3114. pos48406:
  3115. // increment the position
  3116. X++;
  3117. // exit if the punctuation has been reached
  3118. if(X == mem49) return; //goto pos47615;
  3119. if(pitches[X] == 255) goto pos48406;
  3120. A = phase1;
  3121. goto pos48398;
  3122. }
  3123. /*
  3124. SAM's voice can be altered by changing the frequencies of the
  3125. mouth formant (F1) and the throat formant (F2). Only the voiced
  3126. phonemes (5-29 and 48-53) are altered.
  3127. */
  3128. void STM32SAM::SetMouthThroat() {
  3129. unsigned char initialFrequency;
  3130. unsigned char newFrequency = 0;
  3131. //unsigned char mouth; //mem38880
  3132. //unsigned char throat; //mem38881
  3133. // mouth formants (F1) 5..29
  3134. unsigned char mouthFormants5_29[30] = {0, 0, 0, 0, 0, 10, 14, 19, 24, 27,
  3135. 23, 21, 16, 20, 14, 18, 14, 18, 18, 16,
  3136. 13, 15, 11, 18, 14, 11, 9, 6, 6, 6};
  3137. // throat formants (F2) 5..29
  3138. unsigned char throatFormants5_29[30] = {255, 255, 255, 255, 255, 84, 73, 67, 63, 40,
  3139. 44, 31, 37, 45, 73, 49, 36, 30, 51, 37,
  3140. 29, 69, 24, 50, 30, 24, 83, 46, 54, 86};
  3141. // there must be no zeros in this 2 tables
  3142. // formant 1 frequencies (mouth) 48..53
  3143. unsigned char mouthFormants48_53[6] = {19, 27, 21, 27, 18, 13};
  3144. // formant 2 frequencies (throat) 48..53
  3145. unsigned char throatFormants48_53[6] = {72, 39, 31, 43, 30, 34};
  3146. unsigned char pos = 5; //mem39216
  3147. //pos38942:
  3148. // recalculate formant frequencies 5..29 for the mouth (F1) and throat (F2)
  3149. while(pos != 30) {
  3150. // recalculate mouth frequency
  3151. initialFrequency = mouthFormants5_29[pos];
  3152. if(initialFrequency != 0) newFrequency = trans(mouth, initialFrequency);
  3153. freq1data[pos] = newFrequency;
  3154. // recalculate throat frequency
  3155. initialFrequency = throatFormants5_29[pos];
  3156. if(initialFrequency != 0) newFrequency = trans(throat, initialFrequency);
  3157. freq2data[pos] = newFrequency;
  3158. pos++;
  3159. }
  3160. //pos39059:
  3161. // recalculate formant frequencies 48..53
  3162. pos = 48;
  3163. Y = 0;
  3164. while(pos != 54) {
  3165. // recalculate F1 (mouth formant)
  3166. initialFrequency = mouthFormants48_53[Y];
  3167. newFrequency = trans(mouth, initialFrequency);
  3168. freq1data[pos] = newFrequency;
  3169. // recalculate F2 (throat formant)
  3170. initialFrequency = throatFormants48_53[Y];
  3171. newFrequency = trans(throat, initialFrequency);
  3172. freq2data[pos] = newFrequency;
  3173. Y++;
  3174. pos++;
  3175. }
  3176. }
  3177. //return = (mem39212*mem39213) >> 1
  3178. unsigned char STM32SAM::trans(unsigned char mem39212, unsigned char mem39213) {
  3179. //pos39008:
  3180. unsigned char carry;
  3181. int temp;
  3182. unsigned char mem39214, mem39215;
  3183. A = 0;
  3184. mem39215 = 0;
  3185. mem39214 = 0;
  3186. X = 8;
  3187. do {
  3188. carry = mem39212 & 1;
  3189. mem39212 = mem39212 >> 1;
  3190. if(carry != 0) {
  3191. /*
  3192. 39018: LSR 39212
  3193. 39021: BCC 39033
  3194. */
  3195. carry = 0;
  3196. A = mem39215;
  3197. temp = (int)A + (int)mem39213;
  3198. A = A + mem39213;
  3199. if(temp > 255) carry = 1;
  3200. mem39215 = A;
  3201. }
  3202. temp = mem39215 & 1;
  3203. mem39215 = (mem39215 >> 1) | (carry ? 128 : 0);
  3204. carry = temp;
  3205. //39033: ROR 39215
  3206. X--;
  3207. } while(X != 0);
  3208. temp = mem39214 & 128;
  3209. mem39214 = (mem39214 << 1) | (carry ? 1 : 0);
  3210. carry = temp;
  3211. temp = mem39215 & 128;
  3212. mem39215 = (mem39215 << 1) | (carry ? 1 : 0);
  3213. carry = temp;
  3214. return mem39215;
  3215. }
  3216. ////////////////////////////////////////////////////////////////////////////////////////////
  3217. //
  3218. // Sam
  3219. //
  3220. ////////////////////////////////////////////////////////////////////////////////////////////
  3221. //char input[]={"/HAALAOAO MAYN NAAMAEAE IHSTT SAEBAASTTIHAAN \x9b\x9b\0"};
  3222. //unsigned char input[]={"/HAALAOAO \x9b\0"};
  3223. //unsigned char input[]={"AA \x9b\0"};
  3224. //unsigned char input[] = {"GUH5DEHN TAEG\x9b\0"};
  3225. //unsigned char input[]={"AY5 AEM EY TAO4LXKIHNX KAX4MPYUX4TAH. GOW4 AH/HEH3D PAHNK.MEYK MAY8 DEY.\x9b\0"};
  3226. //unsigned char input[]={"/HEH3LOW2, /HAW AH YUX2 TUXDEY. AY /HOH3P YUX AH FIYLIHNX OW4 KEY.\x9b\0"};
  3227. //unsigned char input[]={"/HEY2, DHIHS IH3Z GREY2T. /HAH /HAH /HAH.AYL BIY5 BAEK.\x9b\0"};
  3228. //unsigned char input[]={"/HAH /HAH /HAH \x9b\0"};
  3229. //unsigned char input[]={"/HAH /HAH /HAH.\x9b\0"};
  3230. //unsigned char input[]={".TUW BIY5Y3,, OHR NAA3T - TUW BIY5IYIY., DHAE4T IHZ DHAH KWEH4SCHAHN.\x9b\0"};
  3231. //unsigned char input[]={"/HEY2, DHIHS \x9b\0"};
  3232. //unsigned char input[]={" IYIHEHAEAAAHAOOHUHUXERAXIX \x9b\0"};
  3233. //unsigned char input[]={" RLWWYMNNXBDGJZZHVDH \x9b\0"};
  3234. //unsigned char input[]={" SSHFTHPTKCH/H \x9b\0"};
  3235. //unsigned char input[]={" EYAYOYAWOWUW ULUMUNQ YXWXRXLX/XDX\x9b\0"};
  3236. void STM32SAM::SetInput(char* _input) {
  3237. int i, l;
  3238. l = strlen(_input);
  3239. if(l > 254) l = 254;
  3240. for(i = 0; i < l; i++) {
  3241. input[i] = _input[i];
  3242. }
  3243. input[l] = 0;
  3244. }
  3245. // 168=pitches
  3246. // 169=frequency1
  3247. // 170=frequency2
  3248. // 171=frequency3
  3249. // 172=amplitude1
  3250. // 173=amplitude2
  3251. // 174=amplitude3
  3252. void STM32SAM::Init() {
  3253. bufferpos = 0;
  3254. int i;
  3255. SetMouthThroat();
  3256. bufferpos = 0;
  3257. // TODO, check for free the memory, 10 seconds of output should be more than enough
  3258. //buffer = malloc(22050*10);
  3259. // buffer = (char*) calloc(1, sizeof(char));
  3260. /*
  3261. freq2data = &mem[45136];
  3262. freq1data = &mem[45056];
  3263. freq3data = &mem[45216];
  3264. */
  3265. //pitches = &mem[43008];
  3266. /*
  3267. frequency1 = &mem[43264];
  3268. frequency2 = &mem[43520];
  3269. frequency3 = &mem[43776];
  3270. */
  3271. /*
  3272. amplitude1 = &mem[44032];
  3273. amplitude2 = &mem[44288];
  3274. amplitude3 = &mem[44544];
  3275. */
  3276. //phoneme = &mem[39904];
  3277. /*
  3278. ampl1data = &mem[45296];
  3279. ampl2data = &mem[45376];
  3280. ampl3data = &mem[45456];
  3281. */
  3282. for(i = 0; i < 256; i++) {
  3283. stress[i] = 0;
  3284. phonemeLength[i] = 0;
  3285. }
  3286. for(i = 0; i < 60; i++) {
  3287. phonemeIndexOutput[i] = 0;
  3288. stressOutput[i] = 0;
  3289. phonemeLengthOutput[i] = 0;
  3290. }
  3291. phonemeindex[255] =
  3292. 255; //to prevent buffer overflow // ML : changed from 32 to 255 to stop freezing with long inputs
  3293. }
  3294. //int Code39771()
  3295. int STM32SAM::SAMMain() {
  3296. Init();
  3297. phonemeindex[255] = 32; //to prevent buffer overflow
  3298. if(!Parser1()) {
  3299. return 0;
  3300. }
  3301. Parser2();
  3302. CopyStress();
  3303. SetPhonemeLength();
  3304. AdjustLengths();
  3305. Code41240();
  3306. do {
  3307. A = phonemeindex[X];
  3308. if(A > 80) {
  3309. phonemeindex[X] = 255;
  3310. break; // error: delete all behind it
  3311. }
  3312. X++;
  3313. } while(X != 0);
  3314. //pos39848:
  3315. InsertBreath();
  3316. //mem[40158] = 255;
  3317. PrepareOutput();
  3318. return 1;
  3319. }
  3320. //void Code48547()
  3321. void STM32SAM::PrepareOutput() {
  3322. A = 0;
  3323. X = 0;
  3324. Y = 0;
  3325. //pos48551:
  3326. while(1) {
  3327. A = phonemeindex[X];
  3328. if(A == 255) {
  3329. A = 255;
  3330. phonemeIndexOutput[Y] = 255;
  3331. Render();
  3332. return;
  3333. }
  3334. if(A == 254) {
  3335. X++;
  3336. int temp = X;
  3337. //mem[48546] = X;
  3338. phonemeIndexOutput[Y] = 255;
  3339. Render();
  3340. //X = mem[48546];
  3341. X = temp;
  3342. Y = 0;
  3343. continue;
  3344. }
  3345. if(A == 0) {
  3346. X++;
  3347. continue;
  3348. }
  3349. phonemeIndexOutput[Y] = A;
  3350. phonemeLengthOutput[Y] = phonemeLength[X];
  3351. stressOutput[Y] = stress[X];
  3352. X++;
  3353. Y++;
  3354. }
  3355. }
  3356. //void Code41014()
  3357. void STM32SAM::Insert(
  3358. unsigned char position /*var57*/,
  3359. unsigned char mem60,
  3360. unsigned char mem59,
  3361. unsigned char mem58) {
  3362. int i;
  3363. for(i = 253; i >= position; i--) // ML : always keep last safe-guarding 255
  3364. {
  3365. phonemeindex[i + 1] = phonemeindex[i];
  3366. phonemeLength[i + 1] = phonemeLength[i];
  3367. stress[i + 1] = stress[i];
  3368. }
  3369. phonemeindex[position] = mem60;
  3370. phonemeLength[position] = mem59;
  3371. stress[position] = mem58;
  3372. return;
  3373. }
  3374. //void Code48431()
  3375. void STM32SAM::InsertBreath() {
  3376. unsigned char mem54;
  3377. unsigned char mem55;
  3378. unsigned char index; //variable Y
  3379. mem54 = 255;
  3380. X++;
  3381. mem55 = 0;
  3382. unsigned char mem66 = 0;
  3383. while(1) {
  3384. //pos48440:
  3385. X = mem66;
  3386. index = phonemeindex[X];
  3387. if(index == 255) return;
  3388. mem55 += phonemeLength[X];
  3389. if(mem55 < 232) {
  3390. if(index != 254) // ML : Prevents an index out of bounds problem
  3391. {
  3392. A = flags2[index] & 1;
  3393. if(A != 0) {
  3394. X++;
  3395. mem55 = 0;
  3396. Insert(X, 254, mem59, 0);
  3397. mem66++;
  3398. mem66++;
  3399. continue;
  3400. }
  3401. }
  3402. if(index == 0) mem54 = X;
  3403. mem66++;
  3404. continue;
  3405. }
  3406. X = mem54;
  3407. phonemeindex[X] = 31; // 'Q*' glottal stop
  3408. phonemeLength[X] = 4;
  3409. stress[X] = 0;
  3410. X++;
  3411. mem55 = 0;
  3412. Insert(X, 254, mem59, 0);
  3413. X++;
  3414. mem66 = X;
  3415. }
  3416. }
  3417. // Iterates through the phoneme buffer, copying the stress value from
  3418. // the following phoneme under the following circumstance:
  3419. // 1. The current phoneme is voiced, excluding plosives and fricatives
  3420. // 2. The following phoneme is voiced, excluding plosives and fricatives, and
  3421. // 3. The following phoneme is stressed
  3422. //
  3423. // In those cases, the stress value+1 from the following phoneme is copied.
  3424. //
  3425. // For example, the word LOITER is represented as LOY5TER, with as stress
  3426. // of 5 on the diphtong OY. This routine will copy the stress value of 6 (5+1)
  3427. // to the L that precedes it.
  3428. //void Code41883()
  3429. void STM32SAM::CopyStress() {
  3430. // loop thought all the phonemes to be output
  3431. unsigned char pos = 0; //mem66
  3432. while(1) {
  3433. // get the phomene
  3434. Y = phonemeindex[pos];
  3435. // exit at end of buffer
  3436. if(Y == 255) return;
  3437. // if CONSONANT_FLAG set, skip - only vowels get stress
  3438. if((flags[Y] & 64) == 0) {
  3439. pos++;
  3440. continue;
  3441. }
  3442. // get the next phoneme
  3443. Y = phonemeindex[pos + 1];
  3444. if(Y == 255) //prevent buffer overflow
  3445. {
  3446. pos++;
  3447. continue;
  3448. } else
  3449. // if the following phoneme is a vowel, skip
  3450. if((flags[Y] & 128) == 0) {
  3451. pos++;
  3452. continue;
  3453. }
  3454. // get the stress value at the next position
  3455. Y = stress[pos + 1];
  3456. // if next phoneme is not stressed, skip
  3457. if(Y == 0) {
  3458. pos++;
  3459. continue;
  3460. }
  3461. // if next phoneme is not a VOWEL OR ER, skip
  3462. if((Y & 128) != 0) {
  3463. pos++;
  3464. continue;
  3465. }
  3466. // copy stress from prior phoneme to this one
  3467. stress[pos] = Y + 1;
  3468. // advance pointer
  3469. pos++;
  3470. }
  3471. }
  3472. // The input[] buffer contains a string of phonemes and stress markers along
  3473. // the lines of:
  3474. //
  3475. // DHAX KAET IHZ AH5GLIY. <0x9B>
  3476. //
  3477. // The byte 0x9B marks the end of the buffer. Some phonemes are 2 bytes
  3478. // long, such as "DH" and "AX". Others are 1 byte long, such as "T" and "Z".
  3479. // There are also stress markers, such as "5" and ".".
  3480. //
  3481. // The first character of the phonemes are stored in the table signInputTable1[].
  3482. // The second character of the phonemes are stored in the table signInputTable2[].
  3483. // The stress characters are arranged in low to high stress order in stressInputTable[].
  3484. //
  3485. // The following process is used to parse the input[] buffer:
  3486. //
  3487. // Repeat until the <0x9B> character is reached:
  3488. //
  3489. // First, a search is made for a 2 character match for phonemes that do not
  3490. // end with the '*' (wildcard) character. On a match, the index of the phoneme
  3491. // is added to phonemeIndex[] and the buffer position is advanced 2 bytes.
  3492. //
  3493. // If this fails, a search is made for a 1 character match against all
  3494. // phoneme names ending with a '*' (wildcard). If this succeeds, the
  3495. // phoneme is added to phonemeIndex[] and the buffer position is advanced
  3496. // 1 byte.
  3497. //
  3498. // If this fails, search for a 1 character match in the stressInputTable[].
  3499. // If this succeeds, the stress value is placed in the last stress[] table
  3500. // at the same index of the last added phoneme, and the buffer position is
  3501. // advanced by 1 byte.
  3502. //
  3503. // If this fails, return a 0.
  3504. //
  3505. // On success:
  3506. //
  3507. // 1. phonemeIndex[] will contain the index of all the phonemes.
  3508. // 2. The last index in phonemeIndex[] will be 255.
  3509. // 3. stress[] will contain the stress value for each phoneme
  3510. // input[] holds the string of phonemes, each two bytes wide
  3511. // signInputTable1[] holds the first character of each phoneme
  3512. // signInputTable2[] holds te second character of each phoneme
  3513. // phonemeIndex[] holds the indexes of the phonemes after parsing input[]
  3514. //
  3515. // The parser scans through the input[], finding the names of the phonemes
  3516. // by searching signInputTable1[] and signInputTable2[]. On a match, it
  3517. // copies the index of the phoneme into the phonemeIndexTable[].
  3518. //
  3519. // The character <0x9B> marks the end of text in input[]. When it is reached,
  3520. // the index 255 is placed at the end of the phonemeIndexTable[], and the
  3521. // function returns with a 1 indicating success.
  3522. int STM32SAM::Parser1() {
  3523. int i;
  3524. unsigned char sign1;
  3525. unsigned char sign2;
  3526. unsigned char position = 0;
  3527. X = 0;
  3528. A = 0;
  3529. Y = 0;
  3530. // CLEAR THE STRESS TABLE
  3531. for(i = 0; i < 256; i++) stress[i] = 0;
  3532. // THIS CODE MATCHES THE PHONEME LETTERS TO THE TABLE
  3533. // pos41078:
  3534. while(1) {
  3535. // GET THE FIRST CHARACTER FROM THE PHONEME BUFFER
  3536. sign1 = input[X];
  3537. // TEST FOR 155 (�) END OF LINE MARKER
  3538. if(sign1 == 155) {
  3539. // MARK ENDPOINT AND RETURN
  3540. phonemeindex[position] = 255; //mark endpoint
  3541. // REACHED END OF PHONEMES, SO EXIT
  3542. return 1; //all ok
  3543. }
  3544. // GET THE NEXT CHARACTER FROM THE BUFFER
  3545. X++;
  3546. sign2 = input[X];
  3547. // NOW sign1 = FIRST CHARACTER OF PHONEME, AND sign2 = SECOND CHARACTER OF PHONEME
  3548. // TRY TO MATCH PHONEMES ON TWO TWO-CHARACTER NAME
  3549. // IGNORE PHONEMES IN TABLE ENDING WITH WILDCARDS
  3550. // SET INDEX TO 0
  3551. Y = 0;
  3552. pos41095:
  3553. // GET FIRST CHARACTER AT POSITION Y IN signInputTable
  3554. // --> should change name to PhonemeNameTable1
  3555. A = signInputTable1[Y];
  3556. // FIRST CHARACTER MATCHES?
  3557. if(A == sign1) {
  3558. // GET THE CHARACTER FROM THE PhonemeSecondLetterTable
  3559. A = signInputTable2[Y];
  3560. // NOT A SPECIAL AND MATCHES SECOND CHARACTER?
  3561. if((A != '*') && (A == sign2)) {
  3562. // STORE THE INDEX OF THE PHONEME INTO THE phomeneIndexTable
  3563. phonemeindex[position] = Y;
  3564. // ADVANCE THE POINTER TO THE phonemeIndexTable
  3565. position++;
  3566. // ADVANCE THE POINTER TO THE phonemeInputBuffer
  3567. X++;
  3568. // CONTINUE PARSING
  3569. continue;
  3570. }
  3571. }
  3572. // NO MATCH, TRY TO MATCH ON FIRST CHARACTER TO WILDCARD NAMES (ENDING WITH '*')
  3573. // ADVANCE TO THE NEXT POSITION
  3574. Y++;
  3575. // IF NOT END OF TABLE, CONTINUE
  3576. if(Y != 81) goto pos41095;
  3577. // REACHED END OF TABLE WITHOUT AN EXACT (2 CHARACTER) MATCH.
  3578. // THIS TIME, SEARCH FOR A 1 CHARACTER MATCH AGAINST THE WILDCARDS
  3579. // RESET THE INDEX TO POINT TO THE START OF THE PHONEME NAME TABLE
  3580. Y = 0;
  3581. pos41134:
  3582. // DOES THE PHONEME IN THE TABLE END WITH '*'?
  3583. if(signInputTable2[Y] == '*') {
  3584. // DOES THE FIRST CHARACTER MATCH THE FIRST LETTER OF THE PHONEME
  3585. if(signInputTable1[Y] == sign1) {
  3586. // SAVE THE POSITION AND MOVE AHEAD
  3587. phonemeindex[position] = Y;
  3588. // ADVANCE THE POINTER
  3589. position++;
  3590. // CONTINUE THROUGH THE LOOP
  3591. continue;
  3592. }
  3593. }
  3594. Y++;
  3595. if(Y != 81) goto pos41134; //81 is size of PHONEME NAME table
  3596. // FAILED TO MATCH WITH A WILDCARD. ASSUME THIS IS A STRESS
  3597. // CHARACTER. SEARCH THROUGH THE STRESS TABLE
  3598. // SET INDEX TO POSITION 8 (END OF STRESS TABLE)
  3599. Y = 8;
  3600. // WALK BACK THROUGH TABLE LOOKING FOR A MATCH
  3601. while((sign1 != stressInputTable[Y]) && (Y > 0)) {
  3602. // DECREMENT INDEX
  3603. Y--;
  3604. }
  3605. // REACHED THE END OF THE SEARCH WITHOUT BREAKING OUT OF LOOP?
  3606. if(Y == 0) {
  3607. //mem[39444] = X;
  3608. //41181: JSR 42043 //Error
  3609. // FAILED TO MATCH ANYTHING, RETURN 0 ON FAILURE
  3610. return 0;
  3611. }
  3612. // SET THE STRESS FOR THE PRIOR PHONEME
  3613. stress[position - 1] = Y;
  3614. } //while
  3615. }
  3616. //change phonemelength depedendent on stress
  3617. //void Code41203()
  3618. void STM32SAM::SetPhonemeLength() {
  3619. unsigned char A;
  3620. int position = 0;
  3621. while(phonemeindex[position] != 255) {
  3622. A = stress[position];
  3623. //41218: BMI 41229
  3624. if((A == 0) || ((A & 128) != 0)) {
  3625. phonemeLength[position] = phonemeLengthTable[phonemeindex[position]];
  3626. } else {
  3627. phonemeLength[position] = phonemeStressedLengthTable[phonemeindex[position]];
  3628. }
  3629. position++;
  3630. }
  3631. }
  3632. void STM32SAM::Code41240() {
  3633. unsigned char pos = 0;
  3634. while(phonemeindex[pos] != 255) {
  3635. unsigned char index; //register AC
  3636. X = pos;
  3637. index = phonemeindex[pos];
  3638. if((flags[index] & 2) == 0) {
  3639. pos++;
  3640. continue;
  3641. } else if((flags[index] & 1) == 0) {
  3642. Insert(pos + 1, index + 1, phonemeLengthTable[index + 1], stress[pos]);
  3643. Insert(pos + 2, index + 2, phonemeLengthTable[index + 2], stress[pos]);
  3644. pos += 3;
  3645. continue;
  3646. }
  3647. do {
  3648. X++;
  3649. A = phonemeindex[X];
  3650. } while(A == 0);
  3651. if(A != 255) {
  3652. if((flags[A] & 8) != 0) {
  3653. pos++;
  3654. continue;
  3655. }
  3656. if((A == 36) || (A == 37)) {
  3657. pos++; // '/H' '/X'
  3658. continue;
  3659. }
  3660. }
  3661. Insert(pos + 1, index + 1, phonemeLengthTable[index + 1], stress[pos]);
  3662. Insert(pos + 2, index + 2, phonemeLengthTable[index + 2], stress[pos]);
  3663. pos += 3;
  3664. }
  3665. }
  3666. // Rewrites the phonemes using the following rules:
  3667. //
  3668. // <DIPHTONG ENDING WITH WX> -> <DIPHTONG ENDING WITH WX> WX
  3669. // <DIPHTONG NOT ENDING WITH WX> -> <DIPHTONG NOT ENDING WITH WX> YX
  3670. // UL -> AX L
  3671. // UM -> AX M
  3672. // <STRESSED VOWEL> <SILENCE> <STRESSED VOWEL> -> <STRESSED VOWEL> <SILENCE> Q <VOWEL>
  3673. // T R -> CH R
  3674. // D R -> J R
  3675. // <VOWEL> R -> <VOWEL> RX
  3676. // <VOWEL> L -> <VOWEL> LX
  3677. // G S -> G Z
  3678. // K <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> KX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3679. // G <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> GX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3680. // S P -> S B
  3681. // S T -> S D
  3682. // S K -> S G
  3683. // S KX -> S GX
  3684. // <ALVEOLAR> UW -> <ALVEOLAR> UX
  3685. // CH -> CH CH' (CH requires two phonemes to represent it)
  3686. // J -> J J' (J requires two phonemes to represent it)
  3687. // <UNSTRESSED VOWEL> T <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3688. // <UNSTRESSED VOWEL> D <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3689. //void Code41397()
  3690. void STM32SAM::Parser2() {
  3691. unsigned char pos = 0; //mem66;
  3692. unsigned char mem58 = 0;
  3693. // Loop through phonemes
  3694. while(1) {
  3695. // SET X TO THE CURRENT POSITION
  3696. X = pos;
  3697. // GET THE PHONEME AT THE CURRENT POSITION
  3698. A = phonemeindex[pos];
  3699. // Is phoneme pause?
  3700. if(A == 0) {
  3701. // Move ahead to the
  3702. pos++;
  3703. continue;
  3704. }
  3705. // If end of phonemes flag reached, exit routine
  3706. if(A == 255) return;
  3707. // Copy the current phoneme index to Y
  3708. Y = A;
  3709. // RULE:
  3710. // <DIPHTONG ENDING WITH WX> -> <DIPHTONG ENDING WITH WX> WX
  3711. // <DIPHTONG NOT ENDING WITH WX> -> <DIPHTONG NOT ENDING WITH WX> YX
  3712. // Example: OIL, COW
  3713. // Check for DIPHTONG
  3714. if((flags[A] & 16) == 0) goto pos41457;
  3715. // Not a diphthong. Get the stress
  3716. mem58 = stress[pos];
  3717. // End in IY sound?
  3718. A = flags[Y] & 32;
  3719. // If ends with IY, use YX, else use WX
  3720. if(A == 0)
  3721. A = 20;
  3722. else
  3723. A = 21; // 'WX' = 20 'YX' = 21
  3724. //pos41443:
  3725. // Insert at WX or YX following, copying the stress
  3726. Insert(pos + 1, A, mem59, mem58);
  3727. X = pos;
  3728. // Jump to ???
  3729. goto pos41749;
  3730. pos41457:
  3731. // RULE:
  3732. // UL -> AX L
  3733. // Example: MEDDLE
  3734. // Get phoneme
  3735. A = phonemeindex[X];
  3736. // Skip this rule if phoneme is not UL
  3737. if(A != 78) goto pos41487; // 'UL'
  3738. A = 24; // 'L' //change 'UL' to 'AX L'
  3739. pos41466:
  3740. // Get current phoneme stress
  3741. mem58 = stress[X];
  3742. // Change UL to AX
  3743. phonemeindex[X] = 13; // 'AX'
  3744. // Perform insert. Note code below may jump up here with different values
  3745. Insert(X + 1, A, mem59, mem58);
  3746. pos++;
  3747. // Move to next phoneme
  3748. continue;
  3749. pos41487:
  3750. // RULE:
  3751. // UM -> AX M
  3752. // Example: ASTRONOMY
  3753. // Skip rule if phoneme != UM
  3754. if(A != 79) goto pos41495; // 'UM'
  3755. // Jump up to branch - replaces current phoneme with AX and continues
  3756. A = 27; // 'M' //change 'UM' to 'AX M'
  3757. goto pos41466;
  3758. pos41495:
  3759. // RULE:
  3760. // UN -> AX N
  3761. // Example: FUNCTION
  3762. // Skip rule if phoneme != UN
  3763. if(A != 80) goto pos41503; // 'UN'
  3764. // Jump up to branch - replaces current phoneme with AX and continues
  3765. A = 28; // 'N' //change UN to 'AX N'
  3766. goto pos41466;
  3767. pos41503:
  3768. // RULE:
  3769. // <STRESSED VOWEL> <SILENCE> <STRESSED VOWEL> -> <STRESSED VOWEL> <SILENCE> Q <VOWEL>
  3770. // EXAMPLE: AWAY EIGHT
  3771. Y = A;
  3772. // VOWEL set?
  3773. A = flags[A] & 128;
  3774. // Skip if not a vowel
  3775. if(A != 0) {
  3776. // Get the stress
  3777. A = stress[X];
  3778. // If stressed...
  3779. if(A != 0) {
  3780. // Get the following phoneme
  3781. X++;
  3782. A = phonemeindex[X];
  3783. // If following phoneme is a pause
  3784. if(A == 0) {
  3785. // Get the phoneme following pause
  3786. X++;
  3787. Y = phonemeindex[X];
  3788. // Check for end of buffer flag
  3789. if(Y == 255) //buffer overflow
  3790. // ??? Not sure about these flags
  3791. A = 65 & 128;
  3792. else
  3793. // And VOWEL flag to current phoneme's flags
  3794. A = flags[Y] & 128;
  3795. // If following phonemes is not a pause
  3796. if(A != 0) {
  3797. // If the following phoneme is not stressed
  3798. A = stress[X];
  3799. if(A != 0) {
  3800. // 31 = 'Q'
  3801. Insert(X, 31, mem59, 0);
  3802. pos++;
  3803. continue;
  3804. }
  3805. }
  3806. }
  3807. }
  3808. }
  3809. // RULES FOR PHONEMES BEFORE R
  3810. // T R -> CH R
  3811. // Example: TRACK
  3812. // Get current position and phoneme
  3813. X = pos;
  3814. A = phonemeindex[pos];
  3815. if(A != 23) goto pos41611; // 'R'
  3816. // Look at prior phoneme
  3817. X--;
  3818. A = phonemeindex[pos - 1];
  3819. //pos41567:
  3820. if(A == 69) // 'T'
  3821. {
  3822. phonemeindex[pos - 1] = 42;
  3823. goto pos41779;
  3824. }
  3825. // RULES FOR PHONEMES BEFORE R
  3826. // D R -> J R
  3827. // Example: DRY
  3828. // Prior phonemes D?
  3829. if(A == 57) // 'D'
  3830. {
  3831. // Change D to J
  3832. phonemeindex[pos - 1] = 44;
  3833. goto pos41788;
  3834. }
  3835. // RULES FOR PHONEMES BEFORE R
  3836. // <VOWEL> R -> <VOWEL> RX
  3837. // Example: ART
  3838. // If vowel flag is set change R to RX
  3839. A = flags[A] & 128;
  3840. if(A != 0) phonemeindex[pos] = 18; // 'RX'
  3841. // continue to next phoneme
  3842. pos++;
  3843. continue;
  3844. pos41611:
  3845. // RULE:
  3846. // <VOWEL> L -> <VOWEL> LX
  3847. // Example: ALL
  3848. // Is phoneme L?
  3849. if(A == 24) // 'L'
  3850. {
  3851. // If prior phoneme does not have VOWEL flag set, move to next phoneme
  3852. if((flags[phonemeindex[pos - 1]] & 128) == 0) {
  3853. pos++;
  3854. continue;
  3855. }
  3856. // Prior phoneme has VOWEL flag set, so change L to LX and move to next phoneme
  3857. phonemeindex[X] = 19; // 'LX'
  3858. pos++;
  3859. continue;
  3860. }
  3861. // RULE:
  3862. // G S -> G Z
  3863. //
  3864. // Can't get to fire -
  3865. // 1. The G -> GX rule intervenes
  3866. // 2. Reciter already replaces GS -> GZ
  3867. // Is current phoneme S?
  3868. if(A == 32) // 'S'
  3869. {
  3870. // If prior phoneme is not G, move to next phoneme
  3871. if(phonemeindex[pos - 1] != 60) {
  3872. pos++;
  3873. continue;
  3874. }
  3875. // Replace S with Z and move on
  3876. phonemeindex[pos] = 38; // 'Z'
  3877. pos++;
  3878. continue;
  3879. }
  3880. // RULE:
  3881. // K <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> KX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3882. // Example: COW
  3883. // Is current phoneme K?
  3884. if(A == 72) // 'K'
  3885. {
  3886. // Get next phoneme
  3887. Y = phonemeindex[pos + 1];
  3888. // If at end, replace current phoneme with KX
  3889. if(Y == 255)
  3890. phonemeindex[pos] = 75; // ML : prevents an index out of bounds problem
  3891. else {
  3892. // VOWELS AND DIPHTONGS ENDING WITH IY SOUND flag set?
  3893. A = flags[Y] & 32;
  3894. // Replace with KX
  3895. if(A == 0) phonemeindex[pos] = 75; // 'KX'
  3896. }
  3897. } else
  3898. // RULE:
  3899. // G <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> GX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3900. // Example: GO
  3901. // Is character a G?
  3902. if(A == 60) // 'G'
  3903. {
  3904. // Get the following character
  3905. unsigned char index = phonemeindex[pos + 1];
  3906. // At end of buffer?
  3907. if(index == 255) //prevent buffer overflow
  3908. {
  3909. pos++;
  3910. continue;
  3911. } else
  3912. // If diphtong ending with YX, move continue processing next phoneme
  3913. if((flags[index] & 32) != 0) {
  3914. pos++;
  3915. continue;
  3916. }
  3917. // replace G with GX and continue processing next phoneme
  3918. phonemeindex[pos] = 63; // 'GX'
  3919. pos++;
  3920. continue;
  3921. }
  3922. // RULE:
  3923. // S P -> S B
  3924. // S T -> S D
  3925. // S K -> S G
  3926. // S KX -> S GX
  3927. // Examples: SPY, STY, SKY, SCOWL
  3928. Y = phonemeindex[pos];
  3929. //pos41719:
  3930. // Replace with softer version?
  3931. A = flags[Y] & 1;
  3932. if(A == 0) goto pos41749;
  3933. A = phonemeindex[pos - 1];
  3934. if(A != 32) // 'S'
  3935. {
  3936. A = Y;
  3937. goto pos41812;
  3938. }
  3939. // Replace with softer version
  3940. phonemeindex[pos] = Y - 12;
  3941. pos++;
  3942. continue;
  3943. pos41749:
  3944. // RULE:
  3945. // <ALVEOLAR> UW -> <ALVEOLAR> UX
  3946. //
  3947. // Example: NEW, DEW, SUE, ZOO, THOO, TOO
  3948. // UW -> UX
  3949. A = phonemeindex[X];
  3950. if(A == 53) // 'UW'
  3951. {
  3952. // ALVEOLAR flag set?
  3953. Y = phonemeindex[X - 1];
  3954. A = flags2[Y] & 4;
  3955. // If not set, continue processing next phoneme
  3956. if(A == 0) {
  3957. pos++;
  3958. continue;
  3959. }
  3960. phonemeindex[X] = 16;
  3961. pos++;
  3962. continue;
  3963. }
  3964. pos41779:
  3965. // RULE:
  3966. // CH -> CH CH' (CH requires two phonemes to represent it)
  3967. // Example: CHEW
  3968. if(A == 42) // 'CH'
  3969. {
  3970. // pos41783:
  3971. Insert(X + 1, A + 1, mem59, stress[X]);
  3972. pos++;
  3973. continue;
  3974. }
  3975. pos41788:
  3976. // RULE:
  3977. // J -> J J' (J requires two phonemes to represent it)
  3978. // Example: JAY
  3979. if(A == 44) // 'J'
  3980. {
  3981. Insert(X + 1, A + 1, mem59, stress[X]);
  3982. pos++;
  3983. continue;
  3984. }
  3985. // Jump here to continue
  3986. pos41812:
  3987. // RULE: Soften T following vowel
  3988. // NOTE: This rule fails for cases such as "ODD"
  3989. // <UNSTRESSED VOWEL> T <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3990. // <UNSTRESSED VOWEL> D <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3991. // Example: PARTY, TARDY
  3992. // Past this point, only process if phoneme is T or D
  3993. if(A != 69) // 'T'
  3994. if(A != 57) {
  3995. pos++; // 'D'
  3996. continue;
  3997. }
  3998. //pos41825:
  3999. // If prior phoneme is not a vowel, continue processing phonemes
  4000. if((flags[phonemeindex[X - 1]] & 128) == 0) {
  4001. pos++;
  4002. continue;
  4003. }
  4004. // Get next phoneme
  4005. X++;
  4006. A = phonemeindex[X];
  4007. //pos41841
  4008. // Is the next phoneme a pause?
  4009. if(A != 0) {
  4010. // If next phoneme is not a pause, continue processing phonemes
  4011. if((flags[A] & 128) == 0) {
  4012. pos++;
  4013. continue;
  4014. }
  4015. // If next phoneme is stressed, continue processing phonemes
  4016. // FIXME: How does a pause get stressed?
  4017. if(stress[X] != 0) {
  4018. pos++;
  4019. continue;
  4020. }
  4021. //pos41856:
  4022. // Set phonemes to DX
  4023. phonemeindex[pos] = 30; // 'DX'
  4024. } else {
  4025. A = phonemeindex[X + 1];
  4026. if(A == 255) //prevent buffer overflow
  4027. A = 65 & 128;
  4028. else
  4029. // Is next phoneme a vowel or ER?
  4030. A = flags[A] & 128;
  4031. if(A != 0) phonemeindex[pos] = 30; // 'DX'
  4032. }
  4033. pos++;
  4034. } // while
  4035. } // parser 2
  4036. // Applies various rules that adjust the lengths of phonemes
  4037. //
  4038. // Lengthen <FRICATIVE> or <VOICED> between <VOWEL> and <PUNCTUATION> by 1.5
  4039. // <VOWEL> <RX | LX> <CONSONANT> - decrease <VOWEL> length by 1
  4040. // <VOWEL> <UNVOICED PLOSIVE> - decrease vowel by 1/8th
  4041. // <VOWEL> <UNVOICED CONSONANT> - increase vowel by 1/2 + 1
  4042. // <NASAL> <STOP CONSONANT> - set nasal = 5, consonant = 6
  4043. // <VOICED STOP CONSONANT> {optional silence} <STOP CONSONANT> - shorten both to 1/2 + 1
  4044. // <LIQUID CONSONANT> <DIPHTONG> - decrease by 2
  4045. //void Code48619()
  4046. void STM32SAM::AdjustLengths() {
  4047. // LENGTHEN VOWELS PRECEDING PUNCTUATION
  4048. //
  4049. // Search for punctuation. If found, back up to the first vowel, then
  4050. // process all phonemes between there and up to (but not including) the punctuation.
  4051. // If any phoneme is found that is a either a fricative or voiced, the duration is
  4052. // increased by (length * 1.5) + 1
  4053. // loop index
  4054. X = 0;
  4055. unsigned char index;
  4056. // iterate through the phoneme list
  4057. unsigned char loopIndex = 0;
  4058. while(1) {
  4059. // get a phoneme
  4060. index = phonemeindex[X];
  4061. // exit loop if end on buffer token
  4062. if(index == 255) break;
  4063. // not punctuation?
  4064. if((flags2[index] & 1) == 0) {
  4065. // skip
  4066. X++;
  4067. continue;
  4068. }
  4069. // hold index
  4070. loopIndex = X;
  4071. // Loop backwards from this point
  4072. pos48644:
  4073. // back up one phoneme
  4074. X--;
  4075. // stop once the beginning is reached
  4076. if(X == 0) break;
  4077. // get the preceding phoneme
  4078. index = phonemeindex[X];
  4079. if(index != 255) //inserted to prevent access overrun
  4080. if((flags[index] & 128) == 0) goto pos48644; // if not a vowel, continue looping
  4081. //pos48657:
  4082. do {
  4083. // test for vowel
  4084. index = phonemeindex[X];
  4085. if(index != 255) //inserted to prevent access overrun
  4086. // test for fricative/unvoiced or not voiced
  4087. if(((flags2[index] & 32) == 0) || ((flags[index] & 4) != 0)) //nochmal �berpr�fen
  4088. {
  4089. //A = flags[Y] & 4;
  4090. //if(A == 0) goto pos48688;
  4091. // get the phoneme length
  4092. A = phonemeLength[X];
  4093. // change phoneme length to (length * 1.5) + 1
  4094. A = (A >> 1) + A + 1;
  4095. phonemeLength[X] = A;
  4096. }
  4097. // keep moving forward
  4098. X++;
  4099. } while(X != loopIndex);
  4100. // if (X != loopIndex) goto pos48657;
  4101. X++;
  4102. } // while
  4103. // Similar to the above routine, but shorten vowels under some circumstances
  4104. // Loop throught all phonemes
  4105. loopIndex = 0;
  4106. //pos48697
  4107. while(1) {
  4108. // get a phoneme
  4109. X = loopIndex;
  4110. index = phonemeindex[X];
  4111. // exit routine at end token
  4112. if(index == 255) return;
  4113. // vowel?
  4114. A = flags[index] & 128;
  4115. if(A != 0) {
  4116. // get next phoneme
  4117. X++;
  4118. index = phonemeindex[X];
  4119. // get flags
  4120. if(index == 255)
  4121. mem56 = 65; // use if end marker
  4122. else
  4123. mem56 = flags[index];
  4124. // not a consonant
  4125. if((mem56 & 64) == 0) {
  4126. // RX or LX?
  4127. if((index == 18) || (index == 19)) // 'RX' & 'LX'
  4128. {
  4129. // get the next phoneme
  4130. X++;
  4131. index = phonemeindex[X];
  4132. // next phoneme a consonant?
  4133. if((mem56 & 64) != 0) {
  4134. // RULE: <VOWEL> RX | LX <CONSONANT>
  4135. // decrease length of vowel by 1 frame
  4136. phonemeLength[loopIndex]--;
  4137. }
  4138. // move ahead
  4139. loopIndex++;
  4140. continue;
  4141. }
  4142. // move ahead
  4143. loopIndex++;
  4144. continue;
  4145. }
  4146. // Got here if not <VOWEL>
  4147. // not voiced
  4148. if((mem56 & 4) == 0) {
  4149. // Unvoiced
  4150. // *, .*, ?*, ,*, -*, DX, S*, SH, F*, TH, /H, /X, CH, P*, T*, K*, KX
  4151. // not an unvoiced plosive?
  4152. if((mem56 & 1) == 0) {
  4153. // move ahead
  4154. loopIndex++;
  4155. continue;
  4156. }
  4157. // P*, T*, K*, KX
  4158. // RULE: <VOWEL> <UNVOICED PLOSIVE>
  4159. // <VOWEL> <P*, T*, K*, KX>
  4160. // move back
  4161. X--;
  4162. // decrease length by 1/8th
  4163. mem56 = phonemeLength[X] >> 3;
  4164. phonemeLength[X] -= mem56;
  4165. // move ahead
  4166. loopIndex++;
  4167. continue;
  4168. }
  4169. // RULE: <VOWEL> <VOICED CONSONANT>
  4170. // <VOWEL> <WH, R*, L*, W*, Y*, M*, N*, NX, DX, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX>
  4171. // decrease length
  4172. A = phonemeLength[X - 1];
  4173. phonemeLength[X - 1] = (A >> 2) + A + 1; // 5/4*A + 1
  4174. // move ahead
  4175. loopIndex++;
  4176. continue;
  4177. }
  4178. // WH, R*, L*, W*, Y*, M*, N*, NX, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX
  4179. //pos48821:
  4180. // RULE: <NASAL> <STOP CONSONANT>
  4181. // Set punctuation length to 6
  4182. // Set stop consonant length to 5
  4183. // nasal?
  4184. if((flags2[index] & 8) != 0) {
  4185. // M*, N*, NX,
  4186. // get the next phoneme
  4187. X++;
  4188. index = phonemeindex[X];
  4189. // end of buffer?
  4190. if(index == 255)
  4191. A = 65 & 2; //prevent buffer overflow
  4192. else
  4193. A = flags[index] & 2; // check for stop consonant
  4194. // is next phoneme a stop consonant?
  4195. if(A != 0)
  4196. // B*, D*, G*, GX, P*, T*, K*, KX
  4197. {
  4198. // set stop consonant length to 6
  4199. phonemeLength[X] = 6;
  4200. // set nasal length to 5
  4201. phonemeLength[X - 1] = 5;
  4202. }
  4203. // move to next phoneme
  4204. loopIndex++;
  4205. continue;
  4206. }
  4207. // WH, R*, L*, W*, Y*, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX
  4208. // RULE: <VOICED STOP CONSONANT> {optional silence} <STOP CONSONANT>
  4209. // Shorten both to (length/2 + 1)
  4210. // (voiced) stop consonant?
  4211. if((flags[index] & 2) != 0) {
  4212. // B*, D*, G*, GX
  4213. // move past silence
  4214. do {
  4215. // move ahead
  4216. X++;
  4217. index = phonemeindex[X];
  4218. } while(index == 0);
  4219. // check for end of buffer
  4220. if(index == 255) //buffer overflow
  4221. {
  4222. // ignore, overflow code
  4223. if((65 & 2) == 0) {
  4224. loopIndex++;
  4225. continue;
  4226. }
  4227. } else if((flags[index] & 2) == 0) {
  4228. // if another stop consonant, move ahead
  4229. loopIndex++;
  4230. continue;
  4231. }
  4232. // RULE: <UNVOICED STOP CONSONANT> {optional silence} <STOP CONSONANT>
  4233. // X gets overwritten, so hold prior X value for debug statement
  4234. // int debugX = X;
  4235. // shorten the prior phoneme length to (length/2 + 1)
  4236. phonemeLength[X] = (phonemeLength[X] >> 1) + 1;
  4237. X = loopIndex;
  4238. // also shorten this phoneme length to (length/2 +1)
  4239. phonemeLength[loopIndex] = (phonemeLength[loopIndex] >> 1) + 1;
  4240. // move ahead
  4241. loopIndex++;
  4242. continue;
  4243. }
  4244. // WH, R*, L*, W*, Y*, Q*, Z*, ZH, V*, DH, J*, **,
  4245. // RULE: <VOICED NON-VOWEL> <DIPHTONG>
  4246. // Decrease <DIPHTONG> by 2
  4247. // liquic consonant?
  4248. if((flags2[index] & 16) != 0) {
  4249. // R*, L*, W*, Y*
  4250. // get the prior phoneme
  4251. index = phonemeindex[X - 1];
  4252. // prior phoneme a stop consonant>
  4253. if((flags[index] & 2) != 0) {
  4254. // Rule: <LIQUID CONSONANT> <DIPHTONG>
  4255. // decrease the phoneme length by 2 frames (20 ms)
  4256. phonemeLength[X] -= 2;
  4257. }
  4258. }
  4259. // move to next phoneme
  4260. loopIndex++;
  4261. continue;
  4262. }
  4263. // goto pos48701;
  4264. }
  4265. // -------------------------------------------------------------------------
  4266. // ML : Code47503 is division with remainder, and mem50 gets the sign
  4267. void STM32SAM::Code47503(unsigned char mem52) {
  4268. Y = 0;
  4269. if((mem53 & 128) != 0) {
  4270. mem53 = -mem53;
  4271. Y = 128;
  4272. }
  4273. mem50 = Y;
  4274. A = 0;
  4275. for(X = 8; X > 0; X--) {
  4276. int temp = mem53;
  4277. mem53 = mem53 << 1;
  4278. A = A << 1;
  4279. if(temp >= 128) A++;
  4280. if(A >= mem52) {
  4281. A = A - mem52;
  4282. mem53++;
  4283. }
  4284. }
  4285. mem51 = A;
  4286. if((mem50 & 128) != 0) mem53 = -mem53;
  4287. }
  4288. ////////////////////////////////////////////////////////////////////////////////////////////
  4289. //
  4290. // Reciter
  4291. //
  4292. ////////////////////////////////////////////////////////////////////////////////////////////
  4293. void STM32SAM::Code37055(unsigned char mem59) {
  4294. X = mem59;
  4295. X--;
  4296. A = inputtemp[X];
  4297. Y = A;
  4298. A = tab36376[Y];
  4299. return;
  4300. }
  4301. void STM32SAM::Code37066(unsigned char mem58) {
  4302. X = mem58;
  4303. X++;
  4304. A = inputtemp[X];
  4305. Y = A;
  4306. A = tab36376[Y];
  4307. }
  4308. unsigned char STM32SAM::GetRuleByte(unsigned short mem62, unsigned char Y) {
  4309. unsigned int address = mem62;
  4310. if(mem62 >= 37541) {
  4311. address -= 37541;
  4312. return rules2[address + Y];
  4313. }
  4314. address -= 32000;
  4315. return rules[address + Y];
  4316. }
  4317. int STM32SAM::TextToPhonemes(unsigned char* input) // Code36484
  4318. {
  4319. //unsigned char *tab39445 = &mem[39445]; //input and output
  4320. //unsigned char mem29;
  4321. unsigned char mem56; //output position for phonemes
  4322. unsigned char mem57;
  4323. unsigned char mem58;
  4324. unsigned char mem59;
  4325. unsigned char mem60;
  4326. unsigned char mem61;
  4327. unsigned short mem62; // memory position of current rule
  4328. unsigned char mem64; // position of '=' or current character
  4329. unsigned char mem65; // position of ')'
  4330. unsigned char mem66; // position of '('
  4331. unsigned char mem36653;
  4332. inputtemp[0] = 32;
  4333. // secure copy of input
  4334. // because input will be overwritten by phonemes
  4335. X = 1;
  4336. Y = 0;
  4337. do {
  4338. //pos36499:
  4339. A = input[Y] & 127;
  4340. if(A >= 112)
  4341. A = A & 95;
  4342. else if(A >= 96)
  4343. A = A & 79;
  4344. inputtemp[X] = A;
  4345. X++;
  4346. Y++;
  4347. } while(Y != 255);
  4348. X = 255;
  4349. inputtemp[X] = 27;
  4350. mem61 = 255;
  4351. pos36550:
  4352. A = 255;
  4353. mem56 = 255;
  4354. pos36554:
  4355. while(1) {
  4356. mem61++;
  4357. X = mem61;
  4358. A = inputtemp[X];
  4359. mem64 = A;
  4360. if(A == '[') {
  4361. mem56++;
  4362. X = mem56;
  4363. A = 155;
  4364. input[X] = 155;
  4365. //goto pos36542;
  4366. // Code39771(); //Code39777();
  4367. return 1;
  4368. }
  4369. //pos36579:
  4370. if(A != '.') break;
  4371. X++;
  4372. Y = inputtemp[X];
  4373. A = tab36376[Y] & 1;
  4374. if(A != 0) break;
  4375. mem56++;
  4376. X = mem56;
  4377. A = '.';
  4378. input[X] = '.';
  4379. } //while
  4380. //pos36607:
  4381. A = mem64;
  4382. Y = A;
  4383. A = tab36376[A];
  4384. mem57 = A;
  4385. if((A & 2) != 0) {
  4386. mem62 = 37541;
  4387. goto pos36700;
  4388. }
  4389. //pos36630:
  4390. A = mem57;
  4391. if(A != 0) goto pos36677;
  4392. A = 32;
  4393. inputtemp[X] = ' ';
  4394. mem56++;
  4395. X = mem56;
  4396. if(X > 120) goto pos36654;
  4397. input[X] = A;
  4398. goto pos36554;
  4399. // -----
  4400. //36653 is unknown. Contains position
  4401. pos36654:
  4402. input[X] = 155;
  4403. A = mem61;
  4404. mem36653 = A;
  4405. // mem29 = A; // not used
  4406. // Code36538(); das ist eigentlich
  4407. return 1;
  4408. //Code39771();
  4409. //go on if there is more input ???
  4410. mem61 = mem36653;
  4411. goto pos36550;
  4412. pos36677:
  4413. A = mem57 & 128;
  4414. if(A == 0) {
  4415. //36683: BRK
  4416. return 0;
  4417. }
  4418. // go to the right rules for this character.
  4419. X = mem64 - 'A';
  4420. mem62 = tab37489[X] | (tab37515[X] << 8);
  4421. // -------------------------------------
  4422. // go to next rule
  4423. // -------------------------------------
  4424. pos36700:
  4425. // find next rule
  4426. Y = 0;
  4427. do {
  4428. mem62 += 1;
  4429. A = GetRuleByte(mem62, Y);
  4430. } while((A & 128) == 0);
  4431. Y++;
  4432. //pos36720:
  4433. // find '('
  4434. while(1) {
  4435. A = GetRuleByte(mem62, Y);
  4436. if(A == '(') break;
  4437. Y++;
  4438. }
  4439. mem66 = Y;
  4440. //pos36732:
  4441. // find ')'
  4442. do {
  4443. Y++;
  4444. A = GetRuleByte(mem62, Y);
  4445. } while(A != ')');
  4446. mem65 = Y;
  4447. //pos36741:
  4448. // find '='
  4449. do {
  4450. Y++;
  4451. A = GetRuleByte(mem62, Y);
  4452. A = A & 127;
  4453. } while(A != '=');
  4454. mem64 = Y;
  4455. X = mem61;
  4456. mem60 = X;
  4457. // compare the string within the bracket
  4458. Y = mem66;
  4459. Y++;
  4460. //pos36759:
  4461. while(1) {
  4462. mem57 = inputtemp[X];
  4463. A = GetRuleByte(mem62, Y);
  4464. if(A != mem57) goto pos36700;
  4465. Y++;
  4466. if(Y == mem65) break;
  4467. X++;
  4468. mem60 = X;
  4469. }
  4470. // the string in the bracket is correct
  4471. //pos36787:
  4472. A = mem61;
  4473. mem59 = mem61;
  4474. pos36791:
  4475. while(1) {
  4476. mem66--;
  4477. Y = mem66;
  4478. A = GetRuleByte(mem62, Y);
  4479. mem57 = A;
  4480. //36800: BPL 36805
  4481. if((A & 128) != 0) goto pos37180;
  4482. X = A & 127;
  4483. A = tab36376[X] & 128;
  4484. if(A == 0) break;
  4485. X = mem59 - 1;
  4486. A = inputtemp[X];
  4487. if(A != mem57) goto pos36700;
  4488. mem59 = X;
  4489. }
  4490. //pos36833:
  4491. A = mem57;
  4492. if(A == ' ') goto pos36895;
  4493. if(A == '#') goto pos36910;
  4494. if(A == '.') goto pos36920;
  4495. if(A == '&') goto pos36935;
  4496. if(A == '@') goto pos36967;
  4497. if(A == '^') goto pos37004;
  4498. if(A == '+') goto pos37019;
  4499. if(A == ':') goto pos37040;
  4500. // Code42041(); //Error
  4501. //36894: BRK
  4502. return 0;
  4503. // --------------
  4504. pos36895:
  4505. Code37055(mem59);
  4506. A = A & 128;
  4507. if(A != 0) goto pos36700;
  4508. pos36905:
  4509. mem59 = X;
  4510. goto pos36791;
  4511. // --------------
  4512. pos36910:
  4513. Code37055(mem59);
  4514. A = A & 64;
  4515. if(A != 0) goto pos36905;
  4516. goto pos36700;
  4517. // --------------
  4518. pos36920:
  4519. Code37055(mem59);
  4520. A = A & 8;
  4521. if(A == 0) goto pos36700;
  4522. pos36930:
  4523. mem59 = X;
  4524. goto pos36791;
  4525. // --------------
  4526. pos36935:
  4527. Code37055(mem59);
  4528. A = A & 16;
  4529. if(A != 0) goto pos36930;
  4530. A = inputtemp[X];
  4531. if(A != 72) goto pos36700;
  4532. X--;
  4533. A = inputtemp[X];
  4534. if((A == 67) || (A == 83)) goto pos36930;
  4535. goto pos36700;
  4536. // --------------
  4537. pos36967:
  4538. Code37055(mem59);
  4539. A = A & 4;
  4540. if(A != 0) goto pos36930;
  4541. A = inputtemp[X];
  4542. if(A != 72) goto pos36700;
  4543. if((A != 84) && (A != 67) && (A != 83)) goto pos36700;
  4544. mem59 = X;
  4545. goto pos36791;
  4546. // --------------
  4547. pos37004:
  4548. Code37055(mem59);
  4549. A = A & 32;
  4550. if(A == 0) goto pos36700;
  4551. pos37014:
  4552. mem59 = X;
  4553. goto pos36791;
  4554. // --------------
  4555. pos37019:
  4556. X = mem59;
  4557. X--;
  4558. A = inputtemp[X];
  4559. if((A == 'E') || (A == 'I') || (A == 'Y')) goto pos37014;
  4560. goto pos36700;
  4561. // --------------
  4562. pos37040:
  4563. Code37055(mem59);
  4564. A = A & 32;
  4565. if(A == 0) goto pos36791;
  4566. mem59 = X;
  4567. goto pos37040;
  4568. //---------------------------------------
  4569. pos37077:
  4570. X = mem58 + 1;
  4571. A = inputtemp[X];
  4572. if(A != 'E') goto pos37157;
  4573. X++;
  4574. Y = inputtemp[X];
  4575. X--;
  4576. A = tab36376[Y] & 128;
  4577. if(A == 0) goto pos37108;
  4578. X++;
  4579. A = inputtemp[X];
  4580. if(A != 'R') goto pos37113;
  4581. pos37108:
  4582. mem58 = X;
  4583. goto pos37184;
  4584. pos37113:
  4585. if((A == 83) || (A == 68)) goto pos37108; // 'S' 'D'
  4586. if(A != 76) goto pos37135; // 'L'
  4587. X++;
  4588. A = inputtemp[X];
  4589. if(A != 89) goto pos36700;
  4590. goto pos37108;
  4591. pos37135:
  4592. if(A != 70) goto pos36700;
  4593. X++;
  4594. A = inputtemp[X];
  4595. if(A != 85) goto pos36700;
  4596. X++;
  4597. A = inputtemp[X];
  4598. if(A == 76) goto pos37108;
  4599. goto pos36700;
  4600. pos37157:
  4601. if(A != 73) goto pos36700;
  4602. X++;
  4603. A = inputtemp[X];
  4604. if(A != 78) goto pos36700;
  4605. X++;
  4606. A = inputtemp[X];
  4607. if(A == 71) goto pos37108;
  4608. //pos37177:
  4609. goto pos36700;
  4610. // -----------------------------------------
  4611. pos37180:
  4612. A = mem60;
  4613. mem58 = A;
  4614. pos37184:
  4615. Y = mem65 + 1;
  4616. //37187: CPY 64
  4617. // if(? != 0) goto pos37194;
  4618. if(Y == mem64) goto pos37455;
  4619. mem65 = Y;
  4620. //37196: LDA (62),y
  4621. A = GetRuleByte(mem62, Y);
  4622. mem57 = A;
  4623. X = A;
  4624. A = tab36376[X] & 128;
  4625. if(A == 0) goto pos37226;
  4626. X = mem58 + 1;
  4627. A = inputtemp[X];
  4628. if(A != mem57) goto pos36700;
  4629. mem58 = X;
  4630. goto pos37184;
  4631. pos37226:
  4632. A = mem57;
  4633. if(A == 32) goto pos37295; // ' '
  4634. if(A == 35) goto pos37310; // '#'
  4635. if(A == 46) goto pos37320; // '.'
  4636. if(A == 38) goto pos37335; // '&'
  4637. if(A == 64) goto pos37367; // ''
  4638. if(A == 94) goto pos37404; // ''
  4639. if(A == 43) goto pos37419; // '+'
  4640. if(A == 58) goto pos37440; // ':'
  4641. if(A == 37) goto pos37077; // '%'
  4642. //pos37291:
  4643. // Code42041(); //Error
  4644. //37294: BRK
  4645. return 0;
  4646. // --------------
  4647. pos37295:
  4648. Code37066(mem58);
  4649. A = A & 128;
  4650. if(A != 0) goto pos36700;
  4651. pos37305:
  4652. mem58 = X;
  4653. goto pos37184;
  4654. // --------------
  4655. pos37310:
  4656. Code37066(mem58);
  4657. A = A & 64;
  4658. if(A != 0) goto pos37305;
  4659. goto pos36700;
  4660. // --------------
  4661. pos37320:
  4662. Code37066(mem58);
  4663. A = A & 8;
  4664. if(A == 0) goto pos36700;
  4665. pos37330:
  4666. mem58 = X;
  4667. goto pos37184;
  4668. // --------------
  4669. pos37335:
  4670. Code37066(mem58);
  4671. A = A & 16;
  4672. if(A != 0) goto pos37330;
  4673. A = inputtemp[X];
  4674. if(A != 72) goto pos36700;
  4675. X++;
  4676. A = inputtemp[X];
  4677. if((A == 67) || (A == 83)) goto pos37330;
  4678. goto pos36700;
  4679. // --------------
  4680. pos37367:
  4681. Code37066(mem58);
  4682. A = A & 4;
  4683. if(A != 0) goto pos37330;
  4684. A = inputtemp[X];
  4685. if(A != 72) goto pos36700;
  4686. if((A != 84) && (A != 67) && (A != 83)) goto pos36700;
  4687. mem58 = X;
  4688. goto pos37184;
  4689. // --------------
  4690. pos37404:
  4691. Code37066(mem58);
  4692. A = A & 32;
  4693. if(A == 0) goto pos36700;
  4694. pos37414:
  4695. mem58 = X;
  4696. goto pos37184;
  4697. // --------------
  4698. pos37419:
  4699. X = mem58;
  4700. X++;
  4701. A = inputtemp[X];
  4702. if((A == 69) || (A == 73) || (A == 89)) goto pos37414;
  4703. goto pos36700;
  4704. // ----------------------
  4705. pos37440:
  4706. Code37066(mem58);
  4707. A = A & 32;
  4708. if(A == 0) goto pos37184;
  4709. mem58 = X;
  4710. goto pos37440;
  4711. pos37455:
  4712. Y = mem64;
  4713. mem61 = mem60;
  4714. pos37461:
  4715. //37461: LDA (62),y
  4716. A = GetRuleByte(mem62, Y);
  4717. mem57 = A;
  4718. A = A & 127;
  4719. if(A != '=') {
  4720. mem56++;
  4721. X = mem56;
  4722. input[X] = A;
  4723. }
  4724. //37478: BIT 57
  4725. //37480: BPL 37485 //not negative flag
  4726. if((mem57 & 128) == 0) goto pos37485; //???
  4727. goto pos36554;
  4728. pos37485:
  4729. Y++;
  4730. goto pos37461;
  4731. }
  4732. // Constructor
  4733. STM32SAM::STM32SAM(uint32_t STM32SAM_SPEED /* = 5 */) {
  4734. STM32SAM_SPEED = STM32SAM_SPEED & 0x1f; // limit it from 0 to 31
  4735. _STM32SAM_SPEED = STM32SAM_SPEED;
  4736. // set default voice
  4737. speed = 72;
  4738. pitch = 64;
  4739. mouth = 128;
  4740. throat = 128;
  4741. phonetic = 0;
  4742. singmode = 0;
  4743. wait1 = 7;
  4744. wait2 = 6;
  4745. mem59 = 0;
  4746. oldtimetableindex = 0;
  4747. }
  4748. STM32SAM::STM32SAM() {
  4749. _STM32SAM_SPEED = 7;
  4750. // set default voice
  4751. speed = 72;
  4752. pitch = 64;
  4753. mouth = 128;
  4754. throat = 128;
  4755. phonetic = 0;
  4756. singmode = 0;
  4757. wait1 = 7;
  4758. wait2 = 6;
  4759. mem59 = 0;
  4760. oldtimetableindex = 0;
  4761. }
  4762. /*
  4763. STM32SAM::~STM32SAM() {
  4764. {
  4765. // TODO: end();
  4766. }
  4767. */
  4768. ////////////////////////////////////////////////////////////////////////////////////////////
  4769. //
  4770. // STM32SAM sam (variable string, phonetic, sing, pitch, speed, mouth, throat)
  4771. // STM32SAM say (sing off, phonetic off) (const string)
  4772. // STM32SAM say (sing off, phonetic off) (variable string)
  4773. // STM32SAM sing (sing on, phonetic off) (const string)
  4774. // STM32SAM sing (sing on, phonetic off) (variable string)
  4775. // STM32SAM sayPhonetic (sing off, phonetic on) (const string)
  4776. // STM32SAM sayPhonetic (sing off, phonetic on) (variable string)
  4777. // STM32SAM singPhonetic (sing on, phonetic on) (const string)
  4778. // STM32SAM singPhonetic (sing on, phonetic on) (variable string)
  4779. // STM32SAM voice (pitch, speed, mouth, throat)
  4780. // STM32SAM setPitch (pitch)
  4781. // STM32SAM setSpeed (speed)
  4782. // STM32SAM setMouth (mouth)
  4783. // STM32SAM setThroat (throat)
  4784. //
  4785. //
  4786. ////////////////////////////////////////////////////////////////////////////////////////////
  4787. ////////////////////////////////////////////////////////////////////////////////////////////
  4788. //
  4789. // STM32SAM sam (const string, phonetic, sing, pitch, speed, mouth, throat)
  4790. //
  4791. ////////////////////////////////////////////////////////////////////////////////////////////
  4792. char to_upper_case(char c) {
  4793. if(c >= 'a' && c <= 'z') {
  4794. return c - 'a' + 'A';
  4795. }
  4796. return c;
  4797. }
  4798. void STM32SAM::sam(
  4799. const char* argv,
  4800. unsigned char _phonetic,
  4801. unsigned char _singmode,
  4802. unsigned char _pitch,
  4803. unsigned char _speed,
  4804. unsigned char _mouth,
  4805. unsigned char _throat) {
  4806. phonetic = _phonetic;
  4807. singmode = _singmode;
  4808. pitch = _pitch;
  4809. speed = _speed;
  4810. mouth = _mouth;
  4811. throat = _throat;
  4812. int i;
  4813. for(i = 0; i < 256; i++) {
  4814. input[i] = argv[i];
  4815. }
  4816. for(i = 0; input[i] != 0; i++) {
  4817. if(i != 0) {
  4818. input[i] = to_upper_case((int)argv[i]);
  4819. }
  4820. }
  4821. if(!phonetic) {
  4822. strncat(input, "[", 256);
  4823. if(!TextToPhonemes((unsigned char*)input)) {
  4824. // PrintUsage();
  4825. return;
  4826. }
  4827. } else {
  4828. strncat(input, "\x9b", 256);
  4829. }
  4830. SetInput(input);
  4831. if(!SAMMain()) {
  4832. return;
  4833. }
  4834. }
  4835. ////////////////////////////////////////////////////////////////////////////////////////////
  4836. //
  4837. // STM32SAM sam (variable string, phonetic, sing, pitch, speed, mouth, throat)
  4838. //
  4839. ////////////////////////////////////////////////////////////////////////////////////////////
  4840. void STM32SAM::sam(
  4841. char* argv,
  4842. unsigned char _phonetic,
  4843. unsigned char _singmode,
  4844. unsigned char _pitch,
  4845. unsigned char _speed,
  4846. unsigned char _mouth,
  4847. unsigned char _throat) {
  4848. phonetic = _phonetic;
  4849. singmode = _singmode;
  4850. pitch = _pitch;
  4851. speed = _speed;
  4852. mouth = _mouth;
  4853. throat = _throat;
  4854. int i;
  4855. for(i = 0; i < 256; i++) {
  4856. input[i] = argv[i];
  4857. }
  4858. for(i = 0; input[i] != 0; i++) {
  4859. if(i != 0) {
  4860. input[i] = to_upper_case((int)argv[i]);
  4861. }
  4862. }
  4863. if(i < 256) {
  4864. input[i] = phonetic ? '\x9b' : '[';
  4865. }
  4866. if(!phonetic) {
  4867. if(!TextToPhonemes((unsigned char*)input)) {
  4868. return;
  4869. }
  4870. }
  4871. SetInput(input);
  4872. if(!SAMMain()) {
  4873. return;
  4874. }
  4875. }
  4876. ////////////////////////////////////////////////////////////////////////////////////////////
  4877. //
  4878. // STM32SAM say(sing off, phonetic off) (const string)
  4879. //
  4880. ////////////////////////////////////////////////////////////////////////////////////////////
  4881. void STM32SAM::say(const char* argv) {
  4882. int i;
  4883. phonetic = 0;
  4884. singmode = 0;
  4885. char const_input[256];
  4886. for(i = 0; i < 256; i++) {
  4887. const_input[i] = argv[i];
  4888. }
  4889. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4890. }
  4891. void STM32SAM::say(char* argv) {
  4892. int i;
  4893. phonetic = 0;
  4894. singmode = 0;
  4895. char const_input[256];
  4896. for(i = 0; i < 256; i++) {
  4897. const_input[i] = argv[i];
  4898. }
  4899. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4900. }
  4901. ////////////////////////////////////////////////////////////////////////////////////////////
  4902. //
  4903. // STM32SAM sing (sing on, phonetic off)
  4904. //
  4905. ////////////////////////////////////////////////////////////////////////////////////////////
  4906. void STM32SAM::sing(const char* argv) {
  4907. int i;
  4908. phonetic = 0;
  4909. singmode = 1;
  4910. char const_input[256];
  4911. for(i = 0; i < 256; i++) {
  4912. const_input[i] = argv[i];
  4913. }
  4914. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4915. }
  4916. void STM32SAM::sing(char* argv) {
  4917. int i;
  4918. phonetic = 0;
  4919. singmode = 1;
  4920. char const_input[256];
  4921. for(i = 0; i < 256; i++) {
  4922. const_input[i] = argv[i];
  4923. }
  4924. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4925. }
  4926. ////////////////////////////////////////////////////////////////////////////////////////////
  4927. //
  4928. // STM32SAM sayPhonetic (sing off, phonetic on)
  4929. //
  4930. ////////////////////////////////////////////////////////////////////////////////////////////
  4931. void STM32SAM::sayPhonetic(const char* argv) {
  4932. int i;
  4933. phonetic = 1;
  4934. singmode = 0;
  4935. char const_input[256];
  4936. for(i = 0; i < 256; i++) {
  4937. const_input[i] = argv[i];
  4938. }
  4939. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4940. }
  4941. void STM32SAM::sayPhonetic(char* argv) {
  4942. int i;
  4943. phonetic = 1;
  4944. singmode = 0;
  4945. char const_input[256];
  4946. for(i = 0; i < 256; i++) {
  4947. const_input[i] = argv[i];
  4948. }
  4949. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4950. }
  4951. ////////////////////////////////////////////////////////////////////////////////////////////
  4952. //
  4953. // STM32SAM singPhonetic (sing on, phonetic on)
  4954. //
  4955. ////////////////////////////////////////////////////////////////////////////////////////////
  4956. void STM32SAM::singPhonetic(const char* argv) {
  4957. int i;
  4958. phonetic = 1;
  4959. singmode = 1;
  4960. char const_input[256];
  4961. for(i = 0; i < 256; i++) {
  4962. const_input[i] = argv[i];
  4963. }
  4964. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4965. }
  4966. void STM32SAM::singPhonetic(char* argv) {
  4967. int i;
  4968. phonetic = 1;
  4969. singmode = 0;
  4970. char const_input[256];
  4971. for(i = 0; i < 256; i++) {
  4972. const_input[i] = argv[i];
  4973. }
  4974. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4975. }
  4976. ////////////////////////////////////////////////////////////////////////////////////////////
  4977. //
  4978. // STM32SAM voice (pitch, speed, mouth, throat)
  4979. //
  4980. ////////////////////////////////////////////////////////////////////////////////////////////
  4981. void STM32SAM::setVoice(
  4982. unsigned char _pitch /* = 64 */,
  4983. unsigned char _speed /* = 72 */,
  4984. unsigned char _mouth /* = 128 */,
  4985. unsigned char _throat /* = 128 */) {
  4986. pitch = _pitch;
  4987. speed = _speed;
  4988. mouth = _mouth;
  4989. throat = _throat;
  4990. }
  4991. ////////////////////////////////////////////////////////////////////////////////////////////
  4992. //
  4993. // STM32SAM setPitch (pitch)
  4994. //
  4995. ////////////////////////////////////////////////////////////////////////////////////////////
  4996. void STM32SAM::setPitch(unsigned char _pitch /* = 64 */) {
  4997. pitch = _pitch;
  4998. }
  4999. ////////////////////////////////////////////////////////////////////////////////////////////
  5000. //
  5001. // STM32SAM setSpeed (speed)
  5002. //
  5003. ////////////////////////////////////////////////////////////////////////////////////////////
  5004. void STM32SAM::setSpeed(unsigned char _speed /* = 72 */) {
  5005. speed = _speed;
  5006. }
  5007. ////////////////////////////////////////////////////////////////////////////////////////////
  5008. //
  5009. // STM32SAM setMouth (mouth)
  5010. //
  5011. ////////////////////////////////////////////////////////////////////////////////////////////
  5012. void STM32SAM::setMouth(unsigned char _mouth /* = 128 */) {
  5013. mouth = _mouth;
  5014. }
  5015. ////////////////////////////////////////////////////////////////////////////////////////////
  5016. //
  5017. // STM32SAM setThroat (throat)
  5018. //
  5019. ////////////////////////////////////////////////////////////////////////////////////////////
  5020. void STM32SAM::setThroat(unsigned char _throat /* = 128 */) {
  5021. throat = _throat;
  5022. }
  5023. ////////////////////////////////////////////////////////////////////////////////////////////
  5024. //
  5025. // Hardware
  5026. //
  5027. ////////////////////////////////////////////////////////////////////////////////////////////
  5028. // Hardware specifics, for easier porting to other microcontrollers
  5029. //
  5030. // Set PA8 pin as PWM, at 256 timer ticks overflow (8bit resolution)
  5031. #include <math.h>
  5032. #include <stm32wbxx_ll_tim.h>
  5033. #define FURI_HAL_SPEAKER_TIMER TIM16
  5034. #define FURI_HAL_SPEAKER_CHANNEL LL_TIM_CHANNEL_CH1
  5035. void STM32SAM::begin(void) {
  5036. #ifdef USE_ROGER_CORE
  5037. pinMode(PA8, PWM); // audio output pin
  5038. Timer1.setPeriod(
  5039. 4); // Can't set at 256 ticks, only in uS. First nearest uS is 4 (Roger core is only for bluepill, that means 72*4=288 ticks, or 128*4=512 ticks when overclocked. It's ok, just overall volume will be lower, because maximum volume will be 256/288 or 256/512)
  5040. #endif
  5041. #ifdef USE_STM32duino_CORE
  5042. pinMode(PA8, OUTPUT);
  5043. PWM->pause();
  5044. PWM->setMode(1, TIMER_OUTPUT_COMPARE_PWM1, PA8); // TIM1 CH1 (PA8)
  5045. PWM->setPrescaleFactor(1);
  5046. PWM->setOverflow(256, TICK_FORMAT); // 256 ticks overflow, no matter the CPU (timer) speed
  5047. PWM->resume();
  5048. #endif
  5049. LL_TIM_InitTypeDef TIM_InitStruct;
  5050. memset(&TIM_InitStruct, 0, sizeof(LL_TIM_InitTypeDef));
  5051. TIM_InitStruct.Prescaler = 4;
  5052. TIM_InitStruct.Autoreload = 255;
  5053. LL_TIM_Init(FURI_HAL_SPEAKER_TIMER, &TIM_InitStruct);
  5054. LL_TIM_OC_InitTypeDef TIM_OC_InitStruct;
  5055. memset(&TIM_OC_InitStruct, 0, sizeof(LL_TIM_OC_InitTypeDef));
  5056. TIM_OC_InitStruct.OCMode = LL_TIM_OCMODE_PWM1;
  5057. TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_ENABLE;
  5058. TIM_OC_InitStruct.CompareValue = 127;
  5059. LL_TIM_OC_Init(FURI_HAL_SPEAKER_TIMER, FURI_HAL_SPEAKER_CHANNEL, &TIM_OC_InitStruct);
  5060. LL_TIM_EnableAllOutputs(FURI_HAL_SPEAKER_TIMER);
  5061. LL_TIM_EnableCounter(FURI_HAL_SPEAKER_TIMER);
  5062. } // begin
  5063. inline void STM32SAM::SetAUDIO(unsigned char main_volume) {
  5064. #ifdef USE_ROGER_CORE
  5065. Timer1.setCompare(TIMER_CH1, main_volume);
  5066. #endif
  5067. #ifdef USE_STM32duino_CORE
  5068. PWM->setCaptureCompare(1, main_volume, TICK_COMPARE_FORMAT);
  5069. #endif
  5070. // if(main_volume > 64) {
  5071. // LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, 127);
  5072. // } else {
  5073. // LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, main_volume);
  5074. // }
  5075. float data = main_volume;
  5076. data /= 255.0f;
  5077. data -= 0.5f;
  5078. data *= 4.0f;
  5079. data = tanhf(data);
  5080. data += 0.5f;
  5081. data *= 255.0f;
  5082. if(data < 0) {
  5083. data = 0;
  5084. } else if(data > 255) {
  5085. data = 255;
  5086. }
  5087. LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, data);
  5088. }