
===>>> This is the original data:
playf0  .byte $00   ;and here are the graphics for each block. My programme
        .byte $00   ;draws 24 blocks each is 8 scan lines high. 24*8=192 
        .byte $00   ;so by changing the values for LDY and LDX up in the
        .byte $00   ;draw routine you can alter your vertical resolution for
        .byte $00   ;your playfield graphics. Just make sure that both values
        .byte $00   ;multiply together to make 192. This will let you draw
        .byte $00   ;1*192=192 
        .byte $00   ;2*96 =192
        .byte $00   ;4*48 =192
        .byte $00   ;6*32 =192 
        .byte $00   ;8*24 =192 (also makes nice square blocks!) 
        .byte $20   ;16*12=192
        .byte $20   ;32*6 =192 (okay, we're getting rediculous)
        .byte $70   ;64*3 =192
        .byte $f0   ;96*2 =192
        .byte $f0   ;192*1=192
        .byte $f0   ;
        .byte $e0   ;Anyways... also note that the graphics data here
        .byte $e0   ;is stored upsidedown. Trust me, it's much easier
        .byte $c0   ;to load it this way.
        .byte $80   ;
        .byte $00   ;Using this kind of drawing routine would make it easy
        .byte $00   ;to create a playfield graphics editor that will auto
        .byte $00   ;generate the playfield data in a text file. Then you
playf1  .byte $00   ;can just cut and paste the data into your source code.
        .byte $00   ;But I honestly don't know how well my playfield drawing
        .byte $00   ;routine can be adapted to work in a game. Maybe our
        .byte $00   ;resident "2600 Gods" Nick Bensema or Bob Colbert can
        .byte $00   ;offer some criticism.
        .byte $00   ;
        .byte $00   ;Well that's about all I've got to say on the subject.
        .byte $00   ;It was actually a lot of fun figuring this stuff out
        .byte $00   ;and now that I've actually written my own code to draw
        .byte $00   ;a screen, the 2600 is a lot less scary now.
        .byte $10   ;But don't expect a game from me anytime soon. What i've
        .byte $10   ;just done now is the equivalent of a 
        .byte $11   ;10 PRINT "HELLO"
        .byte $3b   ;20 GOTO 10
        .byte $7b   ;basic programme. It's simple and probably silly, and no
        .byte $ff   ;doubt the real programmers will look at it and laugh at
        .byte $ff   ;me and say something like. "Feh! I could have done that
        .byte $ff   ;whole thing with three lines of code!"
        .byte $ff   ;But hey, we've all got to start somewhere.
        .byte $ff   ;Anyways, feel free to muck about with this and draw your
        .byte $ff   ;own playfield pictures by editing the data. Maybe we
        .byte $ff   ;could have an informal "2600 playfield graphics art
        .byte $7c   ;contest."
        .byte $30   ;
playf2  .byte $00   ;incidently... if you don't know what this is supposed
        .byte $00   ;to be a picture of, try singing "Nanana nanana Nanana
        .byte $80   ;nanana" over and over while looking at the picture.
        .byte $80   ; 
        .byte $c0   ;
        .byte $c0   ;                       CRACKERS
        .byte $c0   ;           (Baby's first code from hell!!!!!!)
        .byte $e2   ;
        .byte $e2   ;
        .byte $f2   ;
        .byte $fa   ;
        .byte $ff   ;
        .byte $1f   ;
        .byte $5f   ;
        .byte $5f   ;
        .byte $9f   ;
        .byte $df   ;
        .byte $cf   ;
        .byte $af   ;
        .byte $93   ;
        .byte $71   ;
        .byte $38   ;
        .byte $0c   ;This code is PUBLIC DOMAIN.
        .byte $04   ;By Chris "Crackers" Cracknell, March 8, 1997

===>>> Bytes translation table:
0000 = ____ = $0
0001 = ___X = $1
0010 = __X_ = $2
0011 = __XX = $3
0100 = _X__ = $4
0101 = _X_X = $5
0110 = _XX_ = $6
0111 = _XXX = $7
1000 = X___ = $8
1001 = X__X = $9
1010 = X_X_ = $a
1011 = X_XX = $b
1100 = XX__ = $c
1101 = XX_X = $d
1110 = XXX_ = $e
1111 = XXXX = $f

===>>> 1st. drawing translation of byte code:
			playf0 playf1 playf2 
	.byte $00 00 00 ________ ________ ________;
        .byte $00 00 00 ________ ________ ________;
        .byte $00 00 80 ________ ________ X_______;
        .byte $00 00 80 ________ ________ X_______;
        .byte $00 00 c0 ________ ________ XX______;
        .byte $00 00 c0 ________ ________ XX______;
        .byte $00 00 c0 ________ ________ XX______; 
        .byte $00 00 e2 ________ ________ XXX___X_;
        .byte $00 00 e2 ________ ________ XXX___X_;
        .byte $00 00 f2 ________ ________ XXXX__X_; 
        .byte $00 10 fa ________ ___X____ XXXXX_X_;
        .byte $20 10 ff __X_____ ___X____ XXXXXXXX;
        .byte $20 11 1f __X_____ ___X___X ___XXXXX;
        .byte $70 3b 5f _XXX____ __XXX_XX _X_XXXXX;
        .byte $f0 7b 5f XXXX____ _XXXX_XX _X_XXXXX;
        .byte $f0 ff 9f XXXX____ XXXXXXXX X__XXXXX;
        .byte $f0 ff df XXXX____ XXXXXXXX XX_XXXXX;
        .byte $e0 ff cf XXX_____ XXXXXXXX XX__XXXX;
        .byte $e0 ff af XXX_____ XXXXXXXX X_X_XXXX;
        .byte $c0 ff 93 XX______ XXXXXXXX X__X__XX;
        .byte $80 ff 71 X_______ XXXXXXXX _XXX___X;
        .byte $00 ff 38 ________ XXXXXXXX __XXX___;
        .byte $00 7c 0c ________ _XXXXX__ ____XX__;
        .byte $00 30 04 ________ __XX____ _____X__;

===>>> Still looks messy...
       Now I have taken a scissor, rearranged the pieces (upside down), until
       I got the right picture (half side!).
       
===>>> Let do this step by step:
       look at this. It's now playf2 playf1 playf0; byte values not updated!
        .byte $00 00 00 ________ ________ ________;
        .byte $00 00 00 ________ ________ ________;
        .byte $00 00 80 X_______ ________ ________;
        .byte $00 00 80 X_______ ________ ________;
        .byte $00 00 c0 XX______ ________ ________;
        .byte $00 00 c0 XX______ ________ ________;
        .byte $00 00 c0 XX______ ________ ________;
        .byte $00 00 e2 XXX___X_ ________ ________;
        .byte $00 00 e2 XXX___X_ ________ ________;
        .byte $00 00 f2 XXXX__X_ ________ ________;
        .byte $00 10 fa XXXXX_X_ ___X____ ________;
        .byte $20 10 ff XXXXXXXX ___X____ __X_____;
        .byte $20 11 1f ___XXXXX ___X___X __X_____;
        .byte $70 3b 5f _X_XXXXX __XXX_XX _XXX____;
        .byte $f0 7b 5f _X_XXXXX _XXXX_XX XXXX____;
        .byte $f0 ff 9f X__XXXXX XXXXXXXX XXXX____;
        .byte $f0 ff df XX_XXXXX XXXXXXXX XXXX____;
        .byte $e0 ff cf XX__XXXX XXXXXXXX XXX_____;
        .byte $e0 ff af X_X_XXXX XXXXXXXX XXX_____;
        .byte $c0 ff 93 X__X__XX XXXXXXXX XX______;
        .byte $80 ff 71 _XXX___X XXXXXXXX X_______;
        .byte $00 ff 38 __XXX___ XXXXXXXX ________;
        .byte $00 7c 0c ____XX__ _XXXXX__ ________;
        .byte $00 30 04 _____X__ __XX____ ________;

===>>> Now rotate the whole drawing 180 degrees to turn it upside down:

I am not doing it here right now...
Now lets see, what we have to do, to draw a playfield grafik and convert them
to .byte data...

We need to have an editor with 24 chars/fields (3x8). X-ed field will result in
the appropiate bit set. Empty fields will result in a 0-bit.

        playf0		  playf1	    playf2
	_ _ _ _ _ _ _ _ | _ _ _ _ _ _ _ _ | _ _ _ _ _ _ _ _

The number of lines can vary between: 192 downto 1 lines, but only in these steps! 
                        |
                        v
        .byte $00   ;1*192=192 
        .byte $00   ;2*96 =192
        .byte $00   ;4*48 =192
        .byte $00   ;6*32 =192 
        .byte $00   ;8*24 =192 (also makes nice square blocks!) 
        .byte $00   ;16*12=192
        .byte $00   ;32*6 =192 (okay, we're getting rediculous)
        .byte $00   ;64*3 =192
        .byte $00   ;96*2 =192
        .byte $00   ;192*1=192

The numbers must be set correctly in the source code:
	...
        LDY  #$08          ;how many scanlines is each block?
        LDX  #$17          ;number of blocks of data = lines of drawing!
			    LDY * LDX = 192! = NTSC = #$17
		
load    LDA  playf0,X      ;load in the data for playfield 1
	...

The code generator must start with the bottom line upwards the first line.
Lets take line 4 as an example:
			playf0	 playf1	  playf2
Editorline:
        .byte $01 ff 8e _______X XXXXXXXX X___XXX_;

Now we must rotate the bits for each playfN byte by 8:
        .byte $80 ff 71 X_______ XXXXXXXX _XXX___X;

This is the complete generated code line:
        .byte $80 ff 71 X_______ XXXXXXXX _XXX___X;

Now the code generator must write first playf0, then playf1, last playf2 
Always last generated byte first up to first generated byte.

