Meta tags:
author= Mark Moxon;
description= Fully documented source code disassembly for Acornsoft Aviator on the BBC Micro, with lots of deep dive articles explaining how every aspect of the game works.;
Headings (most frequently used words):
the, aviator, on, bbc, micro, code, for, fully, documented, source, suggestions, your, visit, if, you, want, to, play, with, similar, projects, 100, handcrafted,
Text of the page (most frequently used words):
the (575), and (140), for (136), part (134), line (70), #aviator (52), code (51), indicator (47), point (46), #source (44), byte (42), high (38), alien (37), that (34), object (34), coordinates (31), main (30), screen (30), variables (28), this (28), draw (28), coordinate (28), calculate (27), game (26), process (26), are (25), update (24), from (23), start (22), set (21), bit (21), key (21), lines (20), canopy (20), low (20), check (19), points (18), whether (18), objects (18), with (17), number (17), aliens (17), calculations (17), flight (17), value (17), colour (17), plane (17), bbc (16), micro (16), subroutines (16), each (16), bytes (16), pixel (16), list (15), all (15), which (15), loop (15), storage (15), mainloop (15), updateindicator (15), how (15), runway (14), score (14), you (14), out (13), visibility (13), can (13), routines (13), sound (13), lookup (13), table (13), buffer (13), site (13), more (12), into (12), vector (12), make (12), flying (12), drawing (12), any (11), one (11), numbers (11), have (11), current (11), dashboard (11), setobjectcoords (11), end (10), move (10), matrix (10), scale (10), variable (9), random (9), working (9), when (9), feeding (9), landing (9), two (9), radar (9), right (9), using (9), apply (9), model (9), hand (9), drawcanopyline (9), project (9), fully (9), mark (8), moxon (8), every (8), used (8), its (8), down (8), next (8), four (8), forces (8), group (8), about (8), processline (7), new (7), hit (7), bullets (7), been (7), theme (7), engine (7), keys (7), multiply (7), presses (7), fuel (7), matrices (7), processlanding (7), applyflightmodel (7), slope (7), indicators (7), want (7), documented (7), software (6), archaeology (6), other (6), workspaces (6), they (6), distance (6), visible (6), linestohide (6), reset (6), horizon (6), acornsville (6), status (6), through (6), off (6), their (6), turn (6), under (6), logger (6), undercarriage (6), converting (6), graphics (6), vertical (6), clipped (6), drawclippedline (6), logic (6), pre (6), sites (5), category (5), indexes (5), workspace (5), routine (5), page (5), behind (5), processrunwayline (5), processing (5), specified (5), copy (5), tables (5), shown (5), starting (5), work (5), various (5), updatealiens (5), cycle (5), not (5), ground (5), adjust (5), vdu (5), edges (5), skills (5), display (5), multiplication (5), nibble (5), left (5), division (5), scaled (5), add (5), fire (5), joystick (5), read (5), top (5), stalling (5), rotation (5), delta (5), clipstartofline (5), checking (5), map (5), deep (5), your (5), details (4), writing (4), acorn (4), index (4), entry (4), temporary (4), linestoshow (4), moving (4), clip (4), return (4), extract (4), them (4), along (4), just (4), too (4), time (4), slots (4), dormant (4), slot (4), print (4), way (4), making (4), thrust (4), view (4), skill (4), sine (4), values (4), scaledown (4), factors (4), maths (4), stores (4), counter (4), fill (4), related (4), first (4), position (4), flaps (4), address (4), standard (4), rudder (4), updateflightmodel (4), taxiing (4), use (4), direction (4), artificial (4), deltas (4), world (4), geometry (4), files (4), original (4), dive (4), articles (4), very (4), good (4), projects (4), contact (3), land (3), lander (3), archimedes (3), sentinel (3), revs (3), elite (3), where (3), subroutine (3), jump (3), stack (3), adding (3), result (3), bullet (3), multi (3), correct (3), calculating (3), within (3), axis (3), randomnumbers (3), delay (3), call (3), message (3), stage (3), exploding (3), killing (3), turbulence (3), towards (3), eight (3), town (3), scores (3), stages (3), has (3), award (3), accordingly (3), free (3), there (3), attack (3), change (3), weak (3), create (3), see (3), pitch (3), volume (3), envelope (3), gunfire (3), command (3), most (3), clear (3), testing (3), checks (3), bridge (3), street (3), fit (3), different (3), amount (3), tank (3), keytable2 (3), keytable1 (3), keyboard (3), elevator (3), logical (3), movement (3), restrict (3), pitching (3), roll (3), then (3), over (3), velocity (3), convert (3), aerodynamic (3), applyaerodynamics (3), spitfire (3), max (3), min (3), erasing (3), modify (3), erase (3), drawvectorline (3), horizontal (3), depending (3), maximum (3), altimeter (3), slip (3), single (3), relative (3), anchor (3), projectpoint (3), exploring (3), what (3), like (3), play (3), history (3), development (3), useful (3), building (3), commentary (3), crammond (3), find (3), but (3), computers (3), handcrafted (3), 100 (3), might (3), homepage (2), tubewalker (2), tube (2), foot (2), walking (2), john (2), groats (2), travel (2), 6502 (2), cross (2), usage (2), analysis (2), click (2), show (2), important (2), blocks (2), furthest (2), aren (2), outline (2), dashes (2), onto (2), rotating (2), item (2), xtemp1 (2), centiseconds (2), since (2), late (2), explosion (2), get (2), state (2), three (2), ready (2), ids (2), air (2), wave (2), size (2), take (2), does (2), yet (2), spot (2), checkifalienishit (2), close (2), guns (2), sounds (2), data (2), airspeed (2), explosions (2), image (2), cursor (2), terminate (2), lower (2), memory (2), around (2), setting (2), zone (2), text (2), increase (2), destroying (2), remove (2), perform (2), checkflyingskills (2), times (2), shifting (2), places (2), doesn (2), bits (2), scaleup (2), sign (2), dividescaled (2), unsigned (2), signs (2), addition (2), during (2), stop (2), core (2), internal (2), priority (2), scanned (2), second (2), scan (2), axes (2), aileron (2), brakes (2), plot (2), black (2), multiple (2), rows (2), leaving (2), alone (2), pixels (2), corners (2), batch (2), level (2), going (2), faster (2), than (2), crashing (2), effects (2), iterations (2), xlinear (2), applyturnandthrust (2), dxturn (2), rate (2), aircraft (2), controls (2), centre (2), before (2), aerodynamics (2), dial (2), bar (2), our (2), steep (2), shallow (2), compass (2), range (2), minute (2), blip (2), gauge (2), cycling (2), hide (2), calculation (2), dials (2), setobjpointcoords (2), projected (2), addtemptopoint (2), hidden (2), commented (2), annotated (2), versions (2), version (2), information (2), makes (2), miscellaneous (2), secrets (2), trigonometry (2), addresses (2), smooth (2), animation (2), many (2), between (2), clock (2), wings (2), recovery (2), dives (2), works (2), hood (2), playing (2), links (2), own (2), explore (2), terminology (2), came (2), quick (2), guide (2), home (2), visit (2), tools (2), some (2), modern (2), disc (2), functionality (2), old (2), may (2), isn (2), try (2), keep (2), don (2), place (2), also (2), interested (2), repository (2), emulator (2), contains (2), buildable (2), straight (2), who (2), geoff (2), reconstructed (2), instruction, counts, stats, statistics, label, references, analyses, above, mainly, lot, zero, share, block, collections, maxobjdistance, maxlinedistance, updatelinestoshow, showorhideline, lists, resetlinelists, portion, construct, middle, projecting, processlinestoshow, unprocessed, processlinestohide, final, transforming, processhorizonline, checkobjdistance, checklinedistance, keeping, pointer, setrandomnumber, resetvariable, nextrandomnumber, loops, copyworktopoint, ytemp1, ztemp1, copytemptopoint, copypointtowork, flag, passed, last, checktimepassed, copying, generators, utility, toolatetext, hittimer, hitobjectid, currently, feedingstage, explodeto, explodefrom, dormantalienscore, distancefromhit, iteration, alientomove, alienstatus, alienstate, alienslot, alienscore, alienobjectid, updatebullets, whole, destroyed, reaches, double, waiting, promote, manage, vacancy, wake, progress, cycles, enabled, spawn, spawnalien, grows, bigger, feeds, resizefeedingalien, column, row, printtoolate, trail, gettrailvectorstep, getalienweakspot, send, fireguns, explode, split, apart, explodealien, initiate, enough, hitting, checkalienweakspot, reached, alieninacornsville, tactics, while, sounddata26, osword, sounddata, envelopes, envelopedata, toggleenginesound, resetenginesound, pressed, processvolumekeys, either, makesoundenvelope, makesound, choppiness, affected, makeenginesound, define, defineenvelope, please, wait, loads, pleasewaittext, string, loading, loaddashboard, disabling, disablecursor, terminategame, startgame, mode, load, setupscreen, prepare, resetvariables, newgame, rivets, drawcanopy, setup, sizes, zones, skillzonesize, skillzonelo, skillzonehi, scoretext, scorelo, scorehi, highscorelo, highscorehi, updatescore, updatehighscore, beep, scorepoints, required, scorehitpoints, removescore, showing, printscoretext, printscore, displayscore, finer, performing, tests, safely, checkbridgeandtown, awarding, buzzing, scoring, timestable, sinlo, sinhi, shift4right, shift4left, matrix4lo, matrix4hi, matrix3lo, matrix3hi, matrix2lo, matrix2hi, matrix1lo, matrix1hi, lownibble, highnibble, divisionlo, divisionhi, sine16bit, until, retaining, sensitivity, smaller, scalesigned, balance, results, divisions, done, negate, negate16bit, multiply8x8, multiply8x16, multiply4x16, multiply16x16mix, multiply16x16bit0, multiply16x16, divide, subtract, addscaled, add16x16bit0, subtraction, only, timely, fashion, previoustime, mainloopcounter, handle, spend, least, successful, switched, enable, increment, invaded, firing, appropriate, statuses, runs, keytable2lo, keytable2hi, keytable1lo, keytable1hi, updatekeylogger, toggle, togglejoystick, specific, scankeyboard, button, readjoystick, adc, channels, readadcchannel, processotherkeys, joysticks, ylookuplo, ylookuphi, xlookuplo, xlookuphi, vdupoint, vduplot, vdumove, vdudraw, physical, setlogicalcolour, white, setcolourtowhite, setcolourtoblack, flip, colourcycle, colourlogic, flipcolours, particular, avoiding, fillcanopyrows, fillcanopy, square, rivet, across, drawrivet, gun, sights, drawgunsights, drawcanopyview, diagonal, drawcanopycorners, clearrows, clearcanopy, general, clearing, signed, powers, scalefactor, fuelusedlo, fuelusedhi, fuellevel, multiplied, scaling, forcefactor, moved, axischangerate, brake, throttle, control, setengine, relevant, scaleflightforces, altitude, scalebyaltitude, retract, 150, mph, retractflapsiffast, successfully, touched, without, tilt, backwards, touching, emergency, bumpy, rolling, yawing, moments, due, yaw, rates, getmoments, 65th, full, fillupfueltank, flash, crash, checkplaneonrunway, ylinear, zlinear, dyturn, dzturn, rotate, according, vectors, sliprate, near, perspective, effect, gravity, springs, primary, ailerons, implement, instant, feature, applyflightcontrol, bumpiness, applybumpyride, figures, simulate, wing, adjustvelocity, adjustturn, adjustrotation, realistic, linebufferw, linebufferv, linebuffert, linebuffers, linebufferr, linebufferg, colour2row, colour2r2l, colour2l2r, colour1row, colour1r2l, colour1l2r, swaplinepoints, modifydrawroutine, erasecanopylines, step, orthogonal, drawortholine, drawjoystickcross, drawindicatorline, limits, drawindicatorhand, drawindicatorbar, half, drawhalfhorizon, was, edge, steepness, completely, best, clipbestendofline, yradarbuffer, yjoycoord, ydeltamax, xradarbuffer, xjoycoord, xdeltamax, heading, later, previouscompass, joycoord, minimum, indicatormin, indicatormax, indicatorlinev, indicatorlineu, indicatorlinet, indicatorlinej, indicatorlinei, base, indicatorbase, indicator7to11, indicator0to6, quadrant, dialquadrant, large, altitudeminutes, updateradarblip, bottom, speed, small, hour, updatefuelgauge, subsequent, updatedashboard, upside, showupsidedownbar, resetradar, indicatoru, indicatort, indicatorf, indicatorb, dot, getradarvector, gethandvector, drawradarblip, drawfuelpixel, artificialhorizon, radars, zpointhi, zobjectpoint, zobjectlo, zobjecthi, zgroupobjecthi, yobjectpoint, yobjectlo, yobjecthi, 255, xtemppoint2hi, 254, xtemppoint1hi, xpointhi, xobjectpoint, xobjectlo, xobjecthi, 252, xlinearhi, xgroupobjecthi, 253, xgravityhi, sequences, together, objectpoints, objectgroup, total, numberoflines, linestartpointid, lineendpointid, groupstart, indicate, calculated, setpointvisibility, origin, setpointtoorigin, setpointcoords, setpoint, factor, setobjecttoorigin, applicable, groups, location, setmatrixentry, setmatrices, angles, projectaxisangle, nextobjectgroup, overflowed, store, another, overflows, addpointtoobject, transformations, configuration, overview, structured, file, snippets, tell, clues, binary, sure, press, gets, recorded, loggers, generates, cosine, inside, algorithms, arithmetic, thing, scheduling, tasks, sequence, events, program, flow, task, scheduler, caching, buffers, colours, super, animated, flicker, serious, consequences, spots, detecting, hits, spawning, leave, tracer, trails, sky, planning, civilisation, life, growth, patterns, everything, tailored, fast, hard, coded, hands, bridges, behaviour, dangerous, parts, offs, landings, modelling, rip, clean, ripping, simulates, tracking, features, mentioned, manual, matching, simulation, simulating, deciding, frames, reference, translating, space, lie, heart, reconstructing, placing, manages, trees, hills, towns, fundamental, elements, discover, weaves, magic, analysed, here, 21st, century, could, benefit, website, short, giants, whose, shoulders, stands, acknowledgements, collection, pages, found, build, story, need, know, beginning, written, geoffrey, acornsoft, 1983, rights, reserved, 2021, course, built, typically, emulators, imagers, replicate, rather, providing, themselves, obviously, exist, disassemblies, hacks, love, fact, things, help, manuals, simple, environment, happy, delegate, being, honest, reason, attractions, possible, person, understand, layer, electrons, gates, ics, cpus, operating, systems, classic, games, commanders, electron, commodore, apple, nes, similar, produce, loaded, experiment, assembled, enjoy, accompanying, github, prefer, lighter, explorations, scheme, clicking, icons, corner, knows, jumping, though, explain, these, notes, lots, browser, journey, following, suggestions, note, hasn, released, instead, lovingly, disassembly, binaries, produces, identical, names, invention, itself, matches, hope, will, those, learn, tick, provided, educational, non, profit, basis, aim, helping, people, appreciate, sim, legend, gaming, simulations, epic, simulator, explained, skip, navigation,
Text of the page (random words):
pixel coordinates to screen addresses going from x y coordinates to screen memory addresses line buffers caching line information for faster erasing main loop the main game loop and task scheduler main loop program flow of the main game loop the sequence of events in the main game loop scheduling tasks in the main loop how aviator does the right thing at the right time maths multiplication trigonometry and random numbers maths times tables and nibble arithmetic inside aviator s multiplication algorithms trigonometry calculating sine and cosine in the rotation matrices random numbers how aviator generates random numbers miscellaneous key loggers and code secrets miscellaneous the key logger making sure that every key press makes gets recorded multi byte variables how aviator stores multi byte variables source code clues hidden in the game binary snippets of original source code and what they can tell us exploring the aviator source code aviator source code annotated source of bbc micro aviator version information about the version of aviator on this site details of the different versions of aviator aviator source code by file map of the source code an overview of how the source code for aviator is structured annotated source files the fully commented source files aviator source files workspaces and configuration the main variable workspaces used in aviator aviator a source part 1 of the main game code aviator b source part 2 of the main game code aviator c source part 3 of the main game code aviator d source part 4 of the main game code aviator e source part 5 of the main game code aviator f source part 6 of the main game code aviator source code by category 3d geometry rotation matrices coordinate transformations object calculations and more subroutines addpointtoobject add a point vector to an object s coordinates addtemptopoint part 1 of 2 add the xtemp1 vector to a point store the result in another point and set the result to hidden if it overflows addtemptopoint part 2 of 2 check whether the vector addition overflowed and set the point s visibility accordingly nextobjectgroup cycle to the next object group projectaxisangle convert the rotation angles of the plane into coordinates projectpoint part 1 of 3 project a point onto the screen i e convert from 3d coordinates to screen coordinates projectpoint part 2 of 3 calculate the screen coordinates of the projected point projectpoint part 3 of 3 move the projected coordinates to the centre of the screen and update the point s status byte setmatrices set up matrices 1 to 4 setmatrixentry calculate a matrix entry setobjectcoords part 1 of 11 calculate the coordinates for an object s location setobjectcoords part 2 of 11 pre process the bullets objects 12 13 14 or 15 setobjectcoords part 3 of 11 logic for checking which objects to pre process setobjectcoords part 4 of 11 pre process the object groups objects 6 7 8 or 9 setobjectcoords part 5 of 11 logic for checking which objects to pre process setobjectcoords part 6 of 11 pre process dormant aliens object group 30 setobjectcoords part 7 of 11 pre process feeding and flying aliens objects 31 32 and 33 setobjectcoords part 8 of 11 process the object setobjectcoords part 9 of 11 process the next object in the group if applicable or return from the subroutine if not setobjectcoords part 10 of 11 process the next dormant alien object group 30 setobjectcoords part 11 of 11 update the object status and return from the subroutine setobjecttoorigin set an object s coordinates to 0 0 0 setobjpointcoords part 1 of 2 calculate the coordinate for a point within an object setobjpointcoords part 2 of 2 apply the correct scale factor to the matrix multiplication setpoint set a point s coordinates to the value a a a setpointcoords calculate the coordinates for a point setpointtoorigin set a point s coordinates to the origin at 0 0 0 setpointvisibility set the status byte for multiple points to indicate that their coordinates and visibility have been calculated variables groupstart the starting value for each object s group number lineendpointid the point id for a line s end point linestartpointid the point id for a line s start point numberoflines the total number of lines in aviator s 3d world objectgroup the current group number for object ids 6 7 8 and 9 objectpoints sequences of related points that together make up objects xgravityhi high byte of point 253 x coordinate xgroupobjecthi high byte of the x coordinate for objects in a group 6 to 9 xlinearhi high byte of point 252 x coordinate xobjecthi high byte of the x coordinate for an object xobjectlo low byte of the x coordinate for an object xobjectpoint scaled x coordinates of the points that make up objects relative to the object s anchor point xpointhi high byte of the x coordinate for a point xtemppoint1hi high byte of point 254 x coordinate xtemppoint2hi high byte of point 255 x coordinate yobjecthi high byte of the y coordinate for an object yobjectlo low byte of the y coordinate for an object yobjectpoint scaled y coordinates of the points that make up objects relative to the object s anchor point zgroupobjecthi high byte of the z coordinate for objects in a group 6 to 9 zobjecthi high byte of the z coordinate for an object zobjectlo low byte of the z coordinate for an object zobjectpoint scaled z coordinates of the points that make up objects relative to the object s anchor point zpointhi high byte of the z coordinate for a point dashboard dials indicators radars and flight controls subroutines artificialhorizon vector line calculation for the artificial horizon on indicator 7 drawfuelpixel draw or erase a pixel on the fuel gauge on the dashboard drawradarblip draw a blip on the radar runway or alien gethandvector vector line calculation for a hand on indicators 0 to 6 getradarvector calculate the radar line vector for a line the runway or a dot an alien indicatorb update the brakes indicator b indicatorf update the flaps indicator f and related variables indicatort update the theme indicator t indicatoru update the undercarriage indicator u and related variables resetradar reset the radar display showupsidedownbar show or hide the upside down bar in the artificial horizon indicator updatedashboard update two indicators on the dashboard one from 0 6 one from 7 11 cycling through them with each subsequent call updatefuelgauge update the fuel gauge every 16 iterations of the main loop updateindicator part 1 of 15 update a single indicator on the dashboard updateindicator part 2 of 15 calculations for the compass indicator 0 updateindicator part 3 of 15 calculations for the airspeed indicator indicator 1 updateindicator part 4 of 15 calculations for the altimeter s small hour hand indicator 2 updateindicator part 5 of 15 calculations for the altimeter s minute hand indicator 3 updateindicator part 6 of 15 logic for checking which indicator to update updateindicator part 7 of 15 calculations for the vertical speed indicator indicator 4 updateindicator part 8 of 15 logic for checking which indicator to update updateindicator part 9 of 15 calculations for the turn indicator indicator 5 the bottom part of the slip and turn indicator updateindicator part 10 of 15 calculations for the slip indicator indicator 6 the top part of the slip and turn indicator updateindicator part 11 of 15 calculations for the artificial horizon indicator 7 updateindicator part 12 of 15 logic for checking which indicator to update updateindicator part 13 of 15 calculations for the rudder indicator indicator 9 updateindicator part 14 of 15 calculations for the joystick position display indicator 8 or 10 updateindicator part 15 of 15 calculations for the thrust indicator indicator 11 updateradarblip update a blip on the radar runway or alien variables altitudeminutes the value of the altimeter s large minute hand dialquadrant the value range of a quadrant in each indicator indicator0to6 the first indicator counter indicator7to11 the second indicator counter indicatorbase the base value for each indicator indicatorlinei line buffer storage for the start x coordinate for each indicator line i indicatorlinej line buffer storage for the start y coordinate for each indicator line j indicatorlinet line buffer storage for the indicator line s x delta t indicatorlineu line buffer storage for the indicator line s y delta u indicatorlinev line buffer storage for the indicator line s direction v indicatormax the maximum value shown on each indicator indicatormin the minimum value shown on each indicator joycoord temporary storage previouscompass stores the value of the compass heading when we draw the runway on the radar so we can erase the line later xdeltamax the maximum x delta for the hand line in each indicator xjoycoord temporary storage xradarbuffer the x coordinates of the runway and alien on the radar ydeltamax the maximum y delta for the hand line in each indicator yjoycoord temporary storage yradarbuffer the y coordinates of the runway and alien on the radar drawing lines the core line drawing routines subroutines clipbestendofline clip a line at the start or end point depending on which is best clipstartofline part 1 of 5 check whether the line is completely off screen clipstartofline part 2 of 5 work out the deltas depending on the direction of slope clipstartofline part 3 of 5 work out the deltas depending on the steepness of slope clipstartofline part 4 of 5 calculate where to clip the line clipstartofline part 5 of 5 move the start point to the clipped position and return it drawcanopyline part 1 of 9 draw a line in the canopy view drawcanopyline part 2 of 9 modify the line drawing routine for a shallow horizontal slope drawcanopyline part 3 of 9 draw a line as a shallow horizontal slope drawcanopyline part 4 of 9 draw a part of the line working down the screen drawcanopyline part 5 of 9 draw a part of the line working up the screen drawcanopyline part 6 of 9 draw a part of the line working along the screen drawcanopyline part 7 of 9 modify the line drawing routine for a steep vertical slope drawcanopyline part 8 of 9 draw a line as a steep vertical slope drawcanopyline part 9 of 9 if the line was clipped draw a line from the clipped coordinates to the edge of the screen drawclippedline part 1 of 6 clip a line to fit on screen starting with the line deltas drawclippedline part 2 of 6 work out whether the line s start point is on screen drawclippedline part 3 of 6 work out whether the line s end point is on screen drawclippedline part 4 of 6 calculate the starting point and direction for our clipped vector line drawclippedline part 5 of 6 calculate the deltas for our clipped vector line drawclippedline part 6 of 6 add the clipped line to the line buffer and draw it drawhalfhorizon draw half of the horizon line drawindicatorbar draw a vertical bar on indicator 9 rudder or 11 thrust drawindicatorhand apply min and max limits to an indicator value and draw a hand on the indicator drawindicatorline draw a line on indicators 0 to 7 i e a dial hand 0 6 or an artificial horizon 7 drawjoystickcross draw a cross in the joystick position display indicator 8 or 10 drawortholine draw an orthogonal line i e vertical or horizontal drawvectorline part 1 of 3 draw a line set up pixel bytes and slope variables drawvectorline part 2 of 3 calculate the coordinates of the next pixel as we step along the line by one pixel drawvectorline part 3 of 3 plot a pixel at i j erasecanopylines draw all the lines from a line buffer to erase them modifydrawroutine modify the drawing routines to draw in the correct colour for the current colour cycle swaplinepoints copy an end point into a start point variables colour1l2r pixel bytes for drawing canopy lines left to right in colour 1 colour1r2l pixel bytes for drawing canopy lines right to left in colour 1 colour1row pixel bytes for erasing canopy lines in colour 1 colour2l2r pixel bytes for drawing canopy lines left to right in colour 2 colour2r2l pixel bytes for drawing canopy lines right to left in colour 2 colour2row pixel bytes for erasing canopy lines in colour 2 linebufferg line buffer storage for the max min y coordinate g linebufferr line buffer storage for the start x coordinate r linebuffers line buffer storage for the start y coordinate s linebuffert line buffer storage for the line s x delta t linebufferv line buffer storage for the line direction v linebufferw line buffer storage for the max min x coordinate w flight model the aerodynamics behind the spitfire s realistic movement through the air subroutines adjustrotation move the plane and adjust its rotation adjustturn adjust the plane s turn rate adjustvelocity adjust the plane s velocity vector applyaerodynamics part 1 of 3 set up various variables to use in the aerodynamics calculations applyaerodynamics part 2 of 3 check whether the plane is stalling and if it is simulate one wing stalling before the other and make the stalling sound applyaerodynamics part 3 of 3 calculate various aerodynamic figures applybumpyride apply a random amount of roll or bumpiness to the plane applyflightcontrol calculate the effects of the primary flight controls elevator rudder and ailerons and implement the instant centre feature applyflightmodel part 1 of 7 apply the flight model to the plane starting by calculating the effect of gravity and the undercarriage springs applyflightmodel part 2 of 7 convert velocity to the plane s perspective and calculate various aerodynamic forces applyflightmodel part 3 of 7 if we are near to an exploding alien apply turbulence applyflightmodel part 4 of 7 calculate the dxturn and xlinear vectors and the sliprate applyflightmodel part 5 of 7 calculate the forces for when we are on the ground applyflightmodel part 6 of 7 adjust the plane s velocity and turn rate rotate the plane according to the forces on the aircraft process landing applyflightmodel part 7 of 7 calculate fuel usage applyturnandthrust part 1 of 2 calculate the dxturn dyturn dzturn vector applyturnandthrust part 2 of 2 calculate the xlinear ylinear zlinear vector checkplaneonrunway check whether the plane is over the runway crash make a crashing sound flash the canopy and start a new game fillupfueltank fill up the fuel tank by 1 65th of a full tank every four iterations of the main loop getmoments calculate the pitching rolling and yawing moments due to the current pitch roll and yaw rates processlanding part 1 of 7 if this is an emergency landing make the landing a bumpy one processlanding part 2 of 7 if we are too high to be touching the ground then we can t be landing so stop the landing checks processlanding part 3 of 7 if we are taxiing restrict the plane s vertical movement and roll processlanding part 4 of 7 if we are taxiing with the undercarriage up restrict pitching processlanding part 5 of 7 if we are taxiing with the undercarriage down restrict pitching and tilt the plane backwards processlanding part 6 of 7 if we ar...
|