Graphics

x86 / x64 programming
Post Reply
svatostop
Posts: 3
Joined: Wed Apr 28, 2021 7:26 pm

Graphics

Post by svatostop » Thu Apr 29, 2021 2:42 pm

Hello everyone !
I have a few questions about graphics on modern systems. I have a big dream to do this and understand everything completely. I really don't want to use existing libraries and engines. I will actually be very happy if I could display at least a pixel on the screen someday :)
As far as I understood, on modern PCs there is no direct access to video memory, as it could be done in DOS using interrupts.
From which my searches moved towards hardware and drivera. Is it correct that my only way is to write a driver for a videocard? Which I could later use in my programs. Or it doesn't work that way and there are other solutions. Thanks in advance for your reply!

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Graphics

Post by akuyou » Sat May 01, 2021 11:13 am

You can write to VRAM in VGA mode without interrupts in the way shown below.
https://www.chibialiens.com/8086/simplesamples.php

So far as I understand modern videocards still have backwards compatibility with such things for Bios screens and the like.

I think the question is, what do you consider 'Modern'... are you looking to use VESA 16 bit 640x480 from DOS, or write a 3D game in windows 10 using RTX raytracing??

If you're looking to do something "Current day", I think you're going to struggle, as the underlying hardware of a modern DirectX 11 video card, and one from 2001 is bound to be pretty unrecognizable
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

svatostop
Posts: 3
Joined: Wed Apr 28, 2021 7:26 pm

Re: Graphics

Post by svatostop » Sat May 01, 2021 1:50 pm

Oh, thank you very much for your answer! And thanks a lot for the link to the tutorial. I did not know this, and Ill definitely study it. In general, for a start I am not interested in RTX (or something like that), but I would like to run my graphic stuff from x64. Do I really need to use already existing libs and programs? Or if i want to do it by myself - writing my own directx (haha) and drivers is solution?
Last edited by svatostop on Sat May 01, 2021 5:27 pm, edited 2 times in total.

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Graphics

Post by akuyou » Mon May 03, 2021 2:54 am

I was not really suggesting you were planning to program an RTX, it was just an example to say theres a whole range of things you could define to be modern.

I think the biggest decider will be the operating system.

If you're willing to use a boot disk (and run Dos or write your own boot sector) then you'll be able to try to access the hardware directly, If you're using modern windows (Windows 10) I'm pretty certain the OS will 'protect' the hardware from you accessing it directly, so yes, you'll need to write your own driver.

I'm not sure you really want to do this in assembly... I doubt much is written in ASM these days for windows 10, I'm pretty certain everyone uses C type languages these days.

I'd probably look to get the 'groundwork' done in C++, then add ASM on the top of that eg:
1. write SDL Init routine in C++ to set up a window with a bitmap screen
2. pass that bitmap screen pointer over to an ASM routine
3. alter the pixels and do cool stuff in assembly
4. Profit!

Well, anyway I hope you make some progress, it certainly sounds a challenge.
Good luck!
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

svatostop
Posts: 3
Joined: Wed Apr 28, 2021 7:26 pm

Re: Graphics

Post by svatostop » Tue May 04, 2021 8:36 am

Thank you very much for your answer and tips! Now, at least for me, there is a work plan in my head. Before that, of course, there is still a lot to learn, but now it is at least clear in which direction to move! :)

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Graphics

Post by akuyou » Wed May 05, 2021 8:42 am

Topic moved to 8086 section.

Feel free to post back with an 'update report' or any useful tech resources you find on ASM with more modern systems.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Lee
Posts: 23
Joined: Sun Oct 10, 2021 1:26 am

Re: Graphics

Post by Lee » Sun Apr 16, 2023 10:17 pm

I would define modern graphics ias resolution and colour depth that shows any photo realistically.

As an aside note x86 assembly language or x64 assembly language is not retro programming there are lots of x86 32bit computers and x64 computers 64bit computers still used today.All x64 CPUs I know of can run x86 code.

A modern day use for assembly language program with modern graphics without using windows is writing a bare bones semi operating system, all modern operating system start with assembly from the boot sector. For example this is used in not powerful x64 or x86 PCs (bought new or old which use x86 or x64) programmed for dedicated tasks, on a large scale, there are lots of example a few are: dedicated PC that print photos in shops, or possibly EPOS type systems. To make these sort of machines as cheaply as possible we can make boot of a custom CD-ROM (which emulates a floppy disc boot sector which all IBM compatible machines do) to possibly avoid the cost of buying a hard drive. Using assembly help to reduce the cost of RAM sticks.

Post Reply

Return to “8086 Assembly Programming”