Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > C/C++ программирование > Общие вопросы C/C++
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 08.06.2010, 16:36   #1
Gerberka
Пользователь
 
Регистрация: 05.04.2010
Сообщений: 14
По умолчанию сделайти если не трудно ехе файл, прога есть

Код:
#include <conio.h>
#include <stdio.h>
#include <dos.h>
#include <string.h>
///////////////////////////////////////////////////////////////
//Параметры текстового режима
#define MENUX 35   //Размеры окошка
#define MENUY 4
#define FONSIM 177 //Фоновый символ
#define FONCOL 0x25 //Фоновый цвет
#define ZAGLCOL 0x34 //Цвет заглавия
#define MENUCOL 0x24 //Цвет меню
#define BACKCOL 0x12 //Теневой цвет
///////////////////////////////////////////////////////////////
//Параметры графического режима
#define MAXX 640
#define MAXY 200
#define MAXCOL 16
///////////////////////////////////////////////////////////////
//Граф. плата
#define EGA_GRAPHICS 0x3ce //Регистры контроллера EGA
#define EGA_GR_SET_RESET 0 //Регистр установки/сброса
#define EGA_GR_ENABLE_SET_RESET 1 //Регистр разрешения установки/сброса
#define EGA_GR_DATA_ROTATE 3 //Регистр сдвига и способа записи
#define EGA_GR_MODE 5   //Регистр режима
#define EGA_GR_BIT_MASK 8 //Регистр битовой маски
///////////////////////////////////////////////////////////////
//Человек, перешагивающий препятствие
//Параметры преграды
#define PAUSE 250
#define PREGRX 100 //Координаты преграды
#define PREGRY 100
#define PREGRC 2   //Цвет
char pregr[6]={0xff,0xff,0xff,0xff,0xff,0xff}; //Спрайт
//Параметры спрайта человечка ╧1
char man1[14]={0x1c,0x3e,0x3e,0x8,0x3e,0x3e,0x3e,0x3e,0x3e,0x8,0x8,0x8,0x8,0x8};
char man2[14]={0,0x1c,0x3e,0x3e,0x8,0x3e,0x3e,0x3e,0x3e,0x3e,0x8,0x8,0x4,0x8};
char man3[14]={0,0,0x1c,0x3e,0x3e,0x8,0x3e,0x3e,0x3e,0x3e,0x3e,0x4,0x2,0x4};
#define MAN1X 83
#define MAN1Y 92
#define MAN1C 3
#define MAN2X 110
#define MAN2Y 92
#define MAN2C 3
unsigned manx[12]={83,83,85,87,92,95,100,103,106,108,110,110};
unsigned many[12]={92,90,88,86,83,83,83,83,86,88,90,92};
////////////////////////////////////////////////////////////////
//Поднимание/опускание перископа
char per1[5][7]={{0,0,0,0,0x7e,0xff,0xff},
		{0,0,0,0x18,0x7e,0xff,0xff},
		{0,0,0x18,0x18,0x7e,0xff,0xff},
		{0,0x18,0x18,0x18,0x7e,0xff,0xff},
		{0x18,0x18,0x18,0x18,0x7e,0xff,0xff}};
/////////////////////////////////////////////////////////////////
//Шарик, бегающий по бильярду
#define BILCOL 2 //Цвет бильярда
#define BILCOL2 4 //Цвет окаймления бильярда
//#define BILCOL3 4 //Цвет луз
#define BILCOL4 1 //Цвет шарика
#define BILADR (88/8+80/8*MAXX) //Адрес бильярда
#define CBILX 88
#define CBILY 80
#define BILX 60  //Длина бильярда по x/8
#define BILY 70  //Длина по y
//char luz1[4]={0x18,0x66,0xc3,0xc3};
char balls[4]={0x7e,0xff,0xff,0x7e};


/////////////////////////////////////////////////////////////////

void inv (unsigned x,unsigned y, unsigned len) //Инвертация
{
  unsigned i;
  char far * adr=(char *)MK_FP(0xb800,0);
  adr+=x*2+y*160+1;
  for (i=0;i<len;i++,adr+=2) *adr=*adr/16+(*adr % 16)*16;
}

void emt20 (char * buf,unsigned x,unsigned y) //Вывод текста по (x,y) из *buf
{
  unsigned i;
  char far * adr=(char *)MK_FP(0xb800,0);
  adr+=x*2+y*160;
  for (i=0;i<strlen(buf);i++,adr+=2) *adr=buf[i];
}
char bufscr[25*160];  //Буфер текстового экрана

void gotograph (void) //Переход в графический режим с запоминанием ситуации
{
  char far * adr=(char *)MK_FP(0xb800,0);
  unsigned i;
  for (i=0;i<25*160;i++,adr++) {bufscr[i]=*adr;}
  //Переход в граф. режим
  asm {
   mov AX,0x000E //640*200*16
   int 0x10
  }
}

void gototext (void) //Переход в текстовый режим с восстановлением ситуации
{
  unsigned i;
  char far * adr=(char *)MK_FP(0xb800,0);
  //Переход в текст. режим
  asm {
   mov AX,0x0003
   int 0x10
  }
  for (i=0;i<25*160;i++,adr++) {*adr=bufscr[i];}
}

void outspr (unsigned x,unsigned y,unsigned color,char * sprite,unsigned leny)
{
  char far * adr=(char *)MK_FP(0xa000,0);
  adr+=y*80+(x/8); //адрес текущего байта
  outport (EGA_GRAPHICS,EGA_GR_MODE+0); //Режимы чтения и записи 0
  outport (EGA_GRAPHICS,EGA_GR_SET_RESET+color*256); //Номер цвета
  outport (EGA_GRAPHICS,EGA_GR_ENABLE_SET_RESET+0xf00); //Проц. байт не влияет
  x=7-x % 8; //сдвиг по Оx
  unsigned i;
  for (i=0;i<leny;i++) {
    if (x!=0) {
    outport (EGA_GRAPHICS,EGA_GR_BIT_MASK+(((((unsigned int)sprite[i])&0xff)<<x)&0xff00));
    (*adr)++;
    }
      outport (EGA_GRAPHICS,EGA_GR_BIT_MASK+((sprite[i]<<(8+x))&0xff00));
      (*(adr+1))++;
    adr+=MAXX/8;
  }
}

Последний раз редактировалось MaTBeu; 08.06.2010 в 18:12.
Gerberka вне форума Ответить с цитированием
Старый 08.06.2010, 18:30   #2
Ozerich
Студент 1 курса
Форумчанин Подтвердите свой е-майл
 
Аватар для Ozerich
 
Регистрация: 27.06.2008
Сообщений: 959
По умолчанию

Ошибки исправь
Цитата:
1>d:\coding\temp\srctoexe\main.cpp( 74) : error C2143: syntax error : missing ';' before '*'
1>d:\coding\temp\srctoexe\main.cpp( 74) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 74) : error C3861: 'MK_FP': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 75) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 76) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 76) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 76) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 76) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 82) : error C2143: syntax error : missing ';' before '*'
1>d:\coding\temp\srctoexe\main.cpp( 82) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 82) : error C3861: 'MK_FP': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 83) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 84) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 84) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 90) : error C2143: syntax error : missing ';' before '*'
1>d:\coding\temp\srctoexe\main.cpp( 90) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 90) : error C3861: 'MK_FP': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 92) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 92) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 94) : error C2059: syntax error : '{'
1>d:\coding\temp\srctoexe\main.cpp( 94) : error C2143: syntax error : missing ';' before '{'
1>d:\coding\temp\srctoexe\main.cpp( 95) : error C2065: 'mov' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 95) : error C2146: syntax error : missing ';' before identifier 'AX'
1>d:\coding\temp\srctoexe\main.cpp( 95) : error C2065: 'AX' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 96) : error C2144: syntax error : 'int' should be preceded by ';'
1>d:\coding\temp\srctoexe\main.cpp( 96) : warning C4091: '' : ignored on left of 'int' when no variable is declared
1>d:\coding\temp\srctoexe\main.cpp( 96) : error C2143: syntax error : missing ';' before 'constant'
1>d:\coding\temp\srctoexe\main.cpp( 97) : error C2143: syntax error : missing ';' before '}'
1>d:\coding\temp\srctoexe\main.cpp( 103) : error C2143: syntax error : missing ';' before '*'
1>d:\coding\temp\srctoexe\main.cpp( 103) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 103) : error C3861: 'MK_FP': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 105) : error C2059: syntax error : '{'
1>d:\coding\temp\srctoexe\main.cpp( 105) : error C2143: syntax error : missing ';' before '{'
1>d:\coding\temp\srctoexe\main.cpp( 106) : error C2065: 'mov' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 106) : error C2146: syntax error : missing ';' before identifier 'AX'
1>d:\coding\temp\srctoexe\main.cpp( 106) : error C2065: 'AX' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 107) : error C2144: syntax error : 'int' should be preceded by ';'
1>d:\coding\temp\srctoexe\main.cpp( 107) : warning C4091: '' : ignored on left of 'int' when no variable is declared
1>d:\coding\temp\srctoexe\main.cpp( 107) : error C2143: syntax error : missing ';' before 'constant'
1>d:\coding\temp\srctoexe\main.cpp( 108) : error C2143: syntax error : missing ';' before '}'
1>d:\coding\temp\srctoexe\main.cpp( 109) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 109) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 114) : error C2143: syntax error : missing ';' before '*'
1>d:\coding\temp\srctoexe\main.cpp( 114) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 114) : error C3861: 'MK_FP': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 115) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 116) : error C3861: 'outport': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 117) : error C3861: 'outport': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 118) : error C3861: 'outport': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 123) : error C3861: 'outport': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 124) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 126) : error C3861: 'outport': identifier not found
1>d:\coding\temp\srctoexe\main.cpp( 127) : error C2065: 'adr' : undeclared identifier
1>d:\coding\temp\srctoexe\main.cpp( 128) : error C2065: 'adr' : undeclared identifier
C++(STL, QT, WinInet) / DHTML(CSS) / JavaScript / PHP Developer
Ozerich вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Если не трудно оцените мой плеер))) Ferz-2009 Софт 23 30.04.2010 21:43
C++ если не трудно помоги!!! nurzi93 Общие вопросы C/C++ 1 03.01.2010 16:15
Как скомпилировать прогу, если у меня есть только *.cpp файл? TwiX Общие вопросы C/C++ 4 13.11.2009 21:13
Помогите решить задачку на 2х мерный массив (если не трудно) jorjinho10 Паскаль, Turbo Pascal, PascalABC.NET 1 11.04.2009 23:43