mirror of
https://github.com/pevans/erc-c.git
synced 2024-10-07 01:55:57 +00:00
Add set_memory function
This commit is contained in:
parent
62af6ef606
commit
8ad1311536
@ -135,6 +135,7 @@ extern void apple2_release_key(apple2 *);
|
||||
extern void apple2_reset(apple2 *);
|
||||
extern void apple2_run_loop(apple2 *);
|
||||
extern void apple2_set_color(apple2 *, int);
|
||||
extern void apple2_set_memory(apple2 *, int);
|
||||
extern void apple2_set_video(apple2 *, int);
|
||||
|
||||
#endif
|
||||
|
15
src/apple2.c
15
src/apple2.c
@ -119,6 +119,10 @@ apple2_create(int width, int height)
|
||||
// We default to lo-res mode.
|
||||
apple2_set_video(mach, VIDEO_LORES);
|
||||
|
||||
// By default we should have ROM be the addressable last 12k of
|
||||
// memory.
|
||||
apple2_set_memory(mach, MEMORY_BANK_ROM);
|
||||
|
||||
// Let's install our bitmap font.
|
||||
mach->sysfont = vm_bitfont_create(mach->screen,
|
||||
objstore_apple2_sysfont(),
|
||||
@ -134,6 +138,15 @@ apple2_create(int width, int height)
|
||||
return mach;
|
||||
}
|
||||
|
||||
/*
|
||||
* Change the memory mode of the apple2 to a given mode.
|
||||
*/
|
||||
void
|
||||
apple2_set_memory(apple2 *mach, int mode)
|
||||
{
|
||||
mach->memory_mode = mode;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if we are in a state that the apple2 would consider
|
||||
* double resolution. (In practice, this refers to horizontal screen
|
||||
@ -202,6 +215,8 @@ apple2_reset(apple2 *mach)
|
||||
mach->cpu->P = MOS_INTERRUPT;
|
||||
mach->cpu->PC = vm_segment_get16(mach->memory, 0xFFFC);
|
||||
mach->cpu->S = 0;
|
||||
|
||||
log_critical("At end of reset, PC = 0x%x", mach->cpu->PC);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user