[Coco] To the organizer of maltedmedia

Tveo Loatouse tvefoo at yahoo.com
Thu Apr 28 17:43:14 EDT 2011


Hi,

The file in the Newly-Received directory called 2vhds.tar.gz should pro bally be deleted because it's size is too big. I should of actually just included the necessary source code change that would let someone compile for them self the mess with two vhd's. The source code needed is shown below and it is pretty easy to compile mess in Linux and Windows. However I don't have Windows so I am not too sure about Windows.

The code needed to implement change:

If you want to have, two virtual hard drives in mess; coco3 - os9.
You can, I did it. I added and/or changed some code in mame/mess to
implement the extra virtual hard drive, giving you vhd1 and vhd2.

I compiled for my system linux, if you compile in windows,
I am not sure, so read docs. I turned on DEBUG, when I ran make.

Using with OS-9:

Build your BootFile with, Emudsk.dr, Emudsk1.dr, ddh0.dd, h0, h1.
The boot.os9 file is a 80.dd nitros9 boot disk with the emudsk's
and the dd's use kwikgen.

Software:

If your reading this, I will assume you have "2vhds.tar"; Inside you will find build environment with a Debug build for linux. A program folder with my mess execution enviroment file. You can try it, if you want to, it works for me (slackware 12.2). Also, a nitros9 project's 80 track bootdisk "boot.os9" and "nitros9.vhd" included; the boot disk has a os9 extension;
mess will boot this up, ok. The nitros9.vhd is already has the defaults, so you can hard drive use them to get started quickly.

Create h0 and h1 in a linux shell with a:

	touch h0.vhd
	touch h1.vhd

Format them in nitros9, use virtual format only. Copy the boot disk
to your default disk (h0) so you can boot; after that do what ever.



-------------------------------------------------------------------
Mess version: 0.141. If you have another version check to see if
same and if not, you must make any necessary changes needed to run.
-------------------------------------------------------------------


Source Changes:
---------------


1. Added and/or changed in mess/src/mess/drivers/coco.c


/* I added and/or changed code */

/* Note that the CoCo 3 doesn't use the SAM VDG mode registers
 *
 * Also, there might be other SAM registers that are ignored in the CoCo 3;
 * I am not sure which ones are...
 *
 * Tepolt implies that $FFD4-$FFD7 and $FFDA-$FFDD are ignored on the CoCo 3,
 * which would make sense, but I'm not sure.
 */
static ADDRESS_MAP_START( coco3_map, ADDRESS_SPACE_PROGRAM, 8 )
    AM_RANGE(0x0000, 0x1fff) AM_RAMBANK("bank1")
    AM_RANGE(0x2000, 0x3fff) AM_RAMBANK("bank2")
    AM_RANGE(0x4000, 0x5fff) AM_RAMBANK("bank3")
    AM_RANGE(0x6000, 0x7fff) AM_RAMBANK("bank4")
    AM_RANGE(0x8000, 0x9fff) AM_RAMBANK("bank5")
    AM_RANGE(0xa000, 0xbfff) AM_RAMBANK("bank6")
    AM_RANGE(0xc000, 0xdfff) AM_RAMBANK("bank7")
    AM_RANGE(0xe000, 0xfdff) AM_RAMBANK("bank8")
    AM_RANGE(0xfe00, 0xfeff) AM_RAMBANK("bank9")
    AM_RANGE(0xff00, 0xff1f) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w)
    AM_RANGE(0xff20, 0xff3f) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w)
    AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w)
    AM_RANGE(0xff80, 0xff85) AM_DEVREADWRITE("vhd1", coco_vhd_io_r, coco_vhd_io_w) /* changed vhd1 here */
    AM_RANGE(0xff90, 0xff9f) AM_READWRITE(coco3_gime_r, coco3_gime_w)
    AM_RANGE(0xffa0, 0xffaf) AM_READWRITE(coco3_mmu_r, coco3_mmu_w)
    AM_RANGE(0xffb0, 0xffbf) AM_READ_BANK("bank10") AM_WRITE(coco3_palette_w)
    AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w)
    AM_RANGE(0xffe0, 0xffe5) AM_DEVREADWRITE("vhd2", coco_vhd_io_r, coco_vhd_io_w) /* added vhd2 here */
    AM_RANGE(0xffe6, 0xffef) AM_NOP
    AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x7ff0)
ADDRESS_MAP_END




/* I added and/or changed code */

static MACHINE_CONFIG_START( coco3, coco3_state )
    /* basic machine hardware */
    MCFG_CPU_ADD("maincpu", M6809E, COCO_CPU_SPEED_HZ * 4)        /* 0,894886 MHz */
    MCFG_CPU_PROGRAM_MAP(coco3_map)

    MCFG_MACHINE_START( coco3 )
    MCFG_MACHINE_RESET( coco3 )

    /* video hardware */
    MCFG_VIDEO_START(coco3)
    MCFG_VIDEO_UPDATE(coco3)
    MCFG_DEFAULT_LAYOUT(layout_coco3)

    MCFG_SCREEN_ADD("composite", RASTER)
    MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
    MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
    MCFG_SCREEN_SIZE(640, 25+192+26)
    MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)

    MCFG_SCREEN_ADD("rgb", RASTER)
    MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
    MCFG_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
    MCFG_SCREEN_SIZE(640, 25+192+26)
    MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)

    MCFG_PIA6821_ADD( "pia_0", coco3_pia_intf_0 )
    MCFG_PIA6821_ADD( "pia_1", coco3_pia_intf_1 )

    /* sound hardware */
    MCFG_FRAGMENT_ADD( coco_sound )

    /* bitbanger/printer */
    MCFG_BITBANGER_ADD("bitbanger", coco3_bitbanger_config)

    /* snapshot/quickload */
    MCFG_SNAPSHOT_ADD("snapshot", coco3_pak, "pak", 0)
    MCFG_QUICKLOAD_ADD("quickload", coco, "bin", 0.5)

    /* devices */
    MCFG_COCO_VHD_ADD("vhd1")  /* changed vhd1 here */
    MCFG_COCO_VHD_ADD("vhd2")  /* added vhd2 here */

    /* cassette */
    MCFG_CASSETTE_ADD( "cassette", coco_cassette_config )

    MCFG_SAM6883_GIME_ADD("sam", coco3_sam_intf)

    MCFG_COCO_CARTRIDGE_ADD("coco_cartslot")
    MCFG_COCO_CARTRIDGE_CART_CALLBACK(coco3_cart_w)
    MCFG_COCO_CARTRIDGE_HALT_CALLBACK(coco_halt_w)
    MCFG_COCO_CARTRIDGE_NMI_CALLBACK(coco_nmi_w)

    /* internal ram */
    MCFG_RAM_ADD("messram")
    MCFG_RAM_DEFAULT_SIZE("512K")
    MCFG_RAM_EXTRA_OPTIONS("128K,2M,8M")

    MCFG_FLOPPY_4_DRIVES_ADD(coco_floppy_config)
MACHINE_CONFIG_END




2. Added and/or changed in mess/src/mess/devices/coco_vhd.c -


/* I added and/or changed code */

/***************************************************************************

    coco_vhd.c

    Color Computer Virtual Hard Drives

****************************************************************************

    Technical specs on the Virtual Hard Disk interface 1&2

    Address       Description
    -------       -----------
    FF80          Logical record number (high byte)
    FF81          Logical record number (middle byte)
    FF82          Logical record number (low byte)
    FF83          Command/status register
    FF84          Buffer address (high byte)
    FF85          Buffer address (low byte)

    FFE0          Logical record number (high byte)
    FFE1          Logical record number (middle byte)
    FFE2          Logical record number (low byte)
    FFE3          Command/status register
    FFE4          Buffer address (high byte)
    FFE5          Buffer address (low byte)

    Set the other registers, and then issue a command to FF83 as follows:

     0 = read 256-byte sector at LRN
     1 = write 256-byte sector at LRN
     2 = flush write cache (Closes and then opens the image file)

    Error values:

     0 = no error
    -1 = power-on state (before the first command is recieved)
    -2 = invalid command
     2 = VHD image does not exist
     4 = Unable to open VHD image file
     5 = access denied (may not be able to write to VHD image)

    IMPORTANT: The I/O buffer must NOT cross an 8K MMU bank boundary.

 ***************************************************************************/



Thankyou
Tvefoo



More information about the Coco mailing list