mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-11-02 00:11:07 -04:00
Increase copy buffer size, and hold B to cancel copying
This commit is contained in:
parent
82760f9fb3
commit
88275c2906
@ -1,7 +1,9 @@
|
|||||||
#include <nds.h>
|
#include <nds.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
u32 copyBuf[0x8000];
|
#define copyBufSize 0x20000
|
||||||
|
|
||||||
|
u32 copyBuf[copyBufSize];
|
||||||
|
|
||||||
off_t getFileSize(const char *fileName)
|
off_t getFileSize(const char *fileName)
|
||||||
{
|
{
|
||||||
@ -43,19 +45,19 @@ int fcopy(const char *sourcePath, const char *destinationPath)
|
|||||||
int numr;
|
int numr;
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* scanKeys();
|
scanKeys();
|
||||||
if (keysHeld() & KEY_A) {
|
if (keysHeld() & KEY_B) {
|
||||||
// Cancel copying
|
// Cancel copying
|
||||||
fclose(sourceFile);
|
fclose(sourceFile);
|
||||||
fclose(destinationFile);
|
fclose(destinationFile);
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
} */
|
}
|
||||||
|
|
||||||
// Copy file to destination path
|
// Copy file to destination path
|
||||||
numr = fread(copyBuf, 2, 0x8000, sourceFile);
|
numr = fread(copyBuf, 2, copyBufSize, sourceFile);
|
||||||
fwrite(copyBuf, 2, numr, destinationFile);
|
fwrite(copyBuf, 2, numr, destinationFile);
|
||||||
offset += 0x8000;
|
offset += copyBufSize;
|
||||||
|
|
||||||
if (offset > fsize) {
|
if (offset > fsize) {
|
||||||
fclose(sourceFile);
|
fclose(sourceFile);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user