struct vm_device *dev;
bool passthrough;
+ bool skip_next_passthrough_out; // for word access
uint32_t updates_since_render;
do { if ((vga)->passthrough) { passthrough_io_in(port,dest,len); } } while (0)
#define PASSTHROUGH_IO_OUT(vga,port,src,len) \
- do { if ((vga)->passthrough) { passthrough_io_out(port,src,len); } } while (0)
+ do { if ((vga)->passthrough && (!(vga)->skip_next_passthrough_out)) { passthrough_io_out(port,src,len); } (vga)->skip_next_passthrough_out=false; } while (0)
+
+#define PASSTHROUGH_IO_SKIP_NEXT_OUT(vga) \
+ do { if ((vga)->passthrough) { (vga)->skip_next_passthrough_out=true; } } while (0)
#define PASSTHROUGH_READ_CHECK(vga,inter,pass) \
do { if ((vga)->passthrough) { if ((inter)!=(pass)) { PrintError("vga: passthrough error: passthrough value read is 0x%x, but internal value read is 0x%x\n",(pass),(inter)); } } } while (0)
ERR_WRONG_SIZE("write","vga sequencer addr",len,1,2);
- PASSTHROUGH_IO_OUT(vga,port,src,1);
-
+ PASSTHROUGH_IO_OUT(vga,port,src,len);
+
vga->vga_sequencer.vga_sequencer_addr.val = *((uint8_t*)src) ;
-
+
if (len==2) {
+ PASSTHROUGH_IO_SKIP_NEXT_OUT(vga);
// second byte is the data
if (sequencer_data_write(core,port,src+1,1,vga)!=1) {
PrintError("vga: write of data failed\n");
ERR_WRONG_SIZE("write","vga crt controller addr",len,1,2);
- PASSTHROUGH_IO_OUT(vga,port,src,1);
+ PASSTHROUGH_IO_OUT(vga,port,src,len);
vga->vga_crt_controller.vga_crt_addr.val = *((uint8_t*)src) ;
if (len==2) {
+ PASSTHROUGH_IO_SKIP_NEXT_OUT(vga);
// second byte is the data
if (crt_controller_data_write(core,port,src+1,1,vga)!=1) {
PrintError("vga: write of data failed\n");
ERR_WRONG_SIZE("write","vga graphics controller addr",len,1,2);
- PASSTHROUGH_IO_OUT(vga,port,src,1);
+ PASSTHROUGH_IO_OUT(vga,port,src,len);
vga->vga_graphics_controller.vga_graphics_ctrl_addr.val = *((uint8_t*)src) ;
if (len==2) {
+ PASSTHROUGH_IO_SKIP_NEXT_OUT(vga);
// second byte is the data
if (graphics_controller_data_write(core,port,src+1,1,vga)!=1) {
PrintError("vga: write of data failed\n");
if (passthrough && strcasecmp(passthrough,"enable")==0) {
PrintDebug("vga: enabling passthrough\n");
vga->passthrough=true;
+ vga->skip_next_passthrough_out=false;
}
// No memory store is allocated since we will use a full memory hook