comparison vdp.h @ 2358:4b2ac43c106e

Give debugger expression engine access to VDP and Sub CPU values. Add basic variable support
author Michael Pavone <pavone@retrodev.com>
date Sat, 28 Oct 2023 00:52:10 -0700
parents 83f5529086c5
children 04d29635d238
comparison
equal deleted inserted replaced
2357:344c6a3fe8a8 2358:4b2ac43c106e
170 VDP_SMS2, 170 VDP_SMS2,
171 VDP_SMS, 171 VDP_SMS,
172 VDP_TMS9918A 172 VDP_TMS9918A
173 }; 173 };
174 174
175 typedef struct vdp_context vdp_context;
176 typedef void (*vdp_hook_fun)(vdp_context *);
177
175 typedef struct { 178 typedef struct {
179 vdp_hook_fun handler;
180 void *data;
181 } vdp_hook;
182
183 struct vdp_context {
176 system_header *system; 184 system_header *system;
177 //pointer to current line in framebuffer 185 //pointer to current line in framebuffer
178 uint32_t *output; 186 uint32_t *output;
179 //pointer to current framebuffer 187 //pointer to current framebuffer
180 uint32_t *fb; 188 uint32_t *fb;
181 uint8_t *done_composite; 189 uint8_t *done_composite;
182 uint32_t *debug_fbs[NUM_DEBUG_TYPES]; 190 uint32_t *debug_fbs[NUM_DEBUG_TYPES];
183 char *kmod_msg_buffer; 191 char *kmod_msg_buffer;
192 vdp_hook dma_hook;
193 vdp_hook vdpreg_hook;
194 vdp_hook data_hook;
184 uint32_t kmod_buffer_storage; 195 uint32_t kmod_buffer_storage;
185 uint32_t kmod_buffer_length; 196 uint32_t kmod_buffer_length;
186 uint32_t timer_start_cycle; 197 uint32_t timer_start_cycle;
187 uint32_t output_pitch; 198 uint32_t output_pitch;
188 uint32_t debug_fb_pitch[NUM_DEBUG_TYPES]; 199 uint32_t debug_fb_pitch[NUM_DEBUG_TYPES];
256 uint8_t pushed_frame; 267 uint8_t pushed_frame;
257 uint8_t type; 268 uint8_t type;
258 uint8_t cram_latch; 269 uint8_t cram_latch;
259 int32_t color_map[1 << 12]; 270 int32_t color_map[1 << 12];
260 uint8_t vdpmem[]; 271 uint8_t vdpmem[];
261 } vdp_context; 272 };
262 273
263 274
264 275
265 vdp_context *init_vdp_context(uint8_t region_pal, uint8_t has_max_vsram, uint8_t type); 276 vdp_context *init_vdp_context(uint8_t region_pal, uint8_t has_max_vsram, uint8_t type);
266 void vdp_free(vdp_context *context); 277 void vdp_free(vdp_context *context);
304 void vdp_inc_debug_mode(vdp_context *context); 315 void vdp_inc_debug_mode(vdp_context *context);
305 //to be implemented by the host system 316 //to be implemented by the host system
306 uint16_t read_dma_value(uint32_t address); 317 uint16_t read_dma_value(uint32_t address);
307 void vdp_dma_started(void); 318 void vdp_dma_started(void);
308 void vdp_replay_event(vdp_context *context, uint8_t event, event_reader *reader); 319 void vdp_replay_event(vdp_context *context, uint8_t event, event_reader *reader);
320 uint16_t vdp_status(vdp_context *context);
309 321
310 #endif //VDP_H_ 322 #endif //VDP_H_