Previous 199869 Revisions Next

r31113 Thursday 26th June, 2014 at 04:15:35 UTC by Fabio Priuli
konami cpu: converted to use delegates. nw.
[src/emu/cpu/m6809]konami.c konami.h
[src/mame/drivers]88games.c aliens.c blockhl.c crimfght.c gbusters.c parodius.c rollerg.c simpsons.c surpratk.c thunderx.c vendetta.c
[src/mame/includes]88games.h aliens.h blockhl.h crimfght.h gbusters.h parodius.h rollerg.h simpsons.h surpratk.h thunderx.h vendetta.h
[src/mame/machine]simpsons.c

trunk/src/emu/cpu/m6809/konami.c
r31112r31113
9797void konami_cpu_device::device_start()
9898{
9999   super::device_start();
100
101   // initialize variables
102   m_set_lines = NULL;
100   
101   // bind callbacks
102   m_set_lines.bind_relative_to(*owner());
103103}
104104
105105
r31112r31113
346346
347347void konami_cpu_device::set_lines(UINT8 data)
348348{
349   if (m_set_lines != NULL)
350      (*m_set_lines)(this, data);
349   if (!m_set_lines.isnull())
350      m_set_lines(data);
351351}
352352
353353
r31112r31113
377377   } while(m_icount > 0);
378378}
379379
380
381//-------------------------------------------------
382//  konami_configure_set_lines
383//-------------------------------------------------
384
385void konami_configure_set_lines(device_t *device, konami_set_lines_func func)
386{
387   konami_cpu_device *cpu = dynamic_cast<konami_cpu_device*>(device);
388   cpu->configure_set_lines(func);
389}
trunk/src/emu/cpu/m6809/konami.h
r31112r31113
1818//  TYPE DEFINITIONS
1919//**************************************************************************
2020
21// callbacks
22typedef void (*konami_set_lines_func)(device_t *device, int lines);
23#define KONAMI_SETLINES_CALLBACK(name) void name(device_t *device, int lines)
21typedef device_delegate<void (int lines)> konami_line_cb_delegate;
22#define KONAMICPU_LINE_CB_MEMBER(_name)   void _name(int lines)
2423
24#define MCFG_KONAMICPU_LINE_CB(_class, _method) \
25   konami_cpu_device::set_line_callback(*device, konami_line_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
26
27
2528// device type definition
2629extern const device_type KONAMI;
2730
r31112r31113
3437   konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3538
3639   // configuration
37   void configure_set_lines(konami_set_lines_func func) { m_set_lines = func; }
40   static void set_line_callback(device_t &device, konami_line_cb_delegate callback) { downcast<konami_cpu_device &>(device).m_set_lines = callback; }
3841
3942protected:
4043   // device-level overrides
r31112r31113
5053   typedef m6809_base_device super;
5154
5255   // incidentals
53   konami_set_lines_func m_set_lines;
56   konami_line_cb_delegate m_set_lines;
5457
5558   // konami-specific addressing modes
5659   UINT16 &ireg();
r31112r31113
7679#define KONAMI_IRQ_LINE 0   /* IRQ line number */
7780#define KONAMI_FIRQ_LINE 1   /* FIRQ line number */
7881
79
80//**************************************************************************
81//  FUNCTIONS
82//**************************************************************************
83
84void konami_configure_set_lines(device_t *device, konami_set_lines_func func);
85
8682#endif /* __KONAMI_CPU_H__ */
trunk/src/mame/drivers/crimfght.c
r31112r31113
1919#include "includes/konamipt.h"
2020#include "includes/crimfght.h"
2121
22/* prototypes */
23static KONAMI_SETLINES_CALLBACK( crimfght_banking );
24
2522INTERRUPT_GEN_MEMBER(crimfght_state::crimfght_interrupt)
2623{
2724   if (m_k051960->k051960_is_irq_enabled())
r31112r31113
233230   membank("bank2")->set_entry(0);
234231}
235232
236void crimfght_state::machine_reset()
233KONAMICPU_LINE_CB_MEMBER( crimfght_state::banking_callback )
237234{
238   konami_configure_set_lines(m_maincpu, crimfght_banking);
235   /* bit 5 = select work RAM or palette */
236   if (lines & 0x20)
237   {
238      m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3");
239      m_maincpu->space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(palette_device::write), m_palette.target()));
240      membank("bank3")->set_base(m_paletteram);
241   }
242   else
243      m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1");                             /* RAM */
244   
245   /* bit 6 = enable char ROM reading through the video RAM */
246   m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
247
248   membank("bank2")->set_entry(lines & 0x0f);
239249}
240250
241251static MACHINE_CONFIG_START( crimfght, crimfght_state )
r31112r31113
244254   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)       /* 052001 (verified on pcb) */
245255   MCFG_CPU_PROGRAM_MAP(crimfght_map)
246256   MCFG_CPU_VBLANK_INT_DRIVER("screen", crimfght_state,  crimfght_interrupt)
257   MCFG_KONAMICPU_LINE_CB(crimfght_state, banking_callback)
247258
248259   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)     /* verified on pcb */
249260   MCFG_CPU_PROGRAM_MAP(crimfght_sound_map)
r31112r31113
366377
367378***************************************************************************/
368379
369static KONAMI_SETLINES_CALLBACK( crimfght_banking )
370{
371   crimfght_state *state = device->machine().driver_data<crimfght_state>();
372
373   /* bit 5 = select work RAM or palette */
374   if (lines & 0x20)
375   {
376      device->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3");
377      device->memory().space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(palette_device::write), state->m_palette.target()));
378      state->membank("bank3")->set_base(state->m_paletteram);
379   }
380   else
381      device->memory().space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1");                             /* RAM */
382
383   /* bit 6 = enable char ROM reading through the video RAM */
384   state->m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
385
386   state->membank("bank2")->set_entry(lines & 0x0f);
387}
388
389380GAME( 1989, crimfght,  0,        crimfght, crimfght, driver_device, 0, ROT0, "Konami", "Crime Fighters (US 4 players)", GAME_SUPPORTS_SAVE )
390381GAME( 1989, crimfght2, crimfght, crimfght, crimfghtj, driver_device,0, ROT0, "Konami", "Crime Fighters (World 2 Players)", GAME_SUPPORTS_SAVE )
391382GAME( 1989, crimfghtj, crimfght, crimfght, crimfghtj, driver_device,0, ROT0, "Konami", "Crime Fighters (Japan 2 Players)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/rollerg.c
r31112r31113
1717#include "sound/k053260.h"
1818#include "includes/rollerg.h"
1919
20/* prototypes */
21static KONAMI_SETLINES_CALLBACK( rollerg_banking );
22
2320WRITE8_MEMBER(rollerg_state::rollerg_0010_w)
2421{
2522   logerror("%04x: write %02x to 0010\n",space.device().safe_pc(), data);
r31112r31113
235232
236233void rollerg_state::machine_reset()
237234{
238   konami_configure_set_lines(m_maincpu, rollerg_banking);
239
240235   m_readzoomroms = 0;
241236}
242237
238KONAMICPU_LINE_CB_MEMBER( rollerg_state::banking_callback )
239{
240   membank("bank1")->set_entry(lines & 0x07);
241}
242
243
243244static MACHINE_CONFIG_START( rollerg, rollerg_state )
244245
245246   /* basic machine hardware */
246247   MCFG_CPU_ADD("maincpu", KONAMI, 3000000)        /* ? */
247248   MCFG_CPU_PROGRAM_MAP(rollerg_map)
248   MCFG_CPU_VBLANK_INT_DRIVER("screen", rollerg_state,  irq0_line_assert)
249   MCFG_CPU_VBLANK_INT_DRIVER("screen", rollerg_state, irq0_line_assert)
250   MCFG_KONAMICPU_LINE_CB(rollerg_state, banking_callback)
249251
250252   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
251253   MCFG_CPU_PROGRAM_MAP(rollerg_sound_map)
r31112r31113
344346
345347***************************************************************************/
346348
347static KONAMI_SETLINES_CALLBACK( rollerg_banking )
348{
349   device->machine().root_device().membank("bank1")->set_entry(lines & 0x07);
350}
351
352
353349GAME( 1991, rollerg,  0,       rollerg, rollerg, driver_device, 0, ROT0, "Konami", "Rollergames (US)", GAME_SUPPORTS_SAVE )
354350GAME( 1991, rollergj, rollerg, rollerg, rollerg, driver_device, 0, ROT0, "Konami", "Rollergames (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/88games.c
r31112r31113
1212#include "includes/88games.h"
1313
1414
15
16
1715/*************************************
1816 *
1917 *  Memory handlers
r31112r31113
253251 *
254252 *************************************/
255253
256static KONAMI_SETLINES_CALLBACK( k88games_banking )
254KONAMICPU_LINE_CB_MEMBER( _88games_state::banking_callback )
257255{
258   _88games_state *state = device->machine().driver_data<_88games_state>();
256   logerror("%04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), lines);
259257
260   logerror("%04x: bank select %02x\n", device->safe_pc(), lines);
261
262258   /* bits 0-2 select ROM bank for 0000-1fff */
263259   /* bit 3: when 1, palette RAM at 1000-1fff */
264260   /* bit 4: when 0, 051316 RAM at 3800-3fff; when 1, work RAM at 2000-3fff (NVRAM 3700-37ff) */
265261   int rombank = lines & 0x07;
266   state->m_bank0000->set_entry(rombank);
267   state->m_bank1000->set_entry((lines & 0x08) ? 8 : rombank);
268   state->m_videobank = lines & 0x10;
262   m_bank0000->set_entry(rombank);
263   m_bank1000->set_entry((lines & 0x08) ? 8 : rombank);
264   m_videobank = lines & 0x10;
269265
270266   /* bit 5 = enable char ROM reading through the video RAM */
271   state->m_k052109->set_rmrd_line((lines & 0x20) ? ASSERT_LINE : CLEAR_LINE);
267   m_k052109->set_rmrd_line((lines & 0x20) ? ASSERT_LINE : CLEAR_LINE);
272268
273269   /* bit 6 is unknown, 1 most of the time */
274270
275271   /* bit 7 controls layer priority */
276   state->m_k88games_priority = lines & 0x80;
272   m_k88games_priority = lines & 0x80;
277273}
278274
279275void _88games_state::machine_start()
r31112r31113
295291
296292void _88games_state::machine_reset()
297293{
298   konami_configure_set_lines(m_maincpu, k88games_banking);
299
300294   m_videobank = 0;
301295   m_zoomreadroms = 0;
302296   m_speech_chip = 0;
r31112r31113
314308   MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* ? */
315309   MCFG_CPU_PROGRAM_MAP(main_map)
316310   MCFG_CPU_VBLANK_INT_DRIVER("screen", _88games_state,  k88games_interrupt)
311   MCFG_KONAMICPU_LINE_CB(_88games_state, banking_callback)
317312
318313   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
319314   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/surpratk.c
r31112r31113
1414#include "includes/konamipt.h"
1515#include "includes/surpratk.h"
1616
17/* prototypes */
18static KONAMI_SETLINES_CALLBACK( surpratk_banking );
19
2017INTERRUPT_GEN_MEMBER(surpratk_state::surpratk_interrupt)
2118{
2219   if (m_k052109->is_irq_enabled())
r31112r31113
146143
147144void surpratk_state::machine_reset()
148145{
149   int i;
150
151   konami_configure_set_lines(m_maincpu, surpratk_banking);
152146   m_bank0000->set_bank(0);
153147
154   for (i = 0; i < 3; i++)
148   for (int i = 0; i < 3; i++)
155149   {
156150      m_layerpri[i] = 0;
157151      m_layer_colorbase[i] = 0;
r31112r31113
160154   m_sprite_colorbase = 0;
161155}
162156
157KONAMICPU_LINE_CB_MEMBER( surpratk_state::banking_callback )
158{
159//   logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines);
160   membank("bank1")->set_entry(lines & 0x1f);
161}
162
163163static MACHINE_CONFIG_START( surpratk, surpratk_state )
164164
165165   /* basic machine hardware */
166166   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 053248, the clock input is 12MHz, and internal CPU divider of 4 */
167167   MCFG_CPU_PROGRAM_MAP(surpratk_map)
168168   MCFG_CPU_VBLANK_INT_DRIVER("screen", surpratk_state,  surpratk_interrupt)
169   MCFG_KONAMICPU_LINE_CB(surpratk_state, banking_callback)
169170
170171   MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0)
171172   MCFG_DEVICE_PROGRAM_MAP(bank0000_map)
r31112r31113
262263
263264***************************************************************************/
264265
265static KONAMI_SETLINES_CALLBACK( surpratk_banking )
266{
267   logerror("%04x: setlines %02x\n",device->safe_pc(), lines);
268   device->machine().root_device().membank("bank1")->set_entry(lines & 0x1f);
269}
270
271
272266GAME( 1990, suratk,  0,      surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (World ver. K)", GAME_SUPPORTS_SAVE )
273267GAME( 1990, suratka, suratk, surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (Asia ver. L)", GAME_SUPPORTS_SAVE )
274268GAME( 1990, suratkj, suratk, surpratk, surpratk, driver_device, 0, ROT0, "Konami", "Surprise Attack (Japan ver. M)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/gbusters.c
r31112r31113
1515#include "includes/konamipt.h"
1616#include "includes/gbusters.h"
1717
18/* prototypes */
19static KONAMI_SETLINES_CALLBACK( gbusters_banking );
20
2118INTERRUPT_GEN_MEMBER(gbusters_state::gbusters_interrupt)
2219{
2320   if (m_k052109->is_irq_enabled())
r31112r31113
254251{
255252   UINT8 *RAM = memregion("maincpu")->base();
256253
257   konami_configure_set_lines(m_maincpu, gbusters_banking);
258
259254   /* mirror address for banked ROM */
260255   memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
261256
r31112r31113
263258   m_priority = 0;
264259}
265260
261KONAMICPU_LINE_CB_MEMBER( gbusters_state::banking_callback )
262{
263   /* bits 0-3 ROM bank */
264   membank("bank1")->set_entry(lines & 0x0f);
265   
266   if (lines & 0xf0)
267   {
268      //logerror("%04x: (lines) write %02x\n",device->safe_pc(), lines);
269      //popmessage("lines = %02x", lines);
270   }
271   
272   /* other bits unknown */
273}
274
266275static MACHINE_CONFIG_START( gbusters, gbusters_state )
267276
268277   /* basic machine hardware */
269278   MCFG_CPU_ADD("maincpu", KONAMI, 3000000)    /* Konami custom 052526 */
270279   MCFG_CPU_PROGRAM_MAP(gbusters_map)
271280   MCFG_CPU_VBLANK_INT_DRIVER("screen", gbusters_state,  gbusters_interrupt)
281   MCFG_KONAMICPU_LINE_CB(gbusters_state, banking_callback)
272282
273283   MCFG_CPU_ADD("audiocpu", Z80, 3579545)      /* ? */
274284   MCFG_CPU_PROGRAM_MAP(gbusters_sound_map)
r31112r31113
387397ROM_END
388398
389399
390static KONAMI_SETLINES_CALLBACK( gbusters_banking )
391{
392   /* bits 0-3 ROM bank */
393   device->machine().root_device().membank("bank1")->set_entry(lines & 0x0f);
394400
395   if (lines & 0xf0)
396   {
397      //logerror("%04x: (lines) write %02x\n",device->safe_pc(), lines);
398      //popmessage("lines = %02x", lines);
399   }
400
401   /* other bits unknown */
402}
403
404
405401GAME( 1988, gbusters,  0,        gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Gang Busters (set 1)", GAME_SUPPORTS_SAVE ) /* N02 & J03 program roms */
406402GAME( 1988, gbustersa, gbusters, gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Gang Busters (set 2)", GAME_SUPPORTS_SAVE ) /* unknown region program roms */
407403GAME( 1988, crazycop,  gbusters, gbusters, gbusters, driver_device, 0, ROT90, "Konami", "Crazy Cop (Japan)", GAME_SUPPORTS_SAVE )    /* M02 & J03 program roms */
trunk/src/mame/drivers/thunderx.c
r31112r31113
2020#include "includes/konamipt.h"
2121#include "includes/thunderx.h"
2222
23static KONAMI_SETLINES_CALLBACK( thunderx_banking );
2423
25/***************************************************************************/
26
2724INTERRUPT_GEN_MEMBER(thunderx_state::scontra_interrupt)
2825{
2926   if (m_k052109->is_irq_enabled())
r31112r31113
605602   save_item(NAME(m_pmcram));
606603}
607604
608MACHINE_RESET_MEMBER(thunderx_state,scontra)
605MACHINE_RESET_MEMBER(thunderx_state, scontra)
609606{
610607   m_priority = 0;
611608   m_1f98_data = 0;
r31112r31113
614611   m_pmcbank = 0;
615612}
616613
617MACHINE_RESET_MEMBER(thunderx_state,thunderx)
618{
619   konami_configure_set_lines(m_maincpu, thunderx_banking);
620
621   MACHINE_RESET_CALL_MEMBER(scontra);
622}
623
624614static MACHINE_CONFIG_START( scontra, thunderx_state )
625615
626616   /* basic machine hardware */
r31112r31113
631621   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)     /* verified on pcb */
632622   MCFG_CPU_PROGRAM_MAP(scontra_sound_map)
633623
634   MCFG_MACHINE_START_OVERRIDE(thunderx_state,scontra)
635   MCFG_MACHINE_RESET_OVERRIDE(thunderx_state,scontra)
624   MCFG_MACHINE_START_OVERRIDE(thunderx_state, scontra)
625   MCFG_MACHINE_RESET_OVERRIDE(thunderx_state, scontra)
636626
637627   /* video hardware */
638628   MCFG_SCREEN_ADD("screen", RASTER)
r31112r31113
669659MACHINE_CONFIG_END
670660
671661
662KONAMICPU_LINE_CB_MEMBER( thunderx_state::thunderx_banking_callback )
663{
664   //logerror("thunderx %04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), lines);
665   membank("bank1")->set_entry(((lines & 0x0f) ^ 0x08));
666}
667
672668static MACHINE_CONFIG_START( thunderx, thunderx_state )
673669
674670   /* basic machine hardware */
675671   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4)     /* 052001 (verified on pcb) */
676672   MCFG_CPU_PROGRAM_MAP(thunderx_map)
677673   MCFG_CPU_VBLANK_INT_DRIVER("screen", thunderx_state,  scontra_interrupt)
674   MCFG_KONAMICPU_LINE_CB(thunderx_state, thunderx_banking_callback)
678675
679676   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)     /* verified on pcb */
680677   MCFG_CPU_PROGRAM_MAP(thunderx_sound_map)
681678
682   MCFG_MACHINE_START_OVERRIDE(thunderx_state,thunderx)
683   MCFG_MACHINE_RESET_OVERRIDE(thunderx_state,thunderx)
679   MCFG_MACHINE_START_OVERRIDE(thunderx_state, thunderx)
680   MCFG_MACHINE_RESET_OVERRIDE(thunderx_state, scontra)
684681
685682   /* video hardware */
686683   MCFG_SCREEN_ADD("screen", RASTER)
r31112r31113
962959
963960/***************************************************************************/
964961
965static KONAMI_SETLINES_CALLBACK( thunderx_banking )
966{
967   //logerror("thunderx %04x: bank select %02x\n", device->cpu->safe_pc(), lines);
968   device->machine().root_device().membank("bank1")->set_entry(((lines & 0x0f) ^ 0x08));
969}
970
971962GAME( 1988, scontra,   0,        scontra,  scontra, driver_device,  0, ROT90, "Konami", "Super Contra", GAME_SUPPORTS_SAVE )
972963GAME( 1988, scontraj,  scontra,  scontra,  scontra, driver_device,  0, ROT90, "Konami", "Super Contra (Japan)", GAME_SUPPORTS_SAVE )
973964GAME( 1988, thunderx,  0,        thunderx, thunderx, driver_device, 0, ROT0,  "Konami", "Thunder Cross (set 1)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/simpsons.c
r31112r31113
327327   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 053248, the clock input is 12MHz, and internal CPU divider of 4 */
328328   MCFG_CPU_PROGRAM_MAP(main_map)
329329   MCFG_CPU_VBLANK_INT_DRIVER("screen", simpsons_state,  simpsons_irq) /* IRQ triggered by the 052109, FIRQ by the sprite hardware */
330   MCFG_KONAMICPU_LINE_CB(simpsons_state, banking_callback)
330331
331332   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
332333   MCFG_CPU_PROGRAM_MAP(z80_map)
trunk/src/mame/drivers/aliens.c
r31112r31113
1414#include "includes/konamipt.h"
1515#include "includes/aliens.h"
1616
17/* prototypes */
18static KONAMI_SETLINES_CALLBACK( aliens_banking );
19
2017INTERRUPT_GEN_MEMBER(aliens_state::aliens_interrupt)
2118{
2219   if (m_k051960->k051960_is_irq_enabled())
r31112r31113
186183
187184void aliens_state::machine_reset()
188185{
189   konami_configure_set_lines(m_maincpu, aliens_banking);
190
191186   m_bank0000->set_bank(0);
192187}
193188
189KONAMICPU_LINE_CB_MEMBER( aliens_state::banking_callback )
190{
191   membank("bank1")->set_entry(lines & 0x1f);
192}
193
194194static MACHINE_CONFIG_START( aliens, aliens_state )
195195
196196   /* basic machine hardware */
197
198197   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)       /* 052001 (verified on pcb) */
199198   MCFG_CPU_PROGRAM_MAP(aliens_map)
200   MCFG_CPU_VBLANK_INT_DRIVER("screen", aliens_state,  aliens_interrupt)
199   MCFG_CPU_VBLANK_INT_DRIVER("screen", aliens_state, aliens_interrupt)
200   MCFG_KONAMICPU_LINE_CB(aliens_state, banking_callback)
201201
202202   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)     /* verified on pcb */
203203   MCFG_CPU_PROGRAM_MAP(aliens_sound_map)
r31112r31113
475475
476476***************************************************************************/
477477
478static KONAMI_SETLINES_CALLBACK( aliens_banking )
479{
480   device->machine().root_device().membank("bank1")->set_entry(lines & 0x1f);
481}
482
483478GAME( 1990, aliens,   0,      aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 1)", GAME_SUPPORTS_SAVE )
484479GAME( 1990, aliens2,  aliens, aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 2)", GAME_SUPPORTS_SAVE )
485480GAME( 1990, aliens3,  aliens, aliens, aliens, driver_device, 0, ROT0, "Konami", "Aliens (World set 3)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/blockhl.c
r31112r31113
2626#include "includes/konamipt.h"
2727#include "includes/blockhl.h"
2828
29/* prototypes */
30static KONAMI_SETLINES_CALLBACK( blockhl_banking );
3129
3230INTERRUPT_GEN_MEMBER(blockhl_state::blockhl_interrupt)
3331{
r31112r31113
179177
180178void blockhl_state::machine_reset()
181179{
182   konami_configure_set_lines(m_maincpu, blockhl_banking);
183
184180   m_palette_selected = 0;
185181   m_rombank = 0;
186182}
187183
184KONAMICPU_LINE_CB_MEMBER( blockhl_state::banking_callback )
185{
186   /* bits 0-1 = ROM bank */
187   m_rombank = lines & 0x03;
188   membank("bank1")->set_entry(m_rombank);
189   
190   /* bits 3/4 = coin counters */
191   coin_counter_w(machine(), 0, lines & 0x08);
192   coin_counter_w(machine(), 1, lines & 0x10);
193   
194   /* bit 5 = select palette RAM or work RAM at 5800-5fff */
195   m_palette_selected = ~lines & 0x20;
196   
197   /* bit 6 = enable char ROM reading through the video RAM */
198   m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
199   
200   /* bit 7 used but unknown */
201   
202   /* other bits unknown */
203   
204   if ((lines & 0x84) != 0x80)
205      logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines);
206}
207
188208static MACHINE_CONFIG_START( blockhl, blockhl_state )
189209
190210   /* basic machine hardware */
191211   MCFG_CPU_ADD("maincpu", KONAMI,3000000)     /* Konami custom 052526 */
192212   MCFG_CPU_PROGRAM_MAP(main_map)
193213   MCFG_CPU_VBLANK_INT_DRIVER("screen", blockhl_state,  blockhl_interrupt)
214   MCFG_KONAMICPU_LINE_CB(blockhl_state, banking_callback)
194215
195216   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
196217   MCFG_CPU_PROGRAM_MAP(audio_map)
r31112r31113
286307
287308***************************************************************************/
288309
289static KONAMI_SETLINES_CALLBACK( blockhl_banking )
290{
291   blockhl_state *state = device->machine().driver_data<blockhl_state>();
292
293   /* bits 0-1 = ROM bank */
294   state->m_rombank = lines & 0x03;
295   state->membank("bank1")->set_entry(state->m_rombank);
296
297   /* bits 3/4 = coin counters */
298   coin_counter_w(device->machine(), 0, lines & 0x08);
299   coin_counter_w(device->machine(), 1, lines & 0x10);
300
301   /* bit 5 = select palette RAM or work RAM at 5800-5fff */
302   state->m_palette_selected = ~lines & 0x20;
303
304   /* bit 6 = enable char ROM reading through the video RAM */
305   state->m_k052109->set_rmrd_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
306
307   /* bit 7 used but unknown */
308
309   /* other bits unknown */
310
311   if ((lines & 0x84) != 0x80)
312      logerror("%04x: setlines %02x\n", device->safe_pc(), lines);
313}
314
315
316310GAME( 1989, blockhl, 0,       blockhl, blockhl, driver_device, 0, ROT0, "Konami", "Block Hole", GAME_SUPPORTS_SAVE )
317311GAME( 1989, quarth,  blockhl, blockhl, blockhl, driver_device, 0, ROT0, "Konami", "Quarth (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/parodius.c
r31112r31113
1515#include "includes/konamipt.h"
1616#include "includes/parodius.h"
1717
18/* prototypes */
19static KONAMI_SETLINES_CALLBACK( parodius_banking );
20
21
2218INTERRUPT_GEN_MEMBER(parodius_state::parodius_interrupt)
2319{
2420   if (m_k052109->is_irq_enabled())
r31112r31113
210206
211207void parodius_state::machine_reset()
212208{
213   int i;
214
215   konami_configure_set_lines(m_maincpu, parodius_banking);
216
217   for (i = 0; i < 3; i++)
209   for (int i = 0; i < 3; i++)
218210   {
219211      m_layerpri[i] = 0;
220212      m_layer_colorbase[i] = 0;
r31112r31113
225217   m_bank2000->set_bank(0);
226218}
227219
220KONAMICPU_LINE_CB_MEMBER( parodius_state::banking_callback )
221{
222   if (lines & 0xf0)
223      logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), lines);
224   
225   membank("bank1")->set_entry((lines & 0x0f) ^ 0x0f);
226}
227
228228static MACHINE_CONFIG_START( parodius, parodius_state )
229229
230230   /* basic machine hardware */
231231   MCFG_CPU_ADD("maincpu", KONAMI, 3000000)        /* 053248 */
232232   MCFG_CPU_PROGRAM_MAP(parodius_map)
233233   MCFG_CPU_VBLANK_INT_DRIVER("screen", parodius_state,  parodius_interrupt)
234   MCFG_KONAMICPU_LINE_CB(parodius_state, banking_callback)
234235
235236   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
236237   MCFG_CPU_PROGRAM_MAP(parodius_sound_map)
r31112r31113
378379
379380***************************************************************************/
380381
381static KONAMI_SETLINES_CALLBACK( parodius_banking )
382{
383   if (lines & 0xf0)
384      logerror("%04x: setlines %02x\n", device->safe_pc(), lines);
385
386   device->machine().root_device().membank("bank1")->set_entry((lines & 0x0f) ^ 0x0f);
387}
388
389382GAME( 1990, parodius,  0,        parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (World, set 1)", GAME_SUPPORTS_SAVE )
390383GAME( 1990, parodiuse, parodius, parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (World, set 2)", GAME_SUPPORTS_SAVE )
391384GAME( 1990, parodiusj, parodius, parodius, parodius, driver_device, 0, ROT0, "Konami", "Parodius DA! (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/vendetta.c
r31112r31113
9696#include "includes/konamipt.h"
9797#include "includes/vendetta.h"
9898
99/* prototypes */
100static KONAMI_SETLINES_CALLBACK( vendetta_banking );
101
10299/***************************************************************************
103100
104101  EEPROM
r31112r31113
435432
436433void vendetta_state::machine_reset()
437434{
438   int i;
439
440   konami_configure_set_lines(m_maincpu, vendetta_banking);
441
442   for (i = 0; i < 3; i++)
435   for (int i = 0; i < 3; i++)
443436   {
444437      m_layerpri[i] = 0;
445438      m_layer_colorbase[i] = 0;
r31112r31113
452445   vendetta_video_banking(0);
453446}
454447
448KONAMICPU_LINE_CB_MEMBER( vendetta_state::banking_callback )
449{
450   if (lines >= 0x1c)
451      logerror("PC = %04x : Unknown bank selected %02x\n", machine().device("maincpu")->safe_pc(), lines);
452   else
453      membank("bank1")->set_entry(lines);
454}
455
455456static MACHINE_CONFIG_START( vendetta, vendetta_state )
456457
457458   /* basic machine hardware */
458459   MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8)   /* 052001 (verified on pcb) */
459460   MCFG_CPU_PROGRAM_MAP(main_map)
460461   MCFG_CPU_VBLANK_INT_DRIVER("screen", vendetta_state,  vendetta_irq)
462   MCFG_KONAMICPU_LINE_CB(vendetta_state, banking_callback)
461463
462464   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified with PCB */
463465   MCFG_CPU_PROGRAM_MAP(sound_map)
r31112r31113
744746
745747***************************************************************************/
746748
747static KONAMI_SETLINES_CALLBACK( vendetta_banking )
748{
749   if (lines >= 0x1c)
750      logerror("PC = %04x : Unknown bank selected %02x\n", device->safe_pc(), lines);
751   else
752      device->machine().root_device().membank("bank1")->set_entry(lines);
753}
754
755749DRIVER_INIT_MEMBER(vendetta_state,vendetta)
756750{
757751   m_video_banking_base = 0x4000;
trunk/src/mame/machine/simpsons.c
r31112r31113
6060
6161***************************************************************************/
6262
63static KONAMI_SETLINES_CALLBACK( simpsons_banking )
63KONAMICPU_LINE_CB_MEMBER( simpsons_state::banking_callback )
6464{
65   device->machine().root_device().membank("bank1")->set_entry(lines & 0x3f);
65   membank("bank1")->set_entry(lines & 0x3f);
6666}
6767
6868void simpsons_state::machine_start()
r31112r31113
8383
8484void simpsons_state::machine_reset()
8585{
86   int i;
87
88   konami_configure_set_lines(m_maincpu, simpsons_banking);
89
90   for (i = 0; i < 3; i++)
86   for (int i = 0; i < 3; i++)
9187   {
9288      m_layerpri[i] = 0;
9389      m_layer_colorbase[i] = 0;
trunk/src/mame/includes/gbusters.h
r31112r31113
5858   DECLARE_WRITE8_MEMBER(volume_callback);
5959   K052109_CB_MEMBER(tile_callback);
6060   K051960_CB_MEMBER(sprite_callback);
61   KONAMICPU_LINE_CB_MEMBER(banking_callback);
6162};
trunk/src/mame/includes/thunderx.h
r31112r31113
33    Super Contra / Thunder Cross
44
55*************************************************************************/
6#include "cpu/m6809/konami.h"
67#include "sound/k007232.h"
78#include "video/k052109.h"
89#include "video/k051960.h"
r31112r31113
6667   DECLARE_MACHINE_START(scontra);
6768   DECLARE_MACHINE_RESET(scontra);
6869   DECLARE_MACHINE_START(thunderx);
69   DECLARE_MACHINE_RESET(thunderx);
7070   UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7171   INTERRUPT_GEN_MEMBER(scontra_interrupt);
7272   void run_collisions( int s0, int e0, int s1, int e1, int cm, int hm );
r31112r31113
7474   DECLARE_WRITE8_MEMBER(volume_callback);
7575   K052109_CB_MEMBER(tile_callback);
7676   K051960_CB_MEMBER(sprite_callback);
77   KONAMICPU_LINE_CB_MEMBER(thunderx_banking_callback);
7778
7879protected:
7980   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/88games.h
r31112r31113
6565   K051316_CB_MEMBER(zoom_callback);
6666   K052109_CB_MEMBER(tile_callback);
6767   K051960_CB_MEMBER(sprite_callback);
68   KONAMICPU_LINE_CB_MEMBER(banking_callback);
6869};
trunk/src/mame/includes/parodius.h
r31112r31113
5858   INTERRUPT_GEN_MEMBER(parodius_interrupt);
5959   K05324X_CB_MEMBER(sprite_callback);
6060   K052109_CB_MEMBER(tile_callback);
61   KONAMICPU_LINE_CB_MEMBER(banking_callback);
6162
6263protected:
6364   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/vendetta.h
r31112r31113
7171   void vendetta_video_banking( int select );
7272   K052109_CB_MEMBER(vendetta_tile_callback);
7373   K052109_CB_MEMBER(esckids_tile_callback);
74   KONAMICPU_LINE_CB_MEMBER(banking_callback);
7475
7576protected:
7677   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/crimfght.h
r31112r31113
33    Crime Fighters
44
55*************************************************************************/
6#include "cpu/m6809/konami.h"
67#include "sound/k007232.h"
78#include "video/k052109.h"
89#include "video/k051960.h"
r31112r31113
4142   DECLARE_WRITE8_MEMBER(k052109_051960_w);
4243   DECLARE_WRITE8_MEMBER(crimfght_snd_bankswitch_w);
4344   virtual void machine_start();
44   virtual void machine_reset();
4545   virtual void video_start();
4646   UINT32 screen_update_crimfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   INTERRUPT_GEN_MEMBER(crimfght_interrupt);
4848   DECLARE_WRITE8_MEMBER(volume_callback);
4949   K052109_CB_MEMBER(tile_callback);
5050   K051960_CB_MEMBER(sprite_callback);
51   KONAMICPU_LINE_CB_MEMBER(banking_callback);
5152};
trunk/src/mame/includes/blockhl.h
r31112r31113
5050   INTERRUPT_GEN_MEMBER(blockhl_interrupt);
5151   K052109_CB_MEMBER(tile_callback);
5252   K051960_CB_MEMBER(sprite_callback);
53   KONAMICPU_LINE_CB_MEMBER(banking_callback);
5354};
trunk/src/mame/includes/simpsons.h
r31112r31113
6666   void sound_nmi_callback(int param);
6767   void simpsons_objdma();
6868   K052109_CB_MEMBER(tile_callback);
69   KONAMICPU_LINE_CB_MEMBER(banking_callback);
6970
7071protected:
7172   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/aliens.h
r31112r31113
4646   DECLARE_WRITE8_MEMBER(volume_callback);
4747   K052109_CB_MEMBER(tile_callback);
4848   K051960_CB_MEMBER(sprite_callback);
49   KONAMICPU_LINE_CB_MEMBER(banking_callback);
4950};
trunk/src/mame/includes/surpratk.h
r31112r31113
4444
4545   K05324X_CB_MEMBER(sprite_callback);
4646   K052109_CB_MEMBER(tile_callback);
47   KONAMICPU_LINE_CB_MEMBER(banking_callback);
4748};
trunk/src/mame/includes/rollerg.h
r31112r31113
5757   UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   K05324X_CB_MEMBER(sprite_callback);
5959   K051316_CB_MEMBER(zoom_callback);
60   KONAMICPU_LINE_CB_MEMBER(banking_callback);
6061
6162protected:
6263   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team