src/mess/video/apple2.c
| r1765 | r1766 | |
| 96 | 96 | -------------------------------------------------*/ |
| 97 | 97 | |
| 98 | 98 | INLINE void apple2_plot_text_character(mame_bitmap *bitmap, int xpos, int ypos, int xscale, UINT32 code, |
| 99 | | const UINT8 *textgfx_data, UINT32 textgfx_datalen, UINT32 my_a2, int flip) |
| 99 | const UINT8 *textgfx_data, UINT32 textgfx_datalen, UINT32 my_a2) |
| 100 | 100 | { |
| 101 | 101 | int x, y, i; |
| 102 | 102 | int fg = fgcolor; |
| r1765 | r1766 | |
| 125 | 125 | { |
| 126 | 126 | for (x = 0; x < 7; x++) |
| 127 | 127 | { |
| 128 | | if (flip) |
| 129 | | color = (chardata[y] & (1 << (6 - x))) ? bg : fg; |
| 130 | | else |
| 131 | | color = (chardata[y] & (1 << x)) ? bg : fg; |
| 128 | color = (chardata[y] & (1 << x)) ? bg : fg; |
| 132 | 129 | |
| 133 | 130 | for (i = 0; i < xscale; i++) |
| 134 | 131 | { |
| r1765 | r1766 | |
| 153 | 150 | const UINT8 *textgfx_data = memory_region(REGION_GFX1); |
| 154 | 151 | UINT32 textgfx_datalen = memory_region_length(REGION_GFX1); |
| 155 | 152 | UINT32 my_a2 = effective_a2(); |
| 156 | | int flip = !strcmp(machine->gamedrv->name, "apple2") || !strcmp(machine->gamedrv->name, "apple2p"); |
| 157 | 153 | |
| 158 | 154 | /* perform adjustments */ |
| 159 | 155 | adjust_begin_and_end_row(cliprect, &beginrow, &endrow); |
| r1765 | r1766 | |
| 168 | 164 | if (my_a2 & VAR_80COL) |
| 169 | 165 | { |
| 170 | 166 | apple2_plot_text_character(bitmap, col * 14 + 0, row, 1, a2_videoram[address + 0x10000], |
| 171 | | textgfx_data, textgfx_datalen, my_a2, flip); |
| 167 | textgfx_data, textgfx_datalen, my_a2); |
| 172 | 168 | apple2_plot_text_character(bitmap, col * 14 + 7, row, 1, a2_videoram[address + 0x00000], |
| 173 | | textgfx_data, textgfx_datalen, my_a2, flip); |
| 169 | textgfx_data, textgfx_datalen, my_a2); |
| 174 | 170 | } |
| 175 | 171 | else |
| 176 | 172 | { |
| 177 | 173 | apple2_plot_text_character(bitmap, col * 14, row, 2, a2_videoram[address], |
| 178 | | textgfx_data, textgfx_datalen, my_a2, flip); |
| 174 | textgfx_data, textgfx_datalen, my_a2); |
| 179 | 175 | } |
| 180 | 176 | } |
| 181 | 177 | } |
| r1765 | r1766 | |
| 382 | 378 | VIDEO CORE |
| 383 | 379 | ***************************************************************************/ |
| 384 | 380 | |
| 385 | | void apple2_video_start(const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo) |
| 381 | void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo) |
| 386 | 382 | { |
| 387 | 383 | int i, j; |
| 388 | 384 | UINT16 c; |
| r1765 | r1766 | |
| 439 | 435 | } |
| 440 | 436 | } |
| 441 | 437 | |
| 438 | /* do we need to flip the gfx? */ |
| 439 | if (!strcmp(machine->gamedrv->name, "apple2") |
| 440 | || !strcmp(machine->gamedrv->name, "apple2p") |
| 441 | || !strcmp(machine->gamedrv->name, "apple2jp")) |
| 442 | { |
| 443 | for (i = 0; i < memory_region_length(REGION_GFX1); i++) |
| 444 | { |
| 445 | apple2_font[i] = BITSWAP8(apple2_font[i], 7, 0, 1, 2, 3, 4, 5, 6); |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | |
| 442 | 450 | /* build double hires artifact map */ |
| 443 | 451 | for (i = 0; i < 16; i++) |
| 444 | 452 | { |
| r1765 | r1766 | |
| 453 | 461 | |
| 454 | 462 | VIDEO_START( apple2 ) |
| 455 | 463 | { |
| 456 | | apple2_video_start(mess_ram, mess_ram_size, VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 4); |
| 464 | apple2_video_start(machine, mess_ram, mess_ram_size, VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 4); |
| 457 | 465 | |
| 458 | 466 | /* hack to fix the colors on apple2/apple2p */ |
| 459 | 467 | fgcolor = 0; |
| r1765 | r1766 | |
| 463 | 471 | |
| 464 | 472 | VIDEO_START( apple2p ) |
| 465 | 473 | { |
| 466 | | apple2_video_start(mess_ram, mess_ram_size, VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 8); |
| 474 | apple2_video_start(machine, mess_ram, mess_ram_size, VAR_80COL | VAR_ALTCHARSET | VAR_DHIRES, 8); |
| 467 | 475 | |
| 468 | 476 | /* hack to fix the colors on apple2/apple2p */ |
| 469 | 477 | fgcolor = 0; |
| r1765 | r1766 | |
| 473 | 481 | |
| 474 | 482 | VIDEO_START( apple2e ) |
| 475 | 483 | { |
| 476 | | apple2_video_start(mess_ram, mess_ram_size, 0, 8); |
| 484 | apple2_video_start(machine, mess_ram, mess_ram_size, 0, 8); |
| 477 | 485 | } |
| 478 | 486 | |
| 479 | 487 | |