Add script to generate pointer table.

Subversion-branch: /research
Subversion-revision: 1892
This commit is contained in:
Simon Howard 2010-04-18 14:18:53 +00:00
parent b6eb31f7f9
commit 2af089c09f
2 changed files with 190 additions and 0 deletions

129
hhe/action-ptrs.c Normal file
View file

@ -0,0 +1,129 @@
static HHEActionPointer action_pointers[] = {
{ { 77680, 80144, 80208 }, "A_AccTeleGlitter" },
{ { 78608, 81104, 81168 }, "A_AddPlayerCorpse" },
{ { 115808, 118000, 118240 }, "A_AddPlayerRain" },
{ { 112272, 114480, 114720 }, "A_BeakAttackPL1" },
{ { 112448, 114656, 114896 }, "A_BeakAttackPL2" },
{ { 111856, 114176, 114416 }, "A_BeakRaise" },
{ { 111568, 113888, 114128 }, "A_BeakReady" },
{ { 74640, 77120, 77184 }, "A_BeastAttack" },
{ { 70480, 72992, 73056 }, "A_BeastPuff" },
{ { 73120, 75600, 75664 }, "A_BlueSpark" },
{ { 115456, 117648, 117888 }, "A_BoltSpark" },
{ { 77344, 79808, 79872 }, "A_BossDeath" },
{ { 69328, 71856, 71920 }, "A_Chase" },
{ { NULL, 80976, 81040 }, "A_CheckBurnGone" },
{ { 78480, 80944, 81008 }, "A_CheckSkullDone" },
{ { 78448, 80912, 80976 }, "A_CheckSkullFloor" },
{ { 71376, 73888, 73952 }, "A_ChicAttack" },
{ { 71488, 74000, 74064 }, "A_ChicChase" },
{ { 71456, 73968, 74032 }, "A_ChicLook" },
{ { 71520, 74032, 74096 }, "A_ChicPain" },
{ { 75792, 78208, 78272 }, "A_ClinkAttack" },
{ { 108432, 110816, 111056 }, "A_ContMobjSound" },
{ { 114752, 116944, 117184 }, "A_DeathBallImpact" },
{ { 70016, 72528, 72592 }, "A_DripBlood" },
{ { 77472, 79936, 80000 }, "A_ESound" },
{ { 76784, 79248, 79312 }, "A_Explode" },
{ { 69872, 72400, 72464 }, "A_FaceTarget" },
{ { 71568, 74080, 74144 }, "A_Feathers" },
{ { 112928, 115136, 115376 }, "A_FireBlasterPL1" },
{ { 113072, 115280, 115520 }, "A_FireBlasterPL2" },
{ { 115232, 117424, 117664 }, "A_FireCrossbowPL1" },
{ { 115312, 117504, 117744 }, "A_FireCrossbowPL2" },
{ { 113152, 115360, 115600 }, "A_FireGoldWandPL1" },
{ { 113296, 115504, 115744 }, "A_FireGoldWandPL2" },
{ { 113760, 115968, 116208 }, "A_FireMacePL1" },
{ { 114624, 116816, 117056 }, "A_FireMacePL2" },
{ { 116368, 118544, 118784 }, "A_FirePhoenixPL1" },
{ { 116736, 118896, 119136 }, "A_FirePhoenixPL2" },
{ { 115568, 117760, 118000 }, "A_FireSkullRodPL1" },
{ { 115648, 117840, 118080 }, "A_FireSkullRodPL2" },
{ { 117120, 119280, 119520 }, "A_FlameEnd" },
{ { 78704, 81200, 81264 }, "A_FlameSnd" },
{ { 117152, 119312, 119552 }, "A_FloatPuff" },
{ { 78512, 81008, 81072 }, "A_FreeTargMobj" },
{ { 117184, 119344, 119584 }, "A_GauntletAttack" },
{ { 73232, 75712, 75776 }, "A_GenWizard" },
{ { 75872, 78304, 78368 }, "A_GhostOff" },
{ { 74752, 77232, 77296 }, "A_HeadAttack" },
{ { 75488, 77984, 78048 }, "A_HeadFireGrow" },
{ { 75328, 77824, 77888 }, "A_HeadIceImpact" },
{ { 116336, 118512, 118752 }, "A_HideInCeiling" },
{ { 78736, 81232, 81296 }, "A_HideThing" },
{ { 70976, 73488, 73552 }, "A_ImpDeath" },
{ { 70304, 72816, 72880 }, "A_ImpExplode" },
{ { 70592, 73104, 73168 }, "A_ImpMeAttack" },
{ { 70672, 73184, 73248 }, "A_ImpMsAttack" },
{ { 70880, 73392, 73456 }, "A_ImpMsAttack2" },
{ { 71024, 73536, 73600 }, "A_ImpXDeath1" },
{ { 71072, 73584, 73648 }, "A_ImpXDeath2" },
{ { 77728, 80192, 80256 }, "A_InitKeyGizmo" },
{ { 116720, 118880, 119120 }, "A_InitPhoenixPL2" },
{ { 70160, 72672, 72736 }, "A_KnightAttack" },
{ { 117648, 119824, 120064 }, "A_Light0" },
{ { 69200, 71728, 71792 }, "A_Look" },
{ { 111760, 114080, 114320 }, "A_Lower" },
{ { 114032, 116224, 116464 }, "A_MaceBallImpact" },
{ { 114192, 116384, 116624 }, "A_MaceBallImpact2" },
{ { 113904, 116112, 116352 }, "A_MacePL1Check" },
{ { 77104, 79568, 79632 }, "A_MakePod" },
{ { 73648, 76128, 76192 }, "A_MinotaurAtk1" },
{ { 74112, 76592, 76656 }, "A_MinotaurAtk2" },
{ { 74352, 76832, 76896 }, "A_MinotaurAtk3" },
{ { 74032, 76512, 76576 }, "A_MinotaurCharge" },
{ { 73760, 76240, 76304 }, "A_MinotaurDecide" },
{ { 74528, 77008, 77072 }, "A_MntrFloorFire" },
{ { 71808, 74288, 74352 }, "A_MummyAttack" },
{ { 71920, 74400, 74464 }, "A_MummyAttack2" },
{ { 72016, 74496, 74560 }, "A_MummyFX1Seek" },
{ { 72048, 74528, 74592 }, "A_MummySoul" },
{ { 76400, 78832, 78896 }, "A_NoBlocking" },
{ { 69984, 72496, 72560 }, "A_Pain" },
{ { 116496, 118656, 118896 }, "A_PhoenixPuff" },
{ { 76896, 79360, 79424 }, "A_PodPain" },
{ { 116272, 118448, 118688 }, "A_RainImpact" },
{ { 111920, 114240, 114480 }, "A_Raise" },
{ { 111696, 114016, 114256 }, "A_ReFire" },
{ { 77056, 79520, 79584 }, "A_RemovePod" },
{ { 116480, NULL, NULL }, "A_RemovedPhoenixFunc" },
{ { 81952, 84464, 84528 }, "A_RestoreArtifact" },
{ { 82048, 84544, 84608 }, "A_RestoreSpecialThing1" },
{ { 82128, 84592, 84656 }, "A_RestoreSpecialThing2" },
{ { 76144, 78576, 78640 }, "A_Scream" },
{ { 117104, 119264, 119504 }, "A_ShutdownPhoenixPL2" },
{ { 78288, 80752, 80816 }, "A_SkullPop" },
{ { 115776, 117968, 118208 }, "A_SkullRodPL2Seek" },
{ { 115984, 118176, 118416 }, "A_SkullRodStorm" },
{ { 75632, 78048, 78112 }, "A_SnakeAttack" },
{ { 75712, 78128, 78192 }, "A_SnakeAttack2" },
{ { 72144, 74624, 74688 }, "A_Sor1Chase" },
{ { 72096, 74576, 74640 }, "A_Sor1Pain" },
{ { 73392, 75872, 75936 }, "A_Sor2DthInit" },
{ { 73424, 75904, 75968 }, "A_Sor2DthLoop" },
{ { 73584, 76064, 76128 }, "A_SorDBon" },
{ { 73552, 76032, 76096 }, "A_SorDExp" },
{ { 73520, 76000, 76064 }, "A_SorDSph" },
{ { 73488, 75968, 76032 }, "A_SorRise" },
{ { 73616, 76096, 76160 }, "A_SorSightSnd" },
{ { 73456, 75936, 76000 }, "A_SorZap" },
{ { 72480, 74960, 75024 }, "A_SorcererRise" },
{ { 115088, 117280, 117520 }, "A_SpawnRippers" },
{ { 77520, 79984, 80048 }, "A_SpawnTeleGlitter" },
{ { 77600, 80064, 80128 }, "A_SpawnTeleGlitter2" },
{ { 72192, 74672, 74736 }, "A_Srcr1Attack" },
{ { 72896, 75376, 75440 }, "A_Srcr2Attack" },
{ { 72816, 75296, 75360 }, "A_Srcr2Decide" },
{ { 112640, 114848, 115088 }, "A_StaffAttackPL1" },
{ { 112784, 114992, 115232 }, "A_StaffAttackPL2" },
{ { 78752, 81248, 81312 }, "A_UnHideThing" },
{ { 78080, 80544, 80608 }, "A_VolcBallImpact" },
{ { 77856, 80320, 80384 }, "A_VolcanoBlast" },
{ { 77824, 80288, 80352 }, "A_VolcanoSet" },
{ { 111168, 113488, 113728 }, "A_WeaponReady" },
{ { 75168, 77664, 77728 }, "A_WhirlwindSeek" },
{ { 75888, 78320, 78384 }, "A_WizAtk1" },
{ { 75920, 78352, 78416 }, "A_WizAtk2" },
{ { 75952, 78384, 78448 }, "A_WizAtk3" },
};

61
hhe/gen-ptr-table Executable file
View file

@ -0,0 +1,61 @@
#!/usr/bin/env ruby
#
# Generate the table of offsets for different action pointers
# in the different Heretic versions.
#
require "common.rb"
def action_func_names
names = {}
for config in CONFIGS
config::ACTION_POINTERS.each_value do |name|
names[name] = true
end
end
names.keys
end
def get_func_offset(config, name)
config::ACTION_POINTERS.each_pair do |offset, funcname|
if name == funcname
return offset
end
end
0
end
def func_offsets(name)
CONFIGS.map do |config|
get_func_offset(config, name)
end
end
def format_func_offsets(offsets)
formatted = offsets.map do |offset|
if offset == 0
" NULL"
else
sprintf("%6i", offset)
end
end
"{ " + formatted.join(", ") + " }"
end
puts "static HHEActionPointer action_pointers[] = {"
for name in action_func_names.sort
offsets = func_offsets(name)
print " { "
print format_func_offsets(offsets) + ", "
print name.to_json
print " },\n"
end
puts "};"
puts