From e154139fdaa57c8c805167641b9ac0c30bb9d115 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Sun, 15 Sep 2013 22:20:43 -0700 Subject: Implement FIFO as a ring buffer so the behavior of reads from invalid CRAM and VSRAM bits can be implemented properly --- vdp.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'vdp.h') diff --git a/vdp.h b/vdp.h index 4cb61e2..75a603d 100644 --- a/vdp.h +++ b/vdp.h @@ -110,6 +110,8 @@ typedef struct { int16_t y; } sprite_info; +#define FIFO_SIZE 4 + typedef struct { uint32_t cycle; uint16_t address; @@ -119,8 +121,9 @@ typedef struct { } fifo_entry; typedef struct { - fifo_entry *fifo_cur; - fifo_entry *fifo_end; + fifo_entry fifo[FIFO_SIZE]; + int32_t fifo_write; + int32_t fifo_read; uint16_t address; uint8_t cd; uint8_t flags; -- cgit v1.2.3