-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VGA mode in libc #2184
Comments
It is possible I suppose, but I don't think it necessarily a good idea, for the following reasons:
In summary, Vgalib.h can't be used by our new toolchain, as it doesn't support __far pointers, and this code can't be used in our Basic interpreter nor is it usable in Doom. Further discussion points might be: what real usefulness does adding a super-simple vgalib.h add? What types of actual programs would be written, and why would we want them to use vgalib.h rather than Nano-X? For instance, ported games will always use their already-existing routines written for speed, which is very necessary on legacy non-framebuffer systems. New graphical applications should probably be pushed into the direction of Nano-X, especially with the new work allowing for multiple graphical applications to run concurrently. |
The idea of this post was actually to only switch to graphical mode and back. It was not to create an entire graphical library. So it could be called "vgamode.h" instead. The target of this post is this code:
that I remember providing to Doom. So what I wanted is to play with VGA with the new 8086-toolchian. But now I need the above assembly code to do it. So how do I do that? I suppose an assembler .as file can be created that I can link against. That we will leave only the problem with |
Ok. Lets start with the C86 toolchain, since that's what you're interested in and each compiler would need a special implementation anyways. C86 has an asm directive, but I've never tested or used it. Nonetheless, switching modes is the simple part; accessing video ram at A000 will likely require a function call. C86 supposedly supports inline functions, but they were discussed as possibly buggy by BYU. The hard part will be making this anywhere near fast enough to be useful for other than experimentation. I'll look further into this and respond with something you can play with, rather than adding immediately to libc, thank you! |
If you implement this function, I can test in the image viewer I plan to develop. |
@ghaerr
Is it possible to add the inline asm code from:
https://github.com/ghaerr/elks/wiki/Coding-games-for-ELKS#2-using-direct-access-to-the-vga-memory that initializes the VGA mode to libc?
It could be a header "vgalib.h" with 1 function and several defines:
This could be used by the new 8086 tool-chain, elksdoom developed by @FrenkelS and our basic interpreter for example. It will give common ground for future VGA development. The
VGA
will be set differently if needed - for PC98 for example, but will not require changing the program that uses the header.The text was updated successfully, but these errors were encountered: