mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
core, fix z80 vcounter value
This commit is contained in:
parent
adffea8dae
commit
7021622153
4 changed files with 27 additions and 28 deletions
|
@ -454,6 +454,8 @@ struct PicoTiming
|
|||
|
||||
int timer_a_next_oflow, timer_a_step; // in z80 cycles
|
||||
int timer_b_next_oflow, timer_b_step;
|
||||
|
||||
int vcnt_wrap, vcnt_adj;
|
||||
};
|
||||
|
||||
struct PicoSound
|
||||
|
@ -914,6 +916,13 @@ static __inline void VideoWriteVRAM(u32 a, u16 d)
|
|||
UpdateSAT(a, d);
|
||||
}
|
||||
|
||||
static __inline u8 PicoVideoGetV(int scanline)
|
||||
{
|
||||
if (scanline >= Pico.t.vcnt_wrap) scanline -= Pico.t.vcnt_adj;
|
||||
if ((Pico.video.reg[12]&6) == 6) scanline = (scanline<<1) | 1;
|
||||
return scanline;
|
||||
}
|
||||
|
||||
PICO_INTERNAL_ASM void PicoVideoWrite(u32 a,unsigned short d);
|
||||
PICO_INTERNAL_ASM u32 PicoVideoRead(u32 a);
|
||||
unsigned char PicoVideoRead8DataH(int is_from_z80);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue