changeset 102:b13ace8d052f

Scribble_15 at wakeup...
author JeanDo
date Mon, 13 Dec 2010 23:49:52 +0100
parents 526d2c016645
children
files code_part1/OSTC_code_asm_part1/MAIN.ASM code_part1/OSTC_code_asm_part1/color_processor.asm code_part1/OSTC_code_asm_part1/scribble_15.asm code_part1/OSTC_code_asm_part1/scribble_15.inc code_part1/OSTC_code_asm_part1/start.asm
diffstat 5 files changed, 496 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/MAIN.ASM	Tue Dec 14 08:59:44 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/MAIN.ASM	Mon Dec 13 23:49:52 2010 +0100
@@ -128,6 +128,9 @@
 	#include 	ostc_part3_wordprocessor_NEW_CURSOR_9A00_to_B960_jump_in_B410.txt	; Christians fonts...
   endif
 
+#include    color_processor.asm
+#include    scribble_15.asm
+
 ;=============================================================================
 p2_deco	code	0x0C000			; Mark segment name into the .map file
 #include	p2_deco_main_v110d.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/color_processor.asm	Mon Dec 13 23:49:52 2010 +0100
@@ -0,0 +1,173 @@
+;=============================================================================
+;
+;    File color_processor.asm
+;
+;    Decompress and draw an image.
+;
+;    This program is free software: you can redistribute it and/or modify
+;    it under the terms of the GNU General Public License as published by
+;    the Free Software Foundation, either version 3 of the License, or
+;    (at your option) any later version.
+;
+;    This program is distributed in the hope that it will be useful,
+;    but WITHOUT ANY WARRANTY; without even the implied warranty of
+;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;    GNU General Public License for more details.
+;
+;    You should have received a copy of the GNU General Public License
+;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;
+;    Copyright (c) 2010, JD Gascuel.
+;=============================================================================
+; HISTORY
+;  2010-12-13 : [jDG] Creation
+;
+; RATIONALS: The OSTC have a nice color screen, and a std geek attitude impose
+;            to show off ... ;-)
+;
+; Inputs: TBLPTR points to the image description block.
+;         win_top, win_leftx2 the Top/Leftx2 corner here to put the image.
+; Ouputs: None.
+; Trashed: TBLPTR, TABLAT, FSR2, PROD, aa_width, aa_height
+;
+; ImageBloc:
+;       db  widthx2, height
+;       db  nbColors, 0
+;       dw  color0, color1, color2, color3, ...
+;       db  ...packed pixels...
+;
+; Limitations:
+; * nbColors should be <= 15.
+; * image width should be even.
+; * image left border should be on even position too.
+;
+;Temporary overlay (in bank 0)
+img_width   equ aa_width
+img_height  equ aa_height
+img_top     equ win_top
+img_left    equ win_leftx2
+img_pixelsL equ aa_start+0
+img_pixelsH equ aa_start+1
+img_pixelsU equ aa_end+0
+img_countL  equ aa_end+1
+img_countH  equ aa_colorDiv+0
+img_colors  equ aa_colorDiv+1
+colorTable  equ letter
+
+;-----------------------------------------------------------------------------
+; Make an entry in the link map.
+color_processor code
+
+;-----------------------------------------------------------------------------
+color_image:
+        movlb   HIGH(img_width)
+
+        ;---- Get image parameters -------------------------------------------
+        tblrd*+                     
+        movff   TABLAT,img_width
+        tblrd*+
+        movff   TABLAT,img_height
+        tblrd*+
+        movff   TABLAT,img_colors
+        tblrd*+
+        ;---- Copy color table -----------------------------------------------
+        movf    img_colors,W
+        lfsr    FSR2,colorTable
+get_colors_loop:                    
+        tblrd*+
+        movff   TABLAT,POSTINC2
+        tblrd*+
+        movff   TABLAT,POSTINC2
+        decfsz  WREG
+        bra     get_colors_loop
+
+        ; Compute width * height * 2 : the number of pixels to write.
+        clrf    img_pixelsU
+        movf    img_width,W             ; Compute number of pixels to draw
+        mulwf   img_height              ; 0 .. 160x240
+        rlcf    PRODL                   ; x2 --> 0 .. 320x240, might by > 0xFFFF
+        rlcf    PRODH
+        movff   PRODL, img_pixelsL
+        movff   PRODH, img_pixelsH
+        rlcf    img_pixelsU             ; Get the upper bit in place.
+
+        ;---- Send window command --------------------------------------------
+        clrf    img_width+1             ; x2 on width, for the true box size.
+        rlcf    img_width+0
+        rlcf    img_width+1
+        call    aa_box_cmd
+        AA_CMD_WRITE 0x22
+
+        ;---- Decode pixels --------------------------------------------------
+color_image_loop_xy:
+        ; Get pixel count
+        clrf    img_countL
+        clrf    img_countH
+
+color_image_loop_count:
+        tblrd*+                         ; Get one byte
+
+        movlw   0x0F                    ; Get count bits
+        andwf   TABLAT,W
+        swapf   WREG                    ; On top-4 bits of W
+        rlcf    WREG                    ; Push topmost bit into img_count:2
+        rlcf    img_countL
+        rlcf    img_countH
+        rlcf    WREG                    ; Push topmost bit into img_count:2
+        rlcf    img_countL
+        rlcf    img_countH
+        rlcf    WREG                    ; Push topmost bit into img_count:2
+        rlcf    img_countL
+        rlcf    img_countH
+        rlcf    WREG                    ; Push topmost bit into img_count:2
+        rlcf    img_countL
+        rlcf    img_countH
+
+        movf    TABLAT,W                ; Does the color-bits mark a big-count ?
+        andlw   0xF0
+        xorlw   0xF0
+        bz      color_image_loop_count  ; YES: loop for more count bits.
+
+        ; Get pixel color into PROD
+        xorlw   0xF0                    ; Get back index.
+        swapf   WREG                    ; Get color index to lower bits.
+        addwf   WREG                    ; x2
+        addlw   LOW(letter)             ; 0x60 + 2 * .15 < 0x80.
+        movff   WREG,FSR2L
+        movff   POSTINC2,PRODL
+        movff   POSTINC2,PRODH
+        
+        ; Substract count-1 from the number of pixel we should do.
+        movf    img_countL,W            ; Make a 24bit substraction.
+        subwf   img_pixelsL,F
+        movf    img_countH,W
+        subwfb  img_pixelsH,F
+        movlw   0
+        subwfb  img_pixelsU,F
+
+        incf    img_countL              ; Get back the true count.
+        addwfc  img_countH
+
+        ; Loop sending pixel color
+        incf    img_countH              ; Because we decrement first, should add one here !
+color_image_loop_pixel:
+        AA_DATA_WRITE_PROD
+        decfsz  img_countL
+        bra     color_image_loop_pixel
+        decfsz  img_countH
+        bra     color_image_loop_pixel
+        
+        ; And count (on a 17bit counter)
+        clrf    WREG                    ; Make a 24bit decrement.
+        decf    img_pixelsL
+        subwfb  img_pixelsH,F
+        subwfb  img_pixelsU,F
+        
+        movf    img_pixelsL,W           ; Test if img_pixels == 0
+        iorwf   img_pixelsH,W
+        iorwf   img_pixelsU,W
+        bnz     color_image_loop_xy     ; NO: loop...
+
+        ;---- Closeup --------------------------------------------------------
+        AA_CMD_WRITE 0x00
+        return
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/scribble_15.asm	Mon Dec 13 23:49:52 2010 +0100
@@ -0,0 +1,42 @@
+;=============================================================================
+;
+;    File scribble_15.asm
+;
+;    HW logo in 320x240
+;
+;    This program is free software: you can redistribute it and/or modify
+;    it under the terms of the GNU General Public License as published by
+;    the Free Software Foundation, either version 3 of the License, or
+;    (at your option) any later version.
+;
+;    This program is distributed in the hope that it will be useful,
+;    but WITHOUT ANY WARRANTY; without even the implied warranty of
+;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;    GNU General Public License for more details.
+;
+;    You should have received a copy of the GNU General Public License
+;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;
+;    Copyright (c) 2010, JD Gascuel.
+;=============================================================================
+; HISTORY
+;  2010-12-13 : [jDG] Creation
+
+scribble_15 code
+#include scribble_15.inc
+
+scribble_15:
+    clrf    WREG
+    movff   WREG,win_top            ; Full 12 bits address.
+    movff   WREG,win_leftx2
+    movlw   LOW(scribble_15_block)
+    movwf   TBLPTRL
+    movlw   HIGH(scribble_15_block)
+    movwf   TBLPTRH
+    movlw   UPPER(scribble_15_block)
+    movwf   TBLPTRU
+    call    color_image
+
+    movlb   1                       ; Back to bank 1 !
+    return
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/code_part1/OSTC_code_asm_part1/scribble_15.inc	Mon Dec 13 23:49:52 2010 +0100
@@ -0,0 +1,276 @@
+scribble_15_width    equ 320
+scribble_15_height   equ 240
+scribble_15_block:
+    db  .160, .240
+    db  .6, 0
+    dw  0xffff
+    dw  0x20e3
+    dw  0x03f0
+    dw  0x4515
+    dw  0x14ba
+    dw  0x75bc
+;
+    DB  0xf2, 0xfc, 0xff, 0x00, 0x12, 0xfe, 0x0b, 0x14
+    DB  0xfe, 0x08, 0x17, 0xfe, 0x06, 0x19, 0xfe, 0x03
+    DB  0x1c, 0xfe, 0x01, 0x1e, 0xfd, 0x0e, 0xf1, 0x11
+    DB  0xfd, 0x0b, 0xf1, 0x13, 0xfd, 0x0a, 0xf1, 0x14
+    DB  0xfd, 0x08, 0xf1, 0x16, 0xfd, 0x07, 0xf1, 0x16
+    DB  0xfd, 0x06, 0xf1, 0x17, 0xfd, 0x05, 0xf1, 0x19
+    DB  0xfd, 0x04, 0xf1, 0x19, 0xfd, 0x04, 0xf1, 0x19
+    DB  0xfd, 0x03, 0xf1, 0x1b, 0xfd, 0x02, 0xf1, 0x1b
+    DB  0xfd, 0x01, 0xf1, 0x1c, 0xfd, 0x01, 0xf1, 0x1d
+    DB  0xfc, 0x0f, 0xf1, 0x1e, 0xfc, 0x0f, 0xf1, 0x1e
+    DB  0xfc, 0x0e, 0xf2, 0x10, 0xfc, 0x0c, 0xf1, 0x12
+    DB  0x40, 0x50, 0x1c, 0xfc, 0x0c, 0xf1, 0x12, 0x52
+    DB  0x1b, 0xf4, 0x0b, 0x10, 0xf7, 0x0e, 0xf1, 0x12
+    DB  0x40, 0x52, 0x1c, 0xf4, 0x0a, 0x12, 0xf7, 0x0c
+    DB  0xf1, 0x12, 0x40, 0x53, 0x1b, 0xf4, 0x0b, 0x12
+    DB  0xf7, 0x0a, 0xf1, 0x12, 0x40, 0x54, 0x1b, 0xf4
+    DB  0x0b, 0x13, 0xf7, 0x09, 0xf1, 0x12, 0x40, 0x54
+    DB  0x1c, 0xf4, 0x0a, 0x15, 0xf7, 0x06, 0xf1, 0x12
+    DB  0x41, 0x54, 0x1c, 0xf4, 0x0a, 0x16, 0xf7, 0x05
+    DB  0xf1, 0x12, 0x41, 0x55, 0x1b, 0xf4, 0x0b, 0x16
+    DB  0xf7, 0x03, 0xf1, 0x12, 0x41, 0x56, 0x1c, 0xf4
+    DB  0x0a, 0x18, 0xf7, 0x00, 0xf1, 0x13, 0x41, 0x56
+    DB  0x1c, 0xf4, 0x0a, 0x19, 0xf6, 0x0f, 0xf1, 0x12
+    DB  0x42, 0x57, 0x1b, 0xf4, 0x0b, 0x19, 0xf6, 0x0d
+    DB  0xf1, 0x13, 0x41, 0x58, 0x1c, 0xf4, 0x0a, 0x1b
+    DB  0xf6, 0x0a, 0xf1, 0x13, 0x42, 0x58, 0x1c, 0xf4
+    DB  0x0a, 0x1c, 0xf6, 0x09, 0xf1, 0x13, 0x42, 0x59
+    DB  0x1b, 0xf4, 0x0b, 0x1c, 0xf6, 0x07, 0xf1, 0x13
+    DB  0x43, 0x59, 0x1c, 0xf4, 0x0a, 0x1e, 0xf6, 0x04
+    DB  0xf1, 0x13, 0x44, 0x59, 0x1c, 0xf4, 0x0a, 0x1f
+    DB  0xf6, 0x03, 0xf1, 0x13, 0x43, 0x5b, 0x1b, 0xf4
+    DB  0x0b, 0x1f, 0xf6, 0x01, 0xf1, 0x13, 0x44, 0x5b
+    DB  0x1c, 0xf4, 0x0a, 0xf1, 0x11, 0xf5, 0x0e, 0xf1
+    DB  0x14, 0x44, 0x5b, 0x1c, 0xf4, 0x0a, 0xf1, 0x12
+    DB  0xf5, 0x0d, 0xf1, 0x13, 0x45, 0x5c, 0x1b, 0xf4
+    DB  0x0b, 0xf1, 0x12, 0xf5, 0x0b, 0xf1, 0x13, 0x45
+    DB  0x5d, 0x1c, 0xf4, 0x0a, 0xf1, 0x14, 0xf5, 0x08
+    DB  0xf1, 0x14, 0x45, 0x5d, 0x1c, 0xf4, 0x0a, 0xf1
+    DB  0x15, 0xf5, 0x06, 0xf1, 0x14, 0x46, 0x5e, 0x1b
+    DB  0xf4, 0x0b, 0xf1, 0x15, 0xf5, 0x05, 0xf1, 0x13
+    DB  0x47, 0x5e, 0x1c, 0xf4, 0x0a, 0xf1, 0x17, 0xf5
+    DB  0x02, 0xf1, 0x14, 0x47, 0x5e, 0x1c, 0xf4, 0x0a
+    DB  0x1c, 0x20, 0x1a, 0xf5, 0x00, 0xf1, 0x14, 0x47
+    DB  0xf1, 0x50, 0x1b, 0xf4, 0x0b, 0x1b, 0x21, 0x1a
+    DB  0xf4, 0x0e, 0xf1, 0x14, 0x48, 0xf1, 0x50, 0x1c
+    DB  0xf4, 0x0a, 0x1b, 0x23, 0x1a, 0xf4, 0x0b, 0xf1
+    DB  0x15, 0x48, 0xf1, 0x50, 0x1c, 0xf4, 0x0a, 0x1c
+    DB  0x23, 0x1a, 0xf4, 0x0a, 0xf1, 0x14, 0x49, 0xf1
+    DB  0x51, 0x1b, 0xf4, 0x0b, 0x1b, 0x24, 0x1a, 0xf4
+    DB  0x08, 0xf1, 0x14, 0x4a, 0xf1, 0x51, 0x1c, 0xf4
+    DB  0x0a, 0x1b, 0x26, 0x1a, 0xf4, 0x05, 0xf1, 0x14
+    DB  0x4a, 0xf1, 0x53, 0x1b, 0xf4, 0x0b, 0x1b, 0x26
+    DB  0x1a, 0xf4, 0x03, 0xf1, 0x15, 0x4a, 0xf1, 0x53
+    DB  0x1b, 0xf4, 0x0b, 0x1b, 0x27, 0x1b, 0xf4, 0x00
+    DB  0xf1, 0x15, 0x4b, 0xf1, 0x53, 0x1c, 0xf4, 0x0a
+    DB  0x1c, 0x28, 0x1a, 0xf3, 0x0e, 0xf1, 0x15, 0x4c
+    DB  0xf1, 0x54, 0x1b, 0xf4, 0x0b, 0x1b, 0x29, 0x1a
+    DB  0xf3, 0x0c, 0xf1, 0x15, 0x4d, 0xf1, 0x54, 0x1b
+    DB  0xf4, 0x0b, 0x1b, 0x2b, 0x1a, 0xf3, 0x09, 0xf1
+    DB  0x16, 0x4d, 0xf1, 0x54, 0x1c, 0xf4, 0x0b, 0x1b
+    DB  0x2b, 0x1a, 0xf3, 0x07, 0xf1, 0x16, 0x4d, 0xf1
+    DB  0x56, 0x1b, 0xf4, 0x0b, 0x1b, 0x2c, 0x1b, 0xf3
+    DB  0x04, 0xf1, 0x16, 0x4e, 0xf1, 0x56, 0x1b, 0xf4
+    DB  0x0b, 0x1c, 0x2d, 0x1a, 0xf3, 0x02, 0xf1, 0x16
+    DB  0x4f, 0xf1, 0x56, 0x1c, 0xf4, 0x0b, 0x1b, 0x2e
+    DB  0x1a, 0xf3, 0x00, 0xf1, 0x16, 0xf1, 0x40, 0xf1
+    DB  0x57, 0x1b, 0xf4, 0x0b, 0x1b, 0xf1, 0x20, 0x1a
+    DB  0xf2, 0x0d, 0xf1, 0x16, 0xf1, 0x41, 0xf1, 0x57
+    DB  0x1c, 0xf4, 0x0b, 0x1b, 0xf1, 0x20, 0x1a, 0xf2
+    DB  0x0b, 0xf1, 0x16, 0xf1, 0x42, 0xf1, 0x58, 0x1b
+    DB  0xf4, 0x0b, 0x1b, 0xf1, 0x21, 0x1b, 0xf2, 0x08
+    DB  0xf1, 0x16, 0xf1, 0x42, 0xf1, 0x59, 0x1b, 0xf4
+    DB  0x0c, 0x1b, 0xf1, 0x22, 0x1a, 0xf2, 0x05, 0xf1
+    DB  0x17, 0xf1, 0x43, 0xf1, 0x59, 0x1c, 0xf4, 0x0b
+    DB  0x1b, 0xf1, 0x23, 0x1b, 0xf2, 0x02, 0xf1, 0x18
+    DB  0xf1, 0x43, 0xf1, 0x5a, 0x1b, 0xf4, 0x0c, 0x1b
+    DB  0xf1, 0x24, 0x1a, 0xf2, 0x00, 0xf1, 0x18, 0xf1
+    DB  0x44, 0xf1, 0x5a, 0x1b, 0xf4, 0x0c, 0x1b, 0xf1
+    DB  0x25, 0x1b, 0xf1, 0x0d, 0xf1, 0x18, 0xf1, 0x45
+    DB  0xf1, 0x5b, 0x1b, 0xf4, 0x0c, 0x1b, 0xf1, 0x26
+    DB  0x1a, 0xf1, 0x0a, 0xf1, 0x18, 0xf1, 0x47, 0xf1
+    DB  0x5b, 0x1b, 0xf4, 0x0c, 0x1b, 0xf1, 0x27, 0x1b
+    DB  0xf1, 0x07, 0xf1, 0x18, 0xf1, 0x48, 0xf1, 0x5b
+    DB  0x1c, 0xf4, 0x0c, 0x1a, 0xf1, 0x28, 0x1b, 0xf1
+    DB  0x05, 0xf1, 0x18, 0xf1, 0x49, 0xf1, 0x5c, 0x1b
+    DB  0xf4, 0x0c, 0x1b, 0xf1, 0x29, 0x1b, 0xf1, 0x01
+    DB  0xf1, 0x19, 0xf1, 0x4a, 0xf1, 0x5c, 0x1b, 0xf4
+    DB  0x0d, 0x1a, 0xf1, 0x2a, 0x1b, 0x0f, 0xf1, 0x19
+    DB  0xf1, 0x4a, 0xf1, 0x5e, 0x1b, 0xf4, 0x0c, 0x1b
+    DB  0xf1, 0x2b, 0x1b, 0x0b, 0xf1, 0x1a, 0xf1, 0x4b
+    DB  0xf1, 0x5e, 0x1b, 0xf4, 0x0d, 0x1a, 0xf1, 0x2c
+    DB  0x1b, 0x09, 0xf1, 0x1a, 0xf1, 0x4c, 0xf1, 0x5e
+    DB  0x1c, 0xf4, 0x0c, 0x1b, 0xf1, 0x2d, 0x1b, 0x05
+    DB  0xf1, 0x1a, 0xf1, 0x4e, 0xf1, 0x5f, 0x1b, 0xf4
+    DB  0x0d, 0x1b, 0xf1, 0x2d, 0x1b, 0x03, 0xf1, 0x1a
+    DB  0xf1, 0x4f, 0xf1, 0x5f, 0x1b, 0xf4, 0x0e, 0x1a
+    DB  0xf1, 0x2f, 0xf2, 0x17, 0xf2, 0x40, 0xf2, 0x50
+    DB  0x1b, 0xf4, 0x0d, 0x1b, 0xf1, 0x2f, 0xf2, 0x15
+    DB  0xf2, 0x41, 0xf2, 0x50, 0x1b, 0xf4, 0x0e, 0x1a
+    DB  0xf2, 0x21, 0xf2, 0x11, 0xf2, 0x43, 0xf2, 0x51
+    DB  0x1b, 0xf4, 0x0d, 0x1b, 0xf2, 0x21, 0xf1, 0x1f
+    DB  0xf2, 0x44, 0xf2, 0x51, 0x1b, 0xf4, 0x0e, 0x1a
+    DB  0xf2, 0x23, 0xf1, 0x1b, 0xf2, 0x46, 0xf2, 0x51
+    DB  0x1b, 0xf4, 0x0e, 0x1b, 0xf2, 0x23, 0xf1, 0x19
+    DB  0xf2, 0x46, 0xf2, 0x53, 0x1b, 0xf4, 0x0e, 0x1a
+    DB  0xf2, 0x25, 0xf1, 0x16, 0xf2, 0x47, 0xf2, 0x53
+    DB  0x1b, 0xf4, 0x0f, 0x1a, 0xf2, 0x26, 0xf1, 0x12
+    DB  0xf2, 0x49, 0xf2, 0x54, 0x1b, 0xf4, 0x0e, 0x1a
+    DB  0xf2, 0x27, 0xf1, 0x10, 0xf2, 0x4a, 0xf2, 0x54
+    DB  0x1b, 0xf4, 0x0f, 0x1a, 0xf2, 0x28, 0x1c, 0xf2
+    DB  0x4c, 0xf2, 0x55, 0x1b, 0xf4, 0x0e, 0x1b, 0xf2
+    DB  0x28, 0x19, 0xf2, 0x4e, 0xf2, 0x55, 0x1b, 0xf4
+    DB  0x0f, 0x1a, 0xf2, 0x2a, 0x16, 0xf2, 0x4f, 0xf2
+    DB  0x56, 0x1b, 0xf4, 0x0f, 0x1a, 0xf2, 0x2a, 0x13
+    DB  0xf3, 0x41, 0xf2, 0x56, 0x1b, 0xf4, 0x0f, 0x1a
+    DB  0xf2, 0x2c, 0xf3, 0x43, 0xf2, 0x57, 0x1a, 0xf5
+    DB  0x00, 0x1a, 0xf2, 0x2d, 0xf3, 0x41, 0xf2, 0x57
+    DB  0x1b, 0xf4, 0x0f, 0x1b, 0xf2, 0x2d, 0xf3, 0x40
+    DB  0xf2, 0x58, 0x1a, 0xf5, 0x00, 0x1a, 0xf2, 0x2f
+    DB  0xf2, 0x4e, 0xf2, 0x58, 0x1b, 0xf5, 0x00, 0x1a
+    DB  0xf2, 0x2f, 0xf2, 0x4d, 0xf2, 0x59, 0x1a, 0xf5
+    DB  0x00, 0x1b, 0xf3, 0x20, 0xf2, 0x4b, 0xf2, 0x59
+    DB  0x1b, 0xf5, 0x00, 0x1a, 0xf3, 0x22, 0xf2, 0x49
+    DB  0xf2, 0x59, 0x1b, 0xf5, 0x01, 0x1a, 0xf3, 0x22
+    DB  0xf2, 0x48, 0xf2, 0x5a, 0x1b, 0xf5, 0x00, 0x1a
+    DB  0xf3, 0x24, 0xf2, 0x46, 0xf2, 0x5a, 0x1b, 0xf5
+    DB  0x01, 0x1a, 0xf3, 0x25, 0xf2, 0x44, 0xf2, 0x5b
+    DB  0x1b, 0xf5, 0x01, 0x1a, 0xf3, 0x25, 0xf2, 0x43
+    DB  0xf2, 0x5c, 0x1a, 0xf5, 0x01, 0x1a, 0xf3, 0x27
+    DB  0xf2, 0x41, 0xf2, 0x5c, 0x1b, 0xf5, 0x01, 0x1a
+    DB  0xf3, 0x28, 0xf1, 0x4f, 0xf2, 0x5d, 0x1a, 0xf5
+    DB  0x02, 0x1a, 0xf3, 0x28, 0xf1, 0x4e, 0xf2, 0x5d
+    DB  0x1b, 0xf5, 0x01, 0x1a, 0xf3, 0x2a, 0xf1, 0x4c
+    DB  0xf2, 0x5e, 0x1a, 0xf5, 0x02, 0x1a, 0xf3, 0x2b
+    DB  0xf1, 0x4a, 0xf2, 0x5e, 0x1b, 0xf5, 0x02, 0x1a
+    DB  0xf3, 0x2b, 0xf1, 0x49, 0xf2, 0x5f, 0x1a, 0xf5
+    DB  0x03, 0x1a, 0xf3, 0x2c, 0xf1, 0x47, 0xf2, 0x5f
+    DB  0x1b, 0xf5, 0x02, 0x1a, 0xf3, 0x2e, 0xf1, 0x45
+    DB  0xf3, 0x50, 0x1a, 0xf5, 0x03, 0x1a, 0xf3, 0x2f
+    DB  0xf1, 0x43, 0xf3, 0x50, 0x1b, 0xf5, 0x03, 0x1a
+    DB  0xf3, 0x2f, 0xf1, 0x42, 0xf3, 0x51, 0x1a, 0xf5
+    DB  0x03, 0x1a, 0xf4, 0x21, 0xf1, 0x40, 0xf3, 0x51
+    DB  0x1b, 0xf5, 0x03, 0x1a, 0xf4, 0x22, 0x4e, 0xf3
+    DB  0x52, 0x1a, 0xf5, 0x04, 0x1a, 0xf4, 0x23, 0x4c
+    DB  0xf3, 0x52, 0x1b, 0xf5, 0x04, 0x1a, 0xf4, 0x24
+    DB  0x4a, 0xf3, 0x53, 0x1a, 0xf5, 0x04, 0x1a, 0xf4
+    DB  0x25, 0x49, 0xf3, 0x53, 0x1b, 0xf5, 0x04, 0x1a
+    DB  0xf4, 0x26, 0x47, 0xf3, 0x54, 0x1a, 0xf5, 0x05
+    DB  0x1a, 0xf4, 0x27, 0x45, 0xf3, 0x55, 0x1a, 0xf5
+    DB  0x05, 0x19, 0xf4, 0x29, 0x43, 0xf3, 0x55, 0x1b
+    DB  0xf5, 0x04, 0x1a, 0xf4, 0x2a, 0x41, 0xf3, 0x56
+    DB  0x1a, 0xf5, 0x05, 0x1a, 0xf4, 0x2a, 0x40, 0xf3
+    DB  0x56, 0x1b, 0xf5, 0x05, 0x1a, 0xf4, 0x2a, 0x30
+    DB  0xf3, 0x56, 0x1a, 0xf5, 0x06, 0x1a, 0xf4, 0x29
+    DB  0x32, 0xf3, 0x54, 0x1b, 0xf5, 0x06, 0x19, 0xf4
+    DB  0x29, 0x34, 0xf3, 0x53, 0x1a, 0xf5, 0x06, 0x1a
+    DB  0xf4, 0x28, 0x36, 0xf3, 0x52, 0x1a, 0xf5, 0x06
+    DB  0x1a, 0xf4, 0x27, 0x38, 0xf3, 0x50, 0x1b, 0xf5
+    DB  0x06, 0x1a, 0xf4, 0x26, 0x3a, 0xf2, 0x5f, 0x1a
+    DB  0xf5, 0x07, 0x19, 0xf4, 0x26, 0x3c, 0xf2, 0x5d
+    DB  0x1b, 0xf5, 0x07, 0x19, 0xf4, 0x25, 0x3d, 0xf2
+    DB  0x5d, 0x1a, 0xf5, 0x07, 0x1a, 0xf4, 0x24, 0x3f
+    DB  0xf2, 0x5b, 0x1b, 0xf5, 0x07, 0x1a, 0xf4, 0x23
+    DB  0xf1, 0x31, 0xf2, 0x5a, 0x1a, 0xf5, 0x08, 0x1a
+    DB  0xf4, 0x22, 0xf1, 0x33, 0xf2, 0x59, 0x1a, 0xf5
+    DB  0x08, 0x19, 0xf4, 0x22, 0xf1, 0x35, 0xf2, 0x57
+    DB  0x1b, 0xf5, 0x08, 0x19, 0xf4, 0x21, 0xf1, 0x37
+    DB  0xf2, 0x56, 0x1a, 0xf5, 0x08, 0x1a, 0xf4, 0x20
+    DB  0xf1, 0x39, 0xf2, 0x54, 0x1b, 0xf5, 0x08, 0x1a
+    DB  0xf3, 0x2f, 0xf1, 0x3b, 0xf2, 0x53, 0x1a, 0xf5
+    DB  0x09, 0x1a, 0xf3, 0x2e, 0xf1, 0x3d, 0xf2, 0x52
+    DB  0x1a, 0xf5, 0x09, 0x1a, 0xf3, 0x2e, 0xf1, 0x3e
+    DB  0xf2, 0x50, 0x1a, 0xf5, 0x0a, 0x19, 0xf3, 0x2e
+    DB  0xf2, 0x30, 0xf1, 0x5f, 0x1a, 0xf5, 0x0a, 0x19
+    DB  0xf3, 0x2d, 0xf2, 0x32, 0xf1, 0x5d, 0x1b, 0xf5
+    DB  0x0a, 0x19, 0xf3, 0x2c, 0xf2, 0x35, 0xf1, 0x5b
+    DB  0x1a, 0xf5, 0x0a, 0x1a, 0xf3, 0x2b, 0xf2, 0x37
+    DB  0xf1, 0x5a, 0x1a, 0xf5, 0x0a, 0x1a, 0xf3, 0x2a
+    DB  0xf2, 0x39, 0xf1, 0x58, 0x1a, 0xf5, 0x0b, 0x1a
+    DB  0xf3, 0x29, 0xf2, 0x3b, 0xf1, 0x57, 0x1a, 0xf5
+    DB  0x0b, 0x1a, 0xf3, 0x28, 0xf2, 0x3d, 0xf1, 0x55
+    DB  0x1b, 0xf5, 0x0b, 0x19, 0xf3, 0x28, 0xf2, 0x3f
+    DB  0xf1, 0x54, 0x1a, 0xf5, 0x0c, 0x19, 0xf3, 0x27
+    DB  0xf3, 0x31, 0xf1, 0x53, 0x1a, 0xf5, 0x0c, 0x19
+    DB  0xf3, 0x26, 0xf3, 0x33, 0xf1, 0x51, 0x1b, 0xf5
+    DB  0x0c, 0x19, 0xf3, 0x26, 0xf3, 0x35, 0x5f, 0x1a
+    DB  0xf5, 0x0d, 0x19, 0xf3, 0x25, 0xf3, 0x37, 0x5e
+    DB  0x1a, 0xf5, 0x0c, 0x1a, 0xf3, 0x24, 0xf3, 0x39
+    DB  0x5c, 0x1a, 0xf5, 0x0d, 0x1a, 0xf3, 0x23, 0xf3
+    DB  0x3b, 0x5b, 0x1a, 0xf5, 0x0d, 0x1a, 0xf3, 0x22
+    DB  0xf3, 0x3e, 0x58, 0x1b, 0xf5, 0x0d, 0x1a, 0xf3
+    DB  0x21, 0xf4, 0x30, 0x57, 0x1a, 0xf5, 0x0e, 0x1a
+    DB  0xf3, 0x20, 0xf4, 0x32, 0x56, 0x1a, 0xf5, 0x0e
+    DB  0x1a, 0xf2, 0x2f, 0xf4, 0x34, 0x54, 0x1d, 0xf5
+    DB  0x0c, 0x19, 0xf2, 0x2f, 0xf4, 0x37, 0x52, 0x1e
+    DB  0xf5, 0x0b, 0x19, 0xf2, 0x2f, 0xf4, 0x38, 0x51
+    DB  0xf1, 0x10, 0xf5, 0x09, 0x19, 0xf2, 0x2e, 0xf4
+    DB  0x3b, 0xf1, 0x12, 0xf5, 0x07, 0x19, 0xf2, 0x2d
+    DB  0xf4, 0x3d, 0xf1, 0x12, 0xf5, 0x06, 0x19, 0xf2
+    DB  0x2c, 0xf4, 0x3f, 0xf1, 0x13, 0xf5, 0x04, 0x19
+    DB  0xf2, 0x2b, 0xf5, 0x32, 0xf1, 0x13, 0xf5, 0x02
+    DB  0x19, 0xf2, 0x2a, 0xf5, 0x34, 0xf1, 0x13, 0xf5
+    DB  0x01, 0x19, 0xf2, 0x29, 0xf5, 0x37, 0xf1, 0x13
+    DB  0xf4, 0x0f, 0x19, 0xf2, 0x28, 0xf5, 0x39, 0xf1
+    DB  0x14, 0xf4, 0x0c, 0x1a, 0xf2, 0x28, 0xf5, 0x3b
+    DB  0xf1, 0x14, 0xf4, 0x0a, 0x1a, 0xf2, 0x27, 0xf5
+    DB  0x3e, 0xf1, 0x14, 0xf4, 0x08, 0x1a, 0xf2, 0x26
+    DB  0xf6, 0x30, 0xf1, 0x15, 0xf4, 0x06, 0x1a, 0xf2
+    DB  0x25, 0xf6, 0x33, 0xf1, 0x15, 0xf4, 0x04, 0x1a
+    DB  0xf2, 0x24, 0xf6, 0x36, 0xf1, 0x15, 0xf4, 0x02
+    DB  0x1a, 0xf2, 0x23, 0xf6, 0x38, 0xf1, 0x16, 0xf4
+    DB  0x00, 0x1a, 0xf2, 0x22, 0xf6, 0x3b, 0xf1, 0x17
+    DB  0xf3, 0x0d, 0x1a, 0xf2, 0x22, 0xf6, 0x3d, 0xf1
+    DB  0x17, 0xf3, 0x0b, 0x1a, 0xf2, 0x21, 0xf7, 0x30
+    DB  0xf1, 0x17, 0xf3, 0x09, 0x1a, 0xf2, 0x20, 0xf7
+    DB  0x33, 0xf1, 0x17, 0xf3, 0x07, 0x1a, 0xf1, 0x2f
+    DB  0xf7, 0x36, 0xf1, 0x18, 0xf3, 0x04, 0x1a, 0xf1
+    DB  0x2e, 0xf7, 0x39, 0xf1, 0x18, 0xf3, 0x02, 0x1a
+    DB  0xf1, 0x2d, 0xf7, 0x3c, 0xf1, 0x18, 0xf3, 0x00
+    DB  0x1a, 0xf1, 0x2d, 0xf7, 0x3e, 0xf1, 0x18, 0xf2
+    DB  0x0e, 0x1a, 0xf1, 0x2c, 0xf8, 0x31, 0xf1, 0x18
+    DB  0xf2, 0x0c, 0x1a, 0xf1, 0x2b, 0xf8, 0x34, 0xf1
+    DB  0x16, 0xf2, 0x0d, 0x19, 0xf1, 0x2a, 0xf8, 0x36
+    DB  0xf1, 0x13, 0xf2, 0x0f, 0x19, 0xf1, 0x29, 0xf8
+    DB  0x36, 0xf1, 0x13, 0xf3, 0x00, 0x19, 0xf1, 0x28
+    DB  0xf8, 0x36, 0xf1, 0x12, 0xf3, 0x02, 0x19, 0xf1
+    DB  0x28, 0xf8, 0x34, 0xf1, 0x13, 0xf3, 0x03, 0x19
+    DB  0xf1, 0x27, 0xf8, 0x33, 0xf1, 0x13, 0xf3, 0x05
+    DB  0x19, 0xf1, 0x26, 0xf8, 0x32, 0xf1, 0x13, 0xf3
+    DB  0x07, 0x19, 0xf1, 0x25, 0xf8, 0x32, 0xf1, 0x13
+    DB  0xf3, 0x08, 0x19, 0xf1, 0x24, 0xf8, 0x31, 0xf1
+    DB  0x13, 0xf3, 0x0a, 0x19, 0xf1, 0x24, 0xf7, 0x3f
+    DB  0xf1, 0x14, 0xf3, 0x0b, 0x19, 0xf1, 0x23, 0xf7
+    DB  0x3e, 0xf1, 0x14, 0xf3, 0x0d, 0x1a, 0xf1, 0x21
+    DB  0xf7, 0x3d, 0xf1, 0x14, 0xf3, 0x0f, 0x1a, 0xf1
+    DB  0x20, 0xf7, 0x3c, 0xf1, 0x15, 0xf4, 0x00, 0x1a
+    DB  0x2f, 0xf7, 0x3b, 0xf1, 0x15, 0xf4, 0x02, 0x1a
+    DB  0x2f, 0xf7, 0x39, 0xf1, 0x15, 0xf4, 0x04, 0x1a
+    DB  0x2e, 0xf7, 0x38, 0xf1, 0x16, 0xf4, 0x06, 0x19
+    DB  0x2d, 0xf7, 0x37, 0xf1, 0x16, 0xf4, 0x08, 0x19
+    DB  0x2c, 0xf7, 0x36, 0xf1, 0x16, 0xf4, 0x0a, 0x19
+    DB  0x2b, 0xf7, 0x34, 0xf1, 0x17, 0xf4, 0x0c, 0x19
+    DB  0x2b, 0xf7, 0x32, 0xf1, 0x18, 0xf4, 0x0d, 0x19
+    DB  0x2a, 0xf7, 0x30, 0xf1, 0x19, 0xf4, 0x0f, 0x1a
+    DB  0x28, 0xf6, 0x3f, 0xf1, 0x19, 0xf5, 0x01, 0x1a
+    DB  0x27, 0xf6, 0x3d, 0xf1, 0x1a, 0xf5, 0x03, 0x1a
+    DB  0x26, 0xf6, 0x3b, 0xf1, 0x1b, 0xf5, 0x05, 0x1a
+    DB  0x26, 0xf6, 0x38, 0xf1, 0x1b, 0xf5, 0x09, 0x19
+    DB  0x25, 0xf6, 0x36, 0xf1, 0x1c, 0xf5, 0x0b, 0x19
+    DB  0x24, 0xf6, 0x34, 0xf1, 0x1d, 0xf5, 0x0d, 0x19
+    DB  0x23, 0xf6, 0x32, 0xf1, 0x1e, 0xf5, 0x0f, 0x1a
+    DB  0x22, 0xf5, 0x3e, 0xf1, 0x1f, 0xf6, 0x02, 0x1a
+    DB  0x21, 0xf5, 0x3b, 0xf2, 0x11, 0xf6, 0x04, 0x1a
+    DB  0x20, 0xf5, 0x38, 0xf2, 0x12, 0xf6, 0x07, 0x1a
+    DB  0xf5, 0x34, 0xf2, 0x15, 0xf6, 0x0a, 0x19, 0xf4
+    DB  0x3f, 0xf2, 0x17, 0xf6, 0x0d, 0x1f, 0xf4, 0x33
+    DB  0xf2, 0x1a, 0xf7, 0x00, 0xf1, 0x16, 0xf3, 0x35
+    DB  0xf2, 0x1e, 0xf7, 0x03, 0xf2, 0x11, 0xf1, 0x3f
+    DB  0xf3, 0x16, 0xf7, 0x06, 0xf7, 0x15, 0xf7, 0x09
+    DB  0xf7, 0x12, 0xf7, 0x0d, 0xf6, 0x1d, 0xf8, 0x01
+    DB  0xf6, 0x19, 0xf8, 0x05, 0xf6, 0x15, 0xf8, 0x09
+    DB  0xf6, 0x11, 0xf9, 0x02, 0xf5, 0x16, 0xf9, 0x0e
+    DB  0xf4, 0x1b, 0xfa, 0x0a, 0xf3, 0x1d, 0xfb, 0x0a
+    DB  0xf2, 0x1b, 0xf2, 0xfb, 0xfb, 0x0c
\ No newline at end of file
--- a/code_part1/OSTC_code_asm_part1/start.asm	Tue Dec 14 08:59:44 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Mon Dec 13 23:49:52 2010 +0100
@@ -136,6 +136,8 @@
 	GETCUSTOM8	d'48'				; time correction value
 	movff	WREG, time_correction_value	; store in Bank0 register
 
+	call    scribble_15
+
 	clrf	flag1					; clear all flags
 	clrf	flag2
 	clrf	flag3