mirror of
https://github.com/libretro/bsnes-libretro.git
synced 2024-11-23 08:59:40 +00:00
f9adb4d2c6
byuu says: The main thing I worked on today was emulating the MBC7 EEPROM. And... I have many things to say about that, but not here, and not now... The missing EEPROM support is why the accelerometer was broken. Although it's not evidently clear that I'm emulating the actual values incorrectly. I'll think about it and get it fixed, though. bsnes went from ~308fps to ~328fps, and I don't even know why. Probably something somewhere in the 140KB of changes to other things made in this WIP.
34 lines
729 B
C++
34 lines
729 B
C++
#pragma once
|
|
|
|
namespace nall { namespace Matrix {
|
|
|
|
template<typename T> inline auto Multiply(
|
|
T* output,
|
|
const T* xdata, uint xrows, uint xcols,
|
|
const T* ydata, uint yrows, uint ycols
|
|
) -> void {
|
|
if(xcols != yrows) return;
|
|
|
|
for(uint y : range(xrows)) {
|
|
for(uint x : range(ycols)) {
|
|
T sum = 0;
|
|
for(uint z : range(xcols)) {
|
|
sum += xdata[y * xcols + z] * ydata[z * ycols + x];
|
|
}
|
|
*output++ = sum;
|
|
}
|
|
}
|
|
}
|
|
|
|
template<typename T> inline auto Multiply(
|
|
const T* xdata, uint xrows, uint xcols,
|
|
const T* ydata, uint yrows, uint ycols
|
|
) -> vector<T> {
|
|
vector<T> output;
|
|
output.resize(xrows * ycols);
|
|
Multiply(output.data(), xdata, xrows, xcols, ydata, yrows, ycols);
|
|
return output;
|
|
}
|
|
|
|
}}
|