I was not able to compile these source files by replacing them into the dosbox sources. Some files are apparently missing. By looking at the sources themselves, it seems that it does not support copy/paste by mouse, and also the related code is Win32 only. It uses pasteBuffer.push for each character in the text, but this alone obviously is not a substitute for the BIOS_AddKeyToBuffer function. Perhaps it uses a complete different structure which may not be present in the files you have attached (for example, the KEYBOARD_BufferSpaceAvail function is defined nowhere in the sources).

For the character limit, it is indeed a limit of the BIOS keyboard buffer itself, which can be expanded pretty easily by using the 256KEYS program in DOSBox for example, as mentioned earlier in this thread (so that I don't consider it a limit any more). You can just place it in the [autoexec] section of dosbox.conf if you want to enable this by default.

One reason I use this code as the basis for one of my projects (Win32 only) is that the programmer has added things to the system menu, and I've adapted the 2.0 code so that Clipboard Paste is available from the system menu, not just from a keystroke.

I have checked dbDOS's source code a bit, not only its paste function is Win32 only, but the keycode parsing function is also Win32 only, so it will not be cross-platform at all. I don't really wish to break the compatibility with other operating systems by adding such Win32-specific function calls (e.g. MapVirtualKey), which in any case are no longer very useful for our purposes any more, given that the BIOS keyboard buffer is indeed easily expandable.

Last edited by Wengier on 2014-10-30 @ 16:11, edited 3 times in total.

Dominus wrote:I'm stumpedey stumped. I cannot make it to work... I have no idea what is failing me.

Especially since the text selecting is failing me in the first part already and that shouldn't.I made sure that C_Clipboard is defined...

OK, since it was a MacOS X 10.10 VMware image, I will try to explain step by step on what I have done after getting OS X to boot into the desktop in VMware.

1. Download and install SDL 1.2.15. It is the usual configure+make+make install. Since GCC was not pre-installed, OS X asked me whether I wanted to install GCC, and I answer yes so that it was automatically installed (it took a few minutes). Everything went fine except that I needed to change the SDL_QuartzVideo.h file a little in order to get it to compile under OS X 10.10 (see this URL for more info about the patch: https://bitbucket.org/gennady/ja2-strac ... n-os-x-109) and EDIT: also disable X11 support.

2. Download and install pdcurses. I ran make in the sdl1 directory, and it generated libpdcurses.a (along with other files, which are not necessary for our purpose though).

3. Mount and enter into the dosbox directory. This is the directory of the source code of DOSBox with LFN and mouse copy/paste support. I mounted the directory in the host machine from inside the VMware virtual machine so that OS X can access the directory in the host machine directly. Copy the libpdcureses.a file generated just now to the src directory.

4. The usual configure+make. Everything should work fine except that the compiler would eventually report about undefined symbols such as _PDC_getclipboard if the makefile does not contain link to libpdcureses.a. If this is the case, copy that command starting with "g++ -g -O2 -o dosbox dosbox.o cpu/libcpu.a ..." and add "./libpdcurses.a" manually after "dosbox.o". Go to the src directory and execute the modified command. Now it should generate the binary "dosbox" correctly.

5. Run the DOSBox binary with ./dosbox, and everything will be set.

(EDIT: Make sure all source files are the latest version, as attached in this thread)

Last edited by Wengier on 2014-10-30 @ 23:41, edited 3 times in total.

hmmm, still not working.Followed the above as close as I could and used the above changed files. AFAICT the only difference was that I needed to add "--disable-video-x11 --without-x" to SDL's configure (as OS X no longer ships with X11 and the Xquartz download didn't exactly work for building SDL for me). If you didn't need those to build SDL then this is the only difference that might matter.Can you attach your working binary? Maybe I can figure things out the other way.

Dominus wrote:hmmm, still not working.Followed the above as close as I could and used the above changed files. AFAICT the only difference was that I needed to add "--disable-video-x11 --without-x" to SDL's configure (as OS X no longer ships with X11 and the Xquartz download didn't exactly work for building SDL for me). If you didn't need those to build SDL then this is the only difference that might matter.Can you attach your working binary? Maybe I can figure things out the other way.

Regarding X11, you are right, I disabled X11 support in SDL's configure too. I forgot to mention this sub-step in my earlier post and now added it as well.

Anyway, I have attached the working DOSBox OS X binary with LFN and mouse copy/paste support.

(Also make sure you have not disabled mouse copy/paste support in dosbox.conf)

You do not have the required permissions to view the files attached to this post.

I'm gonna shoot myself now for wasting that much valuable time of me and you!!!!!

Somewhere along the trying to make it work, I forgot that the right button is also being used for the copy part not only the pasting.... Of course your build wouldn't mark with the left button as well, and that was impossible unless I have either something set wrong or doing it wrong... then I realized...

So, my build did indeed work as well. Thanks a lot

Only problem, as you also found out examining emendelsons problems:The copy/paste only works inside of dosbox, the clipboard of the system is not being used or affected. Same with your build.

I am SO GLAD that you have confirmed that it works on your OS X system too!

On Windows systems, the copy/paste feature of course uses the system clipboard so that it will not only work inside of dosbox, but also outside dosbox. As I am still new to OS X, I do not know exactly how many "clipboards" there are in OS X (in Linux/X11 there are at least two for example), or whether pdcurses-SDL is actually using its own clipboard in OS X now. If this is the case, is it possible to find some setting in pdcurses-SDL to change the clipboard that it is using?

It should be possible to build pdcurses, instead of pdcurses-sdl, against the X11 library in OSX. This would presumably allow the additional functionality with minimal patch modification. In addition, I believe SDL2 has system clipboard functionality, so that avenue will open the additional functionality for the non-X11 case (given verification of the above posts).

Past posts have indicated that SDL1 and SDL2 may co-exist in the same build, so someone could always submit a separate and future patch to enable this capability in dosbox (there is a SDL2 patch for dosbox already available in some form).

On OS X there is no transparent other clipboard, but obviously the X11 clipboard is separate from the system clipboard (when you install xquartz you can see references about this in the preferences).But the x11 clipboard and whatever pdcurses-sdl is using is also not the same from simple tests.

Using X11 for clipboarding is probably not going to be the best option as OS X doesn't provide X11 stuff anymore, you will need to install xquartz. And building SDL 1.x with X11 support seems to be not that straightforward anymore as well (though I think mercurial of SDL 1.x branch has a fix for that or something similar).

If I'd be better in actually coding I'd gladly help wrangler with it. As it stands now I'm good with getting stuff to compile (when I'm not dumb enough to not read which button to press ) but not much help with any coding.

AFAICT pdcurses is no longer developed for years now. Getting upstream to help is probably fruitless. The example for SDL are probably the best way...

Then perhaps the above SDL1 code example will provide a port for OSX system clipboard functions, but the configure file should detect OSX (I think it finds the word "darwin" during the build process). It would also remove the pdcurses library in the OSX build.

There's a file in that example, SDL_Clipboard_MacOSX.m, with functions such as Internal_PasteFromClipboard:

Thanks for your research. The most obvious problem for the code above (which I found it too) is that the code is written in Objective-C (which I have no experience with) instead of C/C++ (which is the programming language used in the DOSBox source code). I wonder if there is a C/C++ version of code that communicates with the OS X system clipboard. If no, is there an easy way to integrate Objective-C code into the C/C++ project?

Edit: alternatively, could someone try to compile the SDL library in OSX with the SDL_Clipboard patch? The patch is here: https://www.assembla.com/code/SDL_Clipb ... rial/nodes. I see now that the .m file must be in objective-C, but there is a cmake system that may work out-of-the-box.

Last edited by truth_deleted on 2014-11-01 @ 03:56, edited 1 time in total.

Thanks for the link. Indeed, this C/C++ example "implemented" clipboard copy/paste by calling shell commands (pbcopy and pbpaste) directly. I really don't know whether the DOSBox devs will be fine with it if I go with this approach.