summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/svmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/svmu.c')
-rw-r--r--src/mess/drivers/svmu.c132
1 files changed, 66 insertions, 66 deletions
diff --git a/src/mess/drivers/svmu.c b/src/mess/drivers/svmu.c
index e89c31e0a95..aab42fc8807 100644
--- a/src/mess/drivers/svmu.c
+++ b/src/mess/drivers/svmu.c
@@ -17,17 +17,17 @@
#include "sound/speaker.h"
#include "svmu.lh"
-#define PIXEL_SIZE 7
-#define PIXEL_DISTANCE 1
+#define PIXEL_SIZE 7
+#define PIXEL_DISTANCE 1
class svmu_state : public driver_device
{
public:
svmu_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_flash(*this, "flash"),
- m_speaker(*this, SPEAKER_TAG)
+ m_maincpu(*this, "maincpu"),
+ m_flash(*this, "flash"),
+ m_speaker(*this, SPEAKER_TAG)
{ }
required_device<lc8670_cpu_device> m_maincpu;
@@ -45,8 +45,8 @@ public:
DECLARE_READ8_MEMBER(p7_r);
private:
- UINT8 * m_bios;
- UINT8 m_page;
+ UINT8 * m_bios;
+ UINT8 m_page;
};
@@ -126,14 +126,14 @@ ADDRESS_MAP_END
/* Input ports */
static INPUT_PORTS_START( svmu )
PORT_START( "P3" )
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("UP") PORT_CODE( KEYCODE_UP )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("DOWN") PORT_CODE( KEYCODE_DOWN )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("LEFT") PORT_CODE( KEYCODE_LEFT )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("RIGHT") PORT_CODE( KEYCODE_RIGHT )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("A") PORT_CODE( KEYCODE_A )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("B") PORT_CODE( KEYCODE_B )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("MODE") PORT_CODE( KEYCODE_M )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("SLEEP") PORT_CODE( KEYCODE_S )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("UP") PORT_CODE( KEYCODE_UP )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("DOWN") PORT_CODE( KEYCODE_DOWN )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("LEFT") PORT_CODE( KEYCODE_LEFT )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("RIGHT") PORT_CODE( KEYCODE_RIGHT )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("A") PORT_CODE( KEYCODE_A )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("B") PORT_CODE( KEYCODE_B )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("MODE") PORT_CODE( KEYCODE_M )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("SLEEP") PORT_CODE( KEYCODE_S )
PORT_START("BATTERY")
PORT_CONFNAME( 0x01, 0x01, "Battery" )
PORT_CONFSETTING( 0x01, "Good" )
@@ -221,73 +221,73 @@ static QUICKLOAD_LOAD( svmu )
// more info about the VMUFAT here: http://mc.pp.se/dc/vms/flashmem.html
//-------------------------------- Formatting --------------------------------
- memset(flash + 241*512, 0, 15*512); // clears the last 15 blocks that contain file system information
+ memset(flash + 241*512, 0, 15*512); // clears the last 15 blocks that contain file system information
for (int i=0; i<0x10; i++)
- vmufat_write_byte(flash, 255, i, 0x55); // first 16 bytes should be 0x55 to indicate a properly formatted card
-
- vmufat_write_byte(flash, 255, 0x10, 0x00); // custom VMS colour (1 = use custom colours, 0 = standard colour)
- vmufat_write_byte(flash, 255, 0x11, 0x00); // VMS colour blue component
- vmufat_write_byte(flash, 255, 0x12, 0x00); // VMS colour green component
- vmufat_write_byte(flash, 255, 0x13, 0x00); // VMS colour red component
- vmufat_write_byte(flash, 255, 0x14, 0x00); // VMS colour alpha component
- vmufat_write_byte(flash, 255, 0x30, 0x19); // Century (BCD)
- vmufat_write_byte(flash, 255, 0x31, 0x99); // Year (BCD)
- vmufat_write_byte(flash, 255, 0x32, 0x01); // Month (BCD)
- vmufat_write_byte(flash, 255, 0x33, 0x01); // Day (BCD)
- vmufat_write_byte(flash, 255, 0x34, 0x00); // Hour (BCD)
- vmufat_write_byte(flash, 255, 0x35, 0x00); // Minute (BCD)
- vmufat_write_byte(flash, 255, 0x36, 0x00); // Second (BCD)
- vmufat_write_byte(flash, 255, 0x37, 0x00); // Day of week (0 = Monday, 6 = Sunday)
- vmufat_write_word(flash, 255, 0x44, 0x00ff); // location of Root
- vmufat_write_word(flash, 255, 0x46, 0x00fe); // location of FAT (254)
- vmufat_write_word(flash, 255, 0x48, 0x0001); // size of FAT in blocks (1)
- vmufat_write_word(flash, 255, 0x4a, 0x00fd); // location of Directory (253)
- vmufat_write_word(flash, 255, 0x4c, 0x000d); // size of Directory in blocks (13)
- vmufat_write_word(flash, 255, 0x4e, 0x0000); // icon shape for this VMS (0-123)
- vmufat_write_word(flash, 255, 0x50, 0x00c8); // number of user blocks (200)
+ vmufat_write_byte(flash, 255, i, 0x55); // first 16 bytes should be 0x55 to indicate a properly formatted card
+
+ vmufat_write_byte(flash, 255, 0x10, 0x00); // custom VMS colour (1 = use custom colours, 0 = standard colour)
+ vmufat_write_byte(flash, 255, 0x11, 0x00); // VMS colour blue component
+ vmufat_write_byte(flash, 255, 0x12, 0x00); // VMS colour green component
+ vmufat_write_byte(flash, 255, 0x13, 0x00); // VMS colour red component
+ vmufat_write_byte(flash, 255, 0x14, 0x00); // VMS colour alpha component
+ vmufat_write_byte(flash, 255, 0x30, 0x19); // Century (BCD)
+ vmufat_write_byte(flash, 255, 0x31, 0x99); // Year (BCD)
+ vmufat_write_byte(flash, 255, 0x32, 0x01); // Month (BCD)
+ vmufat_write_byte(flash, 255, 0x33, 0x01); // Day (BCD)
+ vmufat_write_byte(flash, 255, 0x34, 0x00); // Hour (BCD)
+ vmufat_write_byte(flash, 255, 0x35, 0x00); // Minute (BCD)
+ vmufat_write_byte(flash, 255, 0x36, 0x00); // Second (BCD)
+ vmufat_write_byte(flash, 255, 0x37, 0x00); // Day of week (0 = Monday, 6 = Sunday)
+ vmufat_write_word(flash, 255, 0x44, 0x00ff); // location of Root
+ vmufat_write_word(flash, 255, 0x46, 0x00fe); // location of FAT (254)
+ vmufat_write_word(flash, 255, 0x48, 0x0001); // size of FAT in blocks (1)
+ vmufat_write_word(flash, 255, 0x4a, 0x00fd); // location of Directory (253)
+ vmufat_write_word(flash, 255, 0x4c, 0x000d); // size of Directory in blocks (13)
+ vmufat_write_word(flash, 255, 0x4e, 0x0000); // icon shape for this VMS (0-123)
+ vmufat_write_word(flash, 255, 0x50, 0x00c8); // number of user blocks (200)
for (int i=0; i<256; i++)
- vmufat_write_word(flash, 254, i<<1, 0xfffc); // marks all blocks as unallocated
+ vmufat_write_word(flash, 254, i<<1, 0xfffc); // marks all blocks as unallocated
for (int i=253; i>241; --i)
- vmufat_write_word(flash, 254, i<<1, i - 1); // marsk all Directory blocks as allocate
+ vmufat_write_word(flash, 254, i<<1, i - 1); // marsk all Directory blocks as allocate
- vmufat_write_word(flash, 254, 0x1e2, 0xfffa); // marks last Directory block
- vmufat_write_word(flash, 254, 0x1fc, 0xfffa); // marks FAT block as allocated
- vmufat_write_word(flash, 254, 0x1fe, 0xfffa); // marks Root block as allocated
+ vmufat_write_word(flash, 254, 0x1e2, 0xfffa); // marks last Directory block
+ vmufat_write_word(flash, 254, 0x1fc, 0xfffa); // marks FAT block as allocated
+ vmufat_write_word(flash, 254, 0x1fe, 0xfffa); // marks Root block as allocated
//-------------------------------- Create the vms file --------------------------------
int vms_blocks = (size / 512) + (size & 0x1ff ? 1 : 0); // number of blocks required for store the vms file
for (int i=0; i<vms_blocks - 1; i++)
- vmufat_write_word(flash, 254, i<<1, i + 1); // marks blocks where the file is allocated
+ vmufat_write_word(flash, 254, i<<1, i + 1); // marks blocks where the file is allocated
- vmufat_write_word(flash, 254, (vms_blocks-1)<<1, 0xfffa); // last block for this file
+ vmufat_write_word(flash, 254, (vms_blocks-1)<<1, 0xfffa); // last block for this file
- vmufat_write_byte(flash, 253, 0x00, 0xcc); // file type (0x00 = no file, 0x33 = data, 0xcc = game)
- vmufat_write_byte(flash, 253, 0x01, 0x00); // copy protect (0x00 = no, 0xff = yes)
- vmufat_write_word(flash, 253, 0x02, 0x0000); // location of first file block
+ vmufat_write_byte(flash, 253, 0x00, 0xcc); // file type (0x00 = no file, 0x33 = data, 0xcc = game)
+ vmufat_write_byte(flash, 253, 0x01, 0x00); // copy protect (0x00 = no, 0xff = yes)
+ vmufat_write_word(flash, 253, 0x02, 0x0000); // location of first file block
const char *vms_filename = image.basename_noext();
for (int i=0; i<12; i++)
{
if (i < strlen(vms_filename))
- vmufat_write_byte(flash, 253, i + 4, vms_filename[i]); // 12 bytes filename
+ vmufat_write_byte(flash, 253, i + 4, vms_filename[i]); // 12 bytes filename
else
- vmufat_write_byte(flash, 253, i + 4, 0x20); // space padded
+ vmufat_write_byte(flash, 253, i + 4, 0x20); // space padded
}
- vmufat_write_byte(flash, 253, 0x10, 0x19); // Century (BCD)
- vmufat_write_byte(flash, 253, 0x11, 0x99); // Year (BCD)
- vmufat_write_byte(flash, 253, 0x12, 0x01); // Month (BCD)
- vmufat_write_byte(flash, 253, 0x13, 0x01); // Day (BCD)
- vmufat_write_byte(flash, 253, 0x14, 0x00); // Hour (BCD)
- vmufat_write_byte(flash, 253, 0x15, 0x00); // Minute (BCD)
- vmufat_write_byte(flash, 253, 0x16, 0x00); // Second (BCD)
- vmufat_write_byte(flash, 253, 0x17, 0x00); // Day of week (0 = Monday, 6 = Sunday)
- vmufat_write_word(flash, 253, 0x18, vms_blocks); // file size (in blocks)
- vmufat_write_word(flash, 253, 0x1a, 0x0001); // offset of header (in blocks) from file start
+ vmufat_write_byte(flash, 253, 0x10, 0x19); // Century (BCD)
+ vmufat_write_byte(flash, 253, 0x11, 0x99); // Year (BCD)
+ vmufat_write_byte(flash, 253, 0x12, 0x01); // Month (BCD)
+ vmufat_write_byte(flash, 253, 0x13, 0x01); // Day (BCD)
+ vmufat_write_byte(flash, 253, 0x14, 0x00); // Hour (BCD)
+ vmufat_write_byte(flash, 253, 0x15, 0x00); // Minute (BCD)
+ vmufat_write_byte(flash, 253, 0x16, 0x00); // Second (BCD)
+ vmufat_write_byte(flash, 253, 0x17, 0x00); // Day of week (0 = Monday, 6 = Sunday)
+ vmufat_write_word(flash, 253, 0x18, vms_blocks); // file size (in blocks)
+ vmufat_write_word(flash, 253, 0x1a, 0x0001); // offset of header (in blocks) from file start
}
return IMAGE_INIT_PASS;
@@ -301,7 +301,7 @@ static MACHINE_CONFIG_START( svmu, svmu_state )
MCFG_CPU_IO_MAP(svmu_io_mem)
/* specific LC8670 configurations */
- MCFG_LC8670_SET_CLOCK_SOURCES(XTAL_32_768kHz, 600000, XTAL_6MHz) // tolerance range of the RC oscillator is 600kHz to 1200kHz
+ MCFG_LC8670_SET_CLOCK_SOURCES(XTAL_32_768kHz, 600000, XTAL_6MHz) // tolerance range of the RC oscillator is 600kHz to 1200kHz
MCFG_LC8670_BANKSWITCH_CB(WRITE8(svmu_state, page_w))
MCFG_LC8670_LCD_UPDATE_CB(svmu_lcd_update)
@@ -330,21 +330,21 @@ MACHINE_CONFIG_END
ROM_START( svmu )
ROM_REGION( 0x10000, "bios", 0 )
ROM_DEFAULT_BIOS("jp1004")
- // these ROMs come from the Sega Katana SDK and are scrambled, a simple way to restore it is to remove the first 4 bytes and xor the whole file for the xor key.
+ // these ROMs come from the Sega Katana SDK and are scrambled, a simple way to restore it is to remove the first 4 bytes and xor the whole file for the xor key.
ROM_SYSTEM_BIOS(0, "jp1001", "VMS Japanese BIOS (v1.001)")
ROMX_LOAD("vmu1001.bin", 0x0000, 0x10000, CRC(e6339f4a) SHA1(688b2e1ff8c60bde6e8b07a2d2695cdacc07bd0c), ROM_BIOS(1))
ROM_SYSTEM_BIOS(1, "jp1002", "VMS Japanese BIOS (v1.002)")
ROMX_LOAD("vmu1002.bin", 0x0000, 0x10000, CRC(6c020d48) SHA1(9ee7c87d7b033235e0b315a0b421e70deb547c7a), ROM_BIOS(2))
ROM_SYSTEM_BIOS(2, "jp1004", "VMS Japanese BIOS (v1.004)")
- ROMX_LOAD("vmu1004.bin", 0x0000, 0x10000, CRC(8e0f867a) SHA1(dc2fa2963138a1049a43f7f36439ad0a416ee8b4), ROM_BIOS(3)) // from Sega Katana SDK (original file: fbios.sbf, CRC: c7c77b3c, xor key: 0x37)
+ ROMX_LOAD("vmu1004.bin", 0x0000, 0x10000, CRC(8e0f867a) SHA1(dc2fa2963138a1049a43f7f36439ad0a416ee8b4), ROM_BIOS(3)) // from Sega Katana SDK (original file: fbios.sbf, CRC: c7c77b3c, xor key: 0x37)
ROM_SYSTEM_BIOS(3, "jp1005", "VMS Japanese BIOS (v1.005)")
ROMX_LOAD("vmu1005.bin", 0x0000, 0x10000, CRC(47623324) SHA1(fca1aceff8a2f8c6826f3a865f4d5ef88dfd9ed1), ROM_BIOS(4))
- ROM_SYSTEM_BIOS(4, "dev1004", "VMS Japanese Dev BIOS (v1.004)") // automatically boot the first game found in the flash
- ROMX_LOAD( "vmsdev1004.bin", 0x0000, 0x10000, CRC(395e25f2) SHA1(37dea034322b5b80b35b2de784298d32c71ba7a3), ROM_BIOS(5)) // from Sega Katana SDK (original file: qbios.sbf, CRC: eed5524c, xor key: 0x43)
+ ROM_SYSTEM_BIOS(4, "dev1004", "VMS Japanese Dev BIOS (v1.004)") // automatically boot the first game found in the flash
+ ROMX_LOAD( "vmsdev1004.bin", 0x0000, 0x10000, CRC(395e25f2) SHA1(37dea034322b5b80b35b2de784298d32c71ba7a3), ROM_BIOS(5)) // from Sega Katana SDK (original file: qbios.sbf, CRC: eed5524c, xor key: 0x43)
ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-COMP( 1998, svmu, 0, 0, svmu , svmu , driver_device, 0, "Sega", "Visual Memory Unit", GAME_NOT_WORKING | GAME_NO_SOUND)
+COMP( 1998, svmu, 0, 0, svmu , svmu , driver_device, 0, "Sega", "Visual Memory Unit", GAME_NOT_WORKING | GAME_NO_SOUND)