JNetHackのソースをいじくったものを置いておくための場所
修訂 | 5ad510a9317ff0b027842d3f7910e8b8db4febe0 (tree) |
---|---|
時間 | 2017-10-11 14:15:36 |
作者 | SHIRAKATA Kentaro <argrath@ub32...> |
Commiter | SHIRAKATA Kentaro |
ifdef-ed official patches
@@ -68,11 +68,18 @@ struct u_achieve { | ||
68 | 68 | }; |
69 | 69 | |
70 | 70 | struct u_realtime { |
71 | +#if 0 /*C360-19*/ | |
72 | + long | |
73 | + realtime; /* actual playing time up until the last restore, seconds */ | |
74 | + time_t restored; /* time the game was started or restored */ | |
75 | + time_t endtime; | |
76 | +#else | |
71 | 77 | long realtime; /* accumulated playing time in seconds */ |
72 | 78 | time_t start_timing; /* time game was started or restored or 'realtime' |
73 | 79 | was last updated (savegamestate for checkpoint) */ |
74 | 80 | time_t finish_time; /* end of 'realtime' interval: time of save or |
75 | 81 | end of game; used for topten/logfile/xlogfile */ |
82 | +#endif | |
76 | 83 | }; |
77 | 84 | |
78 | 85 | /* KMH, conduct -- |
@@ -607,13 +607,24 @@ newgame() | ||
607 | 607 | com_pager(1); |
608 | 608 | } |
609 | 609 | |
610 | +#if 1 /*C360-19*/ | |
610 | 611 | urealtime.realtime = 0L; |
611 | 612 | urealtime.start_timing = getnow(); |
613 | +#endif | |
612 | 614 | #ifdef INSURANCE |
613 | 615 | save_currentstate(); |
614 | 616 | #endif |
615 | 617 | program_state.something_worth_saving++; /* useful data now exists */ |
616 | 618 | |
619 | +#if 0 /*C360-19*/ | |
620 | + urealtime.realtime = 0L; | |
621 | +#if defined(BSD) && !defined(POSIX_TYPES) | |
622 | + (void) time((long *) &urealtime.restored); | |
623 | +#else | |
624 | + (void) time(&urealtime.restored); | |
625 | +#endif | |
626 | + | |
627 | +#endif | |
617 | 628 | /* Success! */ |
618 | 629 | welcome(TRUE); |
619 | 630 | return; |
@@ -1115,8 +1115,13 @@ int how; | ||
1115 | 1115 | /* remember time of death here instead of having bones, rip, and |
1116 | 1116 | topten figure it out separately and possibly getting different |
1117 | 1117 | time or even day if player is slow responding to --More-- */ |
1118 | +#if 0 /*C360-19*/ | |
1119 | + endtime = getnow(); | |
1120 | + urealtime.realtime += (long) (endtime - urealtime.restored); | |
1121 | +#else | |
1118 | 1122 | urealtime.finish_time = endtime = getnow(); |
1119 | 1123 | urealtime.realtime += (long) (endtime - urealtime.start_timing); |
1124 | +#endif | |
1120 | 1125 | |
1121 | 1126 | /* Sometimes you die on the first move. Life's not fair. |
1122 | 1127 | * On those rare occasions you get hosed immediately, go out |
@@ -579,10 +579,20 @@ unsigned int *stuckid, *steedid; | ||
579 | 579 | foo = time_from_yyyymmddhhmmss(timebuf); |
580 | 580 | |
581 | 581 | ReadTimebuf(ubirthday); |
582 | +#if 0 /*C360-19*/ | |
583 | + mread(fd, &urealtime.realtime, sizeof(urealtime.realtime)); | |
584 | + ReadTimebuf(urealtime.restored); | |
585 | +#if defined(BSD) && !defined(POSIX_TYPES) | |
586 | + (void) time((long *) &urealtime.restored); | |
587 | +#else | |
588 | + (void) time(&urealtime.restored); | |
589 | +#endif | |
590 | +#else | |
582 | 591 | mread(fd, &urealtime.realtime, sizeof urealtime.realtime); |
583 | 592 | ReadTimebuf(urealtime.start_timing); /** [not used] **/ |
584 | 593 | /* current time is the time to use for next urealtime.realtime update */ |
585 | 594 | urealtime.start_timing = getnow(); |
595 | +#endif | |
586 | 596 | |
587 | 597 | set_uasmon(); |
588 | 598 | #ifdef CLIPPING |
@@ -309,6 +309,14 @@ register int fd, mode; | ||
309 | 309 | #ifdef SYSFLAGS |
310 | 310 | bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); |
311 | 311 | #endif |
312 | +#if 0 /*C360-19*/ | |
313 | + urealtime.realtime += (long) (getnow() - urealtime.restored); | |
314 | + bwrite(fd, (genericptr_t) &u, sizeof(struct you)); | |
315 | + bwrite(fd, yyyymmddhhmmss(ubirthday), 14); | |
316 | + bwrite(fd, (genericptr_t) &urealtime.realtime, | |
317 | + sizeof(urealtime.realtime)); | |
318 | + bwrite(fd, yyyymmddhhmmss(urealtime.restored), 14); | |
319 | +#else | |
312 | 320 | urealtime.finish_time = getnow(); |
313 | 321 | urealtime.realtime += (long) (urealtime.finish_time |
314 | 322 | - urealtime.start_timing); |
@@ -318,6 +326,7 @@ register int fd, mode; | ||
318 | 326 | bwrite(fd, yyyymmddhhmmss(urealtime.start_timing), 14); /** Why? **/ |
319 | 327 | /* this is the value to use for the next update of urealtime.realtime */ |
320 | 328 | urealtime.start_timing = urealtime.finish_time; |
329 | +#endif | |
321 | 330 | save_killers(fd, mode); |
322 | 331 | |
323 | 332 | /* must come before migrating_objs and migrating_mons are freed */ |
@@ -372,8 +372,13 @@ struct toptenentry *tt; | ||
372 | 372 | Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", XLOG_SEP, |
373 | 373 | encodeconduct(), XLOG_SEP, moves, XLOG_SEP, encodeachieve()); |
374 | 374 | Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP, |
375 | +#if 0 /*C360-19*/ | |
376 | + (long) urealtime.realtime, XLOG_SEP, (long) ubirthday, XLOG_SEP, | |
377 | + (long) urealtime.endtime); | |
378 | +#else | |
375 | 379 | (long) urealtime.realtime, XLOG_SEP, |
376 | 380 | (long) ubirthday, XLOG_SEP, (long) urealtime.finish_time); |
381 | +#endif | |
377 | 382 | Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP, |
378 | 383 | genders[flags.initgend].filecode, XLOG_SEP, |
379 | 384 | aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); |
@@ -558,6 +563,9 @@ time_t when; | ||
558 | 563 | t0->birthdate = yyyymmdd(ubirthday); |
559 | 564 | t0->deathdate = yyyymmdd(when); |
560 | 565 | t0->tt_next = 0; |
566 | +#if 0 /*C360-19*/ | |
567 | + urealtime.endtime = when; | |
568 | +#endif | |
561 | 569 | #ifdef UPDATE_RECORD_IN_PLACE |
562 | 570 | t0->fpos = -1L; |
563 | 571 | #endif |
@@ -94,9 +94,14 @@ mswin_display_splash_window(BOOL show_ver) | ||
94 | 94 | if (show_ver) { |
95 | 95 | /* Show complete version information */ |
96 | 96 | dlb *f; |
97 | + | |
98 | +#if 0 /*W360-1*/ | |
99 | + getversionstring(buf + strsize); | |
100 | + strcat(buf, "\r\n\r\n"); | |
101 | +#else | |
97 | 102 | char verbuf[BUFSZ]; |
98 | 103 | int verstrsize = 0; |
99 | - | |
104 | + | |
100 | 105 | getversionstring(verbuf); |
101 | 106 | verstrsize = strlen(verbuf); |
102 | 107 | if (verstrsize + strlen("\r\n\r\n") + 1 < BUFSZ - 1) |
@@ -110,8 +115,9 @@ mswin_display_splash_window(BOOL show_ver) | ||
110 | 115 | panic("out of memory"); |
111 | 116 | } |
112 | 117 | strcat(buf, verbuf); |
118 | +#endif | |
113 | 119 | strsize = strlen(buf); |
114 | - | |
120 | + | |
115 | 121 | /* Add compile options */ |
116 | 122 | f = dlb_fopen(OPTIONS_USED, RDTMODE); |
117 | 123 | if (f) { |
@@ -16,7 +16,9 @@ | ||
16 | 16 | #include "func_tab.h" /* for extended commands */ |
17 | 17 | #include "winMS.h" |
18 | 18 | #include <assert.h> |
19 | +#if 1 /*W360-1*/ | |
19 | 20 | #include <mmsystem.h> |
21 | +#endif | |
20 | 22 | #include "mhmap.h" |
21 | 23 | #include "mhstatus.h" |
22 | 24 | #include "mhtext.h" |
@@ -1653,8 +1655,10 @@ mswin_getlin(const char *question, char *input) | ||
1653 | 1655 | len--; |
1654 | 1656 | #endif |
1655 | 1657 | input[len] = '\0'; |
1658 | +#if 1 /*W360-1*/ | |
1656 | 1659 | } else if (len>=(BUFSZ-1)) { |
1657 | 1660 | PlaySound((LPCSTR)SND_ALIAS_SYSTEMEXCLAMATION, NULL, SND_ALIAS_ID|SND_ASYNC); |
1661 | +#endif | |
1658 | 1662 | } else { |
1659 | 1663 | input[len++] = c; |
1660 | 1664 | #if 1 /*JP*//*2バイト文字ならその場でもう1バイト読み込む*/ |