I want to write a game in assembler

Started by
17 comments, last by jimiwa 19 years, 10 months ago
Well I don''t see the point of writing the game entirely in assembler if it''s going to use OpenGL or DirectX ^^ but if you want to do some low-level stuff, DOS programming is an option, it seems our modern graphics cards are still compatible with VGA and Mode X so why not. Another intersting option is to use an emulator and code for an old console or computer. (SNES, gameboy, amiga there are a lot to choose from).
Advertisement
Hi jimiwa
I''ve (tried) to do an RTS game in SVGA in assembly + DJGPP (its a variation of C++) before on DOS (thats about 7-8 years back)... Since it was on DOS, it was tough to be able to do even simple stuff like setting screen/color mode for anything above VGA mode (320 x 200) for graphics cards. So, an Internet organisation came up with VESA drivers.. I think some older graphic cards still supports VESA... VESA is a standard that allows your ASM/C application to call hardware-independent functions to do stuff like setting screen modes (SVGA only).. If I remember well, the concept then was pretty much as it is now- you initialized the screen mode,grabbed yourself a screen buffer from VESA, put stuff in that buffer, then blit it to the screen.

If you intend to use ASM for game programming, firstly : determine if you wanna do the game in pure DOS , DOS mode in windows or Windows only. Secondly, find out what screen mode you want to use. Izzo is right. The easiest thing to use is 320x200 (mode 13h). Well, you CAN still make a game look good in mode 13h . ''Flashback'' & ''Out of this world'' ran on mode 13h.

I''m sure you can setup something higher than mode 13h on a modern graphics card like geforce. But frankly, if you''re gonna want to avoid DirectX, then its going to be tough, because I can''t tell you for sure if VESA is still being enforced in practice.

In a nutshell, use mode 13h.

Regards,
Ed Tal


00000100-00100011-10000000
00000100-00100011-10000000
Don''t waste your time. Instead, why not spend your time learning how to augment C++ with inline assembler in your games. DOS is beyond dead, you will come away with a lot of knowledge but what will you have really gained? Nobody really programs in pure assembler for the last 10 years now. Nobody really programs VGA cards anymore, the industry is way beyond that now.

If you really have to do it I wish you luck but I think you are just wasting your time. I could be wrong. But I doubt it on this one.
Oh and one more thing about DOS programming. Normal DOS use 8086 16bit assembler by default. I guess you''ll want to avoid that as it''s a nightmare with segment pointers, difficult access to memory beyond the first 640k and stuff like that.
The Watcom compiler had a very good way to set-up 32bit under DOS and is now free. You should look into that. Now these 32bits modes were not that compatible with Windows''s DOS mode if I remember correctly. So that might be a problem.
Just to let you know, it''s assembly... not assembler.
"assembler" is the thing that converts your assembly to opcodes.
Ra
maybe if you read this it will clear up why and when to use assembly
If God played dice, He'd win.—Ian Stewart, Does God Play Dice? The Mathematics of Chaos
I''m interested in programming in DOS mode for Windows.
I have Windows XP.
I''d like to write games that would run well on old computers.
I''m also interested in assembly language because it would be
a challenge. I think what got me into the idea is I dreamed
that I got an apple IIe. (I used to have one when I was a kid)
then I decided I wanted to get one and write assembly language
games for it, just because I envisioned myself becoming an
assembly language programmer when I was younger, but I never
ended up learning it. I figured I might as well do assembly
language for DOS since that would be the closest I could get
to that without actually going out and getting an old apple.
Also, it would be something different - simply the fact that
most game programmers don''t think of writing in assembly makes
me more interested in it.
Why not consider programming the Nintendo Gameboy Advance? I looks like a more modern version of the sort of thing you want to do. There''ll be a bigger community around it to encourage you.
Go for it! I personally think it''s a lot of fun (though I don''t do it that much anymore). Assembly language is used when programming the PS2 and GBA. Granted, the entire game isn''t written in assembly, but rather it is used as an optimisation tool. So learning assembly language certainly won''t be a waste of time (not that any intellectual pursuit is a waste of time if you''re doing it for your own enjoyment).

Check out the Art of Assembly Language Programming to start with. Other keywords to use in google are "mode 13h", "320x200", "graphics", "MCGA". If you want to access higher resolution modes without having to write drivers for every video card out there, you can use the VBA (VESA BIOS Extensions) - a set of standard extensions to the video BIOS that the VESA organisation came up with. They let you access common video modes in a video card-independent manner.

You''d probably want to use protected mode (i.e. flat memory model) to access the frame buffer for anything above 320x200 though. This is probably a bit too much info for now, so you should read the art of asm. and learn about how the x86 architecture is organised and its various operating modes. These things matter when you''re programming in assembly language.

cheers
sam

This topic is closed to new replies.

Advertisement