More updates and fixes

This commit is contained in:
pagefault
2003-03-17 01:36:52 +00:00
parent d35231879b
commit 8aa021748b
5 changed files with 338 additions and 153 deletions

View File

@@ -37,7 +37,9 @@ NEWSYM DmaAsmStart
;*******************************************************
; DMA transfer register
NEWSYM AddrNoIncr, db 0
section .bss
NEWSYM AddrNoIncr, resb 1
section .text
%macro ExecSPCCycles 0
xor ebx,ebx
@@ -220,6 +222,7 @@ NEWSYM transdma
mov byte[AddrNoIncr],0
ret
section .data
ALIGN32
.curbank dd 0
@@ -233,6 +236,7 @@ ALIGN32
.regptrd dd 0
.readaddr dd 0
.cebx dd 0
section .text
NEWSYM transdmappu2cpu
; set address increment value
@@ -379,6 +383,7 @@ NEWSYM transdmappu2cpu
pop eax
ret
section .data
ALIGN32
.curbank dd 0
@@ -392,6 +397,7 @@ ALIGN32
.regptrd dd 0
.writeaddr dd 0
.cebx dd 0
section .text
%macro TestDMA 0
%endmacro
@@ -566,9 +572,11 @@ NEWSYM setuphdma
or [hdmatype],ah
ret
section .data
.addrwrite dw 0,0,0,0, 0,1,0,1, 0,0,0,0, 0,0,1,1, 0,1,2,3, 0,1,2,3, 0,1,2,3
dw 0,1,2,3
.addrnumt db 1,2,2,4,4,4,4,4
section .text
NEWSYM setuphdmars
push eax
@@ -666,9 +674,11 @@ NEWSYM setuphdmars
pop eax
ret
section .data
.addrwrite dw 0,0,0,0, 0,1,0,1, 0,0,0,0, 0,0,1,1, 0,1,2,3, 0,1,2,3, 0,1,2,3
dw 0,1,2,3
.addrnumt db 1,2,2,4,4,4,4,4
section .text
NEWSYM setuphdma2
push eax
@@ -777,12 +787,17 @@ NEWSYM setuphdma2
and [nexthdma],ah
ret
section .data
.addrwrite dw 0,0,0,0, 0,1,0,1, 0,0,0,0, 0,0,1,1, 0,1,2,3, 0,1,2,3, 0,1,2,3
dw 0,1,2,3
.addrnumt db 1,2,2,4,4,4,4,4
NEWSYM hdmastartsc, db 0
NEWSYM hdmarestart, db 0
section .bss
NEWSYM hdmastartsc, resb 1
NEWSYM hdmarestart, resb 1
section .text
NEWSYM reg420Cw
@@ -1024,7 +1039,9 @@ NEWSYM dohdma
pop eax
ret
.tempdecr db 0
section .bss
.tempdecr resd 1
section .text
NEWSYM hdmatype2
mov al,[edx+16]
@@ -1067,7 +1084,9 @@ NEWSYM hdmatype2
dec byte[esi+10]
ret
.tempdecr db 0
section .bss
.tempdecr resd 1
section .text
NEWSYM indirectaddr
push eax
@@ -1128,7 +1147,7 @@ NEWSYM indirectaddr
mov bl,[esi+7]
mov cx,[esi+5] ; increment/decrement/keep pointer location
add cx,3
call dword near [memtabler8+ebx*4]
call dword near [memtabler8+ebx*4]
call dword near [edx+12]
jmp .finhdma
.nozero
@@ -1146,11 +1165,17 @@ NEWSYM indirectaddr
pop eax
ret
.tempdecr db 0
section .bss
.tempdecr resd 1
section .data
.fname2 db 9,'vram2.dat',0
section .text
EXTSYM spcRam
section .data
NEWSYM ewj2hack, dd 0
section .text
NEWSYM hdmatype2indirect
cmp dword [ewj2hack],1
@@ -1243,8 +1268,10 @@ NEWSYM hdmatype2indirect
dec byte[esi+10]
ret
.dest dd 0
.tempdecr db 0
section .bss
.tempdecr resd 1
.dest resd 1
section .text
NEWSYM exechdma
cmp byte[hdmarestart],1

View File

@@ -391,7 +391,7 @@ NEWSYM ResetExecStuff
mov dword[nmistatus],0
mov byte[NextLineCache],0
mov dword[spcnumread],0
mov dword[spchalted],-1
; mov dword[spchalted],-1
mov dword[timer2upd],0
mov dword[HIRQCycNext],0
mov byte[HIRQNextExe],0

View File

@@ -21,7 +21,7 @@ EXTSYM SPC7110Enable,initSPC7110regs,RTCEnable,RTCReset
EXTSYM curypos,cycpl,debuggeron,pdh
EXTSYM vram
EXTSYM romispal
EXTSYM reg1read,spcnumread,spcon
EXTSYM reg1read,spcnumread,spchalted,spcon
EXTSYM reg2read
EXTSYM reg3read
EXTSYM reg4read
@@ -30,6 +30,9 @@ EXTSYM snesmouse
EXTSYM cycphb,joycontren,totlines
EXTSYM DosExit,invalid,numinst,previdmode,printhex,printnum
%ifdef OPENSPC
EXTSYM SPC_PORT0W, SPC_PORT1W, SPC_PORT2W, SPC_PORT3W
%endif
@@ -505,6 +508,7 @@ NEWSYM initregr
ret
; global variables
SECTION .data ;ALIGN=32
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
@@ -712,6 +716,8 @@ NEWSYM nssdip4, db 0
NEWSYM nssdip5, db 0
NEWSYM nssdip6, db 0
SECTION .text
NEWSYM ClearRegs
mov word[VIRQLoc],0
mov word[bg1ptr],0
@@ -984,11 +990,16 @@ reg213Fr:
; Sound Reg #1
reg2140r:
%ifdef OPENSPC
mov al,[SPC_PORT0W]
ret
%else
cmp byte[spcon],0
je .nosound
inc dword[SPC700read]
mov al,[reg1read]
mov byte[spcnumread],0
mov dword[spcnumread],0
; mov dword[spchalted],-1
ret
.nosound
; Find for D0
@@ -1020,14 +1031,20 @@ reg2140r:
mov al,[xa]
.n
ret
%endif
; Sound Reg #2
reg2141r:
%ifdef OPENSPC
mov al,[SPC_PORT1W]
ret
%else
cmp byte[spcon],0
je .nosound
inc dword[SPC700read]
mov al,[reg2read]
mov byte[spcnumread],0
mov dword[spcnumread],0
; mov dword[spchalted],-1
ret
.nosound
; Find for D0
@@ -1051,14 +1068,20 @@ reg2141r:
mov al,[xa]
.n
ret
%endif
; Sound Reg #3
reg2142r:
%ifdef OPENSPC
mov al,[SPC_PORT2W]
ret
%else
cmp byte[spcon],0
je .nosound
inc dword[SPC700read]
mov al,[reg3read]
mov byte[spcnumread],0
mov dword[spcnumread],0
; mov dword[spchalted],-1
ret
.nosound
; Find for D0
@@ -1081,14 +1104,20 @@ reg2142r:
mov al,[xa+1]
.n
ret
%endif
; Sound Reg #4
reg2143r:
%ifdef OPENSPC
mov al,[SPC_PORT3W]
ret
%else
cmp byte[spcon],0
je .nosound
inc dword[SPC700read]
mov al,[reg4read]
mov byte[spcnumread],0
mov dword[spcnumread],0
; mov dword[spchalted],-1
ret
.nosound
; Find for D0
@@ -1107,6 +1136,7 @@ reg2143r:
.notfound
mov al,[xa+1]
ret
%endif
reg2144r:
xor al,al
@@ -1136,7 +1166,10 @@ reg4016r:
rol dword[JoyANow],1
ret
NEWSYM MultiTap, db 0
SECTION .bss ;ALIGN=32
NEWSYM MultiTap, resb 1
SECTION .text
; Joystick Data for controller 2 and 4
reg4017r:
cmp byte[snesmouse],0
@@ -1242,6 +1275,10 @@ reg4211r:
.nohblank
ret
SECTION .bss
NEWSYM hblank, resb 1
SECTION .text
; H/V Blank Flag & Joystick Controller Enable Flag
; bit 7 = vblank, 0=out,1=in, bit 6 = hblank, 0=out,1=in, bit 0 = joystick on
reg4212r:
@@ -1275,8 +1312,10 @@ reg4212r:
or al,80h
; jmp .nohblank
.novbl
mov byte[hblank],0
cmp dh,[cycphb]
jae .nohblank
mov byte[hblank],1
or al,40h
.nohblank
test byte[INTEnab],01h
@@ -1464,6 +1503,8 @@ regINVALID: ; Invalid Register
call printnum
jmp DosExit
SECTION .data ;ALIGN=32
.invalidreg db 'Invalid Read Register : $'
SECTION .text

View File

@@ -32,14 +32,17 @@ EXTSYM opexec358,opexec358cph
EXTSYM hdmarestart
EXTSYM printhex8
%ifdef OPENSPC
EXTSYM SPC_PORT0R, SPC_PORT1R, SPC_PORT2R, SPC_PORT3R
%endif
NEWSYM testgfxv1, db 0
NEWSYM testgfxv2, db 0
SECTION .bss ;ALIGN=32
NEWSYM testgfxv1, resb 1
NEWSYM testgfxv2, resb 1
SECTION .text
NEWSYM initregw
; Fill register pointer with invalid register accesses
@@ -444,7 +447,9 @@ reg2100w:
and byte[forceblnk],80h
ret
NEWSYM prevoamptr, db 0
SECTION .bss ;ALIGN=32
NEWSYM prevoamptr, resb 1
SECTION .text
; OAM size register
reg2101w:
@@ -487,6 +492,7 @@ reg2101w:
.noproc
ret
SECTION .data ;ALIGN=32
.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
@@ -494,7 +500,9 @@ reg2101w:
.objadds1 dw 14,14,14,14,14,12,14,14
.objadds2 dw 14,12,8,12,8,8,14,14
NEWSYM oamlow, db 0
SECTION .bss ;ALIGN=32
NEWSYM oamlow, resb 1
SECTION .text
; OAM address register
reg2102w:
@@ -798,7 +806,9 @@ reg210Ew:
mov byte[bg1scroly+1],al
ret
bgscroltemp db 0
SECTION .bss ;ALIGN=32
bgscroltemp resb 1
SECTION .text
; BG2 horizontal scroll register
reg210Fw:
@@ -1124,7 +1134,9 @@ reg211Aw:
mov [mode7set],al
ret
SECTION .data ;ALIGN=32
NEWSYM multchange, db 1
SECTION .text
; COS (COSINE) rotate angle / X Expansion
reg211Bw:
@@ -1328,7 +1340,9 @@ reg2133w:
mov word[resolutn],239
ret
NEWSYM CleartheScreen, db 0
SECTION .bss ;ALIGN=32
NEWSYM CleartheScreen, resb 1
SECTION .text
; Sound Register #1
reg2140w:
@@ -1337,9 +1351,13 @@ reg2140w:
jne .n
mov byte[nmirept],0
.n
%ifdef OPENSPC
mov byte[SPC_PORT0R],al
%else
mov byte[spcRam+0F4h],al
inc dword[SPC700write]
reenablespc
%endif
ret
; cmp dword[cycpbl],0FFFFh
; ja .spcreset
@@ -1351,9 +1369,13 @@ reg2140w:
; Sound Register #2
reg2141w:
mov byte[sndwrit],1
%ifdef OPENSPC
mov byte[SPC_PORT1R],al
%else
mov byte[spcRam+0F5h],al
inc dword[SPC700write]
reenablespc
%endif
ret
; cmp dword[cycpbl],0FFFFh
; ja .spcreset
@@ -1365,9 +1387,13 @@ reg2141w:
; Sound Register #3
reg2142w:
mov byte[sndwrit],1
%ifdef OPENSPC
mov byte[SPC_PORT2R],al
%else
mov byte[spcRam+0F6h],al
inc dword[SPC700write]
reenablespc
%endif
ret
; cmp dword[cycpbl],0FFFFh
; ja .spcreset
@@ -1379,9 +1405,13 @@ reg2142w:
; Sound Register #4
reg2143w:
mov byte[sndwrit],1
%ifdef OPENSPC
mov byte[SPC_PORT3R],al
%else
mov byte[spcRam+0F7h],al
inc dword[SPC700write]
reenablespc
%endif
ret
; cmp dword[cycpbl],0FFFFh
; ja .spcreset
@@ -1417,7 +1447,9 @@ reg2183w:
ret
; Joystick 1 & 2 status bytes
NEWSYM MultiTapStat, db 0
SECTION .bss ;ALIGN=32
NEWSYM MultiTapStat, resb 1
SECTION .text
reg4016w:
test byte[INTEnab],1
@@ -1831,7 +1863,11 @@ regexiter:
call printnum
jmp DosExit
SECTION .data ;ALIGN=32
.invalidreg db 'Invalid Write Register : $'
.invalidaddr db ' at address $'
.invbank db 0
.invaddr db 0
SECTION .bss ;ALIGN=32
.invbank resb 1
.invaddr resb 1
SECTION .text