Previous 199869 Revisions Next

r22874 Friday 17th May, 2013 at 18:18:58 UTC by Phil Bennett
05194: buggyboy, tx1: Screen 1 and 2 freezes [Phil Bennett]

Also did some cleanup of the video code -nw-
[src/mame/includes]tx1.h
[src/mame/video]tx1.c

trunk/src/mame/video/tx1.c
r22873r22874
1111#include "includes/tx1.h"
1212
1313
14#define OBJ_FRAC    16
15
1416/*************************************
1517 *
1618 *  HD46505S-2 CRT Controller
r22873r22874
226228 *
227229 *************************************/
228230
229static void tx1_draw_char(running_machine &machine, UINT8 *bitmap)
231void tx1_state::tx1_draw_char(UINT8 *bitmap)
230232{
231   tx1_state *state = machine.driver_data<tx1_state>();
232   UINT16 *tx1_vram = state->m_vram;
233   UINT16 *tx1_vram = m_vram;
233234   INT32 x, y;
234235   UINT32 scroll_x;
235236   UINT8 *chars, *gfx2;
236237
237238   /* 2bpp characters */
238   chars = state->memregion("char_tiles")->base();
239   chars = memregion("char_tiles")->base();
239240   gfx2 = chars + 0x4000;
240241
241242   /* X scroll value is the last word in char RAM */
r22873r22874
253254      y_offs = y;
254255
255256      if ((y_offs >= 64) && (y_offs < 128))
256         x_offs = state->m_vregs.slock ? scroll_x : 0;
257         x_offs = m_vregs.slock ? scroll_x : 0;
257258      else
258259         x_offs = 0;
259260
r22873r22874
314315   pix[NUM][3][0] = prom_a[0];         pix[NUM][3][1] = prom_b[0];         pix[NUM][3][2] = prom_c[0]; \
315316}
316317
317INLINE void tx1_draw_road_pixel(running_machine &machine, int screen, UINT8 *bmpaddr,
318                        UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
319                        UINT8 stl, UINT8 sld, UINT8 selb,
320                        UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr)
318void tx1_state::tx1_draw_road_pixel(int screen, UINT8 *bmpaddr,
319                           UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
320                           UINT8 stl, UINT8 sld, UINT8 selb,
321                           UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr)
321322{
322   tx1_state *state = machine.driver_data<tx1_state>();
323   vregs_t &tx1_vregs = state->m_vregs;
323   vregs_t &tx1_vregs = m_vregs;
324324   UINT8 a0 = BIT(apix[0], pixnuma);
325325   UINT8 a1 = BIT(apix[1], pixnuma);
326326   UINT8 a2 = BIT(apix[2], pixnuma);
r22873r22874
394394}
395395
396396/* This could do with a tidy up and more comments... */
397static void tx1_draw_road(running_machine &machine, UINT8 *bitmap)
397void tx1_state::tx1_draw_road(UINT8 *bitmap)
398398{
399   tx1_state *state = machine.driver_data<tx1_state>();
400   UINT16 *tx1_rcram = state->m_rcram;
401   vregs_t &tx1_vregs = state->m_vregs;
399   UINT16 *tx1_rcram = m_rcram;
400   vregs_t &tx1_vregs = m_vregs;
402401   INT32   y;
403402   UINT32  rva9_8;
404403   UINT32  rva7;
r22873r22874
415414   UINT8   pix[2][4][3];
416415
417416   /* Road slice map ROMs */
418   const UINT8 *const gfx3 = state->memregion("gfx3")->base();
417   const UINT8 *const gfx3 = memregion("gfx3")->base();
419418   const UINT8 *const rom_a = gfx3;
420419   const UINT8 *const rom_b = gfx3 + 0x2000;
421420   const UINT8 *const rom_c = gfx3 + 0x4000;
422421
423422   /* Pixel data */
424   const UINT8 *const proms = state->memregion("proms")->base();
423   const UINT8 *const proms = memregion("proms")->base();
425424   const UINT8 *const prom_a = proms + 0x1100;
426425   const UINT8 *const prom_b = proms + 0x1300;
427426   const UINT8 *const prom_c = proms + 0x1500;
r22873r22874
764763            else
765764               b = 3;
766765
767            tx1_draw_road_pixel(machine, 0, bmpaddr,
766            tx1_draw_road_pixel(0, bmpaddr,
768767                     &pix[0][a][0], &pix[1][b][0],
769768                     pixnum0, pixnum1,
770769                     stl, sld, selb, bnkls, rorevls, ebls, rl, delrl);
r22873r22874
786785            else
787786               b = 3;
788787
789            tx1_draw_road_pixel(machine, 1, bmpaddr,
788            tx1_draw_road_pixel(1, bmpaddr,
790789                     &pix[0][a][0], &pix[1][b][0],
791790                     pixnum0, pixnum1,
792791                     stl, sld, selb, bnkcs, rorevcs, ebcs, rc, delrc);
r22873r22874
808807            else
809808               b = 3;
810809
811            tx1_draw_road_pixel(machine, 2, bmpaddr,
810            tx1_draw_road_pixel(2, bmpaddr,
812811                     &pix[0][a][0], &pix[1][b][0],
813812                     pixnum0, pixnum1,
814813                     stl, sld, selb, bnkrs, rorevrs, ebrs, rr, delrr);
r22873r22874
849848 *
850849 *************************************/
851850
852static void tx1_draw_objects(running_machine &machine, UINT8 *bitmap)
851void tx1_state::tx1_draw_objects(UINT8 *bitmap)
853852{
854   tx1_state *state = machine.driver_data<tx1_state>();
855   UINT16 *tx1_objram = state->m_objram;
856#define FRAC    16
853   UINT16 *tx1_objram = m_objram;
857854
858855   UINT32 offs;
859856
860857   /* The many lookup table ROMs */
861   const UINT8 *const ic48 = state->memregion("user3")->base();
858   const UINT8 *const ic48 = memregion("user3")->base();
862859   const UINT8 *const ic281 = ic48 + 0x2000;
863860
864   const UINT8 *const proms = state->memregion("proms")->base();
861   const UINT8 *const proms = memregion("proms")->base();
865862   const UINT8 *const ic190 = proms + 0xc00;
866863   const UINT8 *const ic162 = proms + 0xe00;
867864   const UINT8 *const ic25  = proms + 0x1000;
868865
869   const UINT8 *const ic106 = state->memregion("obj_map")->base();
866   const UINT8 *const ic106 = memregion("obj_map")->base();
870867   const UINT8 *const ic73  = ic106 + 0x4000;
871868
872   const UINT8 *const pixdata_rgn = state->memregion("obj_tiles")->base();
869   const UINT8 *const pixdata_rgn = memregion("obj_tiles")->base();
873870
874871   for (offs = 0x0; offs <= 0x300; offs += 8)
875872   {
r22873r22874
954951            rom_addr = (psa0_11 & ~0xff) << 2;
955952
956953            /* Prepare the x-scaling */
957            x_step = (128 << FRAC) / x_scale;
958            x_acc = (psa0_11 & 0xff) << (FRAC + 5);
954            x_step = (128 << OBJ_FRAC) / x_scale;
955            x_acc = (psa0_11 & 0xff) << (OBJ_FRAC + 5);
959956
960957#define TX1_MASK    0xfff
961958
r22873r22874
972969                  UINT32  ic281_addr;
973970                  UINT32  grom_addr;
974971                  UINT32  lut_data;
975                  UINT32  low_addr = ((x_acc >> (FRAC + 3)) & TX1_MASK);
972                  UINT32  low_addr = ((x_acc >> (OBJ_FRAC + 3)) & TX1_MASK);
976973
977974                  if (gxflip)
978975                  {
r22873r22874
10501047                  UINT8   pix;
10511048                  UINT8   bit;
10521049
1053                  bit = (x_acc >> FRAC) & 7;
1050                  bit = (x_acc >> OBJ_FRAC) & 7;
10541051
10551052                  if (xflip)
10561053                     bit ^= 7;
r22873r22874
10771074
10781075               /* Check if we've stepped into a new 8x8 tile */
10791076
1080               if ((((x_acc + x_step) >> (FRAC + 3)) & TX1_MASK) != ((x_acc >> (FRAC + 3)) & TX1_MASK))
1077               if ((((x_acc + x_step) >> (OBJ_FRAC + 3)) & TX1_MASK) != ((x_acc >> (OBJ_FRAC + 3)) & TX1_MASK))
10811078               {
10821079                  if (lasttile)
10831080                     break;
r22873r22874
11251122   {
11261123      /* /VSYNC: Update TZ113 */
11271124      m_vregs.slin_val += m_vregs.slin_inc;
1125
1126      m_needs_update = true;
11281127   }
11291128}
11301129
1131static void tx1_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, int screen)
1130void tx1_state::tx1_combine_layers(bitmap_ind16 &bitmap, int screen)
11321131{
1133   tx1_state *state = machine.driver_data<tx1_state>();
11341132   int x, y;
1135   UINT8 *chr_pal = state->memregion("proms")->base() + 0x900;
1133   UINT8 *chr_pal = memregion("proms")->base() + 0x900;
11361134
11371135   int x_offset = screen * 256;
11381136
r22873r22874
11421140
11431141      UINT32 bmp_offset = y * 768 + x_offset;
11441142
1145      UINT8 *chr_addr = state->m_chr_bmp + bmp_offset;
1146      UINT8 *rod_addr = state->m_rod_bmp + bmp_offset;
1147      UINT8 *obj_addr = state->m_obj_bmp + bmp_offset;
1143      UINT8 *chr_addr = m_chr_bmp + bmp_offset;
1144      UINT8 *rod_addr = m_rod_bmp + bmp_offset;
1145      UINT8 *obj_addr = m_obj_bmp + bmp_offset;
11481146
11491147      for (x = 0; x < 256; ++x)
11501148      {
r22873r22874
11791177   }
11801178}
11811179
1182UINT32 tx1_state::screen_update_tx1_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1180
1181void tx1_state::tx1_update_layers()
11831182{
11841183   memset(m_obj_bmp, 0, 768*240);
11851184
1186   tx1_draw_char(machine(), m_chr_bmp);
1187   tx1_draw_road(machine(), m_rod_bmp);
1188   tx1_draw_objects(machine(), m_obj_bmp);
1185   tx1_draw_char(m_chr_bmp);
1186   tx1_draw_road(m_rod_bmp);
1187   tx1_draw_objects(m_obj_bmp);
11891188
1190   tx1_combine_layers(machine(), bitmap, 0);
1189   m_needs_update = false;
1190}
1191
1192UINT32 tx1_state::screen_update_tx1_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1193{
1194   if (m_needs_update)
1195      tx1_update_layers();
1196
1197   tx1_combine_layers(bitmap, 0);
11911198   return 0;
11921199}
11931200
11941201UINT32 tx1_state::screen_update_tx1_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
11951202{
1196   tx1_combine_layers(machine(), bitmap, 1);
1203   if (m_needs_update)
1204      tx1_update_layers();
1205
1206   tx1_combine_layers(bitmap, 1);
11971207   return 0;
11981208}
11991209
12001210UINT32 tx1_state::screen_update_tx1_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
12011211{
1202   tx1_combine_layers(machine(), bitmap, 2);
1212   if (m_needs_update)
1213      tx1_update_layers();
1214
1215   tx1_combine_layers(bitmap, 2);
12031216   return 0;
12041217}
12051218
r22873r22874
12831296 *
12841297 *************************************/
12851298
1286static void buggyboy_draw_char(running_machine &machine, UINT8 *bitmap, int wide)
1299void tx1_state::buggyboy_draw_char(UINT8 *bitmap, bool wide)
12871300{
1288   tx1_state *state = machine.driver_data<tx1_state>();
1289   UINT16 *buggyboy_vram = state->m_vram;
1301   UINT16 *buggyboy_vram = m_vram;
12901302   INT32 x, y;
12911303   UINT32 scroll_x, scroll_y;
12921304   UINT8 *chars, *gfx2;
r22873r22874
12941306   UINT32 x_mask;
12951307
12961308   /* 2bpp characters */
1297   chars = state->memregion("char_tiles")->base();
1298   gfx2 = state->memregion("char_tiles")->base() + 0x4000;
1309   chars = memregion("char_tiles")->base();
1310   gfx2 = memregion("char_tiles")->base() + 0x4000;
12991311
13001312   /* X/Y scroll values are the last word in char RAM */
13011313   if (wide)
r22873r22874
14251437
14261438***************************************************************************/
14271439
1428static void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
1429                     UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3,
1430                     const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2)
1440void tx1_state::buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
1441                           UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3,
1442                           const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2)
14311443{
14321444   /* Counter Q10-7 are added to 384 */
14331445   UINT16 ls283_159 = (ls161 & 0x780) + 128 + (256 * screen);
r22873r22874
15081520      else                            \
15091521         hp##NUM = hp##NUM + 1;      \
15101522   }
1511static void buggyboy_draw_road(running_machine &machine, UINT8 *bitmap)
1523void tx1_state::buggyboy_draw_road(UINT8 *bitmap)
15121524{
1513   tx1_state *state = machine.driver_data<tx1_state>();
1514   UINT16 *buggyboy_rcram = state->m_rcram;
1515   vregs_t &vregs = state->m_vregs;
1525   UINT16 *buggyboy_rcram = m_rcram;
1526   vregs_t &vregs = m_vregs;
15161527   INT32 x;
15171528   UINT32 y;
15181529   UINT16 rva_offs;
r22873r22874
15271538   UINT32 rva20_6;
15281539
15291540   /* ROM/PROM lookup tables */
1530   const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
1531   const UINT8 *rom   = state->memregion("road")->base();
1541   const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500);
1542   const UINT8 *rom   = memregion("road")->base();
15321543   const UINT8 *prom0 = rom + 0x4000;
15331544   const UINT8 *prom1 = rom + 0x4200;
15341545   const UINT8 *prom2 = rom + 0x4400;
r22873r22874
21402151   }
21412152}
21422153
2143static void buggybjr_draw_road(running_machine &machine, UINT8 *bitmap, int wide)
2154void tx1_state::buggybjr_draw_road(UINT8 *bitmap)
21442155{
2145   tx1_state *state = machine.driver_data<tx1_state>();
2146   UINT16 *buggyboy_rcram = state->m_rcram;
2147   vregs_t &vregs = state->m_vregs;
2156   UINT16 *buggyboy_rcram = m_rcram;
2157   vregs_t &vregs = m_vregs;
21482158   INT32 x;
21492159   UINT32 y;
21502160   UINT16 rva_offs;
r22873r22874
21592169   UINT32 rva20_6;
21602170
21612171   /* ROM/PROM lookup tables */
2162   const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
2163   const UINT8 *rom   = state->memregion("road")->base();
2172   const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500);
2173   const UINT8 *rom   = memregion("road")->base();
21642174   const UINT8 *prom0 = rom + 0x4000;
21652175   const UINT8 *prom1 = rom + 0x4200;
21662176   const UINT8 *prom2 = rom + 0x4400;
r22873r22874
25602570
25612571**************************************************************************/
25622572
2563static void buggyboy_draw_objs(running_machine &machine, UINT8 *bitmap, int wide)
2573void tx1_state::buggyboy_draw_objs(UINT8 *bitmap, bool wide)
25642574{
2565   tx1_state *state = machine.driver_data<tx1_state>();
2566   UINT16 *buggyboy_objram = state->m_objram;
2567#define FRAC    16
2575   UINT16 *buggyboy_objram = m_objram;
25682576
25692577   UINT32 offs;
25702578
r22873r22874
25722580   UINT32 x_stride;
25732581
25742582   /* The many lookup table ROMs */
2575   const UINT8 *const bug13  = (UINT8*)state->memregion("obj_luts")->base();
2583   const UINT8 *const bug13  = (UINT8*)memregion("obj_luts")->base();
25762584   const UINT8 *const bug18s = bug13 + 0x2000;
2577   const UINT8 *const bb8    = (UINT8*)state->memregion("proms")->base() + 0x1600;
2585   const UINT8 *const bb8    = (UINT8*)memregion("proms")->base() + 0x1600;
25782586
2579   const UINT8 *const bug16s = (UINT8*)state->memregion("obj_map")->base();
2587   const UINT8 *const bug16s = (UINT8*)memregion("obj_map")->base();
25802588   const UINT8 *const bug17s = bug16s + 0x8000;
25812589
2582   const UINT8 *const bb9o = (UINT8*)state->memregion("proms")->base() + 0x500;
2590   const UINT8 *const bb9o = (UINT8*)memregion("proms")->base() + 0x500;
25832591   const UINT8 *const bb9e = bb9o + 0x800;
25842592
2585   const UINT8 *const pixdata_rgn = (UINT8*)state->memregion("obj_tiles")->base();
2593   const UINT8 *const pixdata_rgn = (UINT8*)memregion("obj_tiles")->base();
25862594
25872595   if (wide)
25882596   {
r22873r22874
26802688            rom_addr = (psa0_12 & ~0xff) << 2;
26812689
26822690            /* Prepare the x-scaling */
2683            x_step = (128 << FRAC) / x_scale;
2684            x_acc = (psa0_12 & 0xff) << (FRAC + 5);
2691            x_step = (128 << OBJ_FRAC) / x_scale;
2692            x_acc = (psa0_12 & 0xff) << (OBJ_FRAC + 5);
26852693
26862694            /* TODO Add note */
26872695            x = buggyboy_objram[offs + 4] & x_mask;
r22873r22874
26972705                  UINT32  rombank;
26982706                  UINT8   *romptr;
26992707                  UINT32  bug18s_data;
2700                  UINT32  low_addr = ((x_acc >> (FRAC + 3)) & x_mask);
2708                  UINT32  low_addr = ((x_acc >> (OBJ_FRAC + 3)) & x_mask);
27012709
27022710                  /*
27032711                      Objects are grouped by width (either 16, 8 or 4 tiles) in
r22873r22874
27672775                  UINT8   pix;
27682776                  UINT8   bit;
27692777
2770                  bit = (x_acc >> FRAC) & 7;
2778                  bit = (x_acc >> OBJ_FRAC) & 7;
27712779
27722780                  if (xflip)
27732781                     bit ^= 7;
r22873r22874
27942802               }
27952803
27962804               /* Check if we've stepped into a new 8x8 tile */
2797               if ((((x_acc + x_step) >> (FRAC + 3)) & x_mask) != ((x_acc >> (FRAC + 3)) & x_mask))
2805               if ((((x_acc + x_step) >> (OBJ_FRAC + 3)) & x_mask) != ((x_acc >> (OBJ_FRAC + 3)) & x_mask))
27982806               {
27992807                  if (lasttile)
28002808                     break;
r22873r22874
29202928 *
29212929 *************************************/
29222930
2923static void bb_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, int screen)
2931void tx1_state::bb_combine_layers(bitmap_ind16 &bitmap, int screen)
29242932{
2925   tx1_state *state = machine.driver_data<tx1_state>();
2926   UINT8 *chr_pal = state->memregion("proms")->base() + 0x400;
2933   UINT8 *chr_pal = memregion("proms")->base() + 0x400;
29272934   UINT32 bmp_stride;
29282935   UINT32 x_offset;
29292936   UINT32 y;
r22873r22874
29452952
29462953      UINT32 bmp_offset = y * bmp_stride + x_offset;
29472954
2948      UINT8 *chr_addr = state->m_chr_bmp + bmp_offset;
2949      UINT8 *rod_addr = state->m_rod_bmp + bmp_offset;
2950      UINT8 *obj_addr = state->m_obj_bmp + bmp_offset;
2955      UINT8 *chr_addr = m_chr_bmp + bmp_offset;
2956      UINT8 *rod_addr = m_rod_bmp + bmp_offset;
2957      UINT8 *obj_addr = m_obj_bmp + bmp_offset;
29512958
2952      UINT32 sky_en = BIT(state->m_vregs.sky, 7);
2953      UINT32 sky_val = (((state->m_vregs.sky & 0x7f) + y) >> 2) & 0x3f;
2959      UINT32 sky_en = BIT(m_vregs.sky, 7);
2960      UINT32 sky_val = (((m_vregs.sky & 0x7f) + y) >> 2) & 0x3f;
29542961
29552962      UINT16 *bmp_addr = &bitmap.pix16(y);
29562963
r22873r22874
30263033
30273034      /* /VSYNC: Clear wave LFSR */
30283035      m_vregs.wave_lfsr = 0;
3036
3037      m_needs_update = true;
30293038   }
30303039}
30313040
30323041
3033UINT32 tx1_state::screen_update_buggyboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3042void tx1_state::bb_update_layers()
30343043{
30353044   memset(m_obj_bmp, 0, 768*240);
30363045   memset(m_rod_bmp, 0, 768*240);
30373046
3038   buggyboy_draw_char(machine(), m_chr_bmp, 1);
3039   buggyboy_draw_road(machine(), m_rod_bmp);
3040   buggyboy_draw_objs(machine(), m_obj_bmp, 1);
3047   buggyboy_draw_char(m_chr_bmp, 1);
3048   buggyboy_draw_road(m_rod_bmp);
3049   buggyboy_draw_objs(m_obj_bmp, 1);
30413050
3042   bb_combine_layers(machine(), bitmap, 0);
3051   m_needs_update = false;
3052}
3053
3054UINT32 tx1_state::screen_update_buggyboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3055{
3056   if (m_needs_update)
3057      bb_update_layers();
3058
3059   bb_combine_layers(bitmap, 0);
30433060   return 0;
30443061}
30453062
30463063UINT32 tx1_state::screen_update_buggyboy_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
30473064{
3048   bb_combine_layers(machine(), bitmap, 1);
3065   if (m_needs_update)
3066      bb_update_layers();
3067
3068   bb_combine_layers(bitmap, 1);
30493069   return 0;
30503070}
30513071
30523072UINT32 tx1_state::screen_update_buggyboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
30533073{
3054   bb_combine_layers(machine(), bitmap, 2);
3074   if (m_needs_update)
3075      bb_update_layers();
3076
3077   bb_combine_layers(bitmap, 2);
30553078   return 0;
30563079}
30573080
r22873r22874
30593082{
30603083   memset(m_obj_bmp, 0, 256*240);
30613084
3062   buggyboy_draw_char(machine(), m_chr_bmp, 0);
3063   buggybjr_draw_road(machine(), m_rod_bmp, 0);
3064   buggyboy_draw_objs(machine(), m_obj_bmp, 0);
3085   buggyboy_draw_char(m_chr_bmp, 0);
3086   buggybjr_draw_road(m_rod_bmp);
3087   buggyboy_draw_objs(m_obj_bmp, 0);
30653088
3066   bb_combine_layers(machine(), bitmap, -1);
3089   bb_combine_layers(bitmap, -1);
30673090   return 0;
30683091}
trunk/src/mame/includes/tx1.h
r22873r22874
3838   UINT32  mux;
3939   UINT16  ppshift;
4040   UINT32  i0ff;
41
4241   UINT16  retval;
43
4442   UINT16  muxlatch;   // TX-1
45
46   int dbgaddr;
47   int dbgpc;
43   int      dbgaddr;
44   int      dbgpc;
4845};
4946
5047/*
r22873r22874
103100public:
104101   tx1_state(const machine_config &mconfig, device_type type, const char *tag)
105102      : driver_device(mconfig, type, tag),
106         m_z80_ram(*this, "z80_ram"),
103         m_maincpu(*this, "main_cpu"),
104         m_mathcpu(*this, "math_cpu"),
105         m_audiocpu(*this, "audio_cpu"),
107106         m_math_ram(*this, "math_ram"),
108107         m_vram(*this, "vram"),
109108         m_objram(*this, "objram"),
110109         m_rcram(*this, "rcram"),
111         m_maincpu(*this, "main_cpu"),
112         m_mathcpu(*this, "math_cpu"),
113         m_audiocpu(*this, "audio_cpu") { }
110         m_z80_ram(*this, "z80_ram") { }
114111
115   math_t m_math;
116   sn74s516_t m_sn74s516;
112   required_device<cpu_device> m_maincpu;
113   required_device<cpu_device> m_mathcpu;
114   required_device<cpu_device> m_audiocpu;
115   required_shared_ptr<UINT16> m_math_ram;
116   required_shared_ptr<UINT16> m_vram;
117   required_shared_ptr<UINT16> m_objram;
118   required_shared_ptr<UINT16> m_rcram;
117119   required_shared_ptr<UINT8> m_z80_ram;
120
121   emu_timer *m_interrupt_timer;
122
118123   UINT8 m_ppi_latch_a;
119124   UINT8 m_ppi_latch_b;
120125   UINT32 m_ts;
121   required_shared_ptr<UINT16> m_math_ram;
126
127
128   math_t m_math;
129   sn74s516_t m_sn74s516;
130
122131   vregs_t m_vregs;
123   required_shared_ptr<UINT16> m_vram;
124   required_shared_ptr<UINT16> m_objram;
125   required_shared_ptr<UINT16> m_rcram;
126   emu_timer *m_interrupt_timer;
127132   UINT8 *m_chr_bmp;
128133   UINT8 *m_obj_bmp;
129134   UINT8 *m_rod_bmp;
130135   bitmap_ind16 *m_bitmap;
136
137   bool m_needs_update;
138
131139   DECLARE_READ16_MEMBER(tx1_math_r);
132140   DECLARE_WRITE16_MEMBER(tx1_math_w);
133141   DECLARE_READ16_MEMBER(tx1_spcs_rom_r);
r22873r22874
171179   DECLARE_VIDEO_START(buggyboy);
172180   DECLARE_PALETTE_INIT(buggyboy);
173181   DECLARE_VIDEO_START(buggybjr);
182
183   void tx1_draw_char(UINT8 *bitmap);
184   void tx1_draw_road_pixel(int screen, UINT8 *bmpaddr,
185                        UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
186                        UINT8 stl, UINT8 sld, UINT8 selb,
187                        UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr);
188   void tx1_draw_road(UINT8 *bitmap);
189   void tx1_draw_objects(UINT8 *bitmap);
190   void tx1_update_layers();
191   void tx1_combine_layers(bitmap_ind16 &bitmap, int screen);
192
193   void buggyboy_draw_char(UINT8 *bitmap, bool wide);
194   void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
195                        UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3,
196                        const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2);
197   void buggyboy_draw_road(UINT8 *bitmap);
198   void buggybjr_draw_road(UINT8 *bitmap);
199   void buggyboy_draw_objs(UINT8 *bitmap, bool wide);
200   void bb_combine_layers(bitmap_ind16 &bitmap, int screen);
201   void bb_update_layers();
202
174203   UINT32 screen_update_tx1_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
175204   UINT32 screen_update_tx1_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
176205   UINT32 screen_update_tx1_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
r22873r22874
182211   void screen_eof_buggyboy(screen_device &screen, bool state);
183212   INTERRUPT_GEN_MEMBER(z80_irq);
184213   TIMER_CALLBACK_MEMBER(interrupt_callback);
185   required_device<cpu_device> m_maincpu;
186   required_device<cpu_device> m_mathcpu;
187   required_device<cpu_device> m_audiocpu;
188214};
189215
190216/*----------- defined in audio/tx1.c -----------*/

Previous 199869 Revisions Next


© 1997-2024 The MAME Team