亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dbgmain.c

?? program to simulate tank levels
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************

                          D B G M A I N . C


This module has the startup and debugging code.


Copyright 1999 by Addison Wesley Longman, Inc.

All rights reserved.  No part of this document or the 
computer-coded information from which it is derived may be 
reproduced, stored in a retrieval system, or transmitted, in 
any form or by any means -- electronic, mechanical, 
photocopying, recording or otherwise -- without the prior 
written permission of Addison Wesley Longman, Inc.


                     C H A N G E   R E C O R D

  Date        Who            Description
--------  ------------  -----------------------------------------
05/08/99  DES           Module released
****************************************************************/

/* System Include Files */
#include "os_cfg.h"
#include "ix86s.h"
#include "ucos.h"
#include "probstyl.h"
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

/* Program Include Files */
#include "publics.h"

/* Local Defines */

   /* DOS screen display parameters */

      /* Dividing line between dbg control and system display */
      #define DBG_SCRN_DIV_X        32

      /* Rows on debug control screen */
      #define DBG_SCRN_TIME_ROW     12 
      #define DBG_SCRN_FLOAT_ROW    22

      /* Button locations */
      #define DBG_SCRN_BTN_X        35
      #define DBG_SCRN_BTN_Y        17
      #define DBG_SCRN_BTN_WIDTH    7
      #define DBG_SCRN_BTN_HEIGHT   2
      #define DBG_SCRN_BTN_COLOR          GREEN
      #define DBG_SCRN_BTN_BLINK_COLOR    RED

      /* System display */
      #define DBG_SCRN_DISP_X       33
      #define DBG_SCRN_DISP_Y       13
      #define DBG_SCRN_DISP_WIDTH   20

      /* System printer */
      #define DBG_SCRN_PRNTR_X      57
      #define DBG_SCRN_PRNTR_Y      5
      #define DBG_SCRN_PRNTR_WIDTH  20
      #define DBG_SCRN_PRNTR_HEIGHT 15

      /* Bell display */
      #define DBG_SCRN_BELL_X       43
      #define DBG_SCRN_BELL_Y       5
      #define DBG_SCRN_BELL_WIDTH   10
      #define DBG_SCRN_BELL_HEIGHT  3

   /* Line drawing characters for text mode */
      #define LINE_HORIZ      196
      #define LINE_VERT       179
      #define LINE_CORNER_NW  218
      #define LINE_CORNER_NE  191
      #define LINE_CORNER_SE  217
      #define LINE_CORNER_SW  192
      #define LINE_T_W        195
      #define LINE_T_N        194
      #define LINE_T_E        180
      #define LINE_T_S        193
      #define LINE_CROSS      197


/* Static Functions */
   static void vUtilityDrawBox (int ixNW, int iyNW, 
      int ixSize, int iySize);
   static void vUtilityDisplayFloatLevels (void);
   static void vUtilityPrinterDisplay (void);

/* Static Data */

   /* Data for displaying and getting buttons */
      #define BUTTON_ROWS        3
      #define BUTTON_COLUMNS     3

      static char *p_chButtonText[BUTTON_ROWS][BUTTON_COLUMNS] =
      {
         {" PRT ", "  1  ", "TIME "},
         {" HST ", "  2  ", NULLP},
         {" ALL ", "  3  ", " RST "}
      };

      static char a_chButtonKey[BUTTON_ROWS][BUTTON_COLUMNS] =
      {
         {'P', '1', 'T'},
         {'H', '2', '\x00'},
         {'A', '3', 'R'}
      };

      /* Button the user pressed. */
      static WORD wButton; 

   /* Printer state. */
      /* Printed lines. */
      static char aa_charPrinted
            [DBG_SCRN_PRNTR_HEIGHT][DBG_SCRN_PRNTR_WIDTH + 1];

      /* Printing a line now. */
      static int iPrinting = 0;

   /* Debug variables for reading the tank levels. */
      /* Float levels. */
      static int a_iTankLevels[COUNTOF_TANKS] = 
         {4000, 7200, 6400};

      /* Which tank the system asked about.  NO_TANK means that 
         the simulated float hardware is not reading. */
      static int iTankToRead = NO_TANK;

      /* Which tank the user is changing. */
      static int iTankChanging = 0;

   /* Is time passing automatically? */
      static BOOL fAutoTime = FALSE;

   /* Tasks and stacks for debugging */
      #define STK_SIZE 1024
      UWORD DebugKeyStk[STK_SIZE];
      UWORD DebugTimerStk[STK_SIZE];
      static void far vDebugKeyTask(void *data);
      static void far vDebugTimerTask(void *data);
      static OS_EVENT *semDOS;

   /* Place to store DOS timer interrupt vector. */
      static void interrupt far (*OldTickISR)(void);


/*****   main   *************************************************

This routine starts the system.

RETURNS: None.

*/

void main(

/*
INPUTS:  */
   void)
{

/*
LOCAL VARIABLES:  */

/*-------------------------------------------------------------*/

   /* Set up timer and uC/OS interrupts */
   OldTickISR = getvect(0x08);
   setvect(uCOS, (void interrupt (*)(void))OSCtxSw);
   setvect(0x81, OldTickISR);

   /* Start the real system */
   vEmbeddedMain ();

}  


/*****   vHardwareInit   ****************************************

This routine initializes the fake hardware.

RETURNS: None.

*/

void vHardwareInit (

/*
INPUTS:  */
   void)
{

/*
LOCAL VARIABLES:  */
   int iColumn, iRow;   /* Iterators */
   BYTE byErr;          /* Place for OS to return an error. */

/*-------------------------------------------------------------*/

   /* Start the debugging tasks. */
   OSTaskCreate(vDebugTimerTask, NULLP, 
      (void *)&DebugTimerStk[STK_SIZE], 
      TASK_PRIORITY_DEBUG_TIMER);
   OSTaskCreate(vDebugKeyTask,  NULLP, 
      (void *)&DebugKeyStk[STK_SIZE], 
      TASK_PRIORITY_DEBUG_KEY);

   /* Initialize the DOS protection semaphore */
   semDOS = OSSemCreate (1);
   
   /* Set up the debugging display on the DOS screen */
   OSSemPend (semDOS, WAIT_FOREVER, &byErr);
   clrscr();

   /* Divide the screen. */
   for (iRow = 1; iRow < 25; ++iRow)
   {
      gotoxy (DBG_SCRN_DIV_X, iRow);
      cprintf ("%c", LINE_VERT);
   }

   /*  Set up the debug side of the screen */
   gotoxy (7,2);
   cprintf ("    D E B U G");

   gotoxy (1,4);
   cprintf ("These keys press buttons:");
   gotoxy (1,5);
   cprintf  ("    P   1   T");
   gotoxy (1,6);
   cprintf  ("    H   2");
   gotoxy (1,7);
   cprintf  ("    A   3   R");
   gotoxy (1,9);
   cprintf  ("Press 'X' to exit the program");
   gotoxy (1,10);
   cprintf ("---------------------------");

   gotoxy (1, DBG_SCRN_TIME_ROW - 1);
   cprintf ("TIME:");
   gotoxy (1, DBG_SCRN_TIME_ROW);
   cprintf ("  '!' to make 1/3 second pass");
   gotoxy (1, DBG_SCRN_TIME_ROW + 1);
   cprintf ("  '@' to toggle auto timer");
   gotoxy (1, DBG_SCRN_TIME_ROW + 3);
   cprintf ("Auto-time is:");
   gotoxy (15, DBG_SCRN_TIME_ROW + 3);
   textbackground (RED);
   cprintf (" OFF ");
   textbackground (BLACK);
   gotoxy (1, DBG_SCRN_TIME_ROW + 4);
   cprintf ("---------------------------");

   /* Display the current tank levels. */
   gotoxy (1, DBG_SCRN_FLOAT_ROW - 4);
   cprintf ("FLOATS:");
   gotoxy (1, DBG_SCRN_FLOAT_ROW - 3);
   cprintf ("  '<' and '>' to select float");
   gotoxy (1, DBG_SCRN_FLOAT_ROW - 2);
   cprintf ("  '+' and '-' to change level");
   gotoxy (1, DBG_SCRN_FLOAT_ROW);
   cprintf ("Tank");
   gotoxy (1, DBG_SCRN_FLOAT_ROW + 2);
   cprintf ("Level");

   vUtilityDisplayFloatLevels ();

   /* Start with the buttons. */
   textbackground (DBG_SCRN_BTN_COLOR);
   for (iRow = 0; iRow < BUTTON_ROWS; ++iRow)
      for (iColumn = 0; iColumn < BUTTON_COLUMNS; ++iColumn)
      {
         if (p_chButtonText[iRow][iColumn] IS_NOT NULLP)
         {
            gotoxy (DBG_SCRN_BTN_X + iColumn*DBG_SCRN_BTN_WIDTH,
                  DBG_SCRN_BTN_Y + iRow * DBG_SCRN_BTN_HEIGHT);
            cprintf ("%s", p_chButtonText[iRow][iColumn]);
         }
      }
   textbackground (BLACK);

   /*  Set up the system side of the screen */
   gotoxy (DBG_SCRN_DIV_X + 14, 2);
   cprintf ("    S Y S T E M");

   /* Draw the display */
   vUtilityDrawBox (DBG_SCRN_DISP_X, DBG_SCRN_DISP_Y, 
      DBG_SCRN_DISP_WIDTH, 1);

   /* Draw the printer */
   vUtilityDrawBox (DBG_SCRN_PRNTR_X, DBG_SCRN_PRNTR_Y, 
         DBG_SCRN_PRNTR_WIDTH, DBG_SCRN_PRNTR_HEIGHT);
   vUtilityDrawBox (DBG_SCRN_PRNTR_X, 
         DBG_SCRN_PRNTR_Y + DBG_SCRN_PRNTR_HEIGHT + 1,
         DBG_SCRN_PRNTR_WIDTH, 1);
   gotoxy (DBG_SCRN_PRNTR_X + 1, 
         DBG_SCRN_PRNTR_Y + DBG_SCRN_PRNTR_HEIGHT + 2);
   cprintf ("  ^^  PRINTER  ^^  ");

   /* Initialize printer lines. */
   for (iRow = 0; iRow < DBG_SCRN_PRNTR_HEIGHT; ++iRow)
      strcpy (aa_charPrinted[iRow], "");

   /* Draw the bell. */
   vUtilityDrawBox (DBG_SCRN_BELL_X, DBG_SCRN_BELL_Y, 
      DBG_SCRN_BELL_WIDTH, 
      DBG_SCRN_BELL_HEIGHT);
   gotoxy (DBG_SCRN_BELL_X + 1, DBG_SCRN_BELL_Y + 2);
   cprintf ("   BELL   ");

   OSSemPost (semDOS);

}  


/*****   vDebugKeyTask   ****************************************

This routine gets keystrokes from DOS and feeds them to the rest 
of the system.

RETURNS: None.

*/

static void far vDebugKeyTask(

/*
INPUTS:  */
   void *p_vData)
{

/*
LOCAL VARIABLES:  */
   int iKey;                  /* DOS key the user struck */
   int iColumn = 0, iRow = 0; /* System button activated. */
   BOOL fBtnFound = FALSE;    /* TRUE if sys button pressed. */
   BYTE byErr;                /* Place for OS to return error. */

/*-------------------------------------------------------------*/

   /* Keep the compiler happy. */
   p_vData = p_vData;

   /* Redirect the DOS timer interrupt to uC/OS */
   setvect(0x08, (void interrupt (*)(void))OSTickISR);

   while (TRUE) 
   {
      /* Wait for keys to come in */
      OSTimeDly(2);

      /* Are we printing a line? */
      if (iPrinting)
      {    
         /* Yes. */
         --iPrinting;

         if (iPrinting IS 0)
            /* We have finished.  Call the interrupt routine. */
            vPrinterInterrupt ();
      }

      /* Unblink a button, if necessary. */
      if (fBtnFound)
      {
         OSSemPend (semDOS, WAIT_FOREVER, &byErr);
         textbackground (DBG_SCRN_BTN_COLOR);
         gotoxy (DBG_SCRN_BTN_X + iColumn * DBG_SCRN_BTN_WIDTH,
            DBG_SCRN_BTN_Y + iRow * DBG_SCRN_BTN_HEIGHT);
         cprintf ("%s", p_chButtonText[iRow][iColumn]);
         textbackground (BLACK);
         OSSemPost (semDOS);
         fBtnFound = FALSE;
      }

      /* If the system set up the floats, 
         cause the float interrupt. */
      if (iTankToRead IS_NOT NO_TANK)
         vFloatInterrupt ();

      /* See if the tester-user has pressed a DOS key. */
      OSSemPend (semDOS, WAIT_FOREVER, &byErr);
      if (kbhit()) 
      {
         /* He has.  Get the key */
         iKey = getch ();
         switch (iKey) 
         {
            case '!':
               /* If time is not passing automatically, 
                  make 1/3 second pass */
               if (!fAutoTime)
                  vTimerOneThirdSecond ();
               break;

            case '@':
               /* Toggle the state of the automatic timer */
               fAutoTime = !fAutoTime;

               /* . . . and display the result. */
               if (fAutoTime)
               {
                  gotoxy (15, DBG_SCRN_TIME_ROW + 3);
                  textbackground (GREEN);
                  cprintf ("  ON ");
                  textbackground (BLACK);
               }
               else
               {
                  gotoxy (15, DBG_SCRN_TIME_ROW + 3);
                  textbackground (RED);
                  cprintf (" OFF ");
                  textbackground (BLACK);
               }
               break;

            case 't':
            case 'T':
            case '1':
            case '2':
            case '3':
            case 'r':
            case 'R':
            case 'p':
            case 'P':
            case 'a':
            case 'A':
            case 'h':
            case 'H':

               /* Note which button has been pressed. */
               wButton = toupper (iKey);

               iRow = 0;
               fBtnFound = FALSE;
               while (iRow < BUTTON_ROWS AND !fBtnFound)
               {
                  iColumn = 0;
                  while (iColumn < BUTTON_COLUMNS AND !fBtnFound)
                  {
                     if (wButton IS 
                           (WORD) a_chButtonKey[iRow][iColumn])
                        fBtnFound = TRUE;
                     else
                        ++iColumn;
                  }                          
                  if (!fBtnFound)                
                     ++iRow;
               }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久亚洲综合网| 欧美色大人视频| 亚洲成人av电影| 久久久.com| 欧美日韩一区二区三区四区| 国产精品538一区二区在线| 精品日产卡一卡二卡麻豆| 欧美日韩精品专区| 国产麻豆精品在线观看| 亚洲精品中文在线观看| 久久久精品免费观看| 欧美变态tickle挠乳网站| 欧美日韩国产精品成人| 日韩av一区二区三区| 亚洲自拍欧美精品| 欧美日韩国产不卡| 欧美日韩免费观看一区二区三区| 精品亚洲成a人| 国产中文字幕精品| 亚洲综合色噜噜狠狠| 亚洲精品欧美二区三区中文字幕| 中文字幕在线观看不卡| 国产区在线观看成人精品| 日韩亚洲欧美成人一区| 东方aⅴ免费观看久久av| 成人免费三级在线| 国产成人在线视频播放| 国产一区二区成人久久免费影院| 亚洲1区2区3区4区| 天天av天天翘天天综合网色鬼国产| 精品日韩av一区二区| 国产片一区二区| 亚洲精品在线观| 一区在线中文字幕| 亚洲美腿欧美偷拍| 奇米精品一区二区三区在线观看| 韩国精品一区二区| 国产**成人网毛片九色| av一区二区三区| 欧美精品99久久久**| 欧美一级生活片| 中文字幕一区二区三区在线不卡 | 欧美影院一区二区三区| 欧美久久久久免费| 国产亚洲1区2区3区| 亚洲综合色自拍一区| 欧美国产激情二区三区| 一区二区三区在线视频观看| 国产精品久久久久一区二区三区共| 一区二区三区四区五区视频在线观看| 舔着乳尖日韩一区| 美腿丝袜一区二区三区| 欧美日韩一区二区三区视频| 欧美高清在线一区二区| 亚洲香蕉伊在人在线观| 99久精品国产| 中文字幕一区二区三区色视频| 国产精品欧美一级免费| 午夜精品久久久久久久久久| 国产精品久久毛片| 亚洲综合免费观看高清在线观看| 麻豆成人久久精品二区三区红| 日韩美女久久久| 99九九99九九九视频精品| 777a∨成人精品桃花网| 亚洲日本中文字幕区| 亚洲最新视频在线播放| 成人激情图片网| 国产精品人妖ts系列视频| 中文字幕日韩一区| 韩国精品主播一区二区在线观看| 99精品欧美一区二区三区综合在线| 欧美xxxx在线观看| 国模一区二区三区白浆| 精品国产sm最大网站免费看| 午夜欧美视频在线观看| 久久99精品久久久久久久久久久久 | 日韩视频一区二区| 国产在线视视频有精品| 欧美精品一区二区三区四区| 综合欧美亚洲日本| 91精品办公室少妇高潮对白| 一区二区三区成人| 日韩avvvv在线播放| 日韩美一区二区三区| 国产经典欧美精品| 日韩精品中午字幕| 成人免费观看av| 亚洲精品乱码久久久久久久久| 91国内精品野花午夜精品| 亚洲一区二区三区三| 精品久久久久99| 国产成人日日夜夜| 久久99国产精品免费| 日韩国产一区二| 五月开心婷婷久久| 一区二区激情小说| 亚洲一级二级三级在线免费观看| 国产精品久久久久久久第一福利| 日韩亚洲国产中文字幕欧美| 3atv一区二区三区| 欧美日韩mp4| 欧美精品一二三| 91精品国产综合久久福利| 日韩欧美在线综合网| 欧美一区二区三区日韩视频| 日韩一级高清毛片| 亚洲精品在线观看视频| 久久午夜电影网| 国产精品成人午夜| 亚洲主播在线播放| 五月天激情综合网| 韩国三级中文字幕hd久久精品| 国产精品一卡二卡在线观看| a级精品国产片在线观看| voyeur盗摄精品| 欧美手机在线视频| 精品乱人伦小说| 欧美午夜精品理论片a级按摩| 欧洲精品视频在线观看| 在线观看91av| 国产网红主播福利一区二区| 国产日韩综合av| 婷婷开心激情综合| 国产iv一区二区三区| 欧美视频在线不卡| 久久久久久99精品| 一区二区三区四区在线免费观看 | 亚洲成人免费av| 国产精品一二二区| 欧美日韩在线免费视频| 精品久久久久久无| 中文字幕亚洲在| 极品少妇xxxx精品少妇偷拍| 色综合视频一区二区三区高清| 日韩欧美国产一区二区在线播放 | 一区二区三区小说| 成人动漫在线一区| 26uuu国产日韩综合| 亚洲成人一区二区在线观看| 粉嫩av一区二区三区在线播放 | 裸体一区二区三区| 91色综合久久久久婷婷| 久久久久综合网| 蜜臀av性久久久久av蜜臀妖精| 色综合一区二区三区| 国产精品色在线| 国产.欧美.日韩| 欧美精品一区二区三区四区| 蜜乳av一区二区| 日韩精品专区在线影院重磅| 日韩精品成人一区二区在线| 在线观看国产日韩| 久久久午夜精品理论片中文字幕| 午夜视频久久久久久| 91国模大尺度私拍在线视频| 一区二区视频在线看| 日本韩国一区二区三区视频| 一区二区三区av电影| 免费一区二区视频| 欧美电视剧在线看免费| 国产一区二区美女| 国产清纯美女被跳蛋高潮一区二区久久w | 在线观看91精品国产入口| 伊人色综合久久天天| 欧美优质美女网站| 视频在线观看国产精品| 欧美一级一区二区| 国产乱子轮精品视频| 精品日产卡一卡二卡麻豆| 成人激情校园春色| 亚洲在线中文字幕| 欧美日韩免费电影| 激情综合色播激情啊| 国产精品第四页| www亚洲一区| 91视频在线看| 久久疯狂做爰流白浆xx| 一区二区中文字幕在线| 91精品视频网| 91丨porny丨中文| 老司机精品视频在线| 亚洲欧美精品午睡沙发| 日韩一区二区电影在线| 91网上在线视频| 国产精品911| 日韩1区2区日韩1区2区| **性色生活片久久毛片| www国产成人| 欧美日韩午夜精品| 色域天天综合网| 成人小视频免费观看| 亚洲一区二区三区小说| 欧美激情一区二区三区四区| 91国偷自产一区二区开放时间| 亚洲激情图片qvod| 日韩一区二区精品葵司在线| 国产精品香蕉一区二区三区| 久久综合九色综合欧美就去吻| 色综合久久88色综合天天免费|