No more S-DD1 packs. No more S-DD1 logging. [grinvade]

This commit is contained in:
n-a-c-h
2004-12-07 22:47:06 +00:00
parent d50eff9903
commit 502ef17b05
4 changed files with 561 additions and 561 deletions

View File

@@ -1357,22 +1357,22 @@ NEWSYM endprog
mov ebx,SRAMDir mov ebx,SRAMDir
call Change_Dir call Change_Dir
EXTSYM SDD1Array,SDD1Entry,SDD1Sort ; EXTSYM SDD1Array,SDD1Entry,SDD1Sort
call SDD1Sort ; call SDD1Sort
; jmp .nodecomppack ; jmp .nodecomppack
cmp byte[SDD1Enable],0 ; cmp byte[SDD1Enable],0
jne .yesdecomppack ; jne .yesdecomppack
cmp dword[SDD1Entry],0 ; cmp dword[SDD1Entry],0
je .nodecomppack ; je .nodecomppack
.yesdecomppack ;.yesdecomppack
mov edx,sdd1fname ; mov edx,sdd1fname
call Create_File ; call Create_File
mov bx,ax ; mov bx,ax
mov edx,SDD1Array ; mov edx,SDD1Array
mov ecx,[SDD1Entry] ; mov ecx,[SDD1Entry]
call Write_File ; call Write_File
call Close_File ; call Close_File
.nodecomppack ;.nodecomppack
cmp byte[sramsavedis],1 cmp byte[sramsavedis],1
je .nosram je .nosram
@@ -1489,9 +1489,9 @@ NEWSYM endprog
;.nodeinitipx ;.nodeinitipx
%endif %endif
jmp OSExit jmp OSExit
SECTION .data ;SECTION .data
NEWSYM sdd1fname, db 'sdd1dat.dat',0,0 ;NEWSYM sdd1fname, db 'sdd1dat.dat',0,0
SECTION .text ;SECTION .text
NEWSYM interror NEWSYM interror
stim stim

View File

@@ -4924,10 +4924,10 @@ NEWSYM SA1RAMaccessbankw16b
ret ret
SECTION .bss SECTION .bss
NEWSYM SDD1Array, resb 65536 ;NEWSYM SDD1Array, resb 65536
NEWSYM SDD1Entry, resd 1 ;NEWSYM SDD1Entry, resd 1
NEWSYM SDD1EntryPtr, resd 1 ;NEWSYM SDD1EntryPtr, resd 1
NEWSYM SDD1IdxXferSize, resd 1 ;NEWSYM SDD1IdxXferSize, resd 1
SECTION .text SECTION .text
%macro GetBankLog 1 %macro GetBankLog 1
@@ -5040,288 +5040,288 @@ SECTION .text
; File loading version ; File loading version
NEWSYM oldmemaccessbankr8sdd1 ;NEWSYM oldmemaccessbankr8sdd1
; TestSDD1 ; TestSDD1
; jmp debugdecompress ; jmp debugdecompress
; call FillArray ; call FillArray
mov byte[.found4],0 ; mov byte[.found4],0
cmp byte[AddrNoIncr],0 ; cmp byte[AddrNoIncr],0
je near .failed ; je near .failed
cmp dword[Sdd1Mode],2 ; cmp dword[Sdd1Mode],2
je near .decompress ; je near .decompress
mov [Sdd1Bank],ebx ; mov [Sdd1Bank],ebx
mov [Sdd1Addr],ecx ; mov [Sdd1Addr],ecx
mov [Sdd1NewAddr],ecx ; mov [Sdd1NewAddr],ecx
; Start Actual Decompressor ; Start Actual Decompressor
mov dword[Sdd1Mode],2 ; mov dword[Sdd1Mode],2
push edx ; push edx
push eax ; push eax
push ecx ; push ecx
mov dword[SDD1EntryPtr],0 ; mov dword[SDD1EntryPtr],0
mov eax,ebx ; mov eax,ebx
shl eax,16 ; shl eax,16
mov ax,cx ; mov ax,cx
and eax,0FFFFFh ; and eax,0FFFFFh
shl eax,4 ; shl eax,4
GetBankLog cl ; GetBankLog cl
or al,cl ; or al,cl
cmp dx,8192 ;eax,4f1591h ; cmp dx,8192 ;eax,4f1591h
jbe .nota ; jbe .nota
; mov byte[debstop3],1 ; mov byte[debstop3],1
.nota ;.nota
mov ecx,[SPC7110Entries] ; mov ecx,[SPC7110Entries]
mov edx,[spc7110romptr] ; mov edx,[spc7110romptr]
or ecx,ecx ; or ecx,ecx
jz .notfound ; jz .notfound
.loop ;.loop
cmp dword[edx],eax ; cmp dword[edx],eax
je .found2 ; je .found2
add edx,12 ; add edx,12
dec ecx ; dec ecx
jnz .loop ; jnz .loop
jmp .notfound ; jmp .notfound
.found2 ;.found2
mov eax,[edx+8] ; mov eax,[edx+8]
mov [SDD1IdxXferSize],eax ; mov [SDD1IdxXferSize],eax
mov eax,[edx+4] ; mov eax,[edx+4]
mov [SDD1EntryPtr],eax ; mov [SDD1EntryPtr],eax
mov byte[.found4],1 ; mov byte[.found4],1
.notfound ;.notfound
pop ecx ; pop ecx
pop eax ; pop eax
pop edx ; pop edx
push eax ; push eax
cmp byte[.found4],1 ; cmp byte[.found4],1
jne near .logit ; jne near .logit
cmp edx,[SDD1IdxXferSize] ; cmp edx,[SDD1IdxXferSize]
jbe near .nomore ; jbe near .nomore
.logit ;.logit
mov eax,[SDD1Entry] ; mov eax,[SDD1Entry]
cmp eax,65536 ; cmp eax,65536
je near .nomore ; je near .nomore
push edx ; push edx
xor edx,edx ; xor edx,edx
or eax,eax ; or eax,eax
jz .noentries ; jz .noentries
.trynext ;.trynext
cmp byte[SDD1Array+edx],bl ; cmp byte[SDD1Array+edx],bl
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+1],ch ; cmp byte[SDD1Array+edx+1],ch
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+2],cl ; cmp byte[SDD1Array+edx+2],cl
jne .nomatch ; jne .nomatch
jmp .found ; jmp .found
.nomatch ;.nomatch
add edx,8 ; add edx,8
cmp edx,eax ; cmp edx,eax
jne .trynext ; jne .trynext
.noentries ;.noentries
pop edx ; pop edx
mov [SDD1Array+eax],bl ; mov [SDD1Array+eax],bl
mov [SDD1Array+eax+1],ch ; mov [SDD1Array+eax+1],ch
mov [SDD1Array+eax+2],cl ; mov [SDD1Array+eax+2],cl
mov [SDD1Array+eax+3],dh ; mov [SDD1Array+eax+3],dh
mov [SDD1Array+eax+4],dl ; mov [SDD1Array+eax+4],dl
push ebx ; push ebx
GetBankLog bl ; GetBankLog bl
cmp dword[SDD1EntryPtr],0 ; cmp dword[SDD1EntryPtr],0
je .notthere ; je .notthere
or bl,0F0h ; or bl,0F0h
.notthere ;.notthere
mov [SDD1Array+eax+7],bl ; mov [SDD1Array+eax+7],bl
pop ebx ; pop ebx
add dword[SDD1Entry],8 ; add dword[SDD1Entry],8
.nomore ;.nomore
pop eax ; pop eax
jmp .decompress ; jmp .decompress
.found ;.found
mov eax,edx ; mov eax,edx
pop edx ; pop edx
push ebx ; push ebx
mov ebx,eax ; mov ebx,eax
mov al,[SDD1Array+ebx+4] ; mov al,[SDD1Array+ebx+4]
mov ah,[SDD1Array+ebx+3] ; mov ah,[SDD1Array+ebx+3]
cmp ax,dx ; cmp ax,dx
jae .notgreater ; jae .notgreater
mov [SDD1Array+ebx+4],dl ; mov [SDD1Array+ebx+4],dl
mov [SDD1Array+ebx+3],dh ; mov [SDD1Array+ebx+3],dh
.notgreater ;.notgreater
pop ebx ; pop ebx
pop eax ; pop eax
.decompress ;.decompress
cmp [Sdd1Bank],ebx ; cmp [Sdd1Bank],ebx
jne .nomoredec ; jne .nomoredec
cmp [Sdd1Addr],ecx ; cmp [Sdd1Addr],ecx
je .yesdec ; je .yesdec
.nomoredec ;.nomoredec
mov ebx,[snesmmap+ebx*4] ; mov ebx,[snesmmap+ebx*4]
mov al,[ebx+ecx] ; mov al,[ebx+ecx]
push eax ; push eax
mov eax,memtabler8+0C0h*4 ; mov eax,memtabler8+0C0h*4
mov ebx,40h ; mov ebx,40h
.loopb ;.loopb
mov dword[eax],memaccessbankr8 ; mov dword[eax],memaccessbankr8
add eax,4 ; add eax,4
dec ebx ; dec ebx
jnz .loopb ; jnz .loopb
pop eax ; pop eax
xor ebx,ebx ; xor ebx,ebx
ret ; ret
.yesdec ;.yesdec
cmp dword[SDD1EntryPtr],0 ; cmp dword[SDD1EntryPtr],0
je .nodecompress ; je .nodecompress
push ebx ; push ebx
mov ebx,[SDD1EntryPtr] ; mov ebx,[SDD1EntryPtr]
inc dword[SDD1EntryPtr] ; inc dword[SDD1EntryPtr]
mov al,[ebx] ; mov al,[ebx]
pop ebx ; pop ebx
ret ; ret
.nodecompress ;.nodecompress
mov al,0FFh ; mov al,0FFh
ret ; ret
.failed ;.failed
push ebx ; push ebx
call .nomoredec ; call .nomoredec
pop ebx ; pop ebx
jmp memaccessbankr8 ; jmp memaccessbankr8
; Start Debug Decompressor ; Start Debug Decompressor
SECTION .bss ;SECTION .bss
.found4 resb 1 ;.found4 resb 1
SECTION .text ;SECTION .text
FillArray: ;FillArray:
TestSDD1 ; TestSDD1
push ecx ; push ecx
push eax ; push eax
mov eax,[SDD1Entry] ; mov eax,[SDD1Entry]
cmp eax,65536 ; cmp eax,65536
je near .nomore ; je near .nomore
push edx ; push edx
xor edx,edx ; xor edx,edx
or eax,eax ; or eax,eax
jz .noentries ; jz .noentries
.trynext ;.trynext
cmp byte[SDD1Array+edx],bl ; cmp byte[SDD1Array+edx],bl
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+1],ch ; cmp byte[SDD1Array+edx+1],ch
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+2],cl ; cmp byte[SDD1Array+edx+2],cl
jne .nomatch ; jne .nomatch
jmp .found ; jmp .found
.nomatch ;.nomatch
add edx,8 ; add edx,8
cmp edx,eax ; cmp edx,eax
jne .trynext ; jne .trynext
.noentries ;.noentries
pop edx ; pop edx
mov [SDD1Array+eax],bl ; mov [SDD1Array+eax],bl
mov [SDD1Array+eax+1],ch ; mov [SDD1Array+eax+1],ch
mov [SDD1Array+eax+2],cl ; mov [SDD1Array+eax+2],cl
mov [SDD1Array+eax+3],dh ; mov [SDD1Array+eax+3],dh
mov [SDD1Array+eax+4],dl ; mov [SDD1Array+eax+4],dl
push ebx ; push ebx
GetBankLog bl ; GetBankLog bl
mov [SDD1Array+eax+7],bl ; mov [SDD1Array+eax+7],bl
pop ebx ; pop ebx
add dword[SDD1Entry],8 ; add dword[SDD1Entry],8
.nomore ;.nomore
pop eax ; pop eax
jmp .decompress ; jmp .decompress
.found ;.found
pop edx ; pop edx
pop eax ; pop eax
.decompress ;.decompress
pop ecx ; pop ecx
ret ; ret
debugdecompress: ;debugdecompress:
cmp byte[AddrNoIncr],0 ; cmp byte[AddrNoIncr],0
je near .failed ; je near .failed
cmp dword[Sdd1Mode],2 ; cmp dword[Sdd1Mode],2
je near .decompress ; je near .decompress
TestSDD1 ; TestSDD1
mov [Sdd1Bank],ebx ; mov [Sdd1Bank],ebx
mov [Sdd1Addr],ecx ; mov [Sdd1Addr],ecx
mov [Sdd1NewAddr],ecx ; mov [Sdd1NewAddr],ecx
mov dword[Sdd1Mode],2 ; mov dword[Sdd1Mode],2
; jmp .decompress ; comment this out to activate array ; jmp .decompress ; comment this out to activate array
push eax ; push eax
mov eax,[SDD1Entry] ; mov eax,[SDD1Entry]
cmp eax,65536 ; cmp eax,65536
je near .nomore ; je near .nomore
push edx ; push edx
xor edx,edx ; xor edx,edx
or eax,eax ; or eax,eax
jz .noentries ; jz .noentries
.trynext ;.trynext
cmp byte[SDD1Array+edx],bl ; cmp byte[SDD1Array+edx],bl
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+1],ch ; cmp byte[SDD1Array+edx+1],ch
jne .nomatch ; jne .nomatch
cmp byte[SDD1Array+edx+2],cl ; cmp byte[SDD1Array+edx+2],cl
jne .nomatch ; jne .nomatch
jmp .found ; jmp .found
.nomatch ;.nomatch
add edx,8 ; add edx,8
cmp edx,eax ; cmp edx,eax
jne .trynext ; jne .trynext
.noentries ;.noentries
pop edx ; pop edx
mov [SDD1Array+eax],bl ; mov [SDD1Array+eax],bl
mov [SDD1Array+eax+1],ch ; mov [SDD1Array+eax+1],ch
mov [SDD1Array+eax+2],cl ; mov [SDD1Array+eax+2],cl
mov [SDD1Array+eax+3],dh ; mov [SDD1Array+eax+3],dh
mov [SDD1Array+eax+4],dl ; mov [SDD1Array+eax+4],dl
push ebx ; push ebx
GetBankLog bl ; GetBankLog bl
mov [SDD1Array+eax+7],bl ; mov [SDD1Array+eax+7],bl
pop ebx ; pop ebx
add dword[SDD1Entry],8 ; add dword[SDD1Entry],8
.nomore ;.nomore
pop eax ; pop eax
jmp .decompress ; jmp .decompress
.found ;.found
pop edx ; pop edx
pop eax ; pop eax
.decompress ;.decompress
cmp [Sdd1Bank],ebx ; cmp [Sdd1Bank],ebx
jne .nomoredec ; jne .nomoredec
cmp [Sdd1Addr],ecx ; cmp [Sdd1Addr],ecx
je .yesdec ; je .yesdec
.nomoredec ;.nomoredec
mov ebx,[snesmmap+ebx*4] ; mov ebx,[snesmmap+ebx*4]
mov al,[ebx+ecx] ; mov al,[ebx+ecx]
push eax ; push eax
mov eax,memtabler8+0C0h*4 ; mov eax,memtabler8+0C0h*4
mov ebx,40h ; mov ebx,40h
.loop ;.loop
mov dword[eax],memaccessbankr8 ; mov dword[eax],memaccessbankr8
add eax,4 ; add eax,4
dec ebx ; dec ebx
jnz .loop ; jnz .loop
pop eax ; pop eax
xor ebx,ebx ; xor ebx,ebx
ret ; ret
.yesdec ;.yesdec
push ecx ; push ecx
mov ecx,[Sdd1NewAddr] ; mov ecx,[Sdd1NewAddr]
mov ebx,[snesmmap+ebx*4] ; mov ebx,[snesmmap+ebx*4]
mov al,[ebx+ecx] ; mov al,[ebx+ecx]
xor ebx,ebx ; xor ebx,ebx
inc word[Sdd1NewAddr] ; inc word[Sdd1NewAddr]
pop ecx ; pop ecx
ret ; ret
.failed ;.failed
push ebx ; push ebx
call .nomoredec ; call .nomoredec
pop ebx ; pop ebx
jmp memaccessbankr8 ; jmp memaccessbankr8
NEWSYM MemoryAsmEnd NEWSYM MemoryAsmEnd

View File

@@ -21,7 +21,7 @@ EXTSYM DosExit,curblank,previdmode,start65816,wramdata,C4Ram,cnetplaybuf
EXTSYM UpdateDPage,SA1Enable,splitflags,joinflags,delay EXTSYM UpdateDPage,SA1Enable,splitflags,joinflags,delay
EXTSYM Open_File,Read_File,Create_File,Write_File,Close_File,romdata EXTSYM Open_File,Read_File,Create_File,Write_File,Close_File,romdata
EXTSYM Check_Key,Get_Key EXTSYM Check_Key,Get_Key
EXTSYM SDD1Array, SDD1Entry ;EXTSYM SDD1Array, SDD1Entry
EXTSYM LastLog EXTSYM LastLog
EXTSYM fulladdtab EXTSYM fulladdtab
EXTSYM DecompArray,DecompAPtr EXTSYM DecompArray,DecompAPtr
@@ -58,62 +58,62 @@ NEWSYM DebugAsmStart
; debstop at regsw.asm 2118/2119 ; debstop at regsw.asm 2118/2119
NEWSYM SDD1Sort ;NEWSYM SDD1Sort
mov ecx,[SDD1Entry] ; mov ecx,[SDD1Entry]
cmp ecx,8 ; cmp ecx,8
jbe near .noSDD1 ; jbe near .noSDD1
sub ecx,8 ; sub ecx,8
.next2 ;.next2
xor esi,esi ; xor esi,esi
xor ebx,ebx ; xor ebx,ebx
.next ;.next
xor eax,eax ; xor eax,eax
xor edx,edx ; xor edx,edx
mov al,[SDD1Array+ebx] ; mov al,[SDD1Array+ebx]
shl eax,16 ; shl eax,16
mov ah,[SDD1Array+ebx+1] ; mov ah,[SDD1Array+ebx+1]
mov al,[SDD1Array+ebx+2] ; mov al,[SDD1Array+ebx+2]
mov dl,[SDD1Array+ebx+8] ; mov dl,[SDD1Array+ebx+8]
shl edx,16 ; shl edx,16
mov dh,[SDD1Array+ebx+9] ; mov dh,[SDD1Array+ebx+9]
mov dl,[SDD1Array+ebx+10] ; mov dl,[SDD1Array+ebx+10]
cmp edx,eax ; cmp edx,eax
ja .noswap ; ja .noswap
mov eax,dword[SDD1Array+ebx] ; mov eax,dword[SDD1Array+ebx]
mov edx,dword[SDD1Array+ebx+8] ; mov edx,dword[SDD1Array+ebx+8]
mov dword[SDD1Array+ebx+8],eax ; mov dword[SDD1Array+ebx+8],eax
mov dword[SDD1Array+ebx],edx ; mov dword[SDD1Array+ebx],edx
mov eax,dword[SDD1Array+ebx+4] ; mov eax,dword[SDD1Array+ebx+4]
mov edx,dword[SDD1Array+ebx+12] ; mov edx,dword[SDD1Array+ebx+12]
mov dword[SDD1Array+ebx+12],eax ; mov dword[SDD1Array+ebx+12],eax
mov dword[SDD1Array+ebx+4],edx ; mov dword[SDD1Array+ebx+4],edx
mov esi,1 ; mov esi,1
.noswap ;.noswap
add ebx,8 ; add ebx,8
cmp ebx,ecx ; cmp ebx,ecx
jne near .next ; jne near .next
or esi,esi ; or esi,esi
jnz near .next2 ; jnz near .next2
xor ebx,ebx ; xor ebx,ebx
.next3 ;.next3
mov al,[SDD1Array+ebx] ; mov al,[SDD1Array+ebx]
mov ah,[SDD1Array+ebx+8] ; mov ah,[SDD1Array+ebx+8]
cmp al,ah ; cmp al,ah
jne .notequal ; jne .notequal
mov ah,[SDD1Array+ebx+9] ; mov ah,[SDD1Array+ebx+9]
mov al,[SDD1Array+ebx+10] ; mov al,[SDD1Array+ebx+10]
mov dh,[SDD1Array+ebx+1] ; mov dh,[SDD1Array+ebx+1]
mov dl,[SDD1Array+ebx+2] ; mov dl,[SDD1Array+ebx+2]
sub ax,dx ; sub ax,dx
mov [SDD1Array+ebx+5],ah ; mov [SDD1Array+ebx+5],ah
mov [SDD1Array+ebx+6],al ; mov [SDD1Array+ebx+6],al
.notequal ;.notequal
add ebx,8 ; add ebx,8
cmp ebx,ecx ; cmp ebx,ecx
jne near .next3 ; jne near .next3
.noSDD1 ;.noSDD1
ret ; ret
NEWSYM startdebugger NEWSYM startdebugger
mov byte[curblank],40h mov byte[curblank],40h
@@ -135,8 +135,8 @@ NEWSYM startdebugger
call cleardisplay call cleardisplay
; sort SDD1 ; sort SDD1
; jmp .noSDD1 ; jmp .noSDD1
call SDD1Sort ; call SDD1Sort
.noSDD1 ;.noSDD1
pushad pushad
call LastLog call LastLog

View File

@@ -3038,20 +3038,20 @@ SECTION .text
SECTION .data SECTION .data
SDD1DIRA db 'SOCNSDD1',0 ;SDD1DIRA db 'SOCNSDD1',0
SDD1DIRB db 'SFZ2SDD1',0 ;SDD1DIRB db 'SFZ2SDD1',0
SDD1DIRC db 'SFA2SDD1',0 ;SDD1DIRC db 'SFA2SDD1',0
SDD1DIRD db 'SF2ESDD1',0 ;SDD1DIRD db 'SF2ESDD1',0
SPC7110DirEntry db '*.bin',0 SPC7110DirEntry db '*.bin',0
NEWSYM SDD1Offset, dd 65536*8 NEWSYM SDD1Offset, dd 65536*8
%ifndef __LINUX__ ;%ifndef __LINUX__
NEWSYM SDD1nfname, db ' \_00000-0.bin',0 ;NEWSYM SDD1nfname, db ' \_00000-0.bin',0
%else ;%else
NEWSYM SDD1nfname, db ' /_00000-0.bin',0 ;NEWSYM SDD1nfname, db ' /_00000-0.bin',0
%endif ;%endif
NEWSYM SDD1ifname, db 'sdd1gfx.idx',0 ;NEWSYM SDD1ifname, db 'sdd1gfx.idx',0
NEWSYM SDD1dfname, db 'sdd1gfx.dat',0 ;NEWSYM SDD1dfname, db 'sdd1gfx.dat',0
NEWSYM SDD1pfname, db 'sdd1gfx.pat',0 ;NEWSYM SDD1pfname, db 'sdd1gfx.pat',0
spc7110notfound db 'DECOMPRESSED PACK NOT FOUND',0 spc7110notfound db 'DECOMPRESSED PACK NOT FOUND',0
spc7110notfoundb db 'INDEX DATA NOT FOUND',0 spc7110notfoundb db 'INDEX DATA NOT FOUND',0
@@ -3061,13 +3061,13 @@ SPC7110Allocated resb 1
SPC7110CPtr resd 1 SPC7110CPtr resd 1
SPC7110CPtr2 resd 1 SPC7110CPtr2 resd 1
NEWSYM SPC7110Entries, resd 1 NEWSYM SPC7110Entries, resd 1
SDD1PatchAddr resd 1 ;SDD1PatchAddr resd 1
SDD1PatchOfs resd 1 ;SDD1PatchOfs resd 1
SDD1PatchLen resd 1 ;SDD1PatchLen resd 1
SECTION .text SECTION .text
EXTSYM sdd1fname ;EXTSYM sdd1fname
NEWSYM SPC7110Load NEWSYM SPC7110Load
mov dword[SPC7110Entries],0 mov dword[SPC7110Entries],0
@@ -3096,28 +3096,28 @@ NEWSYM SPC7110Load
.sdd1 .sdd1
cmp al,045h cmp al,045h
jne .noSDD1 jne .noSDD1
mov edx,SDD1DIRA ; mov edx,SDD1DIRA
mov dword[sdd1fname],'socn' ; mov dword[sdd1fname],'socn'
jmp .sdd1b jmp .sdd1b
.noSDD1 .noSDD1
cmp al,043h cmp al,043h
jne .noSDD1a jne .noSDD1a
add esi,3 ; add esi,3
mov al,[esi] ; mov al,[esi]
cmp al,0 cmp al,0
jne .notsfz2 jne .notsfz2
mov edx,SDD1DIRB ; mov edx,SDD1DIRB
mov dword[sdd1fname],'sfz2' ; mov dword[sdd1fname],'sfz2'
jmp .sdd1b jmp .sdd1b
.notsfz2 .notsfz2
cmp al,01h cmp al,01h
jne .notsfa2 jne .notsfa2
mov edx,SDD1DIRC ; mov edx,SDD1DIRC
mov dword[sdd1fname],'sfa2' ; mov dword[sdd1fname],'sfa2'
jmp .sdd1b jmp .sdd1b
.notsfa2 .notsfa2
mov edx,SDD1DIRD ; mov edx,SDD1DIRD
mov dword[sdd1fname],'sf2e' ; mov dword[sdd1fname],'sf2e'
jmp .sdd1b jmp .sdd1b
.noSDD1a .noSDD1a
ret ret
@@ -3139,165 +3139,165 @@ NEWSYM SPC7110Load
call Change_Single_Dir call Change_Single_Dir
jc near .nodir jc near .nodir
mov eax,[spc7110romptr] ; mov eax,[spc7110romptr]
mov [SPC7110CPtr],eax ; mov [SPC7110CPtr],eax
add eax,[SDD1Offset] ; add eax,[SDD1Offset]
mov [SPC7110CPtr2],eax ; mov [SPC7110CPtr2],eax
mov edx,SDD1ifname ; mov edx,SDD1ifname
call Open_File ; call Open_File
jc near .noindexfile ; jc near .noindexfile
mov bx,ax ; mov bx,ax
mov edx,[SPC7110CPtr] ; mov edx,[SPC7110CPtr]
mov ecx,[SDD1Offset] ; mov ecx,[SDD1Offset]
call Read_File ; call Read_File
add dword[SPC7110CPtr],eax ; add dword[SPC7110CPtr],eax
xor ecx,ecx ; xor ecx,ecx
or eax,eax ; or eax,eax
jz .notfoundb ; jz .notfoundb
push ebx ; push ebx
xor edx,edx ; xor edx,edx
mov ebx,12 ; mov ebx,12
div ebx ; div ebx
mov dword[SPC7110Entries],eax ; mov dword[SPC7110Entries],eax
mov ecx,eax ; mov ecx,eax
mov eax,[spc7110romptr] ; mov eax,[spc7110romptr]
mov ebx,[SPC7110CPtr2] ; mov ebx,[SPC7110CPtr2]
.sdd1loop ;.sdd1loop
add [eax+4],ebx ; add [eax+4],ebx
add eax,12 ; add eax,12
dec ecx ; dec ecx
jnz .sdd1loop ; jnz .sdd1loop
pop ebx ; pop ebx
.notfoundb ;.notfoundb
call Close_File ; call Close_File
mov edx,SDD1dfname ; mov edx,SDD1dfname
call Open_File ; call Open_File
jc near .noindexfile ; jc near .noindexfile
mov bx,ax ; mov bx,ax
mov edx,[SPC7110CPtr2] ; mov edx,[SPC7110CPtr2]
mov ecx,7*1024*1024 ; mov ecx,7*1024*1024
call Read_File ; call Read_File
add dword[SPC7110CPtr2],eax ; add dword[SPC7110CPtr2],eax
call Close_File ; call Close_File
jmp .yesindexfile ; jmp .yesindexfile
.noindexfile ;.noindexfile
mov eax,[spc7110romptr] ; mov eax,[spc7110romptr]
mov [SPC7110CPtr],eax ; mov [SPC7110CPtr],eax
add eax,[SDD1Offset] ; add eax,[SDD1Offset]
mov [SPC7110CPtr2],eax ; mov [SPC7110CPtr2],eax
mov dword[SPC7110Entries],0 ; mov dword[SPC7110Entries],0
.yesindexfile ;.yesindexfile
mov edx,SPC7110DirEntry ; mov edx,SPC7110DirEntry
mov cx,20h ; mov cx,20h
call Get_First_Entry ; call Get_First_Entry
jc near .notfound ; jc near .notfound
.moreentries ;.moreentries
pushad ; pushad
mov edx,DTALoc+1Eh ; mov edx,DTALoc+1Eh
xor ecx,ecx ; xor ecx,ecx
xor eax,eax ; xor eax,eax
.loop ;.loop
cmp byte[edx],'.' ; cmp byte[edx],'.'
je .fin ; je .fin
cmp byte[edx],0 ; cmp byte[edx],0
je .fin ; je .fin
cmp byte[edx],'-' ; cmp byte[edx],'-'
je .skipthisone ; je .skipthisone
cmp byte[edx],'_' ; cmp byte[edx],'_'
je .skipthisone ; je .skipthisone
mov al,[edx] ; mov al,[edx]
cmp al,'A' ; cmp al,'A'
jb .num ; jb .num
cmp al,'a' ; cmp al,'a'
jb .uppercl ; jb .uppercl
sub al,'a'-10 ; sub al,'a'-10
jmp .done ; jmp .done
.uppercl ;.uppercl
sub al,'A'-10 ; sub al,'A'-10
jmp .done ; jmp .done
.num ;.num
sub al,'0' ; sub al,'0'
.done ;.done
shl ecx,4 ; shl ecx,4
add ecx,eax ; add ecx,eax
.skipthisone ;.skipthisone
inc edx ; inc edx
jmp .loop ; jmp .loop
.fin ;.fin
; spc7110romptr format: ; spc7110romptr format:
; 64K - address/pointer/length table ; 64K - address/pointer/length table
mov ebx,[SPC7110CPtr2] ; mov ebx,[SPC7110CPtr2]
mov eax,[SPC7110CPtr] ; mov eax,[SPC7110CPtr]
mov [eax],ecx ; mov [eax],ecx
mov [eax+4],ebx ; mov [eax+4],ebx
mov edx,DTALoc+1Eh ; mov edx,DTALoc+1Eh
call Open_File ; call Open_File
jc near .failed ; jc near .failed
mov bx,ax ; mov bx,ax
add dword[SPC7110CPtr],8 ; add dword[SPC7110CPtr],8
mov edx,[SPC7110CPtr2] ; mov edx,[SPC7110CPtr2]
mov ecx,[SDD1Offset] ; mov ecx,[SDD1Offset]
call Read_File ; call Read_File
add dword[SPC7110CPtr2],eax ; add dword[SPC7110CPtr2],eax
mov edx,dword[SPC7110CPtr] ; mov edx,dword[SPC7110CPtr]
mov [edx],eax ; mov [edx],eax
add dword[SPC7110CPtr],4 ; add dword[SPC7110CPtr],4
call Close_File ; call Close_File
inc dword[SPC7110Entries] ; inc dword[SPC7110Entries]
.failed ;.failed
popad ; popad
call Get_Next_Entry ; call Get_Next_Entry
jnc near .moreentries ; jnc near .moreentries
; Load patch (Address, offset, length) ; Load patch (Address, offset, length)
mov edx,SDD1pfname ; mov edx,SDD1pfname
call Open_File ; call Open_File
jc near .nopatch ; jc near .nopatch
mov bx,ax ; mov bx,ax
mov ecx,4 ; mov ecx,4
mov edx,SDD1PatchAddr ; mov edx,SDD1PatchAddr
call Read_File ; call Read_File
or eax,eax ; or eax,eax
jz .donepatch ; jz .donepatch
mov ecx,4 ; mov ecx,4
mov edx,SDD1PatchOfs ; mov edx,SDD1PatchOfs
call Read_File ; call Read_File
mov ecx,4 ; mov ecx,4
mov edx,SDD1PatchLen ; mov edx,SDD1PatchLen
call Read_File ; call Read_File
pushad ; pushad
mov ecx,[SPC7110Entries] ; mov ecx,[SPC7110Entries]
mov edx,[spc7110romptr] ; mov edx,[spc7110romptr]
.patloop ;.patloop
mov eax,[edx] ; mov eax,[edx]
cmp eax,[SDD1PatchAddr] ; cmp eax,[SDD1PatchAddr]
jne .notaddress ; jne .notaddress
mov eax,[edx+4] ; mov eax,[edx+4]
add eax,[SDD1PatchOfs] ; add eax,[SDD1PatchOfs]
pushad ; pushad
mov edx,eax ; mov edx,eax
mov ecx,[SDD1PatchLen] ; mov ecx,[SDD1PatchLen]
call Read_File ; call Read_File
popad ; popad
jmp .foundaddr ; jmp .foundaddr
.notaddress ;.notaddress
add edx,12 ; add edx,12
dec ecx ; dec ecx
jnz .patloop ; jnz .patloop
; not found ; ; not found
pushad ; pushad
mov edx,[SPC7110CPtr2] ; mov edx,[SPC7110CPtr2]
mov ecx,[SDD1PatchLen] ; mov ecx,[SDD1PatchLen]
call Read_File ; call Read_File
popad ; popad
.foundaddr ;.foundaddr
popad ; popad
.donepatch ;.donepatch
call Close_File ; call Close_File
.nopatch ;.nopatch
;
; Save Datafile ; Save Datafile
jmp .nosavedatafile jmp .nosavedatafile
@@ -3306,44 +3306,44 @@ NEWSYM SPC7110Load
; add eax,[SDD1Offset] ; add eax,[SDD1Offset]
; mov [SPC7110CPtr2],eax ; mov [SPC7110CPtr2],eax
mov ecx,[SPC7110Entries] ; mov ecx,[SPC7110Entries]
mov eax,[spc7110romptr] ; mov eax,[spc7110romptr]
mov ebx,eax ; mov ebx,eax
add ebx,[SDD1Offset] ; add ebx,[SDD1Offset]
.sdd1loopb ;.sdd1loopb
sub [eax+4],ebx ; sub [eax+4],ebx
add eax,12 ; add eax,12
dec ecx ; dec ecx
jnz .sdd1loopb ; jnz .sdd1loopb
mov edx,SDD1ifname ; mov edx,SDD1ifname
call Create_File ; call Create_File
mov bx,ax ; mov bx,ax
mov edx,[spc7110romptr] ; mov edx,[spc7110romptr]
mov ecx,[SPC7110CPtr] ; mov ecx,[SPC7110CPtr]
sub ecx,edx ; sub ecx,edx
call Write_File ; call Write_File
call Close_File ; call Close_File
mov edx,SDD1dfname ; mov edx,SDD1dfname
call Create_File ; call Create_File
mov bx,ax ; mov bx,ax
mov edx,[spc7110romptr] ; mov edx,[spc7110romptr]
add edx,[SDD1Offset] ; add edx,[SDD1Offset]
mov ecx,[SPC7110CPtr2] ; mov ecx,[SPC7110CPtr2]
sub ecx,edx ; sub ecx,edx
call Write_File ; call Write_File
call Close_File ; call Close_File
mov ecx,[SPC7110Entries] ; mov ecx,[SPC7110Entries]
mov eax,[spc7110romptr] ; mov eax,[spc7110romptr]
mov ebx,eax ; mov ebx,eax
add ebx,[SDD1Offset] ; add ebx,[SDD1Offset]
.sdd1loopc ;.sdd1loopc
add [eax+4],ebx ; add [eax+4],ebx
add eax,12 ; add eax,12
dec ecx ; dec ecx
jnz .sdd1loopc ; jnz .sdd1loopc
.nosavedatafile .nosavedatafile
mov edx,PrevDir mov edx,PrevDir