summaryrefslogtreecommitdiff
path: root/src/libleo/leo/leoinquiry.c
blob: b23a9ab4548f7c772f16c97b35475dd519288387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "ultra64.h"
#include "ultra64/leo.h"
#include "ultra64/leoappli.h"
#include "ultra64/leodrive.h"

void leoInquiry(void) {
    u32 asic_id;
    u32 asic_data;

    osEPiReadIo(LEOPiInfo, ASIC_ID_REG, &asic_id);
    if (leoSend_asic_cmd_w(0x1B0000, 0) == 0) {
        osEPiReadIo(LEOPiInfo, ASIC_DATA, &asic_data);
        if (asic_data & 0x10000) {
            asic_id |= 0x100000;
        }
    }

    ((LEOCmdInquiry*)LEOcur_command)->devType = 0;
    ((LEOCmdInquiry*)LEOcur_command)->version = asic_id >> 0x10;
    ((LEOCmdInquiry*)LEOcur_command)->devNum = 1;
    ((LEOCmdInquiry*)LEOcur_command)->leoBiosVer = 0;
    LEOcur_command->header.status = LEO_STATUS_GOOD;
}