#define _PRINT_H
void print_the_buffer();
+void print_header();
void log_file(const char *s);
#ifdef _IS_PRINT
char print_buffer[81];
-char log_num = 0;
+unsigned char log_num = 0;
int log_lines_written = 0;
#else
extern char print_buffer[81];
-extern int log_num;
+extern unsigned char log_num;
extern int log_lines_written;
#endif
if (log_num > 0) {
log_num--;
- sprintf(filename, "log-%d", log_num);
+ sprintf(filename, "log-%u", log_num);
if ((c = cbm_open(lfn, (BYTE)8, (BYTE)CBM_READ, filename)) != 0) {
c128_perror(c, "cbm_open(log) for reading");
exit(1);
cprintf("Einnahme %ld konnte nicht umgerechnet werden\r\n", money);
exit(1);
}
- cprintf("C128-Kassenprogramm (phil_fry, sECuRE, sur5r) v:" GV "\r\
+ cprintf("C128-Kassenprogramm (phil_fry, sECuRE, sur5r) " GV "\r\
\r\nUhrzeit: %s (wird nicht aktualisiert)\r\
Eingenommen: %s, Verkauft: %ld Dinge, Drucken: %s\r\n\r\n",
time, profit, items_sold, (printing == 1 ? "ein" : "aus"));
exit(1);
}
- sprintf(print_buffer, "%c[%lu] %s - %-" xstr(MAX_ITEM_NAME_LENGTH) "s - %s - r %s - %d - an %s\r", 17,
+ sprintf(print_buffer, "%c[%3lu] %s - %-" xstr(MAX_ITEM_NAME_LENGTH) "s - %s - r %s - %d - an %s\r", 17,
items_sold, time, name, price, rest,
einheiten, (*nickname != '\0' ? nickname : "Unbekannt"));
print_the_buffer();
int main() {
char *c;
+ char *time;
if (VIDEOMODE == 40)
toggle_videomode();
/* Load configuration */
load_config();
- cprintf("got %d logfiles\r\n", log_num);
/* Load items (= drinks) */
load_items();
/* Load credits */
load_credits();
+
+ time = get_time();
+ sprintf(print_buffer, "%c-----------------------------------------------------------------\r", 17);
+ print_the_buffer();
+ sprintf(print_buffer, "%cC128-Kasse Version " GV "\r", 17);
+ print_the_buffer();
+
+ sprintf(print_buffer, "%cKasse gestartet um %s. Nutze logfile log-%u, zeile %d.\r", 17, time, log_num, log_lines_written);
+ print_the_buffer();
+
+ print_header();
+
while (1) {
print_screen();
c = get_input();
log_file(print_buffer);
}
+void print_header() {
+ sprintf(print_buffer, "%c-----------------------------------------------------------------\r", 17);
+ print_the_buffer();
+
+ sprintf(print_buffer, "%c#kauf Uhrzeit - Ding - Preis - Restguthab - # - Nickname\r", 17);
+ print_the_buffer();
+
+ sprintf(print_buffer, "%c-----------------------------------------------------------------\r", 17);
+ print_the_buffer();
+
+}
+
void log_file(const char *s) {
/* A log-entry has usually 50 bytes, so we take 64 bytes.
Because files are wrapped (log.0, log.1, ...) every 100