AxibugEmuOnline/References/VirtuaNESex_src_191105/NES/Mapper/MapperFDS.h

101 lines
2.1 KiB
C
Raw Normal View History

2024-08-05 17:58:53 +08:00
//////////////////////////////////////////////////////////////////////////
// Mapper020 Nintendo Disk System(FDS) //
//////////////////////////////////////////////////////////////////////////
class Mapper020 : public Mapper
{
public:
Mapper020( NES* parent ) : Mapper(parent) {}
void Reset();
BYTE ExRead ( WORD addr );
void ExWrite( WORD addr, BYTE data );
void WriteLow( WORD addr, BYTE data );
void Write(WORD addr, BYTE data);
void Clock( INT cycles );
void HSync( INT scanline );
void VSync();
BYTE ExCmdRead ( EXCMDRD cmd );
void ExCmdWrite( EXCMDWR cmd, BYTE data );
// For state save
BOOL IsStateSave() { return TRUE; }
void SaveState( LPBYTE p );
void LoadState( LPBYTE p );
void PPU_Latch( WORD addr );
protected:
enum {
BLOCK_READY = 0,
BLOCK_VOLUME_LABEL,
BLOCK_FILE_AMOUNT,
BLOCK_FILE_HEADER,
BLOCK_FILE_DATA,
};
enum {
SIZE_VOLUME_LABEL = 56,
SIZE_FILE_AMOUNT = 2,
SIZE_FILE_HEADER = 16,
};
enum {
OFFSET_VOLUME_LABEL = 0,
OFFSET_FILE_AMOUNT = 56,
OFFSET_FILE_HEADER = 58,
OFFSET_FILE_DATA = 74,
};
enum {
MECHANICAL_SOUND_BOOT = 0,
MECHANICAL_SOUND_SEEKEND,
MECHANICAL_SOUND_MOTOR_ON,
MECHANICAL_SOUND_MOTOR_OFF,
MECHANICAL_SOUND_ALLSTOP,
};
BOOL bDiskThrottle;
INT DiskThrottleTime;
LPBYTE disk;
LPBYTE disk_w;
INT irq_counter, irq_latch; // $4020-$4021
BYTE irq_enable, irq_repeat; // $4022
BYTE irq_occur; // IRQ<52><51><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD>ȊO<C88A>ɂȂ<C982>
BYTE irq_transfer; // <20><><EFBFBD><EFBFBD>ݓ]<5D><><EFBFBD>t<EFBFBD><74><EFBFBD>O
BYTE disk_enable; // Disk I/O enable
BYTE sound_enable; // Sound I/O enable
BYTE RW_start; // <20>ǂݏ<C782><DD8F><EFBFBD><EFBFBD>”\<5C>ɂȂ<C982><C882><EFBFBD><EFBFBD><EFBFBD>IRQ<52><51><EFBFBD><EFBFBD>
BYTE RW_mode; // <20>ǂݏ<C782><DD8F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>h
BYTE disk_motor_mode; // <20>f<EFBFBD>B<EFBFBD>X<EFBFBD>N<EFBFBD><4E><EFBFBD>[<5B>^<5E>[
BYTE disk_eject; // <20>f<EFBFBD>B<EFBFBD>X<EFBFBD>N<EFBFBD>J<EFBFBD>[<5B>h<EFBFBD>̑}<7D><>/<2F><><EFBFBD>}<7D><>
BYTE drive_ready; // <20>ǂݏ<C782><DD8F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǂ<EFBFBD><C782><EFBFBD>
BYTE drive_reset; // <20>h<EFBFBD><68><EFBFBD>C<EFBFBD>u<EFBFBD><75><EFBFBD>Z<EFBFBD>b<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD>
INT block_point;
INT block_mode;
INT size_file_data;
INT file_amount;
INT point;
BYTE first_access;
BYTE disk_side;
BYTE disk_mount_count;
BYTE irq_type;
// For mechanical sound
BYTE sound_startup_flag;
INT sound_startup_timer;
INT sound_seekend_timer;
void MechanicalSound( INT type );
private:
};