Previous 199869 Revisions Next

r22620 Tuesday 30th April, 2013 at 20:00:31 UTC by hap
fixed zodiack.c regression from yesterday
[src/mame/drivers]taitojc.c zodiack.c
[src/mame/includes]zodiack.h
[src/mame/video]zodiack.c

trunk/src/mame/includes/zodiack.h
r22619r22620
1
21#include "emu.h"
32#include "cpu/z80/z80.h"
43
r22619r22620
1413         m_attributeram(*this, "attributeram"),
1514         m_spriteram(*this, "spriteram"),
1615         m_bulletsram(*this, "bulletsram")
17   { m_percuss_hardware = 0; }
16   { }
1817
1918   // in drivers/zodiack.c
2019   DECLARE_WRITE8_MEMBER(nmi_mask_w);
r22619r22620
4140   required_shared_ptr<UINT8> m_attributeram;
4241   required_shared_ptr<UINT8> m_spriteram;
4342   required_shared_ptr<UINT8> m_bulletsram;
44   // currently this driver uses generic palette handling
4543
4644   // state
47   // video-related
48   tilemap_t   *m_bg_tilemap;
49   tilemap_t   *m_fg_tilemap;
45   tilemap_t *m_bg_tilemap;
46   tilemap_t *m_fg_tilemap;
47   UINT8 m_main_nmi_enabled;
48   UINT8 m_sound_nmi_enabled;
49   UINT8 m_flipscreen;
50   bool m_percuss_hardware;
5051
51   // sound-related
52   UINT8     m_nmi_enable;
53   UINT8     m_sound_nmi_enabled;
54
55   // misc
56   int       m_percuss_hardware;
57
5852   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5953
60protected:
61
62   // driver_device overrides
6354   virtual void machine_start();
6455   virtual void machine_reset();
65public:
6656   virtual void video_start();
57
58   DECLARE_DRIVER_INIT(zodiack);
59   DECLARE_DRIVER_INIT(percuss);
6760   TILE_GET_INFO_MEMBER(get_bg_tile_info);
6861   TILE_GET_INFO_MEMBER(get_fg_tile_info);
6962   DECLARE_PALETTE_INIT(zodiack);
7063   INTERRUPT_GEN_MEMBER(zodiack_sound_nmi_gen);
71   TIMER_DEVICE_CALLBACK_MEMBER(zodiack_scanline);
64   INTERRUPT_GEN_MEMBER(zodiack_main_nmi_gen);
7265};
7366
74class percuss_state : public zodiack_state
75{
76public:
77   percuss_state(const machine_config &mconfig, device_type type, const char *tag)
78      : zodiack_state(mconfig, type, tag)
79   { m_percuss_hardware = 1; }
80};
trunk/src/mame/video/zodiack.c
r22619r22620
3939
4040WRITE8_MEMBER( zodiack_state::flipscreen_w )
4141{
42   if (flip_screen() != (~data & 0x01))
42   if (m_flipscreen != (~data & 1))
4343   {
44      flip_screen_set(~data & 0x01);
44      m_flipscreen = ~data & 1;
45      machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
4546      machine().tilemap().mark_all_dirty();
4647   }
4748}
r22619r22620
102103TILE_GET_INFO_MEMBER(zodiack_state::get_bg_tile_info)
103104{
104105   int code = m_videoram_2[tile_index];
105   int color = (m_attributeram[2 * (tile_index % 32) + 1] >> 4) & 0x07;
106   int color = (m_attributeram[(tile_index & 0x1f) << 1 | 1] >> 4) & 0x07;
106107
107108   SET_TILE_INFO_MEMBER(0, code, color, 0);
108109}
r22619r22620
110111TILE_GET_INFO_MEMBER(zodiack_state::get_fg_tile_info)
111112{
112113   int code = m_videoram[tile_index];
113   int color = m_attributeram[2 * (tile_index % 32) + 1] & 0x07;
114   int color = (m_attributeram[(tile_index & 0x1f) << 1 | 1] >> 0) & 0x07;
114115
115116   SET_TILE_INFO_MEMBER(3, code, color, 0);
116117}
r22619r22620
123124   m_fg_tilemap->set_transparent_pen(0);
124125   m_fg_tilemap->set_scroll_cols(32);
125126
126   /* FIXME: flip_screen_x should not be written. */
127   flip_screen_set_no_update(0);
127   m_bg_tilemap->set_scrolldx(0, 396 - 256);
128   m_fg_tilemap->set_scrolldx(0, 396 - 256);
128129}
129130
130131void zodiack_state::draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect )
131132{
132133   for (int offs = 0; offs < m_bulletsram.bytes(); offs += 4)
133134   {
134      int x, y;
135      int sx = m_bulletsram[offs + 3] + 7;
136      int sy = m_bulletsram[offs + 1];
135137
136      x = m_bulletsram[offs + 3] + 7;
137      y = 255 - m_bulletsram[offs + 1];
138      if (!(m_flipscreen && m_percuss_hardware))
139         sy = 255 - sy;
138140
139      if (flip_screen() && m_percuss_hardware)
140      {
141         y = 255 - y;
142      }
143
144141      drawgfx_transpen(
145142         bitmap,
146143         cliprect, machine().gfx[2],
147144         0,  /* this is just a dot, generated by the hardware */
148145         0,
149146         0, 0,
150         x, y, 0);
147         sx, sy, 0);
151148   }
152149}
153150
r22619r22620
155152{
156153   for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
157154   {
158      int flipx, flipy, sx, sy, spritecode;
155      int sx = 240 - m_spriteram[offs + 3];
156      int sy = 240 - m_spriteram[offs];
157      int flipx = !(m_spriteram[offs + 1] & 0x40);
158      int flipy = m_spriteram[offs + 1] & 0x80;
159      int spritecode = m_spriteram[offs + 1] & 0x3f;
159160
160      sx = 240 - m_spriteram[offs + 3];
161      sy = 240 - m_spriteram[offs];
162      flipx = !(m_spriteram[offs + 1] & 0x40);
163      flipy = m_spriteram[offs + 1] & 0x80;
164      spritecode = m_spriteram[offs + 1] & 0x3f;
165
166      if (flip_screen() && m_percuss_hardware)
161      if (m_flipscreen && m_percuss_hardware)
167162      {
168163         sy = 240 - sy;
169164         flipy = !flipy;
r22619r22620
173168         spritecode,
174169         m_spriteram[offs + 2] & 0x07,
175170         flipx, flipy,
176         sx, sy,
177         0);
171         sx, sy, 0);
178172   }
179173}
180174
trunk/src/mame/drivers/zodiack.c
r22619r22620
2121  All it does is scanning the whole 64k z80 space via all those pop opcodes ...
2222  DE register values are always discarded ... bug in coding or ROM patch?
2323
24TODO:
25- improve video emulation (especially moguchan colors)
26- where do the sound related irqs come from exactly?
27- can eventually be merged with espial.c
28
2429============================================================================
2530
2631Zodiack
r22619r22620
99104
100105WRITE8_MEMBER( zodiack_state::nmi_mask_w )
101106{
102   m_nmi_enable = (data & 1) ^ 1;
107   m_main_nmi_enabled = (data & 1) ^ 1;
103108}
104109
105110WRITE8_MEMBER( zodiack_state::sound_nmi_enable_w )
r22619r22620
107112   m_sound_nmi_enabled = data & 1;
108113}
109114
110
111TIMER_DEVICE_CALLBACK_MEMBER(zodiack_state::zodiack_scanline)
115INTERRUPT_GEN_MEMBER(zodiack_state::zodiack_main_nmi_gen)
112116{
113   int scanline = param;
114
115   if(scanline == 240 && m_nmi_enable) // vblank-out irq
116      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
117
118   if(scanline == 0 ) // vblank-in irq
119      m_maincpu->set_input_line(0, HOLD_LINE);
117   if (m_main_nmi_enabled)
118      nmi_line_pulse(device);
120119}
121120
122121INTERRUPT_GEN_MEMBER(zodiack_state::zodiack_sound_nmi_gen)
r22619r22620
547546void zodiack_state::machine_start()
548547{
549548   save_item(NAME(m_sound_nmi_enabled));
550   save_item(NAME(m_nmi_enable));
549   save_item(NAME(m_main_nmi_enabled));
550   save_item(NAME(m_flipscreen));
551551}
552552
553553void zodiack_state::machine_reset()
554554{
555   m_sound_nmi_enabled = FALSE;
556   m_nmi_enable = 0;
555   m_sound_nmi_enabled = 0;
556   m_main_nmi_enabled = 0;
557   m_flipscreen = 0;
557558}
558559
559560
r22619r22620
562563   /* basic machine hardware */
563564   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
564565   MCFG_CPU_PROGRAM_MAP(main_map)
565   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", zodiack_state, zodiack_scanline, "screen", 0, 1)
566   MCFG_CPU_VBLANK_INT_DRIVER("screen", zodiack_state, zodiack_main_nmi_gen)
567   MCFG_CPU_PERIODIC_INT_DRIVER(zodiack_state, irq0_line_hold, 1*60) // sound related - unknown source, timing is guessed
566568
567569   MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6)
568570   MCFG_CPU_PROGRAM_MAP(sound_map)
569571   MCFG_CPU_IO_MAP(io_map)
570   MCFG_CPU_PERIODIC_INT_DRIVER(zodiack_state, zodiack_sound_nmi_gen, 8*60)    /* IRQs are triggered by the main CPU */
572   MCFG_CPU_PERIODIC_INT_DRIVER(zodiack_state, zodiack_sound_nmi_gen, 8*60) // sound tempo - unknown source, timing is guessed
571573
572574   /* video hardware */
573575   MCFG_SCREEN_ADD("screen", RASTER)
r22619r22620
586588   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
587589MACHINE_CONFIG_END
588590
589static MACHINE_CONFIG_DERIVED_CLASS( percuss, zodiack, percuss_state )
590MACHINE_CONFIG_END
591591
592
593592/***************************************************************************
594593
595594  Game driver(s)
r22619r22620
697696ROM_END
698697
699698
700GAME( 1983, zodiack,  0, zodiack, zodiack,  driver_device, 0, ROT270, "Orca (Esco Trading Co., Inc. license)", "Zodiack", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE ) /* bullet color needs to be verified */
701GAME( 1983, dogfight, 0, zodiack, dogfight, driver_device, 0, ROT270, "Orca / Thunderbolt", "Dog Fight (Thunderbolt)", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE ) /* bullet color needs to be verified */
702GAME( 1982, moguchan, 0, percuss, moguchan, driver_device, 0, ROT270, "Orca (Eastern Commerce Inc. license)", "Mogu Chan (bootleg?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) /* license copyright taken from ROM string at $0b5c */
703GAME( 1981, percuss,  0, percuss, percuss,  driver_device, 0, ROT270, "Orca", "The Percussor (bootleg?)", GAME_SUPPORTS_SAVE )
704GAME( 1982, bounty,   0, percuss, bounty,   driver_device, 0, ROT180, "Orca", "The Bounty", GAME_SUPPORTS_SAVE )
699DRIVER_INIT_MEMBER(zodiack_state,zodiack)
700{
701   m_percuss_hardware = false;
702}
703
704DRIVER_INIT_MEMBER(zodiack_state,percuss)
705{
706   m_percuss_hardware = true;
707}
708
709GAME( 1983, zodiack,  0, zodiack, zodiack,  zodiack_state, zodiack, ROT270, "Orca (Esco Trading Co., Inc. license)", "Zodiack", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE ) /* bullet color needs to be verified */
710GAME( 1983, dogfight, 0, zodiack, dogfight, zodiack_state, zodiack, ROT270, "Orca / Thunderbolt", "Dog Fight (Thunderbolt)", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE ) /* bullet color needs to be verified */
711GAME( 1982, moguchan, 0, zodiack, moguchan, zodiack_state, percuss, ROT270, "Orca (Eastern Commerce Inc. license)", "Mogu Chan (bootleg?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) /* license copyright taken from ROM string at $0b5c */
712GAME( 1981, percuss,  0, zodiack, percuss,  zodiack_state, percuss, ROT270, "Orca", "The Percussor", GAME_SUPPORTS_SAVE )
713GAME( 1982, bounty,   0, zodiack, bounty,   zodiack_state, percuss, ROT180, "Orca", "The Bounty", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/taitojc.c
r22619r22620
391391// lookup tables for densha de go analog controls/meters
392392static const int dendego_odometer_table[0x100] =
393393{
394      0,    3,    7,   10,   14,   17,   21,   24,   28,   31,   34,   38,   41,   45,   48,   52,
395      55,   59,   62,   66,   69,   72,   76,   79,   83,   86,   90,   93,   97,  100,  105,  111,
396      116,  121,  126,  132,  137,  142,  147,  153,  158,  163,  168,  174,  179,  184,  189,  195,
397      200,  206,  211,  217,  222,  228,  233,  239,  244,  250,  256,  261,  267,  272,  278,  283,
398      289,  294,  300,  306,  311,  317,  322,  328,  333,  339,  344,  350,  356,  361,  367,  372,
399      378,  383,  389,  394,  400,  406,  412,  418,  424,  429,  435,  441,  447,  453,  459,  465,
400      471,  476,  482,  488,  494,  500,  505,  511,  516,  521,  526,  532,  537,  542,  547,  553,
401      558,  563,  568,  574,  579,  584,  589,  595,  600,  607,  613,  620,  627,  633,  640,  647,
402      653,  660,  667,  673,  680,  687,  693,  700,  705,  711,  716,  721,  726,  732,  737,  742,
403      747,  753,  758,  763,  768,  774,  779,  784,  789,  795,  800,  806,  812,  818,  824,  829,
404      835,  841,  847,  853,  859,  865,  871,  876,  882,  888,  894,  900,  906,  911,  917,  922,
405      928,  933,  939,  944,  950,  956,  961,  967,  972,  978,  983,  989,  994, 1000, 1005, 1011,
394   0,    3,    7,    10,   14,   17,   21,   24,   28,   31,   34,   38,   41,   45,   48,   52,
395   55,   59,   62,   66,   69,   72,   76,   79,   83,   86,   90,   93,   97,   100,  105,  111,
396   116,  121,  126,  132,  137,  142,  147,  153,  158,  163,  168,  174,  179,  184,  189,  195,
397   200,  206,  211,  217,  222,  228,  233,  239,  244,  250,  256,  261,  267,  272,  278,  283,
398   289,  294,  300,  306,  311,  317,  322,  328,  333,  339,  344,  350,  356,  361,  367,  372,
399   378,  383,  389,  394,  400,  406,  412,  418,  424,  429,  435,  441,  447,  453,  459,  465,
400   471,  476,  482,  488,  494,  500,  505,  511,  516,  521,  526,  532,  537,  542,  547,  553,
401   558,  563,  568,  574,  579,  584,  589,  595,  600,  607,  613,  620,  627,  633,  640,  647,
402   653,  660,  667,  673,  680,  687,  693,  700,  705,  711,  716,  721,  726,  732,  737,  742,
403   747,  753,  758,  763,  768,  774,  779,  784,  789,  795,  800,  806,  812,  818,  824,  829,
404   835,  841,  847,  853,  859,  865,  871,  876,  882,  888,  894,  900,  906,  911,  917,  922,
405   928,  933,  939,  944,  950,  956,  961,  967,  972,  978,  983,  989,  994,  1000, 1005, 1011,
406406   1016, 1021, 1026, 1032, 1037, 1042, 1047, 1053, 1058, 1063, 1068, 1074, 1079, 1084, 1089, 1095,
407407   1100, 1107, 1113, 1120, 1127, 1133, 1140, 1147, 1153, 1160, 1167, 1173, 1180, 1187, 1193, 1200,
408408   1203, 1206, 1209, 1212, 1216, 1219, 1222, 1225, 1228, 1231, 1234, 1238, 1241, 1244, 1247, 1250,
r22619r22620
411411
412412static const int dendego_pressure_table[0x100] =
413413{
414      0,    0,    0,    0,    5,   10,   14,   19,   24,   29,   33,   38,   43,   48,   52,   57,
415      62,   67,   71,   76,   81,   86,   90,   95,  100,  106,  112,  119,  125,  131,  138,  144,
416      150,  156,  162,  169,  175,  181,  188,  194,  200,  206,  212,  219,  225,  231,  238,  244,
417      250,  256,  262,  269,  275,  281,  288,  294,  300,  306,  312,  318,  324,  329,  335,  341,
418      347,  353,  359,  365,  371,  376,  382,  388,  394,  400,  407,  413,  420,  427,  433,  440,
419      447,  453,  460,  467,  473,  480,  487,  493,  500,  507,  514,  521,  529,  536,  543,  550,
420      557,  564,  571,  579,  586,  593,  600,  607,  614,  621,  629,  636,  643,  650,  657,  664,
421      671,  679,  686,  693,  700,  706,  712,  719,  725,  731,  738,  744,  750,  756,  762,  769,
422      775,  781,  788,  794,  800,  807,  814,  821,  829,  836,  843,  850,  857,  864,  871,  879,
423      886,  893,  900,  907,  914,  921,  929,  936,  943,  950,  957,  964,  971,  979,  986,  993,
414   0,    0,    0,    0,    5,    10,   14,   19,   24,   29,   33,   38,   43,   48,   52,   57,
415   62,   67,   71,   76,   81,   86,   90,   95,   100,  106,  112,  119,  125,  131,  138,  144,
416   150,  156,  162,  169,  175,  181,  188,  194,  200,  206,  212,  219,  225,  231,  238,  244,
417   250,  256,  262,  269,  275,  281,  288,  294,  300,  306,  312,  318,  324,  329,  335,  341,
418   347,  353,  359,  365,  371,  376,  382,  388,  394,  400,  407,  413,  420,  427,  433,  440,
419   447,  453,  460,  467,  473,  480,  487,  493,  500,  507,  514,  521,  529,  536,  543,  550,
420   557,  564,  571,  579,  586,  593,  600,  607,  614,  621,  629,  636,  643,  650,  657,  664,
421   671,  679,  686,  693,  700,  706,  712,  719,  725,  731,  738,  744,  750,  756,  762,  769,
422   775,  781,  788,  794,  800,  807,  814,  821,  829,  836,  843,  850,  857,  864,  871,  879,
423   886,  893,  900,  907,  914,  921,  929,  936,  943,  950,  957,  964,  971,  979,  986,  993,
424424   1000, 1008, 1015, 1023, 1031, 1038, 1046, 1054, 1062, 1069, 1077, 1085, 1092, 1100, 1108, 1115,
425425   1123, 1131, 1138, 1146, 1154, 1162, 1169, 1177, 1185, 1192, 1200, 1207, 1214, 1221, 1229, 1236,
426426   1243, 1250, 1257, 1264, 1271, 1279, 1286, 1293, 1300, 1307, 1314, 1321, 1329, 1336, 1343, 1350,

Previous 199869 Revisions Next


© 1997-2024 The MAME Team