org.razvan.jzx.v128
Class IO

java.lang.Object
  extended by org.razvan.jzx.BaseComponent
      extended by org.razvan.jzx.BaseIO
          extended by org.razvan.jzx.v128.IO

public class IO
extends BaseIO

The 128k model specialization of the BaseIO class.

Author:
Razvan Surdulescu (c) 2001 - 2006, Erik Kunze (c) 1995, 1996, 1997, Des Herriott (c) 1993, 1994
You may use and distribute this software for free provided you include this copyright notice. You may not sell this software, use my name for publicity reasons or modify the code without permission from me.

Field Summary
static int B_BANK128
          Bit mask for the 128k memory banks.
static int B_PAGING
          Bit mask for enabling/disabling memory paging.
static int B_SELRAM
          Bit mask for selecting the RAM page on C000-FFFF.
static int B_SELROM
          Bit mask for selecting the ROM page.
static int B_SELSCREEN
          Bit mask for selecting the Screen RAM page.
static int B_SNDCHIP
          Sound chip mask (AY-3-8912 chip)
static int B_SNDCONTROL
          Sound control mask (AY-3-8912 chip)
static int B_SNDDATA
          Sound data mask (AY-3-8912 chip)
protected  AY8912 m_ay8912
          AY-3-8912 chip.
protected  int m_last0x7ffd
          Last value written to the memory bank port.
protected  int m_last0xfffd
          Last value written to the sound chip port.
protected  int[] m_psgPorts
          AY-3-8912 ports.
static int P_128
          Definition for all 128k ports.
static int P_BANK128
          Port address for 128k memory management.
static int P_SNDCONTROL
          Sound control register (AY-3-8912 chip)
static int P_SNDDATA
          Sound data register (AY-3-8912 chip)
 
Fields inherited from class org.razvan.jzx.BaseIO
B_BORDER, B_DOWN, B_EAR, B_FIRE, B_KEMPSTON, B_KEYBOARD, B_LEFT, B_MIC, B_RIGHT, B_SPEAKER, B_ULA, B_UP, LINE_BUF_SIZE, m_buffer, m_cpu, m_index, m_inPorts, m_keyPorts, m_lastBorderColor, m_memory, m_outPorts, m_screen, m_speakerLevel, P_KEMPSTON, P_SINCLAIR1, P_SINCLAIR2, P_ULA, SAMPLE_FREQ
 
Fields inherited from class org.razvan.jzx.BaseComponent
m_logger, m_spectrum
 
Constructor Summary
IO()
           
 
Method Summary
 void advance(int tStates)
           
 int in8(int port16)
          Read an 8-bit value from the specified 16-bit I/O port.
 void init(BaseSpectrum spectrum, ILogger logger)
          Allocate the AY port array and cache the reference to the AY-3-8912 chip.
 void load(BaseLoader loader)
          Load the saved values of 0x7ffd and 0xfffd oirt values.
 void out(int port16, int val8)
          Write an 8-bit value to the specified 16-bit I/O port.
 void reset()
          Set the AY port array to 0.
 void terminate()
          Set the port array to null and release the cached reference to the AY chip.
 
Methods inherited from class org.razvan.jzx.BaseIO
andIn, andKey, andOut, getAudioSamplesForTStates, mixSound, orIn, orKey, orOut
 
Methods inherited from class org.razvan.jzx.BaseComponent
getSpectrum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_128

public static final int P_128
Definition for all 128k ports.

See Also:
Constant Field Values

P_BANK128

public static final int P_BANK128
Port address for 128k memory management.

See Also:
Constant Field Values

B_BANK128

public static final int B_BANK128
Bit mask for the 128k memory banks.

See Also:
Constant Field Values

B_SELRAM

public static final int B_SELRAM
Bit mask for selecting the RAM page on C000-FFFF.

See Also:
Constant Field Values

B_SELSCREEN

public static final int B_SELSCREEN
Bit mask for selecting the Screen RAM page.

See Also:
Constant Field Values

B_SELROM

public static final int B_SELROM
Bit mask for selecting the ROM page.

See Also:
Constant Field Values

B_PAGING

public static final int B_PAGING
Bit mask for enabling/disabling memory paging.

See Also:
Constant Field Values

P_SNDCONTROL

public static final int P_SNDCONTROL
Sound control register (AY-3-8912 chip)

See Also:
Constant Field Values

P_SNDDATA

public static final int P_SNDDATA
Sound data register (AY-3-8912 chip)

See Also:
Constant Field Values

B_SNDCHIP

public static final int B_SNDCHIP
Sound chip mask (AY-3-8912 chip)

See Also:
Constant Field Values

B_SNDCONTROL

public static final int B_SNDCONTROL
Sound control mask (AY-3-8912 chip)

See Also:
Constant Field Values

B_SNDDATA

public static final int B_SNDDATA
Sound data mask (AY-3-8912 chip)

See Also:
Constant Field Values

m_last0x7ffd

protected int m_last0x7ffd
Last value written to the memory bank port.


m_last0xfffd

protected int m_last0xfffd
Last value written to the sound chip port.


m_psgPorts

protected int[] m_psgPorts
AY-3-8912 ports.


m_ay8912

protected AY8912 m_ay8912
AY-3-8912 chip.

Constructor Detail

IO

public IO()
Method Detail

init

public void init(BaseSpectrum spectrum,
                 ILogger logger)
Allocate the AY port array and cache the reference to the AY-3-8912 chip.

Overrides:
init in class BaseIO

reset

public void reset()
Set the AY port array to 0.

Overrides:
reset in class BaseIO

terminate

public void terminate()
Set the port array to null and release the cached reference to the AY chip.

Overrides:
terminate in class BaseIO

in8

public int in8(int port16)
Read an 8-bit value from the specified 16-bit I/O port.

Overrides:
in8 in class BaseIO
Parameters:
port16 - The 16-bit I/O input port.
Returns:
The 8-bit value read from the I/O port.

out

public void out(int port16,
                int val8)
Write an 8-bit value to the specified 16-bit I/O port.

Overrides:
out in class BaseIO
Parameters:
port16 - The 16-bit I/O output port.
val8 - The 8-bit value to write to the I/O port.

advance

public void advance(int tStates)
Overrides:
advance in class BaseIO

load

public void load(BaseLoader loader)
Load the saved values of 0x7ffd and 0xfffd oirt values.

Overrides:
load in class BaseIO