CoolFace
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
Tips.txt251 linesDownload Raw Back to Doc
1 2                                      Tips3 4* Turn-off or reboot (<CTRL-ALT-DEL>) at any time, except during disk writes.5Writes are not cached.6 7* Use Seed() and the cmd line to switch Rand() to non-timer mode and replay8games you like.9 10* 64-bit values are most efficient for the compiler.11 12* See Key Map for a list of defined keys.  Define your own keys in MyPutKey().13See Keyboard Devices.14 15* <ALT-m> maximizes a window.  <ALT-SHIFT-w> closes AutoComplete.  <ALT-w>16brings back AutoComplete.  <ALT-v> vertically tiles windows.  <ALT-h>17horizontally tiles windows.  The ALT keys are defined in ~/HomeKeyPlugIns.HC.18You can customize them.19 20* If you make changes to TempleOS files in your /Home directory, generally you21reboot to make them take effect.  (You don't compile anything.)  You should have22two TempleOS partitions on your hard drive because a syntax error in a start-up23file will make the partition unbootable.  Boot to the second partition or boot24to a standard TempleOS CD/DVD and use Mount() to mount your hard drive.25 26* I copy my files to a mirrored ident partition, periodically with CopyTree()27commands in scripts.  I do merge commands with a menu entry like this:28Merge(\"C:/*\",\"D:/*\",\"+r+d\"); to check my changes.29 30* <CTRL-m> at the cmd line to access your PersonalMenu.  Place macros there with31<CTRL-l>, or icon-like sprites with <CTRL-r>.  Use the Pop-Up option on macros32to Spawn() a task to run a file.  It dies when it is finished.  This returns mem33to the system.  Be sure to press <CTRL-s> to save your macro/menu area after34making changes.35 36* You can use ans in cmd line expressions.  It holds the res the last cmd line37operation.  You can use the cmd prompt as a calculator by just entering38expressions like 1+2*3;.  F64 ress can be accessed with ansf.39 40* Use the PullDown menu at the top of the scrn to learn commands, or for finding41the keyboard controls to games.42 43* You can adjust the mouse movement rate by setting global vars in your start-up44file.  See mouse scale.45 46* You can set your local time zone by setting the local_time_offset global var47in a start-up file.  It's units are CDATE_FREQ.  See local time.48 49* <CTRL-SHIFT-L> in the editor to reindent a HolyC function or renumber an asm50routine's local labels.51 52* You can use filter_lines in the editor text search form (<CTRL-f>) to53temporarily display just lines near each match.  A value of filter lines set to545 will display lines within 5 lines of matches.  Then, you can do another find55to a different string and achieve a AND search.  When finished, press <ESC>.56 57* You can recompile and reinstall the kernel with BootHDIns().  You'll probably58want to make a function for recompiling that uses the In() function to answer59the cfg questions.  See my technique Cfg Strs, Update Funs.60 61* Scale2Mem(min,max,limit=2*1024*1024*1024) can be used for cfg questions when62recompiling.  The BootHDIns() cfg prompts accept expressions, not just numbers.63The dft disk cache is Scale2Mem(0x80000,0x8000000).64 65* You can permanently disable AutoComplete commenting-out ACInit() in66~/HomeSys.HC.67 68* Boolean expressions not in if stmts don't have short circuit logic and are69compiled inefficiently.70 71* You can use progress1-progress4 in your programs for whatever you like.72They're just global vars that are shown on the wallpaper.  The original intent73was to indicate how far along operations were.  There's no coordination, so74different apps might interfere.  I use them most for debugging--just values75easily viewed.  See ::/Demo/Progress.HC.76 77* Use DocMax() to adjust the size of the cmd line buf.  It counts CDoc entries,78not lines.79 80* Many data structures have a user_data member.  Those are available for you to81store a data item, for convenience.  CTask, CDocEntry and CDirEntry have them.82You shouldn't encounter conflicts with TempleOS using them.83 84* If, for some strange reason, you wanted to reduce mem usage, make a smaller85disk cache when you recompile the kernel; disabling AutoComplete; Specify86smaller stk sizes when doing Spawn(), chang MEM_DFT_STK, and using DocMax() to87reduce the cmd line buffer size.88 89* Filenames ending in ".Z" will be automatically compressed and uncompressed90when read or written.  The compression method is not supported by other91operating systems.  You can store files uncompressed by Move()ing them to a92filename not ending in ".Z".  See ::/Doc/TOSZ.DD if you want to uncompress while93in Linux.94 95* Merge() can be used to see what's changed.  The +d flag will show differences96of files which have changed and allow you to merge code.  (The +r flag will97recurse.)98 99* There is a utility LinkChk() which will check for broken links in100documentation.101 102* You can use Option(OPTf_WARN_PAREN,ON) to find unnecessary parentheses in103code.104 105* You can use Option(OPTf_WARN_DUP_TYPES,ON) to find unnecessary local var type106stmts.107 108* Option(OPTf_ECHO,ON) can be placed in StartOS.HC to echo start-up scripts.109 110* Use Plain() to edit a plain text file.  You'll need this if your file has $'s.111 Use the ToDolDoc() utility to convert plain text to DolDoc's by doubling $'s.112 113* Use Silent() to disable scrn text output.114 115* Grab-scroll any window at any time with {CTRL-LEFT-MOUSE-DRAG}.  Null116grab-scrolling with {CTRL-RIGHT-MOUSE}.117 118* Use <CTRL-ALT-z> to zoom-in and <CTRL-ALT-SHIFT-Z> to zoom-out.  You can119scroll by moving to the edge of the window.  Set gr.continuous_scroll to TRUE if120you want.121 122* Use <CTRL-ALT-g> and <CTRL-ALT-SHIFT-G> to display a grid on the scrn.123 124* Use <CTRL-ALT-a> to enter an extended ASCII char.125 126* Use <CTRL-ALT-f> to toggle between Std Font and Cyrillic Font.127 128* Use <CTRL-ALT-s> will capture the scrn as a sprite on the clip.  You can save129the cmd line doc as text with <CTRL-a>.130 131* You can save a sprite as a .BMP file in <CTRL-r> on the Sprite BitMap Menu.132 133* You can eye-dropper colors in the <CTRL-r> sprite editor by pressing 'c'.134Press 't' for transparent.135 136* There are handy functions--F(),R(),FD() and RD() which are defined in137~/HomeWrappers.HC.  You are encouraged to change them and add more.  They will138perform find-and-replace operations accross multiple files.  The +l flag is139particularly useful since it limits to whole labels.  The +lb and +la flags140limit to whole labels just before or after.  You are encouraged to add or modify141handy wrapper functions to make cmd line operations easier.142 143* When using Find() while modifying code, work from the bottom-up so that line144numbers are correct.  If you work top-down, then inserting or deleting lines145causes the lower file links will be incorrect.146 147* You can save files after making changes, anytime you are within the editor,148like when viewing help/macro files.  <CTRL-a> saves as, <CTRL-s> saves with the149same name in the scrolling title bar.  Hitting <ESC> will exit and save.  (<SHIF150T-ESC> will abort).  You can save the cmd line window to a file, too, since151you're actually in the editor when you're at the cmd line.152 153* When using <CTRL-l> to insert links in documents, you can usually leave the Ta154g Text blank and it will be filled-in automatically based on other entries.155 156* There is a feature of the precompiler that allows code to be executed in the157middle of compilation and data inserted into the compilation stream.  Click here158for an example: #exe {.159 160* If you output to the cmd line and wish to allow users to scroll around and161view data, you can use View().162 163* Use View() in Pop-up macros to linger until the user presses <ESC> or <SHIFT-E164SC>.165 166* You can access the word under the cursor at ac.cur_word.167 168* You can reactivate AutoComplete after closing it by pressing <CTRL-Fun Key> or169<ALT-w> if you have it defined.170 171* <CTRL-SHIFT-T> to toggle to/from plain text just the CDoc cmd under the172cursor.  See ::/Demo/DolDoc/TextDemo.HC.173 174* If you toggle to plain text when you are working with graphics in a document,175you can add duplicate entries for sprites by entering a $SP...$ cmd with the176same num.177 178* If you toggle to plain text when working with graphics, you can add a str to179the $SP...$ entry to keep track of it.  Try $SP,"<2>",BI=2$ where '2' is the180sprite num.181 182* I use spaces-to-tab operations on all my src files to keep them small.  You183have to be careful, though, because spaces in strings will be converted.  I use184<SHIFT-SPACE> ' ' in such cases.  See S2T() for spaces-to-tabs.185 186* You can edit an existing sprite by putting the cursor on it and pressing <CTRL187-r>.188 189* When editing a sprite, you can cut and paste the elements in the sidebar text190list window.191 192* I recommend keeping CSprite in vect format until you are done creating them,193so you can edit the ctrl points.  Then, convert them to bitmaps, so the flood194fills work well.  If you are doing interpolation, however, they must be vect.195 196* GrFloodFill() is slow.  GrRect() is fast.197 198* You can customize the wallpaper.  See ::/Demo/Graphics/WallPaperFish.HC.199 200* Your RAM disks will not be reformated when you reboot if the memory location201has not changed and it finds the disk intacted.202 203* try{} catch{} in a function will cause all vars to be non-reg.204 205* Using a sub-int array, i.u8[3], for example, will force a local var to206non-reg.207 208* You can delete the ~/Registry.HC.Z file.  The policy is that deleting it will209restore defaults.  It is a text doc, if you want to edit it.  Be careful of tree210indentations.211 212* Study ::/Adam/Opt/Utils/MemRep.HC and WallPaper() to learn how the system213resources are put together.214 215* The editor's sel-text mechanism allows for disjoint portions of sel text.216This is a feature, not a bug -- you can cut-and-paste disjoint text.217 218* cnts.time_stamp_freq is continuously calibrated.  Be careful because219expressions might decrease.  Take a snap-shot, like this: timeout=GetTSC+220cnts.time_stamp_freq x seconds; and compare against GetTSC().  I recommend just221using tS or cnts.jiffies.222 223* Use HeapLog(), HeapLogAddrRep() and HeapLogSizeRep() to find leaks.  Don't be224confused by CDoc allocations.  Those are generated when text is written to the225cmd line buffer.226 227* For advanced heap debugging, play with _CFG_HEAP_DBG.  You're on your own.228 229* You can use Type() to display .BMP or .GR files.230 231* Use Man() to jump to short sym name src code.232 233* Use Fix() to edit and fix the last compiler err.234 235* You can use <CTRL-SHIFT-L> to do a check for compile errors.236 237* You can use DocOpt() to optimize links. (Mostly just removes .Z)238 239* ZipRep() can highlight src files with lots of redundancy.240 241* With start/end, common trailing code is fast.  Common leading code is slow.242 243* The first line of the Psalmody HolyC song files is a comment with a category244recognized by JukeBox().  The categories are "no nothing", "has words", "has245graphics", or "special".  The third character in the song comment is a digit246rating number, shown in JukeBox().  You can set the song rating in JukeBox() by247pressing 0-9.  You can press <DEL> to delete songs.248 249 250* "Linux" is a trademark owned by Linus Torvalds.251