Example #1
0
void Beatmap::LoadBeatmap(std::string BeatmapPath)
{
    BeatmapFile.clear();
    HitObjects.clear();
    MsPBs.clear();

    MapPath = BeatmapPath;

    std::vector<std::string> BeatPath;
    SplitString::tokenize(MapPath, BeatPath, "\\");
    MapName = BeatPath[BeatPath.size() - 1];

    std::cout << "Mapname: " << MapName << std::endl;

    Error = 0;
    BeatmapLoaded = false;

    readBeatmap();
    readVersion();
    readMode();

    if(MapMode != 0 && MapVersion > 5)
    {
        Error = 1;
        std::cerr << "Not a valid Osu!:Beatmap." << std::endl;
    }
    else
    {
        readDifficulty();
        readMsPBs();
        readHitObjects();
        BeatmapLoaded = true;
    }
}
Example #2
0
File: ex11.c Project: pbmartins/AC2
int main(void) {
    configureAll();
    EnableInterrupts();                                     // Global Interrupt Enable

    while (1) {
       switch (readMode()) {
        case 0:                                             // Measure input voltage
            IEC0bits.T1IE = 1;                              // Enable timer T1 interrupts
            setPWM(0);                                      // Turn off LED
            break;
        case 1:                                             // Freeze
            IEC0bits.T1IE = 0;                              // Disable timer T1 interrupts
            setPWM(100);                                    // Turn on LED with max brightness
            break;

        case 2:                                             // LED brigthness control
            IEC0bits.T1IE = 0;                              // Disable timer T1 interrupts
            value2displays = pwmValues[readLEDValues()];
            setPWM(value2displays);
            break;

        case 3:
            break;
        }
    }
    return 0;
}
Example #3
0
void 
VC1541::dumpState()
{
	msg("VC1541\n");
	msg("------\n\n");
	msg(" Bit ready timer : %d\n", bitReadyTimer);
	msg("   Head position : Track %d, Bit offset %d\n", halftrack, bitoffset);
	msg("            SYNC : %d\n", sync);
    msg("       Read mode : %s\n", readMode() ? "YES" : "NO");
	msg("\n");
    disk.dumpState();
}
Example #4
0
int readRefill(FILE* f) {
    if (readMode(f)) return 1;

    if (f->buflim > f->bufpos) {
        return 0;
    }
    f->bufpos = 0;
    f->buflim = f->read(f, f->buffer + f->buflim, f->bufsize - 1);
    if (f->buflim == 0) {
        return 1;
    }
    return 0;
}
Example #5
0
void
VC1541::executeByteReady()
{
    assert(bitoffset % 8 == 0);
    
    if (readMode() && !sync) {
        byteReady(read_shiftreg);
    }
    if (writeMode()) {
        write_shiftreg = via2.ora;
        byteReady();
    }
}
Example #6
0
void
Datasette::dumpState()
{
#if 0
    msg("Datasette\n");
    msg("---------\n\n");
    msg(" Bit ready timer : %d\n", bitReadyTimer);
    msg("   Head position : Track %d, Bit offset %d\n", halftrack, bitoffset);
    msg("            SYNC : %d\n", sync);
    msg("       Read mode : %s\n", readMode() ? "YES" : "NO");
    msg("\n");
#endif
}
Example #7
0
File: ex11.c Project: pbmartins/AC2
// Timer 3
void _int_(12) isr_T3(void) {
    unsigned char val = toBcd(value2displays);
    // Send "value2display" global variable to displays
    send2displays(val);
    if (readMode() != 2)
        send2dots(0x0010);
    // Send "value2displays" global variable to PC through UART1
    if (counter++ >= 99) {
        putc(((val & 0x0F0) >> 4) + 48);
        putc('.');
        putc((val & 0x0F) + 48);
        putc('\n');
        counter = 0;
    }
Example #8
0
int fgetc(FILE *f) {
	if (f->bufpolicy == _IONBF) {
		char ch[1];
		if (fread(ch, 1, 1, f)) {
			return ch[0];
		} else {
			return EOF;
		}
	}
	if (readMode(f)) return EOF;
	if (f->bufpos >= f->buflim) {
		if (readRefill(f)) {
			return EOF;
		}
	}
	return f->buffer[f->bufpos++];
}
Example #9
0
void seissol::checkpoint::sionlib::Wavefield::load(real* dofs)
{
	logInfo(rank()) << "Loading wave field checkpoint";

	seissol::checkpoint::CheckPoint::setLoaded();

	int file = open(linkFile(), readMode());
	checkErr(file);

	// Read header
	checkErr(sion_coll_fread(header().data(), header().size(), 1, file), 1);

	// Read dofs
	checkErr(sion_coll_fread(dofs, sizeof(double), numDofs(), file), numDofs());

	// Close the file
	sionClose(file);
}
Example #10
0
void waitBusy() {
	readMode();
	commandMode();

	//D7 =Eingang
	cbi(LCD_DATA_D,LCD_D7);
	cbi(LCD_DATA,LCD_D7);
	int busy;
	do {
		sbi(LCD_CTRL,LCD_E);
		STROBE_DELAY();
		busy=bit_is_set(LCD_INPUT,LCD_D7);
		cbi(LCD_CTRL,LCD_E);

		strobe();
	}while (busy);

	//D7 = Ausgang
	sbi(LCD_DATA_D,LCD_D7);
}
Example #11
0
void
VC1541::executeBitReady()
{
    read_shiftreg <<= 1;

    if (readMode()) {
        
        // Read mode
        read_shiftreg |= readBitFromHead();

        // Set SYNC signal
        if ((read_shiftreg & 0x3FF) == 0x3FF) {

            sync = true;
            
        } else {

            if (sync)
                byteReadyCounter = 0; // Cleared on falling edge of SYNC
            sync = false;
        }
        
    } else {
        
        // Write mode
        writeBitToHead(write_shiftreg & 0x80);
        disk.setModified(true); 
        sync = false;
    }
    write_shiftreg <<= 1;
    
    rotateDisk();
    
    // Perform action if byte is complete
    if (byteReadyCounter++ == 7) {
        executeByteReady();
        byteReadyCounter = 0;
    }
    
    bitReadyTimer += cyclesPerBit[zone];
}
Example #12
0
AMDetectorInfo AMDetector::toInfo() const {
    return AMDetectorInfo(name(), description(), units(), acquisitionTime(), readMode());
}