# HG changeset patch # User Paul Boddie # Date 1327620707 -3600 # Node ID cb61693507b2246a1f32e885e172d4b6cb63feb9 # Parent fdc7521435842c5e76c3020a09d78ab84adbe7ca Updated notes on hardware sprites and character attribute modes. diff -r fdc752143584 -r cb61693507b2 ULA.txt --- a/ULA.txt Mon Jan 09 00:34:03 2012 +0100 +++ b/ULA.txt Fri Jan 27 00:31:47 2012 +0100 @@ -162,14 +162,14 @@ An enhanced ULA might provide hardware sprites, but this would be done in an way that is incompatible with the standard ULA, since no &FE*X locations are -available for allocation. In a special ULA mode, one might allocate a pair of -locations (for example, &FE20 and &FE21) as a pair of registers referencing a -region of memory from which a sprite might be found and potentially copied -into internal RAM, with other locations (for example, &FE22 and &FE23) -providing the size of the region. Alternatively, one might write the region -location and size through a single ULA location, with the ULA being put into a -particular state after each write. For example: read LSB of region, read MSB -of region, read size, read height. +available for allocation. To keep the facility simple, hardware sprites would +have a standard byte width and height. + +The specification of sprites could involve the reservation of 16 locations +(for example, &FE20-F) specifying a fixed number of eight sprites, with each +location pair referring to the sprite data. By limiting the ULA to dealing +with a fixed number of sprites, the work required inside the ULA would be +reduced and it would avoid having to deal with arbitrary numbers of sprites. Providing hardware sprites can be awkward without having some kind of working area, since the ULA would need to remember where each sprite is to be plotted @@ -179,6 +179,9 @@ colour as the "colourkey" which is to be considered transparent, and only overwriting the main screen pixels with pixel values for other colours. +Even without an intermediate memory buffer, the colourkey concept could still +be used in combining pixel values from sprites and the normal pixel data. + Additional Screen Mode Configurations ------------------------------------- @@ -250,30 +253,37 @@ configured to not produce pixel values. A whole byte used for colour information for a whole character would result in -a choice of 256 colours, and this might be somewhat excessive. By only reading -attribute bytes at every other opportunity, a choice of 16 colours could be -applied individually to two characters. +a choice of 256 colours (or 512 colours if the attribute data were combined +with the pixel data), and this might be somewhat excessive. By only reading +attribute bytes at every other opportunity, a choice of 16 (or 32) colours +could be applied individually to two characters. Cycle: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 Reads: B A B - Pixels: 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 +Further reductions in attribute data access, offering 4 (or 8) colours for +every character in a four character block, for example, might also be worth +considering. + Consider the following configurations for screen modes with a colour depth of 1 bit per pixel for bitmap information: Screen width Columns Scaling Bytes (B) Bytes (A) Colours ------------ ------- ------- --------- --------- ------- - 320 40 x2 40 40 256 - 320 40 x2 40 20 16 - 208 26 x3 26 26 256 - 208 26 x3 26 13 16 + 320 40 x2 40 40 256/512 + 320 40 x2 40 20 16/32 + 320 40 x2 40 10 4/8 + 208 26 x3 26 26 256/512 + 208 26 x3 26 13 16/32 Here, a mode resembling MODE 4 would occupy the same amount of space as MODE 1 if 40 attribute (A) bytes were read in addition to the 40 bitmap (B) bytes. This would offer limited benefit over the mode with the higher colour depth, especially if palette definition lists were also available. However, if only 20 attribute bytes were read, the screen memory would be only 150% of the -original. +original, and if only 10 bytes were read, the screen memory would be a more +reasonable 125% of the original. Similarly, if an additional configuration pixel-tripled mode were to require as many attribute bytes as bitmap bytes, it would occupy as much space as its @@ -281,8 +291,13 @@ attribute bytes for every 26 bitmap bytes, it would actually be more efficient than MODE 6 (a screen start address of &6600 versus MODE 6's &6000). -MODE 7 Emulation ----------------- +One significant limitation of this scheme is the effect on memory bandwidth. +It is arguably unattractive to effectively limit the bandwidth available in +modes similar to MODE 4 or 5, merely to gain attribute colours, particularly +in the most extreme application of the scheme. + +MODE 7 Emulation using Character Attributes +------------------------------------------- If the scheme of applying attributes to character regions were employed to emulate MODE 7, in conjunction with the MODE 6 display technique, the @@ -291,10 +306,14 @@ Screen width Columns Rows Bytes (B) Bytes (A) Colours Screen start ------------ ------- ---- --------- --------- ------- ------------ 320 40 25 40 20 16 &5120 -> &5100 + 320 40 25 40 10 8 &58f0 -> &5800 Although this requires much more memory than MODE 7 (12000 bytes versus MODE 7's 1000 bytes) and more memory than even MODE 6, it would at least make -a limited 40-column multicolour mode available as a substitute for MODE 7. +a limited 40-column multicolour mode available as a substitute for MODE 7. If +only 8 colours were permitted, eliminating any use of an extra bit to indicate +flashing colours, the same amount of memory as MODE 4 or MODE 5 would be +needed. Enhanced Graphics and Mode Layouts ----------------------------------