123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- *****************************************************************
- * MODULE TITLE :cursor_routines *
- * *
- * DESCRIPTION :software to move cursor and display *
- * additional information at the cursor *
- * when neccessary *
- * *
- * NAME DATE *
- * *
- * LIST OF ROUTINES :position_cursor *
- * position_note_info *
- * attach_pointer *
- * attach_note *
- * attach_graphics *
- * detach_pointer *
- * *
- *****************************************************************
- ***********************************************
- ***** POSITION CURSOR *****
- ***********************************************
- position_cursor
- move.w mousex_inc,d0
-
- add.w d0,mouse_x
- cmp.w #319,mouse_x
- ble.s in_rangex
- move.w #319,mouse_x
- in_rangex
- cmp.w #0,mouse_x
- bge.s still_range_x
- move.w #0,mouse_x
- still_range_x
- move.w mousey_inc,d0
- add.w d0,mouse_y
- cmp.w #256,mouse_y
- ble.s in_range_y
- move.w #256,mouse_y
- in_range_y
- cmp.w #0,mouse_y
- bge.s still_range_y
- move.w #0,mouse_y
- still_range_y
- cmp.b #0,pointer_state
- beq.s normal_state
- move.l #wait_pointer,a0
- move.w #27,d7
- bra.s do_other_mouse_stuff
- normal_state
- move.l #mouse_pointer,a0
- move.w #16,d7
- do_other_mouse_stuff
- move.w mouse_x,d0
- add.w #$81-1,d0 ;tricky positioning
- move.b #0,3(A0)
- asr.w #1,d0
- bcc.s no_bit_set
- bset #0,3(a0)
- no_bit_set
- move.b d0,1(a0)
-
- move.w mouse_y,d0
- add.w #$2c,d0
- btst #8,d0
- beq.s not_vert_set
- bset #2,3(a0)
- not_vert_set
- move.b d0,(a0)
-
- add.w d7,d0
- btst #8,d0
- beq.s not_vstop_set
- bset #1,3(a0)
- not_vstop_set
- move.b d0,2(a0)
-
- cmp.b #0,pointer_state
- beq.s normal_pointer
- move.l #wait_pointer,d0
- bra.s stuff_spr_data
- normal_pointer
- move.l #mouse_pointer,d0
- stuff_spr_data
- move.w d0,sprite0l
- swap d0
- move.w d0,sprite0h
- rts
- ***********************************************
- ***** ATTACH POINTER *****
- ***********************************************
- attach_pointer
- *routine for anyone to use
- **send sprite y size in d0
- **send sprite graphics in a0
- move.w d0,attach_pointer_size
- move.l #pointer_attach_bits+4,a2
- subq.w #1,d0
- fill_mouse_pointer
- move.w (a0)+,(a2)+
- move.w (a0)+,(a2)+
- dbra d2,fill_mouse_pointer
- move.l #$0,(a2)
- move.b #1,attach_information
-
- rts
-
- ***********************************************
- ***** ATTACH GRAPHICS *****
- ***********************************************
- attach_graphics
- move.w attach_pointer_size,d2
- move.l #pointer_attach_bits,a0
- move.l mouse_pointer,(a0)
- add.b #17,(a0) ;add to x
- bcc.s no_set_ex
- bset.b #2,3(a0)
- no_set_ex
- add.w #1,d2
- add.b d2,2(a0)
- bcc.s no_vstop_ex
- bset.b #1,3(a0)
- no_vstop_ex
- rts
- attach_pointer_size
- dc.w 0
- attach_information
- dc.b 0
- EVEN
- pointer_state
- dc.b 0
- EVEN
- ********************************
- *** POSITION BOX SPRITE ****
- ********************************
- position_box_sprite
- move.w mouse_x,d0
- move.w mouse_y,d1
- cmp.w #1,show_box
- bne.s blank_out_sprite
- cmp.w max_screen_pos,d1
- blt.s display_box_sprite
- blank_out_sprite
- move.l #blank,d0
- move.w d0,sprite2l
- swap d0
- move.w d0,sprite2h
- move.l #blank,d0
- move.w d0,sprite3l
- swap d0
- move.w d0,sprite3h
- rts
- display_box_sprite
- move.l current_map_ptr,a0
- cmp.w #8,map_block_size(a0)
- beq.s position_sprite8x8
- cmp.w #16,map_block_size(a0)
- beq.s position_sprite16x16
- cmp.w #32,map_block_size(a0)
- beq.s position_sprite32x32
- position_sprite8x8
- andi.w #$fff8,d0
- andi.w #$fff8,d1
- move.w #8,d2
- move.l #sprite8x8,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite2l
- swap d0
- move.w d0,sprite2h
- move.l #blank,d0
- move.w d0,sprite3l
- swap d0
- move.w d0,sprite3h
- rts
- position_sprite16x16
- andi.w #$fff0,d0
- andi.w #$fff0,d1
- move.w #16,d2
- move.l #sprite16x16,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite2l
- swap d0
- move.w d0,sprite2h
- move.l #blank,d0
- move.w d0,sprite3l
- swap d0
- move.w d0,sprite3h
- rts
- position_sprite32x32
- andi.w #$ffe0,d0
- andi.w #$ffe0,d1
- move.w #32,d2
- move.l #sprite32x321,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite2l
- swap d0
- move.w d0,sprite2h
- move.w mouse_x,d0
- move.w mouse_y,d1
- andi.w #$ffe0,d0
- add.w #16,d0
- andi.w #$ffe0,d1
- move.w #32,d2
- move.l #sprite32x322,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite3l
- swap d0
- move.w d0,sprite3h
- rts
- show_box
- dc.w 1
- show_box2
- dc.w 1
- ********************************
- *** POSITION BOX SPRITE2 ****
- ********************************
- position_box_sprite2
- cmp.w #1,show_box2
- beq.s display_box_sprite2
- blank_box2
- move.l #blank,d0
- move.w d0,sprite6l
- swap d0
- move.w d0,sprite6h
- move.l #blank,d0
- move.w d0,sprite7l
- swap d0
- move.w d0,sprite7h
- rts
- display_box_sprite2
- move.w current_block,d0
- move.w current_page,d1
- mulu num_blocks_in_page,d1
- sub.w d1,d0
- move.l current_map_ptr,a0
- move.l #main_screen_struct,a1
- move.w screen_x_size(a1),d1
- divu map_block_size(a0),d1 ;divide factor
- divu d1,d0
- move.w d0,d1 ;y
- swap d0 ;x
- mulu map_block_size(a0),d1 ;y
- mulu map_block_size(a0),d0 ;x
- add.w #BUTTON_WINDOW_OFFSET-32,d1
-
- move.l page_pointer,a1
- move.w screen_y_pos(a1),d2
- add.w #BUTTON_WINDOW_OFFSET-32,d2
- cmp.w d2,d1
- blt blank_box2
- add.w #32,d2
- sub.w map_block_size(a0),d2
- cmp.w d2,d1
- bgt blank_box2
-
- sub.w screen_y_pos(a1),d1
- move.w d0,d6
- move.w d1,d7
- cmp.w #8,map_block_size(a0)
- beq.s position_sprite8x82
- cmp.w #16,map_block_size(a0)
- beq.s position_sprite16x162
- cmp.w #32,map_block_size(a0)
- beq.s position_sprite32x322
- position_sprite8x82
- andi.w #$fff8,d0
- andi.w #$fff8,d1
- move.w #8,d2
- move.l #sprite8x82,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite6l
- swap d0
- move.w d0,sprite6h
- move.l #blank,d0
- move.w d0,sprite7l
- swap d0
- move.w d0,sprite7h
- rts
- position_sprite16x162
- andi.w #$fff0,d0
- andi.w #$fff0,d1
- move.w #16,d2
- move.l #sprite16x162,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite6l
- swap d0
- move.w d0,sprite6h
- move.l #blank,d0
- move.w d0,sprite7l
- swap d0
- move.w d0,sprite7h
- rts
- position_sprite32x322
- andi.w #$ffe0,d0
- andi.w #$ffe0,d1
- move.w #32,d2
- move.l #sprite32x3212,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite6l
- swap d0
- move.w d0,sprite6h
- move.w d6,d0
- move.w d7,d1
- andi.w #$ffe0,d0
- add.w #16,d0
- andi.w #$ffe0,d1
- move.w #32,d2
- move.l #sprite32x3222,a0
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite7l
- swap d0
- move.w d0,sprite7h
- rts
- position_any_sprite
- *send in data in a0
- *x in d0
- *y in d1
- *height in d2
- gendo_other_mouse_stuff
- add.w #$81-1,d0 ;tricky positioning
- move.b #0,3(A0)
- asr.w #1,d0
- bcc.s genno_bit_set
- bset #0,3(a0)
- genno_bit_set
- move.b d0,1(a0)
-
- add.w #$2c,d1
- btst #8,d1
- beq.s gennot_vert_set
- bset #2,3(a0)
- gennot_vert_set
- move.b d1,(a0)
-
- add.w d2,d1
- btst #8,d1
- beq.s gennot_vstop_set
- bset #1,3(a0)
- gennot_vstop_set
- move.b d1,2(a0)
- rts
- ******************************************
- **** DISPLAY HELPFUL CURSOR *****
- ******************************************
- display_helpful_cursor
- * cmp.w #BUTTON_WINDOW_OFFSET,mouse_y
- * bge.s blank_out_help
- cmp.w #0,sprite_to_attach
- bne.s attach_help
- blank_out_help
- move.l #blank,d0
- move.w d0,sprite4l
- swap d0
- move.w d0,sprite4h
- bra.s quit_display_helpful
- attach_help
- cmp.w #WITH,sprite_to_attach
- bne.s check_next
- move.l #sprwith,a0
- bra.s position_it
- check_next
- cmp.w #TO,sprite_to_attach
- bne.s default_last
- move.l #sprto,a0
- bra.s position_it
- default_last
- move.l #sprpick,a0
- position_it
- move.w mouse_x,d0
- move.w mouse_y,d1
- add.w #18,d1
- move.w #10,d2
- bsr position_any_sprite
- move.l a0,d0
- move.w d0,sprite4l
- swap d0
- move.w d0,sprite4h
- quit_display_helpful
- rts
- **********************************
- *** BLANK SPRITES ****
- **********************************
- blank_sprites
- move.l #blank_sprite,d0
- move.w d0,sprite1l
- move.w d0,sprite2l
- move.w d0,sprite3l
- move.w d0,sprite4l
- move.w d0,sprite5l
- move.w d0,sprite6l
- move.w d0,sprite7l
- swap d0
- move.w d0,sprite1h
- move.w d0,sprite2h
- move.w d0,sprite3h
- move.w d0,sprite4h
- move.w d0,sprite5h
- move.w d0,sprite6h
- move.w d0,sprite7h
- rts
-
|