org.razvan.jzx
Class BaseLoader

java.lang.Object
  extended by org.razvan.jzx.BaseLoader
Direct Known Subclasses:
Z80Loader

public abstract class BaseLoader
extends java.lang.Object

Base class extended by all classes that can load information from a saved file format into the Spectrum.

This class provides basic, common loader functionality for the various loader types.

The BaseLoader class provides methods for retrieving the data that was loaded. The actual loading code, parsing of the file format etc. is performed in child classes. The BaseLoader class is implemented (almost) as Visitor pattern, whereby it is passed into all the components of the Spectrum tree, and each component retrieves from it the data that is relevant to that component.

Author:
Razvan Surdulescu (c) 2001 - 2006
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
protected  int m_af16
          Z80 basic registers.
protected  int m_af16alt
          Z80 alternate registers.
protected  int m_bc16
          Z80 basic registers.
protected  int m_bc16alt
          Z80 alternate registers.
protected  int m_border
          Border color.
protected  int m_de16
          Z80 basic registers.
protected  int m_de16alt
          Z80 alternate registers.
protected  int m_hl16
          Z80 basic registers.
protected  int m_hl16alt
          Z80 alternate registers.
protected  int m_i8
          Z80 interrupt and refresh registers.
protected  int m_iff1a
          Z80 flip-flops.
protected  int m_iff1b
          Z80 flip-flops.
protected  int m_im2
          Z80 interrupt mode.
protected  int m_issue
          Spectrum model (issue).
protected  int m_ix16
          Z80 index registers.
protected  int m_iy16
          Z80 index registers.
protected  int m_last0x7ffd
          128k specific saved I/O registers.
protected  int m_last0xfffd
           
protected  ILogger m_logger
          Logger object for logging messages and exceptions.
protected  org.razvan.jzx.SnapshotMemory m_memory
          "headless" memory object that stores the memory image.
protected  int m_mode
          Spectrum model (MODE_48 or MODE_128).
protected  int m_pc16
          Z80 core registers.
protected  int m_r8
          Z80 interrupt and refresh registers.
protected  int m_sp16
          Z80 core registers.
protected  java.net.URL m_url
          URL used for loading the data.
static int MODE_128
          128k Spectrum model data
static int MODE_48
          48k Spectrum model data
 
Constructor Summary
BaseLoader(ILogger logger, java.net.URL url)
          Setup the logger and url, allocate and initialize the "headless" memory object.
 
Method Summary
 int getAF16()
           
 int getAF16ALT()
           
 int getBC16()
           
 int getBC16ALT()
           
 int getBorder()
           
 int getDE16()
           
 int getDE16ALT()
           
 int getHL16()
           
 int getHL16ALT()
           
 int getI8()
           
 int getIFF1a()
           
 int getIFF1b()
           
 int getIM2()
           
 int getIssue()
           
 int getIX16()
           
 int getIY16()
           
 int getLast0x7ffd()
           
 int getLast0xfffd()
           
 BaseMemory getMemory()
          Trivial accessor for the (headless) memory object.
 int getMode()
           
 int getPC16()
           
 int getR8()
           
 int getSP16()
           
abstract  void load(java.lang.String name)
          Perform the actual loading from the URL fragment identified by the "name" parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_48

public static final int MODE_48
48k Spectrum model data

See Also:
Constant Field Values

MODE_128

public static final int MODE_128
128k Spectrum model data

See Also:
Constant Field Values

m_af16

protected int m_af16
Z80 basic registers.


m_bc16

protected int m_bc16
Z80 basic registers.


m_de16

protected int m_de16
Z80 basic registers.


m_hl16

protected int m_hl16
Z80 basic registers.


m_af16alt

protected int m_af16alt
Z80 alternate registers.


m_bc16alt

protected int m_bc16alt
Z80 alternate registers.


m_de16alt

protected int m_de16alt
Z80 alternate registers.


m_hl16alt

protected int m_hl16alt
Z80 alternate registers.


m_ix16

protected int m_ix16
Z80 index registers.


m_iy16

protected int m_iy16
Z80 index registers.


m_sp16

protected int m_sp16
Z80 core registers.


m_pc16

protected int m_pc16
Z80 core registers.


m_r8

protected int m_r8
Z80 interrupt and refresh registers.


m_i8

protected int m_i8
Z80 interrupt and refresh registers.


m_im2

protected int m_im2
Z80 interrupt mode.


m_iff1a

protected int m_iff1a
Z80 flip-flops.


m_iff1b

protected int m_iff1b
Z80 flip-flops.


m_mode

protected int m_mode
Spectrum model (MODE_48 or MODE_128).


m_issue

protected int m_issue
Spectrum model (issue).


m_border

protected int m_border
Border color.


m_last0x7ffd

protected int m_last0x7ffd
128k specific saved I/O registers.


m_last0xfffd

protected int m_last0xfffd

m_memory

protected org.razvan.jzx.SnapshotMemory m_memory
"headless" memory object that stores the memory image.

See Also:
BaseMemory

m_url

protected java.net.URL m_url
URL used for loading the data.


m_logger

protected ILogger m_logger
Logger object for logging messages and exceptions.

Constructor Detail

BaseLoader

public BaseLoader(ILogger logger,
                  java.net.URL url)
Setup the logger and url, allocate and initialize the "headless" memory object.

Method Detail

getAF16

public int getAF16()

getBC16

public int getBC16()

getDE16

public int getDE16()

getHL16

public int getHL16()

getAF16ALT

public int getAF16ALT()

getBC16ALT

public int getBC16ALT()

getDE16ALT

public int getDE16ALT()

getHL16ALT

public int getHL16ALT()

getIX16

public int getIX16()

getIY16

public int getIY16()

getSP16

public int getSP16()

getPC16

public int getPC16()

getR8

public int getR8()

getI8

public int getI8()

getIM2

public int getIM2()

getIFF1a

public int getIFF1a()

getIFF1b

public int getIFF1b()

getMode

public int getMode()

getIssue

public int getIssue()

getBorder

public int getBorder()

getLast0x7ffd

public int getLast0x7ffd()

getLast0xfffd

public int getLast0xfffd()

getMemory

public BaseMemory getMemory()
Trivial accessor for the (headless) memory object.


load

public abstract void load(java.lang.String name)
                   throws java.io.IOException
Perform the actual loading from the URL fragment identified by the "name" parameter.

Parameters:
name - The URL fragment that is combined with the URL specified in the constructor in order to fully specify the URL for the file from which to load the data.
Throws:
java.io.IOException