X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=mercenary-reloaded.git;a=blobdiff_plain;f=src%2Fmercenary%2Fmercenary3.c;h=7fe20c256ca78b75ebe202d00b450d3e7741bc52;hp=28751e253e589c1b0660c4669b660f878a8a40d5;hb=2c16c55973325e3174916dbbbe2c466764149bef;hpb=e2d4abe7782a276d7a0b73b6149b3da6fd5f7cbb diff --git a/src/mercenary/mercenary3.c b/src/mercenary/mercenary3.c index 28751e2..7fe20c2 100644 --- a/src/mercenary/mercenary3.c +++ b/src/mercenary/mercenary3.c @@ -110,6 +110,9 @@ const struct cpu_stop mercenary_stop_at[] = { { 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 */ }; @@ -158,9 +161,10 @@ void mercenary_patch(void) //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 */ @@ -192,6 +196,22 @@ m68k_write_memory_16(0x4FB6c, 0x4e71); /* 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);