2014-04-15 21:03:41 -07:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-07-22 03:41:16 -07:00
|
|
|
#include "common/bit_field.h"
|
2014-04-15 21:03:41 -07:00
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
2014-04-16 17:46:05 -07:00
|
|
|
// Namespace GSP_GPU
|
2014-04-15 21:03:41 -07:00
|
|
|
|
|
|
|
namespace GSP_GPU {
|
|
|
|
|
2014-05-17 13:26:45 -07:00
|
|
|
enum class GXCommandId : u32 {
|
2014-07-22 03:41:16 -07:00
|
|
|
REQUEST_DMA = 0x00,
|
|
|
|
SET_COMMAND_LIST_LAST = 0x01,
|
2014-07-22 04:04:16 -07:00
|
|
|
|
|
|
|
// Fills a given memory range with a particular value
|
2014-07-22 03:41:16 -07:00
|
|
|
SET_MEMORY_FILL = 0x02,
|
2014-07-22 04:04:16 -07:00
|
|
|
|
|
|
|
// Copies an image and optionally performs color-conversion or scaling.
|
|
|
|
// This is highly similar to the GameCube's EFB copy feature
|
2014-07-22 03:41:16 -07:00
|
|
|
SET_DISPLAY_TRANSFER = 0x03,
|
2014-07-22 04:04:16 -07:00
|
|
|
|
|
|
|
// Conceptionally similar to SET_DISPLAY_TRANSFER and presumable uses the same hardware path
|
2014-07-22 03:41:16 -07:00
|
|
|
SET_TEXTURE_COPY = 0x04,
|
2014-07-22 04:04:16 -07:00
|
|
|
|
2014-07-22 03:41:16 -07:00
|
|
|
SET_COMMAND_LIST_FIRST = 0x05,
|
2014-05-17 13:26:45 -07:00
|
|
|
};
|
|
|
|
|
2014-07-22 03:41:16 -07:00
|
|
|
struct GXCommand {
|
|
|
|
BitField<0, 8, GXCommandId> id;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
u32 source_address;
|
|
|
|
u32 dest_address;
|
|
|
|
u32 size;
|
|
|
|
} dma_request;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 address;
|
|
|
|
u32 size;
|
|
|
|
} set_command_list_last;
|
2014-05-17 13:26:45 -07:00
|
|
|
|
2014-07-22 03:41:16 -07:00
|
|
|
struct {
|
|
|
|
u32 start1;
|
|
|
|
u32 value1;
|
|
|
|
u32 end1;
|
|
|
|
u32 start2;
|
|
|
|
u32 value2;
|
|
|
|
u32 end2;
|
|
|
|
} memory_fill;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
u32 in_buffer_address;
|
|
|
|
u32 out_buffer_address;
|
|
|
|
u32 in_buffer_size;
|
|
|
|
u32 out_buffer_size;
|
|
|
|
u32 flags;
|
|
|
|
} image_copy;
|
|
|
|
|
|
|
|
u8 raw_data[0x1C];
|
|
|
|
};
|
2014-05-17 13:26:45 -07:00
|
|
|
};
|
2014-07-22 03:41:16 -07:00
|
|
|
static_assert(sizeof(GXCommand) == 0x20, "GXCommand struct has incorrect size");
|
2014-05-17 13:26:45 -07:00
|
|
|
|
2014-04-16 17:46:05 -07:00
|
|
|
/// Interface to "srv:" service
|
2014-04-15 21:03:41 -07:00
|
|
|
class Interface : public Service::Interface {
|
|
|
|
public:
|
|
|
|
|
|
|
|
Interface();
|
|
|
|
|
|
|
|
~Interface();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the string port name used by CTROS for the service
|
|
|
|
* @return Port name of service
|
|
|
|
*/
|
2014-05-18 18:43:29 -07:00
|
|
|
const char *GetPortName() const {
|
2014-04-15 21:03:41 -07:00
|
|
|
return "gsp::Gpu";
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|