int ElfReader::readHalf(u2 *buf) { return readEndian(buf, 4); }
int ElfReader::readByte(u1 *buf) { return readEndian(buf, 4); }
int ElfReader::readWord(u4 *buf) { return readEndian(buf, 4); }
int ElfReader::readSxword(void *buf) { return readEndian(buf, stdsizes.types.elf_sxword); }
int ElfReader::readOff(void *buf) { return readEndian(buf, stdsizes.types.elf_off); }
int ElfReader::readAddr(void *buf) { return readEndian(buf, stdsizes.types.elf_addr); }
bool sidEmuInitializeSongOld(emuEngine & thisEmuEngine, sidTune & thisTune, uword songNumber) { if (!thisEmuEngine.isReady || !thisTune.status ) { return false; } else { // ------------------------------------------- Determine clock/speed. // Get speed/clock setting for song and preselect // speed/clock descriptions strings, reg = song init akkumulator. ubyte reg = thisTune.selectSong(songNumber) -1; const char* the_description; ubyte the_clock = thisTune.info.clockSpeed; ubyte the_speed = thisTune.info.songSpeed; if (thisEmuEngine.config.forceSongSpeed) { the_clock = thisEmuEngine.config.clockSpeed; } // Select speed description string. if (thisEmuEngine.config.clockSpeed == SIDTUNE_CLOCK_PAL) { if (thisTune.info.songSpeed == SIDTUNE_SPEED_VBI) { the_description = text_PAL_VBI; } else //if (thisTune.info.songSpeed == SIDTUNE_SPEED_CIA_1A) { the_description = text_PAL_CIA; } } else //if (thisEmuEngine.config.clockSpeed == SIDTUNE_CLOCK_NTSC) { if (thisTune.info.songSpeed == SIDTUNE_SPEED_VBI) { the_description = text_NTSC_VBI; } else //if (thisTune.info.songSpeed == SIDTUNE_SPEED_CIA_1A) { the_description = text_NTSC_CIA; } } // Substitute correct VBI frequency. if ((the_clock==SIDTUNE_CLOCK_PAL) && (the_speed==SIDTUNE_SPEED_VBI)) { the_speed = FREQ_VBI_PAL; } if ((the_clock==SIDTUNE_CLOCK_NTSC) && (the_speed==SIDTUNE_SPEED_VBI)) { the_speed = FREQ_VBI_NTSC; } // Transfer the speed settings to the emulator engine. // From here on we don't touch the SID clock speed setting. extern void sidEmuSetReplayingSpeed(int clockMode, uword callsPerSec); // --> 6581_.cpp sidEmuSetReplayingSpeed(the_clock,the_speed); thisTune.info.speedString = the_description; // ------------------------------------------------------------------ thisEmuEngine.MPUreset(); if ( !thisTune.placeSidTuneInC64mem(thisEmuEngine.MPUreturnRAMbase()) ) { return false; } if (thisTune.info.musPlayer) { thisTune.MUS_installPlayer(thisEmuEngine.MPUreturnRAMbase()); } thisEmuEngine.amplifyThreeVoiceTunes(false); // assume digis are used if ( !thisEmuEngine.reset() ) // currently always returns true { return false; } if (thisEmuEngine.config.digiPlayerScans!=0) { // Save the SID registers to allow later comparison. for (int i = 0; i < numberOfC64addr; i++) { oldValues[i] = c64mem2[c64addrTable[i]]; } } // In PlaySID-mode the interpreter will ignore some of the parameters. //bool retcode = interpreter(thisTune.info.initAddr,c64memRamRom(thisTune.info.initAddr),reg,reg,reg); playRamRom = c64memRamRom(thisTune.info.playAddr); // This code is only used to be able to print out the initial IRQ address. if (thisTune.info.playAddr == 0) { // Get the address of the interrupt handler. if ((c64mem1[1] & 2) != 0) // isKernal? { thisTune.setIRQaddress(readEndian(c64mem1[0x0315],c64mem1[0x0314])); // IRQ } else { thisTune.setIRQaddress(readEndian(c64mem1[0xffff],c64mem1[0xfffe])); // NMI } } else { thisTune.setIRQaddress(0); } #if defined(SIDEMU_TIME_COUNT) thisEmuEngine.resetSecondsThisSong(); #endif return true; } // top else (emu&sidtune okay) }