Przeglądaj źródła

emul/sms: don't hardcode name table offset

Use reg 2 as specified.
master
Virgil Dupras 3 lat temu
rodzic
commit
1681e61956
2 zmienionych plików z 3 dodań i 2 usunięć
  1. +2
    -1
      emul/hw/sms/vdp.c
  2. +1
    -1
      recipes/sms/blk/605

+ 2
- 1
emul/hw/sms/vdp.c Wyświetl plik

@@ -61,7 +61,8 @@ uint8_t vdp_pixel(VDP *vdp, uint16_t x, uint16_t y)
return 0;
}
// name table offset
uint16_t offset = 0x3800 + ((y/8) << 6) + ((x/8) << 1);
uint16_t offset = (vdp->regs[2] & 0xe) << 10;
offset += ((y/8) << 6) + ((x/8) << 1);
uint16_t tableval = vdp->vram[offset] + (vdp->vram[offset+1] << 8);
uint16_t tilenum = tableval & 0x1ff;
// is palette select bit on? if yes, use sprite palette instead


+ 1
- 1
recipes/sms/blk/605 Wyświetl plik

@@ -1,7 +1,7 @@
CREATE _idat
0b00000100 C, 0x80 C, ( Bit 2: Select mode 4 )
0b00000000 C, 0x81 C,
0b11111111 C, 0x82 C, ( Name table: 0x3800 )
0b00001110 C, 0x82 C, ( Name table: 0x3800 )
0b11111111 C, 0x85 C, ( Sprite table: 0x3f00 )
0b11111111 C, 0x86 C, ( sprite use tiles from 0x2000 )
0b11111111 C, 0x87 C, ( Border uses palette 0xf )


Ładowanie…
Anuluj
Zapisz