diff --git a/zsnes/src/makefile.ms b/zsnes/src/makefile.ms index 1db97a19..2b891131 100644 --- a/zsnes/src/makefile.ms +++ b/zsnes/src/makefile.ms @@ -405,7 +405,7 @@ ${WINDIR}/zsnes.res: ${WINDIR}/zsnes.rc ${WINDIR}/afxres.h ${WINDIR}/resource.h rc ${WINDIR}/zsnes.rc else ${WINDIR}/winlink${OE}: ${WINDIR}/winlink.cpp ${WINDIR}/resource.h - ${CPPC} -O0 ${CFLAGS} -masm=intel -o $@ -c ${WINDIR}/winlink.cpp + ${CPPC} ${COPT} ${CFLAGS} -masm=intel -o $@ -c ${WINDIR}/winlink.cpp ${WINDIR}/zsnes${OE}: ${WINDIR}/zsnes.rc ${WINDIR}/afxres.h ${WINDIR}/resource.h ${WINDRES} --include-dir ${WINDIR} ${WINDIR}/zsnes.rc -o${WINDIR}/zsnes${OE} ${OBJFIX}: objfix.c diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 7cbecad0..ddfcb713 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -56,8 +56,10 @@ asm_call() can be treated like any C function, use it to call an assembly functi #ifdef __GNUC__ //MinGW //Simple start and end structure, set as volatile so perhaps we can use -O1+ later -#define ASM_BEGIN asm volatile ( -#define ASM_END ); +#define ASM_BEGIN asm volatile ( \ +ASM_COMMAND(pushad) +#define ASM_END ASM_COMMAND(popad) \ +); //All commands need quotes and a newline and tab. C vars are _ prefixed #define ASM_COMMAND(line) #line"\n\t" #define ASM_COMMAND2(line, part2) #line", "#part2"\n\t"