-Wmissing-include-dirs -Wredundant-decls \
-Wshadow -Wsign-conversion -Wstrict-overflow=5 -Wswitch-default \
-Wundef -Wno-unused $(THUMBFLAGS) $(SIZE_OPTIMIZATION) $(INCPATHS) $(C9FLAGS) \
- -fshort-wchar -fno-builtin -std=gnu11 -DREVISION=\"$(REVISION)\" \
+ -fno-builtin -std=gnu11 -DREVISION=\"$(REVISION)\" \
-DFW_NAME=\"corbenik\" $(PATHARGS)
#define OP_JMPF 0x77
#define OP_JMPNF 0x87
+#define OP_INJECT 0x90
+
#define OP_NEXT 0xFF
#ifdef LOADER
offset = new_offset = 0;
code = bytecode;
break;
+ case OP_INJECT: // Read in data (from filename)
+ if (debug) {
+#ifdef LOADER
+ log("set\n");
+#else
+ fprintf(stderr, "set %s\n", &code[1]);
+#endif
+ }
+
+ char* fname = (char*)&code[1];
+#ifdef LOADER
+ (void)fname;
+ // NYI
+#else
+ FILE* f = fopen(fname, "r");
+ fread(current_mode->memory + offset, 1, fsize(f), f);
+ offset += fsize(f);
+ code += strlen(fname);
+ fclose(f);
+#endif
+ break;
default:
#ifndef LOADER
// Panic; not proper opcode.
int wait();
-uint8_t *
+uint8_t*
getProcess9(uint8_t *pos, uint32_t size, uint32_t *process9Size, uint32_t *process9MemAddr)
{
uint8_t *off = memfind(pos, size, "ess9", 4);
// it might be needed to replace a svc call to access it. I'm rather sure that NTR does this.
*pos_native = (uint32_t)mem;
- memcpy(mem, L"sdmc:", 10);
+ memcpy(mem, u"sdmc:", 10);
mem += 10;
for (size_t i = 0; i < sizeof(PATH_NATIVE_P); i++, mem += 2) {
*mem = PATH_NATIVE_P[i];
}
*pos_twl = (uint32_t)mem;
- memcpy(mem, L"sdmc:", 10);
+ memcpy(mem, u"sdmc:", 10);
mem += 10;
for (size_t i = 0; i < sizeof(PATH_TWL_P); i++, mem += 2) {
*mem = PATH_TWL_P[i];
}
*pos_agb = (uint32_t)mem;
- memcpy(mem, L"sdmc:", 10);
+ memcpy(mem, u"sdmc:", 10);
mem += 10;
for (size_t i = 0; i < sizeof(PATH_AGB_P); i++, mem += 2) {
*mem = PATH_AGB_P[i];