Computes if, after a transfer, a dma has finished its transfer, if it shall be re-enabled, if there’re addresses that have to be reloaded..
inline void AfterTransferChecks( int chan )
Does all the operations needed after an IO access.
inline void CheckIOAccess()
Generates an interrupt if VCOUNT is equal to LYC.
inline void CheckVMatch()
Clears HBLANK Flag.
inline void ClearHBlank()
Clears VBlank Flag.
inline void ClearVBlank()
Computes the wait states of the last memory access.
inline int ComputeWaitStates( int cyclesS, int cyclesN, int accessWidth = 2 )
Computes the WaitStates given an address.
inline int ComputeWaitStatesAB( uint32_t addr, int cyclesS, int cyclesN, int accessWidth = 2 )
Getter for the Carry Flag.
inline bool CpsrGetCarry()
Getter for the Fast Interrupt Disable Flag.
inline bool CpsrGetFIQDisable()
Getter for the Interrupt Disable Flag.
inline bool CpsrGetIRQDisable()
Getter for the CPU Mode.
inline int CpsrGetMode()
Getter for the Overflow Flag.
inline bool CpsrGetOverflow()
Getter for the Sign Flag.
inline bool CpsrGetSign()
Getter for the Thumb Mode Flag.
inline bool CpsrGetThumbMode()
Getter for the Zero Flag.
inline bool CpsrGetZero()
Setter for the Carry Flag.
inline void CpsrSetCarry( bool value )
Sets the carry flag looking at the operands of an addition.
inline void CpsrSetCarryByAddVals( int op1, int op2, int res )
Setter for the F Flag.
inline void CpsrSetFIQDisable( bool value )
Setter for the I Flag.
inline void CpsrSetIRQDisable( bool value )
Setter for the Mode field of the CPSR.
inline void CpsrSetMode( int value )
Setter for the Overflow Flag.
inline void CpsrSetOverflow( bool value )
Sets the overflow flag looking at the operands.
inline void CpsrSetOverflowByVals( int op1, int op2, int res )
Setter for the Sign Flag.
inline void CpsrSetSign( bool value )
Sets the sign flag according to a value.
inline void CpsrSetSignByVal( int val )
Setter for the T Flag.
inline void CpsrSetThumbMode( bool value )
Setter for the Zero Flag.
inline void CpsrSetZero( bool value )
Sets the zero flag according to a value.
inline void CpsrSetZeroByVal( int val )
Initializes the CPU.
CPU( Memory * mem )
Initializes the interface.
DebuggerInterface( Memory * _mem, CPU * _cpu, bool startTrace = false )
Initializes the channels
DMAChannels( Memory * mem, CPU * cpu )
Draws the tile
inline void draw( Palettes * palette, int palID, int fromX, int toX, int fromY, int toY, bool flipX, bool flipY, uint16_t * outBuffer )
Draws the tile.
inline void draw( Palettes * palette, int fromX, int toX, int fromY, int toY, bool flipX, bool flipY, uint16_t * outBuffer )
Draws all the windows in the terminal.
void Draw()
Draws the video buffer with openGL.
void Draw()
Draws the sprite tile.
inline void draw_obj( Palettes * palette, int palID, int fromX, int toX, int fromY, int toY, bool flipX, bool flipY, uint16_t * outBuffer, uint8_t * outPriority, int priorityValue )
Draws the sprite tile
inline void draw_obj( Palettes * palette, int fromX, int toX, int fromY, int toY, bool flipX, bool flipY, uint16_t * outBuffer, uint8_t * outPriority, int priorityValue )
Draws the sprite (rotated) tile
inline void draw_obj_rot( Palettes * palette, int palID, int xOff, int yOff, int pa, int pb, int pc, int pd, uint16_t * outBuffer, uint8_t * outPriority, int priorityValue )
Draws the sprite (rotated) tile
inline void draw_obj_rot( Palettes * palette, int xOff, int yOff, int pa, int pb, int pc, int pd, uint16_t * outBuffer, uint8_t * outPriority, int priorityValue )
Performs PPU idle operations.
inline void DrawIdle( int count )
Evaluates break condition.
bool Evaluate( Memory * mem, CPU * cpu, int address )
Evaluates all the breakrules.
bool Evaluate( int address )
Executes the next operation.
int ExecuteOperation()
Executes an Alu operation in THUMB Mode.
inline void ExecuteThumbAluOperation( int op, int rd, int op1, int op2 )
Executes a DMA Transfer.
inline void ExecuteTransfer( int chan )
Builds a GameBoyAdvance.
GBA()
GBA emulation thread entry point
void* gbaFunc( void * args )
Gets bit 9.
inline bool GetA0B9()
Returns the in-system address associated to the emulated address.
inline void* GetAddress( uint32_t addr )
Contained in DISPCNT.
inline int GetBGMode()
Computes Evy factor for backgrounds effects (from BLDY register).
inline float GetBLDYEvy()
inline int getByID( int i )
inline int getByXY( int x, int y )
Checks how many cycles has the dma consumed.
inline int GetConsumedCycles()
Retrieves the control register of a DMAChannel.
inline uint16_t GetControl( int chan )
Gets the Control register of the timer.
inline int GetControl( int index )
Retrieves a timer’s counter.
inline uint16_t GetCount( int index )
When countup timing is enabled in a timer, when it overflows, it increases the next one value.
inline bool GetCountUpTiming( int index )
True if 8bit tiles shall be used, False if 4 bit tiles shall be used.
inline bool GetCP()
Retrieve Current Program Status Register
inline uint32_t GetCpsr()
Returns the destination address operation of the DMAChannel.
inline int GetDestAddrOperation( int chan )
Retrieves the destination address of a DMAChannel.
inline uint32_t GetDestinationAddr( int chan )
The DISPCNT register contains information about rendering (e.g.
inline uint16_t GetDISPCNT()
The DISPSTAT register contains the LYC (vertical match register) and things like HBLANK flag, VBLANK flag, ....
inline uint16_t GetDISPSTAT()
Checks if a DMA channel is enabled.
inline bool GetDMAEnabled( int chan )
Returns the DRQ Flag of the DMAChannel.
inline bool GetDRQ( int chan )
The first frame in rendering modes 3-4-5.
inline unsigned char* GetFirstFrame()
True if the sprite has to be flipped horizontally.
inline int GetFlipX()
True if the sprite has to be flipped vertically.
inline int GetFlipY()
Gets the id of a GP register depending on the current mode.
inline int GetGPRegisterID( int regid, int mode )
Returns the value contained inside a register (in the current mode).
inline uint32_t GetGPRegValue( int regid, int pcOff = 8 )
inline int getHigherNibble( int i )
Gets IORam converted to the ASICRegister structure.
inline ASICRegisters* GetIORam()
The IORam of the GBA associated to the PPU.
inline ASICRegisters* GetIORam()
Returns if DMA interrupts are enabled for a channel.
inline bool GetIRQEnabled( int chan )
Gets if interrupts for a timer overflow are enabled.
inline bool GetIRQEnabled( int index )
inline int getLowerNibble( int i )
The memory of the GBA associated to the PPU.
inline Memory* GetMemory()
0=Normal, 1=Semi-Transparent, 2=Obj-Window
inline int GetObjMode()
0=square, 1=horizontal, 2=vertical
inline int GetObjShape()
Returns the size ID.
inline int GetObjSizeID()
Unimplemented.
inline void* GetObjTilesMemory()
Converts arm opcode into assembly language.
void GetOperationName( char * buffer, int opcode, int opaddr, bool thumb = false, char * comment = nullptr )
Retrieves the color of a background palette.
inline Palette* GetPaletteBG ( int section, int id )
The ID of the palette that has to be used in Tile4 mode.
inline int GetPaletteID()
Retrieves the color of a sprite palette.
inline Palette* GetPaletteOBJ( int section, int id )
The Palettes of the GBA associated to the PPU.
inline Palettes* GetPalettes()
Retrieves the ppu associated to this Window.
inline PPU* GetPPU()
Retrieves pipeline prefetch.
inline uint32_t GetPrefetch()
Gets Prescaler selection.
inline int GetPrescalerSelection( int index )
Gets The prescaler selection index of a timer.
inline int GetPrescalerSelectionIndex( int index )
The priority relative to backgrounds.
inline int GetPriority()
Returns the repeat flag of the DMAChannel.
inline bool GetRepeat( int chan )
Returns true if rotation/scale are used.
inline bool GetRSFlag()
There are 32 transform groups for 128 sprites.
inline int GetRSGroup()
The second frame in rendering modes 3-4-5.
inline unsigned char* GetSecondFrame()
For Render modes 4-5.
inline bool GetSelectedSecondFrame()
Gets the shaders code to draw a full screen quad.
void GetShadersCode( char * vs, char * fs )
Computes the size of the emulated memory.
uint32_t GetSize()
Retrieves the source address of a DMAChannel.
inline uint32_t GetSourceAddr( int chan )
Returns the source address operation of the DMAChannel.
inline int GetSourceAddrOperation( int chan )
inline OAMSprite* GetSprite( int id )
The Sprites of the GBA associated to the PPU.
inline OAMSprites* GetSprites()
Gets the ID of the register SPSR with a particular mode.
inline int GetSpsrID( int mode )
Retrieves the value of SPSR.
inline int GetSpsrVal()
Check if the DMA Channel should start execution
inline bool GetStartCondition( int chan )
Returns the start condition of the DMAChannel.
inline int GetStartTiming( int chan )
The id of the upper-left tile.
inline int GetTileID()
Retrieves a timer’s state.
inline bool GetTimerState( int index )
Every part is located at 0x8 offset starting at 0x6.
inline uint16_t* GetTransformationGroupPart( int id )
inline OAMTransformGroup* GetTransformGroup( int id )
Returns the word size of the DMAChannel.
inline bool GetUnitSize( int chan )
True if VBlank Flag is set.
inline bool GetVBlank()
The VRAM of the GBA associated to the PPU.
inline int8_t* GetVRam()
Retrieves the transfer words count of a DMAChannel.
inline uint16_t GetWordsCount( int chan )
inline int getWSCount( int id )
The X-coordinate of the sprite.
inline int GetX()
The Y-coordinate of the sprite.
inline int GetY()