Fix for VESA2-related command line crash

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
Dr DOS
New Member
Posts: 8
Joined: Fri Apr 07, 2006 1:46 am

Fix for VESA2-related command line crash

Post by Dr DOS »

I would like to submit the
following fix for the crash that
occurs in ZSNES 1.42 (DOS) when
starting a ROM from the command
line while a VESA2 mode is
selected in zsnes.cfg. I have
tested it and it seems to work.
:)

The fix calls initvideo before
ClearScreen to prevent the GPF
that would happen if the null
selector in [VESA2Selec] is used
to access the linear framebuffer
in cscopyvesa2320x480x16b and
similar routines.

--- old\init.asm 2006-04-12 13:58:52.000000000 +0000
+++ new\init.asm 2006-04-12 13:48:36.000000000 +0000
@@ -111,6 +111,7 @@
EXTSYM ScrDispl,wramreadptr,wramwriteptr
EXTSYM pl1Ltk,pl1Rtk,pl2Ltk,pl2Rtk,pl3Ltk,pl3Rtk,pl4Ltk,pl4Rtk,pl5Ltk,pl5Rtk
EXTSYM loadstate2, headerhack
+EXTSYM initvideo

;initc.c
EXTSYM chip_detect
@@ -3168,6 +3169,7 @@
NEWSYM SetupROM
call CheckROMType
call SetIRQVectors
+ call initvideo
call ClearScreen
cmp byte[cbitmode],0
jne .nomakepal
Dr DOS
New Member
Posts: 8
Joined: Fri Apr 07, 2006 1:46 am

Re: Fix for VESA2-related command line crash

Post by Dr DOS »

And here is the same fix for the
29-03-2006 WIP version:

diff -u -P -r old/initc.c new/initc.c
--- old/initc.c 2006-04-12 19:18:00.000000000 +0000
+++ new/initc.c 2006-04-12 19:13:56.000000000 +0000
@@ -2150,6 +2150,7 @@
CheckROMType();
SetIRQVectors();

+ initvideo();
#ifdef __MSDOS__
asm_call(DOSClearScreen);
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Thanks, I will patch CVS with it.
Post Reply