2016-06-27 04:28:48 +00:00
|
|
|
#include "kabufuda/Card.hpp"
|
2016-03-26 04:26:51 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2016-03-26 20:16:30 +00:00
|
|
|
kabufuda::Card mc{_S("test.USA.raw"), "GM8E", "01"};
|
2016-12-29 21:37:45 +00:00
|
|
|
mc.format(kabufuda::ECardSlot::SlotA, kabufuda::ECardSize::Card2043Mb);
|
2016-12-23 09:48:32 +00:00
|
|
|
uint64_t a = 0;
|
|
|
|
mc.getSerial(a);
|
|
|
|
|
2017-01-24 07:40:47 +00:00
|
|
|
kabufuda::FileHandle f;
|
2016-12-28 21:39:10 +00:00
|
|
|
mc.openFile("MetroidPrime A", f);
|
2016-12-29 21:37:45 +00:00
|
|
|
for (uint32_t i = 0; i < 127; i++)
|
2016-06-30 09:53:13 +00:00
|
|
|
{
|
2016-12-29 21:37:45 +00:00
|
|
|
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-06-30 09:53:13 +00:00
|
|
|
mc.setPublic(f, true);
|
|
|
|
mc.setCanCopy(f, true);
|
|
|
|
mc.setCanMove(f, true);
|
2017-02-07 02:25:08 +00:00
|
|
|
kabufuda::CardStat stat = {};
|
|
|
|
mc.setStatus(f, stat);
|
2018-02-06 09:34:01 +00:00
|
|
|
mc.asyncWrite(f, "Test\0", strlen("Test") + 1);
|
2016-12-29 21:37:45 +00:00
|
|
|
mc.seek(f, 32, kabufuda::SeekOrigin::Begin);
|
2018-02-06 09:34:01 +00:00
|
|
|
mc.asyncWrite(f, "Test\0", strlen("Test") + 1);
|
2016-03-27 03:46:52 +00:00
|
|
|
}
|
2016-03-26 04:26:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|