Previous 15994 Revisions Next

r7897 Monday 26th April, 2010 at 01:15:05 UTC by Robbbert
[PEGASUS] Added cassette and cartslots. Printer commented out due to no info available.
[src/mess/drivers]pegasus.c

src/mess/drivers/pegasus.c
r7896r7897
1414#include "emu.h"
1515#include "cpu/m6809/m6809.h"
1616#include "machine/6821pia.h"
17#include "devices/cartslot.h"
18#include "devices/cassette.h"
19#include "machine/ctronics.h"
1720#include "includes/pegasus.h"
1821
1922static UINT8 pegasus_kbd_row = 0;
2023static UINT8 pegasus_kbd_irq = 1;
2124static UINT8 pegasus_control_bits = 0;
25static running_device *pegasus_cass;
2226
27
2328static TIMER_DEVICE_CALLBACK( pegasus_firq )
2429{
2530   running_device *cpu = devtag_get_device( timer->machine, "maincpu" );
r7896r7897
6469   return pegasus_kbd_irq;
6570}
6671
72static READ_LINE_DEVICE_HANDLER( pegasus_cassette_r )
73{
74   return cassette_input(pegasus_cass);
75}
76
77static WRITE_LINE_DEVICE_HANDLER( pegasus_cassette_w )
78{
79   cassette_output(pegasus_cass, state ? 1 : -1);
80}
81
6782static ADDRESS_MAP_START(pegasus_mem, ADDRESS_SPACE_PROGRAM, 8)
6883   ADDRESS_MAP_UNMAP_HIGH
69   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_WRITENOP
70   AM_RANGE(0x2000, 0xbdff) AM_RAM
84   AM_RANGE(0x0000, 0xbdff) AM_RAM
7185   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_BASE(&pegasus_video_ram)
7286   AM_RANGE(0xc000, 0xdfff) AM_ROM
7387   AM_RANGE(0xe200, 0xe3ff) AM_RAM      // PCG
r7896r7897
173187/* System - for keyboard, video, general housekeeping */
174188static const pia6821_interface pegasus_pia_s_intf=
175189{
176   DEVCB_NULL,      /* port A input */
177   DEVCB_HANDLER(pegasus_keyboard_r),      /* port B input */   // high nibble from keyboard
178   DEVCB_NULL,      /* CA1 input */      // from cassette
179   DEVCB_NULL,      /* CB1 input */
180   DEVCB_LINE(pegasus_keyboard_irq),      /* CA2 input */      // do a IRQ when a key pressed
181   DEVCB_NULL,      /* CB2 input */
190   DEVCB_NULL,                  /* port A input */
191   DEVCB_HANDLER(pegasus_keyboard_r),         /* port B input */
192   DEVCB_LINE(pegasus_cassette_r),            /* CA1 input */
193   DEVCB_NULL,                  /* CB1 input */
194   DEVCB_LINE(pegasus_keyboard_irq),         /* CA2 input */
195   DEVCB_NULL,                  /* CB2 input */
182196   DEVCB_HANDLER(pegasus_keyboard_w),         /* port A output */
183   DEVCB_HANDLER(pegasus_controls),      /* port B output */   // low nibble housekeeping
184   DEVCB_NULL,      /* CA2 output */   // to cassette
197   DEVCB_HANDLER(pegasus_controls),         /* port B output */
198   DEVCB_LINE(pegasus_cassette_w),            /* CA2 output */
185199   DEVCB_DEVICE_LINE("maincpu", pegasus_firq_clr),      /* CB2 output */
186200   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE),   /* IRQA output */
187201   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)      /* IRQB output */
r7896r7897
204218   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)
205219};
206220
207static MACHINE_RESET(pegasus)
208{   
221static const cassette_config pegasus_cassette_config =
222{
223   cassette_default_formats,
224   NULL,
225   (cassette_state)(CASSETTE_STOPPED|CASSETTE_MOTOR_ENABLED)
226};
227
228static DEVICE_IMAGE_LOAD( pegasus_cart_1 )
229{
230   image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000);
231
232   return INIT_PASS;
209233}
210234
235static DEVICE_IMAGE_LOAD( pegasus_cart_2 )
236{
237   image_fread(image, memory_region(image->machine, "maincpu") + 0xd000, 0x1000);
238
239   return INIT_PASS;
240}
241
242static MACHINE_START( pegasus )
243{
244   pegasus_cass = devtag_get_device(machine, "cassette");
245}
246
211247static MACHINE_DRIVER_START( pegasus )
212248   /* basic machine hardware */
213249   MDRV_CPU_ADD("maincpu", M6809E, XTAL_4MHz)   // actually a 6809C
214250   MDRV_CPU_PROGRAM_MAP(pegasus_mem)
215251
216252   MDRV_TIMER_ADD_PERIODIC("pegasus_firq", pegasus_firq, HZ(50))
217   MDRV_MACHINE_RESET(pegasus)
218
253   MDRV_MACHINE_START(pegasus)
219254   /* video hardware */
220255   MDRV_SCREEN_ADD("screen", RASTER)
221256   MDRV_SCREEN_REFRESH_RATE(50)
r7896r7897
230265   /* devices */
231266   MDRV_PIA6821_ADD( "pegasus_pia_s", pegasus_pia_s_intf )
232267   MDRV_PIA6821_ADD( "pegasus_pia_u", pegasus_pia_u_intf )
268   MDRV_CARTSLOT_ADD("cart1")
269   MDRV_CARTSLOT_EXTENSION_LIST("bin")
270   MDRV_CARTSLOT_LOAD(pegasus_cart_1)
271   MDRV_CARTSLOT_ADD("cart2")
272   MDRV_CARTSLOT_EXTENSION_LIST("bin")
273   MDRV_CARTSLOT_LOAD(pegasus_cart_2)
274   MDRV_CASSETTE_ADD( "cassette", pegasus_cassette_config )
275//   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
233276MACHINE_DRIVER_END
234277
235278/* ROM definition */
236279ROM_START( pegasus )
237280   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
238//   ROM_LOAD( "invaders.bin", 0x1000, 0x1000, CRC(e19be9e4) SHA1(77a2a3a7ddf2b30790860be994e9c4bab02c72d6) )
239281   ROM_LOAD( "mon11_2674.bin", 0xf000, 0x1000, CRC(1640ff7e) SHA1(8199643749fb40fb8be05e9f311c75620ca939b1) )
240282   ROM_FILL(0xf09e, 1, 0x20)      // hack out the protection
241283//   ROM_LOAD( "mon23_2601.bin", 0xf000, 0x1000, CRC(7dd451bb) SHA1(7843e9166151570f9c915589dc252feb0cb1cec4) )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team