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

View File

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

View File

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

View File

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