Yes, i could use user memory but i dont want to interfere with the game resources, probably not all games have left 382KiB (for the copy of the vram buffer since i don't suspend the game) + size of lib[jpg|png] code + size of memory allocs (giflib requires 64KiB at minimal, the others require more).Strangelove wrote: can't you load the module to a different kernel mem partition? and why does it need kernel mode anyway?
Yeah, its very fun to have control and being able to jump between user/kernel without troublesStrangelove wrote: and if that doesn't work for some reason, there's other possibilities. i recently managed to call kernel code from user mode (needs HEN), you could go the other way too by letting a user mode module handle converting pictures. haven't tried the latter but it could be fun...
Call kernel code from user module: export kernel function, patch the game import with a new syscall and set k1 to 0 inside the syscall if you are planning to use sce* functions.
Call user code from kernel module: search the func address with sctrlHENFindFunction, restore k1 if you are inside a syscall (or set to 0x10000 iirc otherwise), then do a direct jump to the address (if you call the function normally via syscalls then the interrupt manager is gonna set k1 to 0 (because you are already in kernel mode) and the user function will fail) . If the function passes structures then you have to copy the buffer to an address below 0xA000000 and pass that pointer instead.