]> Chaos Git - corbenik/corbenik.git/commitdiff
Okay, all the patches *seem* to work now. Regionfree was wrong before
authorroot <chaos.kagami@gmail.com>
Thu, 2 Jun 2016 18:47:36 +0000 (14:47 -0400)
committerroot <chaos.kagami@gmail.com>
Thu, 2 Jun 2016 18:47:36 +0000 (14:47 -0400)
doc/bytecode.md
external/loader/source/patcher.c
patch/Makefile
patch/regionfree.pco
source/interp.c

index e9747ccbc78aaa31c3907def442bcdd7646e2559..0e018fc2d1c9df99a9894302ca91fcbe923aa10b 100644 (file)
@@ -126,3 +126,8 @@ title <count> <title> : 2 + <count> * 8 bytes : 0x0A
                How many titleIDs to read.
        <title> : 8 * <count> bytes
                List of titleIDs as u64.
+
+next : 1 byte : 0xFF
+       Resets state to default, and changes the base of code to the next instruction.
+       This opcode is not meant to be used directly - it's emitted when generating
+       caches.
index ca98da643a57f796343c038a4801271fd243d5fb..8a72b2bfcf2d2550f4685c0c599d29fe4de3cb85 100644 (file)
@@ -362,7 +362,7 @@ patch_text(u64 progId, u8* text, u32 size, u32 orig_size)
        execb(PATH_PATCHES "/errdisp.vco", progId, text, orig_size);
        execb(PATH_PATCHES "/friends_ver.vco", progId, text, orig_size);
        execb(PATH_PATCHES "/mset_str.vco", progId, text, orig_size);
-       execb(PATH_PATCHES "/ns_force_menu.vco", progId, text, orig_size);
+//     execb(PATH_PATCHES "/ns_force_menu.vco", progId, text, orig_size);
        execb(PATH_PATCHES "/regionfree.vco", progId, text, orig_size);
        execb(PATH_PATCHES "/secinfo_sigs.vco", progId, text, orig_size);
        execb(PATH_PATCHES "/ro_sigs.vco", progId, text, orig_size);
index b70576462da38ff1268dfa1cf564496f0486dc90..06a98dbb70768c63a80b3f41c9a7987a6d76a98a 100644 (file)
@@ -1,5 +1,5 @@
 .PHONY: all
-all: $(patsubst %.pco, %.vco, $(wildcard *.pco))
+all: clean $(patsubst %.pco, %.vco, $(wildcard *.pco))
        mkdir -p ../out/corbenik/bin
        cp *.vco ../out/corbenik/bin/
 
index 25f3e73d78cbd742b1286717d58f2f82d2cab06a..0badc5d3f4dbf74377012e133d241d84101f1273 100644 (file)
@@ -7,6 +7,7 @@
 # Status: needs loader
 
 find 000055E30110A0E3
+
 # 16
-back 11
+back 10
 set  0100A0E31EFF2FE1
index 70e183ae18a468a6ee7daf795d310bbb8afe4bd1..462d26553d8b9e43e4de107549a89dc4e10304b1 100644 (file)
@@ -19,6 +19,7 @@
 #define OP_REWIND 0x08
 #define OP_AND    0x09
 #define OP_TITLE  0x0A
+#define OP_NEXT   0xFF
 
 #ifdef LOADER
   #define log(a) logstr(a)
@@ -245,6 +246,14 @@ int exec_bytecode(uint8_t* bytecode, uint32_t len, int debug) {
                                }
                                code   += *(code-1);
                                break;
+                       case OP_NEXT:
+                               bytecode = code + 1;
+                               set_mode = 3;
+                               current_mode = &modes[set_mode];
+                               offset = 0;
+                               test_was_false = 0;
+                               code = bytecode;
+                               break;
                        case OP_TITLE:
                                if (debug)
                                        log("title\n");
@@ -360,7 +369,7 @@ int execb(char* filename) {
        }
 
        if (!apply) {
-               // Not meant for us. Not an error, though.
+               // Not meant for us.
                return 0;
        }
 
@@ -390,6 +399,7 @@ int execb(char* filename) {
        if (patch->titles != 0) {
                // Not an error, per se, but it means this patch is meant for loader, not us.
                // Patches intended for use during boot will always be applied to zero titles.
+               // We should generate a cache for loader in a file intended for titleid.
                return 0;
        }
 
@@ -398,5 +408,5 @@ int execb(char* filename) {
        patch_mem = (uint8_t*)patch + sizeof(struct system_patch) + (patch->depends * 8) + (patch->titles * 8);
        patch_len = patch->size;
 #endif
-       return exec_bytecode(patch_mem, patch_len, 1);
+       return exec_bytecode(patch_mem, patch_len, 0);
 }