; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.21022.08 

	TITLE	c:\Develop\DScaler423a\DScaler\TDA8290.cpp
	.686P
	.XMM
	include listing.inc
	.model	flat

INCLUDELIB OLDNAMES

PUBLIC	?SetVideoSystemStandard@CTDA8290@@MAEXW4eTDA8290Standard@@@Z ; CTDA8290::SetVideoSystemStandard
PUBLIC	?GetAFCStatus@CTDA8290@@UAE?AW4eTunerAFCStatus@@AAJ@Z ; CTDA8290::GetAFCStatus
PUBLIC	?Detect@CTDA8290@@UAEHXZ			; CTDA8290::Detect
PUBLIC	?TunerSet@CTDA8290@@UAEXHW4eVideoFormat@@@Z	; CTDA8290::TunerSet
PUBLIC	?Init@CTDA8290@@UAEXHW4eVideoFormat@@@Z		; CTDA8290::Init
PUBLIC	??_R4CTDA8290@@6B@				; CTDA8290::`RTTI Complete Object Locator'
PUBLIC	??_R3CTDA8290@@8				; CTDA8290::`RTTI Class Hierarchy Descriptor'
PUBLIC	??_R2CTDA8290@@8				; CTDA8290::`RTTI Base Class Array'
PUBLIC	??_R1A@?0A@EA@CTDA8290@@8			; CTDA8290::`RTTI Base Class Descriptor at (0,-1,0,64)'
PUBLIC	??_R0?AVCTDA8290@@@8				; CTDA8290 `RTTI Type Descriptor'
PUBLIC	?GetDefaultAddress@CTDA8290@@MBEEXZ		; CTDA8290::GetDefaultAddress
PUBLIC	??_GCTDA8290@@UAEPAXI@Z				; CTDA8290::`scalar deleting destructor'
PUBLIC	??_C@_1CM@JFDGNOIK@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAd?$AAe?$AAt?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?$AA@ ; `string'
PUBLIC	??_C@_1CG@HPNAGKAN@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AA$?$AA1?$AAF?$AA?5?$AA?$DN?$AA?5?$AA0?$AA2?$AAx?$AA?$AA@ ; `string'
PUBLIC	??_7CTDA8290@@6B@				; CTDA8290::`vftable'
EXTRN	??_ECTDA8290@@UAEPAXI@Z:PROC			; CTDA8290::`vector deleting destructor'
;	COMDAT ??_7CTDA8290@@6B@
CONST	SEGMENT
??_7CTDA8290@@6B@ DD FLAT:??_R4CTDA8290@@6B@		; CTDA8290::`vftable'
	DD	FLAT:??_ECTDA8290@@UAEPAXI@Z
	DD	FLAT:?GetDefaultAddress@CTDA8290@@MBEEXZ
	DD	FLAT:?SetDetectedI2CAddress@IExternalIFDemodulator@@UAEHPAVCI2CBus@@PAEI@Z
	DD	FLAT:?SetDetectedI2CAddress@IExternalIFDemodulator@@UAEHPAVCI2CBus@@@Z
	DD	FLAT:?Init@CTDA8290@@UAEXHW4eVideoFormat@@@Z
	DD	FLAT:?TunerSet@CTDA8290@@UAEXHW4eVideoFormat@@@Z
	DD	FLAT:?Detect@CTDA8290@@UAEHXZ
	DD	FLAT:?GetAFCStatus@CTDA8290@@UAE?AW4eTunerAFCStatus@@AAJ@Z
	DD	FLAT:?SetVideoSystemStandard@CTDA8290@@MAEXW4eTDA8290Standard@@@Z
CONST	ENDS
;	COMDAT ??_R4CTDA8290@@6B@
rdata$r	SEGMENT
??_R4CTDA8290@@6B@ DD 00H				; CTDA8290::`RTTI Complete Object Locator'
	DD	00H
	DD	00H
	DD	FLAT:??_R0?AVCTDA8290@@@8
	DD	FLAT:??_R3CTDA8290@@8
rdata$r	ENDS
;	COMDAT ??_R3CTDA8290@@8
rdata$r	SEGMENT
??_R3CTDA8290@@8 DD 00H					; CTDA8290::`RTTI Class Hierarchy Descriptor'
	DD	00H
	DD	03H
	DD	FLAT:??_R2CTDA8290@@8
rdata$r	ENDS
;	COMDAT ??_R2CTDA8290@@8
rdata$r	SEGMENT
??_R2CTDA8290@@8 DD FLAT:??_R1A@?0A@EA@CTDA8290@@8	; CTDA8290::`RTTI Base Class Array'
	DD	FLAT:??_R1A@?0A@EA@IExternalIFDemodulator@@8
	DD	FLAT:??_R1A@?0A@EA@CI2CDevice@@8
rdata$r	ENDS
;	COMDAT ??_R1A@?0A@EA@CTDA8290@@8
rdata$r	SEGMENT
??_R1A@?0A@EA@CTDA8290@@8 DD FLAT:??_R0?AVCTDA8290@@@8	; CTDA8290::`RTTI Base Class Descriptor at (0,-1,0,64)'
	DD	02H
	DD	00H
	DD	0ffffffffH
	DD	00H
	DD	040H
	DD	FLAT:??_R3CTDA8290@@8
rdata$r	ENDS
;	COMDAT ??_R0?AVCTDA8290@@@8
_DATA	SEGMENT
??_R0?AVCTDA8290@@@8 DD FLAT:??_7type_info@@6B@		; CTDA8290 `RTTI Type Descriptor'
	DD	00H
	DB	'.?AVCTDA8290@@', 00H
_DATA	ENDS
;	COMDAT ??_C@_1CG@HPNAGKAN@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AA$?$AA1?$AAF?$AA?5?$AA?$DN?$AA?5?$AA0?$AA2?$AAx?$AA?$AA@
CONST	SEGMENT
??_C@_1CG@HPNAGKAN@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AA$?$AA1?$AAF?$AA?5?$AA?$DN?$AA?5?$AA0?$AA2?$AAx?$AA?$AA@ DB 'T'
	DB	00H, 'D', 00H, 'A', 00H, '8', 00H, '2', 00H, '9', 00H, '0', 00H
	DB	':', 00H, ' ', 00H, '$', 00H, '1', 00H, 'F', 00H, ' ', 00H, '='
	DB	00H, ' ', 00H, '0', 00H, '2', 00H, 'x', 00H, 00H, 00H ; `string'
CONST	ENDS
;	COMDAT ??_C@_1CM@JFDGNOIK@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAd?$AAe?$AAt?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?$AA@
CONST	SEGMENT
??_C@_1CM@JFDGNOIK@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAd?$AAe?$AAt?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?$AA@ DB 'T'
	DB	00H, 'D', 00H, 'A', 00H, '8', 00H, '2', 00H, '9', 00H, '0', 00H
	DB	':', 00H, ' ', 00H, 'n', 00H, 'o', 00H, 't', 00H, ' ', 00H, 'd'
	DB	00H, 'e', 00H, 't', 00H, 'e', 00H, 'c', 00H, 't', 00H, 'e', 00H
	DB	'd', 00H, 00H, 00H				; `string'
PUBLIC	?GetTDA8290Standard@CTDA8290@@SA?AW4eTDA8290Standard@@W4eVideoFormat@@@Z ; CTDA8290::GetTDA8290Standard
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\tda8290.cpp
;	COMDAT ?GetTDA8290Standard@CTDA8290@@SA?AW4eTDA8290Standard@@W4eVideoFormat@@@Z
_TEXT	SEGMENT
tv64 = -8						; size = 4
_standard$ = -4						; size = 4
_videoFormat$ = 8					; size = 4
?GetTDA8290Standard@CTDA8290@@SA?AW4eTDA8290Standard@@W4eVideoFormat@@@Z PROC ; CTDA8290::GetTDA8290Standard, COMDAT

; 244  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8

; 245  :     eTDA8290Standard standard = TDA8290_STANDARD_MN;

  00006	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 0

; 246  : 
; 247  :     switch (videoFormat)

  0000d	8b 45 08	 mov	 eax, DWORD PTR _videoFormat$[ebp]
  00010	89 45 f8	 mov	 DWORD PTR tv64[ebp], eax
  00013	83 7d f8 1b	 cmp	 DWORD PTR tv64[ebp], 27	; 0000001bH
  00017	77 59		 ja	 SHORT $LN10@GetTDA8290
  00019	8b 4d f8	 mov	 ecx, DWORD PTR tv64[ebp]
  0001c	0f b6 91 00 00
	00 00		 movzx	 edx, BYTE PTR $LN14@GetTDA8290[ecx]
  00023	ff 24 95 00 00
	00 00		 jmp	 DWORD PTR $LN15@GetTDA8290[edx*4]
$LN9@GetTDA8290:

; 248  :     {
; 249  :     case VIDEOFORMAT_PAL_B:
; 250  :     case VIDEOFORMAT_SECAM_B:
; 251  :         standard = TDA8290_STANDARD_B;

  0002a	c7 45 fc 01 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 1

; 252  :         break;

  00031	eb 3f		 jmp	 SHORT $LN10@GetTDA8290
$LN8@GetTDA8290:

; 253  :     case VIDEOFORMAT_PAL_G:
; 254  :     case VIDEOFORMAT_PAL_H:
; 255  :     case VIDEOFORMAT_PAL_N:
; 256  :     case VIDEOFORMAT_SECAM_G:
; 257  :     case VIDEOFORMAT_SECAM_H:
; 258  :         standard = TDA8290_STANDARD_GH;

  00033	c7 45 fc 02 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 2

; 259  :         break;

  0003a	eb 36		 jmp	 SHORT $LN10@GetTDA8290
$LN7@GetTDA8290:

; 260  :     case VIDEOFORMAT_PAL_I:
; 261  :         standard = TDA8290_STANDARD_I;

  0003c	c7 45 fc 03 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 3

; 262  :         break;

  00043	eb 2d		 jmp	 SHORT $LN10@GetTDA8290
$LN6@GetTDA8290:

; 263  :     case VIDEOFORMAT_PAL_D:
; 264  :     case VIDEOFORMAT_SECAM_D:
; 265  :     case VIDEOFORMAT_SECAM_K:
; 266  :     case VIDEOFORMAT_SECAM_K1:
; 267  :         standard = TDA8290_STANDARD_DK;

  00045	c7 45 fc 04 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 4

; 268  :         break;

  0004c	eb 24		 jmp	 SHORT $LN10@GetTDA8290
$LN5@GetTDA8290:

; 269  :     case VIDEOFORMAT_SECAM_L:
; 270  :     case VIDEOFORMAT_SECAM_L1:
; 271  :         standard = TDA8290_STANDARD_L;

  0004e	c7 45 fc 05 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 5

; 272  :         break;

  00055	eb 1b		 jmp	 SHORT $LN10@GetTDA8290

; 273  :     case VIDEOFORMAT_PAL_60:
; 274  :         // Unsupported
; 275  :         break;

  00057	eb 19		 jmp	 SHORT $LN10@GetTDA8290
$LN3@GetTDA8290:

; 276  :     case VIDEOFORMAT_PAL_M:
; 277  :     case VIDEOFORMAT_PAL_N_COMBO:
; 278  :     case VIDEOFORMAT_NTSC_M:
; 279  :         standard = TDA8290_STANDARD_MN;

  00059	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 0

; 280  :         break;

  00060	eb 10		 jmp	 SHORT $LN10@GetTDA8290
$LN2@GetTDA8290:

; 281  :     case VIDEOFORMAT_NTSC_50:
; 282  :     case VIDEOFORMAT_NTSC_M_Japan:
; 283  :         standard = TDA8290_STANDARD_MN;

  00062	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 0

; 284  :         break;

  00069	eb 07		 jmp	 SHORT $LN10@GetTDA8290
$LN1@GetTDA8290:

; 285  :     // This value is used among ITuner and IExternalIFDemodulator for radio.
; 286  :     case (VIDEOFORMAT_LASTONE+1):
; 287  :         standard = TDA8290_STANDARD_RADIO;

  0006b	c7 45 fc 07 00
	00 00		 mov	 DWORD PTR _standard$[ebp], 7
$LN10@GetTDA8290:

; 288  :         break;
; 289  :     }
; 290  : 
; 291  :     return standard;

  00072	8b 45 fc	 mov	 eax, DWORD PTR _standard$[ebp]

; 292  : }

  00075	8b e5		 mov	 esp, ebp
  00077	5d		 pop	 ebp
  00078	c3		 ret	 0
  00079	8d 49 00	 npad	 3
$LN15@GetTDA8290:
  0007c	00 00 00 00	 DD	 $LN9@GetTDA8290
  00080	00 00 00 00	 DD	 $LN6@GetTDA8290
  00084	00 00 00 00	 DD	 $LN8@GetTDA8290
  00088	00 00 00 00	 DD	 $LN7@GetTDA8290
  0008c	00 00 00 00	 DD	 $LN3@GetTDA8290
  00090	00 00 00 00	 DD	 $LN5@GetTDA8290
  00094	00 00 00 00	 DD	 $LN2@GetTDA8290
  00098	00 00 00 00	 DD	 $LN1@GetTDA8290
  0009c	00 00 00 00	 DD	 $LN10@GetTDA8290
$LN14@GetTDA8290:
  000a0	00		 DB	 0
  000a1	01		 DB	 1
  000a2	02		 DB	 2
  000a3	02		 DB	 2
  000a4	03		 DB	 3
  000a5	04		 DB	 4
  000a6	02		 DB	 2
  000a7	08		 DB	 8
  000a8	04		 DB	 4
  000a9	00		 DB	 0
  000aa	01		 DB	 1
  000ab	02		 DB	 2
  000ac	02		 DB	 2
  000ad	01		 DB	 1
  000ae	01		 DB	 1
  000af	05		 DB	 5
  000b0	05		 DB	 5
  000b1	04		 DB	 4
  000b2	06		 DB	 6
  000b3	06		 DB	 6
  000b4	08		 DB	 8
  000b5	08		 DB	 8
  000b6	08		 DB	 8
  000b7	08		 DB	 8
  000b8	08		 DB	 8
  000b9	08		 DB	 8
  000ba	08		 DB	 8
  000bb	07		 DB	 7
?GetTDA8290Standard@CTDA8290@@SA?AW4eTDA8290Standard@@W4eVideoFormat@@@Z ENDP ; CTDA8290::GetTDA8290Standard
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\tda8290.h
_TEXT	ENDS
;	COMDAT ?GetDefaultAddress@CTDA8290@@MBEEXZ
_TEXT	SEGMENT
_this$ = -4						; size = 4
?GetDefaultAddress@CTDA8290@@MBEEXZ PROC		; CTDA8290::GetDefaultAddress, COMDAT
; _this$ = ecx

; 123  :     virtual BYTE GetDefaultAddress() const { return I2C_ADDR_TDA8290; }

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx
  00007	b0 4b		 mov	 al, 75			; 0000004bH
  00009	8b e5		 mov	 esp, ebp
  0000b	5d		 pop	 ebp
  0000c	c3		 ret	 0
?GetDefaultAddress@CTDA8290@@MBEEXZ ENDP		; CTDA8290::GetDefaultAddress
PUBLIC	__$ArrayPad$
; Function compile flags: /Odtp
; File c:\develop\dscaler423a\dscaler\tda8290.cpp
;	COMDAT ?SetVideoSystemStandard@CTDA8290@@MAEXW4eTDA8290Standard@@@Z
_TEXT	SEGMENT
_this$ = -16						; size = 4
_sgStandard$ = -12					; size = 8
__$ArrayPad$ = -4					; size = 4
_standard$ = 8						; size = 4
?SetVideoSystemStandard@CTDA8290@@MAEXW4eTDA8290Standard@@@Z PROC ; CTDA8290::SetVideoSystemStandard, COMDAT
; _this$ = ecx

; 227  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 10	 sub	 esp, 16			; 00000010H
  00006	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  0000b	33 c5		 xor	 eax, ebp
  0000d	89 45 fc	 mov	 DWORD PTR __$ArrayPad$[ebp], eax
  00010	89 4d f0	 mov	 DWORD PTR _this$[ebp], ecx

; 228  :     const BYTE sgStandard[TDA8290_STANDARD_LASTONE] = { 1, 2, 4, 8, 16, 32, 64, 0 };

  00013	c6 45 f4 01	 mov	 BYTE PTR _sgStandard$[ebp], 1
  00017	c6 45 f5 02	 mov	 BYTE PTR _sgStandard$[ebp+1], 2
  0001b	c6 45 f6 04	 mov	 BYTE PTR _sgStandard$[ebp+2], 4
  0001f	c6 45 f7 08	 mov	 BYTE PTR _sgStandard$[ebp+3], 8
  00023	c6 45 f8 10	 mov	 BYTE PTR _sgStandard$[ebp+4], 16 ; 00000010H
  00027	c6 45 f9 20	 mov	 BYTE PTR _sgStandard$[ebp+5], 32 ; 00000020H
  0002b	c6 45 fa 40	 mov	 BYTE PTR _sgStandard$[ebp+6], 64 ; 00000040H
  0002f	c6 45 fb 00	 mov	 BYTE PTR _sgStandard$[ebp+7], 0

; 229  : 
; 230  :     if (standard == TDA8290_STANDARD_RADIO)

  00033	83 7d 08 07	 cmp	 DWORD PTR _standard$[ebp], 7
  00037	75 02		 jne	 SHORT $LN1@SetVideoSy

; 231  :     {
; 232  :         return;

  00039	eb 2b		 jmp	 SHORT $LN2@SetVideoSy
$LN1@SetVideoSy:

; 233  :     }
; 234  : 
; 235  :     // Bits: 0..6 := standard, 7 := expert mode
; 236  :     WriteToSubAddress(TDA8290_STANDARD_REG, sgStandard[(int)standard]);

  0003b	8b 45 08	 mov	 eax, DWORD PTR _standard$[ebp]
  0003e	0f b6 4c 05 f4	 movzx	 ecx, BYTE PTR _sgStandard$[ebp+eax]
  00043	51		 push	 ecx
  00044	6a 01		 push	 1
  00046	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00049	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 237  :     // Activate expert mode.  I think it might need to be broken into two
; 238  :     // calls like this so the first call sets everything up in easy mode
; 239  :     // before expert mode is switched on.
; 240  :     WriteToSubAddress(TDA8290_STANDARD_REG, sgStandard[(int)standard]|0x80);

  0004e	8b 55 08	 mov	 edx, DWORD PTR _standard$[ebp]
  00051	0f b6 44 15 f4	 movzx	 eax, BYTE PTR _sgStandard$[ebp+edx]
  00056	0d 80 00 00 00	 or	 eax, 128		; 00000080H
  0005b	50		 push	 eax
  0005c	6a 01		 push	 1
  0005e	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00061	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress
$LN2@SetVideoSy:

; 241  : }

  00066	8b 4d fc	 mov	 ecx, DWORD PTR __$ArrayPad$[ebp]
  00069	33 cd		 xor	 ecx, ebp
  0006b	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00070	8b e5		 mov	 esp, ebp
  00072	5d		 pop	 ebp
  00073	c2 04 00	 ret	 4
?SetVideoSystemStandard@CTDA8290@@MAEXW4eTDA8290Standard@@@Z ENDP ; CTDA8290::SetVideoSystemStandard
_TEXT	ENDS
PUBLIC	__real@4129a28000000000
PUBLIC	__real@40c9aecd9b366cda
;	COMDAT __real@4129a28000000000
CONST	SEGMENT
__real@4129a28000000000 DQ 04129a28000000000r	; 840000
CONST	ENDS
;	COMDAT __real@40c9aecd9b366cda
CONST	SEGMENT
__real@40c9aecd9b366cda DQ 040c9aecd9b366cdar	; 13149.6
; Function compile flags: /Odtp
CONST	ENDS
;	COMDAT ?GetAFCStatus@CTDA8290@@UAE?AW4eTunerAFCStatus@@AAJ@Z
_TEXT	SEGMENT
tv88 = -12						; size = 4
_this$ = -8						; size = 4
_afc_reg$ = -1						; size = 1
_nFreqDeviation$ = 8					; size = 4
?GetAFCStatus@CTDA8290@@UAE?AW4eTunerAFCStatus@@AAJ@Z PROC ; CTDA8290::GetAFCStatus, COMDAT
; _this$ = ecx

; 195  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH
  00006	89 4d f8	 mov	 DWORD PTR _this$[ebp], ecx

; 196  :     // Bits: 0..6 := AFC readout, 7 := 1=PLL locked to picture carrier
; 197  :     BYTE afc_reg = 0x00;

  00009	c6 45 ff 00	 mov	 BYTE PTR _afc_reg$[ebp], 0

; 198  : 
; 199  :     if (ReadFromSubAddress(TDA8290_AFC_REG, &afc_reg, 1))

  0000d	6a 01		 push	 1
  0000f	8d 45 ff	 lea	 eax, DWORD PTR _afc_reg$[ebp]
  00012	50		 push	 eax
  00013	6a 1b		 push	 27			; 0000001bH
  00015	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00018	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  0001d	85 c0		 test	 eax, eax
  0001f	74 3a		 je	 SHORT $LN1@GetAFCStat@2

; 200  :     {
; 201  :         // I couldn't find it specified how to interpret the AFC readout.  It says in
; 202  :         // the data-sheet:
; 203  :         //
; 204  :         // "- Wide TDA8290 AFC window (-840...830 kHz) and very accurate AFC information
; 205  :         // (13.2 kHz step) provided via I2C for channel fine tuning."
; 206  :         //
; 207  :         // And:
; 208  :         // "The second one is the high precise AFC readout (7 bit) which delivers the IF
; 209  :         // frequency deviation from nominal.  The AFC information is valid at [-840...830 kHz]
; 210  :         // around the nominal frequency, ..."
; 211  :         //
; 212  :         // I guess the 13.2 kHz step is a rounded approximation because (13.2 x 127 - 840kHz)
; 213  :         // doesn't work out exactly to 830 kHz.  Using this reasoning, the step value is
; 214  :         // (830 + 840) / 127 = 13.1496.......  I'm also guessing it's not in 2's complement
; 215  :         // because there's no way to get step x readout to fall on zero.
; 216  : 
; 217  :         // Deviation in kHz (need Hz): AFC readout x ((830kHz + 840kHz) / 127) - 840kHz.
; 218  :         // (0.5 is added for rounding.)
; 219  :         nFreqDeviation = (long)((afc_reg & 0x7F) * ((double)1670000 / 127) - 840000 + 0.5);

  00021	0f b6 4d ff	 movzx	 ecx, BYTE PTR _afc_reg$[ebp]
  00025	83 e1 7f	 and	 ecx, 127		; 0000007fH
  00028	89 4d f4	 mov	 DWORD PTR tv88[ebp], ecx
  0002b	db 45 f4	 fild	 DWORD PTR tv88[ebp]
  0002e	dc 0d 00 00 00
	00		 fmul	 QWORD PTR __real@40c9aecd9b366cda
  00034	dc 25 00 00 00
	00		 fsub	 QWORD PTR __real@4129a28000000000
  0003a	dc 05 00 00 00
	00		 fadd	 QWORD PTR __real@3fe0000000000000
  00040	e8 00 00 00 00	 call	 __ftol2_sse
  00045	8b 55 08	 mov	 edx, DWORD PTR _nFreqDeviation$[ebp]
  00048	89 02		 mov	 DWORD PTR [edx], eax

; 220  : 
; 221  :         return (afc_reg & 0x80) != 0 ? TUNER_AFC_CARRIER : TUNER_AFC_NOCARRIER;

  0004a	0f b6 45 ff	 movzx	 eax, BYTE PTR _afc_reg$[ebp]
  0004e	25 80 00 00 00	 and	 eax, 128		; 00000080H
  00053	f7 d8		 neg	 eax
  00055	1b c0		 sbb	 eax, eax
  00057	f7 d8		 neg	 eax
  00059	eb 03		 jmp	 SHORT $LN2@GetAFCStat@2
$LN1@GetAFCStat@2:

; 222  :     }
; 223  :     return TUNER_AFC_NOTSUPPORTED;

  0005b	83 c8 ff	 or	 eax, -1
$LN2@GetAFCStat@2:

; 224  : }

  0005e	8b e5		 mov	 esp, ebp
  00060	5d		 pop	 ebp
  00061	c2 04 00	 ret	 4
?GetAFCStatus@CTDA8290@@UAE?AW4eTunerAFCStatus@@AAJ@Z ENDP ; CTDA8290::GetAFCStatus
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?TunerSet@CTDA8290@@UAEXHW4eVideoFormat@@@Z
_TEXT	SEGMENT
_this$ = -12						; size = 4
_readByte$139880 = -5					; size = 1
_standard$ = -4						; size = 4
_bPreSet$ = 8						; size = 4
_videoFormat$ = 12					; size = 4
?TunerSet@CTDA8290@@UAEXHW4eVideoFormat@@@Z PROC	; CTDA8290::TunerSet, COMDAT
; _this$ = ecx

; 88   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 0c	 sub	 esp, 12			; 0000000cH
  00006	89 4d f4	 mov	 DWORD PTR _this$[ebp], ecx

; 89   :     eTDA8290Standard standard = GetTDA8290Standard(videoFormat);

  00009	8b 45 0c	 mov	 eax, DWORD PTR _videoFormat$[ebp]
  0000c	50		 push	 eax
  0000d	e8 00 00 00 00	 call	 ?GetTDA8290Standard@CTDA8290@@SA?AW4eTDA8290Standard@@W4eVideoFormat@@@Z ; CTDA8290::GetTDA8290Standard
  00012	83 c4 04	 add	 esp, 4
  00015	89 45 fc	 mov	 DWORD PTR _standard$[ebp], eax

; 90   : 
; 91   :     if (bPreSet)

  00018	83 7d 08 00	 cmp	 DWORD PTR _bPreSet$[ebp], 0
  0001c	74 72		 je	 SHORT $LN16@TunerSet

; 92   :     {
; 93   :         // Set video system standard.
; 94   :         SetVideoSystemStandard(standard);

  0001e	8b 4d fc	 mov	 ecx, DWORD PTR _standard$[ebp]
  00021	51		 push	 ecx
  00022	8b 55 f4	 mov	 edx, DWORD PTR _this$[ebp]
  00025	8b 02		 mov	 eax, DWORD PTR [edx]
  00027	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0002a	8b 50 20	 mov	 edx, DWORD PTR [eax+32]
  0002d	ff d2		 call	 edx

; 95   : 
; 96   :         // _T("1.1 Set input ADC register") (data-sheet)
; 97   :         WriteToSubAddress(TDA8290_ADC, 0x14);

  0002f	6a 14		 push	 20			; 00000014H
  00031	6a 28		 push	 40			; 00000028H
  00033	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00036	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 98   :         // _T("1.2 Increasing IF AGC speed") (data-sheet)
; 99   :         // This is the register's default value.
; 100  :         WriteToSubAddress(TDA8290_IF_AGC_SET, 0x88);

  0003b	68 88 00 00 00	 push	 136			; 00000088H
  00040	6a 0f		 push	 15			; 0000000fH
  00042	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00045	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 101  :         // _T("1.3 Set ADC headroom (TDA8290) to nominal") (data-sheet)
; 102  :         if (standard == TDA8290_STANDARD_L || standard == TDA8290_STANDARD_L2)

  0004a	83 7d fc 05	 cmp	 DWORD PTR _standard$[ebp], 5
  0004e	74 06		 je	 SHORT $LN14@TunerSet
  00050	83 7d fc 06	 cmp	 DWORD PTR _standard$[ebp], 6
  00054	75 0e		 jne	 SHORT $LN15@TunerSet
$LN14@TunerSet:

; 103  :         {
; 104  :             // 9dB ADC headroom if standard is L or L'
; 105  :             WriteToSubAddress(TDA8290_ADC_HEADR, 0x2);

  00056	6a 02		 push	 2
  00058	6a 05		 push	 5
  0005a	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0005d	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 106  :         }
; 107  :         else

  00062	eb 0c		 jmp	 SHORT $LN13@TunerSet
$LN15@TunerSet:

; 108  :         {
; 109  :             // 6dB ADC headroom
; 110  :             WriteToSubAddress(TDA8290_ADC_HEADR, 0x4);

  00064	6a 04		 push	 4
  00066	6a 05		 push	 5
  00068	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0006b	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress
$LN13@TunerSet:

; 111  :         }
; 112  : 
; 113  :         // 1.4 Set picture carrier PLL BW (TDA8290) to nominal (data-sheet)
; 114  :         // This is the register's default value.
; 115  :         WriteToSubAddress(TDA8290_PC_PLL_FUNC, 0x47);

  00070	6a 47		 push	 71			; 00000047H
  00072	6a 08		 push	 8
  00074	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00077	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 116  : 
; 117  :         // The v4l code does this instead of 1.2, 1.3 and 1.4
; 118  :         // WriteToSubAddress(TDA8290_CLEAR, 0x00);
; 119  : 
; 120  :         // Set TDA8290 gate for TDA8275 communication
; 121  :         WriteToSubAddress(TDA8290_GPIO2, 0xC1);

  0007c	68 c1 00 00 00	 push	 193			; 000000c1H
  00081	6a 21		 push	 33			; 00000021H
  00083	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00086	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 122  :     }
; 123  :     else

  0008b	e9 62 01 00 00	 jmp	 $LN17@TunerSet
$LN16@TunerSet:

; 124  :     {
; 125  :         BYTE readByte = 0x00;

  00090	c6 45 fb 00	 mov	 BYTE PTR _readByte$139880[ebp], 0

; 126  : 
; 127  :         // 4 Switching AGCF gain to keep 8dB headroom for RF power variations
; 128  :         if ((ReadFromSubAddress(TDA8290_IF_AGC_STAT, &readByte, 1) && readByte > 155 ||
; 129  :             ReadFromSubAddress(TDA8290_AFC_REG, &readByte, 1) && (readByte & 0x80) == 0) &&
; 130  :             ReadFromSubAddress(TDA8290_ADC_SAT, &readByte, 1) && readByte < 20)

  00094	6a 01		 push	 1
  00096	8d 45 fb	 lea	 eax, DWORD PTR _readByte$139880[ebp]
  00099	50		 push	 eax
  0009a	6a 1d		 push	 29			; 0000001dH
  0009c	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0009f	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  000a4	85 c0		 test	 eax, eax
  000a6	74 0c		 je	 SHORT $LN9@TunerSet
  000a8	0f b6 4d fb	 movzx	 ecx, BYTE PTR _readByte$139880[ebp]
  000ac	81 f9 9b 00 00
	00		 cmp	 ecx, 155		; 0000009bH
  000b2	7f 27		 jg	 SHORT $LN10@TunerSet
$LN9@TunerSet:
  000b4	6a 01		 push	 1
  000b6	8d 55 fb	 lea	 edx, DWORD PTR _readByte$139880[ebp]
  000b9	52		 push	 edx
  000ba	6a 1b		 push	 27			; 0000001bH
  000bc	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  000bf	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  000c4	85 c0		 test	 eax, eax
  000c6	0f 84 9f 00 00
	00		 je	 $LN11@TunerSet
  000cc	0f b6 45 fb	 movzx	 eax, BYTE PTR _readByte$139880[ebp]
  000d0	25 80 00 00 00	 and	 eax, 128		; 00000080H
  000d5	0f 85 90 00 00
	00		 jne	 $LN11@TunerSet
$LN10@TunerSet:
  000db	6a 01		 push	 1
  000dd	8d 4d fb	 lea	 ecx, DWORD PTR _readByte$139880[ebp]
  000e0	51		 push	 ecx
  000e1	6a 1a		 push	 26			; 0000001aH
  000e3	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  000e6	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  000eb	85 c0		 test	 eax, eax
  000ed	74 7c		 je	 SHORT $LN11@TunerSet
  000ef	0f b6 55 fb	 movzx	 edx, BYTE PTR _readByte$139880[ebp]
  000f3	83 fa 14	 cmp	 edx, 20			; 00000014H
  000f6	7d 73		 jge	 SHORT $LN11@TunerSet

; 131  :         {
; 132  :             // 1Vpp for TDA8290 ADC
; 133  :             WriteToSubAddress(TDA8290_ADC, 0x54);

  000f8	6a 54		 push	 84			; 00000054H
  000fa	6a 28		 push	 40			; 00000028H
  000fc	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  000ff	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 134  :             Sleep(100);

  00104	6a 64		 push	 100			; 00000064H
  00106	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__Sleep@4

; 135  : 
; 136  :             // This cannot be done because there's no interface from here to the TDA8275.
; 137  :             //if ((ReadFromSubAddress(TDA8290_IF_AGC_STAT, &readByte, 1) && readByte > 155 ||
; 138  :             //    ReadFromSubAddress(TDA8290_AFC_REG, &readByte, 1) && (readByte & 0x80) == 0))
; 139  :             //{
; 140  :             //    // AGCF gain is increased to 10-30dB.
; 141  :             //    TDA8275->WriteToSubAddress(TDA8275_AB4, 0x08);
; 142  :             //    Sleep(100);
; 143  : 
; 144  :                 if ((ReadFromSubAddress(TDA8290_IF_AGC_STAT, &readByte, 1) && readByte > 155 ||
; 145  :                     ReadFromSubAddress(TDA8290_AFC_REG, &readByte, 1) && (readByte & 0x80) == 0))

  0010c	6a 01		 push	 1
  0010e	8d 45 fb	 lea	 eax, DWORD PTR _readByte$139880[ebp]
  00111	50		 push	 eax
  00112	6a 1d		 push	 29			; 0000001dH
  00114	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00117	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  0011c	85 c0		 test	 eax, eax
  0011e	74 0c		 je	 SHORT $LN6@TunerSet
  00120	0f b6 4d fb	 movzx	 ecx, BYTE PTR _readByte$139880[ebp]
  00124	81 f9 9b 00 00
	00		 cmp	 ecx, 155		; 0000009bH
  0012a	7f 1f		 jg	 SHORT $LN7@TunerSet
$LN6@TunerSet:
  0012c	6a 01		 push	 1
  0012e	8d 55 fb	 lea	 edx, DWORD PTR _readByte$139880[ebp]
  00131	52		 push	 edx
  00132	6a 1b		 push	 27			; 0000001bH
  00134	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00137	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  0013c	85 c0		 test	 eax, eax
  0013e	74 2b		 je	 SHORT $LN11@TunerSet
  00140	0f b6 45 fb	 movzx	 eax, BYTE PTR _readByte$139880[ebp]
  00144	25 80 00 00 00	 and	 eax, 128		; 00000080H
  00149	75 20		 jne	 SHORT $LN11@TunerSet
$LN7@TunerSet:

; 146  :                 {
; 147  :                     // 12dB ADC headroom
; 148  :                     WriteToSubAddress(TDA8290_ADC_HEADR, 0x1);

  0014b	6a 01		 push	 1
  0014d	6a 05		 push	 5
  0014f	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00152	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 149  :                     // 70kHz PC PLL BW to counteract striping in picture
; 150  :                     WriteToSubAddress(TDA8290_PC_PLL_FUNC, 0x27);

  00157	6a 27		 push	 39			; 00000027H
  00159	6a 08		 push	 8
  0015b	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0015e	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 151  :                     // Wait for IF AGC
; 152  :                     Sleep(100);

  00163	6a 64		 push	 100			; 00000064H
  00165	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__Sleep@4
$LN11@TunerSet:

; 153  :                 }
; 154  :             //}
; 155  :         }
; 156  : 
; 157  :         // 5/ RESET for L/L' deadlock
; 158  :         if (standard == TDA8290_STANDARD_L || standard == TDA8290_STANDARD_L2)

  0016b	83 7d fc 05	 cmp	 DWORD PTR _standard$[ebp], 5
  0016f	74 06		 je	 SHORT $LN4@TunerSet
  00171	83 7d fc 06	 cmp	 DWORD PTR _standard$[ebp], 6
  00175	75 5d		 jne	 SHORT $LN5@TunerSet
$LN4@TunerSet:

; 159  :         {
; 160  :             if (ReadFromSubAddress(TDA8290_ADC_SAT, &readByte, 1) && readByte > 20 ||
; 161  :                 ReadFromSubAddress(TDA8290_AFC_REG, &readByte, 1) && (readByte & 0x80) == 0)

  00177	6a 01		 push	 1
  00179	8d 4d fb	 lea	 ecx, DWORD PTR _readByte$139880[ebp]
  0017c	51		 push	 ecx
  0017d	6a 1a		 push	 26			; 0000001aH
  0017f	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  00182	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  00187	85 c0		 test	 eax, eax
  00189	74 09		 je	 SHORT $LN1@TunerSet
  0018b	0f b6 55 fb	 movzx	 edx, BYTE PTR _readByte$139880[ebp]
  0018f	83 fa 14	 cmp	 edx, 20			; 00000014H
  00192	7f 20		 jg	 SHORT $LN2@TunerSet
$LN1@TunerSet:
  00194	6a 01		 push	 1
  00196	8d 45 fb	 lea	 eax, DWORD PTR _readByte$139880[ebp]
  00199	50		 push	 eax
  0019a	6a 1b		 push	 27			; 0000001bH
  0019c	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  0019f	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  001a4	85 c0		 test	 eax, eax
  001a6	74 2c		 je	 SHORT $LN5@TunerSet
  001a8	0f b6 4d fb	 movzx	 ecx, BYTE PTR _readByte$139880[ebp]
  001ac	81 e1 80 00 00
	00		 and	 ecx, 128		; 00000080H
  001b2	75 20		 jne	 SHORT $LN5@TunerSet
$LN2@TunerSet:

; 162  :             {
; 163  :                 // Reset AGC integrator
; 164  :                 WriteToSubAddress(TDA8290_AGC_FUNC, 0x0B);

  001b4	6a 0b		 push	 11			; 0000000bH
  001b6	6a 09		 push	 9
  001b8	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  001bb	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 165  :                 Sleep(40);

  001c0	6a 28		 push	 40			; 00000028H
  001c2	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__Sleep@4

; 166  :                 // Normal mode
; 167  :                 WriteToSubAddress(TDA8290_AGC_FUNC, 0x09);

  001c8	6a 09		 push	 9
  001ca	6a 09		 push	 9
  001cc	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  001cf	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress
$LN5@TunerSet:

; 168  :             }
; 169  :         }
; 170  : 
; 171  :         // 6/ Set TDA8290 gate to prevent TDA8275 communication
; 172  :         WriteToSubAddress(TDA8290_GPIO2, 0x81);

  001d4	68 81 00 00 00	 push	 129			; 00000081H
  001d9	6a 21		 push	 33			; 00000021H
  001db	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  001de	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 173  :         // 7/ IF AGC control loop bandwidth
; 174  :         WriteToSubAddress(TDA8290_IF_AGC_SET, 0x81);

  001e3	68 81 00 00 00	 push	 129			; 00000081H
  001e8	6a 0f		 push	 15			; 0000000fH
  001ea	8b 4d f4	 mov	 ecx, DWORD PTR _this$[ebp]
  001ed	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress
$LN17@TunerSet:

; 175  :     }
; 176  : }

  001f2	8b e5		 mov	 esp, ebp
  001f4	5d		 pop	 ebp
  001f5	c2 08 00	 ret	 8
?TunerSet@CTDA8290@@UAEXHW4eVideoFormat@@@Z ENDP	; CTDA8290::TunerSet
; Function compile flags: /Odtp
_TEXT	ENDS
;	COMDAT ?Init@CTDA8290@@UAEXHW4eVideoFormat@@@Z
_TEXT	SEGMENT
_this$ = -4						; size = 4
_bPreInit$ = 8						; size = 4
_videoFormat$ = 12					; size = 4
?Init@CTDA8290@@UAEXHW4eVideoFormat@@@Z PROC		; CTDA8290::Init, COMDAT
; _this$ = ecx

; 59   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx

; 60   :     if (bPreInit)

  00007	83 7d 08 00	 cmp	 DWORD PTR _bPreInit$[ebp], 0
  0000b	74 1d		 je	 SHORT $LN2@Init

; 61   :     {
; 62   :         /* Write the default value into the CLEAR register. Sets soft reset and
; 63   :            standby to the _T("normal operation") setting. There's no video or audio
; 64   :            without this. */
; 65   :         WriteToSubAddress(TDA8290_CLEAR, 0x1);

  0000d	6a 01		 push	 1
  0000f	6a 00		 push	 0
  00011	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  00014	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 66   : 
; 67   :         // Set TDA8290 gate for TDA8275 communication
; 68   :         /* DEBUG:
; 69   :             Sets
; 70   :             GP2_CF (Bits 0-3) (GPIO2 Pin Configuration) to 1
; 71   :             IICSW_ON to 1 (I2C Switch Command)
; 72   :             IICSW_EN to 1 (Enable GPIO_1,2 as I2C switch) */
; 73   :         WriteToSubAddress(TDA8290_GPIO2, 0xC1);

  00019	68 c1 00 00 00	 push	 193			; 000000c1H
  0001e	6a 21		 push	 33			; 00000021H
  00020	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  00023	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 74   :     }
; 75   :     else

  00028	eb 27		 jmp	 SHORT $LN3@Init
$LN2@Init:

; 76   :     {
; 77   :         // V-Sync: positive pulse, line 15, width 128us (data-sheet initialization)
; 78   :         WriteToSubAddress(TDA8290_V_SYNC_DEL, 0x6F);

  0002a	6a 6f		 push	 111			; 0000006fH
  0002c	6a 30		 push	 48			; 00000030H
  0002e	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  00031	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 79   :         // Set GP0 to VSYNC.  The data-sheet says this but the v4l2 code
; 80   :         // doesn't do this for some reason.
; 81   :         WriteToSubAddress(TDA8290_GPIO1, 0x0B);

  00036	6a 0b		 push	 11			; 0000000bH
  00038	6a 20		 push	 32			; 00000020H
  0003a	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0003d	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress

; 82   :         // Set TDA8290 gate to prevent TDA8275 communication
; 83   :         WriteToSubAddress(TDA8290_GPIO2, 0x81);

  00042	68 81 00 00 00	 push	 129			; 00000081H
  00047	6a 21		 push	 33			; 00000021H
  00049	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0004c	e8 00 00 00 00	 call	 ?WriteToSubAddress@CI2CDevice@@QAEHEE@Z ; CI2CDevice::WriteToSubAddress
$LN3@Init:

; 84   :     }
; 85   : }

  00051	8b e5		 mov	 esp, ebp
  00053	5d		 pop	 ebp
  00054	c2 08 00	 ret	 8
?Init@CTDA8290@@UAEXHW4eVideoFormat@@@Z ENDP		; CTDA8290::Init
PUBLIC	??1CTDA8290@@UAE@XZ				; CTDA8290::~CTDA8290
;	COMDAT xdata$x
xdata$x	SEGMENT
__unwindtable$??1CTDA8290@@UAE@XZ DD 0ffffffffH
	DD	FLAT:__unwindfunclet$??1CTDA8290@@UAE@XZ$0
__ehfuncinfo$??1CTDA8290@@UAE@XZ DD 019930522H
	DD	01H
	DD	FLAT:__unwindtable$??1CTDA8290@@UAE@XZ
	DD	2 DUP(00H)
	DD	2 DUP(00H)
	DD	00H
	DD	00H
; Function compile flags: /Odtp
xdata$x	ENDS
;	COMDAT ??1CTDA8290@@UAE@XZ
_TEXT	SEGMENT
_this$ = -16						; size = 4
__$EHRec$ = -12						; size = 12
??1CTDA8290@@UAE@XZ PROC				; CTDA8290::~CTDA8290, COMDAT
; _this$ = ecx

; 43   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	6a ff		 push	 -1
  00005	68 00 00 00 00	 push	 __ehhandler$??1CTDA8290@@UAE@XZ
  0000a	64 a1 00 00 00
	00		 mov	 eax, DWORD PTR fs:0
  00010	50		 push	 eax
  00011	51		 push	 ecx
  00012	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  00017	33 c5		 xor	 eax, ebp
  00019	50		 push	 eax
  0001a	8d 45 f4	 lea	 eax, DWORD PTR __$EHRec$[ebp]
  0001d	64 a3 00 00 00
	00		 mov	 DWORD PTR fs:0, eax
  00023	89 4d f0	 mov	 DWORD PTR _this$[ebp], ecx
  00026	8b 45 f0	 mov	 eax, DWORD PTR _this$[ebp]
  00029	c7 00 00 00 00
	00		 mov	 DWORD PTR [eax], OFFSET ??_7CTDA8290@@6B@
  0002f	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR __$EHRec$[ebp+8], 0

; 44   : }

  00036	c7 45 fc ff ff
	ff ff		 mov	 DWORD PTR __$EHRec$[ebp+8], -1
  0003d	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00040	e8 00 00 00 00	 call	 ??1IExternalIFDemodulator@@UAE@XZ
  00045	8b 4d f4	 mov	 ecx, DWORD PTR __$EHRec$[ebp]
  00048	64 89 0d 00 00
	00 00		 mov	 DWORD PTR fs:0, ecx
  0004f	59		 pop	 ecx
  00050	8b e5		 mov	 esp, ebp
  00052	5d		 pop	 ebp
  00053	c3		 ret	 0
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__unwindfunclet$??1CTDA8290@@UAE@XZ$0:
  00000	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00003	e9 00 00 00 00	 jmp	 ??1IExternalIFDemodulator@@UAE@XZ
__ehhandler$??1CTDA8290@@UAE@XZ:
  00008	8b 54 24 08	 mov	 edx, DWORD PTR [esp+8]
  0000c	8d 42 0c	 lea	 eax, DWORD PTR [edx+12]
  0000f	8b 4a f8	 mov	 ecx, DWORD PTR [edx-8]
  00012	33 c8		 xor	 ecx, eax
  00014	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00019	b8 00 00 00 00	 mov	 eax, OFFSET __ehfuncinfo$??1CTDA8290@@UAE@XZ
  0001e	e9 00 00 00 00	 jmp	 ___CxxFrameHandler3
text$x	ENDS
??1CTDA8290@@UAE@XZ ENDP				; CTDA8290::~CTDA8290
; Function compile flags: /Odtp
;	COMDAT ??_GCTDA8290@@UAEPAXI@Z
_TEXT	SEGMENT
_this$ = -4						; size = 4
___flags$ = 8						; size = 4
??_GCTDA8290@@UAEPAXI@Z PROC				; CTDA8290::`scalar deleting destructor', COMDAT
; _this$ = ecx
  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx
  00004	89 4d fc	 mov	 DWORD PTR _this$[ebp], ecx
  00007	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0000a	e8 00 00 00 00	 call	 ??1CTDA8290@@UAE@XZ	; CTDA8290::~CTDA8290
  0000f	8b 45 08	 mov	 eax, DWORD PTR ___flags$[ebp]
  00012	83 e0 01	 and	 eax, 1
  00015	74 0c		 je	 SHORT $LN1@scalar@95
  00017	8b 4d fc	 mov	 ecx, DWORD PTR _this$[ebp]
  0001a	51		 push	 ecx
  0001b	e8 00 00 00 00	 call	 ??3@YAXPAX@Z		; operator delete
  00020	83 c4 04	 add	 esp, 4
$LN1@scalar@95:
  00023	8b 45 fc	 mov	 eax, DWORD PTR _this$[ebp]
  00026	8b e5		 mov	 esp, ebp
  00028	5d		 pop	 ebp
  00029	c2 04 00	 ret	 4
??_GCTDA8290@@UAEPAXI@Z ENDP				; CTDA8290::`scalar deleting destructor'
_TEXT	ENDS
PUBLIC	??0CTDA8290@@QAE@XZ				; CTDA8290::CTDA8290
;	COMDAT xdata$x
xdata$x	SEGMENT
__unwindtable$??0CTDA8290@@QAE@XZ DD 0ffffffffH
	DD	FLAT:__unwindfunclet$??0CTDA8290@@QAE@XZ$0
__ehfuncinfo$??0CTDA8290@@QAE@XZ DD 019930522H
	DD	01H
	DD	FLAT:__unwindtable$??0CTDA8290@@QAE@XZ
	DD	2 DUP(00H)
	DD	2 DUP(00H)
	DD	00H
	DD	00H
; Function compile flags: /Odtp
xdata$x	ENDS
;	COMDAT ??0CTDA8290@@QAE@XZ
_TEXT	SEGMENT
_this$ = -16						; size = 4
__$EHRec$ = -12						; size = 12
??0CTDA8290@@QAE@XZ PROC				; CTDA8290::CTDA8290, COMDAT
; _this$ = ecx

; 39   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	6a ff		 push	 -1
  00005	68 00 00 00 00	 push	 __ehhandler$??0CTDA8290@@QAE@XZ
  0000a	64 a1 00 00 00
	00		 mov	 eax, DWORD PTR fs:0
  00010	50		 push	 eax
  00011	51		 push	 ecx
  00012	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  00017	33 c5		 xor	 eax, ebp
  00019	50		 push	 eax
  0001a	8d 45 f4	 lea	 eax, DWORD PTR __$EHRec$[ebp]
  0001d	64 a3 00 00 00
	00		 mov	 DWORD PTR fs:0, eax
  00023	89 4d f0	 mov	 DWORD PTR _this$[ebp], ecx
  00026	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00029	e8 00 00 00 00	 call	 ??0IExternalIFDemodulator@@QAE@XZ
  0002e	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR __$EHRec$[ebp+8], 0
  00035	8b 45 f0	 mov	 eax, DWORD PTR _this$[ebp]
  00038	c7 00 00 00 00
	00		 mov	 DWORD PTR [eax], OFFSET ??_7CTDA8290@@6B@

; 40   : }

  0003e	c7 45 fc ff ff
	ff ff		 mov	 DWORD PTR __$EHRec$[ebp+8], -1
  00045	8b 45 f0	 mov	 eax, DWORD PTR _this$[ebp]
  00048	8b 4d f4	 mov	 ecx, DWORD PTR __$EHRec$[ebp]
  0004b	64 89 0d 00 00
	00 00		 mov	 DWORD PTR fs:0, ecx
  00052	59		 pop	 ecx
  00053	8b e5		 mov	 esp, ebp
  00055	5d		 pop	 ebp
  00056	c3		 ret	 0
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__unwindfunclet$??0CTDA8290@@QAE@XZ$0:
  00000	8b 4d f0	 mov	 ecx, DWORD PTR _this$[ebp]
  00003	e9 00 00 00 00	 jmp	 ??1IExternalIFDemodulator@@UAE@XZ
__ehhandler$??0CTDA8290@@QAE@XZ:
  00008	8b 54 24 08	 mov	 edx, DWORD PTR [esp+8]
  0000c	8d 42 0c	 lea	 eax, DWORD PTR [edx+12]
  0000f	8b 4a f8	 mov	 ecx, DWORD PTR [edx-8]
  00012	33 c8		 xor	 ecx, eax
  00014	e8 00 00 00 00	 call	 @__security_check_cookie@4
  00019	b8 00 00 00 00	 mov	 eax, OFFSET __ehfuncinfo$??0CTDA8290@@QAE@XZ
  0001e	e9 00 00 00 00	 jmp	 ___CxxFrameHandler3
text$x	ENDS
??0CTDA8290@@QAE@XZ ENDP				; CTDA8290::CTDA8290
PUBLIC	?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z ; CTDA8290::CreateDetectedTDA8290
;	COMDAT xdata$x
xdata$x	SEGMENT
__unwindtable$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z DD 0ffffffffH
	DD	FLAT:__unwindfunclet$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z$0
__ehfuncinfo$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z DD 019930522H
	DD	01H
	DD	FLAT:__unwindtable$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z
	DD	2 DUP(00H)
	DD	2 DUP(00H)
	DD	00H
	DD	00H
; Function compile flags: /Odtp
xdata$x	ENDS
;	COMDAT ?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z
_TEXT	SEGMENT
tv91 = -40						; size = 4
tv71 = -36						; size = 4
$T325094 = -32						; size = 4
$T325093 = -28						; size = 4
$T325090 = -24						; size = 4
$T325089 = -20						; size = 4
_pTDA8290$ = -16					; size = 4
__$EHRec$ = -12						; size = 12
_i2cBus$ = 8						; size = 4
?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z PROC ; CTDA8290::CreateDetectedTDA8290, COMDAT

; 47   : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	6a ff		 push	 -1
  00005	68 00 00 00 00	 push	 __ehhandler$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z
  0000a	64 a1 00 00 00
	00		 mov	 eax, DWORD PTR fs:0
  00010	50		 push	 eax
  00011	83 ec 1c	 sub	 esp, 28			; 0000001cH
  00014	a1 00 00 00 00	 mov	 eax, DWORD PTR ___security_cookie
  00019	33 c5		 xor	 eax, ebp
  0001b	50		 push	 eax
  0001c	8d 45 f4	 lea	 eax, DWORD PTR __$EHRec$[ebp]
  0001f	64 a3 00 00 00
	00		 mov	 DWORD PTR fs:0, eax

; 48   :     CTDA8290* pTDA8290 = new CTDA8290();

  00025	6a 0c		 push	 12			; 0000000cH
  00027	e8 00 00 00 00	 call	 ??2@YAPAXI@Z		; operator new
  0002c	83 c4 04	 add	 esp, 4
  0002f	89 45 e8	 mov	 DWORD PTR $T325090[ebp], eax
  00032	c7 45 fc 00 00
	00 00		 mov	 DWORD PTR __$EHRec$[ebp+8], 0
  00039	83 7d e8 00	 cmp	 DWORD PTR $T325090[ebp], 0
  0003d	74 0d		 je	 SHORT $LN4@CreateDete@2
  0003f	8b 4d e8	 mov	 ecx, DWORD PTR $T325090[ebp]
  00042	e8 00 00 00 00	 call	 ??0CTDA8290@@QAE@XZ	; CTDA8290::CTDA8290
  00047	89 45 dc	 mov	 DWORD PTR tv71[ebp], eax
  0004a	eb 07		 jmp	 SHORT $LN5@CreateDete@2
$LN4@CreateDete@2:
  0004c	c7 45 dc 00 00
	00 00		 mov	 DWORD PTR tv71[ebp], 0
$LN5@CreateDete@2:
  00053	8b 45 dc	 mov	 eax, DWORD PTR tv71[ebp]
  00056	89 45 ec	 mov	 DWORD PTR $T325089[ebp], eax
  00059	c7 45 fc ff ff
	ff ff		 mov	 DWORD PTR __$EHRec$[ebp+8], -1
  00060	8b 4d ec	 mov	 ecx, DWORD PTR $T325089[ebp]
  00063	89 4d f0	 mov	 DWORD PTR _pTDA8290$[ebp], ecx

; 49   : 
; 50   :     if (!pTDA8290->SetDetectedI2CAddress(i2cBus))

  00066	8b 55 08	 mov	 edx, DWORD PTR _i2cBus$[ebp]
  00069	52		 push	 edx
  0006a	8b 45 f0	 mov	 eax, DWORD PTR _pTDA8290$[ebp]
  0006d	8b 10		 mov	 edx, DWORD PTR [eax]
  0006f	8b 4d f0	 mov	 ecx, DWORD PTR _pTDA8290$[ebp]
  00072	8b 42 0c	 mov	 eax, DWORD PTR [edx+12]
  00075	ff d0		 call	 eax
  00077	85 c0		 test	 eax, eax
  00079	75 30		 jne	 SHORT $LN1@CreateDete@2

; 51   :     {
; 52   :         delete pTDA8290;

  0007b	8b 4d f0	 mov	 ecx, DWORD PTR _pTDA8290$[ebp]
  0007e	89 4d e0	 mov	 DWORD PTR $T325094[ebp], ecx
  00081	8b 55 e0	 mov	 edx, DWORD PTR $T325094[ebp]
  00084	89 55 e4	 mov	 DWORD PTR $T325093[ebp], edx
  00087	83 7d e4 00	 cmp	 DWORD PTR $T325093[ebp], 0
  0008b	74 13		 je	 SHORT $LN6@CreateDete@2
  0008d	6a 01		 push	 1
  0008f	8b 45 e4	 mov	 eax, DWORD PTR $T325093[ebp]
  00092	8b 10		 mov	 edx, DWORD PTR [eax]
  00094	8b 4d e4	 mov	 ecx, DWORD PTR $T325093[ebp]
  00097	8b 02		 mov	 eax, DWORD PTR [edx]
  00099	ff d0		 call	 eax
  0009b	89 45 d8	 mov	 DWORD PTR tv91[ebp], eax
  0009e	eb 07		 jmp	 SHORT $LN7@CreateDete@2
$LN6@CreateDete@2:
  000a0	c7 45 d8 00 00
	00 00		 mov	 DWORD PTR tv91[ebp], 0
$LN7@CreateDete@2:

; 53   :         return NULL;

  000a7	33 c0		 xor	 eax, eax
  000a9	eb 03		 jmp	 SHORT $LN2@CreateDete@2
$LN1@CreateDete@2:

; 54   :     }
; 55   :     return pTDA8290;

  000ab	8b 45 f0	 mov	 eax, DWORD PTR _pTDA8290$[ebp]
$LN2@CreateDete@2:

; 56   : }

  000ae	8b 4d f4	 mov	 ecx, DWORD PTR __$EHRec$[ebp]
  000b1	64 89 0d 00 00
	00 00		 mov	 DWORD PTR fs:0, ecx
  000b8	59		 pop	 ecx
  000b9	8b e5		 mov	 esp, ebp
  000bb	5d		 pop	 ebp
  000bc	c3		 ret	 0
_TEXT	ENDS
;	COMDAT text$x
text$x	SEGMENT
__unwindfunclet$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z$0:
  00000	8b 45 e8	 mov	 eax, DWORD PTR $T325090[ebp]
  00003	50		 push	 eax
  00004	e8 00 00 00 00	 call	 ??3@YAXPAX@Z		; operator delete
  00009	59		 pop	 ecx
  0000a	c3		 ret	 0
__ehhandler$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z:
  0000b	8b 54 24 08	 mov	 edx, DWORD PTR [esp+8]
  0000f	8d 42 0c	 lea	 eax, DWORD PTR [edx+12]
  00012	8b 4a e0	 mov	 ecx, DWORD PTR [edx-32]
  00015	33 c8		 xor	 ecx, eax
  00017	e8 00 00 00 00	 call	 @__security_check_cookie@4
  0001c	b8 00 00 00 00	 mov	 eax, OFFSET __ehfuncinfo$?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z
  00021	e9 00 00 00 00	 jmp	 ___CxxFrameHandler3
text$x	ENDS
?CreateDetectedTDA8290@CTDA8290@@SAPAV1@PAVCI2CBus@@@Z ENDP ; CTDA8290::CreateDetectedTDA8290
; Function compile flags: /Odtp
;	COMDAT ?Detect@CTDA8290@@UAEHXZ
_TEXT	SEGMENT
_this$ = -8						; size = 4
_readBuffer$ = -1					; size = 1
?Detect@CTDA8290@@UAEHXZ PROC				; CTDA8290::Detect, COMDAT
; _this$ = ecx

; 179  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	83 ec 08	 sub	 esp, 8
  00006	89 4d f8	 mov	 DWORD PTR _this$[ebp], ecx

; 180  :     BYTE readBuffer;
; 181  : 
; 182  :     // I'm not sure about this.  Maybe the value of identify needs to be tested
; 183  :     // too, and maybe it's necessary to perform read tests on other registers.
; 184  :     if (!ReadFromSubAddress(TDA8290_IDENTITY, &readBuffer, 1))

  00009	6a 01		 push	 1
  0000b	8d 45 ff	 lea	 eax, DWORD PTR _readBuffer$[ebp]
  0000e	50		 push	 eax
  0000f	6a 1f		 push	 31			; 0000001fH
  00011	8b 4d f8	 mov	 ecx, DWORD PTR _this$[ebp]
  00014	e8 00 00 00 00	 call	 ?ReadFromSubAddress@CI2CDevice@@QAEHEPAEI@Z ; CI2CDevice::ReadFromSubAddress
  00019	85 c0		 test	 eax, eax
  0001b	75 13		 jne	 SHORT $LN1@Detect@3

; 185  :     {
; 186  :         LOG(1, _T("TDA8290: not detected"));

  0001d	68 00 00 00 00	 push	 OFFSET ??_C@_1CM@JFDGNOIK@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAd?$AAe?$AAt?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?$AA@
  00022	6a 01		 push	 1
  00024	e8 00 00 00 00	 call	 ?LOG@@YAXHPB_WZZ	; LOG
  00029	83 c4 08	 add	 esp, 8

; 187  :         return FALSE;

  0002c	33 c0		 xor	 eax, eax
  0002e	eb 19		 jmp	 SHORT $LN2@Detect@3
$LN1@Detect@3:

; 188  :     }
; 189  : 
; 190  :     LOG(1, _T("TDA8290: $1F = 02x"), readBuffer);

  00030	0f b6 4d ff	 movzx	 ecx, BYTE PTR _readBuffer$[ebp]
  00034	51		 push	 ecx
  00035	68 00 00 00 00	 push	 OFFSET ??_C@_1CG@HPNAGKAN@?$AAT?$AAD?$AAA?$AA8?$AA2?$AA9?$AA0?$AA?3?$AA?5?$AA$?$AA1?$AAF?$AA?5?$AA?$DN?$AA?5?$AA0?$AA2?$AAx?$AA?$AA@
  0003a	6a 01		 push	 1
  0003c	e8 00 00 00 00	 call	 ?LOG@@YAXHPB_WZZ	; LOG
  00041	83 c4 0c	 add	 esp, 12			; 0000000cH

; 191  :     return TRUE;

  00044	b8 01 00 00 00	 mov	 eax, 1
$LN2@Detect@3:

; 192  : }

  00049	8b e5		 mov	 esp, ebp
  0004b	5d		 pop	 ebp
  0004c	c3		 ret	 0
?Detect@CTDA8290@@UAEHXZ ENDP				; CTDA8290::Detect
END
