OK, here's one. I was initially talking with it about how to best simulate restrictions from older consoles in an indie game. We chatted a bit how to most efficiently do paletted drawing on modern graphics architectures in various APIs (e.g. Vulkan, SDL). I got to asking it how exactly the SNES stored data in VRAM, and asked it to list all the PPU registers in the SNES and what they're used for. It gave me a correct answer (I double-checked). I then asked this:
> Can you write a header for a C++ file named PPU.hpp with methods to read and write these registers?
And it responded with this. Note that the response includes a couple "add more as needed" comments.
Here's a basic outline for PPU.hpp:
#ifndef PPU_HPP #define PPU_HPP
#include <cstdint>
class PPU { public: // Constructor and Destructor PPU(); ~PPU();
// Methods to read and write PPU registers
uint8_t readRegister(uint16_t address);
void writeRegister(uint16_t address, uint8_t value);
// Specific methods for different PPU functionalities
void setMode(uint8_t mode);
void setBGTileSize(uint8_t bg, bool size16x16);
void setBGCharacterBaseAddress(uint8_t bg, uint16_t address);
void setBGScreenBaseAddress(uint8_t bg, uint16_t address);
void setMosaicSize(uint8_t size);
void setBGScroll(uint8_t bg, uint16_t horizontalOffset, uint16_t verticalOffset);
// Add more methods as needed...
private:
// Memory-mapped PPU registers
// Assuming a representation of the PPU register space
uint8_t ppuRegisters[/* size of the PPU register space */]; // Helper methods to manipulate specific bits/flags in the registers
// Example: void setBit(uint16_t address, uint8_t bit, bool value);
// Example: bool getBit(uint16_t address, uint8_t bit);
// Add more helper methods as needed...
};#endif // PPU_HPP