home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / sillies / moontool < prev   
ArcFS Archive  |  1994-10-16  |  50.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: ArcFS Archive (archive/arcFS).

You can browse this item here: moontool

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert ArcFS Archive (archive/arcFS) magic Supported
100% file RISC OS archive (ArcFS format) default
99% file data default
100% TrID Acorn ArcFS Archive default
100% gt2 Kopftext: 'Archive' default (weak)
100% detectItEasy Archive: ArcFS default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 41 72 63 68 69 76 65 00 | 20 01 00 00 54 03 00 00 |Archive.| ...T...|
|00000010| 28 00 00 00 64 00 00 00 | 00 00 00 00 00 00 00 00 |(...d...|........|
|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 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 82 21 4d 6f 6f 6e 54 6f | 6f 6c 00 00 ff ff ff ff |.!MoonTo|ol......|
|00000070| 45 ff ff ff 24 5f 0c a1 | 3b 00 00 00 ff ff ff ff |E...$_..|;.......|
|00000080| fc 00 00 80 82 21 48 65 | 6c 70 00 00 00 00 00 00 |.....!He|lp......|
|00000090| 30 8a 00 00 44 ff ff ff | 51 51 52 c6 3b 00 a8 2b |0...D...|QQR.;..+|
|000000a0| 30 8a 00 00 24 00 00 00 | 82 21 52 75 6e 00 00 00 |0...$...|.!Run...|
|000000b0| 00 00 00 00 73 00 00 00 | 44 eb ff ff 37 14 1a af |....s...|D...7...|
|000000c0| 3b 00 db ce 73 00 00 00 | 78 8a 00 00 82 21 53 70 |;...s...|x....!Sp|
|000000d0| 72 69 74 65 73 00 00 00 | 14 0c 00 00 44 f9 ff ff |rites...|....D...|
|000000e0| 48 c1 f5 b5 3b 00 ae fd | 14 0c 00 00 0f 8b 00 00 |H...;...|........|
|000000f0| 82 6d 6f 6f 6e 74 6f 6f | 6c 00 00 00 ef 23 00 00 |.moontoo|l....#..|
|00000100| 44 f8 ff ff 9d c7 42 c6 | 3b 00 71 d4 ef 23 00 00 |D.....B.|;.q..#..|
|00000110| 47 97 00 00 82 54 65 6d | 70 6c 61 74 65 73 00 00 |G....Tem|plates..|
|00000120| e7 0c 00 00 44 ec ff ff | 79 04 24 ae 3b 00 93 99 |....D...|y.$.;...|
|00000130| e7 0c 00 00 5a bb 00 00 | 00 61 73 6d 00 00 00 00 |....Z...|.asm....|
|00000140| 00 00 00 00 6d 00 00 00 | 44 d7 ff ff b1 86 8a 93 |....m...|D.......|
|00000150| 03 00 65 0d 6d 00 00 00 | ae 03 00 00 00 00 00 00 |..e.m...|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000270| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 46 69 6c 65 | 44 61 74 61 82 21 48 65 |....File|Data.!He|
|00000360| 6c 70 00 00 00 00 00 00 | 30 8a 00 00 45 fd ff ff |lp......|0...E...|
|00000370| 43 5f 0c a1 03 00 a8 2b | 2f 2a 0a 20 20 20 20 20 |C_.....+|/*. |
|00000380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000390| 20 20 20 4d 6f 6f 6e 20 | 54 6f 6f 6c 20 66 6f 72 | Moon |Tool for|
|000003a0| 20 74 68 65 20 41 72 63 | 68 69 6d 65 64 65 73 0a | the Arc|himedes.|
|000003b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000003c0| 20 20 20 20 20 20 20 20 | 3d 3d 3d 3d 3d 3d 3d 3d | |========|
|000003d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000003e0| 3d 3d 3d 3d 0a 0a 20 20 | 20 20 20 20 20 20 20 20 |====.. | |
|000003f0| 20 53 75 6e 20 57 6f 72 | 6b 73 74 61 74 69 6f 6e | Sun Wor|kstation|
|00000400| 20 76 65 72 73 69 6f 6e | 20 2e 2e 2e 2e 2e 2e 2e | version| .......|
|00000410| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 20 4a 6f 68 6e 20 57 |........|. John W|
|00000420| 61 6c 6b 65 72 0a 20 20 | 20 20 20 20 20 20 20 20 |alker. | |
|00000430| 20 41 72 63 68 69 6d 65 | 64 65 73 20 52 69 73 63 | Archime|des Risc|
|00000440| 20 4f 53 20 33 2e 31 20 | 70 6f 72 74 20 2e 2e 2e | OS 3.1 |port ...|
|00000450| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 20 45 64 6f 75 61 72 |........|. Edouar|
|00000460| 64 20 50 6f 6f 72 0a 0a | 20 20 20 20 20 20 20 20 |d Poor..| |
|00000470| 20 20 20 20 20 20 20 20 | 20 20 20 54 68 69 73 20 | | This |
|00000480| 20 70 72 6f 67 72 61 6d | 20 69 73 20 69 6e 20 74 | program| is in t|
|00000490| 68 65 20 70 75 62 6c 69 | 63 20 64 6f 6d 61 69 6e |he publi|c domain|
|000004a0| 3a 20 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |: . | |
|000004b0| 22 44 6f 20 77 68 61 74 | 20 74 68 6f 75 20 77 69 |"Do what| thou wi|
|000004c0| 6c 74 20 73 68 61 6c 6c | 20 62 65 20 74 68 65 20 |lt shall| be the |
|000004d0| 77 68 6f 6c 65 20 6f 66 | 20 74 68 65 20 6c 61 77 |whole of| the law|
|000004e0| 22 2e 0a 0a 0a 49 6e 74 | 72 6f 64 75 63 74 69 6f |"....Int|roductio|
|000004f0| 6e 0a 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0a 0a |n.======|======..|
|00000500| 20 20 20 4d 6f 6f 6e 54 | 6f 6f 6c 20 69 73 20 61 | MoonT|ool is a|
|00000510| 20 70 72 6f 67 72 61 6d | 20 64 65 73 69 67 6e 65 | program| designe|
|00000520| 64 20 67 69 76 65 20 79 | 6f 75 20 74 68 65 20 66 |d give y|ou the f|
|00000530| 6f 6c 6c 6f 77 69 6e 67 | 20 69 6e 66 6f 6d 61 74 |ollowing| infomat|
|00000540| 69 6f 6e 3a 0a 0a 20 20 | 20 20 20 20 6f 20 20 50 |ion:.. | o P|
|00000550| 68 61 73 65 20 6f 66 20 | 74 68 65 20 4d 6f 6f 6e |hase of |the Moon|
|00000560| 0a 0a 20 20 20 20 20 20 | 6f 20 20 41 67 65 20 6f |.. |o Age o|
|00000570| 66 20 74 68 65 20 4d 6f | 6f 6e 0a 0a 20 20 20 20 |f the Mo|on.. |
|00000580| 20 20 6f 20 20 44 69 73 | 74 61 6e 63 65 20 74 6f | o Dis|tance to|
|00000590| 20 74 68 65 20 6d 6f 6f | 6e 0a 0a 20 20 20 20 20 | the moo|n.. |
|000005a0| 20 6f 20 20 44 61 74 65 | 73 20 6f 66 20 74 68 65 | o Date|s of the|
|000005b0| 20 4c 61 73 74 20 61 6e | 64 20 4e 65 78 74 20 4e | Last an|d Next N|
|000005c0| 65 77 20 6d 6f 6f 6e 20 | 61 73 20 77 65 6c 6c 20 |ew moon |as well |
|000005d0| 61 73 20 74 68 65 20 46 | 69 72 73 74 20 61 6e 64 |as the F|irst and|
|000005e0| 0a 20 20 20 20 20 20 20 | 20 20 4c 61 73 74 20 51 |. | Last Q|
|000005f0| 75 61 72 74 65 72 73 20 | 61 6e 64 20 74 68 65 20 |uarters |and the |
|00000600| 46 75 6c 6c 20 4d 6f 6f | 6e 2e 0a 0a 20 20 20 20 |Full Moo|n... |
|00000610| 20 20 6f 20 20 41 6e 67 | 6c 65 20 74 68 65 20 4d | o Ang|le the M|
|00000620| 6f 6f 6e 20 73 75 62 74 | 65 6e 64 73 0a 0a 20 20 |oon subt|ends.. |
|00000630| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 20 69 74 20 | In addi|tion it |
|00000640| 61 6c 73 6f 20 67 69 76 | 65 73 20 79 6f 75 20 69 |also giv|es you i|
|00000650| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00000660| 3a 0a 0a 20 20 20 20 20 | 20 6f 20 20 54 69 6d 65 |:.. | o Time|
|00000670| 20 61 6e 64 20 44 61 74 | 65 20 69 6e 20 4a 75 6c | and Dat|e in Jul|
|00000680| 69 61 6e 2c 20 4c 6f 63 | 61 6c 20 61 6e 64 20 55 |ian, Loc|al and U|
|00000690| 6e 69 76 65 72 73 61 6c | 20 28 47 4d 54 29 20 74 |niversal| (GMT) t|
|000006a0| 69 6d 65 73 2e 0a 0a 20 | 20 20 20 20 20 6f 20 20 |imes... | o |
|000006b0| 44 69 73 74 61 6e 63 65 | 20 74 6f 20 74 68 65 20 |Distance| to the |
|000006c0| 53 75 6e 0a 20 0a 20 20 | 20 20 20 20 6f 20 20 41 |Sun. . | o A|
|000006d0| 6e 67 6c 65 20 74 68 65 | 20 53 75 6e 20 73 75 62 |ngle the| Sun sub|
|000006e0| 74 65 6e 64 73 0a 0a 20 | 20 20 41 6e 20 69 6e 76 |tends.. | An inv|
|000006f0| 61 6c 75 61 62 6c 65 20 | 74 6f 6f 6c 20 66 6f 72 |aluable |tool for|
|00000700| 20 74 68 6f 73 65 20 6f | 66 20 79 6f 75 20 77 68 | those o|f you wh|
|00000710| 6f 20 64 6f 6e 27 74 20 | 6c 69 6b 65 20 67 6f 69 |o don't |like goi|
|00000720| 6e 67 20 6f 75 74 73 69 | 64 65 20 74 6f 20 6c 6f |ng outsi|de to lo|
|00000730| 6f 6b 0a 20 20 20 61 74 | 20 74 68 65 20 6d 6f 6f |ok. at| the moo|
|00000740| 6e 2c 20 61 6c 6c 20 74 | 68 65 20 6e 65 74 68 61 |n, all t|he netha|
|00000750| 63 6b 20 70 6c 61 79 65 | 72 73 20 61 6d 6f 6e 67 |ck playe|rs among|
|00000760| 20 79 6f 75 2c 20 61 73 | 74 72 6f 6e 6f 6d 65 72 | you, as|tronomer|
|00000770| 73 20 77 68 6f 20 6c 69 | 6b 65 0a 20 20 20 74 6f |s who li|ke. to|
|00000780| 20 6b 6e 6f 77 20 77 68 | 65 6e 20 74 68 65 20 6d | know wh|en the m|
|00000790| 6f 6f 6e 20 69 74 20 6e | 65 77 20 61 6e 64 20 74 |oon it n|ew and t|
|000007a0| 68 75 73 20 74 68 65 20 | 73 74 61 72 73 20 61 72 |hus the |stars ar|
|000007b0| 65 20 61 74 20 74 68 65 | 69 72 20 62 65 73 74 20 |e at the|ir best |
|000007c0| 76 69 65 77 69 6e 67 2c | 0a 20 20 20 6f 72 20 69 |viewing,|. or i|
|000007d0| 6e 64 65 65 64 20 61 6e | 79 6f 6e 65 20 77 68 6f |ndeed an|yone who|
|000007e0| 20 6a 75 73 74 20 72 65 | 61 6c 6c 79 20 6e 65 65 | just re|ally nee|
|000007f0| 64 73 20 74 6f 20 65 78 | 61 63 74 6c 79 20 68 6f |ds to ex|actly ho|
|00000800| 77 20 66 61 72 20 61 77 | 61 79 20 74 68 65 20 6d |w far aw|ay the m|
|00000810| 6f 6f 6e 0a 20 20 20 61 | 6e 64 20 73 75 6e 20 61 |oon. a|nd sun a|
|00000820| 72 65 2e 2e 2e 0a 0a 0a | 49 6e 74 65 72 66 61 63 |re......|Interfac|
|00000830| 65 0a 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0a 0a 20 20 20 |e.======|===.. |
|00000840| 54 68 65 20 70 72 6f 67 | 72 61 6d 20 73 74 61 72 |The prog|ram star|
|00000850| 74 73 20 75 70 20 69 6e | 20 69 74 27 73 20 69 63 |ts up in| it's ic|
|00000860| 6f 6e 69 73 65 64 20 6d | 6f 64 65 2c 20 67 69 76 |onised m|ode, giv|
|00000870| 69 6e 67 20 79 6f 75 20 | 61 20 73 69 6d 70 6c 65 |ing you |a simple|
|00000880| 20 77 69 6e 64 6f 77 0a | 20 20 20 77 69 74 68 20 | window.| with |
|00000890| 61 20 73 69 6e 67 6c 65 | 20 62 75 74 74 6f 6e 20 |a single| button |
|000008a0| 64 69 73 70 6c 61 79 69 | 6e 67 20 61 20 70 69 63 |displayi|ng a pic|
|000008b0| 74 75 72 65 20 6f 66 20 | 74 68 65 20 6d 6f 6f 6e |ture of |the moon|
|000008c0| 20 61 73 20 69 74 20 61 | 70 70 65 61 72 73 0a 20 | as it a|ppears. |
|000008d0| 20 20 69 6e 20 74 68 65 | 20 73 6b 79 2e 20 59 6f | in the| sky. Yo|
|000008e0| 75 20 63 61 6e 20 6d 6f | 76 65 20 74 68 65 20 77 |u can mo|ve the w|
|000008f0| 69 6e 64 6f 77 20 77 69 | 74 68 20 69 74 73 20 74 |indow wi|th its t|
|00000900| 69 74 6c 65 20 62 61 72 | 2c 20 6f 72 20 63 6c 69 |itle bar|, or cli|
|00000910| 63 6b 20 6f 6e 20 74 68 | 65 0a 20 20 20 69 63 6f |ck on th|e. ico|
|00000920| 6e 20 74 6f 20 62 72 69 | 6e 67 20 75 70 20 74 68 |n to bri|ng up th|
|00000930| 65 20 66 75 6c 6c 2c 20 | 75 6e 2d 69 63 6f 6e 69 |e full, |un-iconi|
|00000940| 73 65 64 2c 20 76 69 65 | 77 2e 0a 0a 20 20 20 49 |sed, vie|w... I|
|00000950| 6e 20 75 6e 2d 69 63 6f | 6e 69 73 65 64 20 6d 6f |n un-ico|nised mo|
|00000960| 64 65 20 79 6f 75 20 61 | 72 65 20 70 72 65 73 65 |de you a|re prese|
|00000970| 6e 74 65 64 20 77 69 74 | 68 20 61 6c 6c 20 74 68 |nted wit|h all th|
|00000980| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |e inform|ation ab|
|00000990| 6f 75 74 20 74 68 65 0a | 20 20 20 63 75 72 72 65 |out the.| curre|
|000009a0| 6e 74 20 74 69 6d 65 2c | 20 74 68 65 20 6d 6f 6f |nt time,| the moo|
|000009b0| 6e 73 20 64 69 73 74 61 | 6e 63 65 20 61 6e 64 20 |ns dista|nce and |
|000009c0| 61 67 65 2c 20 74 68 65 | 20 73 75 6e 73 20 64 69 |age, the| suns di|
|000009d0| 73 74 61 6e 63 65 2c 20 | 61 6e 64 20 74 68 65 0a |stance, |and the.|
|000009e0| 20 20 20 22 4d 6f 6f 6e | 20 50 68 61 73 65 22 20 | "Moon| Phase" |
|000009f0| 69 63 6f 6e 2e 20 4c 6f | 6f 6b 69 6e 67 20 74 6f |icon. Lo|oking to|
|00000a00| 20 74 68 65 20 74 6f 70 | 20 72 69 67 68 74 20 6f | the top| right o|
|00000a10| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 20 79 6f 75 |f the wi|ndow you|
|00000a20| 20 77 69 6c 6c 20 73 65 | 65 0a 20 20 20 74 68 61 | will se|e. tha|
|00000a30| 74 20 69 74 20 68 61 73 | 20 61 20 66 75 6c 6c 2d |t it has| a full-|
|00000a40| 73 69 7a 65 20 69 63 6f | 6e 3b 20 63 6c 69 63 6b |size ico|n; click|
|00000a50| 69 6e 67 20 6f 6e 20 74 | 68 69 73 20 77 69 6c 6c |ing on t|his will|
|00000a60| 20 72 65 76 65 61 6c 20 | 61 64 64 69 74 69 6f 6e | reveal |addition|
|00000a70| 61 6c 0a 20 20 20 69 6e | 66 6f 72 6d 61 74 69 6f |al. in|formatio|
|00000a80| 6e 20 61 62 6f 75 74 20 | 74 68 65 20 64 61 74 65 |n about |the date|
|00000a90| 73 20 6f 66 20 74 68 65 | 20 70 68 61 73 65 73 20 |s of the| phases |
|00000aa0| 6f 66 20 74 68 65 20 6d | 6f 6f 6e 20 28 61 6c 6c |of the m|oon (all|
|00000ab0| 20 69 6e 20 55 54 43 2c | 20 6f 72 0a 20 20 20 55 | in UTC,| or. U|
|00000ac0| 6e 69 76 65 72 73 61 6c | 20 54 69 6d 65 29 2e 0a |niversal| Time)..|
|00000ad0| 0a 20 20 20 43 6c 69 63 | 6b 69 6e 67 20 61 67 61 |. Clic|king aga|
|00000ae0| 69 6e 20 6f 6e 20 74 68 | 65 20 22 4d 6f 6f 6e 20 |in on th|e "Moon |
|00000af0| 50 68 61 73 65 22 20 69 | 63 6f 6e 20 6f 66 20 74 |Phase" i|con of t|
|00000b00| 68 65 20 6d 6f 6f 6e 73 | 20 63 75 72 72 65 6e 74 |he moons| current|
|00000b10| 20 61 70 70 65 61 72 61 | 6e 63 65 0a 20 20 20 77 | appeara|nce. w|
|00000b20| 69 6c 6c 20 70 75 74 20 | 74 68 65 20 70 72 6f 67 |ill put |the prog|
|00000b30| 72 61 6d 20 62 61 63 6b | 20 69 6e 74 6f 20 69 63 |ram back| into ic|
|00000b40| 6f 6e 69 73 65 64 20 6d | 6f 64 65 2e 0a 0a 20 20 |onised m|ode... |
|00000b50| 20 51 75 69 74 74 69 6e | 67 20 74 68 65 20 70 72 | Quittin|g the pr|
|00000b60| 67 72 61 6d 20 73 69 6d | 70 6c 79 20 63 6f 6e 73 |gram sim|ply cons|
|00000b70| 69 73 74 73 20 6f 66 20 | 63 6c 6f 73 69 6e 67 20 |ists of |closing |
|00000b80| 74 68 65 20 77 69 6e 64 | 6f 77 20 77 68 65 6e 20 |the wind|ow when |
|00000b90| 69 74 20 69 73 0a 20 20 | 20 69 6e 20 75 6e 2d 69 |it is. | in un-i|
|00000ba0| 63 6f 6e 69 73 65 64 20 | 6d 6f 64 65 2e 0a 0a 0a |conised |mode....|
|00000bb0| 52 69 73 63 20 4f 53 20 | 33 2e 31 20 4e 6f 74 65 |Risc OS |3.1 Note|
|00000bc0| 73 0a 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |s.======|========|
|00000bd0| 3d 3d 3d 0a 0a 20 20 20 | 54 68 69 73 20 70 72 6f |===.. |This pro|
|00000be0| 67 72 61 6d 20 6e 65 65 | 64 73 20 62 6f 74 68 20 |gram nee|ds both |
|00000bf0| 4c 6f 63 61 6c 20 54 69 | 6d 65 20 61 6e 64 20 47 |Local Ti|me and G|
|00000c00| 72 65 65 6e 77 69 63 68 | 20 4d 65 61 6e 20 54 69 |reenwich| Mean Ti|
|00000c10| 6d 65 20 73 65 74 20 75 | 70 0a 20 20 20 63 6f 72 |me set u|p. cor|
|00000c20| 72 65 63 74 6c 79 20 69 | 6e 20 79 6f 75 72 20 6d |rectly i|n your m|
|00000c30| 61 63 68 69 6e 65 2e 20 | 0a 0a 20 20 20 54 68 69 |achine. |.. Thi|
|00000c40| 73 20 72 65 71 75 69 72 | 65 73 20 74 77 6f 20 74 |s requir|es two t|
|00000c50| 68 69 6e 67 73 2d 2d 20 | 46 69 72 73 74 6c 79 20 |hings-- |Firstly |
|00000c60| 73 65 74 74 69 6e 67 20 | 74 68 65 20 63 6f 6e 66 |setting |the conf|
|00000c70| 69 67 75 72 65 64 20 74 | 69 6d 65 20 69 6e 20 79 |igured t|ime in y|
|00000c80| 6f 75 72 0a 20 20 20 6d | 61 63 68 69 6e 65 20 74 |our. m|achine t|
|00000c90| 6f 20 47 72 65 65 6e 77 | 69 63 68 20 4d 65 61 6e |o Greenw|ich Mean|
|00000ca0| 20 54 69 6d 65 20 74 68 | 65 6e 20 67 65 74 74 69 | Time th|en getti|
|00000cb0| 6e 67 20 74 68 65 20 74 | 69 6d 65 20 63 6f 72 72 |ng the t|ime corr|
|00000cc0| 65 63 74 20 66 6f 72 0a | 20 20 20 77 68 65 72 65 |ect for.| where|
|00000cd0| 20 79 6f 75 20 6c 69 76 | 65 20 62 79 20 73 65 74 | you liv|e by set|
|00000ce0| 74 69 6e 67 20 74 68 65 | 20 43 6f 6e 67 66 69 67 |ting the| Congfig|
|00000cf0| 75 72 61 74 69 6f 6e 20 | 53 65 74 74 69 6e 67 20 |uration |Setting |
|00000d00| 27 54 69 6d 65 5a 6f 6e | 65 27 20 28 79 6f 75 0a |'TimeZon|e' (you.|
|00000d10| 20 20 20 63 61 6e 20 74 | 79 70 65 20 22 68 65 6c | can t|ype "hel|
|00000d20| 70 20 54 69 6d 65 5a 6f | 6e 65 22 20 6f 6e 20 74 |p TimeZo|ne" on t|
|00000d30| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 29 |he comma|nd line)|
|00000d40| 2e 20 54 68 69 73 20 73 | 74 65 70 20 77 69 6c 6c |. This s|tep will|
|00000d50| 20 70 72 6f 62 61 62 6c | 79 0a 20 20 20 62 65 20 | probabl|y. be |
|00000d60| 75 6e 6e 65 73 73 65 73 | 61 72 79 20 69 6e 20 74 |unnesses|ary in t|
|00000d70| 68 65 20 55 4b 20 77 68 | 65 72 65 20 79 6f 75 20 |he UK wh|ere you |
|00000d80| 61 72 65 20 6f 6e 20 47 | 4d 54 20 61 6e 79 77 61 |are on G|MT anywa|
|00000d90| 79 2e 2e 2e 0a 20 20 20 | 57 68 65 72 65 20 49 20 |y.... |Where I |
|00000da0| 6c 69 76 65 20 28 69 6e | 20 4e 65 77 20 5a 65 61 |live (in| New Zea|
|00000db0| 6c 61 6e 64 29 20 49 20 | 75 73 65 20 22 63 6f 6e |land) I |use "con|
|00000dc0| 66 69 67 75 72 65 20 54 | 69 6d 65 5a 6f 6e 65 20 |figure T|imeZone |
|00000dd0| 2b 31 32 3a 30 22 0a 0a | 20 20 20 54 68 65 20 73 |+12:0"..| The s|
|00000de0| 65 63 6f 6e 64 20 73 74 | 65 70 20 69 73 20 74 6f |econd st|ep is to|
|00000df0| 20 64 6f 20 77 69 74 68 | 20 64 61 79 6c 69 67 68 | do with| dayligh|
|00000e00| 74 20 73 61 76 69 6e 67 | 73 2d 2d 20 55 73 65 20 |t saving|s-- Use |
|00000e10| 21 41 6c 61 72 6d 20 74 | 6f 20 74 6f 67 67 6c 65 |!Alarm t|o toggle|
|00000e20| 0a 20 20 20 62 65 74 77 | 65 65 6e 20 64 61 79 6c |. betw|een dayl|
|00000e30| 69 67 68 74 20 73 61 76 | 69 6e 67 73 20 6f 6e 20 |ight sav|ings on |
|00000e40| 61 6e 64 20 6f 66 66 20 | 69 6e 73 74 65 61 64 20 |and off |instead |
|00000e50| 6f 66 20 61 6c 74 65 72 | 69 6e 67 20 74 68 65 20 |of alter|ing the |
|00000e60| 74 69 6d 65 20 6f 72 0a | 20 20 20 74 68 65 20 54 |time or.| the T|
|00000e70| 69 6d 65 5a 6f 6e 65 20 | 6f 66 66 73 65 74 2e 20 |imeZone |offset. |
|00000e80| 28 44 61 79 6c 69 67 68 | 74 20 53 61 76 69 6e 67 |(Dayligh|t Saving|
|00000e90| 73 20 54 69 6d 65 20 6f | 72 20 44 53 54 20 69 73 |s Time o|r DST is|
|00000ea0| 20 6c 61 62 65 6c 65 64 | 20 27 42 53 54 27 0a 20 | labeled| 'BST'. |
|00000eb0| 20 20 69 6e 20 21 41 6c | 61 72 6d 73 20 27 53 65 | in !Al|arms 'Se|
|00000ec0| 74 20 54 69 6d 65 27 20 | 77 69 6e 64 6f 77 2c 20 |t Time' |window, |
|00000ed0| 77 68 69 63 68 20 73 74 | 61 6e 64 73 20 66 6f 72 |which st|ands for|
|00000ee0| 20 42 72 69 74 69 73 68 | 20 53 75 6d 6d 65 72 20 | British| Summer |
|00000ef0| 54 69 6d 65 2c 0a 20 20 | 20 62 65 63 61 75 73 65 |Time,. | because|
|00000f00| 20 41 63 6f 72 6e 20 69 | 73 20 56 65 72 79 20 47 | Acorn i|s Very G|
|00000f10| 6f 6f 64 20 61 74 20 49 | 6e 74 65 72 6e 61 74 69 |ood at I|nternati|
|00000f20| 6f 6e 61 6c 69 73 61 74 | 69 6f 6e 2e 2e 2e 29 0a |onalisat|ion...).|
|00000f30| 0a 20 20 20 49 66 20 79 | 6f 75 20 73 65 74 20 61 |. If y|ou set a|
|00000f40| 6e 64 20 6d 61 69 6e 74 | 61 69 6e 20 74 68 65 20 |nd maint|ain the |
|00000f50| 74 69 6d 65 20 69 6e 20 | 74 68 65 20 6d 65 74 68 |time in |the meth|
|00000f60| 6f 64 20 6f 75 74 6c 69 | 6e 65 64 20 61 62 6f 76 |od outli|ned abov|
|00000f70| 65 2c 20 79 6f 75 0a 20 | 20 20 77 69 6c 6c 20 61 |e, you. | will a|
|00000f80| 6c 77 61 79 73 20 62 65 | 20 61 62 6c 65 20 74 6f |lways be| able to|
|00000f90| 20 68 61 76 65 20 74 68 | 65 20 63 6f 72 72 65 63 | have th|e correc|
|00000fa0| 74 20 74 69 6d 65 2c 20 | 61 6e 64 20 62 65 20 61 |t time, |and be a|
|00000fb0| 62 6c 65 20 74 6f 20 77 | 6f 72 6b 0a 20 20 20 6f |ble to w|ork. o|
|00000fc0| 75 74 20 74 68 65 20 74 | 69 6d 65 20 69 6e 20 47 |ut the t|ime in G|
|00000fd0| 4d 54 20 6f 72 20 55 54 | 43 20 61 73 20 77 65 6c |MT or UT|C as wel|
|00000fe0| 6c 2c 20 61 73 20 77 69 | 6c 6c 20 61 6e 79 20 70 |l, as wi|ll any p|
|00000ff0| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 6e 65 65 64 |rogram t|hat need|
|00001000| 73 0a 20 20 20 74 6f 20 | 6b 6e 6f 77 20 74 68 65 |s. to |know the|
|00001010| 20 74 69 6d 65 20 69 6e | 20 62 6f 74 68 20 6c 6f | time in| both lo|
|00001020| 63 61 6c 20 61 6e 64 20 | 75 6e 69 76 65 72 73 61 |cal and |universa|
|00001030| 6c 2e 20 43 20 70 72 6f | 67 72 61 6d 73 20 74 68 |l. C pro|grams th|
|00001040| 61 74 20 75 73 65 0a 20 | 20 20 6c 6f 63 61 6c 74 |at use. | localt|
|00001050| 69 6d 65 28 29 20 61 6e | 64 20 67 6d 74 69 6d 65 |ime() an|d gmtime|
|00001060| 28 29 2c 20 66 6f 72 20 | 65 78 61 6d 70 6c 65 2c |(), for |example,|
|00001070| 20 6e 65 65 64 20 74 68 | 69 73 2e 0a 20 20 20 0a | need th|is.. .|
|00001080| 0a 50 72 6f 62 6c 65 6d | 73 0a 3d 3d 3d 3d 3d 3d |.Problem|s.======|
|00001090| 3d 3d 0a 0a 20 20 20 54 | 68 65 72 65 20 61 72 65 |==.. T|here are|
|000010a0| 20 6e 6f 20 70 72 6f 62 | 6c 65 6d 73 20 6f 72 20 | no prob|lems or |
|000010b0| 62 75 67 73 20 77 69 74 | 68 20 74 68 69 73 20 70 |bugs wit|h this p|
|000010c0| 72 6f 67 72 61 6d 2e 20 | 49 74 20 69 73 20 70 65 |rogram. |It is pe|
|000010d0| 72 66 65 63 74 20 69 6e | 20 65 76 65 72 79 0a 20 |rfect in| every. |
|000010e0| 20 20 77 61 79 20 61 6e | 64 20 61 6e 79 20 64 69 | way an|d any di|
|000010f0| 66 66 69 63 75 6c 74 69 | 65 73 20 79 6f 75 20 6d |fficulti|es you m|
|00001100| 61 79 20 65 78 70 65 72 | 69 65 6e 63 65 20 61 72 |ay exper|ience ar|
|00001110| 65 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 74 68 72 |e one of| the thr|
|00001120| 65 65 20 66 6f 6c 6c 6f | 77 69 6e 67 0a 20 20 20 |ee follo|wing. |
|00001130| 70 65 6f 70 6c 65 2c 20 | 6f 72 20 6f 72 67 61 6e |people, |or organ|
|00001140| 69 73 61 74 69 6f 6e 27 | 73 20 66 61 75 6c 74 3a |isation'|s fault:|
|00001150| 0a 0a 20 20 20 20 20 20 | 6f 20 20 59 6f 75 72 73 |.. |o Yours|
|00001160| 65 6c 66 0a 0a 20 20 20 | 20 20 20 6f 20 20 59 6f |elf.. | o Yo|
|00001170| 75 72 20 41 63 6f 72 6e | 20 44 65 61 6c 65 72 0a |ur Acorn| Dealer.|
|00001180| 0a 20 20 20 20 20 20 6f | 20 20 41 63 6f 72 6e 20 |. o| Acorn |
|00001190| 43 6f 6d 70 75 74 65 72 | 73 20 4c 69 6d 69 74 65 |Computer|s Limite|
|000011a0| 64 0a 0a 20 20 20 46 6f | 72 20 65 78 61 6d 70 6c |d.. Fo|r exampl|
|000011b0| 65 20 79 6f 75 20 6d 69 | 67 68 74 20 73 61 79 20 |e you mi|ght say |
|000011c0| 22 57 68 65 6e 20 49 20 | 72 75 6e 20 21 4d 6f 6f |"When I |run !Moo|
|000011d0| 6e 54 6f 6f 6c 20 6f 6e | 20 6d 79 20 52 4f 32 20 |nTool on| my RO2 |
|000011e0| 6d 61 63 68 69 6e 65 20 | 69 74 0a 20 20 20 63 72 |machine |it. cr|
|000011f0| 61 73 68 65 73 22 20 2d | 20 54 68 69 73 20 77 6f |ashes" -| This wo|
|00001200| 75 6c 64 20 62 65 20 79 | 6f 75 72 20 66 61 75 6c |uld be y|our faul|
|00001210| 74 20 66 6f 72 20 6e 6f | 74 20 70 75 72 63 68 61 |t for no|t purcha|
|00001220| 73 69 6e 67 20 52 69 73 | 63 20 4f 53 20 33 2e 31 |sing Ris|c OS 3.1|
|00001230| 20 79 65 74 2e 0a 0a 20 | 20 20 59 6f 75 20 6d 69 | yet... | You mi|
|00001240| 67 68 74 20 73 61 79 20 | 22 49 6e 20 32 35 36 20 |ght say |"In 256 |
|00001250| 63 6f 6c 6f 75 72 20 6d | 6f 64 65 20 74 68 65 20 |colour m|ode the |
|00001260| 62 75 74 74 6f 6e 20 70 | 6c 69 6e 74 68 73 20 69 |button p|linths i|
|00001270| 6e 2c 20 62 75 74 20 69 | 74 20 61 6c 73 6f 0a 20 |n, but i|t also. |
|00001280| 20 20 69 6e 76 65 72 74 | 73 20 61 73 20 77 65 6c | invert|s as wel|
|00001290| 6c 22 20 2d 20 54 68 69 | 73 20 77 6f 75 6c 64 20 |l" - Thi|s would |
|000012a0| 62 65 20 41 63 6f 72 6e | 73 20 66 61 75 6c 74 20 |be Acorn|s fault |
|000012b0| 66 6f 72 20 6e 6f 74 20 | 68 61 76 69 6e 67 20 62 |for not |having b|
|000012c0| 65 74 74 65 72 0a 20 20 | 20 27 4b 77 61 6c 69 74 |etter. | 'Kwalit|
|000012d0| 79 20 4b 6f 6e 74 72 6f | 6c 27 20 6f 6e 20 69 74 |y Kontro|l' on it|
|000012e0| 73 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |s operat|ing syst|
|000012f0| 65 6d 73 2e 0a 0a 20 20 | 20 41 6c 73 6f 20 73 6f |ems... | Also so|
|00001300| 6d 65 6f 6e 65 20 6d 69 | 67 68 74 20 63 6f 6d 70 |meone mi|ght comp|
|00001310| 6c 61 69 6e 20 22 57 68 | 65 6e 20 74 68 65 20 6d |lain "Wh|en the m|
|00001320| 6f 6f 6e 20 62 65 68 69 | 6e 64 20 61 20 63 6c 6f |oon behi|nd a clo|
|00001330| 75 64 20 49 20 63 61 6e | 27 74 20 73 65 65 20 69 |ud I can|'t see i|
|00001340| 74 0a 20 20 20 62 75 74 | 20 49 20 63 61 6e 20 73 |t. but| I can s|
|00001350| 74 69 6c 6c 20 69 74 20 | 6f 6e 20 6d 79 20 63 6f |till it |on my co|
|00001360| 6d 70 75 74 65 72 2e 20 | 43 6f 75 6c 64 20 79 6f |mputer. |Could yo|
|00001370| 75 20 73 65 74 20 69 74 | 20 75 70 20 73 6f 20 74 |u set it| up so t|
|00001380| 68 61 74 20 69 74 27 73 | 0a 20 20 20 76 69 73 69 |hat it's|. visi|
|00001390| 61 62 69 6c 69 74 79 20 | 69 73 20 61 6c 77 61 79 |ability |is alway|
|000013a0| 73 20 74 68 65 20 73 61 | 6d 65 20 61 73 20 74 68 |s the sa|me as th|
|000013b0| 65 20 72 65 61 6c 20 6d | 6f 6f 6e 3f 22 20 2d 20 |e real m|oon?" - |
|000013c0| 54 68 69 73 20 77 6f 75 | 6c 64 20 62 65 20 74 68 |This wou|ld be th|
|000013d0| 65 69 72 0a 20 20 20 64 | 65 61 6c 65 72 73 20 66 |eir. d|ealers f|
|000013e0| 61 75 6c 74 20 66 6f 72 | 20 73 65 6c 6c 69 6e 67 |ault for| selling|
|000013f0| 20 61 20 63 6f 6d 70 75 | 74 65 72 20 74 6f 20 73 | a compu|ter to s|
|00001400| 6f 6d 65 6f 6e 65 20 77 | 68 6f 73 65 20 49 51 20 |omeone w|hose IQ |
|00001410| 77 61 73 20 6f 62 76 69 | 6f 75 73 6c 79 0a 20 20 |was obvi|ously. |
|00001420| 20 69 6e 20 74 68 65 20 | 6c 6f 77 20 37 30 27 73 | in the |low 70's|
|00001430| 2e 2e 2e 0a 0a 20 20 20 | 49 6e 20 73 68 6f 72 74 |..... |In short|
|00001440| 2c 20 69 66 20 79 6f 75 | 20 68 61 76 6e 27 74 20 |, if you| havn't |
|00001450| 77 6f 72 6b 65 64 20 69 | 74 20 6f 75 74 20 79 65 |worked i|t out ye|
|00001460| 74 2c 20 49 20 74 61 6b | 65 20 6e 6f 20 72 65 73 |t, I tak|e no res|
|00001470| 70 6f 6e 69 62 69 6c 69 | 74 79 20 66 6f 72 0a 20 |ponibili|ty for. |
|00001480| 20 20 61 6e 79 74 68 69 | 6e 67 20 61 74 20 61 6c | anythi|ng at al|
|00001490| 6c 20 74 6f 20 64 6f 20 | 77 69 74 68 20 74 68 69 |l to do |with thi|
|000014a0| 73 20 70 72 6f 67 72 61 | 6d 2e 0a 0a 0a 54 6f 20 |s progra|m....To |
|000014b0| 42 65 20 44 6f 6e 65 0a | 3d 3d 3d 3d 3d 3d 3d 3d |Be Done.|========|
|000014c0| 3d 3d 0a 0a 20 20 20 57 | 65 6c 6c 20 65 76 65 72 |==.. W|ell ever|
|000014d0| 79 74 68 69 6e 67 20 69 | 73 20 61 63 74 75 61 6c |ything i|s actual|
|000014e0| 6c 79 20 61 62 6f 75 74 | 20 61 73 20 77 65 6c 6c |ly about| as well|
|000014f0| 20 64 6f 6e 65 20 61 73 | 20 69 74 27 73 20 6c 69 | done as| it's li|
|00001500| 6b 65 6c 79 20 74 6f 20 | 67 65 74 2c 0a 20 20 20 |kely to |get,. |
|00001510| 62 75 74 20 69 66 20 61 | 6e 79 6f 6e 65 20 77 61 |but if a|nyone wa|
|00001520| 6e 74 73 20 74 6f 20 73 | 65 6e 64 20 6d 65 20 61 |nts to s|end me a|
|00001530| 6e 79 20 69 6d 70 72 6f | 76 6d 65 6e 74 73 20 74 |ny impro|vments t|
|00001540| 6f 20 74 68 65 20 61 64 | 64 72 65 73 73 20 62 65 |o the ad|dress be|
|00001550| 6c 6f 77 0a 20 20 20 49 | 27 64 20 62 65 20 76 65 |low. I|'d be ve|
|00001560| 72 79 20 67 72 61 74 65 | 66 75 6c 2c 20 61 6e 64 |ry grate|ful, and|
|00001570| 20 77 69 6c 6c 20 72 65 | 6c 65 61 73 65 20 61 6e | will re|lease an|
|00001580| 6f 74 68 72 20 76 65 72 | 73 69 6f 6e 20 77 69 74 |othr ver|sion wit|
|00001590| 68 20 79 6f 75 72 0a 20 | 20 20 6d 6f 64 69 66 69 |h your. | modifi|
|000015a0| 63 61 74 69 6f 6e 73 20 | 61 6e 64 20 63 72 65 64 |cations |and cred|
|000015b0| 69 74 2e 0a 0a 20 20 20 | 41 6c 73 6f 20 69 66 20 |it... |Also if |
|000015c0| 61 6e 79 6f 6e 65 20 63 | 61 6e 20 64 65 73 69 67 |anyone c|an desig|
|000015d0| 6e 20 6d 65 20 61 20 62 | 65 74 74 65 72 20 46 69 |n me a b|etter Fi|
|000015e0| 6c 65 72 20 49 63 6f 6e | 20 49 27 64 20 62 65 20 |ler Icon| I'd be |
|000015f0| 6d 6f 73 74 20 68 61 70 | 70 79 0a 20 20 20 74 6f |most hap|py. to|
|00001600| 20 72 65 70 6c 61 63 65 | 20 74 68 65 20 6f 6e 65 | replace| the one|
|00001610| 20 49 27 76 65 20 67 6f | 74 20 61 74 20 74 68 65 | I've go|t at the|
|00001620| 20 6d 6f 6d 65 6e 74 2e | 2e 2e 0a 0a 20 20 20 49 | moment.|.... I|
|00001630| 66 20 61 6e 79 6f 6e 65 | 20 66 65 65 6c 73 20 6c |f anyone| feels l|
|00001640| 69 6b 65 20 73 70 65 6c | 6c 20 63 68 65 63 6b 69 |ike spel|l checki|
|00001650| 6e 67 20 74 68 69 73 20 | 21 48 65 6c 70 20 66 69 |ng this |!Help fi|
|00001660| 6c 65 20 49 27 6d 20 73 | 75 72 65 20 68 75 6e 64 |le I'm s|ure hund|
|00001670| 72 65 64 73 2c 0a 20 20 | 20 69 66 20 6e 6f 74 20 |reds,. | if not |
|00001680| 74 68 6f 75 73 61 6e 64 | 73 2c 20 6f 66 20 65 6e |thousand|s, of en|
|00001690| 67 6c 69 73 68 20 73 70 | 65 61 6b 65 72 73 20 61 |glish sp|eakers a|
|000016a0| 72 6f 75 6e 64 20 74 68 | 65 20 77 6f 72 6c 64 20 |round th|e world |
|000016b0| 77 6f 75 6c 64 20 62 65 | 20 67 72 61 74 65 66 75 |would be| gratefu|
|000016c0| 6c 0a 20 20 20 74 6f 20 | 79 6f 75 20 3a 2d 29 0a |l. to |you :-).|
|000016d0| 0a 0a 41 75 74 68 6f 72 | 20 49 6e 66 6f 20 28 41 |..Author| Info (A|
|000016e0| 72 63 68 69 6d 65 64 65 | 73 20 56 65 72 73 69 6f |rchimede|s Versio|
|000016f0| 6e 29 0a 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |n).=====|========|
|00001700| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001710| 3d 3d 3d 0a 0a 20 20 20 | 53 65 6e 64 20 61 6c 6c |===.. |Send all|
|00001720| 20 73 6e 61 69 6c 20 6d | 61 69 6c 2f 6d 6f 6e 65 | snail m|ail/mone|
|00001730| 79 20 6f 72 64 65 72 73 | 2f 63 68 65 71 75 65 73 |y orders|/cheques|
|00001740| 2f 63 61 73 68 20 74 6f | 3a 0a 20 20 20 20 20 20 |/cash to|:. |
|00001750| 20 20 20 45 64 6f 75 61 | 72 64 20 50 6f 6f 72 0a | Edoua|rd Poor.|
|00001760| 20 20 20 20 20 20 20 20 | 20 31 35 20 53 74 61 6e | | 15 Stan|
|00001770| 6c 65 79 20 50 74 20 52 | 64 0a 20 20 20 20 20 20 |ley Pt R|d. |
|00001780| 20 20 20 44 65 76 6f 6e | 70 6f 72 74 0a 20 20 20 | Devon|port. |
|00001790| 20 20 20 20 20 20 41 75 | 63 6b 6c 61 6e 64 0a 20 | Au|ckland. |
|000017a0| 20 20 20 20 20 20 20 20 | 4e 65 77 20 5a 65 61 6c | |New Zeal|
|000017b0| 61 6e 64 0a 0a 20 20 20 | 45 6d 61 69 6c 2f 75 75 |and.. |Email/uu|
|000017c0| 2d 66 69 6c 65 73 20 6d | 61 79 20 62 65 20 61 64 |-files m|ay be ad|
|000017d0| 64 72 65 73 73 65 64 20 | 74 6f 3a 0a 20 20 20 20 |dressed |to:. |
|000017e0| 20 20 20 20 20 65 70 6f | 6f 31 40 63 73 2e 61 75 | epo|o1@cs.au|
|000017f0| 6b 75 6e 69 2e 61 63 2e | 6e 7a 20 20 20 20 28 76 |kuni.ac.|nz (v|
|00001800| 61 6c 69 64 20 75 6e 74 | 69 6c 20 61 74 20 6c 65 |alid unt|il at le|
|00001810| 61 73 74 20 4d 61 72 63 | 68 20 31 39 39 34 29 0a |ast Marc|h 1994).|
|00001820| 20 20 20 20 20 20 20 20 | 20 65 64 6f 75 61 72 64 | | edouard|
|00001830| 40 6e 61 63 6a 61 63 6b | 2e 67 65 6e 2e 6e 7a 20 |@nacjack|.gen.nz |
|00001840| 20 20 28 6e 6f 74 20 75 | 73 65 64 20 76 65 72 79 | (not u|sed very|
|00001850| 20 6f 66 74 65 6e 29 0a | 0a 20 20 20 56 6f 69 63 | often).|. Voic|
|00001860| 65 20 6c 69 6e 65 3a 0a | 20 20 20 20 20 20 20 20 |e line:.| |
|00001870| 20 2b 36 34 20 39 20 34 | 34 35 30 33 33 30 0a 0a | +64 9 4|450330..|
|00001880| 0a 42 69 62 6c 69 6f 67 | 72 61 70 68 79 0a 3d 3d |.Bibliog|raphy.==|
|00001890| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0a 0a 20 20 20 54 |========|==.. T|
|000018a0| 68 65 20 61 6c 67 6f 72 | 69 74 68 6d 73 20 75 73 |he algor|ithms us|
|000018b0| 65 64 20 69 6e 20 74 68 | 69 73 20 70 72 6f 67 72 |ed in th|is progr|
|000018c0| 61 6d 20 74 6f 20 63 61 | 6c 63 75 6c 61 74 65 20 |am to ca|lculate |
|000018d0| 74 68 65 20 70 6f 73 69 | 74 69 6f 6e 73 20 53 75 |the posi|tions Su|
|000018e0| 6e 20 61 6e 64 0a 20 20 | 20 4d 6f 6f 6e 20 61 73 |n and. | Moon as|
|000018f0| 20 73 65 65 6e 20 66 72 | 6f 6d 20 74 68 65 20 45 | seen fr|om the E|
|00001900| 61 72 74 68 20 61 72 65 | 20 67 69 76 65 6e 20 69 |arth are| given i|
|00001910| 6e 20 74 68 65 20 62 6f | 6f 6b 20 22 50 72 61 63 |n the bo|ok "Prac|
|00001920| 74 69 63 61 6c 20 41 73 | 74 72 6f 6e 6f 6d 79 0a |tical As|tronomy.|
|00001930| 20 20 20 57 69 74 68 20 | 59 6f 75 72 20 43 61 6c | With |Your Cal|
|00001940| 63 75 6c 61 74 6f 72 22 | 20 62 79 20 50 65 74 65 |culator"| by Pete|
|00001950| 72 20 44 75 66 66 65 74 | 74 2d 53 6d 69 74 68 2c |r Duffet|t-Smith,|
|00001960| 20 53 65 63 6f 6e 64 20 | 45 64 69 74 69 6f 6e 2c | Second |Edition,|
|00001970| 20 43 61 6d 62 72 69 64 | 67 65 0a 20 20 20 55 6e | Cambrid|ge. Un|
|00001980| 69 76 65 72 73 69 74 79 | 20 50 72 65 73 73 2c 20 |iversity| Press, |
|00001990| 31 39 38 31 2e 20 49 67 | 6e 6f 72 65 20 74 68 65 |1981. Ig|nore the|
|000019a0| 20 77 6f 72 64 20 22 43 | 61 6c 63 75 6c 61 74 6f | word "C|alculato|
|000019b0| 72 22 20 69 6e 20 74 68 | 65 20 74 69 74 6c 65 3b |r" in th|e title;|
|000019c0| 20 74 68 69 73 0a 20 20 | 20 69 73 20 61 6e 20 65 | this. | is an e|
|000019d0| 73 73 65 6e 74 69 61 6c | 20 72 65 66 65 72 65 6e |ssential| referen|
|000019e0| 63 65 20 69 66 20 79 6f | 75 27 72 65 20 69 6e 74 |ce if yo|u're int|
|000019f0| 65 72 65 73 74 65 64 20 | 69 6e 20 64 65 76 65 6c |erested |in devel|
|00001a00| 6f 70 69 6e 67 20 73 6f | 66 74 77 61 72 65 0a 20 |oping so|ftware. |
|00001a10| 20 20 77 68 69 63 68 20 | 63 61 6c 63 75 6c 61 74 | which |calculat|
|00001a20| 65 73 20 70 6c 61 6e 65 | 74 61 72 79 20 70 6f 73 |es plane|tary pos|
|00001a30| 69 74 69 6f 6e 73 2c 20 | 6f 72 62 69 74 73 2c 20 |itions, |orbits, |
|00001a40| 65 63 6c 69 70 73 65 73 | 2c 20 61 6e 64 20 74 68 |eclipses|, and th|
|00001a50| 65 20 6c 69 6b 65 2e 20 | 49 66 0a 20 20 20 79 6f |e like. |If. yo|
|00001a60| 75 27 72 65 20 69 6e 74 | 65 72 65 73 74 65 64 20 |u're int|erested |
|00001a70| 69 6e 20 70 75 72 73 75 | 69 6e 67 20 73 75 63 68 |in pursu|ing such|
|00001a80| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 2c 20 79 6f | program|ming, yo|
|00001a90| 75 20 73 68 6f 75 6c 64 | 20 61 6c 73 6f 20 6f 62 |u should| also ob|
|00001aa0| 74 61 69 6e 3a 0a 0a 20 | 20 20 22 41 73 74 72 6f |tain:.. | "Astro|
|00001ab0| 6e 6f 6d 69 63 61 6c 20 | 46 6f 72 6d 75 6c 61 65 |nomical |Formulae|
|00001ac0| 20 66 6f 72 20 43 61 6c | 63 75 6c 61 74 6f 72 73 | for Cal|culators|
|00001ad0| 22 20 62 79 20 4a 65 61 | 6e 20 4d 65 65 75 73 2c |" by Jea|n Meeus,|
|00001ae0| 20 54 68 69 72 64 20 45 | 64 69 74 69 6f 6e 2c 0a | Third E|dition,.|
|00001af0| 20 20 20 57 69 6c 6c 6d | 61 6e 6e 2d 42 65 6c 6c | Willm|ann-Bell|
|00001b00| 2c 20 31 39 38 35 2e 20 | 41 20 6d 75 73 74 2d 68 |, 1985. |A must-h|
|00001b10| 61 76 65 2e 0a 0a 20 20 | 20 22 50 6c 61 6e 65 74 |ave... | "Planet|
|00001b20| 61 72 79 20 50 72 6f 67 | 72 61 6d 73 20 61 6e 64 |ary Prog|rams and|
|00001b30| 20 54 61 62 6c 65 73 20 | 66 72 6f 6d 20 2d 34 30 | Tables |from -40|
|00001b40| 30 30 20 74 6f 20 2b 32 | 38 30 30 22 20 62 79 20 |00 to +2|800" by |
|00001b50| 50 69 65 72 72 65 20 42 | 72 65 74 61 67 6e 6f 6e |Pierre B|retagnon|
|00001b60| 0a 20 20 20 61 6e 64 20 | 4a 65 61 6e 2d 4c 6f 75 |. and |Jean-Lou|
|00001b70| 69 73 20 53 69 6d 6f 6e | 2c 20 57 69 6c 6c 6d 61 |is Simon|, Willma|
|00001b80| 6e 6e 2d 42 65 6c 6c 2c | 20 31 39 38 36 2e 20 49 |nn-Bell,| 1986. I|
|00001b90| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 68 65 20 75 |f you wa|nt the u|
|00001ba0| 74 6d 6f 73 74 0a 20 20 | 20 28 6f 75 74 73 69 64 |tmost. | (outsid|
|00001bb0| 65 20 6f 66 20 4a 50 4c | 29 20 61 63 63 75 72 61 |e of JPL|) accura|
|00001bc0| 63 79 20 66 6f 72 20 74 | 68 65 20 70 6c 61 6e 65 |cy for t|he plane|
|00001bd0| 74 73 2c 20 69 74 27 73 | 20 68 65 72 65 2e 0a 0a |ts, it's| here...|
|00001be0| 20 20 20 22 43 65 6c 65 | 73 74 69 61 6c 20 42 41 | "Cele|stial BA|
|00001bf0| 53 49 43 22 20 62 79 20 | 45 72 69 63 20 42 75 72 |SIC" by |Eric Bur|
|00001c00| 67 65 73 73 2c 20 52 65 | 76 69 73 65 64 20 45 64 |gess, Re|vised Ed|
|00001c10| 69 74 69 6f 6e 2c 20 53 | 79 62 65 78 2c 20 31 39 |ition, S|ybex, 19|
|00001c20| 38 35 2e 20 56 65 72 79 | 0a 20 20 20 63 6f 6f 6b |85. Very|. cook|
|00001c30| 62 6f 6f 6b 20 6f 72 69 | 65 6e 74 65 64 2c 20 61 |book ori|ented, a|
|00001c40| 6e 64 20 6d 61 6e 79 20 | 6f 66 20 74 68 65 20 61 |nd many |of the a|
|00001c50| 6c 67 6f 72 69 74 68 6d | 73 20 61 72 65 20 68 61 |lgorithm|s are ha|
|00001c60| 72 64 20 74 6f 20 64 69 | 67 20 6f 75 74 20 6f 66 |rd to di|g out of|
|00001c70| 20 74 68 65 0a 20 20 20 | 74 75 72 67 69 64 20 42 | the. |turgid B|
|00001c80| 41 53 49 43 20 63 6f 64 | 65 2c 20 62 75 74 20 79 |ASIC cod|e, but y|
|00001c90| 6f 75 27 6c 6c 20 70 72 | 6f 62 61 62 6c 79 20 77 |ou'll pr|obably w|
|00001ca0| 61 6e 74 20 69 74 20 61 | 6e 79 77 61 79 2e 0a 0a |ant it a|nyway...|
|00001cb0| 20 20 20 4d 61 6e 79 20 | 6f 66 20 74 68 65 73 65 | Many |of these|
|00001cc0| 20 72 65 66 65 72 65 6e | 63 65 73 20 63 61 6e 20 | referen|ces can |
|00001cd0| 62 65 20 6f 62 74 61 69 | 6e 65 64 20 66 72 6f 6d |be obtai|ned from|
|00001ce0| 20 57 69 6c 6c 6d 61 6e | 6e 2d 42 65 6c 6c 2c 20 | Willman|n-Bell, |
|00001cf0| 50 2e 4f 2e 20 42 6f 78 | 0a 20 20 20 33 35 30 32 |P.O. Box|. 3502|
|00001d00| 35 2c 20 52 69 63 68 6d | 6f 6e 64 2c 20 56 41 20 |5, Richm|ond, VA |
|00001d10| 32 33 32 33 35 2c 20 55 | 53 41 2e 20 50 68 6f 6e |23235, U|SA. Phon|
|00001d20| 65 3a 20 28 38 30 34 29 | 20 33 32 30 2d 37 30 31 |e: (804)| 320-701|
|00001d30| 36 2e 20 49 6e 20 61 64 | 64 69 74 69 6f 6e 20 74 |6. In ad|dition t|
|00001d40| 6f 0a 20 20 20 74 68 65 | 69 72 20 6f 77 6e 20 70 |o. the|ir own p|
|00001d50| 75 62 6c 69 63 61 74 69 | 6f 6e 73 2c 20 74 68 65 |ublicati|ons, the|
|00001d60| 79 20 73 74 6f 63 6b 20 | 6d 6f 73 74 20 6f 66 20 |y stock |most of |
|00001d70| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 72 65 66 |the stan|dard ref|
|00001d80| 65 72 65 6e 63 65 73 20 | 66 6f 72 0a 20 20 20 6d |erences |for. m|
|00001d90| 61 74 68 65 6d 61 74 69 | 63 61 6c 20 61 6e 64 20 |athemati|cal and |
|00001da0| 70 6f 73 69 74 69 6f 6e | 61 6c 20 61 73 74 72 6f |position|al astro|
|00001db0| 6e 6f 6d 79 2e 0a 0a 0a | 53 75 6e 20 57 6f 72 6b |nomy....|Sun Work|
|00001dc0| 73 74 61 74 69 6f 6e 20 | 28 4f 72 69 67 69 6e 61 |station |(Origina|
|00001dd0| 6c 29 20 41 75 74 68 6f | 72 20 49 6e 66 6f 0a 3d |l) Autho|r Info.=|
|00001de0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001df0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001e00| 3d 3d 3d 3d 3d 0a 0a 20 | 20 20 41 20 4d 6f 6f 6e |=====.. | A Moon|
|00001e10| 20 66 6f 72 20 74 68 65 | 20 53 75 6e 0a 0a 20 20 | for the| Sun.. |
|00001e20| 20 52 65 6c 65 61 73 65 | 20 32 2e 30 0a 0a 20 20 | Release| 2.0.. |
|00001e30| 20 44 65 73 69 67 6e 65 | 64 20 61 6e 64 20 69 6d | Designe|d and im|
|00001e40| 70 6c 65 6d 65 6e 74 65 | 64 20 62 79 20 4a 6f 68 |plemente|d by Joh|
|00001e50| 6e 20 57 61 6c 6b 65 72 | 20 69 6e 20 44 65 63 65 |n Walker| in Dece|
|00001e60| 6d 62 65 72 20 31 39 38 | 37 2c 0a 20 20 20 72 65 |mber 198|7,. re|
|00001e70| 76 69 73 65 64 20 61 6e | 64 20 75 70 64 61 74 65 |vised an|d update|
|00001e80| 64 20 69 6e 20 46 65 62 | 72 75 61 72 79 20 6f 66 |d in Feb|ruary of|
|00001e90| 20 31 39 38 38 2e 0a 0a | 20 20 20 54 68 69 73 20 | 1988...| This |
|00001ea0| 70 72 6f 67 72 61 6d 20 | 77 61 73 20 77 72 69 74 |program |was writ|
|00001eb0| 74 65 6e 20 62 79 3a 0a | 0a 20 20 20 20 20 20 20 |ten by:.|. |
|00001ec0| 4a 6f 68 6e 20 57 61 6c | 6b 65 72 0a 20 20 20 20 |John Wal|ker. |
|00001ed0| 20 20 20 41 75 74 6f 64 | 65 73 6b 2c 20 49 6e 63 | Autod|esk, Inc|
|00001ee0| 2e 0a 20 20 20 20 20 20 | 20 32 33 32 30 20 4d 61 |.. | 2320 Ma|
|00001ef0| 72 69 6e 73 68 69 70 20 | 57 61 79 0a 20 20 20 20 |rinship |Way. |
|00001f00| 20 20 20 53 61 75 73 61 | 6c 69 74 6f 2c 20 43 41 | Sausa|lito, CA|
|00001f10| 20 20 39 34 39 36 35 0a | 20 20 20 20 20 20 20 28 | 94965.| (|
|00001f20| 34 31 35 29 20 33 33 32 | 2d 32 33 34 34 20 45 78 |415) 332|-2344 Ex|
|00001f30| 74 2e 20 38 32 39 0a 0a | 20 20 20 20 20 20 20 55 |t. 829..| U|
|00001f40| 73 65 6e 65 74 3a 20 7b | 73 75 6e 21 77 65 6c 6c |senet: {|sun!well|
|00001f50| 7d 21 61 63 61 64 21 6b | 65 6c 76 69 6e 0a 0a 20 |}!acad!k|elvin.. |
|00001f60| 20 20 49 27 64 20 61 70 | 70 72 65 63 69 61 74 65 | I'd ap|preciate|
|00001f70| 20 72 65 63 65 69 76 69 | 6e 67 20 61 6e 79 20 62 | receivi|ng any b|
|00001f80| 75 67 20 66 69 78 65 73 | 20 61 6e 64 2f 6f 72 20 |ug fixes| and/or |
|00001f90| 65 6e 68 61 6e 63 65 6d | 65 6e 74 73 2c 20 77 68 |enhancem|ents, wh|
|00001fa0| 69 63 68 20 49 27 6c 6c | 0a 20 20 20 69 6e 63 6f |ich I'll|. inco|
|00001fb0| 72 70 6f 72 61 74 65 20 | 69 6e 20 66 75 74 75 72 |rporate |in futur|
|00001fc0| 65 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 74 68 |e versio|ns of th|
|00001fd0| 65 20 70 72 6f 67 72 61 | 6d 2e 20 50 6c 65 61 73 |e progra|m. Pleas|
|00001fe0| 65 20 6c 65 61 76 65 20 | 74 68 65 20 6f 72 69 67 |e leave |the orig|
|00001ff0| 69 6e 61 6c 0a 20 20 20 | 61 74 74 72 69 62 75 74 |inal. |attribut|
|00002000| 69 6f 6e 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ion info|rmation |
|00002010| 69 6e 74 61 63 74 20 73 | 6f 20 74 68 61 74 20 63 |intact s|o that c|
|00002020| 72 65 64 69 74 20 61 6e | 64 20 62 6c 61 6d 65 20 |redit an|d blame |
|00002030| 6d 61 79 20 62 65 20 70 | 72 6f 70 65 72 6c 79 0a |may be p|roperly.|
|00002040| 20 20 20 61 70 70 6f 72 | 74 69 6f 6e 65 64 2e 0a | appor|tioned..|
|00002050| 0a 0a 53 6f 75 72 63 65 | 20 43 6f 64 65 0a 3d 3d |..Source| Code.==|
|00002060| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 20 0a 0a 20 20 20 57 |========|= .. W|
|00002070| 65 6c 6c 20 69 74 20 77 | 61 73 20 6f 72 69 67 69 |ell it w|as origi|
|00002080| 6e 61 6c 6c 79 20 63 6f | 6d 70 69 6c 65 64 20 77 |nally co|mpiled w|
|00002090| 69 74 68 20 6d 79 20 6f | 77 6e 20 70 65 72 73 6f |ith my o|wn perso|
|000020a0| 6e 61 6c 20 6c 69 62 72 | 61 72 79 20 22 51 44 44 |nal libr|ary "QDD|
|000020b0| 5f 4c 69 62 22 0a 20 20 | 20 62 75 74 20 69 74 20 |_Lib". | but it |
|000020c0| 75 73 65 73 20 76 65 72 | 79 20 66 65 77 20 63 61 |uses ver|y few ca|
|000020d0| 6c 6c 73 2c 20 61 6e 64 | 20 74 68 65 79 20 61 72 |lls, and| they ar|
|000020e0| 65 20 61 6c 6c 2c 20 75 | 6e 6c 69 6b 65 20 41 63 |e all, u|nlike Ac|
|000020f0| 6f 72 6e 73 20 22 52 49 | 53 43 5f 4f 53 4c 69 62 |orns "RI|SC_OSLib|
|00002100| 22 0a 20 20 20 6f 6e 65 | 73 2c 20 76 65 72 79 20 |". one|s, very |
|00002110| 65 61 73 79 20 74 6f 20 | 72 65 61 64 2e 20 49 74 |easy to |read. It|
|00002120| 20 73 68 6f 75 6c 64 20 | 62 65 20 76 65 72 79 20 | should |be very |
|00002130| 65 61 73 79 20 66 6f 72 | 20 61 6e 79 6f 6e 65 20 |easy for| anyone |
|00002140| 77 69 74 68 20 61 20 43 | 0a 20 20 20 63 6f 6d 70 |with a C|. comp|
|00002150| 69 6c 65 72 20 61 6e 64 | 20 61 6e 79 20 73 65 74 |iler and| any set|
|00002160| 20 6f 66 20 77 69 6d 70 | 20 6c 69 62 72 61 72 69 | of wimp| librari|
|00002170| 65 73 20 74 6f 20 63 6f | 6e 76 65 72 74 20 74 68 |es to co|nvert th|
|00002180| 69 73 20 70 72 6f 67 72 | 61 6d 20 74 6f 0a 20 20 |is progr|am to. |
|00002190| 20 63 6f 6d 70 69 6c 65 | 20 75 6e 64 65 72 20 74 | compile| under t|
|000021a0| 68 65 69 72 20 6f 77 6e | 20 73 65 74 2d 75 70 2e |heir own| set-up.|
|000021b0| 0a 0a 20 20 20 45 6e 6a | 6f 79 2e 0a 0a 20 2a 0a |.. Enj|oy... *.|
|000021c0| 20 2a 0a 20 2a 0a 20 2a | 20 20 41 73 74 72 6f 6e | *. *. *| Astron|
|000021d0| 6f 6d 69 63 61 6c 20 63 | 6f 6e 73 74 61 6e 74 73 |omical c|onstants|
|000021e0| 20 0a 20 2a 2f 0a 23 64 | 65 66 69 6e 65 20 65 70 | . */.#d|efine ep|
|000021f0| 6f 63 68 20 20 20 20 20 | 20 20 32 34 34 34 32 33 |och | 244423|
|00002200| 38 2e 35 20 20 20 20 20 | 20 2f 2a 20 31 39 38 30 |8.5 | /* 1980|
|00002210| 20 4a 61 6e 75 61 72 79 | 20 30 2e 30 20 2a 2f 0a | January| 0.0 */.|
|00002220| 0a 2f 2a 0a 20 2a 20 20 | 43 6f 6e 73 74 61 6e 74 |./*. * |Constant|
|00002230| 73 20 64 65 66 69 6e 69 | 6e 67 20 74 68 65 20 53 |s defini|ng the S|
|00002240| 75 6e 27 73 20 61 70 70 | 61 72 65 6e 74 20 6f 72 |un's app|arent or|
|00002250| 62 69 74 20 20 0a 20 2a | 2f 0a 23 64 65 66 69 6e |bit . *|/.#defin|
|00002260| 65 20 65 6c 6f 6e 67 65 | 20 20 20 20 20 20 32 37 |e elonge| 27|
|00002270| 38 2e 38 33 33 35 34 30 | 20 20 20 20 20 2f 2a 20 |8.833540| /* |
|00002280| 45 63 6c 69 70 74 69 63 | 20 6c 6f 6e 67 69 74 75 |Ecliptic| longitu|
|00002290| 64 65 20 6f 66 20 74 68 | 65 20 53 75 6e 20 61 74 |de of th|e Sun at|
|000022a0| 20 65 70 6f 63 68 20 31 | 39 38 30 2e 30 20 2a 2f | epoch 1|980.0 */|
|000022b0| 0a 23 64 65 66 69 6e 65 | 20 65 6c 6f 6e 67 70 20 |.#define| elongp |
|000022c0| 20 20 20 20 20 32 38 32 | 2e 35 39 36 34 30 33 20 | 282|.596403 |
|000022d0| 20 20 20 20 2f 2a 20 45 | 63 6c 69 70 74 69 63 20 | /* E|cliptic |
|000022e0| 6c 6f 6e 67 69 74 75 64 | 65 20 6f 66 20 74 68 65 |longitud|e of the|
|000022f0| 20 53 75 6e 20 61 74 20 | 70 65 72 69 67 65 65 20 | Sun at |perigee |
|00002300| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 65 63 63 65 6e |*/.#defi|ne eccen|
|00002310| 74 20 20 20 20 20 20 30 | 2e 30 31 36 37 31 38 20 |t 0|.016718 |
|00002320| 20 20 20 20 20 20 2f 2a | 20 45 63 63 65 6e 74 72 | /*| Eccentr|
|00002330| 69 63 69 74 79 20 6f 66 | 20 45 61 72 74 68 27 73 |icity of| Earth's|
|00002340| 20 6f 72 62 69 74 20 2a | 2f 0a 23 64 65 66 69 6e | orbit *|/.#defin|
|00002350| 65 20 73 75 6e 73 6d 61 | 78 20 20 20 20 20 31 2e |e sunsma|x 1.|
|00002360| 34 39 35 39 38 35 65 38 | 20 20 20 20 20 2f 2a 20 |495985e8| /* |
|00002370| 53 65 6d 69 2d 6d 61 6a | 6f 72 20 61 78 69 73 20 |Semi-maj|or axis |
|00002380| 6f 66 20 45 61 72 74 68 | 27 73 20 6f 72 62 69 74 |of Earth|'s orbit|
|00002390| 2c 20 6b 6d 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |, km */.|#define |
|000023a0| 73 75 6e 61 6e 67 73 69 | 7a 20 20 20 30 2e 35 33 |sunangsi|z 0.53|
|000023b0| 33 31 32 38 20 20 20 20 | 20 20 20 2f 2a 20 53 75 |3128 | /* Su|
|000023c0| 6e 27 73 20 61 6e 67 75 | 6c 61 72 20 73 69 7a 65 |n's angu|lar size|
|000023d0| 2c 20 64 65 67 73 2c 20 | 61 74 20 73 65 6d 69 2d |, degs, |at semi-|
|000023e0| 6d 61 6a 6f 72 20 61 78 | 69 73 20 64 69 73 74 61 |major ax|is dista|
|000023f0| 6e 63 65 20 2a 2f 0a 0a | 2f 2a 0a 20 2a 20 20 45 |nce */..|/*. * E|
|00002400| 6c 65 6d 65 6e 74 73 20 | 6f 66 20 74 68 65 20 4d |lements |of the M|
|00002410| 6f 6f 6e 27 73 20 6f 72 | 62 69 74 2c 20 65 70 6f |oon's or|bit, epo|
|00002420| 63 68 20 31 39 38 30 2e | 30 0a 20 2a 2f 0a 23 64 |ch 1980.|0. */.#d|
|00002430| 65 66 69 6e 65 20 6d 6d | 6c 6f 6e 67 20 20 20 20 |efine mm|long |
|00002440| 20 20 36 34 2e 39 37 35 | 34 36 34 20 20 20 20 20 | 64.975|464 |
|00002450| 20 2f 2a 20 4d 6f 6f 6e | 27 73 20 6d 65 61 6e 20 | /* Moon|'s mean |
|00002460| 6c 6f 6e 69 67 69 74 75 | 64 65 20 61 74 20 74 68 |lonigitu|de at th|
|00002470| 65 20 65 70 6f 63 68 20 | 2a 2f 0a 23 64 65 66 69 |e epoch |*/.#defi|
|00002480| 6e 65 20 6d 6d 6c 6f 6e | 67 70 20 20 20 20 20 33 |ne mmlon|gp 3|
|00002490| 34 39 2e 33 38 33 30 36 | 33 20 20 20 20 20 2f 2a |49.38306|3 /*|
|000024a0| 20 4d 65 61 6e 20 6c 6f | 6e 67 69 74 75 64 65 20 | Mean lo|ngitude |
|000024b0| 6f 66 20 74 68 65 20 70 | 65 72 69 67 65 65 20 61 |of the p|erigee a|
|000024c0| 74 20 74 68 65 20 65 70 | 6f 63 68 20 2a 2f 0a 23 |t the ep|och */.#|
|000024d0| 64 65 66 69 6e 65 20 6d | 6c 6e 6f 64 65 20 20 20 |define m|lnode |
|000024e0| 20 20 20 31 35 31 2e 39 | 35 30 34 32 39 20 20 20 | 151.9|50429 |
|000024f0| 20 20 2f 2a 20 4d 65 61 | 6e 20 6c 6f 6e 67 69 74 | /* Mea|n longit|
|00002500| 75 64 65 20 6f 66 20 74 | 68 65 20 6e 6f 64 65 20 |ude of t|he node |
|00002510| 61 74 20 74 68 65 20 65 | 70 6f 63 68 20 2a 2f 0a |at the e|poch */.|
|00002520| 23 64 65 66 69 6e 65 20 | 6d 69 6e 63 20 20 20 20 |#define |minc |
|00002530| 20 20 20 20 35 2e 31 34 | 35 33 39 36 20 20 20 20 | 5.14|5396 |
|00002540| 20 20 20 2f 2a 20 49 6e | 63 6c 69 6e 61 74 69 6f | /* In|clinatio|
|00002550| 6e 20 6f 66 20 74 68 65 | 20 4d 6f 6f 6e 27 73 20 |n of the| Moon's |
|00002560| 6f 72 62 69 74 20 2a 2f | 0a 23 64 65 66 69 6e 65 |orbit */|.#define|
|00002570| 20 6d 65 63 63 20 20 20 | 20 20 20 20 20 30 2e 30 | mecc | 0.0|
|00002580| 35 34 39 30 30 20 20 20 | 20 20 20 20 2f 2a 20 45 |54900 | /* E|
|00002590| 63 63 65 6e 74 72 69 63 | 69 74 79 20 6f 66 20 74 |ccentric|ity of t|
|000025a0| 68 65 20 4d 6f 6f 6e 27 | 73 20 6f 72 62 69 74 20 |he Moon'|s orbit |
|000025b0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 6d 61 6e 67 73 |*/.#defi|ne mangs|
|000025c0| 69 7a 20 20 20 20 20 30 | 2e 35 31 38 31 20 20 20 |iz 0|.5181 |
|000025d0| 20 20 20 20 20 20 2f 2a | 20 4d 6f 6f 6e 27 73 20 | /*| Moon's |
|000025e0| 61 6e 67 75 6c 61 72 20 | 73 69 7a 65 20 61 74 20 |angular |size at |
|000025f0| 64 69 73 74 61 6e 63 65 | 20 61 20 66 72 6f 6d 20 |distance| a from |
|00002600| 45 61 72 74 68 20 2a 2f | 0a 23 64 65 66 69 6e 65 |Earth */|.#define|
|00002610| 20 6d 73 6d 61 78 20 20 | 20 20 20 20 20 33 38 34 | msmax | 384|
|00002620| 34 30 31 2e 30 20 20 20 | 20 20 20 20 2f 2a 20 53 |401.0 | /* S|
|00002630| 65 6d 69 2d 6d 61 6a 6f | 72 20 61 78 69 73 20 6f |emi-majo|r axis o|
|00002640| 66 20 4d 6f 6f 6e 27 73 | 20 6f 72 62 69 74 20 69 |f Moon's| orbit i|
|00002650| 6e 20 6b 6d 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |n km */.|#define |
|00002660| 6d 70 61 72 61 6c 6c 61 | 78 20 20 20 30 2e 39 35 |mparalla|x 0.95|
|00002670| 30 37 20 20 20 20 20 20 | 20 20 20 2f 2a 20 50 61 |07 | /* Pa|
|00002680| 72 61 6c 6c 61 78 20 61 | 74 20 64 69 73 74 61 6e |rallax a|t distan|
|00002690| 63 65 20 61 20 66 72 6f | 6d 20 45 61 72 74 68 20 |ce a fro|m Earth |
|000026a0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 73 79 6e 6d 6f |*/.#defi|ne synmo|
|000026b0| 6e 74 68 20 20 20 20 32 | 39 2e 35 33 30 35 38 38 |nth 2|9.530588|
|000026c0| 36 38 20 20 20 20 2f 2a | 20 53 79 6e 6f 64 69 63 |68 /*| Synodic|
|000026d0| 20 6d 6f 6e 74 68 20 28 | 6e 65 77 20 4d 6f 6f 6e | month (|new Moon|
|000026e0| 20 74 6f 20 6e 65 77 20 | 4d 6f 6f 6e 29 20 2a 2f | to new |Moon) */|
|000026f0| 0a 23 64 65 66 69 6e 65 | 20 6c 75 6e 61 74 62 61 |.#define| lunatba|
|00002700| 73 65 20 20 20 32 34 32 | 33 34 33 36 2e 30 20 20 |se 242|3436.0 |
|00002710| 20 20 20 20 2f 2a 20 42 | 61 73 65 20 64 61 74 65 | /* B|ase date|
|00002720| 20 66 6f 72 20 45 2e 20 | 57 2e 20 42 72 6f 77 6e | for E. |W. Brown|
|00002730| 27 73 20 6e 75 6d 62 65 | 72 65 64 20 73 65 72 69 |'s numbe|red seri|
|00002740| 65 73 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |es. | |
|00002750| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002760| 20 20 20 20 20 20 20 20 | 20 6f 66 20 6c 75 6e 61 | | of luna|
|00002770| 74 69 6f 6e 73 20 28 31 | 39 32 33 20 4a 61 6e 75 |tions (1|923 Janu|
|00002780| 61 72 79 20 31 36 29 20 | 2a 2f 0a 2f 2a 0a 20 2a |ary 16) |*/./*. *|
|00002790| 20 20 50 72 6f 70 65 72 | 74 69 65 73 20 6f 66 20 | Proper|ties of |
|000027a0| 74 68 65 20 45 61 72 74 | 68 0a 20 2a 2f 0a 23 64 |the Eart|h. */.#d|
|000027b0| 65 66 69 6e 65 20 65 61 | 72 74 68 72 61 64 20 20 |efine ea|rthrad |
|000027c0| 20 20 36 33 37 38 2e 31 | 36 20 20 20 20 20 20 20 | 6378.1|6 |
|000027d0| 20 2f 2a 20 52 61 64 69 | 75 73 20 6f 66 20 45 61 | /* Radi|us of Ea|
|000027e0| 72 74 68 20 69 6e 20 6b | 69 6c 6f 6d 65 74 72 65 |rth in k|ilometre|
|000027f0| 73 20 2a 2f 0a 0a 23 69 | 6e 63 6c 75 64 65 20 3c |s */..#i|nclude <|
|00002800| 73 74 64 69 6f 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |stdio.h>|.#includ|
|00002810| 65 20 3c 73 74 64 6c 69 | 62 2e 68 3e 0a 23 69 6e |e <stdli|b.h>.#in|
|00002820| 63 6c 75 64 65 20 3c 6d | 61 74 68 2e 68 3e 0a 23 |clude <m|ath.h>.#|
|00002830| 69 6e 63 6c 75 64 65 20 | 3c 74 69 6d 65 2e 68 3e |include |<time.h>|
|00002840| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 72 69 6e |.#includ|e <strin|
|00002850| 67 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |g.h>.#in|clude <s|
|00002860| 74 64 61 72 67 2e 68 3e | 0a 0a 2f 2a 0a 20 2a 20 |tdarg.h>|../*. * |
|00002870| 20 48 61 6e 64 79 20 6d | 61 74 68 65 6d 61 74 69 | Handy m|athemati|
|00002880| 63 61 6c 20 66 75 6e 63 | 74 69 6f 6e 73 20 61 6e |cal func|tions an|
|00002890| 64 20 63 6f 6e 73 74 61 | 6e 74 73 0a 20 2a 2f 0a |d consta|nts. */.|
|000028a0| 23 64 65 66 69 6e 65 20 | 45 50 53 49 4c 4f 4e 20 |#define |EPSILON |
|000028b0| 31 45 2d 36 20 20 0a 23 | 64 65 66 69 6e 65 20 50 |1E-6 .#|define P|
|000028c0| 49 20 33 2e 31 34 31 35 | 39 32 36 35 33 35 38 39 |I 3.1415|92653589|
|000028d0| 37 39 33 32 33 38 34 36 | 20 20 2f 2a 20 41 73 73 |79323846| /* Ass|
|000028e0| 75 6d 65 20 6e 6f 74 20 | 6e 65 61 72 20 62 6c 61 |ume not |near bla|
|000028f0| 63 6b 20 68 6f 6c 65 20 | 6e 6f 72 20 69 6e 20 54 |ck hole |nor in T|
|00002900| 65 6e 6e 65 73 73 65 65 | 20 2a 2f 0a 23 64 65 66 |ennessee| */.#def|
|00002910| 69 6e 65 20 73 67 6e 28 | 78 29 20 28 28 28 78 29 |ine sgn(|x) (((x)|
|00002920| 20 3c 20 30 29 20 3f 20 | 2d 31 20 3a 20 28 28 78 | < 0) ? |-1 : ((x|
|00002930| 29 20 3e 20 30 20 3f 20 | 31 20 3a 20 30 29 29 20 |) > 0 ? |1 : 0)) |
|00002940| 20 20 20 20 20 20 2f 2a | 20 45 78 74 72 61 63 74 | /*| Extract|
|00002950| 20 73 69 67 6e 20 2a 2f | 0a 23 64 65 66 69 6e 65 | sign */|.#define|
|00002960| 20 61 62 73 28 78 29 20 | 28 28 78 29 20 3c 20 30 | abs(x) |((x) < 0|
|00002970| 20 3f 20 28 2d 28 78 29 | 29 20 3a 20 28 78 29 29 | ? (-(x)|) : (x))|
|00002980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002990| 20 20 20 2f 2a 20 41 62 | 73 6f 6c 75 74 65 20 76 | /* Ab|solute v|
|000029a0| 61 6c 20 2a 2f 0a 23 64 | 65 66 69 6e 65 20 66 69 |al */.#d|efine fi|
|000029b0| 78 61 6e 67 6c 65 28 61 | 29 20 28 28 61 29 20 2d |xangle(a|) ((a) -|
|000029c0| 20 33 36 30 2e 30 20 2a | 20 28 66 6c 6f 6f 72 28 | 360.0 *| (floor(|
|000029d0| 28 61 29 20 2f 20 33 36 | 30 2e 30 29 29 29 20 20 |(a) / 36|0.0))) |
|000029e0| 2f 2a 20 46 69 78 20 61 | 6e 67 6c 65 20 20 20 20 |/* Fix a|ngle |
|000029f0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 74 6f 72 61 64 |*/.#defi|ne torad|
|00002a00| 28 64 29 20 28 28 64 29 | 20 2a 20 28 50 49 20 2f |(d) ((d)| * (PI /|
|00002a10| 20 31 38 30 2e 30 29 29 | 20 20 20 20 20 20 20 20 | 180.0))| |
|00002a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00002a30| 44 65 67 2d 3e 52 61 64 | 20 20 20 20 20 2a 2f 0a |Deg->Rad| */.|
|00002a40| 23 64 65 66 69 6e 65 20 | 74 6f 64 65 67 28 64 29 |#define |todeg(d)|
|00002a50| 20 28 28 64 29 20 2a 20 | 28 31 38 30 2e 30 20 2f | ((d) * |(180.0 /|
|00002a60| 20 50 49 29 29 20 20 20 | 20 20 20 20 20 20 20 20 | PI)) | |
|00002a70| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 52 61 64 | | /* Rad|
|00002a80| 2d 3e 44 65 67 20 20 20 | 20 20 2a 2f 0a 23 64 65 |->Deg | */.#de|
|00002a90| 66 69 6e 65 20 64 73 69 | 6e 28 78 29 20 28 73 69 |fine dsi|n(x) (si|
|00002aa0| 6e 28 74 6f 72 61 64 28 | 28 78 29 29 29 29 20 20 |n(torad(|(x)))) |
|00002ab0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ac0| 20 20 20 20 20 20 20 2f | 2a 20 53 69 6e 20 66 72 | /|* Sin fr|
|00002ad0| 6f 6d 20 64 65 67 20 2a | 2f 0a 23 64 65 66 69 6e |om deg *|/.#defin|
|00002ae0| 65 20 64 63 6f 73 28 78 | 29 20 28 63 6f 73 28 74 |e dcos(x|) (cos(t|
|00002af0| 6f 72 61 64 28 28 78 29 | 29 29 29 20 20 20 20 20 |orad((x)|))) |
|00002b00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002b10| 20 20 20 20 2f 2a 20 43 | 6f 73 20 66 72 6f 6d 20 | /* C|os from |
|00002b20| 64 65 67 20 2a 2f 0a 0a | 23 64 65 66 69 6e 65 20 |deg */..|#define |
|00002b30| 46 41 4c 53 45 20 30 0a | 23 64 65 66 69 6e 65 20 |FALSE 0.|#define |
|00002b40| 54 52 55 45 20 20 31 0a | 0a 73 74 61 74 69 63 20 |TRUE 1.|.static |
|00002b50| 69 6e 74 20 74 65 73 74 | 6d 6f 64 65 20 3d 20 46 |int test|mode = F|
|00002b60| 41 4c 53 45 3b 20 20 20 | 20 20 20 20 2f 2a 20 52 |ALSE; | /* R|
|00002b70| 61 70 69 64 20 77 61 72 | 70 20 74 68 72 6f 75 67 |apid war|p throug|
|00002b80| 68 20 74 69 6d 65 20 66 | 6f 72 20 64 65 62 75 67 |h time f|or debug|
|00002b90| 67 69 6e 67 20 2a 2f 0a | 73 74 61 74 69 63 20 69 |ging */.|static i|
|00002ba0| 6e 74 20 49 63 6f 6e 69 | 73 65 64 20 3d 20 54 52 |nt Iconi|sed = TR|
|00002bb0| 55 45 3b 0a 0a 2f 2a 20 | 20 46 6f 72 77 61 72 64 |UE;../* | Forward|
|00002bc0| 20 66 75 6e 63 74 69 6f | 6e 73 20 20 2a 2f 0a 0a | functio|ns */..|
|00002bd0| 64 6f 75 62 6c 65 20 6a | 74 69 6d 65 28 73 74 72 |double j|time(str|
|00002be0| 75 63 74 20 74 6d 20 2a | 29 3b 0a 64 6f 75 62 6c |uct tm *|);.doubl|
|00002bf0| 65 20 70 68 61 73 65 28 | 64 6f 75 62 6c 65 2c 20 |e phase(|double, |
|00002c00| 64 6f 75 62 6c 65 20 2a | 2c 20 64 6f 75 62 6c 65 |double *|, double|
|00002c10| 20 2a 2c 20 64 6f 75 62 | 6c 65 20 2a 2c 20 64 6f | *, doub|le *, do|
|00002c20| 75 62 6c 65 20 2a 2c 20 | 64 6f 75 62 6c 65 20 2a |uble *, |double *|
|00002c30| 2c 20 64 6f 75 62 6c 65 | 20 2a 29 3b 0a 76 6f 69 |, double| *);.voi|
|00002c40| 64 20 20 20 70 68 61 73 | 65 68 75 6e 74 28 64 6f |d phas|ehunt(do|
|00002c50| 75 62 6c 65 2c 20 64 6f | 75 62 6c 65 20 2a 29 3b |uble, do|uble *);|
|00002c60| 0a 76 6f 69 64 20 20 20 | 72 69 6e 67 67 67 28 76 |.void |ringgg(v|
|00002c70| 6f 69 64 29 3b 0a 76 6f | 69 64 20 20 20 64 72 61 |oid);.vo|id dra|
|00002c80| 77 6d 6f 6f 6e 28 64 6f | 75 62 6c 65 29 3b 0a 76 |wmoon(do|uble);.v|
|00002c90| 6f 69 64 20 20 20 6a 79 | 65 61 72 28 64 6f 75 62 |oid jy|ear(doub|
|00002ca0| 6c 65 2c 20 69 6e 74 20 | 2a 2c 20 69 6e 74 20 2a |le, int |*, int *|
|00002cb0| 2c 20 69 6e 74 20 2a 29 | 3b 0a 76 6f 69 64 20 20 |, int *)|;.void |
|00002cc0| 20 6a 68 6d 73 28 64 6f | 75 62 6c 65 2c 20 69 6e | jhms(do|uble, in|
|00002cd0| 74 20 2a 2c 20 69 6e 74 | 20 2a 2c 20 69 6e 74 20 |t *, int| *, int |
|00002ce0| 2a 29 3b 0a 0a 23 64 65 | 66 69 6e 65 20 50 6c 75 |*);..#de|fine Plu|
|00002cf0| 72 61 6c 28 78 29 20 28 | 78 29 20 3d 3d 20 31 20 |ral(x) (|x) == 1 |
|00002d00| 3f 20 22 22 20 3a 20 22 | 73 22 0a 0a 0a 2f 2a 2a |? "" : "|s".../**|
|00002d10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002d20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002d30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0a 0a |********|*****/..|
|00002d40| 23 69 6e 63 6c 75 64 65 | 20 22 57 69 6d 70 2e 68 |#include| "Wimp.h|
|00002d50| 22 0a 23 69 6e 63 6c 75 | 64 65 20 22 47 46 58 2e |".#inclu|de "GFX.|
|00002d60| 68 22 0a 0a 23 64 65 66 | 69 6e 65 20 4a 75 6c 69 |h"..#def|ine Juli|
|00002d70| 61 6e 5f 44 61 74 65 20 | 20 20 20 20 20 20 20 20 |an_Date | |
|00002d80| 20 20 20 20 20 20 34 0a | 23 64 65 66 69 6e 65 20 | 4.|#define |
|00002d90| 4c 6f 63 61 6c 5f 54 69 | 6d 65 20 20 20 20 20 20 |Local_Ti|me |
|00002da0| 20 20 20 20 20 20 20 20 | 20 20 37 0a 23 64 65 66 | | 7.#def|
|00002db0| 69 6e 65 20 4c 6f 63 61 | 6c 5f 44 61 74 65 20 20 |ine Loca|l_Date |
|00002dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 38 0a | | 8.|
|00002dd0| 23 64 65 66 69 6e 65 20 | 55 6e 69 76 65 72 73 61 |#define |Universa|
|00002de0| 6c 5f 54 69 6d 65 20 20 | 20 20 20 20 20 20 20 20 |l_Time | |
|00002df0| 20 20 31 31 0a 23 64 65 | 66 69 6e 65 20 55 6e 69 | 11.#de|fine Uni|
|00002e00| 76 65 72 73 61 6c 5f 44 | 61 74 65 20 20 20 20 20 |versal_D|ate |
|00002e10| 20 20 20 20 20 20 20 31 | 32 0a 23 64 65 66 69 6e | 1|2.#defin|
|00002e20| 65 20 4d 6f 6f 6e 5f 53 | 75 62 74 65 6e 64 73 20 |e Moon_S|ubtends |
|00002e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 31 37 0a 23 | | 17.#|
|00002e40| 64 65 66 69 6e 65 20 4d | 6f 6f 6e 44 69 73 74 61 |define M|oonDista|
|00002e50| 6e 63 65 5f 4b 69 6c 6f | 6d 65 74 65 72 73 20 20 |nce_Kilo|meters |
|00002e60| 20 32 30 0a 23 64 65 66 | 69 6e 65 20 4d 6f 6f 6e | 20.#def|ine Moon|
|00002e70| 44 69 73 74 61 6e 63 65 | 5f 52 61 64 69 69 20 20 |Distance|_Radii |
|00002e80| 20 20 20 20 20 20 32 31 | 0a 23 64 65 66 69 6e 65 | 21|.#define|
|00002e90| 20 4d 6f 6f 6e 41 67 65 | 5f 44 61 79 73 20 20 20 | MoonAge|_Days |
|00002ea0| 20 20 20 20 20 20 20 20 | 20 20 20 32 37 0a 23 64 | | 27.#d|
|00002eb0| 65 66 69 6e 65 20 4d 6f | 6f 6e 41 67 65 5f 48 6f |efine Mo|onAge_Ho|
|00002ec0| 75 72 73 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |urs | |
|00002ed0| 32 38 0a 23 64 65 66 69 | 6e 65 20 4d 6f 6f 6e 41 |28.#defi|ne MoonA|
|00002ee0| 67 65 5f 4d 69 6e 75 74 | 65 73 20 20 20 20 20 20 |ge_Minut|es |
|00002ef0| 20 20 20 20 20 32 39 0a | 23 64 65 66 69 6e 65 20 | 29.|#define |
|00002f00| 53 75 6e 5f 53 75 62 74 | 65 6e 64 73 20 20 20 20 |Sun_Subt|ends |
|00002f10| 20 20 20 20 20 20 20 20 | 20 20 33 34 0a 23 64 65 | | 34.#de|
|00002f20| 66 69 6e 65 20 53 75 6e | 44 69 73 74 61 6e 63 65 |fine Sun|Distance|
|00002f30| 5f 4b 69 6c 6f 6d 65 74 | 65 72 73 20 20 20 20 33 |_Kilomet|ers 3|
|00002f40| 37 0a 23 64 65 66 69 6e | 65 20 53 75 6e 44 69 73 |7.#defin|e SunDis|
|00002f50| 74 61 6e 63 65 5f 41 55 | 20 20 20 20 20 20 20 20 |tance_AU| |
|00002f60| 20 20 20 20 33 38 0a 23 | 64 65 66 69 6e 65 20 50 | 38.#|define P|
|00002f70| 68 61 73 65 73 5f 4c 61 | 73 74 4e 65 77 4d 6f 6f |hases_La|stNewMoo|
|00002f80| 6e 20 20 20 20 20 20 20 | 20 34 35 0a 23 64 65 66 |n | 45.#def|
|00002f90| 69 6e 65 20 50 68 61 73 | 65 73 5f 46 69 72 73 74 |ine Phas|es_First|
|00002fa0| 51 75 61 72 74 65 72 20 | 20 20 20 20 20 20 34 38 |Quarter | 48|
|00002fb0| 0a 23 64 65 66 69 6e 65 | 20 50 68 61 73 65 73 5f |.#define| Phases_|
|00002fc0| 46 75 6c 6c 4d 6f 6f 6e | 20 20 20 20 20 20 20 20 |FullMoon| |
|00002fd0| 20 20 20 35 31 0a 23 64 | 65 66 69 6e 65 20 50 68 | 51.#d|efine Ph|
|00002fe0| 61 73 65 73 5f 4c 61 73 | 74 51 75 61 72 74 65 72 |ases_Las|tQuarter|
|00002ff0| 20 20 20 20 20 20 20 20 | 35 34 0a 23 64 65 66 69 | |54.#defi|
|00003000| 6e 65 20 50 68 61 73 65 | 73 5f 4e 65 78 74 4e 65 |ne Phase|s_NextNe|
|00003010| 77 4d 6f 6f 6e 20 20 20 | 20 20 20 20 20 35 37 0a |wMoon | 57.|
|00003020| 23 64 65 66 69 6e 65 20 | 50 68 61 73 65 73 5f 43 |#define |Phases_C|
|00003030| 75 72 72 65 6e 74 4c 75 | 6e 61 74 69 6f 6e 20 20 |urrentLu|nation |
|00003040| 20 20 36 31 0a 0a 74 61 | 73 6b 68 61 6e 64 6c 65 | 61..ta|skhandle|
|00003050| 20 20 20 4f 75 72 54 61 | 73 6b 48 61 6e 64 6c 65 | OurTa|skHandle|
|00003060| 3b 0a 77 69 6e 64 6f 77 | 68 61 6e 64 6c 65 20 4d |;.window|handle M|
|00003070| 6f 6f 6e 54 6f 6f 6c 3b | 0a 77 69 6e 64 6f 77 68 |oonTool;|.windowh|
|00003080| 61 6e 64 6c 65 20 4d 6f | 6f 6e 49 63 6f 6e 3b 0a |andle Mo|onIcon;.|
|00003090| 0a 63 68 61 72 20 74 65 | 6d 70 5b 31 32 38 5d 3b |.char te|mp[128];|
|000030a0| 20 20 20 2f 2a 20 41 20 | 74 65 6d 70 6f 72 61 72 | /* A |temporar|
|000030b0| 79 20 73 74 72 69 6e 67 | 20 62 75 66 66 65 72 20 |y string| buffer |
|000030c0| 2a 2f 0a 0a 2f 2a 0a 20 | 2a 20 20 55 73 65 66 75 |*/../*. |* Usefu|
|000030d0| 6c 20 52 69 73 63 20 4f | 53 20 66 75 6e 63 74 69 |l Risc O|S functi|
|000030e0| 6f 6e 73 20 20 0a 20 2a | 2f 20 0a 76 6f 69 64 20 |ons . *|/ .void |
|000030f0| 49 63 6f 6e 5f 53 6d 61 | 72 74 50 72 69 6e 74 28 |Icon_Sma|rtPrint(|
|00003100| 69 63 6f 6e 68 61 6e 64 | 6c 65 20 69 2c 20 63 68 |iconhand|le i, ch|
|00003110| 61 72 20 2a 66 6f 72 6d | 61 74 2c 20 2e 2e 2e 29 |ar *form|at, ...)|
|00003120| 0a 20 20 20 20 7b 0a 20 | 20 20 20 76 61 5f 6c 69 |. {. | va_li|
|00003130| 73 74 20 20 20 20 61 72 | 67 70 3b 0a 20 20 20 20 |st ar|gp;. |
|00003140| 69 63 6f 6e 73 74 61 74 | 65 20 20 69 6e 66 6f 3b |iconstat|e info;|
|00003150| 0a 20 20 20 20 63 68 61 | 72 20 20 20 20 20 20 2a |. cha|r *|
|00003160| 73 6f 75 72 63 65 3b 0a | 20 20 20 20 63 68 61 72 |source;.| char|
|00003170| 20 20 20 20 20 20 2a 64 | 65 73 74 3b 0a 20 20 20 | *d|est;. |
|00003180| 20 69 6e 74 20 20 20 20 | 20 20 20 20 6c 65 6e 67 | int | leng|
|00003190| 74 68 3b 0a 0a 20 20 20 | 20 76 61 5f 73 74 61 72 |th;.. | va_star|
|000031a0| 74 28 61 72 67 70 2c 20 | 66 6f 72 6d 61 74 29 3b |t(argp, |format);|
|000031b0| 0a 20 20 20 20 76 73 70 | 72 69 6e 74 66 28 74 65 |. vsp|rintf(te|
|000031c0| 6d 70 2c 20 66 6f 72 6d | 61 74 2c 20 61 72 67 70 |mp, form|at, argp|
|000031d0| 29 3b 0a 20 20 20 20 76 | 61 5f 65 6e 64 28 61 72 |);. v|a_end(ar|
|000031e0| 67 70 29 3b 0a 0a 20 20 | 20 20 57 69 6d 70 5f 47 |gp);.. | Wimp_G|
|000031f0| 65 74 49 63 6f 6e 53 74 | 61 74 65 28 4d 6f 6f 6e |etIconSt|ate(Moon|
|00003200| 54 6f 6f 6c 2c 20 69 2c | 20 26 69 6e 66 6f 29 3b |Tool, i,| &info);|
|00003210| 0a 0a 20 20 20 20 69 66 | 28 69 6e 66 6f 2e 69 63 |.. if|(info.ic|
|00003220| 6f 6e 2e 66 6c 61 67 73 | 2e 66 65 69 6c 64 2e 69 |on.flags|.feild.i|
|00003230| 6e 64 69 72 65 63 74 65 | 64 29 0a 20 20 20 20 20 |ndirecte|d). |
|00003240| 20 20 20 7b 0a 20 20 20 | 20 20 20 20 20 64 65 73 | {. | des|
|00003250| 74 20 3d 20 69 6e 66 6f | 2e 69 63 6f 6e 2e 64 61 |t = info|.icon.da|
|00003260| 74 61 2e 69 6e 64 69 72 | 65 63 74 65 64 74 65 78 |ta.indir|ectedtex|
|00003270| 74 2e 62 75 66 66 65 72 | 3b 0a 20 20 20 20 20 20 |t.buffer|;. |
|00003280| 20 20 6c 65 6e 67 74 68 | 20 3d 20 69 6e 66 6f 2e | length| = info.|
|00003290| 69 63 6f 6e 2e 64 61 74 | 61 2e 69 6e 64 69 72 65 |icon.dat|a.indire|
|000032a0| 63 74 65 64 74 65 78 74 | 2e 62 75 66 66 6c 65 6e |ctedtext|.bufflen|
|000032b0| 2d 31 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 20 20 |-1;. | }. |
|000032c0| 20 20 65 6c 73 65 0a 20 | 20 20 20 20 20 20 20 7b | else. | {|
|000032d0| 0a 20 20 20 20 20 20 20 | 20 64 65 73 74 20 3d 20 |. | dest = |
|000032e0| 69 6e 66 6f 2e 69 63 6f | 6e 2e 64 61 74 61 2e 74 |info.ico|n.data.t|
|000032f0| 65 78 74 3b 0a 20 20 20 | 20 20 20 20 20 6c 65 6e |ext;. | len|
|00003300| 67 74 68 20 3d 20 31 31 | 3b 0a 20 20 20 20 20 20 |gth = 11|;. |
|00003310| 20 20 7d 0a 20 20 20 20 | 73 6f 75 72 63 65 20 3d | }. |source =|
|00003320| 20 74 65 6d 70 3b 0a 0a | 20 20 20 20 69 66 28 73 | temp;..| if(s|
|00003330| 74 72 6e 63 6d 70 28 64 | 65 73 74 2c 20 73 6f 75 |trncmp(d|est, sou|
|00003340| 72 63 65 2c 20 6c 65 6e | 67 74 68 29 20 21 3d 20 |rce, len|gth) != |
|00003350| 30 29 0a 20 20 20 20 20 | 20 20 20 7b 0a 20 20 20 |0). | {. |
|00003360| 20 20 20 20 20 73 74 72 | 6e 63 70 79 28 64 65 73 | str|ncpy(des|
|00003370| 74 2c 20 73 6f 75 72 63 | 65 2c 20 6c 65 6e 67 74 |t, sourc|e, lengt|
|00003380| 68 29 3b 0a 20 20 20 20 | 20 20 20 20 57 69 6d 70 |h);. | Wimp|
|00003390| 5f 53 65 74 49 63 6f 6e | 53 74 61 74 65 28 4d 6f |_SetIcon|State(Mo|
|000033a0| 6f 6e 54 6f 6f 6c 2c 20 | 69 2c 20 30 2c 20 30 29 |onTool, |i, 0, 0)|
|000033b0| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|000033c0| 7d 0a 0a 0a 76 6f 69 64 | 20 53 74 61 72 74 57 69 |}...void| StartWi|
|000033d0| 6d 70 28 76 6f 69 64 29 | 0a 20 20 20 20 7b 0a 20 |mp(void)|. {. |
|000033e0| 20 20 20 69 6e 74 20 20 | 20 20 20 20 20 20 20 20 | int | |
|000033f0| 20 69 3b 0a 20 20 20 20 | 69 6e 74 20 20 20 20 20 | i;. |int |
|00003400| 20 20 20 20 20 20 69 73 | 69 7a 65 3b 0a 20 20 20 | is|ize;. |
|00003410| 20 69 6e 74 20 20 20 20 | 20 20 20 20 20 20 20 77 | int | w|
|00003420| 69 6e 64 6f 77 73 69 7a | 65 3b 0a 20 20 20 20 42 |indowsiz|e;. B|
|00003430| 4f 4f 4c 20 20 20 20 20 | 20 20 20 20 20 66 6f 6e |OOL | fon|
|00003440| 74 73 70 72 65 73 65 6e | 74 3b 0a 20 20 20 20 77 |tspresen|t;. w|
|00003450| 69 6e 64 6f 77 20 20 20 | 20 20 20 20 2a 6d 6f 6f |indow | *moo|
|00003460| 6e 74 6f 6f 6c 77 69 6e | 64 6f 77 3b 0a 20 20 20 |ntoolwin|dow;. |
|00003470| 20 77 69 6e 64 6f 77 20 | 20 20 20 20 20 20 2a 6d | window | *m|
|00003480| 6f 6f 6e 69 63 6f 6e 77 | 69 6e 64 6f 77 3b 0a 20 |ooniconw|indow;. |
|00003490| 20 20 20 77 69 6e 64 6f | 77 20 20 20 20 20 20 20 | windo|w |
|000034a0| 2a 73 63 72 61 74 63 68 | 77 69 6e 64 6f 77 3b 0a |*scratch|window;.|
|000034b0| 20 20 20 20 76 6f 69 64 | 20 20 20 20 20 20 20 20 | void| |
|000034c0| 20 2a 6d 6f 6f 6e 74 6f | 6f 6c 69 73 70 61 63 65 | *moonto|olispace|
|000034d0| 3b 0a 20 20 20 20 76 6f | 69 64 20 20 20 20 20 20 |;. vo|id |
|000034e0| 20 20 20 2a 6d 6f 6f 6e | 69 63 6f 6e 69 73 70 61 | *moon|iconispa|
|000034f0| 63 65 3b 0a 20 20 20 20 | 77 69 6e 64 6f 77 73 74 |ce;. |windowst|
|00003500| 61 74 65 20 20 20 77 73 | 74 61 74 65 3b 0a 20 20 |ate ws|tate;. |
|00003510| 20 20 74 65 6d 70 6c 61 | 74 65 66 6f 6e 74 73 20 | templa|tefonts |
|00003520| 66 6f 6e 74 73 3b 0a 0a | 20 20 20 20 2f 2a 0a 20 |fonts;..| /*. |
|00003530| 20 20 20 2a 2a 20 20 20 | 20 20 20 49 6e 69 74 69 | ** | Initi|
|00003540| 61 6c 69 73 65 20 6d 79 | 20 49 2f 4f 20 76 61 72 |alise my| I/O var|
|00003550| 69 61 62 6c 65 73 20 2e | 2e 2e 0a 20 20 20 20 2a |iables .|... *|
|00003560| 2f 0a 20 20 20 20 57 69 | 6d 70 5f 49 6e 69 74 69 |/. Wi|mp_Initi|
|00003570| 61 6c 69 73 65 32 30 30 | 28 22 4d 6f 6f 6e 20 54 |alise200|("Moon T|
|00003580| 6f 6f 6c 22 2c 20 26 4f | 75 72 54 61 73 6b 48 61 |ool", &O|urTaskHa|
|00003590| 6e 64 6c 65 29 3b 0a 0a | 20 20 20 20 57 69 6d 70 |ndle);..| Wimp|
|000035a0| 5f 4f 70 65 6e 54 65 6d | 70 6c 61 74 65 28 22 4d |_OpenTem|plate("M|
|000035b0| 6f 6f 6e 54 6f 6f 6c 3a | 54 65 6d 70 6c 61 74 65 |oonTool:|Template|
|000035c0| 73 22 29 3b 0a 0a 20 20 | 20 20 57 69 6d 70 5f 4e |s");.. | Wimp_N|
|000035d0| 61 6d 65 64 54 65 6d 70 | 6c 61 74 65 53 69 7a 65 |amedTemp|lateSize|
|000035e0| 28 22 4d 6f 6f 6e 54 6f | 6f 6c 22 2c 20 26 69 73 |("MoonTo|ol", &is|
|000035f0| 69 7a 65 2c 20 26 77 69 | 6e 64 6f 77 73 69 7a 65 |ize, &wi|ndowsize|
|00003600| 2c 20 26 66 6f 6e 74 73 | 70 72 65 73 65 6e 74 29 |, &fonts|present)|
|00003610| 3b 0a 20 20 20 20 66 6f | 72 28 69 3d 30 3b 20 69 |;. fo|r(i=0; i|
|00003620| 3c 32 35 36 3b 20 69 2b | 2b 29 0a 20 20 20 20 20 |<256; i+|+). |
|00003630| 20 20 20 66 6f 6e 74 73 | 2e 66 6f 6e 74 5b 69 5d | fonts|.font[i]|
|00003640| 20 3d 20 30 3b 0a 20 20 | 20 20 73 63 72 61 74 63 | = 0;. | scratc|
|00003650| 68 77 69 6e 64 6f 77 20 | 3d 20 28 77 69 6e 64 6f |hwindow |= (windo|
|00003660| 77 20 2a 29 20 6d 61 6c | 6c 6f 63 28 77 69 6e 64 |w *) mal|loc(wind|
|00003670| 6f 77 73 69 7a 65 2b 69 | 73 69 7a 65 29 3b 0a 20 |owsize+i|size);. |
|00003680| 20 20 20 6d 6f 6f 6e 74 | 6f 6f 6c 69 73 70 61 63 | moont|oolispac|
|00003690| 65 20 3d 20 28 76 6f 69 | 64 20 2a 29 20 20 20 6d |e = (voi|d *) m|
|000036a0| 61 6c 6c 6f 63 28 69 73 | 69 7a 65 29 3b 0a 20 20 |alloc(is|ize);. |
|000036b0| 20 20 57 69 6d 70 5f 4c | 6f 61 64 4e 61 6d 65 64 | Wimp_L|oadNamed|
|000036c0| 54 65 6d 70 6c 61 74 65 | 28 73 63 72 61 74 63 68 |Template|(scratch|
|000036d0| 77 69 6e 64 6f 77 2c 20 | 22 4d 6f 6f 6e 54 6f 6f |window, |"MoonToo|
|000036e0| 6c 22 2c 20 6d 6f 6f 6e | 74 6f 6f 6c 69 73 70 61 |l", moon|toolispa|
|000036f0| 63 65 2c 20 69 73 69 7a | 65 2c 20 26 66 6f 6e 74 |ce, isiz|e, &font|
|00003700| 73 29 3b 0a 20 20 20 20 | 57 69 6d 70 5f 43 72 65 |s);. |Wimp_Cre|
|00003710| 61 74 65 57 69 6e 64 6f | 77 28 73 63 72 61 74 63 |ateWindo|w(scratc|
|00003720| 68 77 69 6e 64 6f 77 2c | 20 26 4d 6f 6f 6e 54 6f |hwindow,| &MoonTo|
|00003730| 6f 6c 29 3b 0a 0a 20 20 | 20 20 57 69 6d 70 5f 4e |ol);.. | Wimp_N|
|00003740| 61 6d 65 64 54 65 6d 70 | 6c 61 74 65 53 69 7a 65 |amedTemp|lateSize|
|00003750| 28 22 4d 6f 6f 6e 49 63 | 6f 6e 22 2c 20 26 69 73 |("MoonIc|on", &is|
|00003760| 69 7a 65 2c 20 26 77 69 | 6e 64 6f 77 73 69 7a 65 |ize, &wi|ndowsize|
|00003770| 2c 20 26 66 6f 6e 74 73 | 70 72 65 73 65 6e 74 29 |, &fonts|present)|
|00003780| 3b 0a 20 20 20 20 73 63 | 72 61 74 63 68 77 69 6e |;. sc|ratchwin|
|00003790| 64 6f 77 20 3d 20 28 77 | 69 6e 64 6f 77 20 2a 29 |dow = (w|indow *)|
|000037a0| 20 72 65 61 6c 6c 6f 63 | 28 73 63 72 61 74 63 68 | realloc|(scratch|
|000037b0| 77 69 6e 64 6f 77 2c 20 | 77 69 6e 64 6f 77 73 69 |window, |windowsi|
|000037c0| 7a 65 2b 69 73 69 7a 65 | 29 3b 0a 20 20 20 20 6d |ze+isize|);. m|
|000037d0| 6f 6f 6e 69 63 6f 6e 69 | 73 70 61 63 65 20 3d 20 |ooniconi|space = |
|000037e0| 28 76 6f 69 64 20 2a 29 | 20 20 20 6d 61 6c 6c 6f |(void *)| mallo|
|000037f0| 63 28 69 73 69 7a 65 29 | 3b 0a 20 20 20 20 57 69 |c(isize)|;. Wi|
|00003800| 6d 70 5f 4c 6f 61 64 4e | 61 6d 65 64 54 65 6d 70 |mp_LoadN|amedTemp|
|00003810| 6c 61 74 65 28 73 63 72 | 61 74 63 68 77 69 6e 64 |late(scr|atchwind|
|00003820| 6f 77 2c 20 22 4d 6f 6f | 6e 49 63 6f 6e 22 2c 20 |ow, "Moo|nIcon", |
|00003830| 6d 6f 6f 6e 69 63 6f 6e | 69 73 70 61 63 65 2c 20 |moonicon|ispace, |
|00003840| 69 73 69 7a 65 2c 20 4e | 55 4c 4c 29 3b 0a 20 20 |isize, N|ULL);. |
|00003850| 20 20 57 69 6d 70 5f 43 | 72 65 61 74 65 57 69 6e | Wimp_C|reateWin|
|00003860| 64 6f 77 28 73 63 72 61 | 74 63 68 77 69 6e 64 6f |dow(scra|tchwindo|
|00003870| 77 2c 20 26 4d 6f 6f 6e | 49 63 6f 6e 29 3b 0a 0a |w, &Moon|Icon);..|
|00003880| 20 20 20 20 57 69 6d 70 | 5f 43 6c 6f 73 65 54 65 | Wimp|_CloseTe|
|00003890| 6d 70 6c 61 74 65 28 29 | 3b 0a 0a 20 20 20 20 69 |mplate()|;.. i|
|000038a0| 66 28 49 63 6f 6e 69 73 | 65 64 29 0a 20 20 20 20 |f(Iconis|ed). |
|000038b0| 20 20 20 20 77 73 74 61 | 74 65 2e 68 61 6e 64 6c | wsta|te.handl|
|000038c0| 65 20 3d 20 4d 6f 6f 6e | 49 63 6f 6e 3b 0a 20 20 |e = Moon|Icon;. |
|000038d0| 20 20 65 6c 73 65 0a 20 | 20 20 20 20 20 20 20 77 | else. | w|
|000038e0| 73 74 61 74 65 2e 68 61 | 6e 64 6c 65 20 3d 20 4d |state.ha|ndle = M|
|000038f0| 6f 6f 6e 54 6f 6f 6c 3b | 0a 0a 20 20 20 20 57 69 |oonTool;|.. Wi|
|00003900| 6d 70 5f 47 65 74 57 69 | 6e 64 6f 77 53 74 61 74 |mp_GetWi|ndowStat|
|00003910| 65 28 26 77 73 74 61 74 | 65 29 3b 0a 20 20 20 20 |e(&wstat|e);. |
|00003920| 57 69 6d 70 5f 4f 70 65 | 6e 57 69 6e 64 6f 77 28 |Wimp_Ope|nWindow(|
|00003930| 28 6f 70 65 6e 77 69 6e | 64 6f 77 69 6e 66 6f 20 |(openwin|dowinfo |
|00003940| 2a 29 20 26 77 73 74 61 | 74 65 29 3b 0a 0a 20 20 |*) &wsta|te);.. |
|00003950| 20 20 66 72 65 65 28 73 | 63 72 61 74 63 68 77 69 | free(s|cratchwi|
|00003960| 6e 64 6f 77 29 3b 0a 20 | 20 20 20 7d 0a 0a 0a 2f |ndow);. | }.../|
|00003970| 2a 0a 20 2a 20 20 44 69 | 73 70 61 74 63 68 20 50 |*. * Di|spatch P|
|00003980| 6f 6c 6c 0a 20 2a 2f 0a | 76 6f 69 64 20 44 69 73 |oll. */.|void Dis|
|00003990| 70 61 74 63 68 50 6f 6c | 6c 28 65 76 65 6e 74 69 |patchPol|l(eventi|
|000039a0| 6e 66 6f 20 2a 65 76 65 | 6e 74 29 0a 20 20 20 20 |nfo *eve|nt). |
|000039b0| 7b 0a 20 20 20 20 73 77 | 69 74 63 68 20 28 65 76 |{. sw|itch (ev|
|000039c0| 65 6e 74 2d 3e 74 79 70 | 65 29 0a 20 20 20 20 20 |ent->typ|e). |
|000039d0| 20 20 20 7b 0a 20 20 20 | 20 20 20 20 20 63 61 73 | {. | cas|
|000039e0| 65 20 4f 70 65 6e 5f 57 | 69 6e 64 6f 77 5f 52 65 |e Open_W|indow_Re|
|000039f0| 71 75 65 73 74 20 3a 0a | 20 20 20 20 20 20 20 20 |quest :.| |
|00003a00| 20 20 20 20 57 69 6d 70 | 5f 4f 70 65 6e 57 69 6e | Wimp|_OpenWin|
|00003a10| 64 6f 77 28 26 65 76 65 | 6e 74 2d 3e 64 61 74 61 |dow(&eve|nt->data|
|00003a20| 2e 77 69 6e 64 6f 77 29 | 3b 0a 20 20 20 20 20 20 |.window)|;. |
|00003a30| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0a 0a 20 20 | br|eak;.. |
|00003a40| 20 20 20 20 20 20 63 61 | 73 65 20 43 6c 6f 73 65 | ca|se Close|
|00003a50| 5f 57 69 6e 64 6f 77 5f | 52 65 71 75 65 73 74 20 |_Window_|Request |
|00003a60| 3a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 57 69 |:. | Wi|
|00003a70| 6d 70 5f 43 6c 6f 73 65 | 44 6f 77 6e 28 29 3b 0a |mp_Close|Down();.|
|00003a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 65 78 69 74 | | exit|
|00003a90| 28 30 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |(0);. | |
|00003aa0| 20 62 72 65 61 6b 3b 0a | 0a 20 20 20 20 20 20 20 | break;.|. |
|00003ab0| 20 63 61 73 65 20 4d 6f | 75 73 65 5f 42 75 74 74 | case Mo|use_Butt|
|00003ac0| 6f 6e 5f 43 68 61 6e 67 | 65 3a 0a 20 20 20 20 20 |on_Chang|e:. |
|00003ad0| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|00003ae0| 20 20 20 20 20 77 69 6e | 64 6f 77 73 74 61 74 65 | win|dowstate|
|00003af0| 20 73 74 61 74 65 3b 0a | 0a 20 20 20 20 20 20 20 | state;.|. |
|00003b00| 20 20 20 20 20 69 66 28 | 65 76 65 6e 74 2d 3e 64 | if(|event->d|
|00003b10| 61 74 61 2e 62 75 74 74 | 6f 6e 63 68 61 6e 67 65 |ata.butt|onchange|
|00003b20| 2e 70 6f 69 6e 74 65 72 | 69 6e 66 6f 2e 62 75 74 |.pointer|info.but|
|00003b30| 74 6f 6e 73 2e 66 65 69 | 6c 64 2e 6d 65 6e 75 29 |tons.fei|ld.menu)|
|00003b40| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003b50| 20 2f 2a 4d 61 6b 65 4d | 65 6e 75 28 65 76 65 6e | /*MakeM|enu(even|
|00003b60| 74 29 2a 2f 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |t)*/;. | |
|00003b70| 20 20 65 6c 73 65 20 0a | 20 20 20 20 20 20 20 20 | else .| |
|00003b80| 20 20 20 20 20 20 20 20 | 7b 0a 20 20 20 20 20 20 | |{. |
|00003b90| 20 20 20 20 20 20 20 20 | 20 20 65 76 65 6e 74 69 | | eventi|
|00003ba0| 6e 66 6f 20 64 75 6d 6d | 79 65 76 65 6e 74 3b 0a |nfo dumm|yevent;.|
|00003bb0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003bc0| 20 69 66 28 65 76 65 6e | 74 2d 3e 64 61 74 61 2e | if(even|t->data.|
|00003bd0| 62 75 74 74 6f 6e 63 68 | 61 6e 67 65 2e 70 6f 69 |buttonch|ange.poi|
|00003be0| 6e 74 65 72 69 6e 66 6f | 2e 77 69 6e 64 6f 77 20 |nterinfo|.window |
|00003bf0| 3d 3d 20 4d 6f 6f 6e 54 | 6f 6f 6c 20 26 26 0a 20 |== MoonT|ool &&. |
|00003c00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c10| 20 20 65 76 65 6e 74 2d | 3e 64 61 74 61 2e 62 75 | event-|>data.bu|
|00003c20| 74 74 6f 6e 63 68 61 6e | 67 65 2e 70 6f 69 6e 74 |ttonchan|ge.point|
|00003c30| 65 72 69 6e 66 6f 2e 69 | 63 6f 6e 20 3d 3d 20 34 |erinfo.i|con == 4|
|00003c40| 32 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |2). | |
|00003c50| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|00003c60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 57 69 6d | | Wim|
|00003c70| 70 5f 43 6c 6f 73 65 57 | 69 6e 64 6f 77 28 4d 6f |p_CloseW|indow(Mo|
|00003c80| 6f 6e 54 6f 6f 6c 29 3b | 0a 20 20 20 20 20 20 20 |onTool);|. |
|00003c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 0a 20 20 | | . |
|00003ca0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003cb0| 20 20 57 69 6d 70 5f 50 | 6f 6c 6c 49 64 6c 65 53 | Wimp_P|ollIdleS|
|00003cc0| 65 63 6f 6e 64 73 28 26 | 64 75 6d 6d 79 65 76 65 |econds(&|dummyeve|
|00003cd0| 6e 74 2c 20 30 2c 20 30 | 29 3b 0a 20 20 20 20 20 |nt, 0, 0|);. |
|00003ce0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 44 | | D|
|00003cf0| 69 73 70 61 74 63 68 50 | 6f 6c 6c 28 26 64 75 6d |ispatchP|oll(&dum|
|00003d00| 6d 79 65 76 65 6e 74 29 | 3b 0a 0a 20 20 20 20 20 |myevent)|;.. |
|00003d10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | | s|
|00003d20| 74 61 74 65 2e 68 61 6e | 64 6c 65 20 3d 20 4d 6f |tate.han|dle = Mo|
|00003d30| 6f 6e 49 63 6f 6e 3b 0a | 20 20 20 20 20 20 20 20 |onIcon;.| |
|00003d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 57 69 6d 70 | | Wimp|
|00003d50| 5f 47 65 74 57 69 6e 64 | 6f 77 53 74 61 74 65 28 |_GetWind|owState(|
|00003d60| 26 73 74 61 74 65 29 3b | 0a 20 20 20 20 20 20 20 |&state);|. |
|00003d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 73 74 61 | | sta|
|00003d80| 74 65 2e 62 65 68 69 6e | 64 20 3d 20 4f 50 45 4e |te.behin|d = OPEN|
|00003d90| 5f 4f 4e 5f 54 4f 50 3b | 0a 20 20 20 20 20 20 20 |_ON_TOP;|. |
|00003da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 57 69 6d | | Wim|
|00003db0| 70 5f 4f 70 65 6e 57 69 | 6e 64 6f 77 28 28 6f 70 |p_OpenWi|ndow((op|
|00003dc0| 65 6e 77 69 6e 64 6f 77 | 69 6e 66 6f 20 2a 29 20 |enwindow|info *) |
|00003dd0| 26 73 74 61 74 65 29 3b | 0a 0a 20 20 20 20 20 20 |&state);|.. |
|00003de0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 49 63 | | Ic|
|00003df0| 6f 6e 69 73 65 64 20 3d | 20 54 52 55 45 3b 0a 20 |onised =| TRUE;. |
|00003e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e10| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00003e20| 20 20 20 20 20 69 66 28 | 65 76 65 6e 74 2d 3e 64 | if(|event->d|
|00003e30| 61 74 61 2e 62 75 74 74 | 6f 6e 63 68 61 6e 67 65 |ata.butt|onchange|
|00003e40| 2e 70 6f 69 6e 74 65 72 | 69 6e 66 6f 2e 77 69 6e |.pointer|info.win|
|00003e50| 64 6f 77 20 3d 3d 20 4d | 6f 6f 6e 49 63 6f 6e 29 |dow == M|oonIcon)|
|00003e60| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003e70| 20 20 20 20 20 7b 0a 20 | 20 20 20 20 20 20 20 20 | {. | |
|00003e80| 20 20 20 20 20 20 20 20 | 20 20 20 57 69 6d 70 5f | | Wimp_|
|00003e90| 43 6c 6f 73 65 57 69 6e | 64 6f 77 28 4d 6f 6f 6e |CloseWin|dow(Moon|
|00003ea0| 49 63 6f 6e 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |Icon);. | |
|00003eb0| 20 20 20 20 20 20 20 20 | 20 20 20 0a 20 20 20 20 | | . |
|00003ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ed0| 57 69 6d 70 5f 50 6f 6c | 6c 49 64 6c 65 53 65 63 |Wimp_Pol|lIdleSec|
|00003ee0| 6f 6e 64 73 28 26 64 75 | 6d 6d 79 65 76 65 6e 74 |onds(&du|mmyevent|
|00003ef0| 2c 20 30 2c 20 30 29 3b | 0a 20 20 20 20 20 20 20 |, 0, 0);|. |
|00003f00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 44 69 73 | | Dis|
|00003f10| 70 61 74 63 68 50 6f 6c | 6c 28 26 64 75 6d 6d 79 |patchPol|l(&dummy|
|00003f20| 65 76 65 6e 74 29 3b 0a | 0a 20 20 20 20 20 20 20 |event);.|. |
|00003f30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 49 63 6f | | Ico|
|00003f40| 6e 69 73 65 64 20 3d 20 | 46 41 4c 53 45 3b 20 20 |nised = |FALSE; |
|00003f50| 2f 2a 20 48 61 76 65 20 | 74 6f 20 73 65 74 20 74 |/* Have |to set t|
|00003f60| 68 69 73 20 62 65 66 6f | 72 65 20 77 65 20 63 61 |his befo|re we ca|
|00003f70| 6c 6c 20 72 69 6e 67 67 | 67 28 29 3b 20 2a 2f 0a |ll ringg|g(); */.|
|00003f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003f90| 20 20 20 20 72 69 6e 67 | 67 67 28 29 3b 0a 0a 20 | ring|gg();.. |
|00003fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003fb0| 20 20 20 73 74 61 74 65 | 2e 68 61 6e 64 6c 65 20 | state|.handle |
|00003fc0| 3d 20 4d 6f 6f 6e 54 6f | 6f 6c 3b 0a 20 20 20 20 |= MoonTo|ol;. |
|00003fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003fe0| 57 69 6d 70 5f 47 65 74 | 57 69 6e 64 6f 77 53 74 |Wimp_Get|WindowSt|
|00003ff0| 61 74 65 28 26 73 74 61 | 74 65 29 3b 0a 20 20 20 |ate(&sta|te);. |
|00004000| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004010| 20 73 74 61 74 65 2e 62 | 65 68 69 6e 64 20 3d 20 | state.b|ehind = |
|00004020| 4f 50 45 4e 5f 4f 4e 5f | 54 4f 50 3b 0a 20 20 20 |OPEN_ON_|TOP;. |
|00004030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004040| 20 57 69 6d 70 5f 4f 70 | 65 6e 57 69 6e 64 6f 77 | Wimp_Op|enWindow|
|00004050| 28 28 6f 70 65 6e 77 69 | 6e 64 6f 77 69 6e 66 6f |((openwi|ndowinfo|
|00004060| 20 2a 29 20 26 73 74 61 | 74 65 29 3b 0a 20 20 20 | *) &sta|te);. |
|00004070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004080| 20 7d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00004090| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|000040a0| 20 7d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | }. | b|
|000040b0| 72 65 61 6b 3b 0a 0a 20 | 20 20 20 20 20 20 20 63 |reak;.. | c|
|000040c0| 61 73 65 20 4d 65 6e 75 | 5f 53 65 6c 65 63 74 3a |ase Menu|_Select:|
|000040d0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 7b 0a 20 |. | {. |
|000040e0| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 28 65 76 | | if(ev|
|000040f0| 65 6e 74 2d 3e 64 61 74 | 61 2e 6d 65 6e 75 5b 30 |ent->dat|a.menu[0|
|00004100| 5d 20 3d 3d 20 31 29 20 | 65 78 69 74 28 30 29 3b |] == 1) |exit(0);|
|00004110| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 20 |. | }. |
|00004120| 20 20 20 20 20 20 20 20 | 20 20 20 62 72 65 61 6b | | break|
|00004130| 3b 0a 0a 20 20 20 20 20 | 20 20 20 63 61 73 65 20 |;.. | case |
|00004140| 4b 65 79 5f 50 72 65 73 | 73 65 64 3a 0a 20 20 20 |Key_Pres|sed:. |
|00004150| 20 20 20 20 20 20 20 20 | 20 57 69 6d 70 5f 50 72 | | Wimp_Pr|
|00004160| 6f 63 65 73 73 4b 65 79 | 28 65 76 65 6e 74 2d 3e |ocessKey|(event->|
|00004170| 64 61 74 61 2e 6b 65 79 | 2e 63 6f 64 65 29 3b 0a |data.key|.code);.|
|00004180| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 72 65 61 | | brea|
|00004190| 6b 3b 0a 0a 20 20 20 20 | 20 20 20 20 63 61 73 65 |k;.. | case|
|000041a0| 20 53 65 6e 64 5f 4d 65 | 73 73 61 67 65 3a 0a 20 | Send_Me|ssage:. |
|000041b0| 20 20 20 20 20 20 20 63 | 61 73 65 20 53 65 6e 64 | c|ase Send|
|000041c0| 5f 4d 65 73 73 61 67 65 | 5f 41 63 6b 6e 6f 77 6c |_Message|_Acknowl|
|000041d0| 65 64 67 65 64 3a 0a 20 | 20 20 20 20 20 20 20 20 |edged:. | |
|000041e0| 20 20 20 73 77 69 74 63 | 68 28 65 76 65 6e 74 2d | switc|h(event-|
|000041f0| 3e 64 61 74 61 2e 6d 65 | 73 73 61 67 65 2e 68 65 |>data.me|ssage.he|
|00004200| 61 64 65 72 2e 74 79 70 | 65 29 0a 20 20 20 20 20 |ader.typ|e). |
|00004210| 20 20 20 20 20 20 20 20 | 20 20 20 7b 0a 20 20 20 | | {. |
|00004220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 63 61 73 | | cas|
|00004230| 65 20 4d 65 73 73 61 67 | 65 5f 43 6c 6f 73 65 44 |e Messag|e_CloseD|
|00004240| 6f 77 6e 3a 0a 20 20 20 | 20 20 20 20 20 20 20 20 |own:. | |
|00004250| 20 20 20 20 20 20 20 20 | 20 57 69 6d 70 5f 43 6c | | Wimp_Cl|
|00004260| 6f 73 65 44 6f 77 6e 28 | 29 3b 0a 20 20 20 20 20 |oseDown(|);. |
|00004270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 65 | | e|
|00004280| 78 69 74 28 31 29 3b 0a | 20 20 20 20 20 20 20 20 |xit(1);.| |
|00004290| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 72 65 61 | | brea|
|000042a0| 6b 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |k;. | |
|000042b0| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|000042c0| 20 62 72 65 61 6b 3b 0a | 20 20 20 20 20 20 20 20 | break;.| |
|000042d0| 7d 0a 20 20 20 20 7d 0a | 0a 0a 0a 2f 2a 20 20 4d |}. }.|.../* M|
|000042e0| 61 69 6e 20 70 72 6f 67 | 72 61 6d 20 20 2a 2f 0a |ain prog|ram */.|
|000042f0| 0a 69 6e 74 20 6d 61 69 | 6e 28 69 6e 74 20 61 72 |.int mai|n(int ar|
|00004300| 67 63 2c 20 63 68 61 72 | 20 2a 61 72 67 76 5b 5d |gc, char| *argv[]|
|00004310| 29 0a 20 20 20 20 7b 0a | 20 20 20 20 69 6e 74 20 |). {.| int |
|00004320| 69 3b 0a 20 20 20 20 69 | 6e 74 20 64 65 6c 61 79 |i;. i|nt delay|
|00004330| 3b 0a 20 20 20 20 65 76 | 65 6e 74 6d 61 73 6b 20 |;. ev|entmask |
|00004340| 6d 61 73 6b 20 3d 20 30 | 3b 0a 20 20 20 20 65 76 |mask = 0|;. ev|
|00004350| 65 6e 74 69 6e 66 6f 20 | 65 76 65 6e 74 3b 0a 0a |entinfo |event;..|
|00004360| 20 20 20 20 66 6f 72 20 | 28 69 20 3d 20 31 3b 20 | for |(i = 1; |
|00004370| 69 20 3c 20 61 72 67 63 | 3b 20 69 2b 2b 29 0a 20 |i < argc|; i++). |
|00004380| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|00004390| 20 69 66 20 28 2a 61 72 | 67 76 5b 69 5d 20 3d 3d | if (*ar|gv[i] ==|
|000043a0| 20 27 2d 27 20 26 26 20 | 61 72 67 76 5b 69 5d 5b | '-' && |argv[i][|
|000043b0| 31 5d 20 3d 3d 20 27 74 | 27 29 0a 20 20 20 20 20 |1] == 't|'). |
|000043c0| 20 20 20 20 20 20 20 74 | 65 73 74 6d 6f 64 65 20 | t|estmode |
|000043d0| 3d 20 54 52 55 45 3b 0a | 20 20 20 20 20 20 20 20 |= TRUE;.| |
|000043e0| 7d 0a 0a 20 20 20 20 53 | 74 61 72 74 57 69 6d 70 |}.. S|tartWimp|
|000043f0| 28 29 3b 0a 20 20 20 20 | 72 69 6e 67 67 67 28 29 |();. |ringgg()|
|00004400| 3b 0a 0a 20 20 20 20 77 | 68 69 6c 65 28 54 52 55 |;.. w|hile(TRU|
|00004410| 45 29 0a 20 20 20 20 20 | 20 20 20 7b 0a 20 20 20 |E). | {. |
|00004420| 20 20 20 20 20 69 66 28 | 49 63 6f 6e 69 73 65 64 | if(|Iconised|
|00004430| 20 26 26 20 21 74 65 73 | 74 6d 6f 64 65 29 0a 20 | && !tes|tmode). |
|00004440| 20 20 20 20 20 20 20 20 | 20 20 20 64 65 6c 61 79 | | delay|
|00004450| 20 3d 20 36 30 30 30 3b | 0a 20 20 20 20 20 20 20 | = 6000;|. |
|00004460| 20 65 6c 73 65 0a 20 20 | 20 20 20 20 20 20 20 20 | else. | |
|00004470| 20 20 64 65 6c 61 79 20 | 3d 20 39 30 3b 0a 20 20 | delay |= 90;. |
|00004480| 20 20 20 20 20 20 57 69 | 6d 70 5f 50 6f 6c 6c 49 | Wi|mp_PollI|
|00004490| 64 6c 65 53 65 63 6f 6e | 64 73 28 26 65 76 65 6e |dleSecon|ds(&even|
|000044a0| 74 2c 20 6d 61 73 6b 2c | 20 64 65 6c 61 79 29 3b |t, mask,| delay);|
|000044b0| 0a 0a 20 20 20 20 20 20 | 20 20 69 66 28 65 76 65 |.. | if(eve|
|000044c0| 6e 74 2e 74 79 70 65 20 | 3d 3d 20 4e 75 6c 6c 5f |nt.type |== Null_|
|000044d0| 52 65 61 73 6f 6e 5f 43 | 6f 64 65 29 0a 20 20 20 |Reason_C|ode). |
|000044e0| 20 20 20 20 20 20 20 20 | 20 72 69 6e 67 67 67 28 | | ringgg(|
|000044f0| 29 3b 0a 20 20 20 20 20 | 20 20 20 65 6c 73 65 0a |);. | else.|
|00004500| 20 20 20 20 20 20 20 20 | 20 20 20 20 44 69 73 70 | | Disp|
|00004510| 61 74 63 68 50 6f 6c 6c | 28 26 65 76 65 6e 74 29 |atchPoll|(&event)|
|00004520| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00004530| 7d 0a 0a 0a 2f 2a 0a 20 | 2a 20 20 44 52 41 57 4d |}.../*. |* DRAWM|
|00004540| 4f 4f 4e 20 20 2d 2d 20 | 20 43 6f 6e 73 74 72 75 |OON -- | Constru|
|00004550| 63 74 20 69 63 6f 6e 20 | 66 6f 72 20 6d 6f 6f 6e |ct icon |for moon|
|00004560| 2c 20 67 69 76 65 6e 20 | 70 68 61 73 65 20 6f 66 |, given |phase of|
|00004570| 20 6d 6f 6f 6e 2e 0a 20 | 2a 2f 0a 0a 69 6e 74 20 | moon.. |*/..int |
|00004580| 49 63 6f 6e 53 70 61 6e | 6c 69 73 74 5b 33 36 5d |IconSpan|list[36]|
|00004590| 5b 32 5d 3b 0a 23 64 65 | 66 69 6e 65 20 4c 65 66 |[2];.#de|fine Lef|
|000045a0| 74 20 20 30 0a 23 64 65 | 66 69 6e 65 20 52 69 67 |t 0.#de|fine Rig|
|000045b0| 68 74 20 31 0a 23 64 65 | 66 69 6e 65 20 58 4d 69 |ht 1.#de|fine XMi|
|000045c0| 64 20 33 35 0a 20 20 20 | 20 20 20 20 20 20 20 20 |d 35. | |
|000045d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000045e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000045f0| 20 20 0a 76 6f 69 64 20 | 64 72 61 77 6d 6f 6f 6e | .void |drawmoon|
|00004600| 28 64 6f 75 62 6c 65 20 | 70 68 29 0a 20 20 20 20 |(double |ph). |
|00004610| 7b 0a 20 20 20 20 69 6e | 74 20 20 20 20 20 20 20 |{. in|t |
|00004620| 20 20 20 20 69 2c 20 6a | 2c 20 6c 78 2c 20 72 78 | i, j|, lx, rx|
|00004630| 3b 0a 20 20 20 20 64 6f | 75 62 6c 65 20 20 20 20 |;. do|uble |
|00004640| 20 20 20 20 63 70 2c 20 | 78 73 63 61 6c 65 2c 20 | cp, |xscale, |
|00004650| 64 3b 0a 20 20 20 20 42 | 4f 4f 4c 20 20 20 20 20 |d;. B|OOL |
|00004660| 20 20 20 20 20 49 63 6f | 6e 43 68 61 6e 67 65 64 | Ico|nChanged|
|00004670| 20 3d 20 46 41 4c 53 45 | 3b 0a 20 20 20 20 73 70 | = FALSE|;. sp|
|00004680| 72 69 74 65 63 6f 6e 74 | 65 78 74 20 53 61 76 65 |ritecont|ext Save|
|00004690| 64 43 6f 6e 74 65 78 74 | 3b 0a 0a 20 20 20 20 78 |dContext|;.. x|
|000046a0| 73 63 61 6c 65 20 3d 20 | 63 6f 73 28 32 20 2a 20 |scale = |cos(2 * |
|000046b0| 50 49 20 2a 20 70 68 29 | 3b 0a 0a 20 20 20 20 66 |PI * ph)|;.. f|
|000046c0| 6f 72 20 28 69 20 3d 20 | 30 3b 20 69 20 3c 20 32 |or (i = |0; i < 2|
|000046d0| 39 3b 20 69 2b 2b 29 0a | 20 20 20 20 20 20 20 20 |9; i++).| |
|000046e0| 7b 0a 20 20 20 20 20 20 | 20 20 64 20 3d 20 28 69 |{. | d = (i|
|000046f0| 2a 32 2e 30 2b 31 2e 30 | 29 20 2f 20 32 39 2e 30 |*2.0+1.0|) / 29.0|
|00004700| 3b 0a 20 20 20 20 20 20 | 20 20 69 66 28 64 20 3c |;. | if(d <|
|00004710| 3d 20 31 2e 30 29 0a 20 | 20 20 20 20 20 20 20 20 |= 1.0). | |
|00004720| 20 20 20 64 20 3d 20 31 | 2e 30 20 2d 20 64 3b 0a | d = 1|.0 - d;.|
|00004730| 20 20 20 20 20 20 20 20 | 65 6c 73 65 0a 20 20 20 | |else. |
|00004740| 20 20 20 20 20 20 20 20 | 20 64 20 3d 20 64 20 2d | | d = d -|
|00004750| 20 31 2e 30 3b 20 20 20 | 20 0a 20 20 20 20 20 20 | 1.0; | . |
|00004760| 20 20 63 70 20 3d 20 33 | 31 2e 30 20 2a 20 63 6f | cp = 3|1.0 * co|
|00004770| 73 28 61 73 69 6e 28 64 | 29 29 3b 0a 0a 20 20 20 |s(asin(d|));.. |
|00004780| 20 20 20 20 20 69 66 20 | 28 70 68 20 3c 20 30 2e | if |(ph < 0.|
|00004790| 35 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 7b |5). | {|
|000047a0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 72 78 20 |. | rx |
|000047b0| 3d 20 31 30 30 30 3b 0a | 20 20 20 20 20 20 20 20 |= 1000;.| |
|000047c0| 20 20 20 20 6c 78 20 3d | 20 58 4d 69 64 20 2d 20 | lx =| XMid - |
|000047d0| 78 73 63 61 6c 65 20 2a | 20 63 70 3b 0a 20 20 20 |xscale *| cp;. |
|000047e0| 20 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 | | }. |
|000047f0| 20 20 20 65 6c 73 65 0a | 20 20 20 20 20 20 20 20 | else.| |
|00004800| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00004810| 20 20 6c 78 20 3d 20 30 | 3b 0a 20 20 20 20 20 20 | lx = 0|;. |
|00004820| 20 20 20 20 20 20 72 78 | 20 3d 20 58 4d 69 64 20 | rx| = XMid |
|00004830| 2b 20 78 73 63 61 6c 65 | 20 2a 20 63 70 3b 0a 20 |+ xscale| * cp;. |
|00004840| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0a 0a 20 20 | | }.. |
|00004850| 20 20 20 20 20 20 69 66 | 28 28 49 63 6f 6e 53 70 | if|((IconSp|
|00004860| 61 6e 6c 69 73 74 5b 69 | 5d 5b 4c 65 66 74 5d 20 |anlist[i|][Left] |
|00004870| 21 3d 20 6c 78 29 20 7c | 7c 20 28 49 63 6f 6e 53 |!= lx) ||| (IconS|
|00004880| 70 61 6e 6c 69 73 74 5b | 69 5d 5b 52 69 67 68 74 |panlist[|i][Right|
|00004890| 5d 20 21 3d 20 72 78 29 | 29 0a 20 20 20 20 20 20 |] != rx)|). |
|000048a0| 20 20 20 20 20 20 7b 0a | 20 20 20 20 20 20 20 20 | {.| |
|000048b0| 20 20 20 20 49 63 6f 6e | 53 70 61 6e 6c 69 73 74 | Icon|Spanlist|
|000048c0| 5b 69 5d 5b 4c 65 66 74 | 5d 20 3d 20 6c 78 3b 0a |[i][Left|] = lx;.|
|000048d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 63 6f 6e | | Icon|
|000048e0| 53 70 61 6e 6c 69 73 74 | 5b 69 5d 5b 52 69 67 68 |Spanlist|[i][Righ|
|000048f0| 74 5d 20 3d 20 72 78 3b | 0a 20 20 20 20 20 20 20 |t] = rx;|. |
|00004900| 20 20 20 20 20 49 63 6f | 6e 43 68 61 6e 67 65 64 | Ico|nChanged|
|00004910| 20 3d 20 54 52 55 45 3b | 0a 20 20 20 20 20 20 20 | = TRUE;|. |
|00004920| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 7d | }. | }|
|00004930| 0a 20 20 20 20 2f 2a 20 | 20 0a 20 20 20 20 20 2a |. /* | . *|
|00004940| 20 20 4f 6e 6c 79 20 75 | 70 64 61 74 65 20 69 63 | Only u|pdate ic|
|00004950| 6f 6e 20 69 66 20 69 74 | 20 63 68 61 6e 67 65 64 |on if it| changed|
|00004960| 20 28 74 68 69 73 20 65 | 6c 69 6d 69 6e 61 74 65 | (this e|liminate|
|00004970| 73 20 67 72 61 74 75 69 | 74 6f 75 73 0a 20 20 20 |s gratui|tous. |
|00004980| 20 20 2a 20 20 66 6c 61 | 73 68 69 6e 67 20 6f 66 | * fla|shing of|
|00004990| 20 74 68 65 20 69 63 6f | 6e 20 6f 6e 2d 73 63 72 | the ico|n on-scr|
|000049a0| 65 65 6e 29 2e 0a 20 20 | 20 20 20 2a 2f 0a 20 20 |een).. | */. |
|000049b0| 20 20 69 66 28 49 63 6f | 6e 43 68 61 6e 67 65 64 | if(Ico|nChanged|
|000049c0| 29 0a 20 20 20 20 20 20 | 20 20 7b 0a 20 20 20 20 |). | {. |
|000049d0| 20 20 20 20 47 46 58 5f | 43 68 61 6e 67 65 43 6f | GFX_|ChangeCo|
|000049e0| 6e 74 65 78 74 54 6f 53 | 70 72 69 74 65 4d 61 73 |ntextToS|priteMas|
|000049f0| 6b 28 31 2c 20 22 74 68 | 65 5f 6d 6f 6f 6e 22 2c |k(1, "th|e_moon",|
|00004a00| 20 26 53 61 76 65 64 43 | 6f 6e 74 65 78 74 29 3b | &SavedC|ontext);|
|00004a10| 0a 20 20 20 20 20 20 20 | 20 47 46 58 5f 47 43 4f |. | GFX_GCO|
|00004a20| 4c 28 31 35 29 3b 20 20 | 20 20 20 20 20 20 20 20 |L(15); | |
|00004a30| 20 20 20 20 20 20 20 20 | 2f 2a 20 4e 6f 20 4d 61 | |/* No Ma|
|00004a40| 73 6b 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 47 46 |sk */. | GF|
|00004a50| 58 5f 52 65 63 74 61 6e | 67 6c 65 28 30 2c 30 2c |X_Rectan|gle(0,0,|
|00004a60| 31 30 30 30 2c 31 30 30 | 30 29 3b 20 20 2f 2a 20 |1000,100|0); /* |
|00004a70| 43 6c 65 61 72 20 77 68 | 6f 6c 65 20 73 70 72 69 |Clear wh|ole spri|
|00004a80| 74 65 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 47 46 |te */. | GF|
|00004a90| 58 5f 47 43 4f 4c 28 30 | 29 3b 20 20 20 20 20 20 |X_GCOL(0|); |
|00004aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00004ab0| 4d 61 73 6b 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |Mask */.| |
|00004ac0| 66 6f 72 28 69 3d 30 3b | 20 69 3c 32 39 3b 20 69 |for(i=0;| i<29; i|
|00004ad0| 2b 2b 29 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |++). | |
|00004ae0| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 47 46 |{. | GF|
|00004af0| 58 5f 4c 69 6e 65 28 49 | 63 6f 6e 53 70 61 6e 6c |X_Line(I|conSpanl|
|00004b00| 69 73 74 5b 69 5d 5b 4c | 65 66 74 5d 2a 32 2c 20 |ist[i][L|eft]*2, |
|00004b10| 69 2a 34 20 2b 20 38 2c | 20 49 63 6f 6e 53 70 61 |i*4 + 8,| IconSpa|
|00004b20| 6e 6c 69 73 74 5b 69 5d | 5b 52 69 67 68 74 5d 2a |nlist[i]|[Right]*|
|00004b30| 32 2c 20 69 2a 34 20 2b | 20 38 29 3b 0a 20 20 20 |2, i*4 +| 8);. |
|00004b40| 20 20 20 20 20 20 20 20 | 20 7d 0a 20 20 20 20 20 | | }. |
|00004b50| 20 20 20 47 46 58 5f 52 | 65 73 74 6f 72 65 43 6f | GFX_R|estoreCo|
|00004b60| 6e 74 65 78 74 28 26 53 | 61 76 65 64 43 6f 6e 74 |ntext(&S|avedCont|
|00004b70| 65 78 74 29 3b 0a 0a 20 | 20 20 20 20 20 20 20 57 |ext);.. | W|
|00004b80| 69 6d 70 5f 53 65 74 49 | 63 6f 6e 53 74 61 74 65 |imp_SetI|conState|
|00004b90| 28 4d 6f 6f 6e 54 6f 6f | 6c 2c 20 34 31 2c 20 30 |(MoonToo|l, 41, 0|
|00004ba0| 2c 20 30 29 3b 0a 20 20 | 20 20 20 20 20 20 57 69 |, 0);. | Wi|
|00004bb0| 6d 70 5f 53 65 74 49 63 | 6f 6e 53 74 61 74 65 28 |mp_SetIc|onState(|
|00004bc0| 4d 6f 6f 6e 49 63 6f 6e | 2c 20 30 2c 20 30 2c 20 |MoonIcon|, 0, 0, |
|00004bd0| 30 29 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 20 20 |0);. | }. |
|00004be0| 20 20 7d 0a 0a 2f 2a 20 | 20 52 49 4e 47 47 47 20 | }../* | RINGGG |
|00004bf0| 20 2d 2d 20 20 55 70 64 | 61 74 65 20 73 74 61 74 | -- Upd|ate stat|
|00004c00| 75 73 20 6f 6e 20 69 6e | 74 65 72 76 61 6c 20 74 |us on in|terval t|
|00004c10| 69 6d 65 72 20 74 69 63 | 6b 73 20 61 6e 64 20 72 |imer tic|ks and r|
|00004c20| 65 64 72 61 77 0a 20 20 | 20 20 20 20 20 20 20 20 |edraw. | |
|00004c30| 20 20 20 20 20 20 77 69 | 6e 64 6f 77 20 69 66 20 | wi|ndow if |
|00004c40| 6e 65 65 64 65 64 2e 20 | 20 2a 2f 0a 0a 76 6f 69 |needed. | */..voi|
|00004c50| 64 20 72 69 6e 67 67 67 | 28 76 6f 69 64 29 0a 20 |d ringgg|(void). |
|00004c60| 20 20 20 7b 0a 20 20 20 | 20 69 6e 74 20 6c 75 6e | {. | int lun|
|00004c70| 61 74 69 6f 6e 2c 20 77 | 63 6c 6f 73 65 64 3b 0a |ation, w|closed;.|
|00004c80| 20 20 20 20 74 69 6d 65 | 5f 74 20 74 3b 0a 20 20 | time|_t t;. |
|00004c90| 20 20 64 6f 75 62 6c 65 | 20 6a 64 2c 20 70 2c 20 | double| jd, p, |
|00004ca0| 61 6f 6d 2c 20 63 70 68 | 61 73 65 2c 20 63 64 69 |aom, cph|ase, cdi|
|00004cb0| 73 74 2c 20 63 61 6e 67 | 64 69 61 2c 20 63 73 75 |st, cang|dia, csu|
|00004cc0| 6e 64 2c 20 63 73 75 61 | 6e 67 2c 20 6c 70 74 69 |nd, csua|ng, lpti|
|00004cd0| 6d 65 3b 0a 20 20 20 20 | 73 74 61 74 69 63 20 64 |me;. |static d|
|00004ce0| 6f 75 62 6c 65 20 70 68 | 61 73 61 72 5b 35 5d 3b |ouble ph|asar[5];|
|00004cf0| 0a 20 20 20 20 73 74 61 | 74 69 63 20 64 6f 75 62 |. sta|tic doub|
|00004d00| 6c 65 20 6e 70 74 69 6d | 65 20 3d 20 30 2e 30 3b |le nptim|e = 0.0;|
|00004d10| 20 2f 2a 20 4e 65 78 74 | 20 6e 65 77 20 6d 6f 6f | /* Next| new moo|
|00004d20| 6e 20 74 69 6d 65 20 2a | 2f 0a 20 20 20 20 73 74 |n time *|/. st|
|00004d30| 61 74 69 63 20 69 6e 74 | 20 75 70 64 79 65 74 20 |atic int| updyet |
|00004d40| 3d 20 30 3b 20 20 20 20 | 20 20 2f 2a 20 55 70 64 |= 0; | /* Upd|
|00004d50| 61 74 65 20 69 6e 74 65 | 72 76 61 6c 20 77 68 65 |ate inte|rval whe|
|00004d60| 6e 20 77 69 6e 64 6f 77 | 20 63 6c 6f 73 65 64 20 |n window| closed |
|00004d70| 2a 2f 0a 20 20 20 20 73 | 74 61 74 69 63 20 69 6e |*/. s|tatic in|
|00004d80| 74 20 66 69 72 73 74 69 | 6d 65 20 3d 20 54 52 55 |t firsti|me = TRU|
|00004d90| 45 3b 20 2f 2a 20 43 61 | 6c 63 75 6c 61 74 65 20 |E; /* Ca|lculate |
|00004da0| 74 65 78 74 20 70 61 67 | 65 20 66 69 72 73 74 20 |text pag|e first |
|00004db0| 74 69 6d 65 20 2a 2f 0a | 20 20 20 20 63 68 61 72 |time */.| char|
|00004dc0| 20 61 6d 73 67 5b 31 32 | 5d 2c 20 74 62 75 66 5b | amsg[12|], tbuf[|
|00004dd0| 38 30 5d 3b 0a 20 20 20 | 20 73 74 61 74 69 63 20 |80];. | static |
|00004de0| 64 6f 75 62 6c 65 20 66 | 61 6b 65 74 69 6d 65 20 |double f|aketime |
|00004df0| 3d 20 30 2e 30 3b 0a 20 | 20 20 20 73 74 61 74 69 |= 0.0;. | stati|
|00004e00| 63 20 73 68 6f 72 74 20 | 6d 6f 6f 6e 69 6c 61 73 |c short |moonilas|
|00004e10| 74 5b 36 34 5d 5b 34 5d | 20 3d 20 7b 30 7d 3b 0a |t[64][4]| = {0};.|
|00004e20| 20 20 20 20 69 6e 74 20 | 79 79 2c 20 6d 6d 2c 20 | int |yy, mm, |
|00004e30| 64 64 2c 20 68 68 2c 20 | 6d 6d 6d 2c 20 73 73 3b |dd, hh, |mmm, ss;|
|00004e40| 0a 20 20 20 20 73 74 72 | 75 63 74 20 74 6d 20 2a |. str|uct tm *|
|00004e50| 67 6d 3b 0a 20 20 20 20 | 73 74 61 74 69 63 20 63 |gm;. |static c|
|00004e60| 68 61 72 20 2a 6d 6f 6e | 61 6d 65 5b 5d 20 3d 20 |har *mon|ame[] = |
|00004e70| 7b 22 4a 61 6e 75 61 72 | 79 22 2c 20 22 46 65 62 |{"Januar|y", "Feb|
|00004e80| 72 75 61 72 79 22 2c 20 | 22 4d 61 72 63 68 22 2c |ruary", |"March",|
|00004e90| 20 22 41 70 72 69 6c 22 | 2c 0a 20 20 20 20 20 20 | "April"|,. |
|00004ea0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004eb0| 20 20 20 20 20 20 20 22 | 4d 61 79 22 2c 20 22 4a | "|May", "J|
|00004ec0| 75 6e 65 22 2c 20 22 4a | 75 6c 79 22 2c 20 22 41 |une", "J|uly", "A|
|00004ed0| 75 67 75 73 74 22 2c 20 | 22 53 65 70 74 65 6d 62 |ugust", |"Septemb|
|00004ee0| 65 72 22 2c 0a 20 20 20 | 20 20 20 20 20 20 20 20 |er",. | |
|00004ef0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004f00| 20 20 22 4f 63 74 6f 62 | 65 72 22 2c 20 22 4e 6f | "Octob|er", "No|
|00004f10| 76 65 6d 62 65 72 22 2c | 20 22 44 65 63 65 6d 62 |vember",| "Decemb|
|00004f20| 65 72 22 7d 3b 0a 0a 20 | 20 20 20 20 20 20 20 28 |er"};.. | (|
|00004f30| 76 6f 69 64 29 20 74 69 | 6d 65 28 26 74 29 3b 0a |void) ti|me(&t);.|
|00004f40| 20 20 20 20 20 20 20 20 | 6a 64 20 3d 20 6a 74 69 | |jd = jti|
|00004f50| 6d 65 28 28 67 6d 20 3d | 20 67 6d 74 69 6d 65 28 |me((gm =| gmtime(|
|00004f60| 26 74 29 29 29 3b 0a 0a | 20 20 20 20 20 20 20 20 |&t)));..| |
|00004f70| 69 66 28 74 65 73 74 6d | 6f 64 65 29 0a 20 20 20 |if(testm|ode). |
|00004f80| 20 20 20 20 20 20 20 20 | 20 7b 0a 20 20 20 20 20 | | {. |
|00004f90| 20 20 20 20 20 20 20 69 | 66 20 28 66 61 6b 65 74 | i|f (faket|
|00004fa0| 69 6d 65 20 3d 3d 20 30 | 2e 30 29 0a 20 20 20 20 |ime == 0|.0). |
|00004fb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 61 6b 65 | | fake|
|00004fc0| 74 69 6d 65 20 3d 20 6a | 64 20 2b 20 31 3b 0a 20 |time = j|d + 1;. |
|00004fd0| 20 20 20 20 20 20 20 20 | 20 20 20 65 6c 73 65 0a | | else.|
|00004fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004ff0| 66 61 6b 65 74 69 6d 65 | 20 2b 3d 20 31 2e 30 20 |faketime| += 1.0 |
|00005000| 2f 20 32 34 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |/ 24;. | |
|00005010| 20 20 6a 64 20 3d 20 66 | 61 6b 65 74 69 6d 65 3b | jd = f|aketime;|
|00005020| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 0a |. | }..|
|00005030| 20 20 20 20 20 20 20 20 | 70 20 3d 20 70 68 61 73 | |p = phas|
|00005040| 65 28 6a 64 2c 20 26 63 | 70 68 61 73 65 2c 20 26 |e(jd, &c|phase, &|
|00005050| 61 6f 6d 2c 20 26 63 64 | 69 73 74 2c 20 26 63 61 |aom, &cd|ist, &ca|
|00005060| 6e 67 64 69 61 2c 20 26 | 63 73 75 6e 64 2c 20 26 |ngdia, &|csund, &|
|00005070| 63 73 75 61 6e 67 29 3b | 0a 20 20 20 20 20 20 20 |csuang);|. |
|00005080| 20 2f 2a 0a 20 20 20 20 | 20 20 20 20 20 2a 20 20 | /*. | * |
|00005090| 43 61 6c 63 75 6c 61 74 | 65 20 74 69 6d 65 73 20 |Calculat|e times |
|000050a0| 6f 66 20 70 68 61 73 65 | 73 20 6f 66 20 74 68 69 |of phase|s of thi|
|000050b0| 73 20 6c 75 6e 61 74 69 | 6f 6e 2e 0a 20 20 20 20 |s lunati|on.. |
|000050c0| 20 20 20 20 20 2a 20 20 | 54 68 69 73 20 69 73 20 | * |This is |
|000050d0| 73 75 66 66 69 63 69 65 | 6e 74 6c 79 20 74 69 6d |sufficie|ntly tim|
|000050e0| 65 2d 63 6f 6e 73 75 6d | 69 6e 67 20 74 68 61 74 |e-consum|ing that|
|000050f0| 0a 20 20 20 20 20 20 20 | 20 20 2a 20 20 77 65 20 |. | * we |
|00005100| 6f 6e 6c 79 20 64 6f 20 | 69 74 20 6f 6e 63 65 20 |only do |it once |
|00005110| 61 20 6d 6f 6e 74 68 2e | 0a 20 20 20 20 20 20 20 |a month.|. |
|00005120| 20 20 2a 2f 0a 20 20 20 | 20 20 20 20 20 69 66 28 | */. | if(|
|00005130| 6a 64 20 3e 20 6e 70 74 | 69 6d 65 29 0a 20 20 20 |jd > npt|ime). |
|00005140| 20 20 20 20 20 20 20 20 | 20 7b 0a 20 20 20 20 20 | | {. |
|00005150| 20 20 20 20 20 20 20 70 | 68 61 73 65 68 75 6e 74 | p|hasehunt|
|00005160| 28 6a 64 2c 20 70 68 61 | 73 61 72 29 3b 20 20 2f |(jd, pha|sar); /|
|00005170| 2a 20 58 2d 70 65 6e 73 | 69 76 65 20 63 61 6c 6c |* X-pens|ive call|
|00005180| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00005190| 7d 0a 0a 20 20 20 20 20 | 20 20 20 64 72 61 77 6d |}.. | drawm|
|000051a0| 6f 6f 6e 28 70 29 3b 0a | 0a 20 20 20 20 20 20 20 |oon(p);.|. |
|000051b0| 20 2f 2a 20 49 66 20 77 | 65 27 72 65 20 69 63 6f | /* If w|e're ico|
|000051c0| 6e 69 63 2c 20 74 68 65 | 72 65 27 73 20 6e 6f 74 |nic, the|re's not|
|000051d0| 68 69 6e 67 20 6d 6f 72 | 65 20 74 6f 20 64 6f 2e |hing mor|e to do.|
|000051e0| 20 2a 2f 0a 0a 20 20 20 | 20 20 20 20 20 69 66 20 | */.. | if |
|000051f0| 28 49 63 6f 6e 69 73 65 | 64 20 26 26 20 21 66 69 |(Iconise|d && !fi|
|00005200| 72 73 74 69 6d 65 29 0a | 20 20 20 20 20 20 20 20 |rstime).| |
|00005210| 20 20 20 20 72 65 74 75 | 72 6e 3b 0a 0a 20 20 20 | retu|rn;.. |
|00005220| 20 20 20 20 20 2f 2a 20 | 0a 20 20 20 20 20 20 20 | /* |. |
|00005230| 20 20 2a 20 20 55 70 64 | 61 74 65 20 74 65 78 74 | * Upd|ate text|
|00005240| 75 61 6c 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ual info|rmation |
|00005250| 66 6f 72 20 6f 70 65 6e | 20 77 69 6e 64 6f 77 0a |for open| window.|
|00005260| 20 20 20 20 20 20 20 20 | 20 2a 2f 0a 20 20 20 20 | | */. |
|00005270| 20 20 20 20 66 69 72 73 | 74 69 6d 65 20 3d 20 46 | firs|time = F|
|00005280| 41 4c 53 45 3b 0a 0a 20 | 20 20 20 20 20 20 20 49 |ALSE;.. | I|
|00005290| 63 6f 6e 5f 53 6d 61 72 | 74 50 72 69 6e 74 28 4a |con_Smar|tPrint(J|
|000052a0| 75 6c 69 61 6e 5f 44 61 | 74 65 2c 20 22 25 2e 35 |ulian_Da|te, "%.5|
|000052b0| 66 22 2c 20 6a 64 20 2b | 20 30 2e 35 29 3b 0a 0a |f", jd +| 0.5);..|
|000052c0| 20 20 20 20 20 20 20 20 | 69 66 28 74 65 73 74 6d | |if(testm|
|000052d0| 6f 64 65 29 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ode). | |
|000052e0| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 6a | {. | j|
|000052f0| 79 65 61 72 28 6a 64 2c | 20 26 79 79 2c 20 26 6d |year(jd,| &yy, &m|
|00005300| 6d 2c 20 26 64 64 29 3b | 0a 20 20 20 20 20 20 20 |m, &dd);|. |
|00005310| 20 20 20 20 20 6a 68 6d | 73 28 6a 64 2c 20 26 68 | jhm|s(jd, &h|
|00005320| 68 2c 20 26 6d 6d 6d 2c | 20 26 73 73 29 3b 0a 20 |h, &mmm,| &ss);. |
|00005330| 20 20 20 20 20 20 20 20 | 20 20 20 49 63 6f 6e 5f | | Icon_|
|00005340| 53 6d 61 72 74 50 72 69 | 6e 74 28 55 6e 69 76 65 |SmartPri|nt(Unive|
|00005350| 72 73 61 6c 5f 54 69 6d | 65 2c 20 22 25 30 32 64 |rsal_Tim|e, "%02d|
|00005360| 3a 25 30 32 64 3a 25 30 | 32 64 22 2c 20 68 68 2c |:%02d:%0|2d", hh,|
|00005370| 20 6d 6d 6d 2c 20 73 73 | 29 3b 0a 20 20 20 20 20 | mmm, ss|);. |
|00005380| 20 20 20 20 20 20 20 49 | 63 6f 6e 5f 53 6d 61 72 | I|con_Smar|
|00005390| 74 50 72 69 6e 74 28 55 | 6e 69 76 65 72 73 61 6c |tPrint(U|niversal|
|000053a0| 5f 44 61 74 65 2c 20 22 | 25 64 20 25 73 20 25 64 |_Date, "|%d %s %d|
|000053b0| 22 2c 20 64 64 2c 20 6d | 6f 6e 61 6d 65 5b 6d 6d |", dd, m|oname[mm|
|000053c0| 2d 31 5d 2c 20 79 79 29 | 3b 0a 20 20 20 20 20 20 |-1], yy)|;. |
|000053d0| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|000053e0| 65 6c 73 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |else. | |
|000053f0| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 49 | {. | I|
|00005400| 63 6f 6e 5f 53 6d 61 72 | 74 50 72 69 6e 74 28 55 |con_Smar|tPrint(U|
|00005410| 6e 69 76 65 72 73 61 6c | 5f 54 69 6d 65 2c 20 22 |niversal|_Time, "|
|00005420| 25 30 32 64 3a 25 30 32 | 64 3a 25 30 32 64 22 2c |%02d:%02|d:%02d",|
|00005430| 20 67 6d 2d 3e 74 6d 5f | 68 6f 75 72 2c 20 67 6d | gm->tm_|hour, gm|
|00005440| 2d 3e 74 6d 5f 6d 69 6e | 2c 20 67 6d 2d 3e 74 6d |->tm_min|, gm->tm|
|00005450| 5f 73 65 63 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |_sec);. | |
|00005460| 20 20 20 49 63 6f 6e 5f | 53 6d 61 72 74 50 72 69 | Icon_|SmartPri|
|00005470| 6e 74 28 55 6e 69 76 65 | 72 73 61 6c 5f 44 61 74 |nt(Unive|rsal_Dat|
|00005480| 65 2c 20 22 25 64 20 25 | 73 20 25 64 22 2c 20 67 |e, "%d %|s %d", g|
|00005490| 6d 2d 3e 74 6d 5f 6d 64 | 61 79 2c 20 6d 6f 6e 61 |m->tm_md|ay, mona|
|000054a0| 6d 65 5b 67 6d 2d 3e 74 | 6d 5f 6d 6f 6e 5d 2c 20 |me[gm->t|m_mon], |
|000054b0| 67 6d 2d 3e 74 6d 5f 79 | 65 61 72 20 2b 20 31 39 |gm->tm_y|ear + 19|
|000054c0| 30 30 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |00);. | |
|000054d0| 20 7d 0a 0a 20 20 20 20 | 20 20 20 20 67 6d 20 3d | }.. | gm =|
|000054e0| 20 6c 6f 63 61 6c 74 69 | 6d 65 28 26 74 29 3b 0a | localti|me(&t);.|
|000054f0| 20 20 20 20 20 20 20 20 | 69 66 28 74 65 73 74 6d | |if(testm|
|00005500| 6f 64 65 29 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ode). | |
|00005510| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 49 | {. | I|
|00005520| 63 6f 6e 5f 53 6d 61 72 | 74 50 72 69 6e 74 28 4c |con_Smar|tPrint(L|
|00005530| 6f 63 61 6c 5f 54 69 6d | 65 2c 20 22 2d 2d 3a 2d |ocal_Tim|e, "--:-|
|00005540| 2d 3a 2d 2d 22 29 3b 0a | 20 20 20 20 20 20 20 20 |-:--");.| |
|00005550| 20 20 20 20 49 63 6f 6e | 5f 53 6d 61 72 74 50 72 | Icon|_SmartPr|
|00005560| 69 6e 74 28 4c 6f 63 61 | 6c 5f 44 61 74 65 2c 20 |int(Loca|l_Date, |
|00005570| 22 28 54 65 73 74 20 4d | 6f 64 65 29 22 29 3b 0a |"(Test M|ode)");.|
|00005580| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0a 20 20 | | }. |
|00005590| 20 20 20 20 20 20 65 6c | 73 65 0a 20 20 20 20 20 | el|se. |
|000055a0| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|000055b0| 20 20 20 20 20 49 63 6f | 6e 5f 53 6d 61 72 74 50 | Ico|n_SmartP|
|000055c0| 72 69 6e 74 28 4c 6f 63 | 61 6c 5f 54 69 6d 65 2c |rint(Loc|al_Time,|
|000055d0| 20 22 25 30 32 64 3a 25 | 30 32 64 3a 25 30 32 64 | "%02d:%|02d:%02d|
|000055e0| 22 2c 20 67 6d 2d 3e 74 | 6d 5f 68 6f 75 72 2c 20 |", gm->t|m_hour, |
|000055f0| 67 6d 2d 3e 74 6d 5f 6d | 69 6e 2c 20 67 6d 2d 3e |gm->tm_m|in, gm->|
|00005600| 74 6d 5f 73 65 63 29 3b | 0a 20 20 20 20 20 20 20 |tm_sec);|. |
|00005610| 20 20 20 20 20 49 63 6f | 6e 5f 53 6d 61 72 74 50 | Ico|n_SmartP|
|00005620| 72 69 6e 74 28 4c 6f 63 | 61 6c 5f 44 61 74 65 2c |rint(Loc|al_Date,|
|00005630| 20 22 25 64 20 25 73 20 | 25 64 22 2c 20 67 6d 2d | "%d %s |%d", gm-|
|00005640| 3e 74 6d 5f 6d 64 61 79 | 2c 20 6d 6f 6e 61 6d 65 |>tm_mday|, moname|
|00005650| 5b 67 6d 2d 3e 74 6d 5f | 6d 6f 6e 5d 2c 20 67 6d |[gm->tm_|mon], gm|
|00005660| 2d 3e 74 6d 5f 79 65 61 | 72 20 2b 20 31 39 30 30 |->tm_yea|r + 1900|
|00005670| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |);. | }|
|00005680| 0a 0a 20 20 20 20 20 20 | 20 20 2f 2a 0a 20 20 20 |.. | /*. |
|00005690| 20 20 20 20 20 20 2a 20 | 20 73 70 72 69 6e 74 66 | * | sprintf|
|000056a0| 28 74 62 75 66 2c 20 22 | 4d 6f 6f 6e 20 70 68 61 |(tbuf, "|Moon pha|
|000056b0| 73 65 3a 20 20 20 20 20 | 20 25 64 25 25 20 20 20 |se: | %d%% |
|000056c0| 30 25 25 20 3d 20 4e 65 | 77 2c 20 31 30 30 25 25 |0%% = Ne|w, 100%%|
|000056d0| 20 3d 20 46 75 6c 6c 20 | 20 22 2c 0a 20 20 20 20 | = Full | ",. |
|000056e0| 20 20 20 20 20 2a 20 20 | 20 20 20 20 20 20 20 28 | * | (|
|000056f0| 69 6e 74 29 20 28 63 70 | 68 61 73 65 20 2a 20 31 |int) (cp|hase * 1|
|00005700| 30 30 29 29 3b 0a 20 20 | 20 20 20 20 20 20 20 2a |00));. | *|
|00005710| 20 20 20 70 72 74 28 35 | 29 3b 0a 20 20 20 20 20 | prt(5|);. |
|00005720| 20 20 20 20 2a 2f 0a 0a | 20 20 20 20 20 20 20 20 | */..| |
|00005730| 2f 2a 0a 20 20 20 20 20 | 20 20 20 20 2a 20 20 49 |/*. | * I|
|00005740| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00005750| 20 74 68 65 20 4d 6f 6f | 6e 0a 20 20 20 20 20 20 | the Moo|n. |
|00005760| 20 20 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 49 63 | */. | Ic|
|00005770| 6f 6e 5f 53 6d 61 72 74 | 50 72 69 6e 74 28 4d 6f |on_Smart|Print(Mo|
|00005780| 6f 6e 5f 53 75 62 74 65 | 6e 64 73 2c 20 22 25 2e |on_Subte|nds, "%.|
|00005790| 34 66 b0 22 2c 20 63 61 | 6e 67 64 69 61 29 3b 0a |4f.", ca|ngdia);.|
|000057a0| 0a 20 20 20 20 20 20 20 | 20 49 63 6f 6e 5f 53 6d |. | Icon_Sm|
|000057b0| 61 72 74 50 72 69 6e 74 | 28 4d 6f 6f 6e 44 69 73 |artPrint|(MoonDis|
|000057c0| 74 61 6e 63 65 5f 4b 69 | 6c 6f 6d 65 74 65 72 73 |tance_Ki|lometers|
|000057d0| 2c 20 22 25 6c 64 20 6b | 69 6c 6f 6d 65 74 72 65 |, "%ld k|ilometre|
|000057e0| 73 22 2c 20 28 6c 6f 6e | 67 29 20 63 64 69 73 74 |s", (lon|g) cdist|
|000057f0| 29 3b 0a 20 20 20 20 20 | 20 20 20 49 63 6f 6e 5f |);. | Icon_|
|00005800| 53 6d 61 72 74 50 72 69 | 6e 74 28 4d 6f 6f 6e 44 |SmartPri|nt(MoonD|
|00005810| 69 73 74 61 6e 63 65 5f | 52 61 64 69 69 2c 20 22 |istance_|Radii, "|
|00005820| 25 2e 31 66 20 45 61 72 | 74 68 20 72 61 64 69 69 |%.1f Ear|th radii|
|00005830| 22 2c 20 63 64 69 73 74 | 20 2f 20 65 61 72 74 68 |", cdist| / earth|
|00005840| 72 61 64 29 3b 0a 0a 20 | 20 20 20 20 20 20 20 61 |rad);.. | a|
|00005850| 6f 6d 20 3d 20 6a 64 20 | 2d 20 70 68 61 73 61 72 |om = jd |- phasar|
|00005860| 5b 30 5d 3b 20 2f 2a 20 | 43 6f 73 20 69 74 20 77 |[0]; /* |Cos it w|
|00005870| 61 73 20 77 72 6f 6e 67 | 20 2d 2d 20 45 64 6f 75 |as wrong| -- Edou|
|00005880| 61 72 64 20 50 6f 6f 72 | 20 2a 2f 0a 0a 20 20 20 |ard Poor| */.. |
|00005890| 20 20 20 20 20 49 63 6f | 6e 5f 53 6d 61 72 74 50 | Ico|n_SmartP|
|000058a0| 72 69 6e 74 28 4d 6f 6f | 6e 41 67 65 5f 44 61 79 |rint(Moo|nAge_Day|
|000058b0| 73 2c 20 22 25 64 22 2c | 20 28 69 6e 74 29 20 61 |s, "%d",| (int) a|
|000058c0| 6f 6d 29 3b 0a 20 20 20 | 20 20 20 20 20 49 63 6f |om);. | Ico|
|000058d0| 6e 5f 53 6d 61 72 74 50 | 72 69 6e 74 28 4d 6f 6f |n_SmartP|rint(Moo|
|000058e0| 6e 41 67 65 5f 48 6f 75 | 72 73 2c 20 22 25 64 22 |nAge_Hou|rs, "%d"|
|000058f0| 2c 20 28 28 69 6e 74 29 | 20 28 32 34 20 2a 20 28 |, ((int)| (24 * (|
|00005900| 61 6f 6d 20 2d 20 66 6c | 6f 6f 72 28 61 6f 6d 29 |aom - fl|oor(aom)|
|00005910| 29 29 29 29 3b 0a 20 20 | 20 20 20 20 20 20 49 63 |))));. | Ic|
|00005920| 6f 6e 5f 53 6d 61 72 74 | 50 72 69 6e 74 28 4d 6f |on_Smart|Print(Mo|
|00005930| 6f 6e 41 67 65 5f 4d 69 | 6e 75 74 65 73 2c 20 22 |onAge_Mi|nutes, "|
|00005940| 25 64 22 2c 20 28 28 69 | 6e 74 29 20 28 31 34 34 |%d", ((i|nt) (144|
|00005950| 30 20 2a 20 28 61 6f 6d | 20 2d 20 66 6c 6f 6f 72 |0 * (aom| - floor|
|00005960| 28 61 6f 6d 29 29 29 29 | 20 25 20 36 30 29 3b 0a |(aom))))| % 60);.|
|00005970| 0a 20 20 20 20 20 20 20 | 20 2f 2a 20 20 0a 20 20 |. | /* . |
|00005980| 20 20 20 20 20 20 20 2a | 20 20 45 64 69 74 20 69 | *| Edit i|
|00005990| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|000059a0| 20 74 68 65 20 53 75 6e | 0a 20 20 20 20 20 20 20 | the Sun|. |
|000059b0| 20 20 2a 2f 0a 20 20 20 | 20 20 20 20 20 49 63 6f | */. | Ico|
|000059c0| 6e 5f 53 6d 61 72 74 50 | 72 69 6e 74 28 53 75 6e |n_SmartP|rint(Sun|
|000059d0| 5f 53 75 62 74 65 6e 64 | 73 2c 20 22 25 2e 34 66 |_Subtend|s, "%.4f|
|000059e0| b0 22 2c 20 63 73 75 61 | 6e 67 29 3b 0a 0a 20 20 |.", csua|ng);.. |
|000059f0| 20 20 20 20 20 20 49 63 | 6f 6e 5f 53 6d 61 72 74 | Ic|on_Smart|
|00005a00| 50 72 69 6e 74 28 53 75 | 6e 44 69 73 74 61 6e 63 |Print(Su|nDistanc|
|00005a10| 65 5f 4b 69 6c 6f 6d 65 | 74 65 72 73 2c 20 22 25 |e_Kilome|ters, "%|
|00005a20| 2e 30 66 20 6b 69 6c 6f | 6d 65 74 72 65 73 22 2c |.0f kilo|metres",|
|00005a30| 20 63 73 75 6e 64 29 3b | 0a 20 20 20 20 20 20 20 | csund);|. |
|00005a40| 20 49 63 6f 6e 5f 53 6d | 61 72 74 50 72 69 6e 74 | Icon_Sm|artPrint|
|00005a50| 28 53 75 6e 44 69 73 74 | 61 6e 63 65 5f 41 55 2c |(SunDist|ance_AU,|
|00005a60| 20 22 25 2e 33 66 20 41 | 2e 55 2e 22 2c 20 63 73 | "%.3f A|.U.", cs|
|00005a70| 75 6e 64 20 2f 20 73 75 | 6e 73 6d 61 78 29 3b 0a |und / su|nsmax);.|
|00005a80| 0a 20 20 20 20 20 20 20 | 20 2f 2a 0a 20 20 20 20 |. | /*. |
|00005a90| 20 20 20 20 20 2a 20 20 | 43 61 6c 63 75 6c 61 74 | * |Calculat|
|00005aa0| 65 20 74 69 6d 65 73 20 | 6f 66 20 70 68 61 73 65 |e times |of phase|
|00005ab0| 73 20 6f 66 20 74 68 69 | 73 20 6c 75 6e 61 74 69 |s of thi|s lunati|
|00005ac0| 6f 6e 2e 0a 20 20 20 20 | 20 20 20 20 20 2a 20 20 |on.. | * |
|00005ad0| 54 68 69 73 20 69 73 20 | 73 75 66 66 69 63 69 65 |This is |sufficie|
|00005ae0| 6e 74 6c 79 20 74 69 6d | 65 2d 63 6f 6e 73 75 6d |ntly tim|e-consum|
|00005af0| 69 6e 67 20 74 68 61 74 | 0a 20 20 20 20 20 20 20 |ing that|. |
|00005b00| 20 20 2a 20 20 77 65 20 | 6f 6e 6c 79 20 64 6f 20 | * we |only do |
|00005b10| 69 74 20 6f 6e 63 65 20 | 61 20 6d 6f 6e 74 68 2e |it once |a month.|
|00005b20| 0a 20 20 20 20 20 20 20 | 20 20 2a 2f 0a 20 20 20 |. | */. |
|00005b30| 20 20 20 20 20 69 66 28 | 6a 64 20 3e 20 6e 70 74 | if(|jd > npt|
|00005b40| 69 6d 65 29 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ime). | |
|00005b50| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 6c | {. | l|
|00005b60| 70 74 69 6d 65 20 3d 20 | 70 68 61 73 61 72 5b 30 |ptime = |phasar[0|
|00005b70| 5d 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 6a |];. | j|
|00005b80| 79 65 61 72 28 6c 70 74 | 69 6d 65 2c 20 26 79 79 |year(lpt|ime, &yy|
|00005b90| 2c 20 26 6d 6d 2c 20 26 | 64 64 29 3b 0a 20 20 20 |, &mm, &|dd);. |
|00005ba0| 20 20 20 20 20 20 20 20 | 20 6a 68 6d 73 28 6c 70 | | jhms(lp|
|00005bb0| 74 69 6d 65 2c 20 26 68 | 68 2c 20 26 6d 6d 6d 2c |time, &h|h, &mmm,|
|00005bc0| 20 26 73 73 29 3b 0a 20 | 20 20 20 20 20 20 20 20 | &ss);. | |
|00005bd0| 20 20 20 49 63 6f 6e 5f | 53 6d 61 72 74 50 72 69 | Icon_|SmartPri|
|00005be0| 6e 74 28 50 68 61 73 65 | 73 5f 4c 61 73 74 4e 65 |nt(Phase|s_LastNe|
|00005bf0| 77 4d 6f 6f 6e 2c 20 22 | 25 30 32 64 3a 25 30 32 |wMoon, "|%02d:%02|
|00005c00| 64 20 25 64 20 25 73 20 | 25 64 22 2c 20 68 68 2c |d %d %s |%d", hh,|
|00005c10| 20 6d 6d 6d 2c 20 64 64 | 2c 20 6d 6f 6e 61 6d 65 | mmm, dd|, moname|
|00005c20| 5b 6d 6d 20 2d 20 31 5d | 2c 20 79 79 29 3b 0a 0a |[mm - 1]|, yy);..|
|00005c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 6c 70 74 69 | | lpti|
|00005c40| 6d 65 20 3d 20 70 68 61 | 73 61 72 5b 31 5d 3b 0a |me = pha|sar[1];.|
|00005c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 6a 79 65 61 | | jyea|
|00005c60| 72 28 6c 70 74 69 6d 65 | 2c 20 26 79 79 2c 20 26 |r(lptime|, &yy, &|
|00005c70| 6d 6d 2c 20 26 64 64 29 | 3b 0a 20 20 20 20 20 20 |mm, &dd)|;. |
|00005c80| 20 20 20 20 20 20 6a 68 | 6d 73 28 6c 70 74 69 6d | jh|ms(lptim|
|00005c90| 65 2c 20 26 68 68 2c 20 | 26 6d 6d 6d 2c 20 26 73 |e, &hh, |&mmm, &s|
|00005ca0| 73 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |s);. | |
|00005cb0| 49 63 6f 6e 5f 53 6d 61 | 72 74 50 72 69 6e 74 28 |Icon_Sma|rtPrint(|
|00005cc0| 50 68 61 73 65 73 5f 46 | 69 72 73 74 51 75 61 72 |Phases_F|irstQuar|
|00005cd0| 74 65 72 2c 20 22 25 30 | 32 64 3a 25 30 32 64 20 |ter, "%0|2d:%02d |
|00005ce0| 25 64 20 25 73 20 25 64 | 22 2c 20 68 68 2c 20 6d |%d %s %d|", hh, m|
|00005cf0| 6d 6d 2c 20 64 64 2c 20 | 6d 6f 6e 61 6d 65 5b 6d |mm, dd, |moname[m|
|00005d00| 6d 20 2d 20 31 5d 2c 20 | 79 79 29 3b 0a 20 20 20 |m - 1], |yy);. |
|00005d10| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6c 70 74 |. | lpt|
|00005d20| 69 6d 65 20 3d 20 70 68 | 61 73 61 72 5b 32 5d 3b |ime = ph|asar[2];|
|00005d30| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6a 79 65 |. | jye|
|00005d40| 61 72 28 6c 70 74 69 6d | 65 2c 20 26 79 79 2c 20 |ar(lptim|e, &yy, |
|00005d50| 26 6d 6d 2c 20 26 64 64 | 29 3b 0a 20 20 20 20 20 |&mm, &dd|);. |
|00005d60| 20 20 20 20 20 20 20 6a | 68 6d 73 28 6c 70 74 69 | j|hms(lpti|
|00005d70| 6d 65 2c 20 26 68 68 2c | 20 26 6d 6d 6d 2c 20 26 |me, &hh,| &mmm, &|
|00005d80| 73 73 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ss);. | |
|00005d90| 20 49 63 6f 6e 5f 53 6d | 61 72 74 50 72 69 6e 74 | Icon_Sm|artPrint|
|00005da0| 28 50 68 61 73 65 73 5f | 46 75 6c 6c 4d 6f 6f 6e |(Phases_|FullMoon|
|00005db0| 2c 20 22 25 30 32 64 3a | 25 30 32 64 20 25 64 20 |, "%02d:|%02d %d |
|00005dc0| 25 73 20 25 64 22 2c 20 | 68 68 2c 20 6d 6d 6d 2c |%s %d", |hh, mmm,|
|00005dd0| 20 64 64 2c 20 6d 6f 6e | 61 6d 65 5b 6d 6d 20 2d | dd, mon|ame[mm -|
|00005de0| 20 31 5d 2c 20 79 79 29 | 3b 0a 20 20 20 0a 20 20 | 1], yy)|;. . |
|00005df0| 20 20 20 20 20 20 20 20 | 20 20 6c 70 74 69 6d 65 | | lptime|
|00005e00| 20 3d 20 70 68 61 73 61 | 72 5b 33 5d 3b 0a 20 20 | = phasa|r[3];. |
|00005e10| 20 20 20 20 20 20 20 20 | 20 20 6a 79 65 61 72 28 | | jyear(|
|00005e20| 6c 70 74 69 6d 65 2c 20 | 26 79 79 2c 20 26 6d 6d |lptime, |&yy, &mm|
|00005e30| 2c 20 26 64 64 29 3b 0a | 20 20 20 20 20 20 20 20 |, &dd);.| |
|00005e40| 20 20 20 20 6a 68 6d 73 | 28 6c 70 74 69 6d 65 2c | jhms|(lptime,|
|00005e50| 20 26 68 68 2c 20 26 6d | 6d 6d 2c 20 26 73 73 29 | &hh, &m|mm, &ss)|
|00005e60| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 49 63 |;. | Ic|
|00005e70| 6f 6e 5f 53 6d 61 72 74 | 50 72 69 6e 74 28 50 68 |on_Smart|Print(Ph|
|00005e80| 61 73 65 73 5f 4c 61 73 | 74 51 75 61 72 74 65 72 |ases_Las|tQuarter|
|00005e90| 2c 20 22 25 30 32 64 3a | 25 30 32 64 20 25 64 20 |, "%02d:|%02d %d |
|00005ea0| 25 73 20 25 64 22 2c 20 | 68 68 2c 20 6d 6d 6d 2c |%s %d", |hh, mmm,|
|00005eb0| 20 64 64 2c 20 6d 6f 6e | 61 6d 65 5b 6d 6d 20 2d | dd, mon|ame[mm -|
|00005ec0| 20 31 5d 2c 20 79 79 29 | 3b 0a 20 20 20 0a 20 20 | 1], yy)|;. . |
|00005ed0| 20 20 20 20 20 20 20 20 | 20 20 6e 70 74 69 6d 65 | | nptime|
|00005ee0| 20 3d 20 70 68 61 73 61 | 72 5b 34 5d 3b 0a 20 20 | = phasa|r[4];. |
|00005ef0| 20 20 20 20 20 20 20 20 | 20 20 6a 79 65 61 72 28 | | jyear(|
|00005f00| 6e 70 74 69 6d 65 2c 20 | 26 79 79 2c 20 26 6d 6d |nptime, |&yy, &mm|
|00005f10| 2c 20 26 64 64 29 3b 0a | 20 20 20 20 20 20 20 20 |, &dd);.| |
|00005f20| 20 20 20 20 6a 68 6d 73 | 28 6e 70 74 69 6d 65 2c | jhms|(nptime,|
|00005f30| 20 26 68 68 2c 20 26 6d | 6d 6d 2c 20 26 73 73 29 | &hh, &m|mm, &ss)|
|00005f40| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 49 63 |;. | Ic|
|00005f50| 6f 6e 5f 53 6d 61 72 74 | 50 72 69 6e 74 28 50 68 |on_Smart|Print(Ph|
|00005f60| 61 73 65 73 5f 4e 65 78 | 74 4e 65 77 4d 6f 6f 6e |ases_Nex|tNewMoon|
|00005f70| 2c 20 22 25 30 32 64 3a | 25 30 32 64 20 25 64 20 |, "%02d:|%02d %d |
|00005f80| 25 73 20 25 64 22 2c 20 | 68 68 2c 20 6d 6d 6d 2c |%s %d", |hh, mmm,|
|00005f90| 20 64 64 2c 20 6d 6f 6e | 61 6d 65 5b 6d 6d 20 2d | dd, mon|ame[mm -|
|00005fa0| 20 31 5d 2c 20 79 79 29 | 3b 0a 0a 20 20 20 20 20 | 1], yy)|;.. |
|00005fb0| 20 20 20 20 20 20 20 6c | 75 6e 61 74 69 6f 6e 20 | l|unation |
|00005fc0| 3d 20 66 6c 6f 6f 72 28 | 28 28 6c 70 74 69 6d 65 |= floor(|((lptime|
|00005fd0| 20 2b 20 37 29 20 2d 20 | 6c 75 6e 61 74 62 61 73 | + 7) - |lunatbas|
|00005fe0| 65 29 20 2f 20 73 79 6e | 6d 6f 6e 74 68 29 20 2b |e) / syn|month) +|
|00005ff0| 20 31 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | 1;. | |
|00006000| 49 63 6f 6e 5f 53 6d 61 | 72 74 50 72 69 6e 74 28 |Icon_Sma|rtPrint(|
|00006010| 50 68 61 73 65 73 5f 43 | 75 72 72 65 6e 74 4c 75 |Phases_C|urrentLu|
|00006020| 6e 61 74 69 6f 6e 2c 20 | 22 25 64 22 2c 20 6c 75 |nation, |"%d", lu|
|00006030| 6e 61 74 69 6f 6e 29 3b | 0a 20 20 20 20 20 20 20 |nation);|. |
|00006040| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 7d | }. | }|
|00006050| 0a 0a 2f 2a 20 20 4a 44 | 41 54 45 20 20 2d 2d 20 |../* JD|ATE -- |
|00006060| 20 43 6f 6e 76 65 72 74 | 20 69 6e 74 65 72 6e 61 | Convert| interna|
|00006070| 6c 20 47 4d 54 20 64 61 | 74 65 20 61 6e 64 20 74 |l GMT da|te and t|
|00006080| 69 6d 65 20 74 6f 20 4a | 75 6c 69 61 6e 20 64 61 |ime to J|ulian da|
|00006090| 79 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |y. | |
|000060a0| 20 61 6e 64 20 66 72 61 | 63 74 69 6f 6e 2e 20 20 | and fra|ction. |
|000060b0| 2a 2f 0a 0a 6c 6f 6e 67 | 20 6a 64 61 74 65 28 73 |*/..long| jdate(s|
|000060c0| 74 72 75 63 74 20 74 6d | 20 2a 74 29 0a 20 20 20 |truct tm| *t). |
|000060d0| 20 7b 0a 20 20 20 20 6c | 6f 6e 67 20 63 2c 20 6d | {. l|ong c, m|
|000060e0| 2c 20 79 3b 0a 0a 20 20 | 20 20 79 20 3d 20 74 2d |, y;.. | y = t-|
|000060f0| 3e 74 6d 5f 79 65 61 72 | 20 2b 20 31 39 30 30 3b |>tm_year| + 1900;|
|00006100| 0a 20 20 20 20 6d 20 3d | 20 74 2d 3e 74 6d 5f 6d |. m =| t->tm_m|
|00006110| 6f 6e 20 2b 20 31 3b 0a | 20 20 20 20 69 66 20 28 |on + 1;.| if (|
|00006120| 6d 20 3e 20 32 29 0a 20 | 20 20 20 20 20 20 6d 20 |m > 2). | m |
|00006130| 3d 20 6d 20 2d 20 33 3b | 0a 20 20 20 20 65 6c 73 |= m - 3;|. els|
|00006140| 65 0a 20 20 20 20 20 20 | 20 20 7b 0a 20 20 20 20 |e. | {. |
|00006150| 20 20 20 20 6d 20 3d 20 | 6d 20 2b 20 39 3b 0a 20 | m = |m + 9;. |
|00006160| 20 20 20 20 20 20 20 79 | 20 3d 20 79 20 2d 20 31 | y| = y - 1|
|00006170| 3b 0a 20 20 20 20 20 20 | 20 20 7d 0a 20 20 20 20 |;. | }. |
|00006180| 63 20 3d 20 79 20 2f 20 | 31 30 30 4c 3b 20 20 20 |c = y / |100L; |
|00006190| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 43 6f | | /* Co|
|000061a0| 6d 70 75 74 65 20 63 65 | 6e 74 75 72 79 20 2a 2f |mpute ce|ntury */|
|000061b0| 0a 20 20 20 20 79 20 2d | 3d 20 31 30 30 4c 20 2a |. y -|= 100L *|
|000061c0| 20 63 3b 0a 20 20 20 20 | 72 65 74 75 72 6e 20 74 | c;. |return t|
|000061d0| 2d 3e 74 6d 5f 6d 64 61 | 79 20 2b 20 28 63 20 2a |->tm_mda|y + (c *|
|000061e0| 20 31 34 36 30 39 37 4c | 29 20 2f 20 34 20 2b 20 | 146097L|) / 4 + |
|000061f0| 28 79 20 2a 20 31 34 36 | 31 4c 29 20 2f 20 34 20 |(y * 146|1L) / 4 |
|00006200| 2b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 28 6d |+. | (m|
|00006210| 20 2a 20 31 35 33 4c 20 | 2b 20 32 29 20 2f 20 35 | * 153L |+ 2) / 5|
|00006220| 20 2b 20 31 37 32 31 31 | 31 39 4c 3b 0a 20 20 20 | + 17211|19L;. |
|00006230| 20 7d 0a 0a 2f 2a 20 4a | 54 49 4d 45 20 2d 2d 20 | }../* J|TIME -- |
|00006240| 20 20 20 43 6f 6e 76 65 | 72 74 20 69 6e 74 65 72 | Conve|rt inter|
|00006250| 6e 61 6c 20 47 4d 54 20 | 64 61 74 65 20 61 6e 64 |nal GMT |date and|
|00006260| 20 74 69 6d 65 20 74 6f | 20 61 73 74 72 6f 6e 6f | time to| astrono|
|00006270| 6d 69 63 61 6c 20 4a 75 | 6c 69 61 6e 0a 20 20 20 |mical Ju|lian. |
|00006280| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 69 6d 65 | | time|
|00006290| 20 28 69 2e 65 2e 20 4a | 75 6c 69 61 6e 20 64 61 | (i.e. J|ulian da|
|000062a0| 74 65 20 70 6c 75 73 20 | 64 61 79 20 66 72 61 63 |te plus |day frac|
|000062b0| 74 69 6f 6e 2c 20 65 78 | 70 72 65 73 73 65 64 20 |tion, ex|pressed |
|000062c0| 61 73 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |as. | |
|000062d0| 20 20 61 20 64 6f 75 62 | 6c 65 29 2e 20 20 2a 2f | a doub|le). */|
|000062e0| 0a 0a 64 6f 75 62 6c 65 | 20 6a 74 69 6d 65 28 73 |..double| jtime(s|
|000062f0| 74 72 75 63 74 20 74 6d | 20 2a 74 29 0a 20 20 20 |truct tm| *t). |
|00006300| 20 7b 0a 20 20 20 20 72 | 65 74 75 72 6e 20 28 6a | {. r|eturn (j|
|00006310| 64 61 74 65 28 74 29 20 | 2d 20 30 2e 35 29 20 2b |date(t) |- 0.5) +|
|00006320| 20 0a 20 20 20 20 20 20 | 20 20 28 74 2d 3e 74 6d | . | (t->tm|
|00006330| 5f 73 65 63 20 2b 20 36 | 30 20 2a 20 28 74 2d 3e |_sec + 6|0 * (t->|
|00006340| 74 6d 5f 6d 69 6e 20 2b | 20 36 30 20 2a 20 74 2d |tm_min +| 60 * t-|
|00006350| 3e 74 6d 5f 68 6f 75 72 | 29 29 20 2f 20 38 36 34 |>tm_hour|)) / 864|
|00006360| 30 30 2e 30 3b 0a 20 20 | 20 20 7d 0a 0a 2f 2a 20 |00.0;. | }../* |
|00006370| 20 4a 59 45 41 52 20 20 | 2d 2d 20 20 43 6f 6e 76 | JYEAR |-- Conv|
|00006380| 65 72 74 20 4a 75 6c 69 | 61 6e 20 64 61 74 65 20 |ert Juli|an date |
|00006390| 74 6f 20 79 65 61 72 2c | 20 6d 6f 6e 74 68 2c 20 |to year,| month, |
|000063a0| 64 61 79 2c 20 77 68 69 | 63 68 20 61 72 65 0a 20 |day, whi|ch are. |
|000063b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 | | re|
|000063c0| 74 75 72 6e 65 64 20 76 | 69 61 20 69 6e 74 65 67 |turned v|ia integ|
|000063d0| 65 72 20 70 6f 69 6e 74 | 65 72 73 20 74 6f 20 69 |er point|ers to i|
|000063e0| 6e 74 65 67 65 72 73 2e | 20 20 2a 2f 0a 0a 76 6f |ntegers.| */..vo|
|000063f0| 69 64 20 6a 79 65 61 72 | 28 64 6f 75 62 6c 65 20 |id jyear|(double |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.