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

@@ -48,10 +48,6 @@ EXTSYM Op08X,Op08Y,Op08Z,Op08Ll,Op08Lh,DSPOp08
EXTSYM Op18X,Op18Y,Op18Z,Op18R,Op18D,DSPOp18
EXTSYM Op1CX,Op1CY,Op1CZ,Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,Op1CZAR,DSPOp1C
NEWSYM Dsp1ProcAsmStart
SECTION .bss
NEWSYM dsp1ptr, resd 1
@@ -486,13 +482,6 @@ DSP1_1C: ; 3D Coordinate Rotation
DSP1_02: ; Vector Size
or byte[DSPDet],10h
push eax
;Op02FX dw 0
;Op02FY dw 0
;Op02FZ dw 0
;Op02LFE dw 0
;Op02LES dw 0
;Op02AAS dw 0
;Op02AZS dw 0
mov ax,[DSP1VARS]
mov [Op02FX],ax
mov ax,[DSP1VARS+2]
@@ -510,10 +499,6 @@ DSP1_02: ; Vector Size
pushad
call DSPOp02
popad
;Op02VOF dw 0
;Op02VVA dw 0
;Op02CX dw 0
;Op02CY dw 0
mov ax,[Op02VOF]
mov [DSP1RET],ax
mov ax,[Op02VVA]
@@ -895,4 +880,3 @@ DSP1_14: ; 3D angle rotation
pop eax
ret
NEWSYM Dsp1ProcAsmEnd

View File

@@ -22,7 +22,6 @@ EXTSYM fxxand,sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc
EXTSYM sfxramdata,fxbit45,fxbit67,SFXProc,ChangeOps
EXTSYM PLOTJmpa,PLOTJmpb
NEWSYM FxEmu2AsmStart
%include "chips/fxemu2.mac"
@@ -40,7 +39,7 @@ NEWSYM FlushCache
SECTION .bss
NEWSYM tempsfx, resb 3
SECTION .data ;ALIGN=32
SECTION .data
; FxChip emulation by _Demo_
; Optimised by zsKnight
@@ -2648,7 +2647,7 @@ NEWSYM FxOpFFA2 ; SM (XX),RN store word in RAM
CLRFLAGS
ret
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM NumberOfOpcodes, resd 1 ; Number of opcodes to execute
NEWSYM NumberOfOpcodesBU, resd 1 ; Number of opcodes to execute backup value
@@ -2687,6 +2686,4 @@ NEWSYM FXEndLoop
SECTION .data
NEWSYM fxtrace, db 0; times 65536 db 0
SECTION .text
NEWSYM FxEmu2AsmEnd

View File

@@ -193,13 +193,7 @@ EXTSYM FxOpd4C1288bl,FxOpd4C1288bzl,FxOpd4C1288bdl,FxOpd4C1288bzdl
EXTSYM fxxand,fxbit01,fxbit23,fxbit45,fxbit67
NEWSYM FxTableAsmStart
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM sfx128lineloc, resd 1
NEWSYM sfx160lineloc, resd 1
NEWSYM sfx192lineloc, resd 1
@@ -3545,7 +3539,3 @@ NEWSYM sfxnametab
db 'IWT R4 IWT R5 IWT R6 IWT R7 '
db 'IWT R8 IWT R9 IWT R10 IWT R11 '
db 'IWT R12 IWT R13 IWT R14 IWT R15 '
SECTION .text
NEWSYM FxTableAsmEnd

View File

@@ -26,16 +26,11 @@ EXTSYM membank0w8,romdata,SA1LBound,SA1UBound,SA1SH,SA1SHb
EXTSYM stackor,stackand,snesmmap,SA1xs,SA1IRQExec
EXTSYM SA1Message,Sflagnz,Sflagc,Sflago
NEWSYM Sa1ProcAsmStart
; In exec loop, jump to execloop if SA1Status != 0
; *** Disable spc700 if possible ***
SECTION .bss ;ALIGN=32
SECTION .bss
NEWSYM SA1Status, resb 1 ; 0 = 65816, 1 = SA1A, 2 = SA1B
NEWSYM CurrentExecSA1, resb 1
@@ -367,4 +362,3 @@ NEWSYM SA1switchtovirq
add esi,eax
ret
NEWSYM Sa1ProcAsmEnd

View File

@@ -53,17 +53,12 @@ EXTSYM curypos,CurrentExecSA1
EXTSYM debstop3
EXTSYM memaccessbankr8sdd1,memtabler8,AddrNoIncr
EXTSYM NumofBanks
NEWSYM Sa1RegsAsmStart
%include "cpu/regs.mac"
%include "cpu/regsw.mac"
SECTION .data ;ALIGN=32
SECTION .data
NEWSYM SPCMultA, dd 0
NEWSYM SPCMultB, dd 0
@@ -850,10 +845,6 @@ SPC480Bw:
mov [SPCCompCommand],al
ret
;NEWSYM SPCROMPtr, dd 0
;NEWSYM SPCROMAdj, dd 0
;NEWSYM SPCROMInc, dd 0
;NEWSYM SPCROMCom, dd 0
; 01,
;$4810 DATA ROM CONTINUOUS READ PORT: returns a byte from data rom at data
; rom pointer location, defval:00
@@ -1252,8 +1243,6 @@ SPC4834:
xor al,al
ret
;NEWSYM SPC7110RTCStat, dd 0
;NEWSYM SPC7110RTC, db 00,00,00,00,00,00,01,00,01,00,00,00,00,01,0F,06
;$4840 RTC CHIP ENABLE/DISABLE: bit 0: on = enable, off = disable, defval:00
;$4841 RTC INDEX/DATA PORT:
; first write after rtc enable: rtc command mode byte (see rtc command modes)
@@ -1483,7 +1472,7 @@ SPC4842:
; SA-1 Start
; ----------
SECTION .data ;ALIGN=32
SECTION .data
; IRQ Stuff
NEWSYM SA1Mode, dd 0 ; 0 = SNES CPU, 1 = SA1 CPU
@@ -2733,5 +2722,3 @@ NEWSYM sdd14801w
pop ebx
pop eax
ret
NEWSYM Sa1RegsAsmEnd

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

View File

@@ -17,17 +17,10 @@
%include "macros.mac"
NEWSYM EndMemAsmStart
NEWSYM romdatahere
; Much of this used to be in uninitialized space, until I discovered that
; ZSNES was unstable because of them... Odd.
SECTION .data
Stuff db 'ZSNES v?.??? / free software, programmed by zsKnight, _Demo_, and Pharos',13,10,0

View File

@@ -2460,31 +2460,6 @@ NEWSYM printhex8
jnz .loopb
ret
;EXTSYM _imp__OutputDebugStringA@4
;NEWSYM printhex32
; pushf
; mov ecx,8
;.loopa
; mov ebx,eax
; and ebx,0Fh
; mov dl,[printhex.hexdat+ebx]
; mov [.hexout-1+ecx],dl
; shr eax,4
; dec ecx
; jnz .loopa
; push dword .hexout
; call [_imp__OutputDebugStringA@4]
; popf
; db 0C3h ; ret
;section .bss
;NEWSYM __debug_crap_address__, dd 0,0,0,0
;.hexout db "blahblah",0
;section .text
;*******************************************************
; Load File
;*******************************************************

View File

@@ -23,20 +23,8 @@ extern void SfxProcAsmStart();
extern void SfxProcAsmEnd();
extern void FxEmu2AsmStart();
extern void FxEmu2AsmEnd();
extern void Dsp1ProcAsmStart();
extern void Dsp1ProcAsmEnd();
extern void FxEmu2BAsmStart();
extern void FxEmu2BAsmEnd();
extern void FxEmu2CAsmStart();
extern void FxEmu2CAsmEnd();
extern void FxTableAsmStart();
extern void FxTableAsmEnd();
extern void ExecuteAsmStart();
extern void ExecuteAsmEnd();
extern void Sa1ProcAsmStart();
extern void Sa1ProcAsmEnd();
extern void Sa1RegsAsmStart();
extern void Sa1RegsAsmEnd();
extern void WinIntRFAsmStart();
extern void WinIntRFAsmEnd();
extern void ProcVidAsmStart();
@@ -45,18 +33,6 @@ extern void CfgLoadAsmStart();
extern void CfgLoadAsmEnd();
extern void IrqAsmStart();
extern void IrqAsmEnd();
extern void MemoryAsmStart();
extern void MemoryAsmEnd();
extern void Spc700AsmStart();
extern void Spc700AsmEnd();
extern void StableAsmStart();
extern void StableAsmEnd();
extern void DspProcAsmStart();
extern void DspProcAsmEnd();
extern void DmaAsmStart();
extern void DmaAsmEnd();
extern void DspAsmStart();
extern void DspAsmEnd();
extern void TableAsmStart();
extern void TableAsmEnd();
extern void TableBAsmStart();
@@ -111,8 +87,6 @@ extern void M716TExtAsmStart();
extern void M716TExtAsmEnd();
extern void TwoxSaiWAsmStart();
extern void TwoxSaiWAsmEnd();
extern void EndMemAsmStart();
extern void EndMemAsmEnd();
extern void MV16TMSAsmStart();
extern void MV16TMSAsmEnd();
extern void NewG162AsmStart();
@@ -150,25 +124,12 @@ void MakeCodeWriteable_f (unsigned long startaddr, unsigned long length, const c
void UnProtectMemory(void)
{
MakeCodeWriteable((long) SfxProcAsmStart, (long) SfxProcAsmEnd - (long) SfxProcAsmStart);
MakeCodeWriteable((long) FxEmu2AsmStart, (long) FxEmu2AsmEnd - (long) FxEmu2AsmStart);
MakeCodeWriteable((long) Dsp1ProcAsmStart, (long) Dsp1ProcAsmEnd - (long) Dsp1ProcAsmStart);
MakeCodeWriteable((long) FxEmu2BAsmStart, (long) FxEmu2BAsmEnd - (long) FxEmu2BAsmStart);
MakeCodeWriteable((long) FxEmu2CAsmStart, (long) FxEmu2CAsmEnd - (long) FxEmu2CAsmStart);
MakeCodeWriteable((long) FxTableAsmStart, (long) FxTableAsmEnd - (long) FxTableAsmStart);
MakeCodeWriteable((long) ExecuteAsmStart, (long) ExecuteAsmEnd - (long) ExecuteAsmStart);
MakeCodeWriteable((long) Sa1ProcAsmStart, (long) Sa1ProcAsmEnd - (long) Sa1ProcAsmStart);
MakeCodeWriteable((long) Sa1RegsAsmStart, (long) Sa1RegsAsmEnd - (long) Sa1RegsAsmStart);
MakeCodeWriteable((long) WinIntRFAsmStart, (long) WinIntRFAsmEnd - (long) WinIntRFAsmStart);
MakeCodeWriteable((long) GuiAsmStart, (long) GuiAsmEnd - (long) GuiAsmStart);
MakeCodeWriteable((long) ProcVidAsmStart, (long) ProcVidAsmEnd - (long) ProcVidAsmStart);
MakeCodeWriteable((long) CfgLoadAsmStart, (long) CfgLoadAsmEnd - (long) CfgLoadAsmStart);
MakeCodeWriteable((long) IrqAsmStart, (long) IrqAsmEnd - (long) IrqAsmStart);
MakeCodeWriteable((long) MemoryAsmStart, (long) MemoryAsmEnd - (long) MemoryAsmStart);
MakeCodeWriteable((long) Spc700AsmStart, (long) Spc700AsmEnd - (long) Spc700AsmStart);
MakeCodeWriteable((long) StableAsmStart, (long) StableAsmEnd - (long) StableAsmStart);
MakeCodeWriteable((long) DspProcAsmStart, (long) DspProcAsmEnd - (long) DspProcAsmStart);
MakeCodeWriteable((long) DmaAsmStart, (long) DmaAsmEnd - (long) DmaAsmStart);
MakeCodeWriteable((long) DspAsmStart, (long) DspAsmEnd - (long) DspAsmStart);
MakeCodeWriteable((long) TableAsmStart, (long) TableAsmEnd - (long) TableAsmStart);
MakeCodeWriteable((long) TableBAsmStart, (long) TableBAsmEnd - (long) TableBAsmStart);
MakeCodeWriteable((long) TableCAsmStart, (long) TableCAsmEnd - (long) TableCAsmStart);
@@ -197,7 +158,6 @@ void UnProtectMemory(void)
MakeCodeWriteable((long) Mode7ExtAsmStart, (long) Mode7ExtAsmEnd - (long) Mode7ExtAsmStart);
MakeCodeWriteable((long) M716TExtAsmStart, (long) M716TExtAsmEnd - (long) M716TExtAsmStart);
MakeCodeWriteable((long) TwoxSaiWAsmStart, (long) TwoxSaiWAsmEnd - (long) TwoxSaiWAsmStart);
MakeCodeWriteable((long) EndMemAsmStart, (long) EndMemAsmEnd - (long) EndMemAsmStart);
MakeCodeWriteable((long) MV16TMSAsmStart, (long) MV16TMSAsmEnd - (long) MV16TMSAsmStart);
MakeCodeWriteable((long) NewG162AsmStart, (long) NewG162AsmEnd - (long) NewG162AsmStart);
MakeCodeWriteable((long) NewGfx16AsmStart, (long) NewGfx16AsmEnd - (long) NewGfx16AsmStart);