This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DAA | |
// opcode: 0x27 | |
// cycles: 4 | |
// flags: Z H C | |
void CPU::daa(){ | |
if (!getFlag(FlagBitmaskN)) { // after an addition, adjust if (half-)carry occurred or if result is out of bounds | |
if (getFlag(FlagBitmaskC) || regs.A > 0x99) { regs.A += 0x60; setFlag(FlagBitmaskC,true); } | |
if (getFlag(FlagBitmaskHalfCarry) || (regs.A & 0x0f) > 0x09) { regs.A += 0x6; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// StickyHeadersCollectionViewFlowLayout | |
// | |
// A subclass of UICollectionViewFlowLayout which has UITableView style sticky headers. | |
// | |
// This code is based on Evadne Wu's code^1, with the following changes: | |
// | |
// * Fixes a crash for sections with zero items | |
// * Adds support for UIScrollView's contentInset | |
// * Adds support for UICollectionViewFlowLayout's sectionInset | |
// |