# CL=cl65
src/%.o: src/%.c include/%.h
- ${CC} -I include -t c128 $<
+ ${CC} -O -I include -t c128 $<
${CA} -I include -t c128 src/$$(basename $< .c).s
-all: src/config.o src/kasse.o src/general.o src/credit_manager.o src/time.o
+test/%.o: test/%.c
+ ${CC} -O -I include -t c128 $<
+ ${CA} -I include -t c128 test/$$(basename $< .c).s
+
+all: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o
# See above, please just kill the PATH-definition
cp /tmp/cc65/lib/c128* .
- PATH=${PATH}:~/customSoftware/cc65-2.11.0/src/ld65:/tmp/cc65/lib ${CL} -t c128 -O src/*.o -o kasse
+ PATH=${PATH}:~/customSoftware/cc65-2.11.0/src/ld65:/tmp/cc65/lib ${CL} -t c128 src/*.o -o kasse
package: all
c1541 -attach kasse.d64 -delete state || exit 0
c1541 -attach kasse.d64 -write state || exit 0
c1541 -attach kasse.d64 -write items || exit 0
-test: config.o test.o general.o
- ${CL} -t c128 config.o test.o general.o -o test
+test: src/config.o test/test.o src/general.o
+ ${CL} -t c128 src/config.o test/test.o src/general.o -o test
test-package: test
c1541 -attach test.d64 -delete state || exit 0
c1541 -attach test.d64 -write items || exit 0
clean:
- rm -rf src/*.o src/*.s
+ rm -rf src/*.o src/*.s test/*.o test/*.s
dist-clean: clean
rm kasse test
--- /dev/null
+#ifndef TIME_H_
+#define TIME_H_
+void set_time();
+char *get_time();
+#endif
+++ /dev/null
-#ifndef TIME_H_
-#define TIME_H_
-void set_time();
-char *get_time();
-#endif
--- /dev/null
+#include <peekpoke.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "general.h"
+
+char *get_time() {
+ long int h = PEEK(0x00A0) * 65536,
+ m = PEEK(0x00A1) * 256,
+ s = PEEK(0x00A2);
+ static char buffer[9];
+ BYTE hrs, min;
+ h = (h + m + s) / 60;
+ hrs = (h / 3600);
+ h -= (hrs * 3600);
+ min = (h / 60);
+ h -= (min * 60);
+ sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h);
+ return buffer;
+}
+
+void set_time(BYTE hrs, min, sec) {
+ long int added = ((long int)sec + ((long int)min * (long int)60) + ((long int)hrs * (long int)3600)) * (long int)60;
+ POKE(0x00A0, (BYTE)(added / 65536));
+ POKE(0x00A1, (BYTE)(added / 256));
+ POKE(0x00A2, (BYTE)added);
+}
#include "config.h"
#include "kasse.h"
#include "credit_manager.h"
-#include "time.h"
+#include "c128time.h"
// drucker 4 oder 5
// graphic 4,0,10
+++ /dev/null
-#include <peekpoke.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "general.h"
-
-char *get_time() {
- long int h = PEEK(0x00A0) * 65536,
- m = PEEK(0x00A1) * 256,
- s = PEEK(0x00A2);
- static char buffer[9];
- BYTE hrs, min;
- h = (h + m + s) / 60;
- hrs = (h / 3600);
- h -= (hrs * 3600);
- min = (h / 60);
- h -= (min * 60);
- sprintf(buffer, "%02d:%02d:%02d", hrs, min, (int)h);
- return buffer;
-}
-
-void set_time(BYTE hrs, min, sec) {
- long int added = ((long int)sec + ((long int)min * (long int)60) + ((long int)hrs * (long int)3600)) * (long int)60;
- POKE(0x00A0, (BYTE)(added / 65536));
- POKE(0x00A1, (BYTE)(added / 256));
- POKE(0x00A2, (BYTE)added);
-}
char euro[10];
load_items();
load_state();
- for (i=0; i < num_items; ++i) {
- 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;
+ for (i=0; i < status.num_items; ++i) {
+ cprintf("%x: %s (%s, %d mal)\n",
+ i, status.status[i].item_name, format_euro(euro, 9, status.status[i].price),
+ status.status[i].times_sold);
+ status.status[i].times_sold += 10;
}
save_state();
load_items();
load_state();
- for (i=0; i < num_items; ++i) {
- cprintf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold);
+ for (i=0; i < status.num_items; ++i) {
+ cprintf("%x: %s (%s, %d mal)\n",
+ i, status.status[i].item_name, format_euro(euro, 9, status.status[i].price),
+ status.status[i].times_sold);
}
- 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');
+ cprintf("strlen(%s)==%d\n", status.status[1].item_name, strlen(status.status[1].item_name));
+ cprintf("%d %d %d\n", status.status[1].item_name[0], '\r', '\n');
}