summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-05-14 23:17:55 -0700
committerMichael Pavone <pavone@retrodev.com>2015-05-14 23:17:55 -0700
commit7d1aa2ab5e1b839f8cd15425f1004c7d1e952400 (patch)
tree90b86598dc59b53a093448d1f2a8f74260e85352
parentb88dc02ba056c2b5891b1bb062a2ad44df5df544 (diff)
Small horizontal interrupt fixes
-rw-r--r--gst.c2
-rw-r--r--vdp.c4
2 files changed, 3 insertions, 3 deletions
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;
}
diff --git a/vdp.c b/vdp.c
index e6d5aea..a7f9d1b 100644
--- a/vdp.c
+++ b/vdp.c
@@ -1476,7 +1476,7 @@ void vdp_run_context(vdp_context * context, uint32_t target_cycles)
}
}
if (is_h40 && slot == LINE_CHANGE_H40 || !is_h40 && slot == LINE_CHANGE_H32) {
- if (line >= inactive_start) {
+ if (line > inactive_start) {
context->hint_counter = context->regs[REG_HINT];
} else if (context->hint_counter) {
context->hint_counter--;
@@ -1954,7 +1954,7 @@ uint32_t vdp_next_hint(vdp_context * context)
}
uint32_t inactive_start = context->latched_mode & BIT_PAL ? PAL_INACTIVE_START : NTSC_INACTIVE_START;
uint32_t hint_line;
- if (context->vcounter >= inactive_start) {
+ if (context->vcounter + context->hint_counter >= inactive_start) {
hint_line = context->regs[REG_HINT];
} else {
hint_line = context->vcounter + context->hint_counter + 1;