package com.lazy.emulate.emulation.cores

import android.util.Log
import android.view.Surface
import com.lazy.emulate.emulation.ConsoleType
import com.lazy.emulate.emulation.DisplayMode
import com.lazy.emulate.emulation.EmulatorCore
import com.lazy.emulate.emulation.SaveSlotInfo
import com.lazy.emulate.input.GamepadButton

/**
 * Placeholder core used for consoles that are not yet implemented.
 * Returns reasonable defaults and logs calls for future implementation.
 */
class PlaceholderCore(override val consoleType: ConsoleType) : EmulatorCore {

    override var isRunning: Boolean = false
        private set

    override fun loadRom(path: String): Boolean {
        Log.w(TAG, "${consoleType.displayName} emulation is not yet implemented")
        return false
    }

    override fun start() {
        Log.w(TAG, "${consoleType.displayName} emulation is not yet implemented")
    }

    override fun pause() { isRunning = false }
    override fun resume() { isRunning = true }
    override fun stop() { isRunning = false }
    override fun reset() {}
    override fun setSurface(surface: Surface) {}
    override fun onButtonPressed(button: GamepadButton) {}
    override fun onButtonReleased(button: GamepadButton) {}
    override fun onAnalogStick(x: Float, y: Float, stickIndex: Int) {}
    override fun saveState(slot: Int): Boolean = false
    override fun loadState(slot: Int): Boolean = false
    override fun getSaveSlotInfo(slot: Int) = SaveSlotInfo(slot, false)
    override fun setAudioEnabled(enabled: Boolean) {}
    override fun setFrameSkip(skip: Int) {}
    override fun setDisplayMode(mode: DisplayMode) {}

    companion object {
        private const val TAG = "PlaceholderCore"
    }
}
