x88000
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
x88000 [2021/01/13 07:01] – [カーソルキーの機能を変える(Windows版)] araki | x88000 [2021/01/14 00:37] (現在) – [カーソルキーの機能を変える(Windows版)] araki | ||
---|---|---|---|
行 27: | 行 27: | ||
* コンパイルエラー('' | * コンパイルエラー('' | ||
* ライブラリ'' | * ライブラリ'' | ||
+ | * DirectInput8 のインスタンスが作成されるようにする。('' | ||
+ | |||
+ | < | ||
+ | #if 0 | ||
+ | typedef HRESULT WINAPI DirectInputCreateProc( | ||
+ | HINSTANCE, DWORD, IDirectInput**, | ||
+ | DirectInputCreateProc* pprocDirectInputCreate = (DirectInputCreateProc*) | ||
+ | GetProcAddress(, | ||
+ | if (pprocDirectInputCreate == NULL) { | ||
+ | return false; | ||
+ | } | ||
+ | HRESULT hResult; | ||
+ | // Direct Input | ||
+ | hResult = pprocDirectInputCreate( | ||
+ | (HINSTANCE)GetModuleHandle(NULL), | ||
+ | DIRECTINPUT_VERSION, | ||
+ | #else | ||
+ | typedef HRESULT WINAPI DirectInput8CreateProc(HINSTANCE, | ||
+ | DirectInput8CreateProc *pprocDirectInput8Create = (DirectInput8CreateProc*) | ||
+ | GetProcAddress(m_hlibDInput, | ||
+ | if (pprocDirectInput8Create == NULL) | ||
+ | { | ||
+ | return false; | ||
+ | } | ||
+ | HRESULT hResult = pprocDirectInput8Create((HINSTANCE)GetModuleHandleW(NULL), | ||
+ | #endif | ||
+ | if (hResult != DI_OK) { | ||
+ | return false; | ||
+ | } | ||
+ | </ | ||
+ | ('' | ||
以上を修正するとバイナリを得ることができる。 | 以上を修正するとバイナリを得ることができる。 | ||
行 38: | 行 69: | ||
なので、キー入力処理に手を入れて、カーソルキーの処理を変更する。 | なので、キー入力処理に手を入れて、カーソルキーの処理を変更する。 | ||
なお、ゲームによって、2, | なお、ゲームによって、2, | ||
+ | |||
+ | {{:: | ||
=== リソース(メニュー)の作成 === | === リソース(メニュー)の作成 === | ||
+ | |||
+ | リソースエディターで、メニューを追加する。 | ||
+ | '' | ||
+ | {{:: | ||
+ | |||
+ | それぞれのIDシンボルは以下のようにする。 | ||
+ | |||
+ | * IDM_CURSORKEYS_CURSOR | ||
+ | * IDM_CURSORKEYS_2468 | ||
+ | * IDM_CURSORKEYS_1235 | ||
+ | |||
=== 処理タイプフラグの追加 === | === 処理タイプフラグの追加 === | ||
行 103: | 行 147: | ||
'' | '' | ||
< | < | ||
- | } else { | + | } else { |
- | bShift = IsKeyPressed(VK_SHIFT); | + | bShift = IsKeyPressed(VK_SHIFT); |
- | } | + | } |
#if 0 | #if 0 | ||
- | bool bUpArrow = IsKeyPressed(VK_UP), | + | bool bUpArrow = IsKeyPressed(VK_UP), |
- | bRightArrow = IsKeyPressed(VK_RIGHT); | + | bRightArrow = IsKeyPressed(VK_RIGHT); |
+ | if (X88k().PC88().Z80Main().GetBasicMode() == | ||
+ | CPC88Z80Main:: | ||
+ | { | ||
+ | if (IsKeyPressed(VK_DOWN)) { | ||
+ | bShift = bUpArrow = true; | ||
+ | } | ||
+ | if (IsKeyPressed(VK_LEFT)) { | ||
+ | bShift = bRightArrow = true; | ||
+ | } | ||
+ | } | ||
+ | #else | ||
+ | bool bUpArrow = false, bRightArrow = false; | ||
+ | if (m_cursorMode == 0||IsKeyPressed(VK_CONTROL)) | ||
+ | { | ||
+ | bUpArrow = IsKeyPressed(VK_UP); | ||
+ | bRightArrow = IsKeyPressed(VK_RIGHT); | ||
if (X88k().PC88().Z80Main().GetBasicMode() == | if (X88k().PC88().Z80Main().GetBasicMode() == | ||
- | CPC88Z80Main:: | + | CPC88Z80Main:: |
{ | { | ||
if (IsKeyPressed(VK_DOWN)) { | if (IsKeyPressed(VK_DOWN)) { | ||
行 119: | 行 179: | ||
} | } | ||
} | } | ||
- | #else | + | } |
- | bool bUpArrow = false, bRightArrow = false; | + | else |
- | if (m_cursorMode == 0||IsKeyPressed(VK_CONTROL)) | + | { |
+ | if (IsKeyPressed(VK_DOWN) || IsKeyPressed(VK_LEFT) || IsKeyPressed(VK_RIGHT) | ||
{ | { | ||
- | bUpArrow = IsKeyPressed(VK_UP); | + | if (m_cursorMode |
- | bRightArrow = IsKeyPressed(VK_RIGHT); | + | |
- | if (X88k().PC88().Z80Main().GetBasicMode() | + | |
- | CPC88Z80Main:: | + | |
{ | { | ||
- | if (IsKeyPressed(VK_DOWN)) | + | X88k().SetKeyMatrics(0x00, |
- | bShift = bUpArrow = true; | + | X88k().SetKeyMatrics(0x00, |
- | } | + | X88k().SetKeyMatrics(0x00, |
- | if | + | X88k().SetKeyMatrics(0x01, |
- | bShift = bRightArrow = true; | + | |
- | } | + | |
} | } | ||
+ | else | ||
+ | { | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | } | ||
+ | return; | ||
} | } | ||
- | else | + | } |
+ | #endif | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | ... | ||
+ | } | ||
+ | | ||
+ | { | ||
+ | bShift = IsKeyPressed(DIK_LSHIFT, | ||
+ | } | ||
+ | #if 0 | ||
+ | bool bUpArrow = IsKeyPressed(DIK_UP), | ||
+ | bRightArrow = IsKeyPressed(DIK_RIGHT); | ||
+ | if (X88k().PC88().Z80Main().GetBasicMode() == | ||
+ | CPC88Z80Main:: | ||
+ | { | ||
+ | if (IsKeyPressed(DIK_DOWN)) { | ||
+ | bShift = bUpArrow = true; | ||
+ | } | ||
+ | if (IsKeyPressed(DIK_LEFT)) { | ||
+ | bShift = bRightArrow = true; | ||
+ | } | ||
+ | } | ||
+ | #else | ||
+ | bool bUpArrow = false, bRightArrow = false; | ||
+ | if (m_cursorMode == 0||IsKeyPressed(DIK_LCONTROL, | ||
+ | { | ||
+ | bUpArrow = IsKeyPressed(DIK_UP); | ||
+ | bRightArrow = IsKeyPressed(DIK_RIGHT); | ||
+ | if (X88k().PC88().Z80Main().GetBasicMode() == | ||
+ | CPC88Z80Main:: | ||
{ | { | ||
- | if (IsKeyPressed(VK_DOWN) || IsKeyPressed(VK_LEFT) || IsKeyPressed(VK_RIGHT) || IsKeyPressed(VK_UP)) | + | if (IsKeyPressed(DIK_DOWN)) { |
+ | bShift = bUpArrow = true; | ||
+ | } | ||
+ | if (IsKeyPressed(DIK_LEFT)) { | ||
+ | bShift = bRightArrow = true; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | if (IsKeyPressed(DIK_DOWN) || IsKeyPressed(DIK_LEFT) || IsKeyPressed(DIK_RIGHT) || IsKeyPressed(DIK_UP)) | ||
+ | { | ||
+ | if (m_cursorMode == 1) | ||
+ | { | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x00, | ||
+ | X88k().SetKeyMatrics(0x01, | ||
+ | } | ||
+ | else | ||
{ | { | ||
- | if (m_cursorMode == 1) | + | X88k().SetKeyMatrics(0x00, |
- | { | + | X88k().SetKeyMatrics(0x00, |
- | X88k().SetKeyMatrics(0x00, | + | X88k().SetKeyMatrics(0x00, |
- | X88k().SetKeyMatrics(0x00, | + | X88k().SetKeyMatrics(0x00, |
- | X88k().SetKeyMatrics(0x00, | + | |
- | X88k().SetKeyMatrics(0x01, | + | |
- | } | + | |
- | else | + | |
- | { | + | |
- | X88k().SetKeyMatrics(0x00, | + | |
- | X88k().SetKeyMatrics(0x00, | + | |
- | X88k().SetKeyMatrics(0x00, | + | |
- | X88k().SetKeyMatrics(0x00, | + | |
- | } | + | |
- | return; | + | |
} | } | ||
+ | return; | ||
} | } | ||
+ | } | ||
#endif | #endif | ||
- | X88k().SetKeyMatrics(0x00, 0, IsKeyPressed(VK_NUMPAD0)); | + | |
- | X88k().SetKeyMatrics(0x00, | + | |
</ | </ | ||
x88000.1610521298.txt.gz · 最終更新: 2021/01/13 07:01 by araki