Merge pull request #5450 from Abextm/script-opcodes
cache: Add world map CS2 Opcodes
This commit is contained in:
@@ -38,6 +38,7 @@ public class ScriptLoader
|
||||
public ScriptDefinition load(int id, byte[] b)
|
||||
{
|
||||
ScriptDefinition def = new ScriptDefinition();
|
||||
def.setId(id);
|
||||
InputStream in = new InputStream(b);
|
||||
|
||||
in.setOffset(in.getLength() - 2);
|
||||
|
||||
@@ -300,6 +300,7 @@ public class Instructions
|
||||
add(ITEM_PRICE, "item_price", 1, 0);
|
||||
add(SEND_BUG_REPORT, "send_bug_report", 1, 0, 2, 0);
|
||||
add(SET_SHIFT_DROP_ENABLED, "set_shift_drop_enabled", 1, 0);
|
||||
add(SET_CONNECTION_TEXT_ENABLED, "set_connection_text_enabled", 1, 0);
|
||||
// 3200-3300
|
||||
add(PLAY_SOUND_EFFECT, "play_sound_effect", 3, 0);
|
||||
add(3201, 1, 0);
|
||||
@@ -485,53 +486,53 @@ public class Instructions
|
||||
add(GET_IS_MOBILE, "get_is_mobile", 0, 1);
|
||||
// 6600-6700
|
||||
add(6600, 0, 0);
|
||||
add(6601, 1, 0, 0, 1);
|
||||
add(6602, 1, 0);
|
||||
add(6603, 0, 1);
|
||||
add(6604, 1, 0);
|
||||
add(GET_MAP_SURFACE_NAME_BY_ID, "get_map_surface_name_by_id", 1, 0, 0, 1);
|
||||
add(SET_CURRENT_MAP_SURFACE, "set_current_map_surface", 1, 0);
|
||||
add(GET_CURRENT_MAP_ZOOM, "get_current_map_zoom", 0, 1);
|
||||
add(SET_CURRENT_MAP_ZOOM, "set_current_map_zoom", 1, 0);
|
||||
add(6605, 0, 1);
|
||||
add(6606, 1, 0);
|
||||
add(6607, 1, 0);
|
||||
add(6608, 1, 0);
|
||||
add(6609, 1, 0);
|
||||
add(6610, 0, 2);
|
||||
add(6611, 1, 1);
|
||||
add(6612, 1, 2);
|
||||
add(6613, 1, 4);
|
||||
add(6614, 1, 1);
|
||||
add(SET_MAP_POSITION, "set_map_position", 1, 0);
|
||||
add(SET_MAP_POSITION_IMMEDIATE, "set_map_position_immediate", 1, 0);
|
||||
add(SET_MAP_POSITION_2, "set_map_position_2", 1, 0);
|
||||
add(SET_MAP_POSITION_IMMEDIATE_2, "set_map_position_immediate_2", 1, 0);
|
||||
add(GET_MAP_POSITION, "get_map_position", 0, 2);
|
||||
add(GET_MAP_DEFAULT_POSITION_BY_ID, "get_map_default_position_by_id", 1, 1);
|
||||
add(GET_MAP_DIMENSIONS_BY_ID, "get_map_dimensions_by_id", 1, 2);
|
||||
add(GET_MAP_BOUNDS_BY_ID, "get_map_bounds_by_id", 1, 4);
|
||||
add(GET_MAP_INITAL_ZOOM_BY_ID, "get_map_inital_zoom_by_id", 1, 1);
|
||||
add(6615, 2, 2);
|
||||
add(6616, 0, 1);
|
||||
add(GET_CURRENT_MAP_ID, "get_current_map_id", 0, 1);
|
||||
add(6617, 1, 2);
|
||||
// 6618 variable
|
||||
add(6619, 2, 1);
|
||||
add(6620, 2, 1);
|
||||
add(6621, 2, 1);
|
||||
add(622, 0, 1);
|
||||
add(6623, 1, 1);
|
||||
add(6624, 1, 0);
|
||||
add(6625, 0, 0);
|
||||
add(6626, 1, 0);
|
||||
add(6627, 0, 0);
|
||||
add(6628, 1, 0);
|
||||
add(6629, 1, 0);
|
||||
add(6630, 1, 0);
|
||||
add(6631, 0, 0);
|
||||
add(6632, 1, 0);
|
||||
add(6633, 2, 0);
|
||||
add(6634, 2, 0);
|
||||
add(6635, 0, 1);
|
||||
add(6636, 0, 1);
|
||||
add(6637, 1, 1);
|
||||
add(MAP_ID_CONTAINS_COORD, "map_id_contains_coord", 2, 1);
|
||||
add(GET_MAP_DISPLAY_DIMENSIONS, "get_map_display_dimensions", 0, 2);
|
||||
add(GET_MAP_ID_CONTAINING_COORD, "get_map_id_containing_coord", 1, 1);
|
||||
add(SET_MAP_ICON_FLASH_COUNT, "set_map_icon_flash_count", 1, 0);
|
||||
add(RESET_MAP_ICON_FLASH_COUNT, "reset_map_icon_flash_count", 0, 0);
|
||||
add(SET_MAP_ICON_FLASH_PERIOD, "set_map_icon_flash_period", 1, 0);
|
||||
add(RESET_MAP_ICON_FLASH_PERIOD, "reset_map_icon_flash_period", 0, 0);
|
||||
add(SET_MAP_ICON_FLASH_FOREVER, "set_map_icon_flash_forever", 1, 0);
|
||||
add(FLASH_MAP_ICONS_BY_ID, "flash_map_icons_by_id", 1, 0);
|
||||
add(FLASH_MAP_ICONS_BY_GROUP, "flash_map_icons_by_group", 1, 0);
|
||||
add(CLEAR_FLASHING_ICONS, "clear_flashing_icons", 0, 0);
|
||||
add(SET_MAP_ICONS_DISABLED, "set_map_icons_disabled", 1, 0);
|
||||
add(SET_MAP_ICONS_ENABLED_BY_ID, "set_map_icons_enabled_by_id", 2, 0);
|
||||
add(SET_MAP_ICONS_ENABLED_BY_GROUP, "set_map_icons_enabled_by_group", 2, 0);
|
||||
add(GET_MAP_ICONS_DISABLED, "get_map_icons_disabled", 0, 1);
|
||||
add(GET_MAP_ICONS_ENABLED_BY_ID, "get_map_icons_enabled_by_id", 1, 1);
|
||||
add(GET_MAP_ICONS_ENABLED_BY_GROUP, "get_map_icons_enabled_by_group", 1, 1);
|
||||
add(6638, 2, 1);
|
||||
add(6639, 0, 2);
|
||||
add(6640, 0, 2);
|
||||
add(GET_AREA_NAME, "get_area_name", 1, 0, 0, 1);
|
||||
add(6694, 1, 1);
|
||||
add(6695, 1, 1);
|
||||
add(6696, 1, 1);
|
||||
add(6697, 0, 1);
|
||||
add(6698, 0, 1);
|
||||
add(6699, 0, 1);
|
||||
add(GET_FIRST_MAP_ICON, "get_first_map_icon", 0, 2);
|
||||
add(GET_NEXT_MAP_ICON, "get_next_map_icon", 0, 2);
|
||||
add(GET_MAPICON_NAME_BY_ID, "get_mapicon_name_by_id", 1, 0, 0, 1);
|
||||
add(GET_MAPICON_FONT_SIZE, "get_mapicon_font_size", 1, 1);
|
||||
add(GET_MAPICON_GROUP_BY_ID, "get_mapicon_group_by_id", 1, 1);
|
||||
add(GET_MAPICON_SPRITE_BY_ID, "get_mapicon_sprite_by_id", 1, 1);
|
||||
add(GET_CURRENT_MAPICON_ID, "get_current_mapicon_id", 0, 1);
|
||||
add(GET_CURRENT_MAPICON_COORD, "get_current_mapicon_coord", 0, 1);
|
||||
add(GET_CURRENT_MAPICON_OTHER_COORD, "get_current_mapicon_other_coord", 0, 1);
|
||||
}
|
||||
|
||||
protected void add(int opcode, String name, int ipops, int ipushes, int spops, int spushes)
|
||||
|
||||
@@ -238,6 +238,7 @@ public class Opcodes
|
||||
public static final int ITEM_PRICE = 3115;
|
||||
public static final int SEND_BUG_REPORT = 3116;
|
||||
public static final int SET_SHIFT_DROP_ENABLED = 3117;
|
||||
public static final int SET_CONNECTION_TEXT_ENABLED = 3126;
|
||||
public static final int PLAY_SOUND_EFFECT = 3200;
|
||||
public static final int GET_GAMECYCLE = 3300;
|
||||
public static final int GET_ITEMCONTAINER_ITEMID = 3301;
|
||||
@@ -373,5 +374,44 @@ public class Opcodes
|
||||
public static final int GET_WORLD_BY_ID = 6506;
|
||||
public static final int GET_WORLD_BY_INDEX = 6511;
|
||||
public static final int GET_IS_MOBILE = 6518;
|
||||
public static final int GET_AREA_NAME = 6693;
|
||||
public static final int GET_MAP_SURFACE_NAME_BY_ID = 6601;
|
||||
public static final int SET_CURRENT_MAP_SURFACE = 6602;
|
||||
public static final int GET_CURRENT_MAP_ZOOM = 6603;
|
||||
public static final int SET_CURRENT_MAP_ZOOM = 6604;
|
||||
public static final int SET_MAP_POSITION = 6606;
|
||||
public static final int SET_MAP_POSITION_IMMEDIATE = 6607;
|
||||
public static final int SET_MAP_POSITION_2 = 6608;
|
||||
public static final int SET_MAP_POSITION_IMMEDIATE_2 = 6609;
|
||||
public static final int GET_MAP_POSITION = 6610;
|
||||
public static final int GET_MAP_DEFAULT_POSITION_BY_ID = 6611;
|
||||
public static final int GET_MAP_DIMENSIONS_BY_ID = 6612;
|
||||
public static final int GET_MAP_BOUNDS_BY_ID = 6613;
|
||||
public static final int GET_MAP_INITAL_ZOOM_BY_ID = 6614;
|
||||
public static final int GET_CURRENT_MAP_ID = 6616;
|
||||
public static final int MAP_ID_CONTAINS_COORD = 6621;
|
||||
public static final int GET_MAP_DISPLAY_DIMENSIONS = 6622;
|
||||
public static final int GET_MAP_ID_CONTAINING_COORD = 6623;
|
||||
public static final int SET_MAP_ICON_FLASH_COUNT = 6624;
|
||||
public static final int RESET_MAP_ICON_FLASH_COUNT = 6625;
|
||||
public static final int SET_MAP_ICON_FLASH_PERIOD = 6626;
|
||||
public static final int RESET_MAP_ICON_FLASH_PERIOD = 6627;
|
||||
public static final int SET_MAP_ICON_FLASH_FOREVER = 6628;
|
||||
public static final int FLASH_MAP_ICONS_BY_ID = 6629;
|
||||
public static final int FLASH_MAP_ICONS_BY_GROUP = 6630;
|
||||
public static final int CLEAR_FLASHING_ICONS = 6631;
|
||||
public static final int SET_MAP_ICONS_DISABLED = 6632;
|
||||
public static final int SET_MAP_ICONS_ENABLED_BY_ID = 6633;
|
||||
public static final int SET_MAP_ICONS_ENABLED_BY_GROUP = 6634;
|
||||
public static final int GET_MAP_ICONS_DISABLED = 6635;
|
||||
public static final int GET_MAP_ICONS_ENABLED_BY_ID = 6636;
|
||||
public static final int GET_MAP_ICONS_ENABLED_BY_GROUP = 6637;
|
||||
public static final int GET_FIRST_MAP_ICON = 6639;
|
||||
public static final int GET_NEXT_MAP_ICON = 6640;
|
||||
public static final int GET_MAPICON_NAME_BY_ID = 6693;
|
||||
public static final int GET_MAPICON_FONT_SIZE = 6694;
|
||||
public static final int GET_MAPICON_GROUP_BY_ID = 6695;
|
||||
public static final int GET_MAPICON_SPRITE_BY_ID = 6696;
|
||||
public static final int GET_CURRENT_MAPICON_ID = 6697;
|
||||
public static final int GET_CURRENT_MAPICON_COORD = 6698;
|
||||
public static final int GET_CURRENT_MAPICON_OTHER_COORD = 6699;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ScriptSaverTest
|
||||
instructions.init();
|
||||
ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE));
|
||||
byte[] saved = new ScriptSaver().save(script);
|
||||
ScriptDefinition loadedScripot = new ScriptLoader().load(42, saved);
|
||||
ScriptDefinition loadedScripot = new ScriptLoader().load(0, saved);
|
||||
assertEquals(script, loadedScripot);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ScriptSaverTest
|
||||
instructions.init();
|
||||
ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE_UNICODE));
|
||||
byte[] saved = new ScriptSaver().save(script);
|
||||
ScriptDefinition loadedScripot = new ScriptLoader().load(42, saved);
|
||||
ScriptDefinition loadedScripot = new ScriptLoader().load(0, saved);
|
||||
assertEquals(script, loadedScripot);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DisassemblerTest
|
||||
continue;
|
||||
}
|
||||
|
||||
ScriptDefinition script = loader.load(0, contents);
|
||||
ScriptDefinition script = loader.load(archive.getArchiveId(), contents);
|
||||
|
||||
File outFile = new File(outDir, archive.getArchiveId() + ".rs2asm");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user