Mercurial > repos > blastem
diff jag_video.h @ 1088:c0a026e974f4
Basic handling of video/object processor register writes
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 08 Oct 2016 23:49:20 -0700 |
parents | 6433d4d05934 |
children | 87597a048d38 |
line wrap: on
line diff
--- a/jag_video.h Fri Oct 07 18:27:38 2016 -0700 +++ b/jag_video.h Sat Oct 08 23:49:20 2016 -0700 @@ -1,7 +1,52 @@ #ifndef JAG_VIDEO_H_ #define JAG_VIDEO_H_ -#define JAG_VIDEO_REGS 0x2E +enum { + VID_HCOUNT, + VID_VCOUNT, + VID_HLPEN, + VID_VLPEN, + VID_REG_C, + VID_REG_E, + VID_OBJ0, + VID_OBJ1, + VID_OBJ2, + VID_OBJ3, + VID_REG_18, + VID_REG_1A, + VID_REG_1C, + VID_REG_1E, + VID_OBJLIST1, + VID_OBJLIST2, + VID_REG_24, + VID_OBJFLAG, + VID_VMODE, + VID_BORDER_RG, + VID_BORDER_B, + VID_HPERIOD, + VID_HBLANK_BEGIN, + VID_HBLANK_END, + VID_HSYNC, + VID_HVSYNC, + VID_HDISP_BEGIN1, + VID_HDISP_BEGIN2, + VID_HDISP_END, + VID_VPERIOD, + VID_VBLANK_BEGIN, + VID_VBLANK_END, + VID_VSYNC, + VID_VDISP_BEGIN, + VID_VDISP_END, + VID_VEQUAL_BEGIN, + VID_VEQUAL_END, + VID_VINT, + VID_PIT0, + VID_PIT1, + VID_HEQUAL_END, + VID_REG_56, + VID_BGCOLOR, + JAG_VIDEO_REGS +}; #define LINEBUFFER_WORDS 720 typedef struct { @@ -13,10 +58,15 @@ uint16_t *write_line_buffer; uint16_t *read_line_buffer; - uint32_t cycles; + uint32_t cycles; + uint8_t pclock_div; + uint8_t pclock_counter; + uint8_t mode; } jag_video; + jag_video *jag_video_init(void); void jag_video_run(jag_video *context, uint32_t target_cycle); +void jag_video_reg_write(jag_video *context, uint32_t address, uint16_t value); #endif //JAG_VIDEO_H_