home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 100 / af100b.adf / patches.lzx / F1GP / PatchF1GP.doc < prev   
Text File  |  1995-09-17  |  18KB  |  486 lines

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