mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-31 19:31:55 +00:00
Implement (true? better?) framerate cycle
This commit is contained in:
parent
f1c0716313
commit
9f09be93a9
@ -4,7 +4,8 @@
|
|||||||
#include "apple2.h"
|
#include "apple2.h"
|
||||||
#include "vm_bits.h"
|
#include "vm_bits.h"
|
||||||
|
|
||||||
extern void apple2_draw_pixel(apple2 *, vm_16bit);
|
extern void apple2_draw(apple2 *);
|
||||||
extern void apple2_draw_40col(apple2 *);
|
extern void apple2_draw_40col(apple2 *);
|
||||||
|
extern void apple2_draw_pixel(apple2 *, vm_16bit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -350,13 +350,14 @@ extern bool apple2_is_double_video(apple2 *);
|
|||||||
extern int apple2_boot(apple2 *);
|
extern int apple2_boot(apple2 *);
|
||||||
extern void apple2_clear_strobe(apple2 *);
|
extern void apple2_clear_strobe(apple2 *);
|
||||||
extern void apple2_free(apple2 *);
|
extern void apple2_free(apple2 *);
|
||||||
|
extern void apple2_notify_refresh(apple2 *);
|
||||||
extern void apple2_press_key(apple2 *, vm_8bit);
|
extern void apple2_press_key(apple2 *, vm_8bit);
|
||||||
extern void apple2_release_key(apple2 *);
|
extern void apple2_release_key(apple2 *);
|
||||||
extern void apple2_reset(apple2 *);
|
extern void apple2_reset(apple2 *);
|
||||||
extern void apple2_run_loop(apple2 *);
|
extern void apple2_run_loop(apple2 *);
|
||||||
extern void apple2_set_bank_switch(apple2 *, vm_8bit);
|
extern void apple2_set_bank_switch(apple2 *, vm_8bit);
|
||||||
extern void apple2_set_color(apple2 *, int);
|
extern void apple2_set_color(apple2 *, int);
|
||||||
extern void apple2_set_memory_mode(apple2 *, vm_8bit);
|
|
||||||
extern void apple2_set_display(apple2 *, vm_8bit);
|
extern void apple2_set_display(apple2 *, vm_8bit);
|
||||||
|
extern void apple2_set_memory_mode(apple2 *, vm_8bit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -391,6 +391,7 @@ apple2_run_loop(apple2 *mach)
|
|||||||
mos6502_execute(mach->cpu);
|
mos6502_execute(mach->cpu);
|
||||||
|
|
||||||
if (vm_screen_dirty(mach->screen)) {
|
if (vm_screen_dirty(mach->screen)) {
|
||||||
|
apple2_draw(mach);
|
||||||
vm_screen_refresh(mach->screen);
|
vm_screen_refresh(mach->screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ SEGMENT_WRITER(apple2_dbuf_write)
|
|||||||
segment->memory[addr] = value;
|
segment->memory[addr] = value;
|
||||||
|
|
||||||
if (mach->display_mode & DISPLAY_TEXT) {
|
if (mach->display_mode & DISPLAY_TEXT) {
|
||||||
apple2_draw_40col(mach);
|
apple2_notify_refresh(mach);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,3 +102,28 @@ apple2_draw_40col(apple2 *mach)
|
|||||||
apple2_text_draw(mach, addr);
|
apple2_text_draw(mach, addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Find the right draw method for the machine, based on its display
|
||||||
|
* mode, and use that to refresh the screen.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
apple2_draw(apple2 *mach)
|
||||||
|
{
|
||||||
|
if (mach->display_mode & DISPLAY_TEXT) {
|
||||||
|
apple2_draw_40col(mach);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tell the screen that it has a change ready to be displayed. This
|
||||||
|
* function will not immediately redraw the screen, and when the screen
|
||||||
|
* is redrawn is up to our framerate cycle.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
apple2_notify_refresh(apple2 *mach)
|
||||||
|
{
|
||||||
|
if (mach && mach->screen) {
|
||||||
|
mach->screen->dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user