MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / OPLRead

Function OPLRead

src/Engine/Adlib/fmopl.cpp:1341–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341unsigned char OPLRead(FM_OPL *OPL,int a)
1342{
1343 if( !(a&1) )
1344 { /* status port */
1345 return OPL->status & (OPL->statusmask|0x80);
1346 }
1347 /* data port */
1348 switch(OPL->address)
1349 {
1350 case 0x05: /* KeyBoard IN */
1351 if(OPL->type&OPL_TYPE_KEYBOARD)
1352 {
1353 if(OPL->keyboardhandler_r)
1354 return OPL->keyboardhandler_r(OPL->keyboard_param);
1355 else
1356 LOG(LOG_WAR,("OPL:read unmapped KEYBOARD port\n"));
1357 }
1358 return 0;
1359#if 0
1360 case 0x0f: /* ADPCM-DATA */
1361 return 0;
1362#endif
1363 case 0x19: /* I/O DATA */
1364 if(OPL->type&OPL_TYPE_IO)
1365 {
1366 if(OPL->porthandler_r)
1367 return OPL->porthandler_r(OPL->port_param);
1368 else
1369 LOG(LOG_WAR,("OPL:read unmapped I/O port\n"));
1370 }
1371 return 0;
1372 case 0x1a: /* PCM-DATA */
1373 return 0;
1374 }
1375 return 0;
1376}
1377
1378int OPLTimerOver(FM_OPL *OPL,int c)
1379{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected