[Contributing] Add a rule against decompiling self-modifying code

Will come up soon in TH03, actually.
This commit is contained in:
nmlgc 2019-11-20 00:07:39 +01:00
parent afbc7eb381
commit e9453bffe0
1 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,15 @@ binary, as compared using [mzdiff].** The only allowed exceptions are:
code, not to replace it with an overly nested, "enterprise-y" class code, not to replace it with an overly nested, "enterprise-y" class
hierarchy. hierarchy.
## Decompilation
* Don't try to decompile self-modifying code. Yes, it may be *possible* by
calculating addresses relative to the start of the function, but as soon as
someone starts modding or porting that function, things *will* crash at
runtime. Inline ASM in C/C++ source files is fine, that will trip up future
port developers at compile time. Self-modifying code can only do the same if
it's kept in separate ASM files.
## Naming conventions ## Naming conventions
* ASM file extensions: `.asm` if they emit code, `.inc` if they don't * ASM file extensions: `.asm` if they emit code, `.inc` if they don't