8#ifndef A2560_PLATFORM_H_
9#define A2560_PLATFORM_H_
46#define EA_MCP (char*)0x010000
47#define EA_USER (char*)0x020000
51#define R8(x) *((volatile __far uint8_t* const)(x))
52#define P8(x) (volatile __far uint8_t* const)(x)
53#define R16(x) *((volatile __far uint16_t* const)(x))
54#define P16(x) (volatile __far uint16_t* const)(x)
55#define R32(x) *((volatile __far uint32_t* const)(x))
56#define P32(x) (volatile __far uint32_t* const)(x)
58#define NR8(x) *((volatile uint8_t* const)(x))
59#define NP8(x) (volatile uint8_t* const)(x)
60#define NR16(x) *((volatile uint16_t* const)(x))
61#define NP16(x) (volatile uint16_t* const)(x)
62#define NR32(x) *((volatile uint32_t* const)(x))
63#define NP32(x) (volatile uint32_t* const)(x)
65#define TEXT_COL_COUNT_FOR_PLOTTING_A2560K 100
66#define TEXT_ROW_COUNT_FOR_PLOTTING_A2560K 75
67#define TEXT_COL_COUNT_FOR_PLOTTING TEXT_COL_COUNT_FOR_PLOTTING_A2560K
68#define TEXT_ROW_COUNT_FOR_PLOTTING TEXT_ROW_COUNT_FOR_PLOTTING_A2560K
70#define TEXT_ROW_COUNT_60HZ 60
71#define TEXT_ROW_COUNT_70HZ 50
72#define TEXT_ROW_COUNT_DEBUG_SCREEN 75
74#define TEXT_FONT_WIDTH 8
75#define TEXT_FONT_HEIGHT 8
76#define TEXT_FONT_BYTE_SIZE (8*256)
79#define MAX_STRING_COMP_LEN 256
82#define GEN_NO_STRLEN_CAP -1
83#define WORD_WRAP_MAX_LEN 12800
86#define FILE_MAX_PATHNAME_SIZE 260
89#define VIDEO_MODE_BYTE 0x01
90#define VIDEO_MODE_BIT1 0x01
95#define VIDEO_MODE_BIT2 0x02
96#define GAMMA_MODE_ONOFF_BITS 0x03
98 #define BORDER_X_MASK 0xFFFF00FF
99 #define BORDER_Y_MASK 0xFF00FFFF
100 #define BORDER_CTRL_OFFSET_L 0x01
101 #define BORDER_COLOR_OFFSET_L 0x02
102 #define BACKGROUND_COLOR_OFFSET_L 0x03
103 #define CURSOR_CTRL_OFFSET_L 0x04
104 #define CURSOR_POS_OFFSET_L 0x04
105 #define LN_INTERRUPT_01_OFFSET_L 0x05
106 #define BITMAP_L0_CTRL_L 0x40
107 #define BITMAP_L0_VRAM_ADDR_OFFSET_L 0x41
108 #define BITMAP_L1_CTRL_L 0x42
109 #define BITMAP_L1_VRAM_ADDR_OFFSET_L 0x43
110 #define CLUT0_OFFSET 8192
111 #define CLUT1_OFFSET (CLUT0_OFFSET + 1024)
112 #define CLUT2_OFFSET (CLUT1_OFFSET + 1024)
113 #define CLUT3_OFFSET (CLUT2_OFFSET + 1024)
114 #define CLUT4_OFFSET (CLUT3_OFFSET + 1024)
115 #define CLUT5_OFFSET (CLUT4_OFFSET + 1024)
116 #define CLUT6_OFFSET (CLUT5_OFFSET + 1024)
117 #define CLUT7_OFFSET (CLUT6_OFFSET + 1024)
123 #define BSWAP(word) ( (((word) >> 8) & 0x00FF) | (((word) << 8) & 0xFF00) )
125 #define VICKY_C256 0x00af0000
126 #define VICKY_II_MASTER_CTRL_REG_L 0x00af0000
127 #define VICKY_II_MASTER_CTRL_REG_H 0x00af0001
128 #define VICKY_II_GAMMA_CTRL_REG 0x00af0002
129 #define VICKY_II_BORDER_CTRL_REG 0x00af0004
130 #define VICKY_II_BORDER_COLOR_B 0x00af0005
131 #define VICKY_II_BORDER_COLOR_G 0x00af0006
132 #define VICKY_II_BORDER_COLOR_R 0x00af0007
133 #define VICKY_II_BORDER_X_SIZE 0x00af0008
134 #define VICKY_II_BORDER_Y_SIZE 0x00af0009
136 #define VICKY_II_BACKGROUND_COLOR_B 0x00af000D
137 #define VICKY_II_BACKGROUND_COLOR_G 0x00af000E
138 #define VICKY_II_BACKGROUND_COLOR_R 0x00af000F
140 #define BITMAP_L0_CTRL 0x00af0100
141 #define BITMAP_L0_VRAM_ADDR_L 0x00af0101
142 #define BITMAP_L0_VRAM_ADDR_M 0x00af0102
143 #define BITMAP_L0_VRAM_ADDR_H 0x00af0103
144 #define BITMAP_L1_CTRL 0x00af0108
145 #define BITMAP_L1_VRAM_ADDR_L 0x00af0109
146 #define BITMAP_L1_VRAM_ADDR_M 0x00af010A
147 #define BITMAP_L1_VRAM_ADDR_H 0x00af010B
149 #define TEXT_RAM_C256 (char*)0xafa000
150 #define TEXT_ATTR_C256 (char*)0xafc000
151 #define TEXT_FORE_LUT_C256 (char*)0xaf1f40
152 #define TEXT_BACK_LUT_C256 (char*)0xaf1f80
153 #define FONT_MEMORY_BANK_C256 (char*)0xaf8000
154 #define VICKY_II_CLUT0 0xaf2000
155 #define VICKY_II_CLUT1 (VICKY_II_CLUT0 + 0x400)
156 #define VICKY_II_CLUT2 (VICKY_II_CLUT1 + 0x400)
157 #define VICKY_II_CLUT3 (VICKY_II_CLUT2 + 0x400)
158 #define VICKY_II_CLUT4 (VICKY_II_CLUT3 + 0x400)
159 #define VICKY_II_CLUT5 (VICKY_II_CLUT4 + 0x400)
160 #define VICKY_II_CLUT6 (VICKY_II_CLUT5 + 0x400)
161 #define VICKY_II_CLUT7 (VICKY_II_CLUT6 + 0x400)
164 #define GABE_SYS_STAT 0x00AFE887
166 #define VIDEO_MODE_REG_OFFSET_B 0x01
167 #define GAMMA_CTRL_REG_OFFSET_B 0x02
168 #define VICKY_RESERVED_OFFSET_B 0x03
169 #define BORDER_CTRL_OFFSET_B 0x04
170 #define BORDER_COLOR_OFFSET_B_B 0x05
171 #define BORDER_COLOR_OFFSET_G_B 0x06
172 #define BORDER_COLOR_OFFSET_R_B 0x07
173 #define BORDER_X_SIZE_B 0x08
174 #define BORDER_Y_SIZE_B 0x09
175 #define BACKGROUND_COLOR_OFFSET_B_B 0x0D
176 #define BACKGROUND_COLOR_OFFSET_G_B 0x0E
177 #define BACKGROUND_COLOR_OFFSET_R_B 0x0F
178 #define CURSOR_CTRL_OFFSET_B 0x10
179 #define START_ADDR_OFFSET_B 0x11
180 #define CURSOR_CHAR_OFFSET_B 0x12
181 #define CURSOR_COLOR_OFFSET_B 0x13
182 #define LN_INTERRUPT_01_OFFSET_B 0x1B
183 #define BITMAP_L0_CTRL_B 0x100
184 #define BITMAP_L0_VRAM_ADDR_L_B 0x101
185 #define BITMAP_L0_VRAM_ADDR_M_B 0x102
186 #define BITMAP_L0_VRAM_ADDR_H_B 0x103
187 #define BITMAP_L1_CTRL_B 0x108
188 #define BITMAP_L1_VRAM_ADDR_L_B 0x109
189 #define BITMAP_L1_VRAM_ADDR_M_B 0x10A
190 #define BITMAP_L1_VRAM_ADDR_H_B 0x10B
191 #define CLUT0_OFFSET_B 0x2000
192 #define CLUT1_OFFSET_B 0x2400
193 #define CLUT2_OFFSET_B 0x2800
194 #define CLUT3_OFFSET_B 0x2C00
195 #define CLUT4_OFFSET_B 0x3000
196 #define CLUT5_OFFSET_B 0x3400
197 #define CLUT6_OFFSET_B 0x3800
198 #define CLUT7_OFFSET_B 0x3C00
199 #define FONT_MEMORY_BANK0_OFFSET_B 0x8000
206#define GAVIN_CONTROL_REG 0xfec00000
208 #define FLAG_SYS0_REG_POWER_LED 0b00000001
209 #define FLAG_SYS0_REG_SD_LED 0b00000010
210 #define FLAG_SYS0_REG_RES_2 0b00000100
211 #define FLAG_SYS0_REG_RES_3 0b00001000
212 #define FLAG_SYS0_REG_R_BUZZER 0b00010000
213 #define FLAG_SYS0_REG_RES_5 0b00100000
214 #define FLAG_SYS0_REG_RES_6 0b01000000
215 #define FLAG_SYS0_REG_RES_7 0b10000000
217 #define FLAG_SYS1_REG_RES_0 0b00000001
218 #define FLAG_SYS1_REG_RES_1 0b00000010
219 #define FLAG_SYS1_REG_RES_2 0b00000100
220 #define FLAG_SYS1_REG_RES_3 0b00001000
221 #define FLAG_SYS1_REG_RES_4 0b00010000
222 #define FLAG_SYS1_REG_RES_5 0b00100000
223 #define FLAG_SYS1_REG_RES_6 0b01000000
224 #define FLAG_SYS1_REG_W_RESET 0b10000000
228#define GAVIN_LFSR_CONTROL 0xfec00004
230 #define FLAG_LFSR0_LFSR_ENABLE 0b00000001
231 #define FLAG_LFSR0_SEED_WRITE 0b00000010
232 #define FLAG_LFSR0_REG_RES_2 0b00000100
233 #define FLAG_LFSR0_REG_RES_3 0b00001000
234 #define FLAG_LFSR0_REG_RES_4 0b00010000
235 #define FLAG_LFSR0_REG_RES_5 0b00100000
236 #define FLAG_LFSR0_REG_RES_6 0b01000000
237 #define FLAG_LFSR0_REG_RES_7 0b10000000
239 #define FLAG_LFSR1_REG_RES_0 0b00000001
240 #define FLAG_LFSR1_REG_RES_1 0b00000010
241 #define FLAG_LFSR1_REG_RES_2 0b00000100
242 #define FLAG_LFSR1_REG_RES_3 0b00001000
243 #define FLAG_LFSR1_REG_RES_4 0b00010000
244 #define FLAG_LFSR1_REG_RES_5 0b00100000
245 #define FLAG_LFSR1_REG_RES_6 0b01000000
246 #define FLAG_LFSR1_REG_RES_7 0b10000000
249#define RANDOM_NUM_GEN_ENABLE (GAVIN_LFSR_CONTROL)
250#define GAVIN_LFSR_OUTPUT 0xfec00008
253 #define FLAG_LFSR_STATUS_CTRL0 0b00000001
254 #define FLAG_LFSR_STATUS_CTRL1 0b00000010
255 #define FLAG_LFSR_STATUS_CTRL2 0b00000100
256 #define FLAG_LFSR_STATUS_CTRL3 0b00001000
257 #define FLAG_LFSR_STATUS_CTRL4 0b00010000
258 #define FLAG_LFSR_STATUS_CTRL5 0b00100000
259 #define FLAG_LFSR_STATUS_CTRL6 0b01000000
262#define RANDOM_NUM_GEN (GAVIN_LFSR_OUTPUT)
264#define GAVIN_POWER_LED_RGB 0xfec00008
270#define GAVIN_MACHINE_ID 0xfec0000c
274#define MACHINE_ID_REGISTER (GAVIN_MACHINE_ID)
276#define GAVIN_KEYBOARD_LED_RGB 0xfec0000c
283#define GAVIN_CHIP_VERSION 0xfec00010
287#define GAVIN_FIRMWARE_DATE 0xfec00014
293#define GAVIN_HARDWARE_DATE_A 0xfec00018
299#define GAVIN_HARDWARE_DATE_B 0xfec0001C
310#define GAVIN_KEYBOARD_INPUT_REG 0xfec00040
315#define GAVIN_RTC 0xfec00080
316#define RTC_SECONDS (GAVIN_RTC)
317#define RTC_SECONDS_ALARM (RTC_SECONDS + 1)
318#define RTC_MINUTES (RTC_SECONDS_ALARM + 1)
319#define RTC_MINUTES_ALARM (RTC_MINUTES + 1)
320#define RTC_HOURS (RTC_MINUTES_ALARM + 1)
321#define RTC_HOURS_ALARM (RTC_HOURS + 1)
322#define RTC_DAY (RTC_HOURS_ALARM + 1)
323#define RTC_DAY_ALARM (RTC_DAY + 1)
324#define RTC_DAY_OF_WEEK (RTC_DAY_ALARM + 1)
325#define RTC_MONTH (RTC_DAY_OF_WEEK + 1)
326#define RTC_YEAR (RTC_MONTH + 1)
327#define RTC_RATES (RTC_YEAR + 1)
328 #define FLAG_RTC_RATE_NONE 0b00000000
329 #define FLAG_RTC_RATE_31NS 0b00000001
330 #define FLAG_RTC_RATE_125MS 0b00001101
331 #define FLAG_RTC_RATE_63MS 0b00001100
332 #define FLAG_RTC_RATE_250MS 0b00001110
333 #define FLAG_RTC_RATE_500MS 0b00001111
334#define RTC_ENABLES (RTC_RATES + 1)
335 #define FLAG_RTC_PERIODIC_INT_EN 0b00000100
336 #define FLAG_RTC_ALARM_INT_EN 0b00001000
337#define RTC_FLAGS (RTC_ENABLES + 1)
338 #define FLAG_RTC_PERIODIC_INT 0b00000100
339 #define FLAG_RTC_ALARM_INT 0b00001000
340#define RTC_CONTROL (RTC_FLAGS + 1)
341 #define MASK_RTC_CTRL_DSE 0b00000001
342 #define MASK_RTC_CTRL_12_24 0b00000010
343 #define MASK_RTC_CTRL_STOP 0b00000100
344 #define MASK_RTC_CTRL_UTI 0b00001000
345 #define MASK_RTC_CTRL_UNUSED 0b11110000
346#define RTC_CENTURY (RTC_CONTROL + 1)
352#define GAVIN_INTERRUPT_CONTROL 0xfec00100
358#define GAVIN_TIMER_CONTROL 0xfec00200
364#define GAVIN_SD_CONTROL 0xfec00300
370#define GAVIN_IDE_CONTROL 0xfec00400
376#define GAVIN_JOY_CONTROL 0xfec00500
382#define GAVIN_ETHERNET_CONTROL 0xfec00500
388#define UART_BAUD_DIV_300 384
389#define UART_BAUD_DIV_600 192
390#define UART_BAUD_DIV_1200 96
391#define UART_BAUD_DIV_1800 64
392#define UART_BAUD_DIV_2000 58
393#define UART_BAUD_DIV_2400 48
394#define UART_BAUD_DIV_3600 32
395#define UART_BAUD_DIV_4800 24
396#define UART_BAUD_DIV_9600 12
397#define UART_BAUD_DIV_19200 6
398#define UART_BAUD_DIV_38400 3
399#define UART_BAUD_DIV_57600 2
400#define UART_BAUD_DIV_115200 1
403#define UART_DATA_BITS 0b00000011
404#define UART_STOP_BITS 0b00000100
405#define UART_PARITY_ENABLE 0b00001000
406#define UART_PARITY_EVEN 0b00010000
407#define UART_PARITY_STICK 0b00100000
408#define UART_BRK_SIG 0b01000000
409#define UART_DLAB_MASK 0b10000000
412#define UART_DATA_AVAILABLE 0b00000001
413#define UART_OVERRUN_ERROR 0b00000010
414#define UART_PARITY_ERROR 0b00000100
415#define UART_FRAMING_ERROR 0b00001000
416#define UART_BREAK_INT 0b00010000
417#define UART_THR_IS_EMPTY 0b00100000
418#define UART_THR_EMPTY_IDLE 0b01000000
419#define UART_ERROR 0b10000000
420#define UART_ERROR_MASK 0b10011110
429#define GAVIN_SERIAL_2_BASE 0xfec022F8
430#define UART2_BASE (GAVIN_SERIAL_2_BASE)
431#define UART2_RBR (UART2_BASE + 0)
432#define UART2_RHR (UART2_BASE + 0)
433#define UART2_THR (UART2_BASE + 0)
434#define UART2_DLL (UART2_BASE + 0)
435#define UART2_IER (UART2_BASE + 1)
436#define UART2_DLM (UART2_BASE + 1)
437#define UART2_IIR (UART2_BASE + 2)
438#define UART2_ISR (UART2_BASE + 2)
439#define UART2_FCR (UART2_BASE + 2)
440#define UART2_LCR (UART2_BASE + 3)
441#define UART2_MCR (UART2_BASE + 4)
442#define UART2_LSR (UART2_BASE + 5)
443#define UART2_MSR (UART2_BASE + 6)
444#define UART2_SCR (UART2_BASE + 7)
445#define UART2_SCR (UART2_BASE + 7)
448#define GAVIN_SERIAL_1_BASE 0xfec023F8
449#define UART_BASE (GAVIN_SERIAL_1_BASE)
450#define UART_RBR (UART_BASE + 0)
451#define UART_RHR (UART_BASE + 0)
452#define UART_THR (UART_BASE + 0)
453#define UART_DLL (UART_BASE + 0)
454#define UART_IER (UART_BASE + 1)
455#define UART_DLM (UART_BASE + 1)
456#define UART_IIR (UART_BASE + 2)
457#define UART_ISR (UART_BASE + 2)
458#define UART_FCR (UART_BASE + 2)
459#define UART_LCR (UART_BASE + 3)
460#define UART_MCR (UART_BASE + 4)
461#define UART_LSR (UART_BASE + 5)
462#define UART_MSR (UART_BASE + 6)
463#define UART_SCR (UART_BASE + 7)
464#define UART_SCR (UART_BASE + 7)
471#define CURSOR_ONOFF_BITS 0b00000001
472#define CURSOR_FLASH_RATE_BITS 0b00000110
473#define CURSOR_FLASH_RATE_12S 0b00000010
474#define CURSOR_FLASH_RATE_14S 0b00000100
475#define CURSOR_FLASH_RATE_15S 0b00000110
478#define VICKY_RES_FON_OVLY 0x10
479#define VICKY_RES_FON_SET 0x20
482#define VICKY_AB_OFFSET_BORDER_CTRL_REG 4
483#define VICKY_AB_OFFSET_BORDER_COLOR_REG 8
484#define VICKY_AB_OFFSET_BACK_COLOR_REG 12
485#define VICKY_AB_OFFSET_CURSOR_CTRL_REG 16
486#define VICKY_AB_OFFSET_CURSOR_POS_REG 20
501#define VICKY_II_RES_640X480_FLAGS 0x00
502#define VICKY_II_RES_800X600_FLAGS 0x01
503#define VICKY_II_PIX_DOUBLER_FLAGS 0x02
504#define VICKY_II_RES_640X400_FLAGS 0x03
506#define VICKY_IIIB_RES_640X480_FLAGS 0x00
507#define VICKY_IIIB_RES_800X600_FLAGS 0x01
508#define VICKY_IIIB_RES_RESERVED_FLAGS 0x02
509#define VICKY_IIIB_RES_640X400_FLAGS 0x03
511#define VICKY_IIIA_RES_800X600_FLAGS 0x00
512#define VICKY_IIIA_RES_1024X768_FLAGS 0x08
514#define VICKY_AB_RES_FLAG_MASK_8BIT 0x03
515#define VICKY_AB_RES_FLAG_MASK_32BIT 0x00000300
523#define VICKY_A_BASE_ADDRESS 0xfec40000
524#define VICKY_A_MASTER_CONTROL (VICKY_A_BASE_ADDRESS)
526 #define VICKY_AB_TEXT_MODE_EN_FLAG 0x00000001
527 #define VICKY_AB_DISABLE_VID_OUTPUT 0x00000080
529 #define VICKY_A_MC_RES_FLAG 0x00000800
531 #define VICKY_A_MC_GAMMA_SRC_FLAG 0x00010000
532 #define VICKY_A_MC_GAMMA_SW_CHOICE 0x00020000
533 #define VICKY_A_MC_SYNC_DISABLE 0x00040000
535 #define VICKY_A_MC_GAMMA_DIP 0x00200000
536 #define VICKY_A_MC_HIRES_DIP 0x00400000
537 #define VICKY_A_MC_CLK_SPD_FLAG 0x00800000
539#define VICKY_A_BORDER_CONTROL (VICKY_A_MASTER_CONTROL + 4)
542#define VICKYA_CURSOR_CTRL_A2560K (0xfec40010)
543 #define VICKY_AB_CCR_CHAR_MASK 0xFF00FFFF
544#define VICKYA_CURSOR_POS_A2560K (VICKY_A_BASE_ADDRESS + 0x14)
545#define VICKYA_MOUSE_GRAPHIC_A2560K 0xfec40400
546#define VICKYA_MOUSE_CTRL_A2560K 0xfec40c00
547#define VICKYA_MOUSE_PTR_POS 0xfec40c04
549#define VICKYA_PS2_MOUSE_BYTE_0 0xfec40c0a
550#define VICKYA_PS2_MOUSE_BYTE_1 0xfec40c0c
551#define VICKYA_PS2_MOUSE_BYTE_2 0xfec40c0e
554#define VICKY_BITMAP_MAX_H_RES 800
555#define VICKY_BITMAP_MAX_V_RES 600
556#define GRAPHICS_MODE_MASK 0xFFFFFF00
557#define VIDEO_MODE_MASK 0xFFFF00FF
558#define GAMMA_MODE_MASK 0xFF00FFFF
560#define VICKY_B_BASE_ADDRESS 0xfec80000
562#define VICKY_B_MASTER_CONTROL (VICKY_B_BASE_ADDRESS)
565 #define VICKY_AB_TEXT_MODE_EN_FLAG 0x00000001
566 #define VICKY_AB_DISABLE_VID_OUTPUT 0x00000080
568 #define GRAPHICS_MODE_TEXT 0x01
569 #define GRAPHICS_MODE_TEXT_OVER 0x02
570 #define GRAPHICS_MODE_GRAPHICS 0x04
571 #define GRAPHICS_MODE_EN_BITMAP 0x08
572 #define GRAPHICS_MODE_EN_TILE 0x10
573 #define GRAPHICS_MODE_EN_SPRITE 0x20
574 #define GRAPHICS_MODE_RESERVED 0x40
575 #define GRAPHICS_MODE_DIS_VIDEO 0x80
579 #define VICKY_B_MC_RES_FLAG_1 0x00000100
580 #define VICKY_B_MC_RES_FLAG_2 0x00000200
585 #define VICKY_B_MC_PIX_DBL_FLAG 0x00000400
586 #define VICKY_B_MC_RESERVED_1 0x00000800
587 #define VICKY_B_MC_RESERVED_2 0x00001000
588 #define VICKY_B_MC_GAMMA_DIP 0x00002000
589 #define VICKY_B_MC_HIRES_DIP 0x00004000
590 #define VICKY_B_MC_CLK_SPD_FLAG 0x00008000
592 #define VICKY_B_MC_GAMMA_SRC_FLAG 0x00010000
593 #define VICKY_B_MC_GAMMA_SW_CHOICE 0x00020000
594 #define VICKY_B_MC_SYNC_DISABLE 0x00040000
597#define VICKYB_BORDER_CTRL_A2560K (VICKY_B_BASE_ADDRESS + 4)
598#define VICKYB_BORDER_COLOR_A2560K 0xfec80008
599#define VICKYB_BACK_COLOR_A2560K 0xfec8000C
600#define VICKYB_CURSOR_CTRL_A2560K (VICKY_B_BASE_ADDRESS + 16)
601#define VICKYB_CURSOR_POS_A2560K (VICKY_B_BASE_ADDRESS + 20)
602#define VICKYB_BITMAP_L0_CTRL 0xfec80100
603#define VICKYB_MOUSE_GRAPHIC_A2560K 0xfec80400
604#define VICKYB_MOUSE_CTRL_A2560K 0xfec80c00
605#define VICKYB_MOUSE_PTR_POS 0xfec80c04
606#define VICKYB_PS2_MOUSE_BYTE_0 0xfec80c0a
607#define VICKYB_PS2_MOUSE_BYTE_1 0xfec80c0c
608#define VICKYB_PS2_MOUSE_BYTE_2 0xfec80c0e
609#define TEXTA_RAM_A2560K (char*)0xfec60000
610#define TEXTA_ATTR_A2560K (char*)0xfec68000
611#define TEXTA_FORE_LUT_A2560K (char*)0xfec6c400
612#define TEXTA_BACK_LUT_A2560K (char*)0xfec6c440
613#define TEXTB_RAM_A2560K (char*)0xfeca0000
614#define TEXTB_ATTR_A2560K (char*)0xfeca8000
615#define TEXTB_FORE_LUT_A2560K (char*)0xfecac400
616#define TEXTB_BACK_LUT_A2560K (char*)0xfecac440
617#define FONT_MEMORY_BANKA_A2560K (char*)0xfec48000
618#define FONT_MEMORY_BANKB_A2560K (char*)0xfec88000
619#define VICKY_IIIB_CLUT0 0xfec82000
620#define VICKY_IIIB_CLUT1 (VICKY_IIIB_CLUT0 + 1024)
621#define VICKY_IIIB_CLUT2 (VICKY_IIIB_CLUT1 + 1024)
622#define VICKY_IIIB_CLUT3 (VICKY_IIIB_CLUT2 + 1024)
623#define VICKY_IIIB_CLUT4 (VICKY_IIIB_CLUT3 + 1024)
624#define VICKY_IIIB_CLUT5 (VICKY_IIIB_CLUT4 + 1024)
625#define VICKY_IIIB_CLUT6 (VICKY_IIIB_CLUT5 + 1024)
626#define VICKY_IIIB_CLUT7 (VICKY_IIIB_CLUT6 + 1024)
628#define default_start_a2560k_vram 0x00011000
629#define BITMAP_CTRL_REG_A2560_0 0xfec80100
630#define BITMAP_VRAM_ADDR_A2560_0 0xfec80104
631#define BITMAP_CTRL_REG_A2560_1 0xfec80108
632#define BITMAP_VRAM_ADDR_A2560_1 0xfec8010C
636#define VICKY_A2560U 0xb40000
637#define VICKY_CURSOR_CTRL_A2560U (VICKY_A2560U + 0x10)
638#define VICKY_CURSOR_POS_A2560U (VICKY_A2560U + 0x14)
639#define TEXT_RAM_A2560U (char*)0xb60000
640#define TEXT_ATTR_A2560U (char*)0xb68000
641#define TEXT_FORE_LUT_A2560U (char*)0xb6c400
642#define TEXT_BACK_LUT_A2560U (char*)0xb6c440
643#define FONT_MEMORY_BANK_A2560U (char*)0xb48000
650#if defined _C256_FMX_
651 #define VRAM_START 0x00B00000
652 #define VRAM_LEN 0x00200000
653#elif defined _A2560U_
654 #define VRAM_START 0x00C00000
655 #define VRAM_LEN 0x00200000
656#elif defined _A2560K_
657 #define VRAM_START 0x00800000
658 #define VRAM_LEN 0x00400000
661#define VRAM_OFFSET_TO_NEXT_SCREEN 0x75300
703#define SYS_TICKS_PER_SEC 60
710#define MACHINE_C256FMX 0x00
711#define MACHINE_C256U 0x01
712#define MACHINE_F256JR 0x02
713#define MACHINE_F256JRE 0x03
714#define MACHINE_GENX 0x04
715#define MACHINE_C256_UPLUS 0x05
716#define MACHINE_UNDEFINED_1 0x06
717#define MACHINE_UNDEFINED_2 0x07
718#define MACHINE_A2560X 0x08
719#define MACHINE_A2560U_PLUS 0x09
720#define MACHINE_A2560M 0x0a
721#define MACHINE_A2560K 0x0b
722#define MACHINE_A2560K40 0x0c
723#define MACHINE_A2560K60 0x0d
724#define MACHINE_UNDEFINED_3 0x0e
725#define MACHINE_UNDEFINED_4 0x0f
726#define MACHINE_F256P 0x10
727#define MACHINE_F256K2 0x11
728#define MACHINE_F256K 0x12
729#define MACHINE_F256KE 0x13
730#define MACHINE_F256K2E 0x14
732#define MACHINE_MODEL_MASK 0x1F
755#define KEYCODE_CURSOR_LEFT 79
756#define KEYCODE_CURSOR_RIGHT 78
757#define KEYCODE_CURSOR_UP 76
758#define KEYCODE_CURSOR_DOWN 77
760#define KEYCODE_RETURN 0x44
761#define KEYCODE_RETURN_UP KEY_RAW_RETURN & 0x80
765#define CHAR_UMLAUT 0xA8
766#define CHAR_ELLIPSIS CHAR_UMLAUT
768#define KEY_BUFFER_SIZE 16
770#define ALERT_MAX_MESSAGE_LEN 256
772#define ALERT_DIALOG_SHOW_AS_ERROR true
773#define ALERT_DIALOG_SHOW_AS_INFO false
775#define ALERT_DIALOG_INCLUDE_CANCEL true
776#define ALERT_DIALOG_NO_CANCEL_BTN false
778#define ALERT_DIALOG_1ST_BUTTON 0
779#define ALERT_DIALOG_2ND_BUTTON 1
780#define ALERT_DIALOG_3RD_BUTTON 2
786#define SYS_COLOR_WHITE 244
787#define SYS_COLOR_GRAY1 (SYS_COLOR_WHITE + 1)
788#define SYS_COLOR_GRAY2 (SYS_COLOR_WHITE + 2)
789#define SYS_COLOR_GRAY3 (SYS_COLOR_WHITE + 3)
790#define SYS_COLOR_GRAY4 (SYS_COLOR_WHITE + 4)
791#define SYS_COLOR_GRAY5 (SYS_COLOR_WHITE + 5)
792#define SYS_COLOR_GRAY6 (SYS_COLOR_WHITE + 6)
793#define SYS_COLOR_GRAY7 (SYS_COLOR_WHITE + 7)
794#define SYS_COLOR_GRAY8 (SYS_COLOR_WHITE + 8)
795#define SYS_COLOR_GRAY9 (SYS_COLOR_WHITE + 9)
796#define SYS_COLOR_GRAY10 (SYS_COLOR_WHITE + 10)
797#define SYS_COLOR_BLACK 255
799#define SYS_COLOR_RED1 35
800#define SYS_COLOR_RED2 (SYS_COLOR_RED1 + 36*5+1)
801#define SYS_COLOR_RED3 (SYS_COLOR_RED2 + 3)
803#define SYS_COLOR_GREEN1 23*8+1
804#define SYS_COLOR_GREEN2 (SYS_COLOR_GREEN1 + 2)
805#define SYS_COLOR_GREEN3 (SYS_COLOR_GREEN2 + 2)
807#define SYS_COLOR_BLUE1 26*8+3
808#define SYS_COLOR_BLUE2 (SYS_COLOR_BLUE1 + 2)
809#define SYS_COLOR_BLUE3 (SYS_COLOR_BLUE2 + 2)
811#define SYS_COLOR_PURPLEBLUE (15*8+7)
812#define SYS_COLOR_PURPLEBLUEINACT SYS_COLOR_GRAY3
813#define SYS_COLOR_PURPLEBLUEHL (6*7+1)
814#define SYS_COLOR_TETRA_1 (14 * 4 + 0)
815#define SYS_COLOR_TETRA_2 (11 * 4 + 1)
816#define SYS_COLOR_TETRA_3 (29 * 4 + 0)
818#define SYS_DEF_COLOR_WINFRAME SYS_COLOR_BLACK
819#define SYS_DEF_COLOR_WINTITLE_BACK SYS_COLOR_PURPLEBLUE
820#define SYS_DEF_COLOR_WINTITLE_TEXT SYS_COLOR_WHITE
821#define SYS_DEF_COLOR_ICONBAR_BACK SYS_COLOR_PURPLEBLUE
822#define SYS_DEF_COLOR_CONTENT_BACK SYS_COLOR_WHITE
823#define SYS_DEF_COLOR_BUTTON_BACK SYS_COLOR_GRAY7
824#define SYS_DEF_COLOR_BUTTON_PUSH SYS_COLOR_PURPLEBLUE
825#define SYS_DEF_COLOR_BUTTON_TEXT SYS_COLOR_WHITE
826#define SYS_DEF_COLOR_BUTTON_TEXT_DIS SYS_COLOR_GRAY3
827#define SYS_DEF_COLOR_DESKTOP SYS_COLOR_GRAY4
831typedef uint8_t ColorIdx;
836#define CH_ALT_OFFSET 96
857#define CH_COPYRIGHT 215
872#define CH_KENTER (CH_ENTER)
924#define CH_QUESTION 63
927#define CH_UC_B (CH_UC_A + 1)
928#define CH_UC_C (CH_UC_B + 1)
929#define CH_UC_D (CH_UC_C + 1)
930#define CH_UC_E (CH_UC_D + 1)
931#define CH_UC_F (CH_UC_E + 1)
932#define CH_UC_G (CH_UC_F + 1)
933#define CH_UC_H (CH_UC_G + 1)
934#define CH_UC_I (CH_UC_H + 1)
935#define CH_UC_J (CH_UC_I + 1)
936#define CH_UC_K (CH_UC_J + 1)
937#define CH_UC_L (CH_UC_K + 1)
938#define CH_UC_M (CH_UC_L + 1)
939#define CH_UC_N (CH_UC_M + 1)
940#define CH_UC_O (CH_UC_N + 1)
941#define CH_UC_P (CH_UC_O + 1)
942#define CH_UC_Q (CH_UC_P + 1)
943#define CH_UC_R (CH_UC_Q + 1)
944#define CH_UC_S (CH_UC_R + 1)
945#define CH_UC_T (CH_UC_S + 1)
946#define CH_UC_U (CH_UC_T + 1)
947#define CH_UC_V (CH_UC_U + 1)
948#define CH_UC_W (CH_UC_V + 1)
949#define CH_UC_X (CH_UC_W + 1)
950#define CH_UC_Y (CH_UC_X + 1)
951#define CH_UC_Z (CH_UC_Y + 1)
952#define CH_LBRACKET 91
954#define CH_RBRACKET 93
958#define CH_LC_A (CH_UC_A + 32)
959#define CH_LC_B (CH_LC_A + 1)
960#define CH_LC_C (CH_LC_B + 1)
961#define CH_LC_D (CH_LC_C + 1)
962#define CH_LC_E (CH_LC_D + 1)
963#define CH_LC_F (CH_LC_E + 1)
964#define CH_LC_G (CH_LC_F + 1)
965#define CH_LC_H (CH_LC_G + 1)
966#define CH_LC_I (CH_LC_H + 1)
967#define CH_LC_J (CH_LC_I + 1)
968#define CH_LC_K (CH_LC_J + 1)
969#define CH_LC_L (CH_LC_K + 1)
970#define CH_LC_M (CH_LC_L + 1)
971#define CH_LC_N (CH_LC_M + 1)
972#define CH_LC_O (CH_LC_N + 1)
973#define CH_LC_P (CH_LC_O + 1)
974#define CH_LC_Q (CH_LC_P + 1)
975#define CH_LC_R (CH_LC_Q + 1)
976#define CH_LC_S (CH_LC_R + 1)
977#define CH_LC_T (CH_LC_S + 1)
978#define CH_LC_U (CH_LC_T + 1)
979#define CH_LC_V (CH_LC_U + 1)
980#define CH_LC_W (CH_LC_V + 1)
981#define CH_LC_X (CH_LC_W + 1)
982#define CH_LC_Y (CH_LC_X + 1)
983#define CH_LC_Z (CH_LC_Y + 1)
984#define CH_LCBRACKET 123
986#define CH_RCBRACKET 125
991#define CH_VFILL_UP_1 95
992#define CH_VFILL_UP_2 1
993#define CH_VFILL_UP_3 2
994#define CH_VFILL_UP_4 3
995#define CH_VFILL_UP_5 4
996#define CH_VFILL_UP_6 5
997#define CH_VFILL_UP_7 6
998#define CH_VFILL_UP_8 7
999#define CH_VFILL_DN_8 7
1000#define CH_VFILL_DN_7 8
1001#define CH_VFILL_DN_6 9
1002#define CH_VFILL_DN_5 10
1003#define CH_VFILL_DN_4 11
1004#define CH_VFILL_DN_3 12
1005#define CH_VFILL_DN_2 13
1006#define CH_VFILL_DN_1 14
1008#define CH_VFILLC_UP_1 192
1009#define CH_VFILLC_UP_2 193
1010#define CH_VFILLC_UP_3 194
1011#define CH_VFILLC_UP_4 195
1012#define CH_VFILLC_UP_5 196
1013#define CH_VFILLC_UP_6 197
1014#define CH_VFILLC_UP_7 198
1015#define CH_VFILLC_UP_8 199
1016#define CH_VFILLC_DN_8 199
1017#define CH_VFILLC_DN_7 200
1018#define CH_VFILLC_DN_6 201
1019#define CH_VFILLC_DN_5 202
1020#define CH_VFILLC_DN_4 203
1021#define CH_VFILLC_DN_3 204
1022#define CH_VFILLC_DN_2 205
1023#define CH_VFILLC_DN_1 206
1025#define CH_HFILL_UP_1 134
1026#define CH_HFILL_UP_2 135
1027#define CH_HFILL_UP_3 136
1028#define CH_HFILL_UP_4 137
1029#define CH_HFILL_UP_5 138
1030#define CH_HFILL_UP_6 139
1031#define CH_HFILL_UP_7 140
1032#define CH_HFILL_UP_8 7
1033#define CH_HFILL_DN_8 7
1034#define CH_HFILL_DN_7 141
1035#define CH_HFILL_DN_6 142
1036#define CH_HFILL_DN_5 143
1037#define CH_HFILL_DN_4 144
1038#define CH_HFILL_DN_3 145
1039#define CH_HFILL_DN_2 146
1040#define CH_HFILL_DN_1 147
1042#define CH_HFILLC_UP_1 207
1043#define CH_HFILLC_UP_2 208
1044#define CH_HFILLC_UP_3 209
1045#define CH_HFILLC_UP_4 210
1046#define CH_HFILLC_UP_5 211
1047#define CH_HFILLC_UP_6 212
1048#define CH_HFILLC_UP_7 213
1049#define CH_HFILLC_UP_8 199
1050#define CH_HFILLC_DN_8 199
1051#define CH_HFILLC_DN_7 214
1052#define CH_HFILLC_DN_6 216
1053#define CH_HFILLC_DN_5 217
1054#define CH_HFILLC_DN_4 218
1055#define CH_HFILLC_DN_3 219
1056#define CH_HFILLC_DN_2 220
1057#define CH_HFILLC_DN_1 221
1059#define CH_HDITH_1 15
1060#define CH_HDITH_2 16
1061#define CH_HDITH_3 17
1062#define CH_HDITH_4 18
1063#define CH_HDITH_5 19
1064#define CH_HDITH_6 20
1065#define CH_HDITH_7 21
1066#define CH_HDITH_8 22
1067#define CH_HDITH_9 23
1068#define CH_HDITH_10 24
1070#define CH_DITH_L1 16
1071#define CH_DITH_L2 18
1072#define CH_DITH_L3 199
1073#define CH_DITH_L4 21
1074#define CH_DITH_L5 23
1076#define CH_VDITH_1 25
1077#define CH_VDITH_2 26
1078#define CH_VDITH_3 27
1079#define CH_VDITH_4 28
1080#define CH_VDITH_5 29
1082#define CH_DIAG_R1 186
1083#define CH_DIAG_R2 30
1085#define CH_DIAG_R3 184
1086#define CH_DIAG_R4 230
1087#define CH_DIAG_R5 234
1088#define CH_DIAG_R6 238
1090#define CH_DIAG_R7 229
1091#define CH_DIAG_R8 233
1092#define CH_DIAG_R9 237
1093#define CH_DIAG_R10 241
1095#define CH_DIAG_L1 187
1096#define CH_DIAG_L2 31
1098#define CH_DIAG_L3 228
1099#define CH_DIAG_L4 232
1100#define CH_DIAG_L5 236
1101#define CH_DIAG_L6 240
1103#define CH_DIAG_L7 185
1104#define CH_DIAG_L8 231
1105#define CH_DIAG_L9 235
1106#define CH_DIAG_L10 239
1108#define CH_DIAG_X 159
1110#define CH_HLINE_UP_1 95
1111#define CH_HLINE_UP_2 148
1112#define CH_HLINE_UP_3 149
1113#define CH_HLINE_UP_4 150
1114#define CH_HLINE_UP_5 151
1115#define CH_HLINE_UP_6 152
1116#define CH_HLINE_UP_7 153
1117#define CH_HLINE_UP_8 14
1118#define CH_HLINE_DN_8 CH_HLINE_UP_8
1119#define CH_HLINE_DN_7 CH_HLINE_UP_7
1120#define CH_HLINE_DN_6 CH_HLINE_UP_6
1121#define CH_HLINE_DN_5 CH_HLINE_UP_5
1122#define CH_HLINE_DN_4 CH_HLINE_UP_4
1123#define CH_HLINE_DN_3 CH_HLINE_UP_3
1124#define CH_HLINE_DN_2 CH_HLINE_UP_2
1125#define CH_HLINE_DN_1 CH_HLINE_UP_1
1127#define CH_VLINE_UP_1 134
1128#define CH_VLINE_UP_2 133
1129#define CH_VLINE_UP_3 132
1130#define CH_VLINE_UP_4 131
1131#define CH_VLINE_UP_5 130
1132#define CH_VLINE_UP_6 129
1133#define CH_VLINE_UP_7 128
1134#define CH_VLINE_UP_8 147
1135#define CH_VLINE_DN_8 CH_VLINE_UP_8
1136#define CH_VLINE_DN_7 CH_VLINE_UP_7
1137#define CH_VLINE_DN_6 CH_VLINE_UP_6
1138#define CH_VLINE_DN_5 CH_VLINE_UP_5
1139#define CH_VLINE_DN_4 CH_VLINE_UP_4
1140#define CH_VLINE_DN_3 CH_VLINE_UP_3
1141#define CH_VLINE_DN_2 CH_VLINE_UP_2
1142#define CH_VLINE_DN_1 CH_VLINE_UP_1
1144#define CH_LINE_WE 150
1145#define CH_LINE_NS 130
1146#define CH_LINE_NES 154
1147#define CH_LINE_WES 155
1148#define CH_LINE_WNES 156
1149#define CH_LINE_WNE 157
1150#define CH_LINE_WNS 158
1151#define CH_LINE_ES 160
1152#define CH_LINE_WS 161
1153#define CH_LINE_NE 162
1154#define CH_LINE_WN 163
1155#define CH_LINE_RND_ES 188
1156#define CH_LINE_RND_WS 189
1157#define CH_LINE_RND_NE 190
1158#define CH_LINE_RND_WN 191
1160#define CH_LINE_BLD_WE 173
1161#define CH_LINE_BLD_NS 174
1162#define CH_LINE_BLD_NES 164
1163#define CH_LINE_BLD_WES 165
1164#define CH_LINE_BLD_WNES 166
1165#define CH_LINE_BLD_WNE 167
1166#define CH_LINE_BLD_WNS 168
1167#define CH_LINE_BLD_ES 169
1168#define CH_LINE_BLD_WS 170
1169#define CH_LINE_BLD_NE 171
1170#define CH_LINE_BLD_WN 172
1171#define CH_LINE_BLD_RND_ES 175
1172#define CH_LINE_BLD_RND_WS 176
1173#define CH_LINE_BLD_RND_NE 177
1174#define CH_LINE_BLD_RND_WN 178
1176#define CH_BLOCK_N 11
1178#define CH_BLOCK_W 137
1179#define CH_BLOCK_E 144
1180#define CH_BLOCK_SE 242
1181#define CH_BLOCK_SW 243
1182#define CH_BLOCK_NE 244
1183#define CH_BLOCK_NW 245
1184#define CH_BLOCK_NWSE 246
1185#define CH_BLOCK_SWNE 247
1187#define CH_MISC_GBP 0
1188#define CH_MISC_VTILDE 127
1189#define CH_MISC_COPY 215
1190#define CH_MISC_FOENIX 223
1191#define CH_MISC_CHECKMARK 222
1192#define CH_MISC_HEART 252
1193#define CH_MISC_DIA 253
1194#define CH_MISC_SPADE 254
1195#define CH_MISC_CLUB 255
1197#define CH_ARROW_DN 248
1198#define CH_ARROW_LEFT 249
1199#define CH_ARROW_RIGHT 250
1200#define CH_ARROW_UP 251
1202#define CH_CIRCLE_1 180
1203#define CH_CIRCLE_2 225
1204#define CH_CIRCLE_3 179
1205#define CH_CIRCLE_4 226
1206#define CH_CIRCLE_5 182
1207#define CH_CIRCLE_6 183
1210#define CH_RECT_2 227
1211#define CH_RECT_3 181
1212#define CH_RECT_4 224
1213#define CH_RECT_5 182
1214#define CH_RECT_6 183
1218#define CH_JA_HOUR 24
1221#define CH_JA_YEAR 28
1222#define CH_JA_MONTH 29
1223#define CH_JA_DAY 192
1225#define CH_JIS_FIRST 193
1226#define CH_JIS_KUTEN 193
1227#define CH_JIS_OPEN 194
1228#define CH_JIS_CLOSE 195
1229#define CH_JIS_DOKUTEN 196
1230#define CH_JIS_MID 197
1231#define CH_JIS_WO 198
1232#define CH_JIS_L_A 199
1233#define CH_JIS_L_I 200
1234#define CH_JIS_L_U 201
1235#define CH_JIS_L_E 202
1236#define CH_JIS_L_O 203
1237#define CH_JIS_L_YA 204
1238#define CH_JIS_L_YU 205
1239#define CH_JIS_L_YO 206
1240#define CH_JIS_L_TU 207
1241#define CH_JIS_BOU 208
1247#define CH_JIS_KA 214
1248#define CH_JIS_KI 215
1249#define CH_JIS_KU 216
1250#define CH_JIS_KE 217
1251#define CH_JIS_KO 218
1252#define CH_JIS_SA 219
1253#define CH_JIS_SHI 220
1254#define CH_JIS_SU 221
1255#define CH_JIS_SE 222
1256#define CH_JIS_SO 223
1257#define CH_JIS_TA 224
1258#define CH_JIS_TI 225
1259#define CH_JIS_TSU 226
1260#define CH_JIS_TE 227
1261#define CH_JIS_TO 228
1262#define CH_JIS_NA 229
1263#define CH_JIS_NI 230
1264#define CH_JIS_NU 231
1265#define CH_JIS_NE 232
1266#define CH_JIS_NO 233
1267#define CH_JIS_HA 234
1268#define CH_JIS_HI 235
1269#define CH_JIS_HU 236
1270#define CH_JIS_HE 237
1271#define CH_JIS_HO 238
1272#define CH_JIS_MA 239
1273#define CH_JIS_MI 240
1274#define CH_JIS_MU 241
1275#define CH_JIS_ME 242
1276#define CH_JIS_MO 243
1277#define CH_JIS_YA 244
1278#define CH_JIS_YU 245
1279#define CH_JIS_YO 246
1280#define CH_JIS_RA 247
1281#define CH_JIS_RI 248
1282#define CH_JIS_RU 249
1283#define CH_JIS_RE 250
1284#define CH_JIS_RO 251
1285#define CH_JIS_WA 252
1289#define CH_JIS_LAST 255
1298#define SC_ULCORNER 160
1299#define SC_URCORNER 161
1300#define SC_LLCORNER 162
1301#define SC_LRCORNER 163
1302#define SC_ULCORNER_RND 188
1303#define SC_URCORNER_RND 189
1304#define SC_LLCORNER_RND 190
1305#define SC_LRCORNER_RND 191
1306#define SC_CHECKERED 199
1307#define SC_T_DOWN 155
1309#define SC_T_LEFT 158
1310#define SC_T_RIGHT 154
1311#define SC_T_JUNCTION 156
1377 volatile uint32_t* vicky_;
1381 int16_t text_cols_vis_;
1382 int16_t text_rows_vis_;
1383 int16_t text_mem_cols_;
1384 int16_t text_mem_rows_;
1386 char* text_attr_ram_;
1387 char* text_font_ram_;
1388 uint32_t* text_color_fore_ram_;
1389 uint32_t* text_color_back_ram_;
1390 int16_t text_font_height_;
1391 int16_t text_font_width_;
This structure describes an instantiated control on a window.
Definition: control.h:130
A structure that can be used to instantiate a ControlTemplate object instance in a window The Control...
Definition: control_template.h:69
This Font object is essentially the Mac "fontRecord" struct, with added pointers for the data tables.
Definition: font.h:71
Definition: a2560k.h:1369
Definition: a2560k.h:1375