⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asmops.h

📁 SFC游戏模拟器 snes9x 1.43 的原代码
💻 H
📖 第 1 页 / 共 2 页
字号:
.macro Lsr8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	tst #1,r0	mov #Carry,r1	bf/s .Lsr8Carry\K	or r1,FLAGS	add #-Carry,FLAGS.Lsr8Carry\K:		shlr r0	mov.l S9xSetByte,r3	SetZNlink r0.endm.macro Lsr16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	tst #1,r0	mov #Carry,r1	bf/s .Lsr16Carry\K	or r1,FLAGS	add #-Carry,FLAGS.Lsr16Carry\K:		shlr r0	mov.l S9xSetWord,r3	Set16ZNlink r0.endm.macro Rol8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	GetCarry	mov #1,r2	rotcl r0	or r2,FLAGS	shll8 r2	tst r2,r0	bf/s .Rol8Carry\K	mov.l S9xSetByte,r3	add #-Carry,FLAGS.Rol8Carry\K:		SetZNlink r0.endm.macro Rol16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	GetCarry	mov #1,r2	rotcl r0	or r2,FLAGS	shll16 r2	tst r2,r0	bf/s .Rol16Carry\K	mov.l S9xSetWord,r3	add #-Carry,FLAGS.Rol16Carry\K:		Set16ZNlink r0.endm.macro Ror8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	mov #1,r1	and FLAGS,r1	shll8 r1	or r1,r0	shlr r0	mov #Carry,r1	bt/s .Ror8Carry\K	or r1,FLAGS	add #-Carry,FLAGS.Ror8Carry\K:		mov.l S9xSetByte,r3	SetZNlink r0.endm.macro Ror16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	mov #1,r1	and FLAGS,r1	shll16 r1	or r1,r0	shlr r0	mov #Carry,r1	bt/s .Ror16Carry\K	or r1,FLAGS	add #-Carry,FLAGS.Ror16Carry\K:		mov.l S9xSetWord,r3	Set16ZNlink r0.endm.macro Bit8 K	mov.l S9xGetByte,r3	jsr @r3	nop	exts.b r0,r7	mov #0x40,r2	shll16 r7	tst r2,r0	bf/s .Bit8Ovf\K	or r2,FLAGS	sub r2,FLAGS.Bit8Ovf\K:	and A,r0	jmp @r13	or r0,r7.endm.macro Bit16 K	mov.l S9xGetWord,r3	jsr @r3	nop	mov #0x40,r2	exts.w r0,r7	shll8 r2	sub r0,r7	tst r2,r0	shlr8 r2	bf/s .Bit16Ovf\K	or r2,FLAGS	sub r2,FLAGS.Bit16Ovf\K:	and A,r0	jmp @r13	or r0,r7.endm.macro Dec8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif#ifdef CPU_SHUTDOWN	mov #0,r3#endif	add #-1,r0#ifdef CPU_SHUTDOWN	mov.l r3,WaitAddress#endif	mov.l S9xSetByte,r3	SetZNlink r0.endm.macro Dec16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif#ifdef CPU_SHUTDOWN	mov #0,r3#endif	add #-1,r0#ifdef CPU_SHUTDOWN	mov.l r3,WaitAddress#endif	mov.l S9xSetWord,r3	Set16ZNlink r0.endm.macro Inc8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif#ifdef CPU_SHUTDOWN	mov #0,r3#endif	add #1,r0#ifdef CPU_SHUTDOWN	mov.l r3,WaitAddress#endif	mov.l S9xSetByte,r3	SetZNlink r0.endm.macro Inc16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif#ifdef CPU_SHUTDOWN	mov #0,r3#endif	add #1,r0#ifdef CPU_SHUTDOWN	mov.l r3,WaitAddress#endif	mov.l S9xSetWord,r3	Set16ZNlink r0.endm.macro Sta8 K	mov.l S9xSetByte,r3	mov A,r0	Xlink.endm.macro Sta16 K	mov.l S9xSetWord,r3	mov A,r0	Xlink.endm.macro Stx8 K	mov.l S9xSetByte,r3	mov.b XL,r0	Xlink.endm.macro Stx16 K	mov.l S9xSetWord,r3	mov.w XX,r0	Xlink.endm.macro Sty8 K	mov.l S9xSetByte,r3	mov.b YL,r0	Xlink.endm.macro Sty16 K	mov.l S9xSetWord,r3	mov.w YY,r0	Xlink.endm.macro Stz8 K	mov.l S9xSetByte,r3	mov #0,r0	Xlink.endm.macro Stz16 K	mov.l S9xSetWord,r3	mov #0,r0	Xlink.endm.macro Trb8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	extu.w r7,r2	sub r2,r7	extu.b A,r2	and r0,r2	or r2,r7	sub r2,r0	mov.l S9xSetByte,r3	Xlink.endm.macro Trb16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	extu.w r7,r2	sub r2,r7	extu.w A,r2	and r0,r2	or r2,r7	sub r2,r0	mov.l S9xSetWord,r3	Xlink.endm.macro Tsb8 K	mov.l S9xGetByte,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	extu.w r7,r2	sub r2,r7	extu.b A,r2	and r0,r2	or r2,r7	or A,r0	mov.l S9xSetByte,r3	Xlink.endm.macro Tsb16 K	mov.l S9xGetWord,r3	jsr @r3#ifdef VAR_CYCLES	add #6,CYCLES#else	nop#endif	extu.w r7,r2	sub r2,r7	extu.w A,r2	and r0,r2	or r2,r7	or A,r0	mov.l S9xSetWord,r3	Xlink.endm.macro CheckForIrqjmp K	mov #IRQ,r0	tst r0,FLAGS	bf .CheckForIrqS9xExit\K	mov.b IRQActive,r0	tst r0,r0	bt .CheckForIrqS9xExit\K	mov.l S9xOpcode_IRQ,r3	Xlink.CheckForIrqS9xExit\K:	jmp @r13	nop.endm.macro S9xFixCycles K	mov FLAGS16,r0	mov #Emulation/4,r1	shll2 r1	tst r1,r0	bt/s .S9xFixCyclesNoEmulation\K	mov.l ICPU,r3#ifndef VAR_CYCLES	mov.l .S9xE1M1X1\K,r0	mov.l r0,@r3#endif	mov.l .S9xOpcodesM1X1\K,r0	bra .S9xFixCyclesS9xExit\K	mov.l r0,@(4,r3).S9xFixCyclesNoEmulation\K:		tst #MemoryFlag,r0	bt .S9xFixCyclesNoMemory\K	tst #IndexFlag,r0	bt .S9xFixCyclesNoIndex\K#ifndef VAR_CYCLES	mov.l .S9xE0M1X1\K,r0	mov.l r0,@r3#endif	mov.l .S9xOpcodesM1X1\K,r0	bra .S9xFixCyclesS9xExit\K	mov.l r0,@(4,r3).S9xFixCyclesNoIndex\K:#ifndef VAR_CYCLES	mov.l .S9xE0M1X0\K,r0	mov.l r0,@r3#endif	mov.l .S9xOpcodesM1X0\K,r0	bra .S9xFixCyclesS9xExit\K	mov.l r0,@(4,r3).S9xFixCyclesNoMemory\K:	tst #IndexFlag,r0	bt .S9xFixCyclesNoIndex2\K#ifndef VAR_CYCLES	mov.l .S9xE0M0X1\K,r0	mov.l r0,@r3#endif	mov.l .S9xOpcodesM0X1\K,r0	bra .S9xFixCyclesS9xExit\K	mov.l r0,@(4,r3).S9xFixCyclesNoIndex2\K:#ifndef VAR_CYCLES	mov.l .S9xE0M0X0\K,r0	mov.l r0,@r3#endif	mov.l .S9xOpcodesM0X0\K,r0	bra .S9xFixCyclesS9xExit\K	mov.l r0,@(4,r3)	.align 2.S9xOpcodesM0X0\K:	.long	_S9xOpcodesM0X0.S9xOpcodesM0X1\K:	.long	_S9xOpcodesM0X1.S9xOpcodesM1X0\K:	.long	_S9xOpcodesM1X0.S9xOpcodesM1X1\K:	.long	_S9xOpcodesM1X1#ifndef VAR_CYCLES.S9xE0M0X0\K:	.long	S9xE0M0X0.S9xE0M0X1\K:	.long	S9xE0M0X1.S9xE0M1X0\K:	.long	S9xE0M1X0.S9xE0M1X1\K:	.long	S9xE0M1X1.S9xE1M1X1\K:	.long	S9xE1M1X1#endif.S9xFixCyclesS9xExit\K:.endm.macro S9xUnpackStatus K	exts.b FLAGS,r7	mov #Zero,r0	shll16 r7	tst r0,FLAGS	rotcl r7.endm.macro S9xPackStatus K	cmp/pz r7	mov #(Negative|Zero)/2,r2        add r2,r2	bf/s PackStatusNeg\K	or r2,FLAGS	add #-Negative,FLAGSPackStatusNeg\K:	extu.w r7,r2	tst r2,r2	bt PackStatusZero\K	add #-Zero,FLAGSPackStatusZero\K:.endm.macro CPUShutdown K#ifdef CPU_SHUTDOWN	mov.l Settings,r1	mov.b Shutdown,r0	tst r0,r0	bt .NoCPUShutdown\K	mov.l WaitAddress,r0	cmp/eq PC,r0	bf .NoCPUShutdown\K	mov.l WaitCounter,r0	tst r0,r0	bf .CPUShutdownNotYet\K!	mov.l Flags,r2!	mov.w .ShutdownMask\K,r1!	tst r2,r1!	bf .CPUShutdownNotYet\K	#ifdef ARMAPU	mov #0,r2	mov.l NextEvent, CYCLES	jmp @r13	mov.l r2,WaitAddress#else	mov.l IAPU,r1	mov #0,r2	mov.b APUExecuting,r0	mov.l NextEvent, CYCLES	tst r0,r0	mov.l r2,WaitAddress	bt .NoCPUShutdown\K	mov.l ICPU,r1	mov #0,r0	mov.l r4,@-r15	mov.b r0, CPUExecuting.CPUShutdownAPUExecLoop\K:#ifdef DEBUGGER	testb $2,APUFlags	je .CPUShutdownNoAPUTrace\K	STORE_REGISTERS	ccall S9xTraceAPU	LOAD_REGISTERS.CPUShutdownNoAPUTrace\K:#endif#ifdef SPC700_C	mov.l IAPU,r1	SAVE_CYCLES	mov.l APUPC,r0	PUSH_REGISTERS	mov.b @r0,r0#else	mov.b @APUPC,r0#endif	mov.l .S9xAPUCycles\K,r1	extu.b r0,r0	mov.l .S9xApuOpcodes\K,r2	shll2 r0	mov.l @(r0,r1),r4	mov.l @(r0,r2),r0	mov.l APU,r1	mov.l APUCycles,r2	add r4,r2	jsr @r0	mov.l r2,APUCycles#ifdef SPC700_C	POP_REGISTERS	LOAD_CYCLES#endif	mov.l APU,r1	mov.l NextEvent,r2	mov.l APUCycles,r3	cmp/ge r2,r3	bf .CPUShutdownAPUExecLoop\K	mov.l ICPU,r1	mov #1,r0	mov.l @r15+,r4	jmp @r13	mov.b r0, CPUExecuting	.align 2.S9xAPUCycles\K:	.long _S9xAPUCycles.S9xApuOpcodes\K:	.long _S9xApuOpcodes#endif /* ARMAPU */.ShutdownMask\K:	.word NMI_FLAG | IRQ_PENDING_FLAG.CPUShutdownNotYet\K:	mov #2,r2	cmp/hs r2,r0	bf/s .CPUShutdownDecCounter\K	add #-1,r0	mov #1,r0.CPUShutdownDecCounter\K:	jmp @r13	mov.l r0,WaitCounter.NoCPUShutdown\K:		jmp @r13	nop#endif.endm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -