Archived

This topic is now archived and is closed to further replies.

Tetris in 3 weeks?

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, for my Computer Architecture/Assembly class we were given the option to do a large problem for as much as 80% credit on the final exam. I''d like to do a simple tetris clone in assembly. The course didn''t teach masm, we used x86. Is it plausible that something like this can be done in such a short time (considering I don''t know about graphics in asm)? Also anyone know of some references to read on (i.e. video modes, timing, etc)?

Share this post


Link to post
Share on other sites
Depends on what OS you''re running, and if you''re required that the source be 100% assembly. On DOS I''d give very good odds of being able to do it in three weeks. Graphics there just consists of calling an interrupt and writing to the correct memory. On the other hand, if you''re on an NT box, you''re separated from direct memory access and you have to go through different APIs to get a writable buffer. Not hard, but a pain to do in pure assembly. Just setting up all the call stacks you need can take a big chunk out of your free time.

Share this post


Link to post
Share on other sites
Ok thanks for the input. I''m running Win98 so I won''t have a problem with my OS. I do remeber how to write direct to the command prompt, base address b800 I think so I will probably do an ascii version then.

Share this post


Link to post
Share on other sites
Alternatively you could do it DOS-based (if it''s Win98 you still have DOS underneath it), in VGA mode 13h

Richard "Superpig" Fine
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4 | Enginuity5
ry. .ibu cy. .y''ybu. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu
"Don''t document your code; code your documentation." -me

Share this post


Link to post
Share on other sites
Not at all impossible. I wrote one in a day before in VB when bored one night, so three weeks should be plenty even with assembly. I would recommend doing it in mode 13h as mentioned above. It''s a lot more natural and you would only need five or so small graphics functions (switch mode, vsync, bitblt, set palette, load graphical image (256 color pcx still easiest)) to do the job. With the exception of image loading, these are extremely simple to code. I wouldn''t do it with text because text is quite a pain to code too and there are a lot of stupid little bumps along the way that nullify the time saved. If you know assembly, you should be able to handle mode 13h.

Timing and input can be done through interrupts or, since tetris isn''t all that depending, through more normal methods.

If you can find the original Tricks of the Game Programming Gurus, that''s a good source for all the above information. It''s a C book but all the same stuff is used asm. Google for vga mode 13h and read about it and decide from there if you want to go the graphical route.


CustomBar

Share this post


Link to post
Share on other sites