Skip to content

Instantly share code, notes, and snippets.

@caiwan
Created July 24, 2015 11:05
Show Gist options
  • Save caiwan/72e6571fc4d86e6446b6 to your computer and use it in GitHub Desktop.
Save caiwan/72e6571fc4d86e6446b6 to your computer and use it in GitHub Desktop.
IHR stands for interpolated HiRes.
This basically interpolates two HiRes images, one in even frames, and the
other in odd frames resulting in more colors, and up to 4 colors per 8x8
block. The selection of colors are limited though: they can be a mix of the
colors selected for the two source planes. It also limits mixing that if two
colors which supposed to make the displayed color are too far from each
other, the image will noticably flicker, and will be tiring for the eye to
look at it (Mixing black and white would result in 25Hz or 30Hz pratical
update rate what is simply miserable). There are several combinations though
which are near to each other, so the flickering coming from the small
difference won't be noticeable (Like white and bright green or yellow).
An additional feature can be overlays of sprites. This means that on each of
the two layers, some sprites may be laid in addition to gain more color.
ISH stands for interpolated Sprite Hires
This mode has a single HiRes image as bg. layer, and only sprites laid over
are interpolating. The reason is to conserve memory (smaller images), for
example if text is used among the images.
IMC is interpolated MultiColour
Similar concept to IHR, 160x200 max size (2 pixel wide limits apply, not
tricking), one of the selectable colors is fixed to be the same for both
images (however usually all should be the same conserving the 1Kb additional
color memory what would otherwise be necessary). Sprite overlay is of
stretched HiRes sprites.
For dithering between the two frames (so looking at from far even a single
frame may give the picture) the coloring of the two frames should be the same
as far as possible.
If it is necessary to stuff everything in one VIC block, 1Kb of image data
has to be sacrified for coloring. This costs four character lines of graphics.
Text file representing an interpolated HiRes image
Header: "IHR".
Next line: X dimension in character blocks (real X / 8)
Next line: Y dimension in char. blocks (real Y / 8)
Next line: no. of sprites overlaid in Plane 1 (0 - 8)
Next line: no. of sprites overlaid in Plane 2 (0 - 8)
Next: Plane1 description:
Hexadecimal (0 - F) values of colors for 1 / 0 bits, one line in each text
line. First comes the color for the 1 bits, next the color for 0 bits.
After the image description comes as 0 / 1 characters, one line in each
text line.
Next: Plane2 description the same way.
Next: Sprite planes in order (first all sprite layers for Plane 1, next for
Plane 2)
First line: sprite color (1 pixels, 0 are transparent; reverts to background)
Next lines: the bitmap of the sprite layer.
New line may be either character 13 or 10; any number of new lines may be
present between image description parts seperated by new lines.
Numbering of colors go like on an original C64.
Note that the bitmaps of the planes are linear unlike the real C64.
Example:
IHR
3
2
0
1
EDEFEF
9DAFEF
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
CEEDDE
A9AEEA
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
3
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
011101010000111101011000
111101010001011011011100
011111100000111100111000
001111000011111111111110
000111000111111111111111
001010101011111111011011
011110111101101101111111
111111111101111101111110
(Note: this does not code any image, i just randomly typed in some 1 and 0 as
image data)
Text file representing an interpolated MultiColor image
Header: "IMC".
Next line: X dimension in character blocks (real X / 8)
Next line: Y dimension in char. blocks (real Y / 8)
Next line: no. of sprites overlaid in Plane 1 (0 - 8)
Next line: no. of sprites overlaid in Plane 2 (0 - 8)
Next: Plane1 description:
First in a single line comes the background (0) color (0 - F)
Then hexadecimal values come for 3/2/1 pixels, one line in each text line.
First cmes for 3, then 2, finally for 1.
After image desc. comes as 0/1/2/3 chars, one line in each text line.
Next: Plane2 description the same way.
Next: Sprite planes in order (first all sprite layers for Plane 1, next for
Plane 2)
First line: sprite color (1 pixels, 0 are transparent; reverts to background)
Next lines: the bitmap of the sprite layer.
(Use either X expanded Hi-Res sprites or MC sprites on the real thing)
New line may be either character 13 or 10; any number of new lines may be
present between image description parts seperated by new lines.
Numbering of colors go like on an original C64.
Note that the bitmaps of the planes are linear unlike the real C64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment