View Single Post
Old 12-28-2013, 12:40 PM   #354
Td-d
Garden variety obsessive
 
Join Date: Oct 2013
Drives: 2009 Sti Hatch; 2015 Audi RSQ3
Location: South Africa
Posts: 532
Thanks: 54
Thanked 448 Times in 245 Posts
Mentioned: 74 Post(s)
Hmm.. Ztan, can you have a look at the following code - normally, the SSMGet routines fetch a float direct parameter, run it through a makeuint 8 or makeuint16 subroutine, and pop out the SSM parameter - this is the way MAF voltage is pulled in the SH7058 roms.

This one pulls another subroutine, which I have not had the patience to pull apart in understanding Maybe you can have a look?

here is the SSMGet routine:
Code:
ROM:000842BC SsmGet_Mass_Airflow_Sensor_Voltage_P18: ; DATA XREF: ROM:00097234o
ROM:000842BC                 movmu.l r14, @-r15      ; Move Multi-register Upper part
ROM:000842BE                 mov     r4, r14         ; Move Data
ROM:000842C0                 mov.l   #sub_12FCC, r2  ; Move Immediate Long Data
ROM:000842C2                 jsr     @R2 ; sub_12FCC ; Jump to Subroutine
ROM:000842C4                 mov     #h'2C, r4 ; ',' ; Move Immediate Byte Data
ROM:000842C6                 extu.w  r0, r6          ; Extend as Unsigned (Word)
ROM:000842C8                 lds     r6, fpul        ; Load to System Register
ROM:000842CA                 float   fpul, fr4       ; Floating-point convert from integer
ROM:000842CC                 mova    flt_84464, r0   ; Move Effective Address
ROM:000842CE                 fmov.s  @r0, fr8        ; Floating-point move single precision
ROM:000842D0                 fmul    fr8, fr4        ; Floating-point multiply
ROM:000842D2                 mov.l   #ConvertTo_uint8, r2 ; Move Immediate Long Data
ROM:000842D4                 fldi0   fr6             ; Floating-point load immediate 0.0
ROM:000842D6                 mova    flt_84468, r0   ; Move Effective Address
ROM:000842D8                 jsr     @R2 ; ConvertTo_uint8 ; Jump to Subroutine
ROM:000842DA                 fmov.s  @r0, fr5        ; Floating-point move single precision
ROM:000842DC                 mov.b   r0, @r14        ; Move Byte Data
ROM:000842DE                 movmu.l @r15+, r14      ; Move Multi-register Upper part
ROM:000842E0                 rts/n                   ; Return from Subroutine with No delay slot
And this is the subroutine it jumps to:
Code:
ROM:00012FCC sub_12FCC:                              ; CODE XREF: sub_2A822+18p
ROM:00012FCC                                         ; sub_2AD74+Cp ...
ROM:00012FCC
ROM:00012FCC var_8           = -8
ROM:00012FCC var_7           = -7
ROM:00012FCC
ROM:00012FCC                 sts.l   pr, @-r15       ; Store System Register Long
ROM:00012FCE                 add     #-4, r15        ; Add binary
ROM:00012FD0                 mov.w   r4, @r15        ; Move Word Data
ROM:00012FD2                 movu.b  @(0,r15), r0    ; Move Structure Byte Data as Unsigned
ROM:00012FD6                 tst     r0, r0          ; Test Logical
ROM:00012FD8                 bt      loc_12FE6       ; Branch if True
ROM:00012FDA                 cmp/eq  #1, r0          ; Compare: Equal
ROM:00012FDC                 bt      loc_12FF2       ; Branch if True
ROM:00012FDE                 cmp/eq  #2, r0          ; Compare: Equal
ROM:00012FE0                 bt      loc_12FFE       ; Branch if True
ROM:00012FE2                 bra     loc_1300A       ; Branch
ROM:00012FE4                 nop                     ; No Operation
ROM:00012FE6 ; ---------------------------------------------------------------------------
ROM:00012FE6
ROM:00012FE6 loc_12FE6:                              ; CODE XREF: sub_12FCC+Cj
ROM:00012FE6                 mov.b   @(1,r15), r0    ; Move Structure Byte Data
ROM:00012FE8                 mov.l   #sub_129C4, r1  ; Move Immediate Long Data
ROM:00012FEA                 jsr     @r1 ; sub_129C4 ; Jump to Subroutine
ROM:00012FEC                 mov     r0, r4          ; Move Data
ROM:00012FEE                 bra     loc_1300C       ; Branch
ROM:00012FF0                 mov     r0, r2          ; Move Data
ROM:00012FF2 ; ---------------------------------------------------------------------------
ROM:00012FF2
ROM:00012FF2 loc_12FF2:                              ; CODE XREF: sub_12FCC+10j
ROM:00012FF2                 movu.b  @(1,r15), r0    ; Move Structure Byte Data as Unsigned
ROM:00012FF6                 mov.l   #unk_FFF848FE, r5 ; Move Immediate Long Data
ROM:00012FF8                 shll    r0              ; Shift Logical Left
ROM:00012FFA                 bra     loc_1300C       ; Branch
ROM:00012FFC                 mov.w   @(r0,r5), r2    ; Move Word Data
ROM:00012FFE ; ---------------------------------------------------------------------------
ROM:00012FFE
ROM:00012FFE loc_12FFE:                              ; CODE XREF: sub_12FCC+14j
ROM:00012FFE                 movu.b  @(1,r15), r0    ; Move Structure Byte Data as Unsigned
ROM:00013002                 mov.l   #unk_FFF8490E, r6 ; Move Immediate Long Data
ROM:00013004                 shll    r0              ; Shift Logical Left
ROM:00013006                 bra     loc_1300C       ; Branch
ROM:00013008                 mov.w   @(r0,r6), r2    ; Move Word Data
ROM:0001300A ; ---------------------------------------------------------------------------
ROM:0001300A
ROM:0001300A loc_1300A:                              ; CODE XREF: sub_12FCC+16j
ROM:0001300A                 mov     #0, r2          ; Move Immediate Byte Data
ROM:0001300C
ROM:0001300C loc_1300C:                              ; CODE XREF: sub_12FCC+22j
ROM:0001300C                                         ; sub_12FCC+2Ej ...
ROM:0001300C                 add     #4, r15         ; Add binary
ROM:0001300E                 lds.l   @r15+, pr       ; Load to System Register Long
ROM:00013010                 rtv/n   r2
Td-d is offline   Reply With Quote