tag:blogger.com,1999:blog-17487316.post141929090784694788..comments2024-01-13T09:14:12.131+00:00Comments on The life of a Games Programmer: Demo coders....Mikehttp://www.blogger.com/profile/15958965170878448339noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-17487316.post-28238471367349000262008-11-01T10:45:00.000+00:002008-11-01T10:45:00.000+00:00While demo sources are rare, effects are often dis...While demo sources are rare, effects are often dissected and explained, e.g. at CSDB, codebase64, in Vandalism News, C= Hacking, etc. And simply asking the coder has always worked for me, though I usually prefer tracing the code in the monitor if I want to check something out. 90% of the time a demo effect just does one thing over and over for a full frame, so the code is usually (but not always) easy to follow. However, the "trick" is only what allows it to be done, actually getting the thing up on screen looking great is just plain old hard work.<BR/><BR/>Regarding bitmap zooming, it's two effects rolled into one. Vertical stretching is done with $d011, refer to the vic article and codebase. It's relatively timing sensitive, so it's not very well suited to game graphics (e.g. throwing sprites on top of it takes a bit of effort). Horizontal stretching is done with brute force, by plotting characters. When you convert a bitmap to character mode, you typically put the first four pixels in character 0, the next four pixels in character 1, and so on, so that to display the image you plot:<BR/><BR/>00 01 02 03<BR/><BR/>for a four character wide image. To prepare the image for stretching you put the first four pixels in character 0, but in character 1 you put pixels 1-4 (instead of 4-7), in character 2 you put 2-5, etc. To display the image you plot:<BR/><BR/>00 04 08 0c<BR/><BR/>The magic happens when you plot:<BR/><BR/>00 03 06 09<BR/><BR/>or:<BR/><BR/>00 05 0a 0f<BR/><BR/>This will stretch or expand the image by one pixel for each character plotted, letting you zoom ±25%.MagerValphttps://www.blogger.com/profile/00694566891929063566noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-55360916314511159232008-10-31T23:26:00.000+00:002008-10-31T23:26:00.000+00:00Check out: http://www.cpcwiki.com/index.php/XEO3Check out:<BR/> http://www.cpcwiki.com/index.php/XEO3Anonymousnoreply@blogger.com