Subversion Repositories svn.mios

Rev

Blame | Last modification | View Log | RSS feed

; $Id: tia_sin_table.inc 111 2008-02-22 00:41:21Z tk $
;
; MIDIbox TIA
; Sinus Table
; generated with tiatab.pl
;
; ==========================================================================
;
;  Copyright 1998-2006 Thorsten Klose (tk@midibox.org)
;  Licensed for personal non-commercial use only.
;  All other rights reserved.
; 
; ==========================================================================

;; --------------------------------------------------------------------------
;; In: index (0x00-0xff) in WREG
;; Out: Sin value in WREG and MIOS_PARAMETER1
;; --------------------------------------------------------------------------
TIA_SIN_TABLE_Get
    ;; note: the table has only 128 entries, the upper entries are just
    ;; inverted, so we can save some memory
    movwf   MIOS_PARAMETER1
    btfss   MIOS_PARAMETER1, 7
    xorlw   0x7f
    andlw   0x7f

    addlw   TIA_SIN_TABLE & 0xff
    movwf   TBLPTRL
    clrf    TBLPTRH
    movlw   TIA_SIN_TABLE >> 8
    addwfc  TBLPTRH, F

    tblrd*+
    movf    TABLAT, W
    btfsc   MIOS_PARAMETER1, 7
    iorlw 0x80
    movwf   MIOS_PARAMETER1
    return

; ==========================================================================

TIA_SIN_TABLE
    db  0x00, 0x01
    db  0x03, 0x04
    db  0x06, 0x07
    db  0x09, 0x0a
    db  0x0c, 0x0e
    db  0x0f, 0x11
    db  0x12, 0x14
    db  0x15, 0x17
    db  0x18, 0x1a
    db  0x1c, 0x1d
    db  0x1f, 0x20
    db  0x22, 0x23
    db  0x25, 0x26
    db  0x28, 0x29
    db  0x2b, 0x2c
    db  0x2e, 0x2f
    db  0x30, 0x32
    db  0x33, 0x35
    db  0x36, 0x38
    db  0x39, 0x3a
    db  0x3c, 0x3d
    db  0x3f, 0x40
    db  0x41, 0x43
    db  0x44, 0x45
    db  0x47, 0x48
    db  0x49, 0x4a
    db  0x4c, 0x4d
    db  0x4e, 0x4f
    db  0x51, 0x52
    db  0x53, 0x54
    db  0x55, 0x57
    db  0x58, 0x59
    db  0x5a, 0x5b
    db  0x5c, 0x5d
    db  0x5e, 0x5f
    db  0x60, 0x61
    db  0x62, 0x63
    db  0x64, 0x65
    db  0x66, 0x67
    db  0x68, 0x69
    db  0x6a, 0x6b
    db  0x6c, 0x6c
    db  0x6d, 0x6e
    db  0x6f, 0x70
    db  0x70, 0x71
    db  0x72, 0x73
    db  0x73, 0x74
    db  0x75, 0x75
    db  0x76, 0x76
    db  0x77, 0x77
    db  0x78, 0x79
    db  0x79, 0x7a
    db  0x7a, 0x7a
    db  0x7b, 0x7b
    db  0x7c, 0x7c
    db  0x7c, 0x7d
    db  0x7d, 0x7d
    db  0x7e, 0x7e
    db  0x7e, 0x7e
    db  0x7f, 0x7f
    db  0x7f, 0x7f
    db  0x7f, 0x7f
    db  0x7f, 0x7f
    db  0x7f, 0x7f