示例#1
0
C64::C64()
{
	setDescription("C64");
	debug(1, "Creating virtual C64 at address %p\n", this);

	p = NULL;    
    warp = false;
    alwaysWarp = false;
    warpLoad = false;
	
    // Register sub components
    VirtualComponent *subcomponents[] = {
        
        &cpu,
        &mem,
        &vic,
        &sid,
        &cia1, &cia2,
        &iec,
        &expansionport,
        &floppy,
        &datasette,
        &keyboard,
        &joystickA,
        &joystickB,
        NULL };
    
    registerSubComponents(subcomponents, sizeof(subcomponents));
    setC64(this);
    
    // Register snapshot items
    SnapshotItem items[] = {
 
        { &warp,            sizeof(warp),               CLEAR_ON_RESET },
        { &alwaysWarp,      sizeof(alwaysWarp),         CLEAR_ON_RESET },
        { &warpLoad,        sizeof(warpLoad),           KEEP_ON_RESET },
        { &cycle,           sizeof(cycle),              CLEAR_ON_RESET },
        { &frame,           sizeof(frame),              CLEAR_ON_RESET },
        { &rasterline,      sizeof(rasterline),         CLEAR_ON_RESET },
        { &rasterlineCycle, sizeof(rasterlineCycle),    CLEAR_ON_RESET },
        { NULL,             0,                          0 }};
    
    registerSnapshotItems(items, sizeof(items));

    // Configure machine type and reset
    setPAL();
    reset();
			
    // Initialie mach timer info
    mach_timebase_info(&timebase);

	// Initialize snapshot ringbuffer (BackInTime feature)
	for (unsigned i = 0; i < BACK_IN_TIME_BUFFER_SIZE; i++)
		backInTimeHistory[i] = new Snapshot();	
	backInTimeWritePtr = 0;
}
示例#2
0
C64::C64()
{	
	name = "C64";
	
	debug(1, "Creating virtual C64\n");

	p = NULL;    
    warp = false;
    alwaysWarp = false;
    warpLoad = false;
	
	// Create components
	cpu = new CPU();
    mem = new C64Memory();
	vic = new VIC();
	sid = new SIDWrapper();
	cia1 = new CIA1();
	cia2 = new CIA2();
	iec = new IEC();
    expansionport = new ExpansionPort();
	floppy = new VC1541();
    keyboard = new Keyboard();
    joystick1 = new Joystick();
    joystick2 = new Joystick();

    // Register sub components
    VirtualComponent *subcomponents[] = {
        
        cpu,
        mem,
        vic,
        sid,
        cia1, cia2,
        iec,
        expansionport,
        floppy,
        &datasette,
        keyboard,
        joystick1, joystick2,
        NULL };
    
    registerSubComponents(subcomponents, sizeof(subcomponents));
    setC64(this);
    
    // Register snapshot items
    SnapshotItem items[] = {
 
        { &warpLoad,        sizeof(warpLoad),           KEEP_ON_RESET },

        { &alwaysWarp,      sizeof(alwaysWarp),         CLEAR_ON_RESET },
        { &warp,            sizeof(warp),               CLEAR_ON_RESET },
        { &cycles,          sizeof(cycles),             CLEAR_ON_RESET },
        { &frame,           sizeof(frame),              CLEAR_ON_RESET },
        { &rasterline,      sizeof(rasterline),         CLEAR_ON_RESET },
        { &rasterlineCycle, sizeof(rasterlineCycle),    CLEAR_ON_RESET },
        { NULL,             0,                          0 }};
    
    registerSnapshotItems(items, sizeof(items));

    // Configure machine type and reset
    setPAL();
    reset();
			
    // Initialie mach timer info
    mach_timebase_info(&timebase);

	// Initialize snapshot ringbuffer (BackInTime feature)
	for (unsigned i = 0; i < BACK_IN_TIME_BUFFER_SIZE; i++)
		backInTimeHistory[i] = new Snapshot();	
	backInTimeWritePtr = 0;
}