/* 81 */ int calc_init_81(LPCALC lpCalc, char *version) { /* INTIALIZE 81 */ //v2 is basically an 82 if (version[0] == '2') { memory_init_81(&lpCalc->mem_c); tc_init(&lpCalc->timer_c, MHZ_2); CPU_init(&lpCalc->cpu, &lpCalc->mem_c, &lpCalc->timer_c); ClearDevices(&lpCalc->cpu); device_init_83(&lpCalc->cpu, 1); } else { memory_init_81(&lpCalc->mem_c); tc_init(&lpCalc->timer_c, MHZ_2); CPU_init(&lpCalc->cpu, &lpCalc->mem_c, &lpCalc->timer_c); ClearDevices(&lpCalc->cpu); device_init_81(&lpCalc->cpu); } /* END INTIALIZE 81 */ #ifdef WINVER // FIXME: dirty cheater! lpCalc->flash_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.flash_size, sizeof(LPBREAKPOINT *)); lpCalc->ram_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.ram_size, sizeof(LPBREAKPOINT *)); if (version[0] == '2') { lpCalc->audio = &lpCalc->cpu.pio.link->audio; lpCalc->audio->enabled = FALSE; lpCalc->audio->init = FALSE; lpCalc->audio->timer_c = &lpCalc->timer_c; } #endif return TRUE; }
nsresult MulticastDNSDeviceProvider::Uninit() { MOZ_ASSERT(NS_IsMainThread()); if (!mInitialized) { return NS_OK; } ClearDevices(); Preferences::RemoveObservers(this, kObservedPrefs); StopDiscovery(NS_OK); UnregisterService(NS_OK); mMulticastDNS = nullptr; if (mWrappedListener) { mWrappedListener->SetListener(nullptr); mWrappedListener = nullptr; } mInitialized = false; return NS_OK; }
/* 82 83 */ static BOOL calc_init_83(LPCALC lpCalc, char *os) { /* INTIALIZE 83 */ memory_init_83(&lpCalc->mem_c); tc_init(&lpCalc->timer_c, MHZ_6); CPU_init(&lpCalc->cpu, &lpCalc->mem_c, &lpCalc->timer_c); ClearDevices(&lpCalc->cpu); if (lpCalc->model == TI_82) { if (memcmp(os, "19.006", 6)==0) { device_init_83(&lpCalc->cpu, 0); } else { device_init_83(&lpCalc->cpu, 1); } } else { device_init_83(&lpCalc->cpu, 0); } /* END INTIALIZE 83 */ #ifdef WINVER // FIXME: dirty cheater! lpCalc->flash_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.flash_size, sizeof(LPBREAKPOINT *)); lpCalc->ram_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.ram_size, sizeof(LPBREAKPOINT *)); lpCalc->audio = &lpCalc->cpu.pio.link->audio; lpCalc->audio->enabled = FALSE; lpCalc->audio->init = FALSE; lpCalc->audio->timer_c = &lpCalc->timer_c; #endif return TRUE; }
/* 83+se 84+se */ int calc_init_83pse(LPCALC lpCalc) { /* INTIALIZE 83+se */ memory_init_83pse(&lpCalc->mem_c); tc_init(&lpCalc->timer_c, MHZ_6); CPU_init(&lpCalc->cpu, &lpCalc->mem_c, &lpCalc->timer_c); ClearDevices(&lpCalc->cpu); device_init_83pse(&lpCalc->cpu); /* END INTIALIZE 83+se */ #ifdef WINVER // FIXME: dirty cheater! lpCalc->flash_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.flash_size, sizeof(LPBREAKPOINT *)); lpCalc->ram_cond_break = (LPBREAKPOINT *) calloc(lpCalc->mem_c.ram_size, sizeof(LPBREAKPOINT *)); lpCalc->audio = &lpCalc->cpu.pio.link->audio; lpCalc->audio->enabled = FALSE; lpCalc->audio->init = FALSE; lpCalc->audio->timer_c = &lpCalc->timer_c; #endif return 0; }
/* 84+ */ int calc_init_84p(LPCALC lpCalc) { /* INTIALIZE 84+ */ memory_init_84p(&lpCalc->mem_c); tc_init(&lpCalc->timer_c, MHZ_6); CPU_init(&lpCalc->cpu, &lpCalc->mem_c, &lpCalc->timer_c); ClearDevices(&lpCalc->cpu); device_init_83pse(&lpCalc->cpu); #ifdef WITH_BACKUPS init_backups(); #endif /* END INTIALIZE 84+ */ #ifdef WINVER // FIXME: dirty cheater! lpCalc->flash_cond_break = (breakpoint_t **) calloc(lpCalc->mem_c.flash_pages, PAGE_SIZE); lpCalc->ram_cond_break = (breakpoint_t **) calloc(lpCalc->mem_c.ram_pages, PAGE_SIZE); lpCalc->audio = &lpCalc->cpu.pio.link->audio; lpCalc->audio->enabled = FALSE; lpCalc->audio->init = FALSE; lpCalc->audio->timer_c = &lpCalc->timer_c; #endif return 0; }
CMainFrame::~CMainFrame() { ClearDevices(); }
BOOL CMainFrame::RefreshStatus() { AutoCursor l_auto_cursor(IDC_WAIT); m_viewTreeList.GetTreeControl().DeleteAllItems(); ClearDevices(); // Initially, no commands are enabled // UIEnableForDevice(pDevice, IDM_TOOL_BIND); UIEnableForDevice(NULL, IDM_TOOL_UNBIND); UIEnableForDevice(NULL, IDM_TOOL_ADDMIRROR); UIEnableForDevice(NULL, IDM_TOOL_MIGRATE); UIEnableForDevice(NULL, IDM_TOOL_REPLACE_DEVICE); UIEnableForDevice(NULL, IDM_TOOL_REPLACE_UNIT_DEVICE); UIEnableForDevice(NULL, IDM_TOOL_SINGLE); UIEnableForDevice(NULL, IDM_TOOL_SPAREADD); UIEnableForDevice(NULL, IDM_TOOL_SPAREREMOVE); UpdateWindow(); // retrieve all the device & unit device information if(!NdasEnumDevices( EnumDevicesCallBack, reinterpret_cast<LPVOID>(&m_listDevices))) { return FALSE; } m_wndRefreshProgress.ShowWindow(SW_SHOW); m_wndRefreshProgress.SetRange32(0, m_listDevices.size()); m_wndRefreshProgress.SetStep(1); m_wndRefreshProgress.SetPos(0); // initialize all the unit devices for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { if(!(*itDevice)->UnitDevicesInitialize()) { // add single empty device ATLTRACE(_T("Device not connected : %s\n"), (*itDevice)->GetName()); // m_wndRefreshProgress.ShowWindow(SW_HIDE); // return FALSE; } m_wndRefreshProgress.StepIt(); } // create logical devices CNBUnitDevice *pUnitDevice; CNBLogicalDevice *pLogicalDevice; m_wndRefreshProgress.SetPos(0); for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { for(UINT32 i = 0; i < (*itDevice)->UnitDevicesCount(); i++) { // find logical device which has this unit device as member pLogicalDevice = NULL; pUnitDevice = (*(*itDevice))[i]; ATLASSERT(pUnitDevice); if(!pUnitDevice) return FALSE; for(NBLogicalDevicePtrList::iterator itLogicalDevice = m_listLogicalDevices.begin(); itLogicalDevice != m_listLogicalDevices.end(); itLogicalDevice++) { if((*itLogicalDevice)->IsMember(pUnitDevice)) { // add to this logical device pLogicalDevice = *itLogicalDevice; ATLTRACE(_T("use CNBLogicalDevice(%p) : %s\n"), pLogicalDevice, pUnitDevice->GetName()); break; } } if(NULL == pLogicalDevice) { // create new logical device pLogicalDevice = new CNBLogicalDevice(); m_listLogicalDevices.push_back(pLogicalDevice); ATLTRACE(_T("new CNBLogicalDevice(%p) : %s\n"), pLogicalDevice, pUnitDevice->GetName()); } if(!pLogicalDevice->UnitDeviceAdd(pUnitDevice)) { m_wndRefreshProgress.ShowWindow(SW_HIDE); return FALSE; } } m_wndRefreshProgress.StepIt(); } m_viewTreeList.SetDevices(&m_listLogicalDevices); m_wndRefreshProgress.ShowWindow(SW_HIDE); return TRUE; }
BOOL CMainFrame::RefreshStatus() { // lock ActivateUI(FALSE); m_viewTreeList.GetTreeControl().DeleteAllItems(); ClearDevices(); // retrieve all the device & unit device information if(!NdasEnumDevices( EnumDevicesCallBack, reinterpret_cast<LPVOID>(&m_listDevices))) return FALSE; m_wndRefreshProgress.ShowWindow(SW_SHOW); m_wndRefreshProgress.SetRange32(0, m_listDevices.size()); m_wndRefreshProgress.SetStep(1); m_wndRefreshProgress.SetPos(0); // initialize all the unit devices for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { if(!(*itDevice)->UnitDevicesInitialize()) { m_wndRefreshProgress.ShowWindow(SW_HIDE); return FALSE; } m_wndRefreshProgress.StepIt(); } // create logical devices CNBUnitDevice *pUnitDevice; CNBLogicalDevice *pLogicalDevice; UINT32 nLogicalDeviceIndex = 0; m_wndRefreshProgress.SetPos(0); for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { for(UINT32 i = 0; i < (*itDevice)->UnitDevicesCount(); i++) { // find logical device which has this unit device as member pLogicalDevice = NULL; pUnitDevice = (*(*itDevice))[i]; for(NBLogicalDevicePtrMap::iterator itLogicalDevice = m_mapLogicalDevices.begin(); itLogicalDevice != m_mapLogicalDevices.end(); itLogicalDevice++) { if(itLogicalDevice->second->IsMember(pUnitDevice)) { // add to this logical device pLogicalDevice = itLogicalDevice->second; break; } } if(NULL == pLogicalDevice) { // create new logical device pLogicalDevice = new CNBLogicalDevice(nLogicalDeviceIndex); m_mapLogicalDevices[nLogicalDeviceIndex++] = pLogicalDevice; } if(!pLogicalDevice->UnitDeviceAdd(pUnitDevice)) { m_wndRefreshProgress.ShowWindow(SW_HIDE); return FALSE; } } m_wndRefreshProgress.StepIt(); } m_viewTreeList.SetDevices(&m_mapLogicalDevices); m_wndRefreshProgress.ShowWindow(SW_HIDE); ActivateUI(TRUE); return TRUE; }
BOOL CMainFrame::RefreshStatus() { // lock ActivateUI(FALSE); m_viewTreeList.GetTreeControl().DeleteAllItems(); ClearDevices(); // retrieve all the device & unit device information if(!NdasEnumDevices( EnumDevicesCallBack, reinterpret_cast<LPVOID>(&m_listDevices))) return FALSE; m_wndRefreshProgress.ShowWindow(SW_SHOW); m_wndRefreshProgress.SetRange32(0, m_listDevices.size()); m_wndRefreshProgress.SetStep(1); m_wndRefreshProgress.SetPos(0); // initialize all the unit devices for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { if(!(*itDevice)->UnitDevicesInitialize()) { // add single empty device ATLTRACE(_T("Device not connected : %s\n"), (*itDevice)->GetName()); // m_wndRefreshProgress.ShowWindow(SW_HIDE); // return FALSE; } m_wndRefreshProgress.StepIt(); } // create logical devices CNBUnitDevice *pUnitDevice; CNBLogicalDevice *pLogicalDevice; m_wndRefreshProgress.SetPos(0); for(NBNdasDevicePtrList::iterator itDevice = m_listDevices.begin(); itDevice != m_listDevices.end(); itDevice++) { /* if(0 == (*itDevice)->UnitDevicesCount()) { // suppose to be disconnected pLogicalDevice = new CNBLogicalDevice(); pLogicalDevice->SetEmpty(); m_listLogicalDevices.push_back(pLogicalDevice); ATLTRACE(_T("new CNBLogicalDevice(%p) : empty\n"), pLogicalDevice); } */ for(UINT32 i = 0; i < (*itDevice)->UnitDevicesCount(); i++) { // find logical device which has this unit device as member pLogicalDevice = NULL; pUnitDevice = (*(*itDevice))[i]; ATLASSERT(pUnitDevice); if(!pUnitDevice) return FALSE; for(NBLogicalDevicePtrList::iterator itLogicalDevice = m_listLogicalDevices.begin(); itLogicalDevice != m_listLogicalDevices.end(); itLogicalDevice++) { if((*itLogicalDevice)->IsMember(pUnitDevice)) { // add to this logical device pLogicalDevice = *itLogicalDevice; ATLTRACE(_T("use CNBLogicalDevice(%p) : %s\n"), pLogicalDevice, pUnitDevice->GetName()); break; } } if(NULL == pLogicalDevice) { // create new logical device pLogicalDevice = new CNBLogicalDevice(); m_listLogicalDevices.push_back(pLogicalDevice); ATLTRACE(_T("new CNBLogicalDevice(%p) : %s\n"), pLogicalDevice, pUnitDevice->GetName()); } if(!pLogicalDevice->UnitDeviceAdd(pUnitDevice)) { m_wndRefreshProgress.ShowWindow(SW_HIDE); return FALSE; } } m_wndRefreshProgress.StepIt(); } m_viewTreeList.SetDevices(&m_listLogicalDevices); m_wndRefreshProgress.ShowWindow(SW_HIDE); ActivateUI(TRUE); return TRUE; }