Search the Community
Showing results for tags 'bitmap'.
Found 3 results
I am starting this thread to collect various examples of bitmap graphics programming in fbForth 2.0. This first example is a quick-and-dirty joystick drawing program, JDRAW , ported from the program of the same name I wrote four years ago for TI Forth in post #48 of thread, TI FORTH Version 3.0 dated October 20 1982. As I stated then, it is a pretty useless program except as a demo and proof of concept. It uses the CRU mode of JOYST for joystick-only use. There is a three-choice menu accessed with the fire button. The choices are P—Toggle pen up/down [blue pen = pen down; white pen = pen up] D—Toggle draw/erase [ solid pen = draw mode; hollow pen = erase mode] Q—Quit program The joystick moves the pen around the display screen. There is much that could be done to make it more useful. One such thing would be to provide finer control over the pen—reaction to joystick movement is too fast for any useful drawing. Another would probably be to dispense with the menu and use the fire button for pen-up/pen-down. But, that leaves managing draw/erase mode, which would probably require using the JOYST word in keyboard (KSCAN) mode. Anyway, here is the fbForth 2.0 source code for JDRAW : I will add a blocks file, later. For now, you can paste this in Classic99 at the command line of fbForth 2.0. Start the program by typing: JDRAW ...lee
Trying to fit big game into small amount of memory tends to be hard. Trying to scroll large bitmap screen is even harder. That is where something like complex scrolling method that wastes no RAM comes in handy. During my recent experiments with AnalMux's MWP (minimum wrapping principle) scrolling, I think I found a better way to understand it. Basic principle is still the same, using two LMSs to wrap the screen so that used memory exceeds only slightly more memory than static screen. Here is the image of memory layout according to 'my way' There are maximum two LMSs used (first row is special case as only one LMS is needed). Scrolling right is done by increasing X, when X reaches the end -> X=0, Y=Y+1 Scrolling down is done by increasing Y. As you see on the image, there are only SCREEN_WIDTH-1 bytes added at the end of screen memory. Contents of these bytes need to be copies of 0..SCREEN_WIDTH-1 bytes. In the case of 3x3 size, bytes 9 and 10 are copies of bytes 0 and 1. LMS addresses and appropriate Mode lines should be easy to calculate from Screen height, Screen width, X and Y. Imho, this "add copy of first row to the right of last row" makes much more sense than the explanation with additional zero row in Ironman Wiki documentation. As I'm in middle of making a game with this, If anyone sees any fault in this reasoning please shout
SC22PC - Convert MSX Screen 2 bitmap pictures into ColecoVision bitmap pictures by Daniel Bienvenu aka NewColeco January 2017 Description This tool extracts the PATTERN and COLOR tables (6K each) from a MSX .sc2 file and save it into a neat 12K .pc file. Technical Infomation MSX .sc2 file is essentially a memory dump of the seven (7) video registers followed by 14K graphics data in video ram, aka VRAM. Technically, that includes also sprites which can be used to patch the picture to avoid color clash effect. ColecoVision .pc file is simply the bitmap screen, composed of 3 charsets, made of two (2) tables: PATTERN and COLOR. No sprites data. Note: It is possible to use .sc2 file into ColecoVision projects, but be sure to consider three (3) things: the video register flag "4K/16K" has no impact on MSX computers but does on ColecoVision game system, the VRAM data is the important part, a good lossless data compression should be applied on VRAM data to save memory space. MSX Screen 2 Sample Download SC22PC - Version 0.1 (EXE, SRC, BATCH FILE) : sc22pc-alpha20170115.zip Links MSX Screen 2 .sc2 files MIF - Convert pictures to MSX Image Format (Win32 command-line and GUI) Multipaint - Convert and Draw pictures for various systems including MSX SC2 Pixel Polizei - Draw pictures for various systems including ColecoVision and MSX