Talk:Episode 58 - The Ruin of Roib

From KeenWiki
Jump to: navigation, search

Known bugs and how to fix them

The v3.0 beta still contains some bugs, including a nasty one in which any level containing the Super Duper enemy is prone to crashing.

To fix that particular bug, and possibly some others, open the ROIB.PAT file in a text editor and copy+paste the following text (written by K1n9 Duk3) into the line just before the very last line with the "%end" command. Then save the resulting file.

<patch title="ROIB bugfix">

  1. fix bad jump address in KeenContact - contacting object type 17 (foot)
  2. is not supposed to end the level in this mod?

%patch $CCBC $158w

  1. fix bad jump address after spawning ground-based Roich in ScanInfoPlane

%patch $EAD0 $032Bw

  1. fix bad jump address after spawning the boss(?) in ScanInfoPlane

%patch $EB58 $02A3w

  1. fix bad jump table entries for ScanInfoPlane (info values 80-82)

%patch $EF23 $50Dw $50Dw $50Dw

  1. fix offset for calling the function to spawn speech bubble #4

%patch $F767 $1080086Erl

  1. restore messed up SD_PlaySound call in Dopefish/boss contact function

%patch $12408 $9A $187409F1rl

  1. convert far call in PlatformThink into a near jump (the old call jumps into the
  2. middle of another function, corrupting registers SI and DI on return)

%patch $117C7 $E9 $FD9Aw $90 $90

  1. fix bad function address for Slop's contact function in the initial state

%patch $3103A $2EE7421Frl

  1. turn bad function address into NULL pointer (the state SHOULD be unused anyway)

%patch $31B3A 0l

  1. turn crashed superduper's obclass into 'stunned object' when loading a game

%patch $6060 $83 $3F $13 # cmp [bx], 13h $75 $08 # jnz skip $C7 $07 $0021w # mov [bx], 21h $EB $EA # jmp clear_temp3 $90 $90 # nop nop

  1. This overwrites the code that would clear the sprite pointers for the platform
  2. thrusters, but they don't exist in Roib, so it's safe to overwrite that code.
  3. Note that this doesn't fix the bug. It just allows you to load "corrupted"
  4. saves and continue playing from that point.
  1. make superduper change its obclass to 'stunned object' when it hits the ground
  2. new (near) subroutine to change state and obclass (si is obj, ax is new state)

%patch $11ED7 #seg012:04B7 $50 # push ax $56 # push si $9A $09DC120Arl # call ChangeState $83 $C4 $04 # add sp, 4 $C7 $04 $0021w # mov [si], 21h $C3 # retn

  1. call new subroutine to change to crashed superduper state

%patch $12002 $E8 $FED2w # call SetStunnedState $90 $90 $90 $90 # nop nop nop nop $90 $90 $90 # nop nop nop %patch $1206A $E8 $FE6Aw # call SetStunnedState $90 $90 $90 $90 # nop nop nop nop $90 $90 $90 # nop nop nop

  1. ------------------------------------
  2. restore some of the error messages
  3. ------------------------------------
  1. RF_PlaceSprite: No free spots in spritearray!

%patch $2EF8F "RF_PlaceSprite: No free spots in spritearray!" 0 %patch $17C1B $011Fw

  1. RF_PlaceSprite: Placed an uncached sprite:

%patch $2EFBD "RF_PlaceSprite: Placed an uncached sprite:" 0 %patch $17C88 $014Dw</patch>