儲存庫 vbox 的更動 55010
- 時間撮記:
- 2015-3-30 下午04:33:39 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r55009 r55010 189 189 int use_hdma; 190 190 int highspeed; 191 int can_write; /** @ Todo Value never gets 0? */191 int can_write; /** @todo Value never gets 0? */ 192 192 193 193 int v2x6; … … 323 323 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 324 324 325 static int magic_of_irq 325 static int magic_of_irq(int irq) 326 326 { 327 327 switch (irq) … … 343 343 } 344 344 345 static int irq_of_magic 345 static int irq_of_magic(int magic) 346 346 { 347 347 switch (magic) … … 363 363 } 364 364 365 #if 0366 static void log_dsp (PSB16STATE dsp)367 { 368 ldebug("%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:speaker=%d\n",369 dsp->fmt_stereo ? "Stereo" : "Mono",370 dsp->fmt_signed ? "Signed" : "Unsigned",371 dsp->fmt_bits,372 dsp->dma_auto ? "Auto" : "Single",373 dsp->block_size,374 dsp->freq,375 dsp->time_const,376 dsp->speaker);365 #ifdef DEBUG 366 static inline void log_dsp(PSB16STATE pThis) 367 { 368 LogFlowFunc(("%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:speaker=%d\n", 369 pThis->fmt_stereo ? "Stereo" : "Mono", 370 pThis->fmt_signed ? "Signed" : "Unsigned", 371 pThis->fmt_bits, 372 pThis->dma_auto ? "Auto" : "Single", 373 pThis->block_size, 374 pThis->freq, 375 pThis->time_const, 376 pThis->speaker)); 377 377 } 378 378 #endif … … 1147 1147 } 1148 1148 1149 static void reset(PSB16STATE pThis)1149 static void sb16Reset(PSB16STATE pThis) 1150 1150 { 1151 1151 #ifndef VBOX … … 1181 1181 } 1182 1182 1183 static IO_WRITE_PROTO 1184 { 1185 PSB16STATE pThis = ( SB16STATE*)opaque;1183 static IO_WRITE_PROTO(dsp_write) 1184 { 1185 PSB16STATE pThis = (PSB16STATE)opaque; 1186 1186 int iport = nport - pThis->port; 1187 1187 1188 1188 LogFlowFunc(("write %#x <- %#x\n", nport, val)); 1189 switch (iport) { 1190 case 0x06: 1191 switch (val) { 1192 case 0x00: 1193 if (pThis->v2x6 == 1) { 1194 if (0 && pThis->highspeed) { 1195 pThis->highspeed = 0; 1189 switch (iport) 1190 { 1191 case 0x06: 1192 switch (val) 1193 { 1194 case 0x00: 1195 { 1196 if (pThis->v2x6 == 1) 1197 { 1198 if (0 && pThis->highspeed) 1199 { 1200 pThis->highspeed = 0; 1196 1201 #ifndef VBOX 1197 qemu_irq_lower (pThis->pic[pThis->irq]); 1198 #else 1199 PDMDevHlpISASetIrq(pThis->pDevIns, pThis->irq, 0); 1200 #endif 1201 sb16Control(pThis, 0); 1202 qemu_irq_lower (pThis->pic[pThis->irq]); 1203 #else 1204 PDMDevHlpISASetIrq(pThis->pDevIns, pThis->irq, 0); 1205 #endif 1206 sb16Control(pThis, 0); 1207 } 1208 else 1209 sb16Reset(pThis); 1210 } 1211 pThis->v2x6 = 0; 1212 break; 1202 1213 } 1203 else { 1204 reset (pThis); 1214 1215 case 0x01: 1216 case 0x03: /* FreeBSD kludge */ 1217 pThis->v2x6 = 1; 1218 break; 1219 1220 case 0xc6: 1221 pThis->v2x6 = 0; /* Prince of Persia, csp.sys, diagnose.exe */ 1222 break; 1223 1224 case 0xb8: /* Panic */ 1225 sb16Reset(pThis); 1226 break; 1227 1228 case 0x39: 1229 dsp_out_data(pThis, 0x38); 1230 sb16Reset(pThis); 1231 pThis->v2x6 = 0x39; 1232 break; 1233 1234 default: 1235 pThis->v2x6 = val; 1236 break; 1237 } 1238 break; 1239 1240 case 0x0c: /* Write data or command | write status */ 1241 #if 0 1242 if (pThis->highspeed) 1243 break; 1244 #endif 1245 if (0 == pThis->needed_bytes) 1246 { 1247 command(pThis, val); 1248 #if 0 1249 if (0 == pThis->needed_bytes) { 1250 log_dsp (pThis); 1251 } 1252 #endif 1253 } 1254 else 1255 { 1256 if (pThis->in_index == sizeof (pThis->in2_data)) 1257 { 1258 LogFlowFunc(("in data overrun\n")); 1259 } 1260 else 1261 { 1262 pThis->in2_data[pThis->in_index++] = val; 1263 if (pThis->in_index == pThis->needed_bytes) 1264 { 1265 pThis->needed_bytes = 0; 1266 complete (pThis); 1267 #if 0 1268 log_dsp (pThis); 1269 #endif 1270 } 1205 1271 } 1206 1272 } 1207 pThis->v2x6 = 0;1208 break;1209 1210 case 0x01:1211 case 0x03: /* FreeBSD kludge */1212 pThis->v2x6 = 1;1213 break;1214 1215 case 0xc6:1216 pThis->v2x6 = 0; /* Prince of Persia, csp.sys, diagnose.exe */1217 break;1218 1219 case 0xb8: /* Panic */1220 reset (pThis);1221 break;1222 1223 case 0x39:1224 dsp_out_data (pThis, 0x38);1225 reset (pThis);1226 pThis->v2x6 = 0x39;1227 1273 break; 1228 1274 1229 1275 default: 1230 pThis->v2x6 = val; 1231 break; 1232 } 1233 break; 1234 1235 case 0x0c: /* write data or command | write status */ 1236 /* if (pThis->highspeed) */ 1237 /* break; */ 1238 1239 if (0 == pThis->needed_bytes) { 1240 command (pThis, val); 1241 #if 0 1242 if (0 == pThis->needed_bytes) { 1243 log_dsp (pThis); 1244 } 1245 #endif 1246 } 1247 else { 1248 if (pThis->in_index == sizeof (pThis->in2_data)) { 1249 LogFlowFunc(("in data overrun\n")); 1250 } 1251 else { 1252 pThis->in2_data[pThis->in_index++] = val; 1253 if (pThis->in_index == pThis->needed_bytes) { 1254 pThis->needed_bytes = 0; 1255 complete (pThis); 1256 #if 0 1257 log_dsp (pThis); 1258 #endif 1259 } 1260 } 1261 } 1262 break; 1263 1264 default: 1265 LogFlowFunc(("nport=%#x, val=%#x)\n", nport, val)); 1266 break; 1276 LogFlowFunc(("nport=%#x, val=%#x)\n", nport, val)); 1277 break; 1267 1278 } 1268 1279 … … 1272 1283 } 1273 1284 1274 static IO_READ_PROTO 1275 { 1276 PSB16STATE pThis = ( SB16STATE*)opaque;1285 static IO_READ_PROTO(dsp_read) 1286 { 1287 PSB16STATE pThis = (PSB16STATE)opaque; 1277 1288 int iport, retval, ack = 0; 1278 1289 … … 1429 1440 static IO_WRITE_PROTO(mixer_write_indexb) 1430 1441 { 1431 PSB16STATE pThis = ( SB16STATE*)opaque;1442 PSB16STATE pThis = (PSB16STATE)opaque; 1432 1443 (void) nport; 1433 1444 pThis->mixer_nreg = val; … … 1593 1604 mixer_write_datab (opaque, nport, (val >> 8) & 0xff); 1594 1605 #else /* VBOX */ 1595 PSB16STATE pThis = ( SB16STATE*)opaque;1606 PSB16STATE pThis = (PSB16STATE)opaque; 1596 1607 int iport = nport - pThis->port; 1597 1608 switch (cb) … … 1622 1633 static IO_READ_PROTO(mixer_read) 1623 1634 { 1624 PSB16STATE pThis = ( SB16STATE*)opaque;1635 PSB16STATE pThis = (PSB16STATE)opaque; 1625 1636 1626 1637 (void) nport; … … 2097 2108 pThis->csp_regs[9] = 0xf8; 2098 2109 2099 sb16MixerReset 2110 sb16MixerReset(pThis); 2100 2111 pThis->aux_ts = qemu_new_timer (vm_clock, aux_timer, s); 2101 2112 if (!pThis->aux_ts) { … … 2341 2352 pThis->csp_regs[9] = 0xf8; 2342 2353 2354 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2355 RTListInit(&pThis->lstDrv); 2356 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 2357 2343 2358 sb16MixerReset(pThis); 2344 2359 … … 2394 2409 */ 2395 2410 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2396 RTListInit(&pThis->lstDrv);2397 2398 2411 uint8_t uLUN; 2399 2412 for (uLUN = 0; uLUN < UINT8_MAX; uLUN)
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器