From 187395f382b19b9faa5af5d79212f6e107db8aaf Mon Sep 17 00:00:00 2001 From: stainless <> Date: Tue, 9 Oct 2001 23:05:02 +0000 Subject: [PATCH] Added small screen to 512x384 video modes in the DOS port. --- zsnes/src/dos/dosintrf.asm | 4 +- zsnes/src/dos/initvid.asm | 1 + zsnes/src/video/copyvid.inc | 80 +++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/zsnes/src/dos/dosintrf.asm b/zsnes/src/dos/dosintrf.asm index 51517536..e94ccdb8 100644 --- a/zsnes/src/dos/dosintrf.asm +++ b/zsnes/src/dos/dosintrf.asm @@ -1014,7 +1014,7 @@ NEWSYM ClearScreen SECTION .data ; Total Number of Video Modes -NEWSYM NumVideoModes, dd 15 +NEWSYM NumVideoModes, dd 17 ; GUI Video Mode Names - Make sure that all names are of the same length ; and end with a NULL terminator @@ -1048,7 +1048,7 @@ NEWSYM GUIEAVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 ; Eagle NEWSYM GUIIEVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0 ; (Interp | Eagle) NEWSYM GUIFSVID, db 0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,0 ; Full Screen NEWSYM GUIWSVID, db 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0 ; (Full Scr. | Wide Scr.) -NEWSYM GUISSVID, db 0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,0 ; Small Screen +NEWSYM GUISSVID, db 0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,0 ; Small Screen NEWSYM GUITBVID, db 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0 ; Triple Buffering NEWSYM GUIHSVID, db 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0 ; Half/Quarter Scanlines NEWSYM GUI2xVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0 ; 2xSaI/Super Eagle Engines diff --git a/zsnes/src/dos/initvid.asm b/zsnes/src/dos/initvid.asm index d09a4452..11c13b06 100644 --- a/zsnes/src/dos/initvid.asm +++ b/zsnes/src/dos/initvid.asm @@ -363,6 +363,7 @@ NEWSYM dosinitvideo .initvesa2512x384x8 mov byte[res640],2 + mov byte[cbitmode],0 mov word[vesa2_x],512 mov word[vesa2_y],384 mov byte[vesa2_bits],8 diff --git a/zsnes/src/video/copyvid.inc b/zsnes/src/video/copyvid.inc index 94cbfacb..257e3a30 100644 --- a/zsnes/src/video/copyvid.inc +++ b/zsnes/src/video/copyvid.inc @@ -2257,6 +2257,8 @@ NEWSYM copyvesa2512x384x8b jne .startcopy ret .startcopy + cmp byte[smallscreenon],1 + je near .smallscreen cmp byte[ForceNewGfxOff],0 jne .nong16b cmp byte[newengen],0 @@ -2351,6 +2353,44 @@ NEWSYM copyvesa2512x384x8b jnz .b2 jmp .returnloop +.smallscreen + push es + mov ax,[vesa2selec] + mov es,ax + mov esi,[vidbuffer] + mov edi,[VidStartDraw] + add esi,16+256+32 + add edi,72*512+128 + cmp byte[resolutn],224 + jne .ssres239 + add edi,8*512 +.ssres239 + xor eax,eax + mov dl,[resolutn] + dec dl + dec dl + cmp byte[MMXSupport],1 + je .ssloopb +.ssloopa + mov ecx,64 + rep movsd + add esi,32 + add edi,128*2 + dec dl + jnz .ssloopa + jmp .done +.ssloopb + mov ecx,16 + MMXStuff + add esi,32 + add edi,128*2 + dec dl + jnz .ssloopb + emms +.done + pop es + ret + SECTION .bss .scratio resb 1 .lastrep resb 1 @@ -5628,6 +5668,8 @@ NEWSYM copyvesa2512x384x16b jne .startcopy ret .startcopy + cmp byte[smallscreenon],1 + je near .smallscreen push es mov byte[.lastrep],0 mov ax,[vesa2selec] @@ -5714,6 +5756,44 @@ NEWSYM copyvesa2512x384x16b jnz .b2 jmp .returnloop +.smallscreen + push es + mov ax,[vesa2selec] + mov es,ax + mov esi,[vidbuffer] + mov edi,[VidStartDraw] + add esi,16*2+256*2+32*2 + add edi,72*512*2+128*2 + cmp byte[resolutn],224 + jne .ssres239 + add edi,8*512*2 +.ssres239 + xor eax,eax + mov dl,[resolutn] + dec dl + dec dl + cmp byte[MMXSupport],1 + je .ssloopb +.ssloopa + mov ecx,64*2 + rep movsd + add esi,32*2 + add edi,128*2*2 + dec dl + jnz .ssloopa + jmp .done +.ssloopb + mov ecx,16*2 + MMXStuff + add esi,32*2 + add edi,128*2*2 + dec dl + jnz .ssloopb + emms +.done + pop es + ret + SECTION .bss .scratio resb 1 .lastrep resb 1