Subversion Repositories pentevo

Rev

Rev 883 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
716 lvd 1
#include "std.h"
2
 
3
#include "emul.h"
4
#include "vars.h"
5
#include "draw.h"
6
#include "drawnomc.h"
7
 
8
void draw_border()
9
{
10
   unsigned br = comp.border_attr * 0x11001100;
11
   for (unsigned i = 0; i < temp.scx*temp.scy/4; i+=4)
12
      *(unsigned*)(rbuf + i) = br;
13
}
14
 
15
void draw_alco();
16
void draw_gigascreen_no_border();
17
 
18
void draw_screen()
19
{
20
/* [vv] ��������, �.�. ���� ��� ������������ ��� DDp scroll
21
   if (comp.pEFF7 & EFF7_384)
22
   {
23
       draw_alco();
24
       return;
25
   }
26
*/
27
 
28
   if (conf.nopaper)
29
   {
30
       draw_border();
31
       return;
32
   }
33
//   if (comp.pEFF7 & EFF7_GIGASCREEN) { draw_border(); draw_gigascreen_no_border(); return; } //Alone Coder
34
 
35
   unsigned char *dst = rbuf;
36
   unsigned br = comp.border_attr * 0x11001100; // ����������� �������� 0xbb00bb00, ��� b - ���� �������
37
 
38
   unsigned i;
39
   // ������� ������ (��������������, ��� temp.scx ������ 16 ������)
40
   for (i = temp.b_top * temp.scx / 16; i; i--)
41
   {
42
      *(unsigned*)dst = br; // ��������� ����� ���� ��������� (�������/pc-��������)
43
      dst += 4;
44
   }
45
 
46
   // �����
47
   for (int y = 0; y < 192; y++)
48
   {
49
      unsigned x;
50
          // ����� ������ (� �������� 192 ����� ������)
51
          for (x = temp.b_left; x; x -= 8) // ���� ���� �� �����������
52
      {
784 DimkaM 53
         *(u16 *)dst = u16(br); // ������ ����� (�� ������� �� ���) � ��������� (���� �������) (0xbb00)
716 lvd 54
         dst += sizeof(u16);
55
      }
56
 
57
          // �������� ������� (����������� �����)
58
      for (x = 0; x < 32; x++) // ���� ���� �� �����������
59
      {
60
         *dst++ = temp.base[t.scrtab[y] + x]; // ����� (8����)
61
         *dst++ = colortab[temp.base[atrtab[y] + x]]; // pc-��������
62
      }
63
 
64
      // ������ ������ (� �������� 192 ����� ������)
65
          for (x = temp.b_right; x; x -= 8) // ���� ���� �� �����������
66
      {
784 DimkaM 67
         *(u16 *)dst = u16(br); // ������ ����� (�� ������� �� ���) � ��������� (���� �������) (0xbb00)
716 lvd 68
         dst += sizeof(u16);
69
      }
70
   }
71
 
72
   // ������ ������ (��������������, ��� temp.scx ������ 16 ������)
73
   for (i = temp.b_bottom*temp.scx / 16; i; i--)
74
   {
75
      *(unsigned*)dst = br; // ��������� ����� ���� ��������� (�������/pc-��������)
76
      dst += 4;
77
   }
78
}
79
 
80
void draw_gigascreen_no_border()
81
{
82
   unsigned char *dst = rbuf + (temp.b_top * temp.scx + temp.b_left) / 4;
83
   unsigned char * const screen = RAM_BASE_M + 5*PAGE;
84
   unsigned offset = (comp.frame_counter & 1)? 0 : 2*PAGE;
85
   for (int y = 0; y < 192; y++) {
86
      *(volatile unsigned char*)dst;
87
      for (unsigned x = 0; x < 32; x++) {
88
         dst[2*x+0] = screen[t.scrtab[y] + x + offset];
89
         dst[2*x+1] = colortab[screen[atrtab[y] + x + offset]];
90
      }
91
      offset ^= 2*PAGE;
92
      dst += temp.scx / 4;
93
   }
94
}