diff --git a/Makefile b/Makefile index dbfecf7..1c40640 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Astrolog (Version 7.40) File: Makefile (Unix version) +# Astrolog (Version 7.50) File: Makefile (Unix version) # # IMPORTANT NOTICE: Astrolog and all chart display routines and anything # not enumerated elsewhere in this program are Copyright (C) 1991-2022 by @@ -17,7 +17,7 @@ # library, and if applicable, the main X library. # NAME = astrolog -OBJ = astrolog.o atlas.o calc.o charts0.o charts1.o charts2.o charts3.o\ +OBJS = astrolog.o atlas.o calc.o charts0.o charts1.o charts2.o charts3.o\ data.o express.o general.o intrpret.o io.o matrix.o placalc.o placalc2.o\ xdata.o xgeneral.o xdevice.o xcharts0.o xcharts1.o xcharts2.o xscreen.o\ swecl.o swedate.o swehouse.o swejpl.o swemmoon.o swemplan.o sweph.o\ @@ -25,10 +25,13 @@ OBJ = astrolog.o atlas.o calc.o charts0.o charts1.o charts2.o charts3.o\ # If you don't have X windows, delete the "-lX11" part from the line below: # If not compiling with GNUC, delete the "-ldl" part from the line below: -LIBS = -lm -lX11 -ldl +LIBS = -lm -lX11 -ldl -s CPPFLAGS = -O -Wno-write-strings -Wno-narrowing -Wno-comment +RM = rm -f -astrolog:: $(OBJ) - cc -o $(NAME) $(OBJ) $(LIBS) - strip $(NAME) +$(NAME): $(OBJS) + cc -o $(NAME) $(OBJS) $(LIBS) + +clean: + $(RM) $(OBJS) $(NAME) # diff --git a/astrolog.as b/astrolog.as index d9023f8..c1d2c06 100644 --- a/astrolog.as +++ b/astrolog.as @@ -1,4 +1,4 @@ -@AD740 ; Astrolog 7.40 default settings file astrolog.as +@AD750 ; Astrolog 7.50 default settings file astrolog.as ; The contents of this file can be automatically generated with the ; "File / Save Settings" menu command, or with the -od command switch. @@ -7,6 +7,7 @@ -z0 Autodetect ; Default Daylight time [0 standard, 1 daylight] -zl 122W19'59 47N36'35 ; Default location [longitude and latitude] -zv 167ft ; Default elevation [in feet or meters ] +-zf 59F ; Default temperature [in Fahren. or Celsius ] -zj "Current moment now" "Seattle, WA, USA" ; Default name and location -Yz 0 ; Time minute addition to be used if "now" charts are offset. @@ -22,6 +23,7 @@ _k ; Ansi color text ["=k" is color, "_k" is monochrome ] :d 48 ; Searching divisions [Change "48" to desired divisions ] _b0 ; Print zodiac seconds ["_b0" to minute, "=b0" to second ] =b ; Use ephemeris files ["=b" uses them, "_b" doesn't ] +=0b ; Disable old calculations ["=0b" disables them, "_0b" allows ] :w 0 ; Wheel chart text rows [Change "0" to desired wheel rows ] :I 80 ; Text screen columns [Change "80" to desired columns ] -YQ 0 ; Text screen scroll limit [Change "24" or set to "0" for none] @@ -75,6 +77,7 @@ _Yv ; European length units ["_Yv" is imperial, "=Yv" is metric] -YR0 0 0 ; Restrict sign changes, direction changes -YR1 1 1 ; Restrict latitude direction changes, distance direction changes +-YR2 1 1 ; Restrict latitude zero node crossings, distance equivalence -YR7 0 1 1 0 1 ; Restrict rulerships: std, esoteric, hierarch, exalt, ray -YRZ 0 0 0 0 ; Restrict angle events: rising, zenith, setting, nadir @@ -176,6 +179,7 @@ _Yv ; European length units ["_Yv" is imperial, "=Yv" is metric] ; GRAPHICS DEFAULTS: +_XJ ; Indian type wheels ["_XJ" is Western, "=XJ" is Indian ] =Xm ; Color charts ["=Xm" is color, "_Xm" is monochrome] _Xr ; Reverse background ["_Xr" is black, "=Xr" is white ] :Xw 600 600 ; Default X and Y resolution (not including sidebar) diff --git a/astrolog.cpp b/astrolog.cpp index faa6a2b..7a94459 100644 --- a/astrolog.cpp +++ b/astrolog.cpp @@ -1,5 +1,5 @@ /* -** Astrolog (Version 7.40) File: astrolog.cpp +** Astrolog (Version 7.50) File: astrolog.cpp ** ** IMPORTANT NOTICE: Astrolog and all chart display routines and anything ** not enumerated below used in this program are Copyright (C) 1991-2022 by @@ -48,7 +48,7 @@ ** Initial programming 8/28-30/1991. ** X Window graphics initially programmed 10/23-29/1991. ** PostScript graphics initially programmed 11/29-30/1992. -** Last code change made 3/31/2022. +** Last code change made 9/9/2022. */ #include "astrolog.h" @@ -229,11 +229,14 @@ void Action(void) #endif #ifdef GRAPH - if (us.fGraphics) // If any of the X window switches in effect, - FActionX(); // then go make a graphics chart. - else + if (us.fGraphics) { + // If in -X graphics mode, go make a graphics chart. + FActionX(); + iLine = cSequenceLine; // Once any graphics drawn, stop looping! + } else #endif { + // If not in graphics mode, print a text only chart on screen. #ifdef GRAPH if (gs.fInverse) { SwapN(kBlackA, kWhiteA); @@ -241,7 +244,7 @@ void Action(void) AnsiColor(kDefault); } #endif - PrintChart(is.fProgress); // Otherwise print chart on text screen. + PrintChart(is.fProgress); #ifdef GRAPH if (gs.fInverse) { SwapN(kBlackA, kWhiteA); @@ -476,6 +479,10 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, SwitchF(us.fTopoPos); break; + case 'f': + SwitchF(us.fRefract); + break; + case 'h': SwitchF(us.fBarycenter); break; @@ -690,13 +697,13 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, sprintf(szName, "%s", FItem(k) ? szObjName[k] : szObjUnknown); } k = rgPntSwiss[i]; - for (pch = szName; *pch; pch++) - ; if (k > 0) { + for (pch = szName; *pch; pch++) + ; sprintf(szName + Min(3, pch-szName), "%s", k == 1 ? "Nor" : (k == 2 ? "Sou" : (k == 3 ? "Per" : "Api"))); } - szObjDisp[i + custLo] = SzPersist(szName); + szObjDisp[i + custLo] = SzCopy(szName); #ifdef GRAPH szDrawObject[i + custLo] = "t"; szDrawObject2[i + custLo] = ""; #endif @@ -741,6 +748,7 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, if (FErrorValN("YU", !FStar(i), i, 1)) return tcError; szStarCustom[i-oNorm] = SzPersist(argv[2]); + rStarBrightDef[0] = -1.0; // Recompute brightness darg += 2; break; @@ -769,6 +777,7 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, CopyRgb(ignore7, ignore7Mem, sizeof(ignore7)); ignorefMem[0] = us.fIgnoreSign; ignorefMem[1] = us.fIgnoreDir; ignorefMem[2] = us.fIgnoreDiralt; ignorefMem[3] = us.fIgnoreDirlen; + ignorefMem[4] = us.fIgnoreAlt0; ignorefMem[5] = us.fIgnoreDisequ; break; } else if (ch1 == 'i') { CopyRgb(ignoreMem, ignore, sizeof(ignore)); @@ -778,6 +787,7 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, CopyRgb(ignore7Mem, ignore7, sizeof(ignore7)); us.fIgnoreSign = ignorefMem[0]; us.fIgnoreDir = ignorefMem[1]; us.fIgnoreDiralt = ignorefMem[2]; us.fIgnoreDirlen = ignorefMem[3]; + us.fIgnoreAlt0 = ignorefMem[4]; us.fIgnoreDisequ = ignorefMem[5]; AdjustRestrictions(); break; } @@ -794,6 +804,11 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, us.fIgnoreDirlen = j != 0; darg += 2; break; + } else if (ch1 == '2') { + us.fIgnoreAlt0 = i != 0; + us.fIgnoreDisequ = j != 0; + darg += 2; + break; } else if (ch1 == 'Z') { ignorez[arAsc] = i != 0; ignorez[arMC] = j != 0; @@ -822,26 +837,7 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, for (k = i; k <= j; k++) pb[k] = NFromSz(argv[3+k-i]) != 0; darg += 3+j-i; - for (j = fFalse, i = cuspLo; i <= cuspHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fCusp = j; - for (j = fFalse, i = uranLo; i <= uranHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fUranian = j; - for (j = fFalse, i = starLo; i <= starHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - if (!(us.nStar && j)) - us.nStar = j; - AdjustRestrictions(); + RedoRestrictions(); break; case 'A': @@ -1130,8 +1126,16 @@ int NProcessSwitchesRare(int argc, char **argv, int pos, FEnumerateCIList(i); break; -#ifdef ATLAS case 'Y': + if (ch1 == 't') { + if (FErrorArgc("YYt", argc, 1)) + return tcError; + if (!us.fGraphics) + PrintSzFormat(argv[1]); + darg++; + break; + } +#ifdef ATLAS i = ch1 - '0'; if (FErrorArgc("YY", argc, 1 + (i == 1 || i == 2))) return tcError; @@ -1270,8 +1274,20 @@ flag FProcessSwitches(int argc, char **argv) case 'v': if (ch1 == '0') SwitchF(us.fVelocity); - else if (ch1 == '3') + else if (ch1 == '3') { SwitchF(us.fListDecan); + if (argc > 1 && ((i = NFromSz(argv[1])) > 0 || FNumCh(argv[1][0]) || + argv[1][0] == '~')) { + argc--; argv++; + if (FErrorValN("v3", !FValidDecan(i), i, 0)) + return fFalse; + if (i <= 0) + us.fListDecan = fFalse; + else + us.nDecanType = i; + } + break; + } SwitchF(us.fListing); break; @@ -1760,6 +1776,7 @@ flag FProcessSwitches(int argc, char **argv) #ifdef TIME case 'n': + ci = ciCore; FInputData(szNowCore); if (ch1 == 'd') TT = 0.0; @@ -1767,6 +1784,11 @@ flag FProcessSwitches(int argc, char **argv) DD = 1; TT = 0.0; } else if (ch1 == 'y') { MM = DD = 1; TT = 0.0; + } else + ch2 = ch1; + if (FBetween(ch2, '1', '0' + cRing)) { + *rgpci[ch2 - '0'] = ciCore; + ciCore = ci; } break; #endif @@ -1801,6 +1823,12 @@ flag FProcessSwitches(int argc, char **argv) us.elvDef = RParseSz(argv[1], pmElv); argc--; argv++; break; + } else if (ch1 == 'f') { + if (FErrorArgc("zf", argc, 1)) + return fFalse; + us.tmpDef = RParseSz(argv[1], pmTmp); + argc--; argv++; + break; } else if (ch1 == 'j') { if (FErrorArgc("zj", argc, 2)) return fFalse; @@ -1892,8 +1920,10 @@ flag FProcessSwitches(int argc, char **argv) case 'q': i = (ch1 == 'y' || ch1 == 'j' || ch1 == 'L') + 2*(ch1 == 'm') + 3*(ch1 == 'd') + 7*(ch1 == 'a') + 8*(ch1 == 'b') + 10*(ch1 == 'c'); - if (i <= 0) + if (i <= 0) { i = 4; + ch2 = ch1; + } if (FErrorArgc("q", argc, i)) return fFalse; is.fHaveInfo = fTrue; @@ -1940,23 +1970,8 @@ flag FProcessSwitches(int argc, char **argv) ciCore.loc = SzPersist(argv[10]); } } - if (ch2 == '1') { - ciMain = ciCore; - ciCore = ci; - } else if (ch2 == '2') { - ciTwin = ciCore; - ciCore = ci; - } else if (ch2 == '3') { - ciThre = ciCore; - ciCore = ci; - } else if (ch2 == '4') { - ciFour = ciCore; - ciCore = ci; - } else if (ch2 == '5') { - ciFive = ciCore; - ciCore = ci; - } else if (ch2 == '6') { - ciHexa = ciCore; + if (FBetween(ch2, '1', '0' + cRing)) { + *rgpci[ch2 - '0'] = ciCore; ciCore = ci; } else if (ch2 == 's') { ciSave = ciCore; @@ -1989,23 +2004,8 @@ flag FProcessSwitches(int argc, char **argv) return fFalse; if (ch1 == 'l' || ch2 == 'l') FAppendCIList(&ciCore); - if (ch1 == '1') { - ciMain = ciCore; - ciCore = ci; - } else if (ch1 == '2') { - ciTwin = ciCore; - ciCore = ci; - } else if (ch1 == '3') { - ciThre = ciCore; - ciCore = ci; - } else if (ch1 == '4') { - ciFour = ciCore; - ciCore = ci; - } else if (ch1 == '5') { - ciFive = ciCore; - ciCore = ci; - } else if (ch1 == '6') { - ciHexa = ciCore; + if (FBetween(ch1, '1', '0' + cRing)) { + *rgpci[ch1 - '0'] = ciCore; ciCore = ci; } else if (ch1 == 's') { ciSave = ciCore; @@ -2037,7 +2037,7 @@ flag FProcessSwitches(int argc, char **argv) argc--; argv++; break; } else if (ch1 == '0' || ch1 == 'd' || ch1 == 'l' || - ch1 == 'a' || ch1 == 'q') + ch1 == 'a' || ch1 == 'q' || ch1 == 'x') us.nWriteFormat = FSwitchF2(us.nWriteFormat == ch1) * ch1; SwitchF(us.fWriteFile); is.szFileOut = SzPersist(argv[1]); @@ -2095,7 +2095,7 @@ flag FProcessSwitches(int argc, char **argv) else if (ch1 == 'C') for (i = cuspLo; i <= cuspHi; i++) SwitchF(pch[i]); - else if (ch1 == 'u' && ch2 == '0') + else if (ch1 == 'u' && ch2 == '0') // Must be before Uranian check for (i = dwarfLo; i <= dwarfHi; i++) SwitchF(pch[i]); else if (ch1 == 'u') @@ -2124,44 +2124,7 @@ flag FProcessSwitches(int argc, char **argv) inv(pch[i]); argc--; argv++; } - for (j = fFalse, i = cuspLo; i <= cuspHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fCusp = j; - for (j = fFalse, i = uranLo; i <= uranHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fUranian = j; - for (j = fFalse, i = dwarfLo; i <= dwarfHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fDwarf = j; - for (j = fFalse, i = moonsLo; i <= moonsHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fMoons = j; - for (j = fFalse, i = cobLo; i <= cobHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - us.fCOB = j; - for (j = fFalse, i = starLo; i <= starHi; i++) - if (!ignore[i] || !ignore2[i]) { - j = fTrue; - break; - } - if (!(us.nStar && j)) - us.nStar = j; - AdjustRestrictions(); + RedoRestrictions(); break; case 'C': @@ -2267,22 +2230,23 @@ flag FProcessSwitches(int argc, char **argv) us.nSwissEph = FSwitchF(us.nSwissEph == 2) * 2; else if (ch1 == 's') us.nSwissEph = FSwitchF(us.nSwissEph == 1); - else if (ch1 == 'p') + else if (ch1 == 'p' && !us.fNoPlacalc) SwitchF(us.fPlacalcPla); - else if (ch1 == 'm') + else if (ch1 == 'm' && !us.fNoPlacalc) SwitchF(us.fMatrixPla); else if (ch1 == 'a') SwitchF(us.fPlacalcAst); else if (ch1 == 'U') SwitchF(us.fMatrixStar); - else if (ch1 == 'J') + else if (ch1 == 'J' && !us.fNoNetwork) us.nSwissEph = FSwitchF(us.nSwissEph == 3) * 3; SwitchF(us.fEphemFiles); break; case 'c': if (ch1 == '3') { - if (argc > 1 && ((i = NFromSz(argv[1])) != 0 || FNumCh(argv[1][0]))) { + if (argc > 1 && ((i = NFromSz(argv[1])) != 0 || FNumCh(argv[1][0]) || + argv[1][0] == '~')) { if (FErrorValN("c3", !FValidMethod(i), i, 0)) return fFalse; argc--; argv++; @@ -2403,7 +2367,10 @@ flag FProcessSwitches(int argc, char **argv) case 'x': if (FErrorArgc("x", argc, 1)) return fFalse; - rT = RFromSz(argv[1]); + i = ChCap(argv[1][0]) == 'D'; + rT = RFromSz(argv[1] + i); + if (i != 0 && rT != 0.0) + rT = rDegMax / rT; if (FErrorValR("x", !FValidHarmonic(rT), rT, 0)) return fFalse; us.rHarmonic = rT; @@ -2463,7 +2430,7 @@ flag FProcessSwitches(int argc, char **argv) break; case 'J': - SwitchF(us.fVedic); + SwitchF(us.fIndian); break; case '9': @@ -2509,7 +2476,7 @@ flag FProcessSwitches(int argc, char **argv) case '+': case '-': - pch = &argv[0][ich-1]; + pch = &argv[0][ich-1]; // Save because argv++ changes it if (argc > 1 && ((rT = RFromSz(argv[1])) != 0.0 || FNumCh(argv[1][0]) || argv[1][0] == '~')) { argc--; argv++; @@ -2523,7 +2490,6 @@ flag FProcessSwitches(int argc, char **argv) rT -= (real)(i*24); TT += rT; AddTime(&ciCore, 3, 0); - ch1 = chNull; } else if (ch1 == 'm') { AddTime(&ciCore, 5, i%12); AddTime(&ciCore, 6, i/12); @@ -2695,6 +2661,7 @@ flag FProcessSwitches(int argc, char **argv) case 'i': us.fNoRead = fTrue; break; case 'q': us.fNoQuit = fTrue; break; case 'X': us.fNoGraphics = fTrue; break; + case 'b': us.fNoPlacalc = fTrue; break; case 'n': us.fNoNetwork = fTrue; break; case '~': us.fNoExp = fTrue; break; default: FErrorSubswitch("0", ch1, fTrue); return fFalse; @@ -2841,6 +2808,7 @@ void InitProgram() CopyRgb(ignore7, ignore7Mem, sizeof(ignore7)); ignorefMem[0] = us.fIgnoreSign; ignorefMem[1] = us.fIgnoreDir; ignorefMem[2] = us.fIgnoreDiralt; ignorefMem[3] = us.fIgnoreDirlen; + ignorefMem[4] = us.fIgnoreAlt0; ignorefMem[5] = us.fIgnoreDisequ; for (i = 0; i < objMax; i++) { szObjDisp[i] = szObjName[i]; rgobjList[i] = i; @@ -2878,6 +2846,47 @@ void InitProgram() ; if (pch - sz > 4 && FEqSz(pch - 4, ".scr")) wi.fSaverExt = fTrue; + // Ensure _graphicschart enum aligns with rgcmdMode array. + Assert(rgcmdMode[gWheel] == cmdChartList); + Assert(rgcmdMode[gHouse] == cmdChartWheel); + Assert(rgcmdMode[gGrid] == cmdChartGrid); + Assert(rgcmdMode[gMidpoint] == cmdChartMidpoint); + Assert(rgcmdMode[gHorizon] == cmdChartHorizon); + Assert(rgcmdMode[gOrbit] == cmdChartOrbit); + Assert(rgcmdMode[gSector] == cmdChartSector); + Assert(rgcmdMode[gCalendar] == cmdChartCalendar); + Assert(rgcmdMode[gDisposit] == cmdChartInfluence); + Assert(rgcmdMode[gEsoteric] == cmdChartEsoteric); + Assert(rgcmdMode[gAstroGraph] == cmdChartAstroGraph); + Assert(rgcmdMode[gEphemeris] == cmdChartEphemeris); + Assert(rgcmdMode[gRising] == cmdChartRising); + Assert(rgcmdMode[gLocal] == cmdChartLocal); + Assert(rgcmdMode[gTraTraGra] == cmdTransit); + Assert(rgcmdMode[gTraNatGra] == cmdTransit); + Assert(rgcmdMode[gMoons] == cmdChartMoons); + Assert(rgcmdMode[gSphere] == cmdChartSphere); + Assert(rgcmdMode[gWorldMap] == cmdChartMap); + Assert(rgcmdMode[gGlobe] == cmdChartGlobe); + Assert(rgcmdMode[gPolar] == cmdChartPolar); + Assert(rgcmdMode[gTelescope] == cmdChartTelescope); + Assert(rgcmdMode[gBiorhythm] == 0/*cmdRelBiorhythm*/); + Assert(rgcmdMode[gAspect] == cmdChartAspect); + Assert(rgcmdMode[gArabic] == cmdChartArabic); + Assert(rgcmdMode[gTraTraTim] == cmdTransit); + Assert(rgcmdMode[gTraTraInf] == cmdTransit); + Assert(rgcmdMode[gTraNatTim] == cmdTransit); + Assert(rgcmdMode[gTraNatInf] == cmdTransit); + Assert(rgcmdMode[gSign] == cmdHelpSign); + Assert(rgcmdMode[gObject] == cmdHelpObject); + Assert(rgcmdMode[gHelpAsp] == cmdHelpAspect); + Assert(rgcmdMode[gConstel] == cmdHelpConstellation); + Assert(rgcmdMode[gPlanet] == cmdHelpPlanetInfo); + Assert(rgcmdMode[gRay] == cmdHelpRay); + Assert(rgcmdMode[gMeaning] == cmdHelpMeaning); + Assert(rgcmdMode[gSwitch] == cmdHelpSwitch); + Assert(rgcmdMode[gObscure] == cmdHelpObscure); + Assert(rgcmdMode[gKeystroke] == cmdHelpKeystroke); + Assert(rgcmdMode[gCredit] == cmdHelpCredit); #endif } diff --git a/astrolog.def b/astrolog.def index 8a15c6e..82da97c 100644 --- a/astrolog.def +++ b/astrolog.def @@ -1,4 +1,4 @@ -; Astrolog (Version 7.40) File: astrolog.def +; Astrolog (Version 7.50) File: astrolog.def ; ; IMPORTANT NOTICE: Astrolog and all chart display routines and anything ; not enumerated below used in this program are Copyright (C) 1991-2022 by @@ -47,10 +47,10 @@ ; Initial programming 8/28-30/1991. ; X Window graphics initially programmed 10/23-29/1991. ; PostScript graphics initially programmed 11/29-30/1992. -; Last code change made 3/31/2022. +; Last code change made 9/9/2022. NAME ASTROLOG -DESCRIPTION "Astrolog 7.40 for MS Windows - By Walter D. Pullen" +DESCRIPTION "Astrolog 7.50 for MS Windows - By Walter D. Pullen" EXETYPE WINDOWS STUB 'WINSTUB.EXE' CODE PRELOAD MOVEABLE DISCARDABLE diff --git a/astrolog.doc b/astrolog.doc index 042d326..720e7b5 100644 Binary files a/astrolog.doc and b/astrolog.doc differ diff --git a/astrolog.h b/astrolog.h index 16ca117..8eaaaf9 100644 --- a/astrolog.h +++ b/astrolog.h @@ -1,5 +1,5 @@ /* -** Astrolog (Version 7.40) File: astrolog.h +** Astrolog (Version 7.50) File: astrolog.h ** ** IMPORTANT NOTICE: Astrolog and all chart display routines and anything ** not enumerated below used in this program are Copyright (C) 1991-2022 by @@ -48,7 +48,7 @@ ** Initial programming 8/28-30/1991. ** X Window graphics initially programmed 10/23-29/1991. ** PostScript graphics initially programmed 11/29-30/1992. -** Last code change made 3/24/2022. +** Last code change made 9/9/2022. */ /* @@ -225,7 +225,7 @@ #define WHEELROWS 11 // Max no. of objects that can be in a wheel house. #define SCREENWIDTH 80 // Number of columns to print interpretations in. #define MONTHSPACE 3 // Number of spaces between each calendar column. -#define MAXINDAY 200 // Max number of aspects or transits displayable. +#define MAXINDAY 300 // Max number of aspects or transits displayable. #define MAXCROSS 750 // Max number of latitude crossings displayable. #define BIODAYS 14 // Days to include in graphic biorhythms. #define CREDITWIDTH 74 // Number of text columns in the -Hc credit screen. @@ -277,9 +277,9 @@ #define chJS (char)(us.fAnsiChar ? 194 : '-') #define chJW (char)(us.fAnsiChar ? 180 : '|') #define chJE (char)(us.fAnsiChar ? 195 : '|') -#define chDeg0 (char)(us.fAnsiChar ? 248 : ' ') -#define chDeg1 (char)(us.fAnsiChar ? 248 : ':') -#define chDeg3 (char)(us.nCharset == ccIBM ? 248 : chDeg2) +#define chDegS (char)(us.fAnsiChar ? chDegT : ' ') +#define chDegC (char)(us.fAnsiChar ? chDegT : ':') +#define chDegT (char)(us.nCharset <= ccIBM ? chDegI : chDegL) /* @@ -456,9 +456,9 @@ #define fTrue TRUE #define szAppNameCore "Astrolog" -#define szVersionCore "7.40" -#define szVerCore "740" -#define szDateCore "March 2022" +#define szVersionCore "7.50" +#define szVerCore "750" +#define szDateCore "September 2022" #define szAddressCore \ "Astara@msn.com - http://www.astrolog.org/astrolog.htm" #define szNowCore "now" @@ -517,39 +517,42 @@ #define rInvalid (1.23456789E-09) #define rRound 0.5 -#define chNull '\0' -#define chEscape '\33' // 27 -#define chBell '\7' -#define chReturn '\r' -#define chTab '\t' -#define chDelete '\b' -#define chBreak '\3' -#define chDeg2 '\260' // 176 -#define chRet 'R' -#define chRet2 'r' -#define chSep ',' -#define chSep2 ';' +// Character constants + +#define chNull '\0' +#define chEscape '\33' // 27 +#define chBell '\7' +#define chReturn '\r' +#define chTab '\t' +#define chDelete '\b' +#define chBreak '\3' +#define chDegL '\260' // 176 (Latin-1) +#define chDegI '\370' // 248 (IBM) +#define chRet 'R' +#define chRet2 'r' +#define chSep ',' +#define chSep2 ';' // Array index limits -#define objMax (cObj+1) -#define objMaxG (objMax+10) -#define cCnstl 88 -#define cZone 72 -#define cSector 36 -#define cPart 177 -#define cWeek 7 -#define cColor 16 -#define cRainbow 7 -#define cRay 7 -#define cRing 6 -#define xFont 6 -#define yFont 10 -#define xFont2 (xFont >> 1) -#define yFont2 (yFont >> 1) -#define xFontT (xFont2 * gi.nScaleTextT2) -#define yFontT (yFont2 * gi.nScaleTextT2) -#define xSideT (SIDESIZE * gi.nScaleTextT2 >> 1) +#define objMax (cObj+1) +#define objMaxG (objMax+10) +#define cCnstl 88 +#define cZone 72 +#define cSector 36 +#define cPart 177 +#define cWeek 7 +#define cColor 16 +#define cRainbow 7 +#define cRay 7 +#define cRing 6 +#define xFont 6 +#define yFont 10 +#define xFont2 (xFont >> 1) +#define yFont2 (yFont >> 1) +#define xFontT (xFont2 * gi.nScaleTextT2) +#define yFontT (yFont2 * gi.nScaleTextT2) +#define xSideT (SIDESIZE * gi.nScaleTextT2 >> 1) // Atlas values @@ -702,6 +705,8 @@ enum _objects { // Aspects enum _aspects { + aDis = -8, // Distances equal + aNod = -7, // Latitude zero/node crossing aLen = -6, // Direction change (distance) aAlt = -5, // Direction change (latitude) aHou = -4, // 3D House change @@ -883,34 +888,50 @@ enum _rulerships { rrMax = 5, }; +// Decan (or other) division types + +enum _decandivisiontype { + ddNone = 0, // No division + ddDecanR = 1, // Decan/Face (ruler) + ddDecanS = 2, // Decan/Face (sign) + ddChaldea = 3, // Chaldean Decan + ddEgypt = 4, // Egyptian Terms/Bounds + ddPtolemy = 5, // Ptolemaic Terms/Bounds + ddNavamsa = 6, // Navamsa division + dd12 = 7, // 12th harmonic + ddDwad = 8, // Dwad + dd27 = 9, // 27 Nakshatras + ddMax = 10, +}; + // Graphics chart modes enum _graphicschart { gWheel = 1, gHouse = 2, gGrid = 3, - gHorizon = 4, - gOrbit = 5, - gSector = 6, - gCalendar = 7, - gDisposit = 8, - gEsoteric = 9, - gAstroGraph = 10, - gEphemeris = 11, - gRising = 12, - gLocal = 13, - gTraTraGra = 14, - gTraNatGra = 15, - gMoons = 16, - gSphere = 17, - gWorldMap = 18, - gGlobe = 19, - gPolar = 20, - gTelescope = 21, - gBiorhythm = 22, + gMidpoint = 4, + gHorizon = 5, + gOrbit = 6, + gSector = 7, + gCalendar = 8, + gDisposit = 9, + gEsoteric = 10, + gAstroGraph = 11, + gEphemeris = 12, + gRising = 13, + gLocal = 14, + gTraTraGra = 15, + gTraNatGra = 16, + gMoons = 17, + gSphere = 18, + gWorldMap = 19, + gGlobe = 20, + gPolar = 21, + gTelescope = 22, + gBiorhythm = 23, #ifdef WIN - gAspect = 23, - gMidpoint = 24, + gAspect = 24, gArabic = 25, gTraTraTim = 26, gTraTraInf = 27, @@ -1002,16 +1023,17 @@ enum _parsemode { pmZon = 6, // Time zone pmLon = 7, // Longitude pmLat = 8, // Latitude - pmDist = 9, // Distance (in km or miles) - pmElv = 10, // Elevation above sea level (in m or feet) - pmLength = 11, // Length (in cm or inches) - pmObject = 12, // Planet or other object - pmAspect = 13, // Aspect - pmSystem = 14, // House system - pmSign = 15, // Sign of the zodiac - pmColor = 16, // Color index - pmRGB = 17, // RGB color value - pmWeek = 18, // Day of week + pmElv = 9, // Elevation above sea level (in m or feet) + pmTmp = 10, // Temperature of location (in C or F) + pmDist = 11, // Distance (in km or miles) + pmLength = 12, // Length (in cm or inches) + pmObject = 13, // Planet or other object + pmAspect = 14, // Aspect + pmSystem = 15, // House system + pmSign = 16, // Sign of the zodiac + pmColor = 17, // Color index + pmRGB = 18, // RGB color value + pmWeek = 19, // Day of week }; // File types @@ -1195,6 +1217,7 @@ enum _terminationcode { #define FValidOffset(r) FBetween(r, -rDegMax, rDegMax) #define FValidCenter(obj) (FBetween(obj, oEar, cObj) && FThing(obj)) #define FValidHarmonic(r) FBetween(r, -10000000.0, 10000000.0) +#define FValidDecan(n) FBetween(n, 0, ddMax-1) #define FValidWheel(n) FBetween(n, 0, WHEELROWS) #define FValidAstrograph(n) ((n) > 0 && (n) < 90) #define FValidAstrograph2(n) FBetween(n, 0, 40000) @@ -1214,7 +1237,7 @@ enum _terminationcode { #define FValidScaleText(n) (FBetween(n, 100, MAXSCALE) && (n)%50 == 0) #define FValidBackPct(r) FBetween(r, 0.0, 100.0) #define FValidBackOrient(n) FBetween(n, -1, 1) -#define FValidZoom(r) (FBetween(r, 0.0001, rDegHalf) || (r) == 0.0) +#define FValidZoom(r) (FBetween(r, 0.0001, rDegMax) || (r) == 0.0) #define FValidGraphX(x) (FBetween(x, BITMAPX1, BITMAPX) || (x) == 0) #define FValidGraphY(y) (FBetween(y, BITMAPY1, BITMAPY) || (y) == 0) #define FValidRotation(n) FBetween(n, 0, rDegMax-rSmall) @@ -1231,7 +1254,7 @@ enum _terminationcode { #define DM(d, m) ((d) + (m)/60.0) #define DMS(d, m, s) (DM(d, m) + (s)/3600.0) #define ZD(z, d) ((real)(((z)-1)*30) + (d)) -#define ZDMS(z, d, m, s) ((real)(((z)-1)*30) + DMS(d, m, s)) +#define ZDMS(z, d, m, s) ZD(z, DMS(d, m, s)) #define HM(h, m) ((h) + (m)/60.0) #define HMS(h, m, s) (HM(h, m) + (s)/3600.0) @@ -1256,7 +1279,6 @@ enum _terminationcode { #define PrintL() PrintCh('\n') #define PrintL2() PrintSz("\n\n") #define PrintF(sz) fprintf(file, "%s", sz) -#define PrintFSz() PrintF(sz) #define SwapN(n1, n2) (n1)^=(n2)^=(n1)^=(n2) #define FSwitchF(f) ((((f) || fOr) && !fAnd) != fNot) #define FSwitchF2(f) (((f) || (fOr || fNot)) && !fAnd) @@ -1318,14 +1340,16 @@ enum _terminationcode { ((int)(RSqr((real)(Sq(180*nScl) - 4*Sq((y)*nScl))) + rRound)) // Do settings indicate the current chart should have the info sidebar? -#define fSidebar ((gi.nMode == gWheel || gi.nMode == gHouse || \ +#define fSidebar \ + ((gi.nMode == gWheel || gi.nMode == gHouse || gi.nMode == gMidpoint || \ gi.nMode == gSector || gi.nMode == gSphere) && gs.fText && !us.fVelocity) // Is the current chart most properly displayed as a square graphic? #define fSquare \ (gi.nMode == gWheel || gi.nMode == gHouse || gi.nMode == gGrid || \ - (gi.nMode == gHorizon && us.fPrimeVert) || gi.nMode == gDisposit || \ - gi.nMode == gOrbit || gi.nMode == gSector || gi.nMode == gMoons || \ + gi.nMode == gMidpoint || (gi.nMode == gHorizon && us.fPrimeVert) || \ + gi.nMode == gDisposit || gi.nMode == gOrbit || gi.nMode == gSector || \ + gi.nMode == gMoons || \ gi.nMode == gSphere || gi.nMode == gGlobe || gi.nMode == gPolar) // Does the current chart have to be displayed in a map rectangle? @@ -1344,8 +1368,8 @@ enum _terminationcode { (gi.nMode != gCalendar || (gs.fLabelAsp && us.nRel < rcNone)) && \ !((gi.nMode == gWorldMap || gi.nMode == gGlobe || gi.nMode == gPolar) && \ (gs.fAlt || gs.fConstel)) && \ - !((gi.nMode == gWheel || gi.nMode == gHouse || gi.nMode == gSector || \ - gi.nMode == gSphere) && !us.fVelocity)) + !((gi.nMode == gWheel || gi.nMode == gHouse || gi.nMode == gMidpoint || \ + gi.nMode == gSector || gi.nMode == gSphere) && !us.fVelocity)) #endif // GRAPH @@ -1433,18 +1457,18 @@ typedef struct _InDayInfo { real time; // Time of event in hours real pos1; // Zodiac position of first planet real pos2; // Zodiac position of second planet - char ret1; // Sign of first planet's velocity - char ret2; // Sign of second planet's velocity + real ret1; // First planet's zodiac position velocity + real ret2; // Second planet's zodiac position velocity } InDayInfo; typedef struct _TransInfo { short source; // Transiting planet short aspect; // The aspect transiting planet makes to natal planet - short dest; // Natal planet - short isret; // Sign of transiting planet's velocity + int dest; // Natal planet real time; // Time of transit in minutes real posT; // Zodiac position of transiting planet real posN; // Zodiac position of natal planet + real retT; // Transiting planet's zodiac position velocity } TransInfo; typedef struct _AtlasEntry { @@ -1590,7 +1614,7 @@ typedef struct _UserSettings { flag fUranian; // -u flag fDwarf; // -u0 flag fMoons; // -u8 - flag fCOB; // -uc + flag fCOB; // -ub flag fProgress; // Are we doing a -p progressed chart? flag fInterpret; // Is -I interpretation switch in effect? flag fHouse3D; // -c3 @@ -1600,7 +1624,7 @@ typedef struct _UserSettings { flag fDecan; // -3 flag fFlip; // -f flag fGeodetic; // -G - flag fVedic; // -J + flag fIndian; // -J flag fNavamsa; // -9 flag fEphemFiles; // -b flag fWriteFile; // -o @@ -1625,6 +1649,7 @@ typedef struct _UserSettings { // Obscure flags flag fTruePos; // -YT flag fTopoPos; // -YV + flag fRefract; // -Yf flag fBarycenter; // -Yh flag fMoonMove; // -Ym flag fSidereal2; // -Ys @@ -1647,6 +1672,8 @@ typedef struct _UserSettings { flag fIgnoreDir; // -YR0 flag fIgnoreDiralt; // -YR1 flag fIgnoreDirlen; // -YR1 + flag fIgnoreAlt0; // -YR2 + flag fIgnoreDisequ; // -YR2 flag fIgnoreAuto; // -YRh flag fStarsList; // -YRU0 flag fStarMagDist; // -YUb @@ -1655,11 +1682,13 @@ typedef struct _UserSettings { flag fNoRead; // -0i flag fNoQuit; // -0q flag fNoGraphics; // -0X + flag fNoPlacalc; // -0b flag fNoNetwork; // -0n flag fNoExp; // -0~ flag fExpOff; // -~0 // Value settings + int nDecanType; // -v3 int nAspectSort; // -a int nEphemYears; // -Ey int nEphemRate; // -E0 @@ -1687,6 +1716,7 @@ typedef struct _UserSettings { real lonDef; // -zl real latDef; // -zl real elvDef; // -zv + real tmpDef; // -zf char *namDef; // -zj char *locDef; // -zj char *rgszPath[10]; // -Yi @@ -1876,6 +1906,8 @@ typedef struct _GraphicsSettings { flag fKeepSquare; // Are we preserving chart aspect ratio (-XQ set). flag fAnimMap; // Are we animating map instead of time (-XN set). flag fThick; // Are we drawing thicker lines in charts (-Xx set). + flag fIndianWheel; // Are wheel charts North/South Indian (-XJ set). + flag fMoonWheel; // Are moons drawn around planets in wheels (-X8 set). int xWin; // Current hor. size of graphic chart (-Xw). int yWin; // Current ver. size of graphic chart (-Xw). int nAnim; // Current animation mode jump rate (-Xn). @@ -1961,6 +1993,10 @@ typedef struct _GraphicsInternal { ES *rges; // List of extra star coordinates (-YXU). int cStarsLin; // Count of extra star coordinates (-YXU). #endif +#ifdef ISG + int xWinResize; // Manually resized hor. size of graphic chart + int yWinResize; // Manually resized ver. size of graphic chart +#endif #ifdef X11 Display *disp; // The opened X11 display (-Xd). GC gc, pmgc; @@ -2075,6 +2111,7 @@ typedef struct _WindowInternal { int cmdCur; // Menu command for current chart type. flag fMenu; // Do we need to repaint the menu bar? flag fMenuAll; // Do we need to redetermine all menu checks? + flag fNotManual; // Is window being resized automatically? flag fRedraw; // Do we need to redraw the screen? flag fCast; // Do we need to recast the chart positions? flag fAbort; // Did the user cancel printing in progress? @@ -2119,6 +2156,7 @@ typedef struct _WindowInternal { HBITMAP hbmpPrev; // Bitmap to restore after using background. short xClient; // Horizontal & vertical window size. short yClient; + flag fNotManual; // Is window being resized automatically? flag fDoRedraw; flag fDoResize; flag fDoCast; diff --git a/astrolog.htm b/astrolog.htm index bc8c74b..addab2d 100644 --- a/astrolog.htm +++ b/astrolog.htm @@ -2,7 +2,7 @@
-