1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-30 15:54:27 +01:00

amex/sram.c: Handle ABI version ioctl

This commit is contained in:
Felix 2021-09-01 22:52:40 +00:00
parent c22013fe9f
commit 22d6c3b8f9

View File

@ -20,12 +20,17 @@
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/str.h" #include "util/str.h"
enum {
SRAM_IOCTL_GET_ABI_VERSION = 0x80006000,
};
static HRESULT sram_handle_irp(struct irp *irp); static HRESULT sram_handle_irp(struct irp *irp);
static HRESULT sram_handle_open(struct irp *irp); static HRESULT sram_handle_open(struct irp *irp);
static HRESULT sram_handle_close(struct irp *irp); static HRESULT sram_handle_close(struct irp *irp);
static HRESULT sram_handle_ioctl(struct irp *irp); static HRESULT sram_handle_ioctl(struct irp *irp);
static HRESULT sram_ioctl_get_geometry(struct irp *irp); static HRESULT sram_ioctl_get_geometry(struct irp *irp);
static HRESULT sram_ioctl_get_abi_version(struct irp *irp);
static struct sram_config sram_config; static struct sram_config sram_config;
static HANDLE sram_file; static HANDLE sram_file;
@ -113,6 +118,9 @@ static HRESULT sram_handle_ioctl(struct irp *irp)
case IOCTL_DISK_GET_DRIVE_GEOMETRY: case IOCTL_DISK_GET_DRIVE_GEOMETRY:
return sram_ioctl_get_geometry(irp); return sram_ioctl_get_geometry(irp);
case SRAM_IOCTL_GET_ABI_VERSION:
return sram_ioctl_get_abi_version(irp);
default: default:
dprintf("SRAM: Unknown ioctl %x, write %i read %i\n", dprintf("SRAM: Unknown ioctl %x, write %i read %i\n",
irp->ioctl, irp->ioctl,
@ -145,3 +153,8 @@ static HRESULT sram_ioctl_get_geometry(struct irp *irp)
return hr; return hr;
} }
static HRESULT sram_ioctl_get_abi_version(struct irp *irp)
{
return iobuf_write_le16(&irp->read, 256);
}