QuakeGod
2024-11-25 9aed5d7e7b3c7bf09da712e9c272ece401a7acc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "BoardType.h"
#include "KMachine.h"
#include "KBus.h"
 
extern int __Vectors;
 
#define  APP_ADDR                      0x08001000  //Ó¦ÓóÌÐòÊ×µØÖ·¶¨Òå (int)(unsigned char *)(&__Vectors)
#define  APPINFOBLOCK_ADDR          (APP_ADDR + 0x100)  //³ÌÐòÐÅÏ¢¿é µØÖ·
#define  INFOBLOCK_ADDR          (APP_ADDR + 0x1000)  //ÐÅÏ¢¿é µØÖ·
 
#define  APP_START_ADDR                     IROM1_START_ADDRESS
extern int Region$$Table$$Limit;
 
#define MAKE_VER(x,y) ((x<<8)|y)
#define APP_VER MAKE_VER(1,18)
 
const stAppInfoBlock AppInfoBlock __attribute__((at(APPINFOBLOCK_ADDR))) =
{
    0xAA55,            // StartSign
    0x0301,            // BlockType
    sizeof(stAppInfoBlock),        //BlockSize
    0,                                                    // Pad,
    APP_VER,                                //AppVer                        
    (BOARD_TYPE<<8) + BOARD_VER,                //AppDevice;
    0x1000,                                //AppSize;
    0x0C00,                                //AppDataSize;
    APP_ADDR,                        //nAppStartAddr
    (int)&Region$$Table$$Limit,                        //nBtldr_NewAppInfoAddr
    0x08009000,                        //nBtldr_NewAppAddr
    0xCCCC,                                //crc16;
    0xAA55                                //EndSign;    
    
};
 
 
const stKMInfoBlock KMInfoBlock __attribute__((at(INFOBLOCK_ADDR))) =
{
//    sizeof(stKMInfoBlock),
    (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceType     BOARD_VER,            //nDevieVer
    APP_VER,            //ProgVer
    0x0102,            //KLinkVer
    KBUS_VER,            //KBusVer
//    0x0100,            //KNetVer
//    0x0100,            //KWLVer
    
    4,                    //nCapacity1    ?K
    1,                    //nCapacity2    ?k
    
    DINPUT,                    //nDInput;
    DOUTPUT,                //nDOutput
    
    0,                    //nAInput
    0,                    //nAOutput
    0,                    //nHInput
    0,                    //nHOutput
    0,                    //nExt1;
    0,                    //nExt2;
    0,                    //nLogSize;
    2,                    //nPorts;
    0,                    //nManSize;
    0,                    //nAbility;
    6,                    //nSwitchBits;
};
 
 
const stDeviceInfo MyDeviceInfo={
        
        (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceTypeVer //    unsigned short ClientType;        // ×Ó»úÀàÐÍ
        APP_VER,            //ProgVer                    //    unsigned short ClientVer;            // ×Ó»ú°æ±¾
 
        DINPUT,                                                //    unsigned char InBitCount;            // ÊäÈ뿪¹ØÁ¿ÊýÁ¿
        DOUTPUT,                                            //    unsigned char OutBitCount;        // Êä³ö¿ª¹ØÁ¿ÊýÁ¿
        0,                                //    unsigned char InDWCount;            // ÊäÈëÊý¾Ý×ÖÊý
        0,                                //    unsigned char OutDWCount;            // Êä³öÊý¾Ý×ÖÊý
        0,                                //    unsigned char AIWCount;                // ÊäÈëÄ£ÄâÁ¿Í¨µÀ(×Ö)Êý    // 16λΪһ¸ö×Ö(ͨµÀ)
        0,                                //    unsigned char AQWCount;                // Êä³öÄ£ÄâÁ¿Í¨µÀ(×Ö)Êý    // 16λΪһ¸ö×Ö(ͨµÀ)
//    0,                                //    unsigned char AIBits;                    //  Ã¿Í¨µÀλÊý        // 16λÒÔÏÂ
//    0,                                //    unsigned char AQbits;                    //    Ã¿Í¨µÀλÊý        // 16λÒÔÏÂ
};
 
const stExDeviceInfo MyExDeviceInfo ={
        (BOARD_TYPE<<8) + BOARD_VER,            //nDeviceTypeVer //    unsigned short ClientType;        // ×Ó»úÀàÐÍ
        APP_VER,            //ProgVer                    //    unsigned short ClientVer;            // ×Ó»ú°æ±¾
 
        DINPUT,                                                //    unsigned char InBitCount;            // ÊäÈ뿪¹ØÁ¿ÊýÁ¿
        DOUTPUT,                                            //    unsigned char OutBitCount;        // Êä³ö¿ª¹ØÁ¿ÊýÁ¿
        0,                                //    unsigned char InDWCount;            // ÊäÈëÊý¾Ý×ÖÊý
        0,                                //    unsigned char OutDWCount;            // Êä³öÊý¾Ý×ÖÊý    
        0,                                //    unsigned char AIWCount;                // ÊäÈëÄ£ÄâÁ¿Í¨µÀ(×Ö)Êý    // 16λΪһ¸ö×Ö(ͨµÀ)
        0,                                //    unsigned char AQWCount;                // Êä³öÄ£ÄâÁ¿Í¨µÀ(×Ö)Êý    // 16λΪһ¸ö×Ö(ͨµÀ)
//    0,                                //    unsigned char AIBits;                    //  Ã¿Í¨µÀλÊý        // 16λÒÔÏÂ
//    0,                                //    unsigned char AQbits;                    //    Ã¿Í¨µÀλÊý        // 16λÒÔÏÂ
 
};