projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b926e47
)
added printing tape date when dumping tape
author
Holger Schemel
<holger.schemel@virtion.de>
Tue, 5 Oct 2021 14:00:06 +0000
(16:00 +0200)
committer
Holger Schemel
<holger.schemel@virtion.de>
Tue, 5 Oct 2021 14:00:21 +0000
(16:00 +0200)
src/files.c
patch
|
blob
|
history
diff --git
a/src/files.c
b/src/files.c
index afccc4a6a295f795d24171be61cf6ad705246e5d..fab3df37653d139a61b68d0b52aa39e09c306e5a 100644
(file)
--- a/
src/files.c
+++ b/
src/files.c
@@
-8476,8
+8476,17
@@
void DumpTape(struct TapeInfo *tape)
Print("[tas_keys]");
if (tape->property_bits & TAPE_PROPERTY_SMALL_GRAPHICS)
Print("[small_graphics]");
Print("[tas_keys]");
if (tape->property_bits & TAPE_PROPERTY_SMALL_GRAPHICS)
Print("[small_graphics]");
-
Print("\n");
Print("\n");
+
+ int year2 = tape->date / 10000;
+ int year4 = (year2 < 70 ? 2000 + year2 : 1900 + year2);
+ int month_index_raw = (tape->date / 100) % 100;
+ int month_index = month_index_raw % 12; // prevent invalid index
+ int month = month_index + 1;
+ int day = tape->date % 100;
+
+ Print("Tape date: %04d-%02d-%02d\n", year4, month, day);
+
PrintLine("-", 79);
tape_frame_counter = 0;
PrintLine("-", 79);
tape_frame_counter = 0;