home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 25 / amigaformatcd25.iso / websites / f1_gp / ftp / patchf1gp.lha / PatchF1GP.doc < prev   
Text File  |  1995-09-05  |  21KB  |  509 lines

  1.   PatchF1GP 1.8.2
  2.   ---------------
  3.  
  4. by Grant Reeve, 5 September 1995
  5.  
  6.  
  7. Overview
  8. --------
  9.  
  10. This  is a tiny utility that will patch into Formula One Grand Prix (and World
  11. Circuit  and  the  A600  version  of  Formula  One Grand Prix) so that it will
  12. actually  notice ALL button presses, not just the ones it feels like noticing.
  13. This  makes  gear changing a delight, rather than the pain in the arse that it
  14. was.   No  more  sticking  gears!   PatchF1GP will buffer both analog joystick
  15. buttons, both digital joystick buttons, and the space bar for keyboard users.
  16.  
  17. It now also buffers, in a different manner, the direction controls in keyboard
  18. and  digital keyboard modes.  The only time you will notice the difference, is
  19. when  you  try to do some very fine steering, ie:  when you are trying to line
  20. the  car  up perfectly for a corner at the end of the straight - now it _will_
  21. notice  those  tiny taps to the left/right controls that you do the first time
  22. you do them.  (Well, I do this, so I assume everyone else does too :) )
  23.  
  24. **  AND!   **  it can also change the timing interval between frames that F1GP
  25. uses,  so  that  if  you have GPPatch you can increase the frame rate and play
  26. some incredibly smooth F1GP!  Normally the game runs at 8 fps, but now you can
  27. run it up to 20 fps!  Yeah!  :)
  28.  
  29. This  program  also  allows  digital  joysticks  to  use  both  buttons (where
  30. available),  and  keyboard  users  to  use 2 keys to change gears.  One for up
  31. gear,  one  for  down.  Just like a real f1 car.  You can define what keys you
  32. want to change up or down gears.
  33.  
  34. And it also allows you to turn traction control on and off (with the "t" key),
  35. except  for  analog  joystick  mode, where it is fixed at off.  If you're good
  36. enough,  this  allows  you  to  go  even faster (or so some people claim).  If
  37. you're  not  good  enough  (like  me) then you'll fall off every corner due to
  38. chronic wheelspin ;-) But practice (LOTS of practice) should fix this. NEW for
  39. this  version  is  a  correction  to  the  noTC patch that makes the car steer
  40. normally with TC off, which is now legal for the Hall of Fame. Previously F1GP
  41. decided  it  wanted  to  "help" the car steer much more than usual when TC was
  42. turned  off,  allowing  you  to  basically  drive around a track with only the
  43. accelerator and brake.
  44.  
  45. F1GP normally randomly degrades the horse power of the players car by anything
  46. up  to  and  possibly over 20 horse power.  So, you think you have 716 HP, but
  47. you  might  only have 694 or something.  This is very stupid, so I remove this
  48. degrading  routine, so the HP will stay at 716 (or whatever you set it to with
  49. F1GP-Ed).  (Thanks to Rene Smit for this one.  Hi Rene!  :) )
  50.  
  51. PS:   for people who want a true sequential gearbox, but don't have a 2 button
  52. digital  joystick,  PatchF1GP  will  treat  'a' and 'z' as buttons 1 and 2, in
  53. addition to reading the normal joystick buttons, so you can have 2 button gear
  54. changes even in normal 1 button digital stick mode.
  55.  
  56. Since  F1GP-Ed  V2.99,  nearly  all  of  these patches that PatchF1GP does are
  57. included.  But  I have updated this program one more time to allow people with
  58. 1Mb machines to still get the advantages of this program, since F1GP-Ed uses a
  59. lot  more RAM than PatchF1GP. If you have F1GP-Ed V2.99 or above, don't bother
  60. using this program.
  61.  
  62.  
  63. Usage
  64. -----
  65.  
  66. PatchF1GP [dig2] [key2] [quiet] [nowindow] [tcoff] [notc] [noint]
  67.       [debounce [num]] [swapjbuttons] [kbutton1 <num>]
  68.       [kbutton2 <num>] [nohpfix] [framerate <num>] [ntsc]
  69.       [pitspdlim [km/h]] [nosundry] [noquit]
  70.  
  71. [dig2]
  72. This option turns on the 2 button digital joystick gear changing
  73.  
  74. [key2]
  75. This  option turns on the 2 key keyboard gear changing (It uses space to go up
  76. a gear, and left-amiga to go down a gear)
  77.  
  78. [quiet]
  79. This tells PatchF1GP to shut up.
  80.  
  81. [nowindow]
  82. This  tells  PatchF1GP not to open a window.  This could be useful in very low
  83. memory situations.  (saves about 5K)
  84.  
  85. [tcoff]
  86. This  tells  PatchF1GP  to  start with TC off, for those who prefer driving in
  87. this manner.
  88.  
  89. [notc]
  90. This tells PatchF1GP not to install it's TC patch.
  91.  
  92. [noint]
  93. This  tells  PatchF1GP  not  to install it's interrupt patch.  This means that
  94. there  is  no buffering, and no 2 button gear changes, since my interrupt does
  95. all  the  joystick  checking  for  my  routines.   I leave the 2 button replay
  96. routines  and  the  2  button  gear  change  routine in place, so that you can
  97. successfully view replays made with 2 button gear changes.
  98.  
  99. [debounce [num]]
  100. Some  peoples  joysticks  will  have an amount of jitter in the buttons.  This
  101. means  that  when  the button is pressed, it's state oscillates between on and
  102. off  momentarily.   This  gets  detected  by  my  patch, and causes some extra
  103. unwanted gear changes.  If you add the 'debounce' option, PatchF1GP will use a
  104. default value for getting rid of this effect (called debouncing).  The default
  105. value  is  3.   By  adding a number afterwards, you can set the exact debounce
  106. factor  you  want.  This value tells PatchF1GP how many calls to its interrupt
  107. it  should ignore after a button press or release, to allow the button time to
  108. settle.  Since the interrupt is called 50 or 60 times per second, depending if
  109. you  are  in  PAL  or  NTSC,  then this number is how many 50ths or 60ths of a
  110. second the button will be ignored for.
  111.  
  112. [swapjbuttons]
  113. Normally  in  2 button joystick mode, button 1 changes up a gear, and button 2
  114. changes down.  This option will swap those around.
  115.  
  116. [kbutton1 <num>] [kbutton2 <num>]
  117. By  default, in 2 button keyboard mode, I have set <space> to be button 1, and
  118. <left-amiga> to be button 2.  But you can tell PatchF1GP exactly what keys you
  119. prefer,  by  specifying  their rawkey codes.  For example, if you want to swap
  120. the  current  functions,  (ie:   space= down) then you would type "kbutton1 66
  121. kbutton2  40", since 66 is the rawkey code of left-amiga, and 40 is the rawkey
  122. code  of  space.  In 1 button keyboard mode, you can define what that 1 button
  123. is with kbutton1.  (default is space)
  124.  
  125. [nohpfix]
  126. This  will  cause  PatchF1GP  to  leave  F1GPs horse power degradation routine
  127. intact.
  128.  
  129. [framerate <num>]
  130. This  tells  PatchF1GP  to install a new timing interval.  If it is not on the
  131. command  line,  (or  0)  then  PatchF1GP will leave the timing as normal.  The
  132. value  of  num represents how many vertical blanks should pass between frames,
  133. so  3  would be 30 fps in NTSC mode (60/3).  (See later section for more info)
  134. (See also the ntsc option)
  135.  
  136. [ntsc]
  137. If  this  is  specified,  then  PatchF1GP will calculate an appropriate timing
  138. value  for  a  60 Hz NTSC display.  Otherwise it will assume that PAL is being
  139. used (50 Hz).
  140.  
  141. [pitspdlim [km/h]]
  142. This  is  a  half complete patch. It will limit your car to whatever speed you
  143. specify  in  the pit lane. Unfortunately the computer cars are not affected. I
  144. therefore don't think many people will use it :)
  145.  
  146. [nosundry]
  147. This  tells  PatchF1GP  not  to  install some patches that don't fall into any
  148. other category.
  149.  
  150. [noquit]
  151. This  tells PatchF1GP not to install it's quit routine, so it won't be able to
  152. detect if F1GP quits.
  153.  
  154.  
  155. run  PatchF1GP  _after_  F1GP,  and also _after_ F1GP-Ed (v2.42-V2.50 only),
  156. since  part  of  F1GP-Ed's  analog  joystick  2-button  routine is THE SAME as
  157. PatchF1GP's  digital  joystick  2-button  routine,  otherwise  PatchF1GP  will
  158. install this change, then F1GP-Ed may erase it again.
  159. Do NOT run PatchF1GP if you are running F1GP-Ed V2.99 or above.
  160. You can get PatchF1GP to run without applying any patches at all with:
  161. PatchF1GP noquit noint nosundry notc nohpfix
  162.  
  163. I used to use the following script to execute F1GP:
  164.  
  165. assign f1gp_disk_#1: ""
  166. assign f1gp_disk_#2: ""
  167. assign f1gp_disk_#3: ""
  168. assign f1gp_disk_#4: ""
  169. run >NIL: f1gp
  170. run >NIL: work:stuff/gppatch/gppatch
  171. wait 5
  172. cd work:stuff/f1gp-ed
  173. f1gp-ed >NIL: SaveToMem championship.data
  174. run >NIL: work:stuff/patchf1gp/patchf1gp debounce framerate 3 ntsc
  175.  
  176.  
  177. Quitting
  178. --------
  179.  
  180. * If PatchF1GP can't find F1GP, it will quit.
  181. * If one of PatchF1GP's patches fail, then it will quit, leaving F1GP fully
  182.   intact.
  183. * PatchF1GP  will  automatically quit a second or two after F1GP quits, unless
  184.   you specify otherwise with "noquit".
  185. * Clicking on the close window gadget will make it quit after a second or two,
  186. as  well.   Doing  this will restore all PatchF1GP's changes to their original
  187. condition.
  188.  
  189.  
  190. What it does
  191. ------------
  192.  
  193. *) button buffering:
  194.  
  195. PatchF1GP  actually buffers the button presses, so you don't miss gear changes
  196. any  more.   To  check  that  it's working, accelerate up to 6th gear, turn on
  197. autofire, and press the button for 1/4 of a second while braking.  Enjoy!  ;-)
  198. If  you  don't have autofire, just press the button really fast about 8 times.
  199. You'll well and truly end up in reverse.
  200.  
  201. PatchF1GP  can  buffer  up  to 12 button presses and releases (24 events) F1GP
  202. will read off these events at a rate of 1 per frame.  So if you manage to fill
  203. up  the  buffer,  (ie:  autofire) then it will take about 3-4 seconds to empty
  204. the buffer.  So expect your gears to go mental until then.
  205.  
  206. Warning:
  207. PatchF1GP  will still buffer button events while the game is paused!  This can
  208. cause  havoc  when  unpaused!   It  also does not clear the buffer at all, ie:
  209. pressing  autofire  to fill up the buffer, then pressing escape, is not really
  210. advised.
  211.  
  212. *) 2 button gear changing:
  213.  
  214. This is basically an add on to the buffering routine.
  215.  
  216. *) traction control:
  217.  
  218. When  you  turn  traction  control off with the "t" key, or with the brand new
  219. "traction  help"  option  in the "game option" menu, PatchF1GP basically fools
  220. F1GP  into  thinking  that  the  keyboard and digital joysticks are now analog
  221. joysticks.   "t"  will  turn  traction  control  back  on when you get sick of
  222. sliding  off  every  corner  ;-) A side effect of this patch is that it is now
  223. possible  to  change into keyboard mode from analog mode, which was previously
  224. impossible.   WARNING:  at the moment the replay routine doesn't keep track of
  225. the  state of traction control.  So a replay of you alternating between states
  226. will cause the car to end up somewhere other than it should be.
  227. Steering while TC is off is now corrected, so you can use notTC in the Hall
  228. of Fame legally now.
  229.  
  230. Frame Rate fixing
  231. -----------------
  232.  
  233. PatchF1GP  can  replace the standard timing interval between two frames with a
  234. much  shorter  one,  so  each  frame  represents a shorter interval of time to
  235. usual.   Then  it  reduces  the  number  of vertical blanks that pass before a
  236. screen  redraw,  so  that  the  game  still  runs at realtime speed, but a LOT
  237. smoother than before.  For those of you who have seen GPPatch (Hi Tony!), then
  238. you  will  know  that  you  can change the physical frame rate with the 1 to 6
  239. keys.   PatchF1GP  will  automatically  start the game at the correct physical
  240. frame rate to get real time simulation.
  241. The normal rate of 8 fps is really rather slow and chunky, but 12 fps is a lot
  242. smoother, 16 fps is a delight, and 20 fps is just amazing!  You get to see the
  243. track  moving past you, instead of just stepping past, the other cars actually
  244. are  now  seen to MOVE between points, instead of jumping large distances, and
  245. the  car  behaves  a  lot  better,  since  it is getting more calculations per
  246. second.
  247. To  put  it  simply, the game becomes INFINITELY more playable!!!!  I now play
  248. F1GP at 20 fps and I don't ever want to go back to 8!
  249.  
  250. At higher frame rates:
  251.  
  252. *  The car appears to behave more realistically (I think.  I've never driven a
  253. f1  car  before).   Slow  corners (hairpins) now behave nicely, where before I
  254. always  got  really annoyed at how the car behaved at 8 fps.  (I still fall of
  255. due  to going to fast all the time though :) ) Also, some corners become a lot
  256. more difficult, for example, at the last chicane/corner sequence at France, it
  257. is  very easy to lose all traction with the back of the car, and slide head on
  258. into the wall.
  259.  
  260. * The computer cars drive slower, depending on how high the frame rate is.  If
  261. you  have  F1GP-Ed,  you  can  multiply  the  Speed Factor (or AI grip) by the
  262. following values, and hopefully the cars will drive at about the same times as
  263. 8 fps.
  264.  
  265. fps  | Speed Factor scale
  266. -----+---------
  267. 20   | 1.0653
  268. 16.6 | 1.0341
  269. 15   | 1.0227
  270. 12.5 | 1.0114
  271. 12   | 1.0085
  272. 10   | 1.0028
  273.  
  274.  
  275. *  my  no-TC patch works much more like it does on the PC when you beef up the
  276. fps:   no  more  violent losses of control due to high wheel spin at low frame
  277. rates.  But you can still fall off corners just as easily as before :)
  278.  
  279. *  qualifying  lap  times  appear to be exactly the same.  ie:  no weird speed
  280. increases, or decreases.  Which is good for competing in championships and the
  281. Hall Of Fame.
  282.  
  283. WARNING:   Replays  made at different frame rates just don't work very well at
  284. all.   So, if you make a replay, you MUST play it back at that exact same fps,
  285. or  all  the calculations will stuff up, and results in all the cars ending up
  286. in  strange  places.   Also,  continuing a game which was saved at a different
  287. frame rate will result in the air resisitance being incorrect.
  288.  
  289. WARNING:   Do  not  change  the  frame  rate  in  the middle of a race/driving
  290. session.   You  must  go back out to the main menu before you change it, since
  291. the  game  calculates  some  values  from  the  time constant when it enters a
  292. race/driving session.
  293.  
  294. How to get the frame rate you want.
  295.  
  296. Look  down  the  fps list on the right of the table below, and find an fps you
  297. want to use.  I advise not using 25 fps or above due to some weird bugs.  Then
  298. get  F1GP  to  use  the  appropriate  screenmode,  then run PatchF1GP with the
  299. framerate value on the same row (and possibly the ntsc option).
  300. Now you drive, and enjoy!!!!
  301.  
  302. PatchF1GP |    resulting fps
  303. framerate |   PAL        NTSC
  304.   value   | (no ntsc)   (ntsc)
  305. ----------+-------------------
  306.     1     |   50          60
  307.     2     |   25          30
  308.     3     |   16.6        20 <- me
  309.     4     |   12.5        15
  310.     5     |   10          12
  311.     6     |   8.3         10
  312.     7     |   -           8.5
  313.  
  314. I  use  20  fps,  in  NTSC, but I drive with the detail level at minimum on my
  315. 4000/040, because in some high detail areas the fps will drop a bit at maximum
  316. detail (ie:  pit lane, street cricuits, Hockenheim straights)
  317.  
  318. Here  is a small table of around the maximum performance you can expect to get
  319. out of various machines while at minimum detail.
  320.  
  321. Computer   CPU  MHz | fps
  322. --------------------+-----
  323. 4000      68040  25 |  20
  324. 1200      68030  50 |  16.7/20
  325. 1200      68020  14 |  12.5/15
  326. 500/600   68000   7 |  8/10
  327.  
  328. If  you  have a standard 500 or 600, you can use 10 fps, but the game may slow
  329. down  a  little.  It is probably worth the difference in playability though to
  330. go to 10 fps.  (hairpins are nicer for example)
  331.  
  332.  
  333. Bugs
  334. ----
  335.  
  336. *  If  you  run  the  game  at 25 fps or above, then in go into race mode, and
  337. sometimes  in  other  modes, the car will spin to its left around its axis.  I
  338. have no idea why it does this at the moment.  But, 20 fps works fine.
  339.  
  340. *  If  you are using my interrupt routines, and using autogears, then you will
  341. find  that when the car is in neutral, and you push forward, the car will gear
  342. down  into reverse, instead up into 1st.  This is very annoying.  My suggested
  343. solution  is  to  run PatchF1GP with the "noint" option if you use auto-gears.
  344. (But you then miss all the buffering features)
  345.  
  346.  
  347. Bug reports
  348. -----------
  349.  
  350. If you find a bug, then e-mail me at:
  351.  
  352. reeve1@lucy.cs.waikato.ac.nz
  353.  
  354. and tell me all about it.  What your system is, what version of F1GP you have,
  355. what you've done to it, etc.  etc.
  356.  
  357.  
  358. Compatability
  359. -------------
  360.  
  361. PatchF1GP has been tested on the following machines:
  362. 4000/040   - 10MB ram (my machine)
  363. 1200       - standard
  364. 1200       - 50 Mhz 68030 with fastram
  365. 500+       - 2MB chipram (my old machine that lives in the closet)
  366. 2000       - 50MHz 68030 accellerated
  367. 500        - standard (1MB ram)
  368.  
  369. It has been found to be pretty much fully compatible with GPPatch, and F1GP-Ed
  370. (up to but not including V2.99) Don't run it if you are using F1GP-Ed V2.99 or
  371. above.  It  should be run after F1GP-Ed V2.42 and upwards if you are not using
  372. the latest version though.
  373. It will have a minor incompatability with the quitting routines of SplitTime,
  374. and GPPerf (also by me but not released at this date), but if you are running
  375. these programs too, then you have more than 1Mb ram, and should get F1GP-Ed
  376. V3.whatever, which has no problem.
  377.  
  378.  
  379. Future
  380. ------
  381.  
  382. This  patch  doesn't  have much future. It does everything I want it to. Other
  383. patches  I  am  writing  will  either  go  into  F1GP-Ed,  or will be seperate
  384. programs.  I am not going to release any new versions, unless I happen to come
  385. accross a fix for either of the bugs listed above.
  386.  
  387.  
  388. Thanks
  389. ------
  390.  
  391. Many  thanks  go  to  Oliver  Roberts, for lending me the code to find F1GP in
  392. memory, + some ideas and beta testing.
  393. Also to Edo Nijmeijer for beta testing + ideas.
  394. And  also  to  Rene  Smit  for  beta testing + tons of ideas + replays of some
  395. bloody fast traction control-less driving for me to drool over.
  396.  
  397.  
  398. The Author (me)
  399. ---------------
  400.  
  401. I  am  a  21  year old 3rd year Comp-Math student at Waikato University in New
  402. Zealand.   I  occaisonally  do  some  uni study but mainly muck around with my
  403. computer  (F1GP,  Roketz,  programming  stuff,  or answering e-mail), and read
  404. really cool sci-fi/fantasy books with whatever left over time I have.
  405.  
  406. I hope you find this program useful, because I did :)
  407.  
  408.  
  409. History
  410. -------
  411.  
  412. V1.0  6 Feb 1995     (9420 bytes)
  413. ---------------------------------
  414.  
  415. * First real release. Sent to Edo Nijmeijer for beta testing.
  416. * Fixed problem where the interrupt didn't buffer on anything below a 68040 :)
  417.  
  418.  
  419. V1.1  15 Feb 1995    (10084 bytes)
  420. ----------------------------------
  421.  
  422. * Added cute messages to the window
  423. *  Enabled  'unpatching' so if PatchF1GP is quit via the closewindow gadget it
  424.   will restore  any  changes  it  made.  (Thanks  to  Edo  Nijmeijer for these
  425.   suggestions)
  426. * Gave the source code a slight work-over.
  427.  
  428.  
  429. V1.2  2 Mar 1995     (10252 bytes)
  430. ----------------------------------
  431.  
  432. * Added 2 key keyboard gear changing ability.
  433.  
  434.  
  435. V1.3  23 Mar 1995    (10496 bytes)
  436. ----------------------------------
  437.  
  438. * Added CPU detection for default interrupt speed selection.
  439. * Added 'nowindow' keyword.
  440. * Improved the 1 button digital joystick routines
  441.  
  442.  
  443. V1.4  12 Apr 1995    (14692 bytes)
  444. ----------------------------------
  445.  
  446. After some prompting from Rene Smit:
  447. * Added traction control state switching in game with "t" key
  448. * Added "traction help on/off" to the "game options menu"
  449. * Enabled keyboard mode switching when in analog joystick mode
  450. * Fixed CPU detection so that a 68000 gets a "fast" interrupt patch
  451.  
  452.  
  453. V1.5   1 May 1995    (15452 bytes)
  454. ----------------------------------
  455.  
  456. * Changed the name from PatchIt to PatchF1GP.
  457. *  Fixed  up  the  replay  routines  so  that they keep track of 2 button gear
  458.   changes correctly.
  459.  
  460.  
  461. V1.6   4 May 1995    (15440 bytes)
  462. ----------------------------------
  463.  
  464. *  Removed  a  very  very stupid bug from the replay routine fix I did in V1.5
  465.   that  caused  all  replays  made  before  V1.5  to  only  change  up  gears.
  466.   Unfortunately any replays  made  with  V1.5  will  probably have gear change
  467.   problems when playing back (unless you use V1.5 :) )
  468.  
  469.  
  470. V1.7  18 May 1995    (15924 bytes)
  471. ----------------------------------
  472.  
  473. * PatchF1GP now patches WC and the A600 version of F1GP. :)
  474. *  At  the  urging  of  Oliver  Roberts,  I  made  PatchF1GP  a lot more space
  475.   efficient.  Despite adding a whole pile of new stuff, the code size has only
  476.   gone up 500 bytes.
  477. * Fixed a minor bug in the auto-interrupt-speed-detection routine.
  478. * Added new commandline options: tcoff, notc, noint.
  479. * Lots of general code cleanup.
  480.  
  481.  
  482. V1.8  23 June 1995   (11520 bytes)
  483. ----------------------------------
  484.  
  485. * Added much more efficient method of detecting when F1GP quits.
  486. * Implemented software joystick button debouncing.
  487. *  In a fit of efficiency, optimized a whole lot of things (including removing
  488.   all  those  patching messages), resulting in a saving of about 4K disk space
  489.   and  about  12K  ram  :)  Now  it should work better on 1Mb systems (no more
  490.   crashes due to lack of ram).
  491. *  Added  some  more  buffering,  this  time to the directions in keyboard and
  492.   digital  joystick  modes,  so that delicate fine directional manoeuvres will
  493.   get noticed.
  494. * Added command line options: swapjbuttons, kbutton1, and kbutton2.
  495. * Fixed a whole lot of complete rubbish code to do with analog sticks
  496. * Added a patch that will turn off f1gp's horsepower degradation.
  497. * Added the frame rate fix.
  498. * Now PatchF1GP will start F1GP at the correct real frame rate too.
  499. *  Now  PatchF1GP  patches  into the VBlank interrupt, so the fast/medium/slow
  500.   options have been removed.
  501.  
  502.  
  503. V1.9  5 September 1995   (12112 bytes)
  504. --------------------------------------
  505.  
  506. * Fixed the bug in the steering when TC was off.
  507. * Added a pit speed limit for the players car.
  508. * Added some extra command line options.
  509.