diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-02-10 11:58:23 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-02-10 11:58:23 -0800 |
commit | 1b23425efd7606bf6cd509861d9b2d60e033e962 (patch) | |
tree | e46744c08ca261f8e98aaa0d4cd109826d391f63 /gst.c | |
parent | a983bd12fa7e47b00d2cc2e8f7cb7dcdfbf26cdf (diff) |
Initial attempt at interrupts in new Z80 core and integrating it into main executable
Diffstat (limited to 'gst.c')
-rw-r--r-- | gst.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -144,6 +144,7 @@ uint8_t z80_load_gst(z80_context * context, FILE * gstfile) } uint8_t * curpos = regdata; uint8_t f = *(curpos++); +#ifndef NEW_CORE context->flags[ZF_C] = f & 1; f >>= 1; context->flags[ZF_N] = f & 1; @@ -200,6 +201,7 @@ uint8_t z80_load_gst(z80_context * context, FILE * gstfile) context->mem_pointers[1] = NULL; } context->bank_reg = bank >> 15; +#endif uint8_t buffer[Z80_RAM_BYTES]; fseek(gstfile, GST_Z80_RAM, SEEK_SET); if(fread(buffer, 1, sizeof(buffer), gstfile) != (8*1024)) { @@ -210,11 +212,15 @@ uint8_t z80_load_gst(z80_context * context, FILE * gstfile) { if (context->mem_pointers[0][i] != buffer[i]) { context->mem_pointers[0][i] = buffer[i]; +#ifndef NEW_CORE z80_handle_code_write(i, context); +#endif } } +#ifndef NEW_CORE context->native_pc = NULL; context->extra_pc = NULL; +#endif return 1; } @@ -296,6 +302,7 @@ uint8_t z80_save_gst(z80_context * context, FILE * gstfile) uint8_t regdata[GST_Z80_REG_SIZE]; uint8_t * curpos = regdata; memset(regdata, 0, sizeof(regdata)); +#ifndef NEW_CORE uint8_t f = context->flags[ZF_S]; f <<= 1; f |= context->flags[ZF_Z] ; @@ -348,6 +355,7 @@ uint8_t z80_save_gst(z80_context * context, FILE * gstfile) curpos += 3; uint32_t bank = context->bank_reg << 15; write_le_32(curpos, bank); +#endif fseek(gstfile, GST_Z80_REGS, SEEK_SET); if (fwrite(regdata, 1, sizeof(regdata), gstfile) != sizeof(regdata)) { return 0; |