filename | src/asic.c |
changeset | 855:b937948d79d9 |
prev | 833:1ea87e0221f8 |
next | 929:fd8cb0c82f5f |
author | nkeynes |
date | Sun Dec 14 07:50:48 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Setup a 'proper' stackframe in translated blocks. This doesn't affect performance noticeably, but does ensure that a) The stack is aligned correctly on OS X with no extra effort, and b) We can't mess up the stack and crash that way anymore. Replace all PUSH/POP instructions (outside of prologue/epilogue) with ESP-rel moves to stack local variables. Finally merge ia32mac and ia32abi together, since they're pretty much the same now anyway (and thereby simplifying maintenance a good deal) |
file | annotate | diff | log | raw |
1.1 --- a/src/asic.c Wed Aug 27 09:42:16 2008 +00001.2 +++ b/src/asic.c Sun Dec 14 07:50:48 2008 +00001.3 @@ -351,6 +351,28 @@1.4 asic_event( EVENT_PVR_DMA );1.5 }1.7 +void pvr_dma2_transfer()1.8 +{1.9 + if( MMIO_READ( EXTDMA, PVRDMA2CTL2 ) == 1 ) {1.10 + if( MMIO_READ( EXTDMA, PVRDMA2CTL1 ) == 1 ) {1.11 + sh4addr_t extaddr = MMIO_READ( EXTDMA, PVRDMA2EXT );1.12 + sh4addr_t sh4addr = MMIO_READ( EXTDMA, PVRDMA2SH4 );1.13 + int dir = MMIO_READ( EXTDMA, PVRDMA2DIR );1.14 + uint32_t length = MMIO_READ( EXTDMA, PVRDMA2SIZ );1.15 + unsigned char buf[length];1.16 + if( dir == 0 ) { /* SH4 to PVR */1.17 + mem_copy_from_sh4( buf, sh4addr, length );1.18 + mem_copy_to_sh4( extaddr, buf, length );1.19 + } else { /* PVR to SH4 */1.20 + mem_copy_from_sh4( buf, extaddr, length );1.21 + mem_copy_to_sh4( sh4addr, buf, length );1.22 + }1.23 + MMIO_WRITE( EXTDMA, PVRDMA2CTL2, 0 );1.24 + asic_event( EVENT_PVR_DMA2 );1.25 + }1.26 + }1.27 +}1.28 +1.29 void sort_dma_transfer( )1.30 {1.31 sh4addr_t table_addr = MMIO_READ( ASIC, SORTDMATBL );1.32 @@ -615,9 +637,8 @@1.33 break;1.34 case PVRDMA2CTL1:1.35 case PVRDMA2CTL2:1.36 - if( val != 0 ) {1.37 - ERROR( "Write to unimplemented DMA control register %08X", reg );1.38 - }1.39 + MMIO_WRITE( EXTDMA, reg, val & 1 );1.40 + pvr_dma2_transfer();1.41 break;1.42 default:1.43 MMIO_WRITE( EXTDMA, reg, val );
.