/* cause why the cpu execution loop stopped */
enum {
STOP_AT_END = 0,
+ STOP_AT_PATCH_RENDER,
STOP_AT_WAIT_VBL,
STOP_AT_WAIT_INPUT,
STOP_AT_CLEAR_SCREEN1,
extern const struct cpu_stop mercenary_stop_at[];
void mercenary_load(void);
void mercenary_patch(void);
+void mercenary_patch_render(void);
uint32_t mercenary_palette_view(void);
uint32_t mercenary_palette_render(void);
uint32_t mercenary_palette_predefined(void);
{ 0x511FE, STOP_AT_DRAW_SIGHTS }, /* when sights are rendered */
{ 0x5351A, STOP_AT_EXPLOSION }, /* explosion debris */
{ 0x4C514, STOP_AT_EXPLOSION },
+ { 0x52C42, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
+ { 0x528C4, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
+ { 0x45806, STOP_AT_PATCH_RENDER }, /* patch away planet rendering (would crash without check above) */
{ 0x0, STOP_AT_END }, /* end */
};
m68k_write_memory_32(0x54ffc, 1);
}
+/* skip certain parts when rendering improved graphics */
+void mercenary_patch_render(void)
+{
+ switch (REG_PC) {
+ case 0x52C42: /* take that branch, so planets get rendered behind obersver */
+ REG_PC += 10;
+ break;
+ case 0x528C4: /* take that branch, so planets get rendered behind obersver */
+ REG_PC += 10;
+ break;
+ case 0x45806: /* just RTS to avoid crashing of rendering functions when planets are behind obersver */
+ REG_PC -= 2;
+ break;
+ }
+}
+
uint32_t mercenary_palette_view(void)
{
return m68k_read_memory_32(0x007c14);
{ 0x4F748, STOP_AT_POLY_UKN2 },
{ 0x54362, STOP_AT_EXPLOSION }, /* explosion debris */
{ 0x4CA18, STOP_AT_EXPLOSION },
+ { 0x53A6C, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
+ { 0x537B0, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
+ { 0x45806, STOP_AT_PATCH_RENDER }, /* patch away planet rendering (would crash without check above) */
{ 0x0, STOP_AT_END }, /* end */
};
//m68k_write_memory_16(0x58388, 0x4E75); /* rts */
//m68k_write_memory_16(0x4FE3E, 0x4E75); /* rts */
-//test: loesche mit index 0
-//m68k_write_memory_16(0x5ABC2, 0x4e71); /* nop */
-//
+//m68k_write_memory_16(0x53A6C, 0x6008); /* bra */
+//m68k_write_memory_16(0x537B0, 0x6008); /* bra */
+//m68k_write_memory_16(0x45806, 0x4E75); /* rts */
+
//m68k_write_memory_16(0x54342, 0x4e71); /* nop */
//m68k_write_memory_16(0x54344, 0x4e71); /* nop */
//m68k_write_memory_16(0x5059e, 0x3f0); /* nop */
m68k_write_memory_32(0x55f5c, 1);
}
+/* skip certain parts when rendering improved graphics */
+void mercenary_patch_render(void)
+{
+ switch (REG_PC) {
+ case 0x53A6C: /* take that branch, so planets get rendered behind obersver */
+ REG_PC += 10;
+ break;
+ case 0x537B0: /* take that branch, so planets get rendered behind obersver */
+ REG_PC += 10;
+ break;
+ case 0x45806: /* just RTS to avoid crashing of rendering functions when planets are behind obersver */
+ REG_PC -= 2;
+ break;
+ }
+}
+
uint32_t mercenary_palette_view(void)
{
return m68k_read_memory_32(0x0072b0);