I have some patches I want to try on my version of DosBox, but they are diff or patch files. I am having a terrible time trying to do all of this manually using Notepad. I did a Google on "diff patch win32." That pulled up half the pages on the Internet, and the relivant links were no longer active.
Yep, looks like those are Win32 ports of the GNU diff/patch tools that all those *nix people used to make the diff/patch files in the first place. So, those should work well.
I installed both diff and patch from the sourceforge download page, then updated my path so that my command line terminal (eh... DOS window?) would know where the new diff.exe and patch.exe files were.
Expecting fabulous results, I typed in "coreswitch.patch" at the prompt. Windows brought up a dialog box asking me to select which program I would like to use to handle files of type .patch. I browsed to the proper directory and selected the patch.exe file. (Patch knows to call diff.exe, I guess?)
This is getting frusterating, but how do I "apply" a .diff file? Specifically, I am wanting to apply the "serialport_patch2.diff" file. diff is for getting the difference between two files or folders, so I don't see how this file is used. I apologize for my ignorance.
Stockholm, Sweden, Europe, Earth Interests: Old games & young women
RankModerator
Rank
Moderator
Posts
5128
Joined
2004-01-18, 04:15
Location
Stockholm, Sweden, Europe, Earth Interests: Old games & young women
Qbix wrote:
patch -p0 < serialport_patch.diff
the proper extestion for a patch is confusingly diff (I think ( as patch applies a diff))
... and the patch program do not care about the extension anyway (as any well-behaved Unix program should).
joe, just a few pointers about that -p0 stuff. Unlike in real life, not all patches are created equal. Some includes extranous path-info (/path/to/some/file-to-patch), some don't. The -p option is used to strip some of that path-info away, allowing patch to find the right file. I think the 0 says "strip the initial /". Depending on the situation, you might have to use -p1, -p2, etc.
Oh - as an alternative to < serialport_patch.diff, you can also use the -i (input option): patch -p0 -i serialport_patch.diff
I really appreciate all the help. Now I seem to be having another problem: When I enter the patch command, I get errors.
1C:\>patch -p0 < c:\dosbox\serialport_patch2.diff 2can't find file to patch at input line 6 3Perhaps you used the wrong -p or --strip option? 4The text leading up to this was: 5----------------------------- 6|Index: include/bios.h 7|======================================== 8|RCS file: /cvsroot/dosbox/dosbox/dosbox/include/bios.h,v 9|retrieving revision 1.9 10|diff -r1.9 bios.h 11------------------------------ 12File to patch: EOF 13Skip this patch? [y] ^C 14C:\
My directory structure is as follows:
* Folder DOSBox is on the C: drive;
* patch files are located within C:\DOSBox;
* subfolder "dosbox" is located within C:\DOSBox and contains the 0.63 version from SourceForge.
Where is patch expecting my files to be? Do I need to adjust the -pxxx parameter as MiniMax suggested? If so, what magical value of xxx would/should I use?
Previously, I applied the realtime clock patch, and now I am trying to apply the serial port patch. Unfortunately, the realtime clock patch seems to have modified some of the same code that the serial port patch needs to modify.
The serial port patch says to do this:
1238,240c848,851 2< for (i=base;i<=(base+8);i++) { 3< IO_RegisterWriteHandler(i+8,WriteSerial,IO_MB); 4< IO_RegisterReadHandler(i+8,ReadSerial,IO_MB); 5--- 6> for (i=base;i<=(base+8);i++) 7> { 8> IO_RegisterWriteHandler(i,WriteSerial,IO_MB); 9> IO_RegisterReadHandler(i,ReadSerial,IO_MB);
Does anyone have a suggestion that would help me modify this? I feel only mildly wrong by modifying the for loop to include the base number, but I am at a loss of what to do about the two different types of functions being called. Should I call them both, or is one set better than another? (Should this be the topic of a new thread? I hate seeing my name on so many threads on here.)
you seem to using old patches.
are you certain you are using the latest version of the serial port patch ?
Uh... I thought I was. I downloaded serialport_patch2.diff from SourceForge, as it had a newer date on it than serialport_patch.diff did. Is there something else I should have used? (Drats!)
When I tried to compile, I got that a few things were missing.
On bios.h, I had to add BIOS_COM3_TIMEOUT and BIOS_COM4_TIMEOUT;
I added the contents of the dosbox\src\hardware\serialport folder to my project
There must be something else missing that I can't find, because I am currently getting these errors when compiling (ignore the warnings):
1------ Build started: Project: dosbox, Configuration: Release Win32 ------ 2 3Compiling... 4sdlmain.cpp 5\DOSBox\dosbox_hal\src\gui\sdlmain.cpp(1154) : warning C4297: 'SDL_main' : function assumed not to throw an exception but does 6 __declspec(nothrow) or throw() was specified on the function 7\DOSBox\dosbox_hal\src\gui\sdlmain.cpp(1154) : warning C4297: 'SDL_main' : function assumed not to throw an exception but does 8 __declspec(nothrow) or throw() was specified on the function 9directserial.cpp 10\DOSBox\dosbox_hal\src\hardware\serialport\directserial.cpp(37) : fatal error C1083: Cannot open include file: 'qextserialport.h': No such file or directory 11serialdummy.cpp 12\DOSBox\dosbox_hal\src\hardware\serialport\serialdummy.cpp(43) : error C2661: 'CSerial::CSerial' : no overloaded function takes 6 arguments 13\DOSBox\dosbox_hal\src\hardware\serialport\serialdummy.cpp(46) : error C2039: 'Init_Registers' : is not a member of 'CSerial' 14 ../include\serialport.h(103) : see declaration of 'CSerial' 15\DOSBox\dosbox_hal\src\hardware\serialport\serialdummy.cpp(46) : error C3861: 'Init_Registers': identifier not found, even with argument-dependent lookup 16\DOSBox\dosbox_hal\src\hardware\serialport\serialdummy.cpp(74) : error C3861: 'changeMSR': identifier not found, even with argument-dependent lookup 17\DOSBox\dosbox_hal\src\hardware\serialport\serialdummy.cpp(81) : error C3861: 'ByteTransmitted': identifier not found, even with argument-dependent lookup 18Generating Code... 19 20Build Time 0:06 21Build log was saved at "file://c:\DOSBox\dosbox_hal\visualc_net\Release\BuildLog.htm" 22dosbox - 6 error(s), 2 warning(s) 23 24 25---------------------- Done ---------------------- 26 27 Build: 0 succeeded, 1 failed, 0 skipped