Fix up sections variables are created in, major code cleanup, remove protection removal. - Round 1

This commit is contained in:
n-a-c-h
2005-01-03 13:57:23 +00:00
parent 95983ca23a
commit 75a6fd131a
17 changed files with 48 additions and 373 deletions

View File

@@ -27,10 +27,6 @@ EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay,hdmaearlstart
EXTSYM resolutn
EXTSYM memtabler16
NEWSYM DmaAsmStart
;*******************************************************
; Transfer DMA Inits & Transfers DMA
@@ -154,9 +150,6 @@ NEWSYM transdma
and edx,0FFFFh
mov ebx,[eax+ebx*4]
;snesmmap times 256 dd 0 ; addresses 8000-FFFF
;snesmap2 times 256 dd 0 ; addresses 0000-7FFF
push esi
mov esi,ebx
xor ebx,ebx
@@ -316,9 +309,6 @@ NEWSYM transdmappu2cpu
and edx,0FFFFh
mov ebx,[eax+ebx*4]
;snesmmap times 256 dd 0 ; addresses 8000-FFFF
;snesmap2 times 256 dd 0 ; addresses 0000-7FFF
push esi
mov esi,ebx
xor ebx,ebx
@@ -1429,7 +1419,3 @@ NEWSYM exechdmars
.nohdma
mov byte[hdmarestart],0
ret
NEWSYM DmaAsmEnd

View File

@@ -38,27 +38,10 @@ EXTSYM MuteVoiceF,VoiceStarter
EXTSYM DecayRate,SustainRate,SustainValue
EXTSYM KeyOnStA,KeyOnStB,SoundTest
NEWSYM DspAsmStart
;none times 256 db 0
SECTION .data
identcode db 255,1,78,78
SECTION .text
;sardcode db 234,76,80,128,65,65 ; 6
;efxcode db 17,47,62,97,26,126,98 ; 7
;zopcode db 54,39,21,0,0,8,14,12,18 ; 9
;yoshcode db 0,68,23,76,123,98,34,87,12,98,65 ; 11
;deejcode db 78,39,240,150,15,78,39,68,89,54,32,33 ; 12
;vmprcode db 127,127,127,127,255,255,255,255,0,0,0,0,1,0,1,0 ; 16
;conjcode db 32,32,25,20,78,232,242,242,0,1,4,98,98,45,13,12,99 ; 17
;wnelcode db 32,64,123,76,123,76,12,0,1,7,43,12,87,18,51,136,65,132 ; 18
;crascode db 82,48,89,26,65,10,200,26,73,84,29,120,37,213,78,89,111,23,84,13,200 ; 21 - Crashman
; Digital Sound Processor of the SPC700 By _Demo_
@@ -69,7 +52,7 @@ SECTION .text
mov [DSPMem+00h+%1],al
%endmacro
SECTION .bss ;ALIGN=32
SECTION .bss
alignb 32
NEWSYM DSPMem, resb 256
SECTION .text
@@ -2877,5 +2860,3 @@ NEWSYM WDSPRegFE ;
NEWSYM WDSPRegFF ;
mov [DSPMem+0FFh],al
ret
NEWSYM DspAsmEnd

View File

@@ -135,14 +135,9 @@ EXTSYM LowPassFilterType
EXTSYM SB_alloc_dma,SB_quality_limiter,vibracard
%endif
NEWSYM DspProcAsmStart
SECTION .data
NEWSYM SBHDMA, db 0 ; stupid legacy code ...
SECTION .bss
; MixEcho
@@ -389,15 +384,12 @@ CubicSpline:
%include "cpu/fir_tables.inc"
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM spcWptr, resd 16 ; SPC Write pointers (point to their own functions)
NEWSYM spcRptr, resd 16 ; SPC Read pointers (point to their own functions)
;dspWptr times 256 dd 0 ; DSP Write pointers (point to their own functions)
;dspRptr times 256 dd 0 ; DSP Read pointers (point to their own functions)
SECTION .data ;ALIGN=32
;
SECTION .data
NEWSYM SoundQuality, dd 2
NEWSYM StereoSound, db 0
NEWSYM SBToSPC, dd 22050
@@ -2037,7 +2029,7 @@ BRRDecode:
.dlpf
ProcessDynamicLowPass
section .data ;ALIGN=32
section .data
ALIGN32
; Original Values
@@ -2200,7 +2192,7 @@ NEWSYM VolumeTableb
; db 1,1,1,1,1,1,1,1,1,1
; db 1,1,1,1,1,1,1,1
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM DSPBuffer, resd 320*4 ; The play buffer...
NEWSYM EchoBuffer, resd 320*4 ; The play buffer...
NEWSYM PModBuffer, resd 320*4 ; The play buffer...
@@ -2223,15 +2215,6 @@ NEWSYM BRRTemp6, resd 1 ; Keep this 0
NEWSYM BRRPlace7, resd 1 ; Place in the BRRBuffer for Voice 0
NEWSYM BRRTemp7, resd 1 ; Keep this 0
;NEWSYM Voice0Freq, dd 1 ; Frequency of Voice 0 (Delta Freq)
;NEWSYM Voice1Freq, dd 1 ; Frequency of Voice 1 (Delta Freq)
;NEWSYM Voice2Freq, dd 1 ; Frequency of Voice 2 (Delta Freq)
;NEWSYM Voice3Freq, dd 1 ; Frequency of Voice 3 (Delta Freq)
;NEWSYM Voice4Freq, dd 1 ; Frequency of Voice 4 (Delta Freq)
;NEWSYM Voice5Freq, dd 1 ; Frequency of Voice 5 (Delta Freq)
;NEWSYM Voice6Freq, dd 1 ; Frequency of Voice 6 (Delta Freq)
;NEWSYM Voice7Freq, dd 1 ; Frequency of Voice 7 (Delta Freq)
NEWSYM Voice0Freq, resd 1 ; Frequency of Voice 0 (Delta Freq)
NEWSYM Voice1Freq, resd 1 ; Frequency of Voice 1 (Delta Freq)
NEWSYM Voice2Freq, resd 1 ; Frequency of Voice 2 (Delta Freq)
@@ -2241,16 +2224,6 @@ NEWSYM Voice5Freq, resd 1 ; Frequency of Voice 5 (Delta Freq)
NEWSYM Voice6Freq, resd 1 ; Frequency of Voice 6 (Delta Freq)
NEWSYM Voice7Freq, resd 1 ; Frequency of Voice 7 (Delta Freq)
; appears to only be used in dspproc.asm
;Voice0Pitch dw 1 ; Previous Pitch for Voice 0
;Voice1Pitch dw 1 ; Previous Pitch for Voice 1
;Voice2Pitch dw 1 ; Previous Pitch for Voice 2
;Voice3Pitch dw 1 ; Previous Pitch for Voice 3
;Voice4Pitch dw 1 ; Previous Pitch for Voice 4
;Voice5Pitch dw 1 ; Previous Pitch for Voice 5
;Voice6Pitch dw 1 ; Previous Pitch for Voice 6
;Voice7Pitch dw 1 ; Previous Pitch for Voice 7
NEWSYM Voice0Pitch, resw 1 ; Previous Pitch for Voice 0
Voice1Pitch resw 1 ; Previous Pitch for Voice 1
Voice2Pitch resw 1 ; Previous Pitch for Voice 2
@@ -2332,15 +2305,6 @@ NEWSYM Voice5End, resb 1
NEWSYM Voice6End, resb 1
NEWSYM Voice7End, resb 1
;NEWSYM Voice0Noise, db 1
;NEWSYM Voice1Noise, db 1
;NEWSYM Voice2Noise, db 1
;NEWSYM Voice3Noise, db 1
;NEWSYM Voice4Noise, db 1
;NEWSYM Voice5Noise, db 1
;NEWSYM Voice6Noise, db 1
;NEWSYM Voice7Noise, db 1
NEWSYM Voice0Noise, resb 1
NEWSYM Voice1Noise, resb 1
NEWSYM Voice2Noise, resb 1
@@ -2377,15 +2341,6 @@ NEWSYM Voice5VolumeL, resb 1
NEWSYM Voice6VolumeL, resb 1
NEWSYM Voice7VolumeL, resb 1
;NEWSYM Voice0Env, db 1
;NEWSYM Voice1Env, db 1
;NEWSYM Voice2Env, db 1
;NEWSYM Voice3Env, db 1
;NEWSYM Voice4Env, db 1
;NEWSYM Voice5Env, db 1
;NEWSYM Voice6Env, db 1
;NEWSYM Voice7Env, db 1
NEWSYM Voice0Env, resb 1
NEWSYM Voice1Env, resb 1
NEWSYM Voice2Env, resb 1
@@ -2414,8 +2369,6 @@ NEWSYM Voice5State, resb 1
NEWSYM Voice6State, resb 1
NEWSYM Voice7State, resb 1
; WAS all dd 1 before, down to next applicable comment
NEWSYM Voice0Time, resd 1
NEWSYM Voice1Time, resd 1
NEWSYM Voice2Time, resd 1
@@ -2849,9 +2802,7 @@ NEWSYM ResetState
pop edi
ret
;VolumeConvTable times 32768 db 0
SECTION .bss ;ALIGN=32
SECTION .bss
spc700temp resd 2
SECTION .text
@@ -3239,7 +3190,7 @@ NEWSYM VoiceStarter
VoiceStarterM 7
ret
section .bss ;ALIGN=32
section .bss
NEWSYM NoiseInc, resd 1
NEWSYM NoisePointer, resd 1
NEWSYM LastNoise, resd 1
@@ -5359,7 +5310,7 @@ NEWSYM EchoStereo
%%Mono
%endmacro
section .bss ;ALIGN=32
section .bss
echowrittento resb 1
section .text
@@ -5559,4 +5510,3 @@ NEWSYM LPFexit
.nosurround
ret
NEWSYM DspProcAsmEnd

View File

@@ -127,8 +127,6 @@ EXTSYM OSPC_Run, ospc_cycle_frac
EXTSYM dssel
%endif
NEWSYM ExecuteAsmStart
%macro BackupCVMacM 2
mov edx,%1
mov ecx,%2
@@ -526,9 +524,6 @@ NEWSYM RestoreSystemVars
ret
NEWSYM BackupCVFrame
;NEWSYM StateBackup, dd 0
;NEWSYM CBackupPos, dd 0
;NEWSYM PBackupPos, dd 0
push edx
push eax
mov ebx,[CBackupPos]
@@ -1128,20 +1123,6 @@ NEWSYM reexecuteb
jnz .loopa
%endif
reexecuteb2:
; temporary sprite displayer
; mov edx,.sdispname
; call Open_File
; jc .failedsd
; mov bx,ax
; mov ecx,544
; mov edx,oamram
; call Read_File
; call Close_File
;.failedsd
; jmp .skipsd
;.sdispname db 'MMX3.SPR',0
;.skipsd
cmp byte[NoSoundReinit],1
je .skippregame
call SetupPreGame
@@ -1352,33 +1333,6 @@ NEWSYM endprog
mov byte[MovieProcessing],0
call Close_File
.nomovieclose
;NEWSYM tempstore, times 1024*1024 db 0
; mov esi,tempstore
; mov ecx,1024*1024
;.loop
; mov al,[esi]
; cmp al,0
; jne .faulty
; inc esi
; dec ecx
; jnz .loop
; xor eax,eax
; jmp .notfaulty
;.faulty
; mov eax,1
;.notfaulty
; mov eax,[vidbufferofsa]
; call printnum
; mov dl,32
; mov ah,02h
; call Output_Text
; mov eax,[vidbufferofsb]
; call printnum
; mov dl,32
; mov ah,02h
; call Output_Text
; mov eax,[romdata]
; call printnum
; change dir to InitDrive/InitDir
mov dl,[InitDrive]
@@ -1391,10 +1345,7 @@ NEWSYM endprog
je .nodeinitmodem
call DeInitModem
.nodeinitmodem
; cmp byte[OSPort],1
; jae .nodeinitipx
call deinitipx
;.nodeinitipx
%endif
jmp OSExit
@@ -2111,7 +2062,7 @@ NEWSYM handler9h
iretd
%endif
SECTION .data ;ALIGN=32
SECTION .data
NEWSYM soundcycleft, dd 0
NEWSYM curexecstate, dd 0
@@ -2350,7 +2301,7 @@ NEWSYM execloop
SECTION .data ;ALIGN=32
SECTION .data
ALIGN32
NEWSYM ExecExitOkay, db 1
NEWSYM JoyABack, dd 0
@@ -3135,21 +3086,6 @@ NEWSYM cpuover
jne near .nocrupdate3 ; *************************
.nobackstate2
pop ebx
;NEWSYM StateBackup, dd 0
;NEWSYM CBackupPos, dd 0
;NEWSYM PBackupPos, dd 0
;NEWSYM PPValue, dd 0 ; Previous PValue
;NEWSYM DPValue, dd 0 ; Destination PValue
;NEWSYM CurRecv, dd 0 ; Set to 1 if Recovery mode is on
; if CurRecv=1, then do not send tcp/ip data, always frame skip, do not
; draw to screen, do not key on, restore previous local key presses,
; when disabling key ons, divert dspmem write/read to a different
; array temporarly, then re-copy back in when finished
;NEWSYM PPContrl, times 16 dd 0 ; Previous Controller 1 Data
;NEWSYM PPContrl2, times 16 dd 0 ; Previous Controller 2 Data
;NEWSYM PPContrl3, times 16 dd 0 ; Previous Controller 3 Data
;NEWSYM PPContrl4, times 16 dd 0 ; Previous Controller 4 Data
;NEWSYM PPContrl5, times 16 dd 0 ; Previous Controller 5 Data
pushad
mov byte[nojoystickpoll],1
@@ -3437,8 +3373,6 @@ NEWSYM cpuover
or byte[NetQuit],1
.quitlater
pop ebx
;NEWSYM NetQuitter, dd 0
;NEWSYM QBackupPos, dd 0
.noquit2b
test dl,02h
jz near .nocrupdate2b
@@ -3969,9 +3903,9 @@ NEWSYM cpuover
pop eax
jmp .returncheat
SECTION .bss ;ALIGN=32
SECTION .bss
.numcheat resb 1
SECTION .text ;ALIGN=32
SECTION .text
ALIGN16
@@ -4525,6 +4459,3 @@ NEWSYM execsingle
; mov byte[debstop3],1
jmp switchtovirqdeb
NEWSYM ExecuteAsmEnd

View File

@@ -41,11 +41,6 @@ EXTSYM SA1Overflow,OBCEnable
EXTSYM Sdd1Mode,Sdd1Bank,Sdd1Addr,Sdd1NewAddr,memtabler8,AddrNoIncr,SDD1BankA
EXTSYM SPC7110Entries,spc7110romptr
NEWSYM MemoryAsmStart
; C4SprScale
;*******************************************************
@@ -105,9 +100,6 @@ NEWSYM C4ObjSelec, resb 1
NEWSYM C4SObjSelec, resb 1
NEWSYM C4Pause, resb 1
C4DataCopy resb 64
;NEWSYM C4Data times 64*4096 db 0 ; 15 sprites, 4 bytes each
; x,y,oamptr,stat (b0=oamb8,b1=16x16)
; 4 byte header (#sobj,?,?,?)
CObjNum resw 1
C4Temp resd 1
section .text
@@ -590,11 +582,6 @@ C4ConvOAM:
.donemultispr
pop esi
pop ecx
;NEWSYM C4Data times 64*4096 db 0 ; 15 sprites, 4 bytes each
; x,y,oamptr,stat (b0=oamb8,b1=16x16)
; 4 byte header (#sobj,?,?,?)
add esi,16
dec cl
jnz near .loop
@@ -1650,13 +1637,6 @@ SECTION .bss
SECTION .text
C4DrawLine:
;C4X1 dw 0
;C4Y1 dw 0
;C4Z1 dw 0
;C4X2 dw 0
;C4Y2 dw 0
;C4Z2 dw 0
;C4Col dw 0
pushad
; transform both coordinates
@@ -5017,6 +4997,3 @@ NEWSYM memaccessbankr8sdd1
jmp memaccessbankr8
SECTION .bss
.tmpbyte resb 1
SECTION .text
NEWSYM MemoryAsmEnd

View File

@@ -247,7 +247,7 @@ NEWSYM initregr
ret
; global variables
SECTION .data ;ALIGN=32
SECTION .data
NEWSYM invreg, dw 0
NEWSYM sndrot, db 0 ; rotates to use A,X or Y for sound skip
NEWSYM sndrot2, db 0 ; rotates a random value for sound skip
@@ -898,7 +898,7 @@ reg4016r:
rol dword[JoyANow],1
ret
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM MultiTap, resb 1
SECTION .text
@@ -1233,7 +1233,7 @@ regINVALID: ; Invalid Register
call printnum
jmp DosExit
SECTION .data ;ALIGN=32
SECTION .data
.invalidreg db 'Invalid Read Register : $'
SECTION .text

View File

@@ -36,7 +36,7 @@ EXTSYM printhex8
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM testgfxv1, resb 1
NEWSYM testgfxv2, resb 1
SECTION .text
@@ -286,9 +286,7 @@ NEWSYM initregw
ret
; video memory change buffer for caching (65536/16=4096)
;vidmemch2 times 4096 db 0
;vidmemch4 times 4096 db 0
;vidmemch8 times 4096 db 0
;vidmemch2, vidmemch4, vidmemch8. 4096 bytes each
NEWSYM unpackfunct
@@ -444,7 +442,7 @@ reg2100w:
and byte[forceblnk],80h
ret
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM prevoamptr, resb 1
SECTION .text
@@ -489,7 +487,7 @@ reg2101w:
.noproc
ret
SECTION .data ;ALIGN=32
SECTION .data
.objsize1 db 1,1,1,4,4,16,1,1
.objsize2 db 4,16,64,16,64,64,4,4
.objmovs1 db 2,2,2,2,2,4,2,2
@@ -497,7 +495,7 @@ SECTION .data ;ALIGN=32
.objadds1 dw 14,14,14,14,14,12,14,14
.objadds2 dw 14,12,8,12,8,8,14,14
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM oamlow, resb 1
SECTION .text
@@ -803,7 +801,7 @@ reg210Ew:
mov byte[bg1scroly+1],al
ret
SECTION .bss ;ALIGN=32
SECTION .bss
bgscroltemp resb 1
SECTION .text
@@ -1131,7 +1129,7 @@ reg211Aw:
mov [mode7set],al
ret
SECTION .data ;ALIGN=32
SECTION .data
NEWSYM multchange, db 1
SECTION .text
@@ -1337,7 +1335,7 @@ reg2133w:
mov word[resolutn],239
ret
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM CleartheScreen, resb 1
SECTION .text
@@ -1428,7 +1426,7 @@ reg2183w:
ret
; Joystick 1 & 2 status bytes
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM MultiTapStat, resb 1
SECTION .text
@@ -1857,11 +1855,11 @@ regexiter:
call printnum
jmp DosExit
SECTION .data ;ALIGN=32
SECTION .data
.invalidreg db 'Invalid Write Register : $'
.invalidaddr db ' at address $'
SECTION .bss ;ALIGN=32
SECTION .bss
.invbank resb 1
.invaddr resb 1
SECTION .text

View File

@@ -23,8 +23,6 @@ EXTSYM spc700read
EXTSYM dspWptr
EXTSYM changeexecloop,curexecstate,SA1Enable,tableadb
NEWSYM Spc700AsmStart
%include "cpu/regsw.mac"
%include "cpu/spcdef.inc"
%include "cpu/spcaddr.inc"
@@ -39,7 +37,7 @@ NEWSYM Spc700AsmStart
; Read byte : read al from [ebx]
; update timer : update the timers, called every scanline
SECTION .data ;ALIGN=32
SECTION .data
ALIGN32
@@ -670,19 +668,6 @@ SECTION .text
.skipflags
%endmacro
;spcNF db 0 ; The Negative Flag 128 or 127 80h
;spcOF db 0 ; The Overflow Flag 64 or 191 40h
;spcDPF db 0 ; Direct Page Flag 32 or 223 20h
;spcUF db 0 ; The Unused Flag ? 16 or 239 10h
;spcHCF db 0 ; The Half Carry Flag 8 or 247 08h
;spcIF db 0 ; The interrupt flag 4 or 251 04h
;spcZF db 0 ; The Zero Flag 2 or 253 02h
;spcCF db 0 ; The Carry Flag 1 or 254 01h
; test byte[spcP],08h
; jz .nohcarry
; or ah,00010000b
;.nohcarry
%macro SPCSetFlagnvhzc 0
lahf
js .setsignflag
@@ -2769,15 +2754,6 @@ NEWSYM OpBE ; DAS A decimal adjust for sub N......ZC
mov [spcA],al
SPCSetFlagnzc
;spcNF db 0 ; The Negative Flag 128 or 127
;spcOF db 0 ; The Overflow Flag 64 or 191
;spcDPF db 0 ; Direct Page Flag 32 or 223
;spcUF db 0 ; The Unused Flag ? 16 or 239
;spcHCF db 0 ; The Half Carry Flag 8 or 247
;spcIF db 0 ; The interrupt flag 4 or 251
;spcZF db 0 ; The Zero Flag 2 or 253
;spcCF db 0 ; The Carry Flag 1 or 254
NEWSYM OpDF ; DAA A decimal adjust for add N......ZC
; copy al flags into AH
xor ah,ah
@@ -2806,5 +2782,3 @@ NEWSYM OpDF ; DAA A decimal adjust for add N......ZC
NEWSYM Invalidopcode ; Invalid Opcode
dec ebp
ret
NEWSYM Spc700AsmEnd

View File

@@ -34,19 +34,19 @@ NEWSYM StableAsmStart
; global variables
;tableA times 256 dd 0 ; Table addresses (M:0,X:0,D:0)
;tableB times 256 dd 0 ; Table addresses (M:1,X:0,D:0)
;tableC times 256 dd 0 ; Table addresses (M:0,X:1,D:0)
;tableD times 256 dd 0 ; Table addresses (M:1,X:1,D:0)
;tableE times 256 dd 0 ; Table addresses (M:0,X:0,D:1)
;tableF times 256 dd 0 ; Table addresses (M:1,X:0,D:1)
;tableG times 256 dd 0 ; Table addresses (M:0,X:1,D:1)
;tableH times 256 dd 0 ; Table addresses (M:1,X:1,D:1)
;tablead times 256 dd 0 ; Table address location according to P
;memtabler8 times 256 dd 0 ; Memory Bank Locations for reading 8-bit
;memtablew8 times 256 dd 0 ; Memory Bank Locations for writing 8-bit
;memtabler16 times 256 dd 0 ; Memory Bank Locations for reading 16-bit
;memtablew16 times 256 dd 0 ; Memory Bank Locations for reading 16-bit
;tableA times 256 ; Table addresses (M:0,X:0,D:0)
;tableB times 256 ; Table addresses (M:1,X:0,D:0)
;tableC times 256 ; Table addresses (M:0,X:1,D:0)
;tableD times 256 ; Table addresses (M:1,X:1,D:0)
;tableE times 256 ; Table addresses (M:0,X:0,D:1)
;tableF times 256 ; Table addresses (M:1,X:0,D:1)
;tableG times 256 ; Table addresses (M:0,X:1,D:1)
;tableH times 256 ; Table addresses (M:1,X:1,D:1)
;tablead times 256 ; Table address location according to P
;memtabler8 times 256 ; Memory Bank Locations for reading 8-bit
;memtablew8 times 256 ; Memory Bank Locations for writing 8-bit
;memtabler16 times 256 ; Memory Bank Locations for reading 16-bit
;memtablew16 times 256 ; Memory Bank Locations for reading 16-bit
;*******************************************************
; Generate OpCode Table
@@ -697,5 +697,3 @@ NEWSYM SA1settableDm16
mov dword[edi+0FDh*4],SA1COpFDm16d
mov dword[edi+0FFh*4],SA1COpFFm16d
ret
NEWSYM StableAsmEnd