From b759df66c0d98a4c5839b386ec352577a223f998 Mon Sep 17 00:00:00 2001 From: sur5r Date: Sat, 20 Oct 2007 13:08:11 +0000 Subject: [PATCH] replace printf and file functions, warning: may be broken, not tested yet git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@44 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- config.c | 67 +++++++++++++++++++++++++++++++++++------------------- general.c | 2 +- items | 4 +++- kasse.c | 1 + kasse.d64 | Bin 174848 -> 174848 bytes state | 4 +++- test.c | 10 ++++---- time.c | 2 +- 8 files changed, 58 insertions(+), 32 deletions(-) diff --git a/config.c b/config.c index 9fc1fee..f173947 100644 --- a/config.c +++ b/config.c @@ -1,6 +1,7 @@ #include -#include +#include #include +#include #include "general.h" #include "config.h" @@ -15,37 +16,48 @@ struct credits_t credits[MAX_CREDIT_ITEMS+1]; void load_config(); void load_items(){ - FILE* f; char line[80]; - char * sep; - BYTE lfn = 219; -// cbm_open(lfn, (BYTE)8, (BYTE)0, "items,r"); - f = fopen("items","r"); - for (num_items=0; num_items < MAX_ITEMS && !feof(f); num_items++) { - fgets(line, 79, f); + char *sep; + BYTE lfn = 8; + BYTE rc; + int count=1; + + rc=cbm_open(lfn, (BYTE)8, (BYTE)0, "items,r"); + if(rc!=0) + { + cprintf("cannot open items\r\n"); + return; + } + for (num_items=0; num_items < MAX_ITEMS && count>0; num_items++) { + count=cbm_read(lfn, line, 79); + //fgets(line, 79, f); sep = strchr(line, '='); strncpy(status[num_items].item_name, line, sep-line); status[num_items].price = atoi(sep+1); status[num_items].times_sold = 0; } - fclose(f); + cbm_close(lfn); } /** * must be called after load_items() */ void load_state(){ - FILE * f; char line[80]; char * sep; - char i, j; - f = fopen("state", "r"); - if (f==NULL){ + char i; + BYTE lfn=8; + BYTE rc; + int count=1; + + rc=cbm_open(lfn, (BYTE)8, (BYTE)0, "state,r"); + if (rc!=0){ cprintf("cannot open state\r\n"); return; } - while (!feof(f)) { - fgets(line, 79, f); + while (count>0) { + count=cbm_read(lfn,line,79); + //fgets(line, 79, f); sep = strchr(line, '='); if (sep==NULL) continue; @@ -57,21 +69,30 @@ void load_state(){ } } } - fclose(f); + cbm_close(lfn); } void save_state(){ - FILE * f; int i; + BYTE lfn=8; + BYTE rc; + int count=1; + int size=1; + char line[81]; - f = fopen("state", "w"); - if (f==NULL){ + rc=cbm_open(lfn, (BYTE)8, (BYTE)0, "state,w"); + if (rc!=0){ c128_perror(23, "cannot open state file"); return; } for (i=0;imaxlen) return NULL; -// sprintf(s, "%d,%dEUR", cent/100, cent%100); + sprintf(s, "%d,%dEUR", cent/100, cent%100); return s; } diff --git a/items b/items index 102a472..fb6548a 100644 --- a/items +++ b/items @@ -1 +1,3 @@ -Mate=100 Bier=120 Cola=100 \ No newline at end of file +mate=100 +bier=120 +cola=100 diff --git a/kasse.c b/kasse.c index 7eb8df9..de72138 100644 --- a/kasse.c +++ b/kasse.c @@ -154,6 +154,7 @@ void set_time_interactive() { int main() { BYTE c; + toggle_videomode(); /* Zeit erstmalig setzen */ set_time_interactive(); POKE(216, 255); diff --git a/kasse.d64 b/kasse.d64 index a5928860c6c0bc97711e739258148db95d1e4cd8..b2796296e9a3903e75188f9b4ab694cda6b1dd5f 100644 GIT binary patch literal 174848 zcmeI4d30RGmH%IFT6*u646?zvY%F8p1$hA*8-Zo1r51jc^rR;YoIsjIMkY83Igkkx z5**^zPor@w(quCvWO{ns8b2Lmq?2S4k|8*NO}ByY0wIKuOgsq|X73DyB_!$J_txuf zNk%!pIlsdn^PArl)>~@5^{IPr)vGF@DEz|&m;e)C0!)AjFaajO1egF5U;<2l2`~XB zzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l2`~XB zzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l2`~XB zzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C0!)AjFaajO1egF5U;<2l2`~XB zzyz286JP>NfC(@GCcp%k025#WO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aajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C z0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%k025#WOn?b60Vco%m;e)C s0!)AjFaajO1egF5U;<2l2`~XBzyz286JP>NfC(@GCcp%kz(NH64_{>QO8@`> diff --git a/state b/state index 3b46f9f..1b33b2d 100644 --- a/state +++ b/state @@ -1 +1,3 @@ -Mate=23 Bier=42 Cola=23 \ No newline at end of file +mate=23 +bier=42 +cola=23 diff --git a/test.c b/test.c index 1df0f3d..ea603ed 100644 --- a/test.c +++ b/test.c @@ -14,7 +14,7 @@ int main(){ load_items(); load_state(); for (i=0; i < num_items; ++i) { - printf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); + cprintf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); status[i].times_sold+=10; } @@ -22,9 +22,9 @@ int main(){ load_items(); load_state(); for (i=0; i < num_items; ++i) { - printf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); + cprintf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); } - printf("strlen(%s)==%d\n", status[1].item_name, strlen(status[1].item_name)); - printf("%d %d %d\n", status[1].item_name[0], '\r', '\n'); -} \ No newline at end of file + cprintf("strlen(%s)==%d\n", status[1].item_name, strlen(status[1].item_name)); + cprintf("%d %d %d\n", status[1].item_name[0], '\r', '\n'); +} diff --git a/time.c b/time.c index 276380b..4552fe0 100644 --- a/time.c +++ b/time.c @@ -18,7 +18,7 @@ char *get_time() { h -= (hrs * 3600); min = (h / 60); h -= (min * 60); -// sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h); + sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h); return buffer; } -- 2.39.5