Battery fixes (unforunetly ZSNES is too complex for a full fix right now).
This commit is contained in:
@@ -821,6 +821,8 @@ clearsram:
|
|||||||
inc eax
|
inc eax
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz .loop
|
jnz .loop
|
||||||
|
cmp byte[SFXBATT],0
|
||||||
|
je .nosfxbatt
|
||||||
mov eax,[sfxramdata]
|
mov eax,[sfxramdata]
|
||||||
mov ecx,65536
|
mov ecx,65536
|
||||||
.loop2
|
.loop2
|
||||||
@@ -828,6 +830,7 @@ clearsram:
|
|||||||
inc eax
|
inc eax
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz .loop2
|
jnz .loop2
|
||||||
|
.nosfxbatt
|
||||||
|
|
||||||
cmp byte[SETAEnable],0
|
cmp byte[SETAEnable],0
|
||||||
je .nosetasram
|
je .nosetasram
|
||||||
@@ -1795,6 +1798,8 @@ NEWSYM StartGUI
|
|||||||
|
|
||||||
call SaveSramData
|
call SaveSramData
|
||||||
|
|
||||||
|
cmp byte[SFXBATT],0
|
||||||
|
je .nosfxbatt
|
||||||
clim
|
clim
|
||||||
mov edx,fnames+1
|
mov edx,fnames+1
|
||||||
call Create_File
|
call Create_File
|
||||||
@@ -1806,6 +1811,7 @@ NEWSYM StartGUI
|
|||||||
call Close_File
|
call Close_File
|
||||||
.nosfxramwrite
|
.nosfxramwrite
|
||||||
stim
|
stim
|
||||||
|
.nosfxbatt
|
||||||
|
|
||||||
cmp byte[SETAEnable],0
|
cmp byte[SETAEnable],0
|
||||||
je .nosetasram
|
je .nosetasram
|
||||||
|
|||||||
@@ -4430,7 +4430,7 @@ NEWSYM CheckROMType
|
|||||||
mov byte[SDD1Enable],0
|
mov byte[SDD1Enable],0
|
||||||
mov byte[SFXBATT],0
|
mov byte[SFXBATT],0
|
||||||
mov byte[OBCEnable],0
|
mov byte[OBCEnable],0
|
||||||
mov byte[CHIPSRAM],0
|
mov byte[CHIPBATT],0
|
||||||
mov byte[SGBEnable],0
|
mov byte[SGBEnable],0
|
||||||
mov byte[SETAEnable],0
|
mov byte[SETAEnable],0
|
||||||
mov byte[ST18Enable],0
|
mov byte[ST18Enable],0
|
||||||
@@ -4448,13 +4448,13 @@ NEWSYM CheckROMType
|
|||||||
cmp ax,02530h
|
cmp ax,02530h
|
||||||
jne .notOBC1
|
jne .notOBC1
|
||||||
mov byte[OBCEnable],1
|
mov byte[OBCEnable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notOBC1
|
.notOBC1
|
||||||
cmp ax,04532h
|
cmp ax,04532h
|
||||||
jne .notSDD1A
|
jne .notSDD1A
|
||||||
mov byte[SDD1Enable],1
|
mov byte[SDD1Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSDD1A
|
.notSDD1A
|
||||||
cmp ax,04332h
|
cmp ax,04332h
|
||||||
@@ -4475,7 +4475,7 @@ NEWSYM CheckROMType
|
|||||||
cmp ax,03523h
|
cmp ax,03523h
|
||||||
jne .notSA1A
|
jne .notSA1A
|
||||||
mov byte[SA1Enable],1
|
mov byte[SA1Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSA1A
|
.notSA1A
|
||||||
cmp ax,03423h
|
cmp ax,03423h
|
||||||
@@ -4486,13 +4486,13 @@ NEWSYM CheckROMType
|
|||||||
cmp ax,0F530h
|
cmp ax,0F530h
|
||||||
jne .notSETAA
|
jne .notSETAA
|
||||||
mov byte[ST18Enable],1
|
mov byte[ST18Enable],1
|
||||||
mov byte[CHIPSRAM],1 ;Check later if this should be removed
|
mov byte[CHIPBATT],1 ;Check later if this should be removed
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSETAA
|
.notSETAA
|
||||||
cmp ax,0F630h
|
cmp ax,0F630h
|
||||||
jne .notSETAB
|
jne .notSETAB
|
||||||
mov byte[SETAEnable],1
|
mov byte[SETAEnable],1
|
||||||
;; mov byte[CHIPSRAM],1 ;Check later if this should be removed
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSETAB
|
.notSETAB
|
||||||
;Super FX has SRAM, but only a battery to save it on the latter two
|
;Super FX has SRAM, but only a battery to save it on the latter two
|
||||||
@@ -4521,26 +4521,26 @@ NEWSYM CheckROMType
|
|||||||
cmp ax,05535h
|
cmp ax,05535h
|
||||||
jne .notRTCplain
|
jne .notRTCplain
|
||||||
mov byte[RTCEnable],1
|
mov byte[RTCEnable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notRTCplain
|
.notRTCplain
|
||||||
cmp ax,0F93Ah
|
cmp ax,0F93Ah
|
||||||
jne .notSPC7A
|
jne .notSPC7A
|
||||||
mov byte[SPC7110Enable],1
|
mov byte[SPC7110Enable],1
|
||||||
mov byte[RTCEnable],1
|
mov byte[RTCEnable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSPC7A
|
.notSPC7A
|
||||||
cmp ax,0F53Ah
|
cmp ax,0F53Ah
|
||||||
jne .notSPC7B
|
jne .notSPC7B
|
||||||
mov byte[SPC7110Enable],1
|
mov byte[SPC7110Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notSPC7B
|
.notSPC7B
|
||||||
cmp ax,00520h
|
cmp ax,00520h
|
||||||
jne .notDSP2
|
jne .notDSP2
|
||||||
mov byte[DSP2Enable],1
|
mov byte[DSP2Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notDSP2
|
.notDSP2
|
||||||
cmp ax,00330h
|
cmp ax,00330h
|
||||||
@@ -4553,7 +4553,7 @@ NEWSYM CheckROMType
|
|||||||
cmp byte[esi+5],0B2h ;Bandai only
|
cmp byte[esi+5],0B2h ;Bandai only
|
||||||
jne .notDSP3
|
jne .notDSP3
|
||||||
mov byte[DSP3Enable],1
|
mov byte[DSP3Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notDSP3
|
.notDSP3
|
||||||
cmp ah,3
|
cmp ah,3
|
||||||
@@ -4564,7 +4564,7 @@ NEWSYM CheckROMType
|
|||||||
cmp ah,5
|
cmp ah,5
|
||||||
jne .notDSP1B
|
jne .notDSP1B
|
||||||
mov byte[DSP1Enable],1
|
mov byte[DSP1Enable],1
|
||||||
mov byte[CHIPSRAM],1
|
mov byte[CHIPBATT],1
|
||||||
jmp .endchpdtct
|
jmp .endchpdtct
|
||||||
.notDSP1B
|
.notDSP1B
|
||||||
cmp byte[esi+5],033h
|
cmp byte[esi+5],033h
|
||||||
@@ -4799,7 +4799,7 @@ NEWSYM CheckROMType
|
|||||||
call GenerateBank0TableSA1
|
call GenerateBank0TableSA1
|
||||||
call SetAddressingModesSA1
|
call SetAddressingModesSA1
|
||||||
; open .srm file
|
; open .srm file
|
||||||
cmp byte[CHIPSRAM],1
|
cmp byte[CHIPBATT],1
|
||||||
jne .nosa1init
|
jne .nosa1init
|
||||||
mov edx,fnames+1
|
mov edx,fnames+1
|
||||||
call Open_File
|
call Open_File
|
||||||
@@ -4844,7 +4844,7 @@ NEWSYM CheckROMType
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
SECTION .bss
|
SECTION .bss
|
||||||
NEWSYM CHIPSRAM, resb 1
|
NEWSYM CHIPBATT, resb 1
|
||||||
NEWSYM SFXEnable, resb 1
|
NEWSYM SFXEnable, resb 1
|
||||||
NEWSYM C4Enable, resb 1
|
NEWSYM C4Enable, resb 1
|
||||||
NEWSYM SPC7110Enable, resb 1
|
NEWSYM SPC7110Enable, resb 1
|
||||||
|
|||||||
Reference in New Issue
Block a user