From e6216d5d0a9f8cdb700124558d38cd47e63fbdda Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 3 Jan 2015 18:23:04 -0800 Subject: Made the Z80 core more contained by refactoring some code in blastem.c into z80_to_x86.c --- gst.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gst.c') diff --git a/gst.c b/gst.c index adf034d..a901858 100644 --- a/gst.c +++ b/gst.c @@ -1,6 +1,6 @@ /* Copyright 2013 Michael Pavone - This file is part of BlastEm. + This file is part of BlastEm. BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. */ #include "gst.h" @@ -207,8 +207,8 @@ uint8_t z80_load_gst(z80_context * context, FILE * gstfile) curpos += 2; context->iff1 = context->iff2 = *curpos; curpos += 2; - reset = !*(curpos++); - busreq = *curpos; + context->reset = !*(curpos++); + context->busreq = *curpos; curpos += 3; uint32_t bank = read_le_32(curpos); if (bank < 0x400000) { @@ -350,8 +350,8 @@ uint8_t z80_save_gst(z80_context * context, FILE * gstfile) curpos += 2; *curpos = context->iff1; curpos += 2; - *(curpos++) = !reset; - *curpos = busreq; + *(curpos++) = !context->reset; + *curpos = context->busreq; curpos += 3; uint32_t bank = context->bank_reg << 15; write_le_32(curpos, bank); -- cgit v1.2.3 From 7d1aa2ab5e1b839f8cd15425f1004c7d1e952400 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 14 May 2015 23:17:55 -0700 Subject: Small horizontal interrupt fixes --- gst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gst.c') diff --git a/gst.c b/gst.c index a901858..28cc4ca 100644 --- a/gst.c +++ b/gst.c @@ -423,7 +423,7 @@ uint32_t load_gst(genesis_context * gen, char * fname) fprintf(stderr, "Could not read ident code from %s\n", fname); goto error_close; } - if (memcmp(ident, "GST\x40\xE0", 5) != 0) { + if (memcmp(ident, "GST\x40\xE0", 3) != 0) { fprintf(stderr, "%s doesn't appear to be a GST savestate. The ident code is %c%c%c\\x%X\\x%X instead of GST\\x40\\xE0.\n", fname, ident[0], ident[1], ident[2], ident[3], ident[4]); goto error_close; } -- cgit v1.2.3 From 9d475a3ccb5b2e1e206cf4c219ec5984cec3574f Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 20 Jul 2015 21:15:34 -0700 Subject: Full support for Sega mapper when it comes to data. Code in remapped sections may not work reliably. SSF2 now works. --- gst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gst.c') diff --git a/gst.c b/gst.c index 28cc4ca..48dbd0e 100644 --- a/gst.c +++ b/gst.c @@ -100,7 +100,7 @@ uint32_t m68k_load_gst(m68k_context * context, FILE * gstfile) return 0; } for(curpos = buffer; curpos < (buffer + sizeof(buffer)); curpos += sizeof(uint16_t)) { - context->mem_pointers[1][i++] = read_be_16(curpos); + ram[i++] = read_be_16(curpos); } } return pc; @@ -141,7 +141,7 @@ uint8_t m68k_save_gst(m68k_context * context, uint32_t pc, FILE * gstfile) fseek(gstfile, GST_68K_RAM, SEEK_SET); for (int i = 0; i < (32*1024);) { for(curpos = buffer; curpos < (buffer + sizeof(buffer)); curpos += sizeof(uint16_t)) { - write_be_16(curpos, context->mem_pointers[1][i++]); + write_be_16(curpos, ram[i++]); } if (fwrite(buffer, 1, sizeof(buffer), gstfile) != sizeof(buffer)) { fputs("Failed to write 68K RAM to savestate\n", stderr); -- cgit v1.2.3