src/mess/video/coco6847.c
| r0 | r6120 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | coco6847.c |
| 4 | |
| 5 | OBSOLETE Implementation of Motorola 6847 video hardware chip |
| 6 | |
| 7 | Sources: |
| 8 | M6847 data sheet |
| 9 | M6847T1 info from Rainbow magazine (10/1986-12/1986) |
| 10 | |
| 11 | |
| 12 | AG AS INTEXT INV GM2 GM1 GM0 |
| 13 | -- -- ------ --- --- --- --- |
| 14 | 0 0 0 0 X X X Internal Alphanumerics |
| 15 | 0 0 0 1 X X X Internal Alphanumerics Inverted |
| 16 | 0 0 1 0 X X X External Alphanumerics |
| 17 | 0 0 1 1 X X X External Alphanumerics Inverted |
| 18 | 0 1 0 X X X X Semigraphics 4 |
| 19 | 0 1 1 X X X X Semigraphics 6 |
| 20 | 1 X X X 0 0 0 Graphics CG1 (64x64x4) (16 bpr) |
| 21 | 1 X X X 0 0 1 Graphics RG1 (128x64x2) (16 bpr) |
| 22 | 1 X X X 0 1 0 Graphics CG2 (128x64x4) (32 bpr) |
| 23 | 1 X X X 0 1 1 Graphics RG2 (128x96x2) (16 bpr) |
| 24 | 1 X X X 1 0 0 Graphics CG3 (128x96x4) (32 bpr) |
| 25 | 1 X X X 1 0 1 Graphics RG3 (128x192x2) (16 bpr) |
| 26 | 1 X X X 1 1 0 Graphics CG6 (128x192x4) (32 bpr) |
| 27 | 1 X X X 1 1 1 Graphics RG6 (256x192x2) (32 bpr) |
| 28 | |
| 29 | Note: The M6847 relies on an external source (typically a 6883 SAM chip) |
| 30 | to feed it bytes; so the BPR (bytes per row) figures are effectively |
| 31 | suggestions. Mismatching modes is responsible for the semigraphic modes |
| 32 | on the CoCo. |
| 33 | |
| 34 | Timing: |
| 35 | (source Motorola M6847 Manual) |
| 36 | |
| 37 | Horizontal Sync: Total Period: 227.5 clock cycles |
| 38 | @ CLK(0) + DHS_F - falling edge (high to low) |
| 39 | @ CLK(16.5) + DHS_R - rising edge (low to high) |
| 40 | @ CLK(42) - left border start |
| 41 | @ CLK(71.5) - body start |
| 42 | @ CLK(199.5) - right border start |
| 43 | @ CLK(227.5) + DHS_F - falling edge (high to low) |
| 44 | ... |
| 45 | |
| 46 | Field Sync: Total Period 262*227.5 clock cycles |
| 47 | @ CLK(0) + DFS_F - falling edge (high to low) |
| 48 | @ CLK(32*227.5) + DFS_R - rising edge (low to high) |
| 49 | @ CLK(262*227.5) + DFS_F - falling edge (high to low) (262.5 for the M6847Y) |
| 50 | |
| 51 | DHS_F: 550ns |
| 52 | DHS_R: 740ns |
| 53 | DFS_F: 520ns |
| 54 | DFS_R: 500ns |
| 55 | |
| 56 | The M6847T1 is a later variant of the M6847 chip that implements lower |
| 57 | case support and some other nifty features. This chip is in the CoCo 2B. |
| 58 | I have not been able to find a pinout diagram for this chip so I am |
| 59 | assuming that the extra text modes on the CoCo 2B are activated by the |
| 60 | GM2-0 pins. This needs to be confirmed. |
| 61 | |
| 62 | TODO: Implement PAL support |
| 63 | |
| 64 | **********************************************************************/ |
| 65 | |
| 66 | #include "driver.h" |
| 67 | #include "coco6847.h" |
| 68 | |
| 69 | #include "debug/debugcpu.h" |
| 70 | #include "debug/debugcon.h" |
| 71 | |
| 72 | |
| 73 | #define LOG_FS 0 |
| 74 | #define LOG_HS 0 |
| 75 | #define LOG_STATS 0 |
| 76 | #define LOG_PREPARE 0 |
| 77 | |
| 78 | typedef struct _m6847_variant m6847_variant; |
| 79 | struct _m6847_variant |
| 80 | { |
| 81 | const UINT8 *fontdata; |
| 82 | unsigned int has_lowercase : 1; |
| 83 | unsigned int text_offset : 1; |
| 84 | |
| 85 | int frames_per_second; |
| 86 | double scanlines_per_frame; |
| 87 | double clocks_per_scanline; |
| 88 | |
| 89 | double vblank_scanlines; |
| 90 | int top_border_scanlines; |
| 91 | int display_scanlines; |
| 92 | int bottom_border_scanlines; |
| 93 | int vretrace_scanlines; |
| 94 | |
| 95 | double field_sync_scanlines; |
| 96 | }; |
| 97 | |
| 98 | typedef struct _m6847_pixel m6847_pixel; |
| 99 | struct _m6847_pixel |
| 100 | { |
| 101 | UINT8 data; |
| 102 | UINT8 attr; |
| 103 | }; |
| 104 | |
| 105 | typedef struct _m6847_vdg m6847_vdg; |
| 106 | struct _m6847_vdg |
| 107 | { |
| 108 | /* callbacks */ |
| 109 | void (*horizontal_sync_callback)(running_machine *machine, int line); |
| 110 | void (*field_sync_callback)(running_machine *machine, int line); |
| 111 | UINT8 (*get_attributes)(running_machine *machine, UINT8 c,int scanline, int pos); |
| 112 | const UINT8 *(*get_video_ram)(running_machine *machine, int scanline); |
| 113 | int (*new_frame_callback)(running_machine *machine); /* returns whether the M6847 is in charge of this frame */ |
| 114 | void (*custom_prepare_scanline)(running_machine *machine, int scanline); |
| 115 | UINT8 (*get_char_rom)(running_machine *machine, UINT8 ch,int line); |
| 116 | |
| 117 | /* timers */ |
| 118 | emu_timer *fs_rise_timer; |
| 119 | emu_timer *fs_fall_timer; |
| 120 | emu_timer *hs_rise_timer; |
| 121 | emu_timer *hs_fall_timer; |
| 122 | |
| 123 | /* things that vary according to chip version */ |
| 124 | attoseconds_t clock_period; |
| 125 | attoseconds_t scanline_period; |
| 126 | attoseconds_t field_sync_period; |
| 127 | attoseconds_t horizontal_sync_period; |
| 128 | attoseconds_t vblank_period; |
| 129 | int top_border_scanlines; |
| 130 | int display_scanlines; |
| 131 | int bottom_border_scanlines; |
| 132 | const UINT32 *palette; |
| 133 | |
| 134 | /* flags */ |
| 135 | unsigned int has_lowercase : 1; /* M6847T1 has lower case */ |
| 136 | unsigned int has_custom_palette : 1; /* needed for CoCo 3 */ |
| 137 | unsigned int text_offset : 2; /* needed for CoCo 3 */ |
| 138 | |
| 139 | /* video state; every scanline the video state for the scanline is copied |
| 140 | * here and only rendered in VIDEO_UPDATE */ |
| 141 | int dirty; |
| 142 | int using_custom; |
| 143 | UINT32 border[384]; |
| 144 | UINT8 attrs[384]; |
| 145 | m6847_pixel screendata[192][32]; |
| 146 | |
| 147 | /* saved palette; used with CoCo 3 */ |
| 148 | UINT32 saved_palette[16]; |
| 149 | |
| 150 | /* 2^7 modes, 256/16 character groups, background/foreground */ |
| 151 | UINT8 colordata[128][256/16][2]; |
| 152 | |
| 153 | /* 2^7 modes, 256 characters, 12 scanlines */ |
| 154 | UINT8 fontdata[128][256][12]; |
| 155 | }; |
| 156 | |
| 157 | |
| 158 | |
| 159 | static void apply_artifacts(running_machine *machine, UINT32 *line); |
| 160 | |
| 161 | static m6847_vdg *m6847; |
| 162 | |
| 163 | |
| 164 | static const UINT8 pal_round_fontdata8x12[] = |
| 165 | { |
| 166 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 167 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 168 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 169 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 170 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 171 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 172 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 173 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 174 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 175 | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 176 | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 177 | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 178 | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 179 | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 180 | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 181 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 182 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 183 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 184 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 185 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 186 | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 187 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 188 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 189 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 190 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 191 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 192 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 193 | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 194 | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 195 | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 196 | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 197 | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 198 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 199 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 200 | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 201 | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 202 | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 203 | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 204 | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 205 | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 206 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 207 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 208 | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 209 | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 210 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 211 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 212 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 213 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 214 | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 215 | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 216 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 217 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 218 | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 219 | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 220 | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 221 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 222 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 223 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 224 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 225 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 226 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 227 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 228 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 229 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 230 | |
| 231 | /* Lower case */ |
| 232 | 0x00, 0x00, 0x18, 0x24, 0x20, 0x70, 0x20, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 233 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 234 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 235 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 236 | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 237 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 238 | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 239 | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 240 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 241 | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 242 | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 243 | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 244 | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 245 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 246 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 247 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 248 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 249 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 250 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 251 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 252 | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 253 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 254 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 255 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 256 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 257 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 258 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 259 | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 260 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 261 | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 262 | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 263 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 264 | |
| 265 | /* Semigraphics 6 */ |
| 266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 267 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 268 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 269 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 270 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 271 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 272 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 273 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 274 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 275 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 276 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 277 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 278 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 279 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 280 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 281 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 282 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 283 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 284 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0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xF0, 0xF0, 0xF0, 0xF0, |
| 325 | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 326 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 327 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 328 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 329 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 330 | |
| 331 | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 332 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 333 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 334 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 335 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 336 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 337 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 338 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 339 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 340 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 341 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 342 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 343 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 344 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 345 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 346 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 347 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 348 | }; |
| 349 | |
| 350 | |
| 351 | |
| 352 | static const UINT8 pal_square_fontdata8x12[] = |
| 353 | { |
| 354 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 355 | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 356 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 357 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 358 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 359 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 360 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 361 | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 362 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 363 | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 364 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 365 | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 366 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 367 | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 368 | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 369 | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 370 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 371 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 372 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 373 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 374 | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 375 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 376 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 377 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 378 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 379 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 380 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 381 | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 382 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 383 | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 384 | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 385 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 386 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 387 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 388 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 389 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 390 | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 391 | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 392 | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 393 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 394 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 395 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 396 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 397 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 398 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 399 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 400 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 401 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 402 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 403 | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 404 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 405 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x0C, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 406 | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 407 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 408 | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 409 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 410 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 411 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 412 | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 413 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 414 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 415 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 416 | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 417 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 418 | |
| 419 | /* Lower case */ |
| 420 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 421 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 422 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 423 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 424 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 425 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 426 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 427 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 428 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 429 | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 430 | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 431 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 432 | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 433 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 434 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 435 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 436 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 437 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 438 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 439 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 440 | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 441 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 442 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 443 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 444 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 445 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 446 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 447 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 448 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 449 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 450 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 451 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 452 | |
| 453 | /* Semigraphics 6 */ |
| 454 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 455 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 456 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 457 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 458 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 459 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 460 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 461 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 462 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 463 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 464 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 465 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 466 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 467 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 468 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 469 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 470 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 471 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 472 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 473 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 474 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 475 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 476 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 477 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 478 | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 479 | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0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x0f, 0xff, 0xff, 0xff, 0xff, |
| 494 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 495 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 496 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 497 | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 498 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 499 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 500 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 501 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 502 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 503 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 504 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 505 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 506 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 507 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 508 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 509 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 510 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 511 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 512 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 513 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 514 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 515 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 516 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 517 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 518 | |
| 519 | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 520 | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 521 | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 522 | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 523 | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 524 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 525 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 526 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 527 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 528 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 529 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 530 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 531 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 532 | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 533 | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 534 | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 535 | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 536 | }; |
| 537 | |
| 538 | |
| 539 | |
| 540 | static const UINT8 ntsc_round_fontdata8x12[] = |
| 541 | { |
| 542 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 543 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 544 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 545 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 546 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 547 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 548 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 549 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 550 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 551 | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 552 | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 553 | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 554 | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 555 | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 556 | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 557 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 558 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 559 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 560 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 561 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 562 | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 563 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 564 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 565 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 566 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 567 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 568 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 569 | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 570 | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 571 | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 572 | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 573 | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 574 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 575 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 576 | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 577 | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 578 | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 579 | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 580 | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 581 | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 582 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 583 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 584 | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 585 | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 586 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 587 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 588 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 589 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 590 | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 591 | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 592 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 593 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 594 | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 595 | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 596 | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 597 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 598 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 599 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 600 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 601 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 602 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 603 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 604 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 605 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 606 | |
| 607 | /* Lower case */ |
| 608 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 609 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 610 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 611 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 612 | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 613 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 614 | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 615 | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 616 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 617 | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 618 | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 619 | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 620 | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 621 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 622 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 623 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 624 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 625 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 626 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 627 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 628 | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 629 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 630 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 631 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 632 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 633 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 634 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 635 | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 636 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 637 | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 638 | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 639 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 640 | |
| 641 | /* Semigraphics 6 */ |
| 642 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 643 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 644 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 645 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 646 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 647 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 648 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 649 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 650 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 651 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 652 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 653 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 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0x0F, |
| 722 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 723 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 724 | }; |
| 725 | |
| 726 | |
| 727 | |
| 728 | static const UINT8 ntsc_square_fontdata8x12[] = |
| 729 | { |
| 730 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 731 | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 732 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 733 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 734 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 735 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 736 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 737 | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 738 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 739 | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 740 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 741 | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 742 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 743 | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 744 | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 745 | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 746 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 747 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 748 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 749 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 750 | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 751 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 752 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 753 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 754 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 755 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 756 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 757 | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 758 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 759 | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 760 | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 761 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 762 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 763 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 764 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 765 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 766 | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 767 | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 768 | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 769 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 770 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 771 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 772 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 773 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 774 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 775 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 776 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 777 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 778 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 779 | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 780 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 781 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x04, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 782 | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 783 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 784 | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 785 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 786 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 787 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 788 | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 789 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 790 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 791 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 792 | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 793 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 794 | |
| 795 | /* Lower case */ |
| 796 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 797 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 798 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 799 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 800 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 801 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 802 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 803 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 804 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 805 | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 806 | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 807 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 808 | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 809 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 810 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 811 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 812 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 813 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 814 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 815 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 816 | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 817 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 818 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 819 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 820 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 821 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 822 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 823 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 824 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 825 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 826 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 827 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 828 | |
| 829 | /* Semigraphics 6 */ |
| 830 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 831 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 832 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 833 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 834 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 835 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 836 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 837 | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 838 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 839 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 840 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 841 | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 842 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 843 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 844 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 845 | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 846 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 847 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 848 | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0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 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 877 | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 878 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 879 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 880 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 881 | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 882 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 883 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 884 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 885 | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 886 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 887 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 888 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 889 | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 890 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 891 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 892 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 893 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 894 | |
| 895 | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 896 | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 897 | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 898 | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 899 | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 900 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 901 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 902 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 903 | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 904 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 905 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 906 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 907 | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 908 | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 909 | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 910 | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 911 | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 912 | }; |
| 913 | |
| 914 | |
| 915 | |
| 916 | enum |
| 917 | { |
| 918 | GREEN, YELLOW, BLUE, RED, /* 0 - 3 */ |
| 919 | BUFF, CYAN, MAGENTA, ORANGE, /* 4 - 7 */ |
| 920 | |
| 921 | BLACK, /* 8 */ |
| 922 | |
| 923 | DKGREEN = 12, LTGREEN = 13, /* 12 - 13 */ |
| 924 | DKORANGE = 14, LTORANGE = 15, /* 14 - 15 */ |
| 925 | }; |
| 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | #define ATTOTIME_STRING_PRECISION 9 |
| 931 | |
| 932 | #define M6847_RGB(r,g,b) ((r << 16) | (g << 8) | (b << 0)) |
| 933 | |
| 934 | |
| 935 | static const UINT32 palette[] = |
| 936 | { |
| 937 | M6847_RGB(0x00, 0xff, 0x00), /* GREEN */ |
| 938 | M6847_RGB(0xff, 0xff, 0x00), /* YELLOW */ |
| 939 | M6847_RGB(0x00, 0x00, 0xff), /* BLUE */ |
| 940 | M6847_RGB(0xff, 0x00, 0x00), /* RED */ |
| 941 | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 942 | M6847_RGB(0x00, 0xff, 0xff), /* CYAN */ |
| 943 | M6847_RGB(0xff, 0x00, 0xff), /* MAGENTA */ |
| 944 | M6847_RGB(0xff, 0x80, 0x00), /* ORANGE */ |
| 945 | |
| 946 | M6847_RGB(0x00, 0x00, 0x00), /* BLACK */ |
| 947 | M6847_RGB(0x00, 0xff, 0x00), /* GREEN */ |
| 948 | M6847_RGB(0x00, 0x00, 0x00), /* BLACK */ |
| 949 | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 950 | |
| 951 | M6847_RGB(0x00, 0x40, 0x00), /* ALPHANUMERIC DARK GREEN */ |
| 952 | M6847_RGB(0x00, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */ |
| 953 | M6847_RGB(0x40, 0x10, 0x00), /* ALPHANUMERIC DARK ORANGE */ |
| 954 | M6847_RGB(0xff, 0xc4, 0x18) /* ALPHANUMERIC BRIGHT ORANGE */ |
| 955 | }; |
| 956 | |
| 957 | |
| 958 | |
| 959 | #define FACTOR_SCANLINES_PER_FRAME 2 |
| 960 | #define FACTOR_CLOCKS_PER_SCANLINE 2 |
| 961 | |
| 962 | #define GROSS_FACTOR (FACTOR_SCANLINES_PER_FRAME * FACTOR_CLOCKS_PER_SCANLINE) |
| 963 | |
| 964 | static const m6847_variant variants[] = |
| 965 | { |
| 966 | { |
| 967 | /* M6847_VERSION_ORIGINAL_NTSC */ |
| 968 | ntsc_square_fontdata8x12, |
| 969 | FALSE, 0, |
| 970 | 60, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 971 | 13, 25, 192, 26, 6, |
| 972 | 13+25+192 /* field sync period */ |
| 973 | }, |
| 974 | { |
| 975 | /* M6847_VERSION_ORIGINAL_PAL */ |
| 976 | pal_square_fontdata8x12, |
| 977 | FALSE, 0, |
| 978 | 50, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 979 | 13, 25, 192, 26, 6, |
| 980 | 13+25+192 /* field sync period */ |
| 981 | }, |
| 982 | { |
| 983 | /* M6847_VERSION_M6847Y_NTSC */ |
| 984 | ntsc_square_fontdata8x12, |
| 985 | FALSE, 0, |
| 986 | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 987 | 13.5, 25, 192, 26, 6, |
| 988 | 13+25+192 /* field sync period */ |
| 989 | }, |
| 990 | { |
| 991 | /* M6847_VERSION_M6847Y_PAL */ |
| 992 | pal_square_fontdata8x12, |
| 993 | FALSE, 0, |
| 994 | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 995 | 13.5, 25, 192, 26, 6, |
| 996 | 13+25+192 /* field sync period */ |
| 997 | }, |
| 998 | { |
| 999 | /* M6847_VERSION_M6847T1_NTSC */ |
| 1000 | ntsc_round_fontdata8x12, |
| 1001 | TRUE, 0, |
| 1002 | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1003 | 13.5, 25, 192, 26, 6, |
| 1004 | 13+25+192 /* field sync period */ |
| 1005 | }, |
| 1006 | { |
| 1007 | /* M6847_VERSION_M6847T1_PAL */ |
| 1008 | pal_round_fontdata8x12, |
| 1009 | TRUE, 0, |
| 1010 | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1011 | 13.5, 25, 192, 26, 6, |
| 1012 | 13+25+192 /* field sync period */ |
| 1013 | }, |
| 1014 | { |
| 1015 | /* M6847_VERSION_GIME_NTSC */ |
| 1016 | ntsc_round_fontdata8x12, |
| 1017 | TRUE, 1, |
| 1018 | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1019 | 13.5, 25, 192, 26, 6, |
| 1020 | 262.5 - 3 /* field sync period */ |
| 1021 | }, |
| 1022 | { |
| 1023 | /* M6847_VERSION_GIME_PAL */ |
| 1024 | pal_round_fontdata8x12, |
| 1025 | TRUE, 1, |
| 1026 | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1027 | 13.5, 25, 192, 26, 6, |
| 1028 | 262.5 - 3 /* field sync period */ |
| 1029 | } |
| 1030 | }; |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | /************************************* |
| 1035 | * |
| 1036 | * Utilities |
| 1037 | * |
| 1038 | *************************************/ |
| 1039 | |
| 1040 | static UINT32 color(int c) |
| 1041 | { |
| 1042 | return m6847->palette[c]; |
| 1043 | } |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | static int attr_index_from_attribute(UINT8 attr) |
| 1048 | { |
| 1049 | int result; |
| 1050 | |
| 1051 | result = ((attr & (M6847_AG | M6847_AS | M6847_INTEXT | M6847_INV | M6847_CSS)) >> 3) |
| 1052 | | ((attr & (M6847_GM1 | M6847_GM0)) << 5); |
| 1053 | |
| 1054 | /* sanity check */ |
| 1055 | assert(result < sizeof(m6847->fontdata) / sizeof(m6847->fontdata[0])); |
| 1056 | return result; |
| 1057 | } |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | static UINT8 attribute_from_attr_index(int attr_index) |
| 1062 | { |
| 1063 | /* sanity check */ |
| 1064 | assert(attr_index >= 0); |
| 1065 | assert(attr_index < sizeof(m6847->fontdata) / sizeof(m6847->fontdata[0])); |
| 1066 | |
| 1067 | return (UINT8) ((attr_index & 0x1F) << 3) |
| 1068 | | ((attr_index & 0x60) >> 5); |
| 1069 | } |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | /************************************* |
| 1074 | * |
| 1075 | * Video modes |
| 1076 | * |
| 1077 | *************************************/ |
| 1078 | |
| 1079 | static void graphics_color_64(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1080 | { |
| 1081 | int x; |
| 1082 | UINT8 byte, attr; |
| 1083 | |
| 1084 | for (x = 0; x < 16; x++) |
| 1085 | { |
| 1086 | byte = video_data[x].data; |
| 1087 | attr = video_data[x].attr; |
| 1088 | |
| 1089 | line[ 0] = line[ 1] = line[ 2] = line[ 3] = color(((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1090 | line[ 4] = line[ 5] = line[ 6] = line[ 7] = color(((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1091 | line[ 8] = line[ 9] = line[10] = line[11] = color(((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1092 | line[12] = line[13] = line[14] = line[15] = color(((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1093 | line += 16; |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | static void graphics_color_128(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1100 | { |
| 1101 | int x; |
| 1102 | UINT8 byte, attr; |
| 1103 | |
| 1104 | for (x = 0; x < 32; x++) |
| 1105 | { |
| 1106 | byte = video_data[x].data; |
| 1107 | attr = video_data[x].attr; |
| 1108 | |
| 1109 | line[ 0] = line[ 1] = color(((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1110 | line[ 2] = line[ 3] = color(((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1111 | line[ 4] = line[ 5] = color(((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1112 | line[ 6] = line[ 7] = color(((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1113 | line += 8; |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | static void graphics_bw_128(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1120 | { |
| 1121 | int x; |
| 1122 | UINT8 byte, attr; |
| 1123 | UINT32 bg, fg; |
| 1124 | |
| 1125 | for (x = 0; x < 16; x++) |
| 1126 | { |
| 1127 | byte = video_data[x].data; |
| 1128 | attr = video_data[x].attr; |
| 1129 | |
| 1130 | bg = color(attr & M6847_CSS ? 10 : 8); |
| 1131 | fg = color(attr & M6847_CSS ? 11 : 9); |
| 1132 | |
| 1133 | line[ 0] = line[ 1] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1134 | line[ 2] = line[ 3] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1135 | line[ 4] = line[ 5] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1136 | line[ 6] = line[ 7] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1137 | line[ 8] = line[ 9] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1138 | line[10] = line[11] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1139 | line[12] = line[13] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1140 | line[14] = line[15] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1141 | line += 16; |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | static void graphics_bw_256(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1148 | { |
| 1149 | int x; |
| 1150 | UINT8 byte, attr; |
| 1151 | UINT32 bg, fg; |
| 1152 | |
| 1153 | for (x = 0; x < 32; x++) |
| 1154 | { |
| 1155 | byte = video_data[x].data; |
| 1156 | attr = video_data[x].attr; |
| 1157 | |
| 1158 | bg = color(attr & M6847_CSS ? 10 : 8); |
| 1159 | fg = color(attr & M6847_CSS ? 11 : 9); |
| 1160 | |
| 1161 | line[0] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1162 | line[1] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1163 | line[2] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1164 | line[3] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1165 | line[4] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1166 | line[5] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1167 | line[6] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1168 | line[7] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1169 | line += 8; |
| 1170 | } |
| 1171 | } |
| 1172 | |
| 1173 | |
| 1174 | |
| 1175 | static void (*const graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) = |
| 1176 | { |
| 1177 | graphics_color_64, graphics_bw_128, |
| 1178 | graphics_color_128, graphics_bw_128, |
| 1179 | graphics_color_128, graphics_bw_128, |
| 1180 | graphics_color_128, graphics_bw_256 |
| 1181 | }; |
| 1182 | |
| 1183 | |
| 1184 | |
| 1185 | static void text_mode(running_machine *machine, int scanline, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1186 | { |
| 1187 | int x; |
| 1188 | UINT8 byte, attr; |
| 1189 | int attr_index; |
| 1190 | UINT32 bg_color, fg_color; |
| 1191 | UINT8 char_data; |
| 1192 | |
| 1193 | for (x = 0; x < 32; x++) |
| 1194 | { |
| 1195 | byte = video_data[x].data; |
| 1196 | attr = video_data[x].attr; |
| 1197 | |
| 1198 | attr_index = attr_index_from_attribute(attr); |
| 1199 | |
| 1200 | bg_color = color(m6847->colordata[attr_index][byte / 16][0]); |
| 1201 | fg_color = color(m6847->colordata[attr_index][byte / 16][1]); |
| 1202 | |
| 1203 | if( (!m6847->has_lowercase) && (attr & M6847_INTEXT) && !(attr & M6847_AS)) { |
| 1204 | if (m6847->get_char_rom) { |
| 1205 | char_data = m6847->get_char_rom(machine,byte,scanline % 12); |
| 1206 | } else { |
| 1207 | char_data = 0xff; |
| 1208 | } |
| 1209 | } else { |
| 1210 | if (m6847->get_char_rom) |
| 1211 | char_data = m6847->get_char_rom(machine,byte,scanline % 12); |
| 1212 | else |
| 1213 | char_data = m6847->fontdata[attr_index][byte][scanline % 12]; |
| 1214 | } |
| 1215 | |
| 1216 | line[x*8+0] = (char_data & 0x80) ? fg_color : bg_color; |
| 1217 | line[x*8+1] = (char_data & 0x40) ? fg_color : bg_color; |
| 1218 | line[x*8+2] = (char_data & 0x20) ? fg_color : bg_color; |
| 1219 | line[x*8+3] = (char_data & 0x10) ? fg_color : bg_color; |
| 1220 | line[x*8+4] = (char_data & 0x08) ? fg_color : bg_color; |
| 1221 | line[x*8+5] = (char_data & 0x04) ? fg_color : bg_color; |
| 1222 | line[x*8+6] = (char_data & 0x02) ? fg_color : bg_color; |
| 1223 | line[x*8+7] = (char_data & 0x01) ? fg_color : bg_color; |
| 1224 | } |
| 1225 | } |
| 1226 | |
| 1227 | |
| 1228 | |
| 1229 | static void render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline) |
| 1230 | { |
| 1231 | UINT32 border_color; |
| 1232 | UINT32 *line; |
| 1233 | UINT8 attrs; |
| 1234 | int mode, x; |
| 1235 | const m6847_pixel *video_data; |
| 1236 | |
| 1237 | /* get the scanline */ |
| 1238 | line = BITMAP_ADDR32(bitmap, scanline, 0); |
| 1239 | |
| 1240 | /* choose the border color */ |
| 1241 | border_color = m6847->border[scanline]; |
| 1242 | attrs = m6847->attrs[scanline]; |
| 1243 | |
| 1244 | /* is this a border scanline? */ |
| 1245 | scanline -= m6847->top_border_scanlines; |
| 1246 | if ((scanline >= 0) && (scanline < m6847->display_scanlines)) |
| 1247 | { |
| 1248 | video_data = m6847->screendata[scanline]; |
| 1249 | |
| 1250 | /* left border */ |
| 1251 | for (x = 0; x < 32; x++) |
| 1252 | line[x] = border_color; |
| 1253 | |
| 1254 | if (attrs & M6847_AG) |
| 1255 | { |
| 1256 | /* graphics */ |
| 1257 | mode = attrs & (M6847_GM2|M6847_GM1|M6847_GM0); |
| 1258 | graphics_modes[mode](line + 32, video_data); |
| 1259 | } |
| 1260 | else |
| 1261 | { |
| 1262 | /* text/semigraphics */ |
| 1263 | text_mode(machine, scanline, line + 32, video_data); |
| 1264 | } |
| 1265 | |
| 1266 | /* right border */ |
| 1267 | for (x = 288; x < 320; x++) |
| 1268 | line[x] = border_color; |
| 1269 | |
| 1270 | /* special case for artifacting */ |
| 1271 | if ((attrs & (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1272 | == (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1273 | { |
| 1274 | apply_artifacts(machine, line + 32); |
| 1275 | } |
| 1276 | } |
| 1277 | else |
| 1278 | { |
| 1279 | /* we are drawing a border */ |
| 1280 | for (x = 0; x < bitmap->width; x++) |
| 1281 | line[x] = border_color; |
| 1282 | } |
| 1283 | } |
| 1284 | |
| 1285 | |
| 1286 | |
| 1287 | static void set_dirty(void) |
| 1288 | { |
| 1289 | m6847->dirty = TRUE; |
| 1290 | } |
| 1291 | |
| 1292 | |
| 1293 | |
| 1294 | /************************************* |
| 1295 | * |
| 1296 | * Artifacting hack; should be in core |
| 1297 | * |
| 1298 | *************************************/ |
| 1299 | |
| 1300 | static UINT32 mix_color(double factor, UINT8 c0, UINT8 c1) |
| 1301 | { |
| 1302 | return (UINT32) (UINT8) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5); |
| 1303 | } |
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | static void apply_artifacts(running_machine *machine, UINT32 *line) |
| 1308 | { |
| 1309 | /* Boy this code sucks; this code was adapted from the old M6847 |
| 1310 | * artifacting implmentation. The only reason that it didn't look as |
| 1311 | * horrible was because the code around it sucked as well. Now that I |
| 1312 | * have cleaned everything up, the ugliness is much more prominent. |
| 1313 | * |
| 1314 | * Hopefully we will have a generic artifacting algorithm that plugs into |
| 1315 | * the MESS/MAME core directly so we can chuck this hack */ |
| 1316 | static const double artifact_colors[14*3] = |
| 1317 | { |
| 1318 | 0.157, 0.000, 0.157, /* [ 1] - dk purple (reverse 2) */ |
| 1319 | 0.000, 0.157, 0.000, /* [ 2] - dk green (reverse 1) */ |
| 1320 | 1.000, 0.824, 1.000, /* [ 3] - lt purple (reverse 4) */ |
| 1321 | 0.824, 1.000, 0.824, /* [ 4] - lt green (reverse 3) */ |
| 1322 | 0.706, 0.236, 0.118, /* [ 5] - dk blue (reverse 6) */ |
| 1323 | 0.000, 0.197, 0.471, /* [ 6] - dk red (reverse 5) */ |
| 1324 | 1.000, 0.550, 0.393, /* [ 7] - lt blue (reverse 8) */ |
| 1325 | 0.275, 0.785, 1.000, /* [ 8] - lt red (reverse 7) */ |
| 1326 | 0.000, 0.500, 1.000, /* [ 9] - red (reverse 10) */ |
| 1327 | 1.000, 0.500, 0.000, /* [10] - blue (reverse 9) */ |
| 1328 | 1.000, 0.942, 0.785, /* [11] - cyan (reverse 12) */ |
| 1329 | 0.393, 0.942, 1.000, /* [12] - yellow (reverse 11) */ |
| 1330 | 0.236, 0.000, 0.000, /* [13] - black-blue (reverse 14) */ |
| 1331 | 0.000, 0.000, 0.236 /* [14] - black-red (reverse 13) */ |
| 1332 | }; |
| 1333 | |
| 1334 | static const UINT8 artifactcorrection[128] = |
| 1335 | { |
| 1336 | 0, 0, 0, 0, 0, 6, 0, 2, |
| 1337 | 5, 7, 5, 7, 1, 3, 1, 11, |
| 1338 | 8, 6, 8, 14, 8, 9, 8, 9, |
| 1339 | 4, 4, 4, 15, 12, 12, 12, 15, |
| 1340 | |
| 1341 | 5, 13, 5, 13, 13, 0, 13, 2, |
| 1342 | 10, 10, 10, 10, 10, 15, 10, 11, |
| 1343 | 3, 1, 3, 1, 15, 9, 15, 9, |
| 1344 | 11, 11, 11, 11, 15, 15, 15, 15, |
| 1345 | |
| 1346 | 14, 0, 14, 0, 14, 6, 14, 2, |
| 1347 | 0, 7, 0, 7, 1, 3, 1, 11, |
| 1348 | 9, 6, 9, 14, 9, 9, 9, 9, |
| 1349 | 15, 4, 15, 15, 12, 12, 12, 15, |
| 1350 | |
| 1351 | 2, 13, 2, 13, 2, 0, 2, 2, |
| 1352 | 10, 10, 10, 10, 10, 15, 10, 11, |
| 1353 | 12, 1, 12, 1, 12, 9, 12, 9, |
| 1354 | 15, 11, 15, 11, 15, 15, 15, 15 |
| 1355 | }; |
| 1356 | |
| 1357 | UINT32 artifacting, c0, c1; |
| 1358 | UINT32 colors[16]; |
| 1359 | static UINT32 saved_artifacting, saved_c0, saved_c1; |
| 1360 | static UINT32 expanded_colors[128]; |
| 1361 | const double *factors; |
| 1362 | UINT8 val; |
| 1363 | UINT32 new_line[256]; |
| 1364 | int i; |
| 1365 | |
| 1366 | /* are we artifacting? */ |
| 1367 | artifacting = input_port_read_safe(machine, "artifacting", 0x00) & 0x03; |
| 1368 | if (artifacting == 0x00) |
| 1369 | return; |
| 1370 | artifacting &= 0x01; |
| 1371 | |
| 1372 | /* determine the base artifact colors */ |
| 1373 | c1 = line[-1]; |
| 1374 | for (i = 0; i < 256; i++) |
| 1375 | { |
| 1376 | if (line[i] != c1) |
| 1377 | break; |
| 1378 | } |
| 1379 | if (i >= 256) |
| 1380 | return; /* if everything is the same color as the border, no need for anything */ |
| 1381 | c0 = line[i]; |
| 1382 | |
| 1383 | /* do we need to update our artifact colors table? */ |
| 1384 | if ((artifacting != saved_artifacting) || (c0 != saved_c0) || (c1 != saved_c1)) |
| 1385 | { |
| 1386 | saved_artifacting = artifacting; |
| 1387 | saved_c0 = colors[0] = c0; |
| 1388 | saved_c1 = colors[15] = c1; |
| 1389 | |
| 1390 | /* mix the other colors */ |
| 1391 | for (i = 1; i <= 14; i++) |
| 1392 | { |
| 1393 | factors = &artifact_colors[((i - 1) ^ artifacting) * 3]; |
| 1394 | |
| 1395 | colors[i] = (mix_color(factors[0], c0 >> 16, c1 >> 16) << 16) |
| 1396 | | (mix_color(factors[1], c0 >> 8, c1 >> 8) << 8) |
| 1397 | | (mix_color(factors[2], c0 >> 0, c1 >> 0) << 0); |
| 1398 | } |
| 1399 | for (i = 0; i < 128; i++) |
| 1400 | expanded_colors[i] = colors[artifactcorrection[i]]; |
| 1401 | } |
| 1402 | |
| 1403 | /* artifact the line */ |
| 1404 | for (i = 0; i < 256; i += 2) |
| 1405 | { |
| 1406 | val = ((line[i - 2] == c1) ? 0x20 : 0x00) |
| 1407 | | ((line[i - 1] == c1) ? 0x10 : 0x00) |
| 1408 | | ((line[i + 0] == c1) ? 0x08 : 0x00) |
| 1409 | | ((line[i + 1] == c1) ? 0x04 : 0x00) |
| 1410 | | ((line[i + 2] == c1) ? 0x02 : 0x00) |
| 1411 | | ((line[i + 3] == c1) ? 0x01 : 0x00); |
| 1412 | |
| 1413 | new_line[i + 0] = expanded_colors[val * 2 + 0]; |
| 1414 | new_line[i + 1] = expanded_colors[val * 2 + 1]; |
| 1415 | } |
| 1416 | |
| 1417 | /* and copy the results back */ |
| 1418 | memcpy(line, new_line, sizeof(*line) * 256); |
| 1419 | } |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | static INPUT_CHANGED( artifacting_changed ) |
| 1424 | { |
| 1425 | set_dirty(); |
| 1426 | } |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | INPUT_PORTS_START( coco6847_artifacting ) |
| 1431 | PORT_START("artifacting") |
| 1432 | PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) PORT_CHANGED(artifacting_changed, NULL) |
| 1433 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 1434 | PORT_CONFSETTING( 0x01, DEF_STR( Standard ) ) |
| 1435 | PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) ) |
| 1436 | INPUT_PORTS_END |
| 1437 | |
| 1438 | |
| 1439 | |
| 1440 | /************************************* |
| 1441 | * |
| 1442 | * Scanline operations |
| 1443 | * |
| 1444 | *************************************/ |
| 1445 | |
| 1446 | static int get_scanline(void) |
| 1447 | { |
| 1448 | int result; |
| 1449 | attotime duration; |
| 1450 | |
| 1451 | /* get the time since last field sync */ |
| 1452 | duration = attotime_sub( |
| 1453 | timer_starttime(m6847->hs_rise_timer), |
| 1454 | timer_starttime(m6847->fs_rise_timer)); |
| 1455 | assert_always(duration.seconds == 0, "get_scanline(): duration exceeds one second"); |
| 1456 | |
| 1457 | if (duration.attoseconds < m6847->vblank_period) |
| 1458 | { |
| 1459 | result = -1; /* vblank */ |
| 1460 | } |
| 1461 | else |
| 1462 | { |
| 1463 | result = (duration.attoseconds - m6847->vblank_period) |
| 1464 | / m6847->scanline_period; |
| 1465 | } |
| 1466 | return result; |
| 1467 | } |
| 1468 | |
| 1469 | |
| 1470 | static int get_beamx(void) |
| 1471 | { |
| 1472 | attotime scanline_time; |
| 1473 | int result; |
| 1474 | |
| 1475 | scanline_time = timer_timeelapsed(m6847->hs_rise_timer); |
| 1476 | if (scanline_time.seconds != 0) |
| 1477 | return 0; |
| 1478 | assert(attotime_to_attoseconds(scanline_time) < m6847->scanline_period); |
| 1479 | |
| 1480 | if (attotime_to_attoseconds(scanline_time) < (m6847->clock_period * 42)) |
| 1481 | { |
| 1482 | /* hsync */ |
| 1483 | result = 0; |
| 1484 | } |
| 1485 | else if (attotime_to_attoseconds(scanline_time) < (m6847->clock_period * 95 / 2)) |
| 1486 | { |
| 1487 | /* left border */ |
| 1488 | result = 0; |
| 1489 | } |
| 1490 | else if (attotime_to_attoseconds(scanline_time) < (m6847->clock_period * 351 / 2)) |
| 1491 | { |
| 1492 | /* body */ |
| 1493 | result = (attotime_to_attoseconds(scanline_time) - (m6847->clock_period * 95 / 2)) |
| 1494 | / m6847->clock_period * 2; |
| 1495 | } |
| 1496 | else |
| 1497 | { |
| 1498 | /* right border */ |
| 1499 | result = 256; |
| 1500 | } |
| 1501 | return result; |
| 1502 | } |
| 1503 | |
| 1504 | |
| 1505 | INLINE void prepare_scanline(running_machine *machine, int xpos) |
| 1506 | { |
| 1507 | UINT8 attrs, data, attr; |
| 1508 | int scanline; |
| 1509 | int i, border_color; |
| 1510 | int dirty; |
| 1511 | const UINT8 *RESTRICT video_ram; |
| 1512 | m6847_pixel *scanline_data; |
| 1513 | |
| 1514 | scanline = get_scanline(); |
| 1515 | |
| 1516 | if (LOG_PREPARE) |
| 1517 | logerror("m6847_prepare_scanline(): scanline=%d xpos=%d\n", scanline, xpos); |
| 1518 | |
| 1519 | if ((scanline >= 0) && (scanline < (m6847->top_border_scanlines |
| 1520 | + m6847->display_scanlines + m6847->bottom_border_scanlines))) |
| 1521 | { |
| 1522 | if (m6847->using_custom) |
| 1523 | { |
| 1524 | m6847->custom_prepare_scanline(machine, scanline); |
| 1525 | } |
| 1526 | else |
| 1527 | { |
| 1528 | /* has the border color changed? */ |
| 1529 | attrs = (*m6847->get_attributes)(machine, 0, 0, 0); |
| 1530 | if (attrs != m6847->attrs[scanline]) |
| 1531 | { |
| 1532 | m6847->dirty = TRUE; |
| 1533 | m6847->attrs[scanline] = attrs; |
| 1534 | |
| 1535 | /* choose the border color */ |
| 1536 | if (attrs & M6847_AG) |
| 1537 | border_color = (attrs & M6847_CSS) ? BUFF : GREEN; |
| 1538 | else if (m6847->has_lowercase && (attrs & M6847_GM2)) |
| 1539 | border_color = (attrs & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1540 | else |
| 1541 | border_color = BLACK; |
| 1542 | |
| 1543 | /* need to use palette table directly; border colors are constant */ |
| 1544 | m6847->border[scanline] = m6847->palette[border_color]; |
| 1545 | } |
| 1546 | |
| 1547 | /* is this a display scanline? */ |
| 1548 | scanline -= m6847->top_border_scanlines; |
| 1549 | if ((scanline >= 0) && (scanline < m6847->display_scanlines)) |
| 1550 | { |
| 1551 | video_ram = m6847->get_video_ram(machine,scanline); |
| 1552 | dirty = m6847->dirty; |
| 1553 | scanline_data = m6847->screendata[scanline]; |
| 1554 | |
| 1555 | for (i = xpos; i < 32; i++) |
| 1556 | { |
| 1557 | data = video_ram[i]; |
| 1558 | attr = (*m6847->get_attributes)(machine, data, scanline, i); |
| 1559 | |
| 1560 | if ((data != scanline_data[i].data) || (attr != scanline_data[i].attr)) |
| 1561 | { |
| 1562 | dirty = TRUE; |
| 1563 | scanline_data[i].data = data; |
| 1564 | scanline_data[i].attr = attr; |
| 1565 | } |
| 1566 | } |
| 1567 | m6847->dirty = dirty; |
| 1568 | } |
| 1569 | } |
| 1570 | } |
| 1571 | } |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | void coco6847_video_changed(void) |
| 1576 | { |
| 1577 | /* NPW 2-May-2006 - Commenting this out until we properly fix bug #878 */ |
| 1578 | /* prepare_scanline(get_beamx() / 8); */ |
| 1579 | } |
| 1580 | |
| 1581 | |
| 1582 | |
| 1583 | /************************************* |
| 1584 | * |
| 1585 | * Sync callbacks |
| 1586 | * |
| 1587 | *************************************/ |
| 1588 | |
| 1589 | int m6847_get_horizontal_sync(running_machine *machine) |
| 1590 | { |
| 1591 | attotime fire_time = timer_firetime(m6847->hs_fall_timer); |
| 1592 | return attotime_compare(fire_time, timer_get_time(machine)) > 0; |
| 1593 | } |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | static void set_horizontal_sync(running_machine *machine) |
| 1598 | { |
| 1599 | attotime fire_time = timer_firetime(m6847->hs_fall_timer); |
| 1600 | int horizontal_sync = attotime_compare(fire_time, timer_get_time(machine)) > 0; |
| 1601 | if (m6847->horizontal_sync_callback) |
| 1602 | m6847->horizontal_sync_callback(machine, !horizontal_sync); |
| 1603 | } |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | int m6847_get_field_sync(running_machine *machine) |
| 1608 | { |
| 1609 | attotime fire_time = timer_firetime(m6847->fs_fall_timer); |
| 1610 | return attotime_compare(fire_time, timer_get_time(machine)) > 0; |
| 1611 | } |
| 1612 | |
| 1613 | |
| 1614 | |
| 1615 | static void set_field_sync(running_machine *machine) |
| 1616 | { |
| 1617 | attotime fire_time = timer_firetime(m6847->fs_fall_timer); |
| 1618 | int field_sync = attotime_compare(fire_time, timer_get_time(machine)) > 0; |
| 1619 | if (m6847->field_sync_callback) |
| 1620 | m6847->field_sync_callback(machine,field_sync); |
| 1621 | } |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | /************************************* |
| 1626 | * |
| 1627 | * Field sync/Horizontal sync timers |
| 1628 | * |
| 1629 | *************************************/ |
| 1630 | |
| 1631 | static TIMER_CALLBACK(hs_fall) |
| 1632 | { |
| 1633 | if (LOG_HS) |
| 1634 | logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION)); |
| 1635 | |
| 1636 | set_horizontal_sync(machine); |
| 1637 | } |
| 1638 | |
| 1639 | static TIMER_CALLBACK(hs_rise) |
| 1640 | { |
| 1641 | if (LOG_HS) |
| 1642 | logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION)); |
| 1643 | |
| 1644 | timer_adjust_oneshot(m6847->hs_rise_timer, |
| 1645 | attotime_make(0, m6847->scanline_period), 0); |
| 1646 | timer_adjust_oneshot(m6847->hs_fall_timer, |
| 1647 | attotime_make(0, m6847->horizontal_sync_period), 0); |
| 1648 | |
| 1649 | set_horizontal_sync(machine); |
| 1650 | prepare_scanline(machine,0); |
| 1651 | } |
| 1652 | |
| 1653 | static TIMER_CALLBACK(fs_fall) |
| 1654 | { |
| 1655 | if (LOG_FS) |
| 1656 | logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1657 | |
| 1658 | set_field_sync(machine); |
| 1659 | } |
| 1660 | |
| 1661 | static TIMER_CALLBACK(fs_rise) |
| 1662 | { |
| 1663 | if (LOG_FS) |
| 1664 | logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(machine), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1665 | |
| 1666 | /* adjust field sync falling edge timer */ |
| 1667 | timer_adjust_oneshot(m6847->fs_fall_timer, |
| 1668 | attotime_make(0, m6847->field_sync_period), 0); |
| 1669 | |
| 1670 | /* adjust horizontal sync rising timer */ |
| 1671 | timer_adjust_oneshot(m6847->hs_rise_timer, attotime_zero, 0); |
| 1672 | |
| 1673 | /* this is a hook for the CoCo 3 code to extend this stuff */ |
| 1674 | if (m6847->new_frame_callback) |
| 1675 | m6847->using_custom = !m6847->new_frame_callback(machine); |
| 1676 | |
| 1677 | set_field_sync(machine); |
| 1678 | } |
| 1679 | |
| 1680 | |
| 1681 | |
| 1682 | /************************************* |
| 1683 | * |
| 1684 | * Debugging |
| 1685 | * |
| 1686 | *************************************/ |
| 1687 | |
| 1688 | |
| 1689 | static void execute_m6847_dumpscanline(running_machine *machine, int ref, int params, const char **param) |
| 1690 | { |
| 1691 | int i; |
| 1692 | int beamx = get_beamx() / 8; |
| 1693 | int scanline = get_scanline(); |
| 1694 | const m6847_pixel *pixel = m6847->screendata[scanline]; |
| 1695 | |
| 1696 | for (i = 0; i < beamx; i++) |
| 1697 | { |
| 1698 | debug_console_printf(machine, "[%02d]: 0x%02X (", i, pixel[i].data); |
| 1699 | |
| 1700 | if (pixel[i].attr & M6847_AG) debug_console_printf(machine, " AG"); |
| 1701 | if (pixel[i].attr & M6847_AS) debug_console_printf(machine, " AS"); |
| 1702 | if (pixel[i].attr & M6847_INTEXT) debug_console_printf(machine, " INTEXT"); |
| 1703 | if (pixel[i].attr & M6847_INV) debug_console_printf(machine, " INV"); |
| 1704 | if (pixel[i].attr & M6847_CSS) debug_console_printf(machine, " CSS"); |
| 1705 | if (pixel[i].attr & M6847_GM2) debug_console_printf(machine, " GM2"); |
| 1706 | if (pixel[i].attr & M6847_GM1) debug_console_printf(machine, " GM1"); |
| 1707 | if (pixel[i].attr & M6847_GM0) debug_console_printf(machine, " GM0"); |
| 1708 | |
| 1709 | debug_console_printf(machine, " )\n"); |
| 1710 | } |
| 1711 | } |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | /************************************* |
| 1717 | * |
| 1718 | * Initialization |
| 1719 | * |
| 1720 | *************************************/ |
| 1721 | |
| 1722 | static const UINT8 *find_char(const m6847_variant *v, |
| 1723 | UINT8 byte, UINT8 attr, int *fg, int *bg) |
| 1724 | { |
| 1725 | int ch; |
| 1726 | size_t offset = 0; |
| 1727 | |
| 1728 | if (attr & M6847_AS) |
| 1729 | { |
| 1730 | /* semigraphics */ |
| 1731 | *bg = BLACK; |
| 1732 | |
| 1733 | if (!v->has_lowercase && (attr & M6847_INTEXT)) |
| 1734 | { |
| 1735 | /* semigraphics 6 */ |
| 1736 | ch = (byte & 0x3F) + 0x60; |
| 1737 | *fg = ((byte >> 6) & 0x03) + ((attr & M6847_CSS) ? BUFF : GREEN); |
| 1738 | } |
| 1739 | else |
| 1740 | { |
| 1741 | /* semigraphics 4 */ |
| 1742 | ch = (byte & 0x0F) + 0xA0; |
| 1743 | *fg = ((byte >> 4) & 0x07) + GREEN; |
| 1744 | } |
| 1745 | } |
| 1746 | else |
| 1747 | { |
| 1748 | /* text */ |
| 1749 | ch = (byte & 0x3F) + 0x00; |
| 1750 | |
| 1751 | if (v->has_lowercase) |
| 1752 | { |
| 1753 | if ((ch < 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) |
| 1754 | { |
| 1755 | /* this is a lowercase character */ |
| 1756 | attr |= M6847_INV; |
| 1757 | ch += 0x40; |
| 1758 | } |
| 1759 | |
| 1760 | if ((ch > 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) { |
| 1761 | ch += 0x20; |
| 1762 | } |
| 1763 | |
| 1764 | if (attr & M6847_GM1) |
| 1765 | attr ^= M6847_INV; |
| 1766 | |
| 1767 | } |
| 1768 | |
| 1769 | if (attr & M6847_INV) |
| 1770 | { |
| 1771 | /* dark foreground, light background */ |
| 1772 | *fg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1773 | *bg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1774 | } |
| 1775 | else |
| 1776 | { |
| 1777 | /* light foreground, dark background */ |
| 1778 | *fg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1779 | *bg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1780 | } |
| 1781 | |
| 1782 | offset = v->text_offset; |
| 1783 | } |
| 1784 | |
| 1785 | return &v->fontdata[ch * 12] + offset; |
| 1786 | } |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | static void build_fontdata(const m6847_variant *v) |
| 1791 | { |
| 1792 | int attr_index, row; |
| 1793 | int fg, bg; |
| 1794 | int byte; |
| 1795 | const UINT8 *char_data; |
| 1796 | |
| 1797 | for (attr_index = 0; attr_index < sizeof(m6847->fontdata) / sizeof(m6847->fontdata[0]); attr_index++) |
| 1798 | { |
| 1799 | UINT8 attr = attribute_from_attr_index(attr_index); |
| 1800 | |
| 1801 | for (byte = 0; byte < 256; byte++) |
| 1802 | { |
| 1803 | char_data = find_char(v, byte, attr, &fg, &bg); |
| 1804 | |
| 1805 | /* specify colors */ |
| 1806 | m6847->colordata[attr_index][byte / 16][0] = bg; |
| 1807 | m6847->colordata[attr_index][byte / 16][1] = fg; |
| 1808 | |
| 1809 | for (row = 0; row < 12; row++) |
| 1810 | { |
| 1811 | m6847->fontdata[attr_index][byte][row] = char_data[row]; |
| 1812 | } |
| 1813 | } |
| 1814 | } |
| 1815 | } |
| 1816 | |
| 1817 | |
| 1818 | |
| 1819 | static STATE_POSTLOAD( m6847_postload ) |
| 1820 | { |
| 1821 | set_field_sync(machine); |
| 1822 | set_horizontal_sync(machine); |
| 1823 | set_dirty(); |
| 1824 | } |
| 1825 | |
| 1826 | |
| 1827 | |
| 1828 | void m6847_init(running_machine *machine, const m6847_config *cfg) |
| 1829 | { |
| 1830 | const m6847_variant *v; |
| 1831 | UINT32 frequency; |
| 1832 | attoseconds_t period, frame_period, cpu0_clock_period = 0; |
| 1833 | double total_scanlines; |
| 1834 | |
| 1835 | /* identify proper M6847 variant */ |
| 1836 | assert(cfg->type < sizeof(variants) / sizeof(variants[0])); |
| 1837 | v = &variants[cfg->type]; |
| 1838 | |
| 1839 | /* allocate instance */ |
| 1840 | m6847 = auto_alloc_clear(machine, m6847_vdg); |
| 1841 | set_dirty(); |
| 1842 | |
| 1843 | /* copy configuration */ |
| 1844 | m6847->get_attributes = cfg->get_attributes; |
| 1845 | m6847->get_video_ram = cfg->get_video_ram; |
| 1846 | m6847->horizontal_sync_callback = cfg->horizontal_sync_callback; |
| 1847 | m6847->field_sync_callback = cfg->field_sync_callback; |
| 1848 | m6847->new_frame_callback = cfg->new_frame_callback; |
| 1849 | m6847->custom_prepare_scanline = cfg->custom_prepare_scanline; |
| 1850 | m6847->has_lowercase = v->has_lowercase; |
| 1851 | m6847->get_char_rom = cfg->get_char_rom; |
| 1852 | |
| 1853 | /* assert our assumptions */ |
| 1854 | assert((v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME) |
| 1855 | == (UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)); |
| 1856 | assert((v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE) |
| 1857 | == (UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1858 | assert((v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR) |
| 1859 | == (UINT32) (v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR)); |
| 1860 | |
| 1861 | /* choose palette */ |
| 1862 | if (cfg->custom_palette) |
| 1863 | { |
| 1864 | m6847->has_custom_palette = 1; |
| 1865 | m6847->palette = cfg->custom_palette; |
| 1866 | } |
| 1867 | else |
| 1868 | { |
| 1869 | m6847->palette = palette; |
| 1870 | } |
| 1871 | |
| 1872 | /* allocate timers */ |
| 1873 | m6847->fs_rise_timer = timer_alloc(machine, fs_rise, NULL); |
| 1874 | m6847->fs_fall_timer = timer_alloc(machine, fs_fall, NULL); |
| 1875 | m6847->hs_rise_timer = timer_alloc(machine, hs_rise, NULL); |
| 1876 | m6847->hs_fall_timer = timer_alloc(machine, hs_fall, NULL); |
| 1877 | |
| 1878 | /* setup dimensions */ |
| 1879 | m6847->top_border_scanlines = v->top_border_scanlines; |
| 1880 | m6847->display_scanlines = v->display_scanlines; |
| 1881 | m6847->bottom_border_scanlines = v->bottom_border_scanlines; |
| 1882 | |
| 1883 | /* compute frequency and period */ |
| 1884 | frequency = v->frames_per_second |
| 1885 | * ((UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)) |
| 1886 | * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1887 | period = ATTOSECONDS_PER_SECOND / frequency; |
| 1888 | |
| 1889 | /* choose CPU clock, if specified */ |
| 1890 | if (cfg->cpu0_timing_factor > 0) |
| 1891 | { |
| 1892 | cpu0_clock_period = period * cfg->cpu0_timing_factor * GROSS_FACTOR; |
| 1893 | cpu_set_clock(machine->firstcpu, ATTOSECONDS_PER_SECOND / cpu0_clock_period); |
| 1894 | } |
| 1895 | |
| 1896 | /* calculate timing */ |
| 1897 | total_scanlines = v->vblank_scanlines |
| 1898 | + v->top_border_scanlines |
| 1899 | + v->display_scanlines |
| 1900 | + v->bottom_border_scanlines |
| 1901 | + v->vretrace_scanlines; |
| 1902 | m6847->clock_period = period * GROSS_FACTOR; |
| 1903 | m6847->scanline_period = period * (UINT32) (v->clocks_per_scanline * GROSS_FACTOR); |
| 1904 | m6847->field_sync_period = period * (UINT32) (v->clocks_per_scanline * v->field_sync_scanlines * GROSS_FACTOR); |
| 1905 | m6847->horizontal_sync_period = period * GROSS_FACTOR * 33 / 2; |
| 1906 | m6847->vblank_period = period * (UINT32) (v->clocks_per_scanline * v->vblank_scanlines * GROSS_FACTOR); |
| 1907 | |
| 1908 | /* setup timing */ |
| 1909 | frame_period = period * |
| 1910 | (UINT32) (v->clocks_per_scanline * total_scanlines * GROSS_FACTOR); |
| 1911 | timer_adjust_periodic(m6847->fs_rise_timer, attotime_zero, 0, attotime_make(0, frame_period)); |
| 1912 | |
| 1913 | /* setup save states */ |
| 1914 | state_save_register_postload(machine, m6847_postload, NULL); |
| 1915 | |
| 1916 | /* build font */ |
| 1917 | build_fontdata(v); |
| 1918 | |
| 1919 | /* dump stats */ |
| 1920 | if (LOG_STATS) |
| 1921 | { |
| 1922 | logerror("m6847_init():\n"); |
| 1923 | logerror("\tclock: %30s sec\n", attotime_string(attotime_make(0, period * GROSS_FACTOR), ATTOTIME_STRING_PRECISION)); |
| 1924 | if (cpu0_clock_period > 0) |
| 1925 | logerror("\tCPU0 clock: %30s sec\n", attotime_string(attotime_make(0, cpu0_clock_period), ATTOTIME_STRING_PRECISION)); |
| 1926 | logerror("\tscanline: %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), ATTOTIME_STRING_PRECISION)); |
| 1927 | logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), ATTOTIME_STRING_PRECISION)); |
| 1928 | logerror("\thorz sync: %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), ATTOTIME_STRING_PRECISION)); |
| 1929 | logerror("\tvblank: %30s sec\n", attotime_string(attotime_make(0, m6847->vblank_period), ATTOTIME_STRING_PRECISION)); |
| 1930 | logerror("\tframe: %30s sec\n", attotime_string(attotime_make(0, frame_period), ATTOTIME_STRING_PRECISION)); |
| 1931 | logerror("\n"); |
| 1932 | } |
| 1933 | |
| 1934 | /* setup debug commands */ |
| 1935 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 1936 | debug_console_register_command(machine, "m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_m6847_dumpscanline); |
| 1937 | } |
| 1938 | |
| 1939 | |
| 1940 | |
| 1941 | VIDEO_UPDATE(m6847) |
| 1942 | { |
| 1943 | int row, i; |
| 1944 | UINT32 rc = 0; |
| 1945 | |
| 1946 | /* if we have a custom palette, check to see if it has changed */ |
| 1947 | if (!m6847->dirty && m6847->has_custom_palette) |
| 1948 | { |
| 1949 | for (i = 0; i < 16; i++) |
| 1950 | { |
| 1951 | if (m6847->palette[i] != m6847->saved_palette[i]) |
| 1952 | { |
| 1953 | m6847->dirty = TRUE; |
| 1954 | break; |
| 1955 | } |
| 1956 | } |
| 1957 | } |
| 1958 | |
| 1959 | if (m6847->dirty) |
| 1960 | { |
| 1961 | /* this frame is dirty; render it */ |
| 1962 | m6847->dirty = FALSE; |
| 1963 | |
| 1964 | /* copy palette if we have a custom palete */ |
| 1965 | if (m6847->has_custom_palette) |
| 1966 | { |
| 1967 | for (i = 0; i < 16; i++) |
| 1968 | m6847->saved_palette[i] = m6847->palette[i]; |
| 1969 | } |
| 1970 | |
| 1971 | /* the video RAM has been dirtied; need to draw */ |
| 1972 | for (row = cliprect->min_y; row <= cliprect->max_y; row++) |
| 1973 | render_scanline(screen->machine, bitmap, row); |
| 1974 | } |
| 1975 | else |
| 1976 | { |
| 1977 | /* skip this frame */ |
| 1978 | rc = UPDATE_HAS_NOT_CHANGED; |
| 1979 | } |
| 1980 | return rc; |
| 1981 | } |
| 1982 | |
| 1983 | |
| 1984 | |
| 1985 | /************************************* |
| 1986 | * |
| 1987 | * Timing calculations |
| 1988 | * |
| 1989 | *************************************/ |
| 1990 | |
| 1991 | static UINT64 divide_mame_time(attotime dividend, attotime divisor) |
| 1992 | { |
| 1993 | /* TODO: it should not be necessary to use floating point here */ |
| 1994 | double dividend_dbl = attotime_to_double(dividend); |
| 1995 | double divisor_dbl = attotime_to_double(divisor); |
| 1996 | return (UINT64) (dividend_dbl / divisor_dbl); |
| 1997 | } |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | static attotime interval(m6847_timing_type timing) |
| 2002 | { |
| 2003 | attotime result; |
| 2004 | |
| 2005 | switch(timing) |
| 2006 | { |
| 2007 | case M6847_CLOCK: |
| 2008 | result = attotime_make(0, m6847->clock_period); |
| 2009 | break; |
| 2010 | case M6847_HSYNC: |
| 2011 | result = attotime_make(0, m6847->scanline_period); |
| 2012 | break; |
| 2013 | default: |
| 2014 | fatalerror("invalid timing type"); |
| 2015 | break; |
| 2016 | } |
| 2017 | return result; |
| 2018 | } |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | UINT64 coco6847_time(running_machine *machine, m6847_timing_type timing) |
| 2023 | { |
| 2024 | attotime current_time = timer_get_time(machine); |
| 2025 | attotime divisor = interval(timing); |
| 2026 | return divide_mame_time(current_time, divisor); |
| 2027 | } |
| 2028 | |
| 2029 | |
| 2030 | |
| 2031 | attotime coco6847_time_until(running_machine *machine, m6847_timing_type timing, UINT64 target_time) |
| 2032 | { |
| 2033 | attotime target_mame_time, current_time; |
| 2034 | target_mame_time = attotime_mul(interval(timing), target_time); |
| 2035 | current_time = timer_get_time(machine); |
| 2036 | |
| 2037 | if (attotime_compare(target_mame_time, current_time) < 0) |
| 2038 | fatalerror("coco6847_time_until(): cannot target past times"); |
| 2039 | |
| 2040 | return attotime_sub(target_mame_time, current_time); |
| 2041 | } |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | attotime coco6847_scanline_time(int scanline) |
| 2046 | { |
| 2047 | return attotime_make(0, m6847->scanline_period * |
| 2048 | (13 /* FIXME */ + scanline)); |
| 2049 | } |