;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; C O N F I G ;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    errorlevel    -302

    include "p12f683.inc"

 __config _MCLRE_OFF & _BOREN_OFF & _IESO_OFF & _FCMEN_OFF & _PWRTE_OFF & _CP_OFF & _CPD_OFF & _WDTE_OFF & _MCLRE_OFF & _BOREN_OFF & _FOSC_INTOSCIO

  
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;; C O N S T A N T S ;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#define TRUE		.1
#define	FALSE		.0

#define ECHO		GPIO, GP5
#define TRIGGER		GPIO, GP2

;SSD1306
#define DISP_SDA	GPIO, GP0;
#define DISP_SCL	GPIO, GP1;


;SSD1306
I2C_ADDR			equ 0x78	;bin 0111 1000
I2C_CTRL_BYTE_C		equ 0x00	;bin 0000 0000 control byte: cmd
I2C_CTRL_BYTE_D		equ 0x40	;bin 0100 0000 control byte: data

;128x32 size
SSD1306_COLS_NUM			equ .128
SSD1306_PAGES_NUM			equ .4

SSD1306_SETCONTRAST			equ 0x81
SSD1306_DISPLAYALLON_RESUME equ	0xA4
SSD1306_DISPLAYALLON 		equ 0xA5
SSD1306_NORMALDISPLAY 		equ 0xA6
SSD1306_INVERTDISPLAY 		equ 0xA7
SSD1306_DISPLAYOFF 			equ 0xAE
SSD1306_DISPLAYON 			equ 0xAF
SSD1306_SETDISPLAYOFFSET 	equ 0xD3
SSD1306_SETCOMPINS 			equ 0xDA
SSD1306_SETVCOMDETECT 		equ 0xDB
SSD1306_SETDISPLAYCLOCKDIV 	equ 0xD5
SSD1306_SETPRECHARGE 		equ 0xD9
SSD1306_SETMULTIPLEX 		equ 0xA8
SSD1306_SETLOWCOLUMN 		equ 0x00
SSD1306_SETHIGHCOLUMN 		equ 0x10
SSD1306_SETSTARTLINE 		equ 0x40
SSD1306_MEMORYMODE 			equ 0x20
SSD1306_COLUMNADDR 			equ 0x21
SSD1306_PAGEADDR   			equ 0x22
SSD1306_COMSCANINC 			equ 0xC0
SSD1306_COMSCANDEC 			equ 0xC8
SSD1306_SEGREMAP 			equ 0xA0
SSD1306_CHARGEPUMP 			equ 0x8D
SSD1306_EXTERNALVCC 		equ 0x01
SSD1306_SWITCHCAPVCC 		equ 0x02
SSD1306_DEACTIVATE_SCROLL 	equ 0x2E

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; V A R I A B L E S ;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    cblock 0x20
		del1			;registry na countery pro 1s delay
		del2
		del3
		w_temp
		status_temp
	
		hiByte			;Pocitadlo centimetru 16bit
		loByte
	
		i
		j
		ssd1306_X
		ssd1306_X_max
		ssd1306_Y
		ssd1306_Y_max		
		
		i2c_byte
		i2c_tmp
		i2c_i
		
		dataPointer: .2
		tmp
		offset
		
		numSecs
		numMilis

		ones
		tens
		hundreds

    endc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; M A C R O S ;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

BANK0 macro
    bcf STATUS, RP0 ;Select memory bank 0
    endm
    
BANK1 macro
    bsf STATUS, RP0 ;Select memory bank 1
    endm    

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
	org 0x00
	goto MAIN
	
	org 0x04
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

INTERRUPT

	movwf w_temp 		;copy W to temp register, could be in either bank
	swapf STATUS,w 		;swap status to be saved into W
	movwf status_temp 	;save status to bank 0 register
	
	bcf PIR1, TMR1IF
	incfsz loByte, f
	goto intNext	
	incf hiByte, f
	goto intNext2
intNext	
	nop					;Abych mel konstantni dobu proceseni inkrementu
	nop
intNext2
	movlw .210
	movwf TMR1L
	movlw .255
	movwf TMR1H
	
skip
	swapf status_temp,w	;swap status_temp register into W, sets bank to original state
	movwf STATUS 		;move W into STATUS register
	swapf w_temp,f 		;swap w_temp
	swapf w_temp,w 		;swap w_temp into W	
	retfie

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; M A I N ;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MAIN

	BANK1
	movlw b'01100100'
	movwf OSCCON		;4MHZ internal

	movlw b'11001000'   ;Interni oscilator, prescaler 1:1 (PSA = 1)
	movwf OPTION_REG 

	clrf ANSEL 			;digital I/O
	
	;Inicializace vystupnich GPIO		
	movlw b'11100000'
	movwf TRISIO    	;Port GP5 je input echo pin
	BANK0
	clrf GPIO
	movlw 07h
	movwf CMCON0    	;Vypni komparator

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; M A I N   L O O P ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

		call ssd1306_init
		
		call ssd1306_clearDisplay

MAIN_LOOP			
		
		call InitTrigger
				
waitEcho	
		btfss ECHO
		goto waitEcho
		call InterruptOn
endEcho
		btfsc ECHO
		goto endEcho
		call InterruptOff

		call gfx_showBasedOnDistance
		
		movlw .2
		call waitMilis
		
		goto MAIN_LOOP

;cca 10us pulz
InitTrigger
		bsf TRIGGER
		goto $+1				
		goto $+1
		goto $+1
		bcf TRIGGER
		return

InterruptOn
		clrf loByte
		clrf hiByte

		movlw .217
		movwf TMR1L
		movlw .255
		movwf TMR1H

		BANK1
		bsf PIE1, TMR1IE	;Generuj interrupt pri roll-overu
		BANK0
		bsf INTCON, PEIE	;Peripheral interrupt pro Timer1
		bsf INTCON, GIE	    ;Povol vsechna preruseni
	
		movlw b'00000101'	;Prescaler 1:1, internal, Timer1 ON
		movwf T1CON			;Zapni Timer1
		return

InterruptOff
		movlw b'00000100'	;Prescaler 1:1, internal, Timer1 OFF
		movwf T1CON
		
		bcf INTCON, GIE	    ;Vypni vsechna preruseni
		bcf INTCON, PEIE	;Peripheral interrupt pro Timer1
		bcf PIE1, TMR1IE	;Generuj interrupt pri roll-overu
		return
	
; ******************************************************************
; ******************** SSD1306 I2C DISPLAY DRIVER ******************
; ******************************************************************		
ssd1306_init	
;{		
			call wait1s

			movlw SSD1306_DISPLAYOFF			;0xAE
			call i2c_sendCmd

			movlw SSD1306_SETDISPLAYCLOCKDIV 	;0xD5
			call i2c_sendCmd
			movlw 0x80				
			call i2c_sendCmd

			movlw SSD1306_SETMULTIPLEX			;0xA8
			call i2c_sendCmd
			movlw 0x1F		;128x32
			;movlw 0x3F		;128x64
			call i2c_sendCmd
			
			movlw SSD1306_SETDISPLAYOFFSET		;0xD3
			call i2c_sendCmd
			movlw 0x00
			call i2c_sendCmd

			movlw SSD1306_SETSTARTLINE			;0x40
			call i2c_sendCmd

			movlw SSD1306_CHARGEPUMP			;0x8D
			call i2c_sendCmd
			movlw 0x14
			call i2c_sendCmd

			movlw SSD1306_MEMORYMODE			;0x20
			call i2c_sendCmd
			movlw 0x00			;horizontal addressing
			call i2c_sendCmd
			
			movlw SSD1306_SEGREMAP | 0x01		;0xA1			
			call i2c_sendCmd		;rotate screen 180

			movlw SSD1306_COMSCANDEC			;0xC8
			call i2c_sendCmd

			movlw SSD1306_SETCOMPINS			;0xDA
			call i2c_sendCmd
			;movlw 0x12		;128x64		
			movlw 0x02		;128x32
			call i2c_sendCmd			

			movlw SSD1306_SETCONTRAST			;0x81
			call i2c_sendCmd
			movlw 0x8F
			call i2c_sendCmd

			movlw SSD1306_SETPRECHARGE			;0xD9
			call i2c_sendCmd
			movlw 0xF1
			call i2c_sendCmd

			movlw SSD1306_SETVCOMDETECT			;0xDB
			call i2c_sendCmd
			movlw 0x40
			call i2c_sendCmd

			movlw SSD1306_DISPLAYALLON_RESUME	;0xA4
			call i2c_sendCmd

			movlw SSD1306_NORMALDISPLAY			;0xA6
			call i2c_sendCmd

			movlw SSD1306_DEACTIVATE_SCROLL 	;0x2E
			call i2c_sendCmd

			movlw SSD1306_DISPLAYON				;0xAF
			call i2c_sendCmd

			call ssd1306_clearDisplay

			call ssd1306_setHome				;pos 0,0

			return
;}


;Zobraz happy <64,69>cm nebo normal emoticon (jina vzdalenost>
;Vstup: hiByte, loByte - vzdalenost v cm
gfx_showBasedOnDistance
;{
	
	;<256?
	movf hiByte, f
	btfss STATUS, Z
	goto gfx_showNormal
	
	;>64?
	movf loByte, w
	addlw .256 - .64   	;192
	btfss STATUS, C		;C = vetsi nez 64
	goto gfx_showNormal ;<64
		
	;<69
	movf loByte, w
	addlw .256 - .69	;187
	btfsc STATUS, C
	goto gfx_showNormal
		
	goto gfx_showHappy
			
;}


gfx_showHappy
;{
		;Happy
		movlw	.0	
		movwf	ssd1306_X
		movlw	.31
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		
		movwf	ssd1306_Y_max		
		movlw HIGH Table_happy
		movwf dataPointer+1
		movlw LOW Table_happy
		movwf dataPointer+0		
		call ssd1306_sprite		
		
		;3
		movlw	.32	
		movwf	ssd1306_X
		movlw	.63
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_3
		movwf dataPointer+1
		movlw LOW Table_3
		movwf dataPointer+0
		call ssd1306_sprite
		
		;8
		movlw	.63	
		movwf	ssd1306_X
		movlw	.95
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_8
		movwf dataPointer+1
		movlw LOW Table_8
		movwf dataPointer+0
		call ssd1306_sprite		
		
		;6
		movlw	.96	
		movwf	ssd1306_X
		movlw	.127
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_6
		movwf dataPointer+1
		movlw LOW Table_6
		movwf dataPointer+0
		call ssd1306_sprite
		
		return
;}

gfx_showNormal
;{
		;Happy
		movlw	.0	
		movwf	ssd1306_X
		movlw	.31
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		
		movwf ssd1306_Y_max		
		movlw HIGH Table_normal
		movwf dataPointer+1
		movlw LOW Table_normal
		movwf dataPointer+0		
		call ssd1306_sprite		
		
		;3
		movlw	.32	
		movwf	ssd1306_X
		movlw	.63
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_empty
		movwf dataPointer+1
		movlw LOW Table_empty
		movwf dataPointer+0
		call ssd1306_sprite
		
		;8
		movlw	.63	
		movwf	ssd1306_X
		movlw	.95
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_empty
		movwf dataPointer+1
		movlw LOW Table_empty
		movwf dataPointer+0
		call ssd1306_sprite		
		
		;6
		movlw	.96	
		movwf	ssd1306_X
		movlw	.127
		movwf 	ssd1306_X_max
		movlw	.0
		movwf	ssd1306_Y
		movlw	.3
		movwf	ssd1306_Y_max
				
		movlw HIGH Table_empty
		movwf dataPointer+1
		movlw LOW Table_empty
		movwf dataPointer+0
		call ssd1306_sprite
		
		return
;}


;Vykresli obdelnik grafickymi daty
;Vstup: dataPointer - ktera data
;Vstup: X, X_max, Y, Y_max - obdelnik, do ktereho se kresli
;Vstup: 128Bytes delka dat (32x32px)
ssd1306_sprite
;{
		call ssd1306_setXY

		call i2c_startCond
		call i2c_sendAddr

		movlw I2C_CTRL_BYTE_D
		call i2c_sendByte2

		movlw .128
		movwf i
looping call getNextByte

		call i2c_sendByte2
		
		decfsz i, f
		goto looping

		call i2c_stopCond
		
		return
;}		


getNextByte
;{
		call getNextByte2 	;To je patch kvuli strankovani
		clrf PCLATH
		incfsz dataPointer+0, f	;Inkrementuj pointer
		goto $+2
		incf dataPointer+1, f
		return 					;Vrat hodnotu (je stale ve W)

getNextByte2
		;Zde se pouze skoci na dvoubajtovou adresu v fontPointer
		movf dataPointer+1, w 	;Zkopiruj HI byte do PCLATHu
		movwf PCLATH
		movf dataPointer+0, w 	;Dej LO byte do PCL
		movwf PCL 				;Skoci na adresu, kam ukazuje fontPointer	
;}
ssd1306_setHome
;{
		movlw SSD1306_COLUMNADDR
		call i2c_sendCmd
		movlw 0x00						;X - pos 0
		call i2c_sendCmd
		movlw SSD1306_COLS_NUM-1		;X - pos max
		call i2c_sendCmd

		movlw SSD1306_PAGEADDR
		call i2c_sendCmd
		movlw 0x00						;Y - pos 0
		call i2c_sendCmd
		movlw SSD1306_PAGES_NUM-1		;Y - pos MAX
		call i2c_sendCmd
		return
;}

ssd1306_setXY
;{
		movlw SSD1306_COLUMNADDR
		call i2c_sendCmd
		movf ssd1306_X, w				
		call i2c_sendCmd
		movf ssd1306_X_max, w			;X - pos max
		call i2c_sendCmd

		movlw SSD1306_PAGEADDR
		call i2c_sendCmd
		movf ssd1306_Y, w
		call i2c_sendCmd
		movf ssd1306_Y_max, w			;Y - pos MAX
		call i2c_sendCmd
		return
;}


ssd1306_clearDisplay
;{
		call ssd1306_setHome

		call i2c_startCond

		call i2c_sendAddr

		movlw I2C_CTRL_BYTE_D
		call i2c_sendByte2

		movlw SSD1306_PAGES_NUM 
		movwf i

ssd1306_i	
		movlw SSD1306_COLS_NUM		
		movwf j

ssd1306_j	
		clrw

		call i2c_sendByte2
					
		decfsz j, f
		goto ssd1306_j
	
		decfsz i, f
		goto ssd1306_i

		call i2c_stopCond
		return
;}

i2c_startCond
;{		
		bsf DISP_SDA
		bsf DISP_SCL
		bcf DISP_SDA
		bcf DISP_SCL

		return
;}
				
; ***** OLED: I2C: SEND STOP CONDITION

i2c_stopCond
;{		
		bcf DISP_SDA
		bsf DISP_SCL
		bsf DISP_SDA
		return
;}

; ***** OLED: I2C: SEND ADDRESS
i2c_sendAddr
;{		
		movlw I2C_ADDR
		call i2c_sendByte2
		return
;}

; ***** OLED: I2C: SEND BYTE

i2c_sendCmd
;{		
		movwf i2c_byte

		call i2c_startCond

		call i2c_sendAddr

		movlw I2C_CTRL_BYTE_C				
		call i2c_sendByte2

		call i2c_sendByte

		call i2c_stopCond
		return					
;}


i2c_sendData
;{		
		movwf i2c_byte
		call i2c_startCond
		call i2c_sendAddr

		movlw I2C_CTRL_BYTE_D
		call i2c_sendByte2

		call i2c_sendByte
		call i2c_stopCond
		return		
;}




; ***** OLED: I2C: SEND
i2c_sendByte		
;{
					movf i2c_byte, w
i2c_sendByte2		movwf i2c_tmp

					movlw .8
					movwf i2c_i
		
i2c_cycle			btfss i2c_tmp, 7		
					goto i2c_bitNotSet
					bcf DISP_SCL ;Abych mel hrany co nejbliz u sebe
					bsf DISP_SDA		
					goto i2c_tested
i2c_bitNotSet 		bcf DISP_SCL
					bcf DISP_SDA	

i2c_tested			bsf DISP_SCL		                  

					rlf i2c_tmp, f
					decfsz i2c_i, f
					goto i2c_cycle

					;ACK BIT
					bcf DISP_SCL
					bcf DISP_SDA					
					bsf DISP_SCL
					bcf DISP_SCL
					return	



; **************************************************************************************
; **************  SSD1306 print rutiny *********************************
; **************************************************************************************



	
;*************************************************************
; ***************** C E K A C I   S M Y C K Y ****************
;*************************************************************

Wait1s		;999990 cycles
	movlw	0x07
	movwf	del1
	movlw	0x2F
	movwf	del2
	movlw	0x03
	movwf	del3
wait1_0
	decfsz	del1, f
	goto	$+2
	decfsz	del2, f
	goto	$+2
	decfsz	del3, f
	goto	wait1_0			
	goto	$+1		;6 cycles
	goto	$+1
	goto	$+1
	return	;4 cycles (including call)


; *** SUBRUTINA, CEKEJ nuMilis milisekund ***************************

waitSecs
		movwf numSecs
waitS	call wait1s
		decfsz numSecs, f
		goto waitS
		return

waitMilis
		movwf numMilis
waitM	call wait1ms
		decfsz numMilis, f
		goto waitM
		return


; Delay = 0.001 seconds
; Clock frequency = 4 MHz

; Actual delay = 0.001 seconds = 1000 cycles
; Error = 0 %

wait1ms
			;993 cycles
	movlw	0xC6
	movwf	del1
	movlw	0x01
	movwf	del2
wait1ms_0
	decfsz	del1, f
	goto	$+2
	decfsz	del2, f
	goto	wait1ms_0

			;3 cycles
	goto	$+1
	nop

			;4 cycles (including call)
	return	

; Delay = 1 seconds
; Clock frequency = 4 MHz

; Actual delay = 1 seconds = 1000000 cycles
; Error = 0 %

wait1s
			;999990 cycles
	movlw	0x07
	movwf	del1
	movlw	0x2F
	movwf	del2
	movlw	0x03
	movwf	del3
wait1s_0
	decfsz	del1, f
	goto	$+2
	decfsz	del2, f
	goto	$+2
	decfsz	del3, f
	goto	wait1s_0

			;6 cycles
	goto	$+1
	goto	$+1
	goto	$+1

			;4 cycles (including call)
	return


; *****************************************************************	
; ********************** G F X    D A T A *************************
; *****************************************************************
					org 0x0200
					
Table_happy

	dt 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0C, 0x0E, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03
	dt 0x03, 0x03, 0x03, 0x03, 0x06, 0x06, 0x0E, 0x0C, 0x1C, 0x38, 0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00 
	dt 0xF0, 0xFE, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, 0x00
	dt 0x00, 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0xFE, 0xF0 
	dt 0x0F, 0x7F, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x38, 0xF8, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xF8, 0x38, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x7F, 0x0F 
	dt 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x1C, 0x38, 0x30, 0x71, 0x61, 0x63, 0xC6, 0xC6, 0xC6, 0xC6
	dt 0xC6, 0xC6, 0xC6, 0xC6, 0x63, 0x61, 0x71, 0x30, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x01, 0x00, 0x00 

Table_normal

	dt 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0C, 0x0E, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03
	dt 0x03, 0x03, 0x03, 0x03, 0x06, 0x06, 0x0E, 0x0C, 0x1C, 0x38, 0x70, 0xE0, 0xC0, 0x80, 0x00, 0x00 
	dt 0xF0, 0xFE, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, 0x00
	dt 0x00, 0x00, 0x3C, 0x7E, 0x7E, 0x7E, 0x7E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0xFE, 0xF0 
	dt 0x0F, 0x7F, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30
	dt 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x7F, 0x0F 
	dt 0x00, 0x00, 0x01, 0x03, 0x07, 0x0E, 0x1C, 0x38, 0x30, 0x70, 0x60, 0x60, 0xC0, 0xC0, 0xC0, 0xC0
	dt 0xC0, 0xC0, 0xC0, 0xC0, 0x60, 0x60, 0x70, 0x30, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x01, 0x00, 0x00 

Table_3

	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x78, 0x78, 0x3C, 0x3C, 0x3C, 0x3C
	dt 0x3C, 0x7C, 0xFC, 0xFC, 0xF8, 0xF8, 0xF0, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0
	dt 0xE0, 0xE0, 0xF0, 0xFF, 0x7F, 0x7F, 0x3F, 0x1F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03
	dt 0x07, 0x07, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x1E, 0x1E, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C
	dt 0x3C, 0x3E, 0x3F, 0x1F, 0x1F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 

Table_8

	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xF0, 0xF8, 0xF8, 0xFC, 0x7C, 0x3C, 0x3C
	dt 0x3C, 0x3C, 0x7C, 0xFC, 0xF8, 0xF8, 0xF0, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0xFF, 0xF8, 0xF0, 0xE0
	dt 0xE0, 0xF0, 0xF8, 0xFF, 0xFF, 0x3F, 0x3F, 0x1F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFE, 0xFF, 0x1F, 0x07, 0x07, 0x03
	dt 0x03, 0x07, 0x0F, 0x1F, 0xFF, 0xFF, 0xFE, 0xFE, 0xFC, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0F, 0x1F, 0x1F, 0x3F, 0x3E, 0x3E, 0x3C, 0x3C
	dt 0x3C, 0x3C, 0x3E, 0x3E, 0x1F, 0x1F, 0x1F, 0x0F, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 

Table_6

	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xF8, 0xF8, 0x7C, 0x3C, 0x3C, 0x3C, 0x3C
	dt 0x3C, 0x3C, 0x78, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0
	dt 0xF0, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
	dt 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03
	dt 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0F, 0x1F, 0x1F, 0x3F, 0x3E, 0x3C, 0x3C, 0x3C, 0x3E, 0x3F
	dt 0x1F, 0x1F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

Table_empty

	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	dt 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

;*** KONEC SOUBORU ********************************************
	end