Previous 15994 Revisions Next

r8514 Thursday 15th July, 2010 at 21:52:14 UTC by Curt Coder
[MANAGER] Added joysticks, 32K memory option, more correct clocks, floppy device.
[src/mess/drivers]crvision.c
[src/mess/includes]crvision.h

src/mess/includes/crvision.h
r8513r8514
2020   crvision_state(running_machine &machine) { }
2121
2222   /* keyboard state */
23   int keylatch;
23   UINT8 keylatch;
2424
25   /* joystick state */
26   UINT8 joylatch;
27
2528   /* devices */
2629   running_device *psg;
2730   running_device *cassette;
src/mess/drivers/crvision.c
r8513r8514
2424
2525   Salora Manager
2626
27   - correct clocks
2827   - keyboard Ctrl+I/J/N don't print out BASIC commands
29   - 16K RAM mapping
30   - joysticks
28   - RAM mapping
3129   - cassette
3230   - printer
3331   - floppy (interface cartridge needed)
r8513r8514
6866|                   LS244                                                         |
6967|       6502                                                                    --|
7068|                   LS244                                                       |
71|                                                           CN5                 |
69|                                           |-------------CN5-------------|     |
7270|-------------------------------------------------------------------------------|
7371
7472Notes:
r8513r8514
83814116    - Toshiba TMM416P-3 16Kx1 RAM (covered w/heatsink)
8482CN1     - sub board connector (17x2 pin header)
8583CN2     - RF board connector (17x1 pin header)
86CN3     - tape connector (7x2 PCB edge male)
84CN3     - printer connector (7x2 PCB edge male)
8785CN4     - expansion connector (30x2 PCB edge male)
8886CN5     - cartridge connector (18x2 PCB edge female)
8987CN6      - keyboard connector (16x1 pin header)
r8513r8514
127125#include "cpu/m6502/m6502.h"
128126#include "devices/cartslot.h"
129127#include "devices/cassette.h"
128#include "devices/flopdrv.h"
129#include "formats/basicdsk.h"
130130#include "machine/ctronics.h"
131131#include "machine/6821pia.h"
132132#include "sound/sn76496.h"
r8513r8514
181181   AM_RANGE(0xe800, 0xe800) AM_DEVWRITE(CENTRONICS_TAG, centronics_data_w)
182182   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE(CENTRONICS_TAG, centronics_status_r, centronics_ctrl_w)
183183//  AM_RANGE(0xe802, 0xf7ff) AM_RAMBANK(4)
184   AM_RANGE(0xf800, 0xffff) AM_ROM
184   AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
185185ADDRESS_MAP_END
186186
187187/*-------------------------------------------------
r8513r8514
466466   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
467467   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
468468   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
469   
470   PORT_START("JOY0")
471   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
472   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
473   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
474   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
475   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
476   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
477   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
478   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
479
480   PORT_START("JOY1")
481   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
482   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
483
484   PORT_START("JOY2")
485   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
486   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
487   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
488   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
489   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
490   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
491   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
492   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
493
494   PORT_START("JOY3")
495   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
496   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
469497INPUT_PORTS_END
470498
471499/***************************************************************************
r8513r8514
677705   return data;
678706}
679707
708static WRITE8_DEVICE_HANDLER( lasr2001_pia_pa_w )
709{
710   /*
711        PA0     Keyboard raster player 1 output (joystick)
712        PA1     Keyboard raster player 1 output (hand keys)
713        PA2     Keyboard raster player 2 output (joystick)
714        PA3     Keyboard raster player 2 output (hand keys)
715        PA4     ?
716        PA5     ?
717        PA6     ?
718        PA7     ?
719    */
720
721   crvision_state *state = (crvision_state *)device->machine->driver_data;
722
723   state->joylatch = data;
724}
725
726static READ8_DEVICE_HANDLER( lasr2001_pia_pb_r )
727{
728   crvision_state *state = (crvision_state *)device->machine->driver_data;
729
730   UINT8 data = 0xff;
731
732   if (!BIT(state->joylatch, 0)) data &= input_port_read(device->machine, "JOY0");
733   if (!BIT(state->joylatch, 1)) data &= input_port_read(device->machine, "JOY1");
734   if (!BIT(state->joylatch, 2)) data &= input_port_read(device->machine, "JOY2");
735   if (!BIT(state->joylatch, 3)) data &= input_port_read(device->machine, "JOY3");
736
737   return data;
738}
739
680740static WRITE8_DEVICE_HANDLER( lasr2001_pia_pb_w )
681741{
682742   /*
r8513r8514
710770static const pia6821_interface lasr2001_pia_intf =
711771{
712772   DEVCB_HANDLER(lasr2001_pia_pa_r),               // input A
713   DEVCB_NULL,                                 // input B
773   DEVCB_HANDLER(lasr2001_pia_pb_r),               // input B
714774   DEVCB_NULL,                                 // input CA1 ?
715775   DEVCB_DEVICE_LINE(SN76489_TAG, sn76496_ready_r),   // input CB1
716776   DEVCB_NULL,                                 // input CA2 ?
717777   DEVCB_LINE_VCC,                              // input CB2 (+5V)
718   DEVCB_NULL,                                 // output A
778   DEVCB_HANDLER(lasr2001_pia_pa_w),               // output A
719779   DEVCB_HANDLER(lasr2001_pia_pb_w),               // output B
720780   DEVCB_NULL,                                 // output CA2 ?
721781   DEVCB_DEVICE_LINE(SN76489_TAG, lasr2001_pia_cb2_w),   // output CB2 (SN76489 pin CE_)
r8513r8514
735795   NULL
736796};
737797
798/*-------------------------------------------------
799    floppy_config lasr2001_floppy_config
800-------------------------------------------------*/
801
802static const floppy_config lasr2001_floppy_config =
803{
804   DEVCB_NULL,
805   DEVCB_NULL,
806   DEVCB_NULL,
807   DEVCB_NULL,
808   DEVCB_NULL,
809   FLOPPY_DRIVE_SS_80,
810   FLOPPY_OPTIONS_NAME(default),
811   DO_NOT_KEEP_GEOMETRY,
812   NULL
813};
814
738815/***************************************************************************
739816    MACHINE INITIALIZATION
740817***************************************************************************/
r8513r8514
9901067   MDRV_DRIVER_DATA(crvision_state)
9911068
9921069   /* basic machine hardware */
993   MDRV_CPU_ADD(M6502_TAG, M6502, 2000000)
1070   MDRV_CPU_ADD(M6502_TAG, M6502, 17734470/9)
9941071   MDRV_CPU_PROGRAM_MAP(lasr2001_map)
9951072   MDRV_CPU_VBLANK_INT(SCREEN_TAG, crvision_int)
9961073
r8513r8514
9981075
9991076   /* sound hardware */
10001077   MDRV_SPEAKER_STANDARD_MONO("mono")
1001   MDRV_SOUND_ADD(SN76489_TAG, SN76489A, 2000000)
1078   MDRV_SOUND_ADD(SN76489_TAG, SN76489A, 17734470/9)
10021079   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
10031080
10041081   MDRV_SOUND_WAVE_ADD("wave", CASSETTE_TAG)
r8513r8514
10191096   /* cassette */
10201097   MDRV_CASSETTE_ADD(CASSETTE_TAG, crvision_cassette_config)
10211098
1099   /* floppy */
1100   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, lasr2001_floppy_config)
1101
10221102   /* printer */
10231103   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
10241104
10251105   /* internal ram */
10261106   MDRV_RAM_ADD("messram")
10271107   MDRV_RAM_DEFAULT_SIZE("16K")
1108   MDRV_RAM_EXTRA_OPTIONS("32K")
10281109
10291110   /* video hardware */
10301111   MDRV_IMPORT_FROM(tms9928a)
r8513r8514
10381119***************************************************************************/
10391120
10401121ROM_START( crvision )
1041    ROM_REGION( 0x10000, M6502_TAG, 0 )
1042    ROM_LOAD( "crvision.u20", 0xf800, 0x0800, CRC(c3c590c6) SHA1(5ac620c529e4965efb5560fe824854a44c983757) )
1122    ROM_REGION( 0x800, M6502_TAG, 0 )
1123    ROM_LOAD( "crvision.u20", 0x0000, 0x0800, CRC(c3c590c6) SHA1(5ac620c529e4965efb5560fe824854a44c983757) )
10431124ROM_END
10441125
10451126ROM_START( fnvision )
1046    ROM_REGION( 0x10000, M6502_TAG, 0 )
1047    ROM_LOAD( "funboot.rom",  0xf800, 0x0800, CRC(05602697) SHA1(c280b20c8074ba9abb4be4338b538361dfae517f) )
1127    ROM_REGION( 0x800, M6502_TAG, 0 )
1128    ROM_LOAD( "funboot.rom",  0x0000, 0x0800, CRC(05602697) SHA1(c280b20c8074ba9abb4be4338b538361dfae517f) )
10481129ROM_END
10491130
10501131#define rom_wizzard rom_crvision
r8513r8514
10571138    ROM_REGION( 0x4000, M6502_TAG, 0 )
10581139    ROM_LOAD( "01", 0x0000, 0x2000, CRC(702f4cf5) SHA1(cd14ee74e787d24b76c166de484dae24206e219b) )
10591140    ROM_LOAD( "23", 0x2000, 0x2000, CRC(46489d88) SHA1(467f5bcd62d0b4117c443e13373df8f3c45df7b2) )
1141
1142   ROM_REGION( 0x1000, "disk", 0 )
1143   ROM_LOAD( "floppy interface cartridge", 0x0000, 0x1000, NO_DUMP )
10601144ROM_END
10611145
10621146/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team