From ef40a5616058da07c08a4d4ca2afeffe3208e1ce Mon Sep 17 00:00:00 2001 From: Philip Smart Date: Sat, 30 May 2020 00:11:13 +0100 Subject: [PATCH] Updates for the tranZPUter development --- common/tranzputer.c | 17 +++++------------ libraries/lib/libimath2-k64f.a | Bin 12504 -> 12504 bytes libraries/lib/libumansi-k64f.a | Bin 124218 -> 124218 bytes libraries/lib/libummath-k64f.a | Bin 2660 -> 2660 bytes libraries/lib/libummathf-k64f.a | Bin 63972 -> 63972 bytes libraries/lib/libummisc-k64f.a | Bin 6222 -> 6222 bytes libraries/lib/libumstdio-k64f.a | Bin 80050 -> 80050 bytes 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/common/tranzputer.c b/common/tranzputer.c index b2d996b..b4cdcca 100644 --- a/common/tranzputer.c +++ b/common/tranzputer.c @@ -1429,7 +1429,6 @@ FRESULT loadZ80Memory(const char *src, uint32_t fileOffset, uint32_t addr, uint3 fr0 = f_lseek(&File, f_size(&File)); if(!fr0) size = (uint32_t)f_tell(&File); -printf("Size:%08lx\n", size); } // Seek to the correct location. @@ -1608,7 +1607,7 @@ FRESULT saveZ80Memory(const char *dst, uint32_t addr, uint32_t size, t_svcDirEnt // Try and create the destination file. fr0 = f_open(&File, dst, FA_CREATE_ALWAYS | FA_WRITE); - printf("SAVE:%8lx,%8lx\n",addr,size); + // If no errors in opening the file, proceed with reading and loading into memory. if(!fr0) { @@ -2527,48 +2526,41 @@ uint8_t svcCacheDir(const char *directory, uint8_t force) } } osControl.dirMap.entries = 0; -printf("Opendir\n"); + // Open the directory and extract all files. result = f_opendir(&dirFp, directory); if(result == FR_OK) { -printf("Dir Open\n"); fileNo = 0; do { // Read an SD directory entry then open the returned SD file so that we can to read out the important MZF data for name matching. // result = f_readdir(&dirFp, &fno); -printf("Read entry\n"); + // If an error occurs or we are at the end of the directory listing close the sector and pass back. if(result != FR_OK || fno.fname[0] == 0) break; -printf("Read entry:%s\n", fno.fname); // Check to see if this is a valid MZF file. const char *ext = strrchr(fno.fname, '.'); if(!ext || strcasecmp(++ext, TZSVC_DEFAULT_EXT) != 0) continue; -printf("After continue\n"); // Build filename. // sprintf(fqfn, "0:\\%s\\%s", directory, fno.fname); -printf("After fqfn\n"); // Open the file so we can read out the MZF header which is the information TZFS/CPM needs. // result = f_open(&File, fqfn, FA_OPEN_EXISTING | FA_READ); -printf("After open\n"); // If no error occurred, read in the header. // if(!result) result = f_read(&File, (char *)&dirEnt, TZSVC_CMPHDR_SIZE, &readSize); -printf("After read\n"); // No errors, read the header. if(!result && readSize == TZSVC_CMPHDR_SIZE) { -printf("In alloc\n"); // Close the file, no longer needed. f_close(&File); @@ -2576,7 +2568,7 @@ printf("In alloc\n"); // fixed at 17 characters as you cant reliably rely on terminators and the additional data makes it a constant 32 chars long. osControl.dirMap.file[fileNo] = (t_sharpToSDMap *)malloc(sizeof(t_sharpToSDMap)); osControl.dirMap.file[fileNo]->sdFileName = (uint8_t *)malloc(strlen(fno.fname)+1); -printf("Mem alloc:%08lx, %08lx\n", osControl.dirMap.file[fileNo], osControl.dirMap.file[fileNo]); + if(osControl.dirMap.file[fileNo] == NULL || osControl.dirMap.file[fileNo]->sdFileName == NULL) { printf("Out of memory cacheing directory:%s\n", directory); @@ -2863,6 +2855,7 @@ void processServiceRequest(void) // Erase a file from the SD Card. case TZSVC_CMD_ERASEFILE: status=svcEraseFile(); + refreshCacheDir = 1; break; // Change active directory. Do this immediately to validate the directory name given. diff --git a/libraries/lib/libimath2-k64f.a b/libraries/lib/libimath2-k64f.a index 1382a59fa95e7b2c4a197e9b05950911428eff33..cfaadf873100e116aa8349ebc63f9a1ee068bb77 100644 GIT binary patch delta 61 zcmcbScq4Iw9E-7qk=aD01~5H&ouv52y>t1%oXv6kK3oviI>`neh=MqN@y(uU{agTG Cj}l)1 delta 61 zcmcbScq4Iw9E+i`vFSvm1~5H&ouv52y>t1%oXv6kK3oviI>`neh=MqN@y(uU{agTC C4iY>7 diff --git a/libraries/lib/libumansi-k64f.a b/libraries/lib/libumansi-k64f.a index ae91167dfa6e0d2ad304d76d2606954cb42e6c89..546bda2533648c9235123cc662418772233d752e 100644 GIT binary patch delta 656 zcmYk3ODIHP6vsPeit)$|nS0S(c_k?_ZcVa~CMydHNfxuP(qth^G%FT1Ge%8K3^lVe zi{Z$rNgkzy)FmrTd4$DKvz#n6zI(rW$K9R(cV55$`O-I~>6_A^%kK8{DF-dt5-sRQ z!FKM@qp)BT@w@V}sGN9P4_u)tC(3NBKC=4+5(Yc{<$BMd+fytTabhrIQKKU#hEkIf zwvT-kbMv@5GiByvAA07zWgI5p4+{S<-7Am0YSS%Z)B2n#B-{x$TBdbGjcFK&kMj4p zn&gCGRTjfSzALg&1FmpyvmHG&#B0vVa(bHw6J3=hnp}c){WIx#8D9BN?OQ3c23z`a zCGrvjCvAjayh@v@5Yu%$WJY{6oiuzYw08uvx&h_*6cRj&yez{oWv?K{wRUNW-@}h? Kob^0GwEPc}2g|wu delta 653 zcmYk3O(;ZB6vsP8F~j7A%$uQk@|C2}o5dsxMOGH3kYq8+ipfHjXjUw2W;``DF-^_v zO!+u+O7c-tGLlDDn(`4AC`(yryt(hb@pkur&pE&U|J-|+DLKrPgxtklvh3MycrVHy zWE3o?R(4VZi-@1)>4I|LWew;GRVi7@x+3v=5HZvmurawOdkg&{4)dcB z=An;5Z5o%xM~#}~NAFa>PRC#%B>bmoU%b=1)?^XuR;CQ$#LZBxiPjS3Gz=yN_4|aH z(i1AGBr3vpTV%Ep+)8JCF?wl8chfd@VB*AXBDpV&Tst`@hHueS+shiYV8DTmZ#O)t zW`M%?2H#*Or}7z9^3#hI_-aND(sIld{GIgcf-PepB~rQxdTkc%XOs$yNKyw}mE{$E zb;B!b^F$tF;GnO5u$Jdvit8#Lge%zGcFsj-en2ay%+T{RjOyxIa?!{(KvH83_d&aAkDMd&Vbj_B#ou`RvwD)!-UQ_IEEy1iD=wDdOwGl5kaKH O4g9dBwTXL(+Wr7+7Rl5A diff --git a/libraries/lib/libummath-k64f.a b/libraries/lib/libummath-k64f.a index 175dc5fbfc9f254b3b17f4fc3dde96a0a45203bc..26fe5a20886db381c665e4bb5157a906d1c86055 100644 GIT binary patch delta 23 bcmaDN@az8POgU&EWX)J zV+w>dd7YfZ=68lVP;oiyJ5bg?mp{A^wf}-lAgsyfZb@wROW=X3h|4?z7nj^@UoH$a z5#)m0hDv^j3*@XNHZx6F0oAi^<_jcM8yElNhS;%g{RXIu?KC7eSMMu_ssg!=?}Q4J jXQ#1b^R0^?I3Rk?-7g7JUvmQh$wOiW delta 289 zcmaFznfb|Q<_U5vhQ`Jw8az8POgU&EWX)J zV+w>dd7YfZ=68lVP;oiyJ5bg?mp{A^wf}-lAgsyfZb@wROW=X3h|4?z7nj^@UoH$a z5#)m0hDv^j3*@XNHZx6F0oAi^<_jcM8yElNhS;%g{RXIu?KC7eSMMu_ssg!=?}Q4J jXQ#1b^R0^?I3Rk?-7g7JUvmQhYlUHD diff --git a/libraries/lib/libummisc-k64f.a b/libraries/lib/libummisc-k64f.a index 029e7d35140c78bf4a333d1b1827208e1f03cf8e..705e6f43383d43d522439976d892af625db6d300 100644 GIT binary patch delta 33 icmX?SaL!!%ZY8a z(|jcjlM~z&M(hc30Ew!eTg!%ZY8a z(|jcjlM~01V7)*Z=?k