aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-04-10 16:38:58 -0400
committerB. Watson <yalhcru@gmail.com>2021-04-10 16:38:58 -0400
commit4aaf0add1cd84215a5e96ca80a6ee85ff4f4e2e7 (patch)
tree61e7a94e2d208f035c3ca9e8b73b3105e0594f99
parentf93fbbad801c9935895aae91222a3d86b962a471 (diff)
downloadtaipan-4aaf0add1cd84215a5e96ca80a6ee85ff4f4e2e7.tar.gz
Save 10 bytes, port_stats() timing
-rw-r--r--taipan.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/taipan.c b/taipan.c
index a52bf8a..1765399 100644
--- a/taipan.c
+++ b/taipan.c
@@ -45,6 +45,9 @@
/* define this to test the cprintfancy_big() routine */
// #define BIGNUM_TEST
+/* define this to show frames/scanlines timing for port_stats() */
+// #define PORT_STAT_TIMER
+
/**** atari-specific stuff */
/* values returned by cgetc() for backspace/enter/delete keys */
@@ -1675,9 +1678,14 @@ unsigned int warehouse_in_use() {
void port_stats(void) {
- int i, in_use, status = get_ship_status();
+ unsigned char i;
+ int in_use, status = get_ship_status();
+#ifdef PORT_STAT_TIMER
+ int startframe, startline, endframe, endline;
+#endif
if(port_stat_dirty) {
+ /* this stuff takes approx 1 jiffy */
bank_dirty = 1;
/* all the static text that used to be in port_stats() has
@@ -1698,15 +1706,23 @@ void port_stats(void) {
}
/* dynamic stuff: */
+#ifdef PORT_STAT_TIMER
+ startframe = PEEK(20);
+ startline = PEEK(54283U);
+#endif
+
+
+ /* approx 73 VCOUNTs */
gotoxy(21, 4);
in_use = warehouse_in_use();
cprintuint(in_use);
cblankto(26);
-
gotoxy(21, 6);
cprintuint(10000 - in_use);
cblankto(26);
+
+ /* approx 1 jiffy */
for(i = 0; i < 4; ++i) {
gotoxy(12, i + 3);
cprintuint(hkw_[i]);
@@ -1768,6 +1784,23 @@ void port_stats(void) {
clrtoeol();
bank_dirty = 0;
}
+
+#ifdef PORT_STAT_TIMER
+ endframe = PEEK(20);
+ endline = PEEK(54283U);
+#endif
+
+#ifdef PORT_STAT_TIMER
+ gotoxy(0, 15);
+ cprintuint(startframe);
+ cprint_pipe();
+ cprintuint(startline);
+ cspace();
+ cprintuint(endframe);
+ cprint_pipe();
+ cprintuint(endline);
+ clrtoeol();
+#endif
}
void mchenry(void) {