📄 execute.asm
字号:
mov [ebx+12],ebp
emms
ret
NEWSYM RestoreCVFrame
push edx
push eax
mov ebx,[PBackupPos]
shl ebx,19
add ebx,[StateBackup]
add ebx,1024
BackupCVRMacB zsmesg,[PHnum2writecpureg]
BackupCVRMac cycpbl,2
BackupCVRMacB sndrot,3019
BackupCVRMacM [wramdata],8192
BackupCVRMacM [vram],4096
cmp byte[spcon],0
je .nospcon
BackupCVRMacB spcRam,[PHspcsave]
BackupCVRMacM DSPMem,16
.nospcon
cmp byte[C4Enable],1
jne .noc4
BackupCVRMac [C4Ram],800h
.noc4
cmp byte[SFXEnable],1
jne .nosfx
BackupCVRMacM [sfxramdata],8192
.nosfx
cmp byte[SA1Enable],1
jne near .nossa1
BackupCVRMacB SA1Mode,[PHnum2writesa1reg]
BackupCVRMacM [SA1RAMArea],8192
BackupCVRMacB SA1Status,3
BackupCVRMac prevedi,1
BackupCVRMac SA1xpc,1
BackupCVRMac SA1RAMArea,6
BackupCVRMac sa1dmaptr,2
.nossa1
cmp byte[DSP1Type],0
je near .nodsp1type
BackupCVRMacB DSP1COp,70+128
BackupCVRMacB C4WFXVal,7*4+7*8+128
BackupCVRMacB C41FXVal,5*4+128
BackupCVRMacB Op00Multiplicand,3*4+128
BackupCVRMacB Op10Coefficient,4*4+128
BackupCVRMacB Op04Angle,4*4+128
BackupCVRMacB Op08X,5*4+128
BackupCVRMacB Op18X,5*4+128
BackupCVRMacB Op28X,4*4+128
BackupCVRMacB Op0CA,5*4+128
BackupCVRMacB Op1CAZ,15*4+128
BackupCVRMacB Op02FX,11*4+3*4+28*8+128
BackupCVRMacB Op0AVS,5*4+14*8+128
BackupCVRMacB Op06X,6*4+10*8+4+128
BackupCVRMacB Op01m,4*4+128
BackupCVRMacB Op0DX,6*4+128
BackupCVRMacB Op03F,6*4+128
BackupCVRMacB Op14Zr,9*4+128
BackupCVRMacB Op0EH,4*4+128
.nodsp1type
BackupCVRMacB soundcycleft,33
BackupCVRMac spc700read,10
BackupCVRMac timer2upd,1
BackupCVRMac xa,14
BackupCVRMacB spcnumread,1
BackupCVRMac opcd,6
BackupCVRMacB HIRQCycNext,5
BackupCVRMac oamaddr,14
BackupCVRMacB prevoamptr,1
BackupCVRMac ReadHead,1
mov edx,[sram]
mov ecx,[ramsize]
shr ecx,4
or ecx,ecx
jz .end
.loop
movq mm0,[ebx]
movq mm1,[ebx+8]
movq [edx],mm0
movq [edx+8],mm1
add edx,16
add ebx,16
loop .loop
.end
pop eax
pop edx
mov esi,[ebx]
mov edi,[ebx+4]
mov ecx,[ebx+8]
mov [tempedx],ecx
mov ebp,[ebx+12]
call UpdateDPage
call SA1UpdateDPage
emms
ret
NEWSYM MuteVoiceF, db 0
VoiceEndMute:
mov byte[MuteVoiceF],0
ret
%macro StartMute 1
mov al,[Voice0Status+%1]
or al,al
jz %%notmuted
or byte[MuteVoiceF],1 << %1
%%notmuted
%endmacro
VoiceStartMute:
mov byte[MuteVoiceF],0
push eax
StartMute 0
StartMute 1
StartMute 2
StartMute 3
StartMute 4
StartMute 5
StartMute 6
StartMute 7
pop eax
ret
NetSaveState:
call joinflags
; de-init variables (copy to variables)
mov [spcPCRam],ebp
mov [Curtableaddr],edi
mov [xp],dl
mov [curcyc],dh
mov eax,[initaddrl]
sub esi,eax ; subtract program counter by address
mov [xpc],si
call ResetTripleBuf
mov eax,[KeySaveState]
cmp byte[CNetType],20
je .skipsoundreinit
test byte[pressed+eax],1
jnz .soundreinit
mov eax,[KeyLoadState]
test byte[pressed+eax],1
jz .skipsoundreinit
.soundreinit
mov byte[NoSoundReinit],1
mov byte[csounddisable],1
.skipsoundreinit
call statesaver
; initialize variables (Copy from variables)
call UpdateDPage
call SA1UpdateDPage
call Makemode7Table
cmp byte[SFXEnable],0
je .nosfxud
call UpdateSFX
.nosfxud
xor eax,eax
xor ebx,ebx
xor ecx,ecx
xor edx,edx
mov bl,[xpb]
mov ax,[xpc]
test ax,8000h
jz .loweraddr
mov esi,[snesmmap+ebx*4]
jmp .skiplower
.loweraddr
cmp ax,4300h
jb .lower
cmp dword[memtabler8+ebx*4],regaccessbankr8
je .dma
.lower
mov esi,[snesmap2+ebx*4]
jmp .skiplower
.dma
mov esi,dmadata-4300h
.skiplower
mov [initaddrl],esi
add esi,eax ; add program counter to address
mov dl,[xp] ; set flags
mov dh,[curcyc] ; set cycles
mov bl,dl
; cmp byte[CNetType],20
; je .skipmovie
; cmp byte[CNetType],21
; je .skipmovie
; jmp .skipmovie
; cmp byte[MovieProcessing],0
; jne .movie
;.skipmovie
cmp byte[spcon],0
je .nosoundta
mov edi,[tableadc+ebx*4]
or byte[curexecstate],2
jmp .soundta
.nosoundta
mov edi,[tableadb+ebx*4]
and byte[curexecstate],0FDh
.soundta
jmp .nomovie
.movie
mov edi,[tableadc+ebx*4]
test byte[curexecstate],2
jnz .nomovie
mov edi,[tableadb+ebx*4]
.nomovie
mov ebp,[spcPCRam]
mov byte[NoSoundReinit],0
mov byte[csounddisable],0
mov byte[NextNGDisplay],0
call splitflags
ret
%macro stim 0
; cmp byte[OSPort],1
; ja %%nosti
%ifdef __MSDOS__
sti
%endif
;%%nosti
%endmacro
%macro clim 0
; cmp byte[OSPort],1
; ja %%nocli
%ifdef __MSDOS__
cli
%endif
;%%nocli
%endmacro
%macro ProcessIRQStuffB 0
; check for VIRQ/HIRQ/NMI
test dl,04h
jnz %%noirq
test byte[INTEnab],20h
jz %%novirq
mov ax,[VIRQLoc]
cmp word[curypos],ax
je near .virq
jmp %%noirq
%%novirq
test byte[INTEnab],10h
jnz near .virq
%%noirq
test byte[INTEnab],20h
jz %%novirq2b
mov ax,[VIRQLoc]
cmp word[curypos],ax
jne %%novirq2b
cmp byte[intrset],1
jne %%nointrset2b
mov byte[intrset],2
%%nointrset2b
%%novirq2b
%endmacro
%macro ProcessIRQStuffC 0
; check for VIRQ/HIRQ
cmp byte[virqnodisable],1
je %%virqdo
test dl,04h
jnz %%virqdo
cmp byte[doirqnext],1
je near .virq
%%virqdo
test byte[INTEnab],20h
jz near %%novirq
mov ax,[VIRQLoc]
add ax,[IRQHack]
cmp ax,[resolutn]
jne %%notres
dec ax
; inc ax
%%notres
cmp ax,0FFFFh
jne %%notzero
xor ax,ax
%%notzero
cmp word[curypos],ax
jne near %%noirq
%%startirq
cmp byte[intrset],1
jne %%nointrseta
mov byte[intrset],2
%%nointrseta
mov byte[irqon],80h
test dl,04h
jnz %%irqd
test byte[INTEnab],10h
jnz %%tryhirq
jmp .virq
%%novirq
test byte[INTEnab],10h
jz %%noirq
%%tryhirq
jmp .virq
jmp %%startirq
%%irqd
mov byte[doirqnext],1
%%noirq
%endmacro
%macro ProcessIRQStuff 0
; check for VIRQ/HIRQ
cmp byte[virqnodisable],1
je %%virqdo
test dl,04h
jnz %%virqdo
cmp byte[doirqnext],1
je near .virq
%%virqdo
test byte[INTEnab],20h
jz near %%novirq
mov ax,[VIRQLoc]
add ax,[IRQHack]
cmp ax,[resolutn]
jne %%notres
dec ax
; inc ax
%%notres
cmp ax,0FFFFh
jne %%notzero
xor ax,ax
%%notzero
cmp word[curypos],ax
jne near %%noirq
test byte[INTEnab],10h
jnz %%tryhirq
%%startirq
cmp byte[intrset],1
jne %%nointrseta
mov byte[intrset],2
%%nointrseta
mov byte[irqon],80h
test dl,04h
jnz %%irqd
jmp .virq
%%novirq
test byte[INTEnab],10h
jz %%noirq
%%setagain
cmp byte[intrset],2
jbe %%nointrseta3
dec byte[intrset]
cmp byte[intrset],2
ja %%noirq
%%nointrseta3
cmp byte[intrset],1
jne %%nointrseta2
cmp byte[hirqmode2],1
je %%hirqchange
mov byte[intrset],8
jmp %%noirq
%%hirqchange
mov byte[intrset],3
jmp %%setagain
%%nointrseta2
test dl,04h
jnz %%noirq
%%tryhirq
jmp %%startirq
%%irqd
mov byte[doirqnext],1
%%noirq
%endmacro
; .returnfromsfx
; pexecs
; *** Copy to PC whenever a non-relative jump is executed
NEWSYM romloadskip, db 0
NEWSYM abcdefg, dd 0
NEWSYM abcdefg1, dd 0
NEWSYM abcdefg2, dd 0
NEWSYM abcdefg3, dd 0
NEWSYM SSKeyPressed, dd 0
NEWSYM NoSoundReinit, dd 0
NEWSYM NextNGDisplay, db 0
NEWSYM TempVidInfo, dd 0
NEWSYM tempdh, db 0
NEWSYM start65816
call initvideo
cmp byte[videotroub],1
jne .notrouble
ret
.notrouble
; cmp byte[OSPort],2
; jae .nonewgfxcheck
jmp .nonewgfxcheck
cmp byte[cbitmode],1
jne .nonewgfxcheck
cmp byte[newengen],1
jne .nonewgfxcheck
cmp byte[cvidmode],3
jne .nocorrectmode
cmp byte[newgfx16b],1
je .nonewgfxcheck
jmp .correctmode
.nocorrectmode
mov dword[Msgptr],newgfxerror2
jmp .correctmode
mov dword[Msgptr],newgfxerror
.correctmode
mov eax,[MsgCount]
mov [MessageOn],eax
mov byte[newengen],0
.nonewgfxcheck
mov edi,[vidbufferofsa]
mov ecx,37518
xor eax,eax
rep stosd
; mov edi,[vidbufferofsb]
; mov ecx,37518
; xor eax,eax
; rep stosd
cmp byte[romloadskip],1
je near StartGUI
NEWSYM continueprog
; clear keyboard presses
mov esi,pressed
mov ecx,256+128+64
mov al,0
.loopa
mov [esi],al
inc esi
loop .loopa
mov byte[romloadskip],0
mov byte[debuggeron],0
mov byte[exiter],0
call InitPreGame
jmp reexecute
NEWSYM continueprognokeys
mov byte[romloadskip],0
mov byte[debuggeron],0
mov byte[exiter],0
call InitPreGame
jmp reexecutenokeys
; Incorrect
NEWSYM reexecute
; clear keyboard presses
mov esi,pressed
mov ecx,256+128+64
mov al,0
.loopa
cmp byte[esi],2
jne .notclear
mov [esi],al
.notclear
inc esi
loop .loopa
reexecutenokeys
jmp reexecuteb2
NEWSYM reexecuteb
;cmp byte[OSPort],1
;ja reexecuteb2
%ifdef __MSDOS__
mov esi,pressed
mov ecx,256+128+64
mov al,0
.loopa
cmp byte[esi],2
jne .notclear
mov [esi],al
.notclear
inc esi
loop .loopa
%endif
reexecuteb2:
; temporary sprite displayer
; mov edx,.sdispname
; call Open_File
; jc .failedsd
; mov bx,ax
; mov ecx,544
; mov edx,oamram
; call Read_File
; call Close_File
;.failedsd
; jmp .skipsd
;.sdispname db 'MMX3.SPR',0
;.skipsd
cmp byte[NoSoundReinit],1
je .skippregame
call SetupPreGame
.skippregame
; initialize variables (Copy from variables)
call UpdateDPage
call SA1UpdateDPage
call Makemode7Table
call ReadSPC7110log
cmp byte[SFXEnable],0
je .nosfxud
call UpdateSFX
.nosfxud
xor eax,eax
xor ebx,ebx
xor ecx,ecx
xor edx,edx
mov bl,[xpb]
mov ax,[xpc]
test ax,8000h
jz .loweraddr
mov esi,[snesmmap+ebx*4]
jmp .skiplower
.loweraddr
cmp ax,4300h
jb .lower
cmp dword[memtabler8+ebx*4],regaccessbankr8
je .dma
.lower
mov esi,[snesmap2+ebx*4]
jmp .skiplower
.dma
mov esi,dmadata-4300h
.skiplower
mov [initaddrl],esi
add esi,eax ; add program counter to address
mov dl,[xp] ; set flags
mov dh,[curcyc] ; set cycles
mov bl,dl
; cmp byte[CNetType],20
; je .skipmovie
; cmp byte[CNetType],21
; je .skipmovie
; jmp .skipmovie
; cmp byte[MovieProcessing],0
; jne .movie
;.skipmovie
cmp byte[spcon],0
je .nosoundta
mov edi,[tableadc+ebx*4]
or byte[curexecstate],2
jmp .soundta
.nosoundta
mov edi,[tableadb+ebx*4]
and byte[curexecstate],0FDh
.soundta
jmp .nomovie
.movie
mov edi,[tableadc+ebx*4]
test byte[curexecstate],2
jnz .nomovie
mov edi,[tableadb+ebx*4]
.nomovie
mov ebp,[spcPCRam]
mov byte[NoSoundReinit],0
mov byte[csounddisable],0
mov byte[NextNGDisplay],0
mov byte[NetPlayNoMore],1
call splitflags
; cmp byte[MovieProcessing],0
; jne .movie2
call execute
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -