@ -282,19 +282,19 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(Thread& thread) {
return RESULT_SUCCESS ;
return RESULT_SUCCESS ;
}
}
std : : vector < u8 > HLERequestContext : : ReadBuffer ( in t buffer_index ) const {
std : : vector < u8 > HLERequestContext : : ReadBuffer ( std : : size_ t buffer_index ) const {
std : : vector < u8 > buffer ;
std : : vector < u8 > buffer ;
const bool is_buffer_a { BufferDescriptorA ( ) . size ( ) > std: : size_t ( buffer_index) & &
const bool is_buffer_a { BufferDescriptorA ( ) . size ( ) > buffer_index & &
BufferDescriptorA ( ) [ buffer_index ] . Size ( ) } ;
BufferDescriptorA ( ) [ buffer_index ] . Size ( ) } ;
auto & memory = Core : : System : : GetInstance ( ) . Memory ( ) ;
auto & memory = Core : : System : : GetInstance ( ) . Memory ( ) ;
if ( is_buffer_a ) {
if ( is_buffer_a ) {
ASSERT_MSG ( BufferDescriptorA ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorA ( ) . size ( ) > buffer_index,
" BufferDescriptorA invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorA invalid buffer_index {} " , buffer_index ) ;
buffer . resize ( BufferDescriptorA ( ) [ buffer_index ] . Size ( ) ) ;
buffer . resize ( BufferDescriptorA ( ) [ buffer_index ] . Size ( ) ) ;
memory . ReadBlock ( BufferDescriptorA ( ) [ buffer_index ] . Address ( ) , buffer . data ( ) , buffer . size ( ) ) ;
memory . ReadBlock ( BufferDescriptorA ( ) [ buffer_index ] . Address ( ) , buffer . data ( ) , buffer . size ( ) ) ;
} else {
} else {
ASSERT_MSG ( BufferDescriptorX ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorX ( ) . size ( ) > buffer_index,
" BufferDescriptorX invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorX invalid buffer_index {} " , buffer_index ) ;
buffer . resize ( BufferDescriptorX ( ) [ buffer_index ] . Size ( ) ) ;
buffer . resize ( BufferDescriptorX ( ) [ buffer_index ] . Size ( ) ) ;
memory . ReadBlock ( BufferDescriptorX ( ) [ buffer_index ] . Address ( ) , buffer . data ( ) , buffer . size ( ) ) ;
memory . ReadBlock ( BufferDescriptorX ( ) [ buffer_index ] . Address ( ) , buffer . data ( ) , buffer . size ( ) ) ;
@ -304,13 +304,13 @@ std::vector<u8> HLERequestContext::ReadBuffer(int buffer_index) const {
}
}
std : : size_t HLERequestContext : : WriteBuffer ( const void * buffer , std : : size_t size ,
std : : size_t HLERequestContext : : WriteBuffer ( const void * buffer , std : : size_t size ,
in t buffer_index ) const {
std : : size_ t buffer_index ) const {
if ( size = = 0 ) {
if ( size = = 0 ) {
LOG_WARNING ( Core , " skip empty buffer write " ) ;
LOG_WARNING ( Core , " skip empty buffer write " ) ;
return 0 ;
return 0 ;
}
}
const bool is_buffer_b { BufferDescriptorB ( ) . size ( ) > std: : size_t ( buffer_index) & &
const bool is_buffer_b { BufferDescriptorB ( ) . size ( ) > buffer_index & &
BufferDescriptorB ( ) [ buffer_index ] . Size ( ) } ;
BufferDescriptorB ( ) [ buffer_index ] . Size ( ) } ;
const std : : size_t buffer_size { GetWriteBufferSize ( buffer_index ) } ;
const std : : size_t buffer_size { GetWriteBufferSize ( buffer_index ) } ;
if ( size > buffer_size ) {
if ( size > buffer_size ) {
@ -321,13 +321,13 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
auto & memory = Core : : System : : GetInstance ( ) . Memory ( ) ;
auto & memory = Core : : System : : GetInstance ( ) . Memory ( ) ;
if ( is_buffer_b ) {
if ( is_buffer_b ) {
ASSERT_MSG ( BufferDescriptorB ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorB ( ) . size ( ) > buffer_index,
" BufferDescriptorB invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorB invalid buffer_index {} " , buffer_index ) ;
ASSERT_MSG ( BufferDescriptorB ( ) [ buffer_index ] . Size ( ) > = size ,
ASSERT_MSG ( BufferDescriptorB ( ) [ buffer_index ] . Size ( ) > = size ,
" BufferDescriptorB buffer_index {} is not large enough " , buffer_index ) ;
" BufferDescriptorB buffer_index {} is not large enough " , buffer_index ) ;
memory . WriteBlock ( BufferDescriptorB ( ) [ buffer_index ] . Address ( ) , buffer , size ) ;
memory . WriteBlock ( BufferDescriptorB ( ) [ buffer_index ] . Address ( ) , buffer , size ) ;
} else {
} else {
ASSERT_MSG ( BufferDescriptorC ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorC ( ) . size ( ) > buffer_index,
" BufferDescriptorC invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorC invalid buffer_index {} " , buffer_index ) ;
ASSERT_MSG ( BufferDescriptorC ( ) [ buffer_index ] . Size ( ) > = size ,
ASSERT_MSG ( BufferDescriptorC ( ) [ buffer_index ] . Size ( ) > = size ,
" BufferDescriptorC buffer_index {} is not large enough " , buffer_index ) ;
" BufferDescriptorC buffer_index {} is not large enough " , buffer_index ) ;
@ -337,17 +337,17 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
return size ;
return size ;
}
}
std : : size_t HLERequestContext : : GetReadBufferSize ( in t buffer_index ) const {
std : : size_t HLERequestContext : : GetReadBufferSize ( std : : size_ t buffer_index ) const {
const bool is_buffer_a { BufferDescriptorA ( ) . size ( ) > std: : size_t ( buffer_index) & &
const bool is_buffer_a { BufferDescriptorA ( ) . size ( ) > buffer_index & &
BufferDescriptorA ( ) [ buffer_index ] . Size ( ) } ;
BufferDescriptorA ( ) [ buffer_index ] . Size ( ) } ;
if ( is_buffer_a ) {
if ( is_buffer_a ) {
ASSERT_MSG ( BufferDescriptorA ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorA ( ) . size ( ) > buffer_index,
" BufferDescriptorA invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorA invalid buffer_index {} " , buffer_index ) ;
ASSERT_MSG ( BufferDescriptorA ( ) [ buffer_index ] . Size ( ) > 0 ,
ASSERT_MSG ( BufferDescriptorA ( ) [ buffer_index ] . Size ( ) > 0 ,
" BufferDescriptorA buffer_index {} is empty " , buffer_index ) ;
" BufferDescriptorA buffer_index {} is empty " , buffer_index ) ;
return BufferDescriptorA ( ) [ buffer_index ] . Size ( ) ;
return BufferDescriptorA ( ) [ buffer_index ] . Size ( ) ;
} else {
} else {
ASSERT_MSG ( BufferDescriptorX ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorX ( ) . size ( ) > buffer_index,
" BufferDescriptorX invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorX invalid buffer_index {} " , buffer_index ) ;
ASSERT_MSG ( BufferDescriptorX ( ) [ buffer_index ] . Size ( ) > 0 ,
ASSERT_MSG ( BufferDescriptorX ( ) [ buffer_index ] . Size ( ) > 0 ,
" BufferDescriptorX buffer_index {} is empty " , buffer_index ) ;
" BufferDescriptorX buffer_index {} is empty " , buffer_index ) ;
@ -355,15 +355,15 @@ std::size_t HLERequestContext::GetReadBufferSize(int buffer_index) const {
}
}
}
}
std : : size_t HLERequestContext : : GetWriteBufferSize ( in t buffer_index ) const {
std : : size_t HLERequestContext : : GetWriteBufferSize ( std : : size_ t buffer_index ) const {
const bool is_buffer_b { BufferDescriptorB ( ) . size ( ) > std: : size_t ( buffer_index) & &
const bool is_buffer_b { BufferDescriptorB ( ) . size ( ) > buffer_index & &
BufferDescriptorB ( ) [ buffer_index ] . Size ( ) } ;
BufferDescriptorB ( ) [ buffer_index ] . Size ( ) } ;
if ( is_buffer_b ) {
if ( is_buffer_b ) {
ASSERT_MSG ( BufferDescriptorB ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorB ( ) . size ( ) > buffer_index,
" BufferDescriptorB invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorB invalid buffer_index {} " , buffer_index ) ;
return BufferDescriptorB ( ) [ buffer_index ] . Size ( ) ;
return BufferDescriptorB ( ) [ buffer_index ] . Size ( ) ;
} else {
} else {
ASSERT_MSG ( BufferDescriptorC ( ) . size ( ) > std: : size_t ( buffer_index) ,
ASSERT_MSG ( BufferDescriptorC ( ) . size ( ) > buffer_index,
" BufferDescriptorC invalid buffer_index {} " , buffer_index ) ;
" BufferDescriptorC invalid buffer_index {} " , buffer_index ) ;
return BufferDescriptorC ( ) [ buffer_index ] . Size ( ) ;
return BufferDescriptorC ( ) [ buffer_index ] . Size ( ) ;
}
}