(1) some element of timing (2) some animation and graphics (3) interesting or innovative twistsDoes not mean every proposal has to have all (or even any) of these elements. But if these are missing, I think you better introduce some other nice features that I consider adequate substitute. Note that even with graphics or animation, you may be able to use text modes rather than the graphics modes.
When you write your proposal, try to mention whether you will use any of the following features, and expand on them if necessary:
(a) random number generator (b) use of timer (c) setting up of new interrupts (d) use of mouse (e) video modes: graphics or text mode? (f) use of animationE.g. The usual game of pong has (1) and (2), but is boring from the viewpoint of (3) -- there are plenty of such games available (for instance, there is one in the book).
E.g. The Extreme Volleyball game by students in my previous class is really a simple variation of the pong game, but they gave it a nice twist.
E.g. Don't propose to do tic-tac-toe, in the standard version of this! No timing, no animation, no novelty. But if you want to do a 3D version of this, I would be more receptive.
E.g. Tetris has (1) and (2) but do not propose to do the standard game (it is easy to copy the code for this game from the internet). But I can think of lots of variations of tetris that you can do. One might be to add "obstacle" squares such that a piece can get stuck if lands on the obstacles. Another would be to change the shape of the region in which you play the game (e.g., the bottom edge need not be flat).
P.S. I found that using "CONST" as name of a segment is illegal in TASM, so you can replace it by "_CONST". There are 3 places where you need to do this.
There is a line drawing routine (prog086.asm) and a routine to draw a solid box (prog085.asm). I have written some main programs to call these routines (e.g., vgaline.asm uses the routine in prog086.asm).
One of the most useful programs here is "Bit Block Transfer", _BitBlt in prog087.asm. It copies a block of pixels from a source block to a destination block. Unfortunately, I believe this works only on page 0 of your graphics mode. Look at my files vgablt*.asm to exercise _BltBlt in various modes.
Also, if the source and destination blocks overlap, there may be some undesirable effects in _BitBlt. My solution is to write another program, called _BitBltX which also does block transfer but calls _BitBlt several times, each time making sure that there is no overlap,
Generally, most games can use more colors in which case I recommend modes 12h or 13h, which are vga graphics modes. These modes have only one video buffer page.
If you need more than one page, consider using (vga graphics) mode 10h which has two pages. Mode 10h has screen size 640x350, and has 16 colors provided your video buffer is at least 128K. See Helppc for more details. These days, most machines have 256K video buffer, so this is not a problem. To find out what your computer has, use INT 10h, fcn=12h.
Note that when you switch modes or pages, normal the display is cleared. To prevent this, make sure that bit 7 of AL is set before you call INT 10h.
mov ah,0 ; set mode mov al,10h ; choose mode 10h or al,80h ; set bit 7 of AL int 10h
This TIMER_TICK program is used in pgm16_2 (page 346). It is used to for generating a fixed frequency tone for the sound card (page 347). I have written a sample program (found in the file timeout.asm) to illustrate how you can keep time using the timer_tick interrupt routine. (Look under ``samples'' in class page.)
NOTE: Another method to keep absolute time is to directly read the clock tick at address 0000:046C and 0000:046E (this is a 32 bit value that is updated by the clock every 55 ms). See the file egalib.asm in the vga-asm directory.
INPUT: ah=11h OUTPUT: al=0 if buffer is empty al=0FFh if buffer is not emptyRelated to this interrupt is the ability to flush the buffer, and execute an input command at the same time.
INT 21h, function 0Ch: INPUT: ah=0Ch al=1,6,7,8 or OAhThe output depends on which of the subfunctions (1,6,7,8,0Ah) is used. Other inputs are also necessary, depending on the subfunction. For instance, al=0Ah refers to reading a string. In this case, ds:dx must be setup to contain the address of the memory buffer for storing the string input. (This was the subject of HW3.)
code, stack, data.Suppose your program does not fit the small model. You can of course, go to full blown definitions of your own segments (using the "SEGMENT" directive). But a more convenient way is to use other ``standard memory models''. We now explained three of the most common ones. In other models, we allow code and data to be put into more than one segment. Moreover, we distinguish several kinds of data segments.
data: has (possibly) initialized data data?: has only un-initialized data const: has constant data fardata: has (possibly) initialized data fardata?: has only un-initialized dataMEDIUM MODEL: data here can be put in one segment but code needs to be put into several segments. To use this model, you use the following directive:
.MODEL MEDIUM >csn<where >csn< refers to "code segment name". If you have several assembly modules, each with a different >csn<, you can generate several code segments this way. But, in fact, you can also generate more than one code segment within the same assembly module, by using the directive
.CODE >csn<This directive begins a new code segment with name >csn<_text, or continues a previously started code segment with that name.
COMPACT MODEL: code here can be put into one segment but data needs to be put into several segments. The usual .DATA directive generates one data segment which is the "near data segment". You can generate other data segments by using the directive
.FARDATA >name<This begins or continues (possibly) initialized data segment with name >name<. For instance, suppose if you have the statements
.FARDATA data1 Var1 db ? ...To you can access Var1, you need to first get its segment number into ds. For instance, to set Var1 to the constant 1, you can do
mov dx, SEG Var1 ; alternatively, use ; mov dx,data1 mov ds, ax ; this sets up ds mov di, OFFSET Var1 ; alternatively, use ; lea di,Var1 mov [di], BYTE PTR 1LARGE MODEL: this is just the combination of the medium and the compact models.
TIMEDELAY EQU 30Better still, allow the user to select the time delay at the start of the game.
1) Main routine and overall logic of the game 2) Graphics 3) Input/Output, interface issues, help routines.But it really depends on your game.