void start_menu_init(){ start_menu = create_menu("spaceinvader_font_transparent.bmp"); button* singleplayer = create_button(512, 250, 500, 90, ALIGN_CENTER, &start_menu_singleplayer_on_click, "Singleplayer", rgb(0xFFFFFF), ALIGN_CENTER); menu_add_button(start_menu, singleplayer); button* multiplayer = create_button(512, 350, 500, 90, ALIGN_CENTER, &start_menu_multiplayer_on_click, "Multiplayer", rgb(0xFFFFFF), ALIGN_CENTER); menu_add_button(start_menu, multiplayer); button* highscore = create_button(512, 450, 500, 90, ALIGN_CENTER, &start_menu_highscore_on_click, "Highscores", rgb(0xFFFFFF), ALIGN_CENTER); menu_add_button(start_menu, highscore); button* options = create_button(512, 550, 500, 90, ALIGN_CENTER, &start_menu_options_on_click, "Options", rgb(0xFFFFFF), ALIGN_CENTER); menu_add_button(start_menu, options); button* exit = create_button(512, 650, 500, 90, ALIGN_CENTER, &start_menu_exit_on_click, "Exit", rgb(0xFFFFFF), ALIGN_CENTER); menu_add_button(start_menu, exit); title = bitmap_load("title.bmp"); }
void mem_menu_create(struct menu *menu) { /* initialize data */ vector_init(&domains, sizeof(struct mem_domain)); add_domain(0x80000000, 0x00C00000, "k0 rdram"); add_domain(0xA0000000, 0x00C00000, "k1 rdram"); add_domain(0xA3F00000, 0x00100000, "rdram regs"); add_domain(0xA4000000, 0x00100000, "sp regs"); add_domain(0xA4100000, 0x00100000, "dp com"); add_domain(0xA4200000, 0x00100000, "dp span"); add_domain(0xA4300000, 0x00100000, "mi regs"); add_domain(0xA4400000, 0x00100000, "vi regs"); add_domain(0xA4500000, 0x00100000, "ai regs"); add_domain(0xA4600000, 0x00100000, "pi regs"); add_domain(0xA4800000, 0x00100000, "si regs"); add_domain(0xA8000000, 0x08000000, "cart dom2"); add_domain(0xB0000000, 0x0FC00000, "cart dom1"); add_domain(0xBFC00000, 0x000007C0, "pif rom"); add_domain(0xBFC007C0, 0x00000040, "pif ram"); /* initialize menus */ menu_init(menu, MENU_NOVALUE, MENU_NOVALUE, MENU_NOVALUE); menu->selector = menu_add_submenu(menu, 0, 0, NULL, "return"); { view_address = menu_add_intinput(menu, 0, 1, 16, 8, address_proc, NULL); struct menu_item *data_size = menu_add_option(menu, 9, 1, "byte\0""halfword\0""word\0", data_size_proc, NULL); menu_option_set(data_size, 2); view_data_size = 4; menu_add_button(menu, 18, 1, "<", prev_domain_proc, NULL); menu_add_button(menu, 20, 1, ">", next_domain_proc, NULL); view_domain_name = menu_add_static(menu, 22, 1, NULL, 0xC0C0C0); view_domain_name->text = malloc(32); struct gfx_texture *t_arrow = resource_get(RES_ICON_ARROW); view_pageup = menu_add_button_icon(menu, 0, 2, t_arrow, 0, 0xFFFFFF, page_up_proc, NULL); view_pagedown = menu_add_button_icon(menu, 2, 2, t_arrow, 1, 0xFFFFFF, page_down_proc, NULL); menu_add_static(menu, 9, 2, "0 1 2 3 4 5 6 7", 0xC0C0C0); for (int y = 0; y < MEM_VIEW_ROWS; ++y) { view_rows[y] = menu_add_static(menu, 0, 3 + y, NULL, 0xC0C0C0); view_rows[y]->text = malloc(9); } make_cells(menu); goto_domain(0); } }