Zeda Thomas 4 лет назад
Родитель
Сommit
a08b9543a3
2 измененных файлов с 23 добавлено и 6 удалено
  1. 3 0
      src/io/menu.z80
  2. 20 6
      src/modemenu.z80

+ 3 - 0
src/io/menu.z80

@@ -45,6 +45,8 @@ menuroutine:
 ;   HL points to the header
 ;   IX points to the get/select code
 ;     If you are using the TI-OS VPutS routine, you'll need to have the textWrite flag set in sGrFlags
+;   (font_height) is the height of the font
+;   (menu_header_get) points to a routine that fetches the menu header.
 ;Notes:
 ;   The header is set up as follows:
 ;       .db number_of_titles
@@ -59,6 +61,7 @@ menuroutine:
 ;       carry flag is reset if it needs to return a pointer to the string for the element
 ;           Return carry flag as set if the element is out-of-bounds.
 ;       carry flag is set if it needs to return a pointer to the data for the element
+
   ld (menucallptr),ix
 
 ;save box dimensions

+ 20 - 6
src/modemenu.z80

@@ -1,29 +1,43 @@
 modemenu:
-
 ;Set the font to the pixel-aligned font
   ld a,2
   ld (textmode),a
 
-  ld hl,modemenu_header
-  ld de,mode_menu_header_RAM
+
+  ld hl,modemenu_header+5
+  ld de,mode_menu_header_RAM+5
   ld bc,6
-  ldir
+  ld a,c
+  ld (font_height),a
+  lddr
 
   ld (menutopinit),bc
   ld (menudefault),bc
 
+  ld hl,menu_header_getter
+  ld (menu_header_get),hl
+
+  ex de,hl
+  inc hl
   ld bc,$120D
   ld de,$3B27
-  ld hl,mode_menu_header_RAM
   ld ix,modemenu_getselect
 
   call menuroutine
 
-;Set the font to the grid-aligned
   xor a
   ld (textmode),a
   ret
 
+mode_menu_header_getter:
+  or a
+  jr z,$+4
+  xor a
+  ret
+  ld hl,mode_menu_header_RAM
+  or h
+  ret
+
 modemenu_getselect:
   jr nc,modemenu_opt
 ; If the user pressed [Enter], then we need to re-enter!