stm32_sam.cpp 172 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705
  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)
  3106. X++;
  3107. pos48398:
  3108. //48398: CLC
  3109. //48399: ADC 48
  3110. // add the inflection direction
  3111. A += mem48;
  3112. phase1 = A;
  3113. // set the inflection
  3114. pitches[X] = A;
  3115. pos48406:
  3116. // increment the position
  3117. X++;
  3118. // exit if the punctuation has been reached
  3119. if(X == mem49) return; //goto pos47615;
  3120. if(pitches[X] == 255) goto pos48406;
  3121. A = phase1;
  3122. goto pos48398;
  3123. }
  3124. /*
  3125. SAM's voice can be altered by changing the frequencies of the
  3126. mouth formant (F1) and the throat formant (F2). Only the voiced
  3127. phonemes (5-29 and 48-53) are altered.
  3128. */
  3129. void STM32SAM::SetMouthThroat() {
  3130. unsigned char initialFrequency;
  3131. unsigned char newFrequency = 0;
  3132. //unsigned char mouth; //mem38880
  3133. //unsigned char throat; //mem38881
  3134. // mouth formants (F1) 5..29
  3135. unsigned char mouthFormants5_29[30] = {0, 0, 0, 0, 0, 10, 14, 19, 24, 27,
  3136. 23, 21, 16, 20, 14, 18, 14, 18, 18, 16,
  3137. 13, 15, 11, 18, 14, 11, 9, 6, 6, 6};
  3138. // throat formants (F2) 5..29
  3139. unsigned char throatFormants5_29[30] = {255, 255, 255, 255, 255, 84, 73, 67, 63, 40,
  3140. 44, 31, 37, 45, 73, 49, 36, 30, 51, 37,
  3141. 29, 69, 24, 50, 30, 24, 83, 46, 54, 86};
  3142. // there must be no zeros in this 2 tables
  3143. // formant 1 frequencies (mouth) 48..53
  3144. unsigned char mouthFormants48_53[6] = {19, 27, 21, 27, 18, 13};
  3145. // formant 2 frequencies (throat) 48..53
  3146. unsigned char throatFormants48_53[6] = {72, 39, 31, 43, 30, 34};
  3147. unsigned char pos = 5; //mem39216
  3148. //pos38942:
  3149. // recalculate formant frequencies 5..29 for the mouth (F1) and throat (F2)
  3150. while(pos != 30) {
  3151. // recalculate mouth frequency
  3152. initialFrequency = mouthFormants5_29[pos];
  3153. if(initialFrequency != 0) newFrequency = trans(mouth, initialFrequency);
  3154. freq1data[pos] = newFrequency;
  3155. // recalculate throat frequency
  3156. initialFrequency = throatFormants5_29[pos];
  3157. if(initialFrequency != 0) newFrequency = trans(throat, initialFrequency);
  3158. freq2data[pos] = newFrequency;
  3159. pos++;
  3160. }
  3161. //pos39059:
  3162. // recalculate formant frequencies 48..53
  3163. pos = 48;
  3164. Y = 0;
  3165. while(pos != 54) {
  3166. // recalculate F1 (mouth formant)
  3167. initialFrequency = mouthFormants48_53[Y];
  3168. newFrequency = trans(mouth, initialFrequency);
  3169. freq1data[pos] = newFrequency;
  3170. // recalculate F2 (throat formant)
  3171. initialFrequency = throatFormants48_53[Y];
  3172. newFrequency = trans(throat, initialFrequency);
  3173. freq2data[pos] = newFrequency;
  3174. Y++;
  3175. pos++;
  3176. }
  3177. }
  3178. //return = (mem39212*mem39213) >> 1
  3179. unsigned char STM32SAM::trans(unsigned char mem39212, unsigned char mem39213) {
  3180. //pos39008:
  3181. unsigned char carry;
  3182. int temp;
  3183. unsigned char mem39214, mem39215;
  3184. A = 0;
  3185. mem39215 = 0;
  3186. mem39214 = 0;
  3187. X = 8;
  3188. do {
  3189. carry = mem39212 & 1;
  3190. mem39212 = mem39212 >> 1;
  3191. if(carry != 0) {
  3192. /*
  3193. 39018: LSR 39212
  3194. 39021: BCC 39033
  3195. */
  3196. carry = 0;
  3197. A = mem39215;
  3198. temp = (int)A + (int)mem39213;
  3199. A = A + mem39213;
  3200. if(temp > 255) carry = 1;
  3201. mem39215 = A;
  3202. }
  3203. temp = mem39215 & 1;
  3204. mem39215 = (mem39215 >> 1) | (carry ? 128 : 0);
  3205. carry = temp;
  3206. //39033: ROR 39215
  3207. X--;
  3208. } while(X != 0);
  3209. temp = mem39214 & 128;
  3210. mem39214 = (mem39214 << 1) | (carry ? 1 : 0);
  3211. carry = temp;
  3212. temp = mem39215 & 128;
  3213. mem39215 = (mem39215 << 1) | (carry ? 1 : 0);
  3214. carry = temp;
  3215. return mem39215;
  3216. }
  3217. ////////////////////////////////////////////////////////////////////////////////////////////
  3218. //
  3219. // Sam
  3220. //
  3221. ////////////////////////////////////////////////////////////////////////////////////////////
  3222. //char input[]={"/HAALAOAO MAYN NAAMAEAE IHSTT SAEBAASTTIHAAN \x9b\x9b\0"};
  3223. //unsigned char input[]={"/HAALAOAO \x9b\0"};
  3224. //unsigned char input[]={"AA \x9b\0"};
  3225. //unsigned char input[] = {"GUH5DEHN TAEG\x9b\0"};
  3226. //unsigned char input[]={"AY5 AEM EY TAO4LXKIHNX KAX4MPYUX4TAH. GOW4 AH/HEH3D PAHNK.MEYK MAY8 DEY.\x9b\0"};
  3227. //unsigned char input[]={"/HEH3LOW2, /HAW AH YUX2 TUXDEY. AY /HOH3P YUX AH FIYLIHNX OW4 KEY.\x9b\0"};
  3228. //unsigned char input[]={"/HEY2, DHIHS IH3Z GREY2T. /HAH /HAH /HAH.AYL BIY5 BAEK.\x9b\0"};
  3229. //unsigned char input[]={"/HAH /HAH /HAH \x9b\0"};
  3230. //unsigned char input[]={"/HAH /HAH /HAH.\x9b\0"};
  3231. //unsigned char input[]={".TUW BIY5Y3,, OHR NAA3T - TUW BIY5IYIY., DHAE4T IHZ DHAH KWEH4SCHAHN.\x9b\0"};
  3232. //unsigned char input[]={"/HEY2, DHIHS \x9b\0"};
  3233. //unsigned char input[]={" IYIHEHAEAAAHAOOHUHUXERAXIX \x9b\0"};
  3234. //unsigned char input[]={" RLWWYMNNXBDGJZZHVDH \x9b\0"};
  3235. //unsigned char input[]={" SSHFTHPTKCH/H \x9b\0"};
  3236. //unsigned char input[]={" EYAYOYAWOWUW ULUMUNQ YXWXRXLX/XDX\x9b\0"};
  3237. void STM32SAM::SetInput(char* _input) {
  3238. int i, l;
  3239. l = strlen(_input);
  3240. if(l > 254) l = 254;
  3241. for(i = 0; i < l; i++) {
  3242. input[i] = _input[i];
  3243. }
  3244. input[l] = 0;
  3245. }
  3246. // 168=pitches
  3247. // 169=frequency1
  3248. // 170=frequency2
  3249. // 171=frequency3
  3250. // 172=amplitude1
  3251. // 173=amplitude2
  3252. // 174=amplitude3
  3253. void STM32SAM::Init() {
  3254. bufferpos = 0;
  3255. int i;
  3256. SetMouthThroat();
  3257. bufferpos = 0;
  3258. // TODO, check for free the memory, 10 seconds of output should be more than enough
  3259. //buffer = malloc(22050*10);
  3260. // buffer = (char*) calloc(1, sizeof(char));
  3261. /*
  3262. freq2data = &mem[45136];
  3263. freq1data = &mem[45056];
  3264. freq3data = &mem[45216];
  3265. */
  3266. //pitches = &mem[43008];
  3267. /*
  3268. frequency1 = &mem[43264];
  3269. frequency2 = &mem[43520];
  3270. frequency3 = &mem[43776];
  3271. */
  3272. /*
  3273. amplitude1 = &mem[44032];
  3274. amplitude2 = &mem[44288];
  3275. amplitude3 = &mem[44544];
  3276. */
  3277. //phoneme = &mem[39904];
  3278. /*
  3279. ampl1data = &mem[45296];
  3280. ampl2data = &mem[45376];
  3281. ampl3data = &mem[45456];
  3282. */
  3283. for(i = 0; i < 256; i++) {
  3284. stress[i] = 0;
  3285. phonemeLength[i] = 0;
  3286. }
  3287. for(i = 0; i < 60; i++) {
  3288. phonemeIndexOutput[i] = 0;
  3289. stressOutput[i] = 0;
  3290. phonemeLengthOutput[i] = 0;
  3291. }
  3292. phonemeindex[255] =
  3293. 255; //to prevent buffer overflow // ML : changed from 32 to 255 to stop freezing with long inputs
  3294. }
  3295. //int Code39771()
  3296. int STM32SAM::SAMMain() {
  3297. Init();
  3298. phonemeindex[255] = 32; //to prevent buffer overflow
  3299. if(!Parser1()) {
  3300. return 0;
  3301. }
  3302. Parser2();
  3303. CopyStress();
  3304. SetPhonemeLength();
  3305. AdjustLengths();
  3306. Code41240();
  3307. do {
  3308. A = phonemeindex[X];
  3309. if(A > 80) {
  3310. phonemeindex[X] = 255;
  3311. break; // error: delete all behind it
  3312. }
  3313. X++;
  3314. } while(X != 0);
  3315. //pos39848:
  3316. InsertBreath();
  3317. //mem[40158] = 255;
  3318. PrepareOutput();
  3319. return 1;
  3320. }
  3321. //void Code48547()
  3322. void STM32SAM::PrepareOutput() {
  3323. A = 0;
  3324. X = 0;
  3325. Y = 0;
  3326. //pos48551:
  3327. while(1) {
  3328. A = phonemeindex[X];
  3329. if(A == 255) {
  3330. A = 255;
  3331. phonemeIndexOutput[Y] = 255;
  3332. Render();
  3333. return;
  3334. }
  3335. if(A == 254) {
  3336. X++;
  3337. int temp = X;
  3338. //mem[48546] = X;
  3339. phonemeIndexOutput[Y] = 255;
  3340. Render();
  3341. //X = mem[48546];
  3342. X = temp;
  3343. Y = 0;
  3344. continue;
  3345. }
  3346. if(A == 0) {
  3347. X++;
  3348. continue;
  3349. }
  3350. phonemeIndexOutput[Y] = A;
  3351. phonemeLengthOutput[Y] = phonemeLength[X];
  3352. stressOutput[Y] = stress[X];
  3353. X++;
  3354. Y++;
  3355. }
  3356. }
  3357. //void Code41014()
  3358. void STM32SAM::Insert(
  3359. unsigned char position /*var57*/,
  3360. unsigned char mem60,
  3361. unsigned char mem59,
  3362. unsigned char mem58) {
  3363. int i;
  3364. for(i = 253; i >= position; i--) // ML : always keep last safe-guarding 255
  3365. {
  3366. phonemeindex[i + 1] = phonemeindex[i];
  3367. phonemeLength[i + 1] = phonemeLength[i];
  3368. stress[i + 1] = stress[i];
  3369. }
  3370. phonemeindex[position] = mem60;
  3371. phonemeLength[position] = mem59;
  3372. stress[position] = mem58;
  3373. return;
  3374. }
  3375. //void Code48431()
  3376. void STM32SAM::InsertBreath() {
  3377. unsigned char mem54;
  3378. unsigned char mem55;
  3379. unsigned char index; //variable Y
  3380. mem54 = 255;
  3381. X++;
  3382. mem55 = 0;
  3383. unsigned char mem66 = 0;
  3384. while(1) {
  3385. //pos48440:
  3386. X = mem66;
  3387. index = phonemeindex[X];
  3388. if(index == 255) return;
  3389. mem55 += phonemeLength[X];
  3390. if(mem55 < 232) {
  3391. if(index != 254) // ML : Prevents an index out of bounds problem
  3392. {
  3393. A = flags2[index] & 1;
  3394. if(A != 0) {
  3395. X++;
  3396. mem55 = 0;
  3397. Insert(X, 254, mem59, 0);
  3398. mem66++;
  3399. mem66++;
  3400. continue;
  3401. }
  3402. }
  3403. if(index == 0) mem54 = X;
  3404. mem66++;
  3405. continue;
  3406. }
  3407. X = mem54;
  3408. phonemeindex[X] = 31; // 'Q*' glottal stop
  3409. phonemeLength[X] = 4;
  3410. stress[X] = 0;
  3411. X++;
  3412. mem55 = 0;
  3413. Insert(X, 254, mem59, 0);
  3414. X++;
  3415. mem66 = X;
  3416. }
  3417. }
  3418. // Iterates through the phoneme buffer, copying the stress value from
  3419. // the following phoneme under the following circumstance:
  3420. // 1. The current phoneme is voiced, excluding plosives and fricatives
  3421. // 2. The following phoneme is voiced, excluding plosives and fricatives, and
  3422. // 3. The following phoneme is stressed
  3423. //
  3424. // In those cases, the stress value+1 from the following phoneme is copied.
  3425. //
  3426. // For example, the word LOITER is represented as LOY5TER, with as stress
  3427. // of 5 on the diphtong OY. This routine will copy the stress value of 6 (5+1)
  3428. // to the L that precedes it.
  3429. //void Code41883()
  3430. void STM32SAM::CopyStress() {
  3431. // loop thought all the phonemes to be output
  3432. unsigned char pos = 0; //mem66
  3433. while(1) {
  3434. // get the phomene
  3435. Y = phonemeindex[pos];
  3436. // exit at end of buffer
  3437. if(Y == 255) return;
  3438. // if CONSONANT_FLAG set, skip - only vowels get stress
  3439. if((flags[Y] & 64) == 0) {
  3440. pos++;
  3441. continue;
  3442. }
  3443. // get the next phoneme
  3444. Y = phonemeindex[pos + 1];
  3445. if(Y == 255) //prevent buffer overflow
  3446. {
  3447. pos++;
  3448. continue;
  3449. } else
  3450. // if the following phoneme is a vowel, skip
  3451. if((flags[Y] & 128) == 0) {
  3452. pos++;
  3453. continue;
  3454. }
  3455. // get the stress value at the next position
  3456. Y = stress[pos + 1];
  3457. // if next phoneme is not stressed, skip
  3458. if(Y == 0) {
  3459. pos++;
  3460. continue;
  3461. }
  3462. // if next phoneme is not a VOWEL OR ER, skip
  3463. if((Y & 128) != 0) {
  3464. pos++;
  3465. continue;
  3466. }
  3467. // copy stress from prior phoneme to this one
  3468. stress[pos] = Y + 1;
  3469. // advance pointer
  3470. pos++;
  3471. }
  3472. }
  3473. // The input[] buffer contains a string of phonemes and stress markers along
  3474. // the lines of:
  3475. //
  3476. // DHAX KAET IHZ AH5GLIY. <0x9B>
  3477. //
  3478. // The byte 0x9B marks the end of the buffer. Some phonemes are 2 bytes
  3479. // long, such as "DH" and "AX". Others are 1 byte long, such as "T" and "Z".
  3480. // There are also stress markers, such as "5" and ".".
  3481. //
  3482. // The first character of the phonemes are stored in the table signInputTable1[].
  3483. // The second character of the phonemes are stored in the table signInputTable2[].
  3484. // The stress characters are arranged in low to high stress order in stressInputTable[].
  3485. //
  3486. // The following process is used to parse the input[] buffer:
  3487. //
  3488. // Repeat until the <0x9B> character is reached:
  3489. //
  3490. // First, a search is made for a 2 character match for phonemes that do not
  3491. // end with the '*' (wildcard) character. On a match, the index of the phoneme
  3492. // is added to phonemeIndex[] and the buffer position is advanced 2 bytes.
  3493. //
  3494. // If this fails, a search is made for a 1 character match against all
  3495. // phoneme names ending with a '*' (wildcard). If this succeeds, the
  3496. // phoneme is added to phonemeIndex[] and the buffer position is advanced
  3497. // 1 byte.
  3498. //
  3499. // If this fails, search for a 1 character match in the stressInputTable[].
  3500. // If this succeeds, the stress value is placed in the last stress[] table
  3501. // at the same index of the last added phoneme, and the buffer position is
  3502. // advanced by 1 byte.
  3503. //
  3504. // If this fails, return a 0.
  3505. //
  3506. // On success:
  3507. //
  3508. // 1. phonemeIndex[] will contain the index of all the phonemes.
  3509. // 2. The last index in phonemeIndex[] will be 255.
  3510. // 3. stress[] will contain the stress value for each phoneme
  3511. // input[] holds the string of phonemes, each two bytes wide
  3512. // signInputTable1[] holds the first character of each phoneme
  3513. // signInputTable2[] holds te second character of each phoneme
  3514. // phonemeIndex[] holds the indexes of the phonemes after parsing input[]
  3515. //
  3516. // The parser scans through the input[], finding the names of the phonemes
  3517. // by searching signInputTable1[] and signInputTable2[]. On a match, it
  3518. // copies the index of the phoneme into the phonemeIndexTable[].
  3519. //
  3520. // The character <0x9B> marks the end of text in input[]. When it is reached,
  3521. // the index 255 is placed at the end of the phonemeIndexTable[], and the
  3522. // function returns with a 1 indicating success.
  3523. int STM32SAM::Parser1() {
  3524. int i;
  3525. unsigned char sign1;
  3526. unsigned char sign2;
  3527. unsigned char position = 0;
  3528. X = 0;
  3529. A = 0;
  3530. Y = 0;
  3531. // CLEAR THE STRESS TABLE
  3532. for(i = 0; i < 256; i++)
  3533. stress[i] = 0;
  3534. // THIS CODE MATCHES THE PHONEME LETTERS TO THE TABLE
  3535. // pos41078:
  3536. while(1) {
  3537. // GET THE FIRST CHARACTER FROM THE PHONEME BUFFER
  3538. sign1 = input[X];
  3539. // TEST FOR 155 (�) END OF LINE MARKER
  3540. if(sign1 == 155) {
  3541. // MARK ENDPOINT AND RETURN
  3542. phonemeindex[position] = 255; //mark endpoint
  3543. // REACHED END OF PHONEMES, SO EXIT
  3544. return 1; //all ok
  3545. }
  3546. // GET THE NEXT CHARACTER FROM THE BUFFER
  3547. X++;
  3548. sign2 = input[X];
  3549. // NOW sign1 = FIRST CHARACTER OF PHONEME, AND sign2 = SECOND CHARACTER OF PHONEME
  3550. // TRY TO MATCH PHONEMES ON TWO TWO-CHARACTER NAME
  3551. // IGNORE PHONEMES IN TABLE ENDING WITH WILDCARDS
  3552. // SET INDEX TO 0
  3553. Y = 0;
  3554. pos41095:
  3555. // GET FIRST CHARACTER AT POSITION Y IN signInputTable
  3556. // --> should change name to PhonemeNameTable1
  3557. A = signInputTable1[Y];
  3558. // FIRST CHARACTER MATCHES?
  3559. if(A == sign1) {
  3560. // GET THE CHARACTER FROM THE PhonemeSecondLetterTable
  3561. A = signInputTable2[Y];
  3562. // NOT A SPECIAL AND MATCHES SECOND CHARACTER?
  3563. if((A != '*') && (A == sign2)) {
  3564. // STORE THE INDEX OF THE PHONEME INTO THE phomeneIndexTable
  3565. phonemeindex[position] = Y;
  3566. // ADVANCE THE POINTER TO THE phonemeIndexTable
  3567. position++;
  3568. // ADVANCE THE POINTER TO THE phonemeInputBuffer
  3569. X++;
  3570. // CONTINUE PARSING
  3571. continue;
  3572. }
  3573. }
  3574. // NO MATCH, TRY TO MATCH ON FIRST CHARACTER TO WILDCARD NAMES (ENDING WITH '*')
  3575. // ADVANCE TO THE NEXT POSITION
  3576. Y++;
  3577. // IF NOT END OF TABLE, CONTINUE
  3578. if(Y != 81) goto pos41095;
  3579. // REACHED END OF TABLE WITHOUT AN EXACT (2 CHARACTER) MATCH.
  3580. // THIS TIME, SEARCH FOR A 1 CHARACTER MATCH AGAINST THE WILDCARDS
  3581. // RESET THE INDEX TO POINT TO THE START OF THE PHONEME NAME TABLE
  3582. Y = 0;
  3583. pos41134:
  3584. // DOES THE PHONEME IN THE TABLE END WITH '*'?
  3585. if(signInputTable2[Y] == '*') {
  3586. // DOES THE FIRST CHARACTER MATCH THE FIRST LETTER OF THE PHONEME
  3587. if(signInputTable1[Y] == sign1) {
  3588. // SAVE THE POSITION AND MOVE AHEAD
  3589. phonemeindex[position] = Y;
  3590. // ADVANCE THE POINTER
  3591. position++;
  3592. // CONTINUE THROUGH THE LOOP
  3593. continue;
  3594. }
  3595. }
  3596. Y++;
  3597. if(Y != 81) goto pos41134; //81 is size of PHONEME NAME table
  3598. // FAILED TO MATCH WITH A WILDCARD. ASSUME THIS IS A STRESS
  3599. // CHARACTER. SEARCH THROUGH THE STRESS TABLE
  3600. // SET INDEX TO POSITION 8 (END OF STRESS TABLE)
  3601. Y = 8;
  3602. // WALK BACK THROUGH TABLE LOOKING FOR A MATCH
  3603. while((sign1 != stressInputTable[Y]) && (Y > 0)) {
  3604. // DECREMENT INDEX
  3605. Y--;
  3606. }
  3607. // REACHED THE END OF THE SEARCH WITHOUT BREAKING OUT OF LOOP?
  3608. if(Y == 0) {
  3609. //mem[39444] = X;
  3610. //41181: JSR 42043 //Error
  3611. // FAILED TO MATCH ANYTHING, RETURN 0 ON FAILURE
  3612. return 0;
  3613. }
  3614. // SET THE STRESS FOR THE PRIOR PHONEME
  3615. stress[position - 1] = Y;
  3616. } //while
  3617. }
  3618. //change phonemelength depedendent on stress
  3619. //void Code41203()
  3620. void STM32SAM::SetPhonemeLength() {
  3621. unsigned char A;
  3622. int position = 0;
  3623. while(phonemeindex[position] != 255) {
  3624. A = stress[position];
  3625. //41218: BMI 41229
  3626. if((A == 0) || ((A & 128) != 0)) {
  3627. phonemeLength[position] = phonemeLengthTable[phonemeindex[position]];
  3628. } else {
  3629. phonemeLength[position] = phonemeStressedLengthTable[phonemeindex[position]];
  3630. }
  3631. position++;
  3632. }
  3633. }
  3634. void STM32SAM::Code41240() {
  3635. unsigned char pos = 0;
  3636. while(phonemeindex[pos] != 255) {
  3637. unsigned char index; //register AC
  3638. X = pos;
  3639. index = phonemeindex[pos];
  3640. if((flags[index] & 2) == 0) {
  3641. pos++;
  3642. continue;
  3643. } else if((flags[index] & 1) == 0) {
  3644. Insert(pos + 1, index + 1, phonemeLengthTable[index + 1], stress[pos]);
  3645. Insert(pos + 2, index + 2, phonemeLengthTable[index + 2], stress[pos]);
  3646. pos += 3;
  3647. continue;
  3648. }
  3649. do {
  3650. X++;
  3651. A = phonemeindex[X];
  3652. } while(A == 0);
  3653. if(A != 255) {
  3654. if((flags[A] & 8) != 0) {
  3655. pos++;
  3656. continue;
  3657. }
  3658. if((A == 36) || (A == 37)) {
  3659. pos++; // '/H' '/X'
  3660. continue;
  3661. }
  3662. }
  3663. Insert(pos + 1, index + 1, phonemeLengthTable[index + 1], stress[pos]);
  3664. Insert(pos + 2, index + 2, phonemeLengthTable[index + 2], stress[pos]);
  3665. pos += 3;
  3666. }
  3667. }
  3668. // Rewrites the phonemes using the following rules:
  3669. //
  3670. // <DIPHTONG ENDING WITH WX> -> <DIPHTONG ENDING WITH WX> WX
  3671. // <DIPHTONG NOT ENDING WITH WX> -> <DIPHTONG NOT ENDING WITH WX> YX
  3672. // UL -> AX L
  3673. // UM -> AX M
  3674. // <STRESSED VOWEL> <SILENCE> <STRESSED VOWEL> -> <STRESSED VOWEL> <SILENCE> Q <VOWEL>
  3675. // T R -> CH R
  3676. // D R -> J R
  3677. // <VOWEL> R -> <VOWEL> RX
  3678. // <VOWEL> L -> <VOWEL> LX
  3679. // G S -> G Z
  3680. // K <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> KX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3681. // G <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> GX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3682. // S P -> S B
  3683. // S T -> S D
  3684. // S K -> S G
  3685. // S KX -> S GX
  3686. // <ALVEOLAR> UW -> <ALVEOLAR> UX
  3687. // CH -> CH CH' (CH requires two phonemes to represent it)
  3688. // J -> J J' (J requires two phonemes to represent it)
  3689. // <UNSTRESSED VOWEL> T <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3690. // <UNSTRESSED VOWEL> D <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3691. //void Code41397()
  3692. void STM32SAM::Parser2() {
  3693. unsigned char pos = 0; //mem66;
  3694. unsigned char mem58 = 0;
  3695. // Loop through phonemes
  3696. while(1) {
  3697. // SET X TO THE CURRENT POSITION
  3698. X = pos;
  3699. // GET THE PHONEME AT THE CURRENT POSITION
  3700. A = phonemeindex[pos];
  3701. // Is phoneme pause?
  3702. if(A == 0) {
  3703. // Move ahead to the
  3704. pos++;
  3705. continue;
  3706. }
  3707. // If end of phonemes flag reached, exit routine
  3708. if(A == 255) return;
  3709. // Copy the current phoneme index to Y
  3710. Y = A;
  3711. // RULE:
  3712. // <DIPHTONG ENDING WITH WX> -> <DIPHTONG ENDING WITH WX> WX
  3713. // <DIPHTONG NOT ENDING WITH WX> -> <DIPHTONG NOT ENDING WITH WX> YX
  3714. // Example: OIL, COW
  3715. // Check for DIPHTONG
  3716. if((flags[A] & 16) == 0) goto pos41457;
  3717. // Not a diphthong. Get the stress
  3718. mem58 = stress[pos];
  3719. // End in IY sound?
  3720. A = flags[Y] & 32;
  3721. // If ends with IY, use YX, else use WX
  3722. if(A == 0)
  3723. A = 20;
  3724. else
  3725. A = 21; // 'WX' = 20 'YX' = 21
  3726. //pos41443:
  3727. // Insert at WX or YX following, copying the stress
  3728. Insert(pos + 1, A, mem59, mem58);
  3729. X = pos;
  3730. // Jump to ???
  3731. goto pos41749;
  3732. pos41457:
  3733. // RULE:
  3734. // UL -> AX L
  3735. // Example: MEDDLE
  3736. // Get phoneme
  3737. A = phonemeindex[X];
  3738. // Skip this rule if phoneme is not UL
  3739. if(A != 78) goto pos41487; // 'UL'
  3740. A = 24; // 'L' //change 'UL' to 'AX L'
  3741. pos41466:
  3742. // Get current phoneme stress
  3743. mem58 = stress[X];
  3744. // Change UL to AX
  3745. phonemeindex[X] = 13; // 'AX'
  3746. // Perform insert. Note code below may jump up here with different values
  3747. Insert(X + 1, A, mem59, mem58);
  3748. pos++;
  3749. // Move to next phoneme
  3750. continue;
  3751. pos41487:
  3752. // RULE:
  3753. // UM -> AX M
  3754. // Example: ASTRONOMY
  3755. // Skip rule if phoneme != UM
  3756. if(A != 79) goto pos41495; // 'UM'
  3757. // Jump up to branch - replaces current phoneme with AX and continues
  3758. A = 27; // 'M' //change 'UM' to 'AX M'
  3759. goto pos41466;
  3760. pos41495:
  3761. // RULE:
  3762. // UN -> AX N
  3763. // Example: FUNCTION
  3764. // Skip rule if phoneme != UN
  3765. if(A != 80) goto pos41503; // 'UN'
  3766. // Jump up to branch - replaces current phoneme with AX and continues
  3767. A = 28; // 'N' //change UN to 'AX N'
  3768. goto pos41466;
  3769. pos41503:
  3770. // RULE:
  3771. // <STRESSED VOWEL> <SILENCE> <STRESSED VOWEL> -> <STRESSED VOWEL> <SILENCE> Q <VOWEL>
  3772. // EXAMPLE: AWAY EIGHT
  3773. Y = A;
  3774. // VOWEL set?
  3775. A = flags[A] & 128;
  3776. // Skip if not a vowel
  3777. if(A != 0) {
  3778. // Get the stress
  3779. A = stress[X];
  3780. // If stressed...
  3781. if(A != 0) {
  3782. // Get the following phoneme
  3783. X++;
  3784. A = phonemeindex[X];
  3785. // If following phoneme is a pause
  3786. if(A == 0) {
  3787. // Get the phoneme following pause
  3788. X++;
  3789. Y = phonemeindex[X];
  3790. // Check for end of buffer flag
  3791. if(Y == 255) //buffer overflow
  3792. // ??? Not sure about these flags
  3793. A = 65 & 128;
  3794. else
  3795. // And VOWEL flag to current phoneme's flags
  3796. A = flags[Y] & 128;
  3797. // If following phonemes is not a pause
  3798. if(A != 0) {
  3799. // If the following phoneme is not stressed
  3800. A = stress[X];
  3801. if(A != 0) {
  3802. // 31 = 'Q'
  3803. Insert(X, 31, mem59, 0);
  3804. pos++;
  3805. continue;
  3806. }
  3807. }
  3808. }
  3809. }
  3810. }
  3811. // RULES FOR PHONEMES BEFORE R
  3812. // T R -> CH R
  3813. // Example: TRACK
  3814. // Get current position and phoneme
  3815. X = pos;
  3816. A = phonemeindex[pos];
  3817. if(A != 23) goto pos41611; // 'R'
  3818. // Look at prior phoneme
  3819. X--;
  3820. A = phonemeindex[pos - 1];
  3821. //pos41567:
  3822. if(A == 69) // 'T'
  3823. {
  3824. phonemeindex[pos - 1] = 42;
  3825. goto pos41779;
  3826. }
  3827. // RULES FOR PHONEMES BEFORE R
  3828. // D R -> J R
  3829. // Example: DRY
  3830. // Prior phonemes D?
  3831. if(A == 57) // 'D'
  3832. {
  3833. // Change D to J
  3834. phonemeindex[pos - 1] = 44;
  3835. goto pos41788;
  3836. }
  3837. // RULES FOR PHONEMES BEFORE R
  3838. // <VOWEL> R -> <VOWEL> RX
  3839. // Example: ART
  3840. // If vowel flag is set change R to RX
  3841. A = flags[A] & 128;
  3842. if(A != 0) phonemeindex[pos] = 18; // 'RX'
  3843. // continue to next phoneme
  3844. pos++;
  3845. continue;
  3846. pos41611:
  3847. // RULE:
  3848. // <VOWEL> L -> <VOWEL> LX
  3849. // Example: ALL
  3850. // Is phoneme L?
  3851. if(A == 24) // 'L'
  3852. {
  3853. // If prior phoneme does not have VOWEL flag set, move to next phoneme
  3854. if((flags[phonemeindex[pos - 1]] & 128) == 0) {
  3855. pos++;
  3856. continue;
  3857. }
  3858. // Prior phoneme has VOWEL flag set, so change L to LX and move to next phoneme
  3859. phonemeindex[X] = 19; // 'LX'
  3860. pos++;
  3861. continue;
  3862. }
  3863. // RULE:
  3864. // G S -> G Z
  3865. //
  3866. // Can't get to fire -
  3867. // 1. The G -> GX rule intervenes
  3868. // 2. Reciter already replaces GS -> GZ
  3869. // Is current phoneme S?
  3870. if(A == 32) // 'S'
  3871. {
  3872. // If prior phoneme is not G, move to next phoneme
  3873. if(phonemeindex[pos - 1] != 60) {
  3874. pos++;
  3875. continue;
  3876. }
  3877. // Replace S with Z and move on
  3878. phonemeindex[pos] = 38; // 'Z'
  3879. pos++;
  3880. continue;
  3881. }
  3882. // RULE:
  3883. // K <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> KX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3884. // Example: COW
  3885. // Is current phoneme K?
  3886. if(A == 72) // 'K'
  3887. {
  3888. // Get next phoneme
  3889. Y = phonemeindex[pos + 1];
  3890. // If at end, replace current phoneme with KX
  3891. if(Y == 255)
  3892. phonemeindex[pos] = 75; // ML : prevents an index out of bounds problem
  3893. else {
  3894. // VOWELS AND DIPHTONGS ENDING WITH IY SOUND flag set?
  3895. A = flags[Y] & 32;
  3896. // Replace with KX
  3897. if(A == 0) phonemeindex[pos] = 75; // 'KX'
  3898. }
  3899. } else
  3900. // RULE:
  3901. // G <VOWEL OR DIPHTONG NOT ENDING WITH IY> -> GX <VOWEL OR DIPHTONG NOT ENDING WITH IY>
  3902. // Example: GO
  3903. // Is character a G?
  3904. if(A == 60) // 'G'
  3905. {
  3906. // Get the following character
  3907. unsigned char index = phonemeindex[pos + 1];
  3908. // At end of buffer?
  3909. if(index == 255) //prevent buffer overflow
  3910. {
  3911. pos++;
  3912. continue;
  3913. } else
  3914. // If diphtong ending with YX, move continue processing next phoneme
  3915. if((flags[index] & 32) != 0) {
  3916. pos++;
  3917. continue;
  3918. }
  3919. // replace G with GX and continue processing next phoneme
  3920. phonemeindex[pos] = 63; // 'GX'
  3921. pos++;
  3922. continue;
  3923. }
  3924. // RULE:
  3925. // S P -> S B
  3926. // S T -> S D
  3927. // S K -> S G
  3928. // S KX -> S GX
  3929. // Examples: SPY, STY, SKY, SCOWL
  3930. Y = phonemeindex[pos];
  3931. //pos41719:
  3932. // Replace with softer version?
  3933. A = flags[Y] & 1;
  3934. if(A == 0) goto pos41749;
  3935. A = phonemeindex[pos - 1];
  3936. if(A != 32) // 'S'
  3937. {
  3938. A = Y;
  3939. goto pos41812;
  3940. }
  3941. // Replace with softer version
  3942. phonemeindex[pos] = Y - 12;
  3943. pos++;
  3944. continue;
  3945. pos41749:
  3946. // RULE:
  3947. // <ALVEOLAR> UW -> <ALVEOLAR> UX
  3948. //
  3949. // Example: NEW, DEW, SUE, ZOO, THOO, TOO
  3950. // UW -> UX
  3951. A = phonemeindex[X];
  3952. if(A == 53) // 'UW'
  3953. {
  3954. // ALVEOLAR flag set?
  3955. Y = phonemeindex[X - 1];
  3956. A = flags2[Y] & 4;
  3957. // If not set, continue processing next phoneme
  3958. if(A == 0) {
  3959. pos++;
  3960. continue;
  3961. }
  3962. phonemeindex[X] = 16;
  3963. pos++;
  3964. continue;
  3965. }
  3966. pos41779:
  3967. // RULE:
  3968. // CH -> CH CH' (CH requires two phonemes to represent it)
  3969. // Example: CHEW
  3970. if(A == 42) // 'CH'
  3971. {
  3972. // pos41783:
  3973. Insert(X + 1, A + 1, mem59, stress[X]);
  3974. pos++;
  3975. continue;
  3976. }
  3977. pos41788:
  3978. // RULE:
  3979. // J -> J J' (J requires two phonemes to represent it)
  3980. // Example: JAY
  3981. if(A == 44) // 'J'
  3982. {
  3983. Insert(X + 1, A + 1, mem59, stress[X]);
  3984. pos++;
  3985. continue;
  3986. }
  3987. // Jump here to continue
  3988. pos41812:
  3989. // RULE: Soften T following vowel
  3990. // NOTE: This rule fails for cases such as "ODD"
  3991. // <UNSTRESSED VOWEL> T <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3992. // <UNSTRESSED VOWEL> D <PAUSE> -> <UNSTRESSED VOWEL> DX <PAUSE>
  3993. // Example: PARTY, TARDY
  3994. // Past this point, only process if phoneme is T or D
  3995. if(A != 69) // 'T'
  3996. if(A != 57) {
  3997. pos++; // 'D'
  3998. continue;
  3999. }
  4000. //pos41825:
  4001. // If prior phoneme is not a vowel, continue processing phonemes
  4002. if((flags[phonemeindex[X - 1]] & 128) == 0) {
  4003. pos++;
  4004. continue;
  4005. }
  4006. // Get next phoneme
  4007. X++;
  4008. A = phonemeindex[X];
  4009. //pos41841
  4010. // Is the next phoneme a pause?
  4011. if(A != 0) {
  4012. // If next phoneme is not a pause, continue processing phonemes
  4013. if((flags[A] & 128) == 0) {
  4014. pos++;
  4015. continue;
  4016. }
  4017. // If next phoneme is stressed, continue processing phonemes
  4018. // FIXME: How does a pause get stressed?
  4019. if(stress[X] != 0) {
  4020. pos++;
  4021. continue;
  4022. }
  4023. //pos41856:
  4024. // Set phonemes to DX
  4025. phonemeindex[pos] = 30; // 'DX'
  4026. } else {
  4027. A = phonemeindex[X + 1];
  4028. if(A == 255) //prevent buffer overflow
  4029. A = 65 & 128;
  4030. else
  4031. // Is next phoneme a vowel or ER?
  4032. A = flags[A] & 128;
  4033. if(A != 0) phonemeindex[pos] = 30; // 'DX'
  4034. }
  4035. pos++;
  4036. } // while
  4037. } // parser 2
  4038. // Applies various rules that adjust the lengths of phonemes
  4039. //
  4040. // Lengthen <FRICATIVE> or <VOICED> between <VOWEL> and <PUNCTUATION> by 1.5
  4041. // <VOWEL> <RX | LX> <CONSONANT> - decrease <VOWEL> length by 1
  4042. // <VOWEL> <UNVOICED PLOSIVE> - decrease vowel by 1/8th
  4043. // <VOWEL> <UNVOICED CONSONANT> - increase vowel by 1/2 + 1
  4044. // <NASAL> <STOP CONSONANT> - set nasal = 5, consonant = 6
  4045. // <VOICED STOP CONSONANT> {optional silence} <STOP CONSONANT> - shorten both to 1/2 + 1
  4046. // <LIQUID CONSONANT> <DIPHTONG> - decrease by 2
  4047. //void Code48619()
  4048. void STM32SAM::AdjustLengths() {
  4049. // LENGTHEN VOWELS PRECEDING PUNCTUATION
  4050. //
  4051. // Search for punctuation. If found, back up to the first vowel, then
  4052. // process all phonemes between there and up to (but not including) the punctuation.
  4053. // If any phoneme is found that is a either a fricative or voiced, the duration is
  4054. // increased by (length * 1.5) + 1
  4055. // loop index
  4056. X = 0;
  4057. unsigned char index;
  4058. // iterate through the phoneme list
  4059. unsigned char loopIndex = 0;
  4060. while(1) {
  4061. // get a phoneme
  4062. index = phonemeindex[X];
  4063. // exit loop if end on buffer token
  4064. if(index == 255) break;
  4065. // not punctuation?
  4066. if((flags2[index] & 1) == 0) {
  4067. // skip
  4068. X++;
  4069. continue;
  4070. }
  4071. // hold index
  4072. loopIndex = X;
  4073. // Loop backwards from this point
  4074. pos48644:
  4075. // back up one phoneme
  4076. X--;
  4077. // stop once the beginning is reached
  4078. if(X == 0) break;
  4079. // get the preceding phoneme
  4080. index = phonemeindex[X];
  4081. if(index != 255) //inserted to prevent access overrun
  4082. if((flags[index] & 128) == 0) goto pos48644; // if not a vowel, continue looping
  4083. //pos48657:
  4084. do {
  4085. // test for vowel
  4086. index = phonemeindex[X];
  4087. if(index != 255) //inserted to prevent access overrun
  4088. // test for fricative/unvoiced or not voiced
  4089. if(((flags2[index] & 32) == 0) || ((flags[index] & 4) != 0)) //nochmal �berpr�fen
  4090. {
  4091. //A = flags[Y] & 4;
  4092. //if(A == 0) goto pos48688;
  4093. // get the phoneme length
  4094. A = phonemeLength[X];
  4095. // change phoneme length to (length * 1.5) + 1
  4096. A = (A >> 1) + A + 1;
  4097. phonemeLength[X] = A;
  4098. }
  4099. // keep moving forward
  4100. X++;
  4101. } while(X != loopIndex);
  4102. // if (X != loopIndex) goto pos48657;
  4103. X++;
  4104. } // while
  4105. // Similar to the above routine, but shorten vowels under some circumstances
  4106. // Loop throught all phonemes
  4107. loopIndex = 0;
  4108. //pos48697
  4109. while(1) {
  4110. // get a phoneme
  4111. X = loopIndex;
  4112. index = phonemeindex[X];
  4113. // exit routine at end token
  4114. if(index == 255) return;
  4115. // vowel?
  4116. A = flags[index] & 128;
  4117. if(A != 0) {
  4118. // get next phoneme
  4119. X++;
  4120. index = phonemeindex[X];
  4121. // get flags
  4122. if(index == 255)
  4123. mem56 = 65; // use if end marker
  4124. else
  4125. mem56 = flags[index];
  4126. // not a consonant
  4127. if((mem56 & 64) == 0) {
  4128. // RX or LX?
  4129. if((index == 18) || (index == 19)) // 'RX' & 'LX'
  4130. {
  4131. // get the next phoneme
  4132. X++;
  4133. index = phonemeindex[X];
  4134. // next phoneme a consonant?
  4135. if((mem56 & 64) != 0) {
  4136. // RULE: <VOWEL> RX | LX <CONSONANT>
  4137. // decrease length of vowel by 1 frame
  4138. phonemeLength[loopIndex]--;
  4139. }
  4140. // move ahead
  4141. loopIndex++;
  4142. continue;
  4143. }
  4144. // move ahead
  4145. loopIndex++;
  4146. continue;
  4147. }
  4148. // Got here if not <VOWEL>
  4149. // not voiced
  4150. if((mem56 & 4) == 0) {
  4151. // Unvoiced
  4152. // *, .*, ?*, ,*, -*, DX, S*, SH, F*, TH, /H, /X, CH, P*, T*, K*, KX
  4153. // not an unvoiced plosive?
  4154. if((mem56 & 1) == 0) {
  4155. // move ahead
  4156. loopIndex++;
  4157. continue;
  4158. }
  4159. // P*, T*, K*, KX
  4160. // RULE: <VOWEL> <UNVOICED PLOSIVE>
  4161. // <VOWEL> <P*, T*, K*, KX>
  4162. // move back
  4163. X--;
  4164. // decrease length by 1/8th
  4165. mem56 = phonemeLength[X] >> 3;
  4166. phonemeLength[X] -= mem56;
  4167. // move ahead
  4168. loopIndex++;
  4169. continue;
  4170. }
  4171. // RULE: <VOWEL> <VOICED CONSONANT>
  4172. // <VOWEL> <WH, R*, L*, W*, Y*, M*, N*, NX, DX, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX>
  4173. // decrease length
  4174. A = phonemeLength[X - 1];
  4175. phonemeLength[X - 1] = (A >> 2) + A + 1; // 5/4*A + 1
  4176. // move ahead
  4177. loopIndex++;
  4178. continue;
  4179. }
  4180. // WH, R*, L*, W*, Y*, M*, N*, NX, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX
  4181. //pos48821:
  4182. // RULE: <NASAL> <STOP CONSONANT>
  4183. // Set punctuation length to 6
  4184. // Set stop consonant length to 5
  4185. // nasal?
  4186. if((flags2[index] & 8) != 0) {
  4187. // M*, N*, NX,
  4188. // get the next phoneme
  4189. X++;
  4190. index = phonemeindex[X];
  4191. // end of buffer?
  4192. if(index == 255)
  4193. A = 65 & 2; //prevent buffer overflow
  4194. else
  4195. A = flags[index] & 2; // check for stop consonant
  4196. // is next phoneme a stop consonant?
  4197. if(A != 0)
  4198. // B*, D*, G*, GX, P*, T*, K*, KX
  4199. {
  4200. // set stop consonant length to 6
  4201. phonemeLength[X] = 6;
  4202. // set nasal length to 5
  4203. phonemeLength[X - 1] = 5;
  4204. }
  4205. // move to next phoneme
  4206. loopIndex++;
  4207. continue;
  4208. }
  4209. // WH, R*, L*, W*, Y*, Q*, Z*, ZH, V*, DH, J*, B*, D*, G*, GX
  4210. // RULE: <VOICED STOP CONSONANT> {optional silence} <STOP CONSONANT>
  4211. // Shorten both to (length/2 + 1)
  4212. // (voiced) stop consonant?
  4213. if((flags[index] & 2) != 0) {
  4214. // B*, D*, G*, GX
  4215. // move past silence
  4216. do {
  4217. // move ahead
  4218. X++;
  4219. index = phonemeindex[X];
  4220. } while(index == 0);
  4221. // check for end of buffer
  4222. if(index == 255) //buffer overflow
  4223. {
  4224. // ignore, overflow code
  4225. if((65 & 2) == 0) {
  4226. loopIndex++;
  4227. continue;
  4228. }
  4229. } else if((flags[index] & 2) == 0) {
  4230. // if another stop consonant, move ahead
  4231. loopIndex++;
  4232. continue;
  4233. }
  4234. // RULE: <UNVOICED STOP CONSONANT> {optional silence} <STOP CONSONANT>
  4235. // X gets overwritten, so hold prior X value for debug statement
  4236. // int debugX = X;
  4237. // shorten the prior phoneme length to (length/2 + 1)
  4238. phonemeLength[X] = (phonemeLength[X] >> 1) + 1;
  4239. X = loopIndex;
  4240. // also shorten this phoneme length to (length/2 +1)
  4241. phonemeLength[loopIndex] = (phonemeLength[loopIndex] >> 1) + 1;
  4242. // move ahead
  4243. loopIndex++;
  4244. continue;
  4245. }
  4246. // WH, R*, L*, W*, Y*, Q*, Z*, ZH, V*, DH, J*, **,
  4247. // RULE: <VOICED NON-VOWEL> <DIPHTONG>
  4248. // Decrease <DIPHTONG> by 2
  4249. // liquic consonant?
  4250. if((flags2[index] & 16) != 0) {
  4251. // R*, L*, W*, Y*
  4252. // get the prior phoneme
  4253. index = phonemeindex[X - 1];
  4254. // prior phoneme a stop consonant>
  4255. if((flags[index] & 2) != 0) {
  4256. // Rule: <LIQUID CONSONANT> <DIPHTONG>
  4257. // decrease the phoneme length by 2 frames (20 ms)
  4258. phonemeLength[X] -= 2;
  4259. }
  4260. }
  4261. // move to next phoneme
  4262. loopIndex++;
  4263. continue;
  4264. }
  4265. // goto pos48701;
  4266. }
  4267. // -------------------------------------------------------------------------
  4268. // ML : Code47503 is division with remainder, and mem50 gets the sign
  4269. void STM32SAM::Code47503(unsigned char mem52) {
  4270. Y = 0;
  4271. if((mem53 & 128) != 0) {
  4272. mem53 = -mem53;
  4273. Y = 128;
  4274. }
  4275. mem50 = Y;
  4276. A = 0;
  4277. for(X = 8; X > 0; X--) {
  4278. int temp = mem53;
  4279. mem53 = mem53 << 1;
  4280. A = A << 1;
  4281. if(temp >= 128) A++;
  4282. if(A >= mem52) {
  4283. A = A - mem52;
  4284. mem53++;
  4285. }
  4286. }
  4287. mem51 = A;
  4288. if((mem50 & 128) != 0) mem53 = -mem53;
  4289. }
  4290. ////////////////////////////////////////////////////////////////////////////////////////////
  4291. //
  4292. // Reciter
  4293. //
  4294. ////////////////////////////////////////////////////////////////////////////////////////////
  4295. void STM32SAM::Code37055(unsigned char mem59) {
  4296. X = mem59;
  4297. X--;
  4298. A = inputtemp[X];
  4299. Y = A;
  4300. A = tab36376[Y];
  4301. return;
  4302. }
  4303. void STM32SAM::Code37066(unsigned char mem58) {
  4304. X = mem58;
  4305. X++;
  4306. A = inputtemp[X];
  4307. Y = A;
  4308. A = tab36376[Y];
  4309. }
  4310. unsigned char STM32SAM::GetRuleByte(unsigned short mem62, unsigned char Y) {
  4311. unsigned int address = mem62;
  4312. if(mem62 >= 37541) {
  4313. address -= 37541;
  4314. return rules2[address + Y];
  4315. }
  4316. address -= 32000;
  4317. return rules[address + Y];
  4318. }
  4319. int STM32SAM::TextToPhonemes(unsigned char* input) // Code36484
  4320. {
  4321. //unsigned char *tab39445 = &mem[39445]; //input and output
  4322. //unsigned char mem29;
  4323. unsigned char mem56; //output position for phonemes
  4324. unsigned char mem57;
  4325. unsigned char mem58;
  4326. unsigned char mem59;
  4327. unsigned char mem60;
  4328. unsigned char mem61;
  4329. unsigned short mem62; // memory position of current rule
  4330. unsigned char mem64; // position of '=' or current character
  4331. unsigned char mem65; // position of ')'
  4332. unsigned char mem66; // position of '('
  4333. unsigned char mem36653;
  4334. inputtemp[0] = 32;
  4335. // secure copy of input
  4336. // because input will be overwritten by phonemes
  4337. X = 1;
  4338. Y = 0;
  4339. do {
  4340. //pos36499:
  4341. A = input[Y] & 127;
  4342. if(A >= 112)
  4343. A = A & 95;
  4344. else if(A >= 96)
  4345. A = A & 79;
  4346. inputtemp[X] = A;
  4347. X++;
  4348. Y++;
  4349. } while(Y != 255);
  4350. X = 255;
  4351. inputtemp[X] = 27;
  4352. mem61 = 255;
  4353. pos36550:
  4354. A = 255;
  4355. mem56 = 255;
  4356. pos36554:
  4357. while(1) {
  4358. mem61++;
  4359. X = mem61;
  4360. A = inputtemp[X];
  4361. mem64 = A;
  4362. if(A == '[') {
  4363. mem56++;
  4364. X = mem56;
  4365. A = 155;
  4366. input[X] = 155;
  4367. //goto pos36542;
  4368. // Code39771(); //Code39777();
  4369. return 1;
  4370. }
  4371. //pos36579:
  4372. if(A != '.') break;
  4373. X++;
  4374. Y = inputtemp[X];
  4375. A = tab36376[Y] & 1;
  4376. if(A != 0) break;
  4377. mem56++;
  4378. X = mem56;
  4379. A = '.';
  4380. input[X] = '.';
  4381. } //while
  4382. //pos36607:
  4383. A = mem64;
  4384. Y = A;
  4385. A = tab36376[A];
  4386. mem57 = A;
  4387. if((A & 2) != 0) {
  4388. mem62 = 37541;
  4389. goto pos36700;
  4390. }
  4391. //pos36630:
  4392. A = mem57;
  4393. if(A != 0) goto pos36677;
  4394. A = 32;
  4395. inputtemp[X] = ' ';
  4396. mem56++;
  4397. X = mem56;
  4398. if(X > 120) goto pos36654;
  4399. input[X] = A;
  4400. goto pos36554;
  4401. // -----
  4402. //36653 is unknown. Contains position
  4403. pos36654:
  4404. input[X] = 155;
  4405. A = mem61;
  4406. mem36653 = A;
  4407. // mem29 = A; // not used
  4408. // Code36538(); das ist eigentlich
  4409. return 1;
  4410. //Code39771();
  4411. //go on if there is more input ???
  4412. mem61 = mem36653;
  4413. goto pos36550;
  4414. pos36677:
  4415. A = mem57 & 128;
  4416. if(A == 0) {
  4417. //36683: BRK
  4418. return 0;
  4419. }
  4420. // go to the right rules for this character.
  4421. X = mem64 - 'A';
  4422. mem62 = tab37489[X] | (tab37515[X] << 8);
  4423. // -------------------------------------
  4424. // go to next rule
  4425. // -------------------------------------
  4426. pos36700:
  4427. // find next rule
  4428. Y = 0;
  4429. do {
  4430. mem62 += 1;
  4431. A = GetRuleByte(mem62, Y);
  4432. } while((A & 128) == 0);
  4433. Y++;
  4434. //pos36720:
  4435. // find '('
  4436. while(1) {
  4437. A = GetRuleByte(mem62, Y);
  4438. if(A == '(') break;
  4439. Y++;
  4440. }
  4441. mem66 = Y;
  4442. //pos36732:
  4443. // find ')'
  4444. do {
  4445. Y++;
  4446. A = GetRuleByte(mem62, Y);
  4447. } while(A != ')');
  4448. mem65 = Y;
  4449. //pos36741:
  4450. // find '='
  4451. do {
  4452. Y++;
  4453. A = GetRuleByte(mem62, Y);
  4454. A = A & 127;
  4455. } while(A != '=');
  4456. mem64 = Y;
  4457. X = mem61;
  4458. mem60 = X;
  4459. // compare the string within the bracket
  4460. Y = mem66;
  4461. Y++;
  4462. //pos36759:
  4463. while(1) {
  4464. mem57 = inputtemp[X];
  4465. A = GetRuleByte(mem62, Y);
  4466. if(A != mem57) goto pos36700;
  4467. Y++;
  4468. if(Y == mem65) break;
  4469. X++;
  4470. mem60 = X;
  4471. }
  4472. // the string in the bracket is correct
  4473. //pos36787:
  4474. A = mem61;
  4475. mem59 = mem61;
  4476. pos36791:
  4477. while(1) {
  4478. mem66--;
  4479. Y = mem66;
  4480. A = GetRuleByte(mem62, Y);
  4481. mem57 = A;
  4482. //36800: BPL 36805
  4483. if((A & 128) != 0) goto pos37180;
  4484. X = A & 127;
  4485. A = tab36376[X] & 128;
  4486. if(A == 0) break;
  4487. X = mem59 - 1;
  4488. A = inputtemp[X];
  4489. if(A != mem57) goto pos36700;
  4490. mem59 = X;
  4491. }
  4492. //pos36833:
  4493. A = mem57;
  4494. if(A == ' ') goto pos36895;
  4495. if(A == '#') goto pos36910;
  4496. if(A == '.') goto pos36920;
  4497. if(A == '&') goto pos36935;
  4498. if(A == '@') goto pos36967;
  4499. if(A == '^') goto pos37004;
  4500. if(A == '+') goto pos37019;
  4501. if(A == ':') goto pos37040;
  4502. // Code42041(); //Error
  4503. //36894: BRK
  4504. return 0;
  4505. // --------------
  4506. pos36895:
  4507. Code37055(mem59);
  4508. A = A & 128;
  4509. if(A != 0) goto pos36700;
  4510. pos36905:
  4511. mem59 = X;
  4512. goto pos36791;
  4513. // --------------
  4514. pos36910:
  4515. Code37055(mem59);
  4516. A = A & 64;
  4517. if(A != 0) goto pos36905;
  4518. goto pos36700;
  4519. // --------------
  4520. pos36920:
  4521. Code37055(mem59);
  4522. A = A & 8;
  4523. if(A == 0) goto pos36700;
  4524. pos36930:
  4525. mem59 = X;
  4526. goto pos36791;
  4527. // --------------
  4528. pos36935:
  4529. Code37055(mem59);
  4530. A = A & 16;
  4531. if(A != 0) goto pos36930;
  4532. A = inputtemp[X];
  4533. if(A != 72) goto pos36700;
  4534. X--;
  4535. A = inputtemp[X];
  4536. if((A == 67) || (A == 83)) goto pos36930;
  4537. goto pos36700;
  4538. // --------------
  4539. pos36967:
  4540. Code37055(mem59);
  4541. A = A & 4;
  4542. if(A != 0) goto pos36930;
  4543. A = inputtemp[X];
  4544. if(A != 72) goto pos36700;
  4545. if((A != 84) && (A != 67) && (A != 83)) goto pos36700;
  4546. mem59 = X;
  4547. goto pos36791;
  4548. // --------------
  4549. pos37004:
  4550. Code37055(mem59);
  4551. A = A & 32;
  4552. if(A == 0) goto pos36700;
  4553. pos37014:
  4554. mem59 = X;
  4555. goto pos36791;
  4556. // --------------
  4557. pos37019:
  4558. X = mem59;
  4559. X--;
  4560. A = inputtemp[X];
  4561. if((A == 'E') || (A == 'I') || (A == 'Y')) goto pos37014;
  4562. goto pos36700;
  4563. // --------------
  4564. pos37040:
  4565. Code37055(mem59);
  4566. A = A & 32;
  4567. if(A == 0) goto pos36791;
  4568. mem59 = X;
  4569. goto pos37040;
  4570. //---------------------------------------
  4571. pos37077:
  4572. X = mem58 + 1;
  4573. A = inputtemp[X];
  4574. if(A != 'E') goto pos37157;
  4575. X++;
  4576. Y = inputtemp[X];
  4577. X--;
  4578. A = tab36376[Y] & 128;
  4579. if(A == 0) goto pos37108;
  4580. X++;
  4581. A = inputtemp[X];
  4582. if(A != 'R') goto pos37113;
  4583. pos37108:
  4584. mem58 = X;
  4585. goto pos37184;
  4586. pos37113:
  4587. if((A == 83) || (A == 68)) goto pos37108; // 'S' 'D'
  4588. if(A != 76) goto pos37135; // 'L'
  4589. X++;
  4590. A = inputtemp[X];
  4591. if(A != 89) goto pos36700;
  4592. goto pos37108;
  4593. pos37135:
  4594. if(A != 70) goto pos36700;
  4595. X++;
  4596. A = inputtemp[X];
  4597. if(A != 85) goto pos36700;
  4598. X++;
  4599. A = inputtemp[X];
  4600. if(A == 76) goto pos37108;
  4601. goto pos36700;
  4602. pos37157:
  4603. if(A != 73) goto pos36700;
  4604. X++;
  4605. A = inputtemp[X];
  4606. if(A != 78) goto pos36700;
  4607. X++;
  4608. A = inputtemp[X];
  4609. if(A == 71) goto pos37108;
  4610. //pos37177:
  4611. goto pos36700;
  4612. // -----------------------------------------
  4613. pos37180:
  4614. A = mem60;
  4615. mem58 = A;
  4616. pos37184:
  4617. Y = mem65 + 1;
  4618. //37187: CPY 64
  4619. // if(? != 0) goto pos37194;
  4620. if(Y == mem64) goto pos37455;
  4621. mem65 = Y;
  4622. //37196: LDA (62),y
  4623. A = GetRuleByte(mem62, Y);
  4624. mem57 = A;
  4625. X = A;
  4626. A = tab36376[X] & 128;
  4627. if(A == 0) goto pos37226;
  4628. X = mem58 + 1;
  4629. A = inputtemp[X];
  4630. if(A != mem57) goto pos36700;
  4631. mem58 = X;
  4632. goto pos37184;
  4633. pos37226:
  4634. A = mem57;
  4635. if(A == 32) goto pos37295; // ' '
  4636. if(A == 35) goto pos37310; // '#'
  4637. if(A == 46) goto pos37320; // '.'
  4638. if(A == 38) goto pos37335; // '&'
  4639. if(A == 64) goto pos37367; // ''
  4640. if(A == 94) goto pos37404; // ''
  4641. if(A == 43) goto pos37419; // '+'
  4642. if(A == 58) goto pos37440; // ':'
  4643. if(A == 37) goto pos37077; // '%'
  4644. //pos37291:
  4645. // Code42041(); //Error
  4646. //37294: BRK
  4647. return 0;
  4648. // --------------
  4649. pos37295:
  4650. Code37066(mem58);
  4651. A = A & 128;
  4652. if(A != 0) goto pos36700;
  4653. pos37305:
  4654. mem58 = X;
  4655. goto pos37184;
  4656. // --------------
  4657. pos37310:
  4658. Code37066(mem58);
  4659. A = A & 64;
  4660. if(A != 0) goto pos37305;
  4661. goto pos36700;
  4662. // --------------
  4663. pos37320:
  4664. Code37066(mem58);
  4665. A = A & 8;
  4666. if(A == 0) goto pos36700;
  4667. pos37330:
  4668. mem58 = X;
  4669. goto pos37184;
  4670. // --------------
  4671. pos37335:
  4672. Code37066(mem58);
  4673. A = A & 16;
  4674. if(A != 0) goto pos37330;
  4675. A = inputtemp[X];
  4676. if(A != 72) goto pos36700;
  4677. X++;
  4678. A = inputtemp[X];
  4679. if((A == 67) || (A == 83)) goto pos37330;
  4680. goto pos36700;
  4681. // --------------
  4682. pos37367:
  4683. Code37066(mem58);
  4684. A = A & 4;
  4685. if(A != 0) goto pos37330;
  4686. A = inputtemp[X];
  4687. if(A != 72) goto pos36700;
  4688. if((A != 84) && (A != 67) && (A != 83)) goto pos36700;
  4689. mem58 = X;
  4690. goto pos37184;
  4691. // --------------
  4692. pos37404:
  4693. Code37066(mem58);
  4694. A = A & 32;
  4695. if(A == 0) goto pos36700;
  4696. pos37414:
  4697. mem58 = X;
  4698. goto pos37184;
  4699. // --------------
  4700. pos37419:
  4701. X = mem58;
  4702. X++;
  4703. A = inputtemp[X];
  4704. if((A == 69) || (A == 73) || (A == 89)) goto pos37414;
  4705. goto pos36700;
  4706. // ----------------------
  4707. pos37440:
  4708. Code37066(mem58);
  4709. A = A & 32;
  4710. if(A == 0) goto pos37184;
  4711. mem58 = X;
  4712. goto pos37440;
  4713. pos37455:
  4714. Y = mem64;
  4715. mem61 = mem60;
  4716. pos37461:
  4717. //37461: LDA (62),y
  4718. A = GetRuleByte(mem62, Y);
  4719. mem57 = A;
  4720. A = A & 127;
  4721. if(A != '=') {
  4722. mem56++;
  4723. X = mem56;
  4724. input[X] = A;
  4725. }
  4726. //37478: BIT 57
  4727. //37480: BPL 37485 //not negative flag
  4728. if((mem57 & 128) == 0) goto pos37485; //???
  4729. goto pos36554;
  4730. pos37485:
  4731. Y++;
  4732. goto pos37461;
  4733. }
  4734. // Constructor
  4735. STM32SAM::STM32SAM(uint32_t STM32SAM_SPEED /* = 5 */) {
  4736. STM32SAM_SPEED = STM32SAM_SPEED & 0x1f; // limit it from 0 to 31
  4737. _STM32SAM_SPEED = STM32SAM_SPEED;
  4738. // set default voice
  4739. speed = 72;
  4740. pitch = 64;
  4741. mouth = 128;
  4742. throat = 128;
  4743. phonetic = 0;
  4744. singmode = 0;
  4745. wait1 = 7;
  4746. wait2 = 6;
  4747. mem59 = 0;
  4748. oldtimetableindex = 0;
  4749. }
  4750. STM32SAM::STM32SAM() {
  4751. _STM32SAM_SPEED = 7;
  4752. // set default voice
  4753. speed = 72;
  4754. pitch = 64;
  4755. mouth = 128;
  4756. throat = 128;
  4757. phonetic = 0;
  4758. singmode = 0;
  4759. wait1 = 7;
  4760. wait2 = 6;
  4761. mem59 = 0;
  4762. oldtimetableindex = 0;
  4763. }
  4764. /*
  4765. STM32SAM::~STM32SAM() {
  4766. {
  4767. // TODO: end();
  4768. }
  4769. */
  4770. ////////////////////////////////////////////////////////////////////////////////////////////
  4771. //
  4772. // STM32SAM sam (variable string, phonetic, sing, pitch, speed, mouth, throat)
  4773. // STM32SAM say (sing off, phonetic off) (const string)
  4774. // STM32SAM say (sing off, phonetic off) (variable string)
  4775. // STM32SAM sing (sing on, phonetic off) (const string)
  4776. // STM32SAM sing (sing on, phonetic off) (variable string)
  4777. // STM32SAM sayPhonetic (sing off, phonetic on) (const string)
  4778. // STM32SAM sayPhonetic (sing off, phonetic on) (variable string)
  4779. // STM32SAM singPhonetic (sing on, phonetic on) (const string)
  4780. // STM32SAM singPhonetic (sing on, phonetic on) (variable string)
  4781. // STM32SAM voice (pitch, speed, mouth, throat)
  4782. // STM32SAM setPitch (pitch)
  4783. // STM32SAM setSpeed (speed)
  4784. // STM32SAM setMouth (mouth)
  4785. // STM32SAM setThroat (throat)
  4786. //
  4787. //
  4788. ////////////////////////////////////////////////////////////////////////////////////////////
  4789. ////////////////////////////////////////////////////////////////////////////////////////////
  4790. //
  4791. // STM32SAM sam (const string, phonetic, sing, pitch, speed, mouth, throat)
  4792. //
  4793. ////////////////////////////////////////////////////////////////////////////////////////////
  4794. char to_upper_case(char c) {
  4795. if(c >= 'a' && c <= 'z') {
  4796. return c - 'a' + 'A';
  4797. }
  4798. return c;
  4799. }
  4800. void STM32SAM::sam(
  4801. const char* argv,
  4802. unsigned char _phonetic,
  4803. unsigned char _singmode,
  4804. unsigned char _pitch,
  4805. unsigned char _speed,
  4806. unsigned char _mouth,
  4807. unsigned char _throat) {
  4808. phonetic = _phonetic;
  4809. singmode = _singmode;
  4810. pitch = _pitch;
  4811. speed = _speed;
  4812. mouth = _mouth;
  4813. throat = _throat;
  4814. int i;
  4815. for(i = 0; i < 256; i++) {
  4816. input[i] = argv[i];
  4817. }
  4818. for(i = 0; input[i] != 0; i++) {
  4819. if(i != 0) {
  4820. input[i] = to_upper_case((int)argv[i]);
  4821. }
  4822. }
  4823. if(!phonetic) {
  4824. strncat(input, "[", 256);
  4825. if(!TextToPhonemes((unsigned char*)input)) {
  4826. // PrintUsage();
  4827. return;
  4828. }
  4829. } else {
  4830. strncat(input, "\x9b", 256);
  4831. }
  4832. SetInput(input);
  4833. if(!SAMMain()) {
  4834. return;
  4835. }
  4836. }
  4837. ////////////////////////////////////////////////////////////////////////////////////////////
  4838. //
  4839. // STM32SAM sam (variable string, phonetic, sing, pitch, speed, mouth, throat)
  4840. //
  4841. ////////////////////////////////////////////////////////////////////////////////////////////
  4842. void STM32SAM::sam(
  4843. char* argv,
  4844. unsigned char _phonetic,
  4845. unsigned char _singmode,
  4846. unsigned char _pitch,
  4847. unsigned char _speed,
  4848. unsigned char _mouth,
  4849. unsigned char _throat) {
  4850. phonetic = _phonetic;
  4851. singmode = _singmode;
  4852. pitch = _pitch;
  4853. speed = _speed;
  4854. mouth = _mouth;
  4855. throat = _throat;
  4856. int i;
  4857. for(i = 0; i < 256; i++) {
  4858. input[i] = argv[i];
  4859. }
  4860. for(i = 0; input[i] != 0; i++) {
  4861. if(i != 0) {
  4862. input[i] = to_upper_case((int)argv[i]);
  4863. }
  4864. }
  4865. if(i < 256) {
  4866. input[i] = phonetic ? '\x9b' : '[';
  4867. }
  4868. if(!phonetic) {
  4869. if(!TextToPhonemes((unsigned char*)input)) {
  4870. return;
  4871. }
  4872. }
  4873. SetInput(input);
  4874. if(!SAMMain()) {
  4875. return;
  4876. }
  4877. }
  4878. ////////////////////////////////////////////////////////////////////////////////////////////
  4879. //
  4880. // STM32SAM say(sing off, phonetic off) (const string)
  4881. //
  4882. ////////////////////////////////////////////////////////////////////////////////////////////
  4883. void STM32SAM::say(const char* argv) {
  4884. int i;
  4885. phonetic = 0;
  4886. singmode = 0;
  4887. char const_input[256];
  4888. for(i = 0; i < 256; i++) {
  4889. const_input[i] = argv[i];
  4890. }
  4891. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4892. }
  4893. void STM32SAM::say(char* argv) {
  4894. int i;
  4895. phonetic = 0;
  4896. singmode = 0;
  4897. char const_input[256];
  4898. for(i = 0; i < 256; i++) {
  4899. const_input[i] = argv[i];
  4900. }
  4901. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4902. }
  4903. ////////////////////////////////////////////////////////////////////////////////////////////
  4904. //
  4905. // STM32SAM sing (sing on, phonetic off)
  4906. //
  4907. ////////////////////////////////////////////////////////////////////////////////////////////
  4908. void STM32SAM::sing(const char* argv) {
  4909. int i;
  4910. phonetic = 0;
  4911. singmode = 1;
  4912. char const_input[256];
  4913. for(i = 0; i < 256; i++) {
  4914. const_input[i] = argv[i];
  4915. }
  4916. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4917. }
  4918. void STM32SAM::sing(char* argv) {
  4919. int i;
  4920. phonetic = 0;
  4921. singmode = 1;
  4922. char const_input[256];
  4923. for(i = 0; i < 256; i++) {
  4924. const_input[i] = argv[i];
  4925. }
  4926. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4927. }
  4928. ////////////////////////////////////////////////////////////////////////////////////////////
  4929. //
  4930. // STM32SAM sayPhonetic (sing off, phonetic on)
  4931. //
  4932. ////////////////////////////////////////////////////////////////////////////////////////////
  4933. void STM32SAM::sayPhonetic(const char* argv) {
  4934. int i;
  4935. phonetic = 1;
  4936. singmode = 0;
  4937. char const_input[256];
  4938. for(i = 0; i < 256; i++) {
  4939. const_input[i] = argv[i];
  4940. }
  4941. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4942. }
  4943. void STM32SAM::sayPhonetic(char* argv) {
  4944. int i;
  4945. phonetic = 1;
  4946. singmode = 0;
  4947. char const_input[256];
  4948. for(i = 0; i < 256; i++) {
  4949. const_input[i] = argv[i];
  4950. }
  4951. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4952. }
  4953. ////////////////////////////////////////////////////////////////////////////////////////////
  4954. //
  4955. // STM32SAM singPhonetic (sing on, phonetic on)
  4956. //
  4957. ////////////////////////////////////////////////////////////////////////////////////////////
  4958. void STM32SAM::singPhonetic(const char* argv) {
  4959. int i;
  4960. phonetic = 1;
  4961. singmode = 1;
  4962. char const_input[256];
  4963. for(i = 0; i < 256; i++) {
  4964. const_input[i] = argv[i];
  4965. }
  4966. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4967. }
  4968. void STM32SAM::singPhonetic(char* argv) {
  4969. int i;
  4970. phonetic = 1;
  4971. singmode = 0;
  4972. char const_input[256];
  4973. for(i = 0; i < 256; i++) {
  4974. const_input[i] = argv[i];
  4975. }
  4976. sam(const_input, phonetic, singmode, pitch, speed, mouth, throat);
  4977. }
  4978. ////////////////////////////////////////////////////////////////////////////////////////////
  4979. //
  4980. // STM32SAM voice (pitch, speed, mouth, throat)
  4981. //
  4982. ////////////////////////////////////////////////////////////////////////////////////////////
  4983. void STM32SAM::setVoice(
  4984. unsigned char _pitch /* = 64 */,
  4985. unsigned char _speed /* = 72 */,
  4986. unsigned char _mouth /* = 128 */,
  4987. unsigned char _throat /* = 128 */) {
  4988. pitch = _pitch;
  4989. speed = _speed;
  4990. mouth = _mouth;
  4991. throat = _throat;
  4992. }
  4993. ////////////////////////////////////////////////////////////////////////////////////////////
  4994. //
  4995. // STM32SAM setPitch (pitch)
  4996. //
  4997. ////////////////////////////////////////////////////////////////////////////////////////////
  4998. void STM32SAM::setPitch(unsigned char _pitch /* = 64 */) {
  4999. pitch = _pitch;
  5000. }
  5001. ////////////////////////////////////////////////////////////////////////////////////////////
  5002. //
  5003. // STM32SAM setSpeed (speed)
  5004. //
  5005. ////////////////////////////////////////////////////////////////////////////////////////////
  5006. void STM32SAM::setSpeed(unsigned char _speed /* = 72 */) {
  5007. speed = _speed;
  5008. }
  5009. ////////////////////////////////////////////////////////////////////////////////////////////
  5010. //
  5011. // STM32SAM setMouth (mouth)
  5012. //
  5013. ////////////////////////////////////////////////////////////////////////////////////////////
  5014. void STM32SAM::setMouth(unsigned char _mouth /* = 128 */) {
  5015. mouth = _mouth;
  5016. }
  5017. ////////////////////////////////////////////////////////////////////////////////////////////
  5018. //
  5019. // STM32SAM setThroat (throat)
  5020. //
  5021. ////////////////////////////////////////////////////////////////////////////////////////////
  5022. void STM32SAM::setThroat(unsigned char _throat /* = 128 */) {
  5023. throat = _throat;
  5024. }
  5025. ////////////////////////////////////////////////////////////////////////////////////////////
  5026. //
  5027. // Hardware
  5028. //
  5029. ////////////////////////////////////////////////////////////////////////////////////////////
  5030. // Hardware specifics, for easier porting to other microcontrollers
  5031. //
  5032. // Set PA8 pin as PWM, at 256 timer ticks overflow (8bit resolution)
  5033. #include <math.h>
  5034. #include <stm32wbxx_ll_tim.h>
  5035. #define FURI_HAL_SPEAKER_TIMER TIM16
  5036. #define FURI_HAL_SPEAKER_CHANNEL LL_TIM_CHANNEL_CH1
  5037. void STM32SAM::begin(void) {
  5038. #ifdef USE_ROGER_CORE
  5039. pinMode(PA8, PWM); // audio output pin
  5040. Timer1.setPeriod(
  5041. 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)
  5042. #endif
  5043. #ifdef USE_STM32duino_CORE
  5044. pinMode(PA8, OUTPUT);
  5045. PWM->pause();
  5046. PWM->setMode(1, TIMER_OUTPUT_COMPARE_PWM1, PA8); // TIM1 CH1 (PA8)
  5047. PWM->setPrescaleFactor(1);
  5048. PWM->setOverflow(256, TICK_FORMAT); // 256 ticks overflow, no matter the CPU (timer) speed
  5049. PWM->resume();
  5050. #endif
  5051. LL_TIM_InitTypeDef TIM_InitStruct;
  5052. memset(&TIM_InitStruct, 0, sizeof(LL_TIM_InitTypeDef));
  5053. TIM_InitStruct.Prescaler = 4;
  5054. TIM_InitStruct.Autoreload = 255;
  5055. LL_TIM_Init(FURI_HAL_SPEAKER_TIMER, &TIM_InitStruct);
  5056. LL_TIM_OC_InitTypeDef TIM_OC_InitStruct;
  5057. memset(&TIM_OC_InitStruct, 0, sizeof(LL_TIM_OC_InitTypeDef));
  5058. TIM_OC_InitStruct.OCMode = LL_TIM_OCMODE_PWM1;
  5059. TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_ENABLE;
  5060. TIM_OC_InitStruct.CompareValue = 127;
  5061. LL_TIM_OC_Init(FURI_HAL_SPEAKER_TIMER, FURI_HAL_SPEAKER_CHANNEL, &TIM_OC_InitStruct);
  5062. LL_TIM_EnableAllOutputs(FURI_HAL_SPEAKER_TIMER);
  5063. LL_TIM_EnableCounter(FURI_HAL_SPEAKER_TIMER);
  5064. } // begin
  5065. inline void STM32SAM::SetAUDIO(unsigned char main_volume) {
  5066. #ifdef USE_ROGER_CORE
  5067. Timer1.setCompare(TIMER_CH1, main_volume);
  5068. #endif
  5069. #ifdef USE_STM32duino_CORE
  5070. PWM->setCaptureCompare(1, main_volume, TICK_COMPARE_FORMAT);
  5071. #endif
  5072. // if(main_volume > 64) {
  5073. // LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, 127);
  5074. // } else {
  5075. // LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, main_volume);
  5076. // }
  5077. float data = main_volume;
  5078. data /= 255.0f;
  5079. data -= 0.5f;
  5080. data *= 4.0f;
  5081. data = tanhf(data);
  5082. data += 0.5f;
  5083. data *= 255.0f;
  5084. if(data < 0) {
  5085. data = 0;
  5086. } else if(data > 255) {
  5087. data = 255;
  5088. }
  5089. LL_TIM_OC_SetCompareCH1(FURI_HAL_SPEAKER_TIMER, data);
  5090. }