diff options
Diffstat (limited to 'arm9/include')
-rw-r--r-- | arm9/include/ds81_global.h | 37 | ||||
-rw-r--r-- | arm9/include/framebuffer.h | 37 | ||||
-rw-r--r-- | arm9/include/gui.h | 28 | ||||
-rw-r--r-- | arm9/include/keyboard.h | 130 | ||||
-rw-r--r-- | arm9/include/tapes.h | 27 | ||||
-rw-r--r-- | arm9/include/z80.h | 250 | ||||
-rw-r--r-- | arm9/include/z80_config.h | 59 | ||||
-rw-r--r-- | arm9/include/z80_private.h | 276 | ||||
-rw-r--r-- | arm9/include/zx81.h | 74 |
9 files changed, 0 insertions, 918 deletions
diff --git a/arm9/include/ds81_global.h b/arm9/include/ds81_global.h deleted file mode 100644 index 96fb23c..0000000 --- a/arm9/include/ds81_global.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ds81 - Nintendo DS ZX81 emulator. - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - $Id$ -*/ -#ifndef DS81_GLOBAL_H -#define DS81_GLOBAL_H - -#define DS81STR(x) #x - -/* Tracing. Remove calls once debugged -- relatively expensive ops -*/ -#define TRACE do \ - { \ - int sprintf(char *,const char *,...); \ - char s[32]; \ - sprintf(s,"%s:%d ",__func__,__LINE__); \ - FB_Print(s,0,184,FB_RGB(31,31,31),FB_RGB(10,10,10));\ - } while(0) - -#endif /* DS81_GLOBAL_H */ diff --git a/arm9/include/framebuffer.h b/arm9/include/framebuffer.h deleted file mode 100644 index 2fd7bc3..0000000 --- a/arm9/include/framebuffer.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - ds81 - Nintendo DS ZX81 emulator. - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - $Id$ -*/ -#ifndef DS81_FRAMEBUFFER_H -#define DS81_FRAMEBUFFER_H - -#define FB_RGB(r,g,b) ((RGB15(r,g,b))|0x8000) - -void FB_Init(uint16 *vram); -void FB_Print(const char *text, int x, int y, int colour, int paper); -void FB_Centre(const char *text, int y, int colour, int paper); -void FB_HLine(int x1, int x2, int y, int colour); -void FB_VLine(int x, int y1, int y2, int colour); -void FB_Box(int x, int y, int w, int h, int colour); -void FB_FillBox(int x, int y, int w, int h, int colour); -void FB_Clear(void); -void FB_Blit(sImage *img, int x, int y); - -#endif /* DS81_FRAMEBUFFER_H */ diff --git a/arm9/include/gui.h b/arm9/include/gui.h deleted file mode 100644 index 4a07915..0000000 --- a/arm9/include/gui.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - ds81 - Nintendo DS ZX81 emulator. - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - $Id$ -*/ -#ifndef DS81_GUI_H -#define DS81_GUI_H - -int GUI_Menu(const char *opts[]); -void GUI_Alert(int fatal, const char *text); - -#endif /* DS81_GUI_H */ diff --git a/arm9/include/keyboard.h b/arm9/include/keyboard.h deleted file mode 100644 index 2afb5df..0000000 --- a/arm9/include/keyboard.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - ds81 - Nintendo ZX81 emulator. - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - $Id$ -*/ -#ifndef DS81_KEYBOARD_H -#define DS81_KEYBOARD_H - -/* Note that the first 40 values purposefully are the keyboard matrix keys. - Note also that they are in display order, not matrix order. -*/ -typedef enum -{ - SK_1, - SK_2, - SK_3, - SK_4, - SK_5, - - SK_6, - SK_7, - SK_8, - SK_9, - SK_0, - - SK_Q, - SK_W, - SK_E, - SK_R, - SK_T, - - SK_Y, - SK_U, - SK_I, - SK_O, - SK_P, - - SK_A, - SK_S, - SK_D, - SK_F, - SK_G, - - SK_H, - SK_J, - SK_K, - SK_L, - SK_NEWLINE, - - SK_SHIFT, - SK_Z, - SK_X, - SK_C, - SK_V, - - SK_B, - SK_N, - SK_M, - SK_PERIOD, - SK_SPACE, - - SK_ABOUT, - SK_CONFIG, - SK_PAD_UP, - SK_PAD_DOWN, - SK_PAD_LEFT, - SK_PAD_RIGHT, - SK_PAD_A, - SK_PAD_B, - SK_PAD_X, - SK_PAD_Y, - SK_PAD_R, - SK_PAD_L, - SK_PAD_START, - SK_PAD_SELECT, - - NUM_SOFT_KEYS -} SoftKey; - -typedef struct -{ - SoftKey key; - int pressed; -} SoftKeyEvent; - - -/* Display the soft keyboard -*/ -void SK_DisplayKeyboard(uint16 *vram); - -/* Returns TRUE while there are still key events for this cycle -*/ -int SK_GetEvent(SoftKeyEvent *ev); - -/* Returns TRUE while there are still key events for this cycle. Unlike - SK_GetEvent this does not do joypad mappings. -*/ -int SK_GetBareEvent(SoftKeyEvent *ev); - -/* Sets a key to be 'sticky' (it will be released automatically on the next - non-sticky press). -*/ -void SK_SetSticky(SoftKey key, int is_sticky); - -/* Map the joypad to keys. Note that when mapped that both the key and the - joypad code will be generated. -*/ -void SK_DefinePad(SoftKey pad, SoftKey key); - -/* Returns a name for key symbols. -*/ -const char *SK_KeyName(SoftKey pad); - -#endif /* DS81_KEYBOARD_H */ diff --git a/arm9/include/tapes.h b/arm9/include/tapes.h deleted file mode 100644 index c31df9a..0000000 --- a/arm9/include/tapes.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - ds81 - Nintendo DS ZX81 emulator. - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - $Id$ -*/ -#ifndef DS81_TAPES_H -#define DS81_TAPES_H - -void SelectTape(void); - -#endif /* DS81_TAPES_H */ diff --git a/arm9/include/z80.h b/arm9/include/z80.h deleted file mode 100644 index 000b950..0000000 --- a/arm9/include/z80.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - - z80 - Z80 emulation - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------- - - $Id$ - -*/ - -#ifndef Z80_H -#define Z80_H "$Id$" - -/* Configuration -*/ -#include "z80_config.h" - - -/* ---------------------------------------- TYPES -*/ - -/* Large unsigned type -*/ -typedef unsigned long Z80Val; - - -/* 8-bit type. The emulation will exit with code 2 if this isn't 8 bits. -*/ -typedef unsigned char Z80Byte; - - -/* 8-bit signed type. The emulation will exit with code 2 if this isn't 8 bits. -*/ -typedef signed char Z80Relative; - - -/* 16-bit type. The emulation will exit with code 2 if this isn't 16 bits. -*/ -typedef unsigned short Z80Word; - - -/* A Z80 16-bit register. To access the HI/LO component use the indexes - Z80_HI_WORD and Z80_LO_WORD which will be initialised once Z80Init has been - called. -*/ -typedef union -{ - Z80Word w; - Z80Byte b[2]; -} Z80Reg; - -extern int Z80_HI_WORD; -extern int Z80_LO_WORD; - - -/* The processor -*/ -struct Z80Private; - -typedef struct -{ - Z80Word PC; - - Z80Reg AF; - Z80Reg BC; - Z80Reg DE; - Z80Reg HL; - - Z80Word AF_; - Z80Word BC_; - Z80Word DE_; - Z80Word HL_; - - Z80Reg IX; - Z80Reg IY; - - Z80Word SP; - - Z80Byte IFF1; - Z80Byte IFF2; - Z80Byte IM; - Z80Byte I; - Z80Byte R; - - struct Z80Private *priv; -} Z80; - - -/* Interfaces used to handle memory -*/ -typedef Z80Byte (*Z80ReadMemory)(Z80 *cpu, Z80Word address); -typedef void (*Z80WriteMemory)(Z80 *cpu, Z80Word address, Z80Byte value); - - -/* Interfaces needed to handle ports (IN/OUT commands) -*/ -typedef Z80Byte (*Z80ReadPort)(Z80 *cpu, Z80Word address); -typedef void (*Z80WritePort)(Z80 *cpu, Z80Word address, Z80Byte value); - - -/* Callback. Callback should return TRUE for processing to continue. -*/ -typedef int (*Z80Callback)(Z80 *cpu, Z80Val data); - - -/* Callback reasons - - eZ80_Instruction Called before the initial fetch for an instruction - (called just to once no matter how many bytes the - instruction is made up of). - - eZ80_EDHook Called when an undefined ED opcode is executed. - - eZ80_Halt Called when the HALT instruction is hit and released. - - eZ80_RETI Called when the RETI instruction is executed -*/ -typedef enum -{ - eZ80_Instruction, /* data = no cycles since reset */ - eZ80_EDHook, /* data = byte after ED opcode (only for NOP opcodes) */ - eZ80_Halt, /* data = 1 halt raised, 0 halt cleared by int */ - eZ80_RETI, /* data = ignored */ - eZ80_NO_CALLBACK /* leave at end */ -} Z80CallbackReason; - - -/* Flags in the F register -*/ -typedef enum -{ - eZ80_Carry =0x01, - eZ80_Neg =0x02, - eZ80_PV =0x04, - eZ80_Hidden3 =0x08, - eZ80_HalfCarry =0x10, - eZ80_Hidden5 =0x20, - eZ80_Zero =0x40, - eZ80_Sign =0x80 -} Z80FlagRegister; - - -/* Disassembly label -- only useful if ENABLE_DISASSEMBLER is set. - Labels are stored as an array, where a NULL in the label field marks - the end of the list. -*/ -typedef struct -{ - Z80Word address; - const char *label; -} Z80Label; - - -/* ---------------------------------------- INTERFACES -*/ - - -/* Initialises the processor. -*/ -#ifdef ENABLE_ARRAY_MEMORY -Z80 *Z80Init(Z80ReadPort read_port, - Z80WritePort write_port); -#else -Z80 *Z80Init(Z80ReadMemory read_memory, - Z80WriteMemory write_memory, - Z80ReadPort read_port, - Z80WritePort write_port, - Z80ReadMemory read_for_disassem); -#endif - - -/* Resets the processor. -*/ -void Z80Reset(Z80 *cpu); - - -/* Lodge a callback to be invoked after special events. Returns FALSE - if the callback couldn't be lodged (there is a max of 10 callbacks per - reason). -*/ -int Z80LodgeCallback(Z80 *cpu, - Z80CallbackReason reason, - Z80Callback callback); - - -/* Remove a callback. Does nothing if reason was not lodged with - Z80LodgeCallback() -*/ -void Z80RemoveCallback(Z80 *cpu, - Z80CallbackReason reason, - Z80Callback callback); - - -/* Cause an interrupt before the next opcode. - devbyte is the byte generated by the device (if any). -*/ -void Z80Interrupt(Z80 *cpu, Z80Byte devbyte); - - -/* Cause an NMI -*/ -void Z80NMI(Z80 *cpu); - - -/* Execute a single instruction. Returns FALSE if any callback returned - FALSE. -*/ -int Z80SingleStep(Z80 *cpu); - - -/* Executes until a callback returns FALSE (never returns otherwise) -*/ -void Z80Exec(Z80 *cpu); - - -/* Manipulate the cylce count of the Z80 -*/ -Z80Val Z80Cycles(Z80 *cpu); -void Z80ResetCycles(Z80 *cpu, Z80Val cycles); - - -/* Set address to label mappings for the disassembler -*/ -void Z80SetLabels(Z80Label labels[]); - - -/* Simple disassembly of memory accessed through read_for_disassem, or - Z80_MEMORY as appropriate. addr is updated on exit. -*/ -const char *Z80Disassemble(Z80 *cpu, Z80Word *addr); - -#endif - -/* END OF FILE */ diff --git a/arm9/include/z80_config.h b/arm9/include/z80_config.h deleted file mode 100644 index 8be062b..0000000 --- a/arm9/include/z80_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - - z80 - Z80 emulation - - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------- - - $Id$ - -*/ - -#ifndef Z80_CONFIG_H -#define Z80_CONFIG_H "$Id$" - - -/* This file defines various compile-time configuration options - for the Z80 emulation -*/ - - -/* Define this to enable the disassembly interface -#define ENABLE_DISASSEM -*/ - - -/* Define this to enable the array-based memory model. In this mode - an externally visible Z80Byte array called Z80_MEMORY must be - defined. The macros RAMBOT and RAMTOP define the writable area of - memory and must be changed accordingly. - - In this mode the signature of Z80Init changes so that the memory functions - are not passed. ALL processor instances share the same memory. -#define ENABLE_ARRAY_MEMORY -*/ - -#ifdef ENABLE_ARRAY_MEMORY -#define RAMBOT 0x0000 -#define RAMTOP 0xffff -#endif - - -#endif - -/* END OF FILE */ diff --git a/arm9/include/z80_private.h b/arm9/include/z80_private.h deleted file mode 100644 index dc4f6b9..0000000 --- a/arm9/include/z80_private.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - - z80 - Z80 emulation - - Copyright (C) 2006 Ian Cowburn (ianc@noddybox.co.uk) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------- - - $Id$ - - Private macros for Z80 - -*/ - -#ifndef Z80_PRIVATE_H -#define Z80_PRIVATE_H "$Id$" - -#include "z80_config.h" - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#define MAX_PER_CALLBACK 10 - - -/* ---------------------------------------- TYPES -*/ - -struct Z80Private -{ - Z80Val cycle; - - int halt; - - Z80Byte shift; - - int raise; - Z80Byte devbyte; - int nmi; - -#ifndef ENABLE_ARRAY_MEMORY - Z80ReadMemory disread; - - Z80ReadMemory mread; - Z80WriteMemory mwrite; -#endif - - Z80ReadPort pread; - Z80WritePort pwrite; - - Z80Callback callback[eZ80_NO_CALLBACK][MAX_PER_CALLBACK]; - - int last_cb; -}; - -#define PRIV cpu->priv - - -/* ---------------------------------------- ARRAY MEMORY -*/ - -#ifdef ENABLE_ARRAY_MEMORY -extern Z80Byte Z80_MEMORY[]; -#endif - - -/* ---------------------------------------- MACROS -*/ - -/* NOTE: A lot of these macros assume you have a variable called 'cpu' - which is a pointer to Z80 -*/ - - -/* Invoke a callback class -*/ -#define CALLBACK(r,d) do \ - { \ - int f; \ - \ - for(f=0;f<MAX_PER_CALLBACK;f++) \ - if (PRIV->callback[r][f]) \ - PRIV->last_cb &= \ - PRIV->callback[r][f](cpu,d);\ - } while(0) - -/* Flag register -*/ -#define C_Z80 0x01 -#define N_Z80 0x02 -#define P_Z80 0x04 -#define V_Z80 P_Z80 -#define H_Z80 0x10 -#define Z_Z80 0x40 -#define S_Z80 0x80 - -#define B3_Z80 0x08 -#define B5_Z80 0x20 - - -#define SET(v,b) (v)|=b -#define CLR(v,b) (v)&=~(b) - -#define SETFLAG(f) SET(cpu->AF.b[LO],f) -#define CLRFLAG(f) CLR(cpu->AF.b[LO],f) - -#ifdef ENABLE_ARRAY_MEMORY - -#define PEEK(addr) Z80_MEMORY[addr] - -static inline Z80Word PEEKW(Z80Word addr) -{ - return (PEEK(addr) | (Z80Word)PEEK(addr+1)<<8); -} - -#define POKE(addr,val) do \ - { \ - Z80Word ba=addr; \ - if (ba>=RAMBOT && ba<=RAMTOP) \ - Z80_MEMORY[ba]=val; \ - } while(0) - -#define POKEW(addr,val) do \ - { \ - Z80Word wa=addr; \ - Z80Word wv=val; \ - POKE(wa,wv); \ - POKE(wa+1,wv>>8); \ - } while(0) - - -#define FETCH_BYTE (Z80_MEMORY[cpu->PC++]) -#define FETCH_WORD (cpu->PC+=2, \ - Z80_MEMORY[cpu->PC-2]| \ - ((Z80Word)Z80_MEMORY[cpu->PC-1]<<8)) - -#else - -#define PEEK(addr) (PRIV->mread(cpu,addr)) -#define PEEKW(addr) FPEEKW(cpu,addr) - -#define POKE(addr,val) PRIV->mwrite(cpu,addr,val) -#define POKEW(addr,val) FPOKEW(cpu,addr,val) - -#define FETCH_BYTE (PRIV->mread(cpu,cpu->PC++)) -#define FETCH_WORD (cpu->PC+=2,FPEEKW(cpu,cpu->PC-2)) - -#endif - - -#define IS_C (cpu->AF.b[LO]&C_Z80) -#define IS_N (cpu->AF.b[LO]&N_Z80) -#define IS_P (cpu->AF.b[LO]&P_Z80) -#define IS_H (cpu->AF.b[LO]&H_Z80) -#define IS_Z (cpu->AF.b[LO]&Z_Z80) -#define IS_S (cpu->AF.b[LO]&S_Z80) - -#define CARRY IS_C - -#define IS_IX_IY (PRIV->shift==0xdd || PRIV->shift==0xfd) -#define OFFSET(off) off=(IS_IX_IY ? (Z80Relative)FETCH_BYTE:0) - -#define TSTATE(n) PRIV->cycle+=n - -#define ADD_R(v) cpu->R=((cpu->R&0x80)|((cpu->R+(v))&0x7f)) -#define INC_R ADD_R(1) - -#ifdef ENABLE_ARRAY_MEMORY - -#define PUSH(REG) do \ - { \ - Z80Word pv=REG; \ - cpu->SP-=2; \ - POKE(cpu->SP,pv); \ - POKE(cpu->SP+1,pv>>8); \ - } while(0) - -#else - -#define PUSH(REG) do \ - { \ - Z80Word pushv=REG; \ - cpu->SP-=2; \ - PRIV->mwrite(cpu,cpu->SP,pushv); \ - PRIV->mwrite(cpu,cpu->SP+1,pushv>>8);\ - } while(0) -#endif - -#define POP(REG) do \ - { \ - REG=PEEK(cpu->SP) | \ - (Z80Word)PEEK(cpu->SP+1)<<8; \ - cpu->SP+=2; \ - } while(0) - -#define SETHIDDEN(res) cpu->AF.b[LO]=(cpu->AF.b[LO]&~(B3_Z80|B5_Z80))|\ - ((res)&(B3_Z80|B5_Z80)) - -#define CALL do \ - { \ - PUSH(cpu->PC+2); \ - cpu->PC=PEEKW(cpu->PC); \ - } while(0) - -#define NOCALL cpu->PC+=2 -#define JP cpu->PC=PEEKW(cpu->PC) -#define NOJP cpu->PC+=2 -#define JR cpu->PC+=(Z80Relative)PEEK(cpu->PC)+1 -#define NOJR cpu->PC++ - -#define OUT(P,V) do \ - { \ - if (PRIV->pwrite) \ - PRIV->pwrite(cpu,P,V); \ - } while(0) - -#define IN(P) (PRIV->pread?PRIV->pread(cpu,P):0) - - - -/* ---------------------------------------- LABELS -*/ -extern Z80Label *z80_labels; - - -/* ---------------------------------------- GLOBAL GENERAL OPCODES/ROUTINES -*/ -void Z80_Decode(Z80 *cpu, Z80Byte opcode); -void Z80_InitialiseInternals(void); - - -/* ---------------------------------------- DISASSEMBLY -*/ -#ifdef ENABLE_DISASSEM -typedef void (*DIS_OP_CALLBACK)(Z80 *z80, Z80Byte op, Z80Word *pc); - -extern DIS_OP_CALLBACK dis_CB_opcode[]; -extern DIS_OP_CALLBACK dis_DD_opcode[]; -extern DIS_OP_CALLBACK dis_DD_CB_opcode[]; -extern DIS_OP_CALLBACK dis_ED_opcode[]; -extern DIS_OP_CALLBACK dis_FD_opcode[]; -extern DIS_OP_CALLBACK dis_FD_CB_opcode[]; -extern DIS_OP_CALLBACK dis_opcode_z80[]; - -const char *Z80_Dis_Printf(const char *format, ...); - -Z80Byte Z80_Dis_FetchByte(Z80 *cpu, Z80Word *pc); -Z80Word Z80_Dis_FetchWord(Z80 *cpu, Z80Word *pc); - -void Z80_Dis_Set(const char *op, const char *arg); -const char *Z80_Dis_GetOp(void); -const char *Z80_Dis_GetArg(void); -#endif /* ENABLE_DISASSEM */ - -#endif /* Z80_PRIVATE_H */ - -/* END OF FILE */ diff --git a/arm9/include/zx81.h b/arm9/include/zx81.h deleted file mode 100644 index 992cba7..0000000 --- a/arm9/include/zx81.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - - ds81 - Nintendo DS ZX81 emulator - - Copyright (C) 2006 Ian Cowburn (ianc@noddybox.co.uk) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - ------------------------------------------------------------------------- - - Provides the emulation for the ZX81 - -*/ - -#ifndef DS81_ZX81_H -#define DS81_ZX81_H - -#include "z80.h" -#include "keyboard.h" - - -/* Initialise the ZX81 -*/ -void ZX81Init(uint16 *vram, Z80 *z80); - -/* Handle keypresses -*/ -void ZX81HandleKey(SoftKey k, int is_pressed); - -/* Enable fopen() loading of tape files -*/ -void ZX81EnableFileSystem(int enable); - -/* Set a file to load from tape -*/ -void ZX81SetTape(const Z80Byte *image, int len); - -/* Reset the 81 -*/ -void ZX81Reset(Z80 *z80); - -/* Displays a string on the ZX81's dislpay. The screen is cleared and the - string displayed with \n characters breaking the line. - - Not all characters can be respresented by the ZX81, and the screen will be - lost on the next emulation update cycle. - - The character '%' toggles inverse video. -*/ -void ZX81DisplayString(const char *p); - -/* Interfaces for the Z80 -*/ -Z80Byte ZX81ReadMem(Z80 *z80, Z80Word addr); -void ZX81WriteMem(Z80 *z80, Z80Word addr, Z80Byte val); -Z80Byte ZX81ReadPort(Z80 *z80, Z80Word port); -void ZX81WritePort(Z80 *z80, Z80Word port, Z80Byte val); - -#endif - - -/* END OF FILE */ |