Skip to content

Instantly share code, notes, and snippets.

@2Tie
2Tie / sizes.c
Last active August 5, 2025 00:29
monster size generation G
void SetMonsterSizes(int param_1,undefined8 param_2)
{
short *psVar1;
uint uVar2;
long lVar3;
while( true ) {
lVar3 = FUN_sub_main__004b3860(param_1,0);
psVar1 = (short *)FUN_sub_main__004b3860(param_1,1);
@2Tie
2Tie / sync.asm
Created January 5, 2024 21:08
sega mkiii tstate synchronizer
;let's try synching up with a cycle
syncloop:
in a, ($7E) ;11
cp 60 ;18
push af ;28
pop af ;39
ld d, a ;43
nop ;47
jp nz, syncloop ;57 (1/4 a scanline)
first: ;now guarantee the start of next scanline
@2Tie
2Tie / g1scripting.txt
Created June 29, 2022 18:11
Monster Hunter 1/G scripting documentation
the block pointed to by 0x10 in the quest header is the quest scripting block. every entry in this block is 0x8 bytes long, consisting of four shorts; the first is the opcode, the other three are arguments (though argument three goes unused by any ops until G). in MH1, opcodes from -2 to 2D are implemented, but only around half are actually used. I will denote unused opcodes with an X prefix, and opcodes added by G with a G prefix. The unused opcodes will likely be documented better in the future, my focus here is on the used opcodes.
-2: Triggers the cameras for quest failure
-1: Triggers the monster camera for quest clear, sends a packet
00: X Waits until 3C7474 is 0
01: Waits for monster goals completion (all monsters stored value 0)
02: Sets the goal for Monster arg1 to arg2; slaying a monster decrements the stored arg2. can be used multiple times to set a max of two monsters.
03: X Check item goal, seems to be an early version that checks player inventory?
04: Sets the delivery item goal for item arg1 t