#include "stdafx.h" #include "kernelstate.h" #include "bitaccess.h" KernelState::KernelState() { m_dlg= NULL; m_HAL708_state= 0; } KernelState::~KernelState() { m_dlg= NULL; } void KernelState::SetView(CTstmodemDlg& dlg) { m_dlg= &dlg; } // ------- handle a400000064 bit 6 -------------------- bool KernelState::Get_a4000064_bit6() { return TestMemoryBitsAny(0xa4000064,0x40); } void KernelState::Set_a4000064_bit6(bool state) { if (state) SetMemoryBits(0xa4000064,0x40); else ClearMemoryBits(0xa4000064,0x40); } // ------- handle ac0203c8 -------------------- void KernelState::Set_ac0203c8(int nr) { SetMemory(0xac0203c8, nr); } int KernelState::Get_ac0203c8() { return GetMemory(0xac0203c8); } // ------- handle a400000068 bit 6 -------------------- void KernelState::Set_a4000068_bit6(bool state) { if (state) SetMemoryBits(0xa4000068,0x40); else ClearMemoryBits(0xa4000068,0x40); } bool KernelState::Get_a4000068_bit6() { return TestMemoryBitsAny(0xa4000068,0x40); } // ---------handle kernel ioctl ---------------------- extern "C" BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned); void KernelState::Set_KernelIoctrl_HAL708(int nr) { m_HAL708_state=nr; KernelIoControl(0x01010b11, &m_HAL708_state, 4, 0, 0, 0); } int KernelState::Get_KernelIoctrl_HAL708() { return m_HAL708_state; }