Skip to content

Commit e8241c6

Browse files
committed
Refresh rates now work
1 parent 304d256 commit e8241c6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/video/vid_bochs_vbe.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060

6161
#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
6262

63-
static video_timings_t timing_ps1_svga_isa = { .type = VIDEO_ISA, .write_b = 6, .write_w = 8, .write_l = 16, .read_b = 6, .read_w = 8, .read_l = 16 };
64-
static video_timings_t timing_ps1_svga_mca = { .type = VIDEO_MCA, .write_b = 6, .write_w = 8, .write_l = 16, .read_b = 6, .read_w = 8, .read_l = 16 };
63+
static video_timings_t timing_bochs = { .type = VIDEO_PCI, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 20, .read_w = 20, .read_l = 21 };
6564

6665
typedef struct bochs_vbe_t {
6766
svga_t svga;
@@ -116,11 +115,9 @@ bochs_vbe_recalctimings(svga_t* svga)
116115
bochs_vbe->vbe_regs[VBE_DISPI_INDEX_YRES] = VBE_DISPI_MAX_YRES;
117116
}
118117

119-
120-
/* Is this okay? */
121118
svga->char_width = 1;
122119
svga->dots_per_clock = 1;
123-
svga->clock = mode->dot_clock * 1000.;
120+
svga->clock = (cpuclock * (double) (1ULL << 32)) / (mode->dot_clock * 1000.);
124121
svga->dispend = mode->vdisplay;
125122
svga->hdisp = mode->hdisplay;
126123
svga->vsyncstart = mode->vsync_start;
@@ -279,8 +276,6 @@ bochs_vbe_outw(uint16_t addr, uint16_t val, void *priv)
279276
memset(bochs_vbe->svga.vram, 0,
280277
bochs_vbe->vbe_regs[VBE_DISPI_INDEX_YRES] * bochs_vbe->svga.rowoffset);
281278
}
282-
283-
break;
284279
} else {
285280
bochs_vbe->svga.read_bank = bochs_vbe->svga.write_bank = 0;
286281
}
@@ -507,7 +502,7 @@ bochs_vbe_init(const device_t *info)
507502

508503
rom_init(&bochs_vbe->bios_rom, "roms/video/bochs/VGABIOS-lgpl-latest.bin", 0xc0000, 0x10000, 0xffff, 0x0000, MEM_MAPPING_EXTERNAL);
509504

510-
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_ps1_svga_isa);
505+
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_bochs);
511506

512507
svga_init(info, &bochs_vbe->svga, bochs_vbe, 1 << 24, /*16mb*/
513508
bochs_vbe_recalctimings,

0 commit comments

Comments
 (0)