All slots [0..7] must register their handlers
| 1149 | |
| 1150 | // All slots [0..7] must register their handlers |
| 1151 | void RegisterIoHandler(UINT uSlot, iofunction IOReadC0, iofunction IOWriteC0, iofunction IOReadCx, iofunction IOWriteCx, LPVOID lpSlotParameter, BYTE* pExpansionRom) |
| 1152 | { |
| 1153 | _ASSERT(uSlot < NUM_SLOTS); |
| 1154 | g_SlotInfo[uSlot].parameters = lpSlotParameter; |
| 1155 | |
| 1156 | // What about [$C80x..$CFEx]? - Do any cards use this as I/O memory? |
| 1157 | g_SlotInfo[uSlot].expansionRom = pExpansionRom; |
| 1158 | |
| 1159 | if (IOReadC0 == NULL) IOReadC0 = IO_Null; |
| 1160 | if (IOWriteC0 == NULL) IOWriteC0 = IO_Null; |
| 1161 | |
| 1162 | // Setup the r/w function pointers for I/O in the 16-byte range at: $C080+s*16 |
| 1163 | IORead[uSlot+8] = IOReadC0; |
| 1164 | IOWrite[uSlot+8] = IOWriteC0; |
| 1165 | |
| 1166 | if (uSlot == SLOT0) // Don't trash C0xx handlers |
| 1167 | return; |
| 1168 | |
| 1169 | // |
| 1170 | |
| 1171 | if (IOReadCx == NULL) IOReadCx = IO_Cxxx; |
| 1172 | if (IOWriteCx == NULL) IOWriteCx = IO_Cxxx; |
| 1173 | |
| 1174 | for (UINT i=0; i<16; i++) // Setup the r/w function pointers for I/O in the 256-byte range: $Cs00..CsFF |
| 1175 | { |
| 1176 | IORead[uSlot*16+i] = IOReadCx; |
| 1177 | IOWrite[uSlot*16+i] = IOWriteCx; |
| 1178 | } |
| 1179 | |
| 1180 | // Setup the r/w function pointers for I/O in the range: $C800..CFFF |
| 1181 | g_SlotInfo[uSlot].IOReadCx = IOReadCx; |
| 1182 | g_SlotInfo[uSlot].IOWriteCx = IOWriteCx; |
| 1183 | } |
| 1184 | |
| 1185 | void UnregisterIoHandler(UINT uSlot) |
| 1186 | { |
no outgoing calls
no test coverage detected