o If the 6-5 bit combination is 10, the color of the pixel immediately to the left of this pixel
is duplicated and then modified. The bit-combinations from planes 4 -1 are used to
replace the four "red" bits.
o If the 6-5 bit combination is 11, the color of the pixel immediately to the left of this pixel
is duplicated and then modified. The bit-combinations from planes 4 -1 are used to
replace the four "green" bits.
Using hold-and-modify mode, it is possible to get by with defining only one color register,
which is COLOR0, the color of the background. You treat the entire screen as a
modification of that original color, according to the scheme above.
Bit 11 of register BPLCON0 selects hold-and-modify mode. The following bits in BPLCON0
must be set for hold-and-modify mode to be active:
o Bit HOMOD, bit 11, is 1.
o Bit DBLPF, bit 10, is 0 (single-playfield mode specified).
o Bit HIRES, bit 15, is 0 (low-resolution mode specified).
o Bits BPU2, BPUI, and BPU0 - bits 14, 13, and 12, are 101 or 110 (five or six bit-planes
active).
The following example code generates a six-bit-plane display with hold-and-modify mode
turned on. All 32 color registers are loaded with black to prove that the colors are being
generated by hold-and-modify. The equates are the usual and are not repeated here.
; First, set up the control registers.
;
LEA CUSTOM,a0 ; Point a0 at custom chips
MOVE.W #$6A00,BPLCON0(a0) ; Six bit-planes, hold-and-modify mode
MOVE.W #0,BPLCON1(a0) ; Horizontal scroll = 0
MOVE.W #0,BPL1MOD(a0) ; Modulo for odd bit-planes = 0
MOVE.W #0,BPL2MOD(a0) ; Ditto for even bit-planes
MOVE.W #$0038,DDFSTRT(a0) ; Set data-fetch start
MOVE.W #$00D0,DDFSTOP(a0) ; Set data-fetch stop
MOVE.W #$2C81,DIWSTRT(a0) ; Set display window start
MOVE.W #$F4C1,DIWSTOP(a0) ; Set display window stop
;
;Set all color registers = black to prove that hold-and-modify mode is ;
;working
;
MOVE.W #32,d0 ; Initialize counter
LEA CUSTOM+COLOR00,a1 ; Point al at first color register
CREGLOOP:
MOVE.W #$0000,(a1)+ ; Write black to a color register
DBRA d0,CREGLOOP ; Decrement counter and loop till done
;
; Fill six bit-planes with an easily recognizable pattern.
;
; NOTE: This is just for example use. Normally these bit planes would
; need to be allocated from the system MEMF_CHIP memory pool.
;
- 82 Playfield Hardware -