Turn VBL break point list into a structure to make game stop at various events
[mercenary-reloaded.git] / src / mercenary / mercenary2.c
index b8bad6c..4fd5df7 100644 (file)
 #include <stdint.h>
 #include <stdlib.h>
 #include "../libcpu/m68k.h"
+#include "../libcpu/execute.h"
 #include "mercenary.h"
 
 #define        INITIAL_STACK   0x7fffa
 #define RESET_VECTOR   0x59484
-const uint32_t mercenary_stop_at[] = {
-       0x59a4e,        /* done with rendering, waiting for VBL */
-       0x54c26,        /* after pressing 'HELP' key before showing menu line on benson */
-       0x55438,        /* waiting for menu command */
-       0x54c2e,        /* after pressing 'HELP' key while showing menu line on benson */
-       0x55446,        /* after pressing 'RETURN' while game waits for other key to resume */
-       0x51620,        /* after dying, waiting for VBL to fade out palette */
-       0x0 /* end */
-}; /* break points for rendering and continue with processing loop */
+
+/* interrupt CPU execution at special break points and tell emulation what to do */
+const struct cpu_stop mercenary_stop_at[] = {
+       { 0x59a4e,      STOP_AT_WAIT_VBL },     /* done with rendering, waiting for VBL */
+       { 0x54c26,      STOP_AT_WAIT_VBL },     /* after pressing 'HELP' key before showing menu line on benson */
+       { 0x55438,      STOP_AT_WAIT_VBL },     /* waiting for menu command */
+       { 0x54c2e,      STOP_AT_WAIT_VBL },     /* after pressing 'HELP' key while showing menu line on benson */
+       { 0x55446,      STOP_AT_WAIT_VBL },     /* after pressing 'RETURN' while game waits for other key to resume */
+       { 0x51620,      STOP_AT_WAIT_VBL },     /* after dying, waiting for VBL to fade out palette */
+       { 0x0,          STOP_AT_END },          /* end */
+};
 
 extern const uint32_t mercenary2_hex[];
 extern int mercenary2_hex_size;