ELF(œž4`ƒ4 ( pÐtÐôÐô44€4€44�4�€€ìuìu€€ø`M€€PP�P�DDQåtd/lib/ld-linux-armhf.so.3GNUGNU×ÁóGªc:qÄ�ËÏ4æÀ‘**F%;-($/+684'"& :5*),% 3 .  #19! 027% ÁD€ ÐB€0Äš  …¤† ‚A@ �€"@(�`AFb 4Q& "#$&'(*,.0124569=­9 \‚ÜAE> ¯EÈ6ZÌUé¯Õ1êÓï}‹s¯4è†ð–|¸+k[˧ O[1/N=öåÅ||íFuÀ9v)Œ2Žu‘². ¼î�Êœ»“¡2>®Xï—yíéC+>~–|@Qò’»lAØßIì—©ºÚzƒ¬?³Y~AµZ+Ë–“ HåÙqXºã’|!Ï ý&”vU_–“ìÞ“ŸûnK±?ÓÕª?BEÕì·“Ý4qÆÃÂ!À¼›{œ|¾ÚW¹�ñvT<”¶ ¥Ž B3I p:¬Úó­`My Òû^áQ¼4ø.Åþ'�¸`M~†oµ@êòVp㪒øÀ`M;˜W!fN‹øW}Éù¬`M4¼� žølibSDL-1.2.so.0__gmon_start___Jv_RegisterClasses_init_finilibSDL_image-1.2.so.0SDL_FreeSurfaceSDL_QuitSDL_PollEventSDL_GetMouseStateIMG_LoadSDL_DisplayFormatSDL_MapRGBSDL_SetColorKeySDL_GetErrorSDL_SetPaletteSDL_SetVideoModeSDL_InitSDL_GetVideoInfoSDL_WM_SetCaptionSDL_CreateRGBSurfaceSDL_FillRectSDL_UpperBlitSDL_FlipSDL_Delaylibstdc++.so.6_Znwjlibm.so.6libgcc_s.so.1__aeabi_unwind_cpp_pr0__aeabi_unwind_cpp_pr1__aeabi_idiv__aeabi_idivmodlibc.so.6strcpy_IO_putcfopenputsputcharabortprintfrewindstrtolfgetsstrlenfseekstdoutfclosemallocstrncatfreadstrcmp__libc_start_mainbasenamefree__cxa_atexit_edata__bss_start__bss_start____bss_end____end___endGCC_3.5GLIBC_2.4GLIBCXX_3.4€ U&y ÅÙ ii Íat)’×ìø4 8<0@1D.HLP(TX\6` d#hl3pt x|"€$„'ˆ%Œ�”˜,œ  ¤¨¬!°&´5¸¼:À/ÄÈÌÐ+Ô4Ø-Üàä@-éD뀽èà-åàŸåà�àð¾åPsÆ�âÊŒâPó¼åÆ�âÊŒâHó¼åÆ�âÊŒâ@ó¼åÆ�âÊŒâ8ó¼åÆ�âÊŒâ0ó¼åÆ�âÊŒâ(ó¼åÆ�âÊŒâ ó¼åÆ�âÊŒâó¼åÆ�âÊŒâó¼åÆ�âÊŒâó¼åÆ�âÊŒâó¼åÆ�âÊŒâøò¼åÆ�âÊŒâðò¼åÆ�âÊŒâèò¼åÆ�âÊŒâàò¼åÆ�âÊŒâØò¼åÆ�âÊŒâÐò¼åÆ�âÊŒâÈò¼åÆ�âÊŒâÀò¼åÆ�âÊŒâ¸ò¼åÆ�âÊŒâ°ò¼åÆ�âÊŒâ¨ò¼åÆ�âÊŒâ ò¼åÆ�âÊŒâ˜ò¼åÆ�âÊŒâ�ò¼åÆ�âÊŒâˆò¼åÆ�âÊŒâ€ò¼åÆ�âÊŒâxò¼åÆ�âÊŒâpò¼åÆ�âÊŒâhò¼åÆ�âÊŒâ`ò¼åÆ�âÊŒâXò¼åÆ�âÊŒâPò¼åÆ�âÊŒâHò¼åÆ�âÊŒâ@ò¼åÆ�âÊŒâ8ò¼åÆ�âÊŒâ0ò¼åÆ�âÊŒâ(ò¼åÆ�âÊŒâ ò¼åÆ�âÊŒâò¼åÆ�âÊŒâò¼åÆ�âÊŒâò¼åÆ�âÊŒâò¼åÆ�âÊŒâøñ¼åÆ�âÊŒâðñ¼åPãðO-é` á ÐMâP á9Ú@‘å” Ÿå áéÿÿëPã „ Ÿå áäÿÿëPãNë ã|ÿÿëh Ÿå áÜÿÿëPã†FëT ŸåzÿÿëP ŸåxÿÿëL ŸåvÿÿëH ŸåqÿÿëD Ÿårÿÿë@ Ÿåpÿÿë< Ÿånÿÿë8 Ÿålÿÿë4 Ÿåjÿÿë0 Ÿåhÿÿë, Ÿåfÿÿë( Ÿådÿÿë$ Ÿåbÿÿë Ÿå`ÿÿë Ÿå^ÿÿë Ÿå\ÿÿë ŸåZÿÿë  ãaÿÿë ãPÿÿë— @ ãøzŸå� áÇë0 ã0�åTá#ª•çÜŸå§ÿÿë¡ áÔŸåPã�Ç °•瀠  á€ žÿÿëPã  á¬Ÿå™ÿÿëPã  áœŸå”ÿÿëPã�:Ÿå€ ã�Çç •ç„ŸåŒÿÿ뀟åPã,�Ç •瀠†ÿÿëlŸåP〠d:Ÿ�Ç •çÿÿëXŸåP〠P:Ÿ�Ç °•ç  áwÿÿëPã  á4ŸårÿÿëPã :Ÿå  ã€ ã Çç °•ç  áŸåhÿÿëPã  áŸåcÿÿëPãô9Ÿå€ ã  ã ÇçèŸå •çZÿÿëPâ@„âTá( •ç  ããþÿëÀ9Ÿå€ ã‡ç¸Ÿå•çLÿÿëPâ@„âTá •ç  ãÕþÿë�9Ÿå€ ã‡çˆŸå•ç>ÿÿëPâ@„âT᪠•ç  ãÇþÿë`9Ÿå€ ã‡ç¡•çTŸå  á/ÿÿëPã  á@Ÿå*ÿÿëPã @„âTá– •ç ã  ã²þÿë9Ÿå€ ã‡ç•ç ŸåÿÿëPã@„âTáñ € ãðŸå•çÓþÿë-�Çå•çàŸåÿÿëPã @„âTáè È8ŸåÈŸå•ç0—瀠ã�s àE€âÂþÿë°Ÿå•çþþÿëPâ @„âTáÜ ˆ8Ÿå•ç  ã —ç…þÿëx8Ÿå€ ã“z*àPŠåpŸå•çíþÿëPâ @„âTáÏ D8Ÿå•ç  ã —çtþÿë48Ÿå€ ã“z*àTŠå0Ÿå•çÜþÿëPâ @„âTá 8Ÿå•ç  ã —çcþÿëð7Ÿå€ ã“z*àXŠå•çìŸåËþÿëPã@„âTá¹ �•ç áºþÿëÿPã°Ѝ7Ÿå¨Ÿå á0—瀠ã�s à†€â€âyþÿë•瘟åµþÿë¡ áPãl7Ÿål'Ÿå€ ã0—ç’s#àd˜Ãå •çlŸå©þÿëPã@7Ÿå@'Ÿå€ ã0—ç’s#àe˜Ãå •çDŸåžþÿë Pâ@„âTá 7Ÿå  á  ã•瀗ç$þÿëô6ŸåÇŸåà ã“x#à  á  ã à‡ç€ ã\ƒå•çþÿëì6Ÿå�Çç0ƒâ‡ç¡•çÜŸå  á€þÿëPã  áÈŸå{þÿëPã @„âTáë •ç ã  ãþÿë�6ŸåPã‡çóÊ�6Ÿå€ ã�Çç¡•ç„Ÿå  ágþÿëPãÅ  ápŸåbþÿëPãÀ Xã0�å  á‡àµ €â€âþÿë0�å0ƒâ0�å@„â¦þÿêVã(Ÿå áNþÿëPã9 Ÿå áIþÿëPã4 Ÿå áDþÿëPã/ ¨Ÿå á?þÿëPã* äŸå á:þÿëPão ÔŸå á5þÿëPãj ÄŸå á0þÿëPãa ´Ÿå á+þÿëPã\ ¤Ÿå á&þÿëPã‘ ”Ÿå á!þÿëPãlþÿ„Ÿå„Ÿå¼ýÿë ã·ýÿë†ëTŸåºýÿëPŸå¸ýÿëLŸå¶ýÿëZþÿê~ë4Ÿå²ýÿëLŸå°ýÿëHŸå®ýÿë(Ÿå©ýÿë(Ÿåªýÿë4Ÿå¨ýÿë0Ÿå¦ýÿë,Ÿå¤ýÿë ã$Ÿåžýÿë ãŸå›ýÿëŸåœýÿëŸåšýÿëŸå˜ýÿë Ÿå–ýÿëŸå”ýÿëŸå’ýÿëŸå�ýÿëüŸåŽýÿëøŸåŒýÿëôŸåŠýÿëðŸåˆýÿëìŸå†ýÿëèŸå„ýÿëäŸå‚ýÿëàŸå€ýÿëÜŸå~ýÿëØŸå|ýÿëÔŸåzýÿëПåxýÿëÌŸåvýÿëÈŸåtýÿëÄŸårýÿëÀŸåmýÿëþÿê•å<ë ãeýÿë4뤟åhýÿë Ÿåfýÿ뜟ådýÿëŸåbýÿë�Ÿå`ýÿëŸåˆŸåZýÿ넟償åWýÿë  ãaýÿëxŸåVýÿëtŸåTýÿëpŸåRýÿëlŸåPýÿëhŸåNýÿëdŸåLýÿë`ŸåJýÿë\ŸåHýÿëXŸåFýÿëTŸåDýÿë ã<ýÿë@„âTá8 •ç ã  ã)ýÿë,4Ÿå@„â�Çç0ƒâ‡çåýÿêäŸå0ýÿë ã+ýÿëŸå/ýÿë ã'ýÿëüŸå+ýÿë ã#ýÿë0�åHBŸåSãä3Ÿå �å „çëëÔŸåýÿë ãýÿë ãÄŸåýÿëÀŸåýÿ뼟åýÿ븟åýÿë´Ÿåýÿë°Ÿåýÿ묟åýÿ먟å ýÿ뤟å ýÿë Ÿåýÿë ãýÿ딟åýÿë ãüüÿ눟å ë4ëÝ2ÔáSãPþëpcŸåžë ãP á PãñŸ—üÿÿê ››üštšôšìšäšÜšÌš¨š0”ç ã0ƒâ0„ç 3ŸåP„ç0ƒâP„çéÿÿêë Pãæÿÿ„ýÿê¸ëúÿÿêQëøÿÿêý ëöÿÿê· ëôÿÿê™ ëòÿÿêÌ ëðÿÿê4 ëîÿÿêÈŸåÍüÿë ãÅüÿ뼟åÉüÿë ãÁüÿë°ŸåÅüÿë ã½üÿ뤟åÁüÿë ã¹üÿ똟å½üÿë ãµüÿ댟å¹üÿë ã±üÿ뀟åµüÿë ã­üÿëtŸå±üÿë ã©üÿëhŸå­üÿë ã¥üÿë.„âë«ÿÿêÀàÌàÐàØàøà,áXádá˜áÜá,âPâŒâ¸âìâãDãxã ãÐãHðPðXðdð’ùhðxð„ð-Œð�ù˜ð¤ð´ð‘ùÄðhùððlù ñpùPñ`ñtùlñ.(ä-Èñüñ0òdòÔòàòìò(-,-$ó8ó$- ô4ôôãääííð$ð,ð8ðDðþÖ4ädä¤äøäTå¬åüåPæ¨æøæ0çˆçÌç èLè�èÔè éTé˜éÜéêXêœêäê0ë<ë„ëØëXì í(íLíhí¤íîàí$îdîˆîÀîìî4ï<ï¼ïèïüï4-,ñüòD-tôHóxó˜ó¤ó¬ó¸óÄóÌóìóøó@ôHŸ<-€ùÌðüð|ñ¤ñØñ ò@ò òpò8@-é ãñûÿëp@ŸåP ãP0D⌠DâÍ„â ád„åP€åh„å£å SáüÿÿD0Ÿå ãƒâ£åSáüÿÿ0Ÿå ãø‚å.‚âRá0 ãúÿÿ ŸåT0åP0å0„ç8€½è€ÀTKÜK° ãà ã�ä  á -å-åÀŸåÀ-å Ÿå 0ŸåEüÿëöûÿë€Úø� Ú0Ÿå Ÿå0�à0“çSãÿ/=üÿê@bÄ0Ÿå ÓåRã   Ãÿ/áü Ÿå@-é0�åS〽0ŸåS〽3ÿ/ွè ðA-é˜2Ÿå˜bŸåÓ0–áSã“Ð0ÖáSã�€BŸå€ ã@PDâ~„â”äPã Òûÿë€åTáøÿÿX‚ŸåD˜åPã Êûÿë0 ãD1ˆåH˜åPã Äûÿë,2Ÿå  ãH!ƒåL˜åPã ½ûÿë2Ÿå  ãL!ƒåP˜åPã ¶ûÿëô1Ÿå  ãP!ƒåT˜åPã ¯ûÿëØ1Ÿå  ãT!ƒåX˜åPã ¨ûÿë¼1Ÿå  ãX!ƒå\˜åPã ¡ûÿë 1Ÿå  ã\!ƒå`˜åPã šûÿë„1Ÿå  ã`!ƒå|AŸåp ãø•åPã ‘ûÿëøq…å^…âUá÷ÿÿXAŸå˜çPã ˆûÿë<1Ÿå  ã ƒçTåPã �ûÿë 1Ÿå  ãT åPåPã zûÿë1Ÿå  ãP åÐ0ÖáSã-0 ã á$ áù,‚âh ‚â0ƒâ SãÆçøÿÿÔ0Ÿå¼ Ÿå’çPã 5ûÿëÀ0Ÿå  ã–ç0CâPá †ç “ûÿëÐ Öá0 ãRá” Ÿå0†ç Bâ0Æçûÿë`0ŸåÓ0–áSãT0ŸåÐ0ÓáSãð�½`ŸåðA½è(ûÿêXŸå&ûÿëkÿÿêPŸå#ûÿë$0ŸåÐ0ÓáSãËÿÿ <ŸåûÿëÈÿÿê4Ÿåûÿëäÿÿê’ù4€TKÜKXù\ù Û¸ÚÐÚäÚøÚ@-éÀ ã<0Ÿå<Ÿå<àŸåWƒâ  áÀÀç ƒäSáüÿÿ$0Ÿå  ã ÀçŸåÿúÿëPãûÿÿ€½è”ÿ“ýðþ@-éÐMâÜ@Ÿå�â  áHûÿë0�å„â$0„å0�å(0„åëúÿëPã 0Ôå0Câ SãñŸ—ê £ø¢£<££££££££ 0”å@„àK„â0 ã“1ÄåN„âÐ�‽è ãÆúÿë 0”å@„àK„â0 ã“1ÄåN„âôÿÿê0Ôå$ ŸåSã Sã0Ÿ Âëÿÿê Ÿå0Âçèÿÿê®ý³ý8@-éûÿëPPâ Þúÿë@Pâ@   áÍúÿë ã  á0 á”åžúÿë ã  á áßúÿë á8€½è40Ÿå4 ŸåÒ “áRãÐ@ÓáTãõÿÿ §úÿë@ ã áŸå‘úÿë á8€½è’ùDÛø@-é` áQŸåTåPã ©úÿë0 ãT0å áäúÿëpPâ ®úÿë@Pâ@   á�úÿë ã0 á  á”ånúÿë ã  á á¯úÿë ã á  áT@å @Ÿå©úÿëœ0ŸåÓ0”áSãˆ0ŸåÐ0ÓáSãø€½€Ÿå áø@½è^úÿêh@Ÿåh0ŸåÓ0”áSãÐ0ÔáSã Sã0 ãT0åÐ0ÔáSãø€½`úÿë á0ŸåKúÿëßÿÿê[úÿë á ŸåFúÿë 0Ÿå0Ôçìÿÿꀒù`ÛPÛDÛ@-éÛMâÐMâë�âqïær ïæs0ïæÀ�âàŽâ@ ã@Íå @Íå @ÍåÌå Ìå0ÌåÀŒâ\áùÿÿÌ ã ã �â0 ãÀ�åNúÿëÐ�âÛ�‽è@-éÛMâÐMâ!( á!4 áë�âr ïæs0ïæqïæÀ�âàŽâ@ ã@Íå @Íå @Íå Ìå0ÌåÌåÀŒâ\áùÿÿÌ ã ã �â0 ãÀ�å0úÿëÐ�âÛ�‽èðG-造ሡŸåˆqŸåˆ‘Ÿå@ ã á^úÿëPPâN 0DâSãñŸ—.ê§l§T§„§ü¦Œ¦D§  ã á  á0 á«ÿÿë áúÿë` á—åPã úÿë ã0 á  á–å×ùÿë ã@„â  á áúÿë á`§åùùÿëTãÕÿÿð‡½è ã á  áÿ0 ã�ÿÿëâÿÿê  ã áÿ ã0 á‰ÿÿëÜÿÿêÿ ã á  á0 áƒÿÿëÖÿÿê á šç›ÿÿëÒÿÿê ã áÿ  ã0 áyÿÿëÌÿÿêÿ ã á  á0 ãsÿÿëÆÿÿêÿ  ã á ã0 ámÿÿëÀÿÿê80ŸåÓ0šáSãÐ0ÚáSã ´ùÿë áŸåŸùÿ뀟åœÿÿêÀ0-’ù”Û|Û €àRã  Ó  Ã2Pã  £Rã �àPã Ó Ã–Qã £ÿ/á áÿ/áp-éUΠãäAŸå0 ã ã0Ä„åÌ ã4Ä„å2Πã0„å 0„å8Ä„åÀ1Ÿå–Ï ã<Ä„å¸ÁŸåWƒâ  áÄå,Äå-Äå@„åD„åH„åL„å Äç ƒäSáÀ ãûÿÿ€aŸå€QŸå\È„å¶èdÈÄåeÈÄå¥è0 ãP8„åX8„å0 ãf8ÄåX1Ÿå–èÀ„ç0ƒâ…äÀ„ç0ƒâ@ŸåÀ„ç0ƒâ!( áÀÄç0ƒâ²ÅàÀ„ç0ƒâ ÅåÀ„ç0ƒâ  ãÀÄç0ƒâÀÄçÀ„ç0ƒâT(„åÀÄç0ƒâÀ„ç0ƒâÀ„çµ= ãÀ„ç0ƒâÀ„çÔ0ŸåÀÄç;ƒâÀÄç0ƒâÀ„ç0ƒâÀ„ç0ƒâÀ„ç0ƒâÀ„ç0ƒâÀ„ç 0ŸåÀ„ç0ƒâÀ„ç$0CâÀ„ç0ƒâÀ„ç0ƒâÀ„ç0ƒâÀ„ç0ƒâÀ„çl0ŸåÀ„ç0CâÀÄç`0ŸåÀ„ç0ƒâÀ„ç0ƒâÀ„ç 0ƒâÀÄç0ƒâÀÄç0ƒâÀÄç40ŸåÀÄçp½èÿ/á”ÿ“ý|ÛP-ðþHõˆùdù|ùñþ@-é  ãL@Ÿå2 ã0”å4”åùÿë<0Ÿå  ã, ÄåÓ0”áSã,0ŸåXåÐ0ÔáS〽Ÿå0”å4$”å@½èæøÿê’ù€°Û@-é  ãL@Ÿå2 ã8”å<”åùÿë<0Ÿå  ã, ÄåÓ0”áSá,0ŸåXåÐ0ÔáSွŸå8”å<$”å@½èËøÿê’ù€ÐÛø@-é  ãâøÿëP㤺¤RŸåÐ0ÕáSã—ùøÿë�bŸå0 áŒŸå “å0“å á0$…å44…åáøÿëÜrÕáWãt2 ã8–å<–å  áÓøÿëT2ŸåTBŸå,pÆåÓ0–áSãXåÐ0ÖáSã 4Ÿå8•å<$•åžøÿëXåPãw  ã0 áÿ ã�å�øÿëXÀå  ã0 áf ãŒåœå‰øÿëXÀåÿ ã  á0 ãˆåœå‚øÿëXÀåf ã  á0 ã„åœå{øÿëXÀå ã0 áÿ  ã€åœåtøÿëXÀå ã0 áf  ã|åœåmøÿëXÀå ã  áÿ0 ãxåœåføÿëXÀå ã  á™0 ãtåœå_øÿëXÀå ã  áD0 ãpåœåXøÿëXÀå ã  á0 álåœåQøÿëXÀåÿ ã  á0 áhåœåJøÿëXÀåÌ ã  á0 ádåœåCøÿëXÀå™ ã0 á  á`åœå<øÿë\å  ã“øÿë¬0Ÿå…çø€½è  ã2 ã0–å4–å^øÿë€0Ÿå€@Ÿå  ãÓ0–á, ÆåSãXåÐ0ÖáSãŽÿÿ dŸå0•å4$•å(øÿëXåˆÿÿêPŸå'øÿëdÿÿê4øÿë á@Ÿåøÿë ãøÿë.øÿë á,Ÿåøÿë ãøÿë0Ü’ù€ÐÛXù°ÛÜ8ÜðÛ@0Ÿå@ Ÿåpã “ç  Qáÿ/ÑÀ ã$ áù,‚âh ‚â€âQáÀÃçøÿÿÊÿ/áŒùðG-éþÿ $��嬅Ÿå`Iâ ê°ÝáP�åÀÖå€àRãqÿæ°Íá�°Í\ã ˜C!àdÑåPã» \ãÈŠöå˜C à Qã Qéÿÿ²ÄÝáT˜�åDŸå À‰àRã”ç|Àÿæ²ÄÍá€âÀŒ²ÄÍ„çÀÖå��å\ã°”ÍáãÿÿŸå `�å�C àÀÔçP�åT�å á á þÿêP8‘åH�â\šå“ à  á¸Àaá80�â¬òÿëPãØºÀÄŸå $Ÿå 0•ç ÕçŽþÿêP8‘å!ÀLâH�â“ à\šå¸Àaá  á80�âœòÿëPãõº€Ÿå`$Ÿå0•ç Õç~þÿêP8‘åH�â\šå“ à  á°Áaá@0�â�òÿëPãºDÄŸå$$Ÿå 0•ç Õç¯þÿêP8‘å!ÀLâH�â“ à\šå°Áaá  á@0�â}òÿëP㻺Ÿåä#Ÿå0•ç ÕçŸþÿêP8‘åH�â\šå“ à  á¸Àaá80�ânòÿëPãvºÈßå¨#Ÿå 0•ç ÕçÎþÿêP8‘å!ÀLâH�â“ à\šå¸Àaá  á80�â^òÿëPãÀºˆŸåh#Ÿå0•ç Õç¾þÿêP8‘åH�â\šå“ à  á°Áaá@0�âOòÿëPãrºLßå,#Ÿå 0•ç ÕçòþÿêP8‘å!ÀLâH�â“ à\šå°Áaá  á@0�â?òÿëPㆺ Ÿåì"Ÿå0•ç ÕçâþÿêP8‘åH�â\šå“ à  á¸Àaá80�â0òÿëPãJºÐŸå°"Ÿå 0•ç ÕçÿÿêP8‘å!ÀLâH�â“ à\šå¸Àaá  á80�â òÿëPãpº�Ÿåp"Ÿå0•ç ÕçÿÿêP8‘åH�â\šå“ à  á°Áaá@0�âòÿëPã"ºTŸå4"Ÿå 0•ç Õç6ÿÿêP8‘å!ÀLâH�â“ à\šå°Áaá  á@0�âòÿëPãlºŸåô!Ÿå0•ç Õç&ÿÿêðñÿë áüŸåÛñÿë�ýÿêëñÿë áèŸåÖñÿëÜŸå¼!Ÿå0•ç ÕçSþÿêâñÿë áÄŸåÍñÿ븟å˜!Ÿå0•ç ÕçÿÿêÙñÿë á ŸåÄñÿ딟åt!Ÿå0•ç ÕçÅþÿêÐñÿë á|Ÿå»ñÿëpŸåP!Ÿå0•ç Õç{þÿêÇñÿë áXŸå²ñÿëLŸå,!Ÿå0•ç Õç±ýÿê¾ñÿë á4Ÿå©ñÿë(Ÿå!Ÿå0•ç Õçèýÿêµñÿë áŸå ñÿë!Ÿå0•ç ‚â Õçßýÿê¬ñÿë áìŸå—ñÿëà Ÿå0•ç ‚â ÕçWþÿê£ñÿë áÈŸåŽñÿë¼ Ÿå0•ç ‚â Õç�þÿêšñÿë á¤Ÿå…ñÿë˜ Ÿå0•ç ‚â Õç„ýÿê‘ñÿë á€Ÿå|ñÿët Ÿå0•ç ‚â Õçùýÿêˆñÿë á\ŸåsñÿëP Ÿå0•ç ‚â ÕçµþÿêLÐ�âð�½è}ñÿë á4Ÿåhñÿë�üÿê€hù-Œùpù-(-Pù-�ÝpÝðA-éÐMâ¼QŸåÐ0ÕáSãS°1Ÿå°AŸå ã •çXå6ñÿëÐ0ÕáSãMTåŒÁŸåPã „qŸåà ã`�å €�å·àŒáp‡â á·àŒáháŸåX åd1Ÿå¾`ŒáàŽâ¾€ŒáSñÿëPãIº0ÕåSã T åRã 4Ÿå1ñÿë1Ÿå0ÓåPåPã Sã@t•åDd•å*üàŸåÀ�å €�å¾p„áàŽâX å¾`„áàŽâ ã¾À„áäÀŸåØ0Ÿå¼€„á2ñÿëPã#º0ÕåSã P0åSã ¸ŸåñÿëXåùðÿë ãñÿëÐ0ÕáSãÐ�âð�½è�ŸåÐ�âðA½èñÿꄟåñÿë¨ÿÿê|Ÿåþðÿë®ÿÿê�å �å0 áhŸå`�åôðÿë40ŸåPåËÿÿêñÿë áLŸåíðÿëÖÿÿêýðÿë á8Ÿåèðÿë°ÿÿê8-€ÌKÐKLMØÝÒK Þ4Þ¨ÝÄÝôÝ�Ý@-é´@ŸåÜ2ÔáSã  ã2 ã0”å4”åöðÿë”0Ÿå  ã, ÄåÓ0”áSã„0ŸåXåÐ0ÔáSã pŸå0”å4$”åÀðÿë@½ècÿÿê  ã2 ã8”å<”åàðÿë<0Ÿå  ã, ÄåÓ0”áSá,0ŸåXåÐ0ÔáSáíÿÿ 8”å<$”åŸåªðÿëèÿÿê’ù€°ÛÐÛà-å<ÐMâãðÿë á�â¿ðÿë�âŸåÈðÿë<Ð�‽è0Üø@-éBŸåRŸå2Ÿå ”ç0”çRáz ‘ùÿëPã  ø€½è1Ÿå ”ç”çµ= ãQã „çÚ0 ã á$ áù,‚âh ‚â0ƒâSáÄçøÿÿ¬Ÿå  ã¨aŸå „ç�â0”ç „ç˜Ÿå|QŸå”qŸå „çê„!ŸåPã•ç�â…ç  á ”ç ã´ðÿë0”ç ÓåRãñÿÿL1Ÿå0!Ÿå’çH1ŸåQãÓ0”á7Sã1ŸåÐ0ÓáSã $ŸåVðÿë !Ÿå 1Ÿå’èhƒå¼Ãáð0Ÿå ã”çŒùÿëPã Ì0ŸåÐ0ÓáSã+ì0Ÿåà Ÿå0”ç’è4 áù<ƒâh0ƒâ „à„ç´Âá  ŸåÀ0Ÿå”ç¼ Ÿå0”ç”ç´ ŸåSá„çªsã 0  ã$ áù,‚âh ‚â0ƒâSáÄçøÿÿº ãø€½èSã00ŸåÐ0ÓáSãÎÿÿ \ŸåðÿëËÿÿê ãø€½èLŸåðÿëÐÿÿê ãðÿë<-D-Œù€ùXùTù\ù’ùPÞhÞûxùdù„ùpÞŒÞp@-é ãðÿë¼bŸå õÿë¸2Ÿå0ÖçSã ¨"Ÿå0 ã  ã0ÆçV ‚â0Æçp€½è�2Ÿå0ÖçSãôÿÿ„"ŸåÖçQãx2ŸådBŸå ÖçRã   Ä  p€½\2Ÿå0ÔçSã L"Ÿå0 ã  ã0Æç@"Ÿå0Æçp€½è0Æçûþÿëéÿÿê(2ŸåÔçPãñÿÿ2ŸåPÔçUã "ŸåÄç0”çSã0C0„p€½ ãp€½èð!Ÿå0ÔçSã ä1ŸåPÄç ”çRãôÿÿ P„ç0ƒâP„ç¨øÿëÐÔáPãp€½¸Ÿå´ïÿë áp€½è¬Ÿå ÔçRã Ð Ôá0ÄçRã p€½ŒŸå§ïÿë ãp€½è€1ŸåÔçQã  Äç\1Ÿå0”çSãÓÿÿ Ð0ÔáSã p€½PŸå–ïÿë ãp€½èD1Ÿå ÔçRã Äç1Ÿå0”çSãÂÿÿ Ð0ÔáSã p€½Ÿå…ïÿë ãp€½è1ŸåÔçQã Ä p€½ô0Ÿå0ÔçSã ä0Ÿå  ã ã Æçp€½èÔÀŸå€0Ÿå ÖçPã Ä Ÿå ã Ãç“ç@âPáƒç º ãp€½è Ÿå ÓçRã Œ ŸåÃç“ç�âQãƒçÚ ãƒçïÿÿê ãp€½è ã_ïÿë ãp€½è®ýþ·þ³ý ý¢þ›ý<-©þ€ù Þªþ°Þ¤þÀÞ«þÜÞ¥þ¬þ þ-¡þ@-é8ÐMâT@ŸåÐ0ÔáSã HŸå2ïÿëµ= ã0”çE„ൠ„â€âkïÿë á�âGïÿë�âŸåPïÿë3úÿëÆýÿë ã8Ð�‽èüÞ0Ü8@-éÜ@ŸåÜ0Ÿå”çQãÚ0 ã á$ áù,‚âh ‚â0ƒâSáÄçøÿÿÐ0Ôá¨PŸå¨ŸåSã¤0Ÿå ”ç”ç „ç„ç€0Ÿå”çAøÿëPã h0ŸåÐ0ÓáSãl0Ÿål Ÿå0”ç’è4 áù<ƒâh0ƒâ „à„ç´ÂáL0Ÿå ã ”ç00Ÿå „ç8€½è8Ÿåçîÿë0Ÿå“çáÿÿê(ŸååîÿëçÿÿêŒù€ù„ù|ùxùhÞPùß<ß8@-éAŸå1Ÿå”çQãÚ0 ã á$ áù,‚âh ‚â0ƒâSáÄçøÿÿà0ŸåàPŸåÐÔá ”ç”ç ‚â�âPã „ç„ç$°0Ÿå”çü÷ÿëPã ˜0ŸåÐ0ÓáSã ˜0Ÿå˜ Ÿå0”ç’è4 áù<ƒâh0ƒâ „à„ç´Âáx Ÿå\0Ÿå ”çRãÚh Ÿå“ç�âƒç ã8€½èÐ0ÓáSãúÿÿ HŸå�îÿë ã8€½è<Ÿå–îÿë0Ÿå“çÕÿÿê,Ÿå”îÿëÛÿÿêŒù|ù€ùxùhÞdù„ù”ßTß|ß@-é\1Ÿå\AŸå”çQã €½ 0ƒâ”çPã Ú0 ã á$ áù,‚âh ‚â0ƒâSáÄçøÿÿ1Ÿå!Ÿå’ç 1ŸåŸåAâ ”ç„ç BâRã „çè Ÿµ ³‚·Ð0ÔáSãØ0Ÿå”çŸ÷ÿëPã ¼0ŸåÐ0ÓáSã$¸0Ÿå¸ Ÿå0”ç’è4 áù<ƒâh0ƒâ „à„ç´ÂᘠŸå€0Ÿå ”çRãÚˆ Ÿå ã“çAâƒç€½ètŸå@îÿëL0ŸåL Ÿå’çL0Ÿå”ç|÷ÿëPãêÿÿ ÛÿÿêÐ0ÓáSã ã€½è8Ÿå3îÿë×ÿÿê0Ÿå0îÿë ã€½è€ù|ùŒùxùhÞdù„ù¬ßÔßìß8@-é(AŸå(1Ÿå0”çSã7 1Ÿå”çQãÚ0 ã á$ áù,‚âh ‚â0ƒâSáÄçøÿÿÐ0ÔáèPŸåSãØ0Ÿå”ç„ç%Ì0Ÿå”çE÷ÿëPã °0ŸåÐ0ÓáSã&°0Ÿå° Ÿå0”ç’è4 áù<ƒâh0ƒâ „à„ç´ÂဠŸå€0Ÿå ã”ç ”ç¡�àÁ BàRã „çT Ÿµ ³‚·`0Ÿå ”ç\0Ÿå „ç8€½è ã8€½èLŸåÞíÿë$0Ÿå“ç$0Ÿå”ç÷ÿëPããÿÿ Ôÿÿê(Ÿå×íÿëÕÿÿê€ùŒù|ùxùhÞPù„ùà,àø@-é(BŸå(2Ÿå”ç$2Ÿå”çQá‚ÚPã Ú0 ã á$ áù,‚âh ‚â0ƒâSáèÁŸåÄç÷ÿÿà1ŸåœçÜ1Ÿåœç`àQãÐ1ŸåÀÁŸµ  ³„ç ± Œ· ?€àÃ0Aà´!ŸåSãÀ ³0„ç”1Ÿµ�QŸåÀƒ·Ð0ÔáSãWÞöÿë€QŸåtaŸå0Pâ”çPãÚ á$ áù,‚âh ‚â0ƒâSáÄçøÿÿ–çD1Ÿå”ç�â„çÉöÿë0Pâìÿÿ Ð Ôá1ŸåRã3 1Ÿå Ÿå aŸå ”ç‘è$ áù,‚âh ‚âÀ„à„ç´Ìá0”çp”çSáÚWãpgàÚP ã…à„à„àù €âù�âh€âh�â‡íÿë ”çP…âRáóÿÿʤ0ŸåŒŸå0‘çSá Ú„Ÿå ã$ áù,‚âh ‚â0CâÄç ”çRá÷ÿÿºX0Ÿå ã ”çd0Ÿå „çø€½èH ŸåXŸå“ç Bâ0“çcàFíÿëÃÿÿê@ŸåCíÿë0Ÿå•ç 0Câ•ç ÿÿê ãø€½èTùŒù€ù|ùxùhÞ„ùlàDàŸåŸå/íÿêˆà à0@-é ÐMâpŸåP á=íÿë@Pâ `Ÿå  ãíÿëXPŸåêÝå•å'íÿë ã�â  á0 áOíÿëPãõÿÿ áoíÿë Ð�â0€½èßÿÿëŸå áíÿë  ã íÿëèÜ)ÿÿø¨àøE-é` áHPŸåH ŸåP�à  �à  eàp á€ áÜìÿëJ¡°áø…½@ ã0•ä á á  á@„â3ÿ/á Tá÷ÿÿø…½èÈ%Ì%ÿ/á0Ÿå Ÿå0�à ã “çRã ’!íÿê”&À@-逽èinfo: Cleaning Up...close: Free Imagesclose: Free Buffersclose: Close Fileinfo: ...Done Cleaning Up Thank You for using sdlReadimage: %s background: %s background: loaded '%s' 08x16-Atari_ST-ish.pngerror: cant load font '%s' info: set %dx%dx16 video mode info: set %dx%d window mode Couldn't initialize SDL: %s info: probing video for W x HsdlReaderror: Couldn't set video mode: %s info: setting system variablesinfo: buffers cols=%d rows=%d info: loading font '%s' info: %d chars in font info: opening filerberror: cant open %s info: file open '%s' read: long line %d >4095 read: long page line %d >256 read: %d lines read CreateRGBSurface failed: %s BlitSurface error: %s info: updating video screeninfo: clear screeninfo: background updatedinfo: updating text_page, %dx%d at %d,%d info: page updatedinfo: video screen updatedinfo: file has 0 linesinfo: file has %d lines open: EOF reachedinfo: do info: do info: do Previous Lineinfo: do Previous Pageinfo: showing text pagenextpage: page top set to file line %d nextpage: EOF reachednextline: page top set to file line %d nextline: EOF reachednextline: 0 lines readprevline: page top set to file line %d prevline: EOF reachedprevline: 0 lines readprevpage: page top set to file line %d prevpage: EOF reachedlastpage: page top set to file line %d lastpage: EOF reached (%d) sdlRead (one-file) v%s 1.1.2error: cant open '%s' --version-v--helpCopyright 2016 MiNTed Games Display a text file using image fonts with SDL 1.2 usage: sdlRead-1f [_option_] _option_: -1f one-file (1f) source information --background shown under text (maybe use with --outline) --imagefont used to diplay text (use without for more help) --color set color of font --bgcolor set page background color (when no image) --outline show text with font outline --margin indent pixels from page edge --fullscreen use display maximum WxH --wrap wrap lines of displayed text --nowrap dont wrap lines of displayed text --help This help information --help=font Show ImageFont help information -v|--version Version information--help-imagefont--help=imagefont--help=font--imagefontHelp with ImageFont settings and information. usage: sdlRead-1f --imagefont [_option_] --imagefont 90 char. bitmap image, size = (font-width x 90) x font-height --imagefont 256 char., size = (font-width x 256) x font-height (use --font-256) --imagefont proportional, multicolor font image (detects W & H, see example) --font-width width of font in pixels, if NOT proportional (default %d) --font-height height of font in pixels, if you want to adjust (default %d) --font-256 font has all 256 chars (default is char. 33 to 126, else use key) --font-prop imagefont is proportional font (GuiChan ImageFont) --font-color use custom color for font color --font-key imagefont is proportional and/or not standard 123/256 chars. --color Caps. or lowercase, font color (default WHITE) --bgcolor set page background color (when no image) --page-width width of centered page for text, in pixels --page-height height of centered page for text, in pixels --margin indent page pixels (< & >) and /2 (top) --margin-top indent page pixels from top --cols height of centered page for text, in characters --rows width of centered page for text, in characters --outline plots the font in 4 directions (+1 to width) --outline-color font outline color (default DARKBLUE) 24bit decimal number, CYAN = 65535 24bit hex 0xRRGGBB number, GREEN = 0x00ff00 WHITE, RED, YELLOW, CYAN, BLUE, GREEN, DARKYELLOW DARKRED, DARKBLUE, LIGHTBLUE, DARKGREEN, LIGHTGREEN examples: sdlRead-1f --background nebula.jpg --outline --margin 100 readme.txt sdlRead-1f --imagefont 08x14-VGA_font.png --font-height 14 --margin 50 help.txt sdlRead-1f --imagefont ConsoleFont.bmp --font-width 6 --font-height 13 --font-color 1600000 --margin 10 --outline chasm.txt sdlRead-1f --imagefont techyfontbig.png --font-prop --font-key "abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%%&\`'*#=[]\"" scroller.txt -1f--1fCopyright 2016 MiNTed Gamesone-file (1f) source information. usage: sdlRead-1f _option_ --src|--source output attached one-file (1f) source file --src-size size of appended source (in bytes) (%d) --src-type type of source appended (TXT/ZIP) (%s) .cppTo save one-file (1f) source to file use one of the following: sdlRead-1f --src > sdlRead-1f.cpp sdlRead-1f --src > sdlRead-1f`sdlRead-1f --src-type`To verify one-file (1f) source file size: sdlRead-1f --src-size (match this to the size in a directory listing)or use:NAME=sdlRead; if [ `ls -l $NAME-1f.cpp|cut -d \ -f 5` = `./$NAME-1f --src-size` ]; then echo Verified; else echo Failed; fi one-file (1f) options exit with status: 31 no error (0x1f) 32 an error occured (0x20)--source--src--src-type--src-size%d--debug--info--verbose-V--fullscreen--outline--wrap--nowrap--no-wrap--linenumbers--line-numbers--widtherror: page --width needs a number--heighterror: page --height needs a number--marginerror: page --margin needs a number--margin-top--margintop--backgrounderror: --background needs a filenameerror: --imagefont needs a filename--font-widtherror: --font-width needs a number--font-heighterror: --font-height needs a number--font-spaceerror: --font-space needs a number--font-keyerror: --font-key needs a character order listerror: --font-key is limited to 256 characters max.--font-256--font-prop--font-colorerror: --font-color needs a hex number--font-color-number--color-numbererror: --font-color-number needs a number <%d currently color numbers are: 0 WHITE 1 RED 2 YELLOW 3 GREEN 4 CYAN 5 BLUEBLACK (dark navy blue) 6 BLACK (for more use --color or --font-color)--background-color--bgcolorerror: page --background-color needs a hex numberinfo: you probably just forgot to choose a file to read±�°°„�²�°°¨�²�°°¨(›ÿ°¯€0©ÿhªÿ°°¬€8­ÿÀÿÿ�­ÿ°¨€€®ÿ©±€¯ÿ«±€H°ÿ¬ÿÿ°°ÿ°ÿÿ ±ÿ°°®€È²ÿ(µÿ°°¨€øµÿ«±€Ø¸ÿ ¹ÿ°°®€ »ÿ°°ª€À¼ÿ°°¨€ø¼ÿ°°ª€ð½ÿ°¯€ÁÿèÁÿ°¯€Åÿ°¯€\Óÿ°¬€XÕÿ°°¨€$Öÿ„€LÖÿ«±€œØÿ°°ª€ÀÛÿ°¨ €(Üÿ©±€xÞÿ°°¨€àÿ©±€Xáÿ«±€¬ãÿ¸ãÿ°©€@äÿŸžüž@av€Ù ¼� ¬Ú”�õþÿoƒˆˆØ„ ã (hTŒDŒþÿÿoä‹ÿÿÿoðÿÿol‹È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�È�ôGCC: (Debian 4.6.3-14+rpi1) 4.6.3A.aeabi$6  ,.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.ARM.extab.ARM.exidx.eh_frame.init_array.fini_array.jcr.dynamic.got.data.bss.comment.ARM.attributes4�4#P�P 1p�p$H”�”ˆDöÿÿoƒ¼N ؄ذVˆˆˆã^ÿÿÿol‹l vkþÿÿoä‹ä `z DŒD ƒ BTŒT h Œ¼�¼ ‡È�È 0’ø�ø´J˜¬Ú¬Zž´Ú´Zø¦¬ô¬t$±p‚ÐôÐt¼èõèuÆ€Ò€Þ  €ã€ì((�Èñðð�÷øø�hKü0ø�"p‚/I‚`ˆ ¤ ™Þ4�P�p�”�ƒØ„ˆˆl‹ä‹ DŒ TŒ ¼� È� ø�¬Ú´Ú¬ôÐôèõ (ðøñÿJP�MœžJàôJÌžJ´ÚJðPñÿMØž™ØžJôžM¼� M¬Ú©ñÿMÄ� M°ÚòñÿMHŸJì¡JàôM ¢Jl¢J¬ôM€¢JÌ¢Mø¢Jl£Mx£J¤M¤J8¥MP¥Jp¦MŒ¦JЧMè§J ªMPªJ¬ªM¼ªJ«M(«Jè­M®JX®M`®J¨°Mè°Jè±M²JH²MP²J,³MP³P³0JP¶M€¶JP·MX·J\ºMŒºJ¨ÈMÜÈJ¨ÊMàÊJ ËM´ËJàËMäËJøÍM<ÎJ ÑMhÑJÌÑMØÑJÀÒMèÒJÔM0ÔJ˜ÕMÄÕJøÖM ×JTÙM|ÙJˆÙM�ÙJÚMø�J€šM¨šJ°›JÐôMž ž”JŒžJJ¸ÚJ7ñÿB JôMüžOüžJŸeüJtMŸ›ŸJ@ŸJ§JüÆñÿM ÚJxÚM€ÚÒñÿM„ÚJ¤Ú7ñÿJèõÜèõJ ê ñÿöô 0(MÈ� JØ� MÜ� FYfx£œu~‡HŸØ“øš¬¼Íð Ø,¨$ê´Úù¤<ø�.@`MH ¢`X(«èhx`®ˆ…“€¢ø¥ ×\¶¼ªlÊÞñ„Ú(ø¬ÚÄÕ\&`M2ôþ:KèÒH\mhÑp�´Ë0Ÿ`Mª³ÅPªlÖæ÷P² ôlL$6œž=OarÜȆ¼� Œ  ¸ÉàÊÔßØ5øCðP`MUh}ޤø°ÂÔ Ú`äÀ¥x �Ù�+K]øo®P‘ØÑ¢P¥pÄäËXÕÞ²@ôŒºP X·4€Ú,L0Ô”]<Î,kˆ —è°(­è§DÀ|ÙÐ8¦°/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o$d$a/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crti.ocall_gmon_start/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crtn.osdlRead-1f.cpp_Z11sdlReadTextiii.constprop.5_GLOBAL__sub_I_sdlReadcrtstuff.c__JCR_LIST____do_global_dtors_auxcompleted.5637__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entryelf-init.oSatexit.oS__FRAME_END____JCR_END____dso_handle_DYNAMIC__init_array_end__init_array_start_GLOBAL_OFFSET_TABLE__Znwj@@GLIBCXX_3.4SDL_FillRect_Z9loadImagePcSDL_QuitSDL_Flip_Z7cleanUpv_edatastrtol@@GLIBC_2.4free@@GLIBC_2.4fseek@@GLIBC_2.4data_start_Z12sdlRead_initv_IO_stdin_used_Z14loadBackgroundPcSDL_MapRGBmainexit@@GLIBC_2.4printf@@GLIBC_2.4__end___Z10flushInputv_Z10initSystemvputs@@GLIBC_2.4_Z8initVarsvSDL_PollEvent_Z12getUserInputv_Z11getLastPagev_Z14setVideoWindowv_IO_putc@@GLIBC_2.4putchar@@GLIBC_2.4atexitSDL_Delay_finiSDL_GetError_Z11getPrevPagev__bss_end__sdlReadfopen@@GLIBC_2.4_Z11getNextLinevabort@@GLIBC_2.4_Z12showTextPagevSDL_UpperBlit_Z11updateTitlePc_bss_end__SDL_Initstrcpy@@GLIBC_2.4_Z11setVideoMaxvSDL_FreeSurfaceSDL_SetVideoMode_Z15sdlReadFileOpenvSDL_SetPalettegraphicsSDL_WM_SetCaption_startSDL_DisplayFormatrewind@@GLIBC_2.4fread@@GLIBC_2.4_Z14sdlUpdateVideov_init_Jv_RegisterClasses__cxa_atexit@@GLIBC_2.4SDL_GetVideoInfo_Z16toggleFullScreenvSDL_SetColorKeybasename@@GLIBC_2.4_Z16sdlReadMultiLinePcii__aeabi_idivmod@@GCC_3.5__bss_start____data_start_endstrncat@@GLIBC_2.4SDL_CreateRGBSurfacefgets@@GLIBC_2.4__aeabi_idiv@@GCC_3.5__bss_startmalloc@@GLIBC_2.4strlen@@GLIBC_2.4__libc_csu_init_Z18setCustomFontColorP11SDL_Surfacejfclose@@GLIBC_2.4_Z9output_1fPc__aeabi_unwind_cpp_pr1@@GCC_3.5SDL_GetMouseStatestdout@@GLIBC_2.4_Z10clearLinesistrcmp@@GLIBC_2.4_Z11getNextPagev_Z12setFontColorP11SDL_Surfaceiii_Z11getTextFilevIMG_Load_Z16sdlReadFileClosev_Z15sdlReadShowPagev_Z11sdlReadTextiii__libc_csu_fini__aeabi_unwind_cpp_pr0@@GCC_3.5_Z11getPrevLinev_Z9checkKeysv__libc_start_main@@GLIBC_2.4__gmon_start___Z16sdlReadInitFontsv_Z10isOnScreeniiii_Z10version_1fv_Z8loadFontPc/* sdlRead-1f one-file (1f) text file reader (SDL 1.2) Copyright (C) 2016 MiNTed Games All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* one-file (-1f) compile g++ `sdl-config --cflags` -Wall -O3 -DVERSION=\"1.2.0\" `sdl-config --libs` -lSDL_image -o sdlRead-1f sdlRead-1f.cpp ; \ g++ `sdl-config --cflags` -Wall -O3 -DVERSION=\"1.2.0\" -DPRG_SIZE=`ls -l sdlRead-1f|cut -d \ -f 5` -DSRC_SIZE=`ls -l sdlRead-1f.cpp|cut -d \ -f 5` `sdl-config --libs` -lSDL_image -o sdlRead-1f sdlRead-1f.cpp ; \ cat sdlRead-1f.cpp >> sdlRead-1f */ /* one-file (-1f) requires libsdl1.2-dev libsdl-image-dev */ /* one-file (1f) headers */ #include #include #include #define LINUX 0 #if LINUX #include #include #include #include #endif #include "SDL/SDL.h" #include "SDL/SDL_image.h" /* one-file source appendage */ #define NO_SIZE 56789 //#define SRC_TYPE ".zip" // if its a ZIP appendage #define SRC_TYPE ".cpp" // if its a TEXT appendage, name the extention #ifndef PRG_SIZE //#define PRG_SIZE 41290 // last checked binary size was ... #define PRG_SIZE NO_SIZE // .. this should be close to actual #endif #ifndef SRC_SIZE // size of 1 text file or 1 zip file //#define SRC_SIZE 55038 // last checked source size was ... #define SRC_SIZE NO_SIZE // .. affects binary size if too small #endif const long offset_1f = PRG_SIZE; // this has never been accurate (EXT4) const long sizeOf_1f = SRC_SIZE; // we use this (-sizeOf_1f) as offset /* one-file (1f) start */ /* one-file (1f) defines */ #define SCREEN_WIDTH 1360 // these are actually dynamic #define SCREEN_HEIGHT 768 #define WINDOW_WIDTH 800 // size when not --fullscreen (ie. windowed) #define WINDOW_HEIGHT 600 #define MAX_TEXTSHAPES 70 #define MAX_FONTSHAPES 8 #define MAX_SHAPES 100 #define DEF_FONT "08x16-Atari_ST-ish.png" #define DEF_FONT_WIDTH 8 #define DEF_FONT_HEIGHT 16 #define DEF_FONT_SPACE DEF_FONT_WIDTH #define DEF_FONT_256 0 #define DEF_FONT_PROP 0 #define DEF_FONT_KEY "" #define DEF_FONT_OUTLINE 0 /* one-file (1f) enums */ // Font Colors enum { FONT_WHITE, FONT_RED, FONT_YELLOW, FONT_GREEN, FONT_CYAN, FONT_BLUE, // FONT_BLACK, // ten off black FONT_CUSTOM // user supplied color }; // matches MAX_FONTSHAPES #define FONT_OUTLINE FONT_BLACK // used to draw outline /* one-file (1f) structs */ typedef struct fontImage { char filename[1024]; // imagefont, any bitmap image, int width; // width of font int height; // height of font int space; // width of a SPACE char (defaults to width) Uint32 color; // default is white int chars; // (calculated) image width / font width = # of chars signed char is256; // image contains ALL 256 chars, otherwise 32>font<128 signed char isProp; // Proportional imagefont requires GuiChan type imagefont signed char inUse; // double-up of sdlRead.cur_font char key[256]; // if NOT is256 && does NOT start with chr(33) (!) } fontImage; typedef struct sdlReadFile { char filename[1024]; // name of file currently being read signed char isOpen; int chr; int line; int lines; char *buffer; FILE *fp; } sldReadFile; typedef struct sdlReadEngineVariables { signed char debug; SDL_Event event; signed char done; float ssx; float ssy; int cursor_x, cursor_y; signed char fullscreen; signed char useBackground; char background[1024]; int display_w; int display_h; int window_w; int window_h; int ox; int oy; int ow; int oh; fontImage fontimage[MAX_FONTSHAPES]; int cur_font; int font_width; int font_height; signed char useOutline; int outlineColorNumber; signed char useFontColorNumber; int fontColorNumber; signed char useFontColor; Uint32 color; signed char useBgColor; Uint32 bgcolor; int next; int current; int playlist; char playList[50][1024]; sldReadFile file; signed char retChar; int line; char lines[256][256]; int page_w; int page_h; int page_m; int page_t; int page_lines; int prev_top; int top; int bottom; int cols; int rows; signed char wrap; signed char linenumbers; signed char info; // This really only applies to Linux users. char userHomeDirectory[1024]; char keyState[350]; signed char section; }; sdlReadEngineVariables sdlRead; typedef struct bRect { int x, y, w, h; bRect *next; } bRect; typedef struct textObject { SDL_Surface *image; unsigned char life; float x, y; signed char fontColor; char text[255]; }; /* one-file (1f) classes */ class sdlReadGraphics { public: Uint32 red; Uint32 darkRed; Uint32 yellow; Uint32 darkYellow; Uint32 green; Uint32 darkGreen; Uint32 blue; Uint32 darkBlue; Uint32 darkerBlue; Uint32 black; Uint32 white; Uint32 lightGrey; Uint32 darkGrey; SDL_Surface *screen, *background; SDL_Surface *text_page; SDL_Surface *shape[MAX_SHAPES]; SDL_Surface *fontShape[MAX_FONTSHAPES]; bRect *bufferHead; bRect *bufferTail; textObject textShape[MAX_TEXTSHAPES]; SDL_Rect blitRect; SDL_Rect scale_rect; SDL_Surface *messageBox; sdlReadGraphics() { bufferHead = new bRect; bufferHead->next = NULL; bufferTail = bufferHead; for (int i = 0 ; i < MAX_SHAPES ; i++) shape[i] = NULL; for (int i = 0 ; i < MAX_SHAPES ; i++) fontShape[i] = NULL; for (int i = 0 ; i < MAX_TEXTSHAPES ; i++) textShape[i].image = NULL; messageBox = NULL; background = NULL; text_page = NULL; } SDL_Surface *setTransparent(SDL_Surface *sprite) { SDL_SetColorKey(sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(sprite->format, 0, 0, 0)); return sprite; } SDL_Surface *setFontTransparent(SDL_Surface *sprite, Uint32 color) { SDL_SetColorKey(sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL), color); return sprite; } void addBuffer(int x, int y, int w, int h) { bRect *rect = new bRect; rect->next = NULL; rect->x = x; rect->y = y; rect->w = w; rect->h = h; bufferTail->next = rect; bufferTail = rect; } void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest) { // Set up a rectangle to draw to blitRect.x = x; blitRect.y = y; blitRect.w = image->w; blitRect.h = image->h; //printf("graphics.image->w=%d graphics.image->h=%d\n", image->w, image->h); /* Blit onto the screen surface */ if(SDL_BlitSurface(image, NULL, dest, &blitRect) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } //printf("graphics.dest->w=%d graphics.dest->h=%d\n", dest->w, dest->h); // addBuffer(blitRect.x, blitRect.y, blitRect.w, blitRect.h); //printf("blitRect.x=%d blitRect.y=%d blitRect.w=%d blitRect.h=%d \n", blitRect.x, blitRect.y, blitRect.w, blitRect.h); } void blit(SDL_Surface *image, int x, int y) { blit(image, x, y, screen); } void blitText(int i) { blit(textShape[i].image, (int)textShape[i].x, (int)textShape[i].y, screen); } void flushBuffer() { bRect *prevRect = bufferHead; bRect *rect = bufferHead; bufferTail = bufferHead; while (rect->next != NULL) { rect = rect->next; prevRect->next = rect->next; delete rect; rect = prevRect; } bufferHead->next = NULL; } void unBuffer() { bRect *prevRect = bufferHead; bRect *rect = bufferHead; bufferTail = bufferHead; while (rect->next != NULL) { rect = rect->next; blitRect.x = rect->x; blitRect.y = rect->y; blitRect.w = rect->w; blitRect.h = rect->h; if (SDL_BlitSurface(background, &blitRect, screen, &blitRect) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } prevRect->next = rect->next; delete rect; rect = prevRect; } bufferHead->next = NULL; } /* In 16 bit mode this is slow. VERY slow. Don't write directly to a surface that constantly needs updating (eg - the main game screen) */ int renderString(char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest) { signed char doLF; SDL_Rect area; area.x = x; area.y = y; area.w = sdlRead.fontimage[sdlRead.cur_font].width; area.h = sdlRead.fontimage[sdlRead.cur_font].height; SDL_Rect letter; letter.y = 0; letter.w = sdlRead.fontimage[sdlRead.cur_font].width; letter.h = sdlRead.fontimage[sdlRead.cur_font].height; while (*in != '\0') { doLF = 0; if (sdlRead.fontimage[sdlRead.cur_font].is256) { letter.x = *in; letter.x *= sdlRead.fontimage[sdlRead.cur_font].width; /* Blit onto the screen surface */ if(SDL_BlitSurface(fontShape[fontColor], &letter, dest, &area) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } }else{ if (*in > 32) { letter.x = (*in - 33); letter.x *= sdlRead.fontimage[sdlRead.cur_font].width; /* Blit onto the screen surface */ if(SDL_BlitSurface(fontShape[fontColor], &letter, dest, &area) < 0) { printf("BlitSurface error: %s\n", SDL_GetError()); } } } if (*in == 13 || *in == 10) doLF = 1; if(doLF) { sdlRead.file.line++; area.y += sdlRead.fontimage[sdlRead.cur_font].height; if (sdlRead.useOutline) area.y +=2; area.x = x; doLF = 0; }else{ area.x += sdlRead.fontimage[sdlRead.cur_font].width; if (sdlRead.useOutline) area.x++; } if (wrap) { if ((area.x > (dest->w - 70)) && (*in == 32)) { area.y += sdlRead.fontimage[sdlRead.cur_font].height; if (sdlRead.useOutline) area.y +=2; area.x = x; } } /* if ((area.x+sdlRead.fontimage[sdlRead.cur_font].width) >= dest->w) { sdlRead.file.line++; area.y += sdlRead.fontimage[sdlRead.cur_font].height; if (sdlRead.useOutline) area.y +=2; area.x = x; } if ((area.y+sdlRead.fontimage[sdlRead.cur_font].height) >= dest->h) break; */ *in++; } return area.y; } int drawString(char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest) { if(sdlRead.useOutline) { renderString(in, x, y - 1, FONT_OUTLINE, wrap, dest); renderString(in, x, y + 1, FONT_OUTLINE, wrap, dest); renderString(in, x, y + 2, FONT_OUTLINE, wrap, dest); renderString(in, x - 1, y, FONT_OUTLINE, wrap, dest); renderString(in, x - 2, y, FONT_OUTLINE, wrap, dest); renderString(in, x + 1, y, FONT_OUTLINE, wrap, dest); } return renderString(in, x, y, fontColor, wrap, dest); } int drawString(char *in, int x, int y, int fontColor, SDL_Surface *dest) { if (x == -1) { x = (dest->w - (strlen(in) * sdlRead.font_width)) / 2; } return drawString(in, x, y, fontColor, 0, dest); } int drawString(char *in, int x, int y, int fontColor) { if (x == -1) { if(sdlRead.useOutline) x = (sdlRead.page_w - (strlen(in) * sdlRead.fontimage[sdlRead.cur_font].width) + 1) / 2; else x = (sdlRead.page_w - (strlen(in) * sdlRead.fontimage[sdlRead.cur_font].width)) / 2; } return drawString(in, x, y, fontColor, 0, screen); } /* Finds the location of the requested color within the palette and returns it's number. This colors are used for drawing rectangles, circle, etc in the correct colors. */ void setColorIndexes() { red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00); darkRed = SDL_MapRGB(screen->format, 0x66, 0x00, 0x00); yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00); darkYellow = SDL_MapRGB(screen->format, 0x66, 0x66, 0x00); green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00); darkGreen = SDL_MapRGB(screen->format, 0x00, 0x66, 0x00); blue = SDL_MapRGB(screen->format, 0x00, 0x00, 0xff); darkBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x99); darkerBlue = SDL_MapRGB(screen->format, 0x00, 0x00, 0x44); black = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00); white = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff); lightGrey = SDL_MapRGB(screen->format, 0xcc, 0xcc, 0xcc); darkGrey = SDL_MapRGB(screen->format, 0x99, 0x99, 0x99); } /* Draws the background surface that has been loaded */ void drawBackGround() { blit(background, 0, 0, screen); } void drawTextPage(int px, int py) { if (sdlRead.debug) printf("info: updating text_page, %dx%d at %d,%d\n", text_page->w, text_page->h, px, py); blit(text_page, px, py, screen); } void clearScreen(Uint32 color) { SDL_FillRect(screen, NULL, color); } void updateScreen() { SDL_Flip(screen); // Give the audio (and possibly the X server) time to work SDL_Delay(1); } /* * get the pixel at (x, y) to the given value */ /* Uint32 getpixel(SDL_Surface *surface, int x, int y) { // Uint32 pixel; unsigned char pixel[4]; int bpp = surface->format->BytesPerPixel; // Here p is the address to the pixel we want to set Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { switch(bpp) { case 1: pixel[0] = p; break; case 2: pixel[0] = (p[0] >> 8) & 0xff; pixel[1] = p[1] & 0xff; break; case 3: pixel[0] = (p[0] >> 16) & 0xff; pixel[1] = (p[1] >> 8) & 0xff; pixel[2] = p[2] & 0xff; break; case 4: pixel = p; break; } }else{ switch(bpp) { case 1: pixel[0] = p; break; case 2: pixel[0] = p[0] & 0xff; pixel[1] = (p[1] >> 8) & 0xff; break; case 3: pixel[0] = p[0] & 0xff; pixel[1] = (p[1] >> 8) & 0xff; pixel[2] = (p[2] >> 16) & 0xff; break; case 4: pixel = p; break; } } return(pixel); } */ /* * Set the pixel at (x, y) to the given value * NOTE: The surface must be locked before calling this! */ void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel) { int bpp = surface->format->BytesPerPixel; /* Here p is the address to the pixel we want to set */ Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp; switch(bpp) { case 1: *p = pixel; break; case 2: *(Uint16 *)p = pixel; break; case 3: if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (pixel >> 16) & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = pixel & 0xff; } else { p[0] = pixel & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = (pixel >> 16) & 0xff; } break; case 4: *(Uint32 *)p = pixel; break; } } void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col) { int counter = 0; if ( SDL_MUSTLOCK(dest) ) { if ( SDL_LockSurface(dest) < 0 ) { printf("Can't lock screen: %s\n", SDL_GetError()); } } while(1) { putpixel(dest, x1, y1, col); if (x1 > x2) x1--; if (x1 < x2) x1++; if (y1 > y2) y1--; if (y1 < y2) y1++; if ((x1 == x2) && (y1 == y2)) {break;} if (counter == 1000) {printf("Loop Error!\n"); break;} counter++; } if ( SDL_MUSTLOCK(dest) ) { SDL_UnlockSurface(dest); } } void drawLine(int x1, int y1, int x2, int y2, int col) { drawLine(screen, x1, y1, x2, y2, col); } /* A quick(?) circle draw function. This code was posted to the SDL mailing list... I didn't write it myself. */ void circle(int xc, int yc, int R, SDL_Surface *PIX, int col) { int x = 0, xx = 0; int y = R, yy = R+R; int p = 1-R; putpixel(PIX, xc, yc - y, col); putpixel(PIX, xc, yc + y, col); putpixel(PIX, xc - y, yc, col); putpixel(PIX, xc + y, yc, col); while(x < y) { xx += 2; ++x; if (p >= 0) { yy -= 2; --y; p -= yy; } p += xx + 1; putpixel(PIX, xc - x, yc - y, col); putpixel(PIX, xc + x, yc - y, col); putpixel(PIX, xc - x, yc + y, col); putpixel(PIX, xc + x, yc + y, col); putpixel(PIX, xc - y, yc - x, col); putpixel(PIX, xc + y, yc - x, col); putpixel(PIX, xc - y, yc + x, col); putpixel(PIX, xc + y, yc + x, col); } if ((x = y)) { putpixel(PIX, xc - x, yc - y, col); putpixel(PIX, xc + x, yc - y, col); putpixel(PIX, xc - x, yc + y, col); putpixel(PIX, xc + x, yc + y, col); } } void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue) { SDL_Rect r = {x, y, w, h}; SDL_FillRect(dest, &r, SDL_MapRGB(screen->format, red, green, blue)); drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255)); drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255)); drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); } void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue) { blevelRect(screen, x, y, w, h, red, green, blue); } SDL_Surface *createSurface(int width, int height) { SDL_Surface *surface, *newImage; Uint32 rmask, gmask, bmask, amask; /* SDL interprets each pixel as a 32-bit number, so our masks must depend on the endianness (byte order) of the machine */ #if (SDL_BYTEORDER == SDL_BIG_ENDIAN) rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; #else rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; #endif surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, rmask, gmask, bmask, amask); if (surface == NULL) { printf("CreateRGBSurface failed: %s\n", SDL_GetError()); } newImage = SDL_DisplayFormat(surface); SDL_FreeSurface(surface); return newImage; } SDL_Surface *textSurface(char *inString, int color) { SDL_Surface *surface = createSurface(strlen(inString) * 9, 16); drawString(inString, 1, 1, color, surface); return setTransparent(surface); } void textSurface(int index, char *inString, int x, int y, int fontColor) { strcpy(textShape[index].text, inString); textShape[index].x = x; textShape[index].y = y; textShape[index].fontColor = fontColor; if (textShape[index].image != NULL) { SDL_FreeSurface(textShape[index].image); } textShape[index].image = textSurface(inString, fontColor); if (x == -1) textShape[index].x = (800 - textShape[index].image->w) / 2; } SDL_Surface *alphaRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue) { SDL_Surface *surface = createSurface(width, height); SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue)); SDL_SetAlpha(surface, SDL_SRCALPHA|SDL_RLEACCEL, 128); return surface; } SDL_Surface *transparentRect(int width, int height, Uint8 red, Uint8 green, Uint8 blue) { SDL_Surface *surface = createSurface(width, height); SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue)); SDL_SetColorKey(surface, (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(surface->format, red, green, blue)); // SDL_SetColorKey(surface, (SDL_SRCCOLORKEY|SDL_RLEACCEL), sge_GetPixel(bitmap,0,0)); return surface; } void createMessageBox(SDL_Surface *face, char *message, signed char transparent) { if (messageBox != NULL) { SDL_FreeSurface(messageBox); messageBox = NULL; } if (transparent) messageBox = alphaRect(550, 60, 0x00, 0x00, 0x00); else messageBox = createSurface(550, 60); signed char x = 60; if (face != NULL) { blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0xaa); blit(face, 5, 5, messageBox); } else { blevelRect(messageBox, 0, 0, messageBox->w - 1, messageBox->h - 1, 0x00, 0x00, 0x00); x = 10; } drawString(message, x, 5, FONT_WHITE, 1, messageBox); } void freeGraphics() { for (int i = 0 ; i < MAX_SHAPES ; i++) { if (shape[i] != NULL) { SDL_FreeSurface(shape[i]); shape[i] = NULL; } } for (int i = 0 ; i < MAX_FONTSHAPES ; i++) { if (fontShape[i] != NULL) { SDL_FreeSurface(fontShape[i]); fontShape[i] = NULL; } } for (int i = 0 ; i < MAX_TEXTSHAPES ; i++) { if (textShape[i].image != NULL) { SDL_FreeSurface(textShape[i].image); textShape[i].image = NULL; } } if (messageBox != NULL) { SDL_FreeSurface(messageBox); messageBox = NULL; } if (background != NULL) { SDL_FreeSurface(background); background = NULL; } if (text_page != NULL) { SDL_FreeSurface(text_page); text_page = NULL; } } }; sdlReadGraphics graphics; /* one-file (1f) functions */ /* key handling */ void flushInput() { for (int i = 0 ; i < 350 ; i++) sdlRead.keyState[i] = 0; while (SDL_PollEvent(&sdlRead.event)){} } void getUserInput() { // Get the current mouse position int x, y; SDL_GetMouseState(&x, &y); sdlRead.cursor_x = x; sdlRead.cursor_y = y; if (SDL_PollEvent(&sdlRead.event)) { switch (sdlRead.event.type) { case SDL_QUIT: exit(0); break; case SDL_MOUSEBUTTONDOWN: if (sdlRead.event.button.button == SDL_BUTTON_LEFT) sdlRead.keyState[SDLK_SPACE] = 1; if (sdlRead.event.button.button == SDL_BUTTON_RIGHT) sdlRead.keyState[SDLK_ESCAPE] = 1; break; case SDL_KEYDOWN: sdlRead.keyState[sdlRead.event.key.keysym.sym] = 1; break; case SDL_KEYUP: sdlRead.keyState[sdlRead.event.key.keysym.sym] = 0; break; default: break; } } } /* This bit is just for Linux users. It attempts to get the user's home directory, then creates the .parallelrealities and .parallelrealities/starfighter directories so that saves and temporary data files can be written there. Good, eh? :) */ #if LINUX void setupUserHomeDirectory() { char dir[4096]; char *userHome; char *name = getlogin(); passwd *pass; if (name != NULL) pass = getpwnam(name); else pass = getpwuid(geteuid()); if (pass == NULL) { printf("Couldn't determine the user home directory. Exitting.\n"); exit(1); } userHome = pass->pw_dir; strcpy(dir, ""); sprintf(dir, "%s/.1f", userHome); if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST)) printf("error: cant create dir '%s'", dir); sprintf(dir, "%s/.1f/sdlRead", userHome); if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST)) printf("error: cant create dir '%s'", dir); sprintf(sdlRead.userHomeDirectory, "%s/.1f/sdlRead/", userHome); } #endif /* image handling */ SDL_Surface *loadImage(char *filename) { SDL_Surface *image, *newImage; image = IMG_Load(filename); if (image == NULL) { if (sdlRead.info || sdlRead.debug) printf("image: %s\n", SDL_GetError()); return NULL; } newImage = SDL_DisplayFormat(image); if ( newImage ) { SDL_FreeSurface(image); } else { // This happens when we are loading the window icon image newImage = image; } return graphics.setTransparent(newImage); } void loadBackground(char *filename) { if (graphics.background != NULL) { SDL_FreeSurface(graphics.background); graphics.background = NULL; } graphics.background = loadImage(filename); if (graphics.background == NULL) { if (sdlRead.info || sdlRead.debug) printf("background: %s\n", SDL_GetError()); }else SDL_SetColorKey(graphics.background, 0, 0); if (sdlRead.info || sdlRead.debug) printf("background: loaded '%s'\n", filename); // graphics.drawBackGround(); } void setFontColor(SDL_Surface *image, int red, int green, int blue) { SDL_Color colors[256]; colors[0].r = 0; colors[0].g = 0; colors[0].b = 0; for (int i = 1 ; i < 256 ; i++) { colors[i].r = red; colors[i].g = green; colors[i].b = blue; } SDL_SetPalette(image, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); } void setCustomFontColor(SDL_Surface *image, Uint32 color) { SDL_Color colors[256]; int red, green, blue; red = (int) (color >> 16) & 0xff; green = (int) (color >> 8) & 0xff; blue = (int) color & 0xff; colors[0].r = 0; colors[0].g = 0; colors[0].b = 0; for (int i = 1 ; i < 256 ; i++) { colors[i].r = red; colors[i].g = green; colors[i].b = blue; } SDL_SetPalette(image, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); } /* Custom loading to alter the font color before doing all other things */ void loadFont(char *filename) { SDL_Surface *image, *newImage; for (int i = 0 ; i < MAX_FONTSHAPES ; i++) { image = IMG_Load(filename); if (image == NULL) { if (sdlRead.info || sdlRead.debug) printf("error: cant load font '%s'\n", SDL_GetError()); loadFont(DEF_FONT); i = MAX_FONTSHAPES; continue; } switch(i) { case 0: setFontColor(image, 255, 255, 255); // FONT_WHITE break; case 1: setFontColor(image, 255, 0, 0); // FONT_RED break; case 2: setFontColor(image, 255, 255, 0); // FONT_YELLOW break; case 3: setFontColor(image, 0, 255, 0); // FONT_GREEN break; case 4: setFontColor(image, 0, 255, 255); // FONT_CYAN break; case 5: setFontColor(image, 0, 0, 255); // FONT_BLUE break; case 6: setFontColor(image, 10, 10, 10); // FONT_BLACK break; case 7: setCustomFontColor(image, sdlRead.color); break; } newImage = SDL_DisplayFormat(image); if (graphics.fontShape[i] != NULL) SDL_FreeSurface(graphics.fontShape[i]); graphics.fontShape[i] = graphics.setTransparent(newImage); SDL_FreeSurface(image); } } int isOnScreen(int x, int y, int w, int h) { if ((x + w > 0) && (x < 800) && (y + h > 0) && (y < 600)) return 1; return 0; } /* initialization */ void sdlRead_init() { sdlRead.debug = 0; sdlRead.fullscreen = 0; sdlRead.useBackground = 0; sdlRead.display_w = SCREEN_WIDTH; // default display size sdlRead.display_h = SCREEN_HEIGHT; sdlRead.window_w = WINDOW_WIDTH; // default window size sdlRead.window_h = WINDOW_HEIGHT; sdlRead.ox = 0; sdlRead.oy = 0; sdlRead.ow = 0; sdlRead.oh = 0; sdlRead.ssx = 0; sdlRead.ssy = 0; for (int i = 0 ; i < 350 ; i++) sdlRead.keyState[i] = 0; strcpy(sdlRead.fontimage[0].filename, DEF_FONT); sdlRead.fontimage[0].width = DEF_FONT_WIDTH; sdlRead.fontimage[0].height = DEF_FONT_HEIGHT; sdlRead.fontimage[0].space = DEF_FONT_SPACE; sdlRead.fontimage[0].color = 0; sdlRead.fontimage[0].is256 = DEF_FONT_256; sdlRead.fontimage[0].isProp = DEF_FONT_PROP; sdlRead.fontimage[0].inUse = 1; sdlRead.cur_font = 0; sdlRead.font_width = 0; sdlRead.font_height = 0; sdlRead.useOutline = DEF_FONT_OUTLINE; sdlRead.outlineColorNumber = 0; sdlRead.fontColorNumber = FONT_WHITE; sdlRead.useFontColor = 0; sdlRead.color = 0; sdlRead.useBgColor = 0; sdlRead.bgcolor = 0; sdlRead.next = 0; sdlRead.current = 0; sdlRead.playlist = 0; strcpy(sdlRead.file.filename, ""); sdlRead.file.isOpen = 0; sdlRead.file.chr = 0; sdlRead.file.line = 0; sdlRead.file.lines = 0; sdlRead.file.buffer = NULL; sdlRead.file.fp = NULL; sdlRead.cols = 0; sdlRead.rows = 0; sdlRead.page_w = 0; sdlRead.page_h = 0; sdlRead.page_m = 0; sdlRead.page_t = 0; sdlRead.page_lines = 0; sdlRead.line = 0; sdlRead.retChar = 0; sdlRead.prev_top = 0; sdlRead.top = 0; sdlRead.bottom = 0; sdlRead.wrap = 0; sdlRead.linenumbers = 0; sdlRead.info = 0; sdlRead.section = 0; } void setVideoMax() { graphics.screen = SDL_SetVideoMode(sdlRead.display_w, sdlRead.display_h, 16, SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN); sdlRead.fullscreen = 1; if (sdlRead.info || sdlRead.debug) printf("info: set %dx%dx16 video mode\n", sdlRead.display_w, sdlRead.display_h); } void setVideoWindow() { graphics.screen = SDL_SetVideoMode(sdlRead.window_w, sdlRead.window_h, 0, SDL_HWSURFACE|SDL_HWPALETTE); sdlRead.fullscreen = 0; if (sdlRead.info || sdlRead.debug) printf("info: set %dx%d window mode\n", sdlRead.window_w, sdlRead.window_h); } void initSystem() { const SDL_VideoInfo* videoInfo; /* Initialize the SDL library */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("Couldn't initialize SDL: %s\n", SDL_GetError()); exit(1); } if (sdlRead.debug) printf("info: probing video for W x H\n"); videoInfo = SDL_GetVideoInfo(); sdlRead.display_w = videoInfo->current_w; sdlRead.display_h = videoInfo->current_h; SDL_WM_SetCaption("sdlRead", "sdlRead"); // SDL_WM_SetIcon(loadImage("gfx/alienDevice.png"), NULL); if (sdlRead.fullscreen) setVideoMax(); else setVideoWindow(); if (graphics.screen == NULL) { printf("error: Couldn't set video mode: %s\n", SDL_GetError()); exit(1); } graphics.setColorIndexes(); sdlRead.file.buffer = (char*) malloc(4096); } void clearLines(int from) { int rows; rows = sdlRead.rows; if (from == -1) { from = 0; rows = 256; } for (int i=from; i < rows; i++) strcpy(sdlRead.lines[i],""); } void initVars() { if (sdlRead.debug) printf("info: setting system variables\n"); if (sdlRead.useFontColor) sdlRead.fontimage[0].color = sdlRead.color; else sdlRead.fontimage[0].color = SDL_MapRGB(graphics.screen->format, 0xff, 0xff, 0xff); if (sdlRead.useBgColor) sdlRead.fontimage[0].color = sdlRead.bgcolor; else sdlRead.fontimage[0].color = 0; if (sdlRead.page_w < 0) sdlRead.page_w = 0; if (sdlRead.page_h < 0) sdlRead.page_h = 0; if (sdlRead.page_m < 0) sdlRead.page_m = 0; if (sdlRead.page_t < 0) sdlRead.page_t = 0; if (sdlRead.page_m > 0 && sdlRead.page_t == 0) sdlRead.page_t = (int) sdlRead.page_m; sdlRead.font_width = sdlRead.fontimage[sdlRead.cur_font].width; sdlRead.font_height = sdlRead.fontimage[sdlRead.cur_font].height; if (sdlRead.useOutline) { sdlRead.font_width += 1; sdlRead.font_height += 2; } if (sdlRead.cols != 0 && sdlRead.rows == 0) { sdlRead.rows = (int) (sdlRead.display_h / sdlRead.font_height); } if (sdlRead.cols == 0 && sdlRead.rows != 0) { sdlRead.cols = (int) (sdlRead.display_w / sdlRead.font_width); } if (sdlRead.cols != 0 && sdlRead.rows != 0) { sdlRead.page_w = ( sdlRead.font_width * sdlRead.cols ) + sdlRead.page_m; sdlRead.page_h = ( sdlRead.font_height * sdlRead.rows ) + sdlRead.page_m; }else{ if (sdlRead.fullscreen) { sdlRead.page_w = sdlRead.display_w - (sdlRead.page_m * 2); sdlRead.page_h = sdlRead.display_h + sdlRead.page_t; sdlRead.cols = (int) (sdlRead.page_w / sdlRead.font_width); sdlRead.rows = (int) (sdlRead.page_h / sdlRead.font_height); }else{ sdlRead.page_w = sdlRead.window_w - (sdlRead.page_m * 2); sdlRead.page_h = sdlRead.window_h + sdlRead.page_t; sdlRead.cols = (int) (sdlRead.page_w / sdlRead.font_width); sdlRead.rows = (int) (sdlRead.page_h / sdlRead.font_height); } } } void sdlReadInitFonts() { if (sdlRead.debug) printf("info: buffers cols=%d rows=%d\n", sdlRead.cols, sdlRead.rows); clearLines(0); sdlRead.ox = sdlRead.page_m; sdlRead.oy = (int) (sdlRead.page_m / 2); if (sdlRead.debug) printf("info: loading font '%s'\n", sdlRead.fontimage[sdlRead.cur_font].filename); loadFont(sdlRead.fontimage[sdlRead.cur_font].filename); sdlRead.fontimage[sdlRead.cur_font].chars = (int) (graphics.fontShape[0]->w / sdlRead.fontimage[sdlRead.cur_font].width); if (sdlRead.debug) printf("info: %d chars in font\n", sdlRead.fontimage[sdlRead.cur_font].chars); } /* file reader */ int sdlReadFileClose() { if (sdlRead.file.fp != NULL) fclose(sdlRead.file.fp); sdlRead.file.fp = NULL; sdlRead.file.isOpen = 0; return 1; } void cleanUp() { if (sdlRead.info || sdlRead.debug) printf("info: Cleaning Up...\n"); graphics.freeGraphics(); if (sdlRead.debug) printf("close: Free Images\n"); if (sdlRead.debug) printf("close: Free Buffers\n"); clearLines(-1); if (sdlRead.file.buffer != NULL) free(sdlRead.file.buffer); sdlRead.file.buffer = NULL; sdlReadFileClose(); if (sdlRead.debug) printf("close: Close File\n"); SDL_Quit(); if (sdlRead.info || sdlRead.debug) printf("info: ...Done Cleaning Up\nThank You for using sdlRead\n"); } int sdlReadFileOpen() { if (sdlRead.debug) printf("info: opening file\n"); sdlRead.file.fp = fopen(sdlRead.playList[sdlRead.next], "rb"); if (sdlRead.file.fp == NULL) { if (sdlRead.info || sdlRead.debug) printf("error: cant open %s\n", sdlRead.playList[sdlRead.next]); return 0; } if (sdlRead.debug) printf("info: file open '%s'\n", sdlRead.playList[sdlRead.next]); sdlRead.file.isOpen = 1; sdlRead.file.chr = 0; sdlRead.file.line = 0; return 1; } int sdlReadMultiLine(char *in, int chars, int line) { int lines, count, remainder; lines = 0; count = (int) strlen(in) / chars; remainder = (int) strlen(in) % chars; while(lines < count) { strncat(sdlRead.lines[line+lines],in,chars); lines++; for (int i=0; i < chars; i++) *in++; } if (remainder > 0) { strncat(sdlRead.lines[line+lines],in,chars); } return lines; } int sdlReadText(int from_line, int to_line, int file_line) { int lines; signed char readDone; if (sdlRead.file.fp == NULL) sdlReadFileOpen(); sdlRead.file.line = file_line; rewind(sdlRead.file.fp); for (int i=0; i4095\n", sdlRead.file.line); if (strlen(sdlRead.file.buffer) >= 256) if (sdlRead.debug) printf("read: long page line %d >256\n", sdlRead.file.line); if ((int)strlen(sdlRead.file.buffer) > sdlRead.cols && sdlRead.wrap) { lines = sdlReadMultiLine(sdlRead.file.buffer, sdlRead.cols, i); sdlRead.page_lines += lines + 1; i += lines; } else { strcpy(sdlRead.lines[i],sdlRead.file.buffer); sdlRead.page_lines++; } sdlRead.line++; if (readDone) i = sdlRead.rows; } sdlReadFileClose(); if (sdlRead.debug) printf("read: %d lines read\n", sdlRead.line); return readDone; } void sdlReadShowPage() { int px, py, ox, oy; if (graphics.text_page != NULL) SDL_FreeSurface(graphics.text_page); graphics.text_page = graphics.transparentRect(sdlRead.page_w+10, sdlRead.page_h, 0, 0, 0); ox = 0; oy = 0; if (sdlRead.useOutline) { ox = 1; oy = 2; } px = sdlRead.page_m + oy; for (int i=0; i < sdlRead.rows; i++) { py = (i * sdlRead.font_height)+oy; graphics.drawString(sdlRead.lines[i], px, py, sdlRead.fontColorNumber, 0, graphics.text_page); } } void sdlUpdateVideo() { if (sdlRead.debug) printf("info: updating video screen\n"); graphics.clearScreen(sdlRead.bgcolor); if (sdlRead.debug) printf("info: clear screen\n"); if (graphics.background != NULL) graphics.drawBackGround(); if (sdlRead.debug && graphics.background != NULL) printf("info: background updated\n"); if (graphics.text_page != NULL) graphics.drawTextPage(sdlRead.ox, sdlRead.oy); if (sdlRead.debug && graphics.text_page != NULL) printf("info: page updated\n"); graphics.updateScreen(); if (sdlRead.debug) printf("info: video screen updated\n"); } void toggleFullScreen() { if(sdlRead.fullscreen) { setVideoWindow(); }else{ setVideoMax(); } sdlUpdateVideo(); } void updateTitle(char *file) { char title[50]; sprintf(title,"%s", basename(file)); SDL_WM_SetCaption(title, "sdlRead"); } /* slideshow states */ int getTextFile() //#0 { int isEOF; if (sdlRead.next == sdlRead.playlist) exit(0); if (!sdlReadFileOpen()) return 9; sdlRead.current = sdlRead.next; clearLines(0); isEOF = 0; sdlRead.top = 0; sdlRead.bottom = 0; sdlRead.file.lines = 0; while(true) { if(!fgets(sdlRead.file.buffer, 4096, sdlRead.file.fp)) isEOF = 1; if (strlen(sdlRead.file.buffer) == 0) break; sdlRead.file.lines++; if (isEOF) break; } if (sdlRead.file.lines == 0) { if (sdlRead.info || sdlRead.debug) printf("info: file has 0 lines\n"); strcpy(sdlRead.lines[0], ""); }else if (sdlRead.info || sdlRead.debug) printf("info: file has %d lines\n", sdlRead.file.lines); if (sdlReadText(0, sdlRead.rows, 0)) { if (sdlRead.debug) printf("open: EOF reached\n"); strcpy(sdlRead.lines[sdlRead.page_lines], ""); } sdlRead.bottom = sdlRead.line; if (sdlRead.page_lines < sdlRead.rows) clearLines(sdlRead.page_lines); return 2; } int checkKeys() //#1 { SDL_Delay(1); getUserInput(); if (sdlRead.keyState[SDLK_ESCAPE] || sdlRead.keyState[SDLK_q]) { sdlRead.keyState[SDLK_ESCAPE] = 0; sdlRead.keyState[SDLK_q] = 0; return 10; } if (sdlRead.keyState[SDLK_F11]) { sdlRead.keyState[SDLK_F11] = 0; toggleFullScreen(); } if (sdlRead.keyState[SDLK_SPACE]) { sdlRead.keyState[SDLK_SPACE] = 0; return 9; } if (sdlRead.keyState[SDLK_RETURN] || sdlRead.keyState[SDLK_KP_ENTER]) { sdlRead.keyState[SDLK_RETURN] = 0; sdlRead.keyState[SDLK_KP_ENTER] = 0; return 9; } if (sdlRead.keyState[SDLK_BACKSPACE]) { sdlRead.keyState[SDLK_BACKSPACE] = 0; if (sdlRead.next == 0) return 1; --sdlRead.next; return 0; } if (sdlRead.keyState[SDLK_HOME]) { sdlRead.keyState[SDLK_HOME] = 0; if (sdlRead.top == 0) return 1; sdlRead.top = 0; sdlRead.bottom = 0; sdlReadFileClose(); if (sdlRead.debug) printf("info: do \n"); return 0; } if (sdlRead.keyState[SDLK_END]) { sdlRead.keyState[SDLK_END] = 0; if (sdlRead.debug) printf("info: do \n"); return 8; } if (sdlRead.keyState[SDLK_UP]) { sdlRead.keyState[SDLK_UP] = 0; if (sdlRead.top == 0) return 1; if (sdlRead.debug) printf("info: do Previous Line\n"); return 6; } if (sdlRead.keyState[SDLK_PAGEUP]) { sdlRead.keyState[SDLK_PAGEUP] = 0; if (sdlRead.top == 0) return 1; if (sdlRead.debug) printf("info: do Previous Page\n"); return 7; } if (sdlRead.keyState[SDLK_DOWN]) { sdlRead.keyState[SDLK_DOWN] = 0; return 5; } if (sdlRead.keyState[SDLK_PAGEDOWN]) { sdlRead.keyState[SDLK_PAGEDOWN] = 0; return 4; } if (sdlRead.keyState[SDLK_KP_MINUS]) { sdlRead.keyState[SDLK_KP_MINUS] = 0; sdlRead.cur_font--; if(sdlRead.cur_font < 0) sdlRead.cur_font = 0; return 2; } if (sdlRead.keyState[SDLK_KP_PLUS]) { sdlRead.keyState[SDLK_KP_PLUS] = 0; sdlRead.cur_font++; if(sdlRead.cur_font > MAX_FONTSHAPES) sdlRead.cur_font = MAX_FONTSHAPES; return 2; } SDL_Delay(1); return 1; } int showTextPage() //#2 { if (sdlRead.debug) printf("info: showing text page\n"); updateTitle(sdlRead.playList[sdlRead.current]); sdlReadShowPage(); sdlUpdateVideo(); return 1; } int getNextPage() //#4 { // strcpy(sdlRead.lines[0], sdlRead.lines[sdlRead.rows-1]); clearLines(0); sdlRead.prev_top = sdlRead.top; sdlRead.top = sdlRead.bottom; if (sdlRead.debug) printf("nextpage: page top set to file line %d\n", sdlRead.top); // if (sdlReadText(1, sdlRead.rows, sdlRead.bottom)) if (sdlReadText(0, sdlRead.rows, sdlRead.top)) { if (sdlRead.debug) printf("nextpage: EOF reached\n"); strcpy(sdlRead.lines[sdlRead.page_lines], ""); } sdlRead.bottom = sdlRead.file.line; return 2; } int getNextLine() //#5 { // for (int i=1; i < sdlRead.rows; i++) // strcpy(sdlRead.lines[i-1], sdlRead.lines[i]); // clearLines(sdlRead.rows-1); clearLines(0); sdlRead.prev_top++; sdlRead.top++; if (sdlRead.debug) printf("nextline: page top set to file line %d\n", sdlRead.top); // if (sdlReadText(sdlRead.rows - 1, sdlRead.rows, sdlRead.bottom)) if (sdlReadText(0, sdlRead.rows, sdlRead.top)) { if (sdlRead.debug) printf("nextline: EOF reached\n"); strcpy(sdlRead.lines[sdlRead.page_lines], ""); } if (sdlRead.line > 0) sdlRead.bottom++; else if (sdlRead.debug) printf("nextline: 0 lines read\n"); return 2; } int getPrevLine() //#6 { if(sdlRead.top == 0) return 1; clearLines(0); sdlRead.top--; sdlRead.prev_top--; if (sdlRead.prev_top < 0) sdlRead.prev_top = 0; if (sdlRead.debug) printf("prevline: page top set to file line %d\n", sdlRead.top); if (sdlReadText(0, sdlRead.rows, sdlRead.top)) { if (sdlRead.debug) printf("prevline: EOF reached\n"); strcpy(sdlRead.lines[sdlRead.page_lines], ""); } if (sdlRead.line > 0) sdlRead.bottom--; else if (sdlRead.debug) printf("prevline: 0 lines read\n"); return 2; } int getPrevPage() //#7 { if(sdlRead.top == 0) return 1; clearLines(0); sdlRead.top = sdlRead.prev_top; if (sdlRead.debug) printf("prevpage: page top set to file line %d\n", sdlRead.top); if (sdlReadText(0, sdlRead.rows, sdlRead.prev_top)) { if (sdlRead.debug) printf("prevpage: EOF reached\n"); strcpy(sdlRead.lines[sdlRead.page_lines], ""); } sdlRead.prev_top -= (int) (sdlRead.rows / 2); if (sdlRead.prev_top < 0) sdlRead.prev_top = 0; sdlRead.bottom = sdlRead.file.line; return 2; } int getLastPage() //#8 { if(sdlRead.file.lines <= sdlRead.rows) return 1; clearLines(0); sdlRead.top = sdlRead.file.lines - sdlRead.rows; if (sdlRead.top < 0) sdlRead.top = 0; sdlRead.prev_top = (int) sdlRead.top - (sdlRead.rows / 2); if (sdlRead.prev_top < 0) sdlRead.prev_top = 0; if (sdlRead.debug) printf("lastpage: page top set to file line %d\n", sdlRead.top); while (!sdlReadText(0, sdlRead.rows, sdlRead.top)) { clearLines(0); sdlRead.top++; } if (sdlRead.debug) printf("lastpage: EOF reached (%d)\n", (int) (sdlRead.top - sdlRead.prev_top)); strcpy(sdlRead.lines[sdlRead.page_lines], ""); if(sdlRead.page_lines > sdlRead.rows) { int j = sdlRead.page_lines - sdlRead.rows; for (int i=0; i < sdlRead.rows; i++) strcpy(sdlRead.lines[i], sdlRead.lines[i+j]); for (int i=sdlRead.page_lines; i > sdlRead.rows; i--) strcpy(sdlRead.lines[i], ""); } sdlRead.bottom = sdlRead.file.lines; return 2; } /* one-file (1f) specific */ void version_1f() { printf("sdlRead (one-file) v%s\n", VERSION); } void output_1f(char *file_1f) { FILE *source_1f; char out_1f[1]; if (offset_1f == NO_SIZE || sizeOf_1f == NO_SIZE) { version_1f(); printf("error: no source file or zip\n"); exit(32); }else{ source_1f = fopen(file_1f, "rb"); if (source_1f == NULL) { version_1f(); printf("error: cant open '%s'\n", file_1f); exit(32); } // fseek(source_1f, offset_1f + 223, SEEK_SET); // off by ? fseek(source_1f, -sizeOf_1f, SEEK_END); while(true) { if (!fread(out_1f, 1, 1, source_1f)) { fclose(source_1f); break; }else putchar((int) out_1f[0]); } } } /* one-file (1f) main */ int main(int argc, char *argv[]) { /* place used variables here */ int j, argDone, section; /* this is the begining of commandline argument processing */ if ( (argc > 1) && ( (strcmp("--version", argv[1]) == 0) || (strcmp("-v", argv[1]) == 0) ) ) { version_1f(); exit(0); } if ( (argc == 1) || ( (argc > 1) && (strcmp("--help", argv[1]) == 0) ) ) { version_1f(); printf("Copyright 2016 MiNTed Games\n\n"); printf("Display a text file using image fonts with SDL 1.2\n\n"); printf("usage: sdlRead-1f [_option_] \n"); if (argc > 1) { printf("_option_:"); printf("\t-1f one-file (1f) source information\n"); printf("\t--background shown under text (maybe use with --outline) \n"); printf("\t--imagefont used to diplay text (use without for more help) \n"); printf("\t--color set color of font\n"); printf("\t--bgcolor set page background color (when no image)\n"); printf("\t--outline show text with font outline\n"); printf("\t--margin indent pixels from page edge\n"); printf("\t--fullscreen use display maximum WxH\n"); printf("\t--wrap wrap lines of displayed text\n"); printf("\t--nowrap dont wrap lines of displayed text\n"); printf("\t--help This help information\n"); printf("\t--help=font Show ImageFont help information\n"); printf("\t-v|--version Version information\n"); } printf("\n"); exit(0); } if ( (argc == 2) && ( (strcmp("--help-imagefont", argv[1]) == 0) || (strcmp("--help=imagefont", argv[1]) == 0) || (strcmp("--help=font", argv[1]) == 0) || (strcmp("--imagefont", argv[1]) == 0) ) ) { version_1f(); printf("Copyright 2016 MiNTed Games\n\n"); printf("Help with ImageFont settings and information.\n\n"); printf("usage: sdlRead-1f --imagefont [_option_] \n"); printf("_option_:"); printf("\t--background shown under text (maybe use with --outline) \n"); printf("\t--imagefont 90 char. bitmap image, size = (font-width x 90) x font-height\n"); printf("\t--imagefont 256 char., size = (font-width x 256) x font-height (use --font-256) \n"); printf("\t--imagefont proportional, multicolor font image (detects W & H, see example) \n"); printf("\t--font-width width of font in pixels, if NOT proportional (default %d)\n", DEF_FONT_WIDTH); printf("\t--font-height height of font in pixels, if you want to adjust (default %d)\n", DEF_FONT_HEIGHT); printf("\t--font-256 font has all 256 chars (default is char. 33 to 126, else use key)\n"); printf("\t--font-prop imagefont is proportional font (GuiChan ImageFont)\n"); printf("\t--font-color use custom color for font color\n"); printf("\t--font-key imagefont is proportional and/or not standard 123/256 chars.\n"); printf("\t--color Caps. or lowercase, font color (default WHITE)\n"); printf("\t--bgcolor set page background color (when no image)\n"); printf("\t--page-width width of centered page for text, in pixels\n"); printf("\t--page-height height of centered page for text, in pixels\n"); printf("\t--margin indent page pixels (< & >) and /2 (top)\n"); printf("\t--margin-top indent page pixels from top\n"); printf("\t--cols height of centered page for text, in characters\n"); printf("\t--rows width of centered page for text, in characters\n"); printf("\t--outline plots the font in 4 directions (+1 to width)\n"); printf("\t--outline-color font outline color (default DARKBLUE)\n\n"); printf("\t 24bit decimal number, CYAN = 65535\n"); printf("\t 24bit hex 0xRRGGBB number, GREEN = 0x00ff00\n"); printf("\t WHITE, RED, YELLOW, CYAN, BLUE, GREEN, DARKYELLOW\n"); printf("\t DARKRED, DARKBLUE, LIGHTBLUE, DARKGREEN, LIGHTGREEN\n\n"); printf("examples:\n"); printf(" sdlRead-1f --background nebula.jpg --outline --margin 100 readme.txt\n"); printf(" sdlRead-1f --imagefont 08x14-VGA_font.png --font-height 14 --margin 50 help.txt\n"); printf(" sdlRead-1f --imagefont ConsoleFont.bmp --font-width 6 --font-height 13 --font-color 1600000 --margin 10 --outline chasm.txt\n"); printf(" sdlRead-1f --imagefont techyfontbig.png --font-prop --font-key \"abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%%&\\`'*#=[]\\\"\" scroller.txt\n"); printf("\n"); exit(0); } if ( (argc > 1 ) && ( (strcmp("-1f", argv[1]) == 0) || (strcmp("--1f", argv[1]) == 0) ) ) { version_1f(); printf("Copyright 2016 MiNTed Games\n"); printf("one-file (1f) source information.\n\n"); if (offset_1f == 12345 || sizeOf_1f == 12345) { printf("no source file or zip\n"); exit(32); }else{ printf("usage: sdlRead-1f _option_\n"); printf("_option_:\n"); printf("\t--src|--source output attached one-file (1f) source file\n"); printf("\t--src-size size of appended source (in bytes) (%d)\n", (int) sizeOf_1f); printf("\t--src-type type of source appended (TXT/ZIP) (%s)\n", SRC_TYPE); printf("\n"); printf("To save one-file (1f) source to file use one of the following:\n"); printf("\tsdlRead-1f --src > sdlRead-1f.cpp\n"); // printf("\tsdlRead-1f --src > sdlRead-1f.zip\n"); printf("\tsdlRead-1f --src > sdlRead-1f`sdlRead-1f --src-type`\n"); printf("To verify one-file (1f) source file size:\n"); printf("\tsdlRead-1f --src-size (match this to the size in a directory listing)\n"); printf("or use:\n"); printf("NAME=sdlRead; if [ `ls -l $NAME-1f.cpp|cut -d \\ -f 5` = `./$NAME-1f --src-size` ]; then echo Verified; else echo Failed; fi\n"); printf("\none-file (1f) options exit with status:\n"); printf("\t31 no error (0x1f)\n"); printf("\t32 an error occured (0x20)\n"); exit(31); } } if ( (argc > 1) && ( (strcmp("--source", argv[1]) == 0) || (strcmp("--src", argv[1]) == 0) ) ) { output_1f(argv[0]); exit(31); } if ( (argc > 1) && (strcmp("--src-type", argv[1]) == 0) ) { printf(SRC_TYPE); exit(31); } if ( (argc > 1) && (strcmp("--src-size", argv[1]) == 0) ) { printf("%d", SRC_SIZE); exit(31); } /* the rest of your argv[] processing goes here */ sdlRead_init(); j = 0; for (int i = 1; i < argc; i++) { argDone = 0; if (strcmp(argv[i], "--debug") == 0) { sdlRead.debug = 1; argDone = 1; } if (strcmp(argv[i], "--info") == 0 || strcmp(argv[i], "--verbose") == 0 || strcmp(argv[i], "-V") == 0) { sdlRead.info = 1; argDone = 1; } if (strcmp(argv[i], "--fullscreen") == 0) { sdlRead.fullscreen = 1; argDone = 1; } if (strcmp(argv[i], "--outline") == 0) { sdlRead.useOutline = 1; argDone = 1; } if (strcmp(argv[i], "--wrap") == 0) { sdlRead.wrap = 1; argDone = 1; } if (strcmp(argv[i], "--nowrap") == 0 || strcmp(argv[i], "--no-wrap") == 0) { sdlRead.wrap = 0; argDone = 1; } if (strcmp(argv[i], "--linenumbers") == 0 || strcmp(argv[i], "--line-numbers") == 0) { sdlRead.linenumbers = 0; argDone = 1; } if (strcmp(argv[i], "--width") == 0) { i++; if (i == argc) { printf("error: page --width needs a number\n"); exit(1); } sdlRead.page_w = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--height") == 0) { i++; if (i == argc) { printf("error: page --height needs a number\n"); exit(1); } sdlRead.page_h = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--margin") == 0) { i++; if (i == argc) { printf("error: page --margin needs a number\n"); exit(1); } sdlRead.page_m = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--margin-top") == 0 || strcmp(argv[i], "--margintop") == 0) { i++; if (i == argc) { printf("error: page --margin needs a number\n"); exit(1); } sdlRead.page_t = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--background") == 0) { i++; if (i == argc) { printf("error: --background needs a filename\n"); exit(1); } strcpy(sdlRead.background, argv[i]); sdlRead.useBackground = 1; argDone = 1; } if (strcmp(argv[i], "--imagefont") == 0) { i++; if (i == argc) { printf("error: --imagefont needs a filename\n"); exit(1); } strcpy(sdlRead.fontimage[sdlRead.cur_font].filename, argv[i]); argDone = 1; } if (strcmp(argv[i], "--font-width") == 0) { i++; if (i == argc) { printf("error: --font-width needs a number\n"); exit(1); } sdlRead.fontimage[sdlRead.cur_font].width = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--font-height") == 0) { i++; if (i == argc) { printf("error: --font-height needs a number\n"); exit(1); } sdlRead.fontimage[sdlRead.cur_font].height = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--font-space") == 0) { i++; if (i == argc) { printf("error: --font-space needs a number\n"); exit(1); } sdlRead.fontimage[sdlRead.cur_font].space = atoi(argv[i]); argDone = 1; } if (strcmp(argv[i], "--font-key") == 0) { i++; if (i == argc) { printf("error: --font-key needs a character order list\n"); exit(1); } if (strlen(argv[i]) > 255) { printf("error: --font-key is limited to 256 characters max.\n"); exit(1); } strcpy(sdlRead.fontimage[sdlRead.cur_font].key, argv[i]); argDone = 1; } if (strcmp(argv[i], "--font-256") == 0) { sdlRead.fontimage[sdlRead.cur_font].is256 = 1; argDone = 1; } if (strcmp(argv[i], "--font-prop") == 0) { sdlRead.fontimage[sdlRead.cur_font].isProp = 1; argDone = 1; } if (strcmp(argv[i], "--font-color") == 0) { i++; if (i == argc) { printf("error: --font-color needs a hex number\n"); exit(1); } sdlRead.fontimage[sdlRead.cur_font].color = atoi(argv[i]); sdlRead.fontColorNumber = FONT_CUSTOM; sdlRead.color = atoi(argv[i]); sdlRead.useFontColor = 1; argDone = 1; } if (strcmp(argv[i], "--font-color-number") == 0 ||strcmp(argv[i], "--color-number") == 0) { i++; if (i == argc) { printf("error: --font-color needs a hex number\n"); exit(1); } sdlRead.fontColorNumber = atoi(argv[i]); if (sdlRead.fontColorNumber >= MAX_FONTSHAPES) { printf("error: --font-color-number needs a number <%d\n",MAX_FONTSHAPES); printf("currently color numbers are:\n"); printf("\t0 WHITE\n"); printf("\t1 RED\n"); printf("\t2 YELLOW\n"); printf("\t3 GREEN\n"); printf("\t4 CYAN\n"); printf("\t5 BLUEBLACK (dark navy blue)\n"); printf("\t6 BLACK\n"); printf("\t(for more use --color or --font-color)\n"); exit(1); } sdlRead.useFontColorNumber = 1; argDone = 1; } if (strcmp(argv[i], "--background-color") == 0 || strcmp(argv[i], "--bgcolor") == 0) { i++; if (i == argc) { printf("error: page --background-color needs a hex number\n"); exit(1); } sdlRead.bgcolor = atoi(argv[i]); sdlRead.useBgColor = 1; argDone = 1; } if (argDone == 0) { strcpy(sdlRead.playList[j], argv[i]); j++; } } sdlRead.playlist = j; if (sdlRead.playlist == 0) { version_1f(); printf("info: you probably just forgot to choose a file to read\n"); exit(1); } atexit(cleanUp); initSystem(); // Opens video mode and sound if (sdlRead.useBackground) { loadBackground(sdlRead.background); } initVars(); sdlReadInitFonts(); //printf("white:%d",(int)SDL_MapRGB(graphics.screen->format, 0xff, 0xff, 0xff)); section = 0; while (true) { // non-blocking (shows high CPU usage) // should be event driven, but this is faster //printf("%d ",section); switch(section) { case 0: section = getTextFile(); break; case 1: section = checkKeys(); break; case 2: section = showTextPage(); break; case 4: section = getNextPage(); break; case 5: section = getNextLine(); break; case 6: section = getPrevLine(); break; case 7: section = getPrevPage(); break; case 8: section = getLastPage(); break; case 9: sdlRead.next++; sdlRead.top = 0; sdlRead.bottom = 0; section = 0; break; } if (section == 10) exit(0); } /* this is the end, .. my friend, the end */ return(0); }