mirror of
https://github.com/felipecsl/6502Android.git
synced 2024-06-07 15:48:23 +00:00
Fix the build
This commit is contained in:
parent
837dcd3b9f
commit
de61af751d
|
@ -287,4 +287,8 @@ class CPU(val memory: Memory) : Display.Callbacks {
|
||||||
override fun onDraw() {
|
override fun onDraw() {
|
||||||
executionLock?.countDown()
|
executionLock?.countDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun triggerIRQ() {
|
||||||
|
throw NotImplementedError()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -6,10 +6,10 @@ data class Cartridge(
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
val pgr: IntArray, // PRG-ROM banks
|
val pgr: IntArray, // PRG-ROM banks
|
||||||
val chr: IntArray, // CHR-ROM banks
|
val chr: IntArray, // CHR-ROM banks
|
||||||
val sram: IntArray = IntArray(0x2000), // Save RAM
|
|
||||||
val mapper: Byte, // mapper type
|
val mapper: Byte, // mapper type
|
||||||
var mirror: Int, // mirroring mode
|
var mirror: Int, // mirroring mode
|
||||||
val battery: Byte // battery present
|
val battery: Byte, // battery present
|
||||||
|
val sram: IntArray = IntArray(0x2000) // Save RAM
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ internal class INESFileParser {
|
||||||
// read chr-rom bank(s)
|
// read chr-rom bank(s)
|
||||||
val chr = ByteArray(inesFileHeader.numCHR.toInt() * 8192)
|
val chr = ByteArray(inesFileHeader.numCHR.toInt() * 8192)
|
||||||
stream.read(chr)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,17 +3,17 @@ package android.emu6502.nes
|
||||||
class PPU(
|
class PPU(
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
|
|
||||||
val cycle: Int, // 0-340
|
val cycle: Int = 0, // 0-340
|
||||||
val scanLine: Int, // 0-261, 0-239=visible, 240=post, 241-260=vblank, 261=pre
|
val scanLine: Int = 0, // 0-261, 0-239=visible, 240=post, 241-260=vblank, 261=pre
|
||||||
val frame: Int, // frame counter
|
val frame: Int = 0, // frame counter
|
||||||
|
|
||||||
// PPU registers
|
// PPU registers
|
||||||
val v: Int, // current vram address (15 bit)
|
val v: Int = 0, // current vram address (15 bit)
|
||||||
val t: Int, // temporary vram address (15 bit)
|
val t: Int = 0, // temporary vram address (15 bit)
|
||||||
val x: Byte, // fine x scroll (3 bit)
|
val x: Byte = 0, // fine x scroll (3 bit)
|
||||||
val w: Byte, // write toggle (1 bit)
|
val w: Byte = 0, // write toggle (1 bit)
|
||||||
val f: Byte, // even/odd frame flag (1 bit)
|
val f: Byte = 0, // even/odd frame flag (1 bit)
|
||||||
val register: Byte,
|
val register: Byte = 0,
|
||||||
|
|
||||||
// $2000 PPUCTRL
|
// $2000 PPUCTRL
|
||||||
val flagNameTable: Boolean = false, // 0: $2000; 1: $2400; 2: $2800; 3: $2C00
|
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 flagShowSprites: Boolean = false, // 0: hide; 1: show
|
||||||
val flagRedTint: Boolean = false, // 0: normal; 1: emphasized
|
val flagRedTint: Boolean = false, // 0: normal; 1: emphasized
|
||||||
val flagGreenTint: 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
|
// $2002 PPUSTATUS
|
||||||
val flagSpriteZeroHit: Boolean = false,
|
val flagSpriteZeroHit: Boolean = false,
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package android.emu6502.nes.mappers
|
package android.emu6502.nes.mappers
|
||||||
|
|
||||||
class AOROM : Mapper {
|
class AOROM : Mapper {
|
||||||
override fun write(address: Int, value: Byte) {
|
override fun write(address: Int, value: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun step() {
|
override fun step() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun read(address: Int): Byte {
|
override fun read(address: Int): Int {
|
||||||
throw NotImplementedError()
|
throw NotImplementedError()
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
package android.emu6502.nes.mappers
|
package android.emu6502.nes.mappers
|
||||||
|
|
||||||
class CNROM : Mapper {
|
class CNROM : Mapper {
|
||||||
override fun read(address: Int): Byte {
|
override fun write(address: Int, value: Int) {
|
||||||
throw NotImplementedError()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun write(address: Int, value: Byte) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun step() {
|
override fun step() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun read(address: Int): Int {
|
||||||
|
throw NotImplementedError()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
package android.emu6502.nes.mappers
|
package android.emu6502.nes.mappers
|
||||||
|
|
||||||
class MMC1 : Mapper {
|
class MMC1 : Mapper {
|
||||||
override fun read(address: Int): Byte {
|
override fun write(address: Int, value: Int) {
|
||||||
throw NotImplementedError()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun write(address: Int, value: Byte) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun step() {
|
override fun step() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun read(address: Int): Int {
|
||||||
|
throw NotImplementedError()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
package android.emu6502.nes.mappers
|
package android.emu6502.nes.mappers
|
||||||
|
|
||||||
class UNROM : Mapper {
|
class UNROM : Mapper {
|
||||||
|
override fun write(address: Int, value: Int) {
|
||||||
|
}
|
||||||
|
|
||||||
override fun step() {
|
override fun step() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun write(address: Int, value: Byte) {
|
override fun read(address: Int): Int {
|
||||||
}
|
|
||||||
|
|
||||||
override fun read(address: Int): Byte {
|
|
||||||
throw NotImplementedError()
|
throw NotImplementedError()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user