mirror of https://github.com/Kris-Sekula/NABU.git
Files used with EPROM Emulator
This commit is contained in:
parent
6a2eec95c0
commit
379f227105
Binary file not shown.
|
@ -0,0 +1,52 @@
|
|||
/* Based on https://github.com/TheCodeman/Nabu_PC */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if( argc == 2 ) {
|
||||
printf("Patching file %s\n", argv[1]);
|
||||
}
|
||||
else {
|
||||
printf("Filename expected...\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
FILE *fp;
|
||||
uint16_t check=0;
|
||||
uint16_t index=0;
|
||||
uint8_t c=0;
|
||||
uint16_t sz;
|
||||
|
||||
fp=fopen(argv[1],"rb+");
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
sz = ftell(fp);
|
||||
rewind(fp);
|
||||
|
||||
if(sz < 4097) {
|
||||
sz = 4096;
|
||||
}
|
||||
else {
|
||||
sz = 8192;
|
||||
}
|
||||
|
||||
printf("Filesize is %u \n\r",sz);
|
||||
|
||||
if(fp!=NULL) {
|
||||
printf("starting\n\r");
|
||||
for(index=0;index<(sz-2);index++){
|
||||
fread(&c, 1,1, fp);
|
||||
check+=c;
|
||||
}
|
||||
printf("Checksum value: %04x\n\r",check);
|
||||
printf("Index value: %04x\n\r",index);
|
||||
}
|
||||
fseek(fp, ftell(fp), SEEK_SET);
|
||||
c=check&0x00ff;
|
||||
fwrite(&c, 1, 1, fp);
|
||||
c=(check>>8);
|
||||
fwrite(&c, 1, 1, fp);
|
||||
fclose(fp);
|
||||
printf("File %s patched\n", argv[1]);
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
printf "Compiling...."
|
||||
z80asm --list=nabu_4k_new.lst nabu_4k.asm -o nabu_4k_new.bin
|
||||
read -p "Press enter to patch checksum"
|
||||
./check nabu_4k_new.bin
|
||||
read -p "Press enter to upload"
|
||||
python3 EPROM_NG_v2.0rc3.py -mem 2732 -spi y -auto n -map y nabu_4k_new.bin /dev/ttyUSB0
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
Reference in New Issue