| 73 | } |
| 74 | |
| 75 | void __DVDInterruptHandler(__OSInterrupt interrupt, OSContext* context) |
| 76 | { |
| 77 | DVDLowCallback cb; |
| 78 | OSContext exceptionContext; |
| 79 | u32 cause = 0; |
| 80 | u32 reg; |
| 81 | u32 intr; |
| 82 | u32 mask; |
| 83 | |
| 84 | if (LastCommandWasRead) |
| 85 | { |
| 86 | LastReadFinished = __OSGetSystemTime(); |
| 87 | FirstRead = FALSE; |
| 88 | Prev.addr = Curr.addr; |
| 89 | Prev.length = Curr.length; |
| 90 | Prev.offset = Curr.offset; |
| 91 | if (StopAtNextInt == TRUE) |
| 92 | { |
| 93 | cause |= 8; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | LastCommandWasRead = FALSE; |
| 98 | StopAtNextInt = FALSE; |
| 99 | reg = __DIRegs[0]; |
| 100 | mask = reg & 0x2a; |
| 101 | intr = (reg & 0x54) & (mask << 1); |
| 102 | |
| 103 | if (intr & 0x40) |
| 104 | { |
| 105 | cause |= 8; |
| 106 | } |
| 107 | |
| 108 | if (intr & 0x10) |
| 109 | { |
| 110 | cause |= 1; |
| 111 | } |
| 112 | |
| 113 | if (intr & 4) |
| 114 | { |
| 115 | cause |= 2; |
| 116 | } |
| 117 | |
| 118 | if (cause) |
| 119 | { |
| 120 | ResetOccurred = FALSE; |
| 121 | OSCancelAlarm(&AlarmForTimeout); |
| 122 | } |
| 123 | |
| 124 | __DIRegs[0] = intr | mask; |
| 125 | |
| 126 | if (ResetOccurred && (__OSGetSystemTime() - LastResetEnd) < OSMillisecondsToTicks(200)) |
| 127 | { |
| 128 | reg = __DIRegs[1]; |
| 129 | mask = reg & 0x2; |
| 130 | intr = (reg & 4) & (mask << 1); |
| 131 | if (intr & 4) |
| 132 | { |
nothing calls this directly
no test coverage detected