📄 spc700.s
字号:
/* * Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. * * (c) Copyright 1996 - 2001 Gary Henderson (gary@daniver.demon.co.uk) and * Jerremy Koot (jkoot@snes9x.com) * * Super FX C emulator code * (c) Copyright 1997 - 1999 Ivar (Ivar@snes9x.com) and * Gary Henderson. * Super FX assembler emulator code (c) Copyright 1998 zsKnight and _Demo_. * * DSP1 emulator code (c) Copyright 1998 Ivar, _Demo_ and Gary Henderson. * C4 asm and some C emulation code (c) Copyright 2000 zsKnight and _Demo_. * C4 C code (c) Copyright 2001 Gary Henderson (gary@daniver.demon.co.uk). * * DOS port code contains the works of other authors. See headers in * individual files. * * Snes9x homepage: www.snes9x.com * * Permission to use, copy, modify and distribute Snes9x in both binary and * source form, for non-commercial purposes, is hereby granted without fee, * providing that this license information and copyright notice appear with * all copies and any derived work. * * This software is provided 'as-is', without any express or implied * warranty. In no event shall the authors be held liable for any damages * arising from the use of this software. * * Snes9x is freeware for PERSONAL USE only. Commercial users should * seek permission of the copyright holders first. Commercial use includes * charging money for Snes9x or software derived from Snes9x. * * The copyright holders request that bug fixes and improvements to the code * should be forwarded to them so everyone can benefit from the modifications * in future versions. * * Super NES and Super Nintendo Entertainment System are trademarks of * Nintendo Co., Limited and its subsidiary companies. */#include "asmstruc.h"#include "spcops.h".section .rodata.LC2: .string "Sound CPU in unknown state executing %s at %04X\n%s\n".textSTOP: subl $100,%esp pushl %esi pushl %ebx movl APUPC,%edx movl APURAM,%eax subl %eax,%edx movl %edx,%eax andl $65535,%eax movl 112(%esp),%esi pushl %eax leal 12(%esp),%ebx pushl %ebx#ifdef DEBUGGER call S9xAPUOPrint#endif pushl %ebx movl APUPC,%edx movl APURAM,%eax subl %eax,%edx movl %edx,%eax pushl %eax pushl %esi pushl $.LC2 pushl $String call sprintf pushl $String pushl $5 pushl $4 call S9xMessage xorl %edx,%edx movl CPU,%ecx addl $40,%esp movb %dl,APUTimerEnabled+2 movb %dl,APUTimerEnabled+1 popl %ebx movb %dl,APUTimerEnabled orl $1,%ecx popl %esi movb %dl,APUExecuting movl %ecx,CPU addl $100,%esp retApuOp00: movl APUPC,%eax incl %eax movl %eax,APUPC retApuOp01: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb ApuS,%dl addb $-2,%dl movb APUExtraRAM+31,%al movb %dl,ApuS andl $255,%eax movb APUExtraRAM+30,%dl sall $8,%eax andl $255,%edx movl APURAM,%ecx addl %eax,%edx addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp11: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+29,%al movb APUExtraRAM+28,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp21: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+27,%al movb APUExtraRAM+26,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp31: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+25,%al movb APUExtraRAM+24,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp41: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+23,%al movb APUExtraRAM+22,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp51: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+21,%al movb APUExtraRAM+20,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp61: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+19,%al movb APUExtraRAM+18,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp71: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+17,%al movb APUExtraRAM+16,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp81: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+15,%al movb APUExtraRAM+14,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp91: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+13,%al movb APUExtraRAM+12,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpA1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+11,%al movb APUExtraRAM+10,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpB1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+9,%al movb APUExtraRAM+8,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpC1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+7,%al movb APUExtraRAM+6,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpD1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+5,%al movb APUExtraRAM+4,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpE1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+3,%al movb APUExtraRAM+2,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOpF1: pushl %ebx movl APURAM,%edx movl APUPC,%ebx movl %edx,%eax subl %eax,%ebx movb ApuS,%cl movl %ebx,%eax andl $255,%ecx incl %eax movw %ax,255(%edx,%ecx) movb APUExtraRAM+1,%al movb APUExtraRAM+0,%dl andl $255,%eax movb ApuS,%bl andl $255,%edx sall $8,%eax movl APURAM,%ecx addb $-2,%bl addl %eax,%edx movb %bl,ApuS addl %ecx,%edx popl %ebx movl %edx,APUPC retApuOp3F: pushl %ebx movl APUPC,%eax movw 1(%eax),%ax andl $65535,%eax movl APURAM,%edx movl %eax,APUAddress movl %edx,%eax movb ApuS,%cl movl APUPC,%ebx addl $-3,%eax andl $255,%ecx subl %eax,%ebx movw %bx,255(%edx,%ecx) movb ApuS,%bl movl APUAddress,%eax movl APURAM,%edx addb $-2,%bl addl %edx,%eax movb %bl,ApuS movl %eax,APUPC popl %ebx retApuOp4F: pushl %ebx movl APUPC,%eax movb 1(%eax),%cl movl APURAM,%edx movb %cl,Work8 movl %edx,%eax movl APUPC,%ebx movb ApuS,%cl addl $-2,%eax andl $255,%ecx subl %eax,%ebx movw %bx,255(%edx,%ecx) movb Work8,%al movb ApuS,%bl andl $255,%eax movl APURAM,%edx addb $-2,%bl addl $65280,%eax movb %bl,ApuS addl %edx,%eax popl %ebx movl %eax,APUPC retApuOp02: movl APUPC,%eax movb 1(%eax),%cl xorl %eax,%eax movb %cl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $1,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%eax addl $2,%eax addl $8,%esp movl %eax,APUPC retApuOp22: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $2,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp42: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $4,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp62: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $8,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp82: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $16,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpA2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $32,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpC2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $64,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpE2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc orb $128,%al addl $4,%esp andl $255,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp12: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $254,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp32: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $253,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp52: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $251,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp72: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $247,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOp92: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $239,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpB2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $223,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpD2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $191,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC retApuOpF2: movl APUPC,%eax movb 1(%eax),%dl xorl %eax,%eax movb %dl,%al pushl %eax pushl %eax call S9xAPUGetByteZ__FUc addl $4,%esp andl $127,%eax pushl %eax call S9xAPUSetByteZ__FUcUc movl APUPC,%ecx addl $2,%ecx addl $8,%esp movl %ecx,APUPC ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -