1. Re: Mouse cursor - Reply - Reply

Jacques,

I was not talking about hot spot coordinates, I said quite clearly "byte pairs
to the right of Jacques' diagrams". Please, run the fragment below, you will see
what I meant. The mask sequence is directly copied from YOUR DIAGRAMS, and when
you apply Viktor's routine, the new cursor's left and right hand halves are
transposed. Jiri


-- snip ------------------------------------------------------------------------
-- Jiri Babor
-- j.babor at gns.cri.nz
--------------------------------------------------------------------------------
include graphics.e
include mouse.e
include get.e
include machine.e

constant new_curs=
   -- screen mask
 {{#9F,#FF,
   #8F,#FF,
   #87,#FF,
   #83,#FF,
   #81,#FF,
   #80,#FF,
   #80,#7F,
   #80,#3F,
   #80,#1F,
   #80,#0F,
   #80,#FF,
   #88,#FF,
   #98,#7F,
   #FC,#3F,
   #FC,#3F,
   #FE,#3F,

   --cursor mask
   #00,#00,
   #20,#00,
   #30,#00,
   #38,#00,
   #3C,#00,
   #3E,#00,
   #3F,#00,
   #3F,#80,
   #3F,#C0,
   #3E,#00,
   #33,#00,
   #23,#00,
   #03,#00,
   #01,#80,
   #01,#80,
   #00,#00},

   1, -- hot spot x
   0} -- hot spot y

object junk
atom Mouse_Cursor_Store
integer key

global procedure Change_cursor(sequence new_cursor)
-- new_cursor is a sequence build like those in mousecur.e
sequence reg_list
  reg_list=repeat(0,10)
  poke(Mouse_Cursor_Store, new_cursor[1])
  reg_list[REG_AX]=#0009  -- mouse function 9 change cursor
  reg_list[REG_BX]=new_cursor[2]  -- hot spot x coordinate
  reg_list[REG_CX]=new_cursor[3]  -- hot spot y coordinate
  reg_list[REG_ES]=floor(Mouse_Cursor_Store /16) -- address of cursor bitmap
 segment
  reg_list[REG_DX]=remainder(Mouse_Cursor_Store,16) -- address offset
  reg_list=dos_interrupt(#33, reg_list) -- call mouse interrupt
end procedure

-- main ------------------------------------------------------------------------

Mouse_Cursor_Store = allocate_low(64)

junk=graphics_mode(19)
polygon(BLUE,1,{{0,0},{319,0},{319,199},{0,199}})
mouse_events(MOVE+LEFT_DOWN+RIGHT_DOWN)

Change_cursor(new_curs)

key = wait_key()
junk=graphics_mode(-1)

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu