-#define STOP_AT_END 0
-#define STOP_AT_WAIT_VBL 1
+/* cause why the cpu execution loop stopped */
+enum {
+ STOP_AT_END = 0,
+ STOP_AT_PATCH_RENDER,
+ STOP_AT_PATCH_VR,
+ STOP_AT_WAIT_VBL,
+ STOP_AT_WAIT_INPUT,
+ STOP_AT_CLEAR_SCREEN1,
+ STOP_AT_CLEAR_SCREEN2,
+ STOP_AT_CLEAR_SCREEN3,
+ STOP_AT_DRAW_GROUND,
+ STOP_AT_INFO_OBJECT_MOVING,
+ STOP_AT_INFO_OBJECT_FIX,
+ STOP_AT_TAG_IS_OBJECT_1,
+ STOP_AT_TAG_IS_OBJECT_0,
+ STOP_AT_COORD_OBJECT,
+ STOP_AT_POLY_OBJECT_M3,
+ STOP_AT_POLY_OBJECT_M2,
+ STOP_AT_LINE_OBJECT,
+ STOP_AT_COORD_BEACON,
+ STOP_AT_POINT_BEACON,
+ STOP_AT_COORD_BUILDING_EXTERIOR,
+ STOP_AT_POLY_BUILDING_EXTERIOR,
+ STOP_AT_LINE_BUILDING_EXTERIOR,
+ STOP_AT_COORD_BUILDING_INTERIOR,
+ STOP_AT_POLY_BUILDING_INTERIOR1,
+ STOP_AT_POLY_BUILDING_INTERIOR2,
+ STOP_AT_POLY_BUILDING_INTERIOR3,
+ STOP_AT_POLY_BUILDING_INTERIOR4,
+ STOP_AT_POLY_BUILDING_INTERIOR5,
+ STOP_AT_POLY_BUILDING_INTERIOR6,
+ STOP_AT_POLY_BUILDING_INTERIOR1to4,
+ STOP_AT_POLY_BUILDING_INTERIOR5to6,
+ STOP_AT_WALL_BUILDING,
+ STOP_AT_COORD_COMET,
+ STOP_AT_MATRIX_COMET,
+ STOP_AT_POLY_COMET,
+ STOP_AT_COORD_LINE_ROADS,
+ STOP_AT_LINE_ROADS,
+ STOP_AT_LINE_ROADS_CENTER,
+ STOP_AT_COORD_POLY_ROADS,
+ STOP_AT_POLY_ROADS,
+ STOP_AT_COORD_TAGS,
+ STOP_AT_COORD_TAGS2,
+ STOP_AT_LINE_TAGS1,
+ STOP_AT_LINE_TAGS2,
+ STOP_AT_POLY_TAGS1,
+ STOP_AT_POLY_TAGS2,
+ STOP_AT_COORD_PLANET,
+ STOP_AT_MATRIX_PLANET,
+ STOP_AT_DRAW_PLANET,
+ STOP_AT_DRAW_COMET,
+ STOP_AT_DRAW_STARS_SPACE,
+ STOP_AT_DRAW_STARS_GROUND,
+ STOP_AT_DRAW_STARS_FLYING,
+ STOP_AT_DRAW_STARS_FLYING2,
+ STOP_AT_DRAW_STARS_INTERSTELLAR,
+ STOP_AT_DRAW_SUN_INTERSTELLAR,
+ STOP_AT_COORD_ISLANDS,
+ STOP_AT_POLY_ISLANDS,
+ STOP_AT_LINE_ISLANDS,
+ STOP_AT_DRAW_SIGHTS,
+ STOP_AT_POLY_UKN2,
+ STOP_AT_COORD_EXPLOSION,
+ STOP_AT_DRAW_EXPLOSION,
+ STOP_AT_SHADOW_BUILDING,
+};
+
+struct vr_move {
+ int override;
+ int index;
+ int32_t east[4];
+ int32_t north[4];
+ int yaw, pitch;
+};
extern const struct cpu_stop mercenary_stop_at[];
void mercenary_load(void);
void mercenary_patch(void);
-uint32_t mercenary_palette(void);
+void mercenary_patch_render(int shadows);
+void mercenary_patch_vr(void);
+uint32_t mercenary_palette_view(void);
+uint32_t mercenary_palette_render(void);
+uint32_t mercenary_palette_predefined(void);
+uint32_t mercenary_palette_stars(void);
+void mercenary_get_sky_colors(uint16_t *day, uint16_t *night);
+uint32_t mercenary_object_vertex_register(void);
+void mercenary_get_orientation(double *roll, double *pitch, double *yaw);
+void mercenary_set_orientation(double yaw);
+void mercenary_get_orientation_raw(int16_t *pitch, uint16_t *yaw);
+void mercenary_get_orientation_planet(double *inclination, double *azimuth, int improved);
+void mercenary_get_location(int32_t *east, int32_t *height, int32_t *north);
+void mercenary_get_object_info(int *id, int32_t *east, int32_t *height, int32_t *north);
+void mercenary_get_building_exterior_info(int32_t *loc_x, int32_t *loc_z, int32_t *scale_x, int32_t *scale_y, int32_t *scale_z, uint16_t *anim_flag, uint16_t *anim_x, uint16_t *anim_y, uint16_t *anim_z, uint16_t *anim_phase, uint32_t *a4, uint32_t *a0, uint32_t *a5);
+void mercenary_coord_building_interior(int16_t *east, int32_t *height1, int32_t *height2, int32_t *height3, int32_t *height4, int16_t *north);
+int mercenary_street_color_index(void);
+int mercenary_line_tags_index(void);
+uint16_t mercenary_poly_tags_color(void);
+int mercenary_background_index(void);
+uint32_t mercenary_planet_scale_index(void);
+uint32_t mercenary_star_table(void);
+void mercenary_vr_move(int override, int32_t *east, int32_t *north, int yaw, int pitch);
+int mercenary_get_info_walking(void);
+extern const char *mercenary_name;
+extern const char *mercenary_gamesavesuffix;
+const uint8_t *get_mission_disk(int disk, int mission);