added missing "modify" declarations in cdpmi.h inline assembly blocks
authorJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 5 Dec 2019 02:03:13 +0000 (04:03 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 5 Dec 2019 02:03:13 +0000 (04:03 +0200)
src/dos/cdpmi.h
src/dos/gfx.c

index 4fc2c30..92bc5b3 100644 (file)
@@ -34,7 +34,8 @@ void dpmi_munmap(void *addr);
                "xor ax, ax" \
                "alloc_skip_err:" \
                value[ax] \
-               parm[ebx][edi];
+               parm[ebx][edi] \
+               modify[dx];
 
 #pragma aux dpmi_free = \
                "mov ax, 0x101" \
@@ -65,7 +66,7 @@ void dpmi_munmap(void *addr);
                "mov ax, cx" \
                value[eax] \
                parm[ebx][esi] \
-               modify[cx di];
+               modify[bx cx di esi];
 
 #pragma aux dpmi_munmap = \
                "mov ax, 0x801" \
@@ -73,7 +74,7 @@ void dpmi_munmap(void *addr);
                "shr ebx, 16" \
                "int 0x31" \
                parm[ebx] \
-               modify[ax];
+               modify[ax cx ebx];
 #endif /* __WATCOMC__ */
 
 #ifdef __DJGPP__
index b5670bf..d0128ee 100644 (file)
@@ -25,11 +25,25 @@ static int fbidx;
 
 static int init_vbe(void)
 {
+       int i, num;
+
        if(vbe_info(&vbe) == -1) {
+               fprintf(stderr, "failed to retrieve VBE information\n");
                return -1;
        }
 
        vbe_print_info(stdout, &vbe);
+
+       num = vbe_num_modes(&vbe);
+       for(i=0; i<num; i++) {
+               struct vbe_mode_info minf;
+
+               if(vbe_mode_info(vbe.modes[i], &minf) == -1) {
+                       continue;
+               }
+               printf("%04x: ", vbe.modes[i]);
+               vbe_print_mode_info(stdout, &minf);
+       }
        fflush(stdout);
 
        vbe_init_ver = VBE_VER_MAJOR(vbe.ver);
@@ -56,7 +70,11 @@ void *set_video_mode(int xsz, int ysz, int bpp)
        mode = -1;
        nmodes = vbe_num_modes(&vbe);
        for(i=0; i<nmodes; i++) {
-               vbe_mode_info(vbe.modes[i], &minf);
+               if(vbe_mode_info(vbe.modes[i], &minf) == -1) {
+                       continue;
+               }
+               printf("trying to match mode: %d (%dx%d %dbpp)\n", vbe.modes[i],
+                               minf.xres, minf.yres, minf.bpp);
                if(minf.xres != xsz || minf.yres != ysz) continue;
                if(minf.bpp == bpp) {
                        mode = vbe.modes[i];