trunk/src/mame/drivers/jack.c
r18122 | r18123 | |
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | | /* these handlers are guessed, because otherwise you can't enter test mode */ |
72 | 71 | |
| 72 | |
73 | 73 | WRITE8_MEMBER(jack_state::joinem_control_w) |
74 | 74 | { |
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: ? |
78 | 78 | |
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 | } |
81 | 86 | |
82 | | CUSTOM_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? |
85 | 91 | |
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); |
90 | 94 | } |
91 | 95 | |
| 96 | |
92 | 97 | /* |
93 | 98 | Super Triv questions read handler |
94 | 99 | */ |
95 | 100 | |
96 | 101 | READ8_MEMBER(jack_state::striv_question_r) |
97 | 102 | { |
98 | | |
99 | 103 | // Set-up the remap table for every 16 bytes |
100 | 104 | if ((offset & 0xc00) == 0x800) |
101 | 105 | { |
r18122 | r18123 | |
579 | 583 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:!3" ) |
580 | 584 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" ) |
581 | 585 | 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" ) |
583 | 587 | 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") |
585 | 589 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
586 | 590 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
587 | 591 | |
588 | 592 | 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 |
591 | 595 | 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 " |
594 | 601 | |
595 | 602 | 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 |
598 | 605 | 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 " |
601 | 611 | |
602 | 612 | PORT_START("IN2") |
603 | 613 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) |
604 | 614 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) |
605 | | |
606 | 615 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) |
607 | 616 | 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 ) // ? |
612 | 621 | INPUT_PORTS_END |
613 | 622 | |
| 623 | static 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 |
| 633 | INPUT_PORTS_END |
| 634 | |
614 | 635 | static INPUT_PORTS_START( loverboy ) |
615 | 636 | PORT_START("DSW1") |
616 | 637 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3,!4") |
r18122 | r18123 | |
795 | 816 | |
796 | 817 | void jack_state::machine_start() |
797 | 818 | { |
798 | | save_item(NAME(m_joinem_snd_bit)); |
799 | 819 | save_item(NAME(m_question_address)); |
800 | 820 | save_item(NAME(m_question_rom)); |
801 | 821 | save_item(NAME(m_remap_address)); |
r18122 | r18123 | |
803 | 823 | |
804 | 824 | void jack_state::machine_reset() |
805 | 825 | { |
| 826 | joinem_control_w(m_maincpu->space(AS_PROGRAM), 0, 0, 0xff); |
806 | 827 | int i; |
807 | 828 | |
808 | | m_joinem_snd_bit = 0; |
809 | 829 | m_question_address = 0; |
810 | 830 | m_question_rom = 0; |
811 | 831 | |
r18122 | r18123 | |
854 | 874 | |
855 | 875 | INTERRUPT_GEN_MEMBER(jack_state::joinem_vblank_irq) |
856 | 876 | { |
857 | | /* TODO: looks hackish to me ... */ |
858 | | if (!(machine().root_device().ioport("IN2")->read() & 0x80)) |
| 877 | if (m_joinem_nmi_enable) |
859 | 878 | device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
860 | 879 | } |
861 | 880 | |
r18122 | r18123 | |
868 | 887 | MCFG_CPU_PERIODIC_INT_DRIVER(jack_state, irq0_line_hold, 2*60) |
869 | 888 | |
870 | 889 | MCFG_GFXDECODE(joinem) |
871 | | MCFG_PALETTE_LENGTH(0x100) |
| 890 | MCFG_PALETTE_LENGTH(0x40) |
872 | 891 | |
873 | 892 | MCFG_SCREEN_MODIFY("screen") |
874 | 893 | MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) |
r18122 | r18123 | |
884 | 903 | /* basic machine hardware */ |
885 | 904 | MCFG_CPU_MODIFY("maincpu") |
886 | 905 | MCFG_CPU_PROGRAM_MAP(unclepoo_map) |
| 906 | |
| 907 | MCFG_PALETTE_LENGTH(0x100) |
887 | 908 | MACHINE_CONFIG_END |
888 | 909 | |
889 | 910 | |
r18122 | r18123 | |
892 | 913 | /* basic machine hardware */ |
893 | 914 | MCFG_CPU_MODIFY("maincpu") |
894 | 915 | 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) |
896 | 917 | |
897 | 918 | MCFG_GFXDECODE(joinem) |
898 | | MCFG_PALETTE_LENGTH(0x100) |
| 919 | MCFG_PALETTE_LENGTH(0x40) |
899 | 920 | |
900 | 921 | MCFG_SCREEN_MODIFY("screen") |
901 | 922 | MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) |
r18122 | r18123 | |
1458 | 1479 | GAME( 1981, tripool, 0, tripool, tripool, jack_state, jack, ROT90, "Noma (Casino Tech license)", "Tri-Pool (Casino Tech)", GAME_SUPPORTS_SAVE ) |
1459 | 1480 | GAME( 1981, tripoola, tripool, tripool, tripool, jack_state, jack, ROT90, "Noma (Costal Games license)", "Tri-Pool (Costal Games)", GAME_SUPPORTS_SAVE ) |
1460 | 1481 | GAME( 1983, joinem, 0, joinem, joinem, jack_state, zzyzzyxx, ROT90, "Global Corporation", "Joinem", GAME_SUPPORTS_SAVE ) |
1461 | | GAME( 1983, unclepoop, unclepoo, unclepoo, joinem, jack_state, zzyzzyxx, ROT90, "Diatec", "Uncle Poo (nincompoop version)", GAME_NOT_WORKING ) |
| 1482 | GAME( 1983, unclepoop, unclepoo, unclepoo, unclepoo, jack_state, zzyzzyxx, ROT90, "Diatec", "Uncle Poo (nincompoop version)", GAME_NOT_WORKING ) |
1462 | 1483 | GAME( 1983, loverboy, 0, loverboy,loverboy, jack_state, loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", GAME_SUPPORTS_SAVE ) |
1463 | 1484 | GAME( 1985, striv, 0, jack, striv, jack_state, striv, ROT270, "Hara Industries", "Super Triv", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/video/jack.c
r18122 | r18123 | |
68 | 68 | |
69 | 69 | for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
70 | 70 | { |
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; |
72 | 77 | |
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 | | |
80 | 78 | if (state->flip_screen()) |
81 | 79 | { |
82 | 80 | sx = 248 - sx; |
r18122 | r18123 | |
86 | 84 | } |
87 | 85 | |
88 | 86 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
89 | | num, |
| 87 | code, |
90 | 88 | color, |
91 | 89 | flipx,flipy, |
92 | 90 | sx,sy,0); |
r18122 | r18123 | |
133 | 131 | TILE_GET_INFO_MEMBER(jack_state::joinem_get_bg_tile_info) |
134 | 132 | { |
135 | 133 | 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; |
137 | 135 | |
138 | 136 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
139 | 137 | } |
r18122 | r18123 | |
151 | 149 | |
152 | 150 | for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
153 | 151 | { |
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; |
155 | 158 | |
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 | | |
163 | 159 | if (state->flip_screen()) |
164 | 160 | { |
165 | 161 | sx = 248 - sx; |
r18122 | r18123 | |
169 | 165 | } |
170 | 166 | |
171 | 167 | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
172 | | num, |
| 168 | code, |
173 | 169 | color, |
174 | 170 | flipx,flipy, |
175 | 171 | sx,sy,0); |