modes.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. This include implements video mode management.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {-----------------------------------------------------------------------}
  13. { Internal routines }
  14. {-----------------------------------------------------------------------}
  15. {$ifdef newmodes}
  16. procedure res2Mode(x, y, maxColor: longint; var driver,mode: smallInt);
  17. var
  18. l: longint;
  19. begin
  20. case maxColor of
  21. 2: driver := D1bit;
  22. 4: driver := D2bit;
  23. 16: driver := D4bit;
  24. 64: driver := D6bit;
  25. 256: driver := D8bit;
  26. 4096: driver := D12bit;
  27. 32768: driver := D15bit;
  28. 65536: driver := D16bit;
  29. { not yet supported
  30. 65536*256: driver := D24bit;
  31. 65536*65536: driver := D32bit;}
  32. else
  33. begin
  34. driver := maxsmallint;
  35. exit;
  36. end;
  37. end;
  38. { Check whether this is known/predefined mode }
  39. for l := lowNewMode to highNewMode do
  40. if (resolutions[l].x = x) and
  41. (resolutions[l].y = y) then
  42. begin
  43. { Found! }
  44. mode := l;
  45. exit;
  46. end;
  47. { Not Found }
  48. mode := maxsmallint;
  49. end;
  50. function mode2res(modeNr: smallInt; var x,y: longint): boolean;
  51. begin
  52. if (modeNr < lowNewMode) or
  53. (modeNr > highNewMode) then
  54. begin
  55. mode2res := false;
  56. exit;
  57. end;
  58. mode2res := true;
  59. x := resolutions[modeNr].x;
  60. y := resolutions[modeNr].y;
  61. end;
  62. {$endif newmodes}
  63. procedure addmode(const mode: TModeInfo);
  64. {********************************************************}
  65. { Procedure AddMode() }
  66. {--------------------------------------------------------}
  67. { This routine adds <mode> to the list of recognized }
  68. { modes. Duplicates are allowed. }
  69. {********************************************************}
  70. var
  71. {$ifdef newmodes}
  72. driverNr, modeNr: smallint;
  73. prev: PModeInfo;
  74. {$endif newmodes}
  75. list: PModeInfo;
  76. newlst : PModeInfo;
  77. begin
  78. {$ifdef newmodes}
  79. res2Mode(mode.maxx+1,mode.maxy+1,mode.maxColor,driverNr,ModeNr);
  80. { bitdepth supported? }
  81. if (driverNr <> maxsmallint) then
  82. { Yes, add the mode }
  83. if not assigned(newModeList.modeinfo[driverNr]) then
  84. begin
  85. new(newModeList.modeinfo[driverNr]);
  86. newModeList.modeinfo[driverNr]^ := mode;
  87. with newModeList.modeinfo[driverNr]^ do
  88. begin
  89. driverNumber := driverNr;
  90. modeNumber := 1;
  91. next := nil;
  92. end;
  93. newModeList.loHiModeNr[driverNr].lo := 1;
  94. newModeList.loHiModeNr[driverNr].hi := 1;
  95. end
  96. else
  97. begin
  98. prev := nil;
  99. list := newModeList.modeinfo[driverNr];
  100. { sort first by x resolution, then by yresolution }
  101. while assigned(list) and
  102. ((list^.maxx < mode.maxx) or
  103. ((list^.maxx = mode.maxx) and
  104. (list^.maxy < mode.maxy))) do
  105. begin
  106. prev := list;
  107. list := list^.next;
  108. end;
  109. { mode already exists? -> replace (assume later added modes are }
  110. { better) }
  111. if assigned(list) and
  112. (list^.maxx = mode.maxx) and
  113. (list^.maxy = mode.maxy) then
  114. begin
  115. { save/restore next, drivernr and drivermode in list }
  116. driverNr := list^.driverNumber;
  117. modeNr := list^.modeNumber;
  118. prev := list^.next;
  119. list^ := mode;
  120. list^.driverNumber := driverNr;
  121. list^.modeNumber := modeNr;
  122. list^.next := prev;
  123. end
  124. else
  125. begin
  126. new(newLst);
  127. { Increase the number of modes for this driver }
  128. inc(newModeList.loHiModeNr[driverNr].hi);
  129. newLst^ := mode;
  130. newLst^.driverNumber := driverNr;
  131. if assigned(list) then
  132. newLst^.next := list^.next
  133. else
  134. newLst^.next := nil;
  135. if assigned(prev) then
  136. begin
  137. prev^.next := newLst;
  138. newLst^.modeNumber := succ(prev^.modeNumber)
  139. end
  140. else
  141. begin
  142. newModeList.modeinfo[driverNr] := newLst;
  143. newLst^.modeNumber := 1;
  144. end;
  145. { Increase the modenumbers of all modes coming after this one }
  146. { with 1 }
  147. newLst := newLst^.next;
  148. while assigned(newLst) do
  149. begin
  150. inc(newLst^.modeNumber);
  151. newLst := newLst^.next;
  152. end;
  153. end;
  154. end;
  155. {$endif newmodes}
  156. { TP-like mode stuff }
  157. if not assigned(ModeList) then
  158. begin
  159. new(ModeList);
  160. move(mode, ModeList^, sizeof(Mode));
  161. end
  162. else
  163. begin
  164. list := ModeList;
  165. { go to the end of the list }
  166. while assigned(list^.next) do
  167. list:=list^.next;
  168. new(NewLst);
  169. list^.next := NewLst;
  170. move(mode, NewLst^, sizeof(Mode));
  171. end;
  172. end;
  173. procedure initmode(var mode: TModeInfo);
  174. {********************************************************}
  175. { Procedure InitMode() }
  176. {--------------------------------------------------------}
  177. { This routine initialized the mode to default values. }
  178. {********************************************************}
  179. begin
  180. FillChar(mode,sizeof(Mode),#0);
  181. end;
  182. function searchmode(ReqDriver : smallint; var reqmode: smallint): PModeInfo;
  183. {********************************************************}
  184. { Procedure SearchMode() }
  185. {--------------------------------------------------------}
  186. { This routine searches the list of recognized modes, }
  187. { and tries to find the <reqmode> in the <reqdriver> }
  188. { return nil if not found, otherwise returns the found }
  189. { structure. }
  190. { note: if reqmode = -32768, the first mode available }
  191. { for reqdriver is returned (JM) }
  192. { if reqmode = -32767, the last mode available }
  193. { for reqdriver is returned (JM) }
  194. {********************************************************}
  195. var
  196. list, lastModeInfo: PModeInfo;
  197. {$ifdef newmodes}
  198. x,y: longint;
  199. {$endif}
  200. begin
  201. {$ifdef logging}
  202. LogLn('Searching for driver '+strf(reqdriver)+' and mode '+strf(reqmode));
  203. {$endif logging}
  204. {$ifdef newmodes}
  205. if (reqDriver >= lowNewDriver) and
  206. (reqDriver <= highNewDriver) then
  207. begin
  208. case reqMode of
  209. -32768:
  210. begin
  211. reqMode := newModeList.loHiModeNr[reqDriver].lo;
  212. searchMode := newModeList.modeinfo[reqDriver];
  213. end;
  214. -32767:
  215. begin
  216. reqMode := newModeList.loHiModeNr[reqDriver].hi;
  217. searchMode := nil;
  218. { Are there any modes available for this driver? }
  219. if reqMode <> -1 then
  220. begin
  221. list := newModeList.modeinfo[reqDriver];
  222. while assigned(list^.next) do
  223. list := list^.next;
  224. searchMode := list;
  225. end;
  226. end;
  227. else
  228. begin
  229. list := newModeList.modeinfo[reqDriver];
  230. searchMode := nil;
  231. if not assigned(list) then
  232. exit;
  233. if mode2res(reqMode,x,y) then
  234. begin
  235. x := pred(x);
  236. y := pred(y);
  237. while assigned(list) and
  238. ((list^.maxx < x) or
  239. ((list^.maxx = x) and
  240. (list^.maxy < y))) do
  241. list := list^.next;
  242. if not assigned(list) or
  243. (list^.maxx <> x) or
  244. (list^.maxy <> y) then
  245. list := nil;
  246. searchmode := list;
  247. end
  248. else
  249. begin
  250. while assigned(list) and
  251. (list^.modeNumber <> reqMode) do
  252. list := list^.next;
  253. searchMode := list;
  254. end;
  255. end;
  256. end;
  257. exit;
  258. end;
  259. {$endif newmodes}
  260. searchmode := nil;
  261. list := ModeList;
  262. If assigned(list) then
  263. lastModeInfo := list;
  264. { go to the end of the list }
  265. while assigned(list) do
  266. begin
  267. {$ifdef logging}
  268. Log('Found driver '+strf(list^.DriverNumber)+
  269. ' and mode $'+hexstr(list^.ModeNumber,4)+'... ');
  270. {$endif logging}
  271. if ((list^.DriverNumber = ReqDriver) and
  272. ((list^.ModeNumber = ReqMode) or
  273. { search for lowest mode }
  274. (reqMode = -32768))) or
  275. { search for highest mode }
  276. ((reqMode = -32767) and
  277. (lastModeInfo^.driverNumber = reqDriver) and
  278. ((list^.driverNumber <> lastModeInfo^.driverNumber) or
  279. not(assigned(list^.next)))) then
  280. begin
  281. {$ifdef logging}
  282. LogLn('Accepted!');
  283. {$endif logging}
  284. searchmode := list;
  285. If reqMode = -32768 then
  286. reqMode := list^.modeNumber
  287. else if reqMode = -32767 then
  288. begin
  289. reqMode := lastModeInfo^.modeNumber;
  290. searchMode := lastModeInfo;
  291. end;
  292. exit;
  293. end;
  294. {$ifdef logging}
  295. LogLn('Rejected.');
  296. {$endif logging}
  297. lastModeInfo := list;
  298. list:=list^.next;
  299. end;
  300. end;
  301. {-----------------------------------------------------------------------}
  302. { External routines }
  303. {-----------------------------------------------------------------------}
  304. function GetModeName(ModeNumber: smallint): string;
  305. {********************************************************}
  306. { Function GetModeName() }
  307. {--------------------------------------------------------}
  308. { Checks the known video list, and returns ModeName }
  309. { string. On error returns an empty string. }
  310. {********************************************************}
  311. var
  312. mode: PModeInfo;
  313. begin
  314. mode:=nil;
  315. GetModeName:='';
  316. { only search in the current driver modes ... }
  317. mode:=SearchMode(IntCurrentDriver,ModeNumber);
  318. if assigned(mode) then
  319. GetModeName:=Mode^.ModeName
  320. else
  321. _GraphResult := grInvalidMode;
  322. end;
  323. function GetGraphMode: smallint;
  324. begin
  325. GetGraphMode := IntCurrentMode;
  326. end;
  327. function GetMaxMode: word;
  328. { I know , i know, this routine is very slow, and it would }
  329. { be much easier to sort the linked list of possible modes }
  330. { instead of doing this, but I'm lazy!! And anyways, the }
  331. { speed of the routine here is not that important.... }
  332. var
  333. i: word;
  334. mode: PModeInfo;
  335. begin
  336. mode:=nil;
  337. i:=0;
  338. repeat
  339. inc(i);
  340. { mode 0 always exists... }
  341. { start search at 1.. }
  342. mode:=SearchMode(IntCurrentDriver,i);
  343. until not assigned(mode);
  344. GetMaxMode:=i;
  345. end;
  346. procedure GetModeRange(GraphDriver: smallint; var LoMode,
  347. HiMode: smallint);
  348. var
  349. mode : PModeInfo;
  350. begin
  351. {$ifdef logging}
  352. LogLn('GetModeRange : Enter ('+strf(GraphDriver)+')');
  353. {$endif}
  354. HiMode:=-1;
  355. mode := nil;
  356. { First search if the graphics driver is supported .. }
  357. { since mode zero is always supported.. if that driver }
  358. { is supported it should return something... }
  359. { not true, e.g. VESA doesn't have a mode 0. Changed so}
  360. { -32768 means "return lowest mode in second parameter }
  361. { also, under VESA some modes may not be supported }
  362. { (e.g. $108 here) while some with a higher number can }
  363. { be supported ($112 and onward), so I also added that }
  364. { -32767 means "return highest mode in second parameter}
  365. { This whole system should be overhauled though to work}
  366. { without such hacks (JM) }
  367. loMode := -32768;
  368. mode := SearchMode(GraphDriver, loMode);
  369. { driver not supported...}
  370. if not assigned(mode) then
  371. begin
  372. loMode := -1;
  373. exit;
  374. end;
  375. {$ifdef logging}
  376. LogLn('GetModeRange : Mode 0 found');
  377. {$endif}
  378. { now it exists... find highest available mode... }
  379. hiMode := -32767;
  380. mode:=SearchMode(GraphDriver,hiMode);
  381. end;
  382. procedure SetGraphMode(mode: smallint);
  383. var
  384. modeinfo: PModeInfo;
  385. begin
  386. { check if the mode exists... }
  387. modeinfo := searchmode(IntcurrentDriver,mode);
  388. if not assigned(modeinfo) then
  389. begin
  390. {$ifdef logging}
  391. LogLn('Mode setting failed in setgraphmode pos 1');
  392. {$endif logging}
  393. _GraphResult := grInvalidMode;
  394. exit;
  395. end;
  396. { reset all hooks...}
  397. DefaultHooks;
  398. { arccall not reset - tested against VGA BGI driver }
  399. { Setup all hooks if none, keep old defaults...}
  400. { required hooks - returns error if no hooks to these }
  401. { routines. }
  402. if assigned(modeinfo^.DirectPutPixel) then
  403. DirectPutPixel := modeinfo^.DirectPutPixel
  404. else
  405. begin
  406. {$ifdef logging}
  407. LogLn('Mode setting failed in setgraphmode pos 2');
  408. {$endif logging}
  409. _Graphresult := grInvalidMode;
  410. exit;
  411. end;
  412. if assigned(modeinfo^.PutPixel) then
  413. PutPixel := modeinfo^.PutPixel
  414. else
  415. begin
  416. {$ifdef logging}
  417. LogLn('Mode setting failed in setgraphmode pos 3');
  418. {$endif logging}
  419. _Graphresult := grInvalidMode;
  420. exit;
  421. end;
  422. if assigned(modeinfo^.GetPixel) then
  423. GetPixel := modeinfo^.GetPixel
  424. else
  425. begin
  426. {$ifdef logging}
  427. LogLn('Mode setting failed in setgraphmode pos 4');
  428. {$endif logging}
  429. _Graphresult := grInvalidMode;
  430. exit;
  431. end;
  432. if assigned(modeinfo^.SetRGBPalette) then
  433. SetRGBPalette := modeinfo^.SetRGBPalette
  434. else
  435. begin
  436. {$ifdef logging}
  437. LogLn('Mode setting failed in setgraphmode pos 5');
  438. {$endif logging}
  439. _Graphresult := grInvalidMode;
  440. exit;
  441. end;
  442. if assigned(modeinfo^.GetRGBPalette) then
  443. GetRGBPalette := modeinfo^.GetRGBPalette
  444. else
  445. begin
  446. {$ifdef logging}
  447. LogLn('Mode setting failed in setgraphmode pos 6');
  448. {$endif logging}
  449. _Graphresult := grInvalidMode;
  450. exit;
  451. end;
  452. { optional hooks. }
  453. if assigned(modeinfo^.ClearViewPort) then
  454. ClearViewPort := modeinfo^.ClearViewPort;
  455. if assigned(modeinfo^.PutImage) then
  456. PutImage := modeinfo^.PutImage;
  457. if assigned(modeinfo^.GetImage) then
  458. GetImage := modeinfo^.GetImage;
  459. if assigned(modeinfo^.ImageSize) then
  460. ImageSize := modeinfo^.ImageSize;
  461. if assigned(modeinfo^.GetScanLine) then
  462. GetScanLine := modeinfo^.GetScanLine;
  463. if assigned(modeinfo^.Line) then
  464. Line := modeinfo^.Line;
  465. if assigned(modeinfo^.InternalEllipse) then
  466. InternalEllipse := modeinfo^.InternalEllipse;
  467. if assigned(modeinfo^.PatternLine) then
  468. PatternLine := modeinfo^.PatternLine;
  469. if assigned(modeinfo^.HLine) then
  470. Hline := modeinfo^.Hline;
  471. if assigned(modeinfo^.Vline) then
  472. VLine := modeinfo^.VLine;
  473. if assigned(modeInfo^.SetVisualPage) then
  474. SetVisualPage := modeInfo^.SetVisualPage;
  475. if assigned(modeInfo^.SetActivePage) then
  476. SetActivePage := modeInfo^.SetActivePage;
  477. if assigned(modeInfo^.OutTextXY) then
  478. OutTextXY:=modeInfo^.OutTextXY;
  479. IntCurrentMode := modeinfo^.ModeNumber;
  480. IntCurrentDriver := modeinfo^.DriverNumber;
  481. XAspect := modeinfo^.XAspect;
  482. YAspect := modeinfo^.YAspect;
  483. MaxX := modeinfo^.MaxX;
  484. MaxY := modeinfo^.MaxY;
  485. HardwarePages := modeInfo^.HardwarePages;
  486. MaxColor := modeinfo^.MaxColor;
  487. PaletteSize := modeinfo^.PaletteSize;
  488. { is this a direct color mode? }
  489. DirectColor := modeinfo^.DirectColor;
  490. { now actually initialize the video mode...}
  491. { check first if the routine exists }
  492. if not assigned(modeinfo^.InitMode) then
  493. begin
  494. {$ifdef logging}
  495. LogLn('Mode setting failed in setgraphmode pos 7');
  496. {$endif logging}
  497. _GraphResult := grInvalidMode;
  498. exit;
  499. end;
  500. modeinfo^.InitMode;
  501. if _GraphResult <> grOk then exit;
  502. isgraphmode := true;
  503. { It is very important that this call be made }
  504. { AFTER the other variables have been setup. }
  505. { Since it calls some routines which rely on }
  506. { those variables. }
  507. SetActivePage(0);
  508. SetVisualPage(0);
  509. GraphDefaults;
  510. SetViewPort(0,0,MaxX,MaxY,TRUE);
  511. end;
  512. procedure RestoreCrtMode;
  513. {********************************************************}
  514. { Procedure RestoreCRTMode() }
  515. {--------------------------------------------------------}
  516. { Returns to the video mode which was set before the }
  517. { InitGraph. Hardware state is set to the old values. }
  518. {--------------------------------------------------------}
  519. { NOTE: - }
  520. { - }
  521. {********************************************************}
  522. begin
  523. isgraphmode := false;
  524. RestoreVideoState;
  525. end;
  526. {
  527. $Log$
  528. Revision 1.26 2000-06-22 18:36:19 peter
  529. * removed notes
  530. Revision 1.25 2000/06/19 01:18:49 carl
  531. + added modes for Atari/Amiga and bit depth also
  532. Revision 1.24 2000/06/18 14:59:39 jonas
  533. * changed maxint -> maxsmallint (range error because of objpas mod
  534. somewhere)
  535. Revision 1.23 2000/06/17 19:09:23 jonas
  536. * new platform independent mode handling (between -dnewmodes)
  537. Revision 1.22 2000/04/02 12:13:37 florian
  538. * some more procedures can be now hooked by the OS specific implementation
  539. Revision 1.21 2000/03/24 18:16:33 florian
  540. * introduce a DrawBitmapCharHoriz procedure variable to accelerate output on
  541. win32
  542. Revision 1.20 2000/03/24 13:01:15 florian
  543. * ClearViewPort fixed
  544. Revision 1.19 2000/01/07 16:41:39 daniel
  545. * copyright 2000
  546. Revision 1.18 2000/01/07 16:32:26 daniel
  547. * copyright 2000 added
  548. Revision 1.17 2000/01/02 19:02:39 jonas
  549. * removed/commented out (inited but) unused vars and unused types
  550. Revision 1.16 1999/12/21 17:42:18 jonas
  551. * changed vesa.inc do it doesn't try to use linear modes anymore (doesn't work
  552. yet!!)
  553. * fixed mode detection so the low modenumber of a driver doesn't have to be zero
  554. anymore (so VESA autodetection now works)
  555. Revision 1.15 1999/12/20 11:22:36 peter
  556. * integer -> smallint to overcome -S2 switch needed for ggi version
  557. Revision 1.14 1999/12/04 21:20:04 michael
  558. + Additional logging
  559. Revision 1.13 1999/11/28 16:13:55 jonas
  560. * corrected misplacement of call to initvars in initgraph
  561. + some extra debugging commands (for -dlogging) in the mode functions
  562. Revision 1.12 1999/09/28 13:56:31 jonas
  563. * reordered some local variables (first 4 byte vars, then 2 byte vars
  564. etc)
  565. * font data is now disposed in exitproc, exitproc is now called
  566. GraphExitProc (was CleanModes) and resides in graph.pp instead of in
  567. modes.inc
  568. Revision 1.11 1999/09/26 13:31:07 jonas
  569. * changed name of modeinfo variable to vesamodeinfo and fixed
  570. associated errors (fillchar(modeinfo,sizeof(tmodeinfo),#0) instead
  571. of sizeof(TVesamodeinfo) etc)
  572. * changed several sizeof(type) to sizeof(varname) to avoid similar
  573. errors in the future
  574. Revision 1.10 1999/09/24 22:52:39 jonas
  575. * optimized patternline a bit (always use hline when possible)
  576. * isgraphmode stuff cleanup
  577. * vesainfo.modelist now gets disposed in cleanmode instead of in
  578. closegraph (required moving of some declarations from vesa.inc to
  579. new vesah.inc)
  580. * queryadapter gets no longer called from initgraph (is called from
  581. initialization of graph unit)
  582. * bugfix for notput in 32k and 64k vesa modes
  583. * a div replaced by / in fillpoly
  584. Revision 1.9 1999/09/22 13:13:36 jonas
  585. * renamed text.inc -> gtext.inc to avoid conflict with system unit
  586. * fixed textwidth
  587. * isgraphmode now gets properly updated, so mode restoring works
  588. again
  589. Revision 1.8 1999/09/18 22:21:11 jonas
  590. + hlinevesa256 and vlinevesa256
  591. + support for not/xor/or/andput in vesamodes with 32k/64k colors
  592. * lots of changes to avoid warnings under FPC
  593. Revision 1.7 1999/07/12 13:27:14 jonas
  594. + added Log and Id tags
  595. * added first FPC support, only VGA works to some extend for now
  596. * use -dasmgraph to use assembler routines, otherwise Pascal
  597. equivalents are used
  598. * use -dsupportVESA to support VESA (crashes under FPC for now)
  599. * only dispose vesainfo at closegrph if a vesa card was detected
  600. * changed int32 to longint (int32 is not declared under FPC)
  601. * changed the declaration of almost every procedure in graph.inc to
  602. "far;" becquse otherwise you can't assign them to procvars under TP
  603. real mode (but unexplainable "data segnment too large" errors prevent
  604. it from working under real mode anyway)
  605. }