From cd7798dd8d9cead1b2f129aaa2c3054a2dc897e4 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Tue, 12 Oct 2004 18:56:55 +0000 Subject: [PATCH] Made battery for SFX more meaningful, fixed SRAM not being cleared. --- zsnes/src/cpu/execute.asm | 10 +++++----- zsnes/src/gui/gui.asm | 14 ++++---------- zsnes/src/gui/guinetpl.inc | 2 +- zsnes/src/init.asm | 10 +++++----- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index 3d1c23d2..f242deb4 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -1394,17 +1394,17 @@ NEWSYM endprog call Write_File call Close_File .nosram - cmp byte[SFXSRAM],0 - je .nosfxsram + cmp byte[SFXBATT],0 + je .nosfxbatt mov edx,fnames+1 call Create_File - jc .nosfxsram + jc .nosfxbatt mov bx,ax mov ecx,65536 mov edx,[sfxramdata] call Write_File call Close_File -.nosfxsram +.nosfxbatt cmp byte[SETAEnable],0 je .nosetasram @@ -1521,7 +1521,7 @@ NEWSYM initaddrl, dd 0 ; initial address location NEWSYM NetSent, dd 0 NEWSYM nextframe, dd 0 ; tick count for timer NEWSYM curfps, db 0 ; frame/sec for current screen -NEWSYM SFXSRAM, db 0 +NEWSYM SFXBATT, db 0 NEWSYM newgfxerror, db 'NEED MEMORY FOR GFX ENGINE',0 NEWSYM newgfxerror2, db 'NEED 320x240 FOR NEW GFX 16B',0 ;newgfxerror db 'NEW GFX IN 16BIT IS N/A',0 diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index 899f25ab..81fd0316 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -15,7 +15,7 @@ ;along with this program; if not, write to the Free Software ;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + ; Sorry. The GUI code is a total mess. One problem I encountered is that ; there seems to be a bug in nasm with using math calculations combined ; with macros within macros, so in some macro definitions, I had to @@ -60,7 +60,7 @@ ; ButtonProcess - routines that processes boxed buttons ; CheatCodeSearchInit ; guiwincontrol - + %include "macros.mac" @@ -77,7 +77,7 @@ EXTSYM Voice0Status, Voice1Status, Voice2Status, Voice3Status, Voice4Status EXTSYM Voice5Status, Voice6Status, Voice7Status, romtype, SetIRQVectors EXTSYM ClearScreen, statesaver, loadstate2, vidbuffer, ASCII2Font, hirestiledat EXTSYM showallext, ROMTypeNOTFound, scanlines,statefileloc,pl1selk,pl2selk -EXTSYM fnamest,sprlefttot,spritetablea,fnames,SFXSRAM,sfxramdata,setaramdata,SETAEnable,cgram,srama +EXTSYM fnamest,sprlefttot,spritetablea,fnames,SFXBATT,sfxramdata,setaramdata,SETAEnable,cgram,srama EXTSYM tempco0,prevbright,maxbr,prevpal,coladdr,coladdg,coladdb EXTSYM scaddtype,ScreenScale,vesa2red10,initvideo2,initvideo,pressed,UpdateDevices EXTSYM memtabler8,memtablew8,writeon,pl1contrl,pl2contrl,JoyRead,SetInputDevice @@ -145,7 +145,7 @@ EXTSYM CReadHead,ReadHead,CFWriteHead,CFWriteStart EXTSYM JoyX,JoyY,JoyMinX,JoyMinY,JoyMaxX,JoyMaxY,JoyMinX209,JoyMaxX209 EXTSYM JoyMinY209,JoyMaxY209,GetCoords,GetCoords3 EXTSYM MultiTap,SFXEnable -EXTSYM RestoreSystemVars +EXTSYM RestoreSystemVars EXTSYM TCPIPStartServer EXTSYM TCPIPInitConnectToServer EXTSYM TCPIPWaitForConnection @@ -807,8 +807,6 @@ clearsram: inc eax dec ecx jnz .loop - cmp byte[SFXSRAM],0 - je .nosfxsram mov eax,[sfxramdata] mov ecx,65536 .loop2 @@ -816,7 +814,6 @@ clearsram: inc eax dec ecx jnz .loop2 -.nosfxsram cmp byte[SETAEnable],0 je .nosetasram @@ -1784,8 +1781,6 @@ NEWSYM StartGUI call SaveSramData - cmp byte[SFXSRAM],0 - je .nosfxsram clim mov edx,fnames+1 call Create_File @@ -1797,7 +1792,6 @@ NEWSYM StartGUI call Close_File .nosfxramwrite stim -.nosfxsram cmp byte[SETAEnable],0 je .nosetasram diff --git a/zsnes/src/gui/guinetpl.inc b/zsnes/src/gui/guinetpl.inc index 33ca6a42..0b93bd3f 100644 --- a/zsnes/src/gui/guinetpl.inc +++ b/zsnes/src/gui/guinetpl.inc @@ -1422,7 +1422,7 @@ SECTION .data SECTION .text transfersram: - cmp byte[SFXSRAM],0 + cmp byte[SFXBATT],0 jne .nosram cmp byte[SA1Enable],1 je .nosram diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index c46fab3b..53436e62 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -97,7 +97,7 @@ EXTSYM SRAMDir,SRAMDrive,cfgloadsdir,fnamest,statefileloc EXTSYM ForcePal,ForceROMTiming,ForceHiLoROM,InitDir,InitDrive,enterpress,frameskip EXTSYM maxromspace,curromspace,infoloc, patchfile EXTSYM gotoroot,headdata,printnum,romispal -EXTSYM InitFxTables,SFXSRAM,SfxR1,SfxR2,SfxSCMR,SfxSFR,finterleave +EXTSYM InitFxTables,SFXBATT,SfxR1,SfxR2,SfxSCMR,SfxSFR,finterleave EXTSYM initregr,initregw,memtabler16,DSP1Read16b3F,memaccessbankr16 EXTSYM memtabler8,DSP1Read8b3F,memaccessbankr8,memtablew16,DSP1Write16b EXTSYM memaccessbankw16,memtablew8,DSP1Write8b,memaccessbankw8,DSP1Write16b3F @@ -294,7 +294,7 @@ NEWSYM init ; above (by placing two digits in the extension). This is so ; as not to break any other code later on which depends ; on it being present. - mov ebx,[statefileloc] + mov ebx,[statefileloc] %ifdef __LINUX__ mov word[fnamest+ebx-1],'st' %else @@ -4424,7 +4424,7 @@ NEWSYM CheckROMType mov byte[RTCEnable],0 mov byte[SA1Enable],0 mov byte[SDD1Enable],0 - mov byte[SFXSRAM],0 + mov byte[SFXBATT],0 mov byte[OBCEnable],0 mov byte[CHIPSRAM],0 mov byte[SGBEnable],0 @@ -4507,14 +4507,14 @@ int 3h cmp ax,01520h jne .notSFXC mov byte[SFXEnable],1 - mov byte[SFXSRAM],1 ;Contains Battery + mov byte[SFXBATT],1 ;Contains Battery jmp .endchpdtct .notSFXC cmp ax,01A20h jne .notSFXD mov byte[SFXEnable],1 + mov byte[SFXBATT],1 ;Contains Battery mov byte[SFXIRQFlag],1 - mov byte[SFXSRAM],1 ;Contains Battery jmp .endchpdtct .notSFXD cmp ax,05535h