Amiga: header hygiene and palette-size constants

Add AMII_PALETTE_SIZE / AMIV_PALETTE_SIZE in amiconf.h to make the
actual populated portion of the init-map arrays explicit.  Drop the
redundant extern void exit() declaration.  Annotate Abort with
NORETURN in both amiconf.h and winproto.h; drop the duplicate Abort
declaration further down winproto.h.

Convert the bare-token "CLIPPING must be defined" assertion in
windefs.h into a real #error directive.

Comment in winext.h to disambiguate the three similarly named
amii*_init*map palette arrays.
This commit is contained in:
Ingo Paschke
2026-05-12 15:21:23 +02:00
parent ebcf31a4da
commit d99eeb17c2
4 changed files with 18 additions and 6 deletions
+5 -2
View File
@@ -48,9 +48,8 @@ extern void nethack_exit(int);
extern void amii_setpens(int);
extern void getlind(const char *, char *, const char *);
extern void exit(int);
extern void CleanUp(void);
extern void Abort(long);
extern void Abort(long) NORETURN;
extern int getpid(void);
extern int kbhit(void);
extern int WindowGetchar(void);
@@ -84,6 +83,10 @@ extern void ami_wininit_data(int);
#define CHANGE_COLOR 1
#define DEPTH 6 /* Maximum depth of the screen allowed */
#define AMII_MAXCOLORS (1L << DEPTH)
/* Number of palette entries actually populated in amii_init_map[] (AMII text
* mode) and amiv_init_map[] (AMIV tile mode). Indices beyond these read 0. */
#define AMII_PALETTE_SIZE 8
#define AMIV_PALETTE_SIZE 32
typedef unsigned short AMII_COLOR_TYPE;
#define PORT_HELP "amii.hlp"
+1 -1
View File
@@ -29,7 +29,7 @@
#include "func_tab.h"
#ifndef CLIPPING
CLIPPING must be defined for the AMIGA version
#error "CLIPPING must be defined for the AMIGA version"
#endif
#undef LI
+11
View File
@@ -23,6 +23,17 @@ extern struct amii_DisplayDesc
*amiIDisplay; /* the Amiga Intuition descriptor */
extern struct window_procs amii_procs;
extern struct window_procs amiv_procs;
/* Three similarly-named palette arrays. Note the position of the
* second underscore distinguishes them:
* amii_initmap = working/runtime palette (mutated by tile/tomb load
* and the in-game color editor).
* amii_init_map = AMII (text-mode) compile-time defaults, 8 entries.
* amiv_init_map = AMIV (tile-mode) compile-time defaults, 32 entries
* (mutated by ReadImageFile when a tile/tomb IFF
* carries its own CMAP).
* The naming is historical; sysflags.amii_curmap is yet another related
* array holding the user's saved color choices.
*/
extern unsigned short amii_initmap[AMII_MAXCOLORS];
extern unsigned short amiv_init_map[AMII_MAXCOLORS];
extern unsigned short amii_init_map[AMII_MAXCOLORS];
+1 -3
View File
@@ -59,7 +59,7 @@ int amikbhit(void);
int WindowGetchar(void);
WETYPE WindowGetevent(void);
void amii_cleanup(void);
void Abort(long rc);
void Abort(long rc) NORETURN;
void CleanUp(void);
void flush_glyph_buffer(struct Window *w);
void amiga_print_glyph(winid window, int color_index, int glyph);
@@ -120,8 +120,6 @@ void amii_display_file(const char *fn, boolean complain);
void SetBorder(struct Gadget *gd);
/* malloc/free provided by stdlib.h */
void Abort(long rc);
win_request_info *amii_ctrl_nhwindow(winid, int, win_request_info *);
/* amirip.c */