#include "vga.h"
#include "util.h"
+#ifdef __DJGPP__
+#define VMEM_PTR ((void*)(0xa0000 + __djgpp_conventional_base))
+#else
+#define VMEM_PTR ((void*)0xa0000)
+#endif
#define SAME_BPP(a, b) \
((a) == (b) || ((a) == 16 && (b) == 15) || ((a) == 15 && (b) == 16) || \
void cleanup_video(void)
{
free(vmodes);
- vmodes = 0;
}
struct video_mode *video_modes(void)
}
/* unmap previous video memory mapping, if there was one (switching modes) */
- if(vpgaddr[0] && vpgaddr[0] != (void*)0xa0000) {
+ if(vpgaddr[0] && vpgaddr[0] != VMEM_PTR) {
dpmi_munmap(vpgaddr[0]);
vpgaddr[0] = vpgaddr[1] = 0;
}
}
} else {
- vpgaddr[0] = (void*)0xa0000;
+ vpgaddr[0] = VMEM_PTR;
vpgaddr[1] = 0;
blit_frame = blit_frame_banked;
int set_text_mode(void)
{
/* unmap previous video memory mapping, if there was one (switching modes) */
- if(vpgaddr[0] && vpgaddr[0] != (void*)0xa0000) {
+ if(vpgaddr[0] && vpgaddr[0] != VMEM_PTR) {
dpmi_munmap(vpgaddr[0]);
vpgaddr[0] = vpgaddr[1] = 0;
}
pending = pgsize;
while(pending > 0) {
sz = pending > 65536 ? 65536 : pending;
- /*memcpy64((void*)0xa0000, pptr, sz >> 3);*/
- memcpy((void*)0xa0000, pptr, sz);
+ /*memcpy64(VMEM_PTR, pptr, sz >> 3);*/
+ memcpy(VMEM_PTR, pptr, sz);
pptr += sz;
pending -= sz;
offs += curmode->win_64k_step;
uint32_t rmask, gmask, bmask;
uint32_t fb_addr;
short max_pages;
- int win_gran, win_gran_shift, win_64k_step;
+ short win_gran, win_gran_shift, win_64k_step;
};
#ifdef __cplusplus
int num_frames = 0;
void *vmem;
+#ifdef __DJGPP__
+ __djgpp_nearptr_enable();
+#endif
+
read_config("rbench.cfg");
if(parse_args(argc, argv) == -1) {
return 1;
}
-#ifdef __DJGPP__
- __djgpp_nearptr_enable();
-#endif
-
init_logger("rbench.log");
if(init_video() == -1) {