通过DMA读取指定地址的双精度浮点数Addr - DmaReadDoubleAddr
函数简介
通过 DMA 读取指定地址的双精度浮点数。使用直接地址而不是 CE 格式。(高级版功能,普通版无法使用)
接口名称
DmaReadDoubleAddr
DLL调用
double OLA_CALL_TYPE DmaReadDoubleAddr(int64_t instance, int64_t deviceId, int32_t pid, int64_t addr);
参数定义:
instance(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。deviceId(长整型数): 设备IDpid(整型数): 进程 PIDaddr(长整型数): 直接内存地址
示例:
// 读取双精度浮点数
double value = DmaReadDoubleAddr(instance, deviceId, 1234, 0x400000);
printf("双精度浮点数: %f\n", value);
// 读取多个浮点数
double x = DmaReadDoubleAddr(instance, deviceId, 1234, 0x400000);
double y = DmaReadDoubleAddr(instance, deviceId, 1234, 0x400008);
double z = DmaReadDoubleAddr(instance, deviceId, 1234, 0x400010);
printf("坐标: (%f, %f, %f)\n", x, y, z);
返回值
双精度浮点数:
返回读取到的双精度浮点数值
参数说明
addr(地址):
- 直接的十六进制地址
- 例如:
0x400000
应用场景
- 读取游戏中的浮点数据(坐标、血量等)
- 内存分析
- 数据提取
相关接口
- DmaReadDouble - CE 格式地址读取
- DmaReadFloatAddr - 读取单精度浮点数
- DmaReadIntAddr - 读取整数
