From 20cd13cec833048a5335741abb396a0130f84b34 Mon Sep 17 00:00:00 2001 From: zsknight <> Date: Sun, 15 Apr 2001 08:19:09 +0000 Subject: [PATCH] Added SPC7110 logger --- zsnes/src/cpu/execute.asm | 4 ++++ zsnes/src/dos/debug.asm | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index 37248251..f69122e1 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -113,6 +113,7 @@ EXTSYM SfxPBR,SCBRrel,SfxSCBR,SfxCOLR,hdmaearlstart,SFXCounter EXTSYM fxbit01,fxbit01pcal,fxbit23,fxbit23pcal,fxbit45,fxbit45pcal,fxbit67,fxbit67pcal EXTSYM SfxSFR EXTSYM cpucycle,debstop,switchtovirqdeb,debstop3,switchtonmideb +EXTSYM ReadSPC7110log,WriteSPC7110log NEWSYM ExecuteAsmStart @@ -745,6 +746,7 @@ NetSaveState: call UpdateDPage call SA1UpdateDPage call Makemode7Table + call ReadSPC7110log cmp byte[SFXEnable],0 je .nosfxud call UpdateSFX @@ -1189,6 +1191,8 @@ reexecuteb2: call DeInitPostGame .skippostgame + call WriteSPC7110log + ; clear all keys call Check_Key cmp al,0 diff --git a/zsnes/src/dos/debug.asm b/zsnes/src/dos/debug.asm index 1a6c6431..26d5b39a 100644 --- a/zsnes/src/dos/debug.asm +++ b/zsnes/src/dos/debug.asm @@ -48,6 +48,7 @@ EXTSYM curypos,xa,xd,xdb,xe,xp,xpb,xpc,xs,xx,xy EXTSYM SA1xpb,SA1xpc,SA1xa,SA1xx,SA1xy,SA1xd,SA1xdb,SA1xs EXTSYM cycpbl,debugbuf,soundon,spcA,spcNZ,spcP,spcPCRam EXTSYM spcRam,spcRamDP,spcS,spcX,spcY +EXTSYM CurPtrVal,SPC7110Enable NEWSYM DebugAsmStart @@ -242,6 +243,42 @@ NEWSYM debstop3, db 0 NEWSYM debstop4, db 0 SECTION .text +NEWSYM WriteSPC7110log + cmp byte[SPC7110Enable],0 + je .nospc7110 + mov edx,SPC7110fn + call Create_File + mov bx,ax + mov ecx,8 + mov edx,DecompAPtr + call Write_File + mov edx,CurPtrVal + mov ecx,[DecompAPtr] + shl ecx,3 + add ecx,27 + call Write_File + call Close_File +.nospc7110 + ret +NEWSYM ReadSPC7110log + cmp byte[SPC7110Enable],0 + je .nospc7110 + mov edx,SPC7110fn + call Open_File + jc .nospc7110 + mov bx,ax + mov ecx,8 + mov edx,DecompAPtr + call Read_File + mov edx,CurPtrVal + mov ecx,[DecompAPtr] + shl ecx,3 + add ecx,27 + call Read_File + call Close_File +.nospc7110 + ret +SPC7110fn db 'SPC7110.dat',0 NEWSYM loadtempstuff ; Load stuff