Machine code restructure, models are now machines instead and the init functions are in the machine files rather than in machine.c (former model.c), also moved the machine stuff into the machine/ subdirectory.
This commit is contained in:
46
src/machine/machine_at_commodore.c
Normal file
46
src/machine/machine_at_commodore.c
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "../ibm.h"
|
||||
|
||||
#include "../io.h"
|
||||
#include "../lpt.h"
|
||||
#include "../serial.h"
|
||||
|
||||
#include "machine_at.h"
|
||||
#include "machine_at_commodore.h"
|
||||
|
||||
static void cbm_io_write(uint16_t port, uint8_t val, void *p)
|
||||
{
|
||||
lpt1_remove();
|
||||
lpt2_remove();
|
||||
switch (val & 3)
|
||||
{
|
||||
case 1:
|
||||
lpt1_init(0x3bc);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x378);
|
||||
break;
|
||||
case 3:
|
||||
lpt1_init(0x278);
|
||||
break;
|
||||
}
|
||||
switch (val & 0xc)
|
||||
{
|
||||
case 0x4:
|
||||
serial_setup(1, 0x2f8, 3);
|
||||
break;
|
||||
case 0x8:
|
||||
serial_setup(1, 0x3f8, 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void cbm_io_init()
|
||||
{
|
||||
io_sethandler(0x0230, 0x0001, NULL,NULL,NULL, cbm_io_write,NULL,NULL, NULL);
|
||||
}
|
||||
|
||||
void machine_at_cmdpc_init(void)
|
||||
{
|
||||
machine_at_ide_top_remap_init();
|
||||
cbm_io_init();
|
||||
}
|
||||
Reference in New Issue
Block a user