Z80.cpp

00001 #include "openem.h"
00002 #include "cpu/debug/cpudbg.h"
00003 #include "cpu/Z80/Z80.h"
00004 #include <stdlib.h>
00005 #include <stdio.h>
00006 #include <string.h>
00007 
00008 #define FLAG_S      0x80        // Sign flag. copy of MSB
00009 #define FLAG_Z      0x40        // Zero flag.
00010 #define FLAG_Y      0x20        // Copy of bit 5
00011 #define FLAG_H      0x10        // Half-carry flag for BCD
00012 #define FLAG_X      0x08        // Copy of bit 3
00013 #define FLAG_P      0x04        // Parity flag
00014 #define FLAG_N      0x02        // What the last ALU op was (addition or subtraction)
00015 #define FLAG_C      0x01        // Carry flag   
00016 
00017 void CPU_Z80::init()                            // 1) Call this on init
00018 {
00019 }
00020 
00021 void CPU_Z80::reset()                           // 4) Then call this to start the emulator. It will jump to the location contained at RESETVEC (0xFFFC)
00022 {
00023     curbank = 0;        // Current register bank being used is 0
00024     IFF1 = IFF2 = 0;    // Interrupts disabled
00025     interrupt_mode = 0; // Interrupt mode is 0 (I8080 emulation)
00026     I = 0;              // Register I = 0
00027     regs[0][CPU_Z80_AF].val = regs[1][CPU_Z80_AF].val = 0xFFFF;
00028     SP = 0xFFFF;
00029     PC = 0;
00030 }
00031 
00032 void CPU_Z80::cycle(dword numleft)              // Do cycles!
00033 {
00034 }
00035 
00036 void CPU_Z80::save_state(CPU_Z80_STATE *foo)    // Save the state!
00037 {
00038 }
00039 
00040 void CPU_Z80::restore_state(CPU_Z80_STATE *foo) // Restore the state!
00041 {
00042 }
00043 
00044 void CPU_Z80::setjumptable(int ins, int mode)   // Sets instruction jump table info
00045 {
00046 }
00047 
00048 void CPU_Z80::IllegalOpcode()                   // Illegal operation.
00049 {
00050 }
00051 
00052 
00053 void CPU_Z80::set_debug_mode(uint16 mode)       // Set the debug mode!
00054 {
00055 }
00056 
00057 char *CPU_Z80::debug_str(CPU_Z80_DEBUG_STATE *s)// Returns a string containing debug info dump
00058 {
00059     char *foo = (char *)malloc(4);
00060     foo[0] = foo[1] = 0;
00061     return foo;
00062 }

Generated on Sat Sep 9 03:50:44 2006 for Openem APIs by  doxygen 1.4.7