/* !DO NOT ALTER FUNCTION SIGNATURE! */ int callback_ofc_capable_switch_ofc_logical_switches_ofc_switch_ofc_controllers_ofc_controller_ofc_ip_address (void ** data, XMLDIFF_OP op, xmlNodePtr node, struct nc_err** error) { nc_verb_verbose("%s: data=%p, op=%d\n", __PRETTY_FUNCTION__, data, op); assert(__data); if ((XMLDIFF_ADD) & op) { // fixme handle zone in address (see http://www.netconfcentral.org/modules/ietf-inet-types) CONTROLLER(__data)->ip_domain = parse_ip_address(XML_GET_CONTENT(node->children), &CONTROLLER(__data)->ip); } else if ((XMLDIFF_REM) & op) { } else { nc_verb_error("not implemented"); assert(0); } return EXIT_SUCCESS; }
/* !DO NOT ALTER FUNCTION SIGNATURE! */ int callback_ofc_capable_switch_ofc_logical_switches_ofc_switch_ofc_controllers_ofc_controller_ofc_id (void ** data, XMLDIFF_OP op, xmlNodePtr node, struct nc_err** error) { nc_verb_verbose("%s: data=%p, op=%d\n", __PRETTY_FUNCTION__, data, op); assert(NULL == __data); if ((XMLDIFF_ADD|XMLDIFF_REM) & op) { __data = calloc(1, sizeof(struct controller)); CONTROLLER(__data)->id = strdup(XML_GET_CONTENT(node->children)); assert(CONTROLLER(__data)->id); } else { nc_verb_error("not implemented"); assert(0); } return EXIT_SUCCESS; }
/* !DO NOT ALTER FUNCTION SIGNATURE! */ int callback_ofc_capable_switch_ofc_logical_switches_ofc_switch_ofc_controllers_ofc_controller_ofc_port (void ** data, XMLDIFF_OP op, xmlNodePtr node, struct nc_err** error) { nc_verb_verbose("%s: data=%p, op=%d\n", __PRETTY_FUNCTION__, data, op); assert(__data); if ((XMLDIFF_ADD) & op) { CONTROLLER(__data)->port = strtoul(XML_GET_CONTENT(node->children), NULL, 10); } else if ((XMLDIFF_REM) & op) { } else { nc_verb_error("not implemented"); assert(0); } return EXIT_SUCCESS; }
void CNES::RUN ( uint32_t* joy ) { uint32_t ljoy [ NUM_CONTROLLERS ]; JoypadLoggerInfo* pSample; if ( m_bReplay ) { if ( m_frame >= CIOStandardJoypad::LOGGER(0)->GetNumSamples() ) { m_bReplay = false; } } // Copy joy data locally for replay edits... *(ljoy+CONTROLLER1) = *(joy+CONTROLLER1); *(ljoy+CONTROLLER2) = *(joy+CONTROLLER2); if ( m_bRecord ) { CIOStandardJoypad::LOGGER(0)->AddSample ( C6502::_CYCLES(), *(ljoy+CONTROLLER1) ); } if ( m_bRecord ) { CIOStandardJoypad::LOGGER(1)->AddSample ( C6502::_CYCLES(), *(ljoy+CONTROLLER2) ); } if ( CONTROLLER(0) == IO_StandardJoypad ) { if ( m_bReplay ) { pSample = CIOStandardJoypad::LOGGER(0)->GetSample ( m_frame ); *(ljoy+CONTROLLER1) |= (pSample->data); } CIOStandardJoypad::JOY ( CONTROLLER1, *(ljoy+CONTROLLER1) ); } else if ( CONTROLLER(0) == IO_TurboJoypad ) { if ( m_bReplay ) { pSample = CIOTurboJoypad::LOGGER(0)->GetSample ( m_frame ); *(ljoy+CONTROLLER1) |= (pSample->data); } CIOTurboJoypad::JOY ( CONTROLLER1, *(ljoy+CONTROLLER1) ); } else if ( CONTROLLER(0) == IO_Zapper ) { CIOZapper::JOY ( CONTROLLER1, *(ljoy+CONTROLLER1) ); } else if ( CONTROLLER(0) == IO_Vaus ) { CIOVaus::JOY ( CONTROLLER1, *(ljoy+CONTROLLER1) ); } else { CIOStandardJoypad::JOY ( CONTROLLER1, 0x00 ); } if ( CONTROLLER(1) == IO_StandardJoypad ) { if ( m_bReplay ) { pSample = CIOStandardJoypad::LOGGER(1)->GetSample ( m_frame ); *(ljoy+CONTROLLER2) |= (pSample->data); } CIOStandardJoypad::JOY ( CONTROLLER2, *(ljoy+CONTROLLER2) ); } else if ( CONTROLLER(1) == IO_TurboJoypad ) { if ( m_bReplay ) { pSample = CIOTurboJoypad::LOGGER(1)->GetSample ( m_frame ); *(ljoy+CONTROLLER2) |= (pSample->data); } CIOTurboJoypad::JOY ( CONTROLLER2, *(ljoy+CONTROLLER2) ); } else if ( CONTROLLER(1) == IO_Zapper ) { CIOZapper::JOY ( CONTROLLER2, *(ljoy+CONTROLLER2) ); } else if ( CONTROLLER(1) == IO_Vaus ) { CIOVaus::JOY ( CONTROLLER2, *(ljoy+CONTROLLER2) ); } else { CIOStandardJoypad::JOY ( CONTROLLER2, 0x00 ); } // PPU cycles repeat... CPPU::RESETCYCLECOUNTER (); m_frame = CPPU::_FRAME(); if ( nesIsDebuggable() ) { m_tracer->SetFrame ( m_frame ); // Emit start-of-frame indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_StartPPUFrame, eNESSource_PPU, 0, 0, 0 ); } // Do scanline processing for scanlines 0 - 239 (the screen!)... CPPU::RENDERSCANLINE ( SCANLINES_VISIBLE ); #if 0 // CPTODO: move this to ide... // Update CHR memory inspector at appropriate scanline... if ( idx == CPPU::GetPPUViewerScanline() ) { CPPU::RENDERCHRMEM (); } // Update OAM inspector at appropriate scanline... if ( idx == CPPU::GetOAMViewerScanline() ) { CPPU::RENDEROAM (); } #endif if ( nesIsDebuggable() ) { // Emit start-of-quiet scanline indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_QuietStart, eNESSource_PPU, 0, 0, 0 ); } // Emulate PPU resting scanlines... CPPU::QUIETSCANLINES (); if ( nesIsDebuggable() ) { // Emit end-of-quiet scanline indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_QuietEnd, eNESSource_PPU, 0, 0, 0 ); // Do VBLANK processing (scanlines 0-19 NTSC or 0-69 PAL)... // Emit start-VBLANK indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_VBLANKStart, eNESSource_PPU, 0, 0, 0 ); } // Emulate VBLANK non-render scanlines... CPPU::VBLANKSCANLINES (); if ( nesIsDebuggable() ) { // Emit end-VBLANK indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_VBLANKEnd, eNESSource_PPU, 0, 0, 0 ); // Emit start-of-prerender scanline indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_PreRenderStart, eNESSource_PPU, 0, 0, 0 ); } // Pre-render scanline... CPPU::RENDERSCANLINE ( -1 ); if ( nesIsDebuggable() ) { // Emit end-of-prerender scanline indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_PreRenderEnd, eNESSource_PPU, 0, 0, 0 ); // Emit end-of-frame indication to Tracer... m_tracer->AddSample ( CPPU::_CYCLES(), eTracer_EndPPUFrame, eNESSource_PPU, 0, 0, 0 ); } }