- [FIX] OR() was ANDing instead of ORing

- [FIX] BIT() was doing the opposite of what it should.
- [FIX] IX_BIT_INSTRUCTIONS() where never called
- [NEW] Afegit color al zxscreen
This commit is contained in:
2024-04-13 17:02:23 +02:00
parent 0d78733d06
commit 83af6e7f50
2 changed files with 6 additions and 4 deletions

View File

@@ -395,7 +395,7 @@ namespace z80
void OR(uint8_t b)
{
rA = rA & b;
rA = rA | b;
rF=0;
FLAGS_SZXY(rA);
SET_PARITY_FLAG();
@@ -709,7 +709,7 @@ namespace z80
const uint8_t res = v & 1<<pos;
KEEP_FLAGS(fC);
SET_FLAGS(fH);
if (~(v>>pos) & 1) SET_FLAGS(fZ | fP);
if (!res) SET_FLAGS(fZ | fP);
if (res&0x80) SET_FLAGS(fS);
if (res&0x20) SET_FLAGS(fY);
if (res&0x08) SET_FLAGS(fX);
@@ -2290,7 +2290,7 @@ namespace z80
case 0xBE: d=READ_MEM_8(); CP(READ_MEM_8(rIY+d));t+=5; break;
case 0xBF: CP(rA); break;
case 0xCB: IX_BIT_INSTRUCTIONS(); break;
case 0xCB: IY_BIT_INSTRUCTIONS(); break;
case 0xE1: POP(_rIY); break;
case 0xE3: EX_MEM(_rIY, rSP); break;
case 0xE5: PUSH(rIY); break;

View File

@@ -42,11 +42,13 @@ namespace zxscreen
// Actual screen
for (uint8_t x=0;x<32;++x)
{
uint8_t color = memory[0x5800 + x + (y>>3)*32];
uint16_t address = 0x4000 | (x&0x1f) | ((y&0x7)<<8) | ((y&0x38)<<2) | ((y&0xc0)<<5);
uint8_t block = memory[address];
for (int i=0;i<8;++i)
{
*(pixels++)=(block&0x80) ? palette[7] : palette[0];
*(pixels++)=(block&0x80) ? palette[color&0x7] : palette[(color>>3)&0x7];
block = block<<1;
}
}