comparison menu.s68 @ 994:4360cb5960c8

Added code to display Next and Prev buttons on file listing screens to menu
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 Apr 2016 20:20:29 -0700
parents fbd783ccbadb
children edab85c29d4d
comparison
equal deleted inserted replaced
993:38f1d897e804 994:4360cb5960c8
171 menu_port equ $180000 171 menu_port equ $180000
172 172
173 MAX_DISPLAY equ 24 173 MAX_DISPLAY equ 24
174 174
175 rsset $FFFF8000 175 rsset $FFFF8000
176 x_pos rs.w 1 176 x_pos rs.w 1
177 base_cmd rs.l 1 177 base_cmd rs.l 1
178 sprite_list rs.l 160 178 sprite_list rs.l 160
179 page_index rs.l MAX_DISPLAY+1 179 page_index rs.l MAX_DISPLAY+1
180 page_stack rs.l 1 180 page_stack rs.l 1
181 page_pointers rs.l 1024 181 page_pointers rs.l 1024
182 mouse_sprite rs.l 1 182 mouse_sprite rs.l 1
183 menu_functions rs.l 1 183 menu_functions rs.l 1
184 mouse_x rs.w 1 184 cursor_show_fun rs.l 1
185 selection_top rs.w 1 185 mouse_x rs.w 1
186 selection_bot rs.w 1 186 selection_top rs.w 1
187 selection_mask rs.w 1 187 selection_bot rs.w 1
188 num_sprites rs.b 1 188 selection_mask rs.w 1
189 last_pad1 rs.b 1 189 num_sprites rs.b 1
190 last_pad2 rs.b 1 190 last_pad1 rs.b 1
191 selected rs.b 1 191 last_pad2 rs.b 1
192 more_pages rs.b 1 192 selected rs.b 1
193 mouse_buf rs.b 3 193 more_pages rs.b 1
194 mouse_shown rs.b 1 194 mouse_buf rs.b 3
195 last_mbuttons rs.b 1 195 mouse_shown rs.b 1
196 num_menu rs.b 1 196 last_mbuttons rs.b 1
197 num_slots rs.b 1 197 num_menu rs.b 1
198 port_off rs.b 1 198 num_slots rs.b 1
199 port_off rs.b 1
199 200
200 201
201 int_6: 202 int_6:
202 dmasrc sprite_list, DMA_SRC_68K 203 dmasrc sprite_list, DMA_SRC_68K
203 ;set DMA length 204 ;set DMA length
920 921
921 move.l #$40860002, d3 922 move.l #$40860002, d3
922 move.l d3, (a1) 923 move.l d3, (a1)
923 move.l d3, base_cmd.w 924 move.l d3, base_cmd.w
924 925
925
926 move.b #0, more_pages.w 926 move.b #0, more_pages.w
927 lea page_index.w, a3 927 lea page_index.w, a3
928 moveq #MAX_DISPLAY-1, d7 928 moveq #MAX_DISPLAY-1, d7
929 file_loop: 929 file_loop:
930 tst.b (a6)+ 930 tst.b (a6)+
970 move.l a5, page_stack.w 970 move.l a5, page_stack.w
971 971
972 ;null terminate page_index 972 ;null terminate page_index
973 moveq #0, d0 973 moveq #0, d0
974 move.l d0, (a3) 974 move.l d0, (a3)
975
976 tst.b mouse_shown
977 beq .no_mouse
978
979 tst.b more_pages.w
980 beq .no_next_page
981
982 ;draw Next button
983 moveq #30, d0
984 moveq #26, d1
985 moveq #6, d2
986 bsr draw_button
987
988 ;base attribute
989 move.w #$206B, d0
990 ;x pos
991 moveq #32, d1
992 ;y pos
993 moveq #26, d2
994 lea next_str(pc), a6
995 bsr print_string_fixed
996
997 .no_next_page
998
999 cmp.l #(page_pointers+8), a5
1000 beq .no_prev_page
1001
1002 ;draw Prev button
1003 moveq #4, d0
1004 moveq #26, d1
1005 moveq #6, d2
1006 bsr draw_button
1007
1008 ;base attribute
1009 move.w #$206B, d0
1010 ;x pos
1011 moveq #6, d1
1012 ;y pos
1013 moveq #26, d2
1014 lea prev_str(pc), a6
1015 bsr print_string_fixed
1016
1017 .no_prev_page
1018
1019 move.l #0, cursor_show_fun.w
1020
1021 bra .done_page_buttons
1022 .no_mouse
1023 ;TODO - setup cusrsor_show_fun
1024 .done_page_buttons
975 1025
976 gamepad_setup: 1026 gamepad_setup:
977 ;setup gamepads 1027 ;setup gamepads
978 move.b #$40, PAD1_CTRL 1028 move.b #$40, PAD1_CTRL
979 move.b #$40, PAD2_CTRL 1029 move.b #$40, PAD2_CTRL
1064 move.b #(6*4), port_off.w 1114 move.b #(6*4), port_off.w
1065 bsr show_save_slots 1115 bsr show_save_slots
1066 .wait 1116 .wait
1067 stop #$2500 1117 stop #$2500
1068 bra .wait 1118 bra .wait
1119
1120 next_str:
1121 dc.b "Next", 0
1122 prev_str:
1123 dc.b "Prev", 0
1069 1124
1070 about_text: 1125 about_text:
1071 dc.b "BlastEm v0.4.0", 0 1126 dc.b "BlastEm v0.4.0", 0
1072 dc.b "Copyright 2011-2016 Michael Pavone", 0 1127 dc.b "Copyright 2011-2016 Michael Pavone", 0
1073 dc.b " ", 0 1128 dc.b " ", 0