From 242ed158ef325c39e1f5dd115a341f4a949f3369 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Tue, 7 Dec 2004 23:42:45 +0000 Subject: [PATCH] Cleaned up grinvader's changes, removed some really insane museam worthy code. --- zsnes/src/cpu/execute.asm | 20 --- zsnes/src/cpu/memory.asm | 293 ------------------------------------- zsnes/src/dos/debug.asm | 5 +- zsnes/src/init.asm | 301 +------------------------------------- 4 files changed, 7 insertions(+), 612 deletions(-) diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index 2b01ef21..74757c48 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -1357,23 +1357,6 @@ NEWSYM endprog mov ebx,SRAMDir call Change_Dir -; 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[sramsavedis],1 je .nosram cmp dword[ramsize],0 @@ -1489,9 +1472,6 @@ NEWSYM endprog ;.nodeinitipx %endif jmp OSExit -;SECTION .data -;NEWSYM sdd1fname, db 'sdd1dat.dat',0,0 -;SECTION .text NEWSYM interror stim diff --git a/zsnes/src/cpu/memory.asm b/zsnes/src/cpu/memory.asm index 1c6cf1e3..98096770 100644 --- a/zsnes/src/cpu/memory.asm +++ b/zsnes/src/cpu/memory.asm @@ -4923,11 +4923,6 @@ NEWSYM SA1RAMaccessbankw16b call SA1RAMaccessbankw8b ret -SECTION .bss -;NEWSYM SDD1Array, resb 65536 -;NEWSYM SDD1Entry, resd 1 -;NEWSYM SDD1EntryPtr, resd 1 -;NEWSYM SDD1IdxXferSize, resd 1 SECTION .text %macro GetBankLog 1 @@ -5036,292 +5031,4 @@ SECTION .bss .tmpbyte resb 1 SECTION .text - - - -; File loading version -;NEWSYM oldmemaccessbankr8sdd1 -; TestSDD1 -; jmp debugdecompress -; call FillArray -; mov byte[.found4],0 - -; cmp byte[AddrNoIncr],0 -; je near .failed -; cmp dword[Sdd1Mode],2 -; je near .decompress - -; 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 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 - -; push eax - -; 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 - -;.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 - -;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 -; 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 - NEWSYM MemoryAsmEnd diff --git a/zsnes/src/dos/debug.asm b/zsnes/src/dos/debug.asm index 2767865b..667c7f17 100644 --- a/zsnes/src/dos/debug.asm +++ b/zsnes/src/dos/debug.asm @@ -21,7 +21,6 @@ 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 LastLog EXTSYM fulladdtab EXTSYM DecompArray,DecompAPtr @@ -616,12 +615,12 @@ NEWSYM drawwindow cmp bl,[wy2] je .last ; middle - mov al,'³' + mov al,'' stosw mov al,' ' sub cx,2 rep stosw - mov al,'³' + mov al,'' stosw jmp .addnext .first diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index 9643b704..bd0abaed 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -3029,31 +3029,13 @@ SECTION .data PrevDir db '..',0 GUIfindBlank db '*.',0 -SECTION .text - SECTION .bss ZipError resb 1 -SECTION .text - SECTION .data -;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 spc7110notfound db 'DECOMPRESSED PACK NOT FOUND',0 -spc7110notfoundb db 'INDEX DATA NOT FOUND',0 SECTION .bss @@ -3061,14 +3043,9 @@ SPC7110Allocated resb 1 SPC7110CPtr resd 1 SPC7110CPtr2 resd 1 NEWSYM SPC7110Entries, resd 1 -;SDD1PatchAddr resd 1 -;SDD1PatchOfs resd 1 -;SDD1PatchLen resd 1 SECTION .text -;EXTSYM sdd1fname - NEWSYM SPC7110Load mov dword[SPC7110Entries],0 mov esi,[romdata] @@ -3078,290 +3055,22 @@ NEWSYM SPC7110Load cmp byte[romtype],2 jne .nothirom cmp al,0F9h - je near .spc7110 + je .spc7110 cmp al,0F5h - je near .spc7110 + je .spc7110 .nothirom - cmp byte[romtype],1 - jne .notlorom - mov esi,[romdata] - add esi,32704+22 - mov al,[esi] - ; Star Ocean = 45h, SFA2 = 43h - cmp al,43h - je .sdd1 - cmp al,45h - je .sdd1 -.notlorom -.sdd1 - cmp al,045h - jne .noSDD1 -; mov edx,SDD1DIRA -; mov dword[sdd1fname],'socn' - jmp .sdd1b -.noSDD1 - cmp al,043h - jne .noSDD1a -; add esi,3 -; mov al,[esi] - cmp al,0 - jne .notsfz2 -; mov edx,SDD1DIRB -; mov dword[sdd1fname],'sfz2' - jmp .sdd1b -.notsfz2 - cmp al,01h - jne .notsfa2 -; mov edx,SDD1DIRC -; mov dword[sdd1fname],'sfa2' - jmp .sdd1b -.notsfa2 -; mov edx,SDD1DIRD -; mov dword[sdd1fname],'sf2e' - jmp .sdd1b -.noSDD1a ret .spc7110 - pushad - call SPC7PackIndexLoad - popad - cmp dword[SPC7110IndexSize],0 - je .nodir - ret -.sdd1b - cmp byte[SPC7110Allocated],0 - jne .notalloc pushad - call allocspc7110 + call SPC7PackIndexLoad popad - mov byte[SPC7110Allocated],1 -.notalloc - call Change_Single_Dir - jc near .nodir - -; 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,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 - - ; 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 -; - ; Save Datafile - jmp .nosavedatafile - -; mov eax,[spc7110romptr] -; mov [SPC7110CPtr],eax -; 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 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 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 - call Change_Single_Dir + cmp dword[SPC7110IndexSize],0 + je .nodir ret -.notfound - mov edx,PrevDir - call Change_Single_Dir .nodir mov dword[Msgptr],spc7110notfound mov dword[MessageOn],60*6 ret -.noindex - mov edx,PrevDir - call Change_Single_Dir - mov dword[Msgptr],spc7110notfoundb - mov dword[MessageOn],60*6 - ret NEWSYM loadfileGUI mov byte[InGUI],1