home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-05-11 | 10.6 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: MacWT.c
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Wed May 11 01:05:00 1994, modified Wed May 11 01:05:00 1994, creator 'MMCC', type ASCII, 10217 bytes "MacWT.c" , at 0x2869 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 4d 61 63 57 54 2e | 63 00 00 00 00 00 00 00 |..MacWT.|c.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 27 e9 00 | 00 01 ac a9 f6 17 fc a9 |.....'..|........|
|00000060| f6 17 fc 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 af 7b 00 00 |........|.....{..|
|00000080| 2f 2f 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |//======|========|
|00000090| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000c0| 3d 3d 3d 3d 0d 2f 2f 20 | 4d 61 63 57 54 2e 63 09 |====.// |MacWT.c.|
|000000d0| 09 09 09 09 09 09 09 09 | 09 09 3c 74 75 72 20 30 |........|..<tur 0|
|000000e0| 31 2d 4d 61 79 2d 39 34 | 3e 0d 2f 2f 0d 2f 2f 20 |1-May-94|>.//.// |
|000000f0| 4d 61 63 20 69 6e 74 65 | 72 66 61 63 65 20 74 6f |Mac inte|rface to|
|00000100| 20 43 68 72 69 73 20 4c | 61 75 72 65 6c 27 73 20 | Chris L|aurel's |
|00000110| 27 77 74 27 20 64 65 6d | 6f 20 5b 22 77 68 61 74 |'wt' dem|o ["what|
|00000120| 27 73 20 74 68 61 74 22 | 5d 2e 0d 2f 2f 0d 2f 2f |'s that"|]..//.//|
|00000130| 09 43 6f 6d 6d 65 6e 74 | 73 2c 20 42 75 67 20 52 |.Comment|s, Bug R|
|00000140| 65 70 6f 72 74 73 2f 46 | 69 78 65 73 2c 20 65 74 |eports/F|ixes, et|
|00000150| 63 2c 20 74 6f 20 74 75 | 72 6c 79 40 69 73 6c 74 |c, to tu|rly@islt|
|00000160| 64 2e 69 6e 73 69 67 6e | 69 61 2e 63 6f 6d 0d 2f |d.insign|ia.com./|
|00000170| 2f 0d 2f 2f 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |/.//====|========|
|00000180| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000190| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000001b0| 3d 3d 3d 3d 3d 3d 0d 0d | 23 69 66 6e 64 65 66 09 |======..|#ifndef.|
|000001c0| 5f 5f 51 55 49 43 4b 44 | 52 41 57 5f 5f 0d 23 69 |__QUICKD|RAW__.#i|
|000001d0| 6e 63 6c 75 64 65 20 22 | 4c 6f 61 64 4d 61 63 48 |nclude "|LoadMacH|
|000001e0| 65 61 64 65 72 73 2e 68 | 22 0d 23 65 6e 64 69 66 |eaders.h|".#endif|
|000001f0| 09 2f 2a 20 5f 5f 51 55 | 49 43 4b 44 52 41 57 5f |./* __QU|ICKDRAW_|
|00000200| 5f 20 2a 2f 0d 0d 23 69 | 6e 63 6c 75 64 65 20 3c |_ */..#i|nclude <|
|00000210| 73 74 64 69 6f 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |stdio.h>|.#includ|
|00000220| 65 20 3c 73 74 72 69 6e | 67 2e 68 3e 0d 0d 23 69 |e <strin|g.h>..#i|
|00000230| 6e 63 6c 75 64 65 20 22 | 46 61 69 6c 75 72 65 2e |nclude "|Failure.|
|00000240| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 44 69 72 |h".#incl|ude "Dir|
|00000250| 53 63 72 6e 57 72 69 74 | 65 2e 68 22 0d 23 69 6e |ScrnWrit|e.h".#in|
|00000260| 63 6c 75 64 65 20 22 77 | 74 2e 68 22 09 09 09 2f |clude "w|t.h".../|
|00000270| 2a 20 77 74 20 2a 2f 0d | 23 69 6e 63 6c 75 64 65 |* wt */.|#include|
|00000280| 20 22 65 72 72 6f 72 2e | 68 22 0d 23 69 6e 63 6c | "error.|h".#incl|
|00000290| 75 64 65 20 22 69 6e 70 | 75 74 2e 68 22 0d 23 69 |ude "inp|ut.h".#i|
|000002a0| 6e 63 6c 75 64 65 20 22 | 66 72 61 6d 65 62 75 66 |nclude "|framebuf|
|000002b0| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 22 67 72 |.h".#inc|lude "gr|
|000002c0| 61 70 68 69 63 73 2e 68 | 22 0d 23 69 6e 63 6c 75 |aphics.h|".#inclu|
|000002d0| 64 65 20 22 4d 61 63 47 | 61 6d 65 2e 68 22 0d 0d |de "MacG|ame.h"..|
|000002e0| 0d 2f 2a 2a 2f 0d 0d 0d | 50 69 78 4d 61 70 09 09 |./**/...|PixMap..|
|000002f0| 09 67 4f 66 66 73 63 72 | 65 65 6e 50 69 78 4d 61 |.gOffscr|eenPixMa|
|00000300| 70 3b 0d 57 69 6e 64 6f | 77 50 74 72 09 09 67 57 |p;.Windo|wPtr..gW|
|00000310| 54 46 54 57 69 6e 64 6f | 77 3b 0d 0d 0d 2f 2a 2a |TFTWindo|w;.../**|
|00000320| 2f 0d 0d 0d 73 74 61 74 | 69 63 20 6c 6f 6e 67 20 |/...stat|ic long |
|00000330| 67 53 74 61 72 74 54 69 | 63 6b 73 2c 20 67 46 72 |gStartTi|cks, gFr|
|00000340| 61 6d 65 43 6f 75 6e 74 | 3b 0d 73 74 61 74 69 63 |ameCount|;.static|
|00000350| 20 49 6e 74 65 6e 74 20 | 67 49 6e 74 65 6e 74 3b | Intent |gIntent;|
|00000360| 0d 0d 0d 2f 2a 2a 2f 0d | 0d 0d 76 6f 69 64 20 69 |.../**/.|..void i|
|00000370| 6e 69 74 5f 69 6e 70 75 | 74 5f 64 65 76 69 63 65 |nit_inpu|t_device|
|00000380| 73 28 76 6f 69 64 29 0d | 7b 0d 09 6d 65 6d 73 65 |s(void).|{..memse|
|00000390| 74 28 26 67 49 6e 74 65 | 6e 74 2c 20 30 2c 20 73 |t(&gInte|nt, 0, s|
|000003a0| 69 7a 65 6f 66 28 67 49 | 6e 74 65 6e 74 29 29 3b |izeof(gI|ntent));|
|000003b0| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 65 6e 64 5f 69 6e |.}...voi|d end_in|
|000003c0| 70 75 74 5f 64 65 76 69 | 63 65 73 28 76 6f 69 64 |put_devi|ces(void|
|000003d0| 29 0d 7b 0d 09 2f 2f 20 | 6e 61 64 61 20 66 6f 72 |).{..// |nada for|
|000003e0| 20 4d 61 63 0d 7d 0d 0d | 0d 2f 2a 2a 2f 0d 0d 0d | Mac.}..|./**/...|
|000003f0| 73 74 61 74 69 63 20 75 | 6e 73 69 67 6e 65 64 20 |static u|nsigned |
|00000400| 43 6f 72 72 65 63 74 50 | 43 52 47 42 28 75 6e 73 |CorrectP|CRGB(uns|
|00000410| 69 67 6e 65 64 20 72 67 | 62 56 61 6c 29 0d 7b 0d |igned rg|bVal).{.|
|00000420| 09 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e |.registe|r unsign|
|00000430| 65 64 20 6c 6f 6e 67 09 | 76 20 3d 20 72 67 62 56 |ed long.|v = rgbV|
|00000440| 61 6c 3b 0d 0d 09 2f 2f | 20 54 68 65 20 50 43 20 |al;...//| The PC |
|00000450| 52 47 42 20 56 61 6c 75 | 65 73 20 61 72 65 20 73 |RGB Valu|es are s|
|00000460| 6f 6d 65 77 68 61 74 20 | 6c 6f 77 20 66 6f 72 20 |omewhat |low for |
|00000470| 6d 79 20 6c 69 6b 69 6e | 67 2e 0d 09 2f 2f 20 54 |my likin|g...// T|
|00000480| 68 69 73 20 6c 69 74 74 | 6c 65 20 68 61 63 6b 20 |his litt|le hack |
|00000490| 63 6f 72 72 65 63 74 73 | 20 74 68 65 6d 2e 2e 2e |corrects| them...|
|000004a0| 0d 0d 09 69 66 20 28 76 | 29 20 7b 0d 09 09 69 66 |...if (v|) {...if|
|000004b0| 20 28 76 20 3c 20 30 78 | 30 43 30 43 29 0d 09 09 | (v < 0x|0C0C)...|
|000004c0| 09 76 20 3d 20 30 78 30 | 43 30 43 3b 0d 09 09 65 |.v = 0x0|C0C;...e|
|000004d0| 6c 73 65 0d 09 09 69 66 | 20 28 76 2b 76 20 3c 20 |lse...if| (v+v < |
|000004e0| 30 78 46 46 46 46 29 0d | 09 09 09 76 20 2b 3d 20 |0xFFFF).|...v += |
|000004f0| 76 3b 0d 09 09 65 6c 73 | 65 0d 09 09 69 66 20 28 |v;...els|e...if (|
|00000500| 76 20 3c 20 30 78 45 45 | 45 45 29 0d 09 09 09 76 |v < 0xEE|EE)....v|
|00000510| 20 2b 3d 20 30 78 31 30 | 30 30 3b 0d 09 7d 0d 0d | += 0x10|00;..}..|
|00000520| 09 72 65 74 75 72 6e 20 | 76 3b 0d 7d 0d 0d 0d 2f |.return |v;.}.../|
|00000530| 2a 2a 2f 0d 0d 0d 69 6e | 74 20 4c 6f 61 64 50 61 |**/...in|t LoadPa|
|00000540| 6c 65 74 74 65 46 72 6f | 6d 46 69 6c 65 28 50 61 |letteFro|mFile(Pa|
|00000550| 6c 65 74 74 65 48 61 6e | 64 6c 65 20 70 61 6c 2c |letteHan|dle pal,|
|00000560| 20 63 6f 6e 73 74 20 63 | 68 61 72 20 2a 70 61 6c | const c|har *pal|
|00000570| 46 69 6c 65 29 0d 7b 0d | 09 46 49 4c 45 09 09 2a |File).{.|.FILE..*|
|00000580| 66 70 3b 0d 09 69 6e 74 | 09 09 09 69 2c 20 72 2c |fp;..int|...i, r,|
|00000590| 20 67 2c 20 62 3b 0d 09 | 52 47 42 43 6f 6c 6f 72 | g, b;..|RGBColor|
|000005a0| 09 63 6f 6c 3b 0d 09 63 | 68 61 72 09 09 6e 61 6d |.col;..c|har..nam|
|000005b0| 65 5b 32 35 36 5d 3b 0d | 0d 09 69 66 20 28 21 70 |e[256];.|..if (!p|
|000005c0| 61 6c 46 69 6c 65 29 0d | 09 09 70 61 6c 46 69 6c |alFile).|..palFil|
|000005d0| 65 20 3d 20 44 45 46 41 | 55 4c 54 5f 50 41 4c 45 |e = DEFA|ULT_PALE|
|000005e0| 54 54 45 5f 46 49 4c 45 | 3b 0d 0d 09 66 70 20 3d |TTE_FILE|;...fp =|
|000005f0| 20 66 6f 70 65 6e 28 70 | 61 6c 46 69 6c 65 2c 20 | fopen(p|alFile, |
|00000600| 22 72 62 22 29 3b 0d 0d | 09 69 66 20 28 66 70 20 |"rb");..|.if (fp |
|00000610| 3d 3d 20 4e 55 4c 4c 29 | 20 7b 0d 09 09 2f 2f 20 |== NULL)| {...// |
|00000620| 63 6f 75 6c 64 6e 27 74 | 20 6f 70 65 6e 20 69 74 |couldn't| open it|
|00000630| 20 2d 2d 20 74 72 79 20 | 74 68 65 20 22 3a 77 74 | -- try |the ":wt|
|00000640| 3a 22 20 73 75 62 64 69 | 72 65 63 74 6f 72 79 2e |:" subdi|rectory.|
|00000650| 2e 2e 0d 0d 09 09 73 70 | 72 69 6e 74 66 28 6e 61 |......sp|rintf(na|
|00000660| 6d 65 2c 20 22 3a 77 74 | 3a 25 73 22 2c 20 70 61 |me, ":wt|:%s", pa|
|00000670| 6c 46 69 6c 65 29 3b 0d | 09 09 66 70 20 3d 20 66 |lFile);.|..fp = f|
|00000680| 6f 70 65 6e 28 6e 61 6d | 65 2c 20 22 72 62 22 29 |open(nam|e, "rb")|
|00000690| 3b 0d 09 09 69 66 20 28 | 66 70 20 3d 3d 20 4e 55 |;...if (|fp == NU|
|000006a0| 4c 4c 29 0d 09 09 09 46 | 61 69 6c 28 22 75 6e 61 |LL)....F|ail("una|
|000006b0| 62 6c 65 20 74 6f 20 6f | 70 65 6e 20 70 61 6c 65 |ble to o|pen pale|
|000006c0| 74 74 65 20 66 69 6c 65 | 20 27 25 73 27 22 2c 20 |tte file| '%s'", |
|000006d0| 70 61 6c 46 69 6c 65 29 | 3b 0d 09 7d 0d 0d 09 63 |palFile)|;..}...c|
|000006e0| 6f 6c 2e 72 65 64 20 3d | 20 63 6f 6c 2e 67 72 65 |ol.red =| col.gre|
|000006f0| 65 6e 20 3d 20 63 6f 6c | 2e 62 6c 75 65 20 3d 20 |en = col|.blue = |
|00000700| 30 78 46 46 46 46 3b 09 | 2f 2f 20 77 68 69 74 65 |0xFFFF;.|// white|
|00000710| 2c 20 62 75 74 20 61 6c | 73 6f 20 74 72 61 6e 73 |, but al|so trans|
|00000720| 70 61 72 65 6e 74 21 0d | 09 53 65 74 45 6e 74 72 |parent!.|.SetEntr|
|00000730| 79 43 6f 6c 6f 72 28 70 | 61 6c 2c 20 30 2c 20 26 |yColor(p|al, 0, &|
|00000740| 63 6f 6c 29 3b 0d 0d 09 | 66 6f 72 20 28 69 20 3d |col);...|for (i =|
|00000750| 20 31 3b 20 69 20 3c 3d | 20 50 41 4c 45 54 54 45 | 1; i <=| PALETTE|
|00000760| 5f 45 4e 54 52 49 45 53 | 3b 20 69 2b 2b 29 20 7b |_ENTRIES|; i++) {|
|00000770| 0d 09 09 72 20 3d 20 67 | 65 74 63 28 66 70 29 3b |...r = g|etc(fp);|
|00000780| 0d 09 09 67 20 3d 20 67 | 65 74 63 28 66 70 29 3b |...g = g|etc(fp);|
|00000790| 0d 09 09 62 20 3d 20 67 | 65 74 63 28 66 70 29 3b |...b = g|etc(fp);|
|000007a0| 0d 09 09 69 66 20 28 62 | 20 3d 3d 20 45 4f 46 29 |...if (b| == EOF)|
|000007b0| 0d 09 09 09 46 61 69 6c | 28 22 65 72 72 6f 72 20 |....Fail|("error |
|000007c0| 72 65 61 64 69 6e 67 20 | 70 61 6c 65 74 74 65 20 |reading |palette |
|000007d0| 66 69 6c 65 20 27 25 73 | 27 22 2c 20 70 61 6c 46 |file '%s|'", palF|
|000007e0| 69 6c 65 29 3b 0d 0d 09 | 09 63 6f 6c 2e 72 65 64 |ile);...|.col.red|
|000007f0| 20 3d 20 28 72 20 3c 3c | 20 38 29 20 7c 20 72 3b | = (r <<| 8) | r;|
|00000800| 0d 09 09 63 6f 6c 2e 67 | 72 65 65 6e 20 3d 20 28 |...col.g|reen = (|
|00000810| 67 20 3c 3c 20 38 29 20 | 7c 20 67 3b 0d 09 09 63 |g << 8) || g;...c|
|00000820| 6f 6c 2e 62 6c 75 65 20 | 3d 20 28 62 20 3c 3c 20 |ol.blue |= (b << |
|00000830| 38 29 20 7c 20 62 3b 0d | 0d 09 09 63 6f 6c 2e 72 |8) | b;.|...col.r|
|00000840| 65 64 20 3d 20 43 6f 72 | 72 65 63 74 50 43 52 47 |ed = Cor|rectPCRG|
|00000850| 42 28 63 6f 6c 2e 72 65 | 64 29 3b 0d 09 09 63 6f |B(col.re|d);...co|
|00000860| 6c 2e 67 72 65 65 6e 20 | 3d 20 43 6f 72 72 65 63 |l.green |= Correc|
|00000870| 74 50 43 52 47 42 28 63 | 6f 6c 2e 67 72 65 65 6e |tPCRGB(c|ol.green|
|00000880| 29 3b 0d 09 09 63 6f 6c | 2e 62 6c 75 65 20 3d 20 |);...col|.blue = |
|00000890| 43 6f 72 72 65 63 74 50 | 43 52 47 42 28 63 6f 6c |CorrectP|CRGB(col|
|000008a0| 2e 62 6c 75 65 29 3b 0d | 0d 09 09 53 65 74 45 6e |.blue);.|...SetEn|
|000008b0| 74 72 79 43 6f 6c 6f 72 | 28 70 61 6c 2c 20 69 2c |tryColor|(pal, i,|
|000008c0| 20 26 63 6f 6c 29 3b 0d | 09 7d 0d 09 66 63 6c 6f | &col);.|.}..fclo|
|000008d0| 73 65 28 66 70 29 3b 0d | 0d 09 2f 2f 20 73 65 74 |se(fp);.|..// set|
|000008e0| 20 61 6c 6c 20 6f 74 68 | 65 72 73 20 28 61 73 20 | all oth|ers (as |
|000008f0| 79 65 74 20 75 6e 61 73 | 73 69 67 6e 65 64 29 20 |yet unas|signed) |
|00000900| 74 6f 20 62 6c 61 63 6b | 21 0d 0d 09 63 6f 6c 2e |to black|!...col.|
|00000910| 72 65 64 20 3d 20 63 6f | 6c 2e 67 72 65 65 6e 20 |red = co|l.green |
|00000920| 3d 20 63 6f 6c 2e 62 6c | 75 65 20 3d 20 30 3b 0d |= col.bl|ue = 0;.|
|00000930| 09 77 68 69 6c 65 20 28 | 69 20 3c 20 32 35 35 29 |.while (|i < 255)|
|00000940| 20 7b 0d 09 09 53 65 74 | 45 6e 74 72 79 43 6f 6c | {...Set|EntryCol|
|00000950| 6f 72 28 70 61 6c 2c 20 | 69 2c 20 26 63 6f 6c 29 |or(pal, |i, &col)|
|00000960| 3b 0d 09 09 2b 2b 69 3b | 0d 09 7d 0d 0d 09 72 65 |;...++i;|..}...re|
|00000970| 74 75 72 6e 20 50 41 4c | 45 54 54 45 5f 45 4e 54 |turn PAL|ETTE_ENT|
|00000980| 52 49 45 53 2b 32 3b 0d | 7d 0d 0d 0d 2f 2a 2a 2f |RIES+2;.|}.../**/|
|00000990| 0d 0d 2f 2f 20 4d 61 63 | 20 70 61 6c 65 74 74 65 |..// Mac| palette|
|000009a0| 20 69 6e 64 69 63 65 73 | 20 61 72 65 20 50 43 20 | indices| are PC |
|000009b0| 69 6e 64 69 63 65 73 20 | 2b 20 31 0d 2f 2f 20 64 |indices |+ 1.// d|
|000009c0| 75 65 20 74 6f 20 51 75 | 69 63 6b 44 72 61 77 20 |ue to Qu|ickDraw |
|000009d0| 72 65 71 75 69 72 65 6d | 65 6e 74 20 74 68 61 74 |requirem|ent that|
|000009e0| 20 77 68 69 74 65 20 62 | 65 20 69 6e 64 65 78 20 | white b|e index |
|000009f0| 30 0d 2f 2f 20 61 6e 64 | 20 62 6c 61 63 6b 20 69 |0.// and| black i|
|00000a00| 6e 64 65 78 20 32 35 35 | 20 2d 2d 20 50 43 73 20 |ndex 255| -- PCs |
|00000a10| 61 72 65 20 67 65 6e 65 | 72 61 6c 6c 79 20 74 68 |are gene|rally th|
|00000a20| 65 20 6f 74 68 65 72 20 | 77 61 79 20 72 6f 75 6e |e other |way roun|
|00000a30| 64 2e 2e 2e 0d 0d 76 6f | 69 64 20 4d 61 63 46 69 |d.....vo|id MacFi|
|00000a40| 78 75 70 50 69 78 65 6c | 44 61 74 61 28 75 6e 73 |xupPixel|Data(uns|
|00000a50| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 62 75 66 2c |igned ch|ar *buf,|
|00000a60| 20 69 6e 74 20 6e 42 79 | 74 65 73 29 0d 7b 0d 09 | int nBy|tes).{..|
|00000a70| 77 68 69 6c 65 20 28 6e | 42 79 74 65 73 2d 2d 29 |while (n|Bytes--)|
|00000a80| 20 7b 0d 09 09 2a 62 75 | 66 20 2b 3d 20 31 3b 0d | {...*bu|f += 1;.|
|00000a90| 09 09 2b 2b 62 75 66 3b | 0d 09 7d 0d 7d 0d 0d 0d |..++buf;|..}.}...|
|00000aa0| 2f 2a 2a 2f 0d 0d 0d 76 | 6f 69 64 20 69 6e 69 74 |/**/...v|oid init|
|00000ab0| 5f 67 72 61 70 68 69 63 | 73 28 76 6f 69 64 29 0d |_graphic|s(void).|
|00000ac0| 7b 0d 0d 09 2f 2f 20 53 | 63 72 65 65 6e 20 77 69 |{...// S|creen wi|
|00000ad0| 64 74 68 20 6d 75 73 74 | 20 62 65 20 6d 75 6c 74 |dth must| be mult|
|00000ae0| 69 70 6c 65 20 6f 66 20 | 34 2e 2e 2e 0d 0d 09 46 |iple of |4......F|
|00000af0| 61 69 6c 49 66 28 53 43 | 52 45 45 4e 5f 57 49 44 |ailIf(SC|REEN_WID|
|00000b00| 54 48 20 26 20 33 29 3b | 0d 0d 09 69 66 20 28 21 |TH & 3);|...if (!|
|00000b10| 67 4f 66 66 73 63 72 65 | 65 6e 50 69 78 4d 61 70 |gOffscre|enPixMap|
|00000b20| 2e 62 61 73 65 41 64 64 | 72 29 20 7b 0d 09 09 67 |.baseAdd|r) {...g|
|00000b30| 4f 66 66 73 63 72 65 65 | 6e 50 69 78 4d 61 70 2e |Offscree|nPixMap.|
|00000b40| 62 61 73 65 41 64 64 72 | 20 3d 20 4e 65 77 50 74 |baseAddr| = NewPt|
|00000b50| 72 28 53 43 52 45 45 4e | 5f 48 45 49 47 48 54 20 |r(SCREEN|_HEIGHT |
|00000b60| 2a 20 53 43 52 45 45 4e | 5f 57 49 44 54 48 29 3b |* SCREEN|_WIDTH);|
|00000b70| 0d 09 09 46 61 69 6c 4e | 69 6c 28 67 4f 66 66 73 |...FailN|il(gOffs|
|00000b80| 63 72 65 65 6e 50 69 78 | 4d 61 70 2e 62 61 73 65 |creenPix|Map.base|
|00000b90| 41 64 64 72 29 3b 0d 09 | 0d 09 09 67 4f 66 66 73 |Addr);..|...gOffs|
|00000ba0| 63 72 65 65 6e 50 69 78 | 4d 61 70 2e 72 6f 77 42 |creenPix|Map.rowB|
|00000bb0| 79 74 65 73 20 3d 20 30 | 78 38 30 30 30 20 7c 20 |ytes = 0|x8000 | |
|00000bc0| 53 43 52 45 45 4e 5f 57 | 49 44 54 48 3b 0d 09 09 |SCREEN_W|IDTH;...|
|00000bd0| 53 65 74 52 65 63 74 28 | 26 67 4f 66 66 73 63 72 |SetRect(|&gOffscr|
|00000be0| 65 65 6e 50 69 78 4d 61 | 70 2e 62 6f 75 6e 64 73 |eenPixMa|p.bounds|
|00000bf0| 2c 20 30 2c 20 30 2c 20 | 53 43 52 45 45 4e 5f 57 |, 0, 0, |SCREEN_W|
|00000c00| 49 44 54 48 2c 20 53 43 | 52 45 45 4e 5f 48 45 49 |IDTH, SC|REEN_HEI|
|00000c10| 47 48 54 29 3b 0d 09 0d | 09 09 67 4f 66 66 73 63 |GHT);...|..gOffsc|
|00000c20| 72 65 65 6e 50 69 78 4d | 61 70 2e 70 69 78 65 6c |reenPixM|ap.pixel|
|00000c30| 53 69 7a 65 20 3d 20 38 | 3b 0d 09 09 67 4f 66 66 |Size = 8|;...gOff|
|00000c40| 73 63 72 65 65 6e 50 69 | 78 4d 61 70 2e 63 6d 70 |screenPi|xMap.cmp|
|00000c50| 43 6f 75 6e 74 20 3d 20 | 31 3b 0d 09 09 67 4f 66 |Count = |1;...gOf|
|00000c60| 66 73 63 72 65 65 6e 50 | 69 78 4d 61 70 2e 63 6d |fscreenP|ixMap.cm|
|00000c70| 70 53 69 7a 65 20 3d 20 | 38 3b 0d 09 09 67 4f 66 |pSize = |8;...gOf|
|00000c80| 66 73 63 72 65 65 6e 50 | 69 78 4d 61 70 2e 70 6d |fscreenP|ixMap.pm|
|00000c90| 54 61 62 6c 65 20 3d 20 | 67 44 69 72 43 6c 75 74 |Table = |gDirClut|
|00000ca0| 3b 0d 09 7d 0d 7d 0d 0d | 0d 2f 2a 2a 2f 0d 0d 0d |;..}.}..|./**/...|
|00000cb0| 76 6f 69 64 20 65 6e 64 | 5f 67 72 61 70 68 69 63 |void end|_graphic|
|00000cc0| 73 28 76 6f 69 64 29 0d | 7b 0d 7d 0d 0d 0d 2f 2a |s(void).|{.}.../*|
|00000cd0| 2a 2f 0d 0d 0d 73 74 61 | 74 69 63 20 76 6f 69 64 |*/...sta|tic void|
|00000ce0| 20 53 68 6f 77 49 66 50 | 61 75 73 65 64 28 76 6f | ShowIfP|aused(vo|
|00000cf0| 69 64 29 0d 7b 0d 09 69 | 6e 74 09 6f 6c 64 46 61 |id).{..i|nt.oldFa|
|00000d00| 63 65 2c 20 6f 6c 64 53 | 69 7a 65 2c 20 6f 6c 64 |ce, oldS|ize, old|
|00000d10| 46 6f 6e 74 2c 20 6f 6c | 64 4d 6f 64 65 3b 0d 09 |Font, ol|dMode;..|
|00000d20| 6c 6f 6e 67 20 74 69 78 | 3b 0d 09 73 74 61 74 69 |long tix|;..stati|
|00000d30| 63 20 69 6e 74 20 64 6f | 57 68 69 74 65 20 3d 20 |c int do|White = |
|00000d40| 74 72 75 65 3b 0d 09 73 | 74 61 74 69 63 20 6c 6f |true;..s|tatic lo|
|00000d50| 6e 67 09 6c 61 73 74 46 | 6c 61 73 68 54 69 63 6b |ng.lastF|lashTick|
|00000d60| 43 6f 75 6e 74 3b 0d 0d | 09 69 66 20 28 67 50 61 |Count;..|.if (gPa|
|00000d70| 75 73 65 64 29 20 7b 0d | 0d 09 09 6f 6c 64 46 61 |used) {.|...oldFa|
|00000d80| 63 65 20 3d 20 67 57 54 | 46 54 57 69 6e 64 6f 77 |ce = gWT|FTWindow|
|00000d90| 2d 3e 74 78 46 61 63 65 | 3b 0d 09 09 6f 6c 64 46 |->txFace|;...oldF|
|00000da0| 6f 6e 74 20 3d 20 67 57 | 54 46 54 57 69 6e 64 6f |ont = gW|TFTWindo|
|00000db0| 77 2d 3e 74 78 46 6f 6e | 74 3b 0d 09 09 6f 6c 64 |w->txFon|t;...old|
|00000dc0| 53 69 7a 65 20 3d 20 67 | 57 54 46 54 57 69 6e 64 |Size = g|WTFTWind|
|00000dd0| 6f 77 2d 3e 74 78 53 69 | 7a 65 3b 0d 09 09 6f 6c |ow->txSi|ze;...ol|
|00000de0| 64 4d 6f 64 65 20 3d 20 | 67 57 54 46 54 57 69 6e |dMode = |gWTFTWin|
|00000df0| 64 6f 77 2d 3e 74 78 4d | 6f 64 65 3b 0d 0d 09 09 |dow->txM|ode;....|
|00000e00| 74 69 78 20 3d 20 54 69 | 63 6b 43 6f 75 6e 74 28 |tix = Ti|ckCount(|
|00000e10| 29 3b 0d 09 09 69 66 20 | 28 21 6c 61 73 74 46 6c |);...if |(!lastFl|
|00000e20| 61 73 68 54 69 63 6b 43 | 6f 75 6e 74 29 0d 09 09 |ashTickC|ount)...|
|00000e30| 09 6c 61 73 74 46 6c 61 | 73 68 54 69 63 6b 43 6f |.lastFla|shTickCo|
|00000e40| 75 6e 74 20 3d 20 74 69 | 78 3b 0d 09 09 46 6f 72 |unt = ti|x;...For|
|00000e50| 65 43 6f 6c 6f 72 28 28 | 64 6f 57 68 69 74 65 29 |eColor((|doWhite)|
|00000e60| 20 3f 20 77 68 69 74 65 | 43 6f 6c 6f 72 20 3a 20 | ? white|Color : |
|00000e70| 62 6c 61 63 6b 43 6f 6c | 6f 72 29 3b 0d 09 09 69 |blackCol|or);...i|
|00000e80| 66 20 28 74 69 78 20 2d | 20 6c 61 73 74 46 6c 61 |f (tix -| lastFla|
|00000e90| 73 68 54 69 63 6b 43 6f | 75 6e 74 20 3e 20 33 30 |shTickCo|unt > 30|
|00000ea0| 29 20 7b 0d 09 09 09 6c | 61 73 74 46 6c 61 73 68 |) {....l|astFlash|
|00000eb0| 54 69 63 6b 43 6f 75 6e | 74 20 3d 20 74 69 78 3b |TickCoun|t = tix;|
|00000ec0| 0d 09 09 09 64 6f 57 68 | 69 74 65 20 3d 20 21 64 |....doWh|ite = !d|
|00000ed0| 6f 57 68 69 74 65 3b 0d | 09 09 7d 0d 09 09 4d 6f |oWhite;.|..}...Mo|
|00000ee0| 76 65 54 6f 28 36 2c 20 | 67 57 54 46 54 57 69 6e |veTo(6, |gWTFTWin|
|00000ef0| 64 6f 77 2d 3e 70 6f 72 | 74 52 65 63 74 2e 74 6f |dow->por|tRect.to|
|00000f00| 70 20 2b 20 33 30 29 3b | 0d 09 09 54 65 78 74 46 |p + 30);|...TextF|
|00000f10| 6f 6e 74 28 74 69 6d 65 | 73 29 3b 0d 09 09 54 65 |ont(time|s);...Te|
|00000f20| 78 74 46 61 63 65 28 62 | 6f 6c 64 29 3b 0d 09 09 |xtFace(b|old);...|
|00000f30| 54 65 78 74 53 69 7a 65 | 28 32 34 29 3b 0d 09 09 |TextSize|(24);...|
|00000f40| 54 65 78 74 4d 6f 64 65 | 28 73 72 63 4f 72 29 3b |TextMode|(srcOr);|
|00000f50| 0d 0d 09 09 44 72 61 77 | 53 74 72 69 6e 67 28 28 |....Draw|String((|
|00000f60| 53 74 72 69 6e 67 50 74 | 72 29 22 5c 70 50 61 75 |StringPt|r)"\pPau|
|00000f70| 73 65 64 22 29 3b 0d 0d | 09 09 54 65 78 74 53 69 |sed");..|..TextSi|
|00000f80| 7a 65 28 31 32 29 3b 0d | 09 09 44 72 61 77 53 74 |ze(12);.|..DrawSt|
|00000f90| 72 69 6e 67 28 28 53 74 | 72 69 6e 67 50 74 72 29 |ring((St|ringPtr)|
|00000fa0| 22 5c 70 20 2d 20 70 72 | 65 73 73 20 54 41 42 20 |"\p - pr|ess TAB |
|00000fb0| 74 6f 20 63 6f 6e 74 69 | 6e 75 65 22 29 3b 0d 0d |to conti|nue");..|
|00000fc0| 09 09 54 65 78 74 53 69 | 7a 65 28 6f 6c 64 53 69 |..TextSi|ze(oldSi|
|00000fd0| 7a 65 29 3b 0d 09 09 54 | 65 78 74 46 61 63 65 28 |ze);...T|extFace(|
|00000fe0| 6f 6c 64 46 61 63 65 29 | 3b 0d 09 09 54 65 78 74 |oldFace)|;...Text|
|00000ff0| 46 6f 6e 74 28 6f 6c 64 | 46 6f 6e 74 29 3b 0d 09 |Font(old|Font);..|
|00001000| 09 54 65 78 74 4d 6f 64 | 65 28 6f 6c 64 4d 6f 64 |.TextMod|e(oldMod|
|00001010| 65 29 3b 0d 0d 09 09 46 | 6f 72 65 43 6f 6c 6f 72 |e);....F|oreColor|
|00001020| 28 62 6c 61 63 6b 43 6f | 6c 6f 72 29 3b 0d 09 7d |(blackCo|lor);..}|
|00001030| 0d 7d 0d 0d 0d 2f 2a 2a | 2f 0d 0d 0d 73 74 61 74 |.}.../**|/...stat|
|00001040| 69 63 20 76 6f 69 64 20 | 4d 61 63 41 74 74 72 61 |ic void |MacAttra|
|00001050| 63 74 4d 6f 64 65 28 76 | 6f 69 64 29 0d 7b 0d 09 |ctMode(v|oid).{..|
|00001060| 69 6e 74 09 09 09 09 09 | 09 6f 6c 64 46 6f 6e 74 |int.....|.oldFont|
|00001070| 2c 20 6f 6c 64 53 69 7a | 65 2c 20 6f 6c 64 46 61 |, oldSiz|e, oldFa|
|00001080| 63 65 2c 20 6f 6c 64 4d | 6f 64 65 3b 0d 0d 09 46 |ce, oldM|ode;...F|
|00001090| 61 69 6c 4e 69 6c 28 67 | 57 54 46 54 57 69 6e 64 |ailNil(g|WTFTWind|
|000010a0| 6f 77 29 3b 0d 0d 09 2f | 2f 20 54 68 69 73 20 69 |ow);.../|/ This i|
|000010b0| 73 20 61 20 62 69 74 20 | 6f 66 20 61 20 68 61 63 |s a bit |of a hac|
|000010c0| 6b 2c 20 49 d5 6d 20 61 | 66 72 61 69 64 2e 2e 2e |k, I.m a|fraid...|
|000010d0| 0d 0d 09 69 66 20 28 21 | 67 47 61 6d 65 4f 6e 29 |...if (!|gGameOn)|
|000010e0| 20 7b 0d 09 09 53 65 74 | 50 6f 72 74 28 67 57 54 | {...Set|Port(gWT|
|000010f0| 46 54 57 69 6e 64 6f 77 | 29 3b 0d 0d 09 09 6f 6c |FTWindow|);....ol|
|00001100| 64 46 6f 6e 74 20 3d 20 | 67 57 54 46 54 57 69 6e |dFont = |gWTFTWin|
|00001110| 64 6f 77 2d 3e 74 78 46 | 6f 6e 74 3b 0d 09 09 6f |dow->txF|ont;...o|
|00001120| 6c 64 53 69 7a 65 20 3d | 20 67 57 54 46 54 57 69 |ldSize =| gWTFTWi|
|00001130| 6e 64 6f 77 2d 3e 74 78 | 53 69 7a 65 3b 0d 09 09 |ndow->tx|Size;...|
|00001140| 6f 6c 64 46 61 63 65 20 | 3d 20 67 57 54 46 54 57 |oldFace |= gWTFTW|
|00001150| 69 6e 64 6f 77 2d 3e 74 | 78 46 61 63 65 3b 0d 09 |indow->t|xFace;..|
|00001160| 09 6f 6c 64 4d 6f 64 65 | 20 3d 20 67 57 54 46 54 |.oldMode| = gWTFT|
|00001170| 57 69 6e 64 6f 77 2d 3e | 74 78 4d 6f 64 65 3b 0d |Window->|txMode;.|
|00001180| 0d 09 09 54 65 78 74 46 | 6f 6e 74 28 67 65 6e 65 |...TextF|ont(gene|
|00001190| 76 61 29 3b 0d 09 09 54 | 65 78 74 53 69 7a 65 28 |va);...T|extSize(|
|000011a0| 39 29 3b 0d 09 09 54 65 | 78 74 4d 6f 64 65 28 73 |9);...Te|xtMode(s|
|000011b0| 72 63 4f 72 29 3b 0d 0d | 09 09 4d 6f 76 65 54 6f |rcOr);..|..MoveTo|
|000011c0| 28 34 2c 20 67 57 54 46 | 54 57 69 6e 64 6f 77 2d |(4, gWTF|TWindow-|
|000011d0| 3e 70 6f 72 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |>portRec|t.bottom|
|000011e0| 20 2d 20 6b 42 6f 74 74 | 6f 6d 42 6f 72 64 65 72 | - kBott|omBorder|
|000011f0| 20 2b 20 31 30 29 3b 0d | 09 09 54 65 78 74 46 61 | + 10);.|..TextFa|
|00001200| 63 65 28 62 6f 6c 64 29 | 3b 0d 09 09 44 72 61 77 |ce(bold)|;...Draw|
|00001210| 53 74 72 69 6e 67 28 28 | 53 74 72 69 6e 67 50 74 |String((|StringPt|
|00001220| 72 29 22 5c 70 77 74 20 | 22 29 3b 0d 09 09 44 72 |r)"\pwt |");...Dr|
|00001230| 61 77 53 74 72 69 6e 67 | 28 67 57 54 56 65 72 73 |awString|(gWTVers|
|00001240| 69 6f 6e 29 3b 0d 09 09 | 44 72 61 77 53 74 72 69 |ion);...|DrawStri|
|00001250| 6e 67 28 28 53 74 72 69 | 6e 67 50 74 72 29 22 5c |ng((Stri|ngPtr)"\|
|00001260| 70 20 2d 20 63 68 72 69 | 73 20 6c 61 75 72 65 6c |p - chri|s laurel|
|00001270| d5 73 20 70 6f 72 74 61 | 62 6c 65 20 33 44 20 67 |.s porta|ble 3D g|
|00001280| 61 6d 65 20 65 6e 67 69 | 6e 65 20 22 29 3b 0d 23 |ame engi|ne ");.#|
|00001290| 69 66 09 5f 5f 70 6f 77 | 65 72 63 0d 09 09 44 72 |if.__pow|erc...Dr|
|000012a0| 61 77 53 74 72 69 6e 67 | 28 28 53 74 72 69 6e 67 |awString|((String|
|000012b0| 50 74 72 29 22 5c 70 28 | 50 50 43 29 22 29 3b 0d |Ptr)"\p(|PPC)");.|
|000012c0| 23 65 6c 73 65 0d 09 09 | 44 72 61 77 53 74 72 69 |#else...|DrawStri|
|000012d0| 6e 67 28 28 53 74 72 69 | 6e 67 50 74 72 29 22 5c |ng((Stri|ngPtr)"\|
|000012e0| 70 28 36 38 4b 29 22 29 | 3b 0d 23 65 6e 64 69 66 |p(68K)")|;.#endif|
|000012f0| 0d 09 09 4d 6f 76 65 54 | 6f 28 34 2c 20 67 57 54 |...MoveT|o(4, gWT|
|00001300| 46 54 57 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 52 65 |FTWindow|->portRe|
|00001310| 63 74 2e 62 6f 74 74 6f | 6d 20 2d 20 6b 42 6f 74 |ct.botto|m - kBot|
|00001320| 74 6f 6d 42 6f 72 64 65 | 72 20 2b 20 32 31 29 3b |tomBorde|r + 21);|
|00001330| 0d 09 09 54 65 78 74 46 | 61 63 65 28 6e 6f 72 6d |...TextF|ace(norm|
|00001340| 61 6c 29 3b 0d 09 09 44 | 72 61 77 53 74 72 69 6e |al);...D|rawStrin|
|00001350| 67 28 28 53 74 72 69 6e | 67 50 74 72 29 22 5c 70 |g((Strin|gPtr)"\p|
|00001360| 57 6f 72 6c 64 20 46 69 | 6c 65 20 d1 20 22 29 3b |World Fi|le . ");|
|00001370| 0d 09 09 44 72 61 77 54 | 65 78 74 28 67 57 6f 72 |...DrawT|ext(gWor|
|00001380| 6c 64 46 69 6c 65 4e 61 | 6d 65 2c 20 30 2c 20 73 |ldFileNa|me, 0, s|
|00001390| 74 72 6c 65 6e 28 67 57 | 6f 72 6c 64 46 69 6c 65 |trlen(gW|orldFile|
|000013a0| 4e 61 6d 65 29 29 3b 0d | 09 09 4d 6f 76 65 54 6f |Name));.|..MoveTo|
|000013b0| 28 34 2c 20 67 57 54 46 | 54 57 69 6e 64 6f 77 2d |(4, gWTF|TWindow-|
|000013c0| 3e 70 6f 72 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |>portRec|t.bottom|
|000013d0| 20 2d 20 6b 42 6f 74 74 | 6f 6d 42 6f 72 64 65 72 | - kBott|omBorder|
|000013e0| 20 2b 20 33 32 29 3b 0d | 09 09 54 65 78 74 46 61 | + 32);.|..TextFa|
|000013f0| 63 65 28 69 74 61 6c 69 | 63 29 3b 0d 09 09 44 72 |ce(itali|c);...Dr|
|00001400| 61 77 53 74 72 69 6e 67 | 28 28 53 74 72 69 6e 67 |awString|((String|
|00001410| 50 74 72 29 22 5c 70 54 | 6f 20 63 68 61 6e 67 65 |Ptr)"\pT|o change|
|00001420| 20 77 6f 72 6c 64 20 66 | 69 6c 65 73 2c 20 68 6f | world f|iles, ho|
|00001430| 6c 64 20 64 6f 77 6e 20 | 53 48 49 46 54 20 77 68 |ld down |SHIFT wh|
|00001440| 69 6c 65 20 6c 61 75 6e | 63 68 69 6e 67 20 4d 61 |ile laun|ching Ma|
|00001450| 63 57 54 22 29 3b 0d 0d | 09 09 54 65 78 74 46 6f |cWT");..|..TextFo|
|00001460| 6e 74 28 6f 6c 64 46 6f | 6e 74 29 3b 0d 09 09 54 |nt(oldFo|nt);...T|
|00001470| 65 78 74 53 69 7a 65 28 | 6f 6c 64 53 69 7a 65 29 |extSize(|oldSize)|
|00001480| 3b 0d 09 09 54 65 78 74 | 46 61 63 65 28 6f 6c 64 |;...Text|Face(old|
|00001490| 46 61 63 65 29 3b 0d 09 | 09 54 65 78 74 4d 6f 64 |Face);..|.TextMod|
|000014a0| 65 28 6f 6c 64 4d 6f 64 | 65 29 3b 0d 09 7d 0d 7d |e(oldMod|e);..}.}|
|000014b0| 0d 0d 0d 2f 2a 2a 2f 0d | 0d 0d 76 6f 69 64 20 42 |.../**/.|..void B|
|000014c0| 65 67 69 6e 47 61 6d 65 | 28 76 6f 69 64 29 0d 7b |eginGame|(void).{|
|000014d0| 0d 09 52 65 63 74 09 72 | 3b 0d 0d 09 46 61 69 6c |..Rect.r|;...Fail|
|000014e0| 4e 69 6c 28 67 57 54 46 | 54 57 69 6e 64 6f 77 29 |Nil(gWTF|TWindow)|
|000014f0| 3b 0d 09 72 20 3d 20 67 | 57 54 46 54 57 69 6e 64 |;..r = g|WTFTWind|
|00001500| 6f 77 2d 3e 70 6f 72 74 | 52 65 63 74 3b 0d 09 72 |ow->port|Rect;..r|
|00001510| 2e 74 6f 70 20 3d 20 72 | 2e 62 6f 74 74 6f 6d 20 |.top = r|.bottom |
|00001520| 2d 20 6b 42 6f 74 74 6f | 6d 42 6f 72 64 65 72 3b |- kBotto|mBorder;|
|00001530| 0d 09 45 72 61 73 65 52 | 65 63 74 28 26 72 29 3b |..EraseR|ect(&r);|
|00001540| 0d 0d 09 67 47 61 6d 65 | 4f 6e 20 3d 20 74 72 75 |...gGame|On = tru|
|00001550| 65 3b 0d 09 69 66 20 28 | 67 50 61 75 73 65 64 29 |e;..if (|gPaused)|
|00001560| 0d 09 09 54 6f 67 67 6c | 65 50 61 75 73 65 28 29 |...Toggl|ePause()|
|00001570| 3b 0d 7d 0d 0d 0d 2f 2a | 2a 2f 0d 0d 0d 76 6f 69 |;.}.../*|*/...voi|
|00001580| 64 20 52 65 66 72 65 73 | 68 57 54 57 69 6e 64 6f |d Refres|hWTWindo|
|00001590| 77 28 76 6f 69 64 29 0d | 7b 0d 09 50 43 6f 70 79 |w(void).|{..PCopy|
|000015a0| 50 69 78 46 75 6e 63 09 | 63 70 46 20 3d 20 44 69 |PixFunc.|cpF = Di|
|000015b0| 72 43 6f 70 79 50 69 78 | 3b 0d 09 6c 6f 6e 67 09 |rCopyPix|;..long.|
|000015c0| 09 09 74 4e 6f 77 3b 0d | 09 63 68 61 72 09 09 09 |..tNow;.|.char...|
|000015d0| 61 53 74 72 5b 32 35 36 | 5d 3b 0d 09 69 6e 74 09 |aStr[256|];..int.|
|000015e0| 09 09 09 64 69 72 57 72 | 69 74 65 2c 20 64 75 62 |...dirWr|ite, dub|
|000015f0| 62 6c 65 3b 0d 0d 09 46 | 61 69 6c 4e 69 6c 28 67 |ble;...F|ailNil(g|
|00001600| 57 54 46 54 57 69 6e 64 | 6f 77 29 3b 0d 0d 09 69 |WTFTWind|ow);...i|
|00001610| 66 20 28 67 4f 66 66 73 | 63 72 65 65 6e 50 69 78 |f (gOffs|creenPix|
|00001620| 4d 61 70 2e 62 61 73 65 | 41 64 64 72 29 20 7b 0d |Map.base|Addr) {.|
|00001630| 0d 09 09 2f 2f 20 44 61 | 6d 6d 69 74 2c 20 49 20 |...// Da|mmit, I |
|00001640| 6b 6e 65 77 20 49 20 66 | 6f 72 67 6f 74 20 74 6f |knew I f|orgot to|
|00001650| 20 65 78 74 72 61 63 74 | 20 73 6f 6d 65 74 68 69 | extract| somethi|
|00001660| 6e 67 20 66 72 6f 6d 20 | 54 44 69 72 53 63 72 6e |ng from |TDirScrn|
|00001670| 21 0d 09 09 2f 2f 20 54 | 68 65 20 66 6f 6c 6c 6f |!...// T|he follo|
|00001680| 77 69 6e 67 20 77 61 73 | 20 70 6f 69 6e 74 65 64 |wing was| pointed|
|00001690| 20 6f 75 74 20 62 79 20 | 41 6c 20 45 76 61 6e 73 | out by |Al Evans|
|000016a0| 20 28 61 6c 40 63 72 75 | 63 69 62 6c 65 2e 70 6f | (al@cru|cible.po|
|000016b0| 77 65 72 74 6f 6f 6c 73 | 2e 63 6f 6d 29 0d 09 09 |wertools|.com)...|
|000016c0| 2f 2f 20 69 66 20 77 65 | 20 63 61 6e 20 77 72 69 |// if we| can wri|
|000016d0| 74 65 20 64 69 72 65 63 | 74 6c 79 20 74 6f 20 74 |te direc|tly to t|
|000016e0| 68 65 20 73 63 72 65 65 | 6e 2c 20 73 65 74 20 74 |he scree|n, set t|
|000016f0| 68 65 20 63 74 53 65 65 | 64 0d 09 09 2f 2f 20 74 |he ctSee|d...// t|
|00001700| 6f 20 62 65 20 74 68 65 | 20 73 61 6d 65 20 61 73 |o be the| same as|
|00001710| 20 74 68 65 20 64 65 76 | 69 63 65 d5 73 20 28 74 | the dev|ice.s (t|
|00001720| 68 69 73 20 69 73 20 66 | 6f 72 20 77 68 65 6e 20 |his is f|or when |
|00001730| 77 65 20 44 4f 4e d5 54 | 0d 09 09 2f 2f 20 77 72 |we DON.T|...// wr|
|00001740| 69 74 65 20 64 69 72 65 | 63 74 6c 79 20 74 6f 20 |ite dire|ctly to |
|00001750| 74 68 65 20 73 63 72 65 | 65 6e 2c 20 62 75 74 20 |the scre|en, but |
|00001760| 69 74 20 64 6f 65 73 20 | 73 70 65 65 64 20 75 70 |it does |speed up|
|00001770| 20 5f 43 6f 70 79 42 69 | 74 73 0d 09 09 2f 2f 20 | _CopyBi|ts...// |
|00001780| 74 6f 20 6d 61 74 63 68 | 20 6d 79 20 28 61 64 6d |to match| my (adm|
|00001790| 69 74 74 65 64 6c 79 20 | 43 29 20 64 69 72 65 63 |ittedly |C) direc|
|000017a0| 74 20 73 63 72 65 65 6e | 20 77 72 69 74 65 20 63 |t screen| write c|
|000017b0| 6f 64 65 2e 0d 09 09 2f | 2f 20 53 63 61 6c 69 6e |ode..../|/ Scalin|
|000017c0| 67 20 75 70 20 74 6f 20 | 36 34 30 78 34 30 30 20 |g up to |640x400 |
|000017d0| 28 66 72 6f 6d 20 33 32 | 30 78 32 30 30 29 20 69 |(from 32|0x200) i|
|000017e0| 73 20 73 74 69 6c 6c 20 | 6e 65 61 72 6c 79 20 32 |s still |nearly 2|
|000017f0| 78 20 66 61 73 74 65 72 | 0d 09 09 2f 2f 20 77 69 |x faster|...// wi|
|00001800| 74 68 20 64 69 72 65 63 | 74 20 73 63 72 65 65 6e |th direc|t screen|
|00001810| 20 77 72 69 74 69 6e 67 | 2c 20 74 68 6f 75 67 68 | writing|, though|
|00001820| 2e 20 28 41 73 20 79 6f | 75 27 64 20 65 78 70 65 |. (As yo|u'd expe|
|00001830| 63 74 2c 20 72 65 61 6c | 6c 79 2e 29 0d 09 09 2f |ct, real|ly.).../|
|00001840| 2f 20 54 68 61 6e 6b 73 | 20 41 6c 21 0d 0d 09 09 |/ Thanks| Al!....|
|00001850| 64 69 72 57 72 69 74 65 | 20 3d 20 43 61 6e 57 72 |dirWrite| = CanWr|
|00001860| 69 74 65 44 69 72 65 63 | 74 54 6f 53 63 72 65 65 |iteDirec|tToScree|
|00001870| 6e 28 67 57 54 46 54 57 | 69 6e 64 6f 77 29 3b 0d |n(gWTFTW|indow);.|
|00001880| 09 09 69 66 20 28 64 69 | 72 57 72 69 74 65 29 20 |..if (di|rWrite) |
|00001890| 7b 0d 09 09 09 28 2a 2a | 67 4f 66 66 73 63 72 65 |{....(**|gOffscre|
|000018a0| 65 6e 50 69 78 4d 61 70 | 2e 70 6d 54 61 62 6c 65 |enPixMap|.pmTable|
|000018b0| 29 2e 63 74 53 65 65 64 | 20 3d 20 28 2a 2a 28 2a |).ctSeed| = (**(*|
|000018c0| 2a 28 2a 2a 67 54 68 65 | 53 63 72 65 65 6e 44 65 |*(**gThe|ScreenDe|
|000018d0| 76 69 63 65 29 2e 67 64 | 50 4d 61 70 29 2e 70 6d |vice).gd|PMap).pm|
|000018e0| 54 61 62 6c 65 29 2e 63 | 74 53 65 65 64 3b 0d 09 |Table).c|tSeed;..|
|000018f0| 09 7d 0d 0d 09 09 64 75 | 62 62 6c 65 20 3d 20 72 |.}....du|bble = r|
|00001900| 65 63 74 57 69 64 74 68 | 28 26 67 57 54 46 54 57 |ectWidth|(&gWTFTW|
|00001910| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 52 65 63 74 29 |indow->p|ortRect)|
|00001920| 20 3e 3d 20 28 53 43 52 | 45 45 4e 5f 57 49 44 54 | >= (SCR|EEN_WIDT|
|00001930| 48 2a 32 29 3b 0d 09 09 | 69 66 20 28 64 75 62 62 |H*2);...|if (dubb|
|00001940| 6c 65 29 0d 09 09 09 63 | 70 46 20 3d 20 44 69 72 |le)....c|pF = Dir|
|00001950| 43 6f 70 79 50 69 78 53 | 63 61 6c 65 64 32 3b 0d |CopyPixS|caled2;.|
|00001960| 0d 09 09 2f 2f 20 57 65 | 20 6e 6f 77 20 6f 6e 6c |...// We| now onl|
|00001970| 79 20 62 6f 74 68 65 72 | 20 74 6f 20 75 73 65 20 |y bother| to use |
|00001980| 64 69 72 65 63 74 20 73 | 63 72 65 65 6e 20 77 72 |direct s|creen wr|
|00001990| 69 74 65 73 20 77 68 65 | 6e 0d 09 09 2f 2f 20 77 |ites whe|n...// w|
|000019a0| 65 27 72 65 20 73 63 61 | 6e 2d 6c 69 6e 65 20 64 |e're sca|n-line d|
|000019b0| 6f 75 62 6c 69 6e 67 2e | 0d 0d 09 09 69 66 20 28 |oubling.|....if (|
|000019c0| 64 69 72 57 72 69 74 65 | 20 26 26 20 21 67 55 73 |dirWrite| && !gUs|
|000019d0| 65 51 75 69 63 6b 44 72 | 61 77 20 26 26 20 67 47 |eQuickDr|aw && gG|
|000019e0| 61 6d 65 4f 6e 20 26 26 | 20 64 75 62 62 6c 65 29 |ameOn &&| dubble)|
|000019f0| 20 7b 0d 0d 09 09 09 63 | 70 46 28 28 6c 6f 6e 67 | {.....c|pF((long|
|00001a00| 20 2a 29 67 4f 66 66 73 | 63 72 65 65 6e 50 69 78 | *)gOffs|creenPix|
|00001a10| 4d 61 70 2e 62 61 73 65 | 41 64 64 72 2c 09 2f 2a |Map.base|Addr,./*|
|00001a20| 73 72 63 50 69 78 65 6c | 73 2a 2f 0d 09 09 09 09 |srcPixel|s*/.....|
|00001a30| 53 43 52 45 45 4e 5f 57 | 49 44 54 48 2c 09 09 09 |SCREEN_W|IDTH,...|
|00001a40| 09 09 09 2f 2a 73 72 63 | 52 6f 77 42 79 74 65 73 |.../*src|RowBytes|
|00001a50| 2a 2f 0d 09 09 09 09 53 | 43 52 45 45 4e 5f 57 49 |*/.....S|CREEN_WI|
|00001a60| 44 54 48 2c 09 09 09 09 | 09 09 2f 2a 73 72 63 57 |DTH,....|../*srcW|
|00001a70| 69 64 2a 2f 0d 09 09 09 | 09 53 43 52 45 45 4e 5f |id*/....|.SCREEN_|
|00001a80| 48 45 49 47 48 54 2c 09 | 09 09 09 09 09 2f 2a 73 |HEIGHT,.|...../*s|
|00001a90| 72 63 48 65 69 67 68 74 | 2a 2f 0d 09 09 09 09 30 |rcHeight|*/.....0|
|00001aa0| 2c 20 30 2c 09 09 09 09 | 09 09 09 09 2f 2a 77 69 |, 0,....|..../*wi|
|00001ab0| 6e 53 74 61 72 74 58 2f | 59 2a 2f 0d 09 09 09 09 |nStartX/|Y*/.....|
|00001ac0| 6e 69 6c 29 3b 09 09 09 | 09 09 09 09 09 2f 2a 70 |nil);...|...../*p|
|00001ad0| 69 78 4d 75 6e 67 65 46 | 75 6e 63 2a 2f 0d 09 09 |ixMungeF|unc*/...|
|00001ae0| 7d 0d 09 09 65 6c 73 65 | 20 7b 0d 09 09 09 52 65 |}...else| {....Re|
|00001af0| 63 74 09 64 73 74 52 65 | 63 74 3b 0d 0d 09 09 09 |ct.dstRe|ct;.....|
|00001b00| 64 73 74 52 65 63 74 20 | 3d 20 67 57 54 46 54 57 |dstRect |= gWTFTW|
|00001b10| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 52 65 63 74 3b |indow->p|ortRect;|
|00001b20| 0d 09 20 09 09 64 73 74 | 52 65 63 74 2e 62 6f 74 |.. ..dst|Rect.bot|
|00001b30| 74 6f 6d 20 2d 3d 20 6b | 42 6f 74 74 6f 6d 42 6f |tom -= k|BottomBo|
|00001b40| 72 64 65 72 3b 0d 0d 09 | 09 09 43 6f 70 79 42 69 |rder;...|..CopyBi|
|00001b50| 74 73 28 28 42 69 74 4d | 61 70 20 2a 29 26 67 4f |ts((BitM|ap *)&gO|
|00001b60| 66 66 73 63 72 65 65 6e | 50 69 78 4d 61 70 2c 20 |ffscreen|PixMap, |
|00001b70| 26 67 57 54 46 54 57 69 | 6e 64 6f 77 2d 3e 70 6f |&gWTFTWi|ndow->po|
|00001b80| 72 74 42 69 74 73 2c 0d | 09 09 09 09 09 26 67 4f |rtBits,.|.....&gO|
|00001b90| 66 66 73 63 72 65 65 6e | 50 69 78 4d 61 70 2e 62 |ffscreen|PixMap.b|
|00001ba0| 6f 75 6e 64 73 2c 20 26 | 64 73 74 52 65 63 74 2c |ounds, &|dstRect,|
|00001bb0| 20 73 72 63 43 6f 70 79 | 2c 20 6e 69 6c 29 3b 0d | srcCopy|, nil);.|
|00001bc0| 0d 09 09 7d 0d 09 7d 0d | 0d 09 53 68 6f 77 49 66 |...}..}.|..ShowIf|
|00001bd0| 50 61 75 73 65 64 28 29 | 3b 0d 0d 09 4d 6f 76 65 |Paused()|;...Move|
|00001be0| 54 6f 28 34 2c 20 67 57 | 54 46 54 57 69 6e 64 6f |To(4, gW|TFTWindo|
|00001bf0| 77 2d 3e 70 6f 72 74 52 | 65 63 74 2e 62 6f 74 74 |w->portR|ect.bott|
|00001c00| 6f 6d 20 2d 20 6b 42 6f | 74 74 6f 6d 42 6f 72 64 |om - kBo|ttomBord|
|00001c10| 65 72 20 2b 20 32 30 29 | 3b 0d 0d 09 69 66 20 28 |er + 20)|;...if (|
|00001c20| 67 47 61 6d 65 4f 6e 20 | 26 26 20 67 53 68 6f 77 |gGameOn |&& gShow|
|00001c30| 46 50 53 29 20 7b 0d 09 | 09 74 4e 6f 77 20 3d 20 |FPS) {..|.tNow = |
|00001c40| 28 54 69 63 6b 43 6f 75 | 6e 74 28 29 20 2d 20 67 |(TickCou|nt() - g|
|00001c50| 53 74 61 72 74 54 69 63 | 6b 73 29 20 2f 20 36 30 |StartTic|ks) / 60|
|00001c60| 3b 0d 09 09 69 66 20 28 | 21 74 4e 6f 77 29 0d 09 |;...if (|!tNow)..|
|00001c70| 09 09 74 4e 6f 77 20 3d | 20 31 3b 0d 0d 09 09 61 |..tNow =| 1;....a|
|00001c80| 53 74 72 5b 30 5d 20 3d | 20 73 70 72 69 6e 74 66 |Str[0] =| sprintf|
|00001c90| 28 61 53 74 72 2b 31 2c | 20 22 46 72 61 6d 65 3a |(aStr+1,| "Frame:|
|00001ca0| 20 25 6c 64 2c 20 66 70 | 73 20 25 6c 64 20 20 20 | %ld, fp|s %ld |
|00001cb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 22 2c 20 | | ", |
|00001cc0| 67 46 72 61 6d 65 43 6f | 75 6e 74 2c 20 28 28 75 |gFrameCo|unt, ((u|
|00001cd0| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 29 67 46 72 |nsigned |long)gFr|
|00001ce0| 61 6d 65 43 6f 75 6e 74 | 29 2f 74 4e 6f 77 29 3b |ameCount|)/tNow);|
|00001cf0| 0d 09 09 44 72 61 77 53 | 74 72 69 6e 67 28 28 53 |...DrawS|tring((S|
|00001d00| 74 72 69 6e 67 50 74 72 | 29 61 53 74 72 29 3b 0d |tringPtr|)aStr);.|
|00001d10| 09 7d 0d 0d 7d 0d 0d 2f | 2a 2a 2f 0d 0d 0d 76 6f |.}..}../|**/...vo|
|00001d20| 69 64 20 75 70 64 61 74 | 65 5f 73 63 72 65 65 6e |id updat|e_screen|
|00001d30| 28 46 72 61 6d 65 62 75 | 66 66 65 72 20 2a 66 62 |(Framebu|ffer *fb|
|00001d40| 29 0d 7b 0d 09 52 65 66 | 72 65 73 68 57 54 57 69 |).{..Ref|reshWTWi|
|00001d50| 6e 64 6f 77 28 29 3b 0d | 0d 09 69 66 20 28 67 47 |ndow();.|..if (gG|
|00001d60| 61 6d 65 4f 6e 29 20 7b | 0d 09 09 2b 2b 67 46 72 |ameOn) {|...++gFr|
|00001d70| 61 6d 65 43 6f 75 6e 74 | 3b 0d 09 09 69 66 20 28 |ameCount|;...if (|
|00001d80| 21 67 53 74 61 72 74 54 | 69 63 6b 73 29 0d 09 09 |!gStartT|icks)...|
|00001d90| 09 67 53 74 61 72 74 54 | 69 63 6b 73 20 3d 20 54 |.gStartT|icks = T|
|00001da0| 69 63 6b 43 6f 75 6e 74 | 28 29 3b 0d 09 7d 0d 7d |ickCount|();..}.}|
|00001db0| 0d 0d 0d 2f 2a 2a 2f 0d | 0d 0d 50 69 78 65 6c 20 |.../**/.|..Pixel |
|00001dc0| 2a 67 65 74 5f 66 72 61 | 6d 65 62 75 66 66 65 72 |*get_fra|mebuffer|
|00001dd0| 5f 6d 65 6d 6f 72 79 28 | 69 6e 74 20 77 69 64 74 |_memory(|int widt|
|00001de0| 68 2c 20 69 6e 74 20 68 | 65 69 67 68 74 29 0d 7b |h, int h|eight).{|
|00001df0| 0d 20 20 20 20 20 72 65 | 74 75 72 6e 20 28 50 69 |. re|turn (Pi|
|00001e00| 78 65 6c 20 2a 29 67 4f | 66 66 73 63 72 65 65 6e |xel *)gO|ffscreen|
|00001e10| 50 69 78 4d 61 70 2e 62 | 61 73 65 41 64 64 72 3b |PixMap.b|aseAddr;|
|00001e20| 0d 7d 0d 0d 0d 2f 2a 2a | 2a 2a 2a 2f 0d 0d 0d 73 |.}.../**|***/...s|
|00001e30| 74 61 74 69 63 20 76 6f | 69 64 20 61 64 64 5f 73 |tatic vo|id add_s|
|00001e40| 70 65 63 69 61 6c 28 49 | 6e 74 65 6e 74 20 2a 69 |pecial(I|ntent *i|
|00001e50| 6e 74 65 6e 74 2c 20 69 | 6e 74 20 73 70 65 63 69 |ntent, i|nt speci|
|00001e60| 61 6c 29 0d 7b 0d 09 69 | 66 20 28 69 6e 74 65 6e |al).{..i|f (inten|
|00001e70| 74 2d 3e 6e 5f 73 70 65 | 63 69 61 6c 20 3c 20 4d |t->n_spe|cial < M|
|00001e80| 41 58 5f 53 50 45 43 49 | 41 4c 5f 49 4e 54 45 4e |AX_SPECI|AL_INTEN|
|00001e90| 54 49 4f 4e 53 29 20 7b | 0d 09 09 69 6e 74 65 6e |TIONS) {|...inten|
|00001ea0| 74 2d 3e 73 70 65 63 69 | 61 6c 5b 69 6e 74 65 6e |t->speci|al[inten|
|00001eb0| 74 2d 3e 6e 5f 73 70 65 | 63 69 61 6c 5d 20 3d 20 |t->n_spe|cial] = |
|00001ec0| 73 70 65 63 69 61 6c 3b | 0d 09 09 69 6e 74 65 6e |special;|...inten|
|00001ed0| 74 2d 3e 6e 5f 73 70 65 | 63 69 61 6c 2b 2b 3b 0d |t->n_spe|cial++;.|
|00001ee0| 09 7d 0d 7d 0d 0d 0d 2f | 2a 2a 2f 0d 0d 23 64 65 |.}.}.../|**/..#de|
|00001ef0| 66 69 6e 65 09 4d 61 63 | 4b 65 79 44 6f 77 6e 28 |fine.Mac|KeyDown(|
|00001f00| 6b 6d 70 2c 20 63 6f 64 | 65 29 09 28 28 6b 6d 70 |kmp, cod|e).((kmp|
|00001f10| 5b 63 6f 64 65 3e 3e 33 | 5d 20 3e 3e 20 28 63 6f |[code>>3|] >> (co|
|00001f20| 64 65 20 26 20 37 29 29 | 20 26 20 31 29 0d 0d 49 |de & 7))| & 1)..I|
|00001f30| 6e 74 65 6e 74 20 2a 72 | 65 61 64 5f 69 6e 70 75 |ntent *r|ead_inpu|
|00001f40| 74 5f 64 65 76 69 63 65 | 73 28 76 6f 69 64 29 0d |t_device|s(void).|
|00001f50| 7b 0d 09 75 6e 73 69 67 | 6e 65 64 20 63 68 61 72 |{..unsig|ned char|
|00001f60| 20 6b 6d 70 5b 31 36 5d | 3b 0d 09 42 6f 6f 6c 65 | kmp[16]|;..Boole|
|00001f70| 61 6e 09 72 6f 74 61 74 | 69 6e 67 5f 63 77 2c 0d |an.rotat|ing_cw,.|
|00001f80| 09 09 09 72 6f 74 61 74 | 69 6e 67 5f 63 63 77 2c |...rotat|ing_ccw,|
|00001f90| 0d 09 09 09 6d 6f 76 69 | 6e 67 5f 66 6f 72 77 61 |....movi|ng_forwa|
|00001fa0| 72 64 2c 0d 09 09 09 6d | 6f 76 69 6e 67 5f 62 61 |rd,....m|oving_ba|
|00001fb0| 63 6b 77 61 72 64 2c 0d | 09 09 09 72 75 6e 6e 69 |ckward,.|...runni|
|00001fc0| 6e 67 2c 0d 09 09 09 73 | 74 72 61 66 69 6e 67 3b |ng,....s|trafing;|
|00001fd0| 0d 09 73 74 72 75 63 74 | 20 7b 0d 09 09 69 6e 74 |..struct| {...int|
|00001fe0| 09 09 72 69 67 68 74 41 | 72 72 6f 77 2c 0d 09 09 |..rightA|rrow,...|
|00001ff0| 09 09 6c 65 66 74 41 72 | 72 6f 77 2c 0d 09 09 09 |..leftAr|row,....|
|00002000| 09 75 70 41 72 72 6f 77 | 2c 0d 09 09 09 09 64 6f |.upArrow|,.....do|
|00002010| 77 6e 41 72 72 6f 77 2c | 0d 09 09 09 09 63 6f 6e |wnArrow,|.....con|
|00002020| 74 72 6f 6c 2c 0d 09 09 | 09 09 65 73 63 61 70 65 |trol,...|..escape|
|00002030| 2c 0d 09 09 09 09 73 68 | 69 66 74 2c 0d 09 09 09 |,.....sh|ift,....|
|00002040| 09 73 6c 61 73 68 2c 0d | 09 09 09 09 73 70 61 63 |.slash,.|....spac|
|00002050| 65 2c 0d 09 09 09 09 74 | 61 62 4b 65 79 3b 0d 09 |e,.....t|abKey;..|
|00002060| 7d 20 6b 65 79 62 6f 61 | 72 64 3b 0d 0d 0d 09 67 |} keyboa|rd;....g|
|00002070| 49 6e 74 65 6e 74 2e 66 | 6f 72 63 65 5f 78 20 3d |Intent.f|orce_x =|
|00002080| 20 67 49 6e 74 65 6e 74 | 2e 66 6f 72 63 65 5f 79 | gIntent|.force_y|
|00002090| 20 3d 20 67 49 6e 74 65 | 6e 74 2e 66 6f 72 63 65 | = gInte|nt.force|
|000020a0| 5f 7a 20 3d 20 30 2e 30 | 3b 0d 09 67 49 6e 74 65 |_z = 0.0|;..gInte|
|000020b0| 6e 74 2e 66 6f 72 63 65 | 5f 72 6f 74 61 74 65 20 |nt.force|_rotate |
|000020c0| 3d 20 30 2e 30 3b 0d 09 | 67 49 6e 74 65 6e 74 2e |= 0.0;..|gIntent.|
|000020d0| 6e 5f 73 70 65 63 69 61 | 6c 20 3d 20 30 3b 0d 0d |n_specia|l = 0;..|
|000020e0| 09 64 6f 20 7b 0d 09 09 | 47 65 74 41 6e 64 50 72 |.do {...|GetAndPr|
|000020f0| 6f 63 65 73 73 45 76 65 | 6e 74 28 29 3b 0d 0d 09 |ocessEve|nt();...|
|00002100| 09 47 65 74 4b 65 79 73 | 28 28 6c 6f 6e 67 20 2a |.GetKeys|((long *|
|00002110| 29 6b 6d 70 29 3b 0d 0d | 09 09 69 66 20 28 67 50 |)kmp);..|..if (gP|
|00002120| 61 75 73 65 64 29 20 7b | 0d 09 09 09 67 53 74 61 |aused) {|....gSta|
|00002130| 72 74 54 69 63 6b 73 20 | 3d 20 67 46 72 61 6d 65 |rtTicks |= gFrame|
|00002140| 43 6f 75 6e 74 20 3d 20 | 30 3b 0d 09 09 09 53 68 |Count = |0;....Sh|
|00002150| 6f 77 49 66 50 61 75 73 | 65 64 28 29 3b 0d 09 09 |owIfPaus|ed();...|
|00002160| 09 69 6e 69 74 5f 69 6e | 70 75 74 5f 64 65 76 69 |.init_in|put_devi|
|00002170| 63 65 73 28 29 3b 09 09 | 2f 2f 20 7a 65 72 6f 20 |ces();..|// zero |
|00002180| 6f 75 74 20 74 68 65 20 | 22 69 6e 74 65 6e 74 22 |out the |"intent"|
|00002190| 20 73 74 72 75 63 74 75 | 72 65 2e 2e 2e 0d 09 09 | structu|re......|
|000021a0| 7d 0d 0d 09 09 69 66 20 | 28 21 67 47 61 6d 65 4f |}....if |(!gGameO|
|000021b0| 6e 29 20 7b 0d 09 09 09 | 2f 2f 20 69 66 20 74 68 |n) {....|// if th|
|000021c0| 65 20 66 6f 72 77 61 72 | 64 20 6b 65 79 20 69 73 |e forwar|d key is|
|000021d0| 20 70 72 65 73 73 65 64 | 2c 20 73 74 61 72 74 20 | pressed|, start |
|000021e0| 74 68 65 20 67 61 6d 65 | 20 69 6d 6d 65 64 69 61 |the game| immedia|
|000021f0| 74 65 6c 79 21 0d 09 09 | 09 69 66 20 28 4d 61 63 |tely!...|.if (Mac|
|00002200| 4b 65 79 44 6f 77 6e 28 | 6b 6d 70 2c 20 30 78 37 |KeyDown(|kmp, 0x7|
|00002210| 65 29 20 7c 7c 20 4d 61 | 63 4b 65 79 44 6f 77 6e |e) || Ma|cKeyDown|
|00002220| 28 6b 6d 70 2c 20 30 78 | 35 62 29 29 0d 09 09 09 |(kmp, 0x|5b))....|
|00002230| 09 42 65 67 69 6e 47 61 | 6d 65 28 29 3b 0d 09 09 |.BeginGa|me();...|
|00002240| 09 65 6c 73 65 0d 09 09 | 09 09 4d 61 63 41 74 74 |.else...|..MacAtt|
|00002250| 72 61 63 74 4d 6f 64 65 | 28 29 3b 0d 09 09 7d 0d |ractMode|();...}.|
|00002260| 0d 09 7d 20 77 68 69 6c | 65 20 28 21 67 47 61 6d |..} whil|e (!gGam|
|00002270| 65 4f 6e 20 7c 7c 20 28 | 67 50 61 75 73 65 64 20 |eOn || (|gPaused |
|00002280| 26 26 20 21 67 44 6f 6e | 65 29 29 3b 0d 0d 0d 09 |&& !gDon|e));....|
|00002290| 6b 65 79 62 6f 61 72 64 | 2e 72 69 67 68 74 41 72 |keyboard|.rightAr|
|000022a0| 72 6f 77 20 3d 20 4d 61 | 63 4b 65 79 44 6f 77 6e |row = Ma|cKeyDown|
|000022b0| 28 6b 6d 70 2c 20 30 78 | 37 43 29 20 7c 7c 20 4d |(kmp, 0x|7C) || M|
|000022c0| 61 63 4b 65 79 44 6f 77 | 6e 28 6b 6d 70 2c 20 30 |acKeyDow|n(kmp, 0|
|000022d0| 78 35 38 29 3b 0d 09 6b | 65 79 62 6f 61 72 64 2e |x58);..k|eyboard.|
|000022e0| 6c 65 66 74 41 72 72 6f | 77 20 3d 20 4d 61 63 4b |leftArro|w = MacK|
|000022f0| 65 79 44 6f 77 6e 28 6b | 6d 70 2c 20 30 78 37 62 |eyDown(k|mp, 0x7b|
|00002300| 29 20 7c 7c 20 4d 61 63 | 4b 65 79 44 6f 77 6e 28 |) || Mac|KeyDown(|
|00002310| 6b 6d 70 2c 20 30 78 35 | 36 29 3b 0d 09 6b 65 79 |kmp, 0x5|6);..key|
|00002320| 62 6f 61 72 64 2e 75 70 | 41 72 72 6f 77 20 3d 20 |board.up|Arrow = |
|00002330| 4d 61 63 4b 65 79 44 6f | 77 6e 28 6b 6d 70 2c 20 |MacKeyDo|wn(kmp, |
|00002340| 30 78 37 65 29 20 7c 7c | 20 4d 61 63 4b 65 79 44 |0x7e) ||| MacKeyD|
|00002350| 6f 77 6e 28 6b 6d 70 2c | 20 30 78 35 62 29 3b 0d |own(kmp,| 0x5b);.|
|00002360| 09 6b 65 79 62 6f 61 72 | 64 2e 64 6f 77 6e 41 72 |.keyboar|d.downAr|
|00002370| 72 6f 77 20 3d 20 4d 61 | 63 4b 65 79 44 6f 77 6e |row = Ma|cKeyDown|
|00002380| 28 6b 6d 70 2c 20 30 78 | 37 64 29 20 7c 7c 20 4d |(kmp, 0x|7d) || M|
|00002390| 61 63 4b 65 79 44 6f 77 | 6e 28 6b 6d 70 2c 20 30 |acKeyDow|n(kmp, 0|
|000023a0| 78 35 34 29 3b 0d 09 6b | 65 79 62 6f 61 72 64 2e |x54);..k|eyboard.|
|000023b0| 63 6f 6e 74 72 6f 6c 20 | 3d 20 4d 61 63 4b 65 79 |control |= MacKey|
|000023c0| 44 6f 77 6e 28 6b 6d 70 | 2c 20 30 78 33 62 29 20 |Down(kmp|, 0x3b) |
|000023d0| 7c 7c 20 4d 61 63 4b 65 | 79 44 6f 77 6e 28 6b 6d ||| MacKe|yDown(km|
|000023e0| 70 2c 20 30 78 33 37 29 | 3b 09 2f 2f 20 43 74 72 |p, 0x37)|;.// Ctr|
|000023f0| 6c 20 6f 72 20 43 6d 64 | 0d 09 6b 65 79 62 6f 61 |l or Cmd|..keyboa|
|00002400| 72 64 2e 73 68 69 66 74 | 20 3d 20 4d 61 63 4b 65 |rd.shift| = MacKe|
|00002410| 79 44 6f 77 6e 28 6b 6d | 70 2c 20 30 78 33 38 29 |yDown(km|p, 0x38)|
|00002420| 20 7c 7c 20 4d 61 63 4b | 65 79 44 6f 77 6e 28 6b | || MacK|eyDown(k|
|00002430| 6d 70 2c 20 30 78 33 63 | 29 3b 0d 09 6b 65 79 62 |mp, 0x3c|);..keyb|
|00002440| 6f 61 72 64 2e 73 6c 61 | 73 68 20 3d 20 4d 61 63 |oard.sla|sh = Mac|
|00002450| 4b 65 79 44 6f 77 6e 28 | 6b 6d 70 2c 20 30 78 32 |KeyDown(|kmp, 0x2|
|00002460| 63 29 20 7c 7c 20 4d 61 | 63 4b 65 79 44 6f 77 6e |c) || Ma|cKeyDown|
|00002470| 28 6b 6d 70 2c 20 30 78 | 34 62 29 3b 0d 09 6b 65 |(kmp, 0x|4b);..ke|
|00002480| 79 62 6f 61 72 64 2e 73 | 70 61 63 65 20 3d 20 4d |yboard.s|pace = M|
|00002490| 61 63 4b 65 79 44 6f 77 | 6e 28 6b 6d 70 2c 20 30 |acKeyDow|n(kmp, 0|
|000024a0| 78 33 31 29 3b 0d 09 6b | 65 79 62 6f 61 72 64 2e |x31);..k|eyboard.|
|000024b0| 74 61 62 4b 65 79 20 3d | 20 4d 61 63 4b 65 79 44 |tabKey =| MacKeyD|
|000024c0| 6f 77 6e 28 6b 6d 70 2c | 20 30 78 33 30 29 3b 0d |own(kmp,| 0x30);.|
|000024d0| 09 6b 65 79 62 6f 61 72 | 64 2e 65 73 63 61 70 65 |.keyboar|d.escape|
|000024e0| 20 3d 20 4d 61 63 4b 65 | 79 44 6f 77 6e 28 6b 6d | = MacKe|yDown(km|
|000024f0| 70 2c 20 30 78 33 35 29 | 20 7c 7c 20 4d 61 63 4b |p, 0x35)| || MacK|
|00002500| 65 79 44 6f 77 6e 28 6b | 6d 70 2c 20 30 78 33 32 |eyDown(k|mp, 0x32|
|00002510| 29 3b 0d 0d 0d 09 2f 2f | 20 6c 6f 67 69 63 20 73 |);....//| logic s|
|00002520| 6e 61 72 66 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |narfed f|rom the |
|00002530| 6f 72 69 67 69 6e 61 6c | 20 22 78 31 31 69 6e 70 |original| "x11inp|
|00002540| 75 74 2e 63 22 0d 0d 09 | 72 6f 74 61 74 69 6e 67 |ut.c"...|rotating|
|00002550| 5f 63 63 77 20 3d 20 6b | 65 79 62 6f 61 72 64 2e |_ccw = k|eyboard.|
|00002560| 6c 65 66 74 41 72 72 6f | 77 3b 0d 09 72 6f 74 61 |leftArro|w;..rota|
|00002570| 74 69 6e 67 5f 63 77 20 | 3d 20 6b 65 79 62 6f 61 |ting_cw |= keyboa|
|00002580| 72 64 2e 72 69 67 68 74 | 41 72 72 6f 77 3b 0d 09 |rd.right|Arrow;..|
|00002590| 6d 6f 76 69 6e 67 5f 66 | 6f 72 77 61 72 64 20 3d |moving_f|orward =|
|000025a0| 20 6b 65 79 62 6f 61 72 | 64 2e 75 70 41 72 72 6f | keyboar|d.upArro|
|000025b0| 77 3b 0d 09 6d 6f 76 69 | 6e 67 5f 62 61 63 6b 77 |w;..movi|ng_backw|
|000025c0| 61 72 64 20 3d 20 6b 65 | 79 62 6f 61 72 64 2e 64 |ard = ke|yboard.d|
|000025d0| 6f 77 6e 41 72 72 6f 77 | 3b 0d 09 72 75 6e 6e 69 |ownArrow|;..runni|
|000025e0| 6e 67 20 3d 20 6b 65 79 | 62 6f 61 72 64 2e 73 68 |ng = key|board.sh|
|000025f0| 69 66 74 3b 0d 09 73 74 | 72 61 66 69 6e 67 20 3d |ift;..st|rafing =|
|00002600| 20 6b 65 79 62 6f 61 72 | 64 2e 73 6c 61 73 68 20 | keyboar|d.slash |
|00002610| 7c 7c 20 6b 65 79 62 6f | 61 72 64 2e 63 6f 6e 74 ||| keybo|ard.cont|
|00002620| 72 6f 6c 3b 0d 0d 09 69 | 66 20 28 6b 65 79 62 6f |rol;...i|f (keybo|
|00002630| 61 72 64 2e 73 70 61 63 | 65 29 0d 09 20 20 20 20 |ard.spac|e).. |
|00002640| 61 64 64 5f 73 70 65 63 | 69 61 6c 28 26 67 49 6e |add_spec|ial(&gIn|
|00002650| 74 65 6e 74 2c 20 49 4e | 54 45 4e 54 5f 4a 55 4d |tent, IN|TENT_JUM|
|00002660| 50 29 3b 0d 0d 09 69 66 | 20 28 67 44 6f 6e 65 29 |P);...if| (gDone)|
|00002670| 0d 09 09 61 64 64 5f 73 | 70 65 63 69 61 6c 28 26 |...add_s|pecial(&|
|00002680| 67 49 6e 74 65 6e 74 2c | 20 49 4e 54 45 4e 54 5f |gIntent,| INTENT_|
|00002690| 45 4e 44 5f 47 41 4d 45 | 29 3b 0d 0d 0d 09 69 66 |END_GAME|);....if|
|000026a0| 20 28 72 6f 74 61 74 69 | 6e 67 5f 63 77 29 20 7b | (rotati|ng_cw) {|
|000026b0| 0d 09 09 69 66 20 28 73 | 74 72 61 66 69 6e 67 29 |...if (s|trafing)|
|000026c0| 0d 09 09 09 67 49 6e 74 | 65 6e 74 2e 66 6f 72 63 |....gInt|ent.forc|
|000026d0| 65 5f 79 20 2d 3d 20 30 | 2e 35 3b 0d 09 09 65 6c |e_y -= 0|.5;...el|
|000026e0| 73 65 0d 09 09 09 67 49 | 6e 74 65 6e 74 2e 66 6f |se....gI|ntent.fo|
|000026f0| 72 63 65 5f 72 6f 74 61 | 74 65 20 2d 3d 20 30 2e |rce_rota|te -= 0.|
|00002700| 35 3b 0d 09 7d 0d 09 69 | 66 20 28 72 6f 74 61 74 |5;..}..i|f (rotat|
|00002710| 69 6e 67 5f 63 63 77 29 | 20 7b 0d 09 09 69 66 20 |ing_ccw)| {...if |
|00002720| 28 73 74 72 61 66 69 6e | 67 29 20 7b 0d 09 09 09 |(strafin|g) {....|
|00002730| 67 49 6e 74 65 6e 74 2e | 66 6f 72 63 65 5f 79 20 |gIntent.|force_y |
|00002740| 2b 3d 20 30 2e 35 3b 0d | 09 09 7d 20 65 6c 73 65 |+= 0.5;.|..} else|
|00002750| 0d 09 09 09 67 49 6e 74 | 65 6e 74 2e 66 6f 72 63 |....gInt|ent.forc|
|00002760| 65 5f 72 6f 74 61 74 65 | 20 2b 3d 20 30 2e 35 3b |e_rotate| += 0.5;|
|00002770| 0d 09 7d 0d 09 69 66 20 | 28 6d 6f 76 69 6e 67 5f |..}..if |(moving_|
|00002780| 66 6f 72 77 61 72 64 29 | 0d 09 09 67 49 6e 74 65 |forward)|...gInte|
|00002790| 6e 74 2e 66 6f 72 63 65 | 5f 78 20 2b 3d 20 30 2e |nt.force|_x += 0.|
|000027a0| 35 3b 0d 09 69 66 20 28 | 6d 6f 76 69 6e 67 5f 62 |5;..if (|moving_b|
|000027b0| 61 63 6b 77 61 72 64 29 | 0d 09 09 67 49 6e 74 65 |ackward)|...gInte|
|000027c0| 6e 74 2e 66 6f 72 63 65 | 5f 78 20 2d 3d 20 30 2e |nt.force|_x -= 0.|
|000027d0| 35 3b 0d 09 69 66 20 28 | 72 75 6e 6e 69 6e 67 29 |5;..if (|running)|
|000027e0| 20 7b 0d 09 09 67 49 6e | 74 65 6e 74 2e 66 6f 72 | {...gIn|tent.for|
|000027f0| 63 65 5f 78 20 2a 3d 20 | 32 2e 30 3b 0d 09 09 67 |ce_x *= |2.0;...g|
|00002800| 49 6e 74 65 6e 74 2e 66 | 6f 72 63 65 5f 79 20 2a |Intent.f|orce_y *|
|00002810| 3d 20 32 2e 30 3b 0d 09 | 09 67 49 6e 74 65 6e 74 |= 2.0;..|.gIntent|
|00002820| 2e 66 6f 72 63 65 5f 7a | 20 2a 3d 20 32 2e 30 3b |.force_z| *= 2.0;|
|00002830| 0d 09 09 67 49 6e 74 65 | 6e 74 2e 66 6f 72 63 65 |...gInte|nt.force|
|00002840| 5f 72 6f 74 61 74 65 20 | 2a 3d 20 32 2e 30 3b 0d |_rotate |*= 2.0;.|
|00002850| 09 7d 0d 0d 09 72 65 74 | 75 72 6e 20 26 67 49 6e |.}...ret|urn &gIn|
|00002860| 74 65 6e 74 3b 0d 7d 0d | 0d 00 00 00 00 00 00 00 |tent;.}.|........|
|00002870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002880| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00002890| 57 41 52 52 41 4e 54 59 | 3b 20 77 69 74 68 6f 75 |WARRANTY|; withou|
|000028a0| 74 20 65 76 65 6e 20 74 | 68 65 20 69 6d 70 6c 69 |t even t|he impli|
|000028b0| 07 4d 61 63 57 54 2e 63 | 02 00 00 00 50 61 72 74 |.MacWT.c|....Part|
|000028c0| 53 49 54 78 00 00 00 00 | 00 00 00 00 00 02 58 70 |SITx....|......Xp|
|000028d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 aa 13 b9 8c 00 00 | 00 00 00 00 01 ac 68 65 |........|......he|
|00002900| 0d 2a 2a 20 20 47 4e 55 | 20 47 65 6e 65 72 61 6c |.** GNU| General|
|00002910| 20 50 75 62 6c 69 63 20 | 4c 69 63 65 6e 73 65 20 | Public |License |
|00002920| 66 6f 72 20 6d 6f 72 65 | 20 64 65 74 61 69 6c 73 |for more| details|
|00002930| 2e 0d 2a 2a 0d 2a 2a 20 | 20 59 6f 75 20 73 68 6f |..**.** | You sho|
|00002940| 75 6c 64 20 68 61 76 65 | 20 72 65 63 65 69 76 65 |uld have| receive|
|00002950| 64 20 61 20 63 6f 70 79 | 20 6f 66 20 74 68 65 20 |d a copy| of the |
|00002960| 47 4e 55 20 47 65 6e 65 | 72 61 6c 20 50 75 62 6c |GNU Gene|ral Publ|
|00002970| 69 63 20 4c 69 63 65 6e | 73 65 0d 2a 2a 20 20 61 |ic Licen|se.** a|
|00002980| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029a0| 00 00 00 00 00 00 00 06 | 00 04 00 7b 00 79 02 44 |........|...{.y.D|
|000029b0| 02 8f 00 7b 00 79 02 44 | 02 8f a9 f5 d1 ac 00 00 |...{.y.D|........|
|000029c0| 1a 61 00 00 1a 61 00 00 | 18 12 01 00 00 00 00 1e |.a...a..|........|
|000029d0| 00 7b 00 79 02 44 02 8f | 00 7b 00 79 02 44 02 8f |.{.y.D..|.{.y.D..|
|000029e0| 00 00 18 12 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 b4 |.....n..|.n...>..|
|00002a00| 57 c8 0d 3a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |W..:....|.>..MPSR|
|00002a10| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00002a20| 03 f0 ff ff 00 00 00 4c | 00 b6 aa 8c 00 00 00 00 |.......L|........|
|00002a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+