mirror of https://github.com/mgba-emu/mgba.git
GBA e-Reader: Fix bitmap short strip scanning
This commit is contained in:
parent
2e0c245e2d
commit
39751aac97
1
CHANGES
1
CHANGES
|
@ -6,6 +6,7 @@ Emulation fixes:
|
|||
Other fixes:
|
||||
- GBA: Fix non-USA 1.0 FireRed misdetecting as a ROM hack (fixes mgba.io/i/2100)
|
||||
- GBA: Fix crash when ROM loading fails
|
||||
- GBA e-Reader: Fix bitmap short strip scanning
|
||||
- GBA Video: Fix mode 5 frame 1 caching (fixes mgba.io/i/2075)
|
||||
Misc:
|
||||
- GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks
|
||||
|
|
|
@ -370,6 +370,11 @@ void GBAHardwareEReaderScan(struct GBACartridgeHardware* hw, const void* data, s
|
|||
// Bitmap sizes
|
||||
case 5456:
|
||||
bitmap = true;
|
||||
blocks = 124;
|
||||
break;
|
||||
case 3520:
|
||||
bitmap = true;
|
||||
blocks = 80;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
@ -380,9 +385,9 @@ void GBAHardwareEReaderScan(struct GBACartridgeHardware* hw, const void* data, s
|
|||
if (bitmap) {
|
||||
size_t x;
|
||||
for (i = 0; i < 40; ++i) {
|
||||
const uint8_t* line = &cdata[(i + 2) * 124];
|
||||
const uint8_t* line = &cdata[(i + 2) * blocks];
|
||||
uint8_t* origin = &hw->eReaderDots[EREADER_DOTCODE_STRIDE * i + 200];
|
||||
for (x = 0; x < 124; ++x) {
|
||||
for (x = 0; x < blocks; ++x) {
|
||||
uint8_t byte = line[x];
|
||||
if (x == 123) {
|
||||
byte &= 0xE0;
|
||||
|
|
|
@ -799,7 +799,7 @@ void CoreController::scanCard(const QString& path) {
|
|||
QFile file(path);
|
||||
file.open(QIODevice::ReadOnly);
|
||||
m_eReaderData = file.read(2912);
|
||||
} else if (image.size() == QSize(989, 44)) {
|
||||
} else if (image.size() == QSize(989, 44) || image.size() == QSize(639, 44)) {
|
||||
const uchar* bits = image.constBits();
|
||||
size_t size;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
|
|
Loading…
Reference in New Issue