mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-04-06 15:39:41 +00:00
- imported UAE CPU 0.8.10 changes
- new utility functions Mac_memset, Mac2Host_memcpy, Host2Mac_memcpu and Mac2Mac_memcpy - extfs.cpp: fixed bug in fs_rename() and fs_cat_move() (auxiliary IOParam block was not in Mac address space) - some provisions for using UAE CPU compiler (doesn't work yet)
This commit is contained in:
parent
76b1d7ca5e
commit
90312d104c
BasiliskII
ChangeLog
src
AmigaOS
BeOS
Unix
adb.cppcdrom.cppdisk.cppemul_op.cppether.cppextfs.cppsony.cppuae_cpu
@ -1,3 +1,11 @@
|
||||
V0.8 -
|
||||
- imported UAE CPU 0.8.10 changes
|
||||
- new utility functions Mac_memset, Mac2Host_memcpy, Host2Mac_memcpu
|
||||
and Mac2Mac_memcpy
|
||||
- extfs.cpp: fixed bug in fs_rename() and fs_cat_move() (auxiliary
|
||||
IOParam block was not in Mac address space)
|
||||
- some provisions for using UAE CPU compiler (doesn't work yet)
|
||||
|
||||
V0.8 (snapshot) - 2.Nov.1999
|
||||
- fixed many UAE FPU bugs [Lauri Pesonen]
|
||||
- added replacement for BlockMove() trap
|
||||
|
@ -192,7 +192,7 @@ static __saveds __attribute__((regparm(3))) ULONG audio_callback(struct Hook *ho
|
||||
|
||||
// Put data into AHI buffer (convert 8-bit data unsigned->signed)
|
||||
if (AudioStatus.sample_size == 16)
|
||||
memcpy(sample[play_buf].ahisi_Address, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), work_size);
|
||||
Mac2Host_memcpy(sample[play_buf].ahisi_Address, ReadMacInt32(apple_stream_info + scd_buffer), work_size);
|
||||
else {
|
||||
uint32 *p = (uint32 *)Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer));
|
||||
uint32 *q = (uint32 *)sample[play_buf].ahisi_Address;
|
||||
|
@ -451,7 +451,7 @@ static __saveds void net_func(void)
|
||||
|
||||
case MSG_ADD_MULTI:
|
||||
control_io->ios2_Req.io_Command = S2_ADDMULTICASTADDRESS;
|
||||
memcpy(control_io->ios2_SrcAddr, Mac2HostAddr(msg->pointer + eMultiAddr), 6);
|
||||
Mac2Host_memcpy(control_io->ios2_SrcAddr, msg->pointer + eMultiAddr, 6);
|
||||
DoIO((struct IORequest *)control_io);
|
||||
if (control_io->ios2_Req.io_Error == S2ERR_NOT_SUPPORTED) {
|
||||
WarningAlert(GetString(STR_NO_MULTICAST_WARN));
|
||||
@ -464,7 +464,7 @@ static __saveds void net_func(void)
|
||||
|
||||
case MSG_DEL_MULTI:
|
||||
control_io->ios2_Req.io_Command = S2_DELMULTICASTADDRESS;
|
||||
memcpy(control_io->ios2_SrcAddr, Mac2HostAddr(msg->pointer + eMultiAddr), 6);
|
||||
Mac2Host_memcpy(control_io->ios2_SrcAddr, msg->pointer + eMultiAddr, 6);
|
||||
DoIO((struct IORequest *)control_io);
|
||||
if (control_io->ios2_Req.io_Error)
|
||||
msg->result = eMultiErr;
|
||||
@ -550,8 +550,8 @@ static __saveds void net_func(void)
|
||||
|
||||
// Get destination address, set source address
|
||||
uint32 hdr = ReadMacInt32(wds + 2);
|
||||
memcpy(write_io->ios2_DstAddr, Mac2HostAddr(hdr), 6);
|
||||
memcpy(Mac2HostAddr(hdr + 6), ether_addr, 6);
|
||||
Mac2Host_memcpy(write_io->ios2_DstAddr, hdr, 6);
|
||||
Host2Mac_memcpy(hdr + 6, ether_addr, 6);
|
||||
|
||||
// Get packet type
|
||||
uint32 type = ReadMacInt16(hdr + 12);
|
||||
@ -651,7 +651,7 @@ void EtherInterrupt(void)
|
||||
continue;
|
||||
|
||||
// Copy header to RHA
|
||||
memcpy(Mac2HostAddr(ether_data + ed_RHA), io->ios2_Data, 14);
|
||||
Host2Mac_memcpy(ether_data + ed_RHA, io->ios2_Data, 14);
|
||||
D(bug(" header %08lx%04lx %08lx%04lx %04lx\n", ReadMacInt32(ether_data + ed_RHA), ReadMacInt16(ether_data + ed_RHA + 4), ReadMacInt32(ether_data + ed_RHA + 6), ReadMacInt16(ether_data + ed_RHA + 10), ReadMacInt16(ether_data + ed_RHA + 12)));
|
||||
|
||||
// Call protocol handler
|
||||
|
@ -227,7 +227,7 @@ static void playbuffer_func(void *arg, void *buf, size_t size, const media_raw_a
|
||||
}
|
||||
|
||||
// Place data into Media Kit buffer
|
||||
memcpy(buf, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), work_size);
|
||||
Mac2Host_memcpy(buf, ReadMacInt32(apple_stream_info + scd_buffer), work_size);
|
||||
if (work_size != size)
|
||||
memset((uint8 *)buf + work_size, 0, size - work_size);
|
||||
}
|
||||
|
@ -281,12 +281,11 @@ void EtherReset(void)
|
||||
|
||||
int16 ether_add_multicast(uint32 pb)
|
||||
{
|
||||
uint8 *addr = Mac2HostAddr(pb + eMultiAddr);
|
||||
net_packet *p = &net_buffer_ptr->write[wr_pos];
|
||||
if (p->cmd & IN_USE) {
|
||||
D(bug("WARNING: Couldn't enable multicast address\n"));
|
||||
} else {
|
||||
memcpy(p->data, addr, 6);
|
||||
Mac2Host_memcpy(p->data, pb + eMultiAddr, 6);
|
||||
p->length = 6;
|
||||
p->cmd = IN_USE | (ADD_MULTICAST << 8);
|
||||
wr_pos = (wr_pos + 1) % WRITE_PACKET_COUNT;
|
||||
@ -302,12 +301,11 @@ int16 ether_add_multicast(uint32 pb)
|
||||
|
||||
int16 ether_del_multicast(uint32 pb)
|
||||
{
|
||||
uint8 *addr = Mac2HostAddr(pb + eMultiAddr);
|
||||
net_packet *p = &net_buffer_ptr->write[wr_pos];
|
||||
if (p->cmd & IN_USE) {
|
||||
D(bug("WARNING: Couldn't enable multicast address\n"));
|
||||
} else {
|
||||
memcpy(p->data, addr, 6);
|
||||
Mac2Host_memcpy(p->data, pb + eMultiAddr, 6);
|
||||
p->length = 6;
|
||||
p->cmd = IN_USE | (REMOVE_MULTICAST << 8);
|
||||
wr_pos = (wr_pos + 1) % WRITE_PACKET_COUNT;
|
||||
@ -372,7 +370,7 @@ int16 ether_write(uint32 wds)
|
||||
int len = ReadMacInt16(wds);
|
||||
if (len == 0)
|
||||
break;
|
||||
memcpy(bp, Mac2HostAddr(ReadMacInt32(wds + 2)), len);
|
||||
Mac2Host_memcpy(bp, ReadMacInt32(wds + 2), len);
|
||||
bp += len;
|
||||
wds += 6;
|
||||
}
|
||||
@ -448,7 +446,7 @@ void EtherInterrupt(void)
|
||||
goto next;
|
||||
|
||||
// Copy header to RHA
|
||||
memcpy(Mac2HostAddr(ether_data + ed_RHA), p->data, 14);
|
||||
Host2Mac_memcpy(ether_data + ed_RHA, p->data, 14);
|
||||
D(bug(" header %08lx%04lx %08lx%04lx %04lx\n", ReadMacInt32(ether_data + ed_RHA), ReadMacInt16(ether_data + ed_RHA + 4), ReadMacInt32(ether_data + ed_RHA + 6), ReadMacInt16(ether_data + ed_RHA + 10), ReadMacInt16(ether_data + ed_RHA + 12)));
|
||||
|
||||
// Call protocol handler
|
||||
|
@ -719,8 +719,8 @@ status_t MacWindow::tick_func(void *arg)
|
||||
|
||||
// Yes, set new cursor image if it was changed
|
||||
if (memcmp(MacCursor+4, Mac2HostAddr(0x844), 64)) {
|
||||
memcpy(MacCursor+4, Mac2HostAddr(0x844), 64); // Cursor image
|
||||
MacCursor[2] = ReadMacInt8(0x885); // Hotspot
|
||||
Mac2Host_memcpy(MacCursor+4, 0x844, 64); // Cursor image
|
||||
MacCursor[2] = ReadMacInt8(0x885); // Hotspot
|
||||
MacCursor[3] = ReadMacInt8(0x887);
|
||||
be_app->SetCursor(MacCursor);
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ int16 ether_write(uint32 wds)
|
||||
{
|
||||
// Set source address
|
||||
uint32 hdr = ReadMacInt32(wds + 2);
|
||||
memcpy(Mac2HostAddr(hdr + 6), ether_addr, 6);
|
||||
Host2Mac_memcpy(hdr + 6, ether_addr, 6);
|
||||
|
||||
// Copy packet to buffer
|
||||
uint8 packet[1516], *p = packet;
|
||||
@ -328,7 +328,7 @@ int16 ether_write(uint32 wds)
|
||||
int w = ReadMacInt16(wds);
|
||||
if (w == 0)
|
||||
break;
|
||||
memcpy(p, Mac2HostAddr(ReadMacInt32(wds + 2)), w);
|
||||
Mac2Host_memcpy(p, ReadMacInt32(wds + 2), w);
|
||||
len += w;
|
||||
p += w;
|
||||
wds += 6;
|
||||
@ -422,7 +422,7 @@ void EtherInterrupt(void)
|
||||
continue;
|
||||
|
||||
// Copy header to RHA
|
||||
memcpy(Mac2HostAddr(ether_data + ed_RHA), p, 14);
|
||||
Host2Mac_memcpy(ether_data + ed_RHA, p, 14);
|
||||
D(bug(" header %08lx%04lx %08lx%04lx %04lx\n", ReadMacInt32(ether_data + ed_RHA), ReadMacInt16(ether_data + ed_RHA + 4), ReadMacInt32(ether_data + ed_RHA + 6), ReadMacInt16(ether_data + ed_RHA + 10), ReadMacInt16(ether_data + ed_RHA + 12)));
|
||||
|
||||
// Call protocol handler
|
||||
|
@ -210,7 +210,7 @@ static void *stream_func(void *arg)
|
||||
write(fd, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), sound_buffer_size);
|
||||
else {
|
||||
// Last buffer
|
||||
memcpy(last_buffer, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), work_size);
|
||||
Mac2Host_memcpy(last_buffer, ReadMacInt32(apple_stream_info + scd_buffer), work_size);
|
||||
memset((uint8 *)last_buffer + work_size, 0, sound_buffer_size - work_size);
|
||||
write(fd, last_buffer, sound_buffer_size);
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ static void *stream_func(void *arg)
|
||||
for (int i=0; i<work_size/2; i++)
|
||||
last_buffer[i] = ntohs(p[i]);
|
||||
} else
|
||||
memcpy(last_buffer, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), work_size);
|
||||
Mac2Host_memcpy(last_buffer, ReadMacInt32(apple_stream_info + scd_buffer), work_size);
|
||||
memset((uint8 *)last_buffer + work_size, silence_byte, sound_buffer_size - work_size);
|
||||
write(audio_fd, last_buffer, sound_buffer_size);
|
||||
}
|
||||
|
2
BasiliskII/src/Unix/configure
vendored
2
BasiliskII/src/Unix/configure
vendored
@ -4037,7 +4037,7 @@ if [ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]; then
|
||||
if [ "x$HAVE_GAS" = "xyes" ]; then
|
||||
WANT_X86_ASSEMBLY=yes
|
||||
DEFINES="$DEFINES -DX86_ASSEMBLY"
|
||||
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
|
||||
CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
|
||||
fi
|
||||
elif [ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]; then
|
||||
case "$MACHINE" in
|
||||
|
@ -251,7 +251,7 @@ if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
|
||||
if [[ "x$HAVE_GAS" = "xyes" ]]; then
|
||||
WANT_X86_ASSEMBLY=yes
|
||||
DEFINES="$DEFINES -DX86_ASSEMBLY"
|
||||
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
|
||||
CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
|
||||
fi
|
||||
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
|
||||
dnl SPARC CPU
|
||||
|
@ -58,6 +58,11 @@
|
||||
#include "mon.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAPPED_MEMORY
|
||||
#include <sys/mman.h>
|
||||
extern char *address_space, *good_address_map;
|
||||
#endif
|
||||
|
||||
|
||||
// Constants
|
||||
const char ROM_FILE_NAME[] = "ROM";
|
||||
@ -178,16 +183,39 @@ int main(int argc, char **argv)
|
||||
if (!PrefsEditor())
|
||||
QuitEmulator();
|
||||
|
||||
// Create area for Mac RAM
|
||||
// Read RAM size
|
||||
RAMSize = PrefsFindInt32("ramsize") & 0xfff00000; // Round down to 1MB boundary
|
||||
if (RAMSize < 1024*1024) {
|
||||
WarningAlert(GetString(STR_SMALL_RAM_WARN));
|
||||
RAMSize = 1024*1024;
|
||||
}
|
||||
RAMBaseHost = new uint8[RAMSize];
|
||||
|
||||
// Create area for Mac ROM
|
||||
// Create areas for Mac RAM and ROM
|
||||
#ifdef USE_MAPPED_MEMORY
|
||||
int fd = open("/dev/zero", O_RDWR);
|
||||
good_address_map = (char *)mmap(NULL, 1<<24, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
address_space = (char *)mmap(NULL, 1<<24, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||
if ((int)address_space < 0 || (int)good_address_map < 0) {
|
||||
ErrorAlert(GetString(STR_NOT_ENOUGH_MEMORY_ERR));
|
||||
QuitEmulator();
|
||||
}
|
||||
RAMBaseHost = (uint8 *)mmap(address_space, RAMSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0);
|
||||
ROMBaseHost = (uint8 *)mmap(address_space + 0x00400000, 0x80000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0);
|
||||
close(fd);
|
||||
char *nam = tmpnam(NULL);
|
||||
int good_address_fd = open(nam, O_CREAT | O_RDWR, 0600);
|
||||
char buffer[4096];
|
||||
memset(buffer, 1, sizeof(buffer));
|
||||
write(good_address_fd, buffer, sizeof(buffer));
|
||||
unlink(nam);
|
||||
for (int i=0; i<RAMSize; i+=4096)
|
||||
mmap(good_address_map + i, 4096, PROT_READ, MAP_FIXED | MAP_PRIVATE, good_address_fd, 0);
|
||||
for (int i=0; i<0x80000; i+=4096)
|
||||
mmap(good_address_map + i + 0x00400000, 4096, PROT_READ, MAP_FIXED | MAP_PRIVATE, good_address_fd, 0);
|
||||
#else
|
||||
RAMBaseHost = new uint8[RAMSize];
|
||||
ROMBaseHost = new uint8[0x100000];
|
||||
#endif
|
||||
|
||||
// Get rom file path from preferences
|
||||
const char *rom_path = PrefsFindString("rom");
|
||||
|
@ -219,15 +219,22 @@ static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {uint8 *b = (uint8 *)a
|
||||
#define call_mem_put_func(func, addr, v) ((*func)(addr, v))
|
||||
#define __inline__ inline
|
||||
#define CPU_EMU_SIZE 0
|
||||
#undef USE_MAPPED_MEMORY
|
||||
#undef CAN_MAP_MEMORY
|
||||
#undef NO_INLINE_MEMORY_ACCESS
|
||||
#undef MD_HAVE_MEM_1_FUNCS
|
||||
#undef USE_COMPILER
|
||||
#define ENUMDECL typedef enum
|
||||
#define ENUMNAME(name) name
|
||||
#define write_log printf
|
||||
|
||||
#ifdef USE_COMPILER
|
||||
#define USE_MAPPED_MEMORY
|
||||
#define CAN_MAP_MEMORY
|
||||
#define NO_EXCEPTION_3
|
||||
#define NO_PREFETCH_BUFFER
|
||||
#else
|
||||
#undef USE_MAPPED_MEMORY
|
||||
#undef CAN_MAP_MEMORY
|
||||
#endif
|
||||
|
||||
#ifdef X86_ASSEMBLY
|
||||
#define ASM_SYM_FOR_FUNC(a) __asm__(a)
|
||||
#else
|
||||
|
@ -1238,7 +1238,7 @@ static void update_display(void)
|
||||
{
|
||||
// In classic mode, copy the frame buffer from Mac RAM
|
||||
if (classic_mode)
|
||||
memcpy(the_buffer, Mac2HostAddr(0x3fa700), VideoMonitor.bytes_per_row * VideoMonitor.y);
|
||||
Mac2Host_memcpy(the_buffer, 0x3fa700, VideoMonitor.bytes_per_row * VideoMonitor.y);
|
||||
|
||||
// Incremental update code
|
||||
int wide = 0, high = 0, x1, x2, y1, y2, i, j;
|
||||
@ -1358,7 +1358,7 @@ static void update_display(void)
|
||||
|
||||
// Set new cursor image if it was changed
|
||||
if (memcmp(the_cursor, Mac2HostAddr(0x844), 64)) {
|
||||
memcpy(the_cursor, Mac2HostAddr(0x844), 64);
|
||||
Mac2Host_memcpy(the_cursor, 0x844, 64);
|
||||
memcpy(cursor_image->data, the_cursor, 32);
|
||||
memcpy(cursor_mask_image->data, the_cursor+32, 32);
|
||||
XFreeCursor(x_display, mac_cursor);
|
||||
|
@ -288,20 +288,19 @@ void ADBInterrupt(void)
|
||||
// Mouse movement (relative) and buttons
|
||||
if (mx != 0 || my != 0 || mouse_button[0] != old_mouse_button[0] || mouse_button[1] != old_mouse_button[1] || mouse_button[2] != old_mouse_button[2]) {
|
||||
uint32 mouse_base = adb_base + 16;
|
||||
uint8 *mouse_data = Mac2HostAddr(tmp_data);
|
||||
|
||||
// Call mouse ADB handler
|
||||
if (mouse_reg_3[1] == 4) {
|
||||
// Extended mouse protocol
|
||||
mouse_data[0] = 3;
|
||||
mouse_data[1] = (my & 0x7f) | (mouse_button[0] ? 0 : 0x80);
|
||||
mouse_data[2] = (mx & 0x7f) | (mouse_button[1] ? 0 : 0x80);
|
||||
mouse_data[3] = ((my >> 3) & 0x70) | ((mx >> 7) & 0x07) | (mouse_button[2] ? 0x08 : 0x88);
|
||||
WriteMacInt8(tmp_data, 3);
|
||||
WriteMacInt8(tmp_data + 1, (my & 0x7f) | (mouse_button[0] ? 0 : 0x80));
|
||||
WriteMacInt8(tmp_data + 2, (mx & 0x7f) | (mouse_button[1] ? 0 : 0x80));
|
||||
WriteMacInt8(tmp_data + 3, ((my >> 3) & 0x70) | ((mx >> 7) & 0x07) | (mouse_button[2] ? 0x08 : 0x88));
|
||||
} else {
|
||||
// 100/200 dpi mode
|
||||
mouse_data[0] = 2;
|
||||
mouse_data[1] = (my & 0x7f) | (mouse_button[0] ? 0 : 0x80);
|
||||
mouse_data[2] = (mx & 0x7f) | (mouse_button[1] ? 0 : 0x80);
|
||||
WriteMacInt8(tmp_data, 2);
|
||||
WriteMacInt8(tmp_data + 1, (my & 0x7f) | (mouse_button[0] ? 0 : 0x80));
|
||||
WriteMacInt8(tmp_data + 2, (mx & 0x7f) | (mouse_button[1] ? 0 : 0x80));
|
||||
}
|
||||
r.a[0] = tmp_data;
|
||||
r.a[1] = ReadMacInt32(mouse_base);
|
||||
@ -332,20 +331,19 @@ void ADBInterrupt(void)
|
||||
// Send mouse button events
|
||||
if (mouse_button[0] != old_mouse_button[0]) {
|
||||
uint32 mouse_base = adb_base + 16;
|
||||
uint8 *mouse_data = Mac2HostAddr(tmp_data);
|
||||
|
||||
// Call mouse ADB handler
|
||||
if (mouse_reg_3[1] == 4) {
|
||||
// Extended mouse protocol
|
||||
mouse_data[0] = 3;
|
||||
mouse_data[1] = mouse_button[0] ? 0 : 0x80;
|
||||
mouse_data[2] = mouse_button[1] ? 0 : 0x80;
|
||||
mouse_data[3] = mouse_button[2] ? 0x08 : 0x88;
|
||||
WriteMacInt8(tmp_data, 3);
|
||||
WriteMacInt8(tmp_data + 1, mouse_button[0] ? 0 : 0x80);
|
||||
WriteMacInt8(tmp_data + 2, mouse_button[1] ? 0 : 0x80);
|
||||
WriteMacInt8(tmp_data + 3, mouse_button[2] ? 0x08 : 0x88);
|
||||
} else {
|
||||
// 100/200 dpi mode
|
||||
mouse_data[0] = 2;
|
||||
mouse_data[1] = mouse_button[0] ? 0 : 0x80;
|
||||
mouse_data[2] = mouse_button[1] ? 0 : 0x80;
|
||||
WriteMacInt8(tmp_data, 2);
|
||||
WriteMacInt8(tmp_data + 1, mouse_button[0] ? 0 : 0x80);
|
||||
WriteMacInt8(tmp_data + 2, mouse_button[1] ? 0 : 0x80);
|
||||
}
|
||||
r.a[0] = tmp_data;
|
||||
r.a[1] = ReadMacInt32(mouse_base);
|
||||
@ -362,7 +360,6 @@ void ADBInterrupt(void)
|
||||
|
||||
// Process accumulated keyboard events
|
||||
uint32 key_base = adb_base + 4;
|
||||
uint8 *key_data = Mac2HostAddr(tmp_data);
|
||||
while (key_read_ptr != key_write_ptr) {
|
||||
|
||||
// Read keyboard event
|
||||
@ -370,9 +367,9 @@ void ADBInterrupt(void)
|
||||
key_read_ptr = (key_read_ptr + 1) % KEY_BUFFER_SIZE;
|
||||
|
||||
// Call keyboard ADB handler
|
||||
key_data[0] = 2;
|
||||
key_data[1] = mac_code;
|
||||
key_data[2] = mac_code == 0x7f ? 0x7f : 0xff; // Power key is special
|
||||
WriteMacInt8(tmp_data, 2);
|
||||
WriteMacInt8(tmp_data + 1, mac_code);
|
||||
WriteMacInt8(tmp_data + 2, mac_code == 0x7f ? 0x7f : 0xff); // Power key is special
|
||||
r.a[0] = tmp_data;
|
||||
r.a[1] = ReadMacInt32(key_base);
|
||||
r.a[2] = ReadMacInt32(key_base + 4);
|
||||
|
@ -602,7 +602,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
||||
break;
|
||||
|
||||
case 3: { // Get track starting address
|
||||
uint8 *buf = Mac2HostAddr(ReadMacInt32(pb + csParam + 2));
|
||||
uint32 buf = ReadMacInt32(pb + csParam + 2);
|
||||
uint16 buf_size = ReadMacInt16(pb + csParam + 6);
|
||||
int track = bcd2bin[ReadMacInt8(pb + csParam + 8)];
|
||||
|
||||
@ -616,10 +616,10 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
||||
// Fill buffer
|
||||
if (i != 804)
|
||||
while (buf_size > 0) {
|
||||
*buf++ = info->toc[i+1] & 0x0f; // Control
|
||||
*buf++ = bin2bcd[info->toc[i+5]]; // M
|
||||
*buf++ = bin2bcd[info->toc[i+6]]; // S
|
||||
*buf++ = bin2bcd[info->toc[i+7]]; // F
|
||||
WriteMacInt8(buf, info->toc[i+1] & 0x0f); buf++; // Control
|
||||
WriteMacInt8(buf, bin2bcd[info->toc[i+5]]); buf++; // M
|
||||
WriteMacInt8(buf, bin2bcd[info->toc[i+6]]); buf++; // S
|
||||
WriteMacInt8(buf, bin2bcd[info->toc[i+7]]); buf++; // F
|
||||
|
||||
// Lead-Out? Then stop
|
||||
if (info->toc[i+2] == 0xaa)
|
||||
@ -650,23 +650,23 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
||||
|
||||
case 101: { // ReadTheQSubcode
|
||||
if (ReadMacInt8(info->status + dsDiskInPlace) == 0) {
|
||||
memset(Mac2HostAddr(pb + csParam), 0, 10);
|
||||
Mac_memset(pb + csParam, 0, 10);
|
||||
return offLinErr;
|
||||
}
|
||||
|
||||
uint8 pos[16];
|
||||
if (SysCDGetPosition(info->fh, pos)) {
|
||||
uint8 *p = Mac2HostAddr(pb + csParam);
|
||||
*p++ = pos[5] & 0x0f; // Control
|
||||
*p++ = bin2bcd[pos[6]]; // Track number
|
||||
*p++ = bin2bcd[pos[7]]; // Index number
|
||||
*p++ = bin2bcd[pos[13]]; // M (rel)
|
||||
*p++ = bin2bcd[pos[14]]; // S (rel)
|
||||
*p++ = bin2bcd[pos[15]]; // F (rel)
|
||||
*p++ = bin2bcd[pos[9]]; // M (abs)
|
||||
*p++ = bin2bcd[pos[10]]; // S (abs)
|
||||
*p++ = bin2bcd[pos[11]]; // F (abs)
|
||||
*p++ = 0;
|
||||
uint32 p = pb + csParam;
|
||||
WriteMacInt8(p, pos[5] & 0x0f); p++; // Control
|
||||
WriteMacInt8(p, bin2bcd[pos[6]]); p++; // Track number
|
||||
WriteMacInt8(p, bin2bcd[pos[7]]); p++; // Index number
|
||||
WriteMacInt8(p, bin2bcd[pos[13]]); p++; // M (rel)
|
||||
WriteMacInt8(p, bin2bcd[pos[14]]); p++; // S (rel)
|
||||
WriteMacInt8(p, bin2bcd[pos[15]]); p++; // F (rel)
|
||||
WriteMacInt8(p, bin2bcd[pos[9]]); p++; // M (abs)
|
||||
WriteMacInt8(p, bin2bcd[pos[10]]); p++; // S (abs)
|
||||
WriteMacInt8(p, bin2bcd[pos[11]]); p++; // F (abs)
|
||||
WriteMacInt8(p, 0);
|
||||
return noErr;
|
||||
} else
|
||||
return ioErr;
|
||||
@ -754,29 +754,30 @@ int16 CDROMControl(uint32 pb, uint32 dce)
|
||||
if (!SysCDGetPosition(info->fh, pos))
|
||||
return paramErr;
|
||||
|
||||
uint8 *p = Mac2HostAddr(pb + csParam);
|
||||
uint32 p = pb + csParam;
|
||||
switch (pos[1]) {
|
||||
case 0x11:
|
||||
*p++ = 0; // Audio play in progress
|
||||
WriteMacInt8(p, 0); // Audio play in progress
|
||||
break;
|
||||
case 0x12:
|
||||
*p++ = 1; // Audio play paused
|
||||
WriteMacInt8(p, 1); // Audio play paused
|
||||
break;
|
||||
case 0x13:
|
||||
*p++ = 3; // Audio play completed
|
||||
WriteMacInt8(p, 3); // Audio play completed
|
||||
break;
|
||||
case 0x14:
|
||||
*p++ = 4; // Error occurred
|
||||
WriteMacInt8(p, 4); // Error occurred
|
||||
break;
|
||||
default:
|
||||
*p++ = 5; // No audio play operation requested
|
||||
WriteMacInt8(p, 5); // No audio play operation requested
|
||||
break;
|
||||
}
|
||||
*p++ = info->play_mode;
|
||||
*p++ = pos[5] & 0x0f; // Control
|
||||
*p++ = bin2bcd[pos[9]]; // M (abs)
|
||||
*p++ = bin2bcd[pos[10]]; // S (abs)
|
||||
*p++ = bin2bcd[pos[11]]; // F (abs)
|
||||
p++;
|
||||
WriteMacInt8(p, info->play_mode); p++;
|
||||
WriteMacInt8(p, pos[5] & 0x0f); p++; // Control
|
||||
WriteMacInt8(p, bin2bcd[pos[9]]); p++; // M (abs)
|
||||
WriteMacInt8(p, bin2bcd[pos[10]]); p++; // S (abs)
|
||||
WriteMacInt8(p, bin2bcd[pos[11]]); p++; // F (abs)
|
||||
return noErr;
|
||||
}
|
||||
|
||||
@ -924,7 +925,7 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
|
||||
// Drive-specific codes
|
||||
switch (code) {
|
||||
case 8: // DriveStatus
|
||||
memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22);
|
||||
Mac2Mac_memcpy(pb + csParam, info->status, 22);
|
||||
return noErr;
|
||||
|
||||
case 70: // GetPowerMode
|
||||
|
@ -484,7 +484,7 @@ int16 DiskStatus(uint32 pb, uint32 dce)
|
||||
// Drive-specific codes
|
||||
switch (code) {
|
||||
case 8: // Get drive status
|
||||
memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22);
|
||||
Mac2Mac_memcpy(pb + csParam, info->status, 22);
|
||||
return noErr;
|
||||
|
||||
default:
|
||||
|
@ -86,7 +86,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
|
||||
EtherReset();
|
||||
|
||||
// Create BootGlobs at top of memory
|
||||
memset((void *)(RAMBaseHost + RAMSize - 4096), 0, 4096);
|
||||
Mac_memset(RAMBaseMac + RAMSize - 4096, 0, 4096);
|
||||
uint32 boot_globs = RAMBaseMac + RAMSize - 0x1c;
|
||||
WriteMacInt32(boot_globs + 0x00, RAMBaseMac); // First RAM bank
|
||||
WriteMacInt32(boot_globs + 0x04, RAMSize);
|
||||
|
@ -152,7 +152,7 @@ int16 EtherControl(uint32 pb, uint32 dce)
|
||||
if (size > 18)
|
||||
size = 18;
|
||||
WriteMacInt16(pb + eDataSize, size); // Number of bytes actually written
|
||||
memcpy(Mac2HostAddr(ReadMacInt32(pb + ePointer)), buf, size);
|
||||
Host2Mac_memcpy(ReadMacInt32(pb + ePointer), buf, size);
|
||||
return noErr;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ void EtherReadPacket(uint8 **src, uint32 &dest, uint32 &len, uint32 &remaining)
|
||||
{
|
||||
D(bug("EtherReadPacket src %08lx, dest %08lx, len %08lx, remaining %08lx\n", *src, dest, len, remaining));
|
||||
uint32 todo = len > remaining ? remaining : len;
|
||||
memcpy(Mac2HostAddr(dest), *src, todo);
|
||||
Host2Mac_memcpy(dest, *src, todo);
|
||||
*src += todo;
|
||||
dest += todo;
|
||||
len -= todo;
|
||||
|
@ -65,7 +65,7 @@ enum {
|
||||
fsHFSProcStub = 6,
|
||||
fsDrvStatus = 12, // Drive Status record
|
||||
fsFSD = 42, // File system descriptor
|
||||
fsPB = 238, // IOParam (for mounting)
|
||||
fsPB = 238, // IOParam (for mounting and renaming)
|
||||
fsVMI = 288, // VoumeMountInfoHeader (for mounting)
|
||||
fsParseRec = 296, // ParsePathRec struct
|
||||
fsReturn = 306, // Area for return data of 68k routines
|
||||
@ -604,7 +604,7 @@ void InstallExtFS(void)
|
||||
WriteMacInt16(fs_data + fsFSD + fsdLength, SIZEOF_FSDRec);
|
||||
WriteMacInt16(fs_data + fsFSD + fsdVersion, fsdVersion1);
|
||||
WriteMacInt16(fs_data + fsFSD + fileSystemFSID, MY_FSID);
|
||||
memcpy(Mac2HostAddr(fs_data + fsFSD + fileSystemName), FS_NAME, 32);
|
||||
Host2Mac_memcpy(fs_data + fsFSD + fileSystemName, FS_NAME, 32);
|
||||
WriteMacInt32(fs_data + fsFSD + fileSystemCommProc, fs_data + fsCommProcStub);
|
||||
WriteMacInt32(fs_data + fsFSD + fsdHFSCI + compInterfProc, fs_data + fsHFSProcStub);
|
||||
WriteMacInt32(fs_data + fsFSD + fsdHFSCI + stackTop, fs_stack + STACK_SIZE);
|
||||
@ -658,7 +658,7 @@ int16 ExtFSComm(uint16 message, uint32 paramBlock, uint32 globalsPtr)
|
||||
|
||||
case ffsGetIconMessage: { // Get disk/drive icon
|
||||
if (ReadMacInt8(paramBlock + iconType) == kLargeIcon && ReadMacInt32(paramBlock + requestSize) >= sizeof(ExtFSIcon)) {
|
||||
memcpy(Mac2HostAddr(ReadMacInt32(paramBlock + iconBufferPtr)), ExtFSIcon, sizeof(ExtFSIcon));
|
||||
Host2Mac_memcpy(ReadMacInt32(paramBlock + iconBufferPtr), ExtFSIcon, sizeof(ExtFSIcon));
|
||||
WriteMacInt32(paramBlock + actualSize, sizeof(ExtFSIcon));
|
||||
return noErr;
|
||||
} else
|
||||
@ -969,7 +969,7 @@ static int16 fs_volume_mount(uint32 pb)
|
||||
WriteMacInt32(vcb + vcbClpSiz, 1024);
|
||||
WriteMacInt32(vcb + vcbNxtCNID, next_cnid);
|
||||
WriteMacInt16(vcb + vcbFreeBks, 0xffff); //!!
|
||||
memcpy(Mac2HostAddr(vcb + vcbVN), VOLUME_NAME, 28);
|
||||
Host2Mac_memcpy(vcb + vcbVN, VOLUME_NAME, 28);
|
||||
WriteMacInt16(vcb + vcbFSID, MY_FSID);
|
||||
WriteMacInt32(vcb + vcbFilCnt, 1); //!!
|
||||
WriteMacInt32(vcb + vcbDirCnt, 1); //!!
|
||||
@ -1043,7 +1043,7 @@ static int16 fs_get_vol_info(uint32 pb, bool hfs)
|
||||
WriteMacInt32(pb + ioVWrCnt, 0);
|
||||
WriteMacInt32(pb + ioVFilCnt, 1); //!!
|
||||
WriteMacInt32(pb + ioVDirCnt, 1); //!!
|
||||
memset(Mac2HostAddr(pb + ioVFndrInfo), 0, 32);
|
||||
Mac_memset(pb + ioVFndrInfo, 0, 32);
|
||||
}
|
||||
return noErr;
|
||||
}
|
||||
@ -1073,7 +1073,7 @@ static int16 fs_get_vol_parms(uint32 pb)
|
||||
uint32 actual = ReadMacInt32(pb + ioReqCount);
|
||||
if (actual > sizeof(vol))
|
||||
actual = sizeof(vol);
|
||||
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioBuffer)), vol, actual);
|
||||
Host2Mac_memcpy(ReadMacInt32(pb + ioBuffer), vol, actual);
|
||||
WriteMacInt32(pb + ioActCount, actual);
|
||||
return noErr;
|
||||
}
|
||||
@ -1218,7 +1218,7 @@ read_next_de:
|
||||
#endif
|
||||
WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET);
|
||||
|
||||
memset(Mac2HostAddr(pb + ioFlFndrInfo), 0, SIZEOF_FInfo);
|
||||
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo);
|
||||
uint32 type, creator; // pb may point to kernel space, but stack is switched
|
||||
get_finder_type(full_path, type, creator);
|
||||
WriteMacInt32(pb + ioFlFndrInfo + fdType, type);
|
||||
@ -1237,7 +1237,7 @@ read_next_de:
|
||||
|
||||
if (hfs) {
|
||||
WriteMacInt32(pb + ioFlBkDat, 0);
|
||||
memset(Mac2HostAddr(pb + ioFlXFndrInfo), 0, SIZEOF_FXInfo);
|
||||
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo);
|
||||
WriteMacInt32(pb + ioFlParID, fs_item->parent_id);
|
||||
WriteMacInt32(pb + ioFlClpSiz, 0);
|
||||
}
|
||||
@ -1355,8 +1355,8 @@ read_next_de:
|
||||
WriteMacInt32(pb + ioFlMdDat, mtime);
|
||||
WriteMacInt32(pb + ioFlBkDat, 0);
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
memset(Mac2HostAddr(pb + ioDrUsrWds), 0, SIZEOF_DInfo);
|
||||
memset(Mac2HostAddr(pb + ioDrFndrInfo), 0, SIZEOF_DXInfo);
|
||||
Mac_memset(pb + ioDrUsrWds, 0, SIZEOF_DInfo);
|
||||
Mac_memset(pb + ioDrFndrInfo, 0, SIZEOF_DXInfo);
|
||||
uint16 fflags; // pb may point to kernel space, but stack is switched
|
||||
get_finder_flags(full_path, fflags);
|
||||
WriteMacInt16(pb + ioDrUsrWds + frFlags, fflags);
|
||||
@ -1382,8 +1382,8 @@ read_next_de:
|
||||
}
|
||||
WriteMacInt16(pb + ioDrNmFls, count);
|
||||
} else {
|
||||
memset(Mac2HostAddr(pb + ioFlFndrInfo), 0, SIZEOF_FInfo);
|
||||
memset(Mac2HostAddr(pb + ioFlXFndrInfo), 0, SIZEOF_FXInfo);
|
||||
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo);
|
||||
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo);
|
||||
uint32 type, creator; // pb may point to kernel space, but stack is switched
|
||||
get_finder_type(full_path, type, creator);
|
||||
WriteMacInt32(pb + ioFlFndrInfo + fdType, type);
|
||||
@ -1926,11 +1926,10 @@ static int16 fs_rename(uint32 pb, uint32 dirID)
|
||||
strcpy(old_path, full_path);
|
||||
|
||||
// Find path for new name
|
||||
uint8 new_pb[SIZEOF_IOParam];
|
||||
memcpy(new_pb, Mac2HostAddr(pb), SIZEOF_IOParam);
|
||||
WriteMacInt32((uint32)new_pb + ioNamePtr, ReadMacInt32(pb + ioMisc));
|
||||
Mac2Mac_memcpy(fs_data + fsPB, pb, SIZEOF_IOParam);
|
||||
WriteMacInt32(fs_data + fsPB + ioNamePtr, ReadMacInt32(pb + ioMisc));
|
||||
FSItem *new_item;
|
||||
result = get_item_and_path((uint32)new_pb, dirID, new_item);
|
||||
result = get_item_and_path(fs_data + fsPB, dirID, new_item);
|
||||
if (result != noErr)
|
||||
return result;
|
||||
|
||||
@ -1967,11 +1966,10 @@ static int16 fs_cat_move(uint32 pb)
|
||||
strcpy(old_path, full_path);
|
||||
|
||||
// Find path for new directory
|
||||
uint8 new_pb[SIZEOF_IOParam];
|
||||
memcpy(new_pb, Mac2HostAddr(pb), SIZEOF_IOParam);
|
||||
WriteMacInt32((uint32)new_pb + ioNamePtr, ReadMacInt32(pb + ioNewName));
|
||||
Mac2Host_memcpy(fs_data + fsPB, pb, SIZEOF_IOParam);
|
||||
WriteMacInt32(fs_data + fsPB + ioNamePtr, ReadMacInt32(pb + ioNewName));
|
||||
FSItem *new_dir_item;
|
||||
result = get_item_and_path((uint32)new_pb, ReadMacInt32(pb + ioNewDirID), new_dir_item);
|
||||
result = get_item_and_path(fs_data + fsPB, ReadMacInt32(pb + ioNewDirID), new_dir_item);
|
||||
if (result != noErr)
|
||||
return result;
|
||||
|
||||
@ -2037,7 +2035,7 @@ static int16 fs_get_wd_info(uint32 pb, uint32 vcb)
|
||||
WriteMacInt32(pb + ioWDProcID, 0);
|
||||
WriteMacInt16(pb + ioWDVRefNum, ReadMacInt16(vcb + vcbVRefNum));
|
||||
if (ReadMacInt32(pb + ioNamePtr))
|
||||
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), Mac2HostAddr(vcb + vcbVN), 28);
|
||||
Mac2Mac_memcpy(ReadMacInt32(pb + ioNamePtr), vcb + vcbVN, 28);
|
||||
WriteMacInt32(pb + ioWDDirID, ROOT_ID);
|
||||
return noErr;
|
||||
}
|
||||
@ -2058,7 +2056,7 @@ static int16 fs_get_wd_info(uint32 pb, uint32 vcb)
|
||||
WriteMacInt16(pb + ioWDProcID, ReadMacInt32(wdcb + wdProcID));
|
||||
WriteMacInt16(pb + ioWDVRefNum, ReadMacInt16(ReadMacInt32(wdcb + wdVCBPtr) + vcbVRefNum));
|
||||
if (ReadMacInt32(pb + ioNamePtr))
|
||||
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), Mac2HostAddr(ReadMacInt32(wdcb + wdVCBPtr) + vcbVN), 28);
|
||||
Mac2Mac_memcpy(ReadMacInt32(pb + ioNamePtr), ReadMacInt32(wdcb + wdVCBPtr) + vcbVN, 28);
|
||||
WriteMacInt32(pb + ioWDDirID, ReadMacInt32(wdcb + wdDirID));
|
||||
return noErr;
|
||||
}
|
||||
|
@ -497,7 +497,7 @@ int16 SonyStatus(uint32 pb, uint32 dce)
|
||||
return paramErr;
|
||||
|
||||
case 8: // Get drive status
|
||||
memcpy(Mac2HostAddr(pb + csParam), Mac2HostAddr(info->status), 22);
|
||||
Mac2Mac_memcpy(pb + csParam, info->status, 22);
|
||||
return noErr;
|
||||
|
||||
case 10: // Get disk type
|
||||
|
@ -81,6 +81,7 @@ bool Init680x0(void)
|
||||
#endif
|
||||
|
||||
init_m68k();
|
||||
compiler_init();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,5 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
printf("};\nint n_defs68k = %d;\n", no_insns);
|
||||
fclose(tablef);
|
||||
return 0;
|
||||
}
|
||||
|
4549
BasiliskII/src/uae_cpu/compiler.cpp
Normal file
4549
BasiliskII/src/uae_cpu/compiler.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,6 @@ static __inline__ void run_compiled_code(void)
|
||||
nr_bbs_to_run = nr_bbs_start;
|
||||
} else
|
||||
m68k_setpc_fast(newpc);
|
||||
do_cycles();
|
||||
}
|
||||
/*} else */
|
||||
regs.spcflags &= ~SPCFLAG_EXEC;
|
||||
|
@ -73,6 +73,10 @@ static inline void WriteMacInt16(uint32 addr, uint32 w) {put_word(addr, w);}
|
||||
static inline void WriteMacInt8(uint32 addr, uint32 b) {put_byte(addr, b);}
|
||||
static inline uint8 *Mac2HostAddr(uint32 addr) {return get_real_address(addr);}
|
||||
#endif
|
||||
static inline void *Mac_memset(uint32 addr, int c, size_t n) {return memset(Mac2HostAddr(addr), c, n);}
|
||||
static inline void *Mac2Host_memcpy(void *dest, uint32 src, size_t n) {return memcpy(dest, Mac2HostAddr(src), n);}
|
||||
static inline void *Host2Mac_memcpy(uint32 dest, const void *src, size_t n) {return memcpy(Mac2HostAddr(dest), src, n);}
|
||||
static inline void *Mac2Mac_memcpy(uint32 dest, uint32 src, size_t n) {return memcpy(Mac2HostAddr(dest), Mac2HostAddr(src), n);}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -872,10 +872,8 @@ static __inline__ int put_fp_value (double value, uae_u32 opcode, uae_u16 extra)
|
||||
int mode;
|
||||
int reg;
|
||||
uae_u32 ad;
|
||||
static int sz1[8] =
|
||||
{4, 4, 12, 12, 2, 8, 1, 0};
|
||||
static int sz2[8] =
|
||||
{4, 4, 12, 12, 2, 8, 2, 0};
|
||||
static int sz1[8] = {4, 4, 12, 12, 2, 8, 1, 0};
|
||||
static int sz2[8] = {4, 4, 12, 12, 2, 8, 2, 0};
|
||||
|
||||
// D(bug("put_fp_value(%.04f,%X,%X)\r\n",(float)value,(int)opcode,(int)extra));
|
||||
|
||||
|
@ -232,7 +232,7 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge
|
||||
if (getv == 1)
|
||||
switch (size) {
|
||||
case sz_byte:
|
||||
#ifdef AMIGA
|
||||
#if defined(AMIGA) && !defined(WARPUP)
|
||||
/* sam: I don't know why gcc.2.7.2.1 produces a code worse */
|
||||
/* if it is not done like that: */
|
||||
printf ("\tuae_s8 %s = ((uae_u8*)&m68k_dreg(regs, %s))[3];\n", name, reg);
|
||||
@ -241,7 +241,7 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge
|
||||
#endif
|
||||
break;
|
||||
case sz_word:
|
||||
#ifdef AMIGA
|
||||
#if defined(AMIGA) && !defined(WARPUP)
|
||||
printf ("\tuae_s16 %s = ((uae_s16*)&m68k_dreg(regs, %s))[1];\n", name, reg);
|
||||
#else
|
||||
printf ("\tuae_s16 %s = m68k_dreg(regs, %s);\n", name, reg);
|
||||
|
@ -550,14 +550,13 @@ addrbank frame_host_888_bank = {
|
||||
|
||||
void memory_init(void)
|
||||
{
|
||||
int i;
|
||||
char buffer[4096];
|
||||
char *nam;
|
||||
int i, fd;
|
||||
|
||||
for(i=0; i<65536; i++)
|
||||
put_mem_bank(i<<16, &dummy_bank);
|
||||
|
||||
RAMBaseDiff = (uae_u32)RAMBaseHost - (uae_u32)RAMBaseMac;
|
||||
ROMBaseDiff = (uae_u32)ROMBaseHost - (uae_u32)ROMBaseMac;
|
||||
FrameBaseDiff = (uae_u32)MacFrameBaseHost - (uae_u32)MacFrameBaseMac;
|
||||
|
||||
// Limit RAM size to not overlap ROM
|
||||
#if REAL_ADDRESSING
|
||||
uint32 ram_size = RAMSize;
|
||||
@ -565,7 +564,11 @@ void memory_init(void)
|
||||
uint32 ram_size = RAMSize > ROMBaseMac ? ROMBaseMac : RAMSize;
|
||||
#endif
|
||||
|
||||
// RAM and ROM
|
||||
RAMBaseDiff = (uae_u32)RAMBaseHost - (uae_u32)RAMBaseMac;
|
||||
ROMBaseDiff = (uae_u32)ROMBaseHost - (uae_u32)ROMBaseMac;
|
||||
FrameBaseDiff = (uae_u32)MacFrameBaseHost - (uae_u32)MacFrameBaseMac;
|
||||
|
||||
// Map RAM and ROM
|
||||
if (TwentyFourBitAddressing) {
|
||||
map_banks(&ram24_bank, RAMBaseMac >> 16, ram_size >> 16);
|
||||
map_banks(&rom24_bank, ROMBaseMac >> 16, ROMSize >> 16);
|
||||
@ -574,7 +577,7 @@ void memory_init(void)
|
||||
map_banks(&rom_bank, ROMBaseMac >> 16, ROMSize >> 16);
|
||||
}
|
||||
|
||||
// Frame buffer
|
||||
// Map frame buffer
|
||||
switch (MacFrameLayout) {
|
||||
case FLAYOUT_DIRECT:
|
||||
map_banks(&frame_direct_bank, MacFrameBaseMac >> 16, (MacFrameSize >> 16) + 1);
|
||||
|
@ -183,8 +183,8 @@ void init_m68k (void)
|
||||
for (j = 7 ; j >= 0 ; j--) {
|
||||
if (i & (1 << j)) break;
|
||||
}
|
||||
fpp_movem_index1[i] = j;
|
||||
fpp_movem_index2[i] = 7-j;
|
||||
fpp_movem_index1[i] = 7-j;
|
||||
fpp_movem_index2[i] = j;
|
||||
fpp_movem_next[i] = i & (~(1 << j));
|
||||
}
|
||||
#if COUNT_INSTRS
|
||||
@ -250,7 +250,7 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
|
||||
disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2;
|
||||
addr = m68k_areg(regs,reg) + (uae_s16)disp16;
|
||||
sprintf (buffer,"(A%d,$%04x) == $%08lx", reg, disp16 & 0xffff,
|
||||
(long unsigned int)addr);
|
||||
(unsigned long)addr);
|
||||
break;
|
||||
case Ad8r:
|
||||
dp = get_iword_1 (m68kpc_offset); m68kpc_offset += 2;
|
||||
@ -283,20 +283,20 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
|
||||
dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W',
|
||||
1 << ((dp >> 9) & 3),
|
||||
disp,outer,
|
||||
(long unsigned int)addr);
|
||||
(unsigned long)addr);
|
||||
} else {
|
||||
addr = m68k_areg(regs,reg) + (uae_s32)((uae_s8)disp8) + dispreg;
|
||||
sprintf (buffer,"(A%d, %c%d.%c*%d, $%02x) == $%08lx", reg,
|
||||
dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W',
|
||||
1 << ((dp >> 9) & 3), disp8,
|
||||
(long unsigned int)addr);
|
||||
(unsigned long)addr);
|
||||
}
|
||||
break;
|
||||
case PC16:
|
||||
addr = m68k_getpc () + m68kpc_offset;
|
||||
disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2;
|
||||
addr += (uae_s16)disp16;
|
||||
sprintf (buffer,"(PC,$%04x) == $%08lx", disp16 & 0xffff,(long unsigned int)addr);
|
||||
sprintf (buffer,"(PC,$%04x) == $%08lx", disp16 & 0xffff,(unsigned long)addr);
|
||||
break;
|
||||
case PC8r:
|
||||
addr = m68k_getpc () + m68kpc_offset;
|
||||
@ -330,20 +330,20 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
|
||||
dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W',
|
||||
1 << ((dp >> 9) & 3),
|
||||
disp,outer,
|
||||
(long unsigned int)addr);
|
||||
(unsigned long)addr);
|
||||
} else {
|
||||
addr += (uae_s32)((uae_s8)disp8) + dispreg;
|
||||
sprintf (buffer,"(PC, %c%d.%c*%d, $%02x) == $%08lx", dp & 0x8000 ? 'A' : 'D',
|
||||
(int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3),
|
||||
disp8, (long unsigned int)addr);
|
||||
disp8, (unsigned long)addr);
|
||||
}
|
||||
break;
|
||||
case absw:
|
||||
sprintf (buffer,"$%08lx", (long unsigned int)(uae_s32)(uae_s16)get_iword_1 (m68kpc_offset));
|
||||
sprintf (buffer,"$%08lx", (unsigned long)(uae_s32)(uae_s16)get_iword_1 (m68kpc_offset));
|
||||
m68kpc_offset += 2;
|
||||
break;
|
||||
case absl:
|
||||
sprintf (buffer,"$%08lx", (long unsigned int)get_ilong_1 (m68kpc_offset));
|
||||
sprintf (buffer,"$%08lx", (unsigned long)get_ilong_1 (m68kpc_offset));
|
||||
m68kpc_offset += 4;
|
||||
break;
|
||||
case imm:
|
||||
@ -357,7 +357,7 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
|
||||
m68kpc_offset += 2;
|
||||
break;
|
||||
case sz_long:
|
||||
sprintf (buffer,"#$%08lx", (long unsigned int)(get_ilong_1 (m68kpc_offset)));
|
||||
sprintf (buffer,"#$%08lx", (unsigned long)(get_ilong_1 (m68kpc_offset)));
|
||||
m68kpc_offset += 4;
|
||||
break;
|
||||
default:
|
||||
@ -377,11 +377,11 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
|
||||
case imm2:
|
||||
offset = (uae_s32)get_ilong_1 (m68kpc_offset);
|
||||
m68kpc_offset += 4;
|
||||
sprintf (buffer,"#$%08lx", (long unsigned int)offset);
|
||||
sprintf (buffer,"#$%08lx", (unsigned long)offset);
|
||||
break;
|
||||
case immi:
|
||||
offset = (uae_s32)(uae_s8)(reg & 0xff);
|
||||
sprintf (buffer,"#$%08lx", (long unsigned int)offset);
|
||||
sprintf (buffer,"#$%08lx", (unsigned long)offset);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user