mockingboard: lz4d allow setting filename

This commit is contained in:
Vince Weaver 2018-02-15 00:43:58 -05:00
parent 2e7e4ed267
commit c20f290275

View File

@ -95,9 +95,14 @@ int main(int argc, char **argv) {
init_6502(); init_6502();
fff=fopen("../mockingboard/outi.raw.lz4","r"); if (argc<2) {
fprintf(stderr,"\nUsage: %s filename\n\n",argv[0]);
}
// fff=fopen("../mockingboard/outi.raw.lz4","r");
fff=fopen(argv[1],"r");
if (fff==NULL) { if (fff==NULL) {
fprintf(stderr,"Error opening!\n"); fprintf(stderr,"Error opening %s!\n",argv[1]);
return -1; return -1;
} }
@ -208,8 +213,8 @@ copy_skip:
pha(); // pha pha(); // pha
a=ram[src]; // lda src a=ram[src]; // lda src
pha(); // pha pha(); // pha
printf("SAVED SRC: %02X%02X\n",ram[src+1],ram[src]); // printf("SAVED SRC: %02X%02X\n",ram[src+1],ram[src]);
printf("CALCULATING: DST %02X%02X - DELTA %02X%02X\n",ram[dst+1],ram[dst],ram[delta+1],ram[delta]); // printf("CALCULATING: DST %02X%02X - DELTA %02X%02X\n",ram[dst+1],ram[dst],ram[delta+1],ram[delta]);
c=1; // sec c=1; // sec
a=ram[dst]; // lda dst a=ram[dst]; // lda dst
sbc(ram[delta]); // sbc delta sbc(ram[delta]); // sbc delta
@ -217,7 +222,7 @@ copy_skip:
a=ram[dst+1]; // lda dst+1 a=ram[dst+1]; // lda dst+1
sbc(ram[delta+1]); // sbc delta+1 sbc(ram[delta+1]); // sbc delta+1
ram[src+1]=a; // sta src+1 ram[src+1]=a; // sta src+1
printf("NEW SRC: %02X:%02X\n",ram[src+1],ram[src]); // printf("NEW SRC: %02X:%02X\n",ram[src+1],ram[src]);
docopy(); // jsr docopy docopy(); // jsr docopy
pla(); // pla pla(); // pla
ram[src]=a; // sta src ram[src]=a; // sta src