Fix the build

This commit is contained in:
Felipe Lima 2017-03-15 21:31:54 -07:00
parent 837dcd3b9f
commit de61af751d
8 changed files with 34 additions and 29 deletions

View File

@ -287,4 +287,8 @@ class CPU(val memory: Memory) : Display.Callbacks {
override fun onDraw() {
executionLock?.countDown()
}
fun triggerIRQ() {
throw NotImplementedError()
}
}

View File

@ -6,10 +6,10 @@ data class Cartridge(
// @formatter:off
val pgr: IntArray, // PRG-ROM banks
val chr: IntArray, // CHR-ROM banks
val sram: IntArray = IntArray(0x2000), // Save RAM
val mapper: Byte, // mapper type
var mirror: Int, // mirroring mode
val battery: Byte // battery present
val battery: Byte, // battery present
val sram: IntArray = IntArray(0x2000) // Save RAM
// @formatter:on
) {

View File

@ -42,7 +42,8 @@ internal class INESFileParser {
// read chr-rom bank(s)
val chr = ByteArray(inesFileHeader.numCHR.toInt() * 8192)
stream.read(chr)
return Cartridge(pgr, chr, mapper.toByte(), mirror.toByte(), battery)
return Cartridge(pgr.map(Byte::toInt).toIntArray(), chr.map(Byte::toInt).toIntArray(),
mapper.toByte(), mirror, battery)
}
}
}

View File

@ -3,17 +3,17 @@ package android.emu6502.nes
class PPU(
// @formatter:off
val cycle: Int, // 0-340
val scanLine: Int, // 0-261, 0-239=visible, 240=post, 241-260=vblank, 261=pre
val frame: Int, // frame counter
val cycle: Int = 0, // 0-340
val scanLine: Int = 0, // 0-261, 0-239=visible, 240=post, 241-260=vblank, 261=pre
val frame: Int = 0, // frame counter
// PPU registers
val v: Int, // current vram address (15 bit)
val t: Int, // temporary vram address (15 bit)
val x: Byte, // fine x scroll (3 bit)
val w: Byte, // write toggle (1 bit)
val f: Byte, // even/odd frame flag (1 bit)
val register: Byte,
val v: Int = 0, // current vram address (15 bit)
val t: Int = 0, // temporary vram address (15 bit)
val x: Byte = 0, // fine x scroll (3 bit)
val w: Byte = 0, // write toggle (1 bit)
val f: Byte = 0, // even/odd frame flag (1 bit)
val register: Byte = 0,
// $2000 PPUCTRL
val flagNameTable: Boolean = false, // 0: $2000; 1: $2400; 2: $2800; 3: $2C00
@ -31,7 +31,7 @@ class PPU(
val flagShowSprites: Boolean = false, // 0: hide; 1: show
val flagRedTint: Boolean = false, // 0: normal; 1: emphasized
val flagGreenTint: Boolean = false, // 0: normal; 1: emphasized
val flagBlueTint: Boolean = false // 0: normal; 1: emphasized
val flagBlueTint: Boolean = false, // 0: normal; 1: emphasized
// $2002 PPUSTATUS
val flagSpriteZeroHit: Boolean = false,

View File

@ -1,13 +1,13 @@
package android.emu6502.nes.mappers
class AOROM : Mapper {
override fun write(address: Int, value: Byte) {
override fun write(address: Int, value: Int) {
}
override fun step() {
}
override fun read(address: Int): Byte {
override fun read(address: Int): Int {
throw NotImplementedError()
}
}

View File

@ -1,13 +1,13 @@
package android.emu6502.nes.mappers
class CNROM : Mapper {
override fun read(address: Int): Byte {
throw NotImplementedError()
}
override fun write(address: Int, value: Byte) {
override fun write(address: Int, value: Int) {
}
override fun step() {
}
override fun read(address: Int): Int {
throw NotImplementedError()
}
}

View File

@ -1,13 +1,13 @@
package android.emu6502.nes.mappers
class MMC1 : Mapper {
override fun read(address: Int): Byte {
throw NotImplementedError()
}
override fun write(address: Int, value: Byte) {
override fun write(address: Int, value: Int) {
}
override fun step() {
}
override fun read(address: Int): Int {
throw NotImplementedError()
}
}

View File

@ -1,13 +1,13 @@
package android.emu6502.nes.mappers
class UNROM : Mapper {
override fun write(address: Int, value: Int) {
}
override fun step() {
}
override fun write(address: Int, value: Byte) {
}
override fun read(address: Int): Byte {
override fun read(address: Int): Int {
throw NotImplementedError()
}
}