The following warnings occurred:
Warning [2] unserialize(): Error at offset 1251 of 1260 bytes - Line: 2650 - File: inc/functions.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
[PHP] errorHandler->error_callback
/inc/functions.php 2650 unserialize
/inc/class_datacache.php 138 native_unserialize
/inc/init.php 182 datacache->cache
/global.php 20 require_once
/printthread.php 16 require_once



MFGG Forums
[Project Log] Journey Into Plumber Subconscious (SMB1 Hack) - Printable Version

+- MFGG Forums (https://forums.mfgg.net)
+-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4)
+--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10)
+--- Thread: [Project Log] Journey Into Plumber Subconscious (SMB1 Hack) (/showthread.php?tid=3475)

Pages: 1 2


RE: [Project Log] Journey Into Plumber Subconscious (SMB1 Hack) - Louis Paul - 10-18-2026

So I finished the level design of Realm 4-1, the next level involves mycology, the plumber can't just consume everything that he finds in his way:

[Image: jips-animation-13.webp]

Now explaining a bit about the custom codes: in the start of the freespace I use the opcode $89, that's an unofficial opcode which just read an immediate byte and skip it (like a NOP with a single argument), I use it as a freespace signature, to make it easier to find in a hex editor, here's the macro I use:

Code:
macro begin_signature(sub_id)     db $89,<sub_id> ; 2-byte unofficial NOP endmacro

Then in the end of the freespace I use this macro to assert if the custom code size can fit in the freespace (to prevent overflow), if the assembled code is too big the Asar assembler gives an error (I use another unofficial NOP as a canary value):

Code:
macro end_signature(end_label)     assert pc() < <end_label>,"<end_label> overflow detected!"     db $da ; unofficial NOP endmacro



RE: [Project Log] Journey Into Plumber Subconscious (SMB1 Hack) - VinnyVideo - 10-18-2026

I have some serious respect for people who can wrangle ASM like that.


RE: [Project Log] Journey Into Plumber Subconscious (SMB1 Hack) - Louis Paul - 10-21-2026

(10-18-2026, 01:10 PM)VinnyVideo Wrote: I have some serious respect for people who can wrangle ASM like that.

Yeah, ASM can sometimes be tricky, a way to tame it is to choose a good assembler with a nice syntax and macro features. My first contact with ASM was when I was applying custom patches in SMW, I didn't understand the code itself.

In the university I had contact with MIPS Assembly in the Computer Architecture course, and quite honestly I didn't like it, the problem is that it doesn't have the status register, and it has a weird concept of delay slot. Instead of MIPS Assembly they could teach 6502, Z80 or 8086 Assembly.

Now today I know the concepts about addressing modes, the registers themselves, the program counter, the stack pointer, the status flags, branches and jumps, learning Assembly is easier when you know these concepts.