SergioLuis / CHIPEIT

A CHIP-8 emulator for Android, written in Kotlin
GNU General Public License v3.0
3 stars 1 forks source link

Implement general backend structure #2

Closed SergioLuis closed 6 years ago

SergioLuis commented 6 years ago

Developers: @sergioluis @mikelcaz Reviewers: @ugedo @jhvargas3112


Implement a high-level backend (emulator) structure so the work on it can be divided. Bear in mind the following guidelines:

Take this suggestion:

SergioLuis commented 6 years ago

This depends on Implement general application structure.

SergioLuis commented 6 years ago

Package structure proposal:

SergioLuis commented 6 years ago

Initial class and methods proposal by package:

interfaces:
   - ICpu
   - IMemory
   - IClock
   - IRegisters
   - ITimer

io:
   + ISoundPlayer
     + startPlaying() : void
     + stopPlaying() : void

   + IGraphicsRenderer
     + render(graphicMemory : byte[]) : void

   + KeyEnum : flags { 0, 1, 2, 3, 4, (...) E, F }

   + Keyboard
     + keyPressed(key : KeyEnum) : void
     + keyReleased(key : KeyEnum) : void

emulator:
   + Chipeit
     + keys : Keys (get)
     + Chipeit(soundPlayer : ISoundPlayer, gr : IGraphicsRenderer) : ctor
     + loadRom(rom : byte[]) : void
     + startEmulation() : void
     + stopEmulation() : void
     + getSnapshot() : SnapshotData
     + loadSnapshot(data : SnapshotData)

   + SnapshotData
     + <<static>> loadFrom(buffer : byte[]) : SnapshotData
     + writeTo(buffer : byte[]) : int

   + EmulationParameters
     + backgroundColor : int (get / set)
     + foregroundColor : int (get / set)
     + clockSpeed : short (get / set)
     + enableLog : boolean (get / set)

core:
   - Cpu : ICpu
   - Memory : IMemory
   - Clock : IClock
   - Registers : IRegisters
   - SoundTimer : ITimer
   - DelayTimer : ITimer
   - <<static>> InstructionSet
SergioLuis commented 6 years ago

PR #20 implements this.