home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / goattracker_2.67.zip / src / ghelp.c < prev    next >
C/C++ Source or Header  |  2008-04-01  |  20KB  |  312 lines

  1. //
  2. // GOATTRACKER v2 online help
  3. //
  4.  
  5. #define GHELP_C
  6.  
  7. #include "goattrk2.h"
  8.  
  9. #define HELP_LASTROW 168
  10.  
  11. void onlinehelp(void)
  12. {
  13.   int hview = -1;
  14.  
  15.   int c;
  16.  
  17.   for (;;)
  18.   {
  19.     int gk = hview + 2;
  20.     int pk = hview + 2;
  21.     int ik;
  22.     int sk;
  23.     int pc;
  24.     int ip;
  25.     int tb;
  26.  
  27.     clearscreen();
  28.     printtext(0, gk++, 15,"GENERAL KEYS");
  29.     printtext(0, gk++, 7, "F1  Play from beginning");
  30.     printtext(0, gk++, 7, "F2  Play from current position");
  31.     printtext(0, gk++, 7, "F3  Play current pattern");
  32.     printtext(0, gk++, 7, "F4  Stop playing");
  33.     printtext(0, gk++, 7, "F5  Go to pattern editor");
  34.     printtext(0, gk++, 7, "F6  Go to orderlist editor");
  35.     printtext(0, gk++, 7, "F7  Go to instrument/table editor");
  36.     printtext(0, gk++, 7, "F8  Go to songname editor");
  37.     printtext(0, gk++, 7, "F9  Pack, relocate & save PRG,SID etc.");
  38.     printtext(0, gk++, 7, "F10 Load song/instrument");
  39.     printtext(0, gk++, 7, "F11 Save song/instrument");
  40.     printtext(0, gk++, 7, "F12 This screen");
  41.     printtext(0, gk++, 7, "SHIFT+F1-F3 Follow play begin/pos/patt.");
  42.     printtext(0, gk++, 7, "SHIFT+F4 Mute current channel");
  43.     printtext(0, gk++, 7, "SHIFT+F5-F6 Change speed multiplier");
  44.     printtext(0, gk++, 7, "SHIFT+F7 Change hardrestart ADSR");
  45.     printtext(0, gk++, 7, "SHIFT+F8 Switch between 6581/8580 SID");
  46.     printtext(0, gk++, 7, "SHIFT+, . Move song startpos & restart");
  47.     printtext(0, gk++, 7, "TAB Cycle between editing modes");
  48.     printtext(0, gk++, 7, "INS Insert row (Press on endmark to");
  49.     printtext(0, gk++, 7, "DEL Delete row change patt. length)");
  50.     printtext(0, gk++, 7, "SHIFT+ESC Clear/optimize all musicdata");
  51.     printtext(0, gk++, 7, "ESC Exit program");
  52.  
  53.     sk = gk + 1;
  54.  
  55.     printtext(40,pk++, 15,"PATTERN EDIT MODE");
  56.     printtext(40,pk++, 7, "Enter notes like on piano (PT or DMC)");
  57.     printtext(40,pk++, 7, "0-9 & A-F to enter commands");
  58.     printtext(40,pk++, 7, "SPC Switch between jam/editmode");
  59.     printtext(40,pk++, 7, "BACKSPC Insert rest");
  60.     printtext(40,pk++, 7, "RET Keyoff (/w SHIFT = Keyon)");
  61.     printtext(40,pk++, 7, "- + Select instrument");
  62.     printtext(40,pk++, 7, "/ * Select octave");
  63.     printtext(40,pk++, 7, "< > Select pattern");
  64.     printtext(40,pk++, 7, "BACKQUOTE Select channel");
  65.     printtext(40,pk++, 7, "SHIFT+SPC Play from cursor pos");
  66.     printtext(40,pk++, 7, "SHIFT+CRSR Mark pattern");
  67.     printtext(40,pk++, 7, "SHIFT+Q,W Transpose half/octave up");
  68.     printtext(40,pk++, 7, "SHIFT+A,S Transpose half/octave down");
  69.     printtext(40,pk++, 7, "SHIFT+E,R Copy,paste effects");
  70.     printtext(40,pk++, 7, "SHIFT+H Make hifi vib/portaspeed");
  71.     printtext(40,pk++, 7, "SHIFT+I Invert selection/pattern");
  72.     printtext(40,pk++, 7, "SHIFT+J,K Join/split pattern");
  73.     printtext(40,pk++, 7, "SHIFT+L Mark/unmark whole pattern");
  74.     printtext(40,pk++, 7, "SHIFT+M,N Choose highlighting step");
  75.     printtext(40,pk++, 7, "SHIFT+O,P Shrink/expand pattern");
  76.     printtext(40,pk++, 7, "SHIFT+X,C,V Cut,copy,paste pattern");
  77.     printtext(40,pk++, 7, "SHIFT+Z Cycle autoadvance-mode");
  78.     printtext(40,pk++, 7, "SHIFT+1,2,3 Mute channel");
  79.  
  80.     ik = pk + 1;
  81.  
  82.     printtext(0, sk++, 15,"SONG EDIT MODE");
  83.     printtext(0, sk++, 7, "0-9 & A-F to enter pattern numbers");
  84.     printtext(0, sk++, 7, "SPC Set start position for F2 key");
  85.     printtext(0, sk++, 7, "BACKSPC Set end position for F2 key");
  86.     printtext(0, sk++, 7, "RET Go to pattern (/w SHIFT=all chns.)");
  87.     printtext(0, sk++, 7, "< > Select subtune");
  88.     printtext(0, sk++, 7, "- + Insert transpose down/up command");
  89.     printtext(0, sk++, 7, "SHIFT+CRSR LEFT/RIGHT Mark orderlist");
  90.     printtext(0, sk++, 7, "SHIFT+L Mark/unmark whole orderlist");
  91.     printtext(0, sk++, 7, "SHIFT+R Insert repeat command");
  92.     printtext(0, sk++, 7, "SHIFT+X,C,V Cut,copy,paste orderlist");
  93.     printtext(0, sk++, 7, "SHIFT+1,2,3 Swap orderlist with chn.");
  94.     printtext(0, sk++, 7, " ");
  95.     printtext(0, sk++, 15,"SONGNAME EDIT MODE");
  96.     printtext(0, sk++, 7, "Use cursor UP/DOWN to change rows");
  97.     printtext(40,ik++, 15,"INSTRUMENT/TABLE EDIT MODE");
  98.     printtext(40,ik++, 7, "0-9 & A-F to enter parameters");
  99.     printtext(40,ik++, 7, "SPC Play test note");
  100.     printtext(40,ik++, 7, "SHIFT+SPC Silence test note");
  101.     printtext(40,ik++, 7, "RET Go to table");
  102.     printtext(40,ik++, 7, "- + Select instrument");
  103.     printtext(40,ik++, 7, "/ * Select octave");
  104.     printtext(40,ik++, 7, "BACKQUOTE Select table");
  105.     printtext(40,ik++, 7, "SHIFT+CRSR Mark table");
  106.     printtext(40,ik++, 7, "SHIFT+Q,W Trans. speed half/octave up");
  107.     printtext(40,ik++, 7, "SHIFT+A,S Trans. speed half/octave down");
  108.     printtext(40,ik++, 7, "SHIFT+L Convert pulse/filter limit");
  109.     printtext(40,ik++, 7, "SHIFT+N Edit name/negate value or note");
  110.     printtext(40,ik++, 7, "SHIFT+O Optimize table (remove unused)");
  111.     printtext(40,ik++, 7, "SHIFT+R Convert absolute/relative note");
  112.     printtext(40,ik++, 7, "SHIFT+S ""Smart"" instrument paste");
  113.     printtext(40,ik++, 7, "SHIFT+U Unlock/lock table view");
  114.     printtext(40,ik++, 7, "SHIFT+X,C,V Cut,copy,paste instr./table");
  115.     printtext(40,ik++, 7, "SHIFT+DEL Delete instrument+tabledata");
  116.     printtext(40,ik++, 7, "SHIFT+RET Convert vibrato parameter");
  117.  
  118.     pc = ik + 1;
  119.  
  120.     printtext(0, pc++, 15,"PATTERN COMMANDS");
  121.     printtext(0, pc++,  7,"                                                                               ");
  122.     printtext(0, pc++,  7,"Command 0XY: Do nothing. Databyte will always be 00.                           ");
  123.     printtext(0, pc++,  7,"                                                                               ");
  124.     printtext(0, pc++,  7,"Command 1XY: Portamento up. XY is index to a 16-bit speed in speedtable.       ");
  125.     printtext(0, pc++,  7,"                                                                               ");
  126.     printtext(0, pc++,  7,"Command 2XY: Portamento down. XY is index to a 16-bit speed in speedtable.     ");
  127.     printtext(0, pc++,  7,"                                                                               ");
  128.     printtext(0, pc++,  7,"Command 3XY: Toneportamento. Raise or lower pitch until target note has been   ");
  129.     printtext(0, pc++,  7,"             reached. XY is index to a 16-bit speed or 00 for ""tie note"".      ");
  130.     printtext(0, pc++,  7,"                                                                               ");
  131.     printtext(0, pc++,  7,"Command 4XY: Vibrato. XY is index to speedtable. Left side value determines how");
  132.     printtext(0, pc++,  7,"             long until the direction changes (speed) and right side value is  ");
  133.     printtext(0, pc++,  7,"             the amount of pitch change each tick (depth).                     ");
  134.     printtext(0, pc++,  7,"                                                                               ");
  135.     printtext(0, pc++,  7,"Command 5XY: Set attack/decay register to value XY.                            ");
  136.     printtext(0, pc++,  7,"                                                                               ");
  137.     printtext(0, pc++,  7,"Command 6XY: Set sustain/release register to value XY.                         ");
  138.     printtext(0, pc++,  7,"                                                                               ");
  139.     printtext(0, pc++,  7,"Command 7XY: Set waveform register to value XY. If a wavetable is actively     ");
  140.     printtext(0, pc++,  7,"             changing the channel's waveform at the same time, will be         ");
  141.     printtext(0, pc++,  7,"             ineffective.                                                      ");
  142.     printtext(0, pc++,  7,"                                                                               ");
  143.     printtext(0, pc++,  7,"Command 8XY: Set wavetable pointer. 00 stops wavetable execution.              ");
  144.     printtext(0, pc++,  7,"                                                                               ");
  145.     printtext(0, pc++,  7,"Command 9XY: Set pulsetable pointer. 00 stops pulsetable execution.            ");
  146.     printtext(0, pc++,  7,"                                                                               ");
  147.     printtext(0, pc++,  7,"Command AXY: Set filtertable pointer. 00 stops filtertable execution.          ");
  148.     printtext(0, pc++,  7,"                                                                               ");
  149.     printtext(0, pc++,  7,"Command BXY: Set filter control. X is resonance and Y is channel bitmask.      ");
  150.     printtext(0, pc++,  7,"             00 turns filter off and also stops filtertable execution.         ");
  151.     printtext(0, pc++,  7,"                                                                               ");
  152.     printtext(0, pc++,  7,"Command CXY: Set filter cutoff to XY. Can be ineffective if the filtertable is ");
  153.     printtext(0, pc++,  7,"             active and also changing the cutoff.                              ");
  154.     printtext(0, pc++,  7,"                                                                               ");
  155.     printtext(0, pc++,  7,"Command DXY: Set mastervolume to Y, if X is 0. If X is not 0, value XY is      ");
  156.     printtext(0, pc++,  7,"             copied to the timing mark location, which is playeraddress+$3F.   ");
  157.     printtext(0, pc++,  7,"                                                                               ");
  158.     printtext(0, pc++,  7,"Command EXY: Funktempo. XY is an index to speedtable. Will alternate left side ");
  159.     printtext(0, pc++,  7,"             and right side tempo values on each pattern step.                 ");
  160.     printtext(0, pc++,  7,"                                                                               ");
  161.     printtext(0, pc++,  7,"Command FXY: Set tempo. Values 03-7F set tempo on all channels, values 83-FF   ");
  162.     printtext(0, pc++,  7,"             only on current channel (subtract 80 to get actual tempo). Tempos ");
  163.     printtext(0, pc++,  7,"             00 and 01 recall the funktempos set by EXY command.               ");
  164.  
  165.     ip = pc + 1;
  166.  
  167.     printtext(0, ip++, 15,"INSTRUMENT PARAMETERS");
  168.     printtext(0, ip++,  7,"                                                                               ");
  169.     printtext(0, ip++,  7,"Attack/Decay          0 is fastest attack or decay, F is slowest               ");
  170.     printtext(0, ip++,  7,"                                                                               ");
  171.     printtext(0, ip++,  7,"Sustain/Release       Sustain level 0 is silent and F is the loudest. Release  ");
  172.     printtext(0, ip++,  7,"                      behaves like Attack & Decay (F slowest).                 ");
  173.     printtext(0, ip++,  7,"                                                                               ");
  174.     printtext(0, ip++,  7,"Wavetable Pos         Wavetable startposition. Value 00 stops the wavetable    ");
  175.     printtext(0, ip++,  7,"                      execution and is not very useful.                        ");
  176.     printtext(0, ip++,  7,"                                                                               ");
  177.     printtext(0, ip++,  7,"Pulsetable Pos        Pulsetable startposition. Value 00 will leave pulse      ");
  178.     printtext(0, ip++,  7,"                      execution untouched.                                     ");
  179.     printtext(0, ip++,  7,"                                                                               ");
  180.     printtext(0, ip++,  7,"Filtertable Pos       Filtertable startposition. Value 00 will leave filter    ");
  181.     printtext(0, ip++,  7,"                      execution untouched. In most cases it makes sense to have");
  182.     printtext(0, ip++,  7,"                      a filter-controlling instrument only on one channel at a ");
  183.     printtext(0, ip++,  7,"                      time.                                                    ");
  184.     printtext(0, ip++,  7,"                                                                               ");
  185.     printtext(0, ip++,  7,"Vibrato Param         Instrument vibrato parameters. An index to the speed-    ");
  186.     printtext(0, ip++,  7,"                      table, see command 4XY.                                  ");
  187.     printtext(0, ip++,  7,"                                                                               ");
  188.     printtext(0, ip++,  7,"Vibrato Delay         How many ticks until instrument vibrato starts. Value 00 ");
  189.     printtext(0, ip++,  7,"                      turns instrument vibrato off.                            ");
  190.     printtext(0, ip++,  7,"                                                                               ");
  191.     printtext(0, ip++,  7,"HR/Gate Timer         How many ticks before note start note fetch, gateoff and ");
  192.     printtext(0, ip++,  7,"                      hard restart happen. Can be at most tempo-1. So on tempo ");
  193.     printtext(0, ip++,  7,"                      4 highest acceptable value is 3. Bitvalue 80 disables    ");
  194.     printtext(0, ip++,  7,"                      hard restart and bitvalue 40 disables gateoff.           ");
  195.     printtext(0, ip++,  7,"                                                                               ");
  196.     printtext(0, ip++,  7,"1stFrame Wave         Waveform used on init frame of the note, usually 09 (gate");
  197.     printtext(0, ip++,  7,"                      + testbit). Values 00, FE and FF have special meaning:   ");
  198.     printtext(0, ip++,  7,"                      leave waveform unchanged and additionally set gate off   ");
  199.     printtext(0, ip++,  7,"                      (FE), gate on (FF), or gate unchanged (00).              ");
  200.  
  201.     tb = ip + 1;
  202.  
  203.     printtext(0, tb++, 15,"TABLES");
  204.     printtext(0, tb++,  7,"                                                                               ");
  205.     printtext(0, tb++,  7,"Wavetable left side:  00    Leave waveform unchanged                           ");
  206.     printtext(0, tb++,  7,"                      01-0F Delay this step by 1-15 frames                     ");
  207.     printtext(0, tb++,  7,"                      10-DF Waveform values                                    ");
  208.     printtext(0, tb++,  7,"                      E0-EF Inaudible waveform values 00-0F                    ");
  209.     printtext(0, tb++,  7,"                      F0-FE Execute command 0XY-EXY. Right side is parameter   ");
  210.     printtext(0, tb++,  7,"                      FF    Jump. Right side tells jump position (00 = stop)   ");
  211.     printtext(0, tb++,  7,"                                                                               ");
  212.     printtext(0, tb++,  7,"Wavetable right side: 00-5F Relative notes                                     ");
  213.     printtext(0, tb++,  7,"                      60-7F Negative relative notes (lower pitch)              ");
  214.     printtext(0, tb++,  7,"                      80    Keep frequency unchanged                           ");
  215.     printtext(0, tb++,  7,"                      81-DF Absolute notes C#0 - B-7                           ");
  216.     printtext(0, tb++,  7,"                                                                               ");
  217.     printtext(0, tb++,  7,"Pulsetable left side: 01-7F Pulse modulation step. Left side indicates time and");
  218.     printtext(0, tb++,  7,"                            right side the speed (8bit signed value).          ");
  219.     printtext(0, tb++,  7,"                      8X-FX Set pulse width. X is the high 4 bits, right side  ");
  220.     printtext(0, tb++,  7,"                            tells the 8 low bits.                              ");
  221.     printtext(0, tb++,  7,"                      FF    Jump. Right side tells jump position (00 = stop)   ");
  222.     printtext(0, tb++,  7,"                                                                               ");
  223.     printtext(0, tb++,  7,"Filt.table left side: 00    Set cutoff, indicated by right side                ");
  224.     printtext(0, tb++,  7,"                      01-7F Filter modulation step. Left side indicates time   ");
  225.     printtext(0, tb++,  7,"                            and right side the speed (signed 8bit value)       ");
  226.     printtext(0, tb++,  7,"                      80-F0 Set filter parameters. Left side high nybble tells ");
  227.     printtext(0, tb++,  7,"                            the passband (90 = lowpass, A0 = bandpass etc.) and");
  228.     printtext(0, tb++,  7,"                            right side tells resonance/channel bitmask, as in  ");
  229.     printtext(0, tb++,  7,"                            command BXY.                                       ");
  230.     printtext(0, tb++,  7,"                      FF    Jump. Right side tells jump position (00 = stop)   ");
  231.     printtext(0, tb++,  7,"                                                                               ");
  232.     printtext(0, tb++,  7,"Speedtbl. vibrato:    XX YY Left side tells how long until vibrato direction   ");
  233.     printtext(0, tb++,  7,"                            changes (speed), right side is the value added to  ");
  234.     printtext(0, tb++,  7,"                            pitch each tick (depth).                           ");
  235.     printtext(0, tb++,  7,"                                                                               ");
  236.     printtext(0, tb++,  7,"Speedtbl. portamento: XX YY A 16-bit value added to pitch each tick. Left side ");
  237.     printtext(0, tb++,  7,"                            is the MSB and the right side the LSB.             ");
  238.     printtext(0, tb++,  7,"                                                                               ");
  239.     printtext(0, tb++,  7,"Speedtbl. funktempo:  XX YY Two 8-bit tempo values that are alternated on each ");
  240.     printtext(0, tb++,  7,"                            pattern row, starting from the left side.          ");
  241.     printtext(0, tb++,  7,"                                                                               ");
  242.     printtext(0, tb++,  7,"For both vibrato and portamento, if XX has the high bit ($80) set, note        ");
  243.     printtext(0, tb++,  7,"independent vibrato depth / portamento speed calculation is enabled, and YY    ");
  244.     printtext(0, tb++,  7,"specifies the divisor (higher value -> lower result and more rastertime taken).");
  245.  
  246.     printblank(0, 0, MAX_COLUMNS);
  247.     sprintf(textbuffer, "%s Online Help", programname);
  248.     printtext(0, 0, 15, textbuffer);
  249.     printtext(55, 0, 15, "Arrows/PgUp/PgDn/Home/End scroll, others exit");
  250.     printbg(0, 0, 1, MAX_COLUMNS);
  251.     fliptoscreen();
  252.     waitkeymousenoupdate();
  253.  
  254.     if (win_quitted)
  255.     {
  256.       exitprogram = 1;
  257.       break;
  258.     }
  259.  
  260.     switch(rawkey)
  261.     {
  262.       case KEY_LEFT:
  263.       case KEY_UP:
  264.       hview++;
  265.       break;
  266.  
  267.       case KEY_RIGHT:
  268.       case KEY_DOWN:
  269.       hview--;
  270.       break;
  271.  
  272.       case KEY_PGUP:
  273.       for (c = 0; c < PGUPDNREPEAT; c++)
  274.       {
  275.         hview++;
  276.       }
  277.       break;
  278.  
  279.       case KEY_PGDN:
  280.       for (c = 0; c < PGUPDNREPEAT; c++)
  281.       {
  282.         hview--;
  283.       }
  284.       break;
  285.  
  286.       case KEY_HOME:
  287.       hview = -1;
  288.       break;
  289.  
  290.       case KEY_END:
  291.       hview = -(HELP_LASTROW-MAX_ROWS+1);
  292.       break;
  293.  
  294.       default:
  295.       if (rawkey) goto EXITHELP;
  296.       break;
  297.     }
  298.  
  299.     if ((mouseb) && (mousey == 1)) hview++;
  300.     if ((mouseb) && (mousey == MAX_ROWS-1)) hview--;
  301.  
  302.     if (hview > -1) hview = -1;
  303.     if (hview < -(HELP_LASTROW-MAX_ROWS+1)) hview = -(HELP_LASTROW-MAX_ROWS+1);
  304.     if ((mouseb) && (!prevmouseb) && (!mousey)) break;
  305.   }
  306.   EXITHELP: ;
  307.   printmainscreen();
  308.   key = 0;
  309.   rawkey = 0;
  310. }
  311.  
  312.