mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
saturn, sfish2: Move existing CD-ROM emulation down into device
This commit is contained in:
parent
36cdf2e7d9
commit
867776875d
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,200 @@
|
||||
// license:LGPL-2.1+
|
||||
// copyright-holders:Angelo Salese, R. Belmont
|
||||
|
||||
#ifndef MAME_MACHINE_STVCD_H
|
||||
#define MAME_MACHINE_STVCD_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cdrom.h"
|
||||
#include "imagedev/chd_cd.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/cdda.h"
|
||||
|
||||
class stvcd_device : public device_t
|
||||
{
|
||||
static constexpr unsigned MAX_FILTERS = 24;
|
||||
static constexpr unsigned MAX_BLOCKS = 200;
|
||||
static constexpr uint32_t MAX_DIR_SIZE = 256*1024;
|
||||
|
||||
public:
|
||||
stvcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
DECLARE_READ32_MEMBER( stvcd_r );
|
||||
DECLARE_WRITE32_MEMBER( stvcd_w );
|
||||
|
||||
void set_tray_open();
|
||||
void set_tray_close();
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_stop() override;
|
||||
|
||||
private:
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( stv_sector_cb );
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( stv_sh1_sim );
|
||||
|
||||
struct direntryT
|
||||
{
|
||||
uint8_t record_size;
|
||||
uint8_t xa_record_size;
|
||||
uint32_t firstfad; // first sector of file
|
||||
uint32_t length; // length of file
|
||||
uint8_t year;
|
||||
uint8_t month;
|
||||
uint8_t day;
|
||||
uint8_t hour;
|
||||
uint8_t minute;
|
||||
uint8_t second;
|
||||
uint8_t gmt_offset;
|
||||
uint8_t flags; // iso9660 flags
|
||||
uint8_t file_unit_size;
|
||||
uint8_t interleave_gap_size;
|
||||
uint16_t volume_sequencer_number;
|
||||
uint8_t name[128];
|
||||
};
|
||||
|
||||
struct filterT
|
||||
{
|
||||
uint8_t mode;
|
||||
uint8_t chan;
|
||||
uint8_t smmask;
|
||||
uint8_t cimask;
|
||||
uint8_t fid;
|
||||
uint8_t smval;
|
||||
uint8_t cival;
|
||||
uint8_t condtrue;
|
||||
uint8_t condfalse;
|
||||
uint32_t fad;
|
||||
uint32_t range;
|
||||
};
|
||||
|
||||
struct blockT
|
||||
{
|
||||
int32_t size; // size of block
|
||||
int32_t FAD; // FAD on disc
|
||||
uint8_t data[CD_MAX_SECTOR_DATA];
|
||||
uint8_t chan; // channel
|
||||
uint8_t fnum; // file number
|
||||
uint8_t subm; // subchannel mode
|
||||
uint8_t cinf; // coding information
|
||||
};
|
||||
|
||||
struct partitionT
|
||||
{
|
||||
int32_t size;
|
||||
blockT *blocks[MAX_BLOCKS];
|
||||
uint8_t bnum[MAX_BLOCKS];
|
||||
uint8_t numblks;
|
||||
};
|
||||
|
||||
// 16-bit transfer types
|
||||
enum transT
|
||||
{
|
||||
XFERTYPE_INVALID,
|
||||
XFERTYPE_TOC,
|
||||
XFERTYPE_FILEINFO_1,
|
||||
XFERTYPE_FILEINFO_254,
|
||||
XFERTYPE_SUBQ,
|
||||
XFERTYPE_SUBRW
|
||||
};
|
||||
|
||||
// 32-bit transfer types
|
||||
enum trans32T
|
||||
{
|
||||
XFERTYPE32_INVALID,
|
||||
XFERTYPE32_GETSECTOR,
|
||||
XFERTYPE32_GETDELETESECTOR,
|
||||
XFERTYPE32_PUTSECTOR,
|
||||
XFERTYPE32_MOVESECTOR
|
||||
};
|
||||
|
||||
int get_track_index(uint32_t fad);
|
||||
int sega_cdrom_get_adr_control(cdrom_file *file, int track);
|
||||
void cr_standard_return(uint16_t cur_status);
|
||||
void mpeg_standard_return(uint16_t cur_status);
|
||||
void cd_free_block(blockT *blktofree);
|
||||
void cd_defragblocks(partitionT *part);
|
||||
void cd_getsectoroffsetnum(uint32_t bufnum, uint32_t *sectoffs, uint32_t *sectnum);
|
||||
|
||||
uint16_t cd_readWord(uint32_t addr);
|
||||
void cd_writeWord(uint32_t addr, uint16_t data);
|
||||
uint32_t cd_readLong(uint32_t addr);
|
||||
void cd_writeLong(uint32_t addr, uint32_t data);
|
||||
|
||||
void cd_readTOC();
|
||||
void cd_readblock(uint32_t fad, uint8_t *dat);
|
||||
void cd_playdata();
|
||||
|
||||
void cd_exec_command( void );
|
||||
// iso9660 utilities
|
||||
void make_dir_current(uint32_t fad);
|
||||
void read_new_dir(uint32_t fileno);
|
||||
|
||||
blockT *cd_alloc_block(uint8_t *blknum);
|
||||
partitionT *cd_filterdata(filterT *flt, int trktype, uint8_t *p_ok);
|
||||
partitionT *cd_read_filtered_sector(int32_t fad, uint8_t *p_ok);
|
||||
|
||||
cdrom_file *cdrom;// = (cdrom_file *)nullptr;
|
||||
|
||||
// local variables
|
||||
partitionT partitions[MAX_FILTERS];
|
||||
partitionT *transpart;
|
||||
|
||||
blockT blocks[MAX_BLOCKS];
|
||||
blockT curblock;
|
||||
|
||||
uint8_t tocbuf[102*4];
|
||||
uint8_t subqbuf[5*2];
|
||||
uint8_t subrwbuf[12*2];
|
||||
uint8_t finfbuf[256];
|
||||
|
||||
int32_t sectlenin, sectlenout;
|
||||
|
||||
uint8_t lastbuf, playtype;
|
||||
|
||||
transT xfertype;
|
||||
trans32T xfertype32;
|
||||
uint32_t xfercount, calcsize;
|
||||
uint32_t xferoffs, xfersect, xfersectpos, xfersectnum, xferdnum;
|
||||
|
||||
filterT filters[MAX_FILTERS];
|
||||
filterT *cddevice;
|
||||
int cddevicenum;
|
||||
|
||||
uint16_t cr1, cr2, cr3, cr4;
|
||||
uint16_t prev_cr1, prev_cr2, prev_cr3, prev_cr4;
|
||||
uint8_t status_type;
|
||||
uint16_t hirqmask, hirqreg;
|
||||
uint16_t cd_stat;
|
||||
uint32_t cd_curfad;// = 0;
|
||||
uint32_t cd_fad_seek;
|
||||
uint32_t fadstoplay;// = 0;
|
||||
uint32_t in_buffer;// = 0; // amount of data in the buffer
|
||||
int oddframe;// = 0;
|
||||
int buffull, sectorstore, freeblocks;
|
||||
int cur_track;
|
||||
uint8_t cmd_pending;
|
||||
uint8_t cd_speed;
|
||||
uint8_t cdda_maxrepeat;
|
||||
uint8_t cdda_repeat_count;
|
||||
uint8_t tray_is_closed;
|
||||
int get_timing_command( void );
|
||||
|
||||
direntryT curroot; // root entry of current filesystem
|
||||
std::vector<direntryT> curdir; // current directory
|
||||
int numfiles; // # of entries in current directory
|
||||
int firstfile; // first non-directory file
|
||||
|
||||
required_device<cdrom_image_device> m_cdrom_image;
|
||||
required_device<timer_device> m_sector_timer;
|
||||
required_device<timer_device> m_sh1_timer;
|
||||
required_device<cdda_device> m_cdda;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(STVCD, stvcd_device)
|
||||
|
||||
#endif // MAME_MACHINE_STVCD_H
|
||||
|
@ -428,12 +428,10 @@ test1f diagnostic hacks:
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/scudsp/scudsp.h"
|
||||
#include "cpu/sh/sh2.h"
|
||||
#include "imagedev/chd_cd.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/smpc.h"
|
||||
#include "machine/stvcd.h"
|
||||
#include "machine/saturn_cdb.h"
|
||||
#include "sound/cdda.h"
|
||||
#include "sound/scsp.h"
|
||||
#include "video/stvvdp1.h"
|
||||
#include "video/stvvdp2.h"
|
||||
@ -443,6 +441,8 @@ test1f diagnostic hacks:
|
||||
#include "bus/saturn/rom.h"
|
||||
#include "bus/saturn/sat_slot.h"
|
||||
|
||||
#include "bus/sat_ctrl/ctrl.h"
|
||||
|
||||
#include "screen.h"
|
||||
#include "softlist.h"
|
||||
#include "speaker.h"
|
||||
@ -456,6 +456,7 @@ public:
|
||||
: saturn_state(mconfig, type, tag)
|
||||
, m_exp(*this, "exp")
|
||||
, m_nvram(*this, "nvram")
|
||||
, m_stvcd(*this, "stvcd")
|
||||
, m_ctrl1(*this, "ctrl1")
|
||||
, m_ctrl2(*this, "ctrl2")
|
||||
{ }
|
||||
@ -489,6 +490,7 @@ public:
|
||||
|
||||
required_device<sat_cart_slot_device> m_exp;
|
||||
required_device<nvram_device> m_nvram;
|
||||
required_device<stvcd_device> m_stvcd;
|
||||
|
||||
required_device<saturn_control_port_device> m_ctrl1;
|
||||
required_device<saturn_control_port_device> m_ctrl2;
|
||||
@ -529,7 +531,7 @@ ADDRESS_MAP_START(sat_console_state::saturn_mem)
|
||||
// AM_RANGE(0x04000000, 0x047fffff) AM_RAM // External Battery RAM area
|
||||
AM_RANGE(0x04fffffc, 0x04ffffff) AM_READ8(saturn_cart_type_r,0x000000ff)
|
||||
AM_RANGE(0x05000000, 0x057fffff) AM_READ(abus_dummy_r)
|
||||
AM_RANGE(0x05800000, 0x0589ffff) AM_READWRITE(stvcd_r, stvcd_w)
|
||||
AM_RANGE(0x05800000, 0x0589ffff) AM_DEVREADWRITE("stvcd", stvcd_device, stvcd_r, stvcd_w)
|
||||
/* Sound */
|
||||
AM_RANGE(0x05a00000, 0x05a7ffff) AM_READWRITE16(saturn_soundram_r, saturn_soundram_w,0xffffffff)
|
||||
AM_RANGE(0x05b00000, 0x05b00fff) AM_DEVREADWRITE16("scsp", scsp_device, read, write, 0xffffffff)
|
||||
@ -556,13 +558,13 @@ ADDRESS_MAP_END
|
||||
INPUT_CHANGED_MEMBER(sat_console_state::tray_open)
|
||||
{
|
||||
if(newval)
|
||||
stvcd_set_tray_open();
|
||||
m_stvcd->set_tray_open();
|
||||
}
|
||||
|
||||
INPUT_CHANGED_MEMBER(sat_console_state::tray_close)
|
||||
{
|
||||
if(newval)
|
||||
stvcd_set_tray_close();
|
||||
m_stvcd->set_tray_close();
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( saturn )
|
||||
@ -655,8 +657,6 @@ MACHINE_START_MEMBER(sat_console_state, saturn)
|
||||
save_item(NAME(m_scsp_last_line));
|
||||
save_item(NAME(m_vdp2.odd));
|
||||
|
||||
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&sat_console_state::stvcd_exit, this));
|
||||
|
||||
// TODO: trampoline
|
||||
m_audiocpu->set_reset_callback(write_line_delegate(FUNC(saturn_state::m68k_reset_callback),this));
|
||||
}
|
||||
@ -687,8 +687,6 @@ MACHINE_RESET_MEMBER(sat_console_state,saturn)
|
||||
m_maincpu->set_unscaled_clock(MASTER_CLOCK_320/2);
|
||||
m_slave->set_unscaled_clock(MASTER_CLOCK_320/2);
|
||||
|
||||
stvcd_reset();
|
||||
|
||||
m_vdp2.old_crmd = -1;
|
||||
m_vdp2.old_tvmd = -1;
|
||||
}
|
||||
@ -826,9 +824,6 @@ MACHINE_CONFIG_START(sat_console_state::saturn)
|
||||
|
||||
MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", sat_console_state, nvram_init)
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("sector_timer", sat_console_state, stv_sector_cb)
|
||||
MCFG_TIMER_DRIVER_ADD("sh1_cmd", sat_console_state, stv_sh1_sim)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_320/8, 427, 0, 320, 263, 0, 224)
|
||||
@ -847,9 +842,9 @@ MACHINE_CONFIG_START(sat_console_state::saturn)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
MCFG_SOUND_ADD("cdda", CDDA, 0)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MCFG_DEVICE_ADD("stvcd", STVCD, 0)
|
||||
//MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
//MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
MCFG_SATURN_CONTROL_PORT_ADD("ctrl1", saturn_controls, "joypad")
|
||||
MCFG_SATURN_CONTROL_PORT_ADD("ctrl2", saturn_controls, "joypad")
|
||||
@ -868,8 +863,6 @@ SLOT_INTERFACE_END
|
||||
|
||||
MACHINE_CONFIG_START(sat_console_state::saturnus)
|
||||
saturn(config);
|
||||
MCFG_CDROM_ADD( "cdrom" )
|
||||
MCFG_CDROM_INTERFACE("sat_cdrom")
|
||||
MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
|
||||
|
||||
MCFG_SOFTWARE_LIST_ADD("cd_list","saturn")
|
||||
@ -885,8 +878,6 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sat_console_state::saturneu)
|
||||
saturn(config);
|
||||
MCFG_CDROM_ADD( "cdrom" )
|
||||
MCFG_CDROM_INTERFACE("sat_cdrom")
|
||||
MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
|
||||
|
||||
MCFG_SOFTWARE_LIST_ADD("cd_list","saturn")
|
||||
@ -901,8 +892,6 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(sat_console_state::saturnjp)
|
||||
saturn(config);
|
||||
MCFG_CDROM_ADD( "cdrom" )
|
||||
MCFG_CDROM_INTERFACE("sat_cdrom")
|
||||
MCFG_DEVICE_ADD("saturn_cdb", SATURN_CDB, 16000000)
|
||||
|
||||
MCFG_SOFTWARE_LIST_ADD("cd_list","saturn")
|
||||
@ -918,7 +907,6 @@ MACHINE_CONFIG_END
|
||||
|
||||
void sat_console_state::saturn_init_driver(int rgn)
|
||||
{
|
||||
// m_saturn_region = rgn;
|
||||
m_vdp2.pal = (rgn == 12) ? 1 : 0;
|
||||
|
||||
// set compatible options
|
||||
|
@ -42,8 +42,8 @@
|
||||
#include "cpu/scudsp/scudsp.h"
|
||||
#include "cpu/sh/sh2.h"
|
||||
#include "imagedev/chd_cd.h"
|
||||
#include "machine/eepromser.h"
|
||||
#include "machine/smpc.h"
|
||||
#include "machine/stvcd.h"
|
||||
#include "machine/stvprot.h"
|
||||
#include "sound/cdda.h"
|
||||
#include "sound/scsp.h"
|
||||
@ -984,7 +984,6 @@ ADDRESS_MAP_START(stv_state::stv_mem)
|
||||
AM_RANGE(0x01000000, 0x017fffff) AM_WRITE(minit_w)
|
||||
AM_RANGE(0x01800000, 0x01ffffff) AM_WRITE(sinit_w)
|
||||
AM_RANGE(0x02000000, 0x04ffffff) AM_ROM AM_MIRROR(0x20000000) AM_REGION("abus", 0) // cartridge
|
||||
AM_RANGE(0x05800000, 0x0589ffff) AM_READWRITE(stvcd_r, stvcd_w)
|
||||
/* Sound */
|
||||
AM_RANGE(0x05a00000, 0x05afffff) AM_READWRITE16(saturn_soundram_r, saturn_soundram_w,0xffffffff)
|
||||
AM_RANGE(0x05b00000, 0x05b00fff) AM_DEVREADWRITE16("scsp", scsp_device, read, write, 0xffffffff)
|
||||
@ -1001,6 +1000,11 @@ ADDRESS_MAP_START(stv_state::stv_mem)
|
||||
AM_RANGE(0xc0000000, 0xc00007ff) AM_RAM // cache RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START(stv_state::stvcd_mem)
|
||||
AM_IMPORT_FROM(stv_mem)
|
||||
AM_RANGE(0x05800000, 0x0589ffff) AM_DEVREADWRITE("stvcd", stvcd_device, stvcd_r, stvcd_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START(stv_state::sound_mem)
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_RAM AM_SHARE("sound_ram")
|
||||
AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("scsp", scsp_device, read, write)
|
||||
@ -1097,9 +1101,6 @@ MACHINE_CONFIG_START(stv_state::stv)
|
||||
|
||||
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") /* Actually AK93C45F */
|
||||
|
||||
MCFG_TIMER_DRIVER_ADD("sector_timer", stv_state, stv_sector_cb)
|
||||
MCFG_TIMER_DRIVER_ADD("sh1_cmd", stv_state, stv_sh1_sim)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
|
||||
@ -1118,11 +1119,6 @@ MACHINE_CONFIG_START(stv_state::stv)
|
||||
MCFG_SCSP_MAIN_IRQ_CB(DEVWRITELINE("scu", sega_scu_device, sound_req_w))
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
MCFG_SOUND_ADD("cdda", CDDA, 0)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(stv_state::stv_5881)
|
||||
@ -1131,6 +1127,17 @@ MACHINE_CONFIG_START(stv_state::stv_5881)
|
||||
MCFG_SET_READ_CALLBACK(stv_state, crypt_read_callback)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(stv_state::stvcd)
|
||||
stv(config);
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_CPU_PROGRAM_MAP(stvcd_mem)
|
||||
MCFG_DEVICE_MODIFY("slave")
|
||||
MCFG_CPU_PROGRAM_MAP(stvcd_mem)
|
||||
MCFG_DEVICE_ADD("stvcd", STVCD, 0)
|
||||
//MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
//MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
uint16_t stv_state::crypt_read_callback_ch1(uint32_t addr)
|
||||
{
|
||||
@ -1229,8 +1236,6 @@ MACHINE_RESET_MEMBER(stv_state,stv)
|
||||
m_maincpu->set_unscaled_clock(MASTER_CLOCK_320/2);
|
||||
m_slave->set_unscaled_clock(MASTER_CLOCK_320/2);
|
||||
|
||||
stvcd_reset();
|
||||
|
||||
m_prev_gamebank_select = 0xff;
|
||||
|
||||
m_vdp2.old_crmd = -1;
|
||||
@ -1285,8 +1290,6 @@ MACHINE_START_MEMBER(stv_state,stv)
|
||||
|
||||
stv_register_protection_savestates(); // machine/stvprot.c
|
||||
|
||||
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&stv_state::stvcd_exit, this));
|
||||
|
||||
m_audiocpu->set_reset_callback(write_line_delegate(FUNC(stv_state::m68k_reset_callback),this));
|
||||
}
|
||||
|
||||
@ -2889,7 +2892,7 @@ ROM_START( sfish2 )
|
||||
ROM_LOAD16_WORD_SWAP( "mpr-18274.ic3", 0x0800000, 0x0400000, CRC(a6d76d23) SHA1(eee8c824eff4485d1b3af93a4fd5b21262eec803) ) // good
|
||||
ROM_LOAD16_WORD_SWAP( "mpr-18275.ic4", 0x0c00000, 0x0200000, CRC(7691deca) SHA1(aabb6b098963caf51f66aefa0a97aed7eb86c308) ) // good
|
||||
|
||||
DISK_REGION( "cdrom" )
|
||||
DISK_REGION( "stvcd" )
|
||||
DISK_IMAGE_READONLY( "cdp-00428", 0, SHA1(166cb5518fa5e0ab15d40dade70fa8913089dcd2) )
|
||||
|
||||
ROM_REGION32_BE( 0x3000000, "abus", ROMREGION_ERASE00 ) /* SH2 code */
|
||||
@ -2909,7 +2912,7 @@ ROM_START( sfish2j )
|
||||
ROM_LOAD16_WORD_SWAP( "mpr-18273.ic2", 0x0400000, 0x0400000, CRC(6fec0193) SHA1(5bbda289a5ca58c5bf57307360b07f0bb98f7356) ) // good
|
||||
ROM_LOAD16_WORD_SWAP( "mpr-18274.ic3", 0x0800000, 0x0400000, CRC(a6d76d23) SHA1(eee8c824eff4485d1b3af93a4fd5b21262eec803) ) // good
|
||||
|
||||
DISK_REGION( "cdrom" )
|
||||
DISK_REGION( "stvcd" )
|
||||
DISK_IMAGE_READONLY( "cdp-00386b", 0, SHA1(2cb357a930bb7fa668949717ec6daaad2669d137) )
|
||||
|
||||
ROM_REGION32_BE( 0x3000000, "abus", ROMREGION_ERASE00 ) /* SH2 code */
|
||||
@ -3719,8 +3722,8 @@ GAME( 1998, choroqhr, stvbios, stv, stv, stv_state, stv, ROT
|
||||
GAME( 2000, sackids, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Soreyuke Anpanman Crayon Kids (J 001026 V1.000)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
|
||||
|
||||
/* CD games */
|
||||
GAME( 1995, sfish2, 0, stv, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (UET 951106 V1.10e)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1995, sfish2j, sfish2, stv, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (J 951201 V1.100)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1995, sfish2, 0, stvcd, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (UET 951106 V1.10e)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1995, sfish2j, sfish2, stvcd, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (J 951201 V1.100)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN )
|
||||
|
||||
/*
|
||||
This is the known list of undumped ST-V games:
|
||||
|
@ -1,16 +1,12 @@
|
||||
// license:LGPL-2.1+
|
||||
// copyright-holders:David Haywood, Angelo Salese, Olivier Galibert, Mariusz Wojcieszek, R. Belmont
|
||||
|
||||
#include "cdrom.h"
|
||||
#include "machine/timer.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/adsp2100/adsp2100.h"
|
||||
#include "machine/sega_scu.h"
|
||||
#include "machine/smpc.h"
|
||||
#include "cpu/sh/sh2.h"
|
||||
|
||||
#include "bus/sat_ctrl/ctrl.h"
|
||||
|
||||
#include "bus/generic/slot.h"
|
||||
#include "bus/generic/carts.h"
|
||||
|
||||
@ -21,10 +17,6 @@
|
||||
#include "debug/debugcmd.h"
|
||||
#include "debugger.h"
|
||||
|
||||
#define MAX_FILTERS (24)
|
||||
#define MAX_BLOCKS (200)
|
||||
#define MAX_DIR_SIZE (256*1024)
|
||||
|
||||
class saturn_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -104,11 +96,6 @@ public:
|
||||
int old_tvmd;
|
||||
}m_vdp2;
|
||||
|
||||
/* Saturn specific*/
|
||||
int m_saturn_region;
|
||||
uint8_t m_cart_type;
|
||||
uint32_t *m_cart_dram;
|
||||
|
||||
required_device<sh2_device> m_maincpu;
|
||||
required_device<sh2_device> m_slave;
|
||||
required_device<m68000_base_device> m_audiocpu;
|
||||
@ -422,173 +409,6 @@ public:
|
||||
|
||||
} stv_rbg_cache_data;
|
||||
|
||||
/* stvcd */
|
||||
DECLARE_READ32_MEMBER( stvcd_r );
|
||||
DECLARE_WRITE32_MEMBER( stvcd_w );
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( stv_sector_cb );
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( stv_sh1_sim );
|
||||
|
||||
struct direntryT
|
||||
{
|
||||
uint8_t record_size;
|
||||
uint8_t xa_record_size;
|
||||
uint32_t firstfad; // first sector of file
|
||||
uint32_t length; // length of file
|
||||
uint8_t year;
|
||||
uint8_t month;
|
||||
uint8_t day;
|
||||
uint8_t hour;
|
||||
uint8_t minute;
|
||||
uint8_t second;
|
||||
uint8_t gmt_offset;
|
||||
uint8_t flags; // iso9660 flags
|
||||
uint8_t file_unit_size;
|
||||
uint8_t interleave_gap_size;
|
||||
uint16_t volume_sequencer_number;
|
||||
uint8_t name[128];
|
||||
};
|
||||
|
||||
struct filterT
|
||||
{
|
||||
uint8_t mode;
|
||||
uint8_t chan;
|
||||
uint8_t smmask;
|
||||
uint8_t cimask;
|
||||
uint8_t fid;
|
||||
uint8_t smval;
|
||||
uint8_t cival;
|
||||
uint8_t condtrue;
|
||||
uint8_t condfalse;
|
||||
uint32_t fad;
|
||||
uint32_t range;
|
||||
};
|
||||
|
||||
struct blockT
|
||||
{
|
||||
int32_t size; // size of block
|
||||
int32_t FAD; // FAD on disc
|
||||
uint8_t data[CD_MAX_SECTOR_DATA];
|
||||
uint8_t chan; // channel
|
||||
uint8_t fnum; // file number
|
||||
uint8_t subm; // subchannel mode
|
||||
uint8_t cinf; // coding information
|
||||
};
|
||||
|
||||
struct partitionT
|
||||
{
|
||||
int32_t size;
|
||||
blockT *blocks[MAX_BLOCKS];
|
||||
uint8_t bnum[MAX_BLOCKS];
|
||||
uint8_t numblks;
|
||||
};
|
||||
|
||||
// 16-bit transfer types
|
||||
enum transT
|
||||
{
|
||||
XFERTYPE_INVALID,
|
||||
XFERTYPE_TOC,
|
||||
XFERTYPE_FILEINFO_1,
|
||||
XFERTYPE_FILEINFO_254,
|
||||
XFERTYPE_SUBQ,
|
||||
XFERTYPE_SUBRW
|
||||
};
|
||||
|
||||
// 32-bit transfer types
|
||||
enum trans32T
|
||||
{
|
||||
XFERTYPE32_INVALID,
|
||||
XFERTYPE32_GETSECTOR,
|
||||
XFERTYPE32_GETDELETESECTOR,
|
||||
XFERTYPE32_PUTSECTOR,
|
||||
XFERTYPE32_MOVESECTOR
|
||||
};
|
||||
|
||||
|
||||
void stvcd_reset(void);
|
||||
void stvcd_exit(void);
|
||||
void stvcd_set_tray_open(void);
|
||||
void stvcd_set_tray_close(void);
|
||||
|
||||
int get_track_index(uint32_t fad);
|
||||
int sega_cdrom_get_adr_control(cdrom_file *file, int track);
|
||||
void cr_standard_return(uint16_t cur_status);
|
||||
void mpeg_standard_return(uint16_t cur_status);
|
||||
void cd_free_block(blockT *blktofree);
|
||||
void cd_defragblocks(partitionT *part);
|
||||
void cd_getsectoroffsetnum(uint32_t bufnum, uint32_t *sectoffs, uint32_t *sectnum);
|
||||
|
||||
uint16_t cd_readWord(uint32_t addr);
|
||||
void cd_writeWord(uint32_t addr, uint16_t data);
|
||||
uint32_t cd_readLong(uint32_t addr);
|
||||
void cd_writeLong(uint32_t addr, uint32_t data);
|
||||
|
||||
void cd_readTOC(void);
|
||||
void cd_readblock(uint32_t fad, uint8_t *dat);
|
||||
void cd_playdata(void);
|
||||
|
||||
void cd_exec_command( void );
|
||||
// iso9660 utilities
|
||||
void make_dir_current(uint32_t fad);
|
||||
void read_new_dir(uint32_t fileno);
|
||||
|
||||
blockT *cd_alloc_block(uint8_t *blknum);
|
||||
partitionT *cd_filterdata(filterT *flt, int trktype, uint8_t *p_ok);
|
||||
partitionT *cd_read_filtered_sector(int32_t fad, uint8_t *p_ok);
|
||||
|
||||
cdrom_file *cdrom;// = (cdrom_file *)nullptr;
|
||||
|
||||
// local variables
|
||||
timer_device *sector_timer;
|
||||
timer_device *sh1_timer;
|
||||
partitionT partitions[MAX_FILTERS];
|
||||
partitionT *transpart;
|
||||
|
||||
blockT blocks[MAX_BLOCKS];
|
||||
blockT curblock;
|
||||
|
||||
uint8_t tocbuf[102*4];
|
||||
uint8_t subqbuf[5*2];
|
||||
uint8_t subrwbuf[12*2];
|
||||
uint8_t finfbuf[256];
|
||||
|
||||
int32_t sectlenin, sectlenout;
|
||||
|
||||
uint8_t lastbuf, playtype;
|
||||
|
||||
transT xfertype;
|
||||
trans32T xfertype32;
|
||||
uint32_t xfercount, calcsize;
|
||||
uint32_t xferoffs, xfersect, xfersectpos, xfersectnum, xferdnum;
|
||||
|
||||
filterT filters[MAX_FILTERS];
|
||||
filterT *cddevice;
|
||||
int cddevicenum;
|
||||
|
||||
uint16_t cr1, cr2, cr3, cr4;
|
||||
uint16_t prev_cr1, prev_cr2, prev_cr3, prev_cr4;
|
||||
uint8_t status_type;
|
||||
uint16_t hirqmask, hirqreg;
|
||||
uint16_t cd_stat;
|
||||
uint32_t cd_curfad;// = 0;
|
||||
uint32_t cd_fad_seek;
|
||||
uint32_t fadstoplay;// = 0;
|
||||
uint32_t in_buffer;// = 0; // amount of data in the buffer
|
||||
int oddframe;// = 0;
|
||||
int buffull, sectorstore, freeblocks;
|
||||
int cur_track;
|
||||
uint8_t cmd_pending;
|
||||
uint8_t cd_speed;
|
||||
uint8_t cdda_maxrepeat;
|
||||
uint8_t cdda_repeat_count;
|
||||
uint8_t tray_is_closed;
|
||||
int get_timing_command( void );
|
||||
|
||||
direntryT curroot; // root entry of current filesystem
|
||||
std::vector<direntryT> curdir; // current directory
|
||||
int numfiles; // # of entries in current directory
|
||||
int firstfile; // first non-directory file
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(m68k_reset_callback);
|
||||
|
||||
// DECLARE_WRITE_LINE_MEMBER(scudsp_end_w);
|
||||
|
@ -147,8 +147,10 @@ public:
|
||||
void batmanfr(machine_config &config);
|
||||
void stv_5838(machine_config &config);
|
||||
void stv_5881(machine_config &config);
|
||||
void stvcd(machine_config &config);
|
||||
void sound_mem(address_map &map);
|
||||
void stv_mem(address_map &map);
|
||||
void stvcd_mem(address_map &map);
|
||||
};
|
||||
|
||||
class stvpc_state : public stv_state
|
||||
|
Loading…
Reference in New Issue
Block a user