PHP Класс GameBoy\Core

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$CPUTicks The number of clock cycles emulated.
$DAATable
$DIVTicks DIV Ticks Counter (Invisible lower 8-bit)
$FCarry bit 4 - Carry
$FHalfCarry bit 5 - Half Carry
$FSubtract bit 6 - Sub
$FZero bit 7 - Zero
$GBCMemory GBC main RAM Banks
$IME Are interrupts enabled?
$JoyPad Joypad State (two four-bit states actually)
$LCDTicks ScanLine Counter
$MBC1Mode MBC1 Type (4/32, 16/8)
$MBCRAMBanksEnabled MBC RAM Access Control.
$MBCRam Switchable RAM (Used by games for more RAM) for the main memory range 0xA000 - 0xC000.
$RAMBanks Used to map the RAM banks to maximum size the MBC used can do.
$ROM The full ROM file dumped to an array.
$ROMBank1offs Offset of the ROM bank switching.
$ROMBanks 1 Bank = 16 KBytes = 256 Kbits
$ROMImage The game's ROM.
$RTCDayOverFlow
$RTCDays
$RTCHALT
$RTCHours
$RTCMinutes
$RTCSeconds
$RTCisLatched
$SecondaryTICKTable
$TACClocker Timer Max Ticks
$TICKTable
$TIMAEnabled
$VRAM Extra VRAM bank for GBC.
$audioTicks Used to sample the audio system every x CPU instructions.
$bgEnabled
$cCamera
$cGBC GameBoy Color detection.
$cHuC1
$cHuC3
$cMBC1 Does the cartridge use MBC1?
$cMBC2 Does the cartridge use MBC2?
$cMBC3 Does the cartridge use MBC3?
$cMBC5 Does the cartridge use MBC5?
$cMMMO1
$cRUMBLE Does the cartridge use the RUMBLE addressing (modified MBC5)?
$cSRAM Does the cartridge use save RAM?
$cTAMA5
$cTIMER Added
$canvasBuffer
$cartridgeType Cartridge Type
$colorCount
$colors "Classic" GameBoy palette colors.
$currMBCRAMBank MBC Currently Indexed RAM Bank
$currMBCRAMBankPosition MBC Position Adder;
$currVRAMBank Current VRAM bank for GBC.
$currentROMBank The parsed current ROM bank selection.
$drawContext LCD Context
$drewBlank To prevent the repeating of drawing a blank screen.
$emulatorTicks Times for how many instructions to execute before ending the loop.
$ffxxDump
$frameBuffer
$frameCount Frame skip tracker
$fromSaveState A boolean to see if this was loaded in as a save state.
$gameCode Game code (Suffix for older games)
$gbColorizedPalette
$gbPalette
$gbcPalette
$gbcRamBank Currently Switched GameBoy Color ram bank
$gbcRamBankPosition GBC RAM offset from address start.
$gbcRamBankPositionECHO GBC RAM (ECHO mirroring) offset from address start.
$gbcRawPalette
$gfxBackgroundX
$gfxBackgroundY
$gfxSpriteDouble
$gfxSpriteShow
$gfxWindowDisplay
$gfxWindowY
$halt Has the CPU been suspended until the next interrupt?
$hdmaRunning HDMA Transfer Flag - GBC only
$height
$inBootstrap Whether we're in the GBC boot ROM.
$lastIteration The last time we iterated the main loop.
$latchedHDays
$latchedHours
$latchedLDays
$latchedMinutes
$latchedSeconds
$lcdController lcdControllerler object
$memory Main Core Memory
$multiplier GBC Speed Multiplier
$name Name of the game
$numRAMBanks How many RAM banks were actually allocated?
$palette Pointer to the current palette we're using (Used for palette switches during boot or so it can be done anytime)
$pixelCount
$programCounter Program Counter
$registerA Accumulator (default is GB mode)
$registerB Register B
$registerC Register C
$registerD Register D
$registerE Register E
$registersHL Registers H and L
$rgbCount
$savedStateFileName When loaded in as a save state, this will not be empty.
$skipPCIncrement Did we trip the DMG Halt bug?
$spritePriorityEnabled
$stackPointer Stack Pointer
$stopEmulator Has the emulation been paused or a frame has ended?
$tileCount GB: 384, GBC: 384 * 2
$tileCountInvalidator
$tileData tile data arrays
$tileReadState true if there are any images to be invalidated
$timerTicks Timer Ticks Count
$transparentCutoff min "attrib" value where transparency can occur (Default is 4 (GB mode))
$untilEnable Are the interrupts on queue to be enabled?
$weaveLookup
$width
$windowSourceLine

Открытые методы

Метод Описание
MBCRAMUtilized ( )
ROMLoad ( )
VRAMReadGFX ( $address, $gbcBank )
__construct ( $ROMImage, $drawContext )
arrayPad ( $length, $defaultValue )
checkPaletteType ( )
clockUpdate ( )
decodePalette ( $startIndex, $data )
disableBootROM ( )
displayShowOff ( )
drawBackgroundForLine ( $line, $windowLeft, $priority )
drawPartBgSprite ( $tileIndex, $x, $y, $sourceLine, $attribs )
drawPartCopy ( $tileIndex, $x, $y, $sourceLine, $attribs )
drawPartFgSprite ( $tileIndex, $x, $y, $sourceLine, $attribs )
drawSpritesForLine ( $line )
drawToCanvas ( )
executeIteration ( )
fromTypedArray ( $baseArray )
getTypedArray ( $length, $defaultValue, $numberType )
initBootstrap ( )
initLCD ( )
initMemory ( )
initSkipBootstrap ( )
invalidateAll ( $pal )
joyPadEvent ( $key, $down )
memoryRead ( $address ) Memory Reading:
memoryWrite ( $address, $data ) Memory Writing:
nswtuw ( $uword )
performHdma ( )
returnFromState ( $returnedFrom )
run ( )
runInterrupt ( )
saveState ( )
setCurrentMBC1ROMBank ( )
setCurrentMBC2AND3ROMBank ( )
setCurrentMBC5ROMBank ( )
setGBCPalette ( $address_, $data )
setGBCPalettePre ( $address_, $data )
setupRAM ( )
start ( )
toTypedArray ( $baseArray, $bit32, $unsigned )
unsbtub ( $ubyte )
unswtuw ( $uword )
updateCore ( )
updateImage ( $tileIndex, $attribs )
usbtsb ( $ubyte ) Helper Functions

Описание методов

MBCRAMUtilized() публичный Метод

public MBCRAMUtilized ( )

ROMLoad() публичный Метод

public ROMLoad ( )

VRAMReadGFX() публичный Метод

public VRAMReadGFX ( $address, $gbcBank )

__construct() публичный Метод

public __construct ( $ROMImage, $drawContext )

arrayPad() публичный Метод

public arrayPad ( $length, $defaultValue )

checkPaletteType() публичный Метод

public checkPaletteType ( )

clockUpdate() публичный Метод

public clockUpdate ( )

decodePalette() публичный Метод

public decodePalette ( $startIndex, $data )

disableBootROM() публичный Метод

public disableBootROM ( )

displayShowOff() публичный Метод

public displayShowOff ( )

drawBackgroundForLine() публичный Метод

public drawBackgroundForLine ( $line, $windowLeft, $priority )

drawPartBgSprite() публичный Метод

public drawPartBgSprite ( $tileIndex, $x, $y, $sourceLine, $attribs )

drawPartCopy() публичный Метод

public drawPartCopy ( $tileIndex, $x, $y, $sourceLine, $attribs )

drawPartFgSprite() публичный Метод

public drawPartFgSprite ( $tileIndex, $x, $y, $sourceLine, $attribs )

drawSpritesForLine() публичный Метод

public drawSpritesForLine ( $line )

drawToCanvas() публичный Метод

public drawToCanvas ( )

executeIteration() публичный Метод

public executeIteration ( )

fromTypedArray() публичный Метод

public fromTypedArray ( $baseArray )

getTypedArray() публичный Метод

public getTypedArray ( $length, $defaultValue, $numberType )

initBootstrap() публичный Метод

public initBootstrap ( )

initLCD() публичный Метод

public initLCD ( )

initMemory() публичный Метод

public initMemory ( )

initSkipBootstrap() публичный Метод

public initSkipBootstrap ( )

invalidateAll() публичный Метод

public invalidateAll ( $pal )

joyPadEvent() публичный Метод

public joyPadEvent ( $key, $down )

memoryRead() публичный Метод

Memory Reading:
public memoryRead ( $address )

memoryWrite() публичный Метод

Memory Writing:
public memoryWrite ( $address, $data )

nswtuw() публичный Метод

public nswtuw ( $uword )

performHdma() публичный Метод

public performHdma ( )

returnFromState() публичный Метод

public returnFromState ( $returnedFrom )

run() публичный Метод

public run ( )

runInterrupt() публичный Метод

public runInterrupt ( )

saveState() публичный Метод

public saveState ( )

setCurrentMBC1ROMBank() публичный Метод

setCurrentMBC2AND3ROMBank() публичный Метод

setCurrentMBC5ROMBank() публичный Метод

setGBCPalette() публичный Метод

public setGBCPalette ( $address_, $data )

setGBCPalettePre() публичный Метод

public setGBCPalettePre ( $address_, $data )

setupRAM() публичный Метод

public setupRAM ( )

start() публичный Метод

public start ( )

toTypedArray() публичный Метод

public toTypedArray ( $baseArray, $bit32, $unsigned )

unsbtub() публичный Метод

public unsbtub ( $ubyte )

unswtuw() публичный Метод

public unswtuw ( $uword )

updateCore() публичный Метод

public updateCore ( )

updateImage() публичный Метод

public updateImage ( $tileIndex, $attribs )

usbtsb() публичный Метод

Helper Functions
public usbtsb ( $ubyte )

Описание свойств

$CPUTicks публичное свойство

The number of clock cycles emulated.
public $CPUTicks

$DAATable публичное свойство

public $DAATable

$DIVTicks публичное свойство

DIV Ticks Counter (Invisible lower 8-bit)
public $DIVTicks

$FCarry публичное свойство

bit 4 - Carry
public $FCarry

$FHalfCarry публичное свойство

bit 5 - Half Carry
public $FHalfCarry

$FSubtract публичное свойство

bit 6 - Sub
public $FSubtract

$FZero публичное свойство

bit 7 - Zero
public $FZero

$GBCMemory публичное свойство

GBC main RAM Banks
public $GBCMemory

$IME публичное свойство

Are interrupts enabled?
public $IME

$JoyPad публичное свойство

Joypad State (two four-bit states actually)
public $JoyPad

$LCDTicks публичное свойство

ScanLine Counter
public $LCDTicks

$MBC1Mode публичное свойство

MBC1 Type (4/32, 16/8)
public $MBC1Mode

$MBCRAMBanksEnabled публичное свойство

MBC RAM Access Control.
public $MBCRAMBanksEnabled

$MBCRam публичное свойство

Switchable RAM (Used by games for more RAM) for the main memory range 0xA000 - 0xC000.
public $MBCRam

$RAMBanks публичное свойство

Used to map the RAM banks to maximum size the MBC used can do.
public $RAMBanks

$ROM публичное свойство

The full ROM file dumped to an array.
public $ROM

$ROMBank1offs публичное свойство

Offset of the ROM bank switching.
public $ROMBank1offs

$ROMBanks публичное свойство

1 Bank = 16 KBytes = 256 Kbits
public $ROMBanks

$ROMImage публичное свойство

The game's ROM.
public $ROMImage

$RTCDayOverFlow публичное свойство

public $RTCDayOverFlow

$RTCDays публичное свойство

public $RTCDays

$RTCHALT публичное свойство

public $RTCHALT

$RTCHours публичное свойство

public $RTCHours

$RTCMinutes публичное свойство

public $RTCMinutes

$RTCSeconds публичное свойство

public $RTCSeconds

$RTCisLatched публичное свойство

public $RTCisLatched

$SecondaryTICKTable публичное свойство

public $SecondaryTICKTable

$TACClocker публичное свойство

Timer Max Ticks
public $TACClocker

$TICKTable публичное свойство

public $TICKTable

$TIMAEnabled публичное свойство

public $TIMAEnabled

$VRAM публичное свойство

Extra VRAM bank for GBC.
public $VRAM

$audioTicks публичное свойство

Used to sample the audio system every x CPU instructions.
public $audioTicks

$bgEnabled публичное свойство

public $bgEnabled

$cCamera публичное свойство

public $cCamera

$cGBC публичное свойство

GameBoy Color detection.
public $cGBC

$cHuC1 публичное свойство

public $cHuC1

$cHuC3 публичное свойство

public $cHuC3

$cMBC1 публичное свойство

Does the cartridge use MBC1?
public $cMBC1

$cMBC2 публичное свойство

Does the cartridge use MBC2?
public $cMBC2

$cMBC3 публичное свойство

Does the cartridge use MBC3?
public $cMBC3

$cMBC5 публичное свойство

Does the cartridge use MBC5?
public $cMBC5

$cMMMO1 публичное свойство

public $cMMMO1

$cRUMBLE публичное свойство

Does the cartridge use the RUMBLE addressing (modified MBC5)?
public $cRUMBLE

$cSRAM публичное свойство

Does the cartridge use save RAM?
public $cSRAM

$cTAMA5 публичное свойство

public $cTAMA5

$cTIMER публичное свойство

Added
public $cTIMER

$canvasBuffer публичное свойство

public $canvasBuffer

$cartridgeType публичное свойство

Cartridge Type
public $cartridgeType

$colorCount публичное свойство

public $colorCount

$colors публичное свойство

"Classic" GameBoy palette colors.
public $colors

$currMBCRAMBank публичное свойство

MBC Currently Indexed RAM Bank
public $currMBCRAMBank

$currMBCRAMBankPosition публичное свойство

MBC Position Adder;
public $currMBCRAMBankPosition

$currVRAMBank публичное свойство

Current VRAM bank for GBC.
public $currVRAMBank

$currentROMBank публичное свойство

The parsed current ROM bank selection.
public $currentROMBank

$drawContext публичное свойство

LCD Context
public $drawContext

$drewBlank публичное свойство

To prevent the repeating of drawing a blank screen.
public $drewBlank

$emulatorTicks публичное свойство

Times for how many instructions to execute before ending the loop.
public $emulatorTicks

$ffxxDump публичное свойство

public $ffxxDump

$frameBuffer публичное свойство

public $frameBuffer

$frameCount публичное свойство

Frame skip tracker
public $frameCount

$fromSaveState публичное свойство

A boolean to see if this was loaded in as a save state.
public $fromSaveState

$gameCode публичное свойство

Game code (Suffix for older games)
public $gameCode

$gbColorizedPalette публичное свойство

public $gbColorizedPalette

$gbPalette публичное свойство

public $gbPalette

$gbcPalette публичное свойство

public $gbcPalette

$gbcRamBank публичное свойство

Currently Switched GameBoy Color ram bank
public $gbcRamBank

$gbcRamBankPosition публичное свойство

GBC RAM offset from address start.
public $gbcRamBankPosition

$gbcRamBankPositionECHO публичное свойство

GBC RAM (ECHO mirroring) offset from address start.
public $gbcRamBankPositionECHO

$gbcRawPalette публичное свойство

public $gbcRawPalette

$gfxBackgroundX публичное свойство

public $gfxBackgroundX

$gfxBackgroundY публичное свойство

public $gfxBackgroundY

$gfxSpriteDouble публичное свойство

public $gfxSpriteDouble

$gfxSpriteShow публичное свойство

public $gfxSpriteShow

$gfxWindowDisplay публичное свойство

public $gfxWindowDisplay

$gfxWindowY публичное свойство

public $gfxWindowY

$halt публичное свойство

Has the CPU been suspended until the next interrupt?
public $halt

$hdmaRunning публичное свойство

HDMA Transfer Flag - GBC only
public $hdmaRunning

$height публичное свойство

public $height

$inBootstrap публичное свойство

Whether we're in the GBC boot ROM.
public $inBootstrap

$lastIteration публичное свойство

The last time we iterated the main loop.
public $lastIteration

$latchedHDays публичное свойство

public $latchedHDays

$latchedHours публичное свойство

public $latchedHours

$latchedLDays публичное свойство

public $latchedLDays

$latchedMinutes публичное свойство

public $latchedMinutes

$latchedSeconds публичное свойство

public $latchedSeconds

$lcdController публичное свойство

lcdControllerler object
public $lcdController

$memory публичное свойство

Main Core Memory
public $memory

$multiplier публичное свойство

GBC Speed Multiplier
public $multiplier

$name публичное свойство

Name of the game
public $name

$numRAMBanks публичное свойство

How many RAM banks were actually allocated?
public $numRAMBanks

$palette публичное свойство

Pointer to the current palette we're using (Used for palette switches during boot or so it can be done anytime)
public $palette

$pixelCount публичное свойство

public $pixelCount

$programCounter публичное свойство

Program Counter
public $programCounter

$registerA публичное свойство

Accumulator (default is GB mode)
public $registerA

$registerB публичное свойство

Register B
public $registerB

$registerC публичное свойство

Register C
public $registerC

$registerD публичное свойство

Register D
public $registerD

$registerE публичное свойство

Register E
public $registerE

$registersHL публичное свойство

Registers H and L
public $registersHL

$rgbCount публичное свойство

public $rgbCount

$savedStateFileName публичное свойство

When loaded in as a save state, this will not be empty.
public $savedStateFileName

$skipPCIncrement публичное свойство

Did we trip the DMG Halt bug?
public $skipPCIncrement

$spritePriorityEnabled публичное свойство

public $spritePriorityEnabled

$stackPointer публичное свойство

Stack Pointer
public $stackPointer

$stopEmulator публичное свойство

Has the emulation been paused or a frame has ended?
public $stopEmulator

$tileCount публичное свойство

GB: 384, GBC: 384 * 2
public $tileCount

$tileCountInvalidator публичное свойство

public $tileCountInvalidator

$tileData публичное свойство

tile data arrays
public $tileData

$tileReadState публичное свойство

true if there are any images to be invalidated
public $tileReadState

$timerTicks публичное свойство

Timer Ticks Count
public $timerTicks

$transparentCutoff публичное свойство

min "attrib" value where transparency can occur (Default is 4 (GB mode))
public $transparentCutoff

$untilEnable публичное свойство

Are the interrupts on queue to be enabled?
public $untilEnable

$weaveLookup публичное свойство

public $weaveLookup

$width публичное свойство

public $width

$windowSourceLine публичное свойство

public $windowSourceLine