comparison src/menu_processor.inc @ 623:c40025d8e750

3.03 beta released
author heinrichsweikamp
date Mon, 03 Jun 2019 14:01:48 +0200
parents b455b31ce022
children 4050675965ea
comparison
equal deleted inserted replaced
622:02d1386429a6 623:c40025d8e750
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File menu_processor.asm REFACTORED VERSION V2.97 3 ; File menu_processor.asm combined next generation V3.0.4b
4 ; 4 ;
5 ; Routines to handle all OSTC graphic/text menus. 5 ; Routines to handle all OSTC graphic/text menus.
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
9 ; HISTORY 9 ; HISTORY
10 ; 2011-05-30 : [jDG] Creation. 10 ; 2011-05-30 : [jDG] Creation.
11 11
12 ; Restart menu-system from first icon/line 12 ; restart menu-system from first icon/line
13 extern menu_processor_reset 13 extern menu_processor_reset
14 14
15 ; Recall last (automatically) saved icon/line when returning from submenu 15 ; recall last (automatically) saved icon/line when returning from submenu
16 extern menu_processor_pop 16 extern menu_processor_pop
17 extern menu_processor_double_pop 17 extern menu_processor_double_pop
18 18
19 ; execute the menu block 19 ; execute the menu block
20 extern menu_processor 20 extern menu_processor
21 extern menu_processor_bottom_line
22 21
23 ;============================================================================= 22 ;=============================================================================
24 ; Menus parameters 23 ; Menus parameters
25 24
26 ;NOTE: should be idenric in .inc and .asm ! 25 ;NOTE: needs to be identical in .inc and .asm files!
27 #define MENU_LINES_MAX .7 ; Number of lines per screen? 26 #define MENU_LINES_MAX .7 ; max number of lines per screen
28 #define MENU_HEIGHT .27 ; Spacing on screen. 27 #define MENU_HEIGHT .27 ; spacing on screen
29 #define MENU_VCENTER .125 ; Position on screen. 28 #define MENU_VCENTER .125 ; position on screen
30 29
31 ;============================================================================= 30 ;=============================================================================
32 31
33 COMMON_BEGIN_MENU MACRO dynamic, txt, nb_items 32 COMMON_BEGIN_MENU MACRO dynamic, txt, nb_items
34 local center 33 local center
44 Endif 43 Endif
45 44
46 extern txt 45 extern txt
47 call menu_processor 46 call menu_processor
48 47
49 ; Push 6 bytes of menu header data. 48 ; Push 6 bytes of menu header data
50 db nb_items, dynamic 49 db nb_items, dynamic
51 db LOW(txt), HIGH(txt) 50 db LOW(txt), HIGH(txt)
52 db UPPER(txt), center 51 db UPPER(txt), center
53 ENDM 52 ENDM
54 53
55 ;============================================================================= 54 ;=============================================================================
56 55
57 ; Macro to generat (and check) menu vertical menu blocks with data. 56 ; Macro to generat (and check) menu vertical menu blocks with data.
69 ; Submenu 68 ; Submenu
70 69
71 MENU_CALL MACRO txt, proc 70 MENU_CALL MACRO txt, proc
72 extern txt 71 extern txt
73 db 0, 0, 0, 0 72 db 0, 0, 0, 0
74 db LOW(proc), HIGH(proc), UPPER(proc), 0 73 db LOW(proc), HIGH(proc), UPPER(proc), 0
75 db LOW(txt), HIGH(txt) 74 db LOW(txt), HIGH(txt)
76 ENDM 75 ENDM
77 76
78 ; Generic option menu 77 ; Generic option menu
79 78
80 MENU_OPTION MACRO txt, option, callback 79 MENU_OPTION MACRO txt, option, callback
81 extern txt 80 extern txt
82 extern option 81 extern option
83 db 2, LOW(callback), HIGH(callback), UPPER(callback) 82 db 2, LOW(callback), HIGH(callback), UPPER(callback)
84 db LOW(option), HIGH(option), UPPER(option), 0 83 db LOW(option), HIGH(option), UPPER(option), 0
85 db LOW(txt), HIGH(txt) 84 db LOW(txt), HIGH(txt)
86 ENDM 85 ENDM
87 86
88 MENU_DYNAMIC MACRO callback, proc 87 MENU_DYNAMIC MACRO callback, proc
89 extern callback 88 extern callback