REALMODE.H 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef VQMREALMODE_H
  19. #define VQMREALMODE_H
  20. /****************************************************************************
  21. *
  22. * C O N F I D E N T I A L -- W E S T W O O D S T U D I O S
  23. *
  24. *----------------------------------------------------------------------------
  25. *
  26. * FILE
  27. * realmode.h
  28. *
  29. * DESCRIPTION
  30. * Real-mode interfacing definitions and equates. Many of the definitions
  31. * and descriptions in this file were taken from other sources and
  32. * compiled here for use in MISC32 library.
  33. *
  34. * PROGRAMMER
  35. * Denzil E. Long, Jr.
  36. *
  37. * DATE
  38. * Febuary 6, 1995
  39. *
  40. ****************************************************************************/
  41. /* REALPTR: Real-mode pointer (segment:offset16).
  42. *
  43. * The REALPTR data type is used in protected mode to hold real-mode
  44. * pointers. The type is an unsigned long value, were the upper 16 bits
  45. * are the segment number and the lower 16 bit are an offset. This type
  46. * and the associated macros are identical to that of the PHARLAP "pltypes.h"
  47. * definitions for easy of conversion to WATCOM/4GW.
  48. */
  49. typedef unsigned long REALPTR;
  50. #define RP_OFF(rp) ((unsigned short)(((unsigned long)(rp)) & 0xFFFF))
  51. #define RP_SEG(rp) ((unsigned short)(((unsigned long)(rp)) >> 16))
  52. #define RP_SET(rp, off, seg) (rp = ((unsigned long)(seg) << 16) + (off))
  53. #define RP_INCR(rp, incr) (rp += ((unsigned long)(incr)) & 0xFFFF)
  54. #define MK_PTR(off, seg) (void *)((((unsigned long)seg&0xFFFF)<<4)+off)
  55. /* RMInfo: Real-mode interrupt call structure.
  56. *
  57. * Information that needs to be passed down to the real-mode interrupt is
  58. * transfered using this structure. The address to this protected-mode
  59. * structure (allocated by user) is passed into DPMI function 0x300. DOS/4GW
  60. * will then use this information to set up the real-mode registers, switch
  61. * to real-mode and then execute the interrupt in real-mode.
  62. */
  63. typedef struct _RMInfo {
  64. long edi;
  65. long esi;
  66. long ebp;
  67. long reservedbysystem;
  68. long ebx;
  69. long edx;
  70. long ecx;
  71. long eax;
  72. short flags;
  73. short es,ds,fs,gs,ip,cs,sp,ss;
  74. } RMInfo;
  75. #endif /* VQMREALMODE_H */