TESTASM.ASM 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. IDEAL
  19. P386
  20. MODEL USE32 FLAT
  21. jumps
  22. codeseg
  23. masm
  24. ;
  25. ; Change a DAC colour register directly
  26. ;
  27. ; register number in al
  28. ;
  29. ; bh=red bl=green cl=blue
  30. ;
  31. set_dac_col proc near
  32. pushad
  33. cli
  34. push eax
  35. mov dx,03dah
  36. in al,dx
  37. jmp @@1
  38. @@1: mov dx,03c8h
  39. pop eax
  40. out dx,al
  41. jmp @@2
  42. @@2: inc dl
  43. mov al,bh
  44. out dx,al
  45. jmp @@3
  46. @@3: mov al,bl
  47. out dx,al
  48. jmp @@4
  49. @@4: mov al,cl
  50. out dx,al
  51. jmp @@5
  52. @@5: sti
  53. popad
  54. ret
  55. set_dac_col endp
  56. ideal
  57. global Set_Palette_Register_:near
  58. proc Set_Palette_Register_ near
  59. pushad
  60. and cl,63
  61. mov bh,dl
  62. and bh,63
  63. and bl,63
  64. call set_dac_col
  65. popad
  66. ret
  67. endp Set_Palette_Register_
  68. end