Update to v106r30 release.

byuu says:

Changelog:

  - nall/GNUmakefile: fixed findstring parameter arguments [Screwtape]
  - nall/Windows: always include -mthreads -lpthread for all
    applications
  - nall/memory: code restructuring

I really wanted to work on the new PPU today, but I thought I'd spend a
few minutes making some minor improvements to nall::memory, that was
five and a half hours ago. Now I have a 67KiB diff of changes. Sigh.
This commit is contained in:
Tim Allen
2018-05-28 11:16:27 +10:00
parent 6882bd98cf
commit 685cec6583
73 changed files with 372 additions and 389 deletions

View File

@@ -91,7 +91,7 @@ struct AudioALSA : Audio {
_offset--;
output++;
}
memory::move(_buffer, output, _offset * sizeof(uint32_t));
memory::move<uint32_t>(_buffer, output, _offset);
}
}

View File

@@ -71,10 +71,10 @@ struct AudioASIO : Audio {
auto clear() -> void {
if(!ready()) return;
for(uint n : range(_channels)) {
memory::fill(_channel[n].buffers[0], _latency * _sampleSize);
memory::fill(_channel[n].buffers[1], _latency * _sampleSize);
memory::fill<uint8_t>(_channel[n].buffers[0], _latency * _sampleSize);
memory::fill<uint8_t>(_channel[n].buffers[1], _latency * _sampleSize);
}
memory::fill(_queue.samples, sizeof(_queue.samples));
memory::fill<uint8_t>(_queue.samples, sizeof(_queue.samples));
_queue.read = 0;
_queue.write = 0;
_queue.count = 0;

View File

@@ -51,7 +51,7 @@ struct AudioDirectSound : Audio {
_ringWrite = _rings - 1;
_ringDistance = _rings - 1;
if(_buffer) memory::fill(_buffer, _period * _rings * 4);
if(_buffer) memory::fill<uint32_t>(_buffer, _period * _rings);
_offset = 0;
if(!_secondary) return;
@@ -61,7 +61,7 @@ struct AudioDirectSound : Audio {
void* output;
DWORD size;
_secondary->Lock(0, _period * _rings * 4, &output, &size, 0, 0, 0);
memory::fill(output, size);
memory::fill<uint8_t>(output, size);
_secondary->Unlock(output, size, 0, 0);
_secondary->Play(0, 0, DSBPLAY_LOOPING);
@@ -102,7 +102,7 @@ struct AudioDirectSound : Audio {
void* output;
DWORD size;
if(_secondary->Lock(_ringWrite * _period * 4, _period * 4, &output, &size, 0, 0, 0) == DS_OK) {
memory::copy(output, _buffer, _period * 4);
memory::copy<uint32_t>(output, _buffer, _period);
_secondary->Unlock(output, size, 0, 0);
}
}

View File

@@ -53,7 +53,7 @@ struct AudioXAudio2 : Audio, public IXAudio2VoiceCallback {
_bufferIndex = 0;
_bufferOffset = 0;
if(_buffer) memory::fill(_buffer, _period * _bufferCount * sizeof(uint32_t));
if(_buffer) memory::fill<uint32_t>(_buffer, _period * _bufferCount);
_sourceVoice->Start(0);
}

View File

@@ -215,7 +215,7 @@ private:
LPDIRECT3DVERTEXBUFFER9* vertexPointer = nullptr;
_vertexBuffer->Lock(0, sizeof(Vertex) * 4, (void**)&vertexPointer, 0);
memory::copy(vertexPointer, vertex, sizeof(Vertex) * 4);
memory::copy<Vertex>(vertexPointer, vertex, 4);
_vertexBuffer->Unlock();
_device->SetStreamSource(0, _vertexBuffer, 0, sizeof(Vertex));

View File

@@ -52,7 +52,7 @@ struct VideoGLX2 : Video {
auto clear() -> void {
if(!ready()) return;
memory::fill(_glBuffer, _glWidth * _glHeight * sizeof(uint32_t));
memory::fill<uint32_t>(_glBuffer, _glWidth * _glHeight);
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();

View File

@@ -38,7 +38,7 @@ struct VideoXVideo : Video {
auto clear() -> void {
if(!ready()) return;
memory::fill(_buffer, _bufferWidth * _bufferHeight * sizeof(uint32_t));
memory::fill<uint32_t>(_buffer, _bufferWidth * _bufferHeight);
//clear twice in case video is double buffered ...
output();
output();
@@ -335,7 +335,7 @@ private:
uint32_t* output = (uint32_t*)_image->data;
for(uint y : range(height)) {
memory::copy(output, input, width * 4);
memory::copy<uint32_t>(output, input, width);
input += _bufferWidth;
output += _bufferWidth;
}