From 0bc192bffbf28ba5733ae955916e5ebc72f3641f Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 5 Jul 2021 19:29:54 +0000 Subject: Initial working version. Still todo : Tapes, Sound --- include/config.h | 1 - include/keyboard.h | 2 +- include/snap.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/spec.h | 8 ++++++-- 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 include/snap.h (limited to 'include') diff --git a/include/config.h b/include/config.h index a6734f7..b57c3ef 100644 --- a/include/config.h +++ b/include/config.h @@ -28,7 +28,6 @@ typedef enum { DSSPEC_STICKY_SHIFT, - DSSPEC_ALLOW_TAPE_SAVE, DSSPEC_LOAD_DEFAULT_SNAPSHOT, DSSPEC_NUM_CONFIG_ITEMS } DSSPEC_ConfigItem; diff --git a/include/keyboard.h b/include/keyboard.h index 00fdcb6..94805a0 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -73,7 +73,7 @@ typedef enum SK_B, SK_N, SK_M, - SK_PERIOD, + SK_SYMBOL, SK_SPACE, SK_ABOUT, diff --git a/include/snap.h b/include/snap.h new file mode 100644 index 0000000..62b6063 --- /dev/null +++ b/include/snap.h @@ -0,0 +1,50 @@ +/* + 3dsspec - Nintendo 3DS Sinclair Spectrum 48K emulator. + + Copyright (C) 2021 Ian Cowburn (ianc@noddybox.demon.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: snap.h 3 2006-09-13 23:49:18Z ianc $ + +*/ + +#ifndef DSSPEC_SNAP_H +#define DSSPEC_SNAP_H + +#include "z80.h" + +/* ---------------------------------------- INTERFACES +*/ + +typedef Z80Byte (*SNAP_Peek)(Z80Word address); +typedef void (*SNAP_Poke)(Z80Word address, Z80Byte val); + + +/* Sets the active TAP file +*/ +void TAPSetTape(Z80Byte *tap, int len); + +/* Loads a block from a TAP file. Returns FALSE for failure. +*/ +int TAPLoad(Z80Byte id, Z80Word *addr, + Z80Word *len, SNAP_Poke poke); + +#endif + + +/* END OF FILE */ diff --git a/include/spec.h b/include/spec.h index b6b73eb..8b7154b 100644 --- a/include/spec.h +++ b/include/spec.h @@ -37,9 +37,9 @@ */ void SPECInit(Z80 *z80); -/* Render the display +/* Start the frame */ -void SPECRenderDisplay(Framebuffer *fb, Z80 *z80); +void SPECStartFrame(Framebuffer *fb); /* Handle keypresses */ @@ -70,6 +70,10 @@ void SPECWritePort(Z80 *z80, Z80Word port, Z80Byte val); #define SPECReadDisassem SPECReadMem +/* Interface for snap +*/ +void SPECWriteSnap(Z80Word addr, Z80Byte val); + /* Interfaces to allows the SPEC to save/load itself as a snapshot to/from a stream. */ -- cgit v1.2.3