ホーム › Devices.Display › VIDEO_BANK_SELECT
VIDEO_BANK_SELECT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Length | DWORD | 4 | +0 | +0 | この構造体のバイト長。 |
| Size | DWORD | 4 | +4 | +4 | バンクセレクトコードのサイズ。 |
| BankingFlags | DWORD | 4 | +8 | +8 | バンク切替の動作フラグ。 |
| BankingType | DWORD | 4 | +12 | +12 | バンク切替の種別。 |
| PlanarHCBankingType | DWORD | 4 | +16 | +16 | プレーナ高色モード時のバンク切替種別。 |
| BitmapWidthInBytes | DWORD | 4 | +20 | +20 | ビットマップ1行のバイト幅。 |
| BitmapSize | DWORD | 4 | +24 | +24 | ビットマップ全体のサイズ。 |
| Granularity | DWORD | 4 | +28 | +28 | バンクの粒度(バイト)。 |
| PlanarHCGranularity | DWORD | 4 | +32 | +32 | プレーナ高色モードのバンク粒度。 |
| CodeOffset | DWORD | 4 | +36 | +36 | バンク切替コードへのオフセット。 |
| PlanarHCBankCodeOffset | DWORD | 4 | +40 | +40 | プレーナ高色バンクコードへのオフセット。 |
| PlanarHCEnableCodeOffset | DWORD | 4 | +44 | +44 | プレーナ高色有効化コードへのオフセット。 |
| PlanarHCDisableCodeOffset | DWORD | 4 | +48 | +48 | プレーナ高色無効化コードへのオフセット。 |
各言語での定義
#include <windows.h>
// VIDEO_BANK_SELECT (x64 52 / x86 52 バイト)
typedef struct VIDEO_BANK_SELECT {
DWORD Length;
DWORD Size;
DWORD BankingFlags;
DWORD BankingType;
DWORD PlanarHCBankingType;
DWORD BitmapWidthInBytes;
DWORD BitmapSize;
DWORD Granularity;
DWORD PlanarHCGranularity;
DWORD CodeOffset;
DWORD PlanarHCBankCodeOffset;
DWORD PlanarHCEnableCodeOffset;
DWORD PlanarHCDisableCodeOffset;
} VIDEO_BANK_SELECT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_BANK_SELECT
{
public uint Length;
public uint Size;
public uint BankingFlags;
public uint BankingType;
public uint PlanarHCBankingType;
public uint BitmapWidthInBytes;
public uint BitmapSize;
public uint Granularity;
public uint PlanarHCGranularity;
public uint CodeOffset;
public uint PlanarHCBankCodeOffset;
public uint PlanarHCEnableCodeOffset;
public uint PlanarHCDisableCodeOffset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_BANK_SELECT
Public Length As UInteger
Public Size As UInteger
Public BankingFlags As UInteger
Public BankingType As UInteger
Public PlanarHCBankingType As UInteger
Public BitmapWidthInBytes As UInteger
Public BitmapSize As UInteger
Public Granularity As UInteger
Public PlanarHCGranularity As UInteger
Public CodeOffset As UInteger
Public PlanarHCBankCodeOffset As UInteger
Public PlanarHCEnableCodeOffset As UInteger
Public PlanarHCDisableCodeOffset As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VIDEO_BANK_SELECT(ctypes.Structure):
_fields_ = [
("Length", wintypes.DWORD),
("Size", wintypes.DWORD),
("BankingFlags", wintypes.DWORD),
("BankingType", wintypes.DWORD),
("PlanarHCBankingType", wintypes.DWORD),
("BitmapWidthInBytes", wintypes.DWORD),
("BitmapSize", wintypes.DWORD),
("Granularity", wintypes.DWORD),
("PlanarHCGranularity", wintypes.DWORD),
("CodeOffset", wintypes.DWORD),
("PlanarHCBankCodeOffset", wintypes.DWORD),
("PlanarHCEnableCodeOffset", wintypes.DWORD),
("PlanarHCDisableCodeOffset", wintypes.DWORD),
]#[repr(C)]
pub struct VIDEO_BANK_SELECT {
pub Length: u32,
pub Size: u32,
pub BankingFlags: u32,
pub BankingType: u32,
pub PlanarHCBankingType: u32,
pub BitmapWidthInBytes: u32,
pub BitmapSize: u32,
pub Granularity: u32,
pub PlanarHCGranularity: u32,
pub CodeOffset: u32,
pub PlanarHCBankCodeOffset: u32,
pub PlanarHCEnableCodeOffset: u32,
pub PlanarHCDisableCodeOffset: u32,
}import "golang.org/x/sys/windows"
type VIDEO_BANK_SELECT struct {
Length uint32
Size uint32
BankingFlags uint32
BankingType uint32
PlanarHCBankingType uint32
BitmapWidthInBytes uint32
BitmapSize uint32
Granularity uint32
PlanarHCGranularity uint32
CodeOffset uint32
PlanarHCBankCodeOffset uint32
PlanarHCEnableCodeOffset uint32
PlanarHCDisableCodeOffset uint32
}type
VIDEO_BANK_SELECT = record
Length: DWORD;
Size: DWORD;
BankingFlags: DWORD;
BankingType: DWORD;
PlanarHCBankingType: DWORD;
BitmapWidthInBytes: DWORD;
BitmapSize: DWORD;
Granularity: DWORD;
PlanarHCGranularity: DWORD;
CodeOffset: DWORD;
PlanarHCBankCodeOffset: DWORD;
PlanarHCEnableCodeOffset: DWORD;
PlanarHCDisableCodeOffset: DWORD;
end;const VIDEO_BANK_SELECT = extern struct {
Length: u32,
Size: u32,
BankingFlags: u32,
BankingType: u32,
PlanarHCBankingType: u32,
BitmapWidthInBytes: u32,
BitmapSize: u32,
Granularity: u32,
PlanarHCGranularity: u32,
CodeOffset: u32,
PlanarHCBankCodeOffset: u32,
PlanarHCEnableCodeOffset: u32,
PlanarHCDisableCodeOffset: u32,
};type
VIDEO_BANK_SELECT {.bycopy.} = object
Length: uint32
Size: uint32
BankingFlags: uint32
BankingType: uint32
PlanarHCBankingType: uint32
BitmapWidthInBytes: uint32
BitmapSize: uint32
Granularity: uint32
PlanarHCGranularity: uint32
CodeOffset: uint32
PlanarHCBankCodeOffset: uint32
PlanarHCEnableCodeOffset: uint32
PlanarHCDisableCodeOffset: uint32struct VIDEO_BANK_SELECT
{
uint Length;
uint Size;
uint BankingFlags;
uint BankingType;
uint PlanarHCBankingType;
uint BitmapWidthInBytes;
uint BitmapSize;
uint Granularity;
uint PlanarHCGranularity;
uint CodeOffset;
uint PlanarHCBankCodeOffset;
uint PlanarHCEnableCodeOffset;
uint PlanarHCDisableCodeOffset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_BANK_SELECT サイズ: 52 バイト(x64)
dim st, 13 ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; Length : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; BankingFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; BankingType : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; PlanarHCBankingType : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BitmapWidthInBytes : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BitmapSize : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Granularity : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; PlanarHCGranularity : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; CodeOffset : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; PlanarHCBankCodeOffset : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; PlanarHCEnableCodeOffset : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; PlanarHCDisableCodeOffset : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_BANK_SELECT
#field int Length
#field int Size
#field int BankingFlags
#field int BankingType
#field int PlanarHCBankingType
#field int BitmapWidthInBytes
#field int BitmapSize
#field int Granularity
#field int PlanarHCGranularity
#field int CodeOffset
#field int PlanarHCBankCodeOffset
#field int PlanarHCEnableCodeOffset
#field int PlanarHCDisableCodeOffset
#endstruct
stdim st, VIDEO_BANK_SELECT ; NSTRUCT 変数を確保
st->Length = 100
mes "Length=" + st->Length