Advertisement
MonoS

Untitled

Jun 30th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4. #include <i86.h>
  5. #include <mem.h>
  6. #include <conio.h>
  7.  
  8. #define INPUT_STATUS 0x03da
  9. #define VRETRACE 0x08
  10.  
  11. typedef unsigned char  byte;
  12. typedef unsigned short word;
  13.  
  14. void wait_for_retrace(void);
  15.  
  16. byte* VGA = (byte*)0xA0000000L;
  17.  
  18. long vet[566] = {\
  19. 22528,22529,\
  20. 22850,22851,22852,22853,22854,22855,\
  21. 23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23186,23187,23188,23189,23190,23191,23192,\
  22. 23499,23500,23501,23513,23514,23515,23516,23517,23518,23519,23520,23521,23522,23523,23524,23525,23526,23527,23528,23529,23530,23531,23532,23533,23534,23535,23536,23537,23538,23539,\
  23. 23822,23823,23860,23861,\
  24. 24144,24145,24182,\
  25. 24466,24467,24503,24504,\
  26. 24788,24789,24825,\
  27. 25110,25111,25145,\
  28. 25432,25433,25465,\
  29. 25728,25729,25730,25731,25732,25733,25734,25735,25754,25785,\
  30. 26056,26057,26058,26059,26060,26075,26104,\
  31. 26381,26382,26383,26384,26396,26397,26424,\
  32. 26705,26706,26707,26718,26719,26743,\
  33. 27028,27040,27062,\
  34. 27342,27343,27344,27345,27346,27347,27348,27349,27350,27351,27352,27353,27354,27355,27356,27361,27381,\
  35. 27658,27659,27660,27661,27670,27677,27678,27682,27683,27701,\
  36. 27973,27974,27975,27976,27977,27991,27992,27999,28000,28004,28019,28020,\
  37. 28288,28289,28290,28291,28292,28313,28321,28325,28338,\
  38. 28634,28642,28643,28646,28657,\
  39. 28954,28964,28967,28976,\
  40. 29275,29285,29288,29294,29295,\
  41. 29596,29606,29609,29613,\
  42. 29888,29916,29927,29930,29931,29932,\
  43. 30209,30236,30248,30250,30251,\
  44. 30530,30557,30568,30569,30572,\
  45. 30851,30876,30886,30887,30889,30893,\
  46. 31172,31173,31196,31205,31210,31214,\
  47. 31494,31495,31516,31523,31524,31530,31535,\
  48. 31816,31836,31841,31842,31851,31856,\
  49. 32137,32155,32159,32160,32171,32177,\
  50. 32458,32459,32474,32477,32478,32491,32497,\
  51. 32779,32794,32796,32812,32818,\
  52. 33100,33113,33114,33115,33132,33138,\
  53. 33421,33431,33432,33433,33452,33459,\
  54. 33742,33749,33750,33751,33773,33780,\
  55. 34062,34067,34068,34069,34093,34100,\
  56. 34383,34386,34387,34388,34414,34421,\
  57. 34703,34704,34705,34706,34734,34739,34742,\
  58. 35023,35054,35059,35062,\
  59. 35343,35374,35378,35379,35380,35383,\
  60. 35663,35694,35698,35700,35703,\
  61. 35983,36015,36017,36020,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,\
  62. 36303,36328,36329,36330,36331,36332,36333,36334,36335,36336,36337,36338,36339,36340,36341,36343,\
  63. 36623,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36655,36656,36660,36663,\
  64. 36943,36944,36945,36946,36947,36948,36949,36950,36951,36952,36953,36954,36955,36956,36975,36980,36984,\
  65. 37252,37253,37254,37255,37256,37257,37258,37259,37260,37261,37262,37263,37294,37295,37301,37304,\
  66. 37568,37569,37570,37571,37583,37614,37615,37621,37624,\
  67. 37888,37890,37891,37903,37904,37933,37935,37941,37944,\
  68. 38208,38209,38212,38213,38222,38223,38224,38253,38256,38261,38264,\
  69. 38529,38530,38531,38534,38535,38542,38544,38545,38546,38572,38576,38581,38584,\
  70. 38852,38853,38854,38855,38856,38857,38858,38861,38862,38867,38868,38869,38870,38871,38872,38892,38896,38901,38904,\
  71. 39176,39177,39178,39179,39180,39181,39193,39194,39195,39196,39197,39198,39199,39200,39201,39211,39216,39221,39224,\
  72. 39498,39499,39500,39501,39522,39523,39524,39525,39526,39527,39528,39531,39536,39541,39544,\
  73. 39822,39823,39824,39825,39826,39827,39828,39829,39849,39850,39851,39852,39853,39854,39855,39856,39857,39858,39861,39863,\
  74. 40150,40151,40152,40153,40154,40155,40156,40170,40176,40179,40180,40181,40182,40183,40184,40185,40186,\
  75. 40477,40478,40479,40480,40481,40482,40483,40484,40485,40486,40489,40497,40502,40503,40507,40508,40509,40510,40511,\
  76. 40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,40820,40821,40822,40823,40824,40825,40826,\
  77. 41127,41137,41142,41147,41148,41149,41150,41151,\
  78. 41446,41457,41462,\
  79. 41766,41777,41781,41782,\
  80. 42085,42097,42101,42102,\
  81. 42404,42417,42420,42422};
  82.  
  83. int main()
  84. {
  85.     union REGS regs;
  86.     long i;
  87.  
  88.     regs.h.ah = 0x00;
  89.     regs.h.al = 0x13;
  90.  
  91.     int86(0x10, &regs, &regs);
  92.  
  93.     while(1)
  94.     {
  95.         for(i = 0; i < 64000; i++)
  96.             VGA[i] = 14;
  97.  
  98.         for(i = 0; i < 566; i++)
  99.             VGA[vet[i]] = 12;
  100.        
  101.         wait_for_retrace();
  102.  
  103.         for(i = 0; i < 64000; i++)
  104.             VGA[i] = 0;
  105.  
  106.         for(i = 0; i < 566; i++)
  107.             VGA[vet[i]] = 12;
  108.  
  109.         wait_for_retrace();
  110.     }
  111.  
  112.     return 0;
  113. }
  114.  
  115. void wait_for_retrace(void)
  116. {
  117.   while  ((inp(INPUT_STATUS) & VRETRACE));
  118.   while (!(inp(INPUT_STATUS) & VRETRACE));
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement