mirror of
https://github.com/alfishe/amiga-bootcamp.git
synced 2026-06-13 00:26:28 +00:00
docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
Comprehensive technical documentation covering: - Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives - Boot sequence: cold boot through startup-sequence - Binary format: HUNK executable spec, relocation, debug info - Linking & ABI: .fd files, LVO tables, register calling conventions - Exec kernel: tasks, interrupts, memory, signals, semaphores - AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting - Graphics: planar bitmaps, Copper programming, HAM/EHB modes - Intuition: screens, windows, IDCMP, BOOPSI - Devices: trackdisk, SCSI, serial, timer, audio, keyboard - Libraries: utility, expansion, IFFParse, locale, ARexx - Networking: bsdsocket API, SANA-II, TCP/IP stack comparison - Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging - Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies - CPU & MMU: 68040/060 emulation libs, PMMU, cache management - Driver development: SANA-II, Picasso96/RTG, AHI audio All files include breadcrumb navigation. No local paths or proprietary content.
This commit is contained in:
parent
f07a368bf1
commit
21751c0025
172 changed files with 19701 additions and 0 deletions
64
09_intuition/menus.md
Normal file
64
09_intuition/menus.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
[← Home](../README.md) · [Intuition](README.md)
|
||||
|
||||
# Menus — MenuStrip Construction
|
||||
|
||||
## Overview
|
||||
|
||||
Intuition menus are structured as: `Menu` → `MenuItem` → `SubItem`. Menus are attached to windows and appear when the user presses the right mouse button.
|
||||
|
||||
---
|
||||
|
||||
## GadTools Menu Creation (OS 2.0+)
|
||||
|
||||
```c
|
||||
struct NewMenu nm[] = {
|
||||
{ NM_TITLE, "Project", NULL, 0, 0, NULL },
|
||||
{ NM_ITEM, "New", "N", 0, 0, NULL },
|
||||
{ NM_ITEM, "Open...", "O", 0, 0, NULL },
|
||||
{ NM_ITEM, NM_BARLABEL, NULL, 0, 0, NULL }, /* separator */
|
||||
{ NM_ITEM, "Quit", "Q", 0, 0, NULL },
|
||||
{ NM_TITLE, "Edit", NULL, 0, 0, NULL },
|
||||
{ NM_ITEM, "Cut", "X", 0, 0, NULL },
|
||||
{ NM_ITEM, "Copy", "C", 0, 0, NULL },
|
||||
{ NM_ITEM, "Paste", "V", 0, 0, NULL },
|
||||
{ NM_END, NULL, NULL, 0, 0, NULL }
|
||||
};
|
||||
|
||||
struct Menu *menu = CreateMenus(nm, TAG_DONE);
|
||||
LayoutMenus(menu, vi, TAG_DONE);
|
||||
SetMenuStrip(win, menu);
|
||||
|
||||
/* In event loop on IDCMP_MENUPICK: */
|
||||
UWORD code = imsg->Code;
|
||||
while (code != MENUNULL) {
|
||||
struct MenuItem *item = ItemAddress(menu, code);
|
||||
UWORD menuNum = MENUNUM(code);
|
||||
UWORD itemNum = ITEMNUM(code);
|
||||
UWORD subNum = SUBNUM(code);
|
||||
/* process selection */
|
||||
code = item->NextSelect;
|
||||
}
|
||||
|
||||
/* Cleanup: */
|
||||
ClearMenuStrip(win);
|
||||
FreeMenus(menu);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Menu Selection Macros
|
||||
|
||||
```c
|
||||
#define MENUNUM(code) ((code) & 0x1F) /* menu number (0–31) */
|
||||
#define ITEMNUM(code) (((code) >> 5) & 0x3F) /* item number (0–63) */
|
||||
#define SUBNUM(code) (((code) >> 11) & 0x1F) /* subitem number */
|
||||
#define FULLMENUNUM(m,i,s) ((m)|((i)<<5)|((s)<<11))
|
||||
#define MENUNULL 0xFFFF /* no selection */
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- NDK39: `libraries/gadtools.h`, `intuition/intuition.h`
|
||||
- ADCD 2.1: `CreateMenus`, `LayoutMenus`, `SetMenuStrip`
|
||||
Loading…
Add table
Add a link
Reference in a new issue