2016-06-27 04:28:48 +00:00
|
|
|
#include "kabufuda/Card.hpp"
|
2016-03-26 04:26:51 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2018-12-08 05:20:24 +00:00
|
|
|
int main() {
|
|
|
|
kabufuda::Card mc{"GM8E", "01"};
|
|
|
|
mc.open(_SYS_STR("test.USA.raw"));
|
|
|
|
mc.format(kabufuda::ECardSlot::SlotA, kabufuda::ECardSize::Card2043Mb);
|
|
|
|
uint64_t a = 0;
|
|
|
|
mc.getSerial(a);
|
2016-12-23 09:48:32 +00:00
|
|
|
|
2018-12-08 05:20:24 +00:00
|
|
|
kabufuda::FileHandle f;
|
|
|
|
mc.openFile("MetroidPrime A", f);
|
|
|
|
for (uint32_t i = 0; i < 127; i++) {
|
|
|
|
char name[32] = {'\0'};
|
|
|
|
sprintf(name, "Metroid Prime %i", i);
|
|
|
|
kabufuda::ECardResult res = mc.createFile(name, kabufuda::BlockSize, f);
|
|
|
|
if (res == kabufuda::ECardResult::INSSPACE || res == kabufuda::ECardResult::NOFILE)
|
|
|
|
break;
|
2016-12-29 21:37:45 +00:00
|
|
|
|
2018-12-08 05:20:24 +00:00
|
|
|
mc.setPublic(f, true);
|
|
|
|
mc.setCanCopy(f, true);
|
|
|
|
mc.setCanMove(f, true);
|
|
|
|
kabufuda::CardStat stat = {};
|
|
|
|
mc.setStatus(f, stat);
|
|
|
|
mc.asyncWrite(f, "Test\0", strlen("Test") + 1);
|
|
|
|
mc.seek(f, 32, kabufuda::SeekOrigin::Begin);
|
|
|
|
mc.asyncWrite(f, "Test\0", strlen("Test") + 1);
|
|
|
|
}
|
|
|
|
return 0;
|
2016-03-26 04:26:51 +00:00
|
|
|
}
|