COLCODE.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ; Filename : COLCODE.INC
  2. ; Description : ASM include file for defining special colour
  3. ; see/update also COLCODE.H for C
  4. ; for transparent code repeated for 1 to UNIQUE_REPEAT_CODE_NUM times,
  5. ; write FEW_TRANSPARENT_CODE(repeated_times)
  6. ; for transparent code repeated for UNIQUE_REPEAT_CODE_NUM+1 to 255 times,
  7. ; write two bytes, MANY_TRANSPARENT_CODE and repeated_times
  8. TRANSPARENT_CODE = 255
  9. UNIQUE_REPEAT_CODE_NUM = 7 ; total no. of bytes used by transparent pixels and compressed transparent pixels is 7+1 (the last 1 is the first byte of the 2 bytes compression code)
  10. ENCODE_FEW_TRANS_CODE MACRO reg ; reg must be byte
  11. neg reg
  12. ENDM
  13. DECODE_FEW_TRANS_CODE MACRO reg ; must be a byte
  14. neg reg
  15. ENDM
  16. MANY_TRANSPARENT_CODE = 0f8h
  17. MIN_TRANSPARENT_CODE = 0f8h
  18. MAX_TRASNPARENT_CODE = 0ffh
  19. ; never appear color code 0
  20. SHADOW_CODE = 000h
  21. OUTLINE_CODE = 0f2h
  22. OUTLINE_SHADOW_CODE = 0f3h
  23. ; do not remap colour
  24. PRE_REMAP MACRO
  25. xlatb [EBX]
  26. ENDM
  27. POST_REMAP MACRO
  28. ENDM
  29. JUMP_IF_TRANS MACRO byteCode, goLabel
  30. cmp byteCode, MIN_TRANSPARENT_CODE
  31. jae goLabel
  32. ENDM
  33. JUMP_IF_NOT_TRANS MACRO byteCode, goLabel
  34. cmp byteCode, MIN_TRANSPARENT_CODE
  35. jb goLabel
  36. ENDM
  37. JUMP_IF_MANY_TRANS MACRO byteCode, goLabel
  38. cmp byteCode, MANY_TRANSPARENT_CODE
  39. je goLabel
  40. ENDM
  41. JUMP_IF_NOT_MANY_TRANS MACRO byteCode, goLabel
  42. cmp byteCode, MANY_TRANSPARENT_CODE
  43. jne goLabel
  44. ENDM