src/mess/machine/coco.c
| r13256 | r13257 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | machine/coco.c |
| 3 | coco.c |
| 4 | 4 | |
| 5 | TRS-80 Radio Shack Color Computer Family |
| 6 | |
| 5 | 7 | Functions to emulate general aspects of the machine (RAM, ROM, interrupts, |
| 6 | 8 | I/O ports) |
| 7 | 9 | |
| r13256 | r13257 | |
| 47 | 49 | research that for you if you want an exact number for scanlines before the |
| 48 | 50 | screen starts and the scanline that the v-interrupt triggers..etc. |
| 49 | 51 | |
| 50 | | Dragon Alpha code added 21-Oct-2004, |
| 51 | | Phill Harvey-Smith (afra@aurigae.demon.co.uk) |
| 52 | | |
| 53 | | Added AY-8912 and FDC code 30-Oct-2004. |
| 54 | | |
| 55 | | Fixed Dragon Alpha NMI enable/disable, following circuit traces on a real machine. |
| 56 | | P.Harvey-Smith, 11-Aug-2005. |
| 57 | | |
| 58 | | Re-implemented Alpha NMI enable/disable, using direct PIA reads, rather than |
| 59 | | keeping track of it in a variable in the driver. |
| 60 | | P.Harvey-Smith, 25-Sep-2006. |
| 61 | | |
| 62 | | Radically re-wrote memory emulation code for CoCo 1/2 & Dragon machines, the |
| 63 | | new code emulates the memory mapping of the SAM, dependent on what size of |
| 64 | | RAM chips it is programed to use, including proper mirroring of the RAM. |
| 65 | | |
| 66 | | Replaced the kludged emulation of the cart line, with a timer based trigger |
| 67 | | this is set to toggle at 1Hz, this seems to be good enough to trigger the |
| 68 | | cartline, but is so slow in real terms that it should have very little |
| 69 | | impact on the emulation speed. |
| 70 | | |
| 71 | | Re-factored the code common to all machines, and seperated the code different, |
| 72 | | into callbacks/functions unique to the machines, in preperation for splitting |
| 73 | | the code for individual machine types into seperate files, I have preposed, that |
| 74 | | the CoCo 1/2 should stay in coco.c, and that the coco3 and dragon specifc code |
| 75 | | should go into coco3.c and dragon.c which should (hopefully) make the code |
| 76 | | easier to manage. |
| 77 | | P.Harvey-Smith, Dec 2006-Feb 2007 |
| 78 | | |
| 79 | 52 | Added bi-directional bitbanger support. Also fixed reading PIA 1, port A. The |
| 80 | 53 | DAC and bitbanger values written should be reflected in the read. |
| 81 | 54 | tim lindner, October 2010 |
| 82 | 55 | |
| 83 | 56 | ***************************************************************************/ |
| 84 | 57 | |
| 85 | | #include <math.h> |
| 86 | | #include <assert.h> |
| 87 | | |
| 88 | | #include "emu.h" |
| 89 | | #include "debug/debugcpu.h" |
| 90 | | #include "cpu/m6809/m6809.h" |
| 91 | | #include "machine/6821pia.h" |
| 92 | 58 | #include "includes/coco.h" |
| 93 | | #include "includes/cococart.h" |
| 94 | | #include "machine/6883sam.h" |
| 95 | | #include "machine/6551acia.h" |
| 96 | | #include "video/coco6847.h" |
| 97 | | #include "formats/cocopak.h" |
| 98 | | #include "imagedev/bitbngr.h" |
| 99 | | #include "imagedev/printer.h" |
| 100 | | #include "imagedev/cassette.h" |
| 101 | | #include "machine/wd17xx.h" |
| 102 | | #include "sound/dac.h" |
| 103 | | #include "sound/ay8910.h" |
| 104 | | #include "machine/cococart.h" |
| 105 | | #include "imagedev/cartslot.h" |
| 106 | | #include "imagedev/flopdrv.h" |
| 107 | | #include "machine/ram.h" |
| 108 | | #include "crsshair.h" |
| 59 | #include "cpu/m6809/m6809.h" |
| 60 | #include "formats/coco_cas.h" |
| 61 | #include "debug/debugcpu.h" |
| 109 | 62 | |
| 110 | | /*************************************************************************** |
| 111 | | PARAMETERS |
| 112 | | ***************************************************************************/ |
| 113 | 63 | |
| 114 | | /* this MUX delay was introduced to fix bug #655, but the delay was originally |
| 115 | | * 16us. This was reduced to 8us to fix bug #1608 */ |
| 116 | | #define JOYSTICK_MUX_DELAY attotime::from_usec(8) |
| 117 | 64 | |
| 65 | //************************************************************************** |
| 66 | // CONSTANTS |
| 67 | //************************************************************************** |
| 118 | 68 | |
| 69 | #define LOG_INTERRUPTS 0 |
| 119 | 70 | |
| 120 | | /*************************************************************************** |
| 121 | | LOCAL VARIABLES / PROTOTYPES |
| 122 | | ***************************************************************************/ |
| 123 | 71 | |
| 124 | | /*common vars/calls */ |
| 125 | 72 | |
| 126 | | static WRITE8_DEVICE_HANDLER( d_pia1_pb_w ); |
| 127 | | static WRITE8_DEVICE_HANDLER( d_pia1_pa_w ); |
| 128 | | static READ8_DEVICE_HANDLER( d_pia1_pa_r ); |
| 129 | | static WRITE8_DEVICE_HANDLER( d_pia0_pa_w ); |
| 130 | | static WRITE8_DEVICE_HANDLER( d_pia0_pb_w ); |
| 131 | | static WRITE8_DEVICE_HANDLER( d_pia1_cb2_w ); |
| 132 | | static WRITE8_DEVICE_HANDLER( d_pia0_cb2_w ); |
| 133 | | static WRITE8_DEVICE_HANDLER( d_pia1_ca2_w ); |
| 134 | | static WRITE8_DEVICE_HANDLER( d_pia0_ca2_w ); |
| 135 | | static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_a ); |
| 136 | | static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_b ); |
| 137 | | static WRITE_LINE_DEVICE_HANDLER( d_pia1_firq_a ); |
| 138 | | static WRITE_LINE_DEVICE_HANDLER( d_pia1_firq_b ); |
| 139 | | static SAM6883_SET_PAGE_ONE_MODE( d_sam_set_pageonemode ); |
| 140 | | static SAM6883_SET_MPU_RATE( d_sam_set_mpurate ); |
| 141 | | static SAM6883_SET_MEMORY_SIZE( d_sam_set_memorysize ); |
| 142 | | static SAM6883_SET_MAP_TYPE( d_sam_set_maptype ); |
| 73 | //************************************************************************** |
| 74 | // BODY |
| 75 | //************************************************************************** |
| 143 | 76 | |
| 144 | | /* CoCo 1 specific */ |
| 145 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_coco ); |
| 77 | //------------------------------------------------- |
| 78 | // ctor |
| 79 | //------------------------------------------------- |
| 146 | 80 | |
| 147 | | /* CoCo 2 specific */ |
| 148 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_coco2 ); |
| 81 | coco_state::coco_state(const machine_config &mconfig, device_type type, const char *tag) |
| 82 | : driver_device(mconfig, type, tag), |
| 83 | m_maincpu(*this, MAINCPU_TAG), |
| 84 | m_pia_0(*this, PIA0_TAG), |
| 85 | m_pia_1(*this, PIA1_TAG), |
| 86 | m_dac(*this, DAC_TAG), |
| 87 | m_wave(*this, WAVE_TAG), |
| 88 | m_cococart(*this, CARTRIDGE_TAG), |
| 89 | m_ram(*this, RAM_TAG), |
| 90 | m_cassette(*this, CASSETTE_TAG), |
| 91 | m_bitbanger(*this, BITBANGER_TAG), |
| 92 | m_vhd(*this, VHD_TAG) |
| 93 | { |
| 94 | } |
| 149 | 95 | |
| 150 | | /* CoCo 3 specific */ |
| 151 | 96 | |
| 152 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia0_irq_a ); |
| 153 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia0_irq_b ); |
| 154 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia1_firq_a ); |
| 155 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia1_firq_b ); |
| 156 | 97 | |
| 157 | | static SAM6883_SET_MAP_TYPE( coco3_sam_set_maptype ); |
| 158 | | static SAM6883_GET_RAMBASE( coco3_sam_get_rambase ); |
| 98 | //------------------------------------------------- |
| 99 | // analog_port_start |
| 100 | //------------------------------------------------- |
| 159 | 101 | |
| 160 | | /* Dragon 32 specific */ |
| 161 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_dragon32 ); |
| 102 | void coco_state::analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag) |
| 103 | { |
| 104 | analog->m_input[0][0] = machine().port(rx_tag); |
| 105 | analog->m_input[0][1] = machine().port(ry_tag); |
| 106 | analog->m_input[1][0] = machine().port(lx_tag); |
| 107 | analog->m_input[1][1] = machine().port(ly_tag); |
| 108 | analog->m_buttons = machine().port(buttons_tag); |
| 109 | } |
| 162 | 110 | |
| 163 | | /* Dragon 64 / 64 Plus / Tano (Alpha) specific */ |
| 164 | | static WRITE8_DEVICE_HANDLER ( dragon64_pia1_pb_w ); |
| 165 | 111 | |
| 166 | | /* Dragon 64 / Alpha shared */ |
| 167 | | static void dragon_page_rom(running_machine &machine, int romswitch); |
| 168 | 112 | |
| 169 | | /* Dragon Alpha specific */ |
| 170 | | static WRITE8_DEVICE_HANDLER ( dgnalpha_pia2_pa_w ); |
| 171 | | static WRITE_LINE_DEVICE_HANDLER( d_pia2_firq_a ); |
| 172 | | static WRITE_LINE_DEVICE_HANDLER( d_pia2_firq_b ); |
| 113 | //------------------------------------------------- |
| 114 | // device_start |
| 115 | //------------------------------------------------- |
| 173 | 116 | |
| 174 | | /* Memory map related CoCo 1/2 and Dragons only */ |
| 175 | | static void setup_memory_map(running_machine &machine); |
| 117 | void coco_state::device_start() |
| 118 | { |
| 119 | /* call base device_start */ |
| 120 | driver_device::device_start(); |
| 176 | 121 | |
| 122 | /* look up keyboard ports */ |
| 123 | for (int i = 0; i < sizeof(m_keyboard) / sizeof(m_keyboard[0]); i++) |
| 124 | { |
| 125 | char name[32]; |
| 126 | snprintf(name, sizeof(name) / sizeof(name[0]), "row%d", i); |
| 127 | m_keyboard[i] = machine().port(name); |
| 128 | } |
| 177 | 129 | |
| 178 | | /* These sets of defines control logging. When MAME_DEBUG is off, all logging |
| 179 | | * is off. There is a different set of defines for when MAME_DEBUG is on so I |
| 180 | | * don't have to worry abount accidently committing a version of the driver |
| 181 | | * with logging enabled after doing some debugging work |
| 182 | | * |
| 183 | | * Logging options marked as "Sparse" are logging options that happen rarely, |
| 184 | | * and should not get in the way. As such, these options are always on |
| 185 | | * (assuming MAME_DEBUG is on). "Frequent" options are options that happen |
| 186 | | * enough that they might get in the way. |
| 187 | | */ |
| 188 | | #define LOG_PAK 0 /* [Sparse] Logging on PAK trailers */ |
| 189 | | #define LOG_INT_MASKING 1 /* [Sparse] Logging on changing GIME interrupt masks */ |
| 190 | | #define LOG_INT_COCO3 0 |
| 191 | | #define LOG_GIME 0 |
| 192 | | #define LOG_MMU 0 |
| 193 | | #define LOG_TIMER 0 |
| 194 | | #define LOG_CART 1 /* Log cart type selections is_dosrom and friends */ |
| 130 | /* look up analog ports */ |
| 131 | analog_port_start(&m_joystick, JOYSTICK_RX_TAG, JOYSTICK_RY_TAG, |
| 132 | JOYSTICK_LX_TAG, JOYSTICK_LY_TAG, JOYSTICK_BUTTONS_TAG); |
| 133 | analog_port_start(&m_rat_mouse, RAT_MOUSE_RX_TAG, RAT_MOUSE_RY_TAG, |
| 134 | RAT_MOUSE_LX_TAG, RAT_MOUSE_LY_TAG, RAT_MOUSE_BUTTONS_TAG); |
| 135 | analog_port_start(&m_diecom_lightgun, DIECOM_LIGHTGUN_RX_TAG, DIECOM_LIGHTGUN_RY_TAG, |
| 136 | DIECOM_LIGHTGUN_LX_TAG, DIECOM_LIGHTGUN_LY_TAG, DIECOM_LIGHTGUN_BUTTONS_TAG); |
| 195 | 137 | |
| 196 | | #define GIME_TYPE_1987 0 |
| 138 | /* look up miscellaneous controls */ |
| 139 | m_joystick_type_control = machine().port(CTRL_SEL_TAG); |
| 140 | m_joystick_hires_control = machine().port(HIRES_INTF_TAG); |
| 197 | 141 | |
| 198 | | static offs_t coco_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); |
| 142 | /* timers */ |
| 143 | m_hiresjoy_transition_timer[0] = timer_alloc(TIMER_HIRES_JOYSTICK_X); |
| 144 | m_hiresjoy_transition_timer[1] = timer_alloc(TIMER_HIRES_JOYSTICK_Y); |
| 145 | m_diecom_lightgun_timer = timer_alloc(TIMER_DIECOM_LIGHTGUN); |
| 199 | 146 | |
| 147 | /* save state support */ |
| 148 | save_item(NAME(m_dac_output)); |
| 149 | save_item(NAME(m_hiresjoy_ca)); |
| 150 | save_item(NAME(m_dclg_previous_bit)); |
| 151 | save_item(NAME(m_dclg_output_h)); |
| 152 | save_item(NAME(m_dclg_output_v)); |
| 153 | save_item(NAME(m_dclg_state)); |
| 154 | save_item(NAME(m_dclg_timer)); |
| 200 | 155 | |
| 201 | | /* ----------------------------------------------------------------------- */ |
| 202 | | /* The bordertop and borderbottom return values are used for calculating |
| 203 | | * field sync timing. Unfortunately, I cannot seem to find an agreement |
| 204 | | * about how exactly field sync works.. |
| 205 | | * |
| 206 | | * What I do know is that FS goes high at the top of the screen, and goes |
| 207 | | * low (forcing an VBORD interrupt) at the bottom of the visual area. |
| 208 | | * |
| 209 | | * Unfortunately, I cannot get a straight answer about how many rows each |
| 210 | | * of the three regions (leading edge --> visible top; visible top --> |
| 211 | | * visible bottom/trailing edge; visible bottom/trailing edge --> leading |
| 212 | | * edge) takes up. Adding the fact that each of the different LPR |
| 213 | | * settings most likely has a different set of values. Here is a summary |
| 214 | | * of what I know from different sources: |
| 215 | | * |
| 216 | | * In the January 1987 issue of Rainbow Magazine, there is a program called |
| 217 | | * COLOR3 that uses midframe palette rotation to show all 64 colors on the |
| 218 | | * screen at once. The first box is at line 32, but it waits for 70 HSYNC |
| 219 | | * transitions before changing |
| 220 | | * |
| 221 | | * SockMaster email: 43/192/28, 41/199/23, 132/0/131, 26/225/12 |
| 222 | | * m6847 reference: 38/192/32 |
| 223 | | * COLOR3 38/192/32 |
| 224 | | * |
| 225 | | * Notes of interest: Below are some observations of key programs and what |
| 226 | | * they rely on: |
| 227 | | * |
| 228 | | * COLOR3: |
| 229 | | * (fs_pia_flip ? fall_scanline : rise_scanline) = border_top - 32 |
| 230 | | */ |
| 156 | /* set up disassembly override */ |
| 157 | if (m_maincpu->debug()) |
| 158 | { |
| 159 | m_maincpu->debug()->set_dasm_override(dasm_override); |
| 160 | } |
| 161 | } |
| 231 | 162 | |
| 232 | | const struct coco3_video_vars coco3_vidvars = |
| 233 | | { |
| 234 | | /* border tops */ |
| 235 | | 38, 36, 132, 25, |
| 236 | 163 | |
| 237 | | /* gime flip (hs/fs) */ |
| 238 | | 0, 0, |
| 239 | 164 | |
| 240 | | /* pia flip (hs/fs) */ |
| 241 | | 1, 1, |
| 165 | //------------------------------------------------- |
| 166 | // device_reset |
| 167 | //------------------------------------------------- |
| 242 | 168 | |
| 243 | | /* rise scanline & fall scanline */ |
| 244 | | 258, 6 |
| 245 | | }; |
| 169 | void coco_state::device_reset() |
| 170 | { |
| 171 | /* call base device_start */ |
| 172 | driver_device::device_reset(); |
| 246 | 173 | |
| 174 | /* reset state */ |
| 175 | m_dac_output = 0; |
| 176 | m_hiresjoy_ca = false; |
| 177 | m_dclg_previous_bit = false; |
| 178 | m_dclg_output_h = 0; |
| 179 | m_dclg_output_v = 0; |
| 180 | m_dclg_state = 0; |
| 181 | m_dclg_timer = 0; |
| 182 | } |
| 247 | 183 | |
| 248 | 184 | |
| 249 | | /* ----------------------------------------------------------------------- */ |
| 250 | 185 | |
| 251 | | /* PIA 0 */ |
| 252 | | const pia6821_interface coco_pia_intf_0 = |
| 253 | | { |
| 254 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 255 | | DEVCB_NULL, |
| 256 | | DEVCB_NULL, |
| 257 | | DEVCB_NULL, |
| 258 | | DEVCB_NULL, |
| 259 | | DEVCB_NULL, |
| 260 | | DEVCB_NULL, |
| 261 | | /*outputs: A/B,CA/B2 */ |
| 262 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 263 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 264 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 265 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 266 | | /*irqs : A/B */ |
| 267 | | DEVCB_LINE(d_pia0_irq_a), |
| 268 | | DEVCB_LINE(d_pia0_irq_b) |
| 269 | | }; |
| 186 | //------------------------------------------------- |
| 187 | // device_timer |
| 188 | //------------------------------------------------- |
| 270 | 189 | |
| 271 | | /* PIA 1 */ |
| 272 | | const pia6821_interface coco_pia_intf_1 = |
| 190 | void coco_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 273 | 191 | { |
| 274 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 275 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 276 | | DEVCB_HANDLER(d_pia1_pb_r_coco), |
| 277 | | DEVCB_NULL, |
| 278 | | DEVCB_NULL, |
| 279 | | DEVCB_NULL, |
| 280 | | DEVCB_NULL, |
| 281 | | /*outputs: A/B,CA/B2 */ |
| 282 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 283 | | DEVCB_HANDLER(d_pia1_pb_w), |
| 284 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 285 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 286 | | /*irqs : A/B */ |
| 287 | | DEVCB_LINE(d_pia1_firq_a), |
| 288 | | DEVCB_LINE(d_pia1_firq_b) |
| 289 | | }; |
| 192 | switch(id) |
| 193 | { |
| 194 | case TIMER_HIRES_JOYSTICK_X: |
| 195 | case TIMER_HIRES_JOYSTICK_Y: |
| 196 | case TIMER_DIECOM_LIGHTGUN: |
| 197 | poll_keyboard(); |
| 198 | break; |
| 199 | } |
| 200 | } |
| 290 | 201 | |
| 291 | | /* PIA 0 */ |
| 292 | | const pia6821_interface coco2_pia_intf_0 = |
| 293 | | { |
| 294 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 295 | | DEVCB_NULL, |
| 296 | | DEVCB_NULL, |
| 297 | | DEVCB_NULL, |
| 298 | | DEVCB_NULL, |
| 299 | | DEVCB_NULL, |
| 300 | | DEVCB_NULL, |
| 301 | | /*outputs: A/B,CA/B2 */ |
| 302 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 303 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 304 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 305 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 306 | | /*irqs : A/B */ |
| 307 | | DEVCB_LINE(d_pia0_irq_a), |
| 308 | | DEVCB_LINE(d_pia0_irq_b) |
| 309 | | }; |
| 310 | 202 | |
| 311 | | /* PIA 1 */ |
| 312 | | const pia6821_interface coco2_pia_intf_1 = |
| 313 | | { |
| 314 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 315 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 316 | | DEVCB_HANDLER(d_pia1_pb_r_coco2), |
| 317 | | DEVCB_NULL, |
| 318 | | DEVCB_NULL, |
| 319 | | DEVCB_NULL, |
| 320 | | DEVCB_NULL, |
| 321 | | /*outputs: A/B,CA/B2 */ |
| 322 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 323 | | DEVCB_HANDLER(d_pia1_pb_w), |
| 324 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 325 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 326 | | /*irqs : A/B */ |
| 327 | | DEVCB_LINE(d_pia1_firq_a), |
| 328 | | DEVCB_LINE(d_pia1_firq_b) |
| 329 | | }; |
| 330 | 203 | |
| 331 | | /* PIA 0 */ |
| 332 | | const pia6821_interface coco3_pia_intf_0 = |
| 333 | | { |
| 334 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 335 | | DEVCB_NULL, |
| 336 | | DEVCB_NULL, |
| 337 | | DEVCB_NULL, |
| 338 | | DEVCB_NULL, |
| 339 | | DEVCB_NULL, |
| 340 | | DEVCB_NULL, |
| 341 | | /*outputs: A/B,CA/B2 */ |
| 342 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 343 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 344 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 345 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 346 | | /*irqs : A/B */ |
| 347 | | DEVCB_LINE(coco3_pia0_irq_a), |
| 348 | | DEVCB_LINE(coco3_pia0_irq_b) |
| 349 | | }; |
| 204 | /*************************************************************************** |
| 205 | PIA0 ($FF00-$FF1F) (Chip U8) |
| 350 | 206 | |
| 351 | | /* PIA 1 */ |
| 352 | | const pia6821_interface coco3_pia_intf_1 = |
| 353 | | { |
| 354 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 355 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 356 | | DEVCB_HANDLER(d_pia1_pb_r_coco2), |
| 357 | | DEVCB_NULL, |
| 358 | | DEVCB_NULL, |
| 359 | | DEVCB_NULL, |
| 360 | | DEVCB_NULL, |
| 361 | | /*outputs: A/B,CA/B2 */ |
| 362 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 363 | | DEVCB_HANDLER(d_pia1_pb_w), |
| 364 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 365 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 366 | | /*irqs : A/B */ |
| 367 | | DEVCB_LINE(coco3_pia1_firq_a), |
| 368 | | DEVCB_LINE(coco3_pia1_firq_b) |
| 369 | | }; |
| 207 | PIA0 PA0-PA7 - Keyboard/Joystick read |
| 208 | PIA0 PB0-PB7 - Keyboard write |
| 209 | PIA0 CA1 - MC6847 HS (Horizontal Sync) |
| 210 | PIA0 CA2 - SEL1 (Used by sound mux and joystick) |
| 211 | PIA0 CB1 - MC6847 FS (Field Sync) |
| 212 | PIA0 CB2 - SEL2 (Used by sound mux and joystick) |
| 213 | ***************************************************************************/ |
| 370 | 214 | |
| 371 | | /* PIA 0 */ |
| 372 | | const pia6821_interface dragon32_pia_intf_0 = |
| 373 | | { |
| 374 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 375 | | DEVCB_NULL, |
| 376 | | DEVCB_NULL, |
| 377 | | DEVCB_NULL, |
| 378 | | DEVCB_NULL, |
| 379 | | DEVCB_NULL, |
| 380 | | DEVCB_NULL, |
| 381 | | /*outputs: A/B,CA/B2 */ |
| 382 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 383 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 384 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 385 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 386 | | /*irqs : A/B */ |
| 387 | | DEVCB_LINE(d_pia0_irq_a), |
| 388 | | DEVCB_LINE(d_pia0_irq_b) |
| 389 | | }; |
| 215 | //------------------------------------------------- |
| 216 | // ff00_write |
| 217 | //------------------------------------------------- |
| 390 | 218 | |
| 391 | | /* PIA 1 */ |
| 392 | | const pia6821_interface dragon32_pia_intf_1 = |
| 219 | READ8_MEMBER( coco_state::ff00_read ) |
| 393 | 220 | { |
| 394 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 395 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 396 | | DEVCB_HANDLER(d_pia1_pb_r_dragon32), |
| 397 | | DEVCB_NULL, |
| 398 | | DEVCB_NULL, |
| 399 | | DEVCB_NULL, |
| 400 | | DEVCB_NULL, |
| 401 | | /*outputs: A/B,CA/B2 */ |
| 402 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 403 | | DEVCB_HANDLER(d_pia1_pb_w), |
| 404 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 405 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 406 | | /*irqs : A/B */ |
| 407 | | DEVCB_LINE(d_pia1_firq_a), |
| 408 | | DEVCB_LINE(d_pia1_firq_b) |
| 409 | | }; |
| 221 | return m_pia_0->read(space, offset, mem_mask); |
| 222 | } |
| 410 | 223 | |
| 411 | | /* PIA 0 */ |
| 412 | | const pia6821_interface dragon64_pia_intf_0 = |
| 413 | | { |
| 414 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 415 | | DEVCB_NULL, |
| 416 | | DEVCB_NULL, |
| 417 | | DEVCB_NULL, |
| 418 | | DEVCB_NULL, |
| 419 | | DEVCB_NULL, |
| 420 | | DEVCB_NULL, |
| 421 | | /*outputs: A/B,CA/B2 */ |
| 422 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 423 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 424 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 425 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 426 | | /*irqs : A/B */ |
| 427 | | DEVCB_LINE(d_pia0_irq_a), |
| 428 | | DEVCB_LINE(d_pia0_irq_b) |
| 429 | | }; |
| 430 | 224 | |
| 431 | | /* PIA 1 */ |
| 432 | | const pia6821_interface dragon64_pia_intf_1 = |
| 433 | | { |
| 434 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 435 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 436 | | DEVCB_HANDLER(d_pia1_pb_r_coco), |
| 437 | | DEVCB_NULL, |
| 438 | | DEVCB_NULL, |
| 439 | | DEVCB_NULL, |
| 440 | | DEVCB_NULL, |
| 441 | | /*outputs: A/B,CA/B2 */ |
| 442 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 443 | | DEVCB_HANDLER(dragon64_pia1_pb_w), |
| 444 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 445 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 446 | | /*irqs : A/B */ |
| 447 | | DEVCB_LINE(d_pia1_firq_a), |
| 448 | | DEVCB_LINE(d_pia1_firq_b) |
| 449 | | }; |
| 450 | 225 | |
| 451 | | /* PIA 0 and 1 as Dragon 64 */ |
| 452 | | /* PIA 0 */ |
| 453 | | const pia6821_interface dgnalpha_pia_intf_0 = |
| 454 | | { |
| 455 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 456 | | DEVCB_NULL, |
| 457 | | DEVCB_NULL, |
| 458 | | DEVCB_NULL, |
| 459 | | DEVCB_NULL, |
| 460 | | DEVCB_NULL, |
| 461 | | DEVCB_NULL, |
| 462 | | /*outputs: A/B,CA/B2 */ |
| 463 | | DEVCB_HANDLER(d_pia0_pa_w), |
| 464 | | DEVCB_HANDLER(d_pia0_pb_w), |
| 465 | | DEVCB_HANDLER(d_pia0_ca2_w), |
| 466 | | DEVCB_HANDLER(d_pia0_cb2_w), |
| 467 | | /*irqs : A/B */ |
| 468 | | DEVCB_LINE(d_pia0_irq_a), |
| 469 | | DEVCB_LINE(d_pia0_irq_b) |
| 470 | | }; |
| 226 | //------------------------------------------------- |
| 227 | // ff00_write |
| 228 | //------------------------------------------------- |
| 471 | 229 | |
| 472 | | /* PIA 1 */ |
| 473 | | const pia6821_interface dgnalpha_pia_intf_1 = |
| 230 | WRITE8_MEMBER( coco_state::ff00_write ) |
| 474 | 231 | { |
| 475 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 476 | | DEVCB_HANDLER(d_pia1_pa_r), |
| 477 | | DEVCB_HANDLER(d_pia1_pb_r_coco), |
| 478 | | DEVCB_NULL, |
| 479 | | DEVCB_NULL, |
| 480 | | DEVCB_NULL, |
| 481 | | DEVCB_NULL, |
| 482 | | /*outputs: A/B,CA/B2 */ |
| 483 | | DEVCB_HANDLER(d_pia1_pa_w), |
| 484 | | DEVCB_HANDLER(d_pia1_pb_w), |
| 485 | | DEVCB_HANDLER(d_pia1_ca2_w), |
| 486 | | DEVCB_HANDLER(d_pia1_cb2_w), |
| 487 | | /*irqs : A/B */ |
| 488 | | DEVCB_LINE(d_pia1_firq_a), |
| 489 | | DEVCB_LINE(d_pia1_firq_b) |
| 490 | | }; |
| 232 | m_pia_0->write(space, offset, data, mem_mask); |
| 233 | } |
| 491 | 234 | |
| 492 | | /* PIA 2 */ |
| 493 | | const pia6821_interface dgnalpha_pia_intf_2 = |
| 494 | | { |
| 495 | | /*inputs : A/B,CA/B1,CA/B2 */ |
| 496 | | DEVCB_NULL, |
| 497 | | DEVCB_NULL, |
| 498 | | DEVCB_NULL, |
| 499 | | DEVCB_NULL, |
| 500 | | DEVCB_NULL, |
| 501 | | DEVCB_NULL, |
| 502 | | /*outputs: A/B,CA/B2 */ |
| 503 | | DEVCB_HANDLER(dgnalpha_pia2_pa_w), |
| 504 | | DEVCB_NULL, |
| 505 | | DEVCB_NULL, |
| 506 | | DEVCB_NULL, |
| 507 | | /*irqs : A/B */ |
| 508 | | DEVCB_LINE(d_pia2_firq_a), |
| 509 | | DEVCB_LINE(d_pia2_firq_b) |
| 510 | | }; |
| 511 | 235 | |
| 512 | | const sam6883_interface coco_sam_intf = |
| 513 | | { |
| 514 | | NULL, |
| 515 | | d_sam_set_pageonemode, |
| 516 | | d_sam_set_mpurate, |
| 517 | | d_sam_set_memorysize, |
| 518 | | d_sam_set_maptype |
| 519 | | }; |
| 520 | 236 | |
| 521 | | const sam6883_interface coco3_sam_intf = |
| 237 | //------------------------------------------------- |
| 238 | // pia0_pb_w |
| 239 | //------------------------------------------------- |
| 240 | |
| 241 | WRITE8_MEMBER( coco_state::pia0_pb_w ) |
| 522 | 242 | { |
| 523 | | coco3_sam_get_rambase, |
| 524 | | NULL, |
| 525 | | d_sam_set_mpurate, |
| 526 | | NULL, |
| 527 | | coco3_sam_set_maptype |
| 528 | | }; |
| 243 | poll_keyboard(); |
| 244 | } |
| 529 | 245 | |
| 530 | 246 | |
| 531 | 247 | |
| 532 | | /*************************************************************************** |
| 533 | | IMPLEMENTATION |
| 534 | | ***************************************************************************/ |
| 248 | //------------------------------------------------- |
| 249 | // pia0_ca2_w |
| 250 | //------------------------------------------------- |
| 535 | 251 | |
| 536 | | /*************************************************************************** |
| 537 | | PAK files |
| 538 | | |
| 539 | | PAK files were originally for storing Program PAKs, but the file format has |
| 540 | | evolved into a snapshot file format, with a file format so convoluted and |
| 541 | | changing to make it worthy of Microsoft. |
| 542 | | ***************************************************************************/ |
| 543 | | |
| 544 | | static int load_pak_into_region(device_image_interface &image, int *pakbase, int *paklen, UINT8 *mem, int segaddr, int seglen) |
| 252 | WRITE_LINE_MEMBER( coco_state::pia0_ca2_w ) |
| 545 | 253 | { |
| 546 | | if (*paklen) |
| 547 | | { |
| 548 | | if (*pakbase < segaddr) |
| 549 | | { |
| 550 | | /* We have to skip part of the PAK file */ |
| 551 | | int skiplen; |
| 254 | update_sound(); |
| 255 | poll_keyboard(); |
| 256 | } |
| 552 | 257 | |
| 553 | | skiplen = segaddr - *pakbase; |
| 554 | | if (image.fseek(skiplen, SEEK_CUR)) |
| 555 | | { |
| 556 | | if (LOG_PAK) |
| 557 | | logerror("Could not fully read PAK.\n"); |
| 558 | | return 1; |
| 559 | | } |
| 560 | 258 | |
| 561 | | *pakbase += skiplen; |
| 562 | | *paklen -= skiplen; |
| 563 | | } |
| 564 | 259 | |
| 565 | | if (*pakbase < segaddr + seglen) |
| 566 | | { |
| 567 | | mem += *pakbase - segaddr; |
| 568 | | seglen -= *pakbase - segaddr; |
| 260 | //------------------------------------------------- |
| 261 | // pia0_cb2_w |
| 262 | //------------------------------------------------- |
| 569 | 263 | |
| 570 | | if (seglen > *paklen) |
| 571 | | seglen = *paklen; |
| 572 | | |
| 573 | | if (image.fread( mem, seglen) < seglen) |
| 574 | | { |
| 575 | | if (LOG_PAK) |
| 576 | | logerror("Could not fully read PAK.\n"); |
| 577 | | return 1; |
| 578 | | } |
| 579 | | |
| 580 | | *pakbase += seglen; |
| 581 | | *paklen -= seglen; |
| 582 | | } |
| 583 | | } |
| 584 | | return 0; |
| 264 | WRITE_LINE_MEMBER( coco_state::pia0_cb2_w ) |
| 265 | { |
| 266 | update_sound(); |
| 267 | poll_keyboard(); |
| 585 | 268 | } |
| 586 | 269 | |
| 587 | | static void pak_load_trailer(running_machine &machine, const pak_decodedtrailer *trailer) |
| 588 | | { |
| 589 | | coco_state *state = machine.driver_data<coco_state>(); |
| 590 | 270 | |
| 591 | | cpu_set_reg(machine.device("maincpu"), M6809_PC, trailer->reg_pc); |
| 592 | | cpu_set_reg(machine.device("maincpu"), M6809_X, trailer->reg_x); |
| 593 | | cpu_set_reg(machine.device("maincpu"), M6809_Y, trailer->reg_y); |
| 594 | | cpu_set_reg(machine.device("maincpu"), M6809_U, trailer->reg_u); |
| 595 | | cpu_set_reg(machine.device("maincpu"), M6809_S, trailer->reg_s); |
| 596 | | cpu_set_reg(machine.device("maincpu"), M6809_DP, trailer->reg_dp); |
| 597 | | cpu_set_reg(machine.device("maincpu"), M6809_B, trailer->reg_b); |
| 598 | | cpu_set_reg(machine.device("maincpu"), M6809_A, trailer->reg_a); |
| 599 | | cpu_set_reg(machine.device("maincpu"), M6809_CC, trailer->reg_cc); |
| 600 | 271 | |
| 601 | | /* I seem to only be able to get a small amount of the PIA state from the |
| 602 | | * snapshot trailers. Thus I am going to configure the PIA myself. The |
| 603 | | * following PIA writes are the same thing that the CoCo ROM does on |
| 604 | | * startup. I wish I had a better solution |
| 605 | | */ |
| 272 | //------------------------------------------------- |
| 273 | // pia0_irq_a |
| 274 | //------------------------------------------------- |
| 606 | 275 | |
| 607 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 1, 0x00); |
| 608 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 3, 0x00); |
| 609 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 0, 0x00); |
| 610 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 2, 0xff); |
| 611 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 1, 0x00); |
| 612 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 3, 0x00); |
| 613 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 0, 0xfe); |
| 614 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 2, 0xf8); |
| 276 | WRITE_LINE_MEMBER( coco_state::pia0_irq_a ) |
| 277 | { |
| 278 | recalculate_irq(); |
| 279 | } |
| 615 | 280 | |
| 616 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 1, trailer->pia[1]); |
| 617 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 0, trailer->pia[0]); |
| 618 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 3, trailer->pia[3]); |
| 619 | | state->m_pia_0->write(*memory_nonspecific_space(machine), 2, trailer->pia[2]); |
| 620 | 281 | |
| 621 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 1, trailer->pia[5]); |
| 622 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 0, trailer->pia[4]); |
| 623 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 3, trailer->pia[7]); |
| 624 | | state->m_pia_1->write(*memory_nonspecific_space(machine), 2, trailer->pia[6]); |
| 625 | 282 | |
| 626 | | /* For some reason, specifying use of high ram seems to screw things up; |
| 627 | | * I'm not sure whether it is because I'm using the wrong method to get |
| 628 | | * access that bit or or whether it is something else. So that is why |
| 629 | | * I am specifying 0x7fff instead of 0xffff here |
| 630 | | */ |
| 631 | | sam6883_set_state(state->m_sam, trailer->sam, 0x7fff); |
| 632 | | } |
| 283 | //------------------------------------------------- |
| 284 | // pia0_irq_b |
| 285 | //------------------------------------------------- |
| 633 | 286 | |
| 634 | | static int generic_pak_load(device_image_interface &image, int rambase_index, int rombase_index, int pakbase_index) |
| 287 | WRITE_LINE_MEMBER( coco_state::pia0_irq_b ) |
| 635 | 288 | { |
| 636 | | UINT8 *ROM; |
| 637 | | UINT8 *rambase; |
| 638 | | UINT8 *rombase; |
| 639 | | UINT8 *pakbase; |
| 640 | | int paklength; |
| 641 | | int pakstart; |
| 642 | | pak_header header; |
| 643 | | int trailerlen; |
| 644 | | UINT8 trailerraw[500]; |
| 645 | | pak_decodedtrailer trailer; |
| 646 | | int trailer_load = 0; |
| 289 | recalculate_irq(); |
| 290 | } |
| 647 | 291 | |
| 648 | | ROM = image.device().machine().region("maincpu")->base(); |
| 649 | | rambase = &ram_get_ptr(image.device().machine().device(RAM_TAG))[rambase_index]; |
| 650 | | rombase = &ROM[rombase_index]; |
| 651 | | pakbase = &ROM[pakbase_index]; |
| 652 | 292 | |
| 653 | | if (ram_get_size(image.device().machine().device(RAM_TAG)) < 0x10000) |
| 654 | | { |
| 655 | | if (LOG_PAK) |
| 656 | | logerror("Cannot load PAK files without at least 64k.\n"); |
| 657 | | return IMAGE_INIT_FAIL; |
| 658 | | } |
| 659 | 293 | |
| 660 | | if (image.fread( &header, sizeof(header)) < sizeof(header)) |
| 661 | | { |
| 662 | | if (LOG_PAK) |
| 663 | | logerror("Could not fully read PAK.\n"); |
| 664 | | return IMAGE_INIT_FAIL; |
| 665 | | } |
| 294 | //------------------------------------------------- |
| 295 | // pia0_config |
| 296 | //------------------------------------------------- |
| 666 | 297 | |
| 667 | | paklength = header.length ? LITTLE_ENDIANIZE_INT16(header.length) : 0x10000; |
| 668 | | pakstart = LITTLE_ENDIANIZE_INT16(header.start); |
| 298 | const pia6821_interface coco_state::pia0_config = |
| 299 | { |
| 300 | DEVCB_NULL, /* port A input */ |
| 301 | DEVCB_NULL, /* port B input */ |
| 302 | DEVCB_NULL, /* CA1 input */ |
| 303 | DEVCB_NULL, /* CB1 input */ |
| 304 | DEVCB_NULL, /* CA2 input */ |
| 305 | DEVCB_NULL, /* CB2 input */ |
| 306 | DEVCB_NULL, /* port A output */ |
| 307 | DEVCB_DRIVER_MEMBER(coco_state, pia0_pb_w), /* port B output */ |
| 308 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_ca2_w), /* CA2 output */ |
| 309 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_cb2_w), /* CB2 output */ |
| 310 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_irq_a), /* IRQA output */ |
| 311 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia0_irq_b) /* IRQB output */ |
| 312 | }; |
| 669 | 313 | |
| 670 | | if (image.fseek(paklength, SEEK_CUR)) |
| 671 | | { |
| 672 | | if (LOG_PAK) |
| 673 | | logerror("Could not fully read PAK.\n"); |
| 674 | | return IMAGE_INIT_FAIL; |
| 675 | | } |
| 676 | 314 | |
| 677 | | trailerlen = image.fread( trailerraw, sizeof(trailerraw)); |
| 678 | | if (trailerlen) |
| 679 | | { |
| 680 | | if (pak_decode_trailer(trailerraw, trailerlen, &trailer)) |
| 681 | | { |
| 682 | | if (LOG_PAK) |
| 683 | | logerror("Invalid or unknown PAK trailer.\n"); |
| 684 | | return IMAGE_INIT_FAIL; |
| 685 | | } |
| 686 | 315 | |
| 687 | | trailer_load = 1; |
| 688 | | } |
| 316 | /*************************************************************************** |
| 317 | PIA1 ($FF20-$FF3F) (Chip U4) |
| 689 | 318 | |
| 690 | | if (image.fseek(sizeof(pak_header), SEEK_SET)) |
| 691 | | { |
| 692 | | if (LOG_PAK) |
| 693 | | logerror("Unexpected error while reading PAK.\n"); |
| 694 | | return IMAGE_INIT_FAIL; |
| 695 | | } |
| 319 | PIA1 PA0 - CASSDIN |
| 320 | PIA1 PA1 - RS232 OUT (CoCo), Printer Strobe (Dragon) |
| 321 | PIA1 PA2-PA7 - DAC |
| 322 | PIA1 PB0 - RS232 IN |
| 323 | PIA1 PB1 - Single bit sound |
| 324 | PIA1 PB2 - RAMSZ (32/64K, 16K, and 4K three position switch) |
| 325 | PIA1 PB3 - M6847 CSS |
| 326 | PIA1 PB4 - M6847 INT/EXT and M6847 GM0 |
| 327 | PIA1 PB5 - M6847 GM1 |
| 328 | PIA1 PB6 - M6847 GM2 |
| 329 | PIA1 PB7 - M6847 A/G |
| 330 | PIA1 CA1 - CD (Carrier Detect; NYI) |
| 331 | PIA1 CA2 - CASSMOT (Cassette Motor) |
| 332 | PIA1 CB1 - CART (Cartridge Detect) |
| 333 | PIA1 CB2 - SNDEN (Sound Enable) |
| 334 | ***************************************************************************/ |
| 696 | 335 | |
| 697 | | /* Now that we are done reading the trailer; we can cap the length */ |
| 698 | | if (paklength > 0xff00) |
| 699 | | paklength = 0xff00; |
| 336 | //------------------------------------------------- |
| 337 | // ff20_read |
| 338 | //------------------------------------------------- |
| 700 | 339 | |
| 701 | | /* PAK files reflect the fact that JeffV's emulator did not appear to |
| 702 | | * differentiate between RAM and ROM memory. So what we do when a PAK |
| 703 | | * loads is to copy the ROM into RAM, load the PAK into RAM, and then |
| 704 | | * copy the part of RAM corresponding to PAK ROM to the actual PAK ROM |
| 705 | | * area. |
| 706 | | * |
| 707 | | * It is ugly, but it reflects the way that JeffV's emulator works |
| 708 | | */ |
| 340 | READ8_MEMBER( coco_state::ff20_read ) |
| 341 | { |
| 342 | return m_pia_1->read(space, offset, mem_mask); |
| 343 | } |
| 709 | 344 | |
| 710 | | memcpy(rambase + 0x8000, rombase, 0x4000); |
| 711 | | memcpy(rambase + 0xC000, pakbase, 0x3F00); |
| 712 | 345 | |
| 713 | | /* Get the RAM portion */ |
| 714 | | if (load_pak_into_region(image, &pakstart, &paklength, rambase, 0x0000, 0xff00)) |
| 715 | | return IMAGE_INIT_FAIL; |
| 716 | 346 | |
| 717 | | memcpy(pakbase, rambase + 0xC000, 0x3F00); |
| 347 | //------------------------------------------------- |
| 348 | // ff20_write |
| 349 | //------------------------------------------------- |
| 718 | 350 | |
| 719 | | if (trailer_load) |
| 720 | | pak_load_trailer(image.device().machine(), &trailer); |
| 721 | | return IMAGE_INIT_PASS; |
| 722 | | } |
| 723 | | |
| 724 | | SNAPSHOT_LOAD ( coco_pak ) |
| 351 | WRITE8_MEMBER( coco_state::ff20_write ) |
| 725 | 352 | { |
| 726 | | return generic_pak_load(image, 0x0000, 0x0000, 0x4000); |
| 727 | | } |
| 353 | /* write to the PIA */ |
| 354 | m_pia_1->write(space, offset, data, mem_mask); |
| 728 | 355 | |
| 729 | | SNAPSHOT_LOAD ( coco3_pak ) |
| 730 | | { |
| 731 | | return generic_pak_load(image, (0x70000 % ram_get_size(image.device().machine().device(RAM_TAG))), 0x0000, 0xc000); |
| 356 | /* we have to do this to do something that approximates the cartridge Q line behavior */ |
| 357 | m_cococart->twiddle_q_lines(); |
| 732 | 358 | } |
| 733 | 359 | |
| 734 | | /*************************************************************************** |
| 735 | | Quickloads |
| 736 | | ***************************************************************************/ |
| 737 | 360 | |
| 738 | | QUICKLOAD_LOAD ( coco ) |
| 739 | | { |
| 740 | | UINT8 preamble; |
| 741 | | UINT16 block_length; |
| 742 | | UINT16 block_address; |
| 743 | | const UINT8 *ptr; |
| 744 | | UINT32 length; |
| 745 | | UINT32 position = 0; |
| 746 | | UINT32 i; |
| 747 | | int done = FALSE; |
| 748 | 361 | |
| 749 | | /* access the pointer and the length */ |
| 750 | | ptr = (const UINT8*)image.ptr(); |
| 751 | | length = image.length(); |
| 362 | //------------------------------------------------- |
| 363 | // pia1_pa_r |
| 364 | //------------------------------------------------- |
| 752 | 365 | |
| 753 | | while(!done && (position + 5 <= length)) |
| 754 | | { |
| 755 | | /* read this block */ |
| 756 | | preamble = ptr[position + 0]; |
| 757 | | block_length = ((UINT16) ptr[position + 1]) << 8 | ((UINT16) ptr[position + 2]) << 0; |
| 758 | | block_address = ((UINT16) ptr[position + 3]) << 8 | ((UINT16) ptr[position + 4]) << 0; |
| 759 | | position += 5; |
| 760 | | |
| 761 | | if (preamble != 0) |
| 762 | | { |
| 763 | | /* start address - just set the address and return */ |
| 764 | | cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, block_address); |
| 765 | | done = TRUE; |
| 766 | | } |
| 767 | | else |
| 768 | | { |
| 769 | | address_space *space = image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM ); |
| 770 | | |
| 771 | | /* data block - need to cap the maximum length of the block */ |
| 772 | | block_length = MIN(block_length, length - position); |
| 773 | | |
| 774 | | /* read the block into memory */ |
| 775 | | for (i = 0; i < block_length; i++) |
| 776 | | { |
| 777 | | space->write_byte(block_address + i, ptr[position + i]); |
| 778 | | } |
| 779 | | |
| 780 | | /* and advance */ |
| 781 | | position += block_length; |
| 782 | | } |
| 783 | | } |
| 784 | | return IMAGE_INIT_PASS; |
| 366 | READ8_MEMBER( coco_state::pia1_pa_r ) |
| 367 | { |
| 368 | return (m_cassette->input() >= 0 ? 0x01 : 0x00) |
| 369 | | (dac_output() << 2); |
| 785 | 370 | } |
| 786 | 371 | |
| 787 | | /*************************************************************************** |
| 788 | | ROM files |
| 789 | 372 | |
| 790 | | ROM files are simply raw dumps of cartridges. I believe that they should |
| 791 | | be used in place of PAK files, when possible |
| 792 | | ***************************************************************************/ |
| 793 | 373 | |
| 794 | | // These are directly handled by ROM_CART_LOAD with no custom DEVICE_IMAGE_LOAD |
| 374 | //------------------------------------------------- |
| 375 | // pia1_pb_r - this handles the reading of the |
| 376 | // memory sense switch (PB2) for the CoCo 1 and |
| 377 | // serial-in (PB0) |
| 378 | //------------------------------------------------- |
| 795 | 379 | |
| 796 | | /*************************************************************************** |
| 797 | | Interrupts |
| 380 | READ8_MEMBER( coco_state::pia1_pb_r ) |
| 381 | { |
| 382 | UINT32 ram_size = m_ram->size(); |
| 798 | 383 | |
| 799 | | The Dragon/CoCo2 have two PIAs. These PIAs can trigger interrupts. PIA0 |
| 800 | | is set up to trigger IRQ on the CPU, and PIA1 can trigger FIRQ. Each PIA |
| 801 | | has two output lines, and an interrupt will be triggered if either of these |
| 802 | | lines are asserted. |
| 384 | // For the CoCo 1, the logic has been changed to only select 64K rams |
| 385 | // if there is more than 16K of memory, as the Color Basic 1.0 rom |
| 386 | // can only configure 4K or 16K ram banks (as documented in "Color |
| 387 | // Basic Unreveled"), doing this allows this allows the coco driver |
| 388 | // to access 32K of ram, and also allows the cocoe driver to access |
| 389 | // the full 64K, as this uses Color Basic 1.2, which can configure 64K rams |
| 390 | bool memory_sense = (ram_size >= 0x4000 && ram_size <= 0x7FFF) |
| 391 | || (ram_size >= 0x8000 && (m_pia_0->b_output() & 0x80)); |
| 803 | 392 | |
| 804 | | ----- IRQ |
| 805 | | 6809 |-<----------- PIA0 |
| 806 | | | |
| 807 | | | |
| 808 | | | |
| 809 | | | |
| 810 | | | |
| 811 | | |-<----------- PIA1 |
| 812 | | ----- |
| 393 | // serial in (PB0) |
| 394 | bool serial_in = (m_bitbanger != NULL) && (m_bitbanger->input() ? true : false); |
| 813 | 395 | |
| 814 | | The CoCo 3 still supports these interrupts, but the GIME can chose whether |
| 815 | | "old school" interrupts are generated, or the new ones generated by the GIME |
| 396 | // composite the results |
| 397 | return (memory_sense ? 0x04 : 0x00) |
| 398 | | (serial_in ? 0x01 : 0x00); |
| 399 | } |
| 816 | 400 | |
| 817 | | ----- IRQ |
| 818 | | 6809 |-<----------- PIA0 |
| 819 | | | | ------ |
| 820 | | | -<-------<-------| | |
| 821 | | | |GIME| |
| 822 | | | -<-------<-------| | |
| 823 | | | FIRQ | ------ |
| 824 | | |-<----------- PIA1 |
| 825 | | ----- |
| 826 | 401 | |
| 827 | | In an email discussion with JK, he informs me that when GIME interrupts are |
| 828 | | enabled, this actually does not prevent PIA interrupts. Apparently JeffV's |
| 829 | | CoCo 3 emulator did not handle this properly. |
| 830 | | ***************************************************************************/ |
| 831 | 402 | |
| 832 | | enum |
| 833 | | { |
| 834 | | COCO3_INT_TMR = 0x20, /* Timer */ |
| 835 | | COCO3_INT_HBORD = 0x10, /* Horizontal border sync */ |
| 836 | | COCO3_INT_VBORD = 0x08, /* Vertical border sync */ |
| 837 | | COCO3_INT_EI2 = 0x04, /* Serial data */ |
| 838 | | COCO3_INT_EI1 = 0x02, /* Keyboard */ |
| 839 | | COCO3_INT_EI0 = 0x01, /* Cartridge */ |
| 403 | //------------------------------------------------- |
| 404 | // pia1_pa_w |
| 405 | //------------------------------------------------- |
| 840 | 406 | |
| 841 | | COCO3_INT_ALL = 0x3f |
| 842 | | }; |
| 843 | | |
| 844 | | static void d_recalc_irq(running_machine &machine) |
| 407 | WRITE8_MEMBER( coco_state::pia1_pa_w ) |
| 845 | 408 | { |
| 846 | | coco_state *state = machine.driver_data<coco_state>(); |
| 847 | | UINT8 pia0_irq_a = state->m_pia_0->irq_a_state(); |
| 848 | | UINT8 pia0_irq_b = state->m_pia_0->irq_b_state(); |
| 849 | | |
| 850 | | if (pia0_irq_a || pia0_irq_b) |
| 851 | | cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); |
| 852 | | else |
| 853 | | cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE); |
| 409 | pia1_pa_changed(); |
| 854 | 410 | } |
| 855 | 411 | |
| 856 | | static void d_recalc_firq(running_machine &machine) |
| 857 | | { |
| 858 | | coco_state *state = machine.driver_data<coco_state>(); |
| 859 | | UINT8 pia1_firq_a = state->m_pia_1->irq_a_state(); |
| 860 | | UINT8 pia1_firq_b = state->m_pia_1->irq_b_state(); |
| 861 | | UINT8 pia2_firq_a = (state->m_pia_2 != NULL) ? state->m_pia_2->irq_a_state() : 0x00; |
| 862 | | UINT8 pia2_firq_b = (state->m_pia_2 != NULL) ? state->m_pia_2->irq_b_state() : 0x00; |
| 863 | 412 | |
| 864 | | if (pia1_firq_a || pia1_firq_b || pia2_firq_a || pia2_firq_b) |
| 865 | | cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); |
| 866 | | else |
| 867 | | cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); |
| 868 | | } |
| 869 | 413 | |
| 870 | | static void coco3_recalc_irq(running_machine &machine) |
| 871 | | { |
| 872 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 873 | | if ((state->m_gimereg[0] & 0x20) && state->m_gime_irq) |
| 874 | | cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); |
| 875 | | else |
| 876 | | d_recalc_irq(machine); |
| 877 | | } |
| 414 | //------------------------------------------------- |
| 415 | // pia1_pb_w |
| 416 | //------------------------------------------------- |
| 878 | 417 | |
| 879 | | static void coco3_recalc_firq(running_machine &machine) |
| 418 | WRITE8_MEMBER( coco_state::pia1_pb_w ) |
| 880 | 419 | { |
| 881 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 882 | | if ((state->m_gimereg[0] & 0x10) && state->m_gime_firq) |
| 883 | | cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); |
| 884 | | else |
| 885 | | d_recalc_firq(machine); |
| 420 | pia1_pb_changed(); |
| 886 | 421 | } |
| 887 | 422 | |
| 888 | | static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_a ) |
| 889 | | { |
| 890 | | d_recalc_irq(device->machine()); |
| 891 | | } |
| 892 | 423 | |
| 893 | | static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_b ) |
| 894 | | { |
| 895 | | d_recalc_irq(device->machine()); |
| 896 | | } |
| 897 | 424 | |
| 898 | | static WRITE_LINE_DEVICE_HANDLER( d_pia1_firq_a ) |
| 899 | | { |
| 900 | | d_recalc_firq(device->machine()); |
| 901 | | } |
| 425 | //------------------------------------------------- |
| 426 | // pia1_ca2_w |
| 427 | //------------------------------------------------- |
| 902 | 428 | |
| 903 | | static WRITE_LINE_DEVICE_HANDLER( d_pia1_firq_b ) |
| 429 | WRITE_LINE_MEMBER( coco_state::pia1_ca2_w ) |
| 904 | 430 | { |
| 905 | | d_recalc_firq(device->machine()); |
| 431 | m_cassette->change_state( |
| 432 | state ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, |
| 433 | CASSETTE_MASK_MOTOR); |
| 906 | 434 | } |
| 907 | 435 | |
| 908 | | /* Dragon Alpha second PIA IRQ lines also cause FIRQ */ |
| 909 | | static WRITE_LINE_DEVICE_HANDLER( d_pia2_firq_a ) |
| 910 | | { |
| 911 | | d_recalc_firq(device->machine()); |
| 912 | | } |
| 913 | 436 | |
| 914 | | static WRITE_LINE_DEVICE_HANDLER( d_pia2_firq_b ) |
| 915 | | { |
| 916 | | d_recalc_firq(device->machine()); |
| 917 | | } |
| 918 | 437 | |
| 919 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia0_irq_a ) |
| 920 | | { |
| 921 | | coco3_recalc_irq(device->machine()); |
| 922 | | } |
| 438 | //------------------------------------------------- |
| 439 | // pia1_cb2_w |
| 440 | //------------------------------------------------- |
| 923 | 441 | |
| 924 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia0_irq_b ) |
| 442 | WRITE_LINE_MEMBER( coco_state::pia1_cb2_w ) |
| 925 | 443 | { |
| 926 | | coco3_recalc_irq(device->machine()); |
| 927 | | } |
| 444 | poll_keyboard(); |
| 928 | 445 | |
| 929 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia1_firq_a ) |
| 930 | | { |
| 931 | | coco3_recalc_firq(device->machine()); |
| 446 | // Theoretically, I should be calling update_sound() here; however this seems to create |
| 447 | // a buzzing in some CoCo software (e.g. - Popcorn). This is likely because this line |
| 448 | // drives the MC14529B MUX, and when disabled the output probably goes hi-Z. |
| 932 | 449 | } |
| 933 | 450 | |
| 934 | | static WRITE_LINE_DEVICE_HANDLER( coco3_pia1_firq_b ) |
| 935 | | { |
| 936 | | coco3_recalc_firq(device->machine()); |
| 937 | | } |
| 938 | 451 | |
| 939 | | static void coco3_raise_interrupt(running_machine &machine, UINT8 mask, int state) |
| 940 | | { |
| 941 | | coco3_state *drvstate = machine.driver_data<coco3_state>(); |
| 942 | | int lowtohigh; |
| 943 | 452 | |
| 944 | | lowtohigh = state && ((drvstate->m_interupt_line & mask) == 0); |
| 453 | //------------------------------------------------- |
| 454 | // pia1_firq_a |
| 455 | //------------------------------------------------- |
| 945 | 456 | |
| 946 | | if (state) |
| 947 | | drvstate->m_interupt_line |= mask; |
| 948 | | else |
| 949 | | drvstate->m_interupt_line &= ~mask; |
| 950 | | |
| 951 | | if (lowtohigh) |
| 952 | | { |
| 953 | | if ((drvstate->m_gimereg[0] & 0x20) && (drvstate->m_gimereg[2] & mask)) |
| 954 | | { |
| 955 | | drvstate->m_gime_irq |= (drvstate->m_gimereg[2] & mask); |
| 956 | | coco3_recalc_irq(machine); |
| 957 | | |
| 958 | | if (LOG_INT_COCO3) |
| 959 | | logerror("CoCo3 Interrupt: Raising IRQ; scanline=%i\n", machine.primary_screen->vpos()); |
| 960 | | } |
| 961 | | if ((drvstate->m_gimereg[0] & 0x10) && (drvstate->m_gimereg[3] & mask)) |
| 962 | | { |
| 963 | | drvstate->m_gime_firq |= (drvstate->m_gimereg[3] & mask); |
| 964 | | coco3_recalc_firq(machine); |
| 965 | | |
| 966 | | if (LOG_INT_COCO3) |
| 967 | | logerror("CoCo3 Interrupt: Raising FIRQ; scanline=%i\n", machine.primary_screen->vpos()); |
| 968 | | } |
| 969 | | } |
| 457 | WRITE_LINE_MEMBER( coco_state::pia1_firq_a ) |
| 458 | { |
| 459 | recalculate_firq(); |
| 970 | 460 | } |
| 971 | 461 | |
| 972 | 462 | |
| 973 | 463 | |
| 974 | | void coco3_horizontal_sync_callback(running_machine &machine,int data) |
| 464 | //------------------------------------------------- |
| 465 | // pia1_firq_b |
| 466 | //------------------------------------------------- |
| 467 | |
| 468 | WRITE_LINE_MEMBER( coco_state::pia1_firq_b ) |
| 975 | 469 | { |
| 976 | | coco_state *state = machine.driver_data<coco_state>(); |
| 977 | | state->m_pia_0->ca1_w(data); |
| 978 | | coco3_raise_interrupt(machine, COCO3_INT_HBORD, data); |
| 470 | recalculate_firq(); |
| 979 | 471 | } |
| 980 | 472 | |
| 981 | 473 | |
| 982 | 474 | |
| 983 | | void coco3_field_sync_callback(running_machine &machine,int data) |
| 984 | | { |
| 985 | | coco_state *state = machine.driver_data<coco_state>(); |
| 986 | | state->m_pia_0->cb1_w(data); |
| 987 | | } |
| 475 | //------------------------------------------------- |
| 476 | // pia1_config |
| 477 | //------------------------------------------------- |
| 988 | 478 | |
| 989 | | void coco3_gime_field_sync_callback(running_machine &machine) |
| 479 | const pia6821_interface coco_state::pia1_config = |
| 990 | 480 | { |
| 991 | | /* the CoCo 3 VBORD interrupt triggers right after the display */ |
| 992 | | coco3_raise_interrupt(machine, COCO3_INT_VBORD, 1); |
| 993 | | coco3_raise_interrupt(machine, COCO3_INT_VBORD, 0); |
| 994 | | } |
| 481 | DEVCB_DRIVER_MEMBER(coco_state, pia1_pa_r), /* port A input */ |
| 482 | DEVCB_DRIVER_MEMBER(coco_state, pia1_pb_r), /* port B input */ |
| 483 | DEVCB_NULL, /* CA1 input */ |
| 484 | DEVCB_NULL, /* CB1 input */ |
| 485 | DEVCB_NULL, /* CA2 input */ |
| 486 | DEVCB_NULL, /* CB2 input */ |
| 487 | DEVCB_DRIVER_MEMBER(coco_state, pia1_pa_w), /* port A output */ |
| 488 | DEVCB_DRIVER_MEMBER(coco_state, pia1_pb_w), /* port B output */ |
| 489 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia1_ca2_w), /* CA2 output */ |
| 490 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia1_cb2_w), /* CB2 output */ |
| 491 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia1_firq_a), /* IRQA output */ |
| 492 | DEVCB_DRIVER_LINE_MEMBER(coco_state, pia1_firq_b) /* IRQB output */ |
| 493 | }; |
| 995 | 494 | |
| 996 | 495 | |
| 997 | 496 | |
| 998 | 497 | /*************************************************************************** |
| 999 | | Halt line |
| 1000 | | ***************************************************************************/ |
| 498 | CPU INTERRUPTS |
| 1001 | 499 | |
| 1002 | | static TIMER_CALLBACK(d_recalc_interrupts) |
| 1003 | | { |
| 1004 | | d_recalc_firq(machine); |
| 1005 | | d_recalc_irq(machine); |
| 1006 | | } |
| 500 | The Dragon/CoCo2 have two PIAs. These PIAs can trigger interrupts. PIA0 |
| 501 | is set up to trigger IRQ on the CPU, and PIA1 can trigger FIRQ. Each PIA |
| 502 | has two output lines, and an interrupt will be triggered if either of these |
| 503 | lines are asserted. |
| 1007 | 504 | |
| 1008 | | static TIMER_CALLBACK(coco3_recalc_interrupts) |
| 1009 | | { |
| 1010 | | coco3_recalc_firq(machine); |
| 1011 | | coco3_recalc_irq(machine); |
| 1012 | | } |
| 505 | ----- IRQ |
| 506 | 6809 |-<----------- PIA0 |
| 507 | | |
| 508 | | |
| 509 | | |
| 510 | | |
| 511 | | |
| 512 | |-<----------- PIA1 |
| 513 | ----- |
| 1013 | 514 | |
| 515 | ***************************************************************************/ |
| 1014 | 516 | |
| 1015 | | #ifdef UNUSED_FUNCTION |
| 1016 | | void coco_set_halt_line(running_machine &machine, int halt_line) |
| 517 | //------------------------------------------------- |
| 518 | // irq_get_line - gets the value of the FIRQ line |
| 519 | // passed into the CPU |
| 520 | //------------------------------------------------- |
| 521 | |
| 522 | bool coco_state::irq_get_line(void) |
| 1017 | 523 | { |
| 1018 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1019 | | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, halt_line); |
| 1020 | | if (halt_line == CLEAR_LINE) |
| 1021 | | machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(state->m_recalc_interrupts)); |
| 524 | return m_pia_0->irq_a_state() || m_pia_0->irq_b_state(); |
| 1022 | 525 | } |
| 1023 | | #endif |
| 1024 | 526 | |
| 1025 | 527 | |
| 1026 | | /*************************************************************************** |
| 1027 | | Hires Joystick |
| 1028 | | ***************************************************************************/ |
| 1029 | 528 | |
| 529 | //------------------------------------------------- |
| 530 | // recalculate_irq |
| 531 | //------------------------------------------------- |
| 1030 | 532 | |
| 1031 | | static attotime coco_hiresjoy_computetransitiontime( running_machine &machine, UINT8 port, UINT8 axis ) |
| 533 | void coco_state::recalculate_irq(void) |
| 1032 | 534 | { |
| 1033 | | double val; |
| 1034 | | UINT8 hires = input_port_read_safe(machine, "hires_intf", 0x00); |
| 1035 | | /* this function gets only called for hi-res joystick. hence, hires can only take values |
| 1036 | | 0x01, 0x03 (hi-res) or 0x02, 0x04 (hi-res coco3max) */ |
| 1037 | | UINT8 coco3max = (hires == 0x02 || hires == 0x04) ? 1 : 0; |
| 535 | bool line = irq_get_line(); |
| 536 | if (LOG_INTERRUPTS) |
| 537 | logerror("recalculate_irq(): line=%d\n", line ? 1 : 0); |
| 538 | m_maincpu->set_input_line(M6809_IRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); |
| 539 | } |
| 1038 | 540 | |
| 1039 | | static const char *const port_tags[4] = {"joystick_rx", "joystick_ry", "joystick_lx", "joystick_ly"}; |
| 1040 | 541 | |
| 1041 | | val = input_port_read_safe(machine, port_tags[axis + 2 * port], 0) / 255.0; |
| 1042 | 542 | |
| 1043 | | if (coco3max) |
| 1044 | | { |
| 1045 | | /* CoCo MAX 3 Interface */ |
| 1046 | | val = val * 2500.0 + 400.0; |
| 1047 | | } |
| 1048 | | else |
| 1049 | | { |
| 1050 | | /* Normal Hires Interface */ |
| 1051 | | val = val * 4160.0 + 592.0; |
| 1052 | | } |
| 543 | //------------------------------------------------- |
| 544 | // firq_get_line - gets the value of the FIRQ line |
| 545 | // passed into the CPU |
| 546 | //------------------------------------------------- |
| 1053 | 547 | |
| 1054 | | return (machine.time() + (COCO_CPU_SPEED * val)); |
| 1055 | | } |
| 1056 | | |
| 1057 | | static void coco_hiresjoy_w( running_machine &machine, int data, UINT8 port ) |
| 548 | bool coco_state::firq_get_line(void) |
| 1058 | 549 | { |
| 1059 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1060 | | if (!data && state->m_hiresjoy_ca) |
| 1061 | | { |
| 1062 | | /* Hi to lo */ |
| 1063 | | state->m_hiresjoy_xtransitiontime = coco_hiresjoy_computetransitiontime(machine, port, 0); |
| 1064 | | state->m_hiresjoy_ytransitiontime = coco_hiresjoy_computetransitiontime(machine, port, 1); |
| 1065 | | } |
| 1066 | | else if (data && !state->m_hiresjoy_ca) |
| 1067 | | { |
| 1068 | | /* Lo to hi */ |
| 1069 | | state->m_hiresjoy_xtransitiontime = attotime::zero; |
| 1070 | | state->m_hiresjoy_ytransitiontime = attotime::zero; |
| 1071 | | } |
| 1072 | | state->m_hiresjoy_ca = data; |
| 1073 | | (*state->update_keyboard)(machine); |
| 550 | return m_pia_1->irq_a_state() || m_pia_1->irq_b_state(); |
| 1074 | 551 | } |
| 1075 | 552 | |
| 1076 | | static int coco_hiresjoy_readone( running_machine &machine, attotime transitiontime ) |
| 1077 | | { |
| 1078 | | return machine.time() >= transitiontime; |
| 1079 | | } |
| 1080 | 553 | |
| 1081 | | static int coco_hiresjoy_rx( running_machine &machine ) |
| 1082 | | { |
| 1083 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1084 | | return coco_hiresjoy_readone(machine, state->m_hiresjoy_xtransitiontime); |
| 1085 | | } |
| 1086 | 554 | |
| 1087 | | static int coco_hiresjoy_ry( running_machine &machine ) |
| 555 | //------------------------------------------------- |
| 556 | // recalculate_firq |
| 557 | //------------------------------------------------- |
| 558 | |
| 559 | void coco_state::recalculate_firq(void) |
| 1088 | 560 | { |
| 1089 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1090 | | return coco_hiresjoy_readone(machine, state->m_hiresjoy_ytransitiontime); |
| 561 | bool line = firq_get_line(); |
| 562 | if (LOG_INTERRUPTS) |
| 563 | logerror("recalculate_firq(): line=%d\n", line ? 1 : 0); |
| 564 | m_maincpu->set_input_line(M6809_FIRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); |
| 1091 | 565 | } |
| 1092 | 566 | |
| 567 | |
| 568 | |
| 1093 | 569 | /*************************************************************************** |
| 1094 | | Sound MUX |
| 570 | SOUND / KEYBOARD / JOYSTICK |
| 1095 | 571 | |
| 1096 | 572 | The sound MUX has 4 possible settings, depend on SELA and SELB inputs: |
| 1097 | 573 | |
| r13256 | r13257 | |
| 1100 | 576 | 10 - SND input from cartridge (NYI because we only support the FDC) |
| 1101 | 577 | 11 - Grounded (0) |
| 1102 | 578 | |
| 579 | Source - Tandy Color Computer Service Manual |
| 580 | |
| 1103 | 581 | Note on the Dragon Alpha state 11, selects the AY-3-8912, this is currently |
| 1104 | 582 | un-implemented - phs. |
| 1105 | 583 | |
| 1106 | | Source - Tandy Color Computer Service Manual |
| 1107 | 584 | ***************************************************************************/ |
| 1108 | 585 | |
| 1109 | | #define SOUNDMUX_STATUS_ENABLE 4 |
| 1110 | | #define SOUNDMUX_STATUS_SEL2 2 |
| 1111 | | #define SOUNDMUX_STATUS_SEL1 1 |
| 586 | //------------------------------------------------- |
| 587 | // soundmux_status |
| 588 | //------------------------------------------------- |
| 1112 | 589 | |
| 1113 | | static cassette_image_device *cassette_device_image(running_machine &machine) |
| 590 | coco_state::soundmux_status_t coco_state::soundmux_status(void) |
| 1114 | 591 | { |
| 1115 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1116 | | return state->m_cassette_device; |
| 592 | return (soundmux_status_t) ( |
| 593 | (snden() ? SOUNDMUX_ENABLE : 0) | |
| 594 | (sel1() ? SOUNDMUX_SEL1 : 0) | |
| 595 | (sel2() ? SOUNDMUX_SEL2 : 0)); |
| 1117 | 596 | } |
| 1118 | 597 | |
| 1119 | | static device_t *bitbanger_image(running_machine &machine) |
| 1120 | | { |
| 1121 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1122 | | return state->m_bitbanger_device; |
| 1123 | | } |
| 1124 | 598 | |
| 1125 | | static printer_image_device *printer_image(running_machine &machine) |
| 1126 | | { |
| 1127 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1128 | | return state->m_printer_device; |
| 1129 | | } |
| 1130 | 599 | |
| 1131 | | static cococart_slot_device *cococart_device(running_machine &machine) |
| 1132 | | { |
| 1133 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1134 | | return state->m_cococart_device; |
| 1135 | | } |
| 600 | //------------------------------------------------- |
| 601 | // update_sound |
| 602 | //------------------------------------------------- |
| 1136 | 603 | |
| 1137 | | static int get_soundmux_status(running_machine &machine) |
| 604 | void coco_state::update_sound(void) |
| 1138 | 605 | { |
| 1139 | | coco_state *state = machine.driver_data<coco_state>(); |
| 606 | /* PB1 will drive the sound output. This is a rarely |
| 607 | * used single bit sound mode. It is always connected thus |
| 608 | * cannot be disabled. |
| 609 | * |
| 610 | * Source: Page 31 of the Tandy Color Computer Serice Manual |
| 611 | */ |
| 612 | UINT8 single_bit_sound = (m_pia_1->b_output() & 0x02) ? 0x80 : 0x00; |
| 1140 | 613 | |
| 1141 | | int soundmux_status = 0; |
| 1142 | | if (state->m_pia_1->cb2_output()) |
| 1143 | | soundmux_status |= SOUNDMUX_STATUS_ENABLE; |
| 1144 | | if (state->m_mux_sel1) |
| 1145 | | soundmux_status |= SOUNDMUX_STATUS_SEL1; |
| 1146 | | if (state->m_mux_sel2) |
| 1147 | | soundmux_status |= SOUNDMUX_STATUS_SEL2; |
| 1148 | | return soundmux_status; |
| 1149 | | } |
| 614 | /* determine the sound mux status */ |
| 615 | soundmux_status_t status = soundmux_status(); |
| 1150 | 616 | |
| 1151 | | static void soundmux_update(running_machine &machine) |
| 1152 | | { |
| 1153 | | /* This function is called whenever the MUX (selector switch) is changed |
| 1154 | | * It mainly turns on and off the cassette audio depending on the switch. |
| 1155 | | * It also calls a function into the cartridges device to tell it if it is |
| 1156 | | * switch on or off. |
| 1157 | | */ |
| 1158 | | cassette_state new_state; |
| 1159 | | int soundmux_status = get_soundmux_status(machine); |
| 617 | /* determine the value to send to the DAC */ |
| 618 | m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2; |
| 619 | UINT8 sound_output = single_bit_sound + (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0); |
| 620 | dac_data_w(m_dac, sound_output); |
| 1160 | 621 | |
| 1161 | | switch(soundmux_status) { |
| 1162 | | case SOUNDMUX_STATUS_ENABLE | SOUNDMUX_STATUS_SEL1: |
| 1163 | | /* CSN */ |
| 1164 | | new_state = CASSETTE_SPEAKER_ENABLED; |
| 1165 | | break; |
| 1166 | | default: |
| 1167 | | new_state = CASSETTE_SPEAKER_MUTED; |
| 1168 | | break; |
| 1169 | | } |
| 622 | /* determine the cassette sound status */ |
| 623 | cassette_state cas_sound = (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL1)) |
| 624 | ? CASSETTE_SPEAKER_ENABLED |
| 625 | : CASSETTE_SPEAKER_MUTED; |
| 626 | m_cassette->change_state(cas_sound, CASSETTE_MASK_SPEAKER); |
| 1170 | 627 | |
| 1171 | | cococart_device(machine)->cart_set_line( |
| 628 | /* determine the cartridge sound status */ |
| 629 | m_cococart->cart_set_line( |
| 1172 | 630 | COCOCART_LINE_SOUND_ENABLE, |
| 1173 | | (soundmux_status == (SOUNDMUX_STATUS_ENABLE|SOUNDMUX_STATUS_SEL2) |
| 1174 | | ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR)); |
| 1175 | | cassette_device_image(machine)->change_state(new_state,CASSETTE_MASK_SPEAKER); |
| 631 | (status == (SOUNDMUX_ENABLE | SOUNDMUX_SEL2)) ? COCOCART_LINE_VALUE_ASSERT : COCOCART_LINE_VALUE_CLEAR); |
| 1176 | 632 | } |
| 1177 | 633 | |
| 1178 | | static void coco_sound_update(running_machine &machine) |
| 1179 | | { |
| 1180 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1181 | 634 | |
| 1182 | | /* Call this function whenever you need to update the sound. It will |
| 1183 | | * automatically mute any devices that are switched out. |
| 1184 | | */ |
| 1185 | | UINT8 dac = state->m_pia_1->a_output() & 0xFC; |
| 1186 | | UINT8 pia1_pb1 = (state->m_pia_1->b_output() & 0x02) ? 0x80 : 0x00; |
| 1187 | | int soundmux_status = get_soundmux_status(machine); |
| 1188 | 635 | |
| 1189 | | switch(soundmux_status) |
| 1190 | | { |
| 1191 | | case SOUNDMUX_STATUS_ENABLE: |
| 1192 | | /* DAC */ |
| 1193 | | dac_data_w(state->m_dac, pia1_pb1 + (dac >> 1) ); /* Mixing the two sources */ |
| 1194 | | break; |
| 1195 | | case SOUNDMUX_STATUS_ENABLE | SOUNDMUX_STATUS_SEL1: |
| 1196 | | /* CSN */ |
| 1197 | | dac_data_w(state->m_dac, pia1_pb1); /* Mixing happens elsewhere */ |
| 1198 | | break; |
| 1199 | | case SOUNDMUX_STATUS_ENABLE | SOUNDMUX_STATUS_SEL2: |
| 1200 | | /* CART Sound */ |
| 1201 | | dac_data_w(state->m_dac, pia1_pb1); /* To do: mix in cart signal */ |
| 1202 | | break; |
| 1203 | | default: |
| 1204 | | /* This pia line is always connected to the output */ |
| 1205 | | dac_data_w(state->m_dac, pia1_pb1); |
| 1206 | | break; |
| 1207 | | } |
| 1208 | | } |
| 636 | //------------------------------------------------- |
| 637 | // joystick_type - returns the type of joystick |
| 638 | // in the specified port |
| 639 | //------------------------------------------------- |
| 1209 | 640 | |
| 1210 | | /* |
| 1211 | | Dragon Alpha AY-3-8912 |
| 1212 | | */ |
| 1213 | | |
| 1214 | | READ8_HANDLER ( dgnalpha_psg_porta_read ) |
| 641 | coco_state::joystick_type_t coco_state::joystick_type(int index) |
| 1215 | 642 | { |
| 1216 | | return 0; |
| 643 | assert((index == 0) || (index == 1)); |
| 644 | return (m_joystick_type_control != NULL) |
| 645 | ? (joystick_type_t) ((input_port_read_direct(m_joystick_type_control) >> (index * 4)) & 0x0F) |
| 646 | : JOYSTICK_NONE; |
| 1217 | 647 | } |
| 1218 | 648 | |
| 1219 | | WRITE8_HANDLER( dgnalpha_psg_porta_write ) |
| 1220 | | { |
| 1221 | | device_t *fdc = space->machine().device("wd2797"); |
| 1222 | | /* Bits 0..3 are the drive select lines for the internal floppy interface */ |
| 1223 | | /* Bit 4 is the motor on, in the real hardware these are inverted on their way to the drive */ |
| 1224 | | /* Bits 5,6,7 are connected to /DDEN, ENP and 5/8 on the WD2797 */ |
| 1225 | | switch (data & 0xF) |
| 1226 | | { |
| 1227 | | case(0x01) : |
| 1228 | | wd17xx_set_drive(fdc,0); |
| 1229 | | break; |
| 1230 | | case(0x02) : |
| 1231 | | wd17xx_set_drive(fdc,1); |
| 1232 | | break; |
| 1233 | | case(0x04) : |
| 1234 | | wd17xx_set_drive(fdc,2); |
| 1235 | | break; |
| 1236 | | case(0x08) : |
| 1237 | | wd17xx_set_drive(fdc,3); |
| 1238 | | break; |
| 1239 | | } |
| 1240 | | } |
| 1241 | 649 | |
| 1242 | | /*************************************************************************** |
| 1243 | | PIA0 ($FF00-$FF1F) (Chip U8) |
| 1244 | 650 | |
| 1245 | | PIA0 PA0-PA7 - Keyboard/Joystick read |
| 1246 | | PIA0 PB0-PB7 - Keyboard write |
| 1247 | | PIA0 CA1 - M6847 HS (Horizontal Sync) |
| 1248 | | PIA0 CA2 - SEL1 (Used by sound mux and joystick) |
| 1249 | | PIA0 CB1 - M6847 FS (Field Sync) |
| 1250 | | PIA0 CB2 - SEL2 (Used by sound mux and joystick) |
| 1251 | | ***************************************************************************/ |
| 651 | //------------------------------------------------- |
| 652 | // hires_interface_type |
| 653 | //------------------------------------------------- |
| 1252 | 654 | |
| 1253 | | static WRITE8_DEVICE_HANDLER( d_pia0_ca2_w ) |
| 655 | coco_state::hires_type_t coco_state::hires_interface_type(void) |
| 1254 | 656 | { |
| 1255 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1256 | | state->m_mux_sel1_timer->adjust(JOYSTICK_MUX_DELAY, data); |
| 657 | return (m_joystick_hires_control != NULL) |
| 658 | ? (hires_type_t) input_port_read_direct(m_joystick_hires_control) |
| 659 | : HIRES_NONE; |
| 1257 | 660 | } |
| 1258 | 661 | |
| 1259 | | static TIMER_CALLBACK( coco_update_sel1_timerproc ) |
| 1260 | | { |
| 1261 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1262 | | state->m_mux_sel1 = param; |
| 1263 | | (*state->update_keyboard)(machine); |
| 1264 | | soundmux_update(machine); |
| 1265 | | } |
| 1266 | 662 | |
| 1267 | | static WRITE8_DEVICE_HANDLER( d_pia0_cb2_w ) |
| 1268 | | { |
| 1269 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1270 | | state->m_mux_sel2_timer->adjust(JOYSTICK_MUX_DELAY, data); |
| 1271 | | } |
| 1272 | 663 | |
| 1273 | | static TIMER_CALLBACK( coco_update_sel2_timerproc ) |
| 664 | //------------------------------------------------- |
| 665 | // is_joystick_hires |
| 666 | //------------------------------------------------- |
| 667 | |
| 668 | bool coco_state::is_joystick_hires(int joystick_index) |
| 1274 | 669 | { |
| 1275 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1276 | | state->m_mux_sel2 = param; |
| 1277 | | (*state->update_keyboard)(machine); |
| 1278 | | soundmux_update(machine); |
| 1279 | | } |
| 670 | bool result; |
| 671 | assert((joystick_index == 0) || (joystick_index == 1)); |
| 1280 | 672 | |
| 673 | switch(hires_interface_type()) |
| 674 | { |
| 675 | case HIRES_RIGHT: |
| 676 | case HIRES_RIGHT_COCOMAX3: |
| 677 | result = (joystick_index == 0); |
| 678 | break; |
| 1281 | 679 | |
| 1282 | | static attotime get_relative_time( running_machine &machine, attotime absolute_time ) |
| 1283 | | { |
| 1284 | | attotime result; |
| 1285 | | attotime now = machine.time(); |
| 680 | case HIRES_LEFT: |
| 681 | case HIRES_LEFT_COCOMAX3: |
| 682 | result = (joystick_index == 1); |
| 683 | break; |
| 1286 | 684 | |
| 1287 | | if (absolute_time > now) |
| 1288 | | result = absolute_time - now; |
| 1289 | | else |
| 1290 | | result = attotime::never; |
| 685 | default: |
| 686 | result = false; |
| 687 | break; |
| 688 | } |
| 1291 | 689 | return result; |
| 1292 | 690 | } |
| 1293 | 691 | |
| 1294 | 692 | |
| 1295 | 693 | |
| 1296 | | static UINT8 coco_update_keyboard( running_machine &machine ) |
| 694 | //------------------------------------------------- |
| 695 | // poll_joystick |
| 696 | //------------------------------------------------- |
| 697 | |
| 698 | void coco_state::poll_joystick(bool *joyin, UINT8 *buttons) |
| 1297 | 699 | { |
| 1298 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1299 | | UINT8 porta = 0x7f, port_za = 0x7f; |
| 1300 | | int joyval; |
| 700 | static const analog_input_t s_empty = {}; |
| 1301 | 701 | static const int joy_rat_table[] = {15, 24, 42, 33 }; |
| 1302 | 702 | static const int dclg_table[] = {0, 14, 30, 49 }; |
| 1303 | | attotime dclg_time = attotime::zero; |
| 1304 | | UINT8 pia0_pb; |
| 1305 | | UINT8 dac = state->m_pia_1->a_output() & 0xfc; |
| 1306 | | UINT8 hires = input_port_read_safe(machine, "hires_intf", 0x00); |
| 1307 | | int joystick_axis, joystick, joy_mask, joy_shift, ctrl, hires_val, cc3m_val; |
| 1308 | 703 | |
| 1309 | | static const char *const portnames[2][4][2] = |
| 1310 | | { |
| 1311 | | { {0}, {"joystick_rx", "joystick_ry"}, {"rat_mouse_rx", "rat_mouse_ry"}, {"dclg_rx", "dclg_ry"} }, /* right ports */ |
| 1312 | | { {0}, {"joystick_lx", "joystick_ly"}, {"rat_mouse_lx", "rat_mouse_ly"}, {"dclg_lx", "dclg_ly"} }, /* left ports */ |
| 1313 | | }; |
| 1314 | | static const char *const button_names[4] = { "empty", "joystick_buttons", "rat_mouse_buttons", "dclg_triggers" }; |
| 704 | /* identify the joystick and axis */ |
| 705 | int joystick_axis = sel1() ? 1 : 0; |
| 706 | int joystick = sel2() ? 1 : 0; |
| 1315 | 707 | |
| 1316 | | |
| 1317 | | |
| 1318 | | pia0_pb = state->m_pia_0->b_output(); |
| 1319 | | joystick_axis = state->m_mux_sel1; |
| 1320 | | joystick = state->m_mux_sel2; |
| 1321 | | |
| 1322 | | /* which kind of controller is selected? */ |
| 1323 | | joy_mask = joystick ? 0xf0 : 0x0f; |
| 1324 | | joy_shift = joystick ? 4 : 0; |
| 1325 | | ctrl = (input_port_read_safe(machine, "ctrl_sel", 0x00) & joy_mask) >> joy_shift; |
| 1326 | | |
| 1327 | | /* is any Hi-Res Interface turned on? prepare masks to check it */ |
| 1328 | | hires_val = joystick ? 0x03 : 0x01; |
| 1329 | | cc3m_val = joystick ? 0x04 : 0x02; |
| 1330 | | |
| 1331 | | /* poll keyboard keys */ |
| 1332 | | if ((input_port_read(machine, "row0") | pia0_pb) != 0xff) porta &= ~0x01; |
| 1333 | | if ((input_port_read(machine, "row1") | pia0_pb) != 0xff) porta &= ~0x02; |
| 1334 | | if ((input_port_read(machine, "row2") | pia0_pb) != 0xff) porta &= ~0x04; |
| 1335 | | if ((input_port_read(machine, "row3") | pia0_pb) != 0xff) porta &= ~0x08; |
| 1336 | | if ((input_port_read(machine, "row4") | pia0_pb) != 0xff) porta &= ~0x10; |
| 1337 | | if ((input_port_read(machine, "row5") | pia0_pb) != 0xff) porta &= ~0x20; |
| 1338 | | if ((input_port_read(machine, "row6") | pia0_pb) != 0xff) porta &= ~0x40; |
| 1339 | | |
| 1340 | | if ((input_port_read(machine, "row0") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x01; |
| 1341 | | if ((input_port_read(machine, "row1") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x02; |
| 1342 | | if ((input_port_read(machine, "row2") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x04; |
| 1343 | | if ((input_port_read(machine, "row3") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x08; |
| 1344 | | if ((input_port_read(machine, "row4") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x10; |
| 1345 | | if ((input_port_read(machine, "row5") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x20; |
| 1346 | | if ((input_port_read(machine, "row6") | state->m_pia_0->port_b_z_mask()) != 0xff) port_za &= ~0x40; |
| 1347 | | |
| 1348 | | switch (ctrl) |
| 708 | /* determine the JOYIN value */ |
| 709 | const analog_input_t *analog; |
| 710 | bool joyin_value; |
| 711 | UINT8 joyval; |
| 712 | int dclg_vpos; |
| 713 | switch(joystick_type(joystick)) |
| 1349 | 714 | { |
| 1350 | | case 0x01: /* Joystick */ |
| 1351 | | if (hires == hires_val || hires == cc3m_val) |
| 715 | case JOYSTICK_NORMAL: |
| 716 | analog = &m_joystick; |
| 717 | |
| 718 | /* is any Hi-Res Interface turned on? prepare masks to check it */ |
| 719 | if (is_joystick_hires(joystick)) |
| 1352 | 720 | { |
| 1353 | | /* Hi-Res Joystick or Hi-Res CoCo3Max Joystick */ |
| 1354 | | if (joystick_axis ? coco_hiresjoy_ry(machine) : coco_hiresjoy_rx(machine)) |
| 1355 | | porta |= 0x80; |
| 721 | /* hi-res joystick or hi-res CoCo3Max joystick */ |
| 722 | attotime remaining = m_hiresjoy_transition_timer[joystick_axis]->remaining(); |
| 723 | joyin_value = remaining < attotime::zero; |
| 1356 | 724 | } |
| 1357 | 725 | else |
| 1358 | 726 | { |
| 1359 | | joyval = input_port_read_safe(machine, portnames[joystick][ctrl][joystick_axis], 0x00); |
| 1360 | | if (dac <= joyval) |
| 1361 | | porta |= 0x80; |
| 727 | /* conventional joystick */ |
| 728 | joyval = analog->input(joystick, joystick_axis); |
| 729 | joyin_value = (dac_output() <= (joyval >> 2)); |
| 1362 | 730 | } |
| 1363 | 731 | break; |
| 1364 | 732 | |
| 1365 | | case 0x02: /* Rat Mouse */ |
| 1366 | | joyval = input_port_read_safe(machine, portnames[joystick][ctrl][joystick_axis], 0x00); |
| 1367 | | if ((dac >> 2) <= joy_rat_table[joyval]) |
| 1368 | | porta |= 0x80; |
| 733 | case JOYSTICK_RAT_MOUSE: |
| 734 | analog = &m_rat_mouse; |
| 735 | joyval = analog->input(joystick, joystick_axis); |
| 736 | joyin_value = dac_output() <= joy_rat_table[joyval]; |
| 1369 | 737 | break; |
| 1370 | 738 | |
| 1371 | | case 0x03: /* Diecom Light Gun */ |
| 1372 | | if ((machine.primary_screen->vpos() == input_port_read_safe(machine, portnames[joystick][ctrl][1], 0))) |
| 739 | case JOYSTICK_DIECOM_LIGHT_GUN: |
| 740 | analog = &m_diecom_lightgun; |
| 741 | |
| 742 | /* get the vertical position of the lightgun */ |
| 743 | dclg_vpos = analog->input(joystick, 1); |
| 744 | |
| 745 | if (machine().primary_screen->vpos() == dclg_vpos) |
| 1373 | 746 | { |
| 1374 | | /* If gun is pointing at the current scan line, set hit bit and cache horizontal timer value */ |
| 1375 | | state->m_dclg_output_h |= 0x02; |
| 1376 | | state->m_dclg_timer = input_port_read_safe(machine, portnames[joystick][ctrl][0], 0) << 1; |
| 747 | /* if gun is pointing at the current scan line, set hit bit and cache horizontal timer value */ |
| 748 | m_dclg_output_h |= 0x02; |
| 749 | m_dclg_timer = analog->input(joystick, 0) << 1; |
| 1377 | 750 | } |
| 1378 | 751 | |
| 1379 | | if ((dac >> 2) <= dclg_table[(joystick_axis ? state->m_dclg_output_h : state->m_dclg_output_v) & 0x03]) |
| 1380 | | porta |= 0x80; |
| 752 | joyin_value = (dac_output() <= dclg_table[(joystick_axis ? m_dclg_output_h : m_dclg_output_v) & 0x03]); |
| 1381 | 753 | |
| 1382 | | if (state->m_dclg_state == 7) |
| 754 | if (m_dclg_state == 7) |
| 1383 | 755 | { |
| 1384 | | /* While in state 7, prepare to chech next video frame for a hit */ |
| 1385 | | dclg_time = machine.primary_screen->time_until_pos(input_port_read_safe(machine, portnames[joystick][ctrl][1], 0), 0); |
| 756 | /* while in state 7, prepare to check next video frame for a hit */ |
| 757 | attotime dclg_time = machine().primary_screen->time_until_pos(dclg_vpos, 0); |
| 758 | m_diecom_lightgun_timer->adjust(dclg_time); |
| 1386 | 759 | } |
| 1387 | | |
| 1388 | 760 | break; |
| 1389 | 761 | |
| 1390 | | default: /* No Controller */ |
| 762 | default: /* None */ |
| 763 | analog = &s_empty; |
| 764 | joyin_value = false; |
| 1391 | 765 | break; |
| 1392 | 766 | } |
| 1393 | 767 | |
| 1394 | | if (dclg_time != attotime::zero) |
| 1395 | | { |
| 1396 | | /* schedule lightgun events */ |
| 1397 | | state->m_update_keyboard_timer->reset(dclg_time); |
| 1398 | | } |
| 1399 | | else |
| 1400 | | { |
| 1401 | | /* schedule hires joystick events */ |
| 1402 | | attotime xtrans = get_relative_time(machine, state->m_hiresjoy_xtransitiontime); |
| 1403 | | attotime ytrans = get_relative_time(machine, state->m_hiresjoy_ytransitiontime); |
| 1404 | | |
| 1405 | | state->m_update_keyboard_timer->reset( |
| 1406 | | (xtrans > ytrans) ? ytrans : xtrans); |
| 1407 | | } |
| 1408 | | |
| 1409 | | /* sample joystick buttons */ |
| 1410 | | porta &= ~input_port_read_safe(machine, button_names[ctrl], 0); |
| 1411 | | port_za &= ~input_port_read_safe(machine, button_names[ctrl], 0); |
| 1412 | | |
| 1413 | | state->m_pia_0->set_a_input(porta, port_za); |
| 1414 | | return porta; |
| 768 | *joyin = joyin_value; |
| 769 | *buttons = analog->buttons(); |
| 1415 | 770 | } |
| 1416 | 771 | |
| 1417 | 772 | |
| 1418 | 773 | |
| 1419 | | static UINT8 coco3_update_keyboard( running_machine &machine ) |
| 1420 | | { |
| 1421 | | /* the CoCo 3 keyboard update routine must also check for the GIME EI1 interrupt */ |
| 1422 | | UINT8 porta = coco_update_keyboard(machine); |
| 1423 | | coco3_raise_interrupt(machine, COCO3_INT_EI1, ((porta & 0x7f) == 0x7f) ? CLEAR_LINE : ASSERT_LINE); |
| 1424 | | return porta; |
| 1425 | | } |
| 774 | //------------------------------------------------- |
| 775 | // poll_keyboard |
| 776 | //------------------------------------------------- |
| 1426 | 777 | |
| 1427 | | |
| 1428 | | |
| 1429 | | /* three functions that update the keyboard in varying ways */ |
| 1430 | | static WRITE8_DEVICE_HANDLER( d_pia0_pb_w ) |
| 778 | void coco_state::poll_keyboard(void) |
| 1431 | 779 | { |
| 1432 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1433 | | (*state->update_keyboard)(device->machine()); |
| 1434 | | } |
| 780 | UINT8 pia0_pb = m_pia_0->b_output(); |
| 781 | UINT8 pia0_pb_z = m_pia_0->port_b_z_mask(); |
| 1435 | 782 | |
| 1436 | | INPUT_CHANGED( coco_keyboard_changed ) |
| 1437 | | { |
| 1438 | | coco_state *state = field.machine().driver_data<coco_state>(); |
| 1439 | | (*state->update_keyboard)(field.machine()); |
| 1440 | | } |
| 783 | UINT8 pia0_pa = 0x7F; |
| 784 | UINT8 pia0_pa_z = 0x7F; |
| 1441 | 785 | |
| 1442 | | static TIMER_CALLBACK( coco_m_update_keyboard_timerproc ) |
| 1443 | | { |
| 1444 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1445 | | (*state->update_keyboard)(machine); |
| 1446 | | } |
| 1447 | | |
| 1448 | | static WRITE8_DEVICE_HANDLER( d_pia0_pa_w ) |
| 1449 | | { |
| 1450 | | UINT8 ctrl = input_port_read_safe(device->machine(), "ctrl_sel", 0x00); |
| 1451 | | UINT8 hires = input_port_read_safe(device->machine(), "hires_intf", 0x00); |
| 1452 | | |
| 1453 | | /* Hi-Res CC3Max Joystick (either in Left or in Right Port) writes here */ |
| 1454 | | if ((ctrl & 0x0f) == 0x01 && hires == 0x02) |
| 1455 | | coco_hiresjoy_w(device->machine(), data & 0x04, 0); |
| 1456 | | else if ((ctrl & 0xf0) == 0x10 && hires == 0x04) |
| 1457 | | coco_hiresjoy_w(device->machine(), data & 0x08, 1); |
| 1458 | | } |
| 1459 | | |
| 1460 | | |
| 1461 | | /*************************************************************************** |
| 1462 | | PIA1 ($FF20-$FF3F) (Chip U4) |
| 1463 | | |
| 1464 | | PIA1 PA0 - CASSDIN |
| 1465 | | PIA1 PA1 - RS232 OUT (CoCo), Printer Strobe (Dragon) |
| 1466 | | PIA1 PA2-PA7 - DAC |
| 1467 | | PIA1 PB0 - RS232 IN |
| 1468 | | PIA1 PB1 - Single bit sound |
| 1469 | | PIA1 PB2 - RAMSZ (32/64K, 16K, and 4K three position switch) |
| 1470 | | PIA1 PB3 - M6847 CSS |
| 1471 | | PIA1 PB4 - M6847 INT/EXT and M6847 GM0 |
| 1472 | | PIA1 PB5 - M6847 GM1 |
| 1473 | | PIA1 PB6 - M6847 GM2 |
| 1474 | | PIA1 PB7 - M6847 A/G |
| 1475 | | PIA1 CA1 - CD (Carrier Detect; NYI) |
| 1476 | | PIA1 CA2 - CASSMOT (Cassette Motor) |
| 1477 | | PIA1 CB1 - CART (Cartridge Detect) |
| 1478 | | PIA1 CB2 - SNDEN (Sound Enable) |
| 1479 | | ***************************************************************************/ |
| 1480 | | |
| 1481 | | static WRITE8_DEVICE_HANDLER ( d_pia1_cb2_w ) |
| 1482 | | { |
| 1483 | | soundmux_update(device->machine()); |
| 1484 | | } |
| 1485 | | |
| 1486 | | /* Printer output functions used by d_pia1_pa_w */ |
| 1487 | | |
| 1488 | | /* Printer output for the CoCo, output to bitbanger port */ |
| 1489 | | static void printer_out_coco(running_machine &machine, int data) |
| 1490 | | { |
| 1491 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1492 | | state->m_bitbanger_output_value = (data & 2) >> 1; |
| 1493 | | bitbanger_output(bitbanger_image(machine), state->m_bitbanger_output_value); |
| 1494 | | } |
| 1495 | | |
| 1496 | | /* Printer output for the Dragon, output to Paralel port */ |
| 1497 | | static void printer_out_dragon(running_machine &machine, int data) |
| 1498 | | { |
| 1499 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1500 | | |
| 1501 | | /* If strobe bit is high send data from pia0 port b to dragon parallel printer */ |
| 1502 | | if (data & 0x02) |
| 786 | /* poll the keyboard, and update PA6-PA0 accordingly*/ |
| 787 | for (int i = 0; i < sizeof(m_keyboard) / sizeof(m_keyboard[0]); i++) |
| 1503 | 788 | { |
| 1504 | | printer_image(machine)->output(state->m_pia_0->b_output()); |
| 1505 | | } |
| 1506 | | } |
| 1507 | | |
| 1508 | | static WRITE8_DEVICE_HANDLER ( d_pia1_pa_w ) |
| 1509 | | { |
| 1510 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1511 | | /* |
| 1512 | | * This port appears at $FF20 |
| 1513 | | * |
| 1514 | | * Bits |
| 1515 | | * 7-2: DAC to speaker or cassette |
| 1516 | | * 1: Serial out (CoCo), Printer strobe (Dragon) |
| 1517 | | */ |
| 1518 | | UINT8 dac = downcast<pia6821_device *>(device)->a_output() & 0xfc; |
| 1519 | | UINT8 ctrl = input_port_read_safe(device->machine(), "ctrl_sel", 0x00); |
| 1520 | | UINT8 hires = input_port_read_safe(device->machine(), "hires_intf", 0x00); |
| 1521 | | state->m_dac_value = dac >> 2; |
| 1522 | | |
| 1523 | | coco_sound_update(device->machine()); |
| 1524 | | |
| 1525 | | /* Diecom Light Gun (either in Left or in Right Port) writes here */ |
| 1526 | | if ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30) |
| 1527 | | { |
| 1528 | | int dclg_this_bit = ((data & 2) >> 1); |
| 1529 | | |
| 1530 | | if (state->m_dclg_previous_bit == 1) |
| 789 | input_port_value value = input_port_read_direct(m_keyboard[i]); |
| 790 | if ((value | pia0_pb) != 0xFF) |
| 1531 | 791 | { |
| 1532 | | if (dclg_this_bit == 0) |
| 1533 | | { |
| 1534 | | /* Clock Diecom Light gun interface on a high to low transistion */ |
| 1535 | | state->m_dclg_state++; |
| 1536 | | state->m_dclg_state &= 0x0f; |
| 1537 | | |
| 1538 | | /* Clear hit bit for every transistion */ |
| 1539 | | state->m_dclg_output_h &= ~0x02; |
| 1540 | | |
| 1541 | | if (state->m_dclg_state > 7) |
| 1542 | | { |
| 1543 | | /* Bit shift timer data on state 8 through 15 */ |
| 1544 | | if (((state->m_dclg_timer >> (state->m_dclg_state - 8 + 1)) & 0x01) == 1) |
| 1545 | | state->m_dclg_output_v |= 0x01; |
| 1546 | | else |
| 1547 | | state->m_dclg_output_v &= ~0x01; |
| 1548 | | |
| 1549 | | /* Bit 9 of timer is only avaiable if state == 8*/ |
| 1550 | | if (state->m_dclg_state == 8 && (((state->m_dclg_timer >> 9) & 0x01) == 1)) |
| 1551 | | state->m_dclg_output_v |= 0x02; |
| 1552 | | else |
| 1553 | | state->m_dclg_output_v &= ~0x02; |
| 1554 | | } |
| 1555 | | |
| 1556 | | /* During state 15, this bit is high. */ |
| 1557 | | if (state->m_dclg_state == 15) |
| 1558 | | state->m_dclg_output_h |= 0x01; |
| 1559 | | else |
| 1560 | | state->m_dclg_output_h &= ~0x01; |
| 1561 | | } |
| 792 | pia0_pa &= ~(0x01 << i); |
| 1562 | 793 | } |
| 1563 | | |
| 1564 | | state->m_dclg_previous_bit = dclg_this_bit; |
| 1565 | | |
| 1566 | | } |
| 1567 | | else |
| 1568 | | { |
| 1569 | | cassette_device_image(device->machine())->output(((int) dac - 0x80) / 128.0); |
| 1570 | | } |
| 1571 | | |
| 1572 | | (*state->update_keyboard)(device->machine()); |
| 1573 | | |
| 1574 | | /* Hi-Res Joystick (either in Left or in Right Port) writes here */ |
| 1575 | | if ((ctrl & 0x0f) == 0x01 && hires == 0x01) |
| 1576 | | coco_hiresjoy_w(device->machine(), dac >= 0x80, 0); |
| 1577 | | else if ((ctrl & 0xf0) == 0x10 && hires == 0x03) |
| 1578 | | coco_hiresjoy_w(device->machine(), dac >= 0x80, 1); |
| 1579 | | |
| 1580 | | /* Handle printer output, serial for CoCos, parallel for Dragons */ |
| 1581 | | (*state->printer_out)(device->machine(), data); |
| 1582 | | } |
| 1583 | | |
| 1584 | | /* |
| 1585 | | * This port appears at $FF23 |
| 1586 | | * |
| 1587 | | * The CoCo 1/2 and Dragon kept the gmode and vmode separate, and the CoCo |
| 1588 | | * 3 tied them together. In the process, the CoCo 3 dropped support for the |
| 1589 | | * semigraphics modes |
| 1590 | | */ |
| 1591 | | |
| 1592 | | static WRITE8_DEVICE_HANDLER( d_pia1_pb_w ) |
| 1593 | | { |
| 1594 | | coco6847_video_changed(); |
| 1595 | | |
| 1596 | | /* PB1 will drive the sound output. This is a rarely |
| 1597 | | * used single bit sound mode. It is always connected thus |
| 1598 | | * cannot be disabled. |
| 1599 | | * |
| 1600 | | * Source: Page 31 of the Tandy Color Computer Serice Manual |
| 1601 | | */ |
| 1602 | | coco_sound_update(device->machine()); |
| 1603 | | } |
| 1604 | | |
| 1605 | | static WRITE8_DEVICE_HANDLER( dragon64_pia1_pb_w ) |
| 1606 | | { |
| 1607 | | int ddr; |
| 1608 | | |
| 1609 | | d_pia1_pb_w(device, 0, data); |
| 1610 | | |
| 1611 | | ddr = ~downcast<pia6821_device *>(device)->port_b_z_mask(); |
| 1612 | | |
| 1613 | | /* If bit 2 of the pia1 ddrb is 1 then this pin is an output so use it */ |
| 1614 | | /* to control the paging of the 32k and 64k basic roms */ |
| 1615 | | /* Otherwise it set as an input, with an EXTERNAL pull-up so it should */ |
| 1616 | | /* always be high (enabling 32k basic rom) */ |
| 1617 | | if (ddr & 0x04) |
| 1618 | | { |
| 1619 | | dragon_page_rom(device->machine(), data & 0x04); |
| 1620 | | } |
| 1621 | | } |
| 1622 | | |
| 1623 | | /*************************************************************************** |
| 1624 | | PIA2 ($FF24-$FF28) on Daragon Alpha/Professional |
| 1625 | | |
| 1626 | | PIA2 PA0 bcdir to AY-8912 |
| 1627 | | PIA2 PA1 bc0 to AY-8912 |
| 1628 | | PIA2 PA2 Rom switch, 0=basic rom, 1=boot rom. |
| 1629 | | PIA2 PA3-PA7 Unknown/unused ? |
| 1630 | | PIA2 PB0-PB7 connected to D0..7 of the AY8912. |
| 1631 | | CB1 DRQ from WD2797 disk controler. |
| 1632 | | ***************************************************************************/ |
| 1633 | | |
| 1634 | | static WRITE8_DEVICE_HANDLER( dgnalpha_pia2_pa_w ) |
| 1635 | | { |
| 1636 | | device_t *ay8912 = device->machine().device("ay8912"); |
| 1637 | | int bc_flags; /* BCDDIR/BC1, as connected to PIA2 port a bits 0 and 1 */ |
| 1638 | | |
| 1639 | | /* If bit 2 of the pia2 ddra is 1 then this pin is an output so use it */ |
| 1640 | | /* to control the paging of the boot and basic roms */ |
| 1641 | | /* Otherwise it set as an input, with an internal pull-up so it should */ |
| 1642 | | /* always be high (enabling boot rom) */ |
| 1643 | | /* PIA FIXME if (pia_get_ddr_a(2) & 0x04) */ |
| 1644 | | { |
| 1645 | | dragon_page_rom(device->machine(), data & 0x04); /* bit 2 controls boot or basic rom */ |
| 1646 | | } |
| 1647 | | |
| 1648 | | /* Bits 0 and 1 for pia2 port a control the BCDIR and BC1 lines of the */ |
| 1649 | | /* AY-8912 */ |
| 1650 | | bc_flags = data & 0x03; /* mask out bits */ |
| 1651 | | |
| 1652 | | switch (bc_flags) |
| 1653 | | { |
| 1654 | | case 0x00 : /* Inactive, do nothing */ |
| 1655 | | break; |
| 1656 | | case 0x01 : /* Write to selected port */ |
| 1657 | | ay8910_data_w(ay8912, 0, downcast<pia6821_device *>(device)->b_output()); |
| 1658 | | break; |
| 1659 | | case 0x02 : /* Read from selected port */ |
| 1660 | | downcast<pia6821_device *>(device)->portb_w(ay8910_r(ay8912, 0)); |
| 1661 | | break; |
| 1662 | | case 0x03 : /* Select port to write to */ |
| 1663 | | ay8910_address_w(ay8912, 0, downcast<pia6821_device *>(device)->b_output()); |
| 1664 | | break; |
| 1665 | | } |
| 1666 | | } |
| 1667 | | |
| 1668 | | /* Controls rom paging in Dragon 64, and Dragon Alpha */ |
| 1669 | | /* On 64, switches between the two versions of the basic rom mapped in at 0x8000 */ |
| 1670 | | /* on the alpha switches between the Boot/Diagnostic rom and the basic rom */ |
| 1671 | | static void dragon_page_rom(running_machine &machine, int romswitch) |
| 1672 | | { |
| 1673 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1674 | | UINT8 *bank; |
| 1675 | | |
| 1676 | | if (romswitch) |
| 1677 | | bank = state->m_rom; /* This is the 32k mode basic(64)/boot rom(alpha) */ |
| 1678 | | else |
| 1679 | | bank = state->m_rom + 0x8000; /* This is the 64k mode basic(64)/basic rom(alpha) */ |
| 1680 | | |
| 1681 | | state->m_bas_rom_bank = bank; /* Record which rom we are using so that the irq routine */ |
| 1682 | | /* uses the vectors from the correct rom ! (alpha) */ |
| 1683 | | |
| 1684 | | setup_memory_map(machine); /* Setup memory map as needed */ |
| 1685 | | } |
| 1686 | | |
| 1687 | | /********************************************************************************************/ |
| 1688 | | /* Dragon Alpha onboard FDC */ |
| 1689 | | /********************************************************************************************/ |
| 1690 | | |
| 1691 | | /* The NMI line on the alphaAlpha is gated through IC16 (early PLD), and is gated by pia2 CA2 */ |
| 1692 | | static WRITE_LINE_DEVICE_HANDLER( dgnalpha_fdc_intrq_w ) |
| 1693 | | { |
| 1694 | | coco_state *cstate = device->machine().driver_data<coco_state>(); |
| 1695 | | |
| 1696 | | if (state) |
| 1697 | | { |
| 1698 | | if(cstate->m_dgnalpha_just_reset) |
| 794 | if ((value | pia0_pb_z) != 0xFF) |
| 1699 | 795 | { |
| 1700 | | cstate->m_dgnalpha_just_reset = 0; |
| 796 | pia0_pa_z &= ~(0x01 << i); |
| 1701 | 797 | } |
| 1702 | | else |
| 1703 | | { |
| 1704 | | if (cstate->m_pia_2->ca2_output_z()) |
| 1705 | | cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 1706 | | } |
| 1707 | 798 | } |
| 1708 | | else |
| 1709 | | cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 1710 | | } |
| 1711 | 799 | |
| 1712 | | /* The DRQ line goes through pia2 cb1, in exactly the same way as DRQ from DragonDos does */ |
| 1713 | | /* for pia1 cb1 */ |
| 1714 | | static WRITE_LINE_DEVICE_HANDLER( dgnalpha_fdc_drq_w ) |
| 1715 | | { |
| 1716 | | coco_state *cstate = device->machine().driver_data<coco_state>(); |
| 1717 | | cstate->m_pia_2->cb1_w(state ? CARTLINE_ASSERTED : CARTLINE_CLEAR); |
| 1718 | | } |
| 800 | /* poll the joystick (*/ |
| 801 | bool joyin; |
| 802 | UINT8 buttons; |
| 803 | poll_joystick(&joyin, &buttons); |
| 1719 | 804 | |
| 1720 | | /* The Dragon Alpha hardware reverses the order of the WD2797 registers */ |
| 1721 | | READ8_HANDLER(dgnalpha_wd2797_r) |
| 1722 | | { |
| 1723 | | device_t *fdc = space->machine().device("wd2797"); |
| 1724 | | int result = 0; |
| 805 | /* PA7 comes from JOYIN */ |
| 806 | pia0_pa |= joyin ? 0x80 : 0x00; |
| 1725 | 807 | |
| 1726 | | switch(offset & 0x03) |
| 1727 | | { |
| 1728 | | case 0: |
| 1729 | | result = wd17xx_data_r(fdc, 0); |
| 1730 | | break; |
| 1731 | | case 1: |
| 1732 | | result = wd17xx_sector_r(fdc, 0); |
| 1733 | | break; |
| 1734 | | case 2: |
| 1735 | | result = wd17xx_track_r(fdc, 0); |
| 1736 | | break; |
| 1737 | | case 3: |
| 1738 | | result = wd17xx_status_r(fdc, 0); |
| 1739 | | break; |
| 1740 | | default: |
| 1741 | | break; |
| 1742 | | } |
| 808 | /* mask out the buttons */ |
| 809 | pia0_pa &= ~buttons; |
| 810 | pia0_pa_z &= ~buttons; |
| 1743 | 811 | |
| 1744 | | return result; |
| 1745 | | } |
| 812 | /* and write the result to PIA0 */ |
| 813 | update_keyboard_input(pia0_pa, pia0_pa_z); |
| 1746 | 814 | |
| 1747 | | WRITE8_HANDLER(dgnalpha_wd2797_w) |
| 1748 | | { |
| 1749 | | device_t *fdc = space->machine().device("wd2797"); |
| 1750 | | switch(offset & 0x3) |
| 1751 | | { |
| 1752 | | case 0: |
| 1753 | | wd17xx_data_w(fdc, 0, data); |
| 1754 | | break; |
| 1755 | | case 1: |
| 1756 | | wd17xx_sector_w(fdc, 0, data); |
| 1757 | | break; |
| 1758 | | case 2: |
| 1759 | | wd17xx_track_w(fdc, 0, data); |
| 1760 | | break; |
| 1761 | | case 3: |
| 1762 | | wd17xx_command_w(fdc, 0, data); |
| 1763 | | |
| 1764 | | /* disk head is encoded in the command byte */ |
| 1765 | | wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0); |
| 1766 | | break; |
| 1767 | | }; |
| 815 | /* hires joystick */ |
| 816 | poll_hires_joystick(); |
| 1768 | 817 | } |
| 1769 | 818 | |
| 1770 | | READ8_HANDLER(dgnalpha_modem_r) |
| 1771 | | { |
| 1772 | | return 0xFF; |
| 1773 | | } |
| 1774 | 819 | |
| 1775 | | WRITE8_HANDLER(dgnalpha_modem_w) |
| 1776 | | { |
| 1777 | | } |
| 1778 | 820 | |
| 1779 | | static WRITE8_DEVICE_HANDLER ( d_pia1_ca2_w ) |
| 1780 | | { |
| 821 | //------------------------------------------------- |
| 822 | // update_keyboard_input - writes to PIA0 PA, but |
| 823 | // on the CoCo 3 controls a GIME input |
| 824 | //------------------------------------------------- |
| 1781 | 825 | |
| 1782 | | cassette_device_image(device->machine())->change_state( |
| 1783 | | data ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, |
| 1784 | | CASSETTE_MASK_MOTOR); |
| 1785 | | } |
| 1786 | | |
| 1787 | | static READ8_DEVICE_HANDLER ( d_pia1_pa_r ) |
| 826 | void coco_state::update_keyboard_input(UINT8 value, UINT8 z) |
| 1788 | 827 | { |
| 1789 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1790 | | UINT8 result; |
| 1791 | | |
| 1792 | | result = (cassette_device_image(device->machine()))->input() >= 0 ? 1 : 0; |
| 1793 | | result |= state->m_bitbanger_output_value << 1; |
| 1794 | | result |= state->m_dac_value << 2; |
| 1795 | | |
| 1796 | | return result; |
| 828 | m_pia_0->set_a_input(value, z); |
| 1797 | 829 | } |
| 1798 | 830 | |
| 1799 | | void coco_bitbanger_callback(running_machine &machine, UINT8 bit) |
| 1800 | | { |
| 1801 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1802 | | state->m_bitbanger_input_value = bit; |
| 1803 | | } |
| 1804 | 831 | |
| 1805 | | void coco3_bitbanger_callback(running_machine &machine, UINT8 bit) |
| 1806 | | { |
| 1807 | | coco_state *state = machine.driver_data<coco_state>(); |
| 1808 | | /* rant: this interrupt is next to useless. It would be useful information to know when a |
| 1809 | | start bit (high to low) occurs, but this interrupt activates in the opposite situation. |
| 1810 | | */ |
| 1811 | 832 | |
| 1812 | | if( state->m_bitbanger_input_value == 0 && bit == 1) |
| 1813 | | { |
| 1814 | | state->m_bitbanger_input_value = bit; |
| 1815 | | coco3_raise_interrupt(machine, COCO3_INT_EI2, 0); |
| 1816 | | coco3_raise_interrupt(machine, COCO3_INT_EI2, 1); |
| 1817 | | } |
| 1818 | | else |
| 1819 | | { |
| 1820 | | state->m_bitbanger_input_value = bit; |
| 1821 | | } |
| 1822 | | } |
| 833 | //------------------------------------------------- |
| 834 | // update_cassout - called when CASSOUT changes |
| 835 | //------------------------------------------------- |
| 1823 | 836 | |
| 1824 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_coco ) |
| 837 | void coco_state::update_cassout(int cassout) |
| 1825 | 838 | { |
| 1826 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 1827 | | |
| 1828 | | /* This handles the reading of the memory sense switch (pb2) for the CoCo 1, |
| 1829 | | * and serial-in (pb0). */ |
| 1830 | | int result; |
| 1831 | | |
| 1832 | | /* For the CoCo 1, the logic has been changed to only select 64K rams |
| 1833 | | if there is more than 16K of memory, as the Color Basic 1.0 rom |
| 1834 | | can only configure 4K or 16K ram banks (as documented in "Color |
| 1835 | | Basic Unreveled"), doing this allows this allows the coco driver |
| 1836 | | to access 32K of ram, and also allows the cocoe driver to access |
| 1837 | | the full 64K, as this uses Color Basic 1.2, which can configure 64K rams */ |
| 1838 | | |
| 1839 | | if (ram_get_size(device->machine().device(RAM_TAG)) > 0x8000) /* 1 bank of 64K rams */ |
| 1840 | | result = (state->m_pia_0->b_output() & 0x80) >> 5; |
| 1841 | | else if (ram_get_size(device->machine().device(RAM_TAG)) >= 0x4000) /* 1 or 2 banks of 16K rams */ |
| 1842 | | result = 0x04; |
| 1843 | | else |
| 1844 | | result = 0x00; /* 4K Rams */ |
| 1845 | | |
| 1846 | | result += state->m_bitbanger_input_value; |
| 1847 | | |
| 1848 | | return result; |
| 839 | m_cassette->output((cassout - 0x20) / 32.0); |
| 1849 | 840 | } |
| 1850 | 841 | |
| 1851 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_dragon32 ) |
| 1852 | | { |
| 1853 | | /* This handles the reading of the memory sense switch (pb2) for the Dragon 32, |
| 1854 | | * and pb0, is the printer /busy line. */ |
| 1855 | 842 | |
| 1856 | | int result; |
| 1857 | 843 | |
| 1858 | | /* Of the Dragon machines, Only the Dragon 32 needs the ram select bit |
| 1859 | | as both the 64 and Alpha, always have 64K rams, also the meaning of |
| 1860 | | the bit is different with respect to the CoCo 1 */ |
| 844 | //------------------------------------------------- |
| 845 | // diecom_lightgun_clock - called the diecom |
| 846 | // lightgun undergoes a high to low transition |
| 847 | //------------------------------------------------- |
| 1861 | 848 | |
| 1862 | | if (ram_get_size(device->machine().device(RAM_TAG)) > 0x8000) |
| 1863 | | result = 0x00; /* 1 bank of 64K, rams */ |
| 1864 | | else |
| 1865 | | result = 0x04; /* 2 banks of 16K rams */ |
| 1866 | | |
| 1867 | | return result; |
| 1868 | | } |
| 1869 | | |
| 1870 | | static READ8_DEVICE_HANDLER ( d_pia1_pb_r_coco2 ) |
| 849 | void coco_state::diecom_lightgun_clock(void) |
| 1871 | 850 | { |
| 1872 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 851 | /* clock Diecom Light gun interface on a high to low transistion */ |
| 852 | m_dclg_state++; |
| 853 | m_dclg_state &= 0x0f; |
| 1873 | 854 | |
| 1874 | | /* This handles the reading of the memory sense switch (pb2) for the CoCo 2 and 3, |
| 1875 | | * and serial-in (pb0). |
| 1876 | | */ |
| 1877 | | int result; |
| 855 | /* clear hit bit for every transistion */ |
| 856 | m_dclg_output_h &= ~0x02; |
| 1878 | 857 | |
| 1879 | | if (ram_get_size(device->machine().device(RAM_TAG)) <= 0x1000) |
| 1880 | | result = 0x00; /* 4K: wire pia1_pb2 low */ |
| 1881 | | else if (ram_get_size(device->machine().device(RAM_TAG)) <= 0x4000) |
| 1882 | | result = 0x04; /* 16K: wire pia1_pb2 high */ |
| 1883 | | else |
| 1884 | | result = (state->m_pia_0->b_output() & 0x40) >> 4; /* 32/64K: wire output of pia0_pb6 to input pia1_pb2 */ |
| 1885 | | |
| 1886 | | result += state->m_bitbanger_input_value; |
| 1887 | | |
| 1888 | | return result; |
| 1889 | | } |
| 1890 | | |
| 1891 | | |
| 1892 | | /* |
| 1893 | | Compusense Dragon Plus Control register |
| 1894 | | */ |
| 1895 | | |
| 1896 | | /* The read handler will eventually return the 6845 status */ |
| 1897 | | READ8_HANDLER ( dgnplus_reg_r ) |
| 1898 | | { |
| 1899 | | return 0; |
| 1900 | | } |
| 1901 | | |
| 1902 | | /* |
| 1903 | | When writing the bits have the following meanings : |
| 1904 | | |
| 1905 | | bit value purpose |
| 1906 | | 0 0 First 2k of memory map determined by bits 1 & 2 |
| 1907 | | 1 6845 display RAM mapped into first 2K of map, |
| 1908 | | |
| 1909 | | 2,1 0,0 Normal bottom 32K or ram mapped (from mainboard). |
| 1910 | | 0,1 First 32K of plus RAM mapped into $0000-$7FFF |
| 1911 | | 1,0 Second 32K of plus RAM mapped into $0000-$7FFF |
| 1912 | | 1,1 Undefined. I will assume that it's the same as 00. |
| 1913 | | 3-7 Unused. |
| 1914 | | */ |
| 1915 | | WRITE8_HANDLER ( dgnplus_reg_w ) |
| 1916 | | { |
| 1917 | | coco_state *state = space->machine().driver_data<coco_state>(); |
| 1918 | | int map; |
| 1919 | | |
| 1920 | | map = (data & 0x06)>>1; |
| 1921 | | |
| 1922 | | switch (map) |
| 858 | if (m_dclg_state > 7) |
| 1923 | 859 | { |
| 1924 | | case 0x00 : state->m_bottom_32k=&ram_get_ptr(space->machine().device(RAM_TAG))[0x00000]; break; |
| 1925 | | case 0x01 : state->m_bottom_32k=&ram_get_ptr(space->machine().device(RAM_TAG))[0x10000]; break; |
| 1926 | | case 0x02 : state->m_bottom_32k=&ram_get_ptr(space->machine().device(RAM_TAG))[0x18000]; break; |
| 1927 | | case 0x03 : state->m_bottom_32k=&ram_get_ptr(space->machine().device(RAM_TAG))[0x00000]; break; |
| 1928 | | default : state->m_bottom_32k=&ram_get_ptr(space->machine().device(RAM_TAG))[0x00000]; break; // Just to shut the compiler up ! |
| 860 | /* Bit shift timer data on state 8 thru 15 */ |
| 861 | if (((m_dclg_timer >> (m_dclg_state - 8 + 1)) & 0x01) == 1) |
| 862 | m_dclg_output_v |= 0x01; |
| 863 | else |
| 864 | m_dclg_output_v &= ~0x01; |
| 865 | |
| 866 | /* Bit 9 of timer is only avaiable if state == 8*/ |
| 867 | if (m_dclg_state == 8 && (((m_dclg_timer >> 9) & 0x01) == 1)) |
| 868 | m_dclg_output_v |= 0x02; |
| 869 | else |
| 870 | m_dclg_output_v &= ~0x02; |
| 1929 | 871 | } |
| 1930 | 872 | |
| 1931 | | setup_memory_map(space->machine()); |
| 873 | /* During state 15, this bit is high. */ |
| 874 | if (m_dclg_state == 15) |
| 875 | m_dclg_output_h |= 0x01; |
| 876 | else |
| 877 | m_dclg_output_h &= ~0x01; |
| 1932 | 878 | } |
| 1933 | 879 | |
| 1934 | 880 | |
| 1935 | 881 | |
| 1936 | | /*************************************************************************** |
| 1937 | | Misc |
| 1938 | | ***************************************************************************/ |
| 882 | //------------------------------------------------- |
| 883 | // update_prinout - called when PRINOUT changes |
| 884 | //------------------------------------------------- |
| 1939 | 885 | |
| 1940 | | static SAM6883_SET_MPU_RATE( d_sam_set_mpurate ) |
| 886 | void coco_state::update_prinout(bool prinout) |
| 1941 | 887 | { |
| 1942 | | /* The infamous speed up poke. |
| 1943 | | * |
| 1944 | | * This was a SAM switch that occupied 4 addresses: |
| 1945 | | * |
| 1946 | | * $FFD9 (set) R1 |
| 1947 | | * $FFD8 (clear) R1 |
| 1948 | | * $FFD7 (set) R0 |
| 1949 | | * $FFD6 (clear) R0 |
| 1950 | | * |
| 1951 | | * R1:R0 formed the following states: |
| 1952 | | * 00 - slow 0.89 MHz |
| 1953 | | * 01 - dual speed ??? |
| 1954 | | * 1x - fast 1.78 MHz |
| 1955 | | * |
| 1956 | | * R1 controlled whether the video addressing was speeded up and R0 |
| 1957 | | * did the same for the CPU. On pre-CoCo 3 machines, setting R1 caused |
| 1958 | | * the screen to display garbage because the M6847 could not display |
| 1959 | | * fast enough. |
| 1960 | | * |
| 1961 | | * TODO: Make the overclock more accurate. In dual speed, ROM was a fast |
| 1962 | | * access but RAM was not. I don't know how to simulate this. |
| 1963 | | */ |
| 1964 | | device->machine().device("maincpu")->set_clock_scale(val ? 2 : 1); |
| 1965 | | } |
| 1966 | | |
| 1967 | | READ8_HANDLER(dgnalpha_mapped_irq_r) |
| 1968 | | { |
| 1969 | | coco_state *state = space->machine().driver_data<coco_state>(); |
| 1970 | | return state->m_bas_rom_bank[0x3ff0 + offset]; |
| 1971 | | } |
| 1972 | | |
| 1973 | | static void setup_memory_map(running_machine &machine) |
| 1974 | | { |
| 1975 | | /* |
| 1976 | | The following table contains the RAM block mappings for the CoCo 1/2 and Dragon computers |
| 1977 | | This replicates the behavior of the SAM ram size programming bits which in ther real hardware |
| 1978 | | allowed the use of various sizes of RAM chips, as follows :- |
| 1979 | | |
| 1980 | | 1 or 2 banks of 4K |
| 1981 | | 1 or 2 banks of 16K |
| 1982 | | 1 bank of 64K |
| 1983 | | up to 64K of static ram. |
| 1984 | | |
| 1985 | | For the 4K and 16K chip sizes, if the second bank was empty it would be mapped to nothing. |
| 1986 | | For the 4K and 16K chip sizes, the banks would be mirrored at chip size*2 intervals. |
| 1987 | | |
| 1988 | | The following table holds the data required to implement this. |
| 1989 | | |
| 1990 | | Note though it is technically possible to have 2 banks of 4K rams, for a total of 8K, I |
| 1991 | | have never seen a machine with this configuration, so I have not implemented it. |
| 1992 | | */ |
| 1993 | | |
| 1994 | | struct coco_meminfo |
| 888 | if ((joystick_type(0) == JOYSTICK_DIECOM_LIGHT_GUN) || (joystick_type(1) == JOYSTICK_DIECOM_LIGHT_GUN)) |
| 1995 | 889 | { |
| 1996 | | offs_t start; /* start address of bank */ |
| 1997 | | offs_t end; /* End address of bank */ |
| 1998 | | int wbank4; /* Bank to map when 4K rams */ |
| 1999 | | int wbank16_1; /* Bank to map when one bank of 16K rams */ |
| 2000 | | int wbank16_2; /* Bank to map when two banks of 16K rams */ |
| 2001 | | int wbank64; /* Bank to map when 64K rams */ |
| 2002 | | }; |
| 2003 | | |
| 2004 | | static const struct coco_meminfo memmap[] = |
| 2005 | | { |
| 2006 | | { 0x0000, 0x0FFF, 1, 1, 1, 1 }, |
| 2007 | | { 0x1000, 0x1FFF, 0, 2, 2, 2 }, |
| 2008 | | { 0x2000, 0x2FFF, 1, 3, 3, 3 }, |
| 2009 | | { 0x3000, 0x3FFF, 0, 4, 4, 4 }, |
| 2010 | | { 0x4000, 0x4FFF, 1, 0, 5, 5 }, |
| 2011 | | { 0x5000, 0x5FFF, 0, 0, 6, 6 }, |
| 2012 | | { 0x6000, 0x6FFF, 1, 0, 7, 7 }, |
| 2013 | | { 0x7000, 0x7FFF, 0, 0, 8, 8 }, |
| 2014 | | { 0x8000, 0x8FFF, 1, 1, 1, 9 }, |
| 2015 | | { 0x9000, 0x9FFF, 0, 2, 2, 10 }, |
| 2016 | | { 0xA000, 0xAFFF, 1, 3, 3, 11 }, |
| 2017 | | { 0xB000, 0xBFFF, 0, 4, 4, 12 }, |
| 2018 | | { 0xC000, 0xCFFF, 1, 0, 5, 13 }, |
| 2019 | | { 0xD000, 0xDFFF, 0, 0, 6, 14 }, |
| 2020 | | { 0xE000, 0xEFFF, 1, 0, 7, 15 }, |
| 2021 | | { 0xF000, 0xFEFF, 0, 0, 8, 16 } |
| 2022 | | }; |
| 2023 | | |
| 2024 | | /* We need to init these vars from the sam, as this may be called from outside the sam callbacks */ |
| 2025 | | address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); |
| 2026 | | coco_state *state = machine.driver_data<coco_state>(); |
| 2027 | | UINT8 memsize = sam6883_memorysize(state->m_sam); |
| 2028 | | UINT8 maptype = sam6883_maptype(state->m_sam); |
| 2029 | | //UINT8 pagemode = sam6883_pagemode(machine); |
| 2030 | | int last_ram_block; /* Last block that will be RAM, dependent on maptype */ |
| 2031 | | int block_index; /* Index of block being processed */ |
| 2032 | | int wbank; /* bank no to go in this block */ |
| 2033 | | UINT8 *offset; /* offset into coco rom for rom mapping */ |
| 2034 | | char bank[10]; |
| 2035 | | |
| 2036 | | /* Set last RAM block dependent on map type */ |
| 2037 | | if (maptype) |
| 2038 | | last_ram_block=15; |
| 2039 | | else |
| 2040 | | last_ram_block=7; |
| 2041 | | |
| 2042 | | /* Map RAM blocks */ |
| 2043 | | for(block_index=0;block_index<=last_ram_block;block_index++) |
| 2044 | | { |
| 2045 | | sprintf(bank,"bank%d",block_index+1); |
| 2046 | | /* Lookup the apropreate wbank value dependent on ram size */ |
| 2047 | | if (memsize==0) |
| 2048 | | wbank=memmap[block_index].wbank4; |
| 2049 | | else if ((memsize==1) && (ram_get_size(machine.device(RAM_TAG)) == 0x4000)) /* one bank of 16K rams */ |
| 2050 | | wbank=memmap[block_index].wbank16_1; |
| 2051 | | else if ((memsize==1) && (ram_get_size(machine.device(RAM_TAG)) == 0x8000)) /* two banks of 16K rams */ |
| 2052 | | wbank=memmap[block_index].wbank16_2; |
| 2053 | | else |
| 2054 | | wbank=memmap[block_index].wbank64; |
| 2055 | | |
| 2056 | | /* If wbank is 0 then there is no ram here so set it up to return 0, note this may change in the future */ |
| 2057 | | /* as all unmapped addresses on the CoCo/Dragon seem to always return 126 (0x7E) */ |
| 2058 | | /* If wbank is a positive integer, it contains the bank number to map into this block */ |
| 2059 | | if(wbank!=0) |
| 890 | /* printer port is connected to diecom light gun */ |
| 891 | if (m_dclg_previous_bit && !prinout) |
| 2060 | 892 | { |
| 2061 | | /* This deals with the bottom 32K page switch and the Dragon Plus paged ram */ |
| 2062 | | if(block_index<8) |
| 2063 | | memory_set_bankptr(machine, bank, &state->m_bottom_32k[memmap[wbank-1].start]); |
| 2064 | | else |
| 2065 | | memory_set_bankptr(machine, bank,&ram_get_ptr(machine.device(RAM_TAG))[memmap[wbank-1].start]); |
| 2066 | | |
| 2067 | | space->install_readwrite_bank(memmap[block_index].start, memmap[block_index].end, bank); |
| 893 | diecom_lightgun_clock(); |
| 2068 | 894 | } |
| 2069 | | else |
| 2070 | | { |
| 2071 | | space->nop_readwrite(memmap[block_index].start, memmap[block_index].end); |
| 2072 | | } |
| 895 | m_dclg_previous_bit = prinout; |
| 2073 | 896 | } |
| 2074 | | |
| 2075 | | /* If in maptype 0 we need to map in the rom also, for now this just maps in the system and cart roms */ |
| 2076 | | if(!maptype) |
| 897 | else |
| 2077 | 898 | { |
| 2078 | | UINT8 *cart_rom = cococart_device(machine)->get_cart_base(); |
| 2079 | | |
| 2080 | | for(block_index=0;block_index<=7;block_index++) |
| 899 | /* output bitbanger if present (only on CoCos) */ |
| 900 | if (m_bitbanger != NULL) |
| 2081 | 901 | { |
| 2082 | | sprintf(bank,"bank%d",block_index+9); |
| 2083 | | /* If we are in the BASIC rom area $8000-$BFFF, then we map to the bas_rom_bank */ |
| 2084 | | /* as this may be in a different block of coco_rom, in the Dragon 64 and Alpha */ |
| 2085 | | /* as these machines have mutiple bios roms that can ocupy this area */ |
| 2086 | | if (block_index < 4) |
| 2087 | | offset = &state->m_bas_rom_bank[0x1000*block_index]; |
| 2088 | | else { |
| 2089 | | if (cart_rom) { |
| 2090 | | offset = &cart_rom[(0x1000*(block_index-4)) % 0x4000]; |
| 2091 | | } else { |
| 2092 | | offset = NULL; |
| 2093 | | } |
| 2094 | | } |
| 2095 | | if (offset){ |
| 2096 | | memory_set_bankptr(machine, bank,offset); |
| 2097 | | } else { |
| 2098 | | space->unmap_read(memmap[block_index+8].start, memmap[block_index+8].end); |
| 2099 | | } |
| 2100 | | space->nop_write(memmap[block_index+8].start, memmap[block_index+8].end); |
| 902 | m_bitbanger->output(prinout ? 1 : 0); |
| 2101 | 903 | } |
| 2102 | 904 | } |
| 2103 | 905 | } |
| 2104 | 906 | |
| 2105 | 907 | |
| 2106 | | static SAM6883_SET_PAGE_ONE_MODE( d_sam_set_pageonemode ) |
| 2107 | | { |
| 2108 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 2109 | | /* Page mode - allowed switching between the low 32k and the high 32k, |
| 2110 | | * assuming that 64k wasn't enabled |
| 2111 | | * |
| 2112 | | * TODO: Actually implement this. Also find out what the CoCo 3 did with |
| 2113 | | * this (it probably ignored it) |
| 2114 | | */ |
| 2115 | 908 | |
| 2116 | | if (!sam6883_maptype(device)) // Ignored in maptype 1 |
| 2117 | | { |
| 2118 | | if((ram_get_size(device->machine().device(RAM_TAG))>0x8000) && val) |
| 2119 | | state->m_bottom_32k=&ram_get_ptr(device->machine().device(RAM_TAG))[0x8000]; |
| 2120 | | else |
| 2121 | | state->m_bottom_32k=&ram_get_ptr(device->machine().device(RAM_TAG))[0]; |
| 909 | //------------------------------------------------- |
| 910 | // pia1_pa_changed - called when PIA1 PA changes |
| 911 | //------------------------------------------------- |
| 2122 | 912 | |
| 2123 | | setup_memory_map(device->machine()); |
| 2124 | | } |
| 2125 | | } |
| 2126 | | |
| 2127 | | static SAM6883_SET_MEMORY_SIZE( d_sam_set_memorysize ) |
| 913 | void coco_state::pia1_pa_changed(void) |
| 2128 | 914 | { |
| 2129 | | /* Memory size - allowed restricting memory accesses to something less than |
| 2130 | | * 32k |
| 2131 | | * |
| 2132 | | * This was a SAM switch that occupied 4 addresses: |
| 2133 | | * |
| 2134 | | * $FFDD (set) R1 |
| 2135 | | * $FFDC (clear) R1 |
| 2136 | | * $FFDB (set) R0 |
| 2137 | | * $FFDA (clear) R0 |
| 2138 | | * |
| 2139 | | * R1:R0 formed the following states: |
| 2140 | | * 00 - 4k |
| 2141 | | * 01 - 16k |
| 2142 | | * 10 - 64k |
| 2143 | | * 11 - static RAM (??) |
| 2144 | | * |
| 2145 | | * If something less than 64k was set, the low RAM would be smaller and |
| 2146 | | * mirror the other parts of the RAM |
| 2147 | | * |
| 2148 | | * TODO: Find out what "static RAM" is |
| 2149 | | * TODO: This should affect _all_ memory accesses, not just video ram |
| 2150 | | * TODO: Verify that the CoCo 3 ignored this |
| 2151 | | */ |
| 2152 | | |
| 2153 | | setup_memory_map(device->machine()); |
| 915 | update_sound(); |
| 916 | poll_keyboard(); |
| 917 | update_cassout(dac_output()); |
| 918 | update_prinout(m_pia_1->a_output() & 0x02 ? true : false); |
| 2154 | 919 | } |
| 2155 | 920 | |
| 2156 | 921 | |
| 2157 | 922 | |
| 2158 | | /*************************************************************************** |
| 2159 | | CoCo 3 Timer |
| 923 | //------------------------------------------------- |
| 924 | // pia1_pb_changed - called when PIA1 PB changes |
| 925 | //------------------------------------------------- |
| 2160 | 926 | |
| 2161 | | The CoCo 3 had a timer that had would activate when first written to, and |
| 2162 | | would decrement over and over again until zero was reached, and at that |
| 2163 | | point, would flag an interrupt. At this point, the timer starts back up |
| 2164 | | again. |
| 2165 | | |
| 2166 | | I am deducing that the timer interrupt line was asserted if the timer was |
| 2167 | | zero and unasserted if the timer was non-zero. Since we never truly track |
| 2168 | | the timer, we just use timer callback (coco3_timer_callback() asserts the |
| 2169 | | line) |
| 2170 | | |
| 2171 | | Most CoCo 3 docs, including the specs that Tandy released, say that the |
| 2172 | | high speed timer is 70ns (half of the speed of the main clock crystal). |
| 2173 | | However, it seems that this is in error, and the GIME timer is really a |
| 2174 | | 280ns timer (one eighth the speed of the main clock crystal. Gault's |
| 2175 | | FAQ agrees with this |
| 2176 | | ***************************************************************************/ |
| 2177 | | |
| 2178 | | |
| 2179 | | static void coco3_timer_reset(running_machine &machine) |
| 927 | void coco_state::pia1_pb_changed(void) |
| 2180 | 928 | { |
| 2181 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 2182 | | /* reset the timer; take the value stored in $FF94-5 and start the timer ticking */ |
| 2183 | | UINT16 timer_value; |
| 2184 | | m6847_timing_type timing; |
| 2185 | | attotime delay_time; |
| 2186 | | |
| 2187 | | /* value is from 0-4095 */ |
| 2188 | | timer_value = ((state->m_gimereg[4] & 0x0F) * 0x100) | state->m_gimereg[5]; |
| 2189 | | |
| 2190 | | if (timer_value > 0) |
| 2191 | | { |
| 2192 | | /* depending on the GIME type, cannonicalize the value */ |
| 2193 | | if (GIME_TYPE_1987) |
| 2194 | | timer_value += 1; /* the 1987 GIME reset to the value plus one */ |
| 2195 | | else |
| 2196 | | timer_value += 2; /* the 1986 GIME reset to the value plus two */ |
| 2197 | | |
| 2198 | | /* choose which timing clock source */ |
| 2199 | | timing = (state->m_gimereg[1] & 0x20) ? M6847_CLOCK : M6847_HSYNC; |
| 2200 | | |
| 2201 | | /* determine the delay time */ |
| 2202 | | delay_time = coco6847_time_delay(machine, timing, timer_value); |
| 2203 | | if (LOG_TIMER) |
| 2204 | | logerror("coco3_reset_timer(): delay_time=%g\n", delay_time.as_double()); |
| 2205 | | |
| 2206 | | /* and adjust the timer */ |
| 2207 | | state->m_gime_timer->adjust(delay_time); |
| 2208 | | } |
| 2209 | | else |
| 2210 | | { |
| 2211 | | /* timer is shut off */ |
| 2212 | | state->m_gime_timer->reset(); |
| 2213 | | if (LOG_TIMER) |
| 2214 | | logerror("coco3_reset_timer(): timer is off\n"); |
| 2215 | | } |
| 929 | update_sound(); |
| 2216 | 930 | } |
| 2217 | 931 | |
| 2218 | 932 | |
| 2219 | 933 | |
| 2220 | | static TIMER_CALLBACK(coco3_timer_proc) |
| 2221 | | { |
| 2222 | | coco3_timer_reset(machine); |
| 2223 | | coco3_vh_blink(machine); |
| 2224 | | coco3_raise_interrupt(machine, COCO3_INT_TMR, 1); |
| 2225 | | coco3_raise_interrupt(machine, COCO3_INT_TMR, 0); |
| 2226 | | } |
| 934 | //------------------------------------------------- |
| 935 | // keyboard_changed |
| 936 | //------------------------------------------------- |
| 2227 | 937 | |
| 2228 | | |
| 2229 | | |
| 2230 | | static void coco3_timer_init(running_machine &machine) |
| 938 | INPUT_CHANGED(coco_state::keyboard_changed) |
| 2231 | 939 | { |
| 2232 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 2233 | | state->m_gime_timer = machine.scheduler().timer_alloc(FUNC(coco3_timer_proc)); |
| 940 | coco_state *state = field.machine().driver_data<coco_state>(); |
| 941 | state->poll_keyboard(); |
| 2234 | 942 | } |
| 2235 | 943 | |
| 2236 | 944 | |
| 2237 | 945 | |
| 2238 | | /*************************************************************************** |
| 2239 | | MMU |
| 2240 | | ***************************************************************************/ |
| 946 | //------------------------------------------------- |
| 947 | // joystick_mode_changed |
| 948 | //------------------------------------------------- |
| 2241 | 949 | |
| 2242 | | /* Dragon 64/Alpha and Tano Dragon 64 sams are now handled in exactly the same */ |
| 2243 | | /* way as the CoCo 1/2 and Dragon 32, this now has been reduced to a call to */ |
| 2244 | | /* setup_memory_map() - 2007-01-02 phs. */ |
| 2245 | | |
| 2246 | | static SAM6883_SET_MAP_TYPE( d_sam_set_maptype ) |
| 950 | INPUT_CHANGED(coco_state::joystick_mode_changed) |
| 2247 | 951 | { |
| 2248 | | coco_state *state = device->machine().driver_data<coco_state>(); |
| 2249 | | if(val) |
| 2250 | | state->m_bottom_32k=ram_get_ptr(device->machine().device(RAM_TAG)); // Always reset, when in maptype 1 |
| 2251 | | |
| 2252 | | setup_memory_map(device->machine()); |
| 952 | coco_state *state = field.machine().driver_data<coco_state>(); |
| 953 | state->poll_keyboard(); |
| 2253 | 954 | } |
| 2254 | 955 | |
| 2255 | | /************************************* |
| 2256 | | * |
| 2257 | | * CoCo 3 |
| 2258 | | * |
| 2259 | | *************************************/ |
| 2260 | 956 | |
| 2261 | 957 | |
| 2262 | | /* |
| 2263 | | * coco3_mmu_translate() takes a zero counted bank index and an offset and |
| 2264 | | * translates it into a physical RAM address. The following logical memory |
| 2265 | | * addresses have the following bank indexes: |
| 2266 | | * |
| 2267 | | * Bank 0 $0000-$1FFF |
| 2268 | | * Bank 1 $2000-$3FFF |
| 2269 | | * Bank 2 $4000-$5FFF |
| 2270 | | * Bank 3 $6000-$7FFF |
| 2271 | | * Bank 4 $8000-$9FFF |
| 2272 | | * Bank 5 $A000-$BFFF |
| 2273 | | * Bank 6 $C000-$DFFF |
| 2274 | | * Bank 7 $E000-$FDFF |
| 2275 | | * Bank 8 $FE00-$FEFF |
| 2276 | | * |
| 2277 | | * The result represents a physical RAM address. Since ROM/Cartidge space is |
| 2278 | | * outside of the standard RAM memory map, ROM addresses get a "physical RAM" |
| 2279 | | * address that has bit 31 set. For example, ECB would be $80000000- |
| 2280 | | * $80001FFFF, CB would be $80002000-$80003FFFF etc. It is possible to force |
| 2281 | | * this function to use a RAM address, which is used for video since video can |
| 2282 | | * never reference ROM. |
| 2283 | | */ |
| 2284 | | offs_t coco3_mmu_translate(running_machine &machine,int bank, int offset) |
| 2285 | | { |
| 2286 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 2287 | | int forceram; |
| 2288 | | UINT32 block; |
| 2289 | | offs_t result; |
| 958 | //------------------------------------------------- |
| 959 | // bitbanger_changed |
| 960 | //------------------------------------------------- |
| 2290 | 961 | |
| 2291 | | /* Bank 8 is the 0xfe00 block; and it is treated differently */ |
| 2292 | | if (bank == 8) |
| 2293 | | { |
| 2294 | | if (state->m_gimereg[0] & 8) |
| 2295 | | { |
| 2296 | | /* this GIME register fixes logical addresses $FExx to physical |
| 2297 | | * addresses $7FExx ($1FExx if 128k */ |
| 2298 | | assert(offset < 0x200); |
| 2299 | | return ((ram_get_size(machine.device(RAM_TAG)) - 0x200) & 0x7ffff) + offset; |
| 2300 | | } |
| 2301 | | bank = 7; |
| 2302 | | offset += 0x1e00; |
| 2303 | | forceram = 1; |
| 2304 | | } |
| 2305 | | else |
| 2306 | | { |
| 2307 | | forceram = 0; |
| 2308 | | } |
| 2309 | | |
| 2310 | | /* Perform the MMU lookup */ |
| 2311 | | if (state->m_gimereg[0] & 0x40) |
| 2312 | | { |
| 2313 | | if (state->m_gimereg[1] & 1) |
| 2314 | | bank += 8; |
| 2315 | | block = state->m_mmu[bank]; |
| 2316 | | block |= ((UINT32) ((state->m_gimereg[11] >> 4) & 0x03)) << 8; |
| 2317 | | } |
| 2318 | | else |
| 2319 | | { |
| 2320 | | block = bank + 56; |
| 2321 | | } |
| 2322 | | |
| 2323 | | /* Are we actually in ROM? |
| 2324 | | * |
| 2325 | | * In our world, ROM is represented by memory blocks 0x40-0x47 |
| 2326 | | * |
| 2327 | | * 0 Extended Color Basic |
| 2328 | | * 1 Color Basic |
| 2329 | | * 2 Reset Initialization |
| 2330 | | * 3 Super Extended Color Basic |
| 2331 | | * 4-7 Cartridge ROM |
| 2332 | | * |
| 2333 | | * This is the level where ROM is mapped, according to Tepolt (p21) |
| 2334 | | */ |
| 2335 | | if (((block & 0x3f) >= 0x3c) && !state->m_enable_64k && !forceram) |
| 2336 | | { |
| 2337 | | static const UINT8 rommap[4][4] = |
| 2338 | | { |
| 2339 | | { 0, 1, 6, 7 }, |
| 2340 | | { 0, 1, 6, 7 }, |
| 2341 | | { 0, 1, 2, 3 }, |
| 2342 | | { 4, 5, 6, 7 } |
| 2343 | | }; |
| 2344 | | block = rommap[state->m_gimereg[0] & 3][(block & 0x3f) - 0x3c]; |
| 2345 | | result = (block * 0x2000 + offset) | 0x80000000; |
| 2346 | | } |
| 2347 | | else |
| 2348 | | { |
| 2349 | | result = ((block * 0x2000) + offset) % ram_get_size(machine.device(RAM_TAG)); |
| 2350 | | } |
| 2351 | | return result; |
| 2352 | | } |
| 2353 | | |
| 2354 | | |
| 2355 | | |
| 2356 | | static void coco3_mmu_update(running_machine &machine, int lowblock, int hiblock) |
| 962 | void coco_state::bitbanger_changed(bool newvalue) |
| 2357 | 963 | { |
| 2358 | | coco_state *state = machine.driver_data<coco_state>(); |
| 2359 | | static const struct |
| 2360 | | { |
| 2361 | | offs_t start; |
| 2362 | | offs_t end; |
| 2363 | | } |
| 2364 | | bank_info[] = |
| 2365 | | { |
| 2366 | | { 0x0000, 0x1fff }, |
| 2367 | | { 0x2000, 0x3fff }, |
| 2368 | | { 0x4000, 0x5fff }, |
| 2369 | | { 0x6000, 0x7fff }, |
| 2370 | | { 0x8000, 0x9fff }, |
| 2371 | | { 0xa000, 0xbfff }, |
| 2372 | | { 0xc000, 0xdfff }, |
| 2373 | | { 0xe000, 0xfdff }, |
| 2374 | | { 0xfe00, 0xfeff } |
| 2375 | | }; |
| 2376 | | |
| 2377 | | address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM ); |
| 2378 | | int i, offset; |
| 2379 | | UINT8 *readbank = NULL; |
| 2380 | | UINT8 *cart_rom = cococart_device(machine)->get_cart_base(); |
| 2381 | | |
| 2382 | | char bank[10]; |
| 2383 | | |
| 2384 | | for (i = lowblock; i <= hiblock; i++) |
| 2385 | | { |
| 2386 | | sprintf(bank,"bank%d",i+1); |
| 2387 | | |
| 2388 | | offset = coco3_mmu_translate(machine, i, 0); |
| 2389 | | if (offset & 0x80000000) |
| 2390 | | { |
| 2391 | | /* an offset into the CoCo 3 ROM */ |
| 2392 | | if (offset & 0x8000) { |
| 2393 | | if (cart_rom) { |
| 2394 | | readbank = &cart_rom[offset & ~0x80008000]; |
| 2395 | | } |
| 2396 | | } |
| 2397 | | else |
| 2398 | | readbank = &state->m_rom[offset & ~0x80000000]; |
| 2399 | | space->unmap_write(bank_info[i].start, bank_info[i].end); |
| 2400 | | } |
| 2401 | | else |
| 2402 | | { |
| 2403 | | /* offset into normal RAM */ |
| 2404 | | readbank = &ram_get_ptr(machine.device(RAM_TAG))[offset]; |
| 2405 | | space->install_write_bank(bank_info[i].start, bank_info[i].end, bank); |
| 2406 | | } |
| 2407 | | |
| 2408 | | /* set up the banks */ |
| 2409 | | if (readbank) { |
| 2410 | | memory_set_bankptr(machine, bank, readbank); |
| 2411 | | } else { |
| 2412 | | space->unmap_read(bank_info[i].start, bank_info[i].end); |
| 2413 | | } |
| 2414 | | |
| 2415 | | if (LOG_MMU) |
| 2416 | | { |
| 2417 | | logerror("CoCo3 GIME MMU: Logical $%04x ==> Physical $%05x\n", |
| 2418 | | (i == 8) ? 0xfe00 : i * 0x2000, |
| 2419 | | offset); |
| 2420 | | } |
| 2421 | | } |
| 964 | // do nothing |
| 2422 | 965 | } |
| 2423 | 966 | |
| 2424 | 967 | |
| 2425 | 968 | |
| 2426 | | READ8_HANDLER(coco3_mmu_r) |
| 2427 | | { |
| 2428 | | coco3_state *state = space->machine().driver_data<coco3_state>(); |
| 2429 | | /* The high two bits are floating (high resistance). Therefore their |
| 2430 | | * value is undefined. But we are exposing them anyways here |
| 2431 | | */ |
| 2432 | | return state->m_mmu[offset]; |
| 2433 | | } |
| 969 | //------------------------------------------------- |
| 970 | // bitbanger_callback |
| 971 | //------------------------------------------------- |
| 2434 | 972 | |
| 2435 | | |
| 2436 | | |
| 2437 | | WRITE8_HANDLER(coco3_mmu_w) |
| 973 | WRITE_LINE_MEMBER( coco_state::bitbanger_callback ) |
| 2438 | 974 | { |
| 2439 | | coco3_state *state = space->machine().driver_data<coco3_state>(); |
| 2440 | | state->m_mmu[offset] = data; |
| 2441 | | |
| 2442 | | /* Did we modify the live MMU bank? */ |
| 2443 | | if ((offset >> 3) == (state->m_gimereg[1] & 1)) |
| 2444 | | { |
| 2445 | | offset &= 7; |
| 2446 | | coco3_mmu_update(space->machine(), offset, (offset == 7) ? 8 : offset); |
| 2447 | | } |
| 975 | bitbanger_changed(state ? true : false); |
| 2448 | 976 | } |
| 2449 | 977 | |
| 2450 | 978 | |
| 2451 | 979 | |
| 2452 | | /*************************************************************************** |
| 2453 | | GIME Registers (Reference: Super Extended Basic Unravelled) |
| 2454 | | ***************************************************************************/ |
| 980 | //------------------------------------------------- |
| 981 | // bitbanger_config |
| 982 | //------------------------------------------------- |
| 2455 | 983 | |
| 2456 | | READ8_HANDLER(coco3_gime_r) |
| 984 | const bitbanger_config coco_state::coco_bitbanger_config = |
| 2457 | 985 | { |
| 2458 | | coco3_state *state = space->machine().driver_data<coco3_state>(); |
| 2459 | | UINT8 result = 0; |
| 986 | DEVCB_DRIVER_LINE_MEMBER(coco_state, bitbanger_callback), /* callback */ |
| 987 | BITBANGER_PRINTER, /* default mode */ |
| 988 | BITBANGER_600, /* default output baud */ |
| 989 | BITBANGER_0PERCENT /* default fine tune adjustment */ |
| 990 | }; |
| 2460 | 991 | |
| 2461 | | switch(offset) { |
| 2462 | | case 2: /* Read pending IRQs */ |
| 2463 | | result = state->m_gime_irq; |
| 2464 | | if (result) { |
| 2465 | | state->m_gime_irq = 0; |
| 2466 | | coco3_recalc_irq(space->machine()); |
| 2467 | | } |
| 2468 | | break; |
| 2469 | 992 | |
| 2470 | | case 3: /* Read pending FIRQs */ |
| 2471 | | result = state->m_gime_firq; |
| 2472 | | if (result) { |
| 2473 | | state->m_gime_firq = 0; |
| 2474 | | coco3_recalc_firq(space->machine()); |
| 2475 | | } |
| 2476 | | break; |
| 2477 | 993 | |
| 2478 | | case 4: /* Timer MSB/LSB; these arn't readable */ |
| 2479 | | case 5: |
| 2480 | | /* JK tells me that these values are indeterminate; and $7E appears |
| 2481 | | * to be the value most commonly returned |
| 2482 | | */ |
| 2483 | | result = 0x7e; |
| 2484 | | break; |
| 994 | //------------------------------------------------- |
| 995 | // poll_hires_joystick |
| 996 | //------------------------------------------------- |
| 2485 | 997 | |
| 2486 | | default: |
| 2487 | | result = state->m_gimereg[offset]; |
| 2488 | | break; |
| 2489 | | } |
| 2490 | | return result; |
| 2491 | | } |
| 2492 | | |
| 2493 | | |
| 2494 | | |
| 2495 | | WRITE8_HANDLER(coco3_gime_w) |
| 998 | void coco_state::poll_hires_joystick(void) |
| 2496 | 999 | { |
| 2497 | | coco3_state *state = space->machine().driver_data<coco3_state>(); |
| 2498 | | /* take note if timer was $0000; see $FF95 for details */ |
| 2499 | | int timer_was_off = (state->m_gimereg[4] == 0x00) && (state->m_gimereg[5] == 0x00); |
| 2500 | | state->m_gimereg[offset] = data; |
| 1000 | bool newvalue; |
| 1001 | bool is_cocomax3; |
| 1002 | int joystick_index, axis; |
| 2501 | 1003 | |
| 2502 | | if (LOG_GIME) |
| 2503 | | logerror("CoCo3 GIME: $%04x <== $%02x pc=$%04x\n", offset + 0xff90, data, cpu_get_pc(&space->device())); |
| 2504 | | |
| 2505 | | /* Features marked with '!' are not yet implemented */ |
| 2506 | | switch(offset) |
| 1004 | /* we do different things based on the type of hires interface */ |
| 1005 | switch(hires_interface_type()) |
| 2507 | 1006 | { |
| 2508 | | case 0: |
| 2509 | | /* $FF90 Initialization register 0 |
| 2510 | | * Bit 7 COCO 1=CoCo compatible mode |
| 2511 | | * Bit 6 MMUEN 1=MMU enabled |
| 2512 | | * Bit 5 IEN 1 = GIME chip IRQ enabled |
| 2513 | | * Bit 4 FEN 1 = GIME chip FIRQ enabled |
| 2514 | | * Bit 3 MC3 1 = RAM at FEXX is constant |
| 2515 | | * Bit 2 MC2 1 = standard SCS (Spare Chip Select) |
| 2516 | | * Bit 1 MC1 ROM map control |
| 2517 | | * Bit 0 MC0 ROM map control |
| 2518 | | */ |
| 2519 | | coco3_mmu_update(space->machine(), 0, 8); |
| 2520 | | { |
| 2521 | | if (state->m_gimereg[0] & 0x04) |
| 2522 | | { |
| 2523 | | space->install_read_handler (0xFF40, 0xFF5F, read8_delegate (FUNC(cococart_slot_device::read), cococart_device(space->machine()))); |
| 2524 | | space->install_write_handler(0xFF40, 0xFF5F, write8_delegate(FUNC(cococart_slot_device::write),cococart_device(space->machine()))); |
| 2525 | | } |
| 2526 | | else |
| 2527 | | { |
| 2528 | | space->nop_readwrite(0xFF40, 0xFF5F); |
| 2529 | | } |
| 2530 | | } |
| 1007 | case HIRES_RIGHT: |
| 1008 | newvalue = (m_pia_0->a_output() & 0x04); |
| 1009 | joystick_index = 0; |
| 1010 | is_cocomax3 = false; |
| 2531 | 1011 | break; |
| 2532 | 1012 | |
| 2533 | | case 1: |
| 2534 | | /* $FF91 Initialization register 1 |
| 2535 | | * Bit 7 Unused |
| 2536 | | * Bit 6 Unused |
| 2537 | | * Bit 5 TINS Timer input select; 1 = 280 nsec, 0 = 63.5 usec |
| 2538 | | * Bit 4 Unused |
| 2539 | | * Bit 3 Unused |
| 2540 | | * Bit 2 Unused |
| 2541 | | * Bit 1 Unused |
| 2542 | | * Bit 0 TR Task register select |
| 2543 | | */ |
| 2544 | | coco3_mmu_update(space->machine(), 0, 8); |
| 2545 | | coco3_timer_reset(space->machine()); |
| 1013 | case HIRES_RIGHT_COCOMAX3: |
| 1014 | newvalue = (dac_output() >= 0x20); |
| 1015 | joystick_index = 0; |
| 1016 | is_cocomax3 = true; |
| 2546 | 1017 | break; |
| 2547 | 1018 | |
| 2548 | | case 2: |
| 2549 | | /* $FF92 Interrupt request enable register |
| 2550 | | * Bit 7 Unused |
| 2551 | | * Bit 6 Unused |
| 2552 | | * Bit 5 TMR Timer interrupt |
| 2553 | | * Bit 4 HBORD Horizontal border interrupt |
| 2554 | | * Bit 3 VBORD Vertical border interrupt |
| 2555 | | * ! Bit 2 EI2 Serial data interrupt |
| 2556 | | * Bit 1 EI1 Keyboard interrupt |
| 2557 | | * Bit 0 EI0 Cartridge interrupt |
| 2558 | | */ |
| 2559 | | if (LOG_INT_MASKING) |
| 2560 | | { |
| 2561 | | logerror("CoCo3 IRQ: Interrupts { %s%s%s%s%s%s} enabled\n", |
| 2562 | | (data & 0x20) ? "TMR " : "", |
| 2563 | | (data & 0x10) ? "HBORD " : "", |
| 2564 | | (data & 0x08) ? "VBORD " : "", |
| 2565 | | (data & 0x04) ? "EI2 " : "", |
| 2566 | | (data & 0x02) ? "EI1 " : "", |
| 2567 | | (data & 0x01) ? "EI0 " : ""); |
| 2568 | | } |
| 2569 | | cococart_device(space->machine())->twiddle_q_lines(); |
| 1019 | case HIRES_LEFT: |
| 1020 | newvalue = (m_pia_0->a_output() & 0x08); |
| 1021 | joystick_index = 1; |
| 1022 | is_cocomax3 = false; |
| 2570 | 1023 | break; |
| 2571 | 1024 | |
| 2572 | | case 3: |
| 2573 | | /* $FF93 Fast interrupt request enable register |
| 2574 | | * Bit 7 Unused |
| 2575 | | * Bit 6 Unused |
| 2576 | | * Bit 5 TMR Timer interrupt |
| 2577 | | * Bit 4 HBORD Horizontal border interrupt |
| 2578 | | * Bit 3 VBORD Vertical border interrupt |
| 2579 | | * ! Bit 2 EI2 Serial border interrupt |
| 2580 | | * Bit 1 EI1 Keyboard interrupt |
| 2581 | | * Bit 0 EI0 Cartridge interrupt |
| 2582 | | */ |
| 2583 | | if (LOG_INT_MASKING) |
| 2584 | | { |
| 2585 | | logerror("CoCo3 FIRQ: Interrupts { %s%s%s%s%s%s} enabled\n", |
| 2586 | | (data & 0x20) ? "TMR " : "", |
| 2587 | | (data & 0x10) ? "HBORD " : "", |
| 2588 | | (data & 0x08) ? "VBORD " : "", |
| 2589 | | (data & 0x04) ? "EI2 " : "", |
| 2590 | | (data & 0x02) ? "EI1 " : "", |
| 2591 | | (data & 0x01) ? "EI0 " : ""); |
| 2592 | | } |
| 2593 | | cococart_device(space->machine())->twiddle_q_lines(); |
| 1025 | case HIRES_LEFT_COCOMAX3: |
| 1026 | newvalue = (dac_output() >= 0x20); |
| 1027 | joystick_index = 1; |
| 1028 | is_cocomax3 = true; |
| 2594 | 1029 | break; |
| 2595 | 1030 | |
| 2596 | | case 4: |
| 2597 | | /* $FF94 Timer register MSB |
| 2598 | | * Bits 4-7 Unused |
| 2599 | | * Bits 0-3 High order four bits of the timer |
| 2600 | | */ |
| 2601 | | coco3_timer_reset(space->machine()); |
| 1031 | default: |
| 1032 | newvalue = true; |
| 1033 | joystick_index = -1; |
| 1034 | is_cocomax3 = false; |
| 2602 | 1035 | break; |
| 1036 | } |
| 2603 | 1037 | |
| 2604 | | case 5: |
| 2605 | | /* $FF95 Timer register LSB |
| 2606 | | * Bits 0-7 Low order eight bits of the timer |
| 2607 | | */ |
| 2608 | | if (timer_was_off && (state->m_gimereg[5] != 0x00)) |
| 2609 | | { |
| 2610 | | /* Writes to $FF95 do not cause the timer to reset, but MESS |
| 2611 | | * will invoke coco3_timer_reset() if $FF94/5 was previously |
| 2612 | | * $0000. The reason for this is because the timer is not |
| 2613 | | * actually off when $FF94/5 are loaded with $0000; rather it |
| 2614 | | * is continuously reloading the GIME's internal countdown |
| 2615 | | * register, even if it isn't causing interrupts to be raised. |
| 2616 | | * |
| 2617 | | * Failure to do this was the cause of bug #1065. Special |
| 2618 | | * thanks to John Kowalski for pointing me in the right |
| 2619 | | * direction |
| 2620 | | */ |
| 2621 | | coco3_timer_reset(space->machine()); |
| 2622 | | } |
| 2623 | | break; |
| 1038 | /* if the joystick isn't selected, newvalue is true */ |
| 1039 | newvalue = newvalue || (joystick_index < 0) || (joystick_type(joystick_index) != JOYSTICK_NORMAL); |
| 2624 | 1040 | |
| 2625 | | case 8: |
| 2626 | | /* $FF98 Video Mode Register |
| 2627 | | * Bit 7 BP 0 = Text modes, 1 = Graphics modes |
| 2628 | | * Bit 6 Unused |
| 2629 | | * ! Bit 5 BPI Burst Phase Invert (Color Set) |
| 2630 | | * Bit 4 MOCH 1 = Monochrome on Composite |
| 2631 | | * ! Bit 3 H50 1 = 50 Hz power, 0 = 60 Hz power |
| 2632 | | * Bits 0-2 LPR Lines per row |
| 2633 | | */ |
| 2634 | | break; |
| 2635 | | |
| 2636 | | case 9: |
| 2637 | | /* $FF99 Video Resolution Register |
| 2638 | | * Bit 7 Undefined |
| 2639 | | * Bits 5-6 LPF Lines per Field (Number of Rows) |
| 2640 | | * Bits 2-4 HRES Horizontal Resolution |
| 2641 | | * Bits 0-1 CRES Color Resolution |
| 2642 | | */ |
| 2643 | | break; |
| 2644 | | |
| 2645 | | case 10: |
| 2646 | | /* $FF9A Border Register |
| 2647 | | * Bits 6,7 Unused |
| 2648 | | * Bits 0-5 BRDR Border color |
| 2649 | | */ |
| 2650 | | break; |
| 2651 | | |
| 2652 | | case 12: |
| 2653 | | /* $FF9C Vertical Scroll Register |
| 2654 | | * Bits 4-7 Reserved |
| 2655 | | * ! Bits 0-3 VSC Vertical Scroll bits |
| 2656 | | */ |
| 2657 | | break; |
| 2658 | | |
| 2659 | | case 11: |
| 2660 | | case 13: |
| 2661 | | case 14: |
| 2662 | | /* $FF9B,$FF9D,$FF9E Vertical Offset Registers |
| 2663 | | * |
| 2664 | | * According to JK, if an odd value is placed in $FF9E on the 1986 |
| 2665 | | * GIME, the GIME crashes |
| 2666 | | * |
| 2667 | | * The reason that $FF9B is not mentioned in offical documentation |
| 2668 | | * is because it is only meaninful in CoCo 3's with the 2MB upgrade |
| 2669 | | */ |
| 2670 | | break; |
| 2671 | | |
| 2672 | | case 15: |
| 2673 | | /* |
| 2674 | | * $FF9F Horizontal Offset Register |
| 2675 | | * Bit 7 HVEN Horizontal Virtual Enable |
| 2676 | | * Bits 0-6 X0-X6 Horizontal Offset Address |
| 2677 | | * |
| 2678 | | * Unline $FF9D-E, this value can be modified mid frame |
| 2679 | | */ |
| 2680 | | break; |
| 1041 | /* make the transition */ |
| 1042 | for (axis = 0; axis <= 1; axis++) |
| 1043 | { |
| 1044 | if (m_hiresjoy_ca && !newvalue) |
| 1045 | { |
| 1046 | /* hi to lo */ |
| 1047 | double value = m_joystick.input(joystick_index, axis) / 255.0; |
| 1048 | value *= is_cocomax3 ? 2500.0 : 4160.0; |
| 1049 | value += is_cocomax3 ? 400.0 : 592.0; |
| 1050 | attotime duration = m_maincpu->clocks_to_attotime((UINT64) value); |
| 1051 | m_hiresjoy_transition_timer[axis]->adjust(duration); |
| 1052 | } |
| 1053 | else if (!m_hiresjoy_ca && newvalue) |
| 1054 | { |
| 1055 | /* lo to hi */ |
| 1056 | m_hiresjoy_transition_timer[axis]->reset(); |
| 1057 | } |
| 2681 | 1058 | } |
| 1059 | m_hiresjoy_ca = newvalue; |
| 2682 | 1060 | } |
| 2683 | 1061 | |
| 2684 | 1062 | |
| 2685 | 1063 | |
| 2686 | | static SAM6883_GET_RAMBASE( coco3_sam_get_rambase ) |
| 2687 | | { |
| 2688 | | UINT32 video_base; |
| 2689 | | video_base = coco3_get_video_base(device->machine(), 0xE0, 0x3F); |
| 2690 | | return &ram_get_ptr(device->machine().device(RAM_TAG))[video_base % ram_get_size(device->machine().device(RAM_TAG))]; |
| 2691 | | } |
| 2692 | | |
| 2693 | | |
| 2694 | | |
| 2695 | | |
| 2696 | | static SAM6883_SET_MAP_TYPE( coco3_sam_set_maptype ) |
| 2697 | | { |
| 2698 | | coco3_state *state = device->machine().driver_data<coco3_state>(); |
| 2699 | | state->m_enable_64k = val; |
| 2700 | | coco3_mmu_update(device->machine(), 4, 8); |
| 2701 | | } |
| 2702 | | |
| 2703 | | |
| 2704 | | |
| 2705 | 1064 | /*************************************************************************** |
| 2706 | | CARTRIDGE EXPANSION SLOT |
| 1065 | VHD |
| 1066 | ***************************************************************************/ |
| 2707 | 1067 | |
| 2708 | | The bulk of the cartridge handling is in cococart.c and related code, |
| 2709 | | whereas this interfaces with the main CoCo emulation. This code also |
| 2710 | | implements the hacks required to simulate the state where a CoCo |
| 2711 | | cartridge ties the CART line to Q, which cannot be emulated by |
| 2712 | | conventional techniques. |
| 1068 | //------------------------------------------------- |
| 1069 | // ff60_read |
| 1070 | //------------------------------------------------- |
| 2713 | 1071 | |
| 2714 | | When the CART line is set to Q, we begin a "twiddle" session - |
| 2715 | | specifically the CART line is toggled on and off twice to ensure that |
| 2716 | | if the PIA is accepting an interrupt, that it will receive it. We also |
| 2717 | | start twiddle sessions when CART is set to Q and the PIA is written to, |
| 2718 | | in order to pick up any interrupt enables that might happen |
| 2719 | | ***************************************************************************/ |
| 2720 | | |
| 2721 | | /*------------------------------------------------- |
| 2722 | | coco_cart_w - call for CART line |
| 2723 | | -------------------------------------------------*/ |
| 2724 | | |
| 2725 | | WRITE_LINE_DEVICE_HANDLER(coco_cart_w) |
| 1072 | READ8_MEMBER( coco_state::ff60_read ) |
| 2726 | 1073 | { |
| 2727 | | coco_state *st = device->machine().driver_data<coco_state>(); |
| 2728 | | st->m_pia_1->cb1_w(state ? ASSERT_LINE : CLEAR_LINE); |
| 2729 | | } |
| 1074 | UINT8 result = 0x00; |
| 2730 | 1075 | |
| 1076 | if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37)) |
| 1077 | { |
| 1078 | result = m_vhd->read(offset - 32); |
| 1079 | } |
| 2731 | 1080 | |
| 2732 | | /*------------------------------------------------- |
| 2733 | | coco3_cart_w - calls coco_cart_w and |
| 2734 | | in addition will raise the GIME interrupt |
| 2735 | | -------------------------------------------------*/ |
| 2736 | | |
| 2737 | | WRITE_LINE_DEVICE_HANDLER(coco3_cart_w) |
| 2738 | | { |
| 2739 | | coco3_raise_interrupt(device->machine(), COCO3_INT_EI0, state ? ASSERT_LINE : CLEAR_LINE); |
| 2740 | | coco_cart_w(device, state); |
| 1081 | return 0; |
| 2741 | 1082 | } |
| 2742 | 1083 | |
| 2743 | 1084 | |
| 2744 | 1085 | |
| 2745 | | /*------------------------------------------------- |
| 2746 | | coco_halt_w - sets the HALT line |
| 2747 | | -------------------------------------------------*/ |
| 1086 | //------------------------------------------------- |
| 1087 | // ff60_write |
| 1088 | //------------------------------------------------- |
| 2748 | 1089 | |
| 2749 | | WRITE_LINE_DEVICE_HANDLER(coco_halt_w) |
| 1090 | WRITE8_MEMBER( coco_state::ff60_write ) |
| 2750 | 1091 | { |
| 2751 | | cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); |
| 2752 | | } |
| 2753 | | |
| 2754 | | |
| 2755 | | |
| 2756 | | /*------------------------------------------------- |
| 2757 | | coco_nmi_w - sets the NMI |
| 2758 | | -------------------------------------------------*/ |
| 2759 | | |
| 2760 | | WRITE_LINE_DEVICE_HANDLER(coco_nmi_w) |
| 2761 | | { |
| 2762 | | cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); |
| 2763 | | } |
| 2764 | | |
| 2765 | | |
| 2766 | | |
| 2767 | | /*------------------------------------------------- |
| 2768 | | coco_pia_1_w - wrapper for pia_1_w() that will |
| 2769 | | also call twiddle Q lines, if necessary |
| 2770 | | -------------------------------------------------*/ |
| 2771 | | |
| 2772 | | WRITE8_DEVICE_HANDLER(coco_pia_1_w) |
| 2773 | | { |
| 2774 | | downcast<pia6821_device *>(device)->write(*memory_nonspecific_space(device->machine()), offset, data); |
| 2775 | | cococart_device(device->machine())->twiddle_q_lines(); |
| 2776 | | } |
| 2777 | | |
| 2778 | | |
| 2779 | | |
| 2780 | | /***************************************************************************/ |
| 2781 | | |
| 2782 | | /* struct to hold callbacks and initializers to pass to generic_init_machine */ |
| 2783 | | typedef struct _machine_init_interface machine_init_interface; |
| 2784 | | struct _machine_init_interface |
| 2785 | | { |
| 2786 | | timer_expired_func recalc_interrupts_; /* recalculate inturrupts callback */ |
| 2787 | | void (*printer_out_)(running_machine &machine, int data); /* printer output callback */ |
| 2788 | | }; |
| 2789 | | |
| 2790 | | |
| 2791 | | |
| 2792 | | /* New generic_init_machine, this sets up the the machine parameters common to all machines in */ |
| 2793 | | /* the CoCo and Dragon families, it has been modified to accept a single structure of type */ |
| 2794 | | /* machine_init_interface, which makes the init code a little clearer */ |
| 2795 | | /* Note sam initialization has been moved to generic_coco12_dragon_init, as it is now identical */ |
| 2796 | | /* for everything except the coco3, so it made sense not to pass it as a parameter */ |
| 2797 | | static void generic_init_machine(running_machine &machine, const machine_init_interface *init) |
| 2798 | | { |
| 2799 | | coco_state *state = (coco_state *) machine.driver_data<coco_state>(); |
| 2800 | | |
| 2801 | | /* locate devices */ |
| 2802 | | state->m_cococart_device = machine.device<cococart_slot_device>("ext"); |
| 2803 | | state->m_cassette_device = machine.device<cassette_image_device>(CASSETTE_TAG); |
| 2804 | | state->m_bitbanger_device = machine.device("bitbanger"); |
| 2805 | | state->m_printer_device = machine.device<printer_image_device>("printer"); |
| 2806 | | state->m_dac = machine.device("dac"); |
| 2807 | | state->m_sam = machine.device("sam"); |
| 2808 | | state->m_pia_0 = machine.device<pia6821_device>("pia_0"); |
| 2809 | | state->m_pia_1 = machine.device<pia6821_device>("pia_1"); |
| 2810 | | state->m_pia_2 = machine.device<pia6821_device>("pia_2"); |
| 2811 | | |
| 2812 | | /* clear static variables */ |
| 2813 | | state->m_hiresjoy_ca = 1; |
| 2814 | | state->m_hiresjoy_xtransitiontime = attotime::zero; |
| 2815 | | state->m_hiresjoy_ytransitiontime = attotime::zero; |
| 2816 | | |
| 2817 | | /* set up function pointers */ |
| 2818 | | state->update_keyboard = coco_update_keyboard; |
| 2819 | | state->m_recalc_interrupts = init->recalc_interrupts_; |
| 2820 | | |
| 2821 | | /* this timer is used to schedule keyboard updating */ |
| 2822 | | state->m_update_keyboard_timer = machine.scheduler().timer_alloc(FUNC(coco_m_update_keyboard_timerproc)); |
| 2823 | | |
| 2824 | | /* these are the timers to delay the MUX switching */ |
| 2825 | | state->m_mux_sel1_timer = machine.scheduler().timer_alloc(FUNC(coco_update_sel1_timerproc)); |
| 2826 | | state->m_mux_sel2_timer = machine.scheduler().timer_alloc(FUNC(coco_update_sel2_timerproc)); |
| 2827 | | |
| 2828 | | /* setup ROM */ |
| 2829 | | state->m_rom = machine.region("maincpu")->base(); |
| 2830 | | |
| 2831 | | /* setup default rom bank */ |
| 2832 | | state->m_bas_rom_bank = state->m_rom; |
| 2833 | | |
| 2834 | | /* setup default pointer for botom 32K of ram */ |
| 2835 | | state->m_bottom_32k = ram_get_ptr(machine.device(RAM_TAG)); |
| 2836 | | |
| 2837 | | /* setup printer output callback */ |
| 2838 | | state->printer_out = init->printer_out_; |
| 2839 | | if (machine.device<cpu_device>("maincpu")->debug()) { |
| 2840 | | machine.device<cpu_device>("maincpu")->debug()->set_dasm_override(coco_dasm_override); |
| 1092 | if ((m_vhd != NULL) && (offset >= 32) && (offset <= 37)) |
| 1093 | { |
| 1094 | m_vhd->write(offset - 32, data); |
| 2841 | 1095 | } |
| 2842 | | |
| 2843 | | /* setup printer input line to "space", this is what a Tandy printer would do */ |
| 2844 | | state->m_bitbanger_output_value = 1; |
| 2845 | | state->m_bitbanger_input_value = 0; |
| 2846 | | state->m_dac_value = 0; |
| 2847 | | |
| 2848 | | state->save_item(NAME(state->m_mux_sel1)); |
| 2849 | | state->save_item(NAME(state->m_mux_sel2)); |
| 2850 | 1096 | } |
| 2851 | 1097 | |
| 2852 | | /* Setup for hardware common to CoCo 1/2 & Dragon machines, calls genertic_init_machine, to process */ |
| 2853 | | /* the setup common with the CoCo3, and then does the init that is not common ! */ |
| 2854 | | static void generic_coco12_dragon_init(running_machine &machine, const machine_init_interface *init) |
| 2855 | | { |
| 2856 | | /* Set default RAM mapping */ |
| 2857 | | memory_set_bankptr(machine, "bank1", &ram_get_ptr(machine.device(RAM_TAG))[0]); |
| 2858 | 1098 | |
| 2859 | | /* Do generic Inits */ |
| 2860 | | generic_init_machine(machine, init); |
| 2861 | | } |
| 2862 | 1099 | |
| 2863 | | /******* Lightgun Setup **********/ |
| 1100 | /*************************************************************************** |
| 1101 | CARTRIDGE & CASSETTE |
| 1102 | ***************************************************************************/ |
| 2864 | 1103 | |
| 2865 | | static void update_lightgun( running_machine &machine ) |
| 2866 | | { |
| 2867 | | /* is there a Diecom Light Gun either in Left or in Right Port? */ |
| 2868 | | UINT8 ctrl = input_port_read_safe(machine, "ctrl_sel", 0x00); |
| 2869 | | int is_lightgun = ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30) ? 1 :0; |
| 1104 | //------------------------------------------------- |
| 1105 | // ff40_read |
| 1106 | //------------------------------------------------- |
| 2870 | 1107 | |
| 2871 | | crosshair_set_screen(machine, 0, is_lightgun ? CROSSHAIR_SCREEN_ALL : CROSSHAIR_SCREEN_NONE); |
| 2872 | | } |
| 2873 | | |
| 2874 | | INPUT_CHANGED( coco_joystick_mode_changed ) |
| 1108 | READ8_MEMBER( coco_state::ff40_read ) |
| 2875 | 1109 | { |
| 2876 | | update_lightgun(field.machine()); |
| 1110 | return m_cococart->read(space, offset, mem_mask); |
| 2877 | 1111 | } |
| 2878 | 1112 | |
| 2879 | | static TIMER_CALLBACK( update_lightgun_timer_callback ) |
| 2880 | | { |
| 2881 | | update_lightgun(machine); |
| 2882 | | } |
| 2883 | 1113 | |
| 2884 | | /******* Machine Setups Dragons **********/ |
| 2885 | 1114 | |
| 2886 | | MACHINE_START( dragon32 ) |
| 2887 | | { |
| 2888 | | machine_init_interface init; |
| 1115 | //------------------------------------------------- |
| 1116 | // ff40_write |
| 1117 | //------------------------------------------------- |
| 2889 | 1118 | |
| 2890 | | /* Setup machine initialization */ |
| 2891 | | memset(&init, 0, sizeof(init)); |
| 2892 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2893 | | init.printer_out_ = printer_out_dragon; |
| 2894 | | |
| 2895 | | generic_coco12_dragon_init(machine, &init); |
| 2896 | | |
| 2897 | | /* need to specify lightgun crosshairs */ |
| 2898 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 2899 | | } |
| 2900 | | |
| 2901 | | MACHINE_START( dragon64 ) |
| 1119 | WRITE8_MEMBER( coco_state::ff40_write ) |
| 2902 | 1120 | { |
| 2903 | | machine_init_interface init; |
| 2904 | | |
| 2905 | | /* Setup machine initialization */ |
| 2906 | | memset(&init, 0, sizeof(init)); |
| 2907 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2908 | | init.printer_out_ = printer_out_dragon; |
| 2909 | | |
| 2910 | | generic_coco12_dragon_init(machine, &init); |
| 2911 | | |
| 2912 | | /* need to specify lightgun crosshairs */ |
| 2913 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 1121 | m_cococart->write(space, offset, data, mem_mask); |
| 2914 | 1122 | } |
| 2915 | 1123 | |
| 2916 | | MACHINE_START( tanodr64 ) |
| 2917 | | { |
| 2918 | | machine_init_interface init; |
| 2919 | 1124 | |
| 2920 | | /* Setup machine initialization */ |
| 2921 | | memset(&init, 0, sizeof(init)); |
| 2922 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2923 | | init.printer_out_ = printer_out_dragon; |
| 2924 | 1125 | |
| 2925 | | generic_coco12_dragon_init(machine, &init); |
| 1126 | //------------------------------------------------- |
| 1127 | // cart_w |
| 1128 | //------------------------------------------------- |
| 2926 | 1129 | |
| 2927 | | /* need to specify lightgun crosshairs */ |
| 2928 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 2929 | | } |
| 2930 | | |
| 2931 | | MACHINE_START( dgnalpha ) |
| 1130 | void coco_state::cart_w(bool state) |
| 2932 | 1131 | { |
| 2933 | | machine_init_interface init; |
| 2934 | | |
| 2935 | | /* Setup machine initialization */ |
| 2936 | | memset(&init, 0, sizeof(init)); |
| 2937 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2938 | | init.printer_out_ = printer_out_dragon; |
| 2939 | | |
| 2940 | | generic_coco12_dragon_init(machine, &init); |
| 2941 | | |
| 2942 | | /* need to specify lightgun crosshairs */ |
| 2943 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 1132 | m_pia_1->cb1_w(state); |
| 2944 | 1133 | } |
| 2945 | 1134 | |
| 2946 | | MACHINE_RESET( dgnalpha ) |
| 2947 | | { |
| 2948 | | coco_state *state = machine.driver_data<coco_state>(); |
| 2949 | | // device_t *fdc = machine.device("wd2797"); |
| 2950 | | // wd17xx_set_complete_command_delay(fdc,20); |
| 2951 | 1135 | |
| 2952 | | /* state->m_dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */ |
| 2953 | | /* by the WD2797, it is reset to 0 after the first inurrupt */ |
| 2954 | | state->m_dgnalpha_just_reset=1; |
| 2955 | 1136 | |
| 2956 | | /* need to specify lightgun crosshairs */ |
| 2957 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 2958 | | } |
| 1137 | //------------------------------------------------- |
| 1138 | // cartridge_config |
| 1139 | //------------------------------------------------- |
| 2959 | 1140 | |
| 2960 | | const wd17xx_interface dgnalpha_wd17xx_interface = |
| 1141 | const cococart_interface coco_state::cartridge_config = |
| 2961 | 1142 | { |
| 2962 | | DEVCB_NULL, |
| 2963 | | DEVCB_LINE(dgnalpha_fdc_intrq_w), |
| 2964 | | DEVCB_LINE(dgnalpha_fdc_drq_w), |
| 2965 | | {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} |
| 1143 | DEVCB_DRIVER_LINE_MEMBER(coco_state, cart_w), // coco_cart_w, |
| 1144 | DEVCB_CPU_INPUT_LINE(MAINCPU_TAG, INPUT_LINE_NMI), // coco_nmi_w, |
| 1145 | DEVCB_CPU_INPUT_LINE(MAINCPU_TAG, INPUT_LINE_HALT) // coco_halt_w |
| 2966 | 1146 | }; |
| 2967 | 1147 | |
| 2968 | | /******* Machine Setups CoCos **********/ |
| 2969 | 1148 | |
| 2970 | | MACHINE_START( coco ) |
| 2971 | | { |
| 2972 | | machine_init_interface init; |
| 1149 | //------------------------------------------------- |
| 1150 | // coco_cassette_interface |
| 1151 | //------------------------------------------------- |
| 2973 | 1152 | |
| 2974 | | /* Setup machine initialization */ |
| 2975 | | memset(&init, 0, sizeof(init)); |
| 2976 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2977 | | init.printer_out_ = printer_out_coco; |
| 2978 | | |
| 2979 | | generic_coco12_dragon_init(machine, &init); |
| 2980 | | |
| 2981 | | /* need to specify lightgun crosshairs */ |
| 2982 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 2983 | | } |
| 2984 | | |
| 2985 | | MACHINE_START( coco2 ) |
| 1153 | const cassette_interface coco_state::coco_cassette_interface = |
| 2986 | 1154 | { |
| 2987 | | machine_init_interface init; |
| 1155 | coco_cassette_formats, |
| 1156 | NULL, |
| 1157 | (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED), |
| 1158 | NULL, |
| 1159 | NULL |
| 1160 | }; |
| 2988 | 1161 | |
| 2989 | | /* Setup machine initialization */ |
| 2990 | | memset(&init, 0, sizeof(init)); |
| 2991 | | init.recalc_interrupts_ = d_recalc_interrupts; |
| 2992 | | init.printer_out_ = printer_out_coco; |
| 2993 | 1162 | |
| 2994 | | generic_coco12_dragon_init(machine, &init); |
| 2995 | 1163 | |
| 2996 | | /* need to specify lightgun crosshairs */ |
| 2997 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 2998 | | } |
| 2999 | | |
| 3000 | | MACHINE_RESET( coco3 ) |
| 3001 | | { |
| 3002 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 3003 | | int i; |
| 3004 | | |
| 3005 | | /* Tepolt verifies that the GIME registers are all cleared on initialization */ |
| 3006 | | state->m_enable_64k = 0; |
| 3007 | | state->m_gime_irq = 0; |
| 3008 | | state->m_gime_firq = 0; |
| 3009 | | for (i = 0; i < 8; i++) |
| 3010 | | { |
| 3011 | | state->m_mmu[i] = state->m_mmu[i + 8] = 56 + i; |
| 3012 | | state->m_gimereg[i] = 0; |
| 3013 | | } |
| 3014 | | coco3_mmu_update(machine, 0, 8); |
| 3015 | | } |
| 3016 | | |
| 3017 | | static void coco3_state_postload(coco3_state *state) |
| 3018 | | { |
| 3019 | | coco3_mmu_update(state->machine(), 0, 8); |
| 3020 | | } |
| 3021 | | |
| 3022 | | MACHINE_START( coco3 ) |
| 3023 | | { |
| 3024 | | coco3_state *state = machine.driver_data<coco3_state>(); |
| 3025 | | machine_init_interface init; |
| 3026 | | |
| 3027 | | /* Setup machine initialization */ |
| 3028 | | memset(&init, 0, sizeof(init)); |
| 3029 | | init.recalc_interrupts_ = coco3_recalc_interrupts; |
| 3030 | | init.printer_out_ = printer_out_coco; |
| 3031 | | |
| 3032 | | generic_init_machine(machine, &init); |
| 3033 | | |
| 3034 | | /* CoCo 3 specific function pointers */ |
| 3035 | | state->update_keyboard = coco3_update_keyboard; |
| 3036 | | |
| 3037 | | coco3_timer_init(machine); |
| 3038 | | |
| 3039 | | state->m_interupt_line = 0; |
| 3040 | | |
| 3041 | | /* set up state save variables */ |
| 3042 | | state->save_item(NAME(state->m_mmu)); |
| 3043 | | state->save_item(NAME(state->m_gimereg)); |
| 3044 | | state->save_item(NAME(state->m_interupt_line)); |
| 3045 | | state->save_item(NAME(state->m_gime_irq)); |
| 3046 | | state->save_item(NAME(state->m_gime_firq)); |
| 3047 | | machine.save().register_postload(save_prepost_delegate(FUNC(coco3_state_postload), state)); |
| 3048 | | |
| 3049 | | /* need to specify lightgun crosshairs */ |
| 3050 | | machine.scheduler().timer_set(attotime::zero, FUNC(update_lightgun_timer_callback)); |
| 3051 | | } |
| 3052 | | |
| 3053 | | |
| 3054 | | |
| 3055 | 1164 | /*************************************************************************** |
| 3056 | | OS9 Syscalls for disassembly |
| 3057 | | ****************************************************************************/ |
| 1165 | DISASSEMBLY OVERRIDE (OS9 syscalls) |
| 1166 | ***************************************************************************/ |
| 3058 | 1167 | |
| 3059 | 1168 | static const char *const os9syscalls[] = |
| 3060 | 1169 | { |
| r13256 | r13257 | |
| 3206 | 1315 | }; |
| 3207 | 1316 | |
| 3208 | 1317 | |
| 3209 | | static offs_t coco_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) |
| 1318 | offs_t coco_state::dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) |
| 3210 | 1319 | { |
| 3211 | 1320 | unsigned call; |
| 3212 | 1321 | unsigned result = 0; |
| r13256 | r13257 | |
| 3215 | 1324 | if ((oprom[0] == 0x10) && (oprom[1] == 0x3F)) |
| 3216 | 1325 | { |
| 3217 | 1326 | call = oprom[2]; |
| 3218 | | if ((call < ARRAY_LENGTH(os9syscalls)) && os9syscalls[call]) |
| 1327 | if ((call >= 0) && (call < ARRAY_LENGTH(os9syscalls)) && os9syscalls[call]) |
| 3219 | 1328 | { |
| 3220 | 1329 | sprintf(buffer, "OS9 %s", os9syscalls[call]); |
| 3221 | 1330 | result = 3; |
src/mess/video/coco6847.c
| r13256 | r13257 | |
| 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 "emu.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 SCREEN_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 | | UINT32 saved_artifacting, saved_c0, saved_c1; |
| 151 | | UINT32 expanded_colors[128]; |
| 152 | | |
| 153 | | /* 2^7 modes, 256/16 character groups, background/foreground */ |
| 154 | | UINT8 colordata[128][256/16][2]; |
| 155 | | |
| 156 | | /* 2^7 modes, 256 characters, 12 scanlines */ |
| 157 | | UINT8 fontdata[128][256][12]; |
| 158 | | }; |
| 159 | | |
| 160 | | |
| 161 | | |
| 162 | | static void apply_artifacts(running_machine &machine, UINT32 *line); |
| 163 | | |
| 164 | | static m6847_vdg *m6847; |
| 165 | | |
| 166 | | |
| 167 | | static const UINT8 pal_round_fontdata8x12[] = |
| 168 | | { |
| 169 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 170 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 171 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 172 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 173 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 174 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 175 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 176 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 177 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 178 | | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 179 | | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 180 | | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 181 | | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 182 | | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 183 | | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 184 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 185 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 186 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 187 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 188 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 189 | | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 190 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 191 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 192 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 193 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 194 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 195 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 196 | | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 197 | | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 198 | | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 199 | | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 200 | | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 201 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 202 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 203 | | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 204 | | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 205 | | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 206 | | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 207 | | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 208 | | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 209 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 210 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 211 | | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 212 | | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 213 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 214 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 215 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 216 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 217 | | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 218 | | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 219 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 220 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 221 | | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 222 | | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 223 | | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 224 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 225 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 226 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 227 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 228 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 229 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 230 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 231 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 232 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 233 | | |
| 234 | | /* Lower case */ |
| 235 | | 0x00, 0x00, 0x18, 0x24, 0x20, 0x70, 0x20, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 236 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 237 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 238 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 239 | | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 240 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 241 | | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 242 | | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 243 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 244 | | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 245 | | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 246 | | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 247 | | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 248 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 249 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 250 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 251 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 252 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 253 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 254 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 255 | | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 256 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 257 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 258 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 259 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 260 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 261 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 262 | | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 263 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 264 | | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 265 | | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 266 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 267 | | |
| 268 | | /* Semigraphics 6 */ |
| 269 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 270 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 271 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 272 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 273 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 274 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 275 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 276 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 277 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 278 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 279 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 280 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 281 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 282 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 283 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 284 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 285 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 286 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 287 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 288 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 289 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 290 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 291 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 292 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 293 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 294 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 295 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 296 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 297 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 298 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 299 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 300 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 301 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 302 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 303 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 304 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 305 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 306 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 307 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 308 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 309 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 310 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 311 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 312 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 313 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 314 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 315 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 316 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 317 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 318 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 319 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 320 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 321 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 322 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 323 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 324 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 325 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 326 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 327 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 328 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 329 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 330 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 331 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 332 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 333 | | |
| 334 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 335 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 336 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 337 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 338 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 339 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 340 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 341 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 342 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 343 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 344 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 345 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 346 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 347 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 348 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 349 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 350 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 351 | | }; |
| 352 | | |
| 353 | | |
| 354 | | |
| 355 | | static const UINT8 pal_square_fontdata8x12[] = |
| 356 | | { |
| 357 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 358 | | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 359 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 360 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 361 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 362 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 363 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 364 | | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 365 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 366 | | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 367 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 368 | | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 369 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 370 | | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 371 | | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 372 | | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 373 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 374 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 375 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 376 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 377 | | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 378 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 379 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 380 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 381 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 382 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 383 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 384 | | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 385 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 386 | | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 387 | | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 388 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 389 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 390 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 391 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 392 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 393 | | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 394 | | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 395 | | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 396 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 397 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 398 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 399 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 400 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 401 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 402 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 403 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 404 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 405 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 406 | | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 407 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 408 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x0C, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 409 | | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 410 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 411 | | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 412 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 413 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 414 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 415 | | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 416 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 417 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 418 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 419 | | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 420 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 421 | | |
| 422 | | /* Lower case */ |
| 423 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 424 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 425 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 426 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 427 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 428 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 429 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 430 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 431 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 432 | | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 433 | | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 434 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 435 | | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 436 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 437 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 438 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 439 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 440 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 441 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 442 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 443 | | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 444 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 445 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 446 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 447 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 448 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 449 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 450 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 451 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 452 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 453 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 454 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 455 | | |
| 456 | | /* Semigraphics 6 */ |
| 457 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 458 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 459 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 460 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 461 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 462 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 463 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 464 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 465 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 466 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 467 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 468 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 469 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 470 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 471 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 472 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 473 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 474 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 475 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 476 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 477 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 478 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 479 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 480 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 481 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 482 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 483 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 484 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 485 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 486 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 487 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 488 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 489 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 490 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 491 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 492 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 493 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 494 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 495 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 496 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 497 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 498 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 499 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 500 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 501 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 502 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 503 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 504 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 505 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 506 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 507 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 508 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 509 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 510 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 511 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 512 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 513 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 514 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 515 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 516 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 517 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 518 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 519 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 520 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 521 | | |
| 522 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 523 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 524 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 525 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 526 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 527 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 528 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 529 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 530 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 531 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 532 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 533 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 534 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 535 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 536 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 537 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 538 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 539 | | }; |
| 540 | | |
| 541 | | |
| 542 | | |
| 543 | | static const UINT8 ntsc_round_fontdata8x12[] = |
| 544 | | { |
| 545 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 546 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 547 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 548 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 549 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 550 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 551 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 552 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 553 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 554 | | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 555 | | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 556 | | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 557 | | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 558 | | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 559 | | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 560 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 561 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 562 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 563 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 564 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 565 | | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 566 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 567 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 568 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 569 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 570 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 571 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 572 | | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 573 | | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 574 | | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 575 | | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 576 | | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 577 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 578 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 579 | | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 580 | | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 581 | | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 582 | | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 583 | | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 584 | | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 585 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 586 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 587 | | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 588 | | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 589 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 590 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 591 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 592 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 593 | | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 594 | | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 595 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 596 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 597 | | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 598 | | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 599 | | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 600 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 601 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 602 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 603 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 604 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 605 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 606 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 607 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 608 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 609 | | |
| 610 | | /* Lower case */ |
| 611 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 612 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 613 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 614 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 615 | | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 616 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 617 | | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 618 | | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 619 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 620 | | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 621 | | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 622 | | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 623 | | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 624 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 625 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 626 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 627 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 628 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 629 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 630 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 631 | | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 632 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 633 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 634 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 635 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 636 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 637 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 638 | | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 639 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 640 | | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 641 | | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 642 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 643 | | |
| 644 | | /* Semigraphics 6 */ |
| 645 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 646 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 647 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 648 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 649 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 650 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 651 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 652 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 653 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 654 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 655 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 656 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 657 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 658 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 659 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 660 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 661 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 662 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 663 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 664 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 665 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 666 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 667 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 668 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 669 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 670 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 671 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 672 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 673 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 674 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 675 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 676 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 677 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 678 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 679 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 680 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 681 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 682 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 683 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 684 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 685 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 686 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 687 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 688 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 689 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 690 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 691 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 692 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 693 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 694 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 695 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 696 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 697 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 698 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 699 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 700 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 701 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 702 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 703 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 704 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 705 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 706 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 707 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 708 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 709 | | |
| 710 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 711 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 712 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 713 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 714 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 715 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 716 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 717 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 718 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 719 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 720 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 721 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 722 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 723 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 724 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 725 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 726 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 727 | | }; |
| 728 | | |
| 729 | | |
| 730 | | |
| 731 | | static const UINT8 ntsc_square_fontdata8x12[] = |
| 732 | | { |
| 733 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 734 | | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 735 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 736 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 737 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 738 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 739 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 740 | | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 741 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 742 | | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 743 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 744 | | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 745 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 746 | | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 747 | | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 748 | | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 749 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 750 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 751 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 752 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 753 | | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 754 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 755 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 756 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 757 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 758 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 759 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 760 | | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 761 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 762 | | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 763 | | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 764 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 765 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 766 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 767 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 768 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 769 | | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 770 | | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 771 | | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 772 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 773 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 774 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 775 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 776 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 777 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 778 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 779 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 780 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 781 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 782 | | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 783 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 784 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x04, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 785 | | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 786 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 787 | | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 788 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 789 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 790 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 791 | | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 792 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 793 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 794 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 795 | | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 796 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 797 | | |
| 798 | | /* Lower case */ |
| 799 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 800 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 801 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 802 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 803 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 804 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 805 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 806 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 807 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 808 | | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 809 | | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 810 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 811 | | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 812 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 813 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 814 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 815 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 816 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 817 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 818 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 819 | | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 820 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 821 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 822 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 823 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 824 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 825 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 826 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 827 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 828 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 829 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 830 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 831 | | |
| 832 | | /* Semigraphics 6 */ |
| 833 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 834 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 835 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 836 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 837 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 838 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 839 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 840 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 841 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 842 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 843 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 844 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 845 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 846 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 847 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 848 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 849 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 850 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 851 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 852 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 853 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 854 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 855 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 856 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 857 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 858 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 859 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 860 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 861 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 862 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 863 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 864 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 865 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 866 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 867 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 868 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 869 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 870 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 871 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 872 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 873 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 874 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 875 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 876 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 877 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 878 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 879 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 880 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 881 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 882 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 883 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 884 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 885 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 886 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 887 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 888 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 889 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 890 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 891 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 892 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 893 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 894 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 895 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 896 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 897 | | |
| 898 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 899 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 900 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 901 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 902 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 903 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 904 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 905 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 906 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 907 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 908 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 909 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 910 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 911 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 912 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 913 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 914 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 915 | | }; |
| 916 | | |
| 917 | | |
| 918 | | |
| 919 | | enum |
| 920 | | { |
| 921 | | GREEN, YELLOW, BLUE, RED, /* 0 - 3 */ |
| 922 | | BUFF, CYAN, MAGENTA, ORANGE, /* 4 - 7 */ |
| 923 | | |
| 924 | | BLACK, /* 8 */ |
| 925 | | |
| 926 | | DKGREEN = 12, LTGREEN = 13, /* 12 - 13 */ |
| 927 | | DKORANGE = 14, LTORANGE = 15, /* 14 - 15 */ |
| 928 | | }; |
| 929 | | |
| 930 | | |
| 931 | | |
| 932 | | |
| 933 | | #define ATTOTIME_STRING_PRECISION 9 |
| 934 | | |
| 935 | | #define M6847_RGB(r,g,b) ((r << 16) | (g << 8) | (b << 0)) |
| 936 | | |
| 937 | | |
| 938 | | static const UINT32 palette[] = |
| 939 | | { |
| 940 | | M6847_RGB(0x00, 0xff, 0x00), /* GREEN */ |
| 941 | | M6847_RGB(0xff, 0xff, 0x00), /* YELLOW */ |
| 942 | | M6847_RGB(0x00, 0x00, 0xff), /* BLUE */ |
| 943 | | M6847_RGB(0xff, 0x00, 0x00), /* RED */ |
| 944 | | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 945 | | M6847_RGB(0x00, 0xff, 0xff), /* CYAN */ |
| 946 | | M6847_RGB(0xff, 0x00, 0xff), /* MAGENTA */ |
| 947 | | M6847_RGB(0xff, 0x80, 0x00), /* ORANGE */ |
| 948 | | |
| 949 | | M6847_RGB(0x00, 0x00, 0x00), /* BLACK */ |
| 950 | | M6847_RGB(0x00, 0xff, 0x00), /* GREEN */ |
| 951 | | M6847_RGB(0x00, 0x00, 0x00), /* BLACK */ |
| 952 | | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 953 | | |
| 954 | | M6847_RGB(0x00, 0x40, 0x00), /* ALPHANUMERIC DARK GREEN */ |
| 955 | | M6847_RGB(0x00, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */ |
| 956 | | M6847_RGB(0x40, 0x10, 0x00), /* ALPHANUMERIC DARK ORANGE */ |
| 957 | | M6847_RGB(0xff, 0xc4, 0x18) /* ALPHANUMERIC BRIGHT ORANGE */ |
| 958 | | }; |
| 959 | | |
| 960 | | |
| 961 | | |
| 962 | | #define FACTOR_SCANLINES_PER_FRAME 2 |
| 963 | | #define FACTOR_CLOCKS_PER_SCANLINE 2 |
| 964 | | |
| 965 | | #define GROSS_FACTOR (FACTOR_SCANLINES_PER_FRAME * FACTOR_CLOCKS_PER_SCANLINE) |
| 966 | | |
| 967 | | static const m6847_variant variants[] = |
| 968 | | { |
| 969 | | { |
| 970 | | /* M6847_VERSION_ORIGINAL_NTSC */ |
| 971 | | ntsc_square_fontdata8x12, |
| 972 | | FALSE, 0, |
| 973 | | 60, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 974 | | 13, 25, 192, 26, 6, |
| 975 | | 13+25+192 /* field sync period */ |
| 976 | | }, |
| 977 | | { |
| 978 | | /* M6847_VERSION_ORIGINAL_PAL */ |
| 979 | | pal_square_fontdata8x12, |
| 980 | | FALSE, 0, |
| 981 | | 50, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 982 | | 13, 25, 192, 26, 6, |
| 983 | | 13+25+192 /* field sync period */ |
| 984 | | }, |
| 985 | | { |
| 986 | | /* M6847_VERSION_M6847Y_NTSC */ |
| 987 | | ntsc_square_fontdata8x12, |
| 988 | | FALSE, 0, |
| 989 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 990 | | 13.5, 25, 192, 26, 6, |
| 991 | | 13+25+192 /* field sync period */ |
| 992 | | }, |
| 993 | | { |
| 994 | | /* M6847_VERSION_M6847Y_PAL */ |
| 995 | | pal_square_fontdata8x12, |
| 996 | | FALSE, 0, |
| 997 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 998 | | 13.5, 25, 192, 26, 6, |
| 999 | | 13+25+192 /* field sync period */ |
| 1000 | | }, |
| 1001 | | { |
| 1002 | | /* M6847_VERSION_M6847T1_NTSC */ |
| 1003 | | ntsc_round_fontdata8x12, |
| 1004 | | TRUE, 0, |
| 1005 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1006 | | 13.5, 25, 192, 26, 6, |
| 1007 | | 13+25+192 /* field sync period */ |
| 1008 | | }, |
| 1009 | | { |
| 1010 | | /* M6847_VERSION_M6847T1_PAL */ |
| 1011 | | pal_round_fontdata8x12, |
| 1012 | | TRUE, 0, |
| 1013 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1014 | | 13.5, 25, 192, 26, 6, |
| 1015 | | 13+25+192 /* field sync period */ |
| 1016 | | }, |
| 1017 | | { |
| 1018 | | /* M6847_VERSION_GIME_NTSC */ |
| 1019 | | ntsc_round_fontdata8x12, |
| 1020 | | TRUE, 1, |
| 1021 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1022 | | 13.5, 25, 192, 26, 6, |
| 1023 | | 262.5 - 3 /* field sync period */ |
| 1024 | | }, |
| 1025 | | { |
| 1026 | | /* M6847_VERSION_GIME_PAL */ |
| 1027 | | pal_round_fontdata8x12, |
| 1028 | | TRUE, 1, |
| 1029 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1030 | | 13.5, 25, 192, 26, 6, |
| 1031 | | 262.5 - 3 /* field sync period */ |
| 1032 | | } |
| 1033 | | }; |
| 1034 | | |
| 1035 | | |
| 1036 | | |
| 1037 | | /************************************* |
| 1038 | | * |
| 1039 | | * Utilities |
| 1040 | | * |
| 1041 | | *************************************/ |
| 1042 | | |
| 1043 | | static UINT32 color(int c) |
| 1044 | | { |
| 1045 | | return m6847->palette[c]; |
| 1046 | | } |
| 1047 | | |
| 1048 | | |
| 1049 | | |
| 1050 | | static int attr_index_from_attribute(UINT8 attr) |
| 1051 | | { |
| 1052 | | int result; |
| 1053 | | |
| 1054 | | result = ((attr & (M6847_AG | M6847_AS | M6847_INTEXT | M6847_INV | M6847_CSS)) >> 3) |
| 1055 | | | ((attr & (M6847_GM1 | M6847_GM0)) << 5); |
| 1056 | | |
| 1057 | | /* sanity check */ |
| 1058 | | assert(result < ARRAY_LENGTH(m6847->fontdata)); |
| 1059 | | return result; |
| 1060 | | } |
| 1061 | | |
| 1062 | | |
| 1063 | | |
| 1064 | | static UINT8 attribute_from_attr_index(int attr_index) |
| 1065 | | { |
| 1066 | | /* sanity check */ |
| 1067 | | assert(attr_index >= 0); |
| 1068 | | assert(attr_index < ARRAY_LENGTH(m6847->fontdata)); |
| 1069 | | |
| 1070 | | return (UINT8) ((attr_index & 0x1F) << 3) |
| 1071 | | | ((attr_index & 0x60) >> 5); |
| 1072 | | } |
| 1073 | | |
| 1074 | | |
| 1075 | | |
| 1076 | | /************************************* |
| 1077 | | * |
| 1078 | | * Video modes |
| 1079 | | * |
| 1080 | | *************************************/ |
| 1081 | | |
| 1082 | | static void graphics_color_64(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1083 | | { |
| 1084 | | int x; |
| 1085 | | UINT8 byte, attr; |
| 1086 | | |
| 1087 | | for (x = 0; x < 16; x++) |
| 1088 | | { |
| 1089 | | byte = video_data[x].data; |
| 1090 | | attr = video_data[x].attr; |
| 1091 | | |
| 1092 | | line[ 0] = line[ 1] = line[ 2] = line[ 3] = color(((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1093 | | line[ 4] = line[ 5] = line[ 6] = line[ 7] = color(((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1094 | | line[ 8] = line[ 9] = line[10] = line[11] = color(((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1095 | | line[12] = line[13] = line[14] = line[15] = color(((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1096 | | line += 16; |
| 1097 | | } |
| 1098 | | } |
| 1099 | | |
| 1100 | | |
| 1101 | | |
| 1102 | | static void graphics_color_128(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1103 | | { |
| 1104 | | int x; |
| 1105 | | UINT8 byte, attr; |
| 1106 | | |
| 1107 | | for (x = 0; x < 32; x++) |
| 1108 | | { |
| 1109 | | byte = video_data[x].data; |
| 1110 | | attr = video_data[x].attr; |
| 1111 | | |
| 1112 | | line[ 0] = line[ 1] = color(((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1113 | | line[ 2] = line[ 3] = color(((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1114 | | line[ 4] = line[ 5] = color(((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1115 | | line[ 6] = line[ 7] = color(((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1116 | | line += 8; |
| 1117 | | } |
| 1118 | | } |
| 1119 | | |
| 1120 | | |
| 1121 | | |
| 1122 | | static void graphics_bw_128(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1123 | | { |
| 1124 | | int x; |
| 1125 | | UINT8 byte, attr; |
| 1126 | | UINT32 bg, fg; |
| 1127 | | |
| 1128 | | for (x = 0; x < 16; x++) |
| 1129 | | { |
| 1130 | | byte = video_data[x].data; |
| 1131 | | attr = video_data[x].attr; |
| 1132 | | |
| 1133 | | bg = color(attr & M6847_CSS ? 10 : 8); |
| 1134 | | fg = color(attr & M6847_CSS ? 11 : 9); |
| 1135 | | |
| 1136 | | line[ 0] = line[ 1] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1137 | | line[ 2] = line[ 3] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1138 | | line[ 4] = line[ 5] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1139 | | line[ 6] = line[ 7] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1140 | | line[ 8] = line[ 9] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1141 | | line[10] = line[11] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1142 | | line[12] = line[13] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1143 | | line[14] = line[15] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1144 | | line += 16; |
| 1145 | | } |
| 1146 | | } |
| 1147 | | |
| 1148 | | |
| 1149 | | |
| 1150 | | static void graphics_bw_256(UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1151 | | { |
| 1152 | | int x; |
| 1153 | | UINT8 byte, attr; |
| 1154 | | UINT32 bg, fg; |
| 1155 | | |
| 1156 | | for (x = 0; x < 32; x++) |
| 1157 | | { |
| 1158 | | byte = video_data[x].data; |
| 1159 | | attr = video_data[x].attr; |
| 1160 | | |
| 1161 | | bg = color(attr & M6847_CSS ? 10 : 8); |
| 1162 | | fg = color(attr & M6847_CSS ? 11 : 9); |
| 1163 | | |
| 1164 | | line[0] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1165 | | line[1] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1166 | | line[2] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1167 | | line[3] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1168 | | line[4] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1169 | | line[5] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1170 | | line[6] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1171 | | line[7] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1172 | | line += 8; |
| 1173 | | } |
| 1174 | | } |
| 1175 | | |
| 1176 | | |
| 1177 | | |
| 1178 | | static void (*const graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) = |
| 1179 | | { |
| 1180 | | graphics_color_64, graphics_bw_128, |
| 1181 | | graphics_color_128, graphics_bw_128, |
| 1182 | | graphics_color_128, graphics_bw_128, |
| 1183 | | graphics_color_128, graphics_bw_256 |
| 1184 | | }; |
| 1185 | | |
| 1186 | | |
| 1187 | | |
| 1188 | | static void text_mode(running_machine &machine, int scanline, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1189 | | { |
| 1190 | | int x; |
| 1191 | | UINT8 byte, attr; |
| 1192 | | int attr_index; |
| 1193 | | UINT32 bg_color, fg_color; |
| 1194 | | UINT8 char_data; |
| 1195 | | |
| 1196 | | for (x = 0; x < 32; x++) |
| 1197 | | { |
| 1198 | | byte = video_data[x].data; |
| 1199 | | attr = video_data[x].attr; |
| 1200 | | |
| 1201 | | attr_index = attr_index_from_attribute(attr); |
| 1202 | | |
| 1203 | | bg_color = color(m6847->colordata[attr_index][byte / 16][0]); |
| 1204 | | fg_color = color(m6847->colordata[attr_index][byte / 16][1]); |
| 1205 | | |
| 1206 | | if( (!m6847->has_lowercase) && (attr & M6847_INTEXT) && !(attr & M6847_AS)) { |
| 1207 | | if (m6847->get_char_rom) { |
| 1208 | | char_data = m6847->get_char_rom(machine,byte,scanline % 12); |
| 1209 | | } else { |
| 1210 | | char_data = 0xff; |
| 1211 | | } |
| 1212 | | } else { |
| 1213 | | if (m6847->get_char_rom) |
| 1214 | | char_data = m6847->get_char_rom(machine,byte,scanline % 12); |
| 1215 | | else |
| 1216 | | char_data = m6847->fontdata[attr_index][byte][scanline % 12]; |
| 1217 | | } |
| 1218 | | |
| 1219 | | line[x*8+0] = (char_data & 0x80) ? fg_color : bg_color; |
| 1220 | | line[x*8+1] = (char_data & 0x40) ? fg_color : bg_color; |
| 1221 | | line[x*8+2] = (char_data & 0x20) ? fg_color : bg_color; |
| 1222 | | line[x*8+3] = (char_data & 0x10) ? fg_color : bg_color; |
| 1223 | | line[x*8+4] = (char_data & 0x08) ? fg_color : bg_color; |
| 1224 | | line[x*8+5] = (char_data & 0x04) ? fg_color : bg_color; |
| 1225 | | line[x*8+6] = (char_data & 0x02) ? fg_color : bg_color; |
| 1226 | | line[x*8+7] = (char_data & 0x01) ? fg_color : bg_color; |
| 1227 | | } |
| 1228 | | } |
| 1229 | | |
| 1230 | | |
| 1231 | | |
| 1232 | | static void render_scanline(running_machine &machine, bitmap_t *bitmap, int scanline) |
| 1233 | | { |
| 1234 | | UINT32 border_color; |
| 1235 | | UINT32 *line; |
| 1236 | | UINT8 attrs; |
| 1237 | | int mode, x; |
| 1238 | | const m6847_pixel *video_data; |
| 1239 | | |
| 1240 | | /* get the scanline */ |
| 1241 | | line = BITMAP_ADDR32(bitmap, scanline, 0); |
| 1242 | | |
| 1243 | | /* choose the border color */ |
| 1244 | | border_color = m6847->border[scanline]; |
| 1245 | | attrs = m6847->attrs[scanline]; |
| 1246 | | |
| 1247 | | /* is this a border scanline? */ |
| 1248 | | scanline -= m6847->top_border_scanlines; |
| 1249 | | if ((scanline >= 0) && (scanline < m6847->display_scanlines)) |
| 1250 | | { |
| 1251 | | video_data = m6847->screendata[scanline]; |
| 1252 | | |
| 1253 | | /* left border */ |
| 1254 | | for (x = 0; x < 32; x++) |
| 1255 | | line[x] = border_color; |
| 1256 | | |
| 1257 | | if (attrs & M6847_AG) |
| 1258 | | { |
| 1259 | | /* graphics */ |
| 1260 | | mode = attrs & (M6847_GM2|M6847_GM1|M6847_GM0); |
| 1261 | | graphics_modes[mode](line + 32, video_data); |
| 1262 | | } |
| 1263 | | else |
| 1264 | | { |
| 1265 | | /* text/semigraphics */ |
| 1266 | | text_mode(machine, scanline, line + 32, video_data); |
| 1267 | | } |
| 1268 | | |
| 1269 | | /* right border */ |
| 1270 | | for (x = 288; x < 320; x++) |
| 1271 | | line[x] = border_color; |
| 1272 | | |
| 1273 | | /* special case for artifacting */ |
| 1274 | | if ((attrs & (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1275 | | == (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1276 | | { |
| 1277 | | apply_artifacts(machine, line + 32); |
| 1278 | | } |
| 1279 | | } |
| 1280 | | else |
| 1281 | | { |
| 1282 | | /* we are drawing a border */ |
| 1283 | | for (x = 0; x < bitmap->width; x++) |
| 1284 | | line[x] = border_color; |
| 1285 | | } |
| 1286 | | } |
| 1287 | | |
| 1288 | | |
| 1289 | | |
| 1290 | | static void set_dirty(void) |
| 1291 | | { |
| 1292 | | m6847->dirty = TRUE; |
| 1293 | | } |
| 1294 | | |
| 1295 | | |
| 1296 | | |
| 1297 | | /************************************* |
| 1298 | | * |
| 1299 | | * Artifacting hack; should be in core |
| 1300 | | * |
| 1301 | | *************************************/ |
| 1302 | | |
| 1303 | | static UINT32 mix_color(double factor, UINT8 c0, UINT8 c1) |
| 1304 | | { |
| 1305 | | return (UINT32) (UINT8) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5); |
| 1306 | | } |
| 1307 | | |
| 1308 | | |
| 1309 | | |
| 1310 | | static void apply_artifacts(running_machine &machine, UINT32 *line) |
| 1311 | | { |
| 1312 | | /* Boy this code sucks; this code was adapted from the old M6847 |
| 1313 | | * artifacting implmentation. The only reason that it didn't look as |
| 1314 | | * horrible was because the code around it sucked as well. Now that I |
| 1315 | | * have cleaned everything up, the ugliness is much more prominent. |
| 1316 | | * |
| 1317 | | * Hopefully we will have a generic artifacting algorithm that plugs into |
| 1318 | | * the MESS/MAME core directly so we can chuck this hack */ |
| 1319 | | static const double artifact_colors[14*3] = |
| 1320 | | { |
| 1321 | | 0.157, 0.000, 0.157, /* [ 1] - dk purple (reverse 2) */ |
| 1322 | | 0.000, 0.157, 0.000, /* [ 2] - dk green (reverse 1) */ |
| 1323 | | 1.000, 0.824, 1.000, /* [ 3] - lt purple (reverse 4) */ |
| 1324 | | 0.824, 1.000, 0.824, /* [ 4] - lt green (reverse 3) */ |
| 1325 | | 0.706, 0.236, 0.118, /* [ 5] - dk blue (reverse 6) */ |
| 1326 | | 0.000, 0.197, 0.471, /* [ 6] - dk red (reverse 5) */ |
| 1327 | | 1.000, 0.550, 0.393, /* [ 7] - lt blue (reverse 8) */ |
| 1328 | | 0.275, 0.785, 1.000, /* [ 8] - lt red (reverse 7) */ |
| 1329 | | 0.000, 0.500, 1.000, /* [ 9] - red (reverse 10) */ |
| 1330 | | 1.000, 0.500, 0.000, /* [10] - blue (reverse 9) */ |
| 1331 | | 1.000, 0.942, 0.785, /* [11] - cyan (reverse 12) */ |
| 1332 | | 0.393, 0.942, 1.000, /* [12] - yellow (reverse 11) */ |
| 1333 | | 0.236, 0.000, 0.000, /* [13] - black-blue (reverse 14) */ |
| 1334 | | 0.000, 0.000, 0.236 /* [14] - black-red (reverse 13) */ |
| 1335 | | }; |
| 1336 | | |
| 1337 | | static const UINT8 artifactcorrection[128] = |
| 1338 | | { |
| 1339 | | 0, 0, 0, 0, 0, 6, 0, 2, |
| 1340 | | 5, 7, 5, 7, 1, 3, 1, 11, |
| 1341 | | 8, 6, 8, 14, 8, 9, 8, 9, |
| 1342 | | 4, 4, 4, 15, 12, 12, 12, 15, |
| 1343 | | |
| 1344 | | 5, 13, 5, 13, 13, 0, 13, 2, |
| 1345 | | 10, 10, 10, 10, 10, 15, 10, 11, |
| 1346 | | 3, 1, 3, 1, 15, 9, 15, 9, |
| 1347 | | 11, 11, 11, 11, 15, 15, 15, 15, |
| 1348 | | |
| 1349 | | 14, 0, 14, 0, 14, 6, 14, 2, |
| 1350 | | 0, 7, 0, 7, 1, 3, 1, 11, |
| 1351 | | 9, 6, 9, 14, 9, 9, 9, 9, |
| 1352 | | 15, 4, 15, 15, 12, 12, 12, 15, |
| 1353 | | |
| 1354 | | 2, 13, 2, 13, 2, 0, 2, 2, |
| 1355 | | 10, 10, 10, 10, 10, 15, 10, 11, |
| 1356 | | 12, 1, 12, 1, 12, 9, 12, 9, |
| 1357 | | 15, 11, 15, 11, 15, 15, 15, 15 |
| 1358 | | }; |
| 1359 | | |
| 1360 | | UINT32 artifacting, c0, c1; |
| 1361 | | UINT32 colors[16]; |
| 1362 | | const double *factors; |
| 1363 | | UINT8 val; |
| 1364 | | UINT32 new_line[256]; |
| 1365 | | int i; |
| 1366 | | |
| 1367 | | /* are we artifacting? */ |
| 1368 | | artifacting = input_port_read_safe(machine, "artifacting", 0x00) & 0x03; |
| 1369 | | if (artifacting == 0x00) |
| 1370 | | return; |
| 1371 | | artifacting &= 0x01; |
| 1372 | | |
| 1373 | | /* determine the base artifact colors */ |
| 1374 | | c1 = line[-1]; |
| 1375 | | for (i = 0; i < 256; i++) |
| 1376 | | { |
| 1377 | | if (line[i] != c1) |
| 1378 | | break; |
| 1379 | | } |
| 1380 | | if (i >= 256) |
| 1381 | | return; /* if everything is the same color as the border, no need for anything */ |
| 1382 | | c0 = line[i]; |
| 1383 | | |
| 1384 | | /* do we need to update our artifact colors table? */ |
| 1385 | | if ((artifacting != m6847->saved_artifacting) || (c0 != m6847->saved_c0) || (c1 != m6847->saved_c1)) |
| 1386 | | { |
| 1387 | | m6847->saved_artifacting = artifacting; |
| 1388 | | m6847->saved_c0 = colors[0] = c0; |
| 1389 | | m6847->saved_c1 = colors[15] = c1; |
| 1390 | | |
| 1391 | | /* mix the other colors */ |
| 1392 | | for (i = 1; i <= 14; i++) |
| 1393 | | { |
| 1394 | | factors = &artifact_colors[((i - 1) ^ artifacting) * 3]; |
| 1395 | | |
| 1396 | | colors[i] = (mix_color(factors[0], c0 >> 16, c1 >> 16) << 16) |
| 1397 | | | (mix_color(factors[1], c0 >> 8, c1 >> 8) << 8) |
| 1398 | | | (mix_color(factors[2], c0 >> 0, c1 >> 0) << 0); |
| 1399 | | } |
| 1400 | | for (i = 0; i < 128; i++) |
| 1401 | | m6847->expanded_colors[i] = colors[artifactcorrection[i]]; |
| 1402 | | } |
| 1403 | | |
| 1404 | | /* artifact the line */ |
| 1405 | | for (i = 0; i < 256; i += 2) |
| 1406 | | { |
| 1407 | | val = ((line[i - 2] == c1) ? 0x20 : 0x00) |
| 1408 | | | ((line[i - 1] == c1) ? 0x10 : 0x00) |
| 1409 | | | ((line[i + 0] == c1) ? 0x08 : 0x00) |
| 1410 | | | ((line[i + 1] == c1) ? 0x04 : 0x00) |
| 1411 | | | ((line[i + 2] == c1) ? 0x02 : 0x00) |
| 1412 | | | ((line[i + 3] == c1) ? 0x01 : 0x00); |
| 1413 | | |
| 1414 | | new_line[i + 0] = m6847->expanded_colors[val * 2 + 0]; |
| 1415 | | new_line[i + 1] = m6847->expanded_colors[val * 2 + 1]; |
| 1416 | | } |
| 1417 | | |
| 1418 | | /* and copy the results back */ |
| 1419 | | memcpy(line, new_line, sizeof(*line) * 256); |
| 1420 | | } |
| 1421 | | |
| 1422 | | |
| 1423 | | |
| 1424 | | static INPUT_CHANGED( artifacting_changed ) |
| 1425 | | { |
| 1426 | | set_dirty(); |
| 1427 | | } |
| 1428 | | |
| 1429 | | |
| 1430 | | |
| 1431 | | INPUT_PORTS_START( coco6847_artifacting ) |
| 1432 | | PORT_START("artifacting") |
| 1433 | | PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) PORT_CHANGED(artifacting_changed, NULL) |
| 1434 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 1435 | | PORT_CONFSETTING( 0x01, DEF_STR( Standard ) ) |
| 1436 | | PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) ) |
| 1437 | | INPUT_PORTS_END |
| 1438 | | |
| 1439 | | |
| 1440 | | |
| 1441 | | /************************************* |
| 1442 | | * |
| 1443 | | * Scanline operations |
| 1444 | | * |
| 1445 | | *************************************/ |
| 1446 | | |
| 1447 | | static int get_scanline(void) |
| 1448 | | { |
| 1449 | | int result; |
| 1450 | | attotime duration; |
| 1451 | | |
| 1452 | | /* get the time since last field sync */ |
| 1453 | | duration = m6847->hs_rise_timer->start() - m6847->fs_rise_timer->start(); |
| 1454 | | assert_always(duration.seconds == 0, "get_scanline(): duration exceeds one second"); |
| 1455 | | |
| 1456 | | if (duration.attoseconds < m6847->vblank_period) |
| 1457 | | { |
| 1458 | | result = -1; /* vblank */ |
| 1459 | | } |
| 1460 | | else |
| 1461 | | { |
| 1462 | | result = (duration.attoseconds - m6847->vblank_period) |
| 1463 | | / m6847->scanline_period; |
| 1464 | | } |
| 1465 | | return result; |
| 1466 | | } |
| 1467 | | |
| 1468 | | |
| 1469 | | static int get_beamx(void) |
| 1470 | | { |
| 1471 | | attotime scanline_time; |
| 1472 | | int result; |
| 1473 | | |
| 1474 | | scanline_time = m6847->hs_rise_timer->elapsed(); |
| 1475 | | if (scanline_time.seconds != 0) |
| 1476 | | return 0; |
| 1477 | | assert(scanline_time.as_attoseconds() < m6847->scanline_period); |
| 1478 | | |
| 1479 | | if (scanline_time.as_attoseconds() < (m6847->clock_period * 42)) |
| 1480 | | { |
| 1481 | | /* hsync */ |
| 1482 | | result = 0; |
| 1483 | | } |
| 1484 | | else if (scanline_time.as_attoseconds() < (m6847->clock_period * 95 / 2)) |
| 1485 | | { |
| 1486 | | /* left border */ |
| 1487 | | result = 0; |
| 1488 | | } |
| 1489 | | else if (scanline_time.as_attoseconds() < (m6847->clock_period * 351 / 2)) |
| 1490 | | { |
| 1491 | | /* body */ |
| 1492 | | result = (scanline_time.as_attoseconds() - (m6847->clock_period * 95 / 2)) |
| 1493 | | / m6847->clock_period * 2; |
| 1494 | | } |
| 1495 | | else |
| 1496 | | { |
| 1497 | | /* right border */ |
| 1498 | | result = 256; |
| 1499 | | } |
| 1500 | | return result; |
| 1501 | | } |
| 1502 | | |
| 1503 | | |
| 1504 | | INLINE void prepare_scanline(running_machine &machine, int xpos) |
| 1505 | | { |
| 1506 | | UINT8 attrs, data, attr; |
| 1507 | | int scanline; |
| 1508 | | int i, border_color; |
| 1509 | | int dirty; |
| 1510 | | const UINT8 *RESTRICT video_ram; |
| 1511 | | m6847_pixel *scanline_data; |
| 1512 | | |
| 1513 | | scanline = get_scanline(); |
| 1514 | | |
| 1515 | | if (LOG_PREPARE) |
| 1516 | | logerror("m6847_prepare_scanline(): scanline=%d xpos=%d\n", scanline, xpos); |
| 1517 | | |
| 1518 | | if ((scanline >= 0) && (scanline < (m6847->top_border_scanlines |
| 1519 | | + m6847->display_scanlines + m6847->bottom_border_scanlines))) |
| 1520 | | { |
| 1521 | | if (m6847->using_custom) |
| 1522 | | { |
| 1523 | | m6847->custom_prepare_scanline(machine, scanline); |
| 1524 | | } |
| 1525 | | else |
| 1526 | | { |
| 1527 | | /* has the border color changed? */ |
| 1528 | | attrs = (*m6847->get_attributes)(machine, 0, 0, 0); |
| 1529 | | if (attrs != m6847->attrs[scanline]) |
| 1530 | | { |
| 1531 | | m6847->dirty = TRUE; |
| 1532 | | m6847->attrs[scanline] = attrs; |
| 1533 | | |
| 1534 | | /* choose the border color */ |
| 1535 | | if (attrs & M6847_AG) |
| 1536 | | border_color = (attrs & M6847_CSS) ? BUFF : GREEN; |
| 1537 | | else if (m6847->has_lowercase && (attrs & M6847_GM2)) |
| 1538 | | border_color = (attrs & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1539 | | else |
| 1540 | | border_color = BLACK; |
| 1541 | | |
| 1542 | | /* need to use palette table directly; border colors are constant */ |
| 1543 | | m6847->border[scanline] = m6847->palette[border_color]; |
| 1544 | | } |
| 1545 | | |
| 1546 | | /* is this a display scanline? */ |
| 1547 | | scanline -= m6847->top_border_scanlines; |
| 1548 | | if ((scanline >= 0) && (scanline < m6847->display_scanlines)) |
| 1549 | | { |
| 1550 | | video_ram = m6847->get_video_ram(machine,scanline); |
| 1551 | | dirty = m6847->dirty; |
| 1552 | | scanline_data = m6847->screendata[scanline]; |
| 1553 | | |
| 1554 | | for (i = xpos; i < 32; i++) |
| 1555 | | { |
| 1556 | | data = video_ram[i]; |
| 1557 | | attr = (*m6847->get_attributes)(machine, data, scanline, i); |
| 1558 | | |
| 1559 | | if ((data != scanline_data[i].data) || (attr != scanline_data[i].attr)) |
| 1560 | | { |
| 1561 | | dirty = TRUE; |
| 1562 | | scanline_data[i].data = data; |
| 1563 | | scanline_data[i].attr = attr; |
| 1564 | | } |
| 1565 | | } |
| 1566 | | m6847->dirty = dirty; |
| 1567 | | } |
| 1568 | | } |
| 1569 | | } |
| 1570 | | } |
| 1571 | | |
| 1572 | | |
| 1573 | | |
| 1574 | | void coco6847_video_changed(void) |
| 1575 | | { |
| 1576 | | /* NPW 2-May-2006 - Commenting this out until we properly fix bug #878 */ |
| 1577 | | /* prepare_scanline(get_beamx() / 8); */ |
| 1578 | | } |
| 1579 | | |
| 1580 | | |
| 1581 | | |
| 1582 | | /************************************* |
| 1583 | | * |
| 1584 | | * Sync callbacks |
| 1585 | | * |
| 1586 | | *************************************/ |
| 1587 | | |
| 1588 | | int m6847_get_horizontal_sync(running_machine &machine) |
| 1589 | | { |
| 1590 | | attotime fire_time = m6847->hs_fall_timer->expire(); |
| 1591 | | return fire_time > machine.time(); |
| 1592 | | } |
| 1593 | | |
| 1594 | | |
| 1595 | | |
| 1596 | | static void set_horizontal_sync(running_machine &machine) |
| 1597 | | { |
| 1598 | | attotime fire_time = m6847->hs_fall_timer->expire(); |
| 1599 | | int horizontal_sync = fire_time > machine.time(); |
| 1600 | | if (m6847->horizontal_sync_callback) |
| 1601 | | m6847->horizontal_sync_callback(machine, !horizontal_sync); |
| 1602 | | } |
| 1603 | | |
| 1604 | | |
| 1605 | | |
| 1606 | | int m6847_get_field_sync(running_machine &machine) |
| 1607 | | { |
| 1608 | | attotime fire_time = m6847->fs_fall_timer->expire(); |
| 1609 | | return fire_time > machine.time(); |
| 1610 | | } |
| 1611 | | |
| 1612 | | |
| 1613 | | |
| 1614 | | static void set_field_sync(running_machine &machine) |
| 1615 | | { |
| 1616 | | attotime fire_time = m6847->fs_fall_timer->expire(); |
| 1617 | | int field_sync = fire_time > machine.time(); |
| 1618 | | if (m6847->field_sync_callback) |
| 1619 | | m6847->field_sync_callback(machine,field_sync); |
| 1620 | | } |
| 1621 | | |
| 1622 | | |
| 1623 | | |
| 1624 | | /************************************* |
| 1625 | | * |
| 1626 | | * Field sync/Horizontal sync timers |
| 1627 | | * |
| 1628 | | *************************************/ |
| 1629 | | |
| 1630 | | static TIMER_CALLBACK(hs_fall) |
| 1631 | | { |
| 1632 | | if (LOG_HS) |
| 1633 | | logerror("hs_fall(): time=%s\n", machine.time().as_string(ATTOTIME_STRING_PRECISION)); |
| 1634 | | |
| 1635 | | set_horizontal_sync(machine); |
| 1636 | | } |
| 1637 | | |
| 1638 | | static TIMER_CALLBACK(hs_rise) |
| 1639 | | { |
| 1640 | | if (LOG_HS) |
| 1641 | | logerror("hs_rise(): time=%s\n", machine.time().as_string(ATTOTIME_STRING_PRECISION)); |
| 1642 | | |
| 1643 | | m6847->hs_rise_timer->adjust( |
| 1644 | | attotime(0, m6847->scanline_period), 0); |
| 1645 | | m6847->hs_fall_timer->adjust( |
| 1646 | | attotime(0, m6847->horizontal_sync_period), 0); |
| 1647 | | |
| 1648 | | set_horizontal_sync(machine); |
| 1649 | | prepare_scanline(machine,0); |
| 1650 | | } |
| 1651 | | |
| 1652 | | static TIMER_CALLBACK(fs_fall) |
| 1653 | | { |
| 1654 | | if (LOG_FS) |
| 1655 | | logerror("fs_fall(): time=%s scanline=%d\n", machine.time().as_string(ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1656 | | |
| 1657 | | set_field_sync(machine); |
| 1658 | | } |
| 1659 | | |
| 1660 | | static TIMER_CALLBACK(fs_rise) |
| 1661 | | { |
| 1662 | | if (LOG_FS) |
| 1663 | | logerror("fs_rise(): time=%s scanline=%d\n", machine.time().as_string(ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1664 | | |
| 1665 | | /* adjust field sync falling edge timer */ |
| 1666 | | m6847->fs_fall_timer->adjust( |
| 1667 | | attotime(0, m6847->field_sync_period), 0); |
| 1668 | | |
| 1669 | | /* adjust horizontal sync rising timer */ |
| 1670 | | m6847->hs_rise_timer->adjust(attotime::zero); |
| 1671 | | |
| 1672 | | /* this is a hook for the CoCo 3 code to extend this stuff */ |
| 1673 | | if (m6847->new_frame_callback) |
| 1674 | | m6847->using_custom = !m6847->new_frame_callback(machine); |
| 1675 | | |
| 1676 | | set_field_sync(machine); |
| 1677 | | } |
| 1678 | | |
| 1679 | | |
| 1680 | | |
| 1681 | | /************************************* |
| 1682 | | * |
| 1683 | | * Debugging |
| 1684 | | * |
| 1685 | | *************************************/ |
| 1686 | | |
| 1687 | | |
| 1688 | | static void execute_m6847_dumpscanline(running_machine &machine, int ref, int params, const char **param) |
| 1689 | | { |
| 1690 | | int i; |
| 1691 | | int beamx = get_beamx() / 8; |
| 1692 | | int scanline = get_scanline(); |
| 1693 | | const m6847_pixel *pixel = m6847->screendata[scanline]; |
| 1694 | | |
| 1695 | | for (i = 0; i < beamx; i++) |
| 1696 | | { |
| 1697 | | debug_console_printf(machine, "[%02d]: 0x%02X (", i, pixel[i].data); |
| 1698 | | |
| 1699 | | if (pixel[i].attr & M6847_AG) debug_console_printf(machine, " AG"); |
| 1700 | | if (pixel[i].attr & M6847_AS) debug_console_printf(machine, " AS"); |
| 1701 | | if (pixel[i].attr & M6847_INTEXT) debug_console_printf(machine, " INTEXT"); |
| 1702 | | if (pixel[i].attr & M6847_INV) debug_console_printf(machine, " INV"); |
| 1703 | | if (pixel[i].attr & M6847_CSS) debug_console_printf(machine, " CSS"); |
| 1704 | | if (pixel[i].attr & M6847_GM2) debug_console_printf(machine, " GM2"); |
| 1705 | | if (pixel[i].attr & M6847_GM1) debug_console_printf(machine, " GM1"); |
| 1706 | | if (pixel[i].attr & M6847_GM0) debug_console_printf(machine, " GM0"); |
| 1707 | | |
| 1708 | | debug_console_printf(machine, " )\n"); |
| 1709 | | } |
| 1710 | | } |
| 1711 | | |
| 1712 | | |
| 1713 | | |
| 1714 | | |
| 1715 | | /************************************* |
| 1716 | | * |
| 1717 | | * Initialization |
| 1718 | | * |
| 1719 | | *************************************/ |
| 1720 | | |
| 1721 | | static const UINT8 *find_char(const m6847_variant *v, |
| 1722 | | UINT8 byte, UINT8 attr, int *fg, int *bg) |
| 1723 | | { |
| 1724 | | int ch; |
| 1725 | | size_t offset = 0; |
| 1726 | | |
| 1727 | | if (attr & M6847_AS) |
| 1728 | | { |
| 1729 | | /* semigraphics */ |
| 1730 | | *bg = BLACK; |
| 1731 | | |
| 1732 | | if (!v->has_lowercase && (attr & M6847_INTEXT)) |
| 1733 | | { |
| 1734 | | /* semigraphics 6 */ |
| 1735 | | ch = (byte & 0x3F) + 0x60; |
| 1736 | | *fg = ((byte >> 6) & 0x03) + ((attr & M6847_CSS) ? BUFF : GREEN); |
| 1737 | | } |
| 1738 | | else |
| 1739 | | { |
| 1740 | | /* semigraphics 4 */ |
| 1741 | | ch = (byte & 0x0F) + 0xA0; |
| 1742 | | *fg = ((byte >> 4) & 0x07) + GREEN; |
| 1743 | | } |
| 1744 | | } |
| 1745 | | else |
| 1746 | | { |
| 1747 | | /* text */ |
| 1748 | | ch = (byte & 0x3F) + 0x00; |
| 1749 | | |
| 1750 | | if (v->has_lowercase) |
| 1751 | | { |
| 1752 | | if ((ch < 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) |
| 1753 | | { |
| 1754 | | /* this is a lowercase character */ |
| 1755 | | attr |= M6847_INV; |
| 1756 | | ch += 0x40; |
| 1757 | | } |
| 1758 | | |
| 1759 | | if ((ch > 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) { |
| 1760 | | ch += 0x20; |
| 1761 | | } |
| 1762 | | |
| 1763 | | if (attr & M6847_GM1) |
| 1764 | | attr ^= M6847_INV; |
| 1765 | | |
| 1766 | | } |
| 1767 | | |
| 1768 | | if (attr & M6847_INV) |
| 1769 | | { |
| 1770 | | /* dark foreground, light background */ |
| 1771 | | *fg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1772 | | *bg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1773 | | } |
| 1774 | | else |
| 1775 | | { |
| 1776 | | /* light foreground, dark background */ |
| 1777 | | *fg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1778 | | *bg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1779 | | } |
| 1780 | | |
| 1781 | | offset = v->text_offset; |
| 1782 | | } |
| 1783 | | |
| 1784 | | return &v->fontdata[ch * 12] + offset; |
| 1785 | | } |
| 1786 | | |
| 1787 | | |
| 1788 | | |
| 1789 | | static void build_fontdata(const m6847_variant *v) |
| 1790 | | { |
| 1791 | | int attr_index, row; |
| 1792 | | int fg, bg; |
| 1793 | | int byte; |
| 1794 | | const UINT8 *char_data; |
| 1795 | | |
| 1796 | | for (attr_index = 0; attr_index < ARRAY_LENGTH(m6847->fontdata); attr_index++) |
| 1797 | | { |
| 1798 | | UINT8 attr = attribute_from_attr_index(attr_index); |
| 1799 | | |
| 1800 | | for (byte = 0; byte < 256; byte++) |
| 1801 | | { |
| 1802 | | char_data = find_char(v, byte, attr, &fg, &bg); |
| 1803 | | |
| 1804 | | /* specify colors */ |
| 1805 | | m6847->colordata[attr_index][byte / 16][0] = bg; |
| 1806 | | m6847->colordata[attr_index][byte / 16][1] = fg; |
| 1807 | | |
| 1808 | | for (row = 0; row < 12; row++) |
| 1809 | | { |
| 1810 | | m6847->fontdata[attr_index][byte][row] = char_data[row]; |
| 1811 | | } |
| 1812 | | } |
| 1813 | | } |
| 1814 | | } |
| 1815 | | |
| 1816 | | |
| 1817 | | |
| 1818 | | static void m6847_postload(running_machine *machine) |
| 1819 | | { |
| 1820 | | set_field_sync(*machine); |
| 1821 | | set_horizontal_sync(*machine); |
| 1822 | | set_dirty(); |
| 1823 | | } |
| 1824 | | |
| 1825 | | |
| 1826 | | |
| 1827 | | void m6847_init(running_machine &machine, const m6847_config *cfg) |
| 1828 | | { |
| 1829 | | const m6847_variant *v; |
| 1830 | | UINT32 frequency; |
| 1831 | | attoseconds_t period, frame_period, cpu0_clock_period = 0; |
| 1832 | | double total_scanlines; |
| 1833 | | |
| 1834 | | /* identify proper M6847 variant */ |
| 1835 | | assert(cfg->type < ARRAY_LENGTH(variants)); |
| 1836 | | v = &variants[cfg->type]; |
| 1837 | | |
| 1838 | | /* allocate instance */ |
| 1839 | | m6847 = auto_alloc_clear(machine, m6847_vdg); |
| 1840 | | set_dirty(); |
| 1841 | | |
| 1842 | | /* copy configuration */ |
| 1843 | | m6847->get_attributes = cfg->get_attributes; |
| 1844 | | m6847->get_video_ram = cfg->get_video_ram; |
| 1845 | | m6847->horizontal_sync_callback = cfg->horizontal_sync_callback; |
| 1846 | | m6847->field_sync_callback = cfg->field_sync_callback; |
| 1847 | | m6847->new_frame_callback = cfg->new_frame_callback; |
| 1848 | | m6847->custom_prepare_scanline = cfg->custom_prepare_scanline; |
| 1849 | | m6847->has_lowercase = v->has_lowercase; |
| 1850 | | m6847->get_char_rom = cfg->get_char_rom; |
| 1851 | | |
| 1852 | | /* assert our assumptions */ |
| 1853 | | assert((v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME) |
| 1854 | | == (UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)); |
| 1855 | | assert((v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE) |
| 1856 | | == (UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1857 | | assert((v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR) |
| 1858 | | == (UINT32) (v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR)); |
| 1859 | | |
| 1860 | | /* choose palette */ |
| 1861 | | if (cfg->custom_palette) |
| 1862 | | { |
| 1863 | | m6847->has_custom_palette = 1; |
| 1864 | | m6847->palette = cfg->custom_palette; |
| 1865 | | } |
| 1866 | | else |
| 1867 | | { |
| 1868 | | m6847->palette = palette; |
| 1869 | | } |
| 1870 | | |
| 1871 | | /* allocate timers */ |
| 1872 | | m6847->fs_rise_timer = machine.scheduler().timer_alloc(FUNC(fs_rise)); |
| 1873 | | m6847->fs_fall_timer = machine.scheduler().timer_alloc(FUNC(fs_fall)); |
| 1874 | | m6847->hs_rise_timer = machine.scheduler().timer_alloc(FUNC(hs_rise)); |
| 1875 | | m6847->hs_fall_timer = machine.scheduler().timer_alloc(FUNC(hs_fall)); |
| 1876 | | |
| 1877 | | /* setup dimensions */ |
| 1878 | | m6847->top_border_scanlines = v->top_border_scanlines; |
| 1879 | | m6847->display_scanlines = v->display_scanlines; |
| 1880 | | m6847->bottom_border_scanlines = v->bottom_border_scanlines; |
| 1881 | | |
| 1882 | | /* compute frequency and period */ |
| 1883 | | frequency = v->frames_per_second |
| 1884 | | * ((UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)) |
| 1885 | | * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1886 | | period = ATTOSECONDS_PER_SECOND / frequency; |
| 1887 | | |
| 1888 | | /* choose CPU clock, if specified */ |
| 1889 | | if (cfg->cpu0_timing_factor > 0) |
| 1890 | | { |
| 1891 | | cpu0_clock_period = period * 1 * GROSS_FACTOR; |
| 1892 | | machine.firstcpu->set_unscaled_clock( ATTOSECONDS_PER_SECOND / cpu0_clock_period); |
| 1893 | | } |
| 1894 | | |
| 1895 | | /* calculate timing */ |
| 1896 | | total_scanlines = v->vblank_scanlines |
| 1897 | | + v->top_border_scanlines |
| 1898 | | + v->display_scanlines |
| 1899 | | + v->bottom_border_scanlines |
| 1900 | | + v->vretrace_scanlines; |
| 1901 | | m6847->clock_period = period * GROSS_FACTOR; |
| 1902 | | m6847->scanline_period = period * (UINT32) (v->clocks_per_scanline * GROSS_FACTOR); |
| 1903 | | m6847->field_sync_period = period * (UINT32) (v->clocks_per_scanline * v->field_sync_scanlines * GROSS_FACTOR); |
| 1904 | | m6847->horizontal_sync_period = period * GROSS_FACTOR * 33 / 2; |
| 1905 | | m6847->vblank_period = period * (UINT32) (v->clocks_per_scanline * v->vblank_scanlines * GROSS_FACTOR); |
| 1906 | | |
| 1907 | | /* setup timing */ |
| 1908 | | frame_period = period * |
| 1909 | | (UINT32) (v->clocks_per_scanline * total_scanlines * GROSS_FACTOR); |
| 1910 | | m6847->fs_rise_timer->adjust(attotime::zero, 0, attotime(0, frame_period)); |
| 1911 | | |
| 1912 | | /* setup save states */ |
| 1913 | | machine.save().register_postload(save_prepost_delegate(FUNC(m6847_postload), &machine)); |
| 1914 | | |
| 1915 | | /* build font */ |
| 1916 | | build_fontdata(v); |
| 1917 | | |
| 1918 | | /* dump stats */ |
| 1919 | | if (LOG_STATS) |
| 1920 | | { |
| 1921 | | logerror("m6847_init():\n"); |
| 1922 | | logerror("\tclock: %30s sec\n", attotime(0, period * GROSS_FACTOR).as_string(ATTOTIME_STRING_PRECISION)); |
| 1923 | | if (cpu0_clock_period > 0) |
| 1924 | | logerror("\tCPU0 clock: %30s sec\n", attotime(0, cpu0_clock_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1925 | | logerror("\tscanline: %30s sec\n", attotime(0, m6847->scanline_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1926 | | logerror("\tfield sync: %30s sec\n", attotime(0, m6847->field_sync_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1927 | | logerror("\thorz sync: %30s sec\n", attotime(0, m6847->horizontal_sync_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1928 | | logerror("\tvblank: %30s sec\n", attotime(0, m6847->vblank_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1929 | | logerror("\tframe: %30s sec\n", attotime(0, frame_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1930 | | logerror("\n"); |
| 1931 | | } |
| 1932 | | |
| 1933 | | /* setup debug commands */ |
| 1934 | | if (machine.debug_flags & DEBUG_FLAG_ENABLED) |
| 1935 | | debug_console_register_command(machine, "m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_m6847_dumpscanline); |
| 1936 | | } |
| 1937 | | |
| 1938 | | |
| 1939 | | |
| 1940 | | SCREEN_UPDATE(m6847) |
| 1941 | | { |
| 1942 | | int row, i; |
| 1943 | | UINT32 rc = 0; |
| 1944 | | |
| 1945 | | /* if we have a custom palette, check to see if it has changed */ |
| 1946 | | if (!m6847->dirty && m6847->has_custom_palette) |
| 1947 | | { |
| 1948 | | for (i = 0; i < 16; i++) |
| 1949 | | { |
| 1950 | | if (m6847->palette[i] != m6847->saved_palette[i]) |
| 1951 | | { |
| 1952 | | m6847->dirty = TRUE; |
| 1953 | | break; |
| 1954 | | } |
| 1955 | | } |
| 1956 | | } |
| 1957 | | |
| 1958 | | if (m6847->dirty) |
| 1959 | | { |
| 1960 | | /* this frame is dirty; render it */ |
| 1961 | | m6847->dirty = FALSE; |
| 1962 | | |
| 1963 | | /* copy palette if we have a custom palete */ |
| 1964 | | if (m6847->has_custom_palette) |
| 1965 | | { |
| 1966 | | for (i = 0; i < 16; i++) |
| 1967 | | m6847->saved_palette[i] = m6847->palette[i]; |
| 1968 | | } |
| 1969 | | |
| 1970 | | /* the video RAM has been dirtied; need to draw */ |
| 1971 | | for (row = cliprect->min_y; row <= cliprect->max_y; row++) |
| 1972 | | render_scanline(screen->machine(), bitmap, row); |
| 1973 | | } |
| 1974 | | else |
| 1975 | | { |
| 1976 | | /* skip this frame */ |
| 1977 | | rc = UPDATE_HAS_NOT_CHANGED; |
| 1978 | | } |
| 1979 | | return rc; |
| 1980 | | } |
| 1981 | | |
| 1982 | | |
| 1983 | | |
| 1984 | | /************************************* |
| 1985 | | * |
| 1986 | | * Timing calculations |
| 1987 | | * |
| 1988 | | *************************************/ |
| 1989 | | |
| 1990 | | static attotime interval(m6847_timing_type timing) |
| 1991 | | { |
| 1992 | | attotime result; |
| 1993 | | |
| 1994 | | switch(timing) |
| 1995 | | { |
| 1996 | | case M6847_CLOCK: |
| 1997 | | result = attotime(0, m6847->clock_period); |
| 1998 | | break; |
| 1999 | | case M6847_HSYNC: |
| 2000 | | result = attotime(0, m6847->scanline_period); |
| 2001 | | break; |
| 2002 | | default: |
| 2003 | | fatalerror("invalid timing type"); |
| 2004 | | break; |
| 2005 | | } |
| 2006 | | return result; |
| 2007 | | } |
| 2008 | | |
| 2009 | | |
| 2010 | | |
| 2011 | | attotime coco6847_time_delay(running_machine &machine, m6847_timing_type timing, UINT64 time_delay) |
| 2012 | | { |
| 2013 | | return interval(timing) * time_delay; |
| 2014 | | } |
| 2015 | | |
| 2016 | | |
| 2017 | | |
| 2018 | | attotime coco6847_scanline_time(int scanline) |
| 2019 | | { |
| 2020 | | return attotime(0, m6847->scanline_period * |
| 2021 | | (13 /* FIXME */ + scanline)); |
| 2022 | | } |
src/mess/video/m6847.c
| r13256 | r13257 | |
| 1 | | /********************************************************************* |
| 2 | | |
| 3 | | m6847.c |
| 4 | | |
| 5 | | 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 "emu.h" |
| 67 | | #include "m6847.h" |
| 68 | | |
| 69 | | #include "debug/debugcpu.h" |
| 70 | | #include "debug/debugcon.h" |
| 71 | | |
| 72 | | enum |
| 73 | | { |
| 74 | | M6847_AG = 0x80, |
| 75 | | M6847_AS = 0x40, |
| 76 | | M6847_INTEXT = 0x20, |
| 77 | | M6847_INV = 0x10, |
| 78 | | M6847_CSS = 0x08, |
| 79 | | M6847_GM2 = 0x04, |
| 80 | | M6847_GM1 = 0x02, |
| 81 | | M6847_GM0 = 0x01 |
| 82 | | }; |
| 83 | | |
| 84 | | |
| 85 | | |
| 86 | | #define LOG_FS 0 |
| 87 | | #define LOG_HS 0 |
| 88 | | #define LOG_STATS 0 |
| 89 | | #define LOG_PREPARE 0 |
| 90 | | |
| 91 | | typedef struct _m6847_variant m6847_variant; |
| 92 | | struct _m6847_variant |
| 93 | | { |
| 94 | | const UINT8 *fontdata; |
| 95 | | unsigned int has_lowercase : 1; |
| 96 | | unsigned int text_offset : 1; |
| 97 | | |
| 98 | | int frames_per_second; |
| 99 | | double scanlines_per_frame; |
| 100 | | double clocks_per_scanline; |
| 101 | | |
| 102 | | double vblank_scanlines; |
| 103 | | int top_border_scanlines; |
| 104 | | int display_scanlines; |
| 105 | | int bottom_border_scanlines; |
| 106 | | int vretrace_scanlines; |
| 107 | | |
| 108 | | double field_sync_scanlines; |
| 109 | | }; |
| 110 | | |
| 111 | | typedef struct _m6847_pixel m6847_pixel; |
| 112 | | struct _m6847_pixel |
| 113 | | { |
| 114 | | UINT8 data; |
| 115 | | UINT8 attr; |
| 116 | | }; |
| 117 | | |
| 118 | | typedef struct _mc6847_state mc6847_state; |
| 119 | | struct _mc6847_state |
| 120 | | { |
| 121 | | /* callbacks */ |
| 122 | | devcb_resolved_read8 in_dd_func; |
| 123 | | |
| 124 | | devcb_resolved_read_line in_gm2_func; |
| 125 | | devcb_resolved_read_line in_gm1_func; |
| 126 | | devcb_resolved_read_line in_gm0_func; |
| 127 | | devcb_resolved_read_line in_intext_func; |
| 128 | | devcb_resolved_read_line in_inv_func; |
| 129 | | devcb_resolved_read_line in_as_func; |
| 130 | | devcb_resolved_read_line in_ag_func; |
| 131 | | devcb_resolved_read_line in_css_func; |
| 132 | | |
| 133 | | devcb_resolved_write_line out_fs_func; |
| 134 | | devcb_resolved_write_line out_hs_func; |
| 135 | | devcb_resolved_write_line out_rs_func; |
| 136 | | |
| 137 | | /* state of mode control lines */ |
| 138 | | unsigned int gm2 : 1; |
| 139 | | unsigned int gm1 : 1; |
| 140 | | unsigned int gm0 : 1; |
| 141 | | unsigned int intext : 1; |
| 142 | | unsigned int inv : 1; |
| 143 | | unsigned int as : 1; |
| 144 | | unsigned int ag : 1; |
| 145 | | unsigned int css : 1; |
| 146 | | |
| 147 | | /* sync control line status */ |
| 148 | | unsigned int fs : 1; |
| 149 | | unsigned int hs : 1; |
| 150 | | |
| 151 | | /* to be cleaned up... */ |
| 152 | | int (*new_frame_callback)(running_machine &machine); /* returns whether the M6847 is in charge of this frame */ |
| 153 | | void (*custom_prepare_scanline)(int scanline); |
| 154 | | UINT8 (*get_char_rom)(running_machine &machine, UINT8 ch,int line); |
| 155 | | |
| 156 | | /* timers */ |
| 157 | | emu_timer *fs_rise_timer; |
| 158 | | emu_timer *fs_fall_timer; |
| 159 | | emu_timer *hs_rise_timer; |
| 160 | | emu_timer *hs_fall_timer; |
| 161 | | |
| 162 | | /* things that vary according to chip version */ |
| 163 | | attoseconds_t clock_period; |
| 164 | | attoseconds_t scanline_period; |
| 165 | | attoseconds_t field_sync_period; |
| 166 | | attoseconds_t horizontal_sync_period; |
| 167 | | attoseconds_t vblank_period; |
| 168 | | int top_border_scanlines; |
| 169 | | int display_scanlines; |
| 170 | | int bottom_border_scanlines; |
| 171 | | const UINT32 *palette; |
| 172 | | |
| 173 | | /* flags */ |
| 174 | | unsigned int has_lowercase : 1; /* M6847T1 has lower case */ |
| 175 | | unsigned int has_custom_palette : 1; /* needed for CoCo 3 */ |
| 176 | | unsigned int text_offset : 2; /* needed for CoCo 3 */ |
| 177 | | |
| 178 | | /* video state; every scanline the video state for the scanline is copied |
| 179 | | * here and only rendered in SCREEN_UPDATE */ |
| 180 | | int dirty; |
| 181 | | int using_custom; |
| 182 | | UINT32 border[384]; |
| 183 | | UINT8 attrs[384]; |
| 184 | | m6847_pixel screendata[192][32]; |
| 185 | | |
| 186 | | UINT32 saved_artifacting, saved_c0, saved_c1; |
| 187 | | UINT32 expanded_colors[128]; |
| 188 | | |
| 189 | | /* saved palette; used with CoCo 3 */ |
| 190 | | UINT32 saved_palette[16]; |
| 191 | | |
| 192 | | /* 2^7 modes, 256/16 character groups, background/foreground */ |
| 193 | | UINT8 colordata[128][256/16][2]; |
| 194 | | |
| 195 | | /* 2^7 modes, 256 characters, 12 scanlines */ |
| 196 | | UINT8 fontdata[128][256][12]; |
| 197 | | }; |
| 198 | | |
| 199 | | |
| 200 | | |
| 201 | | static void apply_artifacts(device_t *device, UINT32 *line); |
| 202 | | |
| 203 | | |
| 204 | | static const UINT8 pal_round_fontdata8x12[] = |
| 205 | | { |
| 206 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 207 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 208 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 209 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 210 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 211 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 212 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 213 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 214 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 215 | | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 216 | | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 217 | | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 218 | | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 219 | | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 220 | | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 221 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 222 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 223 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 224 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 225 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 226 | | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 227 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 228 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 229 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 230 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 231 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 232 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 233 | | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 234 | | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 235 | | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 236 | | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 237 | | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 238 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 239 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 240 | | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 241 | | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 242 | | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 243 | | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 244 | | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 245 | | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 246 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 247 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 248 | | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 249 | | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 250 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 251 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 252 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 253 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 254 | | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 255 | | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 256 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 257 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 258 | | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 259 | | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 260 | | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 261 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 262 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 263 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 264 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 265 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 266 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 267 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 268 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 269 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 270 | | |
| 271 | | /* Lower case */ |
| 272 | | 0x00, 0x00, 0x18, 0x24, 0x20, 0x70, 0x20, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 273 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 274 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 275 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 276 | | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 277 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 278 | | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 279 | | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 280 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 281 | | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 282 | | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 283 | | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 284 | | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 285 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 286 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 287 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 288 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 289 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 290 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 291 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 292 | | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 293 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 294 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 295 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 296 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 297 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 298 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 299 | | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 300 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 301 | | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 302 | | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 303 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 304 | | |
| 305 | | /* Semigraphics 6 */ |
| 306 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 307 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 308 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 309 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 310 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 311 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 312 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 313 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 314 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 315 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 316 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 317 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 318 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 319 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 320 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 321 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 322 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 323 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 324 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 325 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 326 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 327 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 328 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 329 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 330 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 331 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 332 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 333 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 334 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 335 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 336 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 337 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 338 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 339 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 340 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 341 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 342 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 343 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 344 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 345 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 346 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 347 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 348 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 349 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 350 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 351 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 352 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 353 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 354 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 355 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 356 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 357 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 358 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 359 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 360 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 361 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 362 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 363 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 364 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 365 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 366 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 367 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 368 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 369 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 370 | | |
| 371 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 372 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 373 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 374 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 375 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 376 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 377 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 378 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 379 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 380 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 381 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 382 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 383 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 384 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 385 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 386 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 387 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 388 | | }; |
| 389 | | |
| 390 | | |
| 391 | | |
| 392 | | static const UINT8 pal_square_fontdata8x12[] = |
| 393 | | { |
| 394 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 395 | | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 396 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 397 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 398 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 399 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 400 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 401 | | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 402 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 403 | | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 404 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 405 | | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 406 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 407 | | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 408 | | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 409 | | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 410 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 411 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 412 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 413 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 414 | | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 415 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 416 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 417 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 418 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 419 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 420 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 421 | | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 422 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 423 | | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 424 | | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 425 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 426 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 427 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 428 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 429 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 430 | | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 431 | | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 432 | | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 433 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 434 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 435 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 436 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 437 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 438 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 439 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 440 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 441 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 442 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 443 | | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 444 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 445 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x0C, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 446 | | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 447 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 448 | | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 449 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 450 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 451 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 452 | | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 453 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 454 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 455 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 456 | | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 457 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 458 | | |
| 459 | | /* Lower case */ |
| 460 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 461 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 462 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 463 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 464 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 465 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 466 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 467 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 468 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 469 | | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 470 | | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 471 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 472 | | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 473 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 474 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 475 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 476 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 477 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 478 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 479 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 480 | | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 481 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 482 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 483 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 484 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 485 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 486 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 487 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 488 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 489 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 490 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 491 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 492 | | |
| 493 | | /* Semigraphics 6 */ |
| 494 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 495 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 496 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 497 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 498 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 499 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 500 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 501 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 502 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 503 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 504 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 505 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 506 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 507 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 508 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 509 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 510 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 511 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 512 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 513 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 514 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 515 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 516 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 517 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 518 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 519 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 520 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 521 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 522 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 523 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 524 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 525 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 526 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 527 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 528 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 529 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 530 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 531 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 532 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 533 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 534 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 535 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 536 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 537 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 538 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 539 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 540 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 541 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 542 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 543 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 544 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 545 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 546 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 547 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 548 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 549 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 550 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 551 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 552 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 553 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 554 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 555 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 556 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 557 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 558 | | |
| 559 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 560 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 561 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 562 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 563 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 564 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 565 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 566 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 567 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 568 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 569 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 570 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 571 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 572 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 573 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 574 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 575 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 576 | | }; |
| 577 | | |
| 578 | | |
| 579 | | |
| 580 | | static const UINT8 ntsc_round_fontdata8x12[] = |
| 581 | | { |
| 582 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, |
| 583 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 584 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 585 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 586 | | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00, |
| 587 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 588 | | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 589 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 590 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 591 | | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 592 | | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 593 | | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 594 | | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 595 | | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 596 | | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 597 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 598 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 599 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 600 | | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00, |
| 601 | | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 602 | | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 603 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 604 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 605 | | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00, |
| 606 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 607 | | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 608 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 609 | | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00, |
| 610 | | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, |
| 611 | | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00, |
| 612 | | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 613 | | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 614 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 615 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 616 | | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 617 | | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 618 | | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00, |
| 619 | | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00, |
| 620 | | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00, |
| 621 | | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 622 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 623 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 624 | | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00, |
| 625 | | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 626 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00, |
| 627 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 628 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 629 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, |
| 630 | | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 631 | | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 632 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, |
| 633 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 634 | | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 635 | | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 636 | | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 637 | | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 638 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 639 | | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00, |
| 640 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, |
| 641 | | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, |
| 642 | | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 643 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 644 | | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 645 | | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, |
| 646 | | |
| 647 | | /* Lower case */ |
| 648 | | 0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 649 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, |
| 650 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00, |
| 651 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 652 | | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 653 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00, |
| 654 | | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 655 | | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00, |
| 656 | | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 657 | | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 658 | | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, |
| 659 | | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00, |
| 660 | | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, |
| 661 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, |
| 662 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, |
| 663 | | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, |
| 664 | | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, |
| 665 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00, |
| 666 | | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, |
| 667 | | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, |
| 668 | | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00, |
| 669 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00, |
| 670 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, |
| 671 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00, |
| 672 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, |
| 673 | | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, |
| 674 | | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, |
| 675 | | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 676 | | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, |
| 677 | | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, |
| 678 | | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 679 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, |
| 680 | | |
| 681 | | /* Semigraphics 6 */ |
| 682 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 683 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 684 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 685 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 686 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 687 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 688 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 689 | | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 690 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 691 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 692 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 693 | | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 694 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 695 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 696 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 697 | | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 698 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 699 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 700 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 701 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 702 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 703 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 704 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 705 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 706 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 707 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 708 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 709 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 710 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 711 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 712 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 713 | | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 714 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 715 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 716 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 717 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 718 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 719 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 720 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 721 | | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 722 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 723 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 724 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 725 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 726 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 727 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 728 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 729 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 730 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 731 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, |
| 732 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, |
| 733 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, |
| 734 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, |
| 735 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 736 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, |
| 737 | | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, |
| 738 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, |
| 739 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, |
| 740 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 741 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, |
| 742 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, |
| 743 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, |
| 744 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, |
| 745 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 746 | | |
| 747 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 748 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 749 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 750 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 751 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 752 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 753 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 754 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 755 | | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 756 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 757 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 758 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 759 | | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 760 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 761 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, |
| 762 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, |
| 763 | | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 764 | | }; |
| 765 | | |
| 766 | | |
| 767 | | |
| 768 | | static const UINT8 ntsc_square_fontdata8x12[] = |
| 769 | | { |
| 770 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, |
| 771 | | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, |
| 772 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 773 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00, |
| 774 | | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00, |
| 775 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 776 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 777 | | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 778 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 779 | | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 780 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 781 | | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 782 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 783 | | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 784 | | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 785 | | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00, |
| 786 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 787 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 788 | | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00, |
| 789 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00, |
| 790 | | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 791 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 792 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00, |
| 793 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00, |
| 794 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00, |
| 795 | | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 796 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00, |
| 797 | | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, |
| 798 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00, |
| 799 | | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00, |
| 800 | | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 801 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00, |
| 802 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 803 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 804 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 805 | | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00, |
| 806 | | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00, |
| 807 | | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00, |
| 808 | | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00, |
| 809 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 810 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, |
| 811 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, |
| 812 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, |
| 813 | | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, |
| 814 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00, |
| 815 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 816 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, |
| 817 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 818 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00, |
| 819 | | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 820 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00, |
| 821 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x04, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 822 | | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00, |
| 823 | | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00, |
| 824 | | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 825 | | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00, |
| 826 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 827 | | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00, |
| 828 | | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, |
| 829 | | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, |
| 830 | | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, |
| 831 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, |
| 832 | | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00, |
| 833 | | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, |
| 834 | | |
| 835 | | /* Lower case */ |
| 836 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00, |
| 837 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00, |
| 838 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00, |
| 839 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, |
| 840 | | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00, |
| 841 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00, |
| 842 | | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, |
| 843 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 844 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 845 | | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 846 | | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18, |
| 847 | | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00, |
| 848 | | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00, |
| 849 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00, |
| 850 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00, |
| 851 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00, |
| 852 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, |
| 853 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03, |
| 854 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00, |
| 855 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00, |
| 856 | | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00, |
| 857 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00, |
| 858 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00, |
| 859 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00, |
| 860 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00, |
| 861 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C, |
| 862 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00, |
| 863 | | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, |
| 864 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, |
| 865 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00, |
| 866 | | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00, |
| 867 | | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, |
| 868 | | |
| 869 | | /* Semigraphics 6 */ |
| 870 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 871 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 872 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 873 | | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 874 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 875 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 876 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 877 | | 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 878 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 879 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 880 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 881 | | 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 882 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 883 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 884 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 885 | | 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 886 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 887 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 888 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 889 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 890 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 891 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 892 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 893 | | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 894 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 895 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 896 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 897 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 898 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 899 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 900 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 901 | | 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 902 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 903 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 904 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 905 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 906 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 907 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 908 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 909 | | 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 910 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 911 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 912 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 913 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 914 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 915 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 916 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 917 | | 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 918 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 919 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, |
| 920 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, |
| 921 | | 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, |
| 922 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, |
| 923 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 924 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, |
| 925 | | 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, |
| 926 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, |
| 927 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, |
| 928 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, |
| 929 | | 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, |
| 930 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, |
| 931 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, |
| 932 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, |
| 933 | | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |
| 934 | | |
| 935 | | /* Block Graphics (Semigraphics 4 Graphics ) */ |
| 936 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 937 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 938 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 939 | | 0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 940 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 941 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 942 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 943 | | 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 944 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 945 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 946 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 947 | | 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, 0xff,0xff,0xff,0xff,0xff,0xff, |
| 948 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x00,0x00,0x00,0x00,0x00,0x00, |
| 949 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, |
| 950 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, |
| 951 | | 0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff |
| 952 | | }; |
| 953 | | |
| 954 | | |
| 955 | | |
| 956 | | enum |
| 957 | | { |
| 958 | | GREEN, YELLOW, BLUE, RED, /* 0 - 3 */ |
| 959 | | BUFF, CYAN, MAGENTA, ORANGE, /* 4 - 7 */ |
| 960 | | |
| 961 | | BLACK = 10, /* 10 */ |
| 962 | | |
| 963 | | DKGREEN = 12, LTGREEN = 13, /* 12 - 13 */ |
| 964 | | DKORANGE = 14, LTORANGE = 15, /* 14 - 15 */ |
| 965 | | }; |
| 966 | | |
| 967 | | |
| 968 | | |
| 969 | | |
| 970 | | #define ATTOTIME_STRING_PRECISION 9 |
| 971 | | |
| 972 | | /* MC6847 video output pins: Y, phiA, phiB (Y'UV color space). |
| 973 | | * |
| 974 | | * Y voltage levels: |
| 975 | | * VB ("Black") = 0.72V; VWL ("White Low") = 0.65V; VWM ("White Medium") = 0.54V; |
| 976 | | * VWH ("White High") = 0.42V. |
| 977 | | * |
| 978 | | * phiA and phiB voltage levels: |
| 979 | | * VOL ("Output Low") = 1.0V; VR ("Reference"?) = 1.5V; VIH ("Input High") = 2.0V. |
| 980 | | * |
| 981 | | * Color composition: |
| 982 | | * |
| 983 | | * COLOR | Y | phiA | phiB |
| 984 | | * ------------+-----+------+------ |
| 985 | | * GREEN | VWM | VOL | VOL |
| 986 | | * YELLOW | VWH | VOL | VR |
| 987 | | * BLUE | VWL | VIH | VR |
| 988 | | * RED | VWL | VR | VIH |
| 989 | | * WHITE | VWH | VR | VR |
| 990 | | * CYAN | VWM | VR | VOL |
| 991 | | * MAGENTA | VWM | VIH | VIH |
| 992 | | * ORANGE | VWM | VOL | VIH |
| 993 | | * BLACK | VB | VR | VR |
| 994 | | * DARK GREEN | VB | VOL | VOL |
| 995 | | * DARK ORANGE | VB | VOL | VIH |
| 996 | | * |
| 997 | | * |
| 998 | | * Mapping voltages to a 0~255 range: |
| 999 | | * |
| 1000 | | * Y values: |
| 1001 | | * VB = 0; VWL = 59; VWM = 153; VWH = 255. |
| 1002 | | * |
| 1003 | | * phiA and phiB values: |
| 1004 | | * VOL = -128; VR = 0; VIH = +128. |
| 1005 | | * |
| 1006 | | * |
| 1007 | | * Y'UV to RGB convertion: |
| 1008 | | * R = Y' + 1.13983 x U |
| 1009 | | * G = Y' - 0.39465 x U - 0.58060 x V |
| 1010 | | * B = Y' + 2.03211 x V |
| 1011 | | * |
| 1012 | | * So we get: |
| 1013 | | * GREEN = Y'UV(153,-128,-128) = RGB(7,277,-107) --> #07ff00 |
| 1014 | | * YELLOW = Y'UV(255,-128,0) = RGB(255,305,-5) --> #ffff00 |
| 1015 | | * BLUE = Y'UV(59,+128,0) = RGB(59,8,319) --> #3b08ff |
| 1016 | | * RED: Y'UV(59,0,+128) = RGB(204,-15,59) --> #cc003b |
| 1017 | | * WHITE: Y'UV(255,0,0) = RGB(255,255,255) --> #ffffff |
| 1018 | | * CYAN: Y'UV(153,0,-128) = RGB(7,227,153) --> #07e399 |
| 1019 | | * MAGENTA: Y'UV(153,+128,+128) = RGB(298,28,413) --> #ff1cff |
| 1020 | | * ORANGE: Y'UV(153,-128,+128) = RGB(298,129,-107) --> #ff8100 |
| 1021 | | * BLACK: Y'UV(0,0,0) = RGB(0,0,0) --> #000000 |
| 1022 | | * DARK GREEN: Y'UV(0,-128,-128) = RGB(-145,124,-260) --> #007c00 |
| 1023 | | * DARK ORANGE: Y'UV(0,-128,+128) = RGB(145,-23,-260) --> #910000 |
| 1024 | | */ |
| 1025 | | |
| 1026 | | #define M6847_RGB(r,g,b) ((r << 16) | (g << 8) | (b << 0)) |
| 1027 | | |
| 1028 | | |
| 1029 | | static const UINT32 default_palette[] = |
| 1030 | | { |
| 1031 | | M6847_RGB(0x07, 0xff, 0x00), /* GREEN */ |
| 1032 | | M6847_RGB(0xff, 0xff, 0x00), /* YELLOW */ |
| 1033 | | M6847_RGB(0x3b, 0x08, 0xff), /* BLUE */ |
| 1034 | | M6847_RGB(0xcc, 0x00, 0x3b), /* RED */ |
| 1035 | | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 1036 | | M6847_RGB(0x07, 0xe3, 0x99), /* CYAN */ |
| 1037 | | M6847_RGB(0xff, 0x1c, 0xff), /* MAGENTA */ |
| 1038 | | M6847_RGB(0xff, 0x81, 0x00), /* ORANGE */ |
| 1039 | | |
| 1040 | | M6847_RGB(0x00, 0x7c, 0x00), /* DARK GREEN */ |
| 1041 | | M6847_RGB(0x07, 0xff, 0x00), /* GREEN */ |
| 1042 | | M6847_RGB(0x00, 0x00, 0x00), /* BLACK */ |
| 1043 | | M6847_RGB(0xff, 0xff, 0xff), /* BUFF */ |
| 1044 | | |
| 1045 | | M6847_RGB(0x00, 0x7c, 0x00), /* ALPHANUMERIC DARK GREEN */ |
| 1046 | | M6847_RGB(0x07, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */ |
| 1047 | | M6847_RGB(0x91, 0x00, 0x00), /* ALPHANUMERIC DARK ORANGE */ |
| 1048 | | M6847_RGB(0xff, 0x81, 0x00) /* ALPHANUMERIC BRIGHT ORANGE */ |
| 1049 | | }; |
| 1050 | | |
| 1051 | | |
| 1052 | | |
| 1053 | | #define FACTOR_SCANLINES_PER_FRAME 2 |
| 1054 | | #define FACTOR_CLOCKS_PER_SCANLINE 2 |
| 1055 | | |
| 1056 | | #define GROSS_FACTOR (FACTOR_SCANLINES_PER_FRAME * FACTOR_CLOCKS_PER_SCANLINE) |
| 1057 | | |
| 1058 | | static const m6847_variant variants[] = |
| 1059 | | { |
| 1060 | | { |
| 1061 | | /* M6847_VERSION_ORIGINAL_NTSC */ |
| 1062 | | ntsc_square_fontdata8x12, |
| 1063 | | FALSE, 0, |
| 1064 | | 60, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1065 | | 13, 25, 192, 26, 6, |
| 1066 | | 13+25+192 /* field sync period */ |
| 1067 | | }, |
| 1068 | | { |
| 1069 | | /* M6847_VERSION_ORIGINAL_PAL */ |
| 1070 | | pal_square_fontdata8x12, |
| 1071 | | FALSE, 0, |
| 1072 | | 50, 262, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1073 | | 13, 25, 192, 26, 6, |
| 1074 | | 13+25+192 /* field sync period */ |
| 1075 | | }, |
| 1076 | | { |
| 1077 | | /* M6847_VERSION_M6847Y_NTSC */ |
| 1078 | | ntsc_square_fontdata8x12, |
| 1079 | | FALSE, 0, |
| 1080 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1081 | | 13.5, 25, 192, 26, 6, |
| 1082 | | 13+25+192 /* field sync period */ |
| 1083 | | }, |
| 1084 | | { |
| 1085 | | /* M6847_VERSION_M6847Y_PAL */ |
| 1086 | | pal_square_fontdata8x12, |
| 1087 | | FALSE, 0, |
| 1088 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1089 | | 13.5, 25, 192, 26, 6, |
| 1090 | | 13+25+192 /* field sync period */ |
| 1091 | | }, |
| 1092 | | { |
| 1093 | | /* M6847_VERSION_M6847T1_NTSC */ |
| 1094 | | ntsc_round_fontdata8x12, |
| 1095 | | TRUE, 0, |
| 1096 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1097 | | 13.5, 25, 192, 26, 6, |
| 1098 | | 13+25+192 /* field sync period */ |
| 1099 | | }, |
| 1100 | | { |
| 1101 | | /* M6847_VERSION_M6847T1_PAL */ |
| 1102 | | pal_round_fontdata8x12, |
| 1103 | | TRUE, 0, |
| 1104 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1105 | | 13.5, 25, 192, 26, 6, |
| 1106 | | 13+25+192 /* field sync period */ |
| 1107 | | }, |
| 1108 | | { |
| 1109 | | /* M6847_VERSION_GIME_NTSC */ |
| 1110 | | ntsc_round_fontdata8x12, |
| 1111 | | TRUE, 1, |
| 1112 | | 60, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1113 | | 13.5, 25, 192, 26, 6, |
| 1114 | | 262.5 - 3 /* field sync period */ |
| 1115 | | }, |
| 1116 | | { |
| 1117 | | /* M6847_VERSION_GIME_PAL */ |
| 1118 | | pal_round_fontdata8x12, |
| 1119 | | TRUE, 1, |
| 1120 | | 50, 262.5, 227.5, /* frames, scanlines, clocks per scanline */ |
| 1121 | | 13.5, 25, 192, 26, 6, |
| 1122 | | 262.5 - 3 /* field sync period */ |
| 1123 | | } |
| 1124 | | }; |
| 1125 | | |
| 1126 | | |
| 1127 | | |
| 1128 | | /***************************************************************************** |
| 1129 | | INLINE FUNCTIONS |
| 1130 | | *****************************************************************************/ |
| 1131 | | |
| 1132 | | INLINE mc6847_state *get_safe_token(device_t *device) |
| 1133 | | { |
| 1134 | | assert(device != NULL); |
| 1135 | | assert(device->type() == MC6847); |
| 1136 | | |
| 1137 | | return (mc6847_state *)downcast<legacy_device_base *>(device)->token(); |
| 1138 | | } |
| 1139 | | |
| 1140 | | |
| 1141 | | /************************************* |
| 1142 | | * |
| 1143 | | * Utilities |
| 1144 | | * |
| 1145 | | *************************************/ |
| 1146 | | |
| 1147 | | static UINT32 color(device_t *device, int c) |
| 1148 | | { |
| 1149 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1150 | | return mc6847->palette[c]; |
| 1151 | | } |
| 1152 | | |
| 1153 | | static int attr_index_from_attribute(device_t *device, UINT8 attr) |
| 1154 | | { |
| 1155 | | int result; |
| 1156 | | |
| 1157 | | result = ((attr & (M6847_AG | M6847_AS | M6847_INTEXT | M6847_INV | M6847_CSS)) >> 3) |
| 1158 | | | ((attr & (M6847_GM1 | M6847_GM0)) << 5); |
| 1159 | | |
| 1160 | | /* sanity check */ |
| 1161 | | assert(result < ARRAY_LENGTH(get_safe_token(device)->fontdata)); |
| 1162 | | return result; |
| 1163 | | } |
| 1164 | | |
| 1165 | | static UINT8 attribute_from_attr_index(device_t *device, int attr_index) |
| 1166 | | { |
| 1167 | | /* sanity check */ |
| 1168 | | assert(attr_index >= 0); |
| 1169 | | assert(attr_index < ARRAY_LENGTH(get_safe_token(device)->fontdata)); |
| 1170 | | |
| 1171 | | return (UINT8) ((attr_index & 0x1F) << 3) |
| 1172 | | | ((attr_index & 0x60) >> 5); |
| 1173 | | } |
| 1174 | | |
| 1175 | | |
| 1176 | | |
| 1177 | | /************************************* |
| 1178 | | * |
| 1179 | | * Scanline operations |
| 1180 | | * |
| 1181 | | *************************************/ |
| 1182 | | |
| 1183 | | static int get_scanline(mc6847_state *mc6847) |
| 1184 | | { |
| 1185 | | int result; |
| 1186 | | attotime duration; |
| 1187 | | |
| 1188 | | /* get the time since last field sync */ |
| 1189 | | duration = mc6847->hs_rise_timer->start() - mc6847->fs_rise_timer->start(); |
| 1190 | | assert_always(duration.seconds == 0, "get_scanline(): duration exceeds one second"); |
| 1191 | | |
| 1192 | | if (duration.attoseconds < mc6847->vblank_period) |
| 1193 | | { |
| 1194 | | result = -1; /* vblank */ |
| 1195 | | } |
| 1196 | | else |
| 1197 | | { |
| 1198 | | result = (duration.attoseconds - mc6847->vblank_period) |
| 1199 | | / mc6847->scanline_period; |
| 1200 | | } |
| 1201 | | return result; |
| 1202 | | } |
| 1203 | | |
| 1204 | | |
| 1205 | | |
| 1206 | | static offs_t scanline_to_address(mc6847_state *mc6847, int scanline) |
| 1207 | | { |
| 1208 | | if (mc6847->ag) |
| 1209 | | { |
| 1210 | | /* graphics */ |
| 1211 | | int gm = (mc6847->gm2 << 2) | (mc6847->gm1 << 1) | mc6847->gm0; |
| 1212 | | |
| 1213 | | switch (gm) |
| 1214 | | { |
| 1215 | | case 0: return (scanline / 3) * 0x10; |
| 1216 | | case 1: return (scanline / 3) * 0x10; |
| 1217 | | case 2: return (scanline / 3) * 0x20; |
| 1218 | | case 3: return (scanline / 2) * 0x20; |
| 1219 | | case 4: return (scanline / 2) * 0x20; |
| 1220 | | case 5: return (scanline / 1) * 0x10; |
| 1221 | | case 6: return (scanline / 1) * 0x20; |
| 1222 | | case 7: return (scanline / 1) * 0x20; |
| 1223 | | } |
| 1224 | | } |
| 1225 | | else |
| 1226 | | { |
| 1227 | | /* text, semi-graphics */ |
| 1228 | | return (scanline / 12) * 0x20; |
| 1229 | | } |
| 1230 | | |
| 1231 | | /* we never get here */ |
| 1232 | | return 0; |
| 1233 | | } |
| 1234 | | |
| 1235 | | |
| 1236 | | /* TODO: attributes should be read on demand rather then all at once */ |
| 1237 | | static UINT8 update_attributes(mc6847_state *mc6847) |
| 1238 | | { |
| 1239 | | if (!mc6847->in_gm0_func.isnull()) |
| 1240 | | mc6847->gm0 = mc6847->in_gm0_func(); |
| 1241 | | if (!mc6847->in_gm1_func.isnull()) |
| 1242 | | mc6847->gm1 = mc6847->in_gm1_func(); |
| 1243 | | if (!mc6847->in_gm2_func.isnull()) |
| 1244 | | mc6847->gm2 = mc6847->in_gm2_func(); |
| 1245 | | if (!mc6847->in_css_func.isnull()) |
| 1246 | | mc6847->css = mc6847->in_css_func(); |
| 1247 | | if (!mc6847->in_inv_func.isnull()) |
| 1248 | | mc6847->inv = mc6847->in_inv_func(); |
| 1249 | | if (!mc6847->in_intext_func.isnull()) |
| 1250 | | mc6847->intext = mc6847->in_intext_func(); |
| 1251 | | if (!mc6847->in_as_func.isnull()) |
| 1252 | | mc6847->as = mc6847->in_as_func(); |
| 1253 | | if (!mc6847->in_ag_func.isnull()) |
| 1254 | | mc6847->ag = mc6847->in_ag_func(); |
| 1255 | | |
| 1256 | | return (mc6847->ag << 7) | (mc6847->as << 6) | (mc6847->intext << 5) | (mc6847->inv << 4) | |
| 1257 | | (mc6847->css << 3) | (mc6847->gm2 << 2) | (mc6847->gm1 << 1) | mc6847->gm0; |
| 1258 | | } |
| 1259 | | |
| 1260 | | |
| 1261 | | INLINE void prepare_scanline(running_machine &machine, mc6847_state *mc6847, int xpos) |
| 1262 | | { |
| 1263 | | UINT8 attrs, data, attr; |
| 1264 | | int scanline; |
| 1265 | | int i, border_color; |
| 1266 | | int dirty; |
| 1267 | | m6847_pixel *scanline_data; |
| 1268 | | |
| 1269 | | scanline = get_scanline(mc6847); |
| 1270 | | |
| 1271 | | if (LOG_PREPARE) |
| 1272 | | logerror("m6847_prepare_scanline(): scanline=%d xpos=%d\n", scanline, xpos); |
| 1273 | | |
| 1274 | | if ((scanline >= 0) && (scanline < (mc6847->top_border_scanlines |
| 1275 | | + mc6847->display_scanlines + mc6847->bottom_border_scanlines))) |
| 1276 | | { |
| 1277 | | if (mc6847->using_custom) |
| 1278 | | { |
| 1279 | | mc6847->custom_prepare_scanline(scanline); |
| 1280 | | } |
| 1281 | | else |
| 1282 | | { |
| 1283 | | /* has the border color changed? */ |
| 1284 | | attrs = update_attributes(mc6847); |
| 1285 | | |
| 1286 | | /* commenting out cause it breaks the coco3 border, |
| 1287 | | * the whole 'attr' handling needs to be rewritten anyway |
| 1288 | | if (attrs != mc6847->attrs[scanline]) */ |
| 1289 | | { |
| 1290 | | mc6847->dirty = TRUE; |
| 1291 | | mc6847->attrs[scanline] = attrs; |
| 1292 | | |
| 1293 | | /* choose the border color */ |
| 1294 | | if (attrs & M6847_AG) |
| 1295 | | border_color = (attrs & M6847_CSS) ? BUFF : GREEN; |
| 1296 | | else if (mc6847->has_lowercase && (attrs & M6847_GM2)) |
| 1297 | | border_color = (attrs & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1298 | | else |
| 1299 | | border_color = BLACK; |
| 1300 | | |
| 1301 | | /* need to use palette table directly; border colors are constant */ |
| 1302 | | mc6847->border[scanline] = mc6847->palette[border_color]; |
| 1303 | | } |
| 1304 | | |
| 1305 | | /* is this a display scanline? */ |
| 1306 | | scanline -= mc6847->top_border_scanlines; |
| 1307 | | if ((scanline >= 0) && (scanline < mc6847->display_scanlines)) |
| 1308 | | { |
| 1309 | | offs_t addr = scanline_to_address(mc6847, scanline); |
| 1310 | | dirty = mc6847->dirty; |
| 1311 | | scanline_data = mc6847->screendata[scanline]; |
| 1312 | | |
| 1313 | | for (i = xpos; i < 32; i++) |
| 1314 | | { |
| 1315 | | data = mc6847->in_dd_func(addr + i); |
| 1316 | | attr = update_attributes(mc6847); |
| 1317 | | |
| 1318 | | if ((data != scanline_data[i].data) || (attr != scanline_data[i].attr)) |
| 1319 | | { |
| 1320 | | dirty = TRUE; |
| 1321 | | scanline_data[i].data = data; |
| 1322 | | scanline_data[i].attr = attr; |
| 1323 | | } |
| 1324 | | } |
| 1325 | | mc6847->dirty = dirty; |
| 1326 | | } |
| 1327 | | } |
| 1328 | | } |
| 1329 | | } |
| 1330 | | |
| 1331 | | |
| 1332 | | |
| 1333 | | void m6847_video_changed(void) |
| 1334 | | { |
| 1335 | | /* NPW 2-May-2006 - Commenting this out until we properly fix bug #878 */ |
| 1336 | | /* prepare_scanline(get_beamx() / 8); */ |
| 1337 | | } |
| 1338 | | |
| 1339 | | |
| 1340 | | |
| 1341 | | /************************************* |
| 1342 | | * |
| 1343 | | * Field sync/Horizontal sync timers |
| 1344 | | * |
| 1345 | | *************************************/ |
| 1346 | | |
| 1347 | | static TIMER_CALLBACK( hs_fall ) |
| 1348 | | { |
| 1349 | | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1350 | | |
| 1351 | | if (LOG_HS) |
| 1352 | | logerror("hs_fall(): time=%s\n", machine.time().as_string(ATTOTIME_STRING_PRECISION)); |
| 1353 | | |
| 1354 | | mc6847->hs = ASSERT_LINE; |
| 1355 | | mc6847->out_hs_func(mc6847->hs); |
| 1356 | | } |
| 1357 | | |
| 1358 | | static TIMER_CALLBACK( hs_rise ) |
| 1359 | | { |
| 1360 | | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1361 | | |
| 1362 | | if (LOG_HS) |
| 1363 | | logerror("hs_rise(): time=%s\n", machine.time().as_string(ATTOTIME_STRING_PRECISION)); |
| 1364 | | |
| 1365 | | mc6847->hs_rise_timer->adjust( |
| 1366 | | attotime(0, mc6847->scanline_period), 0); |
| 1367 | | mc6847->hs_fall_timer->adjust( |
| 1368 | | attotime(0, mc6847->horizontal_sync_period), 0); |
| 1369 | | |
| 1370 | | mc6847->hs = CLEAR_LINE; |
| 1371 | | mc6847->out_hs_func(mc6847->hs); |
| 1372 | | |
| 1373 | | prepare_scanline(machine, mc6847, 0); |
| 1374 | | } |
| 1375 | | |
| 1376 | | static TIMER_CALLBACK( fs_fall ) |
| 1377 | | { |
| 1378 | | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1379 | | |
| 1380 | | if (LOG_FS) |
| 1381 | | logerror("fs_fall(): time=%s scanline=%d\n", machine.time().as_string(ATTOTIME_STRING_PRECISION), get_scanline(mc6847)); |
| 1382 | | |
| 1383 | | mc6847->fs = ASSERT_LINE; |
| 1384 | | mc6847->out_fs_func(mc6847->fs); |
| 1385 | | } |
| 1386 | | |
| 1387 | | static TIMER_CALLBACK( fs_rise ) |
| 1388 | | { |
| 1389 | | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1390 | | |
| 1391 | | if (LOG_FS) |
| 1392 | | logerror("fs_rise(): time=%s scanline=%d\n", machine.time().as_string(ATTOTIME_STRING_PRECISION), get_scanline(mc6847)); |
| 1393 | | |
| 1394 | | /* adjust field sync falling edge timer */ |
| 1395 | | mc6847->fs_fall_timer->adjust( |
| 1396 | | attotime(0, mc6847->field_sync_period), 0); |
| 1397 | | |
| 1398 | | /* adjust horizontal sync rising timer */ |
| 1399 | | mc6847->hs_rise_timer->adjust(attotime::zero); |
| 1400 | | |
| 1401 | | /* this is a hook for the CoCo 3 code to extend this stuff */ |
| 1402 | | if (mc6847->new_frame_callback) |
| 1403 | | mc6847->using_custom = !mc6847->new_frame_callback(machine); |
| 1404 | | |
| 1405 | | mc6847->fs = CLEAR_LINE; |
| 1406 | | mc6847->out_fs_func(mc6847->fs); |
| 1407 | | } |
| 1408 | | |
| 1409 | | |
| 1410 | | |
| 1411 | | #if 0 |
| 1412 | | /************************************* |
| 1413 | | * |
| 1414 | | * Debugging |
| 1415 | | * |
| 1416 | | *************************************/ |
| 1417 | | |
| 1418 | | |
| 1419 | | static int get_beamx(mc6847_state *mc6847) |
| 1420 | | { |
| 1421 | | attotime scanline_time; |
| 1422 | | int result; |
| 1423 | | |
| 1424 | | scanline_time = mc6847->hs_rise_timer->elapsed(); |
| 1425 | | if (scanline_time.seconds != 0) |
| 1426 | | return 0; |
| 1427 | | assert(scanline.as_attoseconds() < mc6847->scanline_period); |
| 1428 | | |
| 1429 | | if (scanline.as_attoseconds() < (mc6847->clock_period * 42)) |
| 1430 | | { |
| 1431 | | /* hsync */ |
| 1432 | | result = 0; |
| 1433 | | } |
| 1434 | | else if (scanline.as_attoseconds() < (mc6847->clock_period * 95 / 2)) |
| 1435 | | { |
| 1436 | | /* left border */ |
| 1437 | | result = 0; |
| 1438 | | } |
| 1439 | | else if (scanline.as_attoseconds() < (mc6847->clock_period * 351 / 2)) |
| 1440 | | { |
| 1441 | | /* body */ |
| 1442 | | result = (scanline.as_attoseconds() - (mc6847->clock_period * 95 / 2)) |
| 1443 | | / mc6847->clock_period * 2; |
| 1444 | | } |
| 1445 | | else |
| 1446 | | { |
| 1447 | | /* right border */ |
| 1448 | | result = 256; |
| 1449 | | } |
| 1450 | | return result; |
| 1451 | | } |
| 1452 | | |
| 1453 | | |
| 1454 | | static void execute_m6847_dumpscanline(device_t *device, int ref, int params, const char **param) |
| 1455 | | { |
| 1456 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1457 | | |
| 1458 | | int i; |
| 1459 | | int beamx = get_beamx(mc6847) / 8; |
| 1460 | | int scanline = get_scanline(mc6847); |
| 1461 | | const m6847_pixel *pixel = mc6847->screendata[scanline]; |
| 1462 | | |
| 1463 | | for (i = 0; i < beamx; i++) |
| 1464 | | { |
| 1465 | | debug_console_printf(device->machine(), "[%02d]: 0x%02X (", i, pixel[i].data); |
| 1466 | | |
| 1467 | | if (pixel[i].attr & M6847_AG) debug_console_printf(device->machine(), " AG"); |
| 1468 | | if (pixel[i].attr & M6847_AS) debug_console_printf(device->machine(), " AS"); |
| 1469 | | if (pixel[i].attr & M6847_INTEXT) debug_console_printf(device->machine(), " INTEXT"); |
| 1470 | | if (pixel[i].attr & M6847_INV) debug_console_printf(device->machine(), " INV"); |
| 1471 | | if (pixel[i].attr & M6847_CSS) debug_console_printf(device->machine(), " CSS"); |
| 1472 | | if (pixel[i].attr & M6847_GM2) debug_console_printf(device->machine(), " GM2"); |
| 1473 | | if (pixel[i].attr & M6847_GM1) debug_console_printf(device->machine(), " GM1"); |
| 1474 | | if (pixel[i].attr & M6847_GM0) debug_console_printf(device->machine(), " GM0"); |
| 1475 | | |
| 1476 | | debug_console_printf(device->machine(), " )\n"); |
| 1477 | | } |
| 1478 | | } |
| 1479 | | #endif |
| 1480 | | |
| 1481 | | |
| 1482 | | |
| 1483 | | /************************************* |
| 1484 | | * |
| 1485 | | * Initialization |
| 1486 | | * |
| 1487 | | *************************************/ |
| 1488 | | |
| 1489 | | static const UINT8 *find_char(const m6847_variant *v, |
| 1490 | | UINT8 byte, UINT8 attr, int *fg, int *bg) |
| 1491 | | { |
| 1492 | | int ch; |
| 1493 | | size_t offset = 0; |
| 1494 | | |
| 1495 | | if (attr & M6847_AS) |
| 1496 | | { |
| 1497 | | /* semigraphics */ |
| 1498 | | *bg = BLACK; |
| 1499 | | |
| 1500 | | if (!v->has_lowercase && (attr & M6847_INTEXT)) |
| 1501 | | { |
| 1502 | | /* semigraphics 6 */ |
| 1503 | | ch = (byte & 0x3F) + 0x60; |
| 1504 | | *fg = ((byte >> 6) & 0x03) + ((attr & M6847_CSS) ? BUFF : GREEN); |
| 1505 | | } |
| 1506 | | else |
| 1507 | | { |
| 1508 | | /* semigraphics 4 */ |
| 1509 | | ch = (byte & 0x0F) + 0xA0; |
| 1510 | | *fg = ((byte >> 4) & 0x07) + GREEN; |
| 1511 | | } |
| 1512 | | } |
| 1513 | | else |
| 1514 | | { |
| 1515 | | /* text */ |
| 1516 | | ch = (byte & 0x3F) + 0x00; |
| 1517 | | |
| 1518 | | if (v->has_lowercase) |
| 1519 | | { |
| 1520 | | if ((ch < 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) |
| 1521 | | { |
| 1522 | | /* this is a lowercase character */ |
| 1523 | | attr |= M6847_INV; |
| 1524 | | ch += 0x40; |
| 1525 | | } |
| 1526 | | |
| 1527 | | if ((ch > 0x20) && (attr & M6847_GM0) && !(attr & M6847_INV)) { |
| 1528 | | ch += 0x20; |
| 1529 | | } |
| 1530 | | |
| 1531 | | if (attr & M6847_GM1) |
| 1532 | | attr ^= M6847_INV; |
| 1533 | | |
| 1534 | | } |
| 1535 | | |
| 1536 | | if (attr & M6847_INV) |
| 1537 | | { |
| 1538 | | /* dark foreground, light background */ |
| 1539 | | *fg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1540 | | *bg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1541 | | } |
| 1542 | | else |
| 1543 | | { |
| 1544 | | /* light foreground, dark background */ |
| 1545 | | *fg = (attr & M6847_CSS) ? LTORANGE : LTGREEN; |
| 1546 | | *bg = (attr & M6847_CSS) ? DKORANGE : DKGREEN; |
| 1547 | | } |
| 1548 | | |
| 1549 | | offset = v->text_offset; |
| 1550 | | } |
| 1551 | | |
| 1552 | | return &v->fontdata[ch * 12] + offset; |
| 1553 | | } |
| 1554 | | |
| 1555 | | |
| 1556 | | |
| 1557 | | static void build_fontdata(device_t *device, const m6847_variant *v) |
| 1558 | | { |
| 1559 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1560 | | |
| 1561 | | int attr_index, row; |
| 1562 | | int fg, bg; |
| 1563 | | int byte; |
| 1564 | | const UINT8 *char_data; |
| 1565 | | |
| 1566 | | for (attr_index = 0; attr_index < ARRAY_LENGTH(mc6847->fontdata); attr_index++) |
| 1567 | | { |
| 1568 | | UINT8 attr = attribute_from_attr_index(device, attr_index); |
| 1569 | | |
| 1570 | | for (byte = 0; byte < 256; byte++) |
| 1571 | | { |
| 1572 | | char_data = find_char(v, byte, attr, &fg, &bg); |
| 1573 | | |
| 1574 | | /* specify colors */ |
| 1575 | | mc6847->colordata[attr_index][byte / 16][0] = bg; |
| 1576 | | mc6847->colordata[attr_index][byte / 16][1] = fg; |
| 1577 | | |
| 1578 | | for (row = 0; row < 12; row++) |
| 1579 | | { |
| 1580 | | mc6847->fontdata[attr_index][byte][row] = char_data[row]; |
| 1581 | | } |
| 1582 | | } |
| 1583 | | } |
| 1584 | | } |
| 1585 | | |
| 1586 | | |
| 1587 | | |
| 1588 | | /************************************* |
| 1589 | | * |
| 1590 | | * Video modes |
| 1591 | | * |
| 1592 | | *************************************/ |
| 1593 | | |
| 1594 | | static void graphics_color_64(device_t *device, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1595 | | { |
| 1596 | | int x; |
| 1597 | | UINT8 byte, attr; |
| 1598 | | |
| 1599 | | for (x = 0; x < 16; x++) |
| 1600 | | { |
| 1601 | | byte = video_data[x].data; |
| 1602 | | attr = video_data[x].attr; |
| 1603 | | |
| 1604 | | line[ 0] = line[ 1] = line[ 2] = line[ 3] = color(device, ((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1605 | | line[ 4] = line[ 5] = line[ 6] = line[ 7] = color(device, ((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1606 | | line[ 8] = line[ 9] = line[10] = line[11] = color(device, ((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1607 | | line[12] = line[13] = line[14] = line[15] = color(device, ((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1608 | | line += 16; |
| 1609 | | } |
| 1610 | | } |
| 1611 | | |
| 1612 | | |
| 1613 | | |
| 1614 | | static void graphics_color_128(device_t *device, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1615 | | { |
| 1616 | | int x; |
| 1617 | | UINT8 byte, attr; |
| 1618 | | |
| 1619 | | for (x = 0; x < 32; x++) |
| 1620 | | { |
| 1621 | | byte = video_data[x].data; |
| 1622 | | attr = video_data[x].attr; |
| 1623 | | |
| 1624 | | line[ 0] = line[ 1] = color(device, ((byte >> 6) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1625 | | line[ 2] = line[ 3] = color(device, ((byte >> 4) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1626 | | line[ 4] = line[ 5] = color(device, ((byte >> 2) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1627 | | line[ 6] = line[ 7] = color(device, ((byte >> 0) & 0x03) + (attr & M6847_CSS ? BUFF : GREEN)); |
| 1628 | | line += 8; |
| 1629 | | } |
| 1630 | | } |
| 1631 | | |
| 1632 | | |
| 1633 | | |
| 1634 | | static void graphics_bw_128(device_t *device, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1635 | | { |
| 1636 | | int x; |
| 1637 | | UINT8 byte, attr; |
| 1638 | | UINT32 bg, fg; |
| 1639 | | |
| 1640 | | for (x = 0; x < 16; x++) |
| 1641 | | { |
| 1642 | | byte = video_data[x].data; |
| 1643 | | attr = video_data[x].attr; |
| 1644 | | |
| 1645 | | bg = color(device, attr & M6847_CSS ? 10 : 8); |
| 1646 | | fg = color(device, attr & M6847_CSS ? 11 : 9); |
| 1647 | | |
| 1648 | | line[ 0] = line[ 1] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1649 | | line[ 2] = line[ 3] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1650 | | line[ 4] = line[ 5] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1651 | | line[ 6] = line[ 7] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1652 | | line[ 8] = line[ 9] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1653 | | line[10] = line[11] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1654 | | line[12] = line[13] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1655 | | line[14] = line[15] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1656 | | line += 16; |
| 1657 | | } |
| 1658 | | } |
| 1659 | | |
| 1660 | | |
| 1661 | | |
| 1662 | | static void graphics_bw_256(device_t *device, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1663 | | { |
| 1664 | | int x; |
| 1665 | | UINT8 byte, attr; |
| 1666 | | UINT32 bg, fg; |
| 1667 | | |
| 1668 | | for (x = 0; x < 32; x++) |
| 1669 | | { |
| 1670 | | byte = video_data[x].data; |
| 1671 | | attr = video_data[x].attr; |
| 1672 | | |
| 1673 | | bg = color(device, attr & M6847_CSS ? 10 : 8); |
| 1674 | | fg = color(device, attr & M6847_CSS ? 11 : 9); |
| 1675 | | |
| 1676 | | line[0] = ((byte >> 7) & 0x01) ? fg : bg; |
| 1677 | | line[1] = ((byte >> 6) & 0x01) ? fg : bg; |
| 1678 | | line[2] = ((byte >> 5) & 0x01) ? fg : bg; |
| 1679 | | line[3] = ((byte >> 4) & 0x01) ? fg : bg; |
| 1680 | | line[4] = ((byte >> 3) & 0x01) ? fg : bg; |
| 1681 | | line[5] = ((byte >> 2) & 0x01) ? fg : bg; |
| 1682 | | line[6] = ((byte >> 1) & 0x01) ? fg : bg; |
| 1683 | | line[7] = ((byte >> 0) & 0x01) ? fg : bg; |
| 1684 | | line += 8; |
| 1685 | | } |
| 1686 | | } |
| 1687 | | |
| 1688 | | |
| 1689 | | |
| 1690 | | static void (*const graphics_modes[8])(device_t *device, UINT32 *line, const m6847_pixel *video_data) = |
| 1691 | | { |
| 1692 | | graphics_color_64, graphics_bw_128, |
| 1693 | | graphics_color_128, graphics_bw_128, |
| 1694 | | graphics_color_128, graphics_bw_128, |
| 1695 | | graphics_color_128, graphics_bw_256 |
| 1696 | | }; |
| 1697 | | |
| 1698 | | |
| 1699 | | |
| 1700 | | static void text_mode(device_t *device, int scanline, UINT32 *RESTRICT line, const m6847_pixel *RESTRICT video_data) |
| 1701 | | { |
| 1702 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1703 | | int x; |
| 1704 | | UINT8 byte, attr; |
| 1705 | | int attr_index; |
| 1706 | | UINT32 bg_color, fg_color; |
| 1707 | | UINT8 char_data; |
| 1708 | | |
| 1709 | | for (x = 0; x < 32; x++) |
| 1710 | | { |
| 1711 | | byte = video_data[x].data; |
| 1712 | | attr = video_data[x].attr; |
| 1713 | | |
| 1714 | | attr_index = attr_index_from_attribute(device, attr); |
| 1715 | | |
| 1716 | | bg_color = color(device, mc6847->colordata[attr_index][byte / 16][0]); |
| 1717 | | fg_color = color(device, mc6847->colordata[attr_index][byte / 16][1]); |
| 1718 | | |
| 1719 | | if( (!mc6847->has_lowercase) && (attr & M6847_INTEXT) && !(attr & M6847_AS)) { |
| 1720 | | if (mc6847->get_char_rom) { |
| 1721 | | char_data = mc6847->get_char_rom(device->machine(),byte,scanline % 12); |
| 1722 | | } else { |
| 1723 | | char_data = 0xff; |
| 1724 | | } |
| 1725 | | } else { |
| 1726 | | if ((attr & M6847_INTEXT) && !(attr & M6847_AS) && mc6847->get_char_rom) |
| 1727 | | char_data = mc6847->get_char_rom(device->machine(),byte,scanline % 12); |
| 1728 | | else |
| 1729 | | char_data = mc6847->fontdata[attr_index][byte][scanline % 12]; |
| 1730 | | } |
| 1731 | | |
| 1732 | | line[x*8+0] = (char_data & 0x80) ? fg_color : bg_color; |
| 1733 | | line[x*8+1] = (char_data & 0x40) ? fg_color : bg_color; |
| 1734 | | line[x*8+2] = (char_data & 0x20) ? fg_color : bg_color; |
| 1735 | | line[x*8+3] = (char_data & 0x10) ? fg_color : bg_color; |
| 1736 | | line[x*8+4] = (char_data & 0x08) ? fg_color : bg_color; |
| 1737 | | line[x*8+5] = (char_data & 0x04) ? fg_color : bg_color; |
| 1738 | | line[x*8+6] = (char_data & 0x02) ? fg_color : bg_color; |
| 1739 | | line[x*8+7] = (char_data & 0x01) ? fg_color : bg_color; |
| 1740 | | } |
| 1741 | | } |
| 1742 | | |
| 1743 | | |
| 1744 | | |
| 1745 | | static void render_scanline(device_t *device, bitmap_t *bitmap, int scanline) |
| 1746 | | { |
| 1747 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1748 | | UINT32 border_color; |
| 1749 | | UINT32 *line; |
| 1750 | | UINT8 attrs; |
| 1751 | | int mode, x; |
| 1752 | | const m6847_pixel *video_data; |
| 1753 | | |
| 1754 | | /* get the scanline */ |
| 1755 | | line = BITMAP_ADDR32(bitmap, scanline, 0); |
| 1756 | | |
| 1757 | | /* choose the border color */ |
| 1758 | | border_color = mc6847->border[scanline]; |
| 1759 | | attrs = mc6847->attrs[scanline]; |
| 1760 | | |
| 1761 | | /* is this a border scanline? */ |
| 1762 | | scanline -= mc6847->top_border_scanlines; |
| 1763 | | if ((scanline >= 0) && (scanline < mc6847->display_scanlines)) |
| 1764 | | { |
| 1765 | | video_data = mc6847->screendata[scanline]; |
| 1766 | | |
| 1767 | | /* left border */ |
| 1768 | | for (x = 0; x < 32; x++) |
| 1769 | | line[x] = border_color; |
| 1770 | | |
| 1771 | | if (attrs & M6847_AG) |
| 1772 | | { |
| 1773 | | /* graphics */ |
| 1774 | | mode = attrs & (M6847_GM2|M6847_GM1|M6847_GM0); |
| 1775 | | graphics_modes[mode](device, line + 32, video_data); |
| 1776 | | } |
| 1777 | | else |
| 1778 | | { |
| 1779 | | /* text/semigraphics */ |
| 1780 | | text_mode(device, scanline, line + 32, video_data); |
| 1781 | | } |
| 1782 | | |
| 1783 | | /* right border */ |
| 1784 | | for (x = 288; x < 320; x++) |
| 1785 | | line[x] = border_color; |
| 1786 | | |
| 1787 | | /* special case for artifacting */ |
| 1788 | | if ((attrs & (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1789 | | == (M6847_AG|M6847_GM2|M6847_GM1|M6847_GM0)) |
| 1790 | | { |
| 1791 | | apply_artifacts(device, line + 32); |
| 1792 | | } |
| 1793 | | } |
| 1794 | | else |
| 1795 | | { |
| 1796 | | /* we are drawing a border */ |
| 1797 | | for (x = 0; x < bitmap->width; x++) |
| 1798 | | line[x] = border_color; |
| 1799 | | } |
| 1800 | | } |
| 1801 | | |
| 1802 | | |
| 1803 | | |
| 1804 | | static void set_dirty(mc6847_state *mc6847) |
| 1805 | | { |
| 1806 | | mc6847->dirty = TRUE; |
| 1807 | | } |
| 1808 | | |
| 1809 | | |
| 1810 | | |
| 1811 | | /***************************************************************************** |
| 1812 | | DEVICE INTERFACE |
| 1813 | | *****************************************************************************/ |
| 1814 | | |
| 1815 | | static void mc6847_postload(mc6847_state *state) |
| 1816 | | { |
| 1817 | | set_dirty(state); |
| 1818 | | } |
| 1819 | | |
| 1820 | | static DEVICE_START( mc6847 ) |
| 1821 | | { |
| 1822 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1823 | | const mc6847_interface *intf = (mc6847_interface *)device->static_config(); |
| 1824 | | const mc6847_config *cfg = (mc6847_config *)downcast<const legacy_device_base *>(device)->inline_config(); |
| 1825 | | |
| 1826 | | const m6847_variant *v; |
| 1827 | | UINT32 frequency; |
| 1828 | | attoseconds_t period, frame_period; |
| 1829 | | double total_scanlines; |
| 1830 | | |
| 1831 | | /* validate some basic stuff */ |
| 1832 | | assert(device->static_config() != NULL); |
| 1833 | | assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL); |
| 1834 | | |
| 1835 | | /* identify proper M6847 variant */ |
| 1836 | | assert(cfg->type < ARRAY_LENGTH(variants)); |
| 1837 | | v = &variants[cfg->type]; |
| 1838 | | |
| 1839 | | /* allocate instance */ |
| 1840 | | set_dirty(mc6847); |
| 1841 | | |
| 1842 | | /* copy configuration */ |
| 1843 | | mc6847->new_frame_callback = cfg->new_frame_callback; |
| 1844 | | mc6847->custom_prepare_scanline = cfg->custom_prepare_scanline; |
| 1845 | | mc6847->has_lowercase = v->has_lowercase; |
| 1846 | | mc6847->get_char_rom = cfg->get_char_rom; |
| 1847 | | |
| 1848 | | /* assert our assumptions */ |
| 1849 | | assert((v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME) |
| 1850 | | == (UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)); |
| 1851 | | assert((v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE) |
| 1852 | | == (UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1853 | | assert((v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR) |
| 1854 | | == (UINT32) (v->scanlines_per_frame * v->clocks_per_scanline * GROSS_FACTOR)); |
| 1855 | | |
| 1856 | | /* choose palette */ |
| 1857 | | if (cfg->custom_palette) |
| 1858 | | { |
| 1859 | | mc6847->has_custom_palette = 1; |
| 1860 | | mc6847->palette = cfg->custom_palette; |
| 1861 | | } |
| 1862 | | else |
| 1863 | | { |
| 1864 | | mc6847->palette = default_palette; |
| 1865 | | } |
| 1866 | | |
| 1867 | | /* allocate timers */ |
| 1868 | | mc6847->fs_rise_timer = device->machine().scheduler().timer_alloc(FUNC(fs_rise), mc6847); |
| 1869 | | mc6847->fs_fall_timer = device->machine().scheduler().timer_alloc(FUNC(fs_fall), mc6847); |
| 1870 | | mc6847->hs_rise_timer = device->machine().scheduler().timer_alloc(FUNC(hs_rise), mc6847); |
| 1871 | | mc6847->hs_fall_timer = device->machine().scheduler().timer_alloc(FUNC(hs_fall), mc6847); |
| 1872 | | |
| 1873 | | /* setup dimensions */ |
| 1874 | | mc6847->top_border_scanlines = v->top_border_scanlines; |
| 1875 | | mc6847->display_scanlines = v->display_scanlines; |
| 1876 | | mc6847->bottom_border_scanlines = v->bottom_border_scanlines; |
| 1877 | | |
| 1878 | | /* compute frequency and period */ |
| 1879 | | frequency = v->frames_per_second |
| 1880 | | * ((UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)) |
| 1881 | | * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1882 | | period = ATTOSECONDS_PER_SECOND / frequency; |
| 1883 | | |
| 1884 | | /* calculate timing */ |
| 1885 | | total_scanlines = v->vblank_scanlines |
| 1886 | | + v->top_border_scanlines |
| 1887 | | + v->display_scanlines |
| 1888 | | + v->bottom_border_scanlines |
| 1889 | | + v->vretrace_scanlines; |
| 1890 | | mc6847->clock_period = period * GROSS_FACTOR; |
| 1891 | | mc6847->scanline_period = period * (UINT32) (v->clocks_per_scanline * GROSS_FACTOR); |
| 1892 | | mc6847->field_sync_period = period * (UINT32) (v->clocks_per_scanline * v->field_sync_scanlines * GROSS_FACTOR); |
| 1893 | | mc6847->horizontal_sync_period = period * GROSS_FACTOR * 33 / 2; |
| 1894 | | mc6847->vblank_period = period * (UINT32) (v->clocks_per_scanline * v->vblank_scanlines * GROSS_FACTOR); |
| 1895 | | |
| 1896 | | /* setup timing */ |
| 1897 | | frame_period = period * |
| 1898 | | (UINT32) (v->clocks_per_scanline * total_scanlines * GROSS_FACTOR); |
| 1899 | | mc6847->fs_rise_timer->adjust(attotime::zero, 0, attotime(0, frame_period)); |
| 1900 | | |
| 1901 | | /* build font */ |
| 1902 | | build_fontdata(device, v); |
| 1903 | | |
| 1904 | | /* dump stats */ |
| 1905 | | if (LOG_STATS) |
| 1906 | | { |
| 1907 | | logerror("m6847_init():\n"); |
| 1908 | | logerror("\tclock: %30s sec\n", attotime(0, period * GROSS_FACTOR).as_string(ATTOTIME_STRING_PRECISION)); |
| 1909 | | logerror("\tscanline: %30s sec\n", attotime(0, mc6847->scanline_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1910 | | logerror("\tfield sync: %30s sec\n", attotime(0, mc6847->field_sync_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1911 | | logerror("\thorz sync: %30s sec\n", attotime(0, mc6847->horizontal_sync_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1912 | | logerror("\tvblank: %30s sec\n", attotime(0, mc6847->vblank_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1913 | | logerror("\tframe: %30s sec\n", attotime(0, frame_period).as_string(ATTOTIME_STRING_PRECISION)); |
| 1914 | | logerror("\n"); |
| 1915 | | } |
| 1916 | | |
| 1917 | | #if 0 |
| 1918 | | /* setup debug commands */ |
| 1919 | | if (device->machine().debug_flags & DEBUG_FLAG_ENABLED) |
| 1920 | | debug_console_register_command(device->machine(), "m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_m6847_dumpscanline); |
| 1921 | | #endif |
| 1922 | | |
| 1923 | | |
| 1924 | | /* resolve callbacks */ |
| 1925 | | mc6847->in_dd_func.resolve(intf->in_dd_func, *device); |
| 1926 | | mc6847->in_gm2_func.resolve(intf->in_gm2_func, *device); |
| 1927 | | mc6847->in_gm1_func.resolve(intf->in_gm1_func, *device); |
| 1928 | | mc6847->in_gm0_func.resolve(intf->in_gm0_func, *device); |
| 1929 | | mc6847->in_intext_func.resolve(intf->in_intext_func, *device); |
| 1930 | | mc6847->in_inv_func.resolve(intf->in_inv_func, *device); |
| 1931 | | mc6847->in_as_func.resolve(intf->in_as_func, *device); |
| 1932 | | mc6847->in_ag_func.resolve(intf->in_ag_func, *device); |
| 1933 | | mc6847->out_fs_func.resolve(intf->out_fs_func, *device); |
| 1934 | | mc6847->out_hs_func.resolve(intf->out_hs_func, *device); |
| 1935 | | mc6847->in_css_func.resolve(intf->in_css_func, *device); |
| 1936 | | |
| 1937 | | /* setup save states */ |
| 1938 | | device->machine().save().register_postload(save_prepost_delegate(FUNC(mc6847_postload), mc6847)); |
| 1939 | | } |
| 1940 | | |
| 1941 | | static DEVICE_RESET( mc6847 ) |
| 1942 | | { |
| 1943 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1944 | | |
| 1945 | | mc6847->gm2 = 0; |
| 1946 | | mc6847->gm1 = 0; |
| 1947 | | mc6847->gm0 = 0; |
| 1948 | | mc6847->intext = 0; |
| 1949 | | mc6847->inv = 0; |
| 1950 | | mc6847->as = 0; |
| 1951 | | mc6847->ag = 0; |
| 1952 | | mc6847->css = 0; |
| 1953 | | } |
| 1954 | | |
| 1955 | | DEVICE_GET_INFO( mc6847 ) |
| 1956 | | { |
| 1957 | | switch (state) |
| 1958 | | { |
| 1959 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1960 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(mc6847_state); break; |
| 1961 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(mc6847_config); break; |
| 1962 | | |
| 1963 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1964 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(mc6847); break; |
| 1965 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 1966 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(mc6847); break; |
| 1967 | | |
| 1968 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1969 | | case DEVINFO_STR_NAME: strcpy(info->s, "Motorola 6847"); break; |
| 1970 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "MC6847 VDG"); break; |
| 1971 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 1972 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 1973 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 1974 | | } |
| 1975 | | } |
| 1976 | | |
| 1977 | | |
| 1978 | | /*************************************************************************** |
| 1979 | | IMPLEMENTATION |
| 1980 | | ***************************************************************************/ |
| 1981 | | |
| 1982 | | WRITE_LINE_DEVICE_HANDLER( mc6847_gm2_w ) |
| 1983 | | { |
| 1984 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1985 | | mc6847->gm2 = state; |
| 1986 | | } |
| 1987 | | |
| 1988 | | WRITE_LINE_DEVICE_HANDLER( mc6847_gm1_w ) |
| 1989 | | { |
| 1990 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1991 | | mc6847->gm1 = state; |
| 1992 | | } |
| 1993 | | |
| 1994 | | WRITE_LINE_DEVICE_HANDLER( mc6847_gm0_w ) |
| 1995 | | { |
| 1996 | | mc6847_state *mc6847 = get_safe_token(device); |
| 1997 | | mc6847->gm0 = state; |
| 1998 | | } |
| 1999 | | |
| 2000 | | WRITE_LINE_DEVICE_HANDLER( mc6847_intext_w ) |
| 2001 | | { |
| 2002 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2003 | | mc6847->intext = state; |
| 2004 | | } |
| 2005 | | |
| 2006 | | WRITE_LINE_DEVICE_HANDLER( mc6847_inv_w ) |
| 2007 | | { |
| 2008 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2009 | | mc6847->inv = state; |
| 2010 | | } |
| 2011 | | |
| 2012 | | WRITE_LINE_DEVICE_HANDLER( mc6847_as_w ) |
| 2013 | | { |
| 2014 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2015 | | mc6847->as = state; |
| 2016 | | } |
| 2017 | | |
| 2018 | | WRITE_LINE_DEVICE_HANDLER( mc6847_ag_w ) |
| 2019 | | { |
| 2020 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2021 | | mc6847->ag = state; |
| 2022 | | } |
| 2023 | | |
| 2024 | | WRITE_LINE_DEVICE_HANDLER( mc6847_css_w ) |
| 2025 | | { |
| 2026 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2027 | | mc6847->css = state; |
| 2028 | | } |
| 2029 | | |
| 2030 | | READ_LINE_DEVICE_HANDLER( mc6847_fs_r ) |
| 2031 | | { |
| 2032 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2033 | | return mc6847->fs; |
| 2034 | | } |
| 2035 | | |
| 2036 | | READ_LINE_DEVICE_HANDLER( mc6847_hs_r ) |
| 2037 | | { |
| 2038 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2039 | | return mc6847->hs; |
| 2040 | | } |
| 2041 | | |
| 2042 | | |
| 2043 | | void mc6847_set_palette(device_t *device, UINT32 *palette) |
| 2044 | | { |
| 2045 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2046 | | mc6847->has_custom_palette = 1; |
| 2047 | | mc6847->palette = palette; |
| 2048 | | } |
| 2049 | | |
| 2050 | | |
| 2051 | | /************************************* |
| 2052 | | * |
| 2053 | | * Artifacting hack; should be in core |
| 2054 | | * |
| 2055 | | *************************************/ |
| 2056 | | |
| 2057 | | static UINT32 mix_color(double factor, UINT8 c0, UINT8 c1) |
| 2058 | | { |
| 2059 | | return (UINT32) (UINT8) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5); |
| 2060 | | } |
| 2061 | | |
| 2062 | | |
| 2063 | | |
| 2064 | | static void apply_artifacts(device_t *device, UINT32 *line) |
| 2065 | | { |
| 2066 | | /* Boy this code sucks; this code was adapted from the old M6847 |
| 2067 | | * artifacting implmentation. The only reason that it didn't look as |
| 2068 | | * horrible was because the code around it sucked as well. Now that I |
| 2069 | | * have cleaned everything up, the ugliness is much more prominent. |
| 2070 | | * |
| 2071 | | * Hopefully we will have a generic artifacting algorithm that plugs into |
| 2072 | | * the MESS/MAME core directly so we can chuck this hack */ |
| 2073 | | static const double artifact_colors[14*3] = |
| 2074 | | { |
| 2075 | | 0.157, 0.000, 0.157, /* [ 1] - dk purple (reverse 2) */ |
| 2076 | | 0.000, 0.157, 0.000, /* [ 2] - dk green (reverse 1) */ |
| 2077 | | 1.000, 0.824, 1.000, /* [ 3] - lt purple (reverse 4) */ |
| 2078 | | 0.824, 1.000, 0.824, /* [ 4] - lt green (reverse 3) */ |
| 2079 | | 0.706, 0.236, 0.118, /* [ 5] - dk blue (reverse 6) */ |
| 2080 | | 0.000, 0.197, 0.471, /* [ 6] - dk red (reverse 5) */ |
| 2081 | | 1.000, 0.550, 0.393, /* [ 7] - lt blue (reverse 8) */ |
| 2082 | | 0.275, 0.785, 1.000, /* [ 8] - lt red (reverse 7) */ |
| 2083 | | 0.000, 0.500, 1.000, /* [ 9] - red (reverse 10) */ |
| 2084 | | 1.000, 0.500, 0.000, /* [10] - blue (reverse 9) */ |
| 2085 | | 1.000, 0.942, 0.785, /* [11] - cyan (reverse 12) */ |
| 2086 | | 0.393, 0.942, 1.000, /* [12] - yellow (reverse 11) */ |
| 2087 | | 0.236, 0.000, 0.000, /* [13] - black-blue (reverse 14) */ |
| 2088 | | 0.000, 0.000, 0.236 /* [14] - black-red (reverse 13) */ |
| 2089 | | }; |
| 2090 | | |
| 2091 | | static const UINT8 artifactcorrection[128] = |
| 2092 | | { |
| 2093 | | 0, 0, 0, 0, 0, 6, 0, 2, |
| 2094 | | 5, 7, 5, 7, 1, 3, 1, 11, |
| 2095 | | 8, 6, 8, 14, 8, 9, 8, 9, |
| 2096 | | 4, 4, 4, 15, 12, 12, 12, 15, |
| 2097 | | |
| 2098 | | 5, 13, 5, 13, 13, 0, 13, 2, |
| 2099 | | 10, 10, 10, 10, 10, 15, 10, 11, |
| 2100 | | 3, 1, 3, 1, 15, 9, 15, 9, |
| 2101 | | 11, 11, 11, 11, 15, 15, 15, 15, |
| 2102 | | |
| 2103 | | 14, 0, 14, 0, 14, 6, 14, 2, |
| 2104 | | 0, 7, 0, 7, 1, 3, 1, 11, |
| 2105 | | 9, 6, 9, 14, 9, 9, 9, 9, |
| 2106 | | 15, 4, 15, 15, 12, 12, 12, 15, |
| 2107 | | |
| 2108 | | 2, 13, 2, 13, 2, 0, 2, 2, |
| 2109 | | 10, 10, 10, 10, 10, 15, 10, 11, |
| 2110 | | 12, 1, 12, 1, 12, 9, 12, 9, |
| 2111 | | 15, 11, 15, 11, 15, 15, 15, 15 |
| 2112 | | }; |
| 2113 | | |
| 2114 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2115 | | UINT32 artifacting, c0, c1; |
| 2116 | | UINT32 colors[16]; |
| 2117 | | const double *factors; |
| 2118 | | UINT8 val; |
| 2119 | | UINT32 new_line[256]; |
| 2120 | | int i; |
| 2121 | | |
| 2122 | | /* are we artifacting? */ |
| 2123 | | artifacting = input_port_read_safe(device->machine(), "artifacting", 0x00) & 0x03; |
| 2124 | | if (artifacting == 0x00) |
| 2125 | | return; |
| 2126 | | artifacting &= 0x01; |
| 2127 | | |
| 2128 | | /* determine the base artifact colors */ |
| 2129 | | c1 = line[-1]; |
| 2130 | | for (i = 0; i < 256; i++) |
| 2131 | | { |
| 2132 | | if (line[i] != c1) |
| 2133 | | break; |
| 2134 | | } |
| 2135 | | if (i >= 256) |
| 2136 | | return; /* if everything is the same color as the border, no need for anything */ |
| 2137 | | c0 = line[i]; |
| 2138 | | |
| 2139 | | /* do we need to update our artifact colors table? */ |
| 2140 | | if ((artifacting != mc6847->saved_artifacting) || (c0 != mc6847->saved_c0) || (c1 != mc6847->saved_c1)) |
| 2141 | | { |
| 2142 | | mc6847->saved_artifacting = artifacting; |
| 2143 | | mc6847->saved_c0 = colors[0] = c0; |
| 2144 | | mc6847->saved_c1 = colors[15] = c1; |
| 2145 | | |
| 2146 | | /* mix the other colors */ |
| 2147 | | for (i = 1; i <= 14; i++) |
| 2148 | | { |
| 2149 | | factors = &artifact_colors[((i - 1) ^ artifacting) * 3]; |
| 2150 | | |
| 2151 | | colors[i] = (mix_color(factors[0], c0 >> 16, c1 >> 16) << 16) |
| 2152 | | | (mix_color(factors[1], c0 >> 8, c1 >> 8) << 8) |
| 2153 | | | (mix_color(factors[2], c0 >> 0, c1 >> 0) << 0); |
| 2154 | | } |
| 2155 | | for (i = 0; i < 128; i++) |
| 2156 | | mc6847->expanded_colors[i] = colors[artifactcorrection[i]]; |
| 2157 | | } |
| 2158 | | |
| 2159 | | /* artifact the line */ |
| 2160 | | for (i = 0; i < 256; i += 2) |
| 2161 | | { |
| 2162 | | val = ((line[i - 2] == c1) ? 0x20 : 0x00) |
| 2163 | | | ((line[i - 1] == c1) ? 0x10 : 0x00) |
| 2164 | | | ((line[i + 0] == c1) ? 0x08 : 0x00) |
| 2165 | | | ((line[i + 1] == c1) ? 0x04 : 0x00) |
| 2166 | | | ((line[i + 2] == c1) ? 0x02 : 0x00) |
| 2167 | | | ((line[i + 3] == c1) ? 0x01 : 0x00); |
| 2168 | | |
| 2169 | | new_line[i + 0] = mc6847->expanded_colors[val * 2 + 0]; |
| 2170 | | new_line[i + 1] = mc6847->expanded_colors[val * 2 + 1]; |
| 2171 | | } |
| 2172 | | |
| 2173 | | /* and copy the results back */ |
| 2174 | | memcpy(line, new_line, sizeof(*line) * 256); |
| 2175 | | } |
| 2176 | | |
| 2177 | | |
| 2178 | | |
| 2179 | | static INPUT_CHANGED( artifacting_changed ) |
| 2180 | | { |
| 2181 | | /* TODO: not sure how to do this with a device... */ |
| 2182 | | // set_dirty(); |
| 2183 | | } |
| 2184 | | |
| 2185 | | |
| 2186 | | |
| 2187 | | INPUT_PORTS_START( m6847_artifacting ) |
| 2188 | | PORT_START("artifacting") |
| 2189 | | PORT_CONFNAME( 0x03, 0x01, "Artifacting" ) PORT_CHANGED(artifacting_changed, NULL) |
| 2190 | | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 2191 | | PORT_CONFSETTING( 0x01, DEF_STR( Standard ) ) |
| 2192 | | PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) ) |
| 2193 | | INPUT_PORTS_END |
| 2194 | | |
| 2195 | | |
| 2196 | | |
| 2197 | | |
| 2198 | | UINT32 mc6847_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 2199 | | { |
| 2200 | | mc6847_state *mc6847 = get_safe_token(device); |
| 2201 | | int row, i; |
| 2202 | | UINT32 rc = 0; |
| 2203 | | |
| 2204 | | /* if we have a custom palette, check to see if it has changed */ |
| 2205 | | if (!mc6847->dirty && mc6847->has_custom_palette) |
| 2206 | | { |
| 2207 | | for (i = 0; i < 16; i++) |
| 2208 | | { |
| 2209 | | if (mc6847->palette[i] != mc6847->saved_palette[i]) |
| 2210 | | { |
| 2211 | | mc6847->dirty = TRUE; |
| 2212 | | break; |
| 2213 | | } |
| 2214 | | } |
| 2215 | | } |
| 2216 | | |
| 2217 | | if (mc6847->dirty) |
| 2218 | | { |
| 2219 | | /* this frame is dirty; render it */ |
| 2220 | | mc6847->dirty = FALSE; |
| 2221 | | |
| 2222 | | /* copy palette if we have a custom palete */ |
| 2223 | | if (mc6847->has_custom_palette) |
| 2224 | | { |
| 2225 | | for (i = 0; i < 16; i++) |
| 2226 | | mc6847->saved_palette[i] = mc6847->palette[i]; |
| 2227 | | } |
| 2228 | | |
| 2229 | | /* the video RAM has been dirtied; need to draw */ |
| 2230 | | for (row = cliprect->min_y; row <= cliprect->max_y; row++) |
| 2231 | | render_scanline(device, bitmap, row); |
| 2232 | | } |
| 2233 | | else |
| 2234 | | { |
| 2235 | | /* skip this frame */ |
| 2236 | | rc = UPDATE_HAS_NOT_CHANGED; |
| 2237 | | } |
| 2238 | | return rc; |
| 2239 | | } |
| 2240 | | |
| 2241 | | DEFINE_LEGACY_DEVICE(MC6847, mc6847); |
src/mess/video/mc6847.c
| r0 | r13257 | |
| 1 | /*********************************************************************
|
| 2 | |
| 3 | mc6847.c
|
| 4 | |
| 5 | 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 | **********************************************************************/
|
| 63 | |
| 64 | #define ADDRESS_MAP_MODERN
|
| 65 | |
| 66 | #include "emu.h"
|
| 67 | #include "video/mc6847.h"
|
| 68 | |
| 69 | |
| 70 | //**************************************************************************
|
| 71 | // CONSTANTS
|
| 72 | //**************************************************************************
|
| 73 | |
| 74 | #define TOP_BORDER 25
|
| 75 | #define USE_HORIZONTAL_CLIP false
|
| 76 | |
| 77 | #define TIMER_HSYNC_PERIOD (227.5)
|
| 78 | #define TIMER_HSYNC_OFF_TIME (10.0)
|
| 79 | #define TIMER_HSYNC_ON_TIME (TIMER_HSYNC_OFF_TIME + 16.5)
|
| 80 | #define TIMER_FSYNC_OFF_TIME (TIMER_HSYNC_PERIOD * TOP_BORDER + TIMER_HSYNC_ON_TIME)
|
| 81 | #define TIMER_FSYNC_ON_TIME (TIMER_HSYNC_PERIOD * (TOP_BORDER + 192) + TIMER_HSYNC_ON_TIME)
|
| 82 | |
| 83 | #define LOG_SCANLINE 0
|
| 84 | #define LOG_HSYNC 0
|
| 85 | #define LOG_FSYNC 0
|
| 86 | |
| 87 | |
| 88 | const UINT32 mc6847_base_device::s_palette[mc6847_base_device::PALETTE_LENGTH] =
|
| 89 | {
|
| 90 | MAKE_RGB(0x07, 0xff, 0x00), /* GREEN */
|
| 91 | MAKE_RGB(0xff, 0xff, 0x00), /* YELLOW */
|
| 92 | MAKE_RGB(0x3b, 0x08, 0xff), /* BLUE */
|
| 93 | MAKE_RGB(0xcc, 0x00, 0x3b), /* RED */
|
| 94 | MAKE_RGB(0xff, 0xff, 0xff), /* BUFF */
|
| 95 | MAKE_RGB(0x07, 0xe3, 0x99), /* CYAN */
|
| 96 | MAKE_RGB(0xff, 0x1c, 0xff), /* MAGENTA */
|
| 97 | MAKE_RGB(0xff, 0x81, 0x00), /* ORANGE */
|
| 98 | |
| 99 | MAKE_RGB(0x00, 0x00, 0x00), /* BLACK */
|
| 100 | MAKE_RGB(0x07, 0xff, 0x00), /* GREEN */
|
| 101 | MAKE_RGB(0x00, 0x00, 0x00), /* BLACK */
|
| 102 | MAKE_RGB(0xff, 0xff, 0xff), /* BUFF */
|
| 103 | |
| 104 | MAKE_RGB(0x00, 0x7c, 0x00), /* ALPHANUMERIC DARK GREEN */
|
| 105 | MAKE_RGB(0x07, 0xff, 0x00), /* ALPHANUMERIC BRIGHT GREEN */
|
| 106 | MAKE_RGB(0x91, 0x00, 0x00), /* ALPHANUMERIC DARK ORANGE */
|
| 107 | MAKE_RGB(0xff, 0x81, 0x00) /* ALPHANUMERIC BRIGHT ORANGE */
|
| 108 | };
|
| 109 | |
| 110 | |
| 111 | |
| 112 | //**************************************************************************
|
| 113 | // FRIEND DEVICE
|
| 114 | //**************************************************************************
|
| 115 | |
| 116 | //-------------------------------------------------
|
| 117 | // ctor
|
| 118 | //-------------------------------------------------
|
| 119 | |
| 120 | mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock,
|
| 121 | const UINT8 *fontdata, bool is_mc6847t1, double tpfs, int field_sync_falling_edge_scanline)
|
| 122 | : device_t(mconfig, type, name, tag, owner, clock),
|
| 123 | m_character_map(fontdata, is_mc6847t1)
|
| 124 | {
|
| 125 | m_tpfs = tpfs;
|
| 126 | |
| 127 | // The MC6847 and the GIME apply field sync on different scanlines
|
| 128 | m_field_sync_falling_edge_scanline = field_sync_falling_edge_scanline;
|
| 129 | }
|
| 130 | |
| 131 | |
| 132 | |
| 133 | //-------------------------------------------------
|
| 134 | // setup_timer - sets up a single timer relative
|
| 135 | // to the clock
|
| 136 | //-------------------------------------------------
|
| 137 | |
| 138 | ATTR_FORCE_INLINE emu_timer *mc6847_friend_device::setup_timer(device_timer_id id, double offset, double period)
|
| 139 | {
|
| 140 | emu_timer *timer = timer_alloc(id);
|
| 141 | timer->adjust(
|
| 142 | attotime::from_ticks(offset * 4, m_clock * 4),
|
| 143 | 0,
|
| 144 | attotime::from_ticks(period * 4, m_clock * 4));
|
| 145 | return timer;
|
| 146 | }
|
| 147 | |
| 148 | |
| 149 | |
| 150 | //-------------------------------------------------
|
| 151 | // device_start - device-specific startup
|
| 152 | //-------------------------------------------------
|
| 153 | |
| 154 | void mc6847_friend_device::device_start(void)
|
| 155 | {
|
| 156 | /* create the timers */
|
| 157 | m_frame_timer = setup_timer( TIMER_FRAME, 0, m_tpfs * TIMER_HSYNC_PERIOD);
|
| 158 | m_hsync_on_timer = setup_timer( TIMER_HSYNC_ON, TIMER_HSYNC_ON_TIME, TIMER_HSYNC_PERIOD);
|
| 159 | m_hsync_off_timer = setup_timer(TIMER_HSYNC_OFF, TIMER_HSYNC_OFF_TIME, TIMER_HSYNC_PERIOD);
|
| 160 | m_fsync_timer = timer_alloc(TIMER_FSYNC);
|
| 161 | |
| 162 | m_top_border_scanlines = 0;
|
| 163 | m_body_scanlines = 0;
|
| 164 | m_wide = false;
|
| 165 | set_geometry(25, 192, false);
|
| 166 | |
| 167 | /* save states */
|
| 168 | save_item(NAME(m_physical_scanline));
|
| 169 | save_item(NAME(m_logical_scanline));
|
| 170 | save_item(NAME(m_logical_scanline_zone));
|
| 171 | save_item(NAME(m_horizontal_sync));
|
| 172 | save_item(NAME(m_field_sync));
|
| 173 | |
| 174 | /* artifacting */
|
| 175 | m_artifacter.setup_config(this);
|
| 176 | }
|
| 177 | |
| 178 | |
| 179 | |
| 180 | //-------------------------------------------------
|
| 181 | // device_start - device-specific reset
|
| 182 | //-------------------------------------------------
|
| 183 | |
| 184 | void mc6847_friend_device::device_reset(void)
|
| 185 | {
|
| 186 | device_t::device_reset();
|
| 187 | m_video_changed = true;
|
| 188 | }
|
| 189 | |
| 190 | |
| 191 | |
| 192 | //-------------------------------------------------
|
| 193 | // device_post_load - device-specific post load
|
| 194 | //-------------------------------------------------
|
| 195 | |
| 196 | void mc6847_friend_device::device_post_load(void)
|
| 197 | {
|
| 198 | device_t::device_post_load();
|
| 199 | m_video_changed = true;
|
| 200 | }
|
| 201 | |
| 202 | |
| 203 | |
| 204 | //-------------------------------------------------
|
| 205 | // update_field_sync_timer
|
| 206 | //-------------------------------------------------
|
| 207 | |
| 208 | void mc6847_friend_device::update_field_sync_timer(void)
|
| 209 | {
|
| 210 | /* are we expecting field sync? */
|
| 211 | bool expected_field_sync = (m_physical_scanline < m_field_sync_falling_edge_scanline)
|
| 212 | || (m_logical_scanline_zone == SCANLINE_ZONE_VBLANK);
|
| 213 | |
| 214 | /* determine the duration */
|
| 215 | attotime duration = (expected_field_sync != m_field_sync) ? attotime::from_ticks(160, m_clock) : attotime::never;
|
| 216 | |
| 217 | /* and reset the timer */
|
| 218 | m_fsync_timer->adjust(duration, expected_field_sync ? 1 : 0);
|
| 219 | }
|
| 220 | |
| 221 | |
| 222 | |
| 223 | //-------------------------------------------------
|
| 224 | // device_timer
|
| 225 | //-------------------------------------------------
|
| 226 | |
| 227 | void mc6847_friend_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
| 228 | {
|
| 229 | switch(id)
|
| 230 | {
|
| 231 | case TIMER_FRAME: new_frame(); break;
|
| 232 | case TIMER_HSYNC_ON: change_horizontal_sync(true); break;
|
| 233 | case TIMER_HSYNC_OFF: change_horizontal_sync(false); break;
|
| 234 | case TIMER_FSYNC: change_field_sync(param != 0); break;
|
| 235 | }
|
| 236 | }
|
| 237 | |
| 238 | |
| 239 | |
| 240 | //-------------------------------------------------
|
| 241 | // new_frame
|
| 242 | //-------------------------------------------------
|
| 243 | |
| 244 | ATTR_FORCE_INLINE void mc6847_friend_device::new_frame(void)
|
| 245 | {
|
| 246 | m_physical_scanline = 0;
|
| 247 | m_logical_scanline = 0;
|
| 248 | m_logical_scanline_zone = SCANLINE_ZONE_FRAME_END;
|
| 249 | }
|
| 250 | |
| 251 | |
| 252 | |
| 253 | //-------------------------------------------------
|
| 254 | // scanline_zone_string
|
| 255 | //-------------------------------------------------
|
| 256 | |
| 257 | const char *mc6847_friend_device::scanline_zone_string(scanline_zone zone)
|
| 258 | {
|
| 259 | const char *result;
|
| 260 | switch(zone)
|
| 261 | {
|
| 262 | case SCANLINE_ZONE_TOP_BORDER: result = "SCANLINE_ZONE_TOP_BORDER"; break;
|
| 263 | case SCANLINE_ZONE_BODY: result = "SCANLINE_ZONE_BODY"; break;
|
| 264 | case SCANLINE_ZONE_BOTTOM_BORDER: result = "SCANLINE_ZONE_BOTTOM_BORDER"; break;
|
| 265 | case SCANLINE_ZONE_RETRACE: result = "SCANLINE_ZONE_RETRACE"; break;
|
| 266 | case SCANLINE_ZONE_VBLANK: result = "SCANLINE_ZONE_VBLANK"; break;
|
| 267 | case SCANLINE_ZONE_FRAME_END: result = "SCANLINE_ZONE_FRAME_END"; break;
|
| 268 | default:
|
| 269 | fatalerror("Should not get here");
|
| 270 | break;
|
| 271 | }
|
| 272 | return result;
|
| 273 | }
|
| 274 | |
| 275 | |
| 276 | |
| 277 | //-------------------------------------------------
|
| 278 | // change_horizontal_sync
|
| 279 | //-------------------------------------------------
|
| 280 | |
| 281 | ATTR_FORCE_INLINE void mc6847_friend_device::change_horizontal_sync(bool line)
|
| 282 | {
|
| 283 | g_profiler.start(PROFILER_USER1);
|
| 284 | if (line && !m_horizontal_sync)
|
| 285 | {
|
| 286 | if (LOG_SCANLINE)
|
| 287 | logerror("%s: change_horizontal_sync(): Recording scanline\n", describe_context());
|
| 288 | |
| 289 | /* first store the scanline */
|
| 290 | g_profiler.start(PROFILER_USER2);
|
| 291 | switch((scanline_zone) m_logical_scanline_zone)
|
| 292 | {
|
| 293 | case SCANLINE_ZONE_TOP_BORDER:
|
| 294 | case SCANLINE_ZONE_BOTTOM_BORDER:
|
| 295 | record_border_scanline(m_physical_scanline);
|
| 296 | break;
|
| 297 | |
| 298 | case SCANLINE_ZONE_BODY:
|
| 299 | record_body_scanline(m_physical_scanline, m_logical_scanline);
|
| 300 | break;
|
| 301 | |
| 302 | case SCANLINE_ZONE_RETRACE:
|
| 303 | case SCANLINE_ZONE_VBLANK:
|
| 304 | case SCANLINE_ZONE_FRAME_END:
|
| 305 | /* do nothing */
|
| 306 | break;
|
| 307 | }
|
| 308 | g_profiler.stop();
|
| 309 | |
| 310 | /* advance to next scanline */
|
| 311 | next_scanline();
|
| 312 | }
|
| 313 | |
| 314 | /* finally output horizontal sync */
|
| 315 | if (line != m_horizontal_sync)
|
| 316 | {
|
| 317 | m_horizontal_sync = line;
|
| 318 | |
| 319 | /* log if apprpriate */
|
| 320 | if (LOG_HSYNC)
|
| 321 | logerror("%s: change_horizontal_sync(): line=%d\n", describe_context(), line ? 1 : 0);
|
| 322 | |
| 323 | /* invoke callback */
|
| 324 | if (!m_res_out_hsync_func.isnull())
|
| 325 | m_res_out_hsync_func(line);
|
| 326 | |
| 327 | /* call virtual function */
|
| 328 | horizontal_sync_changed(m_horizontal_sync);
|
| 329 | }
|
| 330 | |
| 331 | /* and update the field sync timer */
|
| 332 | update_field_sync_timer();
|
| 333 | g_profiler.stop();
|
| 334 | }
|
| 335 | |
| 336 | |
| 337 | |
| 338 | //-------------------------------------------------
|
| 339 | // change_field_sync
|
| 340 | //-------------------------------------------------
|
| 341 | |
| 342 | ATTR_FORCE_INLINE void mc6847_friend_device::change_field_sync(bool line)
|
| 343 | {
|
| 344 | /* output field sync */
|
| 345 | if (line != m_field_sync)
|
| 346 | {
|
| 347 | m_field_sync = line;
|
| 348 | |
| 349 | /* log if apprpriate */
|
| 350 | if (LOG_FSYNC)
|
| 351 | logerror("%s: change_field_sync(): line=%d\n", describe_context(), line ? 1 : 0);
|
| 352 | |
| 353 | /* invoke callback */
|
| 354 | if (!m_res_out_fsync_func.isnull())
|
| 355 | m_res_out_fsync_func(line);
|
| 356 | |
| 357 | /* call virtual function */
|
| 358 | field_sync_changed(m_field_sync);
|
| 359 | }
|
| 360 | }
|
| 361 | |
| 362 | |
| 363 | |
| 364 | //-------------------------------------------------
|
| 365 | // next_scanline
|
| 366 | //-------------------------------------------------
|
| 367 | |
| 368 | ATTR_FORCE_INLINE void mc6847_friend_device::next_scanline(void)
|
| 369 | {
|
| 370 | /* advance to next scanline */
|
| 371 | m_physical_scanline++;
|
| 372 | m_logical_scanline++;
|
| 373 | |
| 374 | /* check for movement into the next "zone" */
|
| 375 | if (m_logical_scanline_zone == SCANLINE_ZONE_FRAME_END)
|
| 376 | {
|
| 377 | /* we're now in the top border */
|
| 378 | m_logical_scanline = 0;
|
| 379 | m_logical_scanline_zone = SCANLINE_ZONE_TOP_BORDER;
|
| 380 | }
|
| 381 | else if ((m_logical_scanline_zone < SCANLINE_ZONE_VBLANK) && (m_physical_scanline >= 25+192+26+6))
|
| 382 | {
|
| 383 | /* we're now into vblank */
|
| 384 | m_logical_scanline = 0;
|
| 385 | m_logical_scanline_zone = SCANLINE_ZONE_VBLANK;
|
| 386 | }
|
| 387 | else if ((m_logical_scanline_zone < SCANLINE_ZONE_RETRACE) && (m_physical_scanline >= 25+192+26))
|
| 388 | {
|
| 389 | /* we're now into retrace */
|
| 390 | m_logical_scanline = 0;
|
| 391 | m_logical_scanline_zone = SCANLINE_ZONE_RETRACE;
|
| 392 | }
|
| 393 | else if ((m_logical_scanline_zone == SCANLINE_ZONE_TOP_BORDER) && (m_logical_scanline >= m_top_border_scanlines))
|
| 394 | {
|
| 395 | /* we're now into the body */
|
| 396 | m_logical_scanline = 0;
|
| 397 | m_logical_scanline_zone = SCANLINE_ZONE_BODY;
|
| 398 | }
|
| 399 | else if ((m_logical_scanline_zone == SCANLINE_ZONE_BODY) && (m_logical_scanline >= m_body_scanlines))
|
| 400 | {
|
| 401 | /* we're now into the bottom border */
|
| 402 | m_logical_scanline = 0;
|
| 403 | m_logical_scanline_zone = SCANLINE_ZONE_BOTTOM_BORDER;
|
| 404 | enter_bottom_border();
|
| 405 | }
|
| 406 | }
|
| 407 | |
| 408 | |
| 409 | |
| 410 | //-------------------------------------------------
|
| 411 | // horizontal_sync_changed
|
| 412 | //-------------------------------------------------
|
| 413 | |
| 414 | void mc6847_friend_device::horizontal_sync_changed(bool line)
|
| 415 | {
|
| 416 | }
|
| 417 | |
| 418 | |
| 419 | |
| 420 | //-------------------------------------------------
|
| 421 | // field_sync_changed
|
| 422 | //-------------------------------------------------
|
| 423 | |
| 424 | void mc6847_friend_device::field_sync_changed(bool line)
|
| 425 | {
|
| 426 | }
|
| 427 | |
| 428 | |
| 429 | |
| 430 | //-------------------------------------------------
|
| 431 | // enter_bottom_border
|
| 432 | //-------------------------------------------------
|
| 433 | |
| 434 | void mc6847_friend_device::enter_bottom_border(void)
|
| 435 | {
|
| 436 | }
|
| 437 | |
| 438 | |
| 439 | |
| 440 | //-------------------------------------------------
|
| 441 | // record_border_scanline
|
| 442 | //-------------------------------------------------
|
| 443 | |
| 444 | void mc6847_friend_device::record_border_scanline(UINT16 physical_scanline)
|
| 445 | {
|
| 446 | }
|
| 447 | |
| 448 | |
| 449 | |
| 450 | //-------------------------------------------------
|
| 451 | // video_flush
|
| 452 | //-------------------------------------------------
|
| 453 | |
| 454 | void mc6847_friend_device::video_flush(void)
|
| 455 | {
|
| 456 | }
|
| 457 | |
| 458 | |
| 459 | |
| 460 | //-------------------------------------------------
|
| 461 | // describe_context
|
| 462 | //-------------------------------------------------
|
| 463 | |
| 464 | const char *mc6847_friend_device::describe_context(void)
|
| 465 | {
|
| 466 | static char buffer[128];
|
| 467 | snprintf(buffer, ARRAY_LENGTH(buffer), "%s (scanline %s:%d)",
|
| 468 | machine().describe_context(),
|
| 469 | scanline_zone_string((scanline_zone) m_logical_scanline_zone),
|
| 470 | m_logical_scanline);
|
| 471 | return buffer;
|
| 472 | }
|
| 473 | |
| 474 | |
| 475 | |
| 476 | //**************************************************************************
|
| 477 | // BASE DEVICE
|
| 478 | //**************************************************************************
|
| 479 | |
| 480 | //-------------------------------------------------
|
| 481 | // ctor
|
| 482 | //-------------------------------------------------
|
| 483 | |
| 484 | mc6847_base_device::mc6847_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const UINT8 *fontdata, double tpfs)
|
| 485 | : mc6847_friend_device(mconfig, type, name, tag, owner, clock, fontdata, (type == MC6847T1_NTSC) || (type == MC6847T1_PAL), tpfs, 25+191)
|
| 486 | {
|
| 487 | m_palette = s_palette;
|
| 488 | |
| 489 | for (int i = 0; i < ARRAY_LENGTH(s_palette); i++)
|
| 490 | {
|
| 491 | m_bw_palette[i] = black_and_white(s_palette[i]);
|
| 492 | }
|
| 493 | }
|
| 494 | |
| 495 | |
| 496 | |
| 497 | //-------------------------------------------------
|
| 498 | // setup_fixed_mode - sets up a particular video
|
| 499 | // mode bit with a decb callback
|
| 500 | //-------------------------------------------------
|
| 501 | |
| 502 | void mc6847_base_device::setup_fixed_mode(struct devcb_read_line callback, UINT8 mode)
|
| 503 | {
|
| 504 | if (callback.type == DEVCB_TYPE_NULL)
|
| 505 | {
|
| 506 | // do nothing
|
| 507 | }
|
| 508 | else if (callback.type == DEVCB_TYPE_CONSTANT && (callback.index == 0 || callback.index == 1))
|
| 509 | {
|
| 510 | // this mode is fixed
|
| 511 | m_fixed_mode |= (callback.index ? mode : 0x00);
|
| 512 | m_fixed_mode_mask |= mode;
|
| 513 | }
|
| 514 | else
|
| 515 | {
|
| 516 | // for reasons of performance, we currently only support DEVCB_NULL,
|
| 517 | // DEVCB_LINE_GND and DEVCB_LINE_VCC
|
| 518 | emu_fatalerror("mc6847 does not support this callback type for mode bits");
|
| 519 | }
|
| 520 | }
|
| 521 | |
| 522 | |
| 523 | |
| 524 | //-------------------------------------------------
|
| 525 | // device_start - device-specific startup
|
| 526 | //-------------------------------------------------
|
| 527 | |
| 528 | void mc6847_base_device::device_start()
|
| 529 | {
|
| 530 | const mc6847_interface *config = (const mc6847_interface *) static_config();
|
| 531 | assert(config);
|
| 532 | |
| 533 | /* inherited function */
|
| 534 | mc6847_friend_device::device_start();
|
| 535 | |
| 536 | /* setup */
|
| 537 | memset(m_data, 0, sizeof(m_data));
|
| 538 | |
| 539 | /* resolve callbacks */
|
| 540 | m_res_input_func.resolve(config->m_input_func, *this);
|
| 541 | m_res_out_hsync_func.resolve(config->m_out_hsync_func, *this);
|
| 542 | m_res_out_fsync_func.resolve(config->m_out_fsync_func, *this);
|
| 543 | m_get_char_rom = config->m_get_char_rom;
|
| 544 | |
| 545 | /* set up fixed mode */
|
| 546 | m_fixed_mode = 0x00;
|
| 547 | m_fixed_mode_mask = 0x00;
|
| 548 | setup_fixed_mode(config->m_in_gm2_func, MODE_GM2);
|
| 549 | setup_fixed_mode(config->m_in_gm1_func, MODE_GM1);
|
| 550 | setup_fixed_mode(config->m_in_gm0_func, MODE_GM0);
|
| 551 | setup_fixed_mode(config->m_in_intext_func, MODE_INTEXT);
|
| 552 | setup_fixed_mode(config->m_in_inv_func, MODE_INV);
|
| 553 | setup_fixed_mode(config->m_in_as_func, MODE_AS);
|
| 554 | setup_fixed_mode(config->m_in_ag_func, MODE_AG);
|
| 555 | setup_fixed_mode(config->m_in_css_func, MODE_CSS);
|
| 556 | |
| 557 | /* state save */
|
| 558 | save_item(NAME(m_dirty));
|
| 559 | save_item(NAME(m_mode));
|
| 560 | |
| 561 | /* colors */
|
| 562 | m_palette = config->m_black_and_white ? m_bw_palette : s_palette;
|
| 563 | }
|
| 564 | |
| 565 | |
| 566 | |
| 567 | //-------------------------------------------------
|
| 568 | // device_reset - device-specific reset
|
| 569 | //-------------------------------------------------
|
| 570 | |
| 571 | void mc6847_base_device::device_reset()
|
| 572 | {
|
| 573 | mc6847_friend_device::device_reset();
|
| 574 | m_mode = m_fixed_mode;
|
| 575 | }
|
| 576 | |
| 577 | |
| 578 | |
| 579 | //-------------------------------------------------
|
| 580 | // record_scanline_res
|
| 581 | //-------------------------------------------------
|
| 582 | |
| 583 | template<int sample_count, int yres>
|
| 584 | void mc6847_base_device::record_scanline_res(int scanline)
|
| 585 | {
|
| 586 | int i, column;
|
| 587 | UINT8 data;
|
| 588 | |
| 589 | /* calculate offset */
|
| 590 | offs_t offset = scanline / (192 / yres) * sample_count;
|
| 591 | |
| 592 | /* main loop */
|
| 593 | for (column = 0; column < sample_count; column++)
|
| 594 | {
|
| 595 | /* input data */
|
| 596 | data = m_res_input_func(offset++);
|
| 597 | |
| 598 | /* update values */
|
| 599 | update_value(&m_data[scanline].m_mode[column], simplify_mode(data, m_mode));
|
| 600 | update_value(&m_data[scanline].m_data[column], data);
|
| 601 | }
|
| 602 | |
| 603 | /* several more inputs occur after hblank */
|
| 604 | for (i = 0; i < sample_count * 5 / 16; i++)
|
| 605 | {
|
| 606 | data = m_res_input_func(offset++);
|
| 607 | }
|
| 608 | |
| 609 | /* update sample count */
|
| 610 | update_value(&m_data[scanline].m_sample_count, (UINT8) sample_count);
|
| 611 | }
|
| 612 | |
| 613 | |
| 614 | |
| 615 | //-------------------------------------------------
|
| 616 | // record_body_scanline
|
| 617 | //-------------------------------------------------
|
| 618 | |
| 619 | void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline)
|
| 620 | {
|
| 621 | // sanity checks
|
| 622 | assert(scanline >= 0 && scanline < 192);
|
| 623 | |
| 624 | if (m_mode & MODE_AG)
|
| 625 | {
|
| 626 | switch(m_mode & (MODE_GM2|MODE_GM1|MODE_GM0))
|
| 627 | {
|
| 628 | case 0:
|
| 629 | case MODE_GM0:
|
| 630 | record_scanline_res<16, 64>(scanline);
|
| 631 | break;
|
| 632 | |
| 633 | case MODE_GM1:
|
| 634 | record_scanline_res<32, 64>(scanline);
|
| 635 | break;
|
| 636 | |
| 637 | case MODE_GM1|MODE_GM0:
|
| 638 | record_scanline_res<16, 96>(scanline);
|
| 639 | break;
|
| 640 | |
| 641 | case MODE_GM2:
|
| 642 | record_scanline_res<32, 96>(scanline);
|
| 643 | break;
|
| 644 | |
| 645 | case MODE_GM2|MODE_GM0:
|
| 646 | record_scanline_res<16, 192>(scanline);
|
| 647 | break;
|
| 648 | |
| 649 | case MODE_GM2|MODE_GM1:
|
| 650 | case MODE_GM2|MODE_GM1|MODE_GM0:
|
| 651 | record_scanline_res<32, 192>(scanline);
|
| 652 | break;
|
| 653 | |
| 654 | default:
|
| 655 | /* should not get here */
|
| 656 | fatalerror("should not get here");
|
| 657 | break;
|
| 658 | }
|
| 659 | }
|
| 660 | else
|
| 661 | {
|
| 662 | record_scanline_res<32, 16>(scanline);
|
| 663 | }
|
| 664 | }
|
| 665 | |
| 666 | |
| 667 | |
| 668 | //-------------------------------------------------
|
| 669 | // field_sync_changed
|
| 670 | //-------------------------------------------------
|
| 671 | |
| 672 | void mc6847_base_device::field_sync_changed(bool line)
|
| 673 | {
|
| 674 | /* when field sync is on, the DA* enter the Hi-Z state */
|
| 675 | if (line && !m_res_input_func.isnull())
|
| 676 | m_res_input_func(~0);
|
| 677 | }
|
| 678 | |
| 679 | |
| 680 | |
| 681 | //-------------------------------------------------
|
| 682 | // border_value
|
| 683 | //-------------------------------------------------
|
| 684 | |
| 685 | ATTR_FORCE_INLINE mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1)
|
| 686 | {
|
| 687 | pixel_t result;
|
| 688 | switch(mc6847_friend_device::border_value(mode, is_mc6847t1))
|
| 689 | {
|
| 690 | case BORDER_COLOR_BLACK:
|
| 691 | result = palette[8];
|
| 692 | break;
|
| 693 | case BORDER_COLOR_GREEN:
|
| 694 | result = palette[0];
|
| 695 | break;
|
| 696 | case BORDER_COLOR_WHITE:
|
| 697 | result = palette[4];
|
| 698 | break;
|
| 699 | case BORDER_COLOR_ORANGE:
|
| 700 | result = palette[7];
|
| 701 | break;
|
| 702 | default:
|
| 703 | fatalerror("Should not get here");
|
| 704 | break;
|
| 705 | }
|
| 706 | return result;
|
| 707 | }
|
| 708 | |
| 709 | |
| 710 | |
| 711 | //-------------------------------------------------
|
| 712 | // update
|
| 713 | //-------------------------------------------------
|
| 714 | |
| 715 | bool mc6847_base_device::update(bitmap_t *bitmap, const rectangle *cliprect)
|
| 716 | {
|
| 717 | int base_x = 32;
|
| 718 | int base_y = 25;
|
| 719 | int x, x2, y;
|
| 720 | bool is_mc6847t1 = (type() == MC6847T1_NTSC) || (type() == MC6847T1_PAL);
|
| 721 | int min_x = USE_HORIZONTAL_CLIP ? cliprect->min_x : 0;
|
| 722 | int max_x = USE_HORIZONTAL_CLIP ? cliprect->max_x : (base_x * 2 + 256 - 1);
|
| 723 | int min_y = cliprect->min_y;
|
| 724 | int max_y = cliprect->max_y;
|
| 725 | const pixel_t *palette = m_palette;
|
| 726 | |
| 727 | /* if the video didn't change, indicate as much */
|
| 728 | if (!has_video_changed())
|
| 729 | return UPDATE_HAS_NOT_CHANGED;
|
| 730 | |
| 731 | /* top border */
|
| 732 | for (y = min_y; y < base_y; y++)
|
| 733 | {
|
| 734 | for (x = min_x; x <= max_x; x++)
|
| 735 | {
|
| 736 | *bitmap_addr(bitmap, y, x) = border_value(m_data[0].m_mode[0], palette, is_mc6847t1);
|
| 737 | }
|
| 738 | }
|
| 739 | |
| 740 | for (y = MAX(0, min_y - base_y); y <= MIN(192, max_y - base_y); y++)
|
| 741 | {
|
| 742 | /* left border */
|
| 743 | for (x = min_x; x < base_x; x++)
|
| 744 | {
|
| 745 | *bitmap_addr(bitmap, y + base_y, x) = border_value(m_data[y].m_mode[0], palette, is_mc6847t1);
|
| 746 | }
|
| 747 | |
| 748 | /* body */
|
| 749 | x = 0;
|
| 750 | int width = m_data[y].m_sample_count;
|
| 751 | pixel_t *RESTRICT pixels = bitmap_addr(bitmap, base_y + y, base_x);
|
| 752 | while(x < width)
|
| 753 | {
|
| 754 | /* determine how many bytes exist for which the mode is identical */
|
| 755 | for (x2 = x + 1; (x2 < width) && (m_data[y].m_mode[x] == m_data[y].m_mode[x2]); x2++)
|
| 756 | ;
|
| 757 | |
| 758 | /* emit the samples */
|
| 759 | pixels += emit_mc6847_samples<1>(
|
| 760 | m_data[y].m_mode[x],
|
| 761 | &m_data[y].m_data[x],
|
| 762 | x2 - x,
|
| 763 | pixels,
|
| 764 | m_palette,
|
| 765 | m_get_char_rom,
|
| 766 | x,
|
| 767 | y);
|
| 768 | |
| 769 | /* update x */
|
| 770 | x = x2;
|
| 771 | }
|
| 772 | |
| 773 | /* right border */
|
| 774 | for (x = base_x + 256; x <= max_x; x++)
|
| 775 | {
|
| 776 | *bitmap_addr(bitmap, y + base_y, x) = border_value(m_data[y].m_mode[width - 1], palette, is_mc6847t1);
|
| 777 | }
|
| 778 | |
| 779 | /* artifacting */
|
| 780 | m_artifacter.process_artifacts<1>(bitmap_addr(bitmap, y + base_y, base_x), m_data[y].m_mode[0], palette);
|
| 781 | }
|
| 782 | |
| 783 | /* bottom border */
|
| 784 | for (y = base_y + 192; y <= max_y; y++)
|
| 785 | {
|
| 786 | for (x = min_x; x <= max_x; x++)
|
| 787 | {
|
| 788 | int width = m_data[191].m_sample_count;
|
| 789 | *bitmap_addr(bitmap, y, x) = border_value(m_data[191].m_mode[width - 1], palette, is_mc6847t1);
|
| 790 | }
|
| 791 | }
|
| 792 | return 0;
|
| 793 | }
|
| 794 | |
| 795 | |
| 796 | |
| 797 | //**************************************************************************
|
| 798 | // CHARACTER MAP
|
| 799 | //**************************************************************************
|
| 800 | |
| 801 | mc6847_friend_device::character_map::character_map(const UINT8 *text_fontdata, bool is_mc6847t1)
|
| 802 | {
|
| 803 | int mode, i;
|
| 804 | |
| 805 | // set up font data
|
| 806 | for (i = 0; i < 64*12; i++)
|
| 807 | {
|
| 808 | m_text_fontdata_inverse[i] = text_fontdata[i] ^ 0xFF;
|
| 809 | m_text_fontdata_lower_case[i] = text_fontdata[i + (i < 32*12 ? 64*12 : 0)] ^ (i < 32*12 ? 0xFF : 0x00);
|
| 810 | m_text_fontdata_lower_case_inverse[i] = m_text_fontdata_lower_case[i] ^ 0xFF;
|
| 811 | }
|
| 812 | |
| 813 | // loop through all modes
|
| 814 | for (mode = 0; mode < sizeof(m_entries) / sizeof(m_entries[0]); mode++)
|
| 815 | {
|
| 816 | const UINT8 *fontdata;
|
| 817 | UINT8 character_mask;
|
| 818 | UINT8 color_shift_0 = 0;
|
| 819 | UINT8 color_shift_1 = 0;
|
| 820 | UINT8 color_mask_0 = 0x00;
|
| 821 | UINT8 color_mask_1 = 0x00;
|
| 822 | UINT16 color_base_0;
|
| 823 | UINT16 color_base_1;
|
| 824 | |
| 825 | if ((mode & MODE_INTEXT) && !is_mc6847t1)
|
| 826 | {
|
| 827 | // semigraphics 6
|
| 828 | fontdata = semigraphics6_fontdata8x12;
|
| 829 | character_mask = 0x3F;
|
| 830 | color_base_0 = 8;
|
| 831 | color_base_1 = mode & MODE_CSS ? 4 : 0;
|
| 832 | color_shift_1 = 6;
|
| 833 | color_mask_1 = 0x03;
|
| 834 | }
|
| 835 | else if (mode & MODE_AS)
|
| 836 | {
|
| 837 | // semigraphics 4
|
| 838 | fontdata = semigraphics4_fontdata8x12;
|
| 839 | character_mask = 0x0F;
|
| 840 | color_base_0 = 8;
|
| 841 | color_base_1 = 0;
|
| 842 | color_shift_1 = 4;
|
| 843 | color_mask_1 = 0x07;
|
| 844 | }
|
| 845 | else
|
| 846 | {
|
| 847 | // text
|
| 848 | bool is_lower_case = is_mc6847t1 && ((mode & MODE_INV) == 0) && (mode & MODE_GM0);
|
| 849 | bool is_inverse1 = (mode & MODE_INV) ? true : false;
|
| 850 | bool is_inverse2 = is_mc6847t1 && (mode & MODE_GM1);
|
| 851 | bool is_inverse = (is_inverse1 && !is_inverse2) || (!is_inverse1 && is_inverse2);
|
| 852 | fontdata = is_inverse
|
| 853 | ? (is_lower_case ? m_text_fontdata_lower_case_inverse : m_text_fontdata_inverse)
|
| 854 | : (is_lower_case ? m_text_fontdata_lower_case : text_fontdata);
|
| 855 | character_mask = 0x3F;
|
| 856 | color_base_0 = (mode & MODE_CSS ? 14 : 12);
|
| 857 | color_base_1 = (mode & MODE_CSS ? 15 : 13);
|
| 858 | }
|
| 859 | |
| 860 | // populate the entry
|
| 861 | memset(&m_entries[mode], 0, sizeof(m_entries[mode]));
|
| 862 | m_entries[mode].m_fontdata = fontdata;
|
| 863 | m_entries[mode].m_character_mask = character_mask;
|
| 864 | m_entries[mode].m_color_shift_0 = color_shift_0;
|
| 865 | m_entries[mode].m_color_shift_1 = color_shift_1;
|
| 866 | m_entries[mode].m_color_mask_0 = color_mask_0;
|
| 867 | m_entries[mode].m_color_mask_1 = color_mask_1;
|
| 868 | m_entries[mode].m_color_base_0 = color_base_0;
|
| 869 | m_entries[mode].m_color_base_1 = color_base_1;
|
| 870 | }
|
| 871 | }
|
| 872 | |
| 873 | |
| 874 | |
| 875 | //-------------------------------------------------
|
| 876 | // pal_round_fontdata8x12
|
| 877 | //-------------------------------------------------
|
| 878 | |
| 879 | const UINT8 mc6847_friend_device::pal_round_fontdata8x12[] =
|
| 880 | {
|
| 881 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00,
|
| 882 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 883 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00,
|
| 884 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 885 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00,
|
| 886 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 887 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 888 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 889 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 890 | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 891 | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 892 | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00,
|
| 893 | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 894 | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 895 | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 896 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 897 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 898 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00,
|
| 899 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00,
|
| 900 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 901 | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 902 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 903 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 904 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00,
|
| 905 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 906 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 907 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 908 | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00,
|
| 909 | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00,
|
| 910 | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00,
|
| 911 | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 912 | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 913 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 914 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 915 | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 916 | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00,
|
| 917 | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00,
|
| 918 | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00,
|
| 919 | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00,
|
| 920 | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 921 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 922 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 923 | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00,
|
| 924 | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 925 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00,
|
| 926 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 927 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 928 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00,
|
| 929 | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 930 | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 931 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 932 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 933 | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00,
|
| 934 | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 935 | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 936 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 937 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 938 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00,
|
| 939 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 940 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00,
|
| 941 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 942 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 943 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 944 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 945 | |
| 946 | /* Lower case */
|
| 947 | 0x00, 0x00, 0x18, 0x24, 0x20, 0x70, 0x20, 0x24, 0x78, 0x00, 0x00, 0x00,
|
| 948 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00,
|
| 949 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00,
|
| 950 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 951 | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00,
|
| 952 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00,
|
| 953 | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 954 | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00,
|
| 955 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 956 | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 957 | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00,
|
| 958 | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00,
|
| 959 | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 960 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00,
|
| 961 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 962 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 963 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00,
|
| 964 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00,
|
| 965 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 966 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00,
|
| 967 | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00,
|
| 968 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00,
|
| 969 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00,
|
| 970 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00,
|
| 971 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00,
|
| 972 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00,
|
| 973 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00,
|
| 974 | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 975 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 976 | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 977 | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 978 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00
|
| 979 | };
|
| 980 | |
| 981 | |
| 982 | |
| 983 | //-------------------------------------------------
|
| 984 | // pal_square_fontdata8x12
|
| 985 | //-------------------------------------------------
|
| 986 | |
| 987 | const UINT8 mc6847_friend_device::pal_square_fontdata8x12[] =
|
| 988 | {
|
| 989 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00,
|
| 990 | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00,
|
| 991 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00,
|
| 992 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00,
|
| 993 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00,
|
| 994 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 995 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 996 | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00,
|
| 997 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 998 | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 999 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1000 | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00,
|
| 1001 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 1002 | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1003 | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1004 | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00,
|
| 1005 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 1006 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00,
|
| 1007 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00,
|
| 1008 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00,
|
| 1009 | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1010 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1011 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00,
|
| 1012 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00,
|
| 1013 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00,
|
| 1014 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1015 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00,
|
| 1016 | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00,
|
| 1017 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00,
|
| 1018 | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00,
|
| 1019 | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1020 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 1021 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1022 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00,
|
| 1023 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1024 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00,
|
| 1025 | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00,
|
| 1026 | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00,
|
| 1027 | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00,
|
| 1028 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1029 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00,
|
| 1030 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00,
|
| 1031 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00,
|
| 1032 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00,
|
| 1033 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00,
|
| 1034 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1035 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00,
|
| 1036 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00,
|
| 1037 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00,
|
| 1038 | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1039 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 1040 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x0C, 0x02, 0x22, 0x1C, 0x00, 0x00,
|
| 1041 | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00,
|
| 1042 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00,
|
| 1043 | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1044 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00,
|
| 1045 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1046 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00,
|
| 1047 | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
|
| 1048 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00,
|
| 1049 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00,
|
| 1050 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00,
|
| 1051 | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00,
|
| 1052 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00,
|
| 1053 | |
| 1054 | /* Lower case */
|
| 1055 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00,
|
| 1056 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00,
|
| 1057 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00,
|
| 1058 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00,
|
| 1059 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00,
|
| 1060 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00,
|
| 1061 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00,
|
| 1062 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C,
|
| 1063 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1064 | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1065 | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18,
|
| 1066 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00,
|
| 1067 | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1068 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00,
|
| 1069 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1070 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1071 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20,
|
| 1072 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03,
|
| 1073 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 1074 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00,
|
| 1075 | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00,
|
| 1076 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00,
|
| 1077 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00,
|
| 1078 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00,
|
| 1079 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00,
|
| 1080 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C,
|
| 1081 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00,
|
| 1082 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00,
|
| 1083 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1084 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00,
|
| 1085 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00,
|
| 1086 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00,
|
| 1087 | };
|
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | //-------------------------------------------------
|
| 1092 | // ntsc_round_fontdata8x12
|
| 1093 | //-------------------------------------------------
|
| 1094 | |
| 1095 | const UINT8 mc6847_friend_device::ntsc_round_fontdata8x12[] =
|
| 1096 | {
|
| 1097 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00,
|
| 1098 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1099 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00,
|
| 1100 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1101 | 0x00, 0x00, 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00, 0x00, 0x00,
|
| 1102 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 1103 | 0x00, 0x00, 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 1104 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1105 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1106 | 0x00, 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 1107 | 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1108 | 0x00, 0x00, 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00,
|
| 1109 | 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 1110 | 0x00, 0x00, 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1111 | 0x00, 0x00, 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1112 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1113 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 1114 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00,
|
| 1115 | 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00, 0x00, 0x00,
|
| 1116 | 0x00, 0x00, 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1117 | 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1118 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1119 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1120 | 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00, 0x00, 0x00,
|
| 1121 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1122 | 0x00, 0x00, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1123 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 1124 | 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00, 0x00,
|
| 1125 | 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00,
|
| 1126 | 0x00, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x00,
|
| 1127 | 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1128 | 0x00, 0x00, 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 1129 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1130 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 1131 | 0x00, 0x00, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1132 | 0x00, 0x00, 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00, 0x00, 0x00,
|
| 1133 | 0x00, 0x00, 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00, 0x00, 0x00,
|
| 1134 | 0x00, 0x00, 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00, 0x00, 0x00,
|
| 1135 | 0x00, 0x00, 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00, 0x00, 0x00,
|
| 1136 | 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1137 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 1138 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 1139 | 0x00, 0x00, 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00, 0x00, 0x00,
|
| 1140 | 0x00, 0x00, 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 1141 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, 0x00,
|
| 1142 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1143 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 1144 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00,
|
| 1145 | 0x00, 0x00, 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1146 | 0x00, 0x00, 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 1147 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00,
|
| 1148 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1149 | 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00, 0x00, 0x00,
|
| 1150 | 0x00, 0x00, 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1151 | 0x00, 0x00, 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1152 | 0x00, 0x00, 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 1153 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1154 | 0x00, 0x00, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x38, 0x00, 0x00, 0x00,
|
| 1155 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
| 1156 | 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00,
|
| 1157 | 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 1158 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1159 | 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 1160 | 0x00, 0x00, 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
|
| 1161 | |
| 1162 | /* Lower case */
|
| 1163 | 0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1164 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00,
|
| 1165 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00, 0x00, 0x00,
|
| 1166 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1167 | 0x00, 0x00, 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00,
|
| 1168 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00, 0x00, 0x00,
|
| 1169 | 0x00, 0x00, 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1170 | 0x00, 0x00, 0x00, 0x00, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x04, 0x38, 0x00,
|
| 1171 | 0x00, 0x00, 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1172 | 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 1173 | 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00, 0x00,
|
| 1174 | 0x00, 0x00, 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00, 0x00, 0x00,
|
| 1175 | 0x00, 0x00, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00,
|
| 1176 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00,
|
| 1177 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00,
|
| 1178 | 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00,
|
| 1179 | 0x00, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00,
|
| 1180 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x04, 0x00,
|
| 1181 | 0x00, 0x00, 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,
|
| 1182 | 0x00, 0x00, 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00,
|
| 1183 | 0x00, 0x00, 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00, 0x00, 0x00,
|
| 1184 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00, 0x00, 0x00,
|
| 1185 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00,
|
| 1186 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00, 0x00, 0x00,
|
| 1187 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00,
|
| 1188 | 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00,
|
| 1189 | 0x00, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00,
|
| 1190 | 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 1191 | 0x00, 0x00, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00,
|
| 1192 | 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00, 0x00, 0x00,
|
| 1193 | 0x00, 0x00, 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1194 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00,
|
| 1195 | };
|
| 1196 | |
| 1197 | |
| 1198 | |
| 1199 | //-------------------------------------------------
|
| 1200 | // ntsc_square_fontdata8x12
|
| 1201 | //-------------------------------------------------
|
| 1202 | |
| 1203 | const UINT8 mc6847_friend_device::ntsc_square_fontdata8x12[] =
|
| 1204 | {
|
| 1205 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00,
|
| 1206 | 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00,
|
| 1207 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x1C, 0x12, 0x12, 0x3C, 0x00, 0x00,
|
| 1208 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x20, 0x20, 0x20, 0x22, 0x1C, 0x00, 0x00,
|
| 1209 | 0x00, 0x00, 0x00, 0x3C, 0x12, 0x12, 0x12, 0x12, 0x12, 0x3C, 0x00, 0x00,
|
| 1210 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 1211 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x20, 0x38, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 1212 | 0x00, 0x00, 0x00, 0x1E, 0x20, 0x20, 0x26, 0x22, 0x22, 0x1E, 0x00, 0x00,
|
| 1213 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1214 | 0x00, 0x00, 0x00, 0x1C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1215 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1216 | 0x00, 0x00, 0x00, 0x22, 0x24, 0x28, 0x30, 0x28, 0x24, 0x22, 0x00, 0x00,
|
| 1217 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 1218 | 0x00, 0x00, 0x00, 0x22, 0x36, 0x2A, 0x2A, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1219 | 0x00, 0x00, 0x00, 0x22, 0x32, 0x2A, 0x26, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1220 | 0x00, 0x00, 0x00, 0x3E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3E, 0x00, 0x00,
|
| 1221 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 1222 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x2A, 0x24, 0x1A, 0x00, 0x00,
|
| 1223 | 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x3C, 0x28, 0x24, 0x22, 0x00, 0x00,
|
| 1224 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x10, 0x08, 0x04, 0x22, 0x1C, 0x00, 0x00,
|
| 1225 | 0x00, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1226 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1227 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x00, 0x00,
|
| 1228 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x2A, 0x2A, 0x36, 0x22, 0x00, 0x00,
|
| 1229 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x00, 0x00,
|
| 1230 | 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1231 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x3E, 0x00, 0x00,
|
| 1232 | 0x00, 0x00, 0x00, 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00, 0x00,
|
| 1233 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x08, 0x04, 0x02, 0x02, 0x00, 0x00,
|
| 1234 | 0x00, 0x00, 0x00, 0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00, 0x00,
|
| 1235 | 0x00, 0x00, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1236 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3E, 0x10, 0x08, 0x00, 0x00, 0x00,
|
| 1237 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1238 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00,
|
| 1239 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1240 | 0x00, 0x00, 0x00, 0x14, 0x14, 0x36, 0x00, 0x36, 0x14, 0x14, 0x00, 0x00,
|
| 1241 | 0x00, 0x00, 0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08, 0x00, 0x00,
|
| 1242 | 0x00, 0x00, 0x00, 0x32, 0x32, 0x04, 0x08, 0x10, 0x26, 0x26, 0x00, 0x00,
|
| 1243 | 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2A, 0x24, 0x1A, 0x00, 0x00,
|
| 1244 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1245 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, 0x00,
|
| 1246 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00,
|
| 1247 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00,
|
| 1248 | 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00,
|
| 1249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x10, 0x20, 0x00, 0x00,
|
| 1250 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00,
|
| 1252 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00,
|
| 1253 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x24, 0x24, 0x24, 0x18, 0x00, 0x00,
|
| 1254 | 0x00, 0x00, 0x00, 0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1255 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1C, 0x20, 0x20, 0x3E, 0x00, 0x00,
|
| 1256 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x04, 0x02, 0x22, 0x1C, 0x00, 0x00,
|
| 1257 | 0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x3E, 0x04, 0x04, 0x04, 0x00, 0x00,
|
| 1258 | 0x00, 0x00, 0x00, 0x3E, 0x20, 0x3C, 0x02, 0x02, 0x22, 0x1C, 0x00, 0x00,
|
| 1259 | 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1260 | 0x00, 0x00, 0x00, 0x3E, 0x02, 0x04, 0x08, 0x10, 0x20, 0x20, 0x00, 0x00,
|
| 1261 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1C, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1262 | 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x1E, 0x02, 0x02, 0x1C, 0x00, 0x00,
|
| 1263 | 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
|
| 1264 | 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00,
|
| 1265 | 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00,
|
| 1266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00,
|
| 1267 | 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00,
|
| 1268 | 0x00, 0x00, 0x00, 0x18, 0x24, 0x04, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00,
|
| 1269 | |
| 1270 | /* Lower case */
|
| 1271 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x12, 0x3C, 0x00, 0x00,
|
| 1272 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x02, 0x1E, 0x22, 0x1E, 0x00, 0x00,
|
| 1273 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x00, 0x00,
|
| 1274 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00,
|
| 1275 | 0x00, 0x00, 0x00, 0x02, 0x02, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x00, 0x00,
|
| 1276 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x3E, 0x20, 0x1C, 0x00, 0x00,
|
| 1277 | 0x00, 0x00, 0x00, 0x0C, 0x12, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00,
|
| 1278 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C,
|
| 1279 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1280 | 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1281 | 0x00, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x24, 0x18,
|
| 1282 | 0x00, 0x00, 0x00, 0x20, 0x20, 0x24, 0x28, 0x38, 0x24, 0x22, 0x00, 0x00,
|
| 1283 | 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1C, 0x00, 0x00,
|
| 1284 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x2A, 0x2A, 0x2A, 0x2A, 0x00, 0x00,
|
| 1285 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x22, 0x22, 0x22, 0x00, 0x00,
|
| 1286 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00, 0x00,
|
| 1287 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20,
|
| 1288 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x03,
|
| 1289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00,
|
| 1290 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x00, 0x00,
|
| 1291 | 0x00, 0x00, 0x00, 0x10, 0x3C, 0x10, 0x10, 0x10, 0x12, 0x0C, 0x00, 0x00,
|
| 1292 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x26, 0x1A, 0x00, 0x00,
|
| 1293 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x14, 0x14, 0x08, 0x00, 0x00,
|
| 1294 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x2A, 0x2A, 0x1C, 0x14, 0x00, 0x00,
|
| 1295 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00,
|
| 1296 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x1E, 0x02, 0x1C,
|
| 1297 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x04, 0x08, 0x10, 0x3E, 0x00, 0x00,
|
| 1298 | 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00, 0x00,
|
| 1299 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00,
|
| 1300 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00, 0x00,
|
| 1301 | 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x00,
|
| 1302 | 0x00, 0x00, 0x00, 0x08, 0x04, 0x3E, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00
|
| 1303 | };
|
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | //-------------------------------------------------
|
| 1308 | // semigraphics4_fontdata8x12
|
| 1309 | //-------------------------------------------------
|
| 1310 | |
| 1311 | const UINT8 mc6847_friend_device::semigraphics4_fontdata8x12[] =
|
| 1312 | {
|
| 1313 | /* Block Graphics (Semigraphics 4 Graphics ) */
|
| 1314 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1315 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1316 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1317 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1318 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1319 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1320 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1321 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1322 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1323 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1324 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1325 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1326 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1327 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1328 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1329 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
| 1330 | };
|
| 1331 | |
| 1332 | |
| 1333 | |
| 1334 | //-------------------------------------------------
|
| 1335 | // semigraphics6_fontdata8x12
|
| 1336 | //-------------------------------------------------
|
| 1337 | |
| 1338 | const UINT8 mc6847_friend_device::semigraphics6_fontdata8x12[] =
|
| 1339 | {
|
| 1340 | /* Semigraphics 6 */
|
| 1341 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1342 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1343 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1344 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1345 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00,
|
| 1346 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1347 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1348 | 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1349 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00,
|
| 1350 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1351 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1352 | 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1353 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
| 1354 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1355 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1356 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1357 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1358 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1359 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1360 | 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1361 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00,
|
| 1362 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1363 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1364 | 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1365 | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00,
|
| 1366 | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1367 | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1368 | 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1369 | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
| 1370 | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1371 | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1372 | 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1373 | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1374 | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1375 | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1376 | 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1377 | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00,
|
| 1378 | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1379 | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1380 | 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1381 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00,
|
| 1382 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1383 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1384 | 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1385 | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
| 1386 | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1387 | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1388 | 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1389 | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
| 1390 | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1391 | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1392 | 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1393 | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00,
|
| 1394 | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1395 | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1396 | 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1397 | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00,
|
| 1398 | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1399 | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1400 | 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
|
| 1401 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
| 1402 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F,
|
| 1403 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0,
|
| 1404 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
| 1405 | };
|
| 1406 | |
| 1407 | |
| 1408 | |
| 1409 | //**************************************************************************
|
| 1410 | // ARTIFACTING
|
| 1411 | //**************************************************************************
|
| 1412 | |
| 1413 | INPUT_PORTS_START(mc6847_artifacting)
|
| 1414 | PORT_START(ARTIFACTING_TAG)
|
| 1415 | PORT_CONFNAME( 0x03, 0x01, "Artifacting" )
|
| 1416 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
|
| 1417 | PORT_CONFSETTING( 0x01, DEF_STR( Standard ) )
|
| 1418 | PORT_CONFSETTING( 0x02, DEF_STR( Reverse ) )
|
| 1419 | INPUT_PORTS_END
|
| 1420 | |
| 1421 | ioport_constructor mc6847_base_device::device_input_ports() const
|
| 1422 | {
|
| 1423 | return INPUT_PORTS_NAME(mc6847_artifacting);
|
| 1424 | }
|
| 1425 | |
| 1426 | |
| 1427 | |
| 1428 | //-------------------------------------------------
|
| 1429 | // ctor
|
| 1430 | //-------------------------------------------------
|
| 1431 | |
| 1432 | mc6847_base_device::artifacter::artifacter()
|
| 1433 | {
|
| 1434 | m_config = NULL;
|
| 1435 | m_artifacting = 0;
|
| 1436 | m_saved_artifacting = 0;
|
| 1437 | m_saved_c0 = 0;
|
| 1438 | m_saved_c1 = 0;
|
| 1439 | memset(m_expanded_colors, 0, sizeof(m_expanded_colors));
|
| 1440 | }
|
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | //-------------------------------------------------
|
| 1445 | // artifacter::setup_config
|
| 1446 | //-------------------------------------------------
|
| 1447 | |
| 1448 | void mc6847_base_device::artifacter::setup_config(device_t *device)
|
| 1449 | {
|
| 1450 | char port_name[32];
|
| 1451 | snprintf(port_name, ARRAY_LENGTH(port_name), "%s:%s", device->tag(), ARTIFACTING_TAG);
|
| 1452 | m_config = device->machine().port(port_name);
|
| 1453 | }
|
| 1454 | |
| 1455 | |
| 1456 | |
| 1457 | //-------------------------------------------------
|
| 1458 | // artifacter::update_colors
|
| 1459 | //-------------------------------------------------
|
| 1460 | |
| 1461 | void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1)
|
| 1462 | {
|
| 1463 | /* Boy this code sucks; this code was adapted from the old M6847
|
| 1464 | * artifacting implmentation. The only reason that it didn't look as
|
| 1465 | * horrible was because the code around it sucked as well. Now that I
|
| 1466 | * have cleaned everything up, the ugliness is much more prominent.
|
| 1467 | *
|
| 1468 | * Hopefully we will have a generic artifacting algorithm that plugs into
|
| 1469 | * the MESS/MAME core directly so we can chuck this hack */
|
| 1470 | static const double artifact_colors[14*3] =
|
| 1471 | {
|
| 1472 | 0.157, 0.000, 0.157, /* [ 1] - dk purple (reverse 2) */
|
| 1473 | 0.000, 0.157, 0.000, /* [ 2] - dk green (reverse 1) */
|
| 1474 | 1.000, 0.824, 1.000, /* [ 3] - lt purple (reverse 4) */
|
| 1475 | 0.824, 1.000, 0.824, /* [ 4] - lt green (reverse 3) */
|
| 1476 | 0.706, 0.236, 0.118, /* [ 5] - dk blue (reverse 6) */
|
| 1477 | 0.000, 0.197, 0.471, /* [ 6] - dk red (reverse 5) */
|
| 1478 | 1.000, 0.550, 0.393, /* [ 7] - lt blue (reverse 8) */
|
| 1479 | 0.275, 0.785, 1.000, /* [ 8] - lt red (reverse 7) */
|
| 1480 | 0.000, 0.500, 1.000, /* [ 9] - red (reverse 10) */
|
| 1481 | 1.000, 0.500, 0.000, /* [10] - blue (reverse 9) */
|
| 1482 | 1.000, 0.942, 0.785, /* [11] - cyan (reverse 12) */
|
| 1483 | 0.393, 0.942, 1.000, /* [12] - yellow (reverse 11) */
|
| 1484 | 0.236, 0.000, 0.000, /* [13] - black-blue (reverse 14) */
|
| 1485 | 0.000, 0.000, 0.236 /* [14] - black-red (reverse 13) */
|
| 1486 | };
|
| 1487 | |
| 1488 | static const UINT8 artifact_correction[128] =
|
| 1489 | {
|
| 1490 | 0, 0, 0, 0, 0, 6, 0, 2,
|
| 1491 | 5, 7, 5, 7, 1, 3, 1, 11,
|
| 1492 | 8, 6, 8, 14, 8, 9, 8, 9,
|
| 1493 | 4, 4, 4, 15, 12, 12, 12, 15,
|
| 1494 | |
| 1495 | 5, 13, 5, 13, 13, 0, 13, 2,
|
| 1496 | 10, 10, 10, 10, 10, 15, 10, 11,
|
| 1497 | 3, 1, 3, 1, 15, 9, 15, 9,
|
| 1498 | 11, 11, 11, 11, 15, 15, 15, 15,
|
| 1499 | |
| 1500 | 14, 0, 14, 0, 14, 6, 14, 2,
|
| 1501 | 0, 7, 0, 7, 1, 3, 1, 11,
|
| 1502 | 9, 6, 9, 14, 9, 9, 9, 9,
|
| 1503 | 15, 4, 15, 15, 12, 12, 12, 15,
|
| 1504 | |
| 1505 | 2, 13, 2, 13, 2, 0, 2, 2,
|
| 1506 | 10, 10, 10, 10, 10, 15, 10, 11,
|
| 1507 | 12, 1, 12, 1, 12, 9, 12, 9,
|
| 1508 | 15, 11, 15, 11, 15, 15, 15, 15
|
| 1509 | };
|
| 1510 | |
| 1511 | pixel_t colors[16];
|
| 1512 | int i;
|
| 1513 | |
| 1514 | /* do we need to update our artifact colors table? */
|
| 1515 | if ((m_artifacting != m_saved_artifacting) || (c0 != m_saved_c0) || (c1 != m_saved_c1))
|
| 1516 | {
|
| 1517 | m_saved_artifacting = m_artifacting;
|
| 1518 | m_saved_c0 = colors[0] = c0;
|
| 1519 | m_saved_c1 = colors[15] = c1;
|
| 1520 | |
| 1521 | /* mix the other colors */
|
| 1522 | for (i = 1; i <= 14; i++)
|
| 1523 | {
|
| 1524 | const double *factors = &artifact_colors[((i - 1) ^ (m_artifacting & 0x01)) * 3];
|
| 1525 | |
| 1526 | colors[i] = (mix_color(factors[0], c0 >> 16, c1 >> 16) << 16)
|
| 1527 | | (mix_color(factors[1], c0 >> 8, c1 >> 8) << 8)
|
| 1528 | | (mix_color(factors[2], c0 >> 0, c1 >> 0) << 0);
|
| 1529 | }
|
| 1530 | for (i = 0; i < 128; i++)
|
| 1531 | {
|
| 1532 | m_expanded_colors[i] = colors[artifact_correction[i]];
|
| 1533 | }
|
| 1534 | }
|
| 1535 | }
|
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | //-------------------------------------------------
|
| 1540 | // artifacter::update
|
| 1541 | //-------------------------------------------------
|
| 1542 | |
| 1543 | mc6847_base_device::pixel_t mc6847_base_device::artifacter::mix_color(double factor, UINT8 c0, UINT8 c1)
|
| 1544 | {
|
| 1545 | return (UINT32) (UINT8) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5);
|
| 1546 | }
|
| 1547 | |
| 1548 | |
| 1549 | |
| 1550 | //**************************************************************************
|
| 1551 | // VARIATIONS
|
| 1552 | //**************************************************************************
|
| 1553 | |
| 1554 | const device_type MC6847_NTSC = &device_creator<mc6847_ntsc_device>;
|
| 1555 | const device_type MC6847_PAL = &device_creator<mc6847_pal_device>;
|
| 1556 | const device_type MC6847Y_NTSC = &device_creator<mc6847y_ntsc_device>;
|
| 1557 | const device_type MC6847Y_PAL = &device_creator<mc6847y_pal_device>;
|
| 1558 | const device_type MC6847T1_NTSC = &device_creator<mc6847t1_ntsc_device>;
|
| 1559 | const device_type MC6847T1_PAL = &device_creator<mc6847t1_pal_device>;
|
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | //-------------------------------------------------
|
| 1564 | // mc6847_ntsc_device
|
| 1565 | //-------------------------------------------------
|
| 1566 | |
| 1567 | mc6847_ntsc_device::mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1568 | : mc6847_base_device(mconfig, MC6847_NTSC, "MC6847_NTSC", tag, owner, clock, ntsc_square_fontdata8x12, 227.0)
|
| 1569 | {
|
| 1570 | }
|
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | //-------------------------------------------------
|
| 1575 | // mc6847_pal_device
|
| 1576 | //-------------------------------------------------
|
| 1577 | |
| 1578 | mc6847_pal_device::mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1579 | : mc6847_base_device(mconfig, MC6847_PAL, "MC6847_PAL", tag, owner, clock, pal_square_fontdata8x12, 227.0)
|
| 1580 | {
|
| 1581 | }
|
| 1582 | |
| 1583 | |
| 1584 | |
| 1585 | //-------------------------------------------------
|
| 1586 | // mc6847y_ntsc_device
|
| 1587 | //-------------------------------------------------
|
| 1588 | |
| 1589 | mc6847y_ntsc_device::mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1590 | : mc6847_base_device(mconfig, MC6847Y_NTSC, "MC6847Y_NTSC", tag, owner, clock, ntsc_square_fontdata8x12, 227.5)
|
| 1591 | {
|
| 1592 | }
|
| 1593 | |
| 1594 | |
| 1595 | |
| 1596 | //-------------------------------------------------
|
| 1597 | // mc6847y_pal_device
|
| 1598 | //-------------------------------------------------
|
| 1599 | |
| 1600 | mc6847y_pal_device::mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1601 | : mc6847_base_device(mconfig, MC6847Y_PAL, "MC6847Y_PAL", tag, owner, clock, pal_square_fontdata8x12, 227.5)
|
| 1602 | {
|
| 1603 | }
|
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | //-------------------------------------------------
|
| 1608 | // mc6847t1_ntsc_device
|
| 1609 | //-------------------------------------------------
|
| 1610 | |
| 1611 | mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1612 | : mc6847_base_device(mconfig, MC6847T1_NTSC, "MC6847T1_NTSC", tag, owner, clock, ntsc_round_fontdata8x12, 227.0)
|
| 1613 | {
|
| 1614 | }
|
| 1615 | |
| 1616 | |
| 1617 | |
| 1618 | //-------------------------------------------------
|
| 1619 | // mc6847t1_pal_device
|
| 1620 | //-------------------------------------------------
|
| 1621 | |
| 1622 | mc6847t1_pal_device::mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1623 | : mc6847_base_device(mconfig, MC6847T1_PAL, "MC6847T1_PAL", tag, owner, clock, pal_round_fontdata8x12, 227.0)
|
| 1624 | {
|
| 1625 | }
|
| 1626 | |
| 1627 | |
| 1628 | |
src/mess/video/gime.c
| r0 | r13257 | |
| 1 | /*********************************************************************
|
| 2 | |
| 3 | gime.c
|
| 4 | |
| 5 | Implementation of CoCo GIME (Graphics Interrupt Memory Enhancement)
|
| 6 | video chip. |
| 7 | |
| 8 | Mid frame raster effects (source John Kowalski)
|
| 9 | |
| 10 | Here are the things that get changed mid-frame:
|
| 11 | |
| 12 | - Palette registers ($FFB0-$FFBF)
|
| 13 | - Horizontal resolution (switches between 256 and 320 pixels, $FF99)
|
| 14 | - Horizontal scroll position (bits 0-6 $FF9F)
|
| 15 | - Horizontal virtual screen (bit 7 $FF9F)
|
| 16 | - Pixel height (bits 0-2 $FF98)
|
| 17 | - Border color ($FF9A)
|
| 18 | |
| 19 | On the positive side, you don't have to worry about registers
|
| 20 | $FF9D/$FF9E being changed mid-frame. Even if they are changed
|
| 21 | mid-frame, they have no effect on the displayed image. The video
|
| 22 | address only gets latched at the top of the frame.
|
| 23 | |
| 24 | |
| 25 | TIMING
|
| 26 | |
| 27 | We divide a single frame into five regions
|
| 28 | |
| 29 | Region Scanlines (on 192) Field Sync (before right border)
|
| 30 | ------ ------------------ --------------------------------
|
| 31 | Top Border 25 1
|
| 32 | Body 192 1
|
| 33 | Bottom Border 26 1
|
| 34 | Vertical Retrace 6 0
|
| 35 | Vertical Blanking 13 (or 13.5) 1
|
| 36 | |
| 37 | Horizontal sync appears to be low only during retrace/blanking but
|
| 38 | field sync switches as soon as the last body pixel is displayed
|
| 39 | |
| 40 | Note that the GIME trailing edges field sync after the bottom
|
| 41 | border; this is different than the MC6847
|
| 42 | |
| 43 | **********************************************************************
|
| 44 | |
| 45 | SOFTWARE FOR TIMING TESTING
|
| 46 | |
| 47 | Various CoCo 3 programs can "stress test" timing in various ways
|
| 48 | |
| 49 | COLOR3: This program was in Rainbow January 1987. It will synchronize
|
| 50 | with field sync by polling bit 7 of $FF03 (PIA0) (specifically, it polls
|
| 51 | until the rising edge of writes to PIA0 CB1). This causes the loop to
|
| 52 | be broken out at the top of vblank. COLOR3 also synchronizes on
|
| 53 | horizontal sync through PIA0; it counts 70 hsyncs to get to a point 32
|
| 54 | scanlines into the body.
|
| 55 | |
| 56 | DEMO: This SockMaster demo has a main loop that adjusts GIME registers
|
| 57 | and shuffles some graphics bytes. From a timing perspective, the
|
| 58 | critical piece is a SYNC with PIA field sync (specifically, it SYNCs
|
| 59 | with the trailing edge of writes to PIA0 CB1). DEMO does not attempt
|
| 60 | to synchronize on horizontal sync; it relies on CPU timing.
|
| 61 | |
| 62 | MOON: SockMaster demo. Uses GIME interrupts; FIRQ gets TMR interrupts
|
| 63 | and IRQ gets VBORD interrupts. Since it does not use the PIA field
|
| 64 | sync, it can be used to demonstrate how the GIME's VBORD interrupt
|
| 65 | is distinct.
|
| 66 | |
| 67 | BOINK: SockMaster demo. Like DEMO, it SYNCs on the trailing edge
|
| 68 | of PIA field sync. Also uses non standard $FF99 LPF mode. If
|
| 69 | BOINK "wobbles vertically", it suggests that the main loop is not
|
| 70 | executing within a single field sync. BOINK also makes extensive
|
| 71 | use of $FF9F scrolling with bit 7 cleared.
|
| 72 | |
| 73 | CRYSTAL CITY: Jeremy Spiller game. The intro uses an attribute-less
|
| 74 | GIME text mode
|
| 75 | |
| 76 | **********************************************************************/
|
| 77 | |
| 78 | #define ADDRESS_MAP_MODERN
|
| 79 | |
| 80 | #include "emu.h"
|
| 81 | #include "devcpu.h"
|
| 82 | #include "video/gime.h"
|
| 83 | #include "machine/6883sam.h"
|
| 84 | #include "machine/cococart.h"
|
| 85 | #include "machine/ram.h"
|
| 86 | |
| 87 | |
| 88 | |
| 89 | //**************************************************************************
|
| 90 | // CONSTANTS
|
| 91 | //**************************************************************************
|
| 92 | |
| 93 | #define USE_HORIZONTAL_CLIP false
|
| 94 | #define GIME_TYPE_1987 0
|
| 95 | #define NO_ATTRIBUTE 0x80
|
| 96 | |
| 97 | #define LOG_INT_MASKING 0
|
| 98 | #define LOG_GIME 0
|
| 99 | #define LOG_TIMER 0
|
| 100 | |
| 101 | |
| 102 | |
| 103 | //**************************************************************************
|
| 104 | // DEVICE SETUP
|
| 105 | //**************************************************************************
|
| 106 | |
| 107 | //-------------------------------------------------
|
| 108 | // ctor
|
| 109 | //-------------------------------------------------
|
| 110 | |
| 111 | gime_base_device::gime_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const UINT8 *fontdata)
|
| 112 | : mc6847_friend_device(mconfig, type, name, tag, owner, clock, fontdata, true, 263, 25+192+26+3)
|
| 113 | {
|
| 114 | }
|
| 115 | |
| 116 | |
| 117 | |
| 118 | //-------------------------------------------------
|
| 119 | // device_start - device-specific startup
|
| 120 | //-------------------------------------------------
|
| 121 | |
| 122 | void gime_base_device::device_start(void)
|
| 123 | {
|
| 124 | /* get the config */
|
| 125 | const gime_interface *config = (const gime_interface *) static_config();
|
| 126 | assert(config);
|
| 127 | |
| 128 | /* find the RAM device - make sure that it is started */
|
| 129 | m_ram = machine().device<ram_device>(config->m_ram_tag);
|
| 130 | if (!m_ram->started())
|
| 131 | throw device_missing_dependencies();
|
| 132 | |
| 133 | /* find the CART device - make sure that it is started */
|
| 134 | cococart_slot_device *cart_device = machine().device<cococart_slot_device>(config->m_ext_tag);
|
| 135 | if (!cart_device->started())
|
| 136 | throw device_missing_dependencies();
|
| 137 | |
| 138 | /* find the CPU device - make sure that it is started */
|
| 139 | m_cpu = machine().device<cpu_device>(config->m_maincpu_tag);
|
| 140 | if (!m_cpu->started())
|
| 141 | throw device_missing_dependencies();
|
| 142 | |
| 143 | /* inherited device_start - need to do this after checking dependencies */
|
| 144 | super::device_start();
|
| 145 | |
| 146 | /* initialize variables */
|
| 147 | memset(m_scanlines, 0, sizeof(m_scanlines));
|
| 148 | m_interrupt_value = 0x00;
|
| 149 | m_irq = 0x00;
|
| 150 | m_firq = 0x00;
|
| 151 | |
| 152 | /* allocate timer */
|
| 153 | m_gime_clock_timer = timer_alloc(TIMER_GIME_CLOCK);
|
| 154 | |
| 155 | /* resolve callbacks */
|
| 156 | m_res_out_hsync_func.resolve(config->m_out_hsync_func, *this);
|
| 157 | m_res_out_fsync_func.resolve(config->m_out_fsync_func, *this);
|
| 158 | m_res_out_irq_func.resolve(config->m_out_irq_func, *this);
|
| 159 | m_res_out_firq_func.resolve(config->m_out_firq_func, *this);
|
| 160 | |
| 161 | /* set up ROM/RAM pointers */
|
| 162 | m_rom = machine().region(config->m_maincpu_tag)->base();
|
| 163 | m_cart_rom = cart_device->get_cart_base();
|
| 164 | |
| 165 | /* populate palettes */
|
| 166 | for (int color = 0; color < 64; color++)
|
| 167 | {
|
| 168 | m_composite_palette[color] = get_composite_color(color);
|
| 169 | m_composite_bw_palette[color] = black_and_white(m_composite_palette[color]);
|
| 170 | m_rgb_palette[color] = get_rgb_color(color);
|
| 171 | }
|
| 172 | |
| 173 | /* set up save states */
|
| 174 | save_pointer(NAME(m_gime_registers), ARRAY_LENGTH(m_gime_registers));
|
| 175 | save_pointer(NAME(m_mmu), ARRAY_LENGTH(m_mmu));
|
| 176 | save_item(NAME(m_sam_state));
|
| 177 | save_item(NAME(m_ff22_value));
|
| 178 | save_item(NAME(m_interrupt_value));
|
| 179 | save_item(NAME(m_irq));
|
| 180 | save_item(NAME(m_firq));
|
| 181 | save_item(NAME(m_timer_value));
|
| 182 | save_item(NAME(m_is_blinking));
|
| 183 | }
|
| 184 | |
| 185 | |
| 186 | |
| 187 | //-------------------------------------------------
|
| 188 | // get_composite_color
|
| 189 | //-------------------------------------------------
|
| 190 | |
| 191 | ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_composite_color(int color)
|
| 192 | {
|
| 193 | /* CMP colors
|
| 194 | *
|
| 195 | * These colors are of the format IICCCC, where II is the intensity and
|
| 196 | * CCCC is the base color. There is some weirdness because intensity
|
| 197 | * is often different for each base color.
|
| 198 | *
|
| 199 | * The code below is based on an algorithm specified in the following
|
| 200 | * CoCo BASIC program was used to approximate composite colors.
|
| 201 | * (Program by SockMaster):
|
| 202 | *
|
| 203 | * 10 POKE65497,0:DIMR(63),G(63),B(63):WIDTH80:PALETTE0,0:PALETTE8,54:CLS1
|
| 204 | * 20 SAT=92:CON=70:BRI=-50:L(0)=0:L(1)=47:L(2)=120:L(3)=255
|
| 205 | * 30 W=.4195456981879*1.01:A=W*9.2:S=A+W*5:D=S+W*5:P=0:FORH=0TO3:P=P+1
|
| 206 | * 40 BRI=BRI+CON:FORG=1TO15:R(P)=COS(A)*SAT+BRI
|
| 207 | * 50 G(P)=(COS(S)*SAT)*1+BRI:B(P)=(COS(D)*SAT)*1+BRI:P=P+1
|
| 208 | * 55 A=A+W:S=S+W:D=D+W:NEXT:R(P-16)=L(H):G(P-16)=L(H):B(P-16)=L(H)
|
| 209 | * 60 NEXT:R(63)=R(48):G(63)=G(48):B(63)=B(48)
|
| 210 | * 70 FORH=0TO63STEP1:R=INT(R(H)):G=INT(G(H)):B=INT(B(H)):IFR<0THENR=0
|
| 211 | * 80 IFG<0THENG=0
|
| 212 | * 90 IFB<0THENB=0
|
| 213 | * 91 IFR>255THENR=255
|
| 214 | * 92 IFG>255THENG=255
|
| 215 | * 93 IFB>255THENB=255
|
| 216 | * 100 PRINTRIGHT$(STR$(H),2);" $";:R=R+256:G=G+256:B=B+256
|
| 217 | * 110 PRINTRIGHT$(HEX$(R),2);",$";RIGHT$(HEX$(G),2);",$";RIGHT$(HEX$(B),2)
|
| 218 | * 115 IF(H AND15)=15 THENIFINKEY$=""THEN115ELSEPRINT
|
| 219 | * 120 NEXT
|
| 220 | *
|
| 221 | * At one point, we used a different SockMaster program, but the colors
|
| 222 | * produced were too dark for people's taste
|
| 223 | *
|
| 224 | * 10 POKE65497,0:DIMR(63),G(63),B(63):WIDTH80:PALETTE0,0:PALETTE8,54:CLS1
|
| 225 | * 20 SAT=92:CON=53:BRI=-16:L(0)=0:L(1)=47:L(2)=120:L(3)=255
|
| 226 | * 30 W=.4195456981879*1.01:A=W*9.2:S=A+W*5:D=S+W*5:P=0:FORH=0TO3:P=P+1
|
| 227 | * 40 BRI=BRI+CON:FORG=1TO15:R(P)=COS(A)*SAT+BRI
|
| 228 | * 50 G(P)=(COS(S)*SAT)*.50+BRI:B(P)=(COS(D)*SAT)*1.9+BRI:P=P+1
|
| 229 | * 55 A=A+W:S=S+W:D=D+W:NEXT:R(P-16)=L(H):G(P-16)=L(H):B(P-16)=L(H)
|
| 230 | * 60 NEXT:R(63)=R(48):G(63)=G(48):B(63)=B(48)
|
| 231 | * 70 FORH=0TO63STEP1:R=INT(R(H)):G=INT(G(H)):B=INT(B(H)):IFR<0THENR=0
|
| 232 | * 80 IFG<0THENG=0
|
| 233 | * 90 IFB<0THENB=0
|
| 234 | * 91 IFR>255THENR=255
|
| 235 | * 92 IFG>255THENG=255
|
| 236 | * 93 IFB>255THENB=255
|
| 237 | * 100 PRINTRIGHT$(STR$(H),2);" $";:R=R+256:G=G+256:B=B+256
|
| 238 | * 110 PRINTRIGHT$(HEX$(R),2);",$";RIGHT$(HEX$(G),2);",$";RIGHT$(HEX$(B),2)
|
| 239 | * 115 IF(H AND15)=15 THENIFINKEY$=""THEN115ELSEPRINT
|
| 240 | * 120 NEXT
|
| 241 | */
|
| 242 | |
| 243 | double saturation, brightness, contrast;
|
| 244 | int offset;
|
| 245 | double w;
|
| 246 | int r, g, b;
|
| 247 | |
| 248 | switch(color)
|
| 249 | {
|
| 250 | case 0:
|
| 251 | r = g = b = 0;
|
| 252 | break;
|
| 253 | |
| 254 | case 16:
|
| 255 | r = g = b = 47;
|
| 256 | break;
|
| 257 | |
| 258 | case 32:
|
| 259 | r = g = b = 120;
|
| 260 | break;
|
| 261 | |
| 262 | case 48:
|
| 263 | case 63:
|
| 264 | r = g = b = 255;
|
| 265 | break;
|
| 266 | |
| 267 | default:
|
| 268 | w = .4195456981879*1.01;
|
| 269 | contrast = 70;
|
| 270 | saturation = 92;
|
| 271 | brightness = -50;
|
| 272 | brightness += ((color / 16) + 1) * contrast;
|
| 273 | offset = (color % 16) - 1 + (color / 16)*15;
|
| 274 | r = cos(w*(offset + 9.2)) * saturation + brightness;
|
| 275 | g = cos(w*(offset + 14.2)) * saturation + brightness;
|
| 276 | b = cos(w*(offset + 19.2)) * saturation + brightness;
|
| 277 | |
| 278 | if (r < 0)
|
| 279 | r = 0;
|
| 280 | else if (r > 255)
|
| 281 | r = 255;
|
| 282 | |
| 283 | if (g < 0)
|
| 284 | g = 0;
|
| 285 | else if (g > 255)
|
| 286 | g = 255;
|
| 287 | |
| 288 | if (b < 0)
|
| 289 | b = 0;
|
| 290 | else if (b > 255)
|
| 291 | b = 255;
|
| 292 | break;
|
| 293 | }
|
| 294 | return (pixel_t) ((r << 16) | (g << 8) | (b << 0));
|
| 295 | }
|
| 296 | |
| 297 | |
| 298 | |
| 299 | //-------------------------------------------------
|
| 300 | // get_rgb_color
|
| 301 | //-------------------------------------------------
|
| 302 | |
| 303 | ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_rgb_color(int color)
|
| 304 | {
|
| 305 | return (((color >> 4) & 2) | ((color >> 2) & 1)) * 0x550000
|
| 306 | | (((color >> 3) & 2) | ((color >> 1) & 1)) * 0x005500
|
| 307 | | (((color >> 2) & 2) | ((color >> 0) & 1)) * 0x000055;
|
| 308 | }
|
| 309 | |
| 310 | |
| 311 | |
| 312 | //-------------------------------------------------
|
| 313 | // device_reset - device-specific reset
|
| 314 | //-------------------------------------------------
|
| 315 | |
| 316 | void gime_base_device::device_reset(void)
|
| 317 | {
|
| 318 | /* Tepolt verifies that the GIME registers are all cleared on initialization */
|
| 319 | memset(m_gime_registers, 0, sizeof(m_gime_registers));
|
| 320 | |
| 321 | /* initialize MMU */
|
| 322 | for (int i = 0; i < 8; i++)
|
| 323 | m_mmu[i] = m_mmu[i + 8] = 56 + i;
|
| 324 | |
| 325 | /* initialize palette */
|
| 326 | memset(m_palette_rotated, 0, sizeof(m_palette_rotated));
|
| 327 | m_palette_rotated_position = 0;
|
| 328 | m_palette_rotated_position_used = false;
|
| 329 | |
| 330 | /* clear SAM state */
|
| 331 | m_sam_state = 0x0000;
|
| 332 | |
| 333 | /* clear interrupts */
|
| 334 | m_interrupt_value = 0x00;
|
| 335 | m_irq = 0x00;
|
| 336 | m_firq = 0x00;
|
| 337 | m_is_blinking = false;
|
| 338 | |
| 339 | update_memory();
|
| 340 | reset_timer();
|
| 341 | }
|
| 342 | |
| 343 | |
| 344 | |
| 345 | //-------------------------------------------------
|
| 346 | // device_pre_save - device-specific pre save
|
| 347 | //-------------------------------------------------
|
| 348 | |
| 349 | void gime_base_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
| 350 | {
|
| 351 | switch(id)
|
| 352 | {
|
| 353 | case TIMER_GIME_CLOCK:
|
| 354 | timer_elapsed();
|
| 355 | break;
|
| 356 | |
| 357 | default:
|
| 358 | super::device_timer(timer, id, param, ptr);
|
| 359 | break;
|
| 360 | }
|
| 361 | }
|
| 362 | |
| 363 | |
| 364 | |
| 365 | //-------------------------------------------------
|
| 366 | // device_post_load - device-specific post load
|
| 367 | //-------------------------------------------------
|
| 368 | |
| 369 | void gime_base_device::device_post_load()
|
| 370 | {
|
| 371 | super::device_post_load();
|
| 372 | update_memory();
|
| 373 | }
|
| 374 | |
| 375 | |
| 376 | |
| 377 | //-------------------------------------------------
|
| 378 | // device_input_ports
|
| 379 | //-------------------------------------------------
|
| 380 | |
| 381 | ioport_constructor gime_base_device::device_input_ports() const
|
| 382 | {
|
| 383 | return INPUT_PORTS_NAME(mc6847_artifacting);
|
| 384 | }
|
| 385 | |
| 386 | |
| 387 | |
| 388 | //**************************************************************************
|
| 389 | // TIMER
|
| 390 | // |
| 391 | // The CoCo 3 had a timer that had would activate when first written to, and
|
| 392 | // would decrement over and over again until zero was reached, and at that
|
| 393 | // point, would flag an interrupt. At this point, the timer starts back up
|
| 394 | // again.
|
| 395 | //
|
| 396 | // I am deducing that the timer interrupt line was asserted if the timer was
|
| 397 | // zero and unasserted if the timer was non-zero. Since we never truly track
|
| 398 | // the timer, we just use timer callback (coco3_timer_callback() asserts the
|
| 399 | // line)
|
| 400 | //
|
| 401 | // Most CoCo 3 docs, including the specs that Tandy released, say that the
|
| 402 | // high speed timer is 70ns (half of the speed of the main clock crystal).
|
| 403 | // However, it seems that this is in error, and the GIME timer is really a
|
| 404 | // 280ns timer (one eighth the speed of the main clock crystal. Gault's
|
| 405 | // FAQ agrees with this
|
| 406 | //
|
| 407 | //**************************************************************************
|
| 408 | |
| 409 | //-------------------------------------------------
|
| 410 | // timer_type
|
| 411 | //-------------------------------------------------
|
| 412 | |
| 413 | gime_base_device::timer_type_t gime_base_device::timer_type(void)
|
| 414 | {
|
| 415 | // wraps the GIME register access and returns an enumeration
|
| 416 | return (m_gime_registers[0x01] & 0x20) ? GIME_TIMER_CLOCK : GIME_TIMER_HBORD;
|
| 417 | }
|
| 418 | |
| 419 | |
| 420 | |
| 421 | //-------------------------------------------------
|
| 422 | // timer_type_string
|
| 423 | //-------------------------------------------------
|
| 424 | |
| 425 | const char *gime_base_device::timer_type_string(void)
|
| 426 | {
|
| 427 | const char *result;
|
| 428 | switch(timer_type())
|
| 429 | {
|
| 430 | case GIME_TIMER_CLOCK:
|
| 431 | result = "CLOCK";
|
| 432 | break;
|
| 433 | case GIME_TIMER_HBORD:
|
| 434 | result = "HBORD";
|
| 435 | break;
|
| 436 | default:
|
| 437 | fatalerror("Should not get here");
|
| 438 | break;
|
| 439 | }
|
| 440 | return result;
|
| 441 | }
|
| 442 | |
| 443 | |
| 444 | |
| 445 | //-------------------------------------------------
|
| 446 | // timer_elapsed
|
| 447 | //-------------------------------------------------
|
| 448 | |
| 449 | void gime_base_device::timer_elapsed(void)
|
| 450 | {
|
| 451 | /* reset the timer; give her another run! */
|
| 452 | reset_timer();
|
| 453 | |
| 454 | /* change the blinking value - note that we don't have to use update_value() */
|
| 455 | m_is_blinking = !m_is_blinking;
|
| 456 | |
| 457 | /* twiddle the timer interrupt */
|
| 458 | set_interrupt_value(INTERRUPT_TMR, true);
|
| 459 | set_interrupt_value(INTERRUPT_TMR, false);
|
| 460 | }
|
| 461 | |
| 462 | |
| 463 | |
| 464 | //-------------------------------------------------
|
| 465 | // reset_timer
|
| 466 | //-------------------------------------------------
|
| 467 | |
| 468 | void gime_base_device::reset_timer(void)
|
| 469 | {
|
| 470 | /* value is from 0-4095 */
|
| 471 | m_timer_value = ((m_gime_registers[0x04] & 0x0F) * 0x100) | m_gime_registers[0x05];
|
| 472 | |
| 473 | /* depending on the GIME type, cannonicalize the value */
|
| 474 | if (m_timer_value > 0)
|
| 475 | {
|
| 476 | if (GIME_TYPE_1987)
|
| 477 | m_timer_value += 1; /* the 1987 GIME reset to the value plus one */
|
| 478 | else
|
| 479 | m_timer_value += 2; /* the 1986 GIME reset to the value plus two */
|
| 480 | }
|
| 481 | |
| 482 | attotime duration;
|
| 483 | if ((timer_type() == GIME_TIMER_CLOCK) && (m_timer_value > 0))
|
| 484 | {
|
| 485 | /* we're starting a countdown on the GIME clock timer */
|
| 486 | attotime current_time = machine().time();
|
| 487 | UINT64 current_tick = current_time.as_ticks(m_clock);
|
| 488 | duration = attotime::from_ticks(current_tick + m_timer_value, m_clock) - current_time;
|
| 489 | }
|
| 490 | else
|
| 491 | {
|
| 492 | /* either the timer is off, or were not using the GIME clock timer */
|
| 493 | duration = attotime::never;
|
| 494 | }
|
| 495 | m_gime_clock_timer->adjust(duration);
|
| 496 | |
| 497 | if (LOG_TIMER)
|
| 498 | logerror("%s: reset_timer(): timer_type=%s value=%d\n", describe_context(), timer_type_string(), m_timer_value);
|
| 499 | }
|
| 500 | |
| 501 | |
| 502 | |
| 503 | //**************************************************************************
|
| 504 | // MEMORY AND REGISTERS
|
| 505 | //**************************************************************************
|
| 506 | |
| 507 | //-------------------------------------------------
|
| 508 | // update_memory
|
| 509 | //-------------------------------------------------
|
| 510 | |
| 511 | ATTR_FORCE_INLINE void gime_base_device::update_memory(void)
|
| 512 | {
|
| 513 | for (int bank = 0; bank <= 8; bank++)
|
| 514 | {
|
| 515 | update_memory(bank);
|
| 516 | }
|
| 517 | }
|
| 518 | |
| 519 | |
| 520 | |
| 521 | //-------------------------------------------------
|
| 522 | // update_memory
|
| 523 | //-------------------------------------------------
|
| 524 | |
| 525 | void gime_base_device::update_memory(int bank)
|
| 526 | {
|
| 527 | static const char *rbanks[] = { "rbank0", "rbank1", "rbank2", "rbank3", "rbank4", "rbank5", "rbank6", "rbank7", "rbank8" };
|
| 528 | static const char *wbanks[] = { "wbank0", "wbank1", "wbank2", "wbank3", "wbank4", "wbank5", "wbank6", "wbank7", "wbank8" };
|
| 529 | |
| 530 | /* look up the bank tags */
|
| 531 | assert((bank >= 0) && (bank < ARRAY_LENGTH(rbanks)) && (bank < ARRAY_LENGTH(wbanks)));
|
| 532 | const char *rbank = rbanks[bank];
|
| 533 | const char *wbank = wbanks[bank];
|
| 534 | |
| 535 | /* bank 8 is really $FE00-$FEFF; it is weird so adjust for it */
|
| 536 | offs_t offset;
|
| 537 | bool force_ram;
|
| 538 | bool enable_mmu = (m_gime_registers[0] & 0x40) ? true : false;
|
| 539 | if (bank == 8)
|
| 540 | {
|
| 541 | bank = 7;
|
| 542 | offset = 0x1E00;
|
| 543 | force_ram = true;
|
| 544 | enable_mmu = enable_mmu && !(m_gime_registers[0] & 0x08);
|
| 545 | }
|
| 546 | else
|
| 547 | {
|
| 548 | offset = 0x0000;
|
| 549 | force_ram = false;
|
| 550 | }
|
| 551 | |
| 552 | /* is the MMU enabled at $FF90? */
|
| 553 | int block;
|
| 554 | if (enable_mmu)
|
| 555 | {
|
| 556 | /* check TR register at $FF91 */
|
| 557 | bank += (m_gime_registers[1] & 0x01) ? 8 : 0;
|
| 558 | |
| 559 | /* perform the MMU lookup */
|
| 560 | block = m_mmu[bank];
|
| 561 | |
| 562 | /* also check $FF9B - relevant for the 2 MB upgrade */
|
| 563 | block |= ((UINT32) ((m_gime_registers[11] >> 4) & 0x03)) << 8;
|
| 564 | }
|
| 565 | else
|
| 566 | {
|
| 567 | /* the MMU is not enabled */
|
| 568 | block = bank + 56;
|
| 569 | }
|
| 570 | |
| 571 | /* are we actually in ROM? */
|
| 572 | UINT8 *memory;
|
| 573 | bool is_read_only;
|
| 574 | if (((block & 0x3F) >= 0x3C) && !(m_sam_state & SAM_STATE_TY) && !force_ram)
|
| 575 | {
|
| 576 | /* we're in ROM */
|
| 577 | static const UINT8 rom_map[4][4] =
|
| 578 | {
|
| 579 | { 0, 1, 6, 7 },
|
| 580 | { 0, 1, 6, 7 },
|
| 581 | { 0, 1, 2, 3 },
|
| 582 | { 4, 5, 6, 7 }
|
| 583 | };
|
| 584 | |
| 585 | /* look up the block in the ROM map */
|
| 586 | block = rom_map[m_gime_registers[0] & 3][(block & 0x3F) - 0x3C];
|
| 587 | |
| 588 | /* are we in onboard ROM or cart ROM? */
|
| 589 | UINT8 *rom_ptr = (block & 4) ? m_cart_rom : m_rom;
|
| 590 | |
| 591 | /* perform the look up */
|
| 592 | memory = &rom_ptr[(block & 3) * 0x2000];
|
| 593 | is_read_only = true;
|
| 594 | }
|
| 595 | else
|
| 596 | {
|
| 597 | /* we're in RAM */
|
| 598 | memory = memory_pointer(block * 0x2000);
|
| 599 | is_read_only = false;
|
| 600 | }
|
| 601 | |
| 602 | /* compensate for offset */
|
| 603 | memory += offset;
|
| 604 | |
| 605 | /* set the banks */
|
| 606 | memory_set_bankptr(machine(), rbank, memory);
|
| 607 | memory_set_bankptr(machine(), wbank, is_read_only ? m_dummy_bank : memory);
|
| 608 | }
|
| 609 | |
| 610 | |
| 611 | |
| 612 | //-------------------------------------------------
|
| 613 | // memory_pointer
|
| 614 | //-------------------------------------------------
|
| 615 | |
| 616 | UINT8 *gime_base_device::memory_pointer(UINT32 address)
|
| 617 | {
|
| 618 | return &m_ram->pointer()[address % m_ram->size()];
|
| 619 | }
|
| 620 | |
| 621 | |
| 622 | |
| 623 | //-------------------------------------------------
|
| 624 | // read
|
| 625 | //-------------------------------------------------
|
| 626 | |
| 627 | UINT8 gime_base_device::read(offs_t offset)
|
| 628 | {
|
| 629 | UINT8 data = 0x00;
|
| 630 | |
| 631 | switch(offset & 0xF0)
|
| 632 | {
|
| 633 | case 0x00:
|
| 634 | data = read_gime_register(offset);
|
| 635 | break;
|
| 636 | |
| 637 | case 0x10:
|
| 638 | data = read_mmu_register(offset);
|
| 639 | break;
|
| 640 | |
| 641 | case 0x20:
|
| 642 | data = read_palette_register(offset);
|
| 643 | break;
|
| 644 | }
|
| 645 | |
| 646 | return data;
|
| 647 | }
|
| 648 | |
| 649 | |
| 650 | |
| 651 | //-------------------------------------------------
|
| 652 | // read_gime_register
|
| 653 | //-------------------------------------------------
|
| 654 | |
| 655 | ATTR_FORCE_INLINE UINT8 gime_base_device::read_gime_register(offs_t offset)
|
| 656 | {
|
| 657 | offset &= 0x0F;
|
| 658 | |
| 659 | UINT8 result;
|
| 660 | switch(offset)
|
| 661 | {
|
| 662 | case 2: /* Read pending IRQs */
|
| 663 | result = m_irq;
|
| 664 | if (result != 0x00)
|
| 665 | {
|
| 666 | m_irq = 0x00;
|
| 667 | recalculate_irq();
|
| 668 | }
|
| 669 | break;
|
| 670 | |
| 671 | case 3: /* Read pending FIRQs */
|
| 672 | result = m_firq;
|
| 673 | if (result != 0x00)
|
| 674 | {
|
| 675 | m_firq = 0x00;
|
| 676 | recalculate_firq();
|
| 677 | }
|
| 678 | break;
|
| 679 | |
| 680 | case 4: /* Timer MSB/LSB; these arn't readable */
|
| 681 | case 5:
|
| 682 | /* JK tells me that these values are indeterminate; and $7E appears
|
| 683 | * to be the value most commonly returned
|
| 684 | */
|
| 685 | result = 0x7E;
|
| 686 | break;
|
| 687 | |
| 688 | default:
|
| 689 | result = m_gime_registers[offset];
|
| 690 | break;
|
| 691 | }
|
| 692 | return result;
|
| 693 | }
|
| 694 | |
| 695 | |
| 696 | |
| 697 | //-------------------------------------------------
|
| 698 | // read_mmu_register
|
| 699 | //-------------------------------------------------
|
| 700 | |
| 701 | ATTR_FORCE_INLINE UINT8 gime_base_device::read_mmu_register(offs_t offset)
|
| 702 | {
|
| 703 | return m_mmu[offset & 0x0F];
|
| 704 | }
|
| 705 | |
| 706 | |
| 707 | |
| 708 | //-------------------------------------------------
|
| 709 | // read_palette_register
|
| 710 | //-------------------------------------------------
|
| 711 | |
| 712 | ATTR_FORCE_INLINE UINT8 gime_base_device::read_palette_register(offs_t offset)
|
| 713 | {
|
| 714 | return m_palette_rotated[m_palette_rotated_position][offset & 0x0F] | 0x40;
|
| 715 | }
|
| 716 | |
| 717 | |
| 718 | |
| 719 | //-------------------------------------------------
|
| 720 | // write
|
| 721 | //-------------------------------------------------
|
| 722 | |
| 723 | void gime_base_device::write(offs_t offset, UINT8 data)
|
| 724 | {
|
| 725 | switch(offset & 0xF0)
|
| 726 | {
|
| 727 | case 0x00:
|
| 728 | write_gime_register(offset & 0x0F, data);
|
| 729 | break;
|
| 730 | |
| 731 | case 0x10:
|
| 732 | write_mmu_register(offset & 0x0F, data & 0x3F);
|
| 733 | break;
|
| 734 | |
| 735 | case 0x20:
|
| 736 | write_palette_register(offset & 0x0F, data & 0x3F);
|
| 737 | break;
|
| 738 | |
| 739 | case 0x30:
|
| 740 | case 0x40:
|
| 741 | write_sam_register(offset - 0x30);
|
| 742 | break;
|
| 743 | }
|
| 744 | }
|
| 745 | |
| 746 | |
| 747 | |
| 748 | //-------------------------------------------------
|
| 749 | // write_gime_register
|
| 750 | //-------------------------------------------------
|
| 751 | |
| 752 | ATTR_FORCE_INLINE void gime_base_device::write_gime_register(offs_t offset, UINT8 data)
|
| 753 | {
|
| 754 | // this is needed for writes to FF95
|
| 755 | bool timer_was_off = (m_gime_registers[0x04] == 0x00) && (m_gime_registers[0x05] == 0x00);
|
| 756 | |
| 757 | // sanity check input
|
| 758 | offset &= 0x0F;
|
| 759 | |
| 760 | // perform logging
|
| 761 | if (LOG_GIME)
|
| 762 | logerror("%s: CoCo3 GIME: $%04x <== $%02x\n", describe_context(), offset + 0xff90, data);
|
| 763 | |
| 764 | // make the change, and track the difference
|
| 765 | UINT8 xorval = m_gime_registers[offset] ^ data;
|
| 766 | m_gime_registers[offset] = data;
|
| 767 | |
| 768 | switch(offset)
|
| 769 | {
|
| 770 | case 0x00:
|
| 771 | // $FF90 Initialization register 0
|
| 772 | // Bit 7 COCO 1=CoCo compatible mode
|
| 773 | // Bit 6 MMUEN 1=MMU enabled
|
| 774 | // Bit 5 IEN 1 = GIME chip IRQ enabled
|
| 775 | // Bit 4 FEN 1 = GIME chip FIRQ enabled
|
| 776 | // Bit 3 MC3 1 = RAM at FEXX is constant
|
| 777 | // Bit 2 MC2 1 = standard SCS (Spare Chip Select)
|
| 778 | // Bit 1 MC1 ROM map control
|
| 779 | // Bit 0 MC0 ROM map control
|
| 780 | if (xorval & 0x4B)
|
| 781 | update_memory();
|
| 782 | break;
|
| 783 | |
| 784 | case 0x01:
|
| 785 | // $FF91 Initialization register 1
|
| 786 | // Bit 7 Unused
|
| 787 | // Bit 6 Unused
|
| 788 | // Bit 5 TINS Timer input select; 1 = 280 nsec, 0 = 63.5 usec
|
| 789 | // Bit 4 Unused
|
| 790 | // Bit 3 Unused
|
| 791 | // Bit 2 Unused
|
| 792 | // Bit 1 Unused
|
| 793 | // Bit 0 TR Task register select
|
| 794 | if (xorval & 0x01)
|
| 795 | update_memory();
|
| 796 | |
| 797 | // I'm not sure about this one; as written this code will reset the timer
|
| 798 | // with the _original_ value. This is probably not correct.
|
| 799 | if (xorval & 0x20)
|
| 800 | reset_timer();
|
| 801 | break;
|
| 802 | |
| 803 | case 0x02:
|
| 804 | // $FF92 Interrupt request enable register
|
| 805 | // Bit 7 Unused
|
| 806 | // Bit 6 Unused
|
| 807 | // Bit 5 TMR Timer interrupt
|
| 808 | // Bit 4 HBORD Horizontal border interrupt
|
| 809 | // Bit 3 VBORD Vertical border interrupt
|
| 810 | // ! Bit 2 EI2 Serial data interrupt
|
| 811 | // Bit 1 EI1 Keyboard interrupt
|
| 812 | // Bit 0 EI0 Cartridge interrupt
|
| 813 | if (LOG_INT_MASKING)
|
| 814 | {
|
| 815 | logerror("%s: GIME IRQ: Interrupts { %s%s%s%s%s%s} enabled\n",
|
| 816 | describe_context(), |
| 817 | (data & 0x20) ? "TMR " : "",
|
| 818 | (data & 0x10) ? "HBORD " : "",
|
| 819 | (data & 0x08) ? "VBORD " : "",
|
| 820 | (data & 0x04) ? "EI2 " : "",
|
| 821 | (data & 0x02) ? "EI1 " : "",
|
| 822 | (data & 0x01) ? "EI0 " : "");
|
| 823 | }
|
| 824 | break;
|
| 825 | |
| 826 | case 0x03:
|
| 827 | // $FF93 Fast interrupt request enable register
|
| 828 | // Bit 7 Unused
|
| 829 | // Bit 6 Unused
|
| 830 | // Bit 5 TMR Timer interrupt
|
| 831 | // Bit 4 HBORD Horizontal border interrupt
|
| 832 | // Bit 3 VBORD Vertical border interrupt
|
| 833 | // ! Bit 2 EI2 Serial data interrupt
|
| 834 | // Bit 1 EI1 Keyboard interrupt
|
| 835 | // Bit 0 EI0 Cartridge interrupt
|
| 836 | if (LOG_INT_MASKING)
|
| 837 | {
|
| 838 | logerror("%s: GIME FIRQ: Interrupts { %s%s%s%s%s%s} enabled\n",
|
| 839 | describe_context(),
|
| 840 | (data & 0x20) ? "TMR " : "",
|
| 841 | (data & 0x10) ? "HBORD " : "",
|
| 842 | (data & 0x08) ? "VBORD " : "",
|
| 843 | (data & 0x04) ? "EI2 " : "",
|
| 844 | (data & 0x02) ? "EI1 " : "",
|
| 845 | (data & 0x01) ? "EI0 " : "");
|
| 846 | }
|
| 847 | break;
|
| 848 | |
| 849 | case 0x04:
|
| 850 | // $FF94 Timer register MSB
|
| 851 | // Bits 4-7 Unused
|
| 852 | // Bits 0-3 High order four bits of the timer
|
| 853 | reset_timer();
|
| 854 | break;
|
| 855 | |
| 856 | case 0x05:
|
| 857 | // $FF95 Timer register LSB
|
| 858 | // Bits 0-7 Low order eight bits of the timer
|
| 859 | if (timer_was_off && (m_gime_registers[0x05] != 0x00))
|
| 860 | {
|
| 861 | // Writes to $FF95 do not cause the timer to reset, but MESS
|
| 862 | // will invoke coco3_timer_reset() if $FF94/5 was previously
|
| 863 | // $0000. The reason for this is because the timer is not
|
| 864 | // actually off when $FF94/5 are loaded with $0000; rather it
|
| 865 | // is continuously reloading the GIME's internal countdown
|
| 866 | // register, even if it isn't causing interrupts to be raised.
|
| 867 | //
|
| 868 | // Failure to do this was the cause of bug #1065. Special
|
| 869 | // thanks to John Kowalski for pointing me in the right
|
| 870 | // direction
|
| 871 | reset_timer();
|
| 872 | }
|
| 873 | break;
|
| 874 | |
| 875 | case 0x08:
|
| 876 | // $FF98 Video Mode Register
|
| 877 | // Bit 7 BP 0 = Text modes, 1 = Graphics modes
|
| 878 | // Bit 6 Unused
|
| 879 | // ! Bit 5 BPI Burst Phase Invert (Color Set)
|
| 880 | // Bit 4 MOCH 1 = Monochrome on Composite
|
| 881 | // ! Bit 3 H50 1 = 50 Hz power, 0 = 60 Hz power
|
| 882 | // Bits 0-2 LPR Lines per row
|
| 883 | break;
|
| 884 | |
| 885 | case 0x09:
|
| 886 | // $FF99 Video Resolution Register
|
| 887 | // Bit 7 Undefined
|
| 888 | // Bits 5-6 LPF Lines per Field (Number of Rows)
|
| 889 | // Bits 2-4 HRES Horizontal Resolution
|
| 890 | // 000=16 bytes per row
|
| 891 | // 001=20 bytes per row
|
| 892 | // 010=32 bytes per row
|
| 893 | // 011=40 bytes per row
|
| 894 | // 100=64 bytes per row
|
| 895 | // 101=80 bytes per row
|
| 896 | // 110=128 bytes per row
|
| 897 | // 111=160 bytes per row
|
| 898 | // Bits 0-1 CRES Color Resolution
|
| 899 | if (xorval & 0x60)
|
| 900 | update_geometry();
|
| 901 | break;
|
| 902 | |
| 903 | case 0x0A:
|
| 904 | // $FF9A Border Register
|
| 905 | // Bits 6,7 Unused
|
| 906 | // Bits 0-5 BRDR Border color
|
| 907 | break;
|
| 908 | |
| 909 | case 0x0C:
|
| 910 | // $FF9C Vertical Scroll Register
|
| 911 | // Bits 4-7 Reserved
|
| 912 | // Bits 0-3 VSC Vertical Scroll bits
|
| 913 | break;
|
| 914 | |
| 915 | case 0x0B:
|
| 916 | case 0x0D:
|
| 917 | case 0x0E:
|
| 918 | // $FF9B,$FF9D,$FF9E Vertical Offset Registers
|
| 919 | //
|
| 920 | // According to JK, if an odd value is placed in $FF9E on the 1986
|
| 921 | // GIME, the GIME crashes
|
| 922 | //
|
| 923 | // The reason that $FF9B is not mentioned in offical documentation
|
| 924 | // is because it is only meaninful in CoCo 3's with the 2MB upgrade
|
| 925 | break;
|
| 926 | |
| 927 | case 0x0F:
|
| 928 | // $FF9F Horizontal Offset Register
|
| 929 | // Bit 7 HVEN Horizontal Virtual Enable
|
| 930 | // Bits 0-6 X0-X6 Horizontal Offset Address
|
| 931 | //
|
| 932 | // Unline $FF9D-E, this value can be modified mid frame
|
| 933 | //
|
| 934 | // Note that the FF9F offset is shifted by one bit (e.g. - $FF9F=$03 will
|
| 935 | // be a six byte offset). Also note that scanlines wrap at 256 byte boundaries
|
| 936 | // without regard to bit 7.
|
| 937 | break;
|
| 938 | }
|
| 939 | }
|
| 940 | |
| 941 | |
| 942 | |
| 943 | //-------------------------------------------------
|
| 944 | // write_mmu_register
|
| 945 | //-------------------------------------------------
|
| 946 | |
| 947 | ATTR_FORCE_INLINE void gime_base_device::write_mmu_register(offs_t offset, UINT8 data)
|
| 948 | {
|
| 949 | offset &= 0x0F;
|
| 950 | if (m_mmu[offset] != data)
|
| 951 | {
|
| 952 | m_mmu[offset] = data;
|
| 953 | update_memory(offset & 0x07);
|
| 954 | }
|
| 955 | }
|
| 956 | |
| 957 | |
| 958 | |
| 959 | //-------------------------------------------------
|
| 960 | // write_palette_register
|
| 961 | //-------------------------------------------------
|
| 962 | |
| 963 | ATTR_FORCE_INLINE void gime_base_device::write_palette_register(offs_t offset, UINT8 data)
|
| 964 | {
|
| 965 | offset &= 0x0F;
|
| 966 | |
| 967 | /* has this entry changed? */
|
| 968 | if (m_palette_rotated[m_palette_rotated_position][offset] != data)
|
| 969 | {
|
| 970 | /* do we need to rotate the palette? */
|
| 971 | if (m_palette_rotated_position_used)
|
| 972 | {
|
| 973 | /* identify the new position */
|
| 974 | UINT16 new_palette_rotated_position = (m_palette_rotated_position + 1) % ARRAY_LENGTH(m_palette_rotated);
|
| 975 | |
| 976 | /* copy the palette */
|
| 977 | for (int i = 0; i < ARRAY_LENGTH(m_palette_rotated[0]); i++)
|
| 978 | m_palette_rotated[new_palette_rotated_position][i] = m_palette_rotated[m_palette_rotated_position][i];
|
| 979 | |
| 980 | /* and advance */
|
| 981 | m_palette_rotated_position = new_palette_rotated_position;
|
| 982 | m_palette_rotated_position_used = false;
|
| 983 | }
|
| 984 | |
| 985 | /* record the change */;
|
| 986 | m_palette_rotated[m_palette_rotated_position][offset] = data;
|
| 987 | }
|
| 988 | }
|
| 989 | |
| 990 | |
| 991 | |
| 992 | //-------------------------------------------------
|
| 993 | // write_sam_register
|
| 994 | //-------------------------------------------------
|
| 995 | |
| 996 | ATTR_FORCE_INLINE void gime_base_device::write_sam_register(offs_t offset)
|
| 997 | {
|
| 998 | /* change the SAM state */
|
| 999 | UINT16 xorval = alter_sam_state(offset);
|
| 1000 | |
| 1001 | /* $FFDE-F can trigger a memory update */
|
| 1002 | if (xorval & SAM_STATE_TY)
|
| 1003 | update_memory();
|
| 1004 | |
| 1005 | if (xorval & (SAM_STATE_R1|SAM_STATE_R0))
|
| 1006 | update_cpu_clock();
|
| 1007 | }
|
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | //-------------------------------------------------
|
| 1012 | // interrupt_rising_edge
|
| 1013 | //-------------------------------------------------
|
| 1014 | |
| 1015 | void gime_base_device::interrupt_rising_edge(UINT8 interrupt)
|
| 1016 | {
|
| 1017 | /* evaluate IRQ */
|
| 1018 | if ((m_gime_registers[0x00] & 0x20) && (m_gime_registers[0x02] & interrupt))
|
| 1019 | {
|
| 1020 | m_irq |= interrupt;
|
| 1021 | recalculate_irq();
|
| 1022 | }
|
| 1023 | |
| 1024 | /* evaluate FIRQ */
|
| 1025 | if ((m_gime_registers[0x00] & 0x10) && (m_gime_registers[0x03] & interrupt))
|
| 1026 | {
|
| 1027 | m_firq |= interrupt;
|
| 1028 | recalculate_firq();
|
| 1029 | }
|
| 1030 | }
|
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | //-------------------------------------------------
|
| 1035 | // recalculate_irq
|
| 1036 | //-------------------------------------------------
|
| 1037 | |
| 1038 | void gime_base_device::recalculate_irq(void)
|
| 1039 | {
|
| 1040 | if (!m_res_out_irq_func.isnull())
|
| 1041 | m_res_out_irq_func(irq_r());
|
| 1042 | }
|
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | //-------------------------------------------------
|
| 1047 | // recalculate_firq
|
| 1048 | //-------------------------------------------------
|
| 1049 | |
| 1050 | void gime_base_device::recalculate_firq(void)
|
| 1051 | {
|
| 1052 | if (!m_res_out_firq_func.isnull())
|
| 1053 | m_res_out_firq_func(firq_r());
|
| 1054 | }
|
| 1055 | |
| 1056 | |
| 1057 | |
| 1058 | //**************************************************************************
|
| 1059 | // VIDEO STATE
|
| 1060 | //**************************************************************************
|
| 1061 | |
| 1062 | //-------------------------------------------------
|
| 1063 | // get_video_base
|
| 1064 | //
|
| 1065 | // The purpose of the ff9d_mask and ff9e_mask is to mask out bits that are
|
| 1066 | // ignored in lo-res mode. Specifically, $FF9D is masked with $E0, and
|
| 1067 | // $FF9E is masked with $3F
|
| 1068 | //
|
| 1069 | // John Kowalski confirms this behavior
|
| 1070 | //-------------------------------------------------
|
| 1071 | |
| 1072 | ATTR_FORCE_INLINE offs_t gime_base_device::get_video_base(void)
|
| 1073 | {
|
| 1074 | offs_t result;
|
| 1075 | UINT8 ff9d_mask, ff9e_mask;
|
| 1076 | |
| 1077 | if (m_legacy_video)
|
| 1078 | {
|
| 1079 | /* legacy video gets the base address from the SAM addresses, and masks out GIME variables */
|
| 1080 | result = display_offset();
|
| 1081 | ff9d_mask = 0xE0;
|
| 1082 | ff9e_mask = 0x3F;
|
| 1083 | }
|
| 1084 | else
|
| 1085 | {
|
| 1086 | /* GIME video ignores the SAM addresses, relying on the GIME variables exclusively */
|
| 1087 | result = 0;
|
| 1088 | ff9d_mask = 0xFF;
|
| 1089 | ff9e_mask = 0xFF;
|
| 1090 | }
|
| 1091 | |
| 1092 | result += ((offs_t) (m_gime_registers[0x0E] & ff9e_mask) * 0x00008)
|
| 1093 | | ((offs_t) (m_gime_registers[0x0D] & ff9d_mask) * 0x00800)
|
| 1094 | | ((offs_t) (m_gime_registers[0x0B] & 0x0F) * 0x80000);
|
| 1095 | return result;
|
| 1096 | }
|
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | //-------------------------------------------------
|
| 1101 | // new_frame
|
| 1102 | //-------------------------------------------------
|
| 1103 | |
| 1104 | void gime_base_device::new_frame(void)
|
| 1105 | {
|
| 1106 | /* call inherited function */
|
| 1107 | super::new_frame();
|
| 1108 | |
| 1109 | /* latch in legacy video value */
|
| 1110 | bool legacy_video_changed = update_value(&m_legacy_video, m_gime_registers[0] & 0x80 ? true : false);
|
| 1111 | |
| 1112 | /* latch in the video position */
|
| 1113 | m_video_position = get_video_base();
|
| 1114 | m_line_in_row = m_gime_registers[0x0C] & 0x0F;
|
| 1115 | |
| 1116 | /* update the geometry, as appropriate */
|
| 1117 | if (legacy_video_changed)
|
| 1118 | update_geometry();
|
| 1119 | }
|
| 1120 | |
| 1121 | |
| 1122 | |
| 1123 | //-------------------------------------------------
|
| 1124 | // horizontal_sync_changed
|
| 1125 | //-------------------------------------------------
|
| 1126 | |
| 1127 | void gime_base_device::horizontal_sync_changed(bool line)
|
| 1128 | {
|
| 1129 | set_interrupt_value(INTERRUPT_HBORD, line);
|
| 1130 | |
| 1131 | /* decrement timer if appropriate */
|
| 1132 | if ((timer_type() == GIME_TIMER_HBORD) && (m_timer_value > 0) && line)
|
| 1133 | {
|
| 1134 | if (--m_timer_value == 0)
|
| 1135 | timer_elapsed();
|
| 1136 | }
|
| 1137 | |
| 1138 | }
|
| 1139 | |
| 1140 | |
| 1141 | |
| 1142 | //-------------------------------------------------
|
| 1143 | // enter_bottom_border
|
| 1144 | //-------------------------------------------------
|
| 1145 | |
| 1146 | void gime_base_device::enter_bottom_border(void)
|
| 1147 | {
|
| 1148 | set_interrupt_value(INTERRUPT_VBORD, true);
|
| 1149 | set_interrupt_value(INTERRUPT_VBORD, false);
|
| 1150 | }
|
| 1151 | |
| 1152 | |
| 1153 | |
| 1154 | //-------------------------------------------------
|
| 1155 | // update_border
|
| 1156 | //-------------------------------------------------
|
| 1157 | |
| 1158 | void gime_base_device::update_border(UINT16 physical_scanline)
|
| 1159 | {
|
| 1160 | UINT8 border;
|
| 1161 | if (m_legacy_video)
|
| 1162 | {
|
| 1163 | /* legacy video */
|
| 1164 | switch(border_value(m_ff22_value, true))
|
| 1165 | {
|
| 1166 | case BORDER_COLOR_GREEN:
|
| 1167 | border = 0x12; /* green */
|
| 1168 | break;
|
| 1169 | case BORDER_COLOR_WHITE:
|
| 1170 | border = 0x3F; /* white */
|
| 1171 | break;
|
| 1172 | case BORDER_COLOR_BLACK:
|
| 1173 | border = 0x00; /* black */
|
| 1174 | break;
|
| 1175 | case BORDER_COLOR_ORANGE:
|
| 1176 | border = 0x26; /* orange */
|
| 1177 | break;
|
| 1178 | default:
|
| 1179 | fatalerror("Should not get here");
|
| 1180 | break;
|
| 1181 | }
|
| 1182 | }
|
| 1183 | else
|
| 1184 | {
|
| 1185 | /* get the border value from $FF9A */
|
| 1186 | border = m_gime_registers[0x0A] & 0x3F;
|
| 1187 | }
|
| 1188 | update_value(&m_scanlines[physical_scanline].m_border, border);
|
| 1189 | }
|
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | //-------------------------------------------------
|
| 1194 | // record_border_scanline
|
| 1195 | //-------------------------------------------------
|
| 1196 | |
| 1197 | void gime_base_device::record_border_scanline(UINT16 physical_scanline)
|
| 1198 | {
|
| 1199 | m_line_in_row = 0;
|
| 1200 | update_border(physical_scanline);
|
| 1201 | update_value(&m_scanlines[physical_scanline].m_line_in_row, (UINT8) ~0);
|
| 1202 | }
|
| 1203 | |
| 1204 | |
| 1205 | |
| 1206 | //-------------------------------------------------
|
| 1207 | // get_lines_per_row
|
| 1208 | //-------------------------------------------------
|
| 1209 | |
| 1210 | ATTR_FORCE_INLINE UINT16 gime_base_device::get_lines_per_row(void)
|
| 1211 | {
|
| 1212 | UINT16 lines_per_row;
|
| 1213 | if (m_legacy_video)
|
| 1214 | {
|
| 1215 | switch(m_ff22_value & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0))
|
| 1216 | {
|
| 1217 | case 0:
|
| 1218 | case MODE_GM0:
|
| 1219 | case MODE_GM1:
|
| 1220 | case MODE_GM1|MODE_GM0:
|
| 1221 | case MODE_GM2:
|
| 1222 | case MODE_GM2|MODE_GM0:
|
| 1223 | case MODE_GM2|MODE_GM1:
|
| 1224 | case MODE_GM2|MODE_GM1|MODE_GM0:
|
| 1225 | lines_per_row = 12;
|
| 1226 | break;
|
| 1227 | |
| 1228 | case MODE_AG:
|
| 1229 | case MODE_AG|MODE_GM0:
|
| 1230 | case MODE_AG|MODE_GM1:
|
| 1231 | lines_per_row = 3;
|
| 1232 | break;
|
| 1233 | |
| 1234 | case MODE_AG|MODE_GM1|MODE_GM0:
|
| 1235 | case MODE_AG|MODE_GM2:
|
| 1236 | lines_per_row = 2;
|
| 1237 | break;
|
| 1238 | |
| 1239 | case MODE_AG|MODE_GM2|MODE_GM0:
|
| 1240 | case MODE_AG|MODE_GM2|MODE_GM1:
|
| 1241 | case MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0:
|
| 1242 | lines_per_row = 1;
|
| 1243 | break;
|
| 1244 | |
| 1245 | default:
|
| 1246 | fatalerror("Should not get here");
|
| 1247 | break;
|
| 1248 | }
|
| 1249 | }
|
| 1250 | else
|
| 1251 | {
|
| 1252 | switch(m_gime_registers[0x08] & 0x07)
|
| 1253 | {
|
| 1254 | case 0x00:
|
| 1255 | case 0x01:
|
| 1256 | lines_per_row = 1;
|
| 1257 | break;
|
| 1258 | case 0x02:
|
| 1259 | lines_per_row = 2;
|
| 1260 | break;
|
| 1261 | case 0x03:
|
| 1262 | lines_per_row = 8;
|
| 1263 | break;
|
| 1264 | case 0x04:
|
| 1265 | lines_per_row = 9;
|
| 1266 | break;
|
| 1267 | case 0x05:
|
| 1268 | lines_per_row = 10;
|
| 1269 | break;
|
| 1270 | case 0x06:
|
| 1271 | lines_per_row = 11;
|
| 1272 | break;
|
| 1273 | case 0x07:
|
| 1274 | lines_per_row = 0xFFFF;
|
| 1275 | break;
|
| 1276 | default:
|
| 1277 | fatalerror("Should not get here");
|
| 1278 | break;
|
| 1279 | }
|
| 1280 | }
|
| 1281 | return lines_per_row;
|
| 1282 | }
|
| 1283 | |
| 1284 | |
| 1285 | |
| 1286 | //-------------------------------------------------
|
| 1287 | // record_scanline_res
|
| 1288 | //-------------------------------------------------
|
| 1289 | |
| 1290 | template<UINT8 xres, gime_base_device::get_data_func get_data, bool record_mode>
|
| 1291 | ATTR_FORCE_INLINE UINT32 gime_base_device::record_scanline_res(int scanline)
|
| 1292 | {
|
| 1293 | int column;
|
| 1294 | UINT32 base_offset = m_legacy_video ? 0 : (m_gime_registers[0x0F] & 0x7F) * 2;
|
| 1295 | UINT32 offset = 0;
|
| 1296 | |
| 1297 | /* main loop */
|
| 1298 | for (column = 0; column < xres; column++)
|
| 1299 | {
|
| 1300 | /* input data */
|
| 1301 | UINT8 data, mode;
|
| 1302 | offset += ((*this).*(get_data))(m_video_position + ((base_offset + offset) & 0xFF), &data, &mode);
|
| 1303 | |
| 1304 | /* and record the pertinent values */
|
| 1305 | if (record_mode)
|
| 1306 | update_value(&m_scanlines[scanline].m_mode[column], mode);
|
| 1307 | update_value(&m_scanlines[scanline].m_data[column], data);
|
| 1308 | update_value(&m_scanlines[scanline].m_palette[column], m_palette_rotated_position);
|
| 1309 | }
|
| 1310 | |
| 1311 | return offset;
|
| 1312 | }
|
| 1313 | |
| 1314 | |
| 1315 | |
| 1316 | //-------------------------------------------------
|
| 1317 | // get_data_mc6847 - used for retrieving data/mode
|
| 1318 | // in legacy video modes
|
| 1319 | //-------------------------------------------------
|
| 1320 | |
| 1321 | UINT32 gime_base_device::get_data_mc6847(UINT32 video_position, UINT8 *data, UINT8 *mode)
|
| 1322 | {
|
| 1323 | *data = *memory_pointer(video_position);
|
| 1324 | *mode = (m_ff22_value & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0|MODE_CSS))
|
| 1325 | | ((*data & 0x80) == 0x80 ? MODE_AS : 0)
|
| 1326 | | ((*data & 0xC0) == 0x40 ? MODE_INV : 0);
|
| 1327 | |
| 1328 | // postprocess the mode to remove unnecessary flags
|
| 1329 | *mode = mc6847_friend_device::simplify_mode(*data, *mode);
|
| 1330 | return 1;
|
| 1331 | }
|
| 1332 | |
| 1333 | |
| 1334 | |
| 1335 | //-------------------------------------------------
|
| 1336 | // get_data_without_attributes - used for
|
| 1337 | // retrieving data/mode in GIME graphics or GIME
|
| 1338 | // text modes without attributes
|
| 1339 | //-------------------------------------------------
|
| 1340 | |
| 1341 | UINT32 gime_base_device::get_data_without_attributes(UINT32 video_position, UINT8 *data, UINT8 *mode)
|
| 1342 | {
|
| 1343 | *data = *memory_pointer(video_position);
|
| 1344 | *mode = NO_ATTRIBUTE;
|
| 1345 | return 1;
|
| 1346 | }
|
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | //-------------------------------------------------
|
| 1351 | // get_data_with_attributes - used for retrieving
|
| 1352 | // data/mode in GIME text modes with attributes
|
| 1353 | //-------------------------------------------------
|
| 1354 | |
| 1355 | UINT32 gime_base_device::get_data_with_attributes(UINT32 video_position, UINT8 *data, UINT8 *mode)
|
| 1356 | {
|
| 1357 | *data = *memory_pointer(video_position + 0);
|
| 1358 | *mode = *memory_pointer(video_position + 1);
|
| 1359 | |
| 1360 | /* is the blink attribute specified? */
|
| 1361 | if (UNEXPECTED(*mode) & 0x80)
|
| 1362 | {
|
| 1363 | /* if so - and we're blinking - then clear the character */
|
| 1364 | if (m_is_blinking)
|
| 1365 | {
|
| 1366 | *data = 0x20;
|
| 1367 | *mode &= ~0x40;
|
| 1368 | }
|
| 1369 | |
| 1370 | /* clear the blink bit */
|
| 1371 | *mode &= ~0x80;
|
| 1372 | }
|
| 1373 | return 2;
|
| 1374 | }
|
| 1375 | |
| 1376 | |
| 1377 | |
| 1378 | //-------------------------------------------------
|
| 1379 | // record_body_scanline
|
| 1380 | //-------------------------------------------------
|
| 1381 | |
| 1382 | void gime_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 logical_scanline)
|
| 1383 | {
|
| 1384 | /* update the border first */
|
| 1385 | update_border(physical_scanline);
|
| 1386 | |
| 1387 | /* set the line in row */
|
| 1388 | update_value(&m_scanlines[physical_scanline].m_line_in_row, m_line_in_row);
|
| 1389 | |
| 1390 | /* we're using this palette rotation */
|
| 1391 | m_palette_rotated_position_used = true;
|
| 1392 | |
| 1393 | UINT32 pitch = 0;
|
| 1394 | if (m_legacy_video)
|
| 1395 | {
|
| 1396 | /* legacy video */
|
| 1397 | update_value(&m_scanlines[physical_scanline].m_ff22_value, m_ff22_value);
|
| 1398 | |
| 1399 | switch(m_ff22_value & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0))
|
| 1400 | {
|
| 1401 | case MODE_AG:
|
| 1402 | case MODE_AG|MODE_GM0:
|
| 1403 | case MODE_AG|MODE_GM1|MODE_GM0:
|
| 1404 | case MODE_AG|MODE_GM2|MODE_GM0:
|
| 1405 | pitch = record_scanline_res<16, &gime_base_device::get_data_mc6847, true>(physical_scanline);
|
| 1406 | break;
|
| 1407 | |
| 1408 | case 0:
|
| 1409 | case MODE_GM0:
|
| 1410 | case MODE_GM1:
|
| 1411 | case MODE_GM1|MODE_GM0:
|
| 1412 | case MODE_GM2:
|
| 1413 | case MODE_GM2|MODE_GM0:
|
| 1414 | case MODE_GM2|MODE_GM1:
|
| 1415 | case MODE_GM2|MODE_GM1|MODE_GM0:
|
| 1416 | case MODE_AG|MODE_GM1:
|
| 1417 | case MODE_AG|MODE_GM2:
|
| 1418 | case MODE_AG|MODE_GM2|MODE_GM1:
|
| 1419 | case MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0:
|
| 1420 | pitch = record_scanline_res<32, &gime_base_device::get_data_mc6847, true>(physical_scanline);
|
| 1421 | break;
|
| 1422 | |
| 1423 | default:
|
| 1424 | /* should not get here */
|
| 1425 | fatalerror("Should not get here");
|
| 1426 | return;
|
| 1427 | }
|
| 1428 | }
|
| 1429 | else
|
| 1430 | {
|
| 1431 | /* CoCo 3 video */
|
| 1432 | update_value(&m_scanlines[physical_scanline].m_ff98_value, m_gime_registers[0x08]);
|
| 1433 | update_value(&m_scanlines[physical_scanline].m_ff99_value, m_gime_registers[0x09]);
|
| 1434 | |
| 1435 | /* is this graphics or text? */
|
| 1436 | if (m_gime_registers[0x08] & 0x80)
|
| 1437 | {
|
| 1438 | /* graphics */
|
| 1439 | switch(m_gime_registers[0x09] & 0x1C)
|
| 1440 | {
|
| 1441 | case 0x00: pitch = record_scanline_res< 16, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1442 | case 0x04: pitch = record_scanline_res< 20, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1443 | case 0x08: pitch = record_scanline_res< 32, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1444 | case 0x0C: pitch = record_scanline_res< 40, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1445 | case 0x10: pitch = record_scanline_res< 64, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1446 | case 0x14: pitch = record_scanline_res< 80, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1447 | case 0x18: pitch = record_scanline_res<128, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1448 | case 0x1C: pitch = record_scanline_res<160, &gime_base_device::get_data_without_attributes, false>(physical_scanline); break;
|
| 1449 | default:
|
| 1450 | fatalerror("Should not get here");
|
| 1451 | return;
|
| 1452 | }
|
| 1453 | }
|
| 1454 | else
|
| 1455 | {
|
| 1456 | /* text */
|
| 1457 | switch(m_gime_registers[0x09] & 0x15)
|
| 1458 | {
|
| 1459 | case 0x00: pitch = record_scanline_res< 32, &gime_base_device::get_data_without_attributes, true>(physical_scanline); break;
|
| 1460 | case 0x01: pitch = record_scanline_res< 32, &gime_base_device::get_data_with_attributes, true>(physical_scanline); break;
|
| 1461 | case 0x04: pitch = record_scanline_res< 40, &gime_base_device::get_data_without_attributes, true>(physical_scanline); break;
|
| 1462 | case 0x05: pitch = record_scanline_res< 40, &gime_base_device::get_data_with_attributes, true>(physical_scanline); break;
|
| 1463 | case 0x10: pitch = record_scanline_res< 64, &gime_base_device::get_data_without_attributes, true>(physical_scanline); break;
|
| 1464 | case 0x11: pitch = record_scanline_res< 64, &gime_base_device::get_data_with_attributes, true>(physical_scanline); break;
|
| 1465 | case 0x14: pitch = record_scanline_res< 80, &gime_base_device::get_data_without_attributes, true>(physical_scanline); break;
|
| 1466 | case 0x15: pitch = record_scanline_res< 80, &gime_base_device::get_data_with_attributes, true>(physical_scanline); break;
|
| 1467 | default:
|
| 1468 | fatalerror("Should not get here");
|
| 1469 | return;
|
| 1470 | }
|
| 1471 | }
|
| 1472 | |
| 1473 | /* is the GIME hoizontal virtual screen enabled? */
|
| 1474 | if (m_gime_registers[0x0F] & 0x80)
|
| 1475 | {
|
| 1476 | pitch = 256;
|
| 1477 | }
|
| 1478 | }
|
| 1479 | |
| 1480 | /* sanity checks */
|
| 1481 | assert(pitch > 0);
|
| 1482 | |
| 1483 | /* are we moving on to the next line? */
|
| 1484 | if (++m_line_in_row >= get_lines_per_row())
|
| 1485 | {
|
| 1486 | /* next row */
|
| 1487 | m_line_in_row = 0;
|
| 1488 | m_video_position += pitch;
|
| 1489 | }
|
| 1490 | }
|
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | //-------------------------------------------------
|
| 1495 | // update_geometry
|
| 1496 | //-------------------------------------------------
|
| 1497 | |
| 1498 | void gime_base_device::update_geometry(void)
|
| 1499 | {
|
| 1500 | UINT16 top_border_scanlines, body_scanlines;
|
| 1501 | |
| 1502 | switch(m_legacy_video ? 0x00 : (m_gime_registers[9] & 0x60))
|
| 1503 | {
|
| 1504 | case 0x00:
|
| 1505 | // 192 lines (and legacy video)
|
| 1506 | top_border_scanlines = 25;
|
| 1507 | body_scanlines = 192;
|
| 1508 | break;
|
| 1509 | |
| 1510 | case 0x20:
|
| 1511 | // 200 lines
|
| 1512 | top_border_scanlines = 23;
|
| 1513 | body_scanlines = 200;
|
| 1514 | break;
|
| 1515 | |
| 1516 | case 0x40:
|
| 1517 | // zero/infinite lines
|
| 1518 | //
|
| 1519 | // If specified within the border, the border will go forever. If specified within the body, the body will go forever. This
|
| 1520 | // suggests that there is a counter that counts scanlines, and we switch border <=> body when we hit some maximum count
|
| 1521 | top_border_scanlines = ~0;
|
| 1522 | body_scanlines = ~0;
|
| 1523 | break;
|
| 1524 | |
| 1525 | case 0x60:
|
| 1526 | // 225 lines
|
| 1527 | top_border_scanlines = 8;
|
| 1528 | body_scanlines = 225;
|
| 1529 | break;
|
| 1530 | |
| 1531 | default:
|
| 1532 | fatalerror("Should not get here");
|
| 1533 | break;
|
| 1534 | }
|
| 1535 | |
| 1536 | // bit 3 of $FF99 controls "wideness"
|
| 1537 | bool wide = !m_legacy_video && (m_gime_registers[9] & 0x08);
|
| 1538 | |
| 1539 | // set the geometry
|
| 1540 | set_geometry(top_border_scanlines, body_scanlines, wide);
|
| 1541 | }
|
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | //**************************************************************************
|
| 1546 | // VIDEO BLITTING
|
| 1547 | //**************************************************************************
|
| 1548 | |
| 1549 | //-------------------------------------------------
|
| 1550 | // emit_dummy_samples
|
| 1551 | //-------------------------------------------------
|
| 1552 | |
| 1553 | UINT32 gime_base_device::emit_dummy_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
|
| 1554 | {
|
| 1555 | fatalerror("Should not get here");
|
| 1556 | return 0;
|
| 1557 | }
|
| 1558 | |
| 1559 | |
| 1560 | |
| 1561 | //-------------------------------------------------
|
| 1562 | // emit_mc6847_samples
|
| 1563 | //-------------------------------------------------
|
| 1564 | |
| 1565 | ATTR_FORCE_INLINE UINT32 gime_base_device::emit_mc6847_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
|
| 1566 | {
|
| 1567 | return super::emit_mc6847_samples<2>(
|
| 1568 | scanline->m_mode[sample_start],
|
| 1569 | &scanline->m_data[sample_start],
|
| 1570 | sample_count,
|
| 1571 | pixels,
|
| 1572 | palette,
|
| 1573 | NULL,
|
| 1574 | sample_start,
|
| 1575 | scanline->m_line_in_row);
|
| 1576 | }
|
| 1577 | |
| 1578 | |
| 1579 | |
| 1580 | //-------------------------------------------------
|
| 1581 | // emit_gime_graphics_samples
|
| 1582 | //-------------------------------------------------
|
| 1583 | |
| 1584 | template<int xscale, int bits_per_pixel>
|
| 1585 | ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_graphics_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
|
| 1586 | {
|
| 1587 | const UINT8 *data = &scanline->m_data[sample_start];
|
| 1588 | mc6847_friend_device::emit_graphics<bits_per_pixel, xscale>(data, sample_count, pixels, 0, palette);
|
| 1589 | return sample_count * (8 / bits_per_pixel) * xscale;
|
| 1590 | }
|
| 1591 | |
| 1592 | |
| 1593 | |
| 1594 | //-------------------------------------------------
|
| 1595 | // emit_gime_text_samples
|
| 1596 | //-------------------------------------------------
|
| 1597 | |
| 1598 | template<int xscale>
|
| 1599 | ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_text_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
|
| 1600 | {
|
| 1601 | UINT8 attribute = scanline->m_mode[sample_start];
|
| 1602 | const UINT8 *data = &scanline->m_data[sample_start];
|
| 1603 | |
| 1604 | /* determine the background/foreground colors */
|
| 1605 | UINT8 bg = (attribute == NO_ATTRIBUTE) ? 0 : ((attribute >> 0) & 0x07) + 0x00;
|
| 1606 | UINT8 fg = (attribute == NO_ATTRIBUTE) ? 1 : ((attribute >> 3) & 0x07) + 0x08;
|
| 1607 | |
| 1608 | /* underline attribute */
|
| 1609 | int underline_line = -1;
|
| 1610 | if ((attribute != NO_ATTRIBUTE) && (attribute & 0x40))
|
| 1611 | {
|
| 1612 | /* to quote SockMaster:
|
| 1613 | *
|
| 1614 | * The underline attribute will light up the bottom scan line of the character
|
| 1615 | * if the lines are set to 8 or 9. Not appear at all when less, or appear on
|
| 1616 | * the 2nd to bottom scan line if set higher than 9. Further exception being
|
| 1617 | * the $x7 setting where the whole screen is filled with only one line of data
|
| 1618 | * - but it's glitched - the line repeats over and over again every 16 scan
|
| 1619 | * lines.. Nobody will use this mode, but that's what happens if you want to
|
| 1620 | * make things really authentic :)
|
| 1621 | */
|
| 1622 | switch(scanline->m_ff98_value & 0x07)
|
| 1623 | {
|
| 1624 | case 0x03:
|
| 1625 | underline_line = 7;
|
| 1626 | break;
|
| 1627 | case 0x04:
|
| 1628 | case 0x05:
|
| 1629 | underline_line = 8;
|
| 1630 | break;
|
| 1631 | case 0x06:
|
| 1632 | underline_line = 9;
|
| 1633 | break;
|
| 1634 | }
|
| 1635 | }
|
| 1636 | |
| 1637 | for (int i = 0; i < sample_count; i++)
|
| 1638 | {
|
| 1639 | for (int j = 0; j < 8; j++)
|
| 1640 | {
|
| 1641 | for (int k = 0; k < xscale; k++)
|
| 1642 | {
|
| 1643 | UINT8 font_byte = hires_font[data[i] & 0x7F][scanline->m_line_in_row];
|
| 1644 | bool bit = (scanline->m_line_in_row == underline_line) || ((font_byte >> (7 - j)) & 0x01);
|
| 1645 | pixels[(i * 8 + j) * xscale + k] = bit ? palette[fg] : palette[bg];
|
| 1646 | }
|
| 1647 | }
|
| 1648 | }
|
| 1649 | return sample_count * 8 * xscale;
|
| 1650 | }
|
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | //-------------------------------------------------
|
| 1655 | // render_scanline
|
| 1656 | //-------------------------------------------------
|
| 1657 | |
| 1658 | template<int sample_count, gime_base_device::emit_samples_proc emit_samples>
|
| 1659 | ATTR_FORCE_INLINE void gime_base_device::render_scanline(const scanline_record *scanline, pixel_t *pixels, int min_x, int max_x, palette_resolver *resolver)
|
| 1660 | {
|
| 1661 | int left_border, right_border;
|
| 1662 | int x, x2;
|
| 1663 | pixel_t border_color = resolver->lookup(scanline->m_border);
|
| 1664 | const pixel_t *resolved_palette = NULL;
|
| 1665 | |
| 1666 | /* is this a wide video mode? */
|
| 1667 | bool wide = !m_legacy_video && (scanline->m_ff99_value & 0x04);
|
| 1668 | |
| 1669 | /* size up the borders */
|
| 1670 | if (sample_count > 0)
|
| 1671 | {
|
| 1672 | left_border = wide ? 0 : 64;
|
| 1673 | right_border = wide ? 640 : 512;
|
| 1674 | }
|
| 1675 | else
|
| 1676 | {
|
| 1677 | left_border = 640;
|
| 1678 | right_border = 640;
|
| 1679 | }
|
| 1680 | |
| 1681 | /* left border */
|
| 1682 | for (x = min_x; x < left_border; x++)
|
| 1683 | {
|
| 1684 | pixels[x] = border_color;
|
| 1685 | }
|
| 1686 | |
| 1687 | /* right border */
|
| 1688 | for (x = right_border; x <= max_x; x++)
|
| 1689 | {
|
| 1690 | pixels[x] = border_color;
|
| 1691 | }
|
| 1692 | |
| 1693 | /* offset the pixel counts depending on wide */
|
| 1694 | pixels += wide ? 0 : 64;
|
| 1695 | |
| 1696 | /* body */
|
| 1697 | x = 0;
|
| 1698 | while(x < sample_count)
|
| 1699 | {
|
| 1700 | /* determine how many bytes exist for which the mode is identical */
|
| 1701 | for (x2 = x + 1; (x2 < sample_count) && (scanline->m_mode[x] == scanline->m_mode[x2]) && (scanline->m_palette[x] == scanline->m_palette[x2]); x2++)
|
| 1702 | ;
|
| 1703 | |
| 1704 | /* resolve the palette */
|
| 1705 | resolved_palette = resolver->get_palette(scanline->m_palette[x]);
|
| 1706 | |
| 1707 | /* emit the samples, with a (hopefully) aggressively inlined function */
|
| 1708 | pixels += ((*this).*(emit_samples))(scanline, x, x2 - x, pixels, resolved_palette);
|
| 1709 | |
| 1710 | /* update x */
|
| 1711 | x = x2;
|
| 1712 | }
|
| 1713 | |
| 1714 | /* artifacting */
|
| 1715 | if (m_legacy_video && (sample_count > 0))
|
| 1716 | {
|
| 1717 | m_artifacter.process_artifacts<2>(pixels, scanline->m_mode[0], resolved_palette);
|
| 1718 | }
|
| 1719 | }
|
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | //-------------------------------------------------
|
| 1724 | // update_screen
|
| 1725 | //-------------------------------------------------
|
| 1726 | |
| 1727 | bool gime_base_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect, const pixel_t *RESTRICT palette)
|
| 1728 | {
|
| 1729 | int base_x = 64;
|
| 1730 | int min_x = USE_HORIZONTAL_CLIP ? cliprect->min_x : 0;
|
| 1731 | int max_x = USE_HORIZONTAL_CLIP ? cliprect->max_x : (base_x * 2 + 512 - 1);
|
| 1732 | int min_y = cliprect->min_y;
|
| 1733 | int max_y = cliprect->max_y;
|
| 1734 | palette_resolver resolver(this, palette);
|
| 1735 | |
| 1736 | /* if the video didn't change, indicate as much */
|
| 1737 | if (!has_video_changed())
|
| 1738 | return UPDATE_HAS_NOT_CHANGED;
|
| 1739 | |
| 1740 | for (int y = min_y; y <= max_y; y++)
|
| 1741 | {
|
| 1742 | const scanline_record *scanline = &m_scanlines[y];
|
| 1743 | pixel_t *RESTRICT pixels = bitmap_addr(bitmap, y, 0);
|
| 1744 | |
| 1745 | /* render the scanline */
|
| 1746 | if (m_scanlines[y].m_line_in_row == (UINT8) ~0)
|
| 1747 | {
|
| 1748 | /* this is a border scanline */
|
| 1749 | render_scanline<0, &gime_base_device::emit_dummy_samples>(scanline, pixels, min_x, max_x, &resolver);
|
| 1750 | }
|
| 1751 | else if (m_legacy_video)
|
| 1752 | {
|
| 1753 | /* this is a legacy body scanline */
|
| 1754 | switch(scanline->m_ff22_value & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0))
|
| 1755 | {
|
| 1756 | case MODE_AG:
|
| 1757 | case MODE_AG|MODE_GM0:
|
| 1758 | case MODE_AG|MODE_GM1|MODE_GM0:
|
| 1759 | case MODE_AG|MODE_GM2|MODE_GM0:
|
| 1760 | render_scanline<16, &gime_base_device::emit_mc6847_samples>(scanline, pixels, min_x, max_x, &resolver);
|
| 1761 | break;
|
| 1762 | |
| 1763 | default:
|
| 1764 | render_scanline<32, &gime_base_device::emit_mc6847_samples>(scanline, pixels, min_x, max_x, &resolver);
|
| 1765 | break;
|
| 1766 | }
|
| 1767 | }
|
| 1768 | else if (scanline->m_ff98_value & 0x80)
|
| 1769 | {
|
| 1770 | /* GIME graphics */
|
| 1771 | switch(scanline->m_ff99_value & 0x1F)
|
| 1772 | {
|
| 1773 | case 0x00: render_scanline< 16, &gime_base_device::emit_gime_graphics_samples< 4, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1774 | case 0x01: render_scanline< 16, &gime_base_device::emit_gime_graphics_samples< 8, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1775 | case 0x02:
|
| 1776 | case 0x03: render_scanline< 16, &gime_base_device::emit_gime_graphics_samples<16, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1777 | case 0x04: render_scanline< 20, &gime_base_device::emit_gime_graphics_samples< 4, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1778 | case 0x05: render_scanline< 20, &gime_base_device::emit_gime_graphics_samples< 8, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1779 | case 0x06:
|
| 1780 | case 0x07: render_scanline< 20, &gime_base_device::emit_gime_graphics_samples<16, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1781 | case 0x08: render_scanline< 32, &gime_base_device::emit_gime_graphics_samples< 2, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1782 | case 0x09: render_scanline< 32, &gime_base_device::emit_gime_graphics_samples< 4, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1783 | case 0x0A:
|
| 1784 | case 0x0B: render_scanline< 32, &gime_base_device::emit_gime_graphics_samples< 8, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1785 | case 0x0C: render_scanline< 40, &gime_base_device::emit_gime_graphics_samples< 2, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1786 | case 0x0D: render_scanline< 40, &gime_base_device::emit_gime_graphics_samples< 4, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1787 | case 0x0E:
|
| 1788 | case 0x0F: render_scanline< 40, &gime_base_device::emit_gime_graphics_samples< 8, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1789 | case 0x10: render_scanline< 64, &gime_base_device::emit_gime_graphics_samples< 1, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1790 | case 0x11: render_scanline< 64, &gime_base_device::emit_gime_graphics_samples< 2, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1791 | case 0x12:
|
| 1792 | case 0x13: render_scanline< 64, &gime_base_device::emit_gime_graphics_samples< 4, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1793 | case 0x14: render_scanline< 80, &gime_base_device::emit_gime_graphics_samples< 1, 1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1794 | case 0x15: render_scanline< 80, &gime_base_device::emit_gime_graphics_samples< 2, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1795 | case 0x16:
|
| 1796 | case 0x17: render_scanline< 80, &gime_base_device::emit_gime_graphics_samples< 4, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1797 | case 0x18:
|
| 1798 | case 0x19: render_scanline<128, &gime_base_device::emit_gime_graphics_samples< 1, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1799 | case 0x1A:
|
| 1800 | case 0x1B: render_scanline<128, &gime_base_device::emit_gime_graphics_samples< 2, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1801 | case 0x1C:
|
| 1802 | case 0x1D: render_scanline<160, &gime_base_device::emit_gime_graphics_samples< 1, 2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1803 | case 0x1E:
|
| 1804 | case 0x1F: render_scanline<160, &gime_base_device::emit_gime_graphics_samples< 2, 4> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1805 | }
|
| 1806 | }
|
| 1807 | else
|
| 1808 | {
|
| 1809 | /* GIME text */
|
| 1810 | switch(scanline->m_ff99_value & 0x14)
|
| 1811 | {
|
| 1812 | case 0x00: render_scanline<32, &gime_base_device::emit_gime_text_samples<2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1813 | case 0x04: render_scanline<40, &gime_base_device::emit_gime_text_samples<2> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1814 | case 0x10: render_scanline<64, &gime_base_device::emit_gime_text_samples<1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1815 | case 0x14: render_scanline<80, &gime_base_device::emit_gime_text_samples<1> >(scanline, pixels, min_x, max_x, &resolver); break;
|
| 1816 | }
|
| 1817 | }
|
| 1818 | }
|
| 1819 | return 0;
|
| 1820 | }
|
| 1821 | |
| 1822 | |
| 1823 | |
| 1824 | //-------------------------------------------------
|
| 1825 | // update_composite
|
| 1826 | //-------------------------------------------------
|
| 1827 | |
| 1828 | bool gime_base_device::update_composite(bitmap_t *bitmap, const rectangle *cliprect)
|
| 1829 | {
|
| 1830 | update_value(&m_displayed_rgb, false);
|
| 1831 | const pixel_t *palette = (m_gime_registers[0x08] & 0x10)
|
| 1832 | ? m_composite_bw_palette
|
| 1833 | : m_composite_palette;
|
| 1834 | return update_screen(bitmap, cliprect, palette);
|
| 1835 | }
|
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | //-------------------------------------------------
|
| 1840 | // update_rgb
|
| 1841 | //-------------------------------------------------
|
| 1842 | |
| 1843 | bool gime_base_device::update_rgb(bitmap_t *bitmap, const rectangle *cliprect)
|
| 1844 | {
|
| 1845 | update_value(&m_displayed_rgb, true);
|
| 1846 | return update_screen(bitmap, cliprect, m_rgb_palette);
|
| 1847 | }
|
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | //**************************************************************************
|
| 1852 | // PALETTE RESOLVER MEMBER CLASS
|
| 1853 | //**************************************************************************
|
| 1854 | |
| 1855 | //-------------------------------------------------
|
| 1856 | // palette_resolver::palette_resolver
|
| 1857 | //-------------------------------------------------
|
| 1858 | |
| 1859 | ATTR_FORCE_INLINE gime_base_device::palette_resolver::palette_resolver(gime_base_device *gime, const pixel_t *palette)
|
| 1860 | {
|
| 1861 | m_gime = gime;
|
| 1862 | m_palette = palette;
|
| 1863 | memset(m_resolved_palette, 0, sizeof(m_resolved_palette));
|
| 1864 | m_current_resolved_palette = -1;
|
| 1865 | }
|
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | //-------------------------------------------------
|
| 1870 | // palette_resolver::get_palette
|
| 1871 | //-------------------------------------------------
|
| 1872 | |
| 1873 | ATTR_FORCE_INLINE const gime_base_device::pixel_t *gime_base_device::palette_resolver::get_palette(UINT16 palette_rotation)
|
| 1874 | {
|
| 1875 | if (UNEXPECTED(m_current_resolved_palette != palette_rotation))
|
| 1876 | {
|
| 1877 | for (int i = 0; i < 16; i++)
|
| 1878 | m_resolved_palette[i] = lookup(m_gime->m_palette_rotated[palette_rotation][i]);
|
| 1879 | m_current_resolved_palette = palette_rotation;
|
| 1880 | }
|
| 1881 | return m_resolved_palette;
|
| 1882 | }
|
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | //-------------------------------------------------
|
| 1887 | // palette_resolver::lookup
|
| 1888 | //-------------------------------------------------
|
| 1889 | |
| 1890 | ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::palette_resolver::lookup(UINT8 color)
|
| 1891 | {
|
| 1892 | assert((color >= 0) && (color <= 63));
|
| 1893 | return m_palette[color];
|
| 1894 | }
|
| 1895 | |
| 1896 | |
| 1897 | |
| 1898 | //-------------------------------------------------
|
| 1899 | // hires_font
|
| 1900 | //-------------------------------------------------
|
| 1901 | |
| 1902 | const UINT8 gime_base_device::hires_font[128][12] =
|
| 1903 | {
|
| 1904 | { 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x10}, { 0x44, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00}, |
| 1905 | { 0x08, 0x10, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00}, { 0x10, 0x28, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00}, |
| 1906 | { 0x28, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00}, { 0x20, 0x10, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00}, |
| 1907 | { 0x10, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00}, { 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x10}, |
| 1908 | { 0x10, 0x28, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00}, { 0x28, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00}, |
| 1909 | { 0x20, 0x10, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00}, { 0x28, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00}, |
| 1910 | { 0x10, 0x28, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00}, { 0x00, 0x18, 0x24, 0x38, 0x24, 0x24, 0x38, 0x40}, |
| 1911 | { 0x44, 0x10, 0x28, 0x44, 0x7C, 0x44, 0x44, 0x00}, { 0x10, 0x10, 0x28, 0x44, 0x7C, 0x44, 0x44, 0x00}, |
| 1912 | { 0x08, 0x10, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, { 0x00, 0x00, 0x68, 0x14, 0x3C, 0x50, 0x3C, 0x00}, |
| 1913 | { 0x3C, 0x50, 0x50, 0x78, 0x50, 0x50, 0x5C, 0x00}, { 0x10, 0x28, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, |
| 1914 | { 0x28, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, { 0x00, 0x00, 0x38, 0x4C, 0x54, 0x64, 0x38, 0x00}, |
| 1915 | { 0x10, 0x28, 0x00, 0x44, 0x44, 0x4C, 0x34, 0x00}, { 0x20, 0x10, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00}, |
| 1916 | { 0x38, 0x4C, 0x54, 0x54, 0x54, 0x64, 0x38, 0x00}, { 0x44, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00}, |
| 1917 | { 0x28, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00}, { 0x38, 0x40, 0x38, 0x44, 0x38, 0x04, 0x38, 0x00}, |
| 1918 | { 0x08, 0x14, 0x10, 0x38, 0x10, 0x50, 0x3C, 0x00}, { 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x7C, 0x00}, |
| 1919 | { 0x10, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, { 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x20, 0x40}, |
| 1920 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, { 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00}, |
| 1921 | { 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00}, { 0x28, 0x28, 0x7C, 0x28, 0x7C, 0x28, 0x28, 0x00}, |
| 1922 | { 0x10, 0x3C, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00}, { 0x60, 0x64, 0x08, 0x10, 0x20, 0x4C, 0x0C, 0x00}, |
| 1923 | { 0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00}, { 0x10, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
| 1924 | { 0x08, 0x10, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00}, { 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00}, |
| 1925 | { 0x00, 0x10, 0x54, 0x38, 0x38, 0x54, 0x10, 0x00}, { 0x00, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x00, 0x00}, |
| 1926 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x20}, { 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00}, |
| 1927 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00}, { 0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00}, |
| 1928 | { 0x38, 0x44, 0x4C, 0x54, 0x64, 0x44, 0x38, 0x00}, { 0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00}, |
| 1929 | { 0x38, 0x44, 0x04, 0x38, 0x40, 0x40, 0x7C, 0x00}, { 0x38, 0x44, 0x04, 0x08, 0x04, 0x44, 0x38, 0x00}, |
| 1930 | { 0x08, 0x18, 0x28, 0x48, 0x7C, 0x08, 0x08, 0x00}, { 0x7C, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00}, |
| 1931 | { 0x38, 0x40, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00}, { 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x40, 0x00}, |
| 1932 | { 0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00}, { 0x38, 0x44, 0x44, 0x38, 0x04, 0x04, 0x38, 0x00}, |
| 1933 | { 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00}, { 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20}, |
| 1934 | { 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00}, { 0x00, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0x00}, |
| 1935 | { 0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00}, { 0x38, 0x44, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00}, |
| 1936 | { 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00}, { 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00}, |
| 1937 | { 0x78, 0x24, 0x24, 0x38, 0x24, 0x24, 0x78, 0x00}, { 0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00}, |
| 1938 | { 0x78, 0x24, 0x24, 0x24, 0x24, 0x24, 0x78, 0x00}, { 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x7C, 0x00}, |
| 1939 | { 0x7C, 0x40, 0x40, 0x70, 0x40, 0x40, 0x40, 0x00}, { 0x38, 0x44, 0x40, 0x40, 0x4C, 0x44, 0x38, 0x00}, |
| 1940 | { 0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x00}, { 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00}, |
| 1941 | { 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00}, { 0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00}, |
| 1942 | { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x00}, { 0x44, 0x6C, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00}, |
| 1943 | { 0x44, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x44, 0x00}, { 0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00}, |
| 1944 | { 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00}, { 0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00}, |
| 1945 | { 0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00}, { 0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00}, |
| 1946 | { 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00}, { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00}, |
| 1947 | { 0x44, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x00}, { 0x44, 0x44, 0x44, 0x44, 0x54, 0x6C, 0x44, 0x00}, |
| 1948 | { 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00}, { 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00}, |
| 1949 | { 0x7C, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7C, 0x00}, { 0x38, 0x20, 0x20, 0x20, 0x20, 0x20, 0x38, 0x00}, |
| 1950 | { 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00}, { 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00}, |
| 1951 | { 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x10, 0x00}, { 0x00, 0x10, 0x20, 0x7C, 0x20, 0x10, 0x00, 0x00}, |
| 1952 | { 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00}, { 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00}, |
| 1953 | { 0x40, 0x40, 0x58, 0x64, 0x44, 0x64, 0x58, 0x00}, { 0x00, 0x00, 0x38, 0x44, 0x40, 0x44, 0x38, 0x00}, |
| 1954 | { 0x04, 0x04, 0x34, 0x4C, 0x44, 0x4C, 0x34, 0x00}, { 0x00, 0x00, 0x38, 0x44, 0x7C, 0x40, 0x38, 0x00}, |
| 1955 | { 0x08, 0x14, 0x10, 0x38, 0x10, 0x10, 0x10, 0x00}, { 0x00, 0x00, 0x34, 0x4C, 0x4C, 0x34, 0x04, 0x38}, |
| 1956 | { 0x40, 0x40, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00}, { 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00}, |
| 1957 | { 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x44, 0x38}, { 0x40, 0x40, 0x48, 0x50, 0x60, 0x50, 0x48, 0x00}, |
| 1958 | { 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00}, { 0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00}, |
| 1959 | { 0x00, 0x00, 0x58, 0x64, 0x44, 0x44, 0x44, 0x00}, { 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, |
| 1960 | { 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40}, { 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x04}, |
| 1961 | { 0x00, 0x00, 0x58, 0x64, 0x40, 0x40, 0x40, 0x00}, { 0x00, 0x00, 0x3C, 0x40, 0x38, 0x04, 0x78, 0x00}, |
| 1962 | { 0x20, 0x20, 0x70, 0x20, 0x20, 0x24, 0x18, 0x00}, { 0x00, 0x00, 0x44, 0x44, 0x44, 0x4C, 0x34, 0x00}, |
| 1963 | { 0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00}, { 0x00, 0x00, 0x44, 0x54, 0x54, 0x28, 0x28, 0x00}, |
| 1964 | { 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00}, { 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38}, |
| 1965 | { 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00}, { 0x08, 0x10, 0x10, 0x20, 0x10, 0x10, 0x08, 0x00}, |
| 1966 | { 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x10, 0x00}, { 0x20, 0x10, 0x10, 0x08, 0x10, 0x10, 0x20, 0x00}, |
| 1967 | { 0x20, 0x54, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00}
|
| 1968 | };
|
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | //**************************************************************************
|
| 1973 | // VARIATIONS
|
| 1974 | //**************************************************************************
|
| 1975 | |
| 1976 | const device_type GIME_NTSC = &device_creator<gime_ntsc_device>;
|
| 1977 | const device_type GIME_PAL = &device_creator<gime_pal_device>;
|
| 1978 | |
| 1979 | |
| 1980 | |
| 1981 | //-------------------------------------------------
|
| 1982 | // gime_ntsc_device
|
| 1983 | //-------------------------------------------------
|
| 1984 | |
| 1985 | gime_ntsc_device::gime_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1986 | : gime_base_device(mconfig, GIME_NTSC, "GIME_NTSC", tag, owner, clock, ntsc_round_fontdata8x12)
|
| 1987 | {
|
| 1988 | }
|
| 1989 | |
| 1990 | |
| 1991 | |
| 1992 | //-------------------------------------------------
|
| 1993 | // gime_pal_device
|
| 1994 | //-------------------------------------------------
|
| 1995 | |
| 1996 | gime_pal_device::gime_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 1997 | : gime_base_device(mconfig, GIME_PAL, "GIME_PAL", tag, owner, clock, pal_round_fontdata8x12)
|
| 1998 | {
|
| 1999 | }
|
src/mess/drivers/coco.c
| r13256 | r13257 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | coco.c |
| 4 | | |
| 5 | | TRS-80 Radio Shack Color Computer Family |
| 6 | | |
| 7 | | Mathis Rosenhauer (original driver) |
| 8 | | Nate Woods (current maintainer) |
| 9 | | Tim Lindner (VHD and other work) |
| 10 | | |
| 11 | | Version information: |
| 12 | | |
| 13 | | Basic Extended Basic Disk Extended |
| 14 | | coco 1.0 - - |
| 15 | | cocoe 1.1 1.0 1.0 |
| 16 | | coco2 1.2 1.1 1.1 |
| 17 | | coco2b 1.3 1.1 1.1 |
| 18 | | coco3 1.2 2.0 1.1 |
| 19 | | coco3p 1.2 2.0 1.1 |
| 20 | | coco3h 1.2 2.0 1.1 |
| 21 | | |
| 22 | | ***************************************************************************/ |
| 23 | | |
| 24 | | #include "emu.h" |
| 25 | | #include "cpu/m6809/m6809.h" |
| 26 | | #include "cpu/hd6309/hd6309.h" |
| 27 | | #include "sound/wave.h" |
| 28 | | #include "machine/6821pia.h" |
| 29 | | #include "video/coco6847.h" |
| 30 | | #include "machine/msm6242.h" |
| 31 | | #include "machine/ds1315.h" |
| 32 | | #include "machine/6883sam.h" |
| 33 | | #include "includes/coco.h" |
| 34 | | #include "machine/wd17xx.h" |
| 35 | | #include "machine/6551acia.h" |
| 36 | | #include "formats/coco_dsk.h" |
| 37 | | #include "formats/coco_cas.h" |
| 38 | | #include "imagedev/printer.h" |
| 39 | | #include "imagedev/flopdrv.h" |
| 40 | | #include "imagedev/cassette.h" |
| 41 | | #include "imagedev/bitbngr.h" |
| 42 | | #include "imagedev/snapquik.h" |
| 43 | | #include "imagedev/cartslot.h" |
| 44 | | #include "machine/cococart.h" |
| 45 | | #include "machine/coco_vhd.h" |
| 46 | | #include "machine/coco_232.h" |
| 47 | | #include "machine/coco_orch90.h" |
| 48 | | #include "machine/coco_pak.h" |
| 49 | | #include "machine/coco_fdc.h" |
| 50 | | #include "machine/coco_multi.h" |
| 51 | | #include "sound/ay8910.h" |
| 52 | | #include "sound/dac.h" |
| 53 | | #include "machine/ram.h" |
| 54 | | #include "coco3.lh" |
| 55 | | |
| 56 | | #define SHOW_FULL_AREA 0 |
| 57 | | #define JOYSTICK_DELTA 10 |
| 58 | | #define JOYSTICK_SENSITIVITY 100 |
| 59 | | |
| 60 | | static ADDRESS_MAP_START( coco_map, AS_PROGRAM, 8 ) |
| 61 | | AM_RANGE(0x0000, 0x0FFF) AM_RAMBANK("bank1") |
| 62 | | AM_RANGE(0x1000, 0x1FFF) AM_RAMBANK("bank2") |
| 63 | | AM_RANGE(0x2000, 0x2FFF) AM_RAMBANK("bank3") |
| 64 | | AM_RANGE(0x3000, 0x3FFF) AM_RAMBANK("bank4") |
| 65 | | AM_RANGE(0x4000, 0x4FFF) AM_RAMBANK("bank5") |
| 66 | | AM_RANGE(0x5000, 0x5FFF) AM_RAMBANK("bank6") |
| 67 | | AM_RANGE(0x6000, 0x6FFF) AM_RAMBANK("bank7") |
| 68 | | AM_RANGE(0x7000, 0x7FFF) AM_RAMBANK("bank8") |
| 69 | | AM_RANGE(0x8000, 0x8FFF) AM_RAMBANK("bank9") |
| 70 | | AM_RANGE(0x9000, 0x9FFF) AM_RAMBANK("bank10") |
| 71 | | AM_RANGE(0xA000, 0xAFFF) AM_RAMBANK("bank11") |
| 72 | | AM_RANGE(0xB000, 0xBFFF) AM_RAMBANK("bank12") |
| 73 | | AM_RANGE(0xC000, 0xCFFF) AM_RAMBANK("bank13") |
| 74 | | AM_RANGE(0xD000, 0xDFFF) AM_RAMBANK("bank14") |
| 75 | | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15") |
| 76 | | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16") |
| 77 | | AM_RANGE(0xff00, 0xff1f) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 78 | | AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 79 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 80 | | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 81 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 82 | | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 83 | | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x3ff0) |
| 84 | | ADDRESS_MAP_END |
| 85 | | |
| 86 | | |
| 87 | | static ADDRESS_MAP_START( dragon_map, AS_PROGRAM, 8 ) |
| 88 | | AM_RANGE(0x0000, 0x0FFF) AM_RAMBANK("bank1") |
| 89 | | AM_RANGE(0x1000, 0x1FFF) AM_RAMBANK("bank2") |
| 90 | | AM_RANGE(0x2000, 0x2FFF) AM_RAMBANK("bank3") |
| 91 | | AM_RANGE(0x3000, 0x3FFF) AM_RAMBANK("bank4") |
| 92 | | AM_RANGE(0x4000, 0x4FFF) AM_RAMBANK("bank5") |
| 93 | | AM_RANGE(0x5000, 0x5FFF) AM_RAMBANK("bank6") |
| 94 | | AM_RANGE(0x6000, 0x6FFF) AM_RAMBANK("bank7") |
| 95 | | AM_RANGE(0x7000, 0x7FFF) AM_RAMBANK("bank8") |
| 96 | | AM_RANGE(0x8000, 0x8FFF) AM_RAMBANK("bank9") |
| 97 | | AM_RANGE(0x9000, 0x9FFF) AM_RAMBANK("bank10") |
| 98 | | AM_RANGE(0xA000, 0xAFFF) AM_RAMBANK("bank11") |
| 99 | | AM_RANGE(0xB000, 0xBFFF) AM_RAMBANK("bank12") |
| 100 | | AM_RANGE(0xC000, 0xCFFF) AM_RAMBANK("bank13") |
| 101 | | AM_RANGE(0xD000, 0xDFFF) AM_RAMBANK("bank14") |
| 102 | | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15") |
| 103 | | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16") |
| 104 | | AM_RANGE(0xff00, 0xff1f) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 105 | | AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 106 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 107 | | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 108 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 109 | | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 110 | | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x3ff0) |
| 111 | | ADDRESS_MAP_END |
| 112 | | |
| 113 | | |
| 114 | | /* Note that the CoCo 3 doesn't use the SAM VDG mode registers |
| 115 | | * |
| 116 | | * Also, there might be other SAM registers that are ignored in the CoCo 3; |
| 117 | | * I am not sure which ones are... |
| 118 | | * |
| 119 | | * Tepolt implies that $FFD4-$FFD7 and $FFDA-$FFDD are ignored on the CoCo 3, |
| 120 | | * which would make sense, but I'm not sure. |
| 121 | | */ |
| 122 | | static ADDRESS_MAP_START( coco3_map, AS_PROGRAM, 8 ) |
| 123 | | AM_RANGE(0x0000, 0x1fff) AM_RAMBANK("bank1") |
| 124 | | AM_RANGE(0x2000, 0x3fff) AM_RAMBANK("bank2") |
| 125 | | AM_RANGE(0x4000, 0x5fff) AM_RAMBANK("bank3") |
| 126 | | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("bank4") |
| 127 | | AM_RANGE(0x8000, 0x9fff) AM_RAMBANK("bank5") |
| 128 | | AM_RANGE(0xa000, 0xbfff) AM_RAMBANK("bank6") |
| 129 | | AM_RANGE(0xc000, 0xdfff) AM_RAMBANK("bank7") |
| 130 | | AM_RANGE(0xe000, 0xfdff) AM_RAMBANK("bank8") |
| 131 | | AM_RANGE(0xfe00, 0xfeff) AM_RAMBANK("bank9") |
| 132 | | AM_RANGE(0xff00, 0xff1f) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 133 | | AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 134 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 135 | | AM_RANGE(0xff80, 0xff85) AM_DEVREADWRITE_MODERN("vhd", coco_vhd_image_device, read, write) |
| 136 | | AM_RANGE(0xff90, 0xff9f) AM_READWRITE(coco3_gime_r, coco3_gime_w) |
| 137 | | AM_RANGE(0xffa0, 0xffaf) AM_READWRITE(coco3_mmu_r, coco3_mmu_w) |
| 138 | | AM_RANGE(0xffb0, 0xffbf) AM_READ_BANK("bank10") AM_WRITE(coco3_palette_w) |
| 139 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 140 | | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 141 | | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x7ff0) |
| 142 | | ADDRESS_MAP_END |
| 143 | | |
| 144 | | |
| 145 | | |
| 146 | | static ADDRESS_MAP_START( d64_map, AS_PROGRAM, 8 ) |
| 147 | | AM_RANGE(0x0000, 0x0FFF) AM_RAMBANK("bank1") |
| 148 | | AM_RANGE(0x1000, 0x1FFF) AM_RAMBANK("bank2") |
| 149 | | AM_RANGE(0x2000, 0x2FFF) AM_RAMBANK("bank3") |
| 150 | | AM_RANGE(0x3000, 0x3FFF) AM_RAMBANK("bank4") |
| 151 | | AM_RANGE(0x4000, 0x4FFF) AM_RAMBANK("bank5") |
| 152 | | AM_RANGE(0x5000, 0x5FFF) AM_RAMBANK("bank6") |
| 153 | | AM_RANGE(0x6000, 0x6FFF) AM_RAMBANK("bank7") |
| 154 | | AM_RANGE(0x7000, 0x7FFF) AM_RAMBANK("bank8") |
| 155 | | AM_RANGE(0x8000, 0x8FFF) AM_RAMBANK("bank9") |
| 156 | | AM_RANGE(0x9000, 0x9FFF) AM_RAMBANK("bank10") |
| 157 | | AM_RANGE(0xA000, 0xAFFF) AM_RAMBANK("bank11") |
| 158 | | AM_RANGE(0xB000, 0xBFFF) AM_RAMBANK("bank12") |
| 159 | | AM_RANGE(0xC000, 0xCFFF) AM_RAMBANK("bank13") |
| 160 | | AM_RANGE(0xD000, 0xDFFF) AM_RAMBANK("bank14") |
| 161 | | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15") |
| 162 | | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16") |
| 163 | | AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) AM_MIRROR(0x0018) |
| 164 | | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, read, write) AM_MIRROR(0x0018) |
| 165 | | AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 166 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 167 | | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 168 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 169 | | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 170 | | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x3ff0) |
| 171 | | ADDRESS_MAP_END |
| 172 | | |
| 173 | | /* |
| 174 | | Dragon 64 with compusense Plus addon, this provided an extra 64K of memory |
| 175 | | and an 80x25 column text display, provided by a motorola 6845. |
| 176 | | |
| 177 | | Currently only the memory is emulated. |
| 178 | | */ |
| 179 | | |
| 180 | | static ADDRESS_MAP_START( d64_plus_map, AS_PROGRAM, 8 ) |
| 181 | | AM_RANGE(0x0000, 0x0FFF) AM_RAMBANK("bank1") |
| 182 | | AM_RANGE(0x1000, 0x1FFF) AM_RAMBANK("bank2") |
| 183 | | AM_RANGE(0x2000, 0x2FFF) AM_RAMBANK("bank3") |
| 184 | | AM_RANGE(0x3000, 0x3FFF) AM_RAMBANK("bank4") |
| 185 | | AM_RANGE(0x4000, 0x4FFF) AM_RAMBANK("bank5") |
| 186 | | AM_RANGE(0x5000, 0x5FFF) AM_RAMBANK("bank6") |
| 187 | | AM_RANGE(0x6000, 0x6FFF) AM_RAMBANK("bank7") |
| 188 | | AM_RANGE(0x7000, 0x7FFF) AM_RAMBANK("bank8") |
| 189 | | AM_RANGE(0x8000, 0x8FFF) AM_RAMBANK("bank9") |
| 190 | | AM_RANGE(0x9000, 0x9FFF) AM_RAMBANK("bank10") |
| 191 | | AM_RANGE(0xA000, 0xAFFF) AM_RAMBANK("bank11") |
| 192 | | AM_RANGE(0xB000, 0xBFFF) AM_RAMBANK("bank12") |
| 193 | | AM_RANGE(0xC000, 0xCFFF) AM_RAMBANK("bank13") |
| 194 | | AM_RANGE(0xD000, 0xDFFF) AM_RAMBANK("bank14") |
| 195 | | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15") |
| 196 | | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16") |
| 197 | | AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) AM_MIRROR(0x0018) |
| 198 | | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, read, write) AM_MIRROR(0x0018) |
| 199 | | AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 200 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 201 | | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 202 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 203 | | AM_RANGE(0xffe0, 0xffe1) AM_NOP |
| 204 | | AM_RANGE(0xffe2, 0xffe2) AM_READWRITE(dgnplus_reg_r,dgnplus_reg_w) /* Dragon plus control / status reg */ |
| 205 | | AM_RANGE(0xffe3, 0xffef) AM_NOP |
| 206 | | AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x3ff0) |
| 207 | | ADDRESS_MAP_END |
| 208 | | |
| 209 | | /* |
| 210 | | The Dragon Alpha was a prototype in development when Dragon Data went bust, |
| 211 | | it is basically an enhanced Dragon 64, with built in modem, disk system, and |
| 212 | | graphical boot rom. |
| 213 | | |
| 214 | | It has the following extra hardware :- |
| 215 | | A third 6821 PIA mapped between FF24 and FF27 |
| 216 | | An AY-8912, connected to the PIA. |
| 217 | | |
| 218 | | Port A of the PIA is connected as follows :- |
| 219 | | |
| 220 | | b0 BDIR of AY8912 |
| 221 | | b1 BC1 of AY8912 |
| 222 | | b2 Rom select, High= boot rom, low=BASIC rom |
| 223 | | b3..7 not used. |
| 224 | | |
| 225 | | Port B |
| 226 | | b0..7 connected to D0..7 of the AY8912. |
| 227 | | |
| 228 | | CB1 DRQ of WD2797. |
| 229 | | |
| 230 | | /irqa |
| 231 | | /irqb both connected to 6809 FIRQ. |
| 232 | | |
| 233 | | |
| 234 | | The analog outputs of the AY-8912 are connected to the standard sound multiplexer. |
| 235 | | The AY8912 output port is used as follows :- |
| 236 | | |
| 237 | | b0..b3 /DS0../DS3 for the drive interface (through an inverter first). |
| 238 | | b4 /motor for the drive interface (through an inverter first). |
| 239 | | b5..b7 not used as far as I can tell. |
| 240 | | |
| 241 | | A 6850 for the modem. |
| 242 | | |
| 243 | | A WD2797, used as an internal disk interface, this is however connected in a slightly strange |
| 244 | | way that I am yet to completely determine. |
| 245 | | 19/10/2004, WD2797 is mapped between FF2C and FF2F, however the order of the registers is |
| 246 | | reversed so the command Register is at the highest address instead of the lowest. The Data |
| 247 | | request pin is connected to CB1(pin 18) of PIA2, to cause an firq, the INTRQ, is connected via |
| 248 | | an inverter to the 6809's NMI. |
| 249 | | |
| 250 | | All these are as yet un-emulated. |
| 251 | | |
| 252 | | 29-Oct-2004, AY-8912 is now emulated. |
| 253 | | 30-Oct-2004, Internal disk interface now emulated, Normal DragonDos rom replaced with a re-assembled |
| 254 | | version, that talks to the alpha hardware (verified on a clone of the real machine). |
| 255 | | */ |
| 256 | | |
| 257 | | |
| 258 | | static ADDRESS_MAP_START( dgnalpha_map, AS_PROGRAM, 8 ) |
| 259 | | AM_RANGE(0x0000, 0x0FFF) AM_RAMBANK("bank1") |
| 260 | | AM_RANGE(0x1000, 0x1FFF) AM_RAMBANK("bank2") |
| 261 | | AM_RANGE(0x2000, 0x2FFF) AM_RAMBANK("bank3") |
| 262 | | AM_RANGE(0x3000, 0x3FFF) AM_RAMBANK("bank4") |
| 263 | | AM_RANGE(0x4000, 0x4FFF) AM_RAMBANK("bank5") |
| 264 | | AM_RANGE(0x5000, 0x5FFF) AM_RAMBANK("bank6") |
| 265 | | AM_RANGE(0x6000, 0x6FFF) AM_RAMBANK("bank7") |
| 266 | | AM_RANGE(0x7000, 0x7FFF) AM_RAMBANK("bank8") |
| 267 | | AM_RANGE(0x8000, 0x8FFF) AM_RAMBANK("bank9") |
| 268 | | AM_RANGE(0x9000, 0x9FFF) AM_RAMBANK("bank10") |
| 269 | | AM_RANGE(0xA000, 0xAFFF) AM_RAMBANK("bank11") |
| 270 | | AM_RANGE(0xB000, 0xBFFF) AM_RAMBANK("bank12") |
| 271 | | AM_RANGE(0xC000, 0xCFFF) AM_RAMBANK("bank13") |
| 272 | | AM_RANGE(0xD000, 0xDFFF) AM_RAMBANK("bank14") |
| 273 | | AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15") |
| 274 | | AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16") |
| 275 | | AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) |
| 276 | | AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, read, write) |
| 277 | | AM_RANGE(0xff20, 0xff23) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w) |
| 278 | | AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE_MODERN("pia_2", pia6821_device, read, write) /* Third PIA on Dragon Alpha */ |
| 279 | | AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(dgnalpha_modem_r, dgnalpha_modem_w) /* Modem, dummy to stop eror log ! */ |
| 280 | | AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(dgnalpha_wd2797_r, dgnalpha_wd2797_w) /* Alpha onboard disk interface */ |
| 281 | | AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write) |
| 282 | | AM_RANGE(0xff90, 0xffbf) AM_NOP |
| 283 | | AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w) |
| 284 | | AM_RANGE(0xffe0, 0xffef) AM_NOP |
| 285 | | AM_RANGE(0xfff0, 0xffff) AM_READ(dgnalpha_mapped_irq_r) |
| 286 | | ADDRESS_MAP_END |
| 287 | | |
| 288 | | |
| 289 | | static INPUT_PORTS_START( coco_joystick ) |
| 290 | | PORT_START("joystick_rx") |
| 291 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 292 | | PORT_START("joystick_ry") |
| 293 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 294 | | PORT_START("joystick_lx") |
| 295 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 296 | | PORT_START("joystick_ly") |
| 297 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 298 | | PORT_START("joystick_buttons") |
| 299 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 300 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 301 | | INPUT_PORTS_END |
| 302 | | |
| 303 | | static INPUT_PORTS_START( coco3_joystick ) |
| 304 | | PORT_START("joystick_rx") |
| 305 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 306 | | PORT_START("joystick_ry") |
| 307 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 308 | | PORT_START("joystick_lx") |
| 309 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 310 | | PORT_START("joystick_ly") |
| 311 | | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 312 | | PORT_START("joystick_buttons") |
| 313 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 314 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 2") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 315 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 316 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 2") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 317 | | INPUT_PORTS_END |
| 318 | | |
| 319 | | static INPUT_PORTS_START( coco_rat_mouse ) |
| 320 | | PORT_START("rat_mouse_rx") |
| 321 | | PORT_BIT( 0x03, 0x00, IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x02) |
| 322 | | PORT_START("rat_mouse_ry") |
| 323 | | PORT_BIT( 0x03, 0x00, IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Right Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x02) |
| 324 | | PORT_START("rat_mouse_lx") |
| 325 | | PORT_BIT( 0x03, 0x00, IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x20) |
| 326 | | PORT_START("rat_mouse_ly") |
| 327 | | PORT_BIT( 0x03, 0x00, IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x20) |
| 328 | | PORT_START("rat_mouse_buttons") |
| 329 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x02) |
| 330 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x02) |
| 331 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Left Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x20) |
| 332 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Left Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x20) |
| 333 | | INPUT_PORTS_END |
| 334 | | |
| 335 | | static INPUT_PORTS_START( coco_lightgun ) |
| 336 | | PORT_START("dclg_rx") |
| 337 | | PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Right Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x03) |
| 338 | | PORT_START("dclg_ry") |
| 339 | | PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Right Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x03) |
| 340 | | PORT_START("dclg_lx") |
| 341 | | PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Left Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x30) |
| 342 | | PORT_START("dclg_ly") |
| 343 | | PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Left Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x30) |
| 344 | | PORT_START("dclg_triggers") |
| 345 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x03) |
| 346 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Left Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x30) |
| 347 | | INPUT_PORTS_END |
| 348 | | |
| 349 | | |
| 350 | | static INPUT_PORTS_START( cart_autostart ) |
| 351 | | PORT_START("CARTAUTO") |
| 352 | | PORT_CONFNAME( 0x01, 0x01, "Cart Auto-Start" ) |
| 353 | | PORT_CONFSETTING( 0x00, DEF_STR( Off )) |
| 354 | | PORT_CONFSETTING( 0x01, DEF_STR( On )) |
| 355 | | INPUT_PORTS_END |
| 356 | | |
| 357 | | /* Dragon keyboard |
| 358 | | |
| 359 | | PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 |
| 360 | | PA6: Ent Clr Brk N/c N/c N/c N/c Shift |
| 361 | | PA5: X Y Z Up Dwn Lft Rgt Space |
| 362 | | PA4: P Q R S T U V W |
| 363 | | PA3: H I J K L M N O |
| 364 | | PA2: @ A B C D E F G |
| 365 | | PA1: 8 9 : ; , - . / |
| 366 | | PA0: 0 1 2 3 4 5 6 7 |
| 367 | | */ |
| 368 | | static INPUT_PORTS_START( dragon32 ) |
| 369 | | PORT_START("row0") |
| 370 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 371 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 372 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 373 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 374 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 375 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 376 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 377 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 378 | | |
| 379 | | PORT_START("row1") |
| 380 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 381 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 382 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') |
| 383 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') |
| 384 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 385 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 386 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 387 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 388 | | |
| 389 | | PORT_START("row2") |
| 390 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') |
| 391 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 392 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 393 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 394 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 395 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 396 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 397 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 398 | | |
| 399 | | PORT_START("row3") |
| 400 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 401 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 402 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 403 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 404 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 405 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 406 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 407 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 408 | | |
| 409 | | PORT_START("row4") |
| 410 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 411 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 412 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 413 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 414 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 415 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 416 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 417 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 418 | | |
| 419 | | PORT_START("row5") |
| 420 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 421 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 422 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 423 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') |
| 424 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) |
| 425 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 426 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) |
| 427 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 428 | | |
| 429 | | PORT_START("row6") |
| 430 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 431 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) |
| 432 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 433 | | PORT_BIT(0x78, IP_ACTIVE_LOW, IPT_UNUSED) |
| 434 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 435 | | |
| 436 | | /* Other CoCo controllers were compatible with the Dragon, even if no software is known to make use of them */ |
| 437 | | /* We add them here, based on this compatibility, in case anyone wants to use them in homebrew software */ |
| 438 | | PORT_START("ctrl_sel") /* Select Controller Type */ |
| 439 | | PORT_CONFNAME( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 440 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 441 | | PORT_CONFSETTING( 0x01, "Joystick" ) |
| 442 | | PORT_CONFSETTING( 0x02, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20) |
| 443 | | PORT_CONFSETTING( 0x03, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30) |
| 444 | | PORT_CONFNAME( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 445 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 446 | | PORT_CONFSETTING( 0x10, "Joystick" ) |
| 447 | | PORT_CONFSETTING( 0x20, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02) |
| 448 | | PORT_CONFSETTING( 0x30, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03) |
| 449 | | |
| 450 | | PORT_START("hires_intf") |
| 451 | | PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" ) |
| 452 | | PORT_CONFSETTING( 0x00, "None" ) |
| 453 | | PORT_CONFSETTING( 0x01, "Hi-Res in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 454 | | PORT_CONFSETTING( 0x02, "Hi-Res CoCoMax 3 Style in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 455 | | PORT_CONFSETTING( 0x03, "Hi-Res in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 456 | | PORT_CONFSETTING( 0x04, "Hi-Res CoCoMax 3 Style in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 457 | | |
| 458 | | PORT_INCLUDE( coco_joystick ) |
| 459 | | PORT_INCLUDE( coco_rat_mouse ) |
| 460 | | PORT_INCLUDE( coco_lightgun ) |
| 461 | | |
| 462 | | PORT_INCLUDE( coco6847_artifacting ) |
| 463 | | |
| 464 | | PORT_INCLUDE( cart_autostart ) |
| 465 | | INPUT_PORTS_END |
| 466 | | |
| 467 | | /* CoCo keyboard |
| 468 | | |
| 469 | | PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 |
| 470 | | PA6: Ent Clr Brk N/c N/c N/c N/c Shift |
| 471 | | PA5: 8 9 : ; , - . / |
| 472 | | PA4: 0 1 2 3 4 5 6 7 |
| 473 | | PA3: X Y Z Up Dwn Lft Rgt Space |
| 474 | | PA2: P Q R S T U V W |
| 475 | | PA1: H I J K L M N O |
| 476 | | PA0: @ A B C D E F G |
| 477 | | */ |
| 478 | | static INPUT_PORTS_START( coco ) |
| 479 | | PORT_START("row0") |
| 480 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') |
| 481 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 482 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 483 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 484 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 485 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 486 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 487 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 488 | | |
| 489 | | PORT_START("row1") |
| 490 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 491 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 492 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 493 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 494 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 495 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 496 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 497 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 498 | | |
| 499 | | PORT_START("row2") |
| 500 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 501 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 502 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 503 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 504 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 505 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 506 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 507 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 508 | | |
| 509 | | PORT_START("row3") |
| 510 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 511 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 512 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 513 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') |
| 514 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) |
| 515 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 516 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) |
| 517 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 518 | | |
| 519 | | PORT_START("row4") |
| 520 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 521 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 522 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 523 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 524 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 525 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 526 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 527 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 528 | | |
| 529 | | PORT_START("row5") |
| 530 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 531 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 532 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') |
| 533 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') |
| 534 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 535 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 536 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 537 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 538 | | |
| 539 | | PORT_START("row6") |
| 540 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 541 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) |
| 542 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 543 | | PORT_BIT(0x78, IP_ACTIVE_LOW, IPT_UNUSED) |
| 544 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 545 | | |
| 546 | | PORT_INCLUDE( coco6847_artifacting ) |
| 547 | | |
| 548 | | PORT_START("real_time_clock") |
| 549 | | PORT_CONFNAME( 0x03, 0x00, "Real Time Clock" ) |
| 550 | | PORT_CONFSETTING( 0x00, "Disto" ) |
| 551 | | PORT_CONFSETTING( 0x01, "Cloud-9" ) |
| 552 | | |
| 553 | | /* Port Condition is used because you can plug Hi-Res joystick, Rat Mouse and Lightgun in either ports, but not both */ |
| 554 | | PORT_START("ctrl_sel") /* Select Controller Type */ |
| 555 | | PORT_CONFNAME( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 556 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 557 | | PORT_CONFSETTING( 0x01, "Joystick" ) |
| 558 | | PORT_CONFSETTING( 0x02, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20) |
| 559 | | PORT_CONFSETTING( 0x03, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30) |
| 560 | | PORT_CONFNAME( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 561 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 562 | | PORT_CONFSETTING( 0x10, "Joystick" ) |
| 563 | | PORT_CONFSETTING( 0x20, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02) |
| 564 | | PORT_CONFSETTING( 0x30, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03) |
| 565 | | |
| 566 | | PORT_START("hires_intf") |
| 567 | | PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" ) |
| 568 | | PORT_CONFSETTING( 0x00, "None" ) |
| 569 | | PORT_CONFSETTING( 0x01, "Hi-Res in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 570 | | PORT_CONFSETTING( 0x02, "Hi-Res CoCoMax 3 Style in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 571 | | PORT_CONFSETTING( 0x03, "Hi-Res in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 572 | | PORT_CONFSETTING( 0x04, "Hi-Res CoCoMax 3 Style in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 573 | | |
| 574 | | PORT_INCLUDE( coco_joystick ) |
| 575 | | PORT_INCLUDE( coco_rat_mouse ) |
| 576 | | PORT_INCLUDE( coco_lightgun ) |
| 577 | | |
| 578 | | PORT_INCLUDE( cart_autostart ) |
| 579 | | INPUT_PORTS_END |
| 580 | | |
| 581 | | /* CoCo 3 keyboard |
| 582 | | |
| 583 | | PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 |
| 584 | | PA6: Ent Clr Brk Alt Ctr F1 F2 Shift |
| 585 | | PA5: 8 9 : ; , - . / |
| 586 | | PA4: 0 1 2 3 4 5 6 7 |
| 587 | | PA3: X Y Z Up Dwn Lft Rgt Space |
| 588 | | PA2: P Q R S T U V W |
| 589 | | PA1: H I J K L M N O |
| 590 | | PA0: @ A B C D E F G |
| 591 | | */ |
| 592 | | static INPUT_PORTS_START( coco3 ) |
| 593 | | PORT_START("row0") |
| 594 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') |
| 595 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 596 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 597 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 598 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 599 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 600 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 601 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 602 | | |
| 603 | | PORT_START("row1") |
| 604 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 605 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 606 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 607 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 608 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 609 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 610 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 611 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 612 | | |
| 613 | | PORT_START("row2") |
| 614 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 615 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 616 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 617 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 618 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 619 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 620 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 621 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 622 | | |
| 623 | | PORT_START("row3") |
| 624 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 625 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 626 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 627 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("UP") PORT_CODE(KEYCODE_UP) PORT_CHAR('^') |
| 628 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("DOWN") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(10) |
| 629 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 630 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9) |
| 631 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 632 | | |
| 633 | | PORT_START("row4") |
| 634 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 635 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 636 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 637 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 638 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 639 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 640 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 641 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 642 | | |
| 643 | | PORT_START("row5") |
| 644 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 645 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 646 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') |
| 647 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') |
| 648 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 649 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') PORT_CHAR('_') |
| 650 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 651 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 652 | | |
| 653 | | PORT_START("row6") |
| 654 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 655 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12) |
| 656 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 657 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ALT") PORT_CODE(KEYCODE_LALT) |
| 658 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| 659 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 660 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 661 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 662 | | |
| 663 | | PORT_INCLUDE( coco6847_artifacting ) |
| 664 | | |
| 665 | | PORT_START("real_time_clock") |
| 666 | | PORT_CONFNAME( 0x03, 0x00, "Real Time Clock" ) |
| 667 | | PORT_CONFSETTING( 0x00, "Disto" ) |
| 668 | | PORT_CONFSETTING( 0x01, "Cloud-9" ) |
| 669 | | |
| 670 | | /* Port Condition is used because you can plug Hi-Res joystick, Rat Mouse and Lightgun in either ports, but not both */ |
| 671 | | PORT_START("ctrl_sel") /* Select Controller Type */ |
| 672 | | PORT_CONFNAME( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 673 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 674 | | PORT_CONFSETTING( 0x01, "Joystick" ) |
| 675 | | PORT_CONFSETTING( 0x02, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20) |
| 676 | | PORT_CONFSETTING( 0x03, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30) |
| 677 | | PORT_CONFNAME( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 ) |
| 678 | | PORT_CONFSETTING( 0x00, "Unconnected" ) |
| 679 | | PORT_CONFSETTING( 0x10, "Joystick" ) |
| 680 | | PORT_CONFSETTING( 0x20, "The Rat Graphics Mouse" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02) |
| 681 | | PORT_CONFSETTING( 0x30, "Diecom Light Gun Adaptor" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03) |
| 682 | | |
| 683 | | PORT_START("hires_intf") |
| 684 | | PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" ) |
| 685 | | PORT_CONFSETTING( 0x00, "None" ) |
| 686 | | PORT_CONFSETTING( 0x01, "Hi-Res in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 687 | | PORT_CONFSETTING( 0x02, "Hi-Res CoCoMax 3 Style in Right Port" ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01) |
| 688 | | PORT_CONFSETTING( 0x03, "Hi-Res in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 689 | | PORT_CONFSETTING( 0x04, "Hi-Res CoCoMax 3 Style in Left Port" ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10) |
| 690 | | |
| 691 | | PORT_INCLUDE( coco3_joystick ) |
| 692 | | PORT_INCLUDE( coco_rat_mouse ) |
| 693 | | PORT_INCLUDE( coco_lightgun ) |
| 694 | | |
| 695 | | PORT_INCLUDE( cart_autostart ) |
| 696 | | INPUT_PORTS_END |
| 697 | | |
| 698 | | /*************************************************************************** |
| 699 | | Bitbanger port |
| 700 | | ***************************************************************************/ |
| 701 | | |
| 702 | | static const bitbanger_config coco_bitbanger_config = |
| 703 | | { |
| 704 | | coco_bitbanger_callback, |
| 705 | | BITBANGER_PRINTER, /* default mode */ |
| 706 | | BITBANGER_600, /* default output baud */ |
| 707 | | BITBANGER_0PERCENT /* default fine tune adjustment */ |
| 708 | | }; |
| 709 | | |
| 710 | | static const bitbanger_config coco3_bitbanger_config = |
| 711 | | { |
| 712 | | coco3_bitbanger_callback, |
| 713 | | BITBANGER_PRINTER, /* default mode */ |
| 714 | | BITBANGER_600, /* dafault output baud */ |
| 715 | | BITBANGER_0PERCENT /* default fine tune adjustment */ |
| 716 | | }; |
| 717 | | |
| 718 | | |
| 719 | | |
| 720 | | /* ----------------------------------------------------------------------- */ |
| 721 | | |
| 722 | | /* AY-8912 for Dragon Alpha, the AY-8912 simply an AY-8910 with only one io port. */ |
| 723 | | static const ay8910_interface ay8912_interface = |
| 724 | | { |
| 725 | | AY8910_LEGACY_OUTPUT, |
| 726 | | AY8910_DEFAULT_LOADS, |
| 727 | | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, dgnalpha_psg_porta_read), /* portA read */ |
| 728 | | DEVCB_NULL, /* portB read */ |
| 729 | | DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, dgnalpha_psg_porta_write), /* portA write */ |
| 730 | | DEVCB_NULL /* portB write */ |
| 731 | | }; |
| 732 | | |
| 733 | | |
| 734 | | static MACHINE_CONFIG_FRAGMENT( coco_sound ) |
| 735 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 736 | | MCFG_SOUND_ADD("dac", DAC, 0) |
| 737 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 738 | | MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) |
| 739 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 740 | | MACHINE_CONFIG_END |
| 741 | | |
| 742 | | static const cassette_interface coco_cassette_interface = |
| 743 | | { |
| 744 | | coco_cassette_formats, |
| 745 | | NULL, |
| 746 | | (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED), |
| 747 | | NULL, |
| 748 | | NULL |
| 749 | | }; |
| 750 | | |
| 751 | | static const floppy_interface coco_floppy_interface = |
| 752 | | { |
| 753 | | DEVCB_NULL, |
| 754 | | DEVCB_NULL, |
| 755 | | DEVCB_NULL, |
| 756 | | DEVCB_NULL, |
| 757 | | DEVCB_NULL, |
| 758 | | FLOPPY_STANDARD_5_25_DSHD, |
| 759 | | LEGACY_FLOPPY_OPTIONS_NAME(coco), |
| 760 | | NULL, |
| 761 | | NULL |
| 762 | | }; |
| 763 | | |
| 764 | | static const cococart_interface coco_cococart_interface = |
| 765 | | { |
| 766 | | DEVCB_LINE(coco_cart_w), |
| 767 | | DEVCB_LINE(coco_nmi_w), |
| 768 | | DEVCB_LINE(coco_halt_w) |
| 769 | | }; |
| 770 | | |
| 771 | | static const cococart_interface coco3_cococart_interface = |
| 772 | | { |
| 773 | | DEVCB_LINE(coco3_cart_w), |
| 774 | | DEVCB_LINE(coco_nmi_w), |
| 775 | | DEVCB_LINE(coco_halt_w) |
| 776 | | }; |
| 777 | | |
| 778 | | static SLOT_INTERFACE_START(dragon_cart) |
| 779 | | SLOT_INTERFACE("dragon_fdc", DRAGON_FDC) |
| 780 | | SLOT_INTERFACE("sdtandy_fdc", SDTANDY_FDC) |
| 781 | | SLOT_INTERFACE("pak", COCO_PAK) |
| 782 | | SLOT_INTERFACE_END |
| 783 | | |
| 784 | | static SLOT_INTERFACE_START(coco_cart) |
| 785 | | SLOT_INTERFACE("fdc", COCO_FDC) |
| 786 | | SLOT_INTERFACE("fdcv11", COCO_FDC_V11) |
| 787 | | SLOT_INTERFACE("cp400_fdc", CP400_FDC) |
| 788 | | SLOT_INTERFACE("rs232", COCO_232) |
| 789 | | SLOT_INTERFACE("orch90", COCO_ORCH90) |
| 790 | | SLOT_INTERFACE("banked_16k", COCO_PAK_BANKED) |
| 791 | | SLOT_INTERFACE("pak", COCO_PAK) |
| 792 | | SLOT_INTERFACE("multi", COCO_MULTIPAK) |
| 793 | | SLOT_INTERFACE_END |
| 794 | | |
| 795 | | static MACHINE_CONFIG_START( dragon32, coco_state ) |
| 796 | | /* basic machine hardware */ |
| 797 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 798 | | MCFG_CPU_PROGRAM_MAP(dragon_map) |
| 799 | | |
| 800 | | MCFG_MACHINE_START( dragon32 ) |
| 801 | | |
| 802 | | /* video hardware */ |
| 803 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 804 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 805 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 806 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 807 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 808 | | MCFG_SCREEN_UPDATE(m6847) |
| 809 | | |
| 810 | | MCFG_VIDEO_START(dragon) |
| 811 | | |
| 812 | | /* sound hardware */ |
| 813 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 814 | | |
| 815 | | /* printer */ |
| 816 | | MCFG_PRINTER_ADD("printer") |
| 817 | | |
| 818 | | /* snapshot/quickload */ |
| 819 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 820 | | |
| 821 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 822 | | |
| 823 | | MCFG_PIA6821_ADD( "pia_0", dragon32_pia_intf_0 ) |
| 824 | | MCFG_PIA6821_ADD( "pia_1", dragon32_pia_intf_1 ) |
| 825 | | |
| 826 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 827 | | |
| 828 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, dragon_cart, "dragon_fdc", NULL) |
| 829 | | |
| 830 | | /* internal ram */ |
| 831 | | MCFG_RAM_ADD(RAM_TAG) |
| 832 | | MCFG_RAM_DEFAULT_SIZE("32K") |
| 833 | | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 834 | | |
| 835 | | /* Software lists */ |
| 836 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 837 | | MACHINE_CONFIG_END |
| 838 | | |
| 839 | | static MACHINE_CONFIG_START( dragon64, coco_state ) |
| 840 | | /* basic machine hardware */ |
| 841 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 842 | | MCFG_CPU_PROGRAM_MAP(d64_map) |
| 843 | | |
| 844 | | MCFG_MACHINE_START( dragon64 ) |
| 845 | | |
| 846 | | /* video hardware */ |
| 847 | | MCFG_VIDEO_START(dragon) |
| 848 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 849 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 850 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 851 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 852 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 853 | | MCFG_SCREEN_UPDATE(m6847) |
| 854 | | |
| 855 | | /* sound hardware */ |
| 856 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 857 | | |
| 858 | | /* printer */ |
| 859 | | MCFG_PRINTER_ADD("printer") |
| 860 | | |
| 861 | | /* snapshot/quickload */ |
| 862 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 863 | | |
| 864 | | /* cassette */ |
| 865 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 866 | | |
| 867 | | /* acia */ |
| 868 | | MCFG_ACIA6551_ADD("acia") |
| 869 | | |
| 870 | | MCFG_PIA6821_ADD( "pia_0", dragon64_pia_intf_0 ) |
| 871 | | MCFG_PIA6821_ADD( "pia_1", dragon64_pia_intf_1 ) |
| 872 | | |
| 873 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 874 | | |
| 875 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, dragon_cart, "dragon_fdc", NULL) |
| 876 | | |
| 877 | | /* internal ram */ |
| 878 | | MCFG_RAM_ADD(RAM_TAG) |
| 879 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 880 | | |
| 881 | | /* Software lists */ |
| 882 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 883 | | MACHINE_CONFIG_END |
| 884 | | |
| 885 | | static MACHINE_CONFIG_START( d64plus, coco_state ) |
| 886 | | /* basic machine hardware */ |
| 887 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 888 | | MCFG_CPU_PROGRAM_MAP(d64_plus_map) |
| 889 | | |
| 890 | | MCFG_MACHINE_START( dragon64 ) |
| 891 | | |
| 892 | | /* video hardware */ |
| 893 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 894 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 895 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 896 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 897 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 898 | | MCFG_SCREEN_UPDATE(m6847) |
| 899 | | |
| 900 | | MCFG_VIDEO_START(dragon) |
| 901 | | |
| 902 | | /* sound hardware */ |
| 903 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 904 | | |
| 905 | | /* printer */ |
| 906 | | MCFG_PRINTER_ADD("printer") |
| 907 | | |
| 908 | | /* snapshot/quickload */ |
| 909 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 910 | | |
| 911 | | /* cassette */ |
| 912 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 913 | | |
| 914 | | /* acia */ |
| 915 | | MCFG_ACIA6551_ADD("acia") |
| 916 | | |
| 917 | | MCFG_PIA6821_ADD( "pia_0", dragon64_pia_intf_0 ) |
| 918 | | MCFG_PIA6821_ADD( "pia_1", dragon64_pia_intf_1 ) |
| 919 | | |
| 920 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 921 | | |
| 922 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, dragon_cart, "dragon_fdc", NULL) |
| 923 | | |
| 924 | | /* internal ram */ |
| 925 | | MCFG_RAM_ADD(RAM_TAG) |
| 926 | | MCFG_RAM_DEFAULT_SIZE("128K") |
| 927 | | |
| 928 | | /* Software lists */ |
| 929 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 930 | | MACHINE_CONFIG_END |
| 931 | | |
| 932 | | static MACHINE_CONFIG_START( dgnalpha, coco_state ) |
| 933 | | /* basic machine hardware */ |
| 934 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 935 | | MCFG_CPU_PROGRAM_MAP(dgnalpha_map) |
| 936 | | |
| 937 | | MCFG_MACHINE_START( dgnalpha ) |
| 938 | | MCFG_MACHINE_RESET( dgnalpha ) |
| 939 | | |
| 940 | | /* video hardware */ |
| 941 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 942 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 943 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 944 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 945 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 946 | | MCFG_SCREEN_UPDATE(m6847) |
| 947 | | |
| 948 | | MCFG_VIDEO_START(dragon) |
| 949 | | |
| 950 | | /* sound hardware */ |
| 951 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 952 | | MCFG_SOUND_ADD("ay8912", AY8912, 1000000) |
| 953 | | MCFG_SOUND_CONFIG(ay8912_interface) |
| 954 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 955 | | |
| 956 | | /* onboard fdc */ |
| 957 | | MCFG_WD2797_ADD("wd2797", dgnalpha_wd17xx_interface) |
| 958 | | |
| 959 | | /* printer */ |
| 960 | | MCFG_PRINTER_ADD("printer") |
| 961 | | |
| 962 | | /* snapshot/quickload */ |
| 963 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 964 | | |
| 965 | | /* cassette */ |
| 966 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 967 | | |
| 968 | | /* acia */ |
| 969 | | MCFG_ACIA6551_ADD("acia") |
| 970 | | |
| 971 | | MCFG_PIA6821_ADD( "pia_0", dgnalpha_pia_intf_0 ) |
| 972 | | MCFG_PIA6821_ADD( "pia_1", dgnalpha_pia_intf_1 ) |
| 973 | | MCFG_PIA6821_ADD( "pia_2", dgnalpha_pia_intf_2 ) |
| 974 | | |
| 975 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 976 | | |
| 977 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, dragon_cart, NULL, NULL) |
| 978 | | |
| 979 | | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface) |
| 980 | | |
| 981 | | /* internal ram */ |
| 982 | | MCFG_RAM_ADD(RAM_TAG) |
| 983 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 984 | | |
| 985 | | /* Software lists */ |
| 986 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 987 | | MACHINE_CONFIG_END |
| 988 | | |
| 989 | | static MACHINE_CONFIG_START( tanodr64, coco_state ) |
| 990 | | /* basic machine hardware */ |
| 991 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 992 | | MCFG_CPU_PROGRAM_MAP(d64_map) |
| 993 | | |
| 994 | | MCFG_MACHINE_START( tanodr64 ) |
| 995 | | |
| 996 | | /* video hardware */ |
| 997 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 998 | | MCFG_SCREEN_REFRESH_RATE(COCO_FRAMES_PER_SECOND) /* Tano Dragon 64 is NTSC */ |
| 999 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1000 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 1001 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 1002 | | MCFG_SCREEN_UPDATE(m6847) |
| 1003 | | |
| 1004 | | MCFG_VIDEO_START(dragon) |
| 1005 | | |
| 1006 | | /* sound hardware */ |
| 1007 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 1008 | | |
| 1009 | | /* printer */ |
| 1010 | | MCFG_PRINTER_ADD("printer") |
| 1011 | | |
| 1012 | | /* snapshot/quickload */ |
| 1013 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 1014 | | |
| 1015 | | /* cassette */ |
| 1016 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 1017 | | |
| 1018 | | /* acia */ |
| 1019 | | MCFG_ACIA6551_ADD("acia") |
| 1020 | | |
| 1021 | | MCFG_PIA6821_ADD( "pia_0", dragon64_pia_intf_0 ) |
| 1022 | | MCFG_PIA6821_ADD( "pia_1", dragon64_pia_intf_1 ) |
| 1023 | | |
| 1024 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 1025 | | |
| 1026 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, dragon_cart, "sdtandy_fdc", NULL) |
| 1027 | | |
| 1028 | | /* internal ram */ |
| 1029 | | MCFG_RAM_ADD(RAM_TAG) |
| 1030 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1031 | | |
| 1032 | | /* Software lists */ |
| 1033 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 1034 | | MACHINE_CONFIG_END |
| 1035 | | |
| 1036 | | static MACHINE_CONFIG_START( coco, coco_state ) |
| 1037 | | /* basic machine hardware */ |
| 1038 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 1039 | | MCFG_CPU_PROGRAM_MAP(coco_map) |
| 1040 | | |
| 1041 | | MCFG_MACHINE_START( coco ) |
| 1042 | | |
| 1043 | | /* video hardware */ |
| 1044 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 1045 | | MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND) |
| 1046 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1047 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 1048 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 1049 | | MCFG_SCREEN_UPDATE(m6847) |
| 1050 | | |
| 1051 | | MCFG_VIDEO_START(coco) |
| 1052 | | |
| 1053 | | /* sound hardware */ |
| 1054 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 1055 | | |
| 1056 | | /* bitbanger/printer */ |
| 1057 | | MCFG_BITBANGER_ADD("bitbanger", coco_bitbanger_config) |
| 1058 | | |
| 1059 | | /* snapshot/quickload */ |
| 1060 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 1061 | | MCFG_QUICKLOAD_ADD("quickload", coco, "bin", 0.5) |
| 1062 | | |
| 1063 | | /* cassette */ |
| 1064 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 1065 | | |
| 1066 | | MCFG_PIA6821_ADD( "pia_0", coco_pia_intf_0 ) |
| 1067 | | MCFG_PIA6821_ADD( "pia_1", coco_pia_intf_1 ) |
| 1068 | | |
| 1069 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 1070 | | |
| 1071 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, coco_cart, "pak", NULL) |
| 1072 | | |
| 1073 | | /* internal ram */ |
| 1074 | | MCFG_RAM_ADD(RAM_TAG) |
| 1075 | | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1076 | | MCFG_RAM_EXTRA_OPTIONS("4K,32K,64K") |
| 1077 | | |
| 1078 | | /* Software lists */ |
| 1079 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 1080 | | MACHINE_CONFIG_END |
| 1081 | | |
| 1082 | | static MACHINE_CONFIG_START( coco2, coco_state ) |
| 1083 | | /* basic machine hardware */ |
| 1084 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 1085 | | MCFG_CPU_PROGRAM_MAP(coco_map) |
| 1086 | | |
| 1087 | | MCFG_MACHINE_START( coco2 ) |
| 1088 | | |
| 1089 | | /* video hardware */ |
| 1090 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 1091 | | MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND) |
| 1092 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1093 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 1094 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 1095 | | MCFG_SCREEN_UPDATE(m6847) |
| 1096 | | |
| 1097 | | MCFG_VIDEO_START(coco) |
| 1098 | | |
| 1099 | | /* sound hardware */ |
| 1100 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 1101 | | |
| 1102 | | /* bitbanger/printer */ |
| 1103 | | MCFG_BITBANGER_ADD("bitbanger", coco_bitbanger_config) |
| 1104 | | |
| 1105 | | /* snapshot/quickload */ |
| 1106 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 1107 | | MCFG_QUICKLOAD_ADD("quickload", coco, "bin", 0.5) |
| 1108 | | |
| 1109 | | /* cassette */ |
| 1110 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 1111 | | |
| 1112 | | MCFG_PIA6821_ADD( "pia_0", coco2_pia_intf_0 ) |
| 1113 | | MCFG_PIA6821_ADD( "pia_1", coco2_pia_intf_1 ) |
| 1114 | | |
| 1115 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 1116 | | |
| 1117 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, coco_cart, "fdcv11", NULL) |
| 1118 | | |
| 1119 | | /* internal ram */ |
| 1120 | | MCFG_RAM_ADD(RAM_TAG) |
| 1121 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1122 | | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 1123 | | |
| 1124 | | /* Software lists */ |
| 1125 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 1126 | | MACHINE_CONFIG_END |
| 1127 | | |
| 1128 | | static MACHINE_CONFIG_START( coco2b, coco_state ) |
| 1129 | | /* basic machine hardware */ |
| 1130 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 1131 | | MCFG_CPU_PROGRAM_MAP(coco_map) |
| 1132 | | |
| 1133 | | MCFG_MACHINE_START( coco2 ) |
| 1134 | | |
| 1135 | | /* video hardware */ |
| 1136 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 1137 | | MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND) |
| 1138 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1139 | | MCFG_SCREEN_SIZE(320, 25+192+26) |
| 1140 | | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 1141 | | MCFG_SCREEN_UPDATE(m6847) |
| 1142 | | |
| 1143 | | MCFG_VIDEO_START(coco2b) |
| 1144 | | |
| 1145 | | /* sound hardware */ |
| 1146 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 1147 | | |
| 1148 | | /* bitbanger/printer */ |
| 1149 | | MCFG_BITBANGER_ADD("bitbanger", coco_bitbanger_config) |
| 1150 | | |
| 1151 | | /* snapshot/quickload */ |
| 1152 | | MCFG_SNAPSHOT_ADD("snapshot", coco_pak, "pak", 0) |
| 1153 | | MCFG_QUICKLOAD_ADD("quickload", coco, "bin", 0.5) |
| 1154 | | |
| 1155 | | /* cassette */ |
| 1156 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 1157 | | |
| 1158 | | MCFG_PIA6821_ADD( "pia_0", coco2_pia_intf_0 ) |
| 1159 | | MCFG_PIA6821_ADD( "pia_1", coco2_pia_intf_1 ) |
| 1160 | | |
| 1161 | | MCFG_SAM6883_ADD("sam", coco_sam_intf) |
| 1162 | | |
| 1163 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, coco_cart, "fdcv11", NULL) |
| 1164 | | |
| 1165 | | /* internal ram */ |
| 1166 | | MCFG_RAM_ADD(RAM_TAG) |
| 1167 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1168 | | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 1169 | | |
| 1170 | | /* Software lists */ |
| 1171 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 1172 | | MACHINE_CONFIG_END |
| 1173 | | |
| 1174 | | static MACHINE_CONFIG_START( coco3, coco3_state ) |
| 1175 | | /* basic machine hardware */ |
| 1176 | | MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4) /* 0,894886 MHz */ |
| 1177 | | MCFG_CPU_PROGRAM_MAP(coco3_map) |
| 1178 | | |
| 1179 | | MCFG_MACHINE_START( coco3 ) |
| 1180 | | MCFG_MACHINE_RESET( coco3 ) |
| 1181 | | |
| 1182 | | /* video hardware */ |
| 1183 | | MCFG_VIDEO_START(coco3) |
| 1184 | | MCFG_DEFAULT_LAYOUT(layout_coco3) |
| 1185 | | |
| 1186 | | MCFG_SCREEN_ADD("composite", RASTER) |
| 1187 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1188 | | MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND) |
| 1189 | | MCFG_SCREEN_SIZE(640, 25+192+26) |
| 1190 | | MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239) |
| 1191 | | MCFG_SCREEN_UPDATE(coco3) |
| 1192 | | |
| 1193 | | MCFG_SCREEN_ADD("rgb", RASTER) |
| 1194 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1195 | | MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND) |
| 1196 | | MCFG_SCREEN_SIZE(640, 25+192+26) |
| 1197 | | MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239) |
| 1198 | | MCFG_SCREEN_UPDATE(coco3) |
| 1199 | | |
| 1200 | | MCFG_PIA6821_ADD( "pia_0", coco3_pia_intf_0 ) |
| 1201 | | MCFG_PIA6821_ADD( "pia_1", coco3_pia_intf_1 ) |
| 1202 | | |
| 1203 | | /* sound hardware */ |
| 1204 | | MCFG_FRAGMENT_ADD( coco_sound ) |
| 1205 | | |
| 1206 | | /* bitbanger/printer */ |
| 1207 | | MCFG_BITBANGER_ADD("bitbanger", coco3_bitbanger_config) |
| 1208 | | |
| 1209 | | /* snapshot/quickload */ |
| 1210 | | MCFG_SNAPSHOT_ADD("snapshot", coco3_pak, "pak", 0) |
| 1211 | | MCFG_QUICKLOAD_ADD("quickload", coco, "bin", 0.5) |
| 1212 | | |
| 1213 | | /* devices */ |
| 1214 | | MCFG_COCO_VHD_ADD("vhd") |
| 1215 | | |
| 1216 | | /* cassette */ |
| 1217 | | MCFG_CASSETTE_ADD( CASSETTE_TAG, coco_cassette_interface ) |
| 1218 | | |
| 1219 | | MCFG_SAM6883_GIME_ADD("sam", coco3_sam_intf) |
| 1220 | | |
| 1221 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco3_cococart_interface, coco_cart, "fdcv11", NULL) |
| 1222 | | |
| 1223 | | /* internal ram */ |
| 1224 | | MCFG_RAM_ADD(RAM_TAG) |
| 1225 | | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1226 | | MCFG_RAM_EXTRA_OPTIONS("128K,2M,8M") |
| 1227 | | |
| 1228 | | /* Software lists */ |
| 1229 | | MCFG_SOFTWARE_LIST_ADD("cart_list","coco_cart") |
| 1230 | | MACHINE_CONFIG_END |
| 1231 | | |
| 1232 | | static MACHINE_CONFIG_DERIVED( coco3p, coco3 ) |
| 1233 | | |
| 1234 | | /* video hardware */ |
| 1235 | | MCFG_VIDEO_START(coco3p) |
| 1236 | | MCFG_SCREEN_MODIFY("composite") |
| 1237 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 1238 | | MCFG_SCREEN_UPDATE(coco3) |
| 1239 | | MCFG_SCREEN_MODIFY("rgb") |
| 1240 | | MCFG_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND) |
| 1241 | | MCFG_SCREEN_UPDATE(coco3) |
| 1242 | | MACHINE_CONFIG_END |
| 1243 | | |
| 1244 | | static MACHINE_CONFIG_DERIVED( coco3h, coco3 ) |
| 1245 | | MCFG_CPU_REPLACE( "maincpu", HD6309, COCO_CPU_SPEED_HZ * 4) |
| 1246 | | MCFG_CPU_PROGRAM_MAP(coco3_map) |
| 1247 | | MACHINE_CONFIG_END |
| 1248 | | |
| 1249 | | static MACHINE_CONFIG_DERIVED( cocoe, coco ) |
| 1250 | | MCFG_COCO_CARTRIDGE_REMOVE("ext") |
| 1251 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, coco_cart, "fdc", NULL) |
| 1252 | | /* internal ram */ |
| 1253 | | MCFG_RAM_MODIFY(RAM_TAG) |
| 1254 | | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1255 | | MCFG_RAM_EXTRA_OPTIONS("4K,16K,32K") |
| 1256 | | MACHINE_CONFIG_END |
| 1257 | | |
| 1258 | | static MACHINE_CONFIG_DERIVED( cp400, coco ) |
| 1259 | | MCFG_COCO_CARTRIDGE_REMOVE("ext") |
| 1260 | | MCFG_COCO_CARTRIDGE_ADD("ext", coco_cococart_interface, coco_cart, "cp400_fdc", NULL) |
| 1261 | | MACHINE_CONFIG_END |
| 1262 | | |
| 1263 | | /*************************************************************************** |
| 1264 | | |
| 1265 | | Game driver(s) |
| 1266 | | |
| 1267 | | ***************************************************************************/ |
| 1268 | | |
| 1269 | | ROM_START(dragon32) |
| 1270 | | ROM_REGION(0xC000, "maincpu",0) |
| 1271 | | ROM_LOAD("d32.rom", 0x0000, 0x4000, CRC(e3879310) SHA1(f2dab125673e653995a83bf6b793e3390ec7f65a)) |
| 1272 | | ROM_END |
| 1273 | | |
| 1274 | | ROM_START(dragon64) |
| 1275 | | ROM_REGION(0x10000,"maincpu",0) |
| 1276 | | ROM_LOAD("d64_1.rom", 0x0000, 0x4000, CRC(60a4634c) SHA1(f119506eaa3b4b70b9aa0dd83761e8cbe043d042)) |
| 1277 | | ROM_LOAD("d64_2.rom", 0x8000, 0x4000, CRC(17893a42) SHA1(e3c8986bb1d44269c4587b04f1ca27a70b0aaa2e)) |
| 1278 | | ROM_END |
| 1279 | | |
| 1280 | | ROM_START(d64plus) |
| 1281 | | ROM_REGION(0x10000,"maincpu",0) |
| 1282 | | ROM_LOAD("d64_1.rom", 0x0000, 0x4000, CRC(60a4634c) SHA1(f119506eaa3b4b70b9aa0dd83761e8cbe043d042)) |
| 1283 | | ROM_LOAD("d64_2.rom", 0x8000, 0x4000, CRC(17893a42) SHA1(e3c8986bb1d44269c4587b04f1ca27a70b0aaa2e)) |
| 1284 | | ROM_END |
| 1285 | | |
| 1286 | | ROM_START(tanodr64) |
| 1287 | | ROM_REGION(0x10000,"maincpu",0) |
| 1288 | | ROM_LOAD("d64_1.rom", 0x0000, 0x4000, CRC(60a4634c) SHA1(f119506eaa3b4b70b9aa0dd83761e8cbe043d042)) |
| 1289 | | ROM_LOAD("d64_2.rom", 0x8000, 0x4000, CRC(17893a42) SHA1(e3c8986bb1d44269c4587b04f1ca27a70b0aaa2e)) |
| 1290 | | ROM_END |
| 1291 | | |
| 1292 | | ROM_START(dgnalpha) |
| 1293 | | ROM_REGION(0xC000,"maincpu",1) |
| 1294 | | ROM_LOAD("alpha_bt.rom", 0x2000, 0x2000, CRC(c3dab585) SHA1(4a5851aa66eb426e9bb0bba196f1e02d48156068)) |
| 1295 | | ROM_LOAD("alpha_ba.rom", 0x8000, 0x4000, CRC(84f68bf9) SHA1(1983b4fb398e3dd9668d424c666c5a0b3f1e2b69)) |
| 1296 | | ROM_END |
| 1297 | | |
| 1298 | | ROM_START(coco) |
| 1299 | | ROM_REGION(0x8000,"maincpu",0) |
| 1300 | | ROM_LOAD("bas10.rom", 0x2000, 0x2000, CRC(00b50aaa) SHA1(1f08455cd48ce6a06132aea15c4778f264e19539)) |
| 1301 | | ROM_END |
| 1302 | | |
| 1303 | | ROM_START(cocoe) |
| 1304 | | ROM_REGION(0x8000,"maincpu",0) |
| 1305 | | ROM_LOAD("bas11.rom", 0x2000, 0x2000, CRC(6270955a) SHA1(cecb7c24ff1e0ab5836e4a7a8eb1b8e01f1fded3)) |
| 1306 | | ROM_LOAD("extbas10.rom", 0x0000, 0x2000, CRC(6111a086) SHA1(8aa58f2eb3e8bcfd5470e3e35e2b359e9a72848e)) |
| 1307 | | ROM_END |
| 1308 | | |
| 1309 | | ROM_START(coco2) |
| 1310 | | ROM_REGION(0x8000,"maincpu",0) |
| 1311 | | ROM_LOAD("bas12.rom", 0x2000, 0x2000, CRC(54368805) SHA1(0f14dc46c647510eb0b7bd3f53e33da07907d04f)) |
| 1312 | | ROM_LOAD("extbas11.rom", 0x0000, 0x2000, CRC(a82a6254) SHA1(ad927fb4f30746d820cb8b860ebb585e7f095dea)) |
| 1313 | | ROM_END |
| 1314 | | |
| 1315 | | ROM_START(coco2b) |
| 1316 | | ROM_REGION(0x8000,"maincpu",0) |
| 1317 | | ROM_LOAD("bas13.rom", 0x2000, 0x2000, CRC(d8f4d15e) SHA1(28b92bebe35fa4f026a084416d6ea3b1552b63d3)) |
| 1318 | | ROM_LOAD("extbas11.rom", 0x0000, 0x2000, CRC(a82a6254) SHA1(ad927fb4f30746d820cb8b860ebb585e7f095dea)) |
| 1319 | | ROM_END |
| 1320 | | |
| 1321 | | ROM_START(coco3) |
| 1322 | | ROM_REGION(0x8000,"maincpu",0) |
| 1323 | | ROM_LOAD("coco3.rom", 0x0000, 0x8000, CRC(b4c88d6c) SHA1(e0d82953fb6fd03768604933df1ce8bc51fc427d)) |
| 1324 | | ROM_END |
| 1325 | | |
| 1326 | | ROM_START(coco3p) |
| 1327 | | ROM_REGION(0x8000,"maincpu",0) |
| 1328 | | ROM_LOAD("coco3p.rom", 0x0000, 0x8000, CRC(ff050d80) SHA1(631e383068b1f52a8f419f4114b69501b21cf379)) |
| 1329 | | ROM_END |
| 1330 | | |
| 1331 | | ROM_START(cp400) |
| 1332 | | ROM_REGION(0x8000,"maincpu",0) |
| 1333 | | ROM_LOAD("cp400bas.rom", 0x0000, 0x4000, CRC(878396a5) SHA1(292c545da3c77978e043b00a3dbc317201d18c3b)) |
| 1334 | | ROM_END |
| 1335 | | |
| 1336 | | #define rom_coco3h rom_coco3 |
| 1337 | | |
| 1338 | | /* I have split up coco and cocoe, as the basic rom in the coco, cannot */ |
| 1339 | | /* use 64K rams, and will boot with 4k, if this is selected, so I have */ |
| 1340 | | /* split these to avoid confusion -- PHS */ |
| 1341 | | |
| 1342 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 1343 | | COMP( 1980, coco, 0, 0, coco, coco, 0, "Tandy Radio Shack", "Color Computer", 0) |
| 1344 | | COMP( 1981, cocoe, coco, 0, cocoe, coco, 0, "Tandy Radio Shack", "Color Computer (Extended BASIC 1.0)", 0) |
| 1345 | | COMP( 1983, coco2, coco, 0, coco2, coco, 0, "Tandy Radio Shack", "Color Computer 2", 0) |
| 1346 | | COMP( 1985?, coco2b, coco, 0, coco2b, coco, 0, "Tandy Radio Shack", "Color Computer 2B", 0) |
| 1347 | | COMP( 1986, coco3, coco, 0, coco3, coco3, 0, "Tandy Radio Shack", "Color Computer 3 (NTSC)", 0) |
| 1348 | | COMP( 1986, coco3p, coco, 0, coco3p, coco3, 0, "Tandy Radio Shack", "Color Computer 3 (PAL)", 0) |
| 1349 | | COMP( 19??, coco3h, coco, 0, coco3h, coco3, 0, "Tandy Radio Shack", "Color Computer 3 (NTSC; HD6309)", GAME_UNOFFICIAL) |
| 1350 | | COMP( 1982, dragon32, coco, 0, dragon32, dragon32, 0, "Dragon Data Ltd", "Dragon 32", 0) |
| 1351 | | COMP( 1983, dragon64, coco, 0, dragon64, dragon32, 0, "Dragon Data Ltd", "Dragon 64", 0) |
| 1352 | | COMP( 1983, d64plus, coco, 0, d64plus, dragon32, 0, "Dragon Data Ltd", "Dragon 64 Plus", 0) |
| 1353 | | COMP( 1983, tanodr64, coco, 0, tanodr64, dragon32, 0, "Dragon Data Ltd / Tano Ltd", "Tano Dragon 64 (NTSC)", 0) |
| 1354 | | COMP( 1984, dgnalpha, coco, 0, dgnalpha, dragon32, 0, "Dragon Data Ltd", "Dragon Alpha Prototype", 0) |
| 1355 | | COMP( 1984, cp400, coco, 0, cp400, coco, 0, "Prologica", "CP400", 0) |