31.05.2010

parent 3e0522b3
......@@ -1580,7 +1580,7 @@ dnl //mtufan
dnl
is_64bit=no
AC_MSG_CHECKING([whether CPU is 64bit])
if grep "x86_64" /proc/version > /dev/null; then
if [[ "$HOST_CPU" = amd64 ]]; then
is_64bit=yes
AC_DEFINE(CPU_64_BIT,1,[CPU is 64bit])
UAE_DEFINES="$UAE_DEFINES -DCPU_64_BIT -D__x86_64__"
......
This diff is collapsed.
/*
* UAE - The Un*x Amiga Emulator
*
* ADIDE
*
* (c) 2009 Toni Wilen
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "gayle.h"
static struct ide_hdf *idedrive[2];
int adide_add_ide_unit (int ch, char *path, int blocksize, int readonly,
char *devname, int sectors, int surfaces, int reserved,
int bootpri, char *filesys)
{
struct ide_hdf *ide;
if (ch >= 2)
return -1;
alloc_ide_mem ();
ide = idedrive[ch];
if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
return -1;
ide->lba48 = ide->hdhfd.size >= 128 * (uae_u64)0x40000000 ? 1 : 0;
write_log ("IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n",
ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48);
ide->status = 0;
ide->data_offset = 0;
ide->data_size = 0;
//dumphdf (&ide->hdhfd.hfd);
return 1;
}
/*
* UAE - The Un*x Amiga Emulator
*
* ADIDE
*
* (c) 2009 Toni Wilen
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "gayle.h"
static struct ide_hdf *idedrive[2];
int adide_add_ide_unit (int ch, char *path, int blocksize, int readonly,
char *devname, int sectors, int surfaces, int reserved,
int bootpri, char *filesys)
{
struct ide_hdf *ide;
if (ch >= 2)
return -1;
alloc_ide_mem ();
ide = idedrive[ch];
if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
return -1;
ide->lba48 = ide->hdhfd.size >= 128 * (uae_u64)0x40000000 ? 1 : 0;
write_log ("IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n",
ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48);
ide->status = 0;
ide->data_offset = 0;
ide->data_size = 0;
//dumphdf (&ide->hdhfd.hfd);
return 1;
}
......@@ -402,7 +402,7 @@ static int qcode_valid;
static int cdrom_disk, cdrom_paused, cdrom_playing;
static int cdrom_command_active;
static int cdrom_command_length;
static int cdrom_checksum_error, cdrom_unknown_command;
static int cdrom_checksum_error, cdrom_unknown_command;
static int cdrom_data_offset, cdrom_speed, cdrom_sector_counter;
static int cdrom_current_sector, cdrom_seek_delay;
static int cdrom_data_end, cdrom_leadout;
......@@ -788,8 +788,8 @@ static int cdrom_command_led (void)
static int cdrom_command_media_status (void)
{
cdrom_result_buffer[0] = 0x0a;
cdrom_result_buffer[1] = sys_command_ismedia (DF_IOCTL, unitnum, 0) ? 0x83: 0x80;
cdrom_result_buffer[0] = 0x0a;
cdrom_result_buffer[1] = sys_command_ismedia (DF_IOCTL, unitnum, 0) ? 0x83: 0x80;
return 2;
}
......@@ -942,8 +942,8 @@ static void cdrom_run_command (void)
uae_u8 checksum;
uae_u8 *pp = get_real_address (cdtx_address);
if (!(cdrom_flags & CDFLAG_TXD))
return;
if (!(cdrom_flags & CDFLAG_TXD))
return;
for (;;) {
if (cdrom_command_active)
return;
......@@ -955,20 +955,20 @@ static void cdrom_run_command (void)
return;
}
cdrom_checksum_error = 0;
cdrom_unknown_command = 0;
cdrom_unknown_command = 0;
cmd_len = command_lengths[cdrom_command & 0x0f];
if (cmd_len < 0) {
#if AKIKO_DEBUG_IO_CMD
write_log ("unknown command %x\n", cdrom_command & 0x0f);
write_log ("unknown command %x\n", cdrom_command & 0x0f);
#endif
cdrom_unknown_command = 1;
cdrom_command_active = 1;
cdrom_command_length = 1;
set_status (CDINTERRUPT_TXDMADONE);
return;
cdrom_unknown_command = 1;
cdrom_command_active = 1;
cdrom_command_length = 1;
set_status (CDINTERRUPT_TXDMADONE);
return;
}
#if AKIKO_DEBUG_IO_CMD
write_log ("IN:");
#endif
......@@ -1029,7 +1029,7 @@ static void cdrom_run_command_run (void)
}
if (len == 0)
return;
if (cdrom_checksum_error || cdrom_unknown_command)
if (cdrom_checksum_error || cdrom_unknown_command)
cdrom_result_buffer[1] |= 0x80;
cdrom_start_return_data (len);
}
......
#ifdef AMAX
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "zfile.h"
#include "amax.h"
#include "custom.h"
#include "memory.h"
#include "newcpu.h"
static int data_scramble[8] = { 3, 2, 4, 5, 7, 6, 0, 1 };
static int addr_scramble[16] = { 14, 12, 2, 10, 15, 13, 1, 0, 7, 6, 5, 4, 8, 9, 11, 3 };
static int romptr;
static uae_u8 *rom;
static int rom_size, rom_oddeven;
static uae_u8 data;
static uae_u8 bfd100, bfe001;
static uae_u8 dselect;
#define AMAX_LOG 0
static void load_byte (void)
{
int addr, i;
uae_u8 val, v;
v = 0xff;
addr = 0;
for (i = 0; i < 16; i++) {
if (romptr & (1 << i))
addr |= 1 << addr_scramble[i];
}
if (rom_oddeven < 0) {
val = v;
} else {
v = rom[addr * 2 + rom_oddeven];
val = 0;
for (i = 0; i < 8; i++) {
if (v & (1 << data_scramble[i]))
val |= 1 << i;
}
}
data = val;
if (AMAX_LOG > 0)
write_log ("AMAX: load byte, rom=%d addr=%06x (%06x) data=%02x (%02x) PC=%08X\n", rom_oddeven, romptr, addr, v, val, M68K_GETPC);
}
static void amax_check (void)
{
/* DIR low = reset address counter */
if ((bfd100 & 2)) {
if (romptr && AMAX_LOG > 0)
write_log ("AMAX: counter reset PC=%08X\n", M68K_GETPC);
romptr = 0;
}
}
static int dwlastbit;
void amax_diskwrite (uae_u16 w)
{
int i;
/* this is weird, 1->0 transition in disk write line increases address pointer.. */
for (i = 0; i < 16; i++) {
if (dwlastbit && !(w & 0x8000)) {
romptr++;
if (AMAX_LOG > 0)
write_log ("AMAX: counter increase %d PC=%08X\n", romptr, M68K_GETPC);
}
dwlastbit = (w & 0x8000) ? 1 : 0;
w <<= 1;
}
romptr &= rom_size - 1;
amax_check ();
}
static uae_u8 bfe001_ov;
void amax_bfe001_write (uae_u8 pra, uae_u8 dra)
{
uae_u8 v = dra & pra;
bfe001 = v;
/* CHNG low -> high: shift data register */
if ((v & 4) && !(bfe001_ov & 4)) {
data <<= 1;
data |= 1;
if (AMAX_LOG > 0)
write_log ("AMAX: data shifted\n");
}
/* TK0 = even, WPRO = odd */
rom_oddeven = -1;
if ((v & (8 | 16)) != (8 | 16)) {
rom_oddeven = 0;
if (!(v & 16))
rom_oddeven = 1;
}
bfe001_ov = v;
amax_check ();
}
void amax_disk_select (uae_u8 v, uae_u8 ov)
{
bfd100 = v;
if (!(bfd100 & dselect) && (ov & dselect))
load_byte ();
amax_check ();
}
uae_u8 amax_disk_status (void)
{
uae_u8 st = 0x3c;
if (!(data & 0x80))
st &= ~0x20;
return st;
}
void amax_reset (void)
{
romptr = 0;
rom_oddeven = 0;
bfe001_ov = 0;
dwlastbit = 0;
data = 0xff;
xfree (rom);
rom = NULL;
dselect = 0;
}
void amax_init (void)
{
struct zfile *z;
if (!currprefs.amaxromfile[0])
return;
amax_reset ();
z = zfile_fopen (currprefs.amaxromfile, "rb", ZFD_NORMAL);
if (!z) {
write_log ("AMAX: failed to load rom '%s'\n", currprefs.amaxromfile);
return;
}
zfile_fseek (z, 0, SEEK_END);
rom_size = zfile_ftell (z);
zfile_fseek (z, 0, SEEK_SET);
rom = xmalloc (uae_u8, rom_size);
zfile_fread (rom, rom_size, 1, z);
zfile_fclose (z);
write_log ("AMAX: '%s' loaded, %d bytes\n", currprefs.amaxromfile, rom_size);
dselect = 0x20;
}
#endif //ifdef amax
#ifdef AMAX
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "zfile.h"
#include "amax.h"
#include "custom.h"
#include "memory.h"
#include "newcpu.h"
static int data_scramble[8] = { 3, 2, 4, 5, 7, 6, 0, 1 };
static int addr_scramble[16] = { 14, 12, 2, 10, 15, 13, 1, 0, 7, 6, 5, 4, 8, 9, 11, 3 };
static int romptr;
static uae_u8 *rom;
static int rom_size, rom_oddeven;
static uae_u8 data;
static uae_u8 bfd100, bfe001;
static uae_u8 dselect;
#define AMAX_LOG 0
static void load_byte (void)
{
int addr, i;
uae_u8 val, v;
v = 0xff;
addr = 0;
for (i = 0; i < 16; i++) {
if (romptr & (1 << i))
addr |= 1 << addr_scramble[i];
}
if (rom_oddeven < 0) {
val = v;
} else {
v = rom[addr * 2 + rom_oddeven];
val = 0;
for (i = 0; i < 8; i++) {
if (v & (1 << data_scramble[i]))
val |= 1 << i;
}
}
data = val;
if (AMAX_LOG > 0)
write_log ("AMAX: load byte, rom=%d addr=%06x (%06x) data=%02x (%02x) PC=%08X\n", rom_oddeven, romptr, addr, v, val, M68K_GETPC);
}
static void amax_check (void)
{
/* DIR low = reset address counter */
if ((bfd100 & 2)) {
if (romptr && AMAX_LOG > 0)
write_log ("AMAX: counter reset PC=%08X\n", M68K_GETPC);
romptr = 0;
}
}
static int dwlastbit;
void amax_diskwrite (uae_u16 w)
{
int i;
/* this is weird, 1->0 transition in disk write line increases address pointer.. */
for (i = 0; i < 16; i++) {
if (dwlastbit && !(w & 0x8000)) {
romptr++;
if (AMAX_LOG > 0)
write_log ("AMAX: counter increase %d PC=%08X\n", romptr, M68K_GETPC);
}
dwlastbit = (w & 0x8000) ? 1 : 0;
w <<= 1;
}
romptr &= rom_size - 1;
amax_check ();
}
static uae_u8 bfe001_ov;
void amax_bfe001_write (uae_u8 pra, uae_u8 dra)
{
uae_u8 v = dra & pra;
bfe001 = v;
/* CHNG low -> high: shift data register */
if ((v & 4) && !(bfe001_ov & 4)) {
data <<= 1;
data |= 1;
if (AMAX_LOG > 0)
write_log ("AMAX: data shifted\n");
}
/* TK0 = even, WPRO = odd */
rom_oddeven = -1;
if ((v & (8 | 16)) != (8 | 16)) {
rom_oddeven = 0;
if (!(v & 16))
rom_oddeven = 1;
}
bfe001_ov = v;
amax_check ();
}
void amax_disk_select (uae_u8 v, uae_u8 ov)
{
bfd100 = v;
if (!(bfd100 & dselect) && (ov & dselect))
load_byte ();
amax_check ();
}
uae_u8 amax_disk_status (void)
{
uae_u8 st = 0x3c;
if (!(data & 0x80))
st &= ~0x20;
return st;
}
void amax_reset (void)
{
romptr = 0;
rom_oddeven = 0;
bfe001_ov = 0;
dwlastbit = 0;
data = 0xff;
xfree (rom);
rom = NULL;
dselect = 0;
}
void amax_init (void)
{
struct zfile *z;
if (!currprefs.amaxromfile[0])
return;
amax_reset ();
z = zfile_fopen (currprefs.amaxromfile, "rb", ZFD_NORMAL);
if (!z) {
write_log ("AMAX: failed to load rom '%s'\n", currprefs.amaxromfile);
return;
}
zfile_fseek (z, 0, SEEK_END);
rom_size = zfile_ftell (z);
zfile_fseek (z, 0, SEEK_SET);
rom = xmalloc (uae_u8, rom_size);
zfile_fread (rom, rom_size, 1, z);
zfile_fclose (z);
write_log ("AMAX: '%s' loaded, %d bytes\n", currprefs.amaxromfile, rom_size);
dselect = 0x20;
}
#endif //ifdef amax
......@@ -266,7 +266,7 @@ static void cartridge_exit (void)
{
#ifdef PICASSO96
if (stored_picasso_on >= 0)
picasso_requested_on = stored_picasso_on != 0;
picasso_requested_on = stored_picasso_on != 0;
stored_picasso_on = -1;
#endif
}
......
......@@ -297,10 +297,10 @@ static void blitter_interrupt (int hpos, int done)
{
if (blit_interrupt)
return;
if (!done && (!currprefs.blitter_cycle_exact || (currprefs.chipset_mask & CSMASK_AGA)))
if (!done && (!currprefs.blitter_cycle_exact || currprefs.cpu_model >= 68020))
return;
blit_interrupt = 1;
send_interrupt (6, 3);
send_interrupt (6, 3 * CYCLE_UNIT);
if (debug_dma)
record_dma_event (DMA_EVENT_BLITIRQ, hpos, vpos);
}
......@@ -325,7 +325,7 @@ STATIC_INLINE void chipmem_agnus_wput2 (uaecptr addr, uae_u32 w)
{
last_custom_value1 = w;
#ifndef BLITTER_DEBUG_NO_D
chipmem_agnus_wput (addr, w);
chipmem_wput_indirect (addr, w);
#endif
}
......@@ -372,7 +372,7 @@ static void blitter_dofast (void)
uae_u32 bltadat, blitahold;
uae_u16 bltbdat;
if (bltadatptr) {
blt_info.bltadat = bltadat = chipmem_agnus_wget (bltadatptr);
blt_info.bltadat = bltadat = chipmem_wget_indirect (bltadatptr);
bltadatptr += 2;
} else
bltadat = blt_info.bltadat;
......@@ -381,14 +381,14 @@ static void blitter_dofast (void)
preva = bltadat;
if (bltbdatptr) {
blt_info.bltbdat = bltbdat = chipmem_agnus_wget (bltbdatptr);
blt_info.bltbdat = bltbdat = chipmem_wget_indirect (bltbdatptr);
bltbdatptr += 2;
blitbhold = (((uae_u32)prevb << 16) | bltbdat) >> blt_info.blitbshift;
prevb = bltbdat;
}
if (bltcdatptr) {
blt_info.bltcdat = chipmem_agnus_wget (bltcdatptr);
blt_info.bltcdat = chipmem_wget_indirect (bltcdatptr);
bltcdatptr += 2;
}
if (dodst)
......@@ -471,7 +471,7 @@ static void blitter_dofast_desc (void)
uae_u32 bltadat, blitahold;
uae_u16 bltbdat;
if (bltadatptr) {
bltadat = blt_info.bltadat = chipmem_agnus_wget (bltadatptr);
bltadat = blt_info.bltadat = chipmem_wget_indirect (bltadatptr);
bltadatptr -= 2;
} else
bltadat = blt_info.bltadat;
......@@ -480,14 +480,14 @@ static void blitter_dofast_desc (void)
preva = bltadat;
if (bltbdatptr) {
blt_info.bltbdat = bltbdat = chipmem_agnus_wget (bltbdatptr);
blt_info.bltbdat = bltbdat = chipmem_wget_indirect (bltbdatptr);
bltbdatptr -= 2;
blitbhold = (((uae_u32)bltbdat << 16) | prevb) >> blt_info.blitdownbshift;
prevb = bltbdat;
}
if (bltcdatptr) {
blt_info.bltcdat = blt_info.bltbdat = chipmem_agnus_wget (bltcdatptr);
blt_info.bltcdat = blt_info.bltbdat = chipmem_wget_indirect (bltcdatptr);
bltcdatptr -= 2;
}
if (dodst)
......@@ -533,7 +533,7 @@ STATIC_INLINE void blitter_read (void)
if (bltcon0 & 0x200) {
if (!dmaen (DMA_BLITTER))
return;
blt_info.bltcdat = chipmem_bank.wget (bltcpt);
blt_info.bltcdat = chipmem_wget_indirect (bltcpt);
last_custom_value1 = blt_info.bltcdat;
}
bltstate = BLT_work;
......@@ -548,7 +548,7 @@ STATIC_INLINE void blitter_write (void)
if (!dmaen (DMA_BLITTER))
return;
last_custom_value1 = blt_info.bltddat;
chipmem_bank.wput (bltdpt, blt_info.bltddat);
chipmem_wput_indirect (bltdpt, blt_info.bltddat);
}
bltstate = BLT_next;
}
......@@ -870,14 +870,14 @@ STATIC_INLINE void blitter_dodma (int ch, int hpos)
switch (ch)
{
case 1:
blt_info.bltadat = dat = chipmem_agnus_wget (bltapt);
blt_info.bltadat = dat = chipmem_wget_indirect (bltapt);
last_custom_value1 = blt_info.bltadat;
addr = bltapt;
bltapt += blit_add;
reg = 0x74;
break;
case 2:
blt_info.bltbdat = dat = chipmem_agnus_wget (bltbpt);
blt_info.bltbdat = dat = chipmem_wget_indirect (bltbpt);
last_custom_value1 = blt_info.bltbdat;
addr = bltbpt;
bltbpt += blit_add;
......@@ -889,7 +889,7 @@ STATIC_INLINE void blitter_dodma (int ch, int hpos)
reg = 0x72;
break;
case 3:
blt_info.bltcdat = dat = chipmem_agnus_wget (bltcpt);
blt_info.bltcdat = dat = chipmem_wget_indirect (bltcpt);
last_custom_value1 = blt_info.bltcdat;
addr = bltcpt;
bltcpt += blit_add;
......@@ -971,7 +971,7 @@ void decide_blitter (int hpos)
if (blt_delayed_irq > 0 && hsync) {
blt_delayed_irq--;
if (!blt_delayed_irq)
send_interrupt (6, 2);
send_interrupt (6, 2 * CYCLE_UNIT);
}
if (bltstate == BLT_done)
......
This diff is collapsed.
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "memory.h"
#include "execlib.h"
#include "disk.h"
#include "rommgr.h"
#include "uae.h"
#include "threaddep/thread.h"
#include "keybuf.h"
#include "consolehook.h"
static uaecptr beginio;
void consolehook_config (struct uae_prefs *p)
{
int roms[] = { 15, 31, 16, 46, -1 };
default_prefs (p, 0);
//p->headless = 1;
p->produce_sound = 0;
p->gfx_resolution = 0;
p->gfx_linedbl = 0;
p->gfx_framerate = 10;
p->immediate_blits = 1;
p->collision_level = 0;
configure_rom (p, roms, 0);
p->cpu_model = 68020;
p->fpu_model = 68882;
p->m68k_speed = -1;
#ifdef JIT
p->cachesize = 8192;
#endif
p->cpu_compatible = 0;
p->address_space_24 = 0;
p->chipmem_size = 0x00200000;
p->fastmem_size = 0x00800000;
p->bogomem_size = 0;
p->nr_floppies = 1;
p->dfxtype[1] = DRV_NONE;
p->floppy_speed = 0;
p->start_gui = 0;
p->gfx_size_win.width = 320;
p->gfx_size_win.height = 256;
p->turbo_emulation = 0;
// p->win32_automount_drives = 2;
// p->win32_automount_cddrives = 2;
add_filesys_config (p, -1, "DH0", "CLIBOOT", ".", 1, 0, 0, 0, 0, 15, NULL, 0, 0);
}
static void *console_thread (void *v)
{
uae_set_thread_priority (2);
for (;;) {
char wc = "a"; //console_getch ();
char c[2];
write_log ("*");
c[0] = 0;
c[1] = 0;
ua_copy (c, 1, &wc);
record_key_direct ((0x10 << 1) | 0);
record_key_direct ((0x10 << 1) | 1);
}
}
int consolehook_activate (void)
{
return console_emulation;
}
void consolehook_ret (uaecptr condev, uaecptr oldbeginio)
{
beginio = oldbeginio;
write_log ("console.device at %08X\n", condev);
uae_start_thread ("consolereader", console_thread, NULL, NULL);
}
uaecptr consolehook_beginio (uaecptr request)
{
uae_u32 io_data = get_long (request + 40); // 0x28
uae_u32 io_length = get_long (request + 36); // 0x24
uae_u32 io_actual = get_long (request + 32); // 0x20
uae_u32 io_offset = get_long (request + 44); // 0x2c
uae_u16 cmd = get_word (request + 28);
if (cmd == CMD_WRITE) {
char *buf;
const char *src = (char*)get_real_address (io_data);
int len = io_length;
if (io_length == -1)
len = strlen (src);
buf = xmalloc (char, len + 1);
strncpy (buf, src, len);
buf[len] = 0;
//f_out ("%s", buf);
xfree (buf);
} else if (cmd == CMD_READ) {
write_log ("%08x: CMD=%d LEN=%d OFF=%d ACT=%d\n", request, cmd, io_length, io_offset, io_actual);
}
return beginio;
}
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "memory.h"
#include "execlib.h"
#include "disk.h"
#include "rommgr.h"
#include "uae.h"
#include "threaddep/thread.h"
#include "keybuf.h"
#include "consolehook.h"
static uaecptr beginio;
void consolehook_config (struct uae_prefs *p)
{
int roms[] = { 15, 31, 16, 46, -1 };
default_prefs (p, 0);
//p->headless = 1;
p->produce_sound = 0;
p->gfx_resolution = 0;
p->gfx_linedbl = 0;
p->gfx_framerate = 10;
p->immediate_blits = 1;
p->collision_level = 0;
configure_rom (p, roms, 0);
p->cpu_model = 68020;
p->fpu_model = 68882;
p->m68k_speed = -1;
#ifdef JIT
p->cachesize = 8192;
#endif
p->cpu_compatible = 0;
p->address_space_24 = 0;
p->chipmem_size = 0x00200000;
p->fastmem_size = 0x00800000;
p->bogomem_size = 0;
p->nr_floppies = 1;
p->dfxtype[1] = DRV_NONE;
p->floppy_speed = 0;
p->start_gui = 0;
p->gfx_size_win.width = 320;
p->gfx_size_win.height = 256;
p->turbo_emulation = 0;
// p->win32_automount_drives = 2;
// p->win32_automount_cddrives = 2;
add_filesys_config (p, -1, "DH0", "CLIBOOT", ".", 1, 0, 0, 0, 0, 15, NULL, 0, 0);
}
static void *console_thread (void *v)
{
uae_set_thread_priority (2);
for (;;) {
char wc = "a"; //console_getch ();
char c[2];
write_log ("*");
c[0] = 0;
c[1] = 0;
ua_copy (c, 1, &wc);
record_key_direct ((0x10 << 1) | 0);
record_key_direct ((0x10 << 1) | 1);
}
}
int consolehook_activate (void)
{
return console_emulation;
}
void consolehook_ret (uaecptr condev, uaecptr oldbeginio)
{
beginio = oldbeginio;
write_log ("console.device at %08X\n", condev);
uae_start_thread ("consolereader", console_thread, NULL, NULL);
}
uaecptr consolehook_beginio (uaecptr request)
{
uae_u32 io_data = get_long (request + 40); // 0x28
uae_u32 io_length = get_long (request + 36); // 0x24
uae_u32 io_actual = get_long (request + 32); // 0x20
uae_u32 io_offset = get_long (request + 44); // 0x2c
uae_u16 cmd = get_word (request + 28);
if (cmd == CMD_WRITE) {
char *buf;
const char *src = (char*)get_real_address (io_data);
int len = io_length;
if (io_length == -1)
len = strlen (src);
buf = xmalloc (char, len + 1);
strncpy (buf, src, len);
buf[len] = 0;
//f_out ("%s", buf);
xfree (buf);
} else if (cmd == CMD_READ) {
write_log ("%08x: CMD=%d LEN=%d OFF=%d ACT=%d\n", request, cmd, io_length, io_offset, io_actual);
}
return beginio;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -145,7 +145,8 @@ STATIC_INLINE void color_reg_cpy (struct color_entry *dst, struct color_entry *s
else
#endif
/* copy first 32 acolors and color_regs_ecs */
memcpy (dst->color_regs_ecs, src->color_regs_ecs, sizeof(struct color_entry));
memcpy (dst->color_regs_ecs, src->color_regs_ecs,
sizeof(struct color_entry));
}
/*
......
......@@ -46,11 +46,11 @@ extern bool no_gui, quit_to_gui;
struct gui_info
{
uae_u8 drive_motor[4]; /* motor on off */
bool drive_motor[4]; /* motor on off */
uae_u8 drive_track[4]; /* rw-head track */
uae_u8 drive_writing[4]; /* drive is writing */
uae_u8 drive_disabled[4]; /* drive is disabled */
uae_u8 powerled; /* state of power led */
bool drive_writing[4]; /* drive is writing */
bool drive_disabled[4]; /* drive is disabled */
bool powerled; /* state of power led */
uae_u8 powerled_brightness; /* 0 to 255 */
uae_u8 drive_side; /* floppy side */
uae_u8 hd; /* harddrive */
......
......@@ -247,7 +247,7 @@ extern void inputdevice_settest (int);
extern int inputdevice_testread_count (void);
//FIXME:
typedef enum {
typedef enum {
DIK_0,
DIK_1,
DIK_2,
......@@ -392,7 +392,7 @@ extern int inputdevice_testread_count (void);
DIK_Y,
DIK_YEN,
DIK_Z
};
};
static struct uae_input_device_kbr_default keytrans[] = {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,9 +39,11 @@ extern char *restore_string_func (const uae_u8 **);
#ifdef SAVESTATE
/* save, restore and initialize routines for Amiga's subsystems */
extern const uae_u8 *restore_cpu (const uae_u8 *src);
extern void restore_cpu_finish (void);
extern uae_u8 *save_cpu (uae_u32 *len, uae_u8 *dstpr);
extern uae_u8 *restore_cpu (uae_u8 *);
extern void restore_cpu_finish (void);
extern uae_u8 *save_cpu (int *, uae_u8 *);
extern uae_u8 *restore_cpu_extra (uae_u8 *);
extern uae_u8 *save_cpu_extra (int *, uae_u8 *);
extern uae_u8 *restore_mmu (uae_u8 *);
extern uae_u8 *save_mmu (int *, uae_u8 *);
......@@ -49,16 +51,18 @@ extern uae_u8 *save_mmu (int *, uae_u8 *);
extern uae_u8 *restore_fpu (uae_u8 *);
extern uae_u8 *save_fpu (int *, uae_u8 *);
extern const uae_u8 *restore_disk (unsigned int num, const uae_u8 *src);
extern uae_u8 *save_disk (unsigned int num, uae_u32 *len, uae_u8 *dsptr);
extern const uae_u8 *restore_floppy (const uae_u8 *src);
extern uae_u8 *save_floppy (uae_u32 *len, uae_u8 *dstptr);
extern uae_u8 *restore_disk (int, uae_u8 *);
extern uae_u8 *save_disk (int, int *, uae_u8 *);
extern uae_u8 *restore_floppy (uae_u8 *src);
extern uae_u8 *save_floppy (int *len, uae_u8 *);
extern void DISK_save_custom (uae_u32 *pdskpt, uae_u16 *pdsklen, uae_u16 *pdsksync, uae_u16 *pdskbytr);
extern void DISK_restore_custom (uae_u32 pdskpt, uae_u16 pdsklength, uae_u16 pdskbytr);
extern void restore_disk_finish (void);
extern uae_u8 *restore_custom (uae_u8 *);
extern uae_u8 *save_custom (int *, uae_u8 *, int);
extern uae_u8 *restore_custom_extra (uae_u8 *);
extern uae_u8 *save_custom_extra (int *, uae_u8 *);
extern uae_u8 *restore_custom_sprite (int num, uae_u8 *src);
extern uae_u8 *save_custom_sprite (int num, int *len, uae_u8 *);
......@@ -109,6 +113,9 @@ extern uae_u8 *restore_configuration (uae_u8 *src);
extern uae_u8 *save_log (int, int *len);
extern uae_u8 *restore_log (uae_u8 *src);
extern uae_u8 *restore_input (uae_u8 *src);
extern uae_u8 *save_input (int *len, uae_u8 *dstptr);
extern void restore_cram (int, size_t);
extern void restore_bram (int, size_t);
extern void restore_fram (int, size_t);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment