From 7473dabb3daa20f9c33925d7ba6528f49bad571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 11 Dec 2007 21:25:14 +0000 Subject: [PATCH] add program to load external graphics bioses Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3060 --- src/dos/dos_programs.cpp | 61 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 900b225c..08083c97 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.79 2007-11-01 12:15:34 qbix79 Exp $ */ +/* $Id: dos_programs.cpp,v 1.80 2007-12-11 21:25:14 c2woody Exp $ */ #include "dosbox.h" #include @@ -756,12 +756,66 @@ public: } }; - static void BOOT_ProgramStart(Program * * make) { *make=new BOOT; } +#if C_DEBUG +class LDGFXROM : public Program { +public: + void Run(void) { + if (!(cmd->FindCommand(1, temp_line))) return; + + Bit8u drive; + char fullname[DOS_PATHLENGTH]; + + localDrive* ldp=0; + if (!DOS_MakeName((char *)temp_line.c_str(),fullname,&drive)) return; + + try { + ldp=dynamic_cast(Drives[drive]); + if(!ldp) return; + + FILE *tmpfile = ldp->GetSystemFilePtr(fullname, "rb"); + if(tmpfile == NULL) { + LOG_MSG("BIOS file not accessible."); + return; + } + fseek(tmpfile, 0L, SEEK_END); + if (ftell(tmpfile)>0x10000) { + LOG_MSG("BIOS file too large."); + return; + } + fseek(tmpfile, 0L, SEEK_SET); + + PhysPt rom_base=PhysMake(0xc000,0); + + Bit8u vga_buffer[0x10000]; + Bitu data_written=0; + Bitu data_read=fread(vga_buffer, 1, 0x10000, tmpfile); + for (Bitu ct=0; ct