Previous 199869 Revisions Next

r18123 Monday 24th September, 2012 at 21:53:45 UTC by hap
fix joinem testmode
[src/mame/drivers]jack.c
[src/mame/includes]jack.h
[src/mame/video]jack.c

trunk/src/mame/drivers/jack.c
r18122r18123
6868}
6969
7070
71/* these handlers are guessed, because otherwise you can't enter test mode */
7271
72
7373WRITE8_MEMBER(jack_state::joinem_control_w)
7474{
75   flip_screen_set(data & 0x80);
76   m_joinem_snd_bit = data & 1;
77   m_joinem_color_bank = data & 0x18;
75   // d0: related to test mode?
76   // d1: unused?
77   // d2: ?
7878   
79   m_bg_tilemap->mark_all_dirty();
80}
79   // d3-d4: palette bank
80   int palette_bank = data & (machine().total_colors() - 1) >> 3 & 0x18;
81   if (m_joinem_palette_bank != palette_bank)
82   {
83      m_joinem_palette_bank = palette_bank;
84      m_bg_tilemap->mark_all_dirty();
85   }
8186
82CUSTOM_INPUT_MEMBER(jack_state::sound_check_r)
83{
84   UINT8 ret = 0;
87   // d5: assume nmi enable
88   m_joinem_nmi_enable = data & 0x20;
89   
90   // d6: unused?
8591
86   if ((ioport("IN2")->read() & 0x80) && !m_joinem_snd_bit)
87      ret = 1;
88
89   return ret;
92   // d7: flip screen
93   flip_screen_set(data & 0x80);
9094}
9195
96
9297/*
9398    Super Triv questions read handler
9499*/
95100
96101READ8_MEMBER(jack_state::striv_question_r)
97102{
98
99103   // Set-up the remap table for every 16 bytes
100104   if ((offset & 0xc00) == 0x800)
101105   {
r18122r18123
579583   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:!3" )
580584   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" )
581585   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" )
582   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jack_state,sound_check_r, NULL) // sound check
586   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_HIGH, "SW2:!6" )
583587   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW2:!7" )
584   PORT_DIPNAME( 0x80, 0x00, "Infinite Lives" )      PORT_DIPLOCATION("SW2:!8")
588   PORT_DIPNAME( 0x80, 0x00, "Infinite Lives (Cheat)" )      PORT_DIPLOCATION("SW2:!8")
585589   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
586590   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
587591
588592   PORT_START("IN0")
589   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
590   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
593   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_8WAY
594   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY
591595   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
592   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
593   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
596   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_8WAY
597   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 1S in testmode
598   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 1J "
599   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // X6 "
600   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // X7 "
594601
595602   PORT_START("IN1")
596   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
597   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
603   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_COCKTAIL
604   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_COCKTAIL
598605   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
599   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
600   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
606   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_COCKTAIL
607   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 2S in testmode
608   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // 2J "
609   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Y6 "
610   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Y7 "
601611
602612   PORT_START("IN2")
603613   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
604614   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
605
606615   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
607616   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
608   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
609   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
610   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) // otherwise it doesn't boot because the code is buggy
611   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
617   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Z4 in testmode
618   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Z5 "
619   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN ) // Z6 ", locks up at boot if low?
620   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ?
612621INPUT_PORTS_END
613622
623static INPUT_PORTS_START( unclepoo )
624   PORT_INCLUDE( joinem )
625
626   PORT_MODIFY("IN0")
627   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
628   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
629
630   PORT_MODIFY("IN1")
631   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
632   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
633INPUT_PORTS_END
634
614635static INPUT_PORTS_START( loverboy )
615636   PORT_START("DSW1")
616637   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:!1,!2,!3,!4")
r18122r18123
795816
796817void jack_state::machine_start()
797818{
798   save_item(NAME(m_joinem_snd_bit));
799819   save_item(NAME(m_question_address));
800820   save_item(NAME(m_question_rom));
801821   save_item(NAME(m_remap_address));
r18122r18123
803823
804824void jack_state::machine_reset()
805825{
826   joinem_control_w(m_maincpu->space(AS_PROGRAM), 0, 0, 0xff);
806827   int i;
807828
808   m_joinem_snd_bit = 0;
809829   m_question_address = 0;
810830   m_question_rom = 0;
811831
r18122r18123
854874
855875INTERRUPT_GEN_MEMBER(jack_state::joinem_vblank_irq)
856876{
857    /* TODO: looks hackish to me ... */
858   if (!(machine().root_device().ioport("IN2")->read() & 0x80))
877   if (m_joinem_nmi_enable)
859878      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
860879}
861880
r18122r18123
868887   MCFG_CPU_PERIODIC_INT_DRIVER(jack_state, irq0_line_hold, 2*60)
869888
870889   MCFG_GFXDECODE(joinem)
871   MCFG_PALETTE_LENGTH(0x100)
890   MCFG_PALETTE_LENGTH(0x40)
872891
873892   MCFG_SCREEN_MODIFY("screen")
874893   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
r18122r18123
884903   /* basic machine hardware */
885904   MCFG_CPU_MODIFY("maincpu")
886905   MCFG_CPU_PROGRAM_MAP(unclepoo_map)
906
907   MCFG_PALETTE_LENGTH(0x100)
887908MACHINE_CONFIG_END
888909
889910
r18122r18123
892913   /* basic machine hardware */
893914   MCFG_CPU_MODIFY("maincpu")
894915   MCFG_CPU_PROGRAM_MAP(joinem_map)
895   MCFG_CPU_VBLANK_INT_DRIVER("screen", jack_state, nmi_line_pulse)
916   MCFG_CPU_VBLANK_INT_DRIVER("screen", jack_state, nmi_line_pulse)
896917
897918   MCFG_GFXDECODE(joinem)
898   MCFG_PALETTE_LENGTH(0x100)
919   MCFG_PALETTE_LENGTH(0x40)
899920
900921   MCFG_SCREEN_MODIFY("screen")
901922   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
r18122r18123
14581479GAME( 1981, tripool,  0,        tripool, tripool, jack_state,  jack,     ROT90,  "Noma (Casino Tech license)",  "Tri-Pool (Casino Tech)", GAME_SUPPORTS_SAVE )
14591480GAME( 1981, tripoola, tripool,  tripool, tripool, jack_state,  jack,     ROT90,  "Noma (Costal Games license)", "Tri-Pool (Costal Games)", GAME_SUPPORTS_SAVE )
14601481GAME( 1983, joinem,   0,        joinem,  joinem, jack_state,   zzyzzyxx, ROT90,  "Global Corporation",          "Joinem", GAME_SUPPORTS_SAVE )
1461GAME( 1983, unclepoop, unclepoo, unclepoo, joinem, jack_state, zzyzzyxx, ROT90, "Diatec", "Uncle Poo (nincompoop version)", GAME_NOT_WORKING )
1482GAME( 1983, unclepoop, unclepoo, unclepoo, unclepoo, jack_state, zzyzzyxx, ROT90, "Diatec", "Uncle Poo (nincompoop version)", GAME_NOT_WORKING )
14621483GAME( 1983, loverboy, 0,        loverboy,loverboy, jack_state, loverboy, ROT90,  "G.T Enterprise Inc",          "Lover Boy", GAME_SUPPORTS_SAVE )
14631484GAME( 1985, striv,    0,        jack,    striv, jack_state,    striv,    ROT270, "Hara Industries",             "Super Triv", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/jack.h
r18122r18123
2828
2929   /* misc */
3030   int m_timer_rate;
31   UINT8 m_joinem_snd_bit;
32   UINT8 m_joinem_color_bank;
31   UINT8 m_joinem_nmi_enable;
32   UINT8 m_joinem_palette_bank;
3333   int m_question_address;
3434   int m_question_rom;
3535   int m_remap_address[16];
r18122r18123
4242   DECLARE_WRITE8_MEMBER(jack_paletteram_w);
4343   DECLARE_READ8_MEMBER(jack_flipscreen_r);
4444   DECLARE_WRITE8_MEMBER(jack_flipscreen_w);
45   DECLARE_CUSTOM_INPUT_MEMBER(sound_check_r);
4645   DECLARE_READ8_MEMBER(timer_r);
4746
4847   DECLARE_DRIVER_INIT(zzyzzyxx);
trunk/src/mame/video/jack.c
r18122r18123
6868
6969   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
7070   {
71      int sx, sy, num, color, flipx, flipy;
71      int sy = spriteram[offs];
72      int sx = spriteram[offs + 1];
73      int code = spriteram[offs + 2] | ((spriteram[offs + 3] & 0x08) << 5);
74      int color = spriteram[offs + 3] & 0x07;
75      int flipx = (spriteram[offs + 3] & 0x80) >> 7;
76      int flipy = (spriteram[offs + 3] & 0x40) >> 6;
7277
73      sx    = spriteram[offs + 1];
74      sy    = spriteram[offs];
75      num   = spriteram[offs + 2] + ((spriteram[offs + 3] & 0x08) << 5);
76      color = spriteram[offs + 3] & 0x07;
77      flipx = (spriteram[offs + 3] & 0x80);
78      flipy = (spriteram[offs + 3] & 0x40);
79
8078      if (state->flip_screen())
8179      {
8280         sx = 248 - sx;
r18122r18123
8684      }
8785
8886      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
89            num,
87            code,
9088            color,
9189            flipx,flipy,
9290            sx,sy,0);
r18122r18123
133131TILE_GET_INFO_MEMBER(jack_state::joinem_get_bg_tile_info)
134132{
135133   int code = m_videoram[tile_index] + ((m_colorram[tile_index] & 0x03) << 8);
136   int color = (m_colorram[tile_index] & 0x38) >> 3 | m_joinem_color_bank;
134   int color = (m_colorram[tile_index] & 0x38) >> 3 | m_joinem_palette_bank;
137135
138136   SET_TILE_INFO_MEMBER(0, code, color, 0);
139137}
r18122r18123
151149
152150   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
153151   {
154      int sx, sy, num, color, flipx, flipy;
152      int sy = spriteram[offs];
153      int sx = spriteram[offs + 1];
154      int code = spriteram[offs + 2] | ((spriteram[offs + 3] & 0x03) << 8);
155      int color = (spriteram[offs + 3] & 0x38) >> 3 | state->m_joinem_palette_bank;
156      int flipx = (spriteram[offs + 3] & 0x80) >> 7;
157      int flipy = (spriteram[offs + 3] & 0x40) >> 6;
155158
156      sx    = spriteram[offs + 1];
157      sy    = spriteram[offs];
158      num   = spriteram[offs + 2] + ((spriteram[offs + 3] & 0x01) << 8);
159      color = (spriteram[offs + 3] & 0x38) >> 3;
160      flipx = (spriteram[offs + 3] & 0x80);
161      flipy = (spriteram[offs + 3] & 0x40);
162
163159      if (state->flip_screen())
164160      {
165161         sx = 248 - sx;
r18122r18123
169165      }
170166
171167      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
172            num,
168            code,
173169            color,
174170            flipx,flipy,
175171            sx,sy,0);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team