Previous 15994 Revisions Next

r14396 Wednesday 8th February, 2012 at 21:56:13 UTC by Curt Coder
[C64] Re-added Super Explode! cartridge support, some graphics issues though. (nw)
[src/mess]mess.mak
[src/mess/machine]c64_super_explode.c* c64_super_explode.h* c64_vw64.c cbmipt.c cbmipt.h

src/mess/machine/c64_super_explode.h
r0r14396
1/**********************************************************************
2 
3    Super Explode! cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __SUPER_EXPLODE__
13#define __SUPER_EXPLODE__
14 
15#define ADDRESS_MAP_MODERN
16 
17#include "emu.h"
18#include "machine/c64exp.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> c64_super_explode_cartridge_device
27 
28class c64_super_explode_cartridge_device : public device_t,
29                                 public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_super_explode_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35protected:
36   // device-level overrides
37   virtual void device_start();
38   virtual void device_reset();
39   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
40 
41   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
43   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
44 
45private:
46   UINT8 m_bank;
47 
48   emu_timer *m_exrom_timer;
49};
50 
51 
52// device type definition
53extern const device_type C64_SUPER_EXPLODE;
54 
55 
56#endif
src/mess/machine/cbmipt.c
r14395r14396
11451145SLOT_INTERFACE_START( c64_expansion_cards )
11461146   SLOT_INTERFACE("standard", C64_STD)
11471147   SLOT_INTERFACE("silverrock", C64_SILVERROCK)
1148   SLOT_INTERFACE("super_explode", C64_SUPER_EXPLODE)
11481149   SLOT_INTERFACE("vizawrite", C64_VW64)
11491150   SLOT_INTERFACE("xl80", C64_XL80)
11501151SLOT_INTERFACE_END
src/mess/machine/cbmipt.h
r14395r14396
55
66#include "machine/c64_silverrock.h"
77#include "machine/c64_std.h"
8#include "machine/c64_super_explode.h"
89#include "machine/c64_vw64.h"
910#include "machine/c64_xl80.h"
1011#include "machine/c1541.h"
src/mess/machine/c64_vw64.c
r14395r14396
4545#define UNSCRAMBLE_DATA(_data) \
4646   BITSWAP8(_data,7,6,0,5,1,4,2,3)
4747 
48   
49// 74LS122 tW=0.45*R*C = 1.1844s
50#define TIMER_PERIOD   1184   
4851 
4952 
53 
5054//**************************************************************************
5155//  DEVICE DEFINITIONS
5256//**************************************************************************
r14395r14396
7680 
7781void c64_vizawrite_cartridge_device::device_start()
7882{
83   // allocate timer
7984   m_game_timer = timer_alloc();
8085}
8186 
r14395r14396
8893{
8994   m_game = 0;
9095   
91   // 74LS122 tW=0.45*R*C = 1.1844s
92   m_game_timer->adjust(attotime::from_msec(1184), 0);
96 
97   m_game_timer->adjust(attotime::from_msec(TIMER_PERIOD), 0);
9398}
9499 
95100 
src/mess/machine/c64_super_explode.c
r0r14396
1/**********************************************************************
2 
3    Super Explode! cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_super_explode.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18// t = R*C = 3.3K * 0.47uF * 40% Vtr = 792.2905424610516 usec
19// (3.3K pull-up on the EXROM line inside the C64, PLA Vih min = 2.0V = 40% of 5.0V)
20#define TIMER_PERIOD   792
21 
22 
23 
24//**************************************************************************
25//  DEVICE DEFINITIONS
26//**************************************************************************
27 
28const device_type C64_SUPER_EXPLODE = &device_creator<c64_super_explode_cartridge_device>;
29 
30 
31 
32//**************************************************************************
33//  LIVE DEVICE
34//**************************************************************************
35 
36//-------------------------------------------------
37//  c64_super_explode_cartridge_device - constructor
38//-------------------------------------------------
39 
40c64_super_explode_cartridge_device::c64_super_explode_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
41   device_t(mconfig, C64_SUPER_EXPLODE, "C64 Super Explode! cartridge", tag, owner, clock),
42   device_c64_expansion_card_interface(mconfig, *this)
43{
44}
45 
46 
47//-------------------------------------------------
48//  device_start - device-specific startup
49//-------------------------------------------------
50 
51void c64_super_explode_cartridge_device::device_start()
52{
53   // allocate timer
54   m_exrom_timer = timer_alloc();
55 
56   // state saving
57   save_item(NAME(m_bank));
58}
59 
60 
61//-------------------------------------------------
62//  device_reset - device-specific reset
63//-------------------------------------------------
64 
65void c64_super_explode_cartridge_device::device_reset()
66{
67   m_bank = 0;
68 
69   m_exrom = 0;
70   m_exrom_timer->adjust(attotime::from_usec(TIMER_PERIOD), 0);
71}
72 
73 
74//-------------------------------------------------
75//  device_timer - handler timer events
76//-------------------------------------------------
77 
78void c64_super_explode_cartridge_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
79{
80   m_exrom = 1;
81}
82 
83 
84//-------------------------------------------------
85//  c64_cd_r - cartridge data read
86//-------------------------------------------------
87 
88UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
89{
90   UINT8 data = 0;
91   
92   if (!roml)
93   {
94      m_exrom = 0;
95      m_exrom_timer->adjust(attotime::from_usec(TIMER_PERIOD), 0);
96       
97      data = m_roml[(m_bank << 13) | (offset & 0x1fff)];
98   }
99   else if (!io1)
100   {
101      m_exrom = 0;
102      m_exrom_timer->adjust(attotime::from_usec(TIMER_PERIOD), 0);
103   }
104   else if (!io2)
105   {
106      data = m_roml[offset & 0x1fff];
107   }
108 
109   return data;
110}
111 
112 
113//-------------------------------------------------
114//  c64_cd_w - cartridge data write
115//-------------------------------------------------
116 
117void c64_super_explode_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
118{
119   if (!io1)
120   {
121      m_exrom = 0;
122      m_exrom_timer->adjust(attotime::from_usec(TIMER_PERIOD), 0);
123   }
124   else if (!io2)
125   {
126      m_bank = BIT(data, 7);
127   }
128}
src/mess/mess.mak
r14395r14396
753753   $(MESS_DRIVERS)/c64dtv.o   \
754754   $(MESS_MACHINE)/c64exp.o   \
755755   $(MESS_MACHINE)/c64user.o   \
756   $(MESS_MACHINE)/c64_silverrock.o   \
756757   $(MESS_MACHINE)/c64_std.o   \
757   $(MESS_MACHINE)/c64_silverrock.o   \
758   $(MESS_MACHINE)/c64_super_explode.o   \
758759   $(MESS_MACHINE)/c64_vw64.o   \
759760   $(MESS_MACHINE)/c64_xl80.o   \
760761   $(MESS_MACHINE)/interpod.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team