Previous 15994 Revisions Next

r1766 Tuesday 26th February, 2008 at 12:59:50 UTC by Nathan Woods
[APPLE2] Optimized flipping and fixed apple2jp
[src/mess/includes]apple2.h
[src/mess/video]apple2.c apple2gs.c

src/mess/includes/apple2.h
r1765r1766
8484
8585/*----------- defined in video/apple2.c -----------*/
8686
87void apple2_video_start(const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo);
87void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo);
8888VIDEO_START( apple2 );
8989VIDEO_START( apple2p );
9090VIDEO_START( apple2e );
src/mess/video/apple2gs.c
r1765r1766
1818VIDEO_START( apple2gs )
1919{
2020   apple2gs_bordercolor = 0;
21   apple2_video_start(apple2gs_slowmem, 0x20000, 0, 8);
21   apple2_video_start(machine, apple2gs_slowmem, 0x20000, 0, 8);
2222   apple2gs_legacy_gfx = auto_bitmap_alloc(560, 192, BITMAP_FORMAT_INDEXED16);
2323}
2424
src/mess/video/apple2.c
r1765r1766
9696-------------------------------------------------*/
9797
9898INLINE 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)
100100{
101101   int x, y, i;
102102   int fg = fgcolor;
r1765r1766
125125   {
126126      for (x = 0; x < 7; x++)
127127      {
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;
132129
133130         for (i = 0; i < xscale; i++)
134131         {
r1765r1766
153150   const UINT8 *textgfx_data = memory_region(REGION_GFX1);
154151   UINT32 textgfx_datalen = memory_region_length(REGION_GFX1);
155152   UINT32 my_a2 = effective_a2();
156   int flip = !strcmp(machine->gamedrv->name, "apple2") || !strcmp(machine->gamedrv->name, "apple2p");
157153
158154   /* perform adjustments */
159155   adjust_begin_and_end_row(cliprect, &beginrow, &endrow);
r1765r1766
168164         if (my_a2 & VAR_80COL)
169165         {
170166            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);
172168            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);
174170         }
175171         else
176172         {
177173            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);
179175         }
180176      }
181177   }
r1765r1766
382378   VIDEO CORE
383379***************************************************************************/
384380
385void apple2_video_start(const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo)
381void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo)
386382{
387383   int i, j;
388384   UINT16 c;
r1765r1766
439435      }
440436   }
441437
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
442450   /* build double hires artifact map */
443451   for (i = 0; i < 16; i++)
444452   {
r1765r1766
453461
454462VIDEO_START( apple2 )
455463{
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);
457465
458466   /* hack to fix the colors on apple2/apple2p */
459467   fgcolor = 0;
r1765r1766
463471
464472VIDEO_START( apple2p )
465473{
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);
467475
468476   /* hack to fix the colors on apple2/apple2p */
469477   fgcolor = 0;
r1765r1766
473481
474482VIDEO_START( apple2e )
475483{
476   apple2_video_start(mess_ram, mess_ram_size, 0, 8);
484   apple2_video_start(machine, mess_ram, mess_ram_size, 0, 8);
477485}
478486
479487

Previous 15994 Revisions Next


© 1998-2018 The MESS Team