From cdea37980522d8ae5e4c15ba60b70dfbc9c5b8c4 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 2 Sep 2007 13:21:17 +0300 Subject: [PATCH] imported winuaesrc1440b2.zip --- a2091.c | 108 +- akiko.c | 229 +- akiko2.c | 38 +- ar.c | 454 +- arcadia.c | 18 +- archivers/7z/7zBuffer.h | 2 +- archivers/7z/7zCrc.c | 10 +- archivers/7z/7zCrc.h | 2 +- archivers/7z/7zDecode.c | 28 +- archivers/7z/7zDecode.h | 2 +- archivers/7z/7zExtract.c | 70 +- archivers/7z/7zExtract.h | 18 +- archivers/7z/7zHeader.h | 22 +- archivers/7z/7zIn.c | 428 +- archivers/7z/7zIn.h | 20 +- archivers/7z/7zItem.c | 2 +- archivers/7z/7zItem.h | 4 +- archivers/7z/7zMain.c | 120 +- archivers/7z/7zMethodID.h | 2 +- archivers/7z/7zTypes.h | 10 +- archivers/7z/LzmaDecode.c | 472 +- archivers/7z/LzmaDecode.h | 14 +- archivers/7z/LzmaTypes.h | 10 +- archivers/dms/pfile.c | 90 +- archivers/lha/dhuf.c | 2 +- archivers/lha/header.c | 86 +- archivers/lha/huf.c | 2 +- archivers/lha/slide.c | 12 +- archivers/lha/uae_lha.c | 4 +- archivers/lzx/unlzx.c | 86 +- archivers/xfd/main.c | 17 + archivers/xfd/xfd.c | 18 +- archivers/xfd/xfdmaster.h | 4 +- audio.c | 212 +- autoconf.c | 2 +- blitter.c | 130 +- blitter2.c | 96 +- blitter3.c | 100 +- blkdev.c | 34 +- bsdsocket.c | 28 +- catweasel.c | 40 +- cdrom.c | 4 +- cdtv.c | 104 +- cfgfile.c | 270 +- cia.c | 98 +- compemu_fpp.c | 14 +- compemu_raw_x86.c | 124 +- compemu_support.c | 118 +- cpummu.c | 120 +- crc32.c | 36 +- custom.c | 195 +- custom2.c | 302 +- debug.c | 190 +- disk.c | 212 +- drawing.c | 123 +- driveclick.c | 2 +- enforcer.c | 806 ++-- ersatz.c | 23 +- expansion.c | 44 +- fdi2raw.c | 110 +- filesys.c | 727 ++- filesys_bootrom.c | 241 +- fpp.c | 67 +- fsusage.c | 4 +- gayle.c | 448 +- genblitter.c | 3 +- gencomp.c | 12 +- gencpu.c | 414 +- gencpu_mini.c | 146 +- gfxlib.c | 336 +- gfxutil.c | 54 +- hardfile.c | 28 +- include/autoconf.h | 2 + include/blkdev.h | 2 +- include/cpu_prefetch.h | 6 +- include/cpummu.h | 154 +- include/events_jit.h | 2 +- include/filesys.h | 4 +- include/filter.h | 4 +- include/flags_x86.h | 2 +- include/inputdevice.h | 12 +- include/keyboard.h | 2 +- include/keybuf.h | 2 +- include/memory.h | 18 +- include/moduleripper.h | 2 +- include/native2amiga.h | 4 +- include/newcpu.h | 80 +- include/options.h | 10 +- include/osemu.h | 2 +- include/savestate.h | 2 +- include/serial.h | 18 +- include/uaeexe.h | 6 +- inputdevice.c | 160 +- keybuf.c | 6 +- main.c | 70 +- memory.c | 107 +- moduleripper.c | 6 +- native2amiga.c | 10 +- ncr_scsi.c | 68 +- newcpu.c | 930 ++-- od-win32/7zplugin.c | 6 +- od-win32/ahidsound.c | 130 +- od-win32/avioutput.c | 92 +- od-win32/avioutput.h | 4 +- od-win32/blkdev_win32_aspi.c | 22 +- od-win32/blkdev_win32_ioctl.c | 50 +- od-win32/blkdev_win32_spti.c | 42 +- od-win32/bsdsock.c | 394 +- od-win32/caps/CapsAPI.h | 4 +- od-win32/caps/caps_win32.c | 10 +- od-win32/debug_win32.c | 924 ++-- od-win32/dinput.c | 94 +- od-win32/direct3d.c | 8 +- od-win32/diskutil.c | 10 +- od-win32/dxwrap.c | 124 +- od-win32/dxwrap.h | 30 +- od-win32/fdrawcmd.c | 4 +- od-win32/filesys.asm | 1354 ++++++ od-win32/fsdb_win32.c | 51 +- od-win32/gencpu_msvc/cpustbl_small.c | 1890 -------- od-win32/gencpu_msvc/cputbl_small.h | 3776 --------------- od-win32/hardfile_win32.c | 244 +- od-win32/hq2x.c | 5336 ++++++++++----------- od-win32/ioport.c | 10 +- od-win32/ipctester.c | 10 +- od-win32/keyboard_win32.c | 8 +- od-win32/lcd.c | 12 +- od-win32/machdep/maccess.h | 12 +- od-win32/machdep/support.c | 4 +- od-win32/md-fpp.h | 24 +- od-win32/midi.c | 84 +- od-win32/midiin.c | 620 +-- od-win32/mman.c | 26 +- od-win32/opengl.c | 60 +- od-win32/parser.c | 118 +- od-win32/parser.h | 2 +- od-win32/picasso96_win.c | 762 +-- od-win32/picasso96_win.h | 4 +- od-win32/picasso96_xp_win.c | 598 +-- od-win32/posixemu.c | 42 +- od-win32/resources/resource.h | 7 +- od-win32/resources/winuae.rc | 2650 +++++----- od-win32/scaler.c | 752 +-- od-win32/scaler2.c | 752 +-- od-win32/scaler_more.c | 332 +- od-win32/screenshot.c | 58 +- od-win32/serial_win32.c | 68 +- od-win32/sfhelper.c | 4 +- od-win32/shm.c | 16 +- od-win32/soundcheck.c | 120 +- od-win32/sounddep/sound.c | 102 +- od-win32/sounddep/sound.h | 6 +- od-win32/support.c | 4 +- od-win32/win32.c | 128 +- od-win32/win32.h | 10 +- od-win32/win32_decompress.c | 55 +- od-win32/win32_nogui.c | 34 +- od-win32/win32_scale2x.c | 34 +- od-win32/win32gfx.c | 78 +- od-win32/win32gui.c | 562 +-- od-win32/win32gui_extra.c | 2 +- od-win32/winuae_msvc/winuae_msvc.vcproj | 32 +- od-win32/winuaechangelog.txt | 23 + od-win32/writelog.c | 12 +- picasso96.c | 198 +- prowizard/{rippers => include}/extern.h | 23 +- prowizard/{rippers => include}/globals.h | 12 +- prowizard/{rippers => include}/ptktable.h | 0 prowizard/{rippers => include}/tuning.h | 0 prowizard/{rippers => include}/vars.h | 0 prowizard/misc/misc.c | 71 +- prowizard/misc/testbag.c | 4 +- prowizard/prowiz.c | 144 +- prowizard/rippers/Bytekiller.c | 7 +- prowizard/rippers/DefjamCruncher32-pro.c | 67 +- prowizard/rippers/GnuPlayer.c | 4 +- prowizard/rippers/ModuleProtector.c | 2 +- prowizard/rippers/Newtron.c | 9 +- prowizard/rippers/NewtronOld.c | 234 + prowizard/rippers/NovoTrade.c | 249 + prowizard/rippers/PolkaPacker.c | 2 +- prowizard/rippers/Prorunner10.c | 2 +- prowizard/rippers/SGT-Packer.c | 2 +- prowizard/rippers/StoneArtsPlayer.c | 161 + prowizard/rippers/ThePlayer61a.c | 2 +- prowizard/rippers/TitanicsPlayer.c | 307 ++ prowizard/rippers/TreasurePattern.c | 2 +- prowizard/rippers/Viruz2.c | 136 + prowizard/rippers/skizzo.c | 182 + readcpu.c | 2 +- savestate.c | 26 +- scsi.c | 6 +- scsidev.c | 30 +- scsiemul.c | 50 +- serial.c | 2 +- svgancui.c | 1 - traps.c | 2 +- uaeexe.c | 58 +- uaeipc.c | 12 +- uaelib.c | 31 +- uaeserial.c | 83 +- zfile.c | 52 +- zfile_archive.c | 56 +- 203 files changed, 16337 insertions(+), 18842 deletions(-) create mode 100755 archivers/xfd/main.c create mode 100755 od-win32/filesys.asm delete mode 100755 od-win32/gencpu_msvc/cpustbl_small.c delete mode 100755 od-win32/gencpu_msvc/cputbl_small.h rename prowizard/{rippers => include}/extern.h (94%) rename prowizard/{rippers => include}/globals.h (94%) rename prowizard/{rippers => include}/ptktable.h (100%) rename prowizard/{rippers => include}/tuning.h (100%) rename prowizard/{rippers => include}/vars.h (100%) create mode 100755 prowizard/rippers/NewtronOld.c create mode 100755 prowizard/rippers/NovoTrade.c create mode 100755 prowizard/rippers/StoneArtsPlayer.c create mode 100755 prowizard/rippers/TitanicsPlayer.c create mode 100755 prowizard/rippers/Viruz2.c create mode 100755 prowizard/rippers/skizzo.c diff --git a/a2091.c b/a2091.c index 81c0f175..b3da2ce5 100755 --- a/a2091.c +++ b/a2091.c @@ -84,7 +84,7 @@ #define WD_COMMAND 0x18 #define WD_DATA 0x19 #define WD_QUEUE_TAG 0x1a -#define WD_AUXILIARY_STATUS 0x1f +#define WD_AUXILIARY_STATUS 0x1f /* WD commands */ #define WD_CMD_RESET 0x00 #define WD_CMD_ABORT 0x01 @@ -101,14 +101,14 @@ #define WD_CMD_WAIT_SEL_RECEIVE 0x0c #define WD_CMD_TRANS_ADDR 0x18 #define WD_CMD_TRANS_INFO 0x20 -#define WD_CMD_TRANSFER_PAD 0x21 +#define WD_CMD_TRANSFER_PAD 0x21 #define WD_CMD_SBT_MODE 0x80 -#define CSR_MSGIN 0x20 +#define CSR_MSGIN 0x20 #define CSR_SDP 0x21 #define CSR_SEL_ABORT 0x22 #define CSR_RESEL_ABORT 0x25 -#define CSR_RESEL_ABORT_AM 0x27 +#define CSR_RESEL_ABORT_AM 0x27 #define CSR_ABORT 0x28 /* successful completion interrupts */ #define CSR_RESELECT 0x10 @@ -118,17 +118,17 @@ /* terminated interrupts */ #define CSR_INVALID 0x40 #define CSR_UNEXP_DISC 0x41 -#define CSR_TIMEOUT 0x42 -#define CSR_PARITY 0x43 +#define CSR_TIMEOUT 0x42 +#define CSR_PARITY 0x43 #define CSR_PARITY_ATN 0x44 #define CSR_BAD_STATUS 0x45 -#define CSR_UNEXP 0x48 +#define CSR_UNEXP 0x48 /* service required interrupts */ -#define CSR_RESEL 0x80 -#define CSR_RESEL_AM 0x81 -#define CSR_DISC 0x85 -#define CSR_SRV_REQ 0x88 -/* SCSI Bus Phases */ +#define CSR_RESEL 0x80 +#define CSR_RESEL_AM 0x81 +#define CSR_DISC 0x85 +#define CSR_SRV_REQ 0x88 +/* SCSI Bus Phases */ #define PHS_DATA_OUT 0x00 #define PHS_DATA_IN 0x01 #define PHS_COMMAND 0x02 @@ -168,7 +168,7 @@ static int isirq(void) if ((dmac_cntr & SCNTR_INTEN) && (dmac_istr & (ISTR_INTS | ISTR_E_INT))) return 1; } else { - if ((dmac_cntr & CNTR_INTEN) && (dmac_istr & (ISTR_INTS | ISTR_E_INT))) + if ((dmac_cntr & CNTR_INTEN) && (dmac_istr & (ISTR_INTS | ISTR_E_INT))) return 1; } return 0; @@ -179,7 +179,7 @@ void rethink_a2091(void) if (isirq()) { uae_int_requested |= 2; #if A2091_DEBUG > 2 || A3000_DEBUG > 2 - write_log("Interrupt_RETHINK\n"); + write_log ("Interrupt_RETHINK\n"); #endif } else { uae_int_requested &= ~2; @@ -200,7 +200,7 @@ static void INT2(void) static void dmac_start_dma(void) { #if A3000_DEBUG > 0 || A2091_DEBUG > 0 - write_log("DMAC DMA started, ADDR=%08X, LEN=%08X words\n", dmac_acr, dmac_wtc); + write_log ("DMAC DMA started, ADDR=%08X, LEN=%08X words\n", dmac_acr, dmac_wtc); #endif dmac_dma = 1; } @@ -214,9 +214,9 @@ static void dmac_reset(void) { #if WD33C93_DEBUG > 0 if (superdmac) - write_log("A3000 %s SCSI reset\n", WD33C93); + write_log ("A3000 %s SCSI reset\n", WD33C93); else - write_log("A2091 %s SCSI reset\n", WD33C93); + write_log ("A2091 %s SCSI reset\n", WD33C93); #endif } @@ -241,13 +241,13 @@ static void doscsistatus(void) wdregs[WD_SCSI_STATUS] = scsidelay_status; auxstatus |= 0x80; #if WD33C93_DEBUG > 0 - write_log("%s STATUS=%02X\n", WD33C93, scsidelay_status); + write_log ("%s STATUS=%02X\n", WD33C93, scsidelay_status); #endif if (!currprefs.cs_a2091 && currprefs.cs_mbdmac != 1) return; INT2(); #if A2091_DEBUG > 2 || A3000_DEBUG > 2 - write_log("Interrupt\n"); + write_log ("Interrupt\n"); #endif } @@ -291,7 +291,7 @@ static void wd_cmd_sel_xfer(void) { int phase = wdregs[WD_COMMAND_PHASE]; #if WD33C93_DEBUG > 0 - write_log("* %s select and transfer, ID=%d phase=%02X\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, phase); + write_log ("* %s select and transfer, ID=%d phase=%02X\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, phase); #endif if (!SCSIID) { set_status(CSR_TIMEOUT, 0); @@ -313,14 +313,14 @@ static void do_dma(void) if (currprefs.cs_cdtvscsi) cdtv_getdmadata(&dmac_acr); if (SCSIID->direction == 0) { - write_log("%s DMA but no data!?\n", WD33C93); + write_log ("%s DMA but no data!?\n", WD33C93); } else if (SCSIID->direction < 0) { for (;;) { uae_u8 v; int status = scsi_receive_data(SCSIID, &v); - put_byte(dmac_acr, v); + put_byte (dmac_acr, v); if (wd_dataoffset < sizeof wd_data) - wd_data[wd_dataoffset++] = v; + wd_data[wd_dataoffset++] = v; dmac_acr++; if (status) break; @@ -328,7 +328,7 @@ static void do_dma(void) } else if (SCSIID->direction > 0) { for (;;) { int status; - uae_u8 v = get_byte(dmac_acr); + uae_u8 v = get_byte (dmac_acr); if (wd_dataoffset < sizeof wd_data) wd_data[wd_dataoffset++] = v; status = scsi_send_data(SCSIID, v); @@ -342,7 +342,7 @@ static void do_dma(void) static void wd_do_transfer_out(void) { #if WD33C93_DEBUG > 0 - write_log("%s SCSI O [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring()); + write_log ("%s SCSI O [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring()); #endif if (wdregs[WD_COMMAND_PHASE] == 0x11) { wdregs[WD_COMMAND_PHASE] = 0x20; @@ -357,10 +357,10 @@ static void wd_do_transfer_out(void) } else { scsi_emulate_cmd(SCSIID); if (SCSIID->data_len <= 0 || SCSIID->status != 0 || SCSIID->direction == 0) { - wd_phase = CSR_XFER_DONE | PHS_STATUS; + wd_phase = CSR_XFER_DONE | PHS_STATUS; wdregs[WD_COMMAND_PHASE] = 0x47; } else { - wd_phase = CSR_XFER_DONE | PHS_DATA_IN; + wd_phase = CSR_XFER_DONE | PHS_DATA_IN; wdregs[WD_COMMAND_PHASE] = 0x3f; } } @@ -370,7 +370,7 @@ static void wd_do_transfer_out(void) scsi_emulate_cmd(SCSIID); wd_phase = CSR_XFER_DONE | PHS_STATUS; } - wdregs[WD_COMMAND_PHASE] = 0x47; + wdregs[WD_COMMAND_PHASE] = 0x47; } wd_dataoffset = 0; set_status(wd_phase, SCSIID->direction ? 0 : 1); @@ -380,7 +380,7 @@ static void wd_do_transfer_out(void) static void wd_do_transfer_in(void) { #if WD33C93_DEBUG > 0 - write_log("%s SCSI I [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring()); + write_log ("%s SCSI I [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring()); #endif wd_dataoffset = 0; if (wdregs[WD_COMMAND_PHASE] >= 0x36 && wdregs[WD_COMMAND_PHASE] < 0x47) { @@ -404,7 +404,7 @@ static void wd_cmd_sel_xfer_atn(void) tmp_tc = wdregs[WD_TRANSFER_COUNT_LSB] | (wdregs[WD_TRANSFER_COUNT] << 8) | (wdregs[WD_TRANSFER_COUNT_MSB] << 16); #if WD33C93_DEBUG > 0 - write_log("* %s select and transfer with atn, ID=%d PHASE=%02X TC=%d\n", + write_log ("* %s select and transfer with atn, ID=%d PHASE=%02X TC=%d\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, wdregs[WD_COMMAND_PHASE], tmp_tc); #endif if (wdregs[WD_COMMAND] & 0x80) @@ -432,9 +432,9 @@ static void wd_cmd_sel_xfer_atn(void) wdregs[WD_COMMAND_PHASE] = 0x36; } if (wdregs[WD_COMMAND_PHASE] <= 0x41) { - wd_tc = tmp_tc; - wd_dataoffset = 0; - wdregs[WD_COMMAND_PHASE] = 0x45; + wd_tc = tmp_tc; + wd_dataoffset = 0; + wdregs[WD_COMMAND_PHASE] = 0x45; if (wd_tc == 0) { if (SCSIID->direction != 0 && SCSIID->status == 0) { wd_phase = CSR_UNEXP; @@ -448,9 +448,9 @@ static void wd_cmd_sel_xfer_atn(void) } if ((wdregs[WD_CONTROL] >> 5) == 4) { if (wd_phase == (CSR_XFER_DONE | PHS_DATA_IN)) - do_dma(); + do_dma(); else if(wd_phase == (CSR_XFER_DONE | PHS_DATA_OUT)) - do_dma(); + do_dma(); } } @@ -474,13 +474,13 @@ static void wd_cmd_trans_info(void) wd_tc = 1; wd_dataoffset = 0; #if WD33C93_DEBUG > 0 - write_log("* %s transfer info phase=%02x len=%d dma=%d\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_tc, wdregs[WD_CONTROL] >> 5); + write_log ("* %s transfer info phase=%02x len=%d dma=%d\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_tc, wdregs[WD_CONTROL] >> 5); #endif scsi_start_transfer(SCSIID, wd_tc); if (wdregs[WD_COMMAND_PHASE] >= 0x36 && wdregs[WD_COMMAND_PHASE] <= 0x3f) wdregs[WD_COMMAND_PHASE] = 0x45; if ((wdregs[WD_CONTROL] >> 5) == 4) { - do_dma(); + do_dma(); if (SCSIID->direction < 0) wd_do_transfer_in(); else if (SCSIID->direction > 0) @@ -493,7 +493,7 @@ static void wd_cmd_trans_info(void) static void wd_cmd_sel_atn(void) { #if WD33C93_DEBUG > 0 - write_log("* %s select with atn, ID=%d\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7); + write_log ("* %s select with atn, ID=%d\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7); #endif wd_phase = 0; wdregs[WD_COMMAND_PHASE] = 0; @@ -511,7 +511,7 @@ static void wd_cmd_reset(void) int i; #if WD33C93_DEBUG > 0 - write_log("%s reset\n", WD33C93); + write_log ("%s reset\n", WD33C93); #endif for (i = 1; i < 0x16; i++) wdregs[i] = 0; @@ -524,7 +524,7 @@ static void wd_cmd_reset(void) static void wd_cmd_abort(void) { #if WD33C93_DEBUG > 0 - write_log("%s abort\n", WD33C93); + write_log ("%s abort\n", WD33C93); #endif set_status(CSR_SEL_ABORT, 0); } @@ -540,17 +540,17 @@ void wdscsi_put(uae_u8 d) { #if WD33C93_DEBUG > 1 if (WD33C93_DEBUG > 3 || sasr != WD_DATA) - write_log("W %s REG %02.2X (%d) = %02.2X (%d) PC=%08X\n", WD33C93, sasr, sasr, d, d, M68K_GETPC); + write_log ("W %s REG %02.2X (%d) = %02.2X (%d) PC=%08X\n", WD33C93, sasr, sasr, d, d, M68K_GETPC); #endif if (!writeonlyreg(sasr)) wdregs[sasr] = d; if (!wd_used) { wd_used = 1; - write_log("%s in use\n", WD33C93); + write_log ("%s in use\n", WD33C93); } if (sasr == WD_COMMAND_PHASE) { #if WD33C93_DEBUG > 0 - write_log("%s PHASE=%02X\n", WD33C93, d); + write_log ("%s PHASE=%02X\n", WD33C93, d); #endif } else if (sasr == WD_DATA) { if (wd_dataoffset < sizeof wd_data) @@ -566,7 +566,7 @@ void wdscsi_put(uae_u8 d) break; break; case WD_CMD_SEL_ATN: - wd_cmd_sel_atn(); + wd_cmd_sel_atn(); break; case WD_CMD_SEL_ATN_XFER: wd_cmd_sel_xfer_atn(); @@ -578,7 +578,7 @@ void wdscsi_put(uae_u8 d) wd_cmd_trans_info(); break; default: - write_log("%s unimplemented/unknown command %02.X\n", WD33C93, d); + write_log ("%s unimplemented/unknown command %02.X\n", WD33C93, d); break; } } @@ -597,7 +597,7 @@ uae_u8 wdscsi_getauxstatus(void) uae_u8 wdscsi_get(void) { uae_u8 v, osasr = sasr; - + v = wdregs[sasr]; if (sasr == WD_DATA) { int status = scsi_receive_data(SCSIID, &v); @@ -620,7 +620,7 @@ uae_u8 wdscsi_get(void) incsasr(0); #if WD33C93_DEBUG > 1 if (WD33C93_DEBUG > 3 || osasr != WD_DATA) - write_log("R %s REG %02.2X (%d) = %02.2X (%d) PC=%08X\n", WD33C93, osasr, osasr, v, v, M68K_GETPC); + write_log ("R %s REG %02.2X (%d) = %02.2X (%d) PC=%08X\n", WD33C93, osasr, osasr, v, v, M68K_GETPC); #endif return v; } @@ -1000,7 +1000,7 @@ static uae_u32 mbdmac_read (uae_u32 addr, int mode) { uae_u32 vaddr = addr; uae_u32 v = 0xffffffff; - + if (currprefs.cs_mbdmac > 1) return 0; @@ -1218,7 +1218,7 @@ static void addnativescsi(void) while (devices[i] >= 0 && j < 7) { if (scsis[j] == NULL) { scsis[j] = scsi_alloc_native(j, devices[i]); - write_log("SCSI: %d:'%s'\n", j, dis[i].label); + write_log ("SCSI: %d:'%s'\n", j, dis[i].label); i++; } j++; @@ -1301,26 +1301,26 @@ void a2091_init (void) rombank = 0; rl = getromlistbyids(roms); if (rl) { - write_log("A590/A2091 BOOT ROM '%s' %d.%d ", rl->path, rl->rd->ver, rl->rd->rev); + write_log ("A590/A2091 BOOT ROM '%s' %d.%d ", rl->path, rl->rd->ver, rl->rd->rev); z = zfile_fopen(rl->path, "rb"); if (z) { if (rl->rd->id == 56) { int i; rom_size = 32768; rombankswitcher = 1; - rom = (uae_u8*)xmalloc (rom_size * 2); + rom = (uae_u8*)xmalloc (rom_size * 2); for (i = 0; i < rom_size; i++) zfile_fread(rom + i * 2, 1, 1, z); - } else { + } else { rom_size = 16384; rom = (uae_u8*)xmalloc (rom_size); zfile_fread (rom, rom_size, 1, z); } zfile_fclose(z); rom_mask = rom_size - 1; - write_log("loaded\n"); + write_log ("loaded\n"); } else { - write_log("failed to load\n"); + write_log ("failed to load\n"); } } else { romwarning(roms); diff --git a/akiko.c b/akiko.c index 6205387c..7824fdcd 100755 --- a/akiko.c +++ b/akiko.c @@ -30,7 +30,7 @@ #define AKIKO_DEBUG_NVRAM 0 #define AKIKO_DEBUG_IO 0 -#define AKIKO_DEBUG_IO_CMD 0 +#define AKIKO_DEBUG_IO_CMD 1 static void irq(void) { @@ -52,25 +52,25 @@ static void irq(void) * unnecessarily complex and not 100% correct.. */ -enum i2c { I2C_WAIT, I2C_START, I2C_DEVICEADDR, I2C_WORDADDR, I2C_DATA }; +enum i2c { I2C_WAIT, I2C_START, I2C_DEVICEADDR, I2C_WORDADDR, I2C_DATA }; /* size of EEPROM, don't try to change, * (hardcoded in Kickstart) */ -#define NVRAM_SIZE 1024 +#define NVRAM_SIZE 1024 /* max size of one write request */ -#define NVRAM_PAGE_SIZE 16 +#define NVRAM_PAGE_SIZE 16 static uae_u8 cd32_nvram[NVRAM_SIZE], nvram_writetmp[NVRAM_PAGE_SIZE]; static int nvram_address, nvram_writeaddr; static int nvram_rw; -static int bitcounter = -1, direction = -1; +static int bitcounter = -1, direction = -1; static uae_u8 nvram_byte; static int scl_out, scl_in, scl_dir, oscl, sda_out, sda_in, sda_dir, osda; static int sda_dir_nvram; static int state = I2C_WAIT; -static void nvram_write (int offset, int len) +static void nvram_write (int offset, int len) { struct zfile *f; @@ -153,7 +153,7 @@ static void i2c_do (void) bitcounter = -1; } } else { - //write_log("NVRAM received bit %d, offset %d\n", sda_out, bitcounter); + //write_log ("NVRAM received bit %d, offset %d\n", sda_out, bitcounter); nvram_byte <<= 1; nvram_byte |= sda_out; bitcounter++; @@ -166,7 +166,7 @@ static void i2c_do (void) nvram_byte = cd32_nvram[nvram_address]; sda_dir_nvram = 1; sda_in = (nvram_byte & 0x80) ? 1 : 0; - //write_log("NVRAM sent bit %d, offset %d\n", sda_in, bitcounter); + //write_log ("NVRAM sent bit %d, offset %d\n", sda_in, bitcounter); nvram_byte <<= 1; bitcounter++; if (bitcounter == 8) { @@ -331,15 +331,15 @@ static uae_u32 akiko_c2p_read (int offset) * this piece of crap emulates real CD32 CDROM controller and drive :) */ -#define CDSTATUS_FRAME 0x80000000 +#define CDSTATUS_FRAME 0x80000000 #define CDSTATUS_UNK1 0x40000000 /* not used by ROM */ #define CDSTATUS_UNK2 0x20000000 /* not used by ROM */ -#define CDSTATUS_DATA_AVAILABLE 0x10000000 -#define CDSTATUS_DATASECTOR_ERROR 0x08000000 /* ?? */ -#define CDSTATUS_DATASECTOR 0x04000000 +#define CDSTATUS_DATA_AVAILABLE 0x10000000 +#define CDSTATUS_DATASECTOR_ERROR 0x08000000 /* ?? */ +#define CDSTATUS_DATASECTOR 0x04000000 -#define CDS_ERROR 0x80 -#define CDS_PLAYING 0x08 +#define CDS_ERROR 0x80 +#define CDS_PLAYING 0x08 #define AUDIO_STATUS_NOT_SUPPORTED 0x00 #define AUDIO_STATUS_IN_PROGRESS 0x11 @@ -353,10 +353,10 @@ static uae_u8 cdrom_status3; static uae_u32 cdrom_address1, cdrom_address2; static uae_u32 cdrom_longmask; static uae_u32 cdrom_readmask_r, cdrom_readmask_w; -static uae_u8 cdrom_command_offset_complete; /* 0x19 */ +static uae_u8 cdrom_command_offset_complete; /* 0x19 */ static uae_u8 cdrom_command_offset_todo; /* 0x1d */ -static uae_u8 cdrom_result_complete; /* 0x1a */ -static uae_u8 cdrom_result_last_pos; /* 0x1f */ +static uae_u8 cdrom_result_complete; /* 0x1a */ +static uae_u8 cdrom_result_last_pos; /* 0x1f */ static uae_u8 cdrom_result_buffer[32]; static uae_u8 cdrom_command_buffer[32]; static uae_u8 cdrom_command; @@ -409,7 +409,7 @@ static int fromlongbcd (uae_u8 *p) } /* convert minutes, seconds and frames -> logical sector number */ -static int msf2lsn (int msf) +static int msf2lsn (int msf) { int sector = (((msf >> 16) & 0xff) * 60 * 75 + ((msf >> 8) & 0xff) * 75 + ((msf >> 0) & 0xff)) - 150; if (sector < 0) @@ -418,7 +418,7 @@ static int msf2lsn (int msf) } /* convert logical sector number -> minutes, seconds and frames */ -static int lsn2msf (int sectors) +static int lsn2msf (int sectors) { int msf; sectors += 150; @@ -428,7 +428,7 @@ static int lsn2msf (int sectors) return msf; } -static void cdaudiostop (void) +static void cdaudiostop (void) { cdrom_playing = 0; cdrom_paused = 0; @@ -440,12 +440,12 @@ static void cdaudiostop (void) } static uae_u32 last_play_end; -static int cd_play_audio (uae_u32 startmsf, uae_u32 endmsf, int scan) +static int cd_play_audio (uae_u32 startmsf, uae_u32 endmsf, int scan) { if (endmsf >= lsn2msf (cdrom_leadout)) endmsf = lsn2msf (cdrom_leadout); last_play_end = endmsf; - return sys_command_cd_play (DF_IOCTL, unitnum,startmsf, endmsf, scan); + return sys_command_cd_play (DF_IOCTL, unitnum, startmsf, endmsf, scan); } @@ -902,7 +902,7 @@ static void cdrom_run_read (void) return; } #if AKIKO_DEBUG_IO_CMD - write_log("read sector=%d, scnt=%d -> %d\n", cdrom_data_offset, cdrom_sector_counter, sector); + write_log ("read sector=%d, scnt=%d -> %d\n", cdrom_data_offset, cdrom_sector_counter, sector); #endif cdrom_readmask_w &= ~(1 << j); } @@ -973,15 +973,15 @@ static void do_hunt(void) if (i == MAX_TOTAL_DEVICES) return; if (unitnum >= 0) { + int ou = unitnum; cdaudiostop(); - sys_command_close(DF_IOCTL, unitnum); + unitnum = -1; + sys_command_close(DF_IOCTL, ou); } if (sys_command_open(DF_IOCTL, i) > 0) { unitnum = i; cd_hunt = 0; - write_log("CD32: autodetected unit %d\n", unitnum); - } else { - unitnum = -1; + write_log ("CD32: autodetected unit %d\n", unitnum); } } @@ -1011,8 +1011,8 @@ void AKIKO_hsync_handler (void) } if (cdrom_playing) { static int frame2counter; - frame2counter--; - if (frame2counter <= 0) { + frame2counter--; + if (frame2counter <= 0) { uae_u8 *s; frame2counter = 312 * 50 * 2; s = sys_command_cd_qcode (DF_IOCTL, unitnum); @@ -1037,7 +1037,7 @@ void AKIKO_hsync_handler (void) static volatile int akiko_thread_running; /* cdrom data buffering thread */ -static void *akiko_thread (void *null) +static void *akiko_thread (void *null) { int i; uae_u8 *tmp1; @@ -1058,7 +1058,7 @@ static void *akiko_thread (void *null) (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || i != SECTOR_BUFFER_SIZE)) { memset (sector_buffer_info_2, 0, SECTOR_BUFFER_SIZE); #if AKIKO_DEBUG_IO_CMD - write_log("filling buffer sector=%d (max=%d)\n", sector, cdrom_data_end); + write_log ("filling buffer sector=%d (max=%d)\n", sector, cdrom_data_end); #endif sector_buffer_sector_2 = sector; offset = 0; @@ -1093,6 +1093,7 @@ STATIC_INLINE uae_u8 akiko_get_long (uae_u32 v, int offset) { return v >> ((3 - offset) * 8); } + STATIC_INLINE void akiko_put_long (uae_u32 *p, int offset, int v) { *p &= ~(0xff << ((3 - offset) * 8)); @@ -1118,78 +1119,78 @@ static uae_u32 akiko_bget2 (uaecptr addr, int msg) { /* "CAFE" = Akiko identification. * Kickstart ignores Akiko C2P if this ID isn't correct */ - case 0x02: + case 0x02: v = 0xCA; break; - case 0x03: + case 0x03: v = 0xFE; break; if (currprefs.cs_cd32cd) { /* CDROM control */ - case 0x04: - case 0x05: - case 0x06: - case 0x07: + case 0x04: + case 0x05: + case 0x06: + case 0x07: v = akiko_get_long (cdrom_status1, addr - 0x04); break; - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: v = akiko_get_long (cdrom_status2, addr - 0x08); break; - case 0x10: - case 0x11: - case 0x12: - case 0x13: + case 0x10: + case 0x11: + case 0x12: + case 0x13: v = akiko_get_long (cdrom_address1, addr - 0x10); break; - case 0x14: - case 0x15: - case 0x16: - case 0x17: + case 0x14: + case 0x15: + case 0x16: + case 0x17: v = akiko_get_long (cdrom_address2, addr - 0x14); break; - case 0x18: + case 0x18: v = cdrom_status3; break; - case 0x19: + case 0x19: v = cdrom_command_offset_complete; break; - case 0x1a: + case 0x1a: v = cdrom_result_complete; break; - case 0x1f: + case 0x1f: v = cdrom_result_last_pos; break; - case 0x20: - case 0x21: + case 0x20: + case 0x21: v = akiko_get_long (cdrom_readmask_r, addr - 0x20 + 2); break; - case 0x24: - case 0x25: - case 0x26: - case 0x27: + case 0x24: + case 0x25: + case 0x26: + case 0x27: v = akiko_get_long (cdrom_longmask, addr - 0x24); break; } else if (addr < 0x30) { break; } - /* NVRAM */ - case 0x30: - case 0x31: - case 0x32: - case 0x33: + /* NVRAM */ + case 0x30: + case 0x31: + case 0x32: + case 0x33: if (currprefs.cs_cd32nvram) - v = akiko_nvram_read (addr - 0x30); - break; + v = akiko_nvram_read (addr - 0x30); + break; /* C2P */ case 0x38: case 0x39: - case 0x3a: + case 0x3a: case 0x3b: if (currprefs.cs_cd32c2p) v = akiko_c2p_read (addr - 0x38); @@ -1272,57 +1273,57 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) switch (addr) { if (currprefs.cs_cd32cd) { - case 0x04: - case 0x05: - case 0x06: - case 0x07: + case 0x04: + case 0x05: + case 0x06: + case 0x07: akiko_put_long (&cdrom_status1, addr - 0x04, v); break; - case 0x08: - case 0x09: - case 0x0a: - case 0x0b: + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: akiko_put_long (&cdrom_status2, addr - 0x08, v); if (addr == 8) cdrom_status1 &= cdrom_status2; break; - case 0x10: - case 0x11: - case 0x12: - case 0x13: + case 0x10: + case 0x11: + case 0x12: + case 0x13: akiko_put_long (&cdrom_address1, addr - 0x10, v); break; - case 0x14: - case 0x15: - case 0x16: - case 0x17: + case 0x14: + case 0x15: + case 0x16: + case 0x17: akiko_put_long (&cdrom_address2, addr - 0x14, v); break; - case 0x18: + case 0x18: cdrom_status3 = v; break; - case 0x19: + case 0x19: cdrom_command_offset_complete = v; break; - case 0x1a: + case 0x1a: cdrom_result_complete = v; break; - case 0x1d: + case 0x1d: cdrom_command_offset_todo = v; break; - case 0x1f: + case 0x1f: cdrom_result_last_pos = v; break; - case 0x20: + case 0x20: write_readmask(v <<8); break; - case 0x21: + case 0x21: write_readmask(v); break; - case 0x24: - case 0x25: - case 0x26: - case 0x27: + case 0x24: + case 0x25: + case 0x26: + case 0x27: tmp = cdrom_longmask; akiko_put_long (&cdrom_longmask, addr - 0x24, v); if ((cdrom_longmask & 0x04000000) && !(tmp & 0x04000000)) @@ -1332,21 +1333,21 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) break; } - case 0x30: - case 0x31: - case 0x32: - case 0x33: + case 0x30: + case 0x31: + case 0x32: + case 0x33: if (currprefs.cs_cd32nvram) akiko_nvram_write (addr - 0x30, v); break; - case 0x38: - case 0x39: - case 0x3a: - case 0x3b: + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: if (currprefs.cs_cd32c2p) akiko_c2p_write (addr - 0x38, v); - break; + break; default: write_log ("akiko_bput: unknown address %08.8X\n", addr); @@ -1371,7 +1372,7 @@ static void REGPARAM2 akiko_wput (uaecptr addr, uae_u32 v) #endif addr &= 0xfff; if((addr < 0x30 && AKIKO_DEBUG_IO)) - write_log("akiko_wput %08.8X: %08.8X=%04.4X\n", M68K_GETPC, addr, v & 0xffff); + write_log ("akiko_wput %08.8X: %08.8X=%04.4X\n", M68K_GETPC, addr, v & 0xffff); akiko_bput2 (addr + 1, v & 0xff, 0); akiko_bput2 (addr + 0, v >> 8, 0); } @@ -1383,7 +1384,7 @@ static void REGPARAM2 akiko_lput (uaecptr addr, uae_u32 v) #endif addr &= 0xffff; if(addr < 0x30 && AKIKO_DEBUG_IO) - write_log("akiko_lput %08.8X: %08.8X=%08.8X\n", M68K_GETPC, addr, v); + write_log ("akiko_lput %08.8X: %08.8X=%08.8X\n", M68K_GETPC, addr, v); akiko_bput2 (addr + 3, (v >> 0) & 0xff, 0); akiko_bput2 (addr + 2, (v >> 8) & 0xff, 0); akiko_bput2 (addr + 1, (v >> 16) & 0xff, 0); @@ -1567,7 +1568,7 @@ uae_u8 *restore_akiko(uae_u8 *src) restore_u16 (); cdrom_status1 = restore_u32 (); cdrom_status2 = restore_u32 (); - restore_u32(); + restore_u32 (); cdrom_address1 = restore_u32 (); cdrom_address2 = restore_u32 (); cdrom_status3 = restore_u8 (); @@ -1581,13 +1582,13 @@ uae_u8 *restore_akiko(uae_u8 *src) cdrom_readmask_w = restore_u16 (); restore_u16 (); cdrom_longmask = restore_u32 (); - restore_u32(); - restore_u32(); - v = restore_u32(); + restore_u32 (); + restore_u32 (); + v = restore_u32 (); scl_dir = (v & 0x8000) ? 1 : 0; sda_dir = (v & 0x4000) ? 1 : 0; - restore_u32(); - restore_u32(); + restore_u32 (); + restore_u32 (); for (i = 0; i < 8; i++) akiko_buffer[i] = restore_u32 (); @@ -1607,9 +1608,9 @@ uae_u8 *restore_akiko(uae_u8 *src) cdrom_speed = restore_u8 (); cdrom_current_sector = (uae_s8)restore_u8 (); - restore_u32(); - restore_u8(); - restore_u32(); + restore_u32 (); + restore_u8 (); + restore_u32 (); return src; } diff --git a/akiko2.c b/akiko2.c index b2251d9c..1cb4b89a 100755 --- a/akiko2.c +++ b/akiko2.c @@ -30,7 +30,7 @@ int cd32_enabled; -static int m68k_getpc(void) { return 0; } +static int m68k_getpc (void) { return 0; } /* * CD32 1Kb NVRAM (EEPROM) emulation @@ -123,14 +123,14 @@ static void i2c_do (void) } return; } - } + } if (bitcounter >= 0) { if (direction) { /* Amiga -> NVRAM */ if (scl_out && !oscl) { if (bitcounter == 8) { #if AKIKO_DEBUG_NVRAM - write_log ("RB %02.2X ", nvram_byte, m68k_getpc()); + write_log ("RB %02.2X ", nvram_byte, m68k_getpc ()); #endif sda_in = 0; /* ACK */ if (direction > 0) { @@ -141,7 +141,7 @@ static void i2c_do (void) bitcounter = -1; } } else { - //write_log("NVRAM received bit %d, offset %d\n", sda_out, bitcounter); + //write_log ("NVRAM received bit %d, offset %d\n", sda_out, bitcounter); nvram_byte <<= 1; nvram_byte |= sda_out; bitcounter++; @@ -154,12 +154,12 @@ static void i2c_do (void) nvram_byte = cd32_nvram[nvram_address]; sda_dir_nvram = 1; sda_in = (nvram_byte & 0x80) ? 1 : 0; - //write_log("NVRAM sent bit %d, offset %d\n", sda_in, bitcounter); + //write_log ("NVRAM sent bit %d, offset %d\n", sda_in, bitcounter); nvram_byte <<= 1; bitcounter++; if (bitcounter == 8) { #if AKIKO_DEBUG_NVRAM - write_log ("NVRAM sent byte %02.2X address %04.4X PC=%08.8X\n", cd32_nvram[nvram_address], nvram_address, m68k_getpc()); + write_log ("NVRAM sent byte %02.2X address %04.4X PC=%08.8X\n", cd32_nvram[nvram_address], nvram_address, m68k_getpc ()); #endif nvram_address++; nvram_address &= NVRAM_SIZE - 1; @@ -193,14 +193,14 @@ static void i2c_do (void) } bitcounter = 0; #if AKIKO_DEBUG_NVRAM - write_log ("I2C_DEVICEADDR: rw %d, address %02.2Xxx PC=%08.8X\n", nvram_rw, nvram_address >> 8, m68k_getpc()); + write_log ("I2C_DEVICEADDR: rw %d, address %02.2Xxx PC=%08.8X\n", nvram_rw, nvram_address >> 8, m68k_getpc ()); #endif break; case I2C_WORDADDR: nvram_address &= 0x300; nvram_address |= nvram_byte; #if AKIKO_DEBUG_NVRAM - write_log ("I2C_WORDADDR: address %04.4X PC=%08.8X\n", nvram_address, m68k_getpc()); + write_log ("I2C_WORDADDR: address %04.4X PC=%08.8X\n", nvram_address, m68k_getpc ()); #endif if (direction < 0) { memcpy (nvram_writetmp, cd32_nvram + (nvram_address & ~(NVRAM_PAGE_SIZE - 1)), NVRAM_PAGE_SIZE); @@ -833,7 +833,7 @@ static void cdrom_run_read (void) } else return; #if AKIKO_DEBUG_IO_CMD - write_log("read sector=%d, scnt=%d -> %d\n", cdrom_data_offset, cdrom_sector_counter, sector); + write_log ("read sector=%d, scnt=%d -> %d\n", cdrom_data_offset, cdrom_sector_counter, sector); #endif cdrom_readmask_w &= ~(1 << j); cdrom_status1 |= CDSTATUS_DATASECTOR; @@ -873,7 +873,7 @@ static void akiko_handler (void) return; } } - + static void akiko_internal (void) { cdrom_run_command (); @@ -925,7 +925,7 @@ static void *akiko_thread (void *null) if (cdrom_data_end > 0 && sector >= 0 && (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || i != SECTOR_BUFFER_SIZE)) { memset (sector_buffer_info_2, 0, SECTOR_BUFFER_SIZE); #if AKIKO_DEBUG_IO_CMD - write_log("filling buffer sector=%d (max=%d)\n", sector, cdrom_data_end); + write_log ("filling buffer sector=%d (max=%d)\n", sector, cdrom_data_end); #endif sector_buffer_sector_2 = sector; offset = 0; @@ -1055,7 +1055,7 @@ uae_u32 akiko_bget2 (uaecptr addr, int msg) akiko_internal (); uae_sem_post (&akiko_sem); if (msg && addr < 0x30 && AKIKO_DEBUG_IO) - write_log ("akiko_bget %08.8X: %08.8X %02.2X\n", m68k_getpc(), addr, v & 0xff); + write_log ("akiko_bget %08.8X: %08.8X %02.2X\n", m68k_getpc (), addr, v & 0xff); return v; } @@ -1071,7 +1071,7 @@ uae_u32 akiko_wget (uaecptr addr) v = akiko_bget2 (addr + 1, 0); v |= akiko_bget2 (addr + 0, 0) << 8; if (addr < 0x30 && AKIKO_DEBUG_IO) - write_log ("akiko_wget %08.8X: %08.8X %04.4X\n", m68k_getpc(), addr, v & 0xffff); + write_log ("akiko_wget %08.8X: %08.8X %04.4X\n", m68k_getpc (), addr, v & 0xffff); return v; } @@ -1085,7 +1085,7 @@ uae_u32 akiko_lget (uaecptr addr) v |= akiko_bget2 (addr + 1, 0) << 16; v |= akiko_bget2 (addr + 0, 0) << 24; if (addr < 0x30 && (addr != 4 && addr != 8) && AKIKO_DEBUG_IO) - write_log ("akiko_lget %08.8X: %08.8X %08.8X\n", m68k_getpc(), addr, v); + write_log ("akiko_lget %08.8X: %08.8X %08.8X\n", m68k_getpc (), addr, v); return v; } @@ -1096,7 +1096,7 @@ void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) addr &= 0xffff; v &= 0xff; if(msg && addr < 0x30 && AKIKO_DEBUG_IO) - write_log ("akiko_bput %08.8X: %08.8X=%02.2X\n", m68k_getpc(), addr, v & 0xff); + write_log ("akiko_bput %08.8X: %08.8X=%02.2X\n", m68k_getpc (), addr, v & 0xff); uae_sem_wait (&akiko_sem); switch (addr) { @@ -1190,7 +1190,7 @@ void akiko_wput (uaecptr addr, uae_u32 v) { addr &= 0xfff; if((addr < 0x30 && AKIKO_DEBUG_IO)) - write_log("akiko_wput %08.8X: %08.8X=%04.4X\n", m68k_getpc(), addr, v & 0xffff); + write_log ("akiko_wput %08.8X: %08.8X=%04.4X\n", m68k_getpc (), addr, v & 0xffff); akiko_bput2 (addr + 1, v & 0xff, 0); akiko_bput2 (addr + 0, v >> 8, 0); } @@ -1199,7 +1199,7 @@ void akiko_lput (uaecptr addr, uae_u32 v) { addr &= 0xffff; if(addr < 0x30 && AKIKO_DEBUG_IO) - write_log("akiko_lput %08.8X: %08.8X=%08.8X\n", m68k_getpc(), addr, v); + write_log ("akiko_lput %08.8X: %08.8X=%08.8X\n", m68k_getpc (), addr, v); akiko_bput2 (addr + 3, (v >> 0) & 0xff, 0); akiko_bput2 (addr + 2, (v >> 8) & 0xff, 0); akiko_bput2 (addr + 1, (v >> 16) & 0xff, 0); @@ -1284,7 +1284,7 @@ void akiko_init (void) if (!savestate_state) { cdrom_playing = cdrom_paused = 0; cdrom_data_offset = -1; - uae_sem_init (&akiko_sem, 0, 1); + uae_sem_init (&akiko_sem, 0, 1); } if (cdromok && !akiko_thread_running) { akiko_thread_running = 1; @@ -1326,7 +1326,7 @@ uae_u8 *save_akiko(int *len) save_u32 (akiko_buffer[i]); save_u8 ((uae_u8)akiko_read_offset); save_u8 ((uae_u8)akiko_write_offset); - + save_u32 ((cdrom_playing ? 1 : 0) | (cdrom_paused ? 2 : 0)); if (cdrom_playing) cd_qcode (0); diff --git a/ar.c b/ar.c index 1af8dc7a..d1faad79 100755 --- a/ar.c +++ b/ar.c @@ -22,14 +22,14 @@ * * Found to work for the following roms by Mark Cox: * (Yes the date format is inconsistent, i just copied it straight from the rom) - * 1.15 + * 1.15 * 2.14 22/02/91 dd/mm/yy * 3.09 10/13/91 mm/dd/yy * 3.17 12/17/91 mm/dd/yy * * This patch also makes AR3 compatible with KickStart's other than 1.3 * (ROM checksum error is normal with KS != 1.3) - * NOTE: AR has problems with 68020+ processors + * NOTE: AR has problems with 68020+ processors. * For maximum compatibility select 68000/68010 and A500 speed from UAE * options. * @@ -50,7 +50,7 @@ * with * you * new (AR3 only) - * + * * AR1: 64K ROM is visible at 0xf00000-0xf0ffff * and 16K RAM at 0x9fc000-0x9fffff * AR2: 128K ROM is visible at 0x400000-0x41ffff @@ -192,7 +192,7 @@ * * Data: 0-2,1-3,2-4,3-5,4-6,5-7,6-0,7-1 * Addr: 0-3,1-6,2-5,3-7,4-9,5-12,6-14,7-13,8-8,9-11,10-10,11-1,12-0,13-4,14-2,15-15 - * + * */ #include "sysconfig.h" @@ -248,10 +248,10 @@ uae_u32 hrtmem_end, hrtmem2_end; static int hrtmem_rom; static int triggered_once; -static void hrtmon_unmap_banks(void); +static void hrtmon_unmap_banks (void); void check_prefs_changed_carts(int in_memory_reset); -int action_replay_unload(int in_memory_reset); +int action_replay_unload (int in_memory_reset); static int stored_picasso_on = -1; @@ -277,10 +277,12 @@ static uae_u32 REGPARAM2 hrtmem3_bget (uaecptr addr) addr &= hrtmem3_mask; return hrtmemory3[addr]; } + static uae_u32 REGPARAM2 hrtmem3_wget (uaecptr addr) { return (hrtmem3_bget (addr) << 8) | hrtmem3_bget (addr + 1); } + static uae_u32 REGPARAM2 hrtmem3_lget (uaecptr addr) { return (hrtmem3_wget (addr) << 16) | hrtmem3_wget (addr + 2); @@ -303,6 +305,7 @@ static void REGPARAM2 hrtmem3_wput (uaecptr addr, uae_u32 w) m = (uae_u16 *)(hrtmemory3 + addr); do_put_mem_word (m, (uae_u16)w); } + static void REGPARAM2 hrtmem3_bput (uaecptr addr, uae_u32 b) { addr -= hrtmem3_start & hrtmem3_mask; @@ -326,7 +329,7 @@ static uae_u8 *REGPARAM2 hrtmem3_xlate (uaecptr addr) static uae_u32 REGPARAM2 hrtmem2_bget (uaecptr addr) { if (addr == 0xb8007c && cart_type == CART_SUPER4) { - static int cnt = 60; + static int cnt = 60; cnt--; if (cnt == 0) uae_reset(0); @@ -471,19 +474,21 @@ static addrbank hrtmem3_bank = { hrtmem3_xlate, hrtmem3_check, NULL, "Cartridge Bank 3", hrtmem3_lget, hrtmem3_wget, ABFLAG_RAM }; -static void copyfromamiga(uae_u8 *dst,uaecptr src,int len) + +static void copyfromamiga (uae_u8 *dst, uaecptr src, int len) { -while(len--) { - *dst++ = get_byte (src); - src++; -} + while (len--) { + *dst++ = get_byte (src); + src++; + } } -static void copytoamiga(uaecptr dst,uae_u8 *src,int len) + +static void copytoamiga (uaecptr dst, uae_u8 *src, int len) { -while(len--) { - put_byte (dst, *src++); - dst++; -} + while (len--) { + put_byte (dst, *src++); + dst++; + } } int action_replay_flag = ACTION_REPLAY_INACTIVE; @@ -504,14 +509,14 @@ uaecptr wait_for_pc = 0; /* The program counter that we wait for. */ /* returns true if the Program counter is currently in the AR rom. */ int is_ar_pc_in_rom() { - uaecptr pc = m68k_getpc(®s) & 0xFFFFFF; + uaecptr pc = m68k_getpc (®s) & 0xFFFFFF; return pc >= arrom_start && pc < arrom_start+arrom_size; } /* returns true if the Program counter is currently in the AR RAM. */ int is_ar_pc_in_ram() { - uaecptr pc = m68k_getpc(®s) & 0xFFFFFF; + uaecptr pc = m68k_getpc (®s) & 0xFFFFFF; return pc >= arram_start && pc < arram_start+arram_size; } @@ -520,40 +525,37 @@ int is_ar_pc_in_ram() STATIC_INLINE int ar3a (uaecptr addr, uae_u8 b, int writing) { uaecptr pc; -/* if ( addr < 8 ) //|| writing ) */ +/* if (addr < 8) //|| writing ) */ /* { */ -/* if ( writing ) */ -/* write_log_debug("ARSTATUS armode:%d, Writing %d to address %p, PC=%p\n", armode, b, addr, m68k_getpc()); */ +/* if (writing) */ +/* write_log_debug("ARSTATUS armode:%d, Writing %d to address %p, PC=%p\n", armode, b, addr, m68k_getpc ()); */ /* else */ -/* write_log_debug("ARSTATUS armode:%d, Reading %d from address %p, PC=%p\n", armode, armemory_rom[addr], addr, m68k_getpc()); */ +/* write_log_debug("ARSTATUS armode:%d, Reading %d from address %p, PC=%p\n", armode, armemory_rom[addr], addr, m68k_getpc ()); */ /* } */ if (armodel == 1) /* With AR1. It is always a read. Actually, it is a strobe on exit of the AR. * but, it is also read during the checksum routine. */ { - if (addr < 2) - { - if (is_ar_pc_in_rom()) - { - if (ar_wait_pop) - { + if (addr < 2) { + if (is_ar_pc_in_rom()) { + if (ar_wait_pop) { action_replay_flag = ACTION_REPLAY_WAIT_PC; -/* write_log_debug("SP %p\n", m68k_areg(regs,7)); */ -/* write_log_debug("SP+2 %p\n", m68k_areg(regs,7)+2 ); */ -/* write_log_debug("(SP+2) %p\n", longget(m68k_areg(regs,7)+2)); */ +/* write_log_debug ("SP %p\n", m68k_areg (regs, 7)); */ +/* write_log_debug ("SP+2 %p\n", m68k_areg (regs, 7) + 2); */ +/* write_log_debug ("(SP+2) %p\n", longget (m68k_areg (regs, 7) + 2)); */ ar_wait_pop = 0; /* We get (SP+2) here, as the first word on the stack is the status register. */ /* We want the following long, which is the return program counter. */ - wait_for_pc = longget(m68k_areg(®s,7)+2); /* Get (SP+2) */ + wait_for_pc = longget (m68k_areg (®s, 7) + 2); /* Get (SP+2) */ set_special (®s, SPCFLAG_ACTION_REPLAY); - pc = m68k_getpc(®s); -/* write_log_debug("Action Replay marked as ACTION_REPLAY_WAIT_PC, PC=%p\n",pc);*/ + pc = m68k_getpc (®s); +/* write_log_debug ("Action Replay marked as ACTION_REPLAY_WAIT_PC, PC=%p\n",pc);*/ } else { - uaecptr pc = m68k_getpc(®s); -/* write_log_debug("Action Replay marked as IDLE, PC=%p\n",pc);*/ + uaecptr pc = m68k_getpc (®s); +/* write_log_debug ("Action Replay marked as IDLE, PC=%p\n",pc);*/ action_replay_flag = ACTION_REPLAY_IDLE; } } @@ -582,23 +584,16 @@ STATIC_INLINE int ar3a (uaecptr addr, uae_u8 b, int writing) /* else, we are writing */ else if (addr == 1) { armode = b; - if(armode >= 2) - { - if ( armode == ARMODE_BREAKPOINT_AR2 ) - { - write_log("AR2: exit with breakpoint(s) active\n"); /* Correct for AR2 */ - } - else if ( armode == ARMODE_BREAKPOINT_AR3_RESET_AR2 ) - { - write_log("AR3: exit waiting for breakpoint.\n"); /* Correct for AR3 (waiting for breakpoint)*/ - } + if (armode >= 2) { + if (armode == ARMODE_BREAKPOINT_AR2) { + write_log ("AR2: exit with breakpoint(s) active\n"); /* Correct for AR2 */ + } else if (armode == ARMODE_BREAKPOINT_AR3_RESET_AR2 ) + write_log ("AR3: exit waiting for breakpoint.\n"); /* Correct for AR3 (waiting for breakpoint)*/ else - { - write_log("AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); - } - } else { - write_log("AR: exit with armode(%d)\n", armode); - } + write_log ("AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); + } else + write_log ("AR: exit with armode(%d)\n", armode); + set_special (®s, SPCFLAG_ACTION_REPLAY); action_replay_flag = ACTION_REPLAY_HIDE; } else if (addr == 6) { @@ -677,7 +672,7 @@ static void REGPARAM3 arrom_wput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 arrom_bput (uaecptr, uae_u32) REGPARAM; static int REGPARAM3 arrom_check (uaecptr addr, uae_u32 size) REGPARAM; static uae_u8 *REGPARAM3 arrom_xlate (uaecptr addr) REGPARAM; -static void action_replay_unmap_banks(void); +static void action_replay_unmap_banks (void); static uae_u32 action_replay_calculate_checksum(void); static uae_u8* get_checksum_location(void); @@ -692,20 +687,20 @@ static uae_u32 REGPARAM2 arram_lget (uaecptr addr) addr -= arram_start; addr &= arram_mask; m = (uae_u32 *)(armemory_ram + addr); - if (strncmp("T8", (char*)m, 2) == 0) - write_log_debug("Reading T8 from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("LAME", (char*)m, 4) == 0) - write_log_debug("Reading LAME from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("RES1", (char*)m, 4) == 0) - write_log_debug("Reading RES1 from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("ARON", (char*)m, 4) == 0) - write_log_debug("Reading ARON from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("KILL", (char*)m, 4) == 0) - write_log_debug("Reading KILL from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("BRON", (char*)m, 4) == 0) - write_log_debug("Reading BRON from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("PRIN", (char*)m, 4) == 0) - write_log_debug("Reading PRIN from addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); + if (strncmp ("T8", (char*)m, 2) == 0) + write_log_debug ("Reading T8 from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("LAME", (char*)m, 4) == 0) + write_log_debug ("Reading LAME from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("RES1", (char*)m, 4) == 0) + write_log_debug ("Reading RES1 from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("ARON", (char*)m, 4) == 0) + write_log_debug ("Reading ARON from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("KILL", (char*)m, 4) == 0) + write_log_debug ("Reading KILL from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("BRON", (char*)m, 4) == 0) + write_log_debug ("Reading BRON from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("PRIN", (char*)m, 4) == 0) + write_log_debug ("Reading PRIN from addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); return do_get_mem_long (m); } @@ -741,20 +736,20 @@ void REGPARAM2 arram_lput (uaecptr addr, uae_u32 l) addr -= arram_start; addr &= arram_mask; m = (uae_u32 *)(armemory_ram + addr); - if (strncmp("T8", (char*)m, 2) == 0) - write_log_debug("Writing T8 to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("LAME", (char*)m, 4) == 0) - write_log_debug("Writing LAME to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("RES1", (char*)m, 4) == 0) - write_log_debug("Writing RES1 to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("ARON", (char*)m, 4) == 0) - write_log_debug("Writing ARON to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("KILL", (char*)m, 4) == 0) - write_log_debug("Writing KILL to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("BRON", (char*)m, 4) == 0) - write_log_debug("Writing BRON to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); - if (strncmp("PRIN", (char*)m, 4) == 0) - write_log_debug("Writing PRIN to addr %08.08x PC=%p\n", addr, m68k_getpc(®s)); + if (strncmp ("T8", (char*)m, 2) == 0) + write_log_debug ("Writing T8 to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("LAME", (char*)m, 4) == 0) + write_log_debug ("Writing LAME to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("RES1", (char*)m, 4) == 0) + write_log_debug ("Writing RES1 to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("ARON", (char*)m, 4) == 0) + write_log_debug ("Writing ARON to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("KILL", (char*)m, 4) == 0) + write_log_debug ("Writing KILL to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("BRON", (char*)m, 4) == 0) + write_log_debug ("Writing BRON to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); + if (strncmp ("PRIN", (char*)m, 4) == 0) + write_log_debug ("Writing PRIN to addr %08.08x PC=%p\n", addr, m68k_getpc (®s)); do_put_mem_long (m, l); } @@ -886,19 +881,19 @@ static addrbank arram_bank = { arram_lget, arram_wget, ABFLAG_RAM }; -static void action_replay_unmap_banks() +static void action_replay_unmap_banks () { if(!armemory_rom) return; if (armodel == 1) { - action_replay_map_banks(); + action_replay_map_banks (); return; } map_banks (&dummy_bank, arrom_start >> 16 , arrom_size >> 16, 0); map_banks (&dummy_bank, arram_start >> 16 , arram_size >> 16, 0); } -static void action_replay_map_banks() +static void action_replay_map_banks () { if(!armemory_rom) return; @@ -910,9 +905,9 @@ static void hide_cart(int hide) { #ifdef ACTION_REPLAY_HIDE_CARTRIDGE if(hide) { - action_replay_unmap_banks(); + action_replay_unmap_banks (); } else { - action_replay_map_banks(); + action_replay_map_banks (); } #endif } @@ -932,7 +927,7 @@ static void action_replay_go (void) action_replay_flag = ACTION_REPLAY_ACTIVE; set_special (®s, SPCFLAG_ACTION_REPLAY); copyfromamiga (artemp, regs.vbr + 0x7c, 4); - copytoamiga (regs.vbr+0x7c, armemory_rom + 0x7c, 4); + copytoamiga (regs.vbr + 0x7c, armemory_rom + 0x7c, 4); NMI (); } @@ -982,7 +977,7 @@ static void hrtmon_go (void) { uaecptr old; int i; - + triggered_once = 1; cartridge_enter(); hrtmon_flag = ACTION_REPLAY_ACTIVE; @@ -998,7 +993,7 @@ static void hrtmon_go (void) hrtmon_ciab[i * hrtmon_ciadiv + 0] = ar_ciab[i]; } if (cart_type == CART_AR1200) { - old = get_long((uaecptr)(regs.vbr + 0x8)); + old = get_long ((uaecptr)(regs.vbr + 0x8)); put_word (hrtmem_start + 0xc0000, 4); put_long ((uaecptr)(regs.vbr + 8), get_long (hrtmem_start + 8)); Exception (2, ®s, 0); @@ -1006,13 +1001,13 @@ static void hrtmon_go (void) } else if (cart_type == CART_SUPER4) { uae_u32 v = get_long (hrtmem_start + 0x7c); if (v) { - old = get_long((uaecptr)(regs.vbr + 0x7c)); + old = get_long ((uaecptr)(regs.vbr + 0x7c)); put_long ((uaecptr)(regs.vbr + 0x7c), v); NMI (); put_long ((uaecptr)(regs.vbr + 0x7c), old); } } else { - old = get_long((uaecptr)(regs.vbr + 0x7c)); + old = get_long ((uaecptr)(regs.vbr + 0x7c)); put_long ((uaecptr)(regs.vbr + 0x7c), hrtmem_start + 12 + 2 + get_word (hrtmem_start + 14)); NMI (); //put_long ((uaecptr)(regs.vbr + 0x7c), old); @@ -1022,7 +1017,7 @@ static void hrtmon_go (void) void cartridge_init (void) { if (hrtmemory && cart_type != CART_AR1200) { - hrtmon_map_banks (); + hrtmon_map_banks (); put_long ((uaecptr)(regs.vbr + 0x7c), hrtmem_start + 12 + 2 + get_word (hrtmem_start + 14)); } } @@ -1032,7 +1027,7 @@ void hrtmon_enter (void) if (!hrtmemory) return; hrtmon_map_banks (); - write_log("%s: freeze\n", cart_memnames[cart_type]); + write_log ("%s: freeze\n", cart_memnames[cart_type]); hrtmon_go(); } @@ -1042,32 +1037,23 @@ void action_replay_enter(void) return; triggered_once = 1; if (armodel == 1) { - write_log("AR1: Enter PC:%p\n", m68k_getpc(®s)); + write_log ("AR1: Enter PC:%p\n", m68k_getpc (®s)); action_replay_go1 (7); unset_special (®s, SPCFLAG_ACTION_REPLAY); return; } if (action_replay_flag == ACTION_REPLAY_DORESET) { - write_log("AR2/3: reset\n"); + write_log ("AR2/3: reset\n"); armode = ARMODE_BREAKPOINT_AR3_RESET_AR2; - } - else if (armode == ARMODE_FREEZE) { - write_log("AR2/3: activated (freeze)\n"); - } - else if (armode >= 2) - { - if ( armode == ARMODE_BREAKPOINT_AR2 ) - { - write_log("AR2: activated (breakpoint)\n"); - } - else if ( armode == ARMODE_BREAKPOINT_AR3_RESET_AR2 ) - { - write_log("AR3: activated (breakpoint)\n"); - } + } else if (armode == ARMODE_FREEZE) { + write_log ("AR2/3: activated (freeze)\n"); + } else if (armode >= 2) { + if (armode == ARMODE_BREAKPOINT_AR2) + write_log ("AR2: activated (breakpoint)\n"); + else if (armode == ARMODE_BREAKPOINT_AR3_RESET_AR2) + write_log ("AR3: activated (breakpoint)\n"); else - { - write_log("AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); - } + write_log ("AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); armode = ARMODE_BREAKPOINT_ACTIVATED; } action_replay_go(); @@ -1078,15 +1064,15 @@ void check_prefs_changed_carts(int in_memory_reset) if (currprefs.cart_internal != changed_prefs.cart_internal) currprefs.cart_internal = changed_prefs.cart_internal; if (strcmp (currprefs.cartfile, changed_prefs.cartfile) != 0) { - write_log("Cartridge ROM Prefs changed.\n"); - if (action_replay_unload(in_memory_reset)) { + write_log ("Cartridge ROM Prefs changed.\n"); + if (action_replay_unload (in_memory_reset)) { memcpy (currprefs.cartfile, changed_prefs.cartfile, sizeof currprefs.cartfile); #ifdef ACTION_REPLAY - action_replay_load(); + action_replay_load (); action_replay_init(1); #endif #ifdef ACTION_REPLAY_HRTMON - hrtmon_load(); + hrtmon_load (); #endif } } @@ -1096,17 +1082,17 @@ void action_replay_reset(void) { if (hrtmemory) { if (savestate_state == STATE_RESTORE) { - if (m68k_getpc(®s) >= hrtmem_start && m68k_getpc(®s) <= hrtmem_start + hrtmem_size) - hrtmon_map_banks(); + if (m68k_getpc (®s) >= hrtmem_start && m68k_getpc (®s) <= hrtmem_start + hrtmem_size) + hrtmon_map_banks (); else - hrtmon_unmap_banks(); + hrtmon_unmap_banks (); } } else { if (action_replay_flag == ACTION_REPLAY_INACTIVE) return; if (savestate_state == STATE_RESTORE) { - if (m68k_getpc(®s) >= arrom_start && m68k_getpc(®s) <= arrom_start + arrom_size) { + if (m68k_getpc (®s) >= arrom_start && m68k_getpc (®s) <= arrom_start + arrom_size) { action_replay_flag = ACTION_REPLAY_ACTIVE; hide_cart (0); } else { @@ -1115,12 +1101,12 @@ void action_replay_reset(void) } return; } - if (armodel == 1) { + if (armodel == 1) { /* We need to mark it as active here, because the kickstart rom jumps directly into it. */ action_replay_flag = ACTION_REPLAY_ACTIVE; } else { - write_log_debug("Setting flag to ACTION_REPLAY_WAITRESET\n"); - write_log_debug("armode == %d\n", armode); + write_log_debug ("Setting flag to ACTION_REPLAY_WAITRESET\n"); + write_log_debug ("armode == %d\n", armode); action_replay_flag = ACTION_REPLAY_WAITRESET; } } @@ -1134,9 +1120,10 @@ void action_replay_ciaread(void) return; if (action_replay_flag == ACTION_REPLAY_INACTIVE) return; - if (armode < 2) /* If there are no active breakpoints*/ + if (armode < 2) + /* If there are no active breakpoints */ return; - if (m68k_getpc(®s) >= 0x200) + if (m68k_getpc (®s) >= 0x200) return; action_replay_flag = ACTION_REPLAY_ACTIVATE; set_special (®s, SPCFLAG_ACTION_REPLAY); @@ -1144,7 +1131,7 @@ void action_replay_ciaread(void) int action_replay_freeze(void) { - if(action_replay_flag == ACTION_REPLAY_IDLE) { + if (action_replay_flag == ACTION_REPLAY_IDLE) { if (armodel == 1) { action_replay_chipwrite(); } else { @@ -1268,17 +1255,17 @@ static uae_u32 action_replay_calculate_checksum(void) * 2.14 0xad839d36 * 2.14 0xad839d36 * 1.15 0xee12116 - */ + */ if (!armemory_rom) - return 0; /* If there is no rom then i guess the checksum is ok */ + return 0; /* If there is no rom then i guess the checksum is ok */ checksum_start = (uae_u32*)&armemory_rom[checksum_start_offset[armodel]]; checksum_end = (uae_u32*)&armemory_rom[ar_rom_file_size]; /* Search for first non-zero Long starting from the end of the rom. */ /* Assume long alignment, (will always be true for AR2 and AR3 and the AR1 rom i've got). */ - /* If anyone finds an AR1 rom with a word-aligned checksum, then this code will have to be modified. */ + /* If anyone finds an AR1 rom with a word-aligned checksum, then this code will have to be modified. */ while (! *(--checksum_end)); if (armodel == 1) @@ -1306,7 +1293,7 @@ static uae_u32 action_replay_calculate_checksum(void) } } - stored_checksum = do_get_mem_long(checksum_end); + stored_checksum = do_get_mem_long (checksum_end); return checksum == stored_checksum ? 0 : checksum; } @@ -1331,18 +1318,14 @@ static uae_u8* get_checksum_location() /* Replaces the existing cart checksum with a correct one. */ -/* Useful if you want to patch the rom.*/ +/* Useful if you want to patch the rom. */ static void action_replay_fixup_checksum(uae_u32 new_checksum) { uae_u32* checksum = (uae_u32*)get_checksum_location(); if (checksum) - { - do_put_mem_long(checksum, new_checksum); - } + do_put_mem_long (checksum, new_checksum); else - { - write_log("Unable to locate Checksum in ROM.\n"); - } + write_log ("Unable to locate Checksum in ROM.\n"); return; } @@ -1350,12 +1333,12 @@ static void action_replay_fixup_checksum(uae_u32 new_checksum) * the search_value is assumed to already be in the local endian format * return 0 on failure */ -static uae_u8* find_absolute_long(uae_u8* start_addr, uae_u8* end_addr, uae_u32 search_value) +static uae_u8* find_absolute_long (uae_u8* start_addr, uae_u8* end_addr, uae_u32 search_value) { uae_u8* addr; for (addr = start_addr; addr < end_addr;) { - if (do_get_mem_long((uae_u32*)addr) == search_value) { + if (do_get_mem_long ((uae_u32*)addr) == search_value) { /* write_log_debug("Found %p at offset %p.\n", search_value, addr - start_addr);*/ return addr; } @@ -1397,17 +1380,17 @@ static void disable_rom_test(void) uae_u8* start_addr = armemory_rom; uae_u8* end_addr = get_checksum_location(); -/* - * To see what the routine below is doing. Here is some code from the Action replay rom where it does the - * checksum test. - * AR1: - * F0D4D0 6100 ???? bsr.w calc_checksum ; calculate the checksum - * F0D4D4 41FA 147A lea (0xf0e950,PC),a0 ; load the existing checksum. - * ; do a comparison. - * AR2: - * 40EC92 6100 ???? bsr.w calc_checksum - * 40EC96 41F9 0041 FFFC lea (0x41fffc),a0 - */ + /* + * To see what the routine below is doing. Here is some code from the Action replay rom where it does the + * checksum test. + * AR1: + * F0D4D0 6100 ???? bsr.w calc_checksum ; calculate the checksum + * F0D4D4 41FA 147A lea (0xf0e950,PC),a0 ; load the existing checksum. + * ; do a comparison. + * AR2: + * 40EC92 6100 ???? bsr.w calc_checksum + * 40EC96 41F9 0041 FFFC lea (0x41fffc),a0 + */ if (armodel == 1) { uae_u16 search_value_rel = end_addr - start_addr; @@ -1415,21 +1398,21 @@ static void disable_rom_test(void) if (addr) { if (do_get_mem_word((uae_u16*)(addr-6)) == 0x6100 && /* bsr.w */ - do_get_mem_word((uae_u16*)(addr-2)) == 0x41fa) /* lea relative */ + do_get_mem_word((uae_u16*)(addr-2)) == 0x41fa) /* lea relative */ { - write_log("Patching to disable ROM TEST.\n"); + write_log ("Patching to disable ROM TEST.\n"); do_put_mem_word((uae_u16*)(addr-6), 0x4e75); /* rts */ } } } else { uae_u32 search_value_abs = arrom_start + end_addr - start_addr; - addr = find_absolute_long(start_addr, end_addr, search_value_abs); + addr = find_absolute_long (start_addr, end_addr, search_value_abs); if (addr) { if (do_get_mem_word((uae_u16*)(addr-6)) == 0x6100 && /* bsr.w */ do_get_mem_word((uae_u16*)(addr-2)) == 0x41f9) /* lea absolute */ { - write_log("Patching to disable ROM TEST.\n"); + write_log ("Patching to disable ROM TEST.\n"); do_put_mem_word((uae_u16*)(addr-6), 0x4e75); /* rts */ } } @@ -1447,9 +1430,9 @@ static void action_replay_checksum_info(void) if (!armemory_rom) return; if (action_replay_calculate_checksum() == 0) - write_log("Action Replay Checksum is OK.\n"); + write_log ("Action Replay Checksum is OK.\n"); else - write_log("Action Replay Checksum is INVALID.\n"); + write_log ("Action Replay Checksum is INVALID.\n"); disable_rom_test(); } @@ -1458,21 +1441,20 @@ static void action_replay_checksum_info(void) static void action_replay_setbanks (void) { if (!savestate_state && chipmem_bank.lput == chipmem_lput) { - switch (armodel) - { - case 2: - case 3: + switch (armodel) { + case 2: + case 3: if (currprefs.cpu_cycle_exact) chipmem_bank.wput = chipmem_wput_actionreplay23; chipmem_bank.lput = chipmem_lput_actionreplay23; break; - case 1: + case 1: chipmem_bank.bput = chipmem_bput_actionreplay1; chipmem_bank.wput = chipmem_wput_actionreplay1; chipmem_bank.lput = chipmem_lput_actionreplay1; break; } - } + } } static void action_replay_unsetbanks (void) @@ -1483,11 +1465,10 @@ static void action_replay_unsetbanks (void) } /* param to allow us to unload the cart. Currently we know it is safe if we are doing a reset to unload it.*/ -int action_replay_unload(int in_memory_reset) +int action_replay_unload (int in_memory_reset) { - char* state[] = - { - "ACTION_REPLAY_WAIT_PC", + static const char *state[] = { + "ACTION_REPLAY_WAIT_PC", "ACTION_REPLAY_INACTIVE", "ACTION_REPLAY_WAITRESET", "0", @@ -1499,31 +1480,31 @@ int action_replay_unload(int in_memory_reset) }; write_log_debug("Action Replay State:(%s)\nHrtmon State:(%s)\n", state[action_replay_flag+3],state[hrtmon_flag+3]); - + if (armemory_rom && armodel == 1) { if (is_ar_pc_in_ram() || is_ar_pc_in_rom() || action_replay_flag == ACTION_REPLAY_WAIT_PC) { - write_log("Can't Unload Action Replay 1. It is Active.\n"); + write_log ("Can't Unload Action Replay 1. It is Active.\n"); return 0; } } else { - if (action_replay_flag != ACTION_REPLAY_IDLE && action_replay_flag != ACTION_REPLAY_INACTIVE) { - write_log("Can't Unload Action Replay. It is Active.\n"); + if (action_replay_flag != ACTION_REPLAY_IDLE && action_replay_flag != ACTION_REPLAY_INACTIVE) { + write_log ("Can't Unload Action Replay. It is Active.\n"); return 0; /* Don't unload it whilst it's active, or it will crash the amiga if not the emulator */ } if (hrtmon_flag != ACTION_REPLAY_IDLE && hrtmon_flag != ACTION_REPLAY_INACTIVE) { - write_log("Can't Unload Hrtmon. It is Active.\n"); + write_log ("Can't Unload Hrtmon. It is Active.\n"); return 0; /* Don't unload it whilst it's active, or it will crash the amiga if not the emulator */ } } - unset_special(®s, SPCFLAG_ACTION_REPLAY); /* This shouldn't be necessary here, but just in case. */ + unset_special (®s, SPCFLAG_ACTION_REPLAY); /* This shouldn't be necessary here, but just in case. */ action_replay_flag = ACTION_REPLAY_INACTIVE; hrtmon_flag = ACTION_REPLAY_INACTIVE; - action_replay_unsetbanks(); - action_replay_unmap_banks(); - hrtmon_unmap_banks(); + action_replay_unsetbanks (); + action_replay_unmap_banks (); + hrtmon_unmap_banks (); /* Make sure you unmap everything before you call action_replay_cleanup() */ - action_replay_cleanup(); + action_replay_cleanup (); return 1; } @@ -1582,7 +1563,7 @@ static int superiv_init(struct romdata *rd, struct zfile *f) } if (hrtmem3_size) { hrtmemory3 = mapped_malloc (hrtmem3_size, cart_memnames3[cart_type]); - memset(hrtmemory3, 0, hrtmem3_size); + memset(hrtmemory3, 0, hrtmem3_size); } hrtmem3_bank.baseaddr = hrtmemory3; hrtmem2_bank.baseaddr = hrtmemory2; @@ -1616,11 +1597,11 @@ static int superiv_init(struct romdata *rd, struct zfile *f) } hrtmon_flag = ACTION_REPLAY_IDLE; - write_log("%s installed at %08.8X\n", cart_memnames[cart_type], hrtmem_start); + write_log ("%s installed at %08.8X\n", cart_memnames[cart_type], hrtmem_start); return 1; } -int action_replay_load(void) +int action_replay_load (void) { struct zfile *f; uae_u8 header[8]; @@ -1628,10 +1609,10 @@ int action_replay_load(void) armodel = 0; action_replay_flag = ACTION_REPLAY_INACTIVE; - write_log_debug("Entered action_replay_load()\n"); - /* Don't load a rom if one is already loaded. Use action_replay_unload() first. */ + write_log_debug("Entered action_replay_load ()\n"); + /* Don't load a rom if one is already loaded. Use action_replay_unload () first. */ if (armemory_rom || hrtmemory) { - write_log("action_replay_load() ROM already loaded.\n"); + write_log ("action_replay_load () ROM already loaded.\n"); return 0; } @@ -1642,12 +1623,12 @@ int action_replay_load(void) return superiv_init(rd, NULL); f = zfile_fopen(currprefs.cartfile, "rb"); if (!f) { - write_log("failed to load '%s' cartridge ROM\n", currprefs.cartfile); + write_log ("failed to load '%s' cartridge ROM\n", currprefs.cartfile); return 0; } rd = getromdatabyzfile(f); if (!rd) { - write_log("Unknown cartridge ROM\n"); + write_log ("Unknown cartridge ROM\n"); } else { if (rd->type & (ROMTYPE_SUPERIV | ROMTYPE_NORDIC | ROMTYPE_XPOWER)) { return superiv_init(rd, f); @@ -1663,7 +1644,7 @@ int action_replay_load(void) return 0; } if (ar_rom_file_size != 65536 && ar_rom_file_size != 131072 && ar_rom_file_size != 262144) { - write_log("rom size must be 64KB (AR1), 128KB (AR2) or 256KB (AR3)\n"); + write_log ("rom size must be 64KB (AR1), 128KB (AR2) or 256KB (AR3)\n"); zfile_fclose(f); return 0; } @@ -1688,13 +1669,13 @@ int action_replay_load(void) arram_mask = arram_size - 1; arrom_mask = arrom_size - 1; armemory_ram = (uae_u8*)xcalloc (arram_size, 1); - write_log("Action Replay %d installed at %08.8X, size %08.8X\n", armodel, arrom_start, arrom_size); + write_log ("Action Replay %d installed at %08.8X, size %08.8X\n", armodel, arrom_start, arrom_size); action_replay_setbanks (); action_replay_version(); return armodel; } -void action_replay_init (int activate) +void action_replay_init (int activate) { if (!armemory_rom) return; @@ -1765,20 +1746,20 @@ static void hrtmon_configure(void) cfg->hexmode = TRUE; cfg->entered = 0; cfg->keyboard = hrtmon_lang; - do_put_mem_long(&cfg->max_chip, currprefs.chipmem_size); - do_put_mem_long(&cfg->mon_size, 0x800000); + do_put_mem_long (&cfg->max_chip, currprefs.chipmem_size); + do_put_mem_long (&cfg->mon_size, 0x800000); cfg->ide = currprefs.cs_ide ? 1 : 0; cfg->a1200 = currprefs.cs_ide == 1 ? 1 : 0; /* type of IDE interface, not Amiga model */ } -int hrtmon_load(void) +int hrtmon_load (void) { struct zfile *f; uae_u32 header[4]; struct romdata *rd; int isinternal = 0; - /* Don't load a rom if one is already loaded. Use action_replay_unload() first. */ + /* Don't load a rom if one is already loaded. Use action_replay_unload () first. */ if (armemory_rom) return 0; if (hrtmemory) @@ -1796,7 +1777,7 @@ int hrtmon_load(void) return 0; f = zfile_fopen(currprefs.cartfile,"rb"); if(!f) { - write_log("failed to load '%s' cartridge ROM\n", currprefs.cartfile); + write_log ("failed to load '%s' cartridge ROM\n", currprefs.cartfile); return 0; } zfile_fread(header, sizeof header, 1, f); @@ -1820,7 +1801,7 @@ int hrtmon_load(void) #else return 0; #endif - cart_type = CART_HRTMON; + cart_type = CART_HRTMON; } hrtmemory = mapped_malloc (hrtmem_size, cart_memnames[cart_type]); memset (hrtmemory, 0xff, 0x80000); @@ -1839,15 +1820,15 @@ int hrtmon_load(void) } hrtmem_bank.baseaddr = hrtmemory; hrtmon_flag = ACTION_REPLAY_IDLE; - write_log("%s installed at %08.8X\n", cart_memnames[cart_type], hrtmem_start); + write_log ("%s installed at %08.8X\n", cart_memnames[cart_type], hrtmem_start); return 1; } -void hrtmon_map_banks() +void hrtmon_map_banks () { uaecptr addr; - if(!hrtmemory) + if (!hrtmemory) return; addr = hrtmem_start; @@ -1870,11 +1851,11 @@ void hrtmon_map_banks() map_banks (&hrtmem3_bank, hrtmem3_start >> 16, hrtmem3_size >> 16, 0); } -static void hrtmon_unmap_banks() +static void hrtmon_unmap_banks () { uaecptr addr; - if(!hrtmemory) + if (!hrtmemory) return; addr = hrtmem_start; @@ -1923,45 +1904,38 @@ void action_replay_version(void) memcpy(arVersionString, armemory_rom+AR_VER_STR_OFFSET, AR_VER_STR_LEN); arVersionString[AR_VER_STR_LEN]= '\0'; tmp = strchr(arVersionString, 0x0d); - if ( tmp ) - { + if (tmp) { *tmp = '\0'; } /* write_log_debug("Version string is : '%s'\n", arVersionString); */ tmp = strchr(arVersionString,')'); - if ( tmp ) - { + if (tmp) { *tmp = '\0'; tmp = strchr(arVersionString, '('); - if ( tmp ) - { - if ( *(tmp + 1 ) == 'V' ) - { + if (tmp) { + if (*(tmp + 1) == 'V') { pNext = tmp + 2; tmp = strchr(pNext, '.'); - if ( tmp ) - { + if (tmp) { *tmp = '\0'; iArVersionMajor = atoi(pNext); pNext = tmp+1; tmp = strchr(pNext, ' '); - if ( tmp ) - { + if (tmp) { *tmp = '\0'; iArVersionMinor = atoi(pNext); } pNext = tmp+1; - strcpy(sArDate, pNext); + strcpy (sArDate, pNext); } } } } - if (iArVersionMajor > 0) - { - write_log("Version of cart is '%d.%.02d', date is '%s'\n", iArVersionMajor, iArVersionMinor, sArDate); + if (iArVersionMajor > 0) { + write_log ("Version of cart is '%d.%.02d', date is '%s'\n", iArVersionMajor, iArVersionMinor, sArDate); } } @@ -1970,28 +1944,28 @@ void action_replay_memory_reset(void) { #ifdef ACTION_REPLAY if (armemory_rom) { - action_replay_hide(); + action_replay_hide (); } #endif #ifdef ACTION_REPLAY_HRTMON if (hrtmemory) { - hrtmon_hide(); /* It is never really idle */ - hrtmon_flag = ACTION_REPLAY_IDLE; + hrtmon_hide (); /* It is never really idle */ + hrtmon_flag = ACTION_REPLAY_IDLE; if (cart_type == CART_SUPER4) - hrtmon_map_banks(); + hrtmon_map_banks (); } #endif #ifdef ACTION_REPLAY_COMMON - check_prefs_changed_carts(1); + check_prefs_changed_carts (1); #endif - action_replay_patch(); - action_replay_checksum_info(); - hrtmon_configure(); + action_replay_patch (); + action_replay_checksum_info (); + hrtmon_configure (); } uae_u8 *save_hrtmon (int *len, uae_u8 *dstptr) { - uae_u8 *dstbak,*dst; + uae_u8 *dstbak, *dst; if (!hrtmemory) return 0; @@ -2005,11 +1979,11 @@ uae_u8 *save_hrtmon (int *len, uae_u8 *dstptr) save_u8 (0); save_u32 (0); strcpy (dst, currprefs.cartfile); - dst += strlen(dst) + 1; + dst += strlen (dst) + 1; save_u32 (0); if (!hrtmem_rom) { save_u32 (hrtmem_size); - memcpy (dst, hrtmemory, hrtmem_size); + memcpy (dst, hrtmemory, hrtmem_size); dst += hrtmem_size; } else if (hrtmem2_size) { save_u32 (hrtmem2_size); @@ -2041,12 +2015,12 @@ uae_u8 *restore_hrtmon (uae_u8 *src) restore_u32 (); strncpy (changed_prefs.cartfile, src, 255); strcpy (currprefs.cartfile, changed_prefs.cartfile); - src += strlen(src) + 1; + src += strlen (src) + 1; hrtmon_load (); action_replay_load (); - if (restore_u32() != 0) + if (restore_u32 () != 0) return src; - size = restore_u32(); + size = restore_u32 (); if (!hrtmem_rom) { if (hrtmemory) memcpy (hrtmemory, src, size); @@ -2055,13 +2029,13 @@ uae_u8 *restore_hrtmon (uae_u8 *src) memcpy (hrtmemory2, src, size); } src += size; - restore_u32(); + restore_u32 (); memcpy (ar_custom, src, sizeof ar_custom); src += sizeof ar_custom; - restore_u32(); + restore_u32 (); memcpy (ar_ciaa, src, sizeof ar_ciaa); src += sizeof ar_ciaa; - restore_u32(); + restore_u32 (); memcpy (ar_ciab, src, sizeof ar_ciab); src += sizeof ar_ciab; return src; @@ -2069,7 +2043,7 @@ uae_u8 *restore_hrtmon (uae_u8 *src) uae_u8 *save_action_replay (int *len, uae_u8 *dstptr) { - uae_u8 *dstbak,*dst; + uae_u8 *dstbak, *dst; if (!armemory_ram || !armemory_rom || !armodel) return 0; @@ -2081,7 +2055,7 @@ uae_u8 *save_action_replay (int *len, uae_u8 *dstptr) save_u8 (armodel); save_u32 (get_crc32 (armemory_rom + 4, arrom_size - 4)); strcpy (dst, currprefs.cartfile); - dst += strlen(dst) + 1; + dst += strlen (dst) + 1; save_u32 (arrom_size); save_u32 (arram_size); memcpy (dst, armemory_ram, arram_size); @@ -2111,21 +2085,21 @@ uae_u8 *restore_action_replay (uae_u8 *src) crc32 = restore_u32 (); strncpy (changed_prefs.cartfile, src, 255); strcpy (currprefs.cartfile, changed_prefs.cartfile); - src += strlen(src) + 1; + src += strlen (src) + 1; action_replay_load (); - if (restore_u32() != arrom_size) + if (restore_u32 () != arrom_size) return src; - if (restore_u32() != arram_size) + if (restore_u32 () != arram_size) return src; if (armemory_ram) memcpy (armemory_ram, src, arram_size); src += arram_size; - restore_u32(); + restore_u32 (); memcpy (ar_custom, src, sizeof ar_custom); src += sizeof ar_custom; - restore_u32(); + restore_u32 (); src += sizeof ar_ciaa; - restore_u32(); + restore_u32 (); src += sizeof ar_ciab; return src; } diff --git a/arcadia.c b/arcadia.c index 9d6af363..23d17e33 100755 --- a/arcadia.c +++ b/arcadia.c @@ -44,7 +44,7 @@ struct arcadiarom *arcadia_bios, *arcadia_game; #define BIOS_VERSION_211 2 #define BIOS_VERSION_300 3 - + static struct arcadiarom roms[] = { { 49, "ar_bios.zip", "scpa21", ARCADIA_BIOS, 0, 6, 1, 0, 2, 3, 4, 5, 7 }, @@ -218,7 +218,7 @@ static void decrypt_roms (struct arcadiarom *rom) for (i = start; i < end; i += 2) { arbmemory[i] = bswap (arbmemory[i], rom->b7,rom->b6,rom->b5,rom->b4,rom->b3,rom->b2,rom->b1,rom->b0); - if (rom->extra == 2) + if (rom->extra == 2) arbmemory[i - 1] = bswap (arbmemory[i - 1],7,6,5,4,3,2,1,0); } } @@ -457,16 +457,16 @@ struct romdata *scan_arcadia_rom (char *path, int cnt) arcadia_rom = is_arcadia(path, cnt); if (arcadia_rom) { - arc_rl = getarcadiaroms(); - for (i = 0; arc_rl[i]; i++) { + arc_rl = getarcadiaroms(); + for (i = 0; arc_rl[i]; i++) { if (arc_rl[i]->rd->id == arcadia_rom->romid) { - rd = arc_rl[i]->rd; + rd = arc_rl[i]->rd; strcat(path, "/"); strcat(path, arcadia_rom->rom); - break; - } - } - xfree(arc_rl); + break; + } + } + xfree(arc_rl); } return rd; } diff --git a/archivers/7z/7zBuffer.h b/archivers/7z/7zBuffer.h index 17e59060..1aab7fad 100755 --- a/archivers/7z/7zBuffer.h +++ b/archivers/7z/7zBuffer.h @@ -7,7 +7,7 @@ #include "7zTypes.h" typedef struct _CSzByteBuffer -{ +{ size_t Capacity; Byte *Items; }CSzByteBuffer; diff --git a/archivers/7z/7zCrc.c b/archivers/7z/7zCrc.c index 97738404..72da5302 100755 --- a/archivers/7z/7zCrc.c +++ b/archivers/7z/7zCrc.c @@ -14,16 +14,16 @@ void InitCrcTable() UInt32 r = i; int j; for (j = 0; j < 8; j++) - if (r & 1) - r = (r >> 1) ^ kCrcPoly; - else - r >>= 1; + if (r & 1) + r = (r >> 1) ^ kCrcPoly; + else + r >>= 1; g_CrcTable[i] = r; } } void CrcInit(UInt32 *crc) { *crc = 0xFFFFFFFF; } -UInt32 CrcGetDigest(UInt32 *crc) { return *crc ^ 0xFFFFFFFF; } +UInt32 CrcGetDigest(UInt32 *crc) { return *crc ^ 0xFFFFFFFF; } void CrcUpdateByte(UInt32 *crc, Byte b) { diff --git a/archivers/7z/7zCrc.h b/archivers/7z/7zCrc.h index adcc563a..0795bad0 100755 --- a/archivers/7z/7zCrc.h +++ b/archivers/7z/7zCrc.h @@ -17,7 +17,7 @@ void CrcUpdateUInt16(UInt32 *crc, UInt16 v); void CrcUpdateUInt32(UInt32 *crc, UInt32 v); void CrcUpdateUInt64(UInt32 *crc, UInt64 v); void CrcUpdate(UInt32 *crc, const void *data, size_t size); - + UInt32 CrcCalculateDigest(const void *data, size_t size); int CrcVerifyDigest(UInt32 digest, const void *data, size_t size); diff --git a/archivers/7z/7zDecode.c b/archivers/7z/7zDecode.c index 1e14acaa..186c9573 100755 --- a/archivers/7z/7zDecode.c +++ b/archivers/7z/7zDecode.c @@ -44,7 +44,7 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder, #else const Byte *inBuffer, #endif - Byte *outBuffer, size_t outSize, + Byte *outBuffer, size_t outSize, size_t *outSizeProcessed, ISzAlloc *allocMain) { UInt32 si; @@ -73,12 +73,12 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder, size_t bufferSize; RINOK(inStream->Read((void *)inStream, (void **)&inBuffer, inSize - i, &bufferSize)); if (bufferSize == 0) - return SZE_DATA_ERROR; + return SZE_DATA_ERROR; if (bufferSize > inSize - i) - return SZE_FAIL; + return SZE_FAIL; *outSizeProcessed += bufferSize; for (j = 0; j < bufferSize && i < inSize; j++, i++) - outBuffer[i] = inBuffer[j]; + outBuffer[i] = inBuffer[j]; } #else for (i = 0; i < inSize; i++) @@ -106,8 +106,8 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder, lzmaCallback.InCallback.Read = LzmaReadImp; #endif - if (LzmaDecodeProperties(&state.Properties, coder->Properties.Items, - coder->Properties.Capacity) != LZMA_RESULT_OK) + if (LzmaDecodeProperties(&state.Properties, coder->Properties.Items, + coder->Properties.Capacity) != LZMA_RESULT_OK) return SZE_FAIL; state.Probs = (CProb *)allocMain->Alloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb)); @@ -122,20 +122,20 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder, state.Dictionary = (unsigned char *)allocMain->Alloc(state.Properties.DictionarySize); if (state.Dictionary == 0) { - allocMain->Free(state.Probs); - return SZE_OUTOFMEMORY; + allocMain->Free(state.Probs); + return SZE_OUTOFMEMORY; } } LzmaDecoderInit(&state); #endif result = LzmaDecode(&state, - #ifdef _LZMA_IN_CB - &lzmaCallback.InCallback, - #else - inBuffer, (SizeT)inSize, &inProcessed, - #endif - outBuffer, (SizeT)outSize, &outSizeProcessedLoc); + #ifdef _LZMA_IN_CB + &lzmaCallback.InCallback, + #else + inBuffer, (SizeT)inSize, &inProcessed, + #endif + outBuffer, (SizeT)outSize, &outSizeProcessedLoc); *outSizeProcessed = (size_t)outSizeProcessedLoc; allocMain->Free(state.Probs); #ifdef _LZMA_OUT_READ diff --git a/archivers/7z/7zDecode.h b/archivers/7z/7zDecode.h index 74bb180f..b6252883 100755 --- a/archivers/7z/7zDecode.h +++ b/archivers/7z/7zDecode.h @@ -15,7 +15,7 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder, #else const Byte *inBuffer, #endif - Byte *outBuffer, size_t outSize, + Byte *outBuffer, size_t outSize, size_t *outSizeProcessed, ISzAlloc *allocMain); #endif diff --git a/archivers/7z/7zExtract.c b/archivers/7z/7zExtract.c index 6ef872c3..fda5074a 100755 --- a/archivers/7z/7zExtract.c +++ b/archivers/7z/7zExtract.c @@ -5,14 +5,14 @@ #include "7zCrc.h" SZ_RESULT SzExtract( - ISzInStream *inStream, + ISzInStream *inStream, CArchiveDatabaseEx *db, UInt32 fileIndex, UInt32 *blockIndex, - Byte **outBuffer, + Byte **outBuffer, size_t *outBufferSize, - size_t *offset, - size_t *outSizeProcessed, + size_t *offset, + size_t *outSizeProcessed, ISzAlloc *allocMain, ISzAlloc *allocTemp) { @@ -41,15 +41,15 @@ SZ_RESULT SzExtract( *blockIndex = folderIndex; allocMain->Free(*outBuffer); *outBuffer = 0; - + RINOK(inStream->Seek(inStream, SzArDbGetFolderStreamPos(db, folderIndex, 0))); - + #ifndef _LZMA_IN_CB if (packSize != 0) { inBuffer = (Byte *)allocTemp->Alloc((size_t)packSize); if (inBuffer == 0) - return SZE_OUTOFMEMORY; + return SZE_OUTOFMEMORY; } res = inStream->Read(inStream, inBuffer, (size_t)packSize, &processedSize); if (res == SZ_OK && processedSize != (size_t)packSize) @@ -60,34 +60,34 @@ SZ_RESULT SzExtract( *outBufferSize = (size_t)unPackSize; if (unPackSize != 0) { - *outBuffer = (Byte *)allocMain->Alloc((size_t)unPackSize); - if (*outBuffer == 0) - res = SZE_OUTOFMEMORY; + *outBuffer = (Byte *)allocMain->Alloc((size_t)unPackSize); + if (*outBuffer == 0) + res = SZE_OUTOFMEMORY; } if (res == SZ_OK) { - size_t outRealSize; - res = SzDecode(db->Database.PackSizes + - db->FolderStartPackStreamIndex[folderIndex], folder, - #ifdef _LZMA_IN_CB - inStream, - #else - inBuffer, - #endif - *outBuffer, (size_t)unPackSize, &outRealSize, allocTemp); - if (res == SZ_OK) - { - if (outRealSize == (size_t)unPackSize) - { - if (folder->UnPackCRCDefined) - { - if (!CrcVerifyDigest(folder->UnPackCRC, *outBuffer, (size_t)unPackSize)) - res = SZE_FAIL; - } - } - else - res = SZE_FAIL; - } + size_t outRealSize; + res = SzDecode(db->Database.PackSizes + + db->FolderStartPackStreamIndex[folderIndex], folder, + #ifdef _LZMA_IN_CB + inStream, + #else + inBuffer, + #endif + *outBuffer, (size_t)unPackSize, &outRealSize, allocTemp); + if (res == SZ_OK) + { + if (outRealSize == (size_t)unPackSize) + { + if (folder->UnPackCRCDefined) + { + if (!CrcVerifyDigest(folder->UnPackCRC, *outBuffer, (size_t)unPackSize)) + res = SZE_FAIL; + } + } + else + res = SZE_FAIL; + } } } #ifndef _LZMA_IN_CB @@ -96,7 +96,7 @@ SZ_RESULT SzExtract( } if (res == SZ_OK) { - UInt32 i; + UInt32 i; CFileItem *fileItem = db->Database.Files + fileIndex; *offset = 0; for(i = db->FolderStartFileIndex[folderIndex]; i < fileIndex; i++) @@ -107,8 +107,8 @@ SZ_RESULT SzExtract( { if (fileItem->IsFileCRCDefined) { - if (!CrcVerifyDigest(fileItem->FileCRC, *outBuffer + *offset, *outSizeProcessed)) - res = SZE_FAIL; + if (!CrcVerifyDigest(fileItem->FileCRC, *outBuffer + *offset, *outSizeProcessed)) + res = SZE_FAIL; } } } diff --git a/archivers/7z/7zExtract.h b/archivers/7z/7zExtract.h index e9a4fb4e..5c97b8ef 100755 --- a/archivers/7z/7zExtract.h +++ b/archivers/7z/7zExtract.h @@ -8,25 +8,25 @@ /* SzExtract extracts file from archive - *outBuffer must be 0 before first call for each new archive. + *outBuffer must be 0 before first call for each new archive. Extracting cache: - If you need to decompress more than one file, you can send + If you need to decompress more than one file, you can send these values from previous call: - *blockIndex, - *outBuffer, + *blockIndex, + *outBuffer, *outBufferSize - You can consider "*outBuffer" as cache of solid block. If your archive is solid, + You can consider "*outBuffer" as cache of solid block. If your archive is solid, it will increase decompression speed. - - If you use external function, you can declare these 3 cache variables + + If you use external function, you can declare these 3 cache variables (blockIndex, outBuffer, outBufferSize) as static in that external function. - + Free *outBuffer and set *outBuffer to 0, if you want to flush cache. */ SZ_RESULT SzExtract( - ISzInStream *inStream, + ISzInStream *inStream, CArchiveDatabaseEx *db, UInt32 fileIndex, /* index of file */ UInt32 *blockIndex, /* index of solid block */ diff --git a/archivers/7z/7zHeader.h b/archivers/7z/7zHeader.h index 0356aaa6..f98c3511 100755 --- a/archivers/7z/7zHeader.h +++ b/archivers/7z/7zHeader.h @@ -15,40 +15,40 @@ extern Byte k7zSignature[k7zSignatureSize]; enum EIdEnum { k7zIdEnd, - + k7zIdHeader, - + k7zIdArchiveProperties, - + k7zIdAdditionalStreamsInfo, k7zIdMainStreamsInfo, k7zIdFilesInfo, - + k7zIdPackInfo, k7zIdUnPackInfo, k7zIdSubStreamsInfo, - + k7zIdSize, k7zIdCRC, - + k7zIdFolder, - + k7zIdCodersUnPackSize, k7zIdNumUnPackStream, - + k7zIdEmptyStream, k7zIdEmptyFile, k7zIdAnti, - + k7zIdName, k7zIdCreationTime, k7zIdLastAccessTime, k7zIdLastWriteTime, k7zIdWinAttributes, k7zIdComment, - + k7zIdEncodedHeader, - + k7zIdStartPos }; diff --git a/archivers/7z/7zIn.c b/archivers/7z/7zIn.c index 8ff1e62d..ba0ab39b 100755 --- a/archivers/7z/7zIn.c +++ b/archivers/7z/7zIn.c @@ -26,7 +26,7 @@ void SzArDbExFree(CArchiveDatabaseEx *db, void (*freeFunc)(void *)) } /* -CFileSize GetFolderPackStreamSize(int folderIndex, int streamIndex) const +CFileSize GetFolderPackStreamSize(int folderIndex, int streamIndex) const { return PackSizes[FolderStartPackStreamIndex[folderIndex] + streamIndex]; } @@ -89,12 +89,12 @@ SZ_RESULT SzArDbExFill(CArchiveDatabaseEx *db, void * (*allocFunc)(size_t size)) */ while(1) { - if (folderIndex >= db->Database.NumFolders) - return SZE_ARCHIVE_ERROR; - db->FolderStartFileIndex[folderIndex] = i; - if (db->Database.Folders[folderIndex].NumUnPackStreams != 0) - break; - folderIndex++; + if (folderIndex >= db->Database.NumFolders) + return SZE_ARCHIVE_ERROR; + db->FolderStartFileIndex[folderIndex] = i; + if (db->Database.Folders[folderIndex].NumUnPackStreams != 0) + break; + folderIndex++; } } db->FileIndexToFolderIndexMap[i] = folderIndex; @@ -113,7 +113,7 @@ SZ_RESULT SzArDbExFill(CArchiveDatabaseEx *db, void * (*allocFunc)(size_t size)) CFileSize SzArDbGetFolderStreamPos(CArchiveDatabaseEx *db, UInt32 folderIndex, UInt32 indexInFolder) { - return db->ArchiveInfo.DataStartPosition + + return db->ArchiveInfo.DataStartPosition + db->PackStreamStartPositions[db->FolderStartPackStreamIndex[folderIndex] + indexInFolder]; } @@ -155,20 +155,20 @@ SZ_RESULT SzReadTime(const CObjectVector &dataVector, switch(type) { case k7zIdCreationTime: - file.IsCreationTimeDefined = defined; - if (defined) - file.CreationTime = fileTime; - break; + file.IsCreationTimeDefined = defined; + if (defined) + file.CreationTime = fileTime; + break; case k7zIdLastWriteTime: - file.IsLastWriteTimeDefined = defined; - if (defined) - file.LastWriteTime = fileTime; - break; + file.IsLastWriteTimeDefined = defined; + if (defined) + file.LastWriteTime = fileTime; + break; case k7zIdLastAccessTime: - file.IsLastAccessTimeDefined = defined; - if (defined) - file.LastAccessTime = fileTime; - break; + file.IsLastAccessTimeDefined = defined; + if (defined) + file.LastAccessTime = fileTime; + break; } } return SZ_OK; @@ -322,9 +322,9 @@ SZ_RESULT SzReadNumber32(CSzData *sd, UInt32 *value) return SZ_OK; } -SZ_RESULT SzReadID(CSzData *sd, UInt64 *value) -{ - return SzReadNumber(sd, value); +SZ_RESULT SzReadID(CSzData *sd, UInt64 *value) +{ + return SzReadNumber(sd, value); } SZ_RESULT SzSkeepDataSize(CSzData *sd, UInt64 size) @@ -403,10 +403,10 @@ SZ_RESULT SzReadBoolVector2(CSzData *sd, size_t numItems, Byte **v, void * (*all } SZ_RESULT SzReadHashDigests( - CSzData *sd, + CSzData *sd, size_t numItems, - Byte **digestsDefined, - UInt32 **digests, + Byte **digestsDefined, + UInt32 **digests, void * (*allocFunc)(size_t size)) { size_t i; @@ -421,7 +421,7 @@ SZ_RESULT SzReadHashDigests( } SZ_RESULT SzReadPackInfo( - CSzData *sd, + CSzData *sd, CFileSize *dataOffset, UInt32 *numPackStreams, CFileSize **packSizes, @@ -450,7 +450,7 @@ SZ_RESULT SzReadPackInfo( break; if (type == k7zIdCRC) { - RINOK(SzReadHashDigests(sd, (size_t)*numPackStreams, packCRCsDefined, packCRCs, allocFunc)); + RINOK(SzReadHashDigests(sd, (size_t)*numPackStreams, packCRCsDefined, packCRCs, allocFunc)); continue; } RINOK(SzSkeepData(sd)); @@ -501,21 +501,21 @@ SZ_RESULT SzGetNextFolderItem(CSzData *sd, CFolder *folder, void * (*allocFunc)( RINOK(SzReadBytes(sd, coder->MethodID.ID, coder->MethodID.IDSize)); if ((mainByte & 0x10) != 0) { - RINOK(SzReadNumber32(sd, &coder->NumInStreams)); - RINOK(SzReadNumber32(sd, &coder->NumOutStreams)); + RINOK(SzReadNumber32(sd, &coder->NumInStreams)); + RINOK(SzReadNumber32(sd, &coder->NumOutStreams)); } else { - coder->NumInStreams = 1; - coder->NumOutStreams = 1; + coder->NumInStreams = 1; + coder->NumOutStreams = 1; } if ((mainByte & 0x20) != 0) { - UInt64 propertiesSize = 0; - RINOK(SzReadNumber(sd, &propertiesSize)); - if (!SzByteBufferCreate(&coder->Properties, (size_t)propertiesSize, allocFunc)) - return SZE_OUTOFMEMORY; - RINOK(SzReadBytes(sd, coder->Properties.Items, (size_t)propertiesSize)); + UInt64 propertiesSize = 0; + RINOK(SzReadNumber(sd, &propertiesSize)); + if (!SzByteBufferCreate(&coder->Properties, (size_t)propertiesSize, allocFunc)) + return SZE_OUTOFMEMORY; + RINOK(SzReadBytes(sd, coder->Properties.Items, (size_t)propertiesSize)); } } while ((mainByte & 0x80) != 0) @@ -524,15 +524,15 @@ SZ_RESULT SzGetNextFolderItem(CSzData *sd, CFolder *folder, void * (*allocFunc)( RINOK(SzSkeepDataSize(sd, (mainByte & 0xF))); if ((mainByte & 0x10) != 0) { - UInt32 n; - RINOK(SzReadNumber32(sd, &n)); - RINOK(SzReadNumber32(sd, &n)); + UInt32 n; + RINOK(SzReadNumber32(sd, &n)); + RINOK(SzReadNumber32(sd, &n)); } if ((mainByte & 0x20) != 0) { - UInt64 propertiesSize = 0; - RINOK(SzReadNumber(sd, &propertiesSize)); - RINOK(SzSkeepDataSize(sd, propertiesSize)); + UInt64 propertiesSize = 0; + RINOK(SzReadNumber(sd, &propertiesSize)); + RINOK(SzSkeepDataSize(sd, propertiesSize)); } } numInStreams += (UInt32)coder->NumInStreams; @@ -549,7 +549,7 @@ SZ_RESULT SzGetNextFolderItem(CSzData *sd, CFolder *folder, void * (*allocFunc)( { CBindPair *bindPair = folder->BindPairs + i;; RINOK(SzReadNumber32(sd, &bindPair->InIndex)); - RINOK(SzReadNumber32(sd, &bindPair->OutIndex)); + RINOK(SzReadNumber32(sd, &bindPair->OutIndex)); } numPackedStreams = numInStreams - (UInt32)numBindPairs; @@ -564,8 +564,8 @@ SZ_RESULT SzGetNextFolderItem(CSzData *sd, CFolder *folder, void * (*allocFunc)( for (j = 0; j < numInStreams; j++) if (SzFolderFindBindPairForInStream(folder, j) < 0) { - folder->PackStreams[pi++] = j; - break; + folder->PackStreams[pi++] = j; + break; } } else @@ -577,7 +577,7 @@ SZ_RESULT SzGetNextFolderItem(CSzData *sd, CFolder *folder, void * (*allocFunc)( } SZ_RESULT SzReadUnPackInfo( - CSzData *sd, + CSzData *sd, UInt32 *numFolders, CFolder **folders, /* for allocFunc */ void * (*allocFunc)(size_t size), @@ -627,15 +627,15 @@ SZ_RESULT SzReadUnPackInfo( SZ_RESULT res; Byte *crcsDefined = 0; UInt32 *crcs = 0; - res = SzReadHashDigests(sd, *numFolders, &crcsDefined, &crcs, allocTemp->Alloc); + res = SzReadHashDigests(sd, *numFolders, &crcsDefined, &crcs, allocTemp->Alloc); if (res == SZ_OK) { - for(i = 0; i < *numFolders; i++) - { - CFolder *folder = (*folders) + i; - folder->UnPackCRCDefined = crcsDefined[i]; - folder->UnPackCRC = crcs[i]; - } + for(i = 0; i < *numFolders; i++) + { + CFolder *folder = (*folders) + i; + folder->UnPackCRCDefined = crcsDefined[i]; + folder->UnPackCRC = crcs[i]; + } } allocTemp->Free(crcs); allocTemp->Free(crcsDefined); @@ -647,7 +647,7 @@ SZ_RESULT SzReadUnPackInfo( } SZ_RESULT SzReadSubStreamsInfo( - CSzData *sd, + CSzData *sd, UInt32 numFolders, CFolder *folders, UInt32 *numUnPackStreams, @@ -673,10 +673,10 @@ SZ_RESULT SzReadSubStreamsInfo( *numUnPackStreams = 0; for(i = 0; i < numFolders; i++) { - UInt32 numStreams; - RINOK(SzReadNumber32(sd, &numStreams)); - folders[i].NumUnPackStreams = numStreams; - *numUnPackStreams += numStreams; + UInt32 numStreams; + RINOK(SzReadNumber32(sd, &numStreams)); + folders[i].NumUnPackStreams = numStreams; + *numUnPackStreams += numStreams; } continue; } @@ -743,39 +743,39 @@ SZ_RESULT SzReadSubStreamsInfo( numDigests += numSubstreams; } - + si = 0; while(1) { if (type == k7zIdCRC) { int digestIndex = 0; - Byte *digestsDefined2 = 0; + Byte *digestsDefined2 = 0; UInt32 *digests2 = 0; SZ_RESULT res = SzReadHashDigests(sd, numDigests, &digestsDefined2, &digests2, allocTemp->Alloc); if (res == SZ_OK) { - for (i = 0; i < numFolders; i++) - { - CFolder *folder = folders + i; - UInt32 numSubstreams = folder->NumUnPackStreams; - if (numSubstreams == 1 && folder->UnPackCRCDefined) - { - (*digestsDefined)[si] = 1; - (*digests)[si] = folder->UnPackCRC; - si++; - } - else - { - UInt32 j; - for (j = 0; j < numSubstreams; j++, digestIndex++) - { - (*digestsDefined)[si] = digestsDefined2[digestIndex]; - (*digests)[si] = digests2[digestIndex]; - si++; - } - } - } + for (i = 0; i < numFolders; i++) + { + CFolder *folder = folders + i; + UInt32 numSubstreams = folder->NumUnPackStreams; + if (numSubstreams == 1 && folder->UnPackCRCDefined) + { + (*digestsDefined)[si] = 1; + (*digests)[si] = folder->UnPackCRC; + si++; + } + else + { + UInt32 j; + for (j = 0; j < numSubstreams; j++, digestIndex++) + { + (*digestsDefined)[si] = digestsDefined2[digestIndex]; + (*digests)[si] = digests2[digestIndex]; + si++; + } + } + } } allocTemp->Free(digestsDefined2); allocTemp->Free(digests2); @@ -793,7 +793,7 @@ SZ_RESULT SzReadSubStreamsInfo( SZ_RESULT SzReadStreamsInfo( - CSzData *sd, + CSzData *sd, CFileSize *dataOffset, CArchiveDatabase *db, UInt32 *numUnPackStreams, @@ -812,33 +812,33 @@ SZ_RESULT SzReadStreamsInfo( switch((int)type) { case k7zIdEnd: - return SZ_OK; + return SZ_OK; case k7zIdPackInfo: { - RINOK(SzReadPackInfo(sd, dataOffset, &db->NumPackStreams, - &db->PackSizes, &db->PackCRCsDefined, &db->PackCRCs, allocFunc)); - break; + RINOK(SzReadPackInfo(sd, dataOffset, &db->NumPackStreams, + &db->PackSizes, &db->PackCRCsDefined, &db->PackCRCs, allocFunc)); + break; } case k7zIdUnPackInfo: { - RINOK(SzReadUnPackInfo(sd, &db->NumFolders, &db->Folders, allocFunc, allocTemp)); - break; + RINOK(SzReadUnPackInfo(sd, &db->NumFolders, &db->Folders, allocFunc, allocTemp)); + break; } case k7zIdSubStreamsInfo: { - RINOK(SzReadSubStreamsInfo(sd, db->NumFolders, db->Folders, - numUnPackStreams, unPackSizes, digestsDefined, digests, allocTemp)); - break; + RINOK(SzReadSubStreamsInfo(sd, db->NumFolders, db->Folders, + numUnPackStreams, unPackSizes, digestsDefined, digests, allocTemp)); + break; } default: - return SZE_FAIL; + return SZE_FAIL; } } } Byte kUtf8Limits[5] = { 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; -SZ_RESULT SzReadFileNames(CSzData *sd, UInt32 numFiles, CFileItem *files, +SZ_RESULT SzReadFileNames(CSzData *sd, UInt32 numFiles, CFileItem *files, void * (*allocFunc)(size_t size)) { UInt32 i; @@ -854,25 +854,25 @@ SZ_RESULT SzReadFileNames(CSzData *sd, UInt32 numFiles, CFileItem *files, pos += 2; len++; if (value == 0) - break; + break; if (value < 0x80) - continue; + continue; if (value >= 0xD800 && value < 0xE000) { - UInt32 c2; - if (value >= 0xDC00) - return SZE_ARCHIVE_ERROR; - if (pos + 2 > sd->Size) - return SZE_ARCHIVE_ERROR; - c2 = (UInt32)(sd->Data[pos] | (((UInt32)sd->Data[pos + 1]) << 8)); - pos += 2; - if (c2 < 0xDC00 || c2 >= 0xE000) - return SZE_ARCHIVE_ERROR; - value = ((value - 0xD800) << 10) | (c2 - 0xDC00); + UInt32 c2; + if (value >= 0xDC00) + return SZE_ARCHIVE_ERROR; + if (pos + 2 > sd->Size) + return SZE_ARCHIVE_ERROR; + c2 = (UInt32)(sd->Data[pos] | (((UInt32)sd->Data[pos + 1]) << 8)); + pos += 2; + if (c2 < 0xDC00 || c2 >= 0xE000) + return SZE_ARCHIVE_ERROR; + value = ((value - 0xD800) << 10) | (c2 - 0xDC00); } for (numAdds = 1; numAdds < 5; numAdds++) - if (value < (((UInt32)1) << (numAdds * 5 + 6))) - break; + if (value < (((UInt32)1) << (numAdds * 5 + 6))) + break; len += numAdds; } @@ -886,25 +886,25 @@ SZ_RESULT SzReadFileNames(CSzData *sd, UInt32 numFiles, CFileItem *files, SzSkeepDataSize(sd, 2); if (value < 0x80) { - file->Name[len++] = (char)value; - if (value == 0) - break; - continue; + file->Name[len++] = (char)value; + if (value == 0) + break; + continue; } if (value >= 0xD800 && value < 0xE000) { - UInt32 c2 = (UInt32)(sd->Data[0] | (((UInt32)sd->Data[1]) << 8)); - SzSkeepDataSize(sd, 2); - value = ((value - 0xD800) << 10) | (c2 - 0xDC00); + UInt32 c2 = (UInt32)(sd->Data[0] | (((UInt32)sd->Data[1]) << 8)); + SzSkeepDataSize(sd, 2); + value = ((value - 0xD800) << 10) | (c2 - 0xDC00); } for (numAdds = 1; numAdds < 5; numAdds++) - if (value < (((UInt32)1) << (numAdds * 5 + 6))) - break; + if (value < (((UInt32)1) << (numAdds * 5 + 6))) + break; file->Name[len++] = (char)(kUtf8Limits[numAdds - 1] + (value >> (6 * numAdds))); do { - numAdds--; - file->Name[len++] = (char)(0x80 + ((value >> (6 * numAdds)) & 0x3F)); + numAdds--; + file->Name[len++] = (char)(0x80 + ((value >> (6 * numAdds)) & 0x3F)); } while(numAdds > 0); @@ -915,14 +915,14 @@ SZ_RESULT SzReadFileNames(CSzData *sd, UInt32 numFiles, CFileItem *files, } SZ_RESULT SzReadHeader2( - CSzData *sd, + CSzData *sd, CArchiveDatabaseEx *db, /* allocMain */ CFileSize **unPackSizes, /* allocTemp */ Byte **digestsDefined, /* allocTemp */ UInt32 **digests, /* allocTemp */ Byte **emptyStreamVector, /* allocTemp */ Byte **emptyFileVector, /* allocTemp */ - ISzAlloc *allocMain, + ISzAlloc *allocMain, ISzAlloc *allocTemp) { UInt64 type; @@ -939,17 +939,17 @@ SZ_RESULT SzReadHeader2( RINOK(SzReadArchiveProperties(sd)); RINOK(SzReadID(sd, &type)); } - - + + if (type == k7zIdMainStreamsInfo) { RINOK(SzReadStreamsInfo(sd, - &db->ArchiveInfo.DataStartPosition, - &db->Database, - &numUnPackStreams, - unPackSizes, - digestsDefined, - digests, allocMain->Alloc, allocTemp)); + &db->ArchiveInfo.DataStartPosition, + &db->Database, + &numUnPackStreams, + unPackSizes, + digestsDefined, + digests, allocMain->Alloc, allocTemp)); db->ArchiveInfo.DataStartPosition += db->ArchiveInfo.StartPositionAfterHeader; RINOK(SzReadID(sd, &type)); } @@ -958,7 +958,7 @@ SZ_RESULT SzReadHeader2( return SZ_OK; if (type != k7zIdFilesInfo) return SZE_ARCHIVE_ERROR; - + RINOK(SzReadNumber32(sd, &numFiles)); db->Database.NumFiles = numFiles; @@ -986,27 +986,27 @@ SZ_RESULT SzReadHeader2( { case k7zIdName: { - RINOK(SzReadSwitch(sd)); - RINOK(SzReadFileNames(sd, numFiles, files, allocMain->Alloc)) - break; + RINOK(SzReadSwitch(sd)); + RINOK(SzReadFileNames(sd, numFiles, files, allocMain->Alloc)) + break; } case k7zIdEmptyStream: { - RINOK(SzReadBoolVector(sd, numFiles, emptyStreamVector, allocTemp->Alloc)); - numEmptyStreams = 0; - for (i = 0; i < numFiles; i++) - if ((*emptyStreamVector)[i]) - numEmptyStreams++; - break; + RINOK(SzReadBoolVector(sd, numFiles, emptyStreamVector, allocTemp->Alloc)); + numEmptyStreams = 0; + for (i = 0; i < numFiles; i++) + if ((*emptyStreamVector)[i]) + numEmptyStreams++; + break; } case k7zIdEmptyFile: { - RINOK(SzReadBoolVector(sd, numEmptyStreams, emptyFileVector, allocTemp->Alloc)); - break; + RINOK(SzReadBoolVector(sd, numEmptyStreams, emptyFileVector, allocTemp->Alloc)); + break; } default: { - RINOK(SzSkeepDataSize(sd, size)); + RINOK(SzSkeepDataSize(sd, size)); } } } @@ -1019,26 +1019,26 @@ SZ_RESULT SzReadHeader2( CFileItem *file = files + i; file->IsAnti = 0; if (*emptyStreamVector == 0) - file->HasStream = 1; + file->HasStream = 1; else - file->HasStream = (Byte)((*emptyStreamVector)[i] ? 0 : 1); + file->HasStream = (Byte)((*emptyStreamVector)[i] ? 0 : 1); if(file->HasStream) { - file->IsDirectory = 0; - file->Size = (*unPackSizes)[sizeIndex]; - file->FileCRC = (*digests)[sizeIndex]; - file->IsFileCRCDefined = (Byte)(*digestsDefined)[sizeIndex]; - sizeIndex++; + file->IsDirectory = 0; + file->Size = (*unPackSizes)[sizeIndex]; + file->FileCRC = (*digests)[sizeIndex]; + file->IsFileCRCDefined = (Byte)(*digestsDefined)[sizeIndex]; + sizeIndex++; } else { - if (*emptyFileVector == 0) - file->IsDirectory = 1; - else - file->IsDirectory = (Byte)((*emptyFileVector)[emptyFileIndex] ? 0 : 1); - emptyFileIndex++; - file->Size = 0; - file->IsFileCRCDefined = 0; + if (*emptyFileVector == 0) + file->IsDirectory = 1; + else + file->IsDirectory = (Byte)((*emptyFileVector)[emptyFileIndex] ? 0 : 1); + emptyFileIndex++; + file->Size = 0; + file->IsFileCRCDefined = 0; } } } @@ -1046,9 +1046,9 @@ SZ_RESULT SzReadHeader2( } SZ_RESULT SzReadHeader( - CSzData *sd, - CArchiveDatabaseEx *db, - ISzAlloc *allocMain, + CSzData *sd, + CArchiveDatabaseEx *db, + ISzAlloc *allocMain, ISzAlloc *allocTemp) { CFileSize *unPackSizes = 0; @@ -1056,7 +1056,7 @@ SZ_RESULT SzReadHeader( UInt32 *digests = 0; Byte *emptyStreamVector = 0; Byte *emptyFileVector = 0; - SZ_RESULT res = SzReadHeader2(sd, db, + SZ_RESULT res = SzReadHeader2(sd, db, &unPackSizes, &digestsDefined, &digests, &emptyStreamVector, &emptyFileVector, allocMain, allocTemp); @@ -1066,13 +1066,13 @@ SZ_RESULT SzReadHeader( allocTemp->Free(emptyStreamVector); allocTemp->Free(emptyFileVector); return res; -} +} SZ_RESULT SzReadAndDecodePackedStreams2( - ISzInStream *inStream, + ISzInStream *inStream, CSzData *sd, CSzByteBuffer *outBuffer, - CFileSize baseOffset, + CFileSize baseOffset, CArchiveDatabase *db, CFileSize **unPackSizes, Byte **digestsDefined, @@ -1095,16 +1095,16 @@ SZ_RESULT SzReadAndDecodePackedStreams2( SZ_RESULT res; RINOK(SzReadStreamsInfo(sd, &dataStartPos, db, - &numUnPackStreams, unPackSizes, digestsDefined, digests, + &numUnPackStreams, unPackSizes, digestsDefined, digests, allocTemp->Alloc, allocTemp)); - + dataStartPos += baseOffset; if (db->NumFolders != 1) return SZE_ARCHIVE_ERROR; folder = db->Folders; unPackSize = SzFolderGetUnPackSize(folder); - + RINOK(inStream->Seek(inStream, dataStartPos)); #ifndef _LZMA_IN_CB @@ -1118,15 +1118,15 @@ SZ_RESULT SzReadAndDecodePackedStreams2( if (!SzByteBufferCreate(outBuffer, (size_t)unPackSize, allocTemp->Alloc)) return SZE_OUTOFMEMORY; - - res = SzDecode(db->PackSizes, folder, - #ifdef _LZMA_IN_CB - inStream, - #else - *inBuffer, - #endif - outBuffer->Items, (size_t)unPackSize, - &outRealSize, allocTemp); + + res = SzDecode(db->PackSizes, folder, + #ifdef _LZMA_IN_CB + inStream, + #else + *inBuffer, + #endif + outBuffer->Items, (size_t)unPackSize, + &outRealSize, allocTemp); RINOK(res) if (outRealSize != (UInt32)unPackSize) return SZE_FAIL; @@ -1137,10 +1137,10 @@ SZ_RESULT SzReadAndDecodePackedStreams2( } SZ_RESULT SzReadAndDecodePackedStreams( - ISzInStream *inStream, + ISzInStream *inStream, CSzData *sd, CSzByteBuffer *outBuffer, - CFileSize baseOffset, + CFileSize baseOffset, ISzAlloc *allocTemp) { CArchiveDatabase db; @@ -1152,8 +1152,8 @@ SZ_RESULT SzReadAndDecodePackedStreams( #endif SZ_RESULT res; SzArchiveDatabaseInit(&db); - res = SzReadAndDecodePackedStreams2(inStream, sd, outBuffer, baseOffset, - &db, &unPackSizes, &digestsDefined, &digests, + res = SzReadAndDecodePackedStreams2(inStream, sd, outBuffer, baseOffset, + &db, &unPackSizes, &digestsDefined, &digests, #ifndef _LZMA_IN_CB &inBuffer, #endif @@ -1169,9 +1169,9 @@ SZ_RESULT SzReadAndDecodePackedStreams( } SZ_RESULT SzArchiveOpen2( - ISzInStream *inStream, + ISzInStream *inStream, CArchiveDatabaseEx *db, - ISzAlloc *allocMain, + ISzAlloc *allocMain, ISzAlloc *allocTemp) { Byte signature[k7zSignatureSize]; @@ -1212,7 +1212,7 @@ SZ_RESULT SzArchiveOpen2( pos = k7zStartHeaderSize; db->ArchiveInfo.StartPositionAfterHeader = pos; - + if (CrcGetDigest(&crc) != crcFromArchive) return SZE_ARCHIVE_ERROR; @@ -1231,36 +1231,36 @@ SZ_RESULT SzArchiveOpen2( { while (1) { - UInt64 type; - sd.Data = buffer.Items; - sd.Size = buffer.Capacity; - res = SzReadID(&sd, &type); - if (res != SZ_OK) - break; - if (type == k7zIdHeader) - { - res = SzReadHeader(&sd, db, allocMain, allocTemp); - break; - } - if (type != k7zIdEncodedHeader) - { - res = SZE_ARCHIVE_ERROR; - break; - } - { - CSzByteBuffer outBuffer; - res = SzReadAndDecodePackedStreams(inStream, &sd, &outBuffer, - db->ArchiveInfo.StartPositionAfterHeader, - allocTemp); - if (res != SZ_OK) - { - SzByteBufferFree(&outBuffer, allocTemp->Free); - break; - } - SzByteBufferFree(&buffer, allocTemp->Free); - buffer.Items = outBuffer.Items; - buffer.Capacity = outBuffer.Capacity; - } + UInt64 type; + sd.Data = buffer.Items; + sd.Size = buffer.Capacity; + res = SzReadID(&sd, &type); + if (res != SZ_OK) + break; + if (type == k7zIdHeader) + { + res = SzReadHeader(&sd, db, allocMain, allocTemp); + break; + } + if (type != k7zIdEncodedHeader) + { + res = SZE_ARCHIVE_ERROR; + break; + } + { + CSzByteBuffer outBuffer; + res = SzReadAndDecodePackedStreams(inStream, &sd, &outBuffer, + db->ArchiveInfo.StartPositionAfterHeader, + allocTemp); + if (res != SZ_OK) + { + SzByteBufferFree(&outBuffer, allocTemp->Free); + break; + } + SzByteBufferFree(&buffer, allocTemp->Free); + buffer.Items = outBuffer.Items; + buffer.Capacity = outBuffer.Capacity; + } } } } @@ -1269,9 +1269,9 @@ SZ_RESULT SzArchiveOpen2( } SZ_RESULT SzArchiveOpen( - ISzInStream *inStream, + ISzInStream *inStream, CArchiveDatabaseEx *db, - ISzAlloc *allocMain, + ISzAlloc *allocMain, ISzAlloc *allocTemp) { SZ_RESULT res = SzArchiveOpen2(inStream, db, allocMain, allocTemp); diff --git a/archivers/7z/7zIn.h b/archivers/7z/7zIn.h index 6bfa2a70..f874225a 100755 --- a/archivers/7z/7zIn.h +++ b/archivers/7z/7zIn.h @@ -6,10 +6,10 @@ #include "7zHeader.h" #include "7zItem.h" #include "7zAlloc.h" - + typedef struct _CInArchiveInfo { - CFileSize StartPositionAfterHeader; + CFileSize StartPositionAfterHeader; CFileSize DataStartPosition; }CInArchiveInfo; @@ -35,21 +35,21 @@ typedef struct _ISzInStream void *object, /* pointer to ISzInStream itself */ void **buffer, /* out: pointer to buffer with data */ size_t maxRequiredSize, /* max required size to read */ - size_t *processedSize); /* real processed size. - processedSize can be less than maxRequiredSize. - If processedSize == 0, then there are no more - bytes in stream. */ + size_t *processedSize); /* real processed size. + processedSize can be less than maxRequiredSize. + If processedSize == 0, then there are no more + bytes in stream. */ #else SZ_RESULT (*Read)(void *object, void *buffer, size_t size, size_t *processedSize); #endif SZ_RESULT (*Seek)(void *object, CFileSize pos); } ISzInStream; - + int SzArchiveOpen( - ISzInStream *inStream, + ISzInStream *inStream, CArchiveDatabaseEx *db, - ISzAlloc *allocMain, + ISzAlloc *allocMain, ISzAlloc *allocTemp); - + #endif diff --git a/archivers/7z/7zItem.c b/archivers/7z/7zItem.c index 2a408050..26ea00f6 100755 --- a/archivers/7z/7zItem.c +++ b/archivers/7z/7zItem.c @@ -69,7 +69,7 @@ int SzFolderFindBindPairForOutStream(CFolder *folder, UInt32 outStreamIndex) } CFileSize SzFolderGetUnPackSize(CFolder *folder) -{ +{ int i = (int)SzFolderGetNumOutStreams(folder); if (i == 0) return 0; diff --git a/archivers/7z/7zItem.h b/archivers/7z/7zItem.h index 876539a9..4d848b0c 100755 --- a/archivers/7z/7zItem.h +++ b/archivers/7z/7zItem.h @@ -30,7 +30,7 @@ typedef struct _CFolder CCoderInfo *Coders; UInt32 NumBindPairs; CBindPair *BindPairs; - UInt32 NumPackStreams; + UInt32 NumPackStreams; UInt32 *PackStreams; CFileSize *UnPackSizes; int UnPackCRCDefined; @@ -52,7 +52,7 @@ typedef struct _CFileItem /* CArchiveFileTime LastWriteTime; CFileSize StartPos; - UInt32 Attributes; + UInt32 Attributes; */ CFileSize Size; UInt32 FileCRC; diff --git a/archivers/7z/7zMain.c b/archivers/7z/7zMain.c index 73bf36bb..263bc2c3 100755 --- a/archivers/7z/7zMain.c +++ b/archivers/7z/7zMain.c @@ -1,4 +1,4 @@ -/* +/* 7zMain.c Test application for 7z Decoder LZMA SDK 4.43 Copyright (c) 1999-2006 Igor Pavlov (2006-06-04) @@ -125,8 +125,8 @@ int main(int numargs, char *args[]) UInt32 i; for (i = 0; i < db.Database.NumFiles; i++) { - CFileItem *f = db.Database.Files + i; - printf("%10d %s\n", (int)f->Size, f->Name); + CFileItem *f = db.Database.Files + i; + printf("%10d %s\n", (int)f->Size, f->Name); } } else if (testCommand || extractCommand) @@ -144,62 +144,62 @@ int main(int numargs, char *args[]) printf("\n"); for (i = 0; i < db.Database.NumFiles; i++) { - size_t offset; - size_t outSizeProcessed; - CFileItem *f = db.Database.Files + i; - if (f->IsDirectory) - printf("Directory "); - else - printf(testCommand ? - "Testing ": - "Extracting"); - printf(" %s", f->Name); - if (f->IsDirectory) - { - printf("\n"); - continue; - } - res = SzExtract(&archiveStream.InStream, &db, i, - &blockIndex, &outBuffer, &outBufferSize, - &offset, &outSizeProcessed, - &allocImp, &allocTempImp); - if (res != SZ_OK) - break; - if (!testCommand) - { - FILE *outputHandle; - UInt32 processedSize; - char *fileName = f->Name; - size_t nameLen = strlen(f->Name); - for (; nameLen > 0; nameLen--) - if (f->Name[nameLen - 1] == '/') - { - fileName = f->Name + nameLen; - break; - } - - outputHandle = fopen(fileName, "wb+"); - if (outputHandle == 0) - { - PrintError("can not open output file"); - res = SZE_FAIL; - break; - } - processedSize = fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); - if (processedSize != outSizeProcessed) - { - PrintError("can not write output file"); - res = SZE_FAIL; - break; - } - if (fclose(outputHandle)) - { - PrintError("can not close output file"); - res = SZE_FAIL; - break; - } - } - printf("\n"); + size_t offset; + size_t outSizeProcessed; + CFileItem *f = db.Database.Files + i; + if (f->IsDirectory) + printf("Directory "); + else + printf(testCommand ? + "Testing ": + "Extracting"); + printf(" %s", f->Name); + if (f->IsDirectory) + { + printf("\n"); + continue; + } + res = SzExtract(&archiveStream.InStream, &db, i, + &blockIndex, &outBuffer, &outBufferSize, + &offset, &outSizeProcessed, + &allocImp, &allocTempImp); + if (res != SZ_OK) + break; + if (!testCommand) + { + FILE *outputHandle; + UInt32 processedSize; + char *fileName = f->Name; + size_t nameLen = strlen(f->Name); + for (; nameLen > 0; nameLen--) + if (f->Name[nameLen - 1] == '/') + { + fileName = f->Name + nameLen; + break; + } + + outputHandle = fopen(fileName, "wb+"); + if (outputHandle == 0) + { + PrintError("can not open output file"); + res = SZE_FAIL; + break; + } + processedSize = fwrite(outBuffer + offset, 1, outSizeProcessed, outputHandle); + if (processedSize != outSizeProcessed) + { + PrintError("can not write output file"); + res = SZE_FAIL; + break; + } + if (fclose(outputHandle)) + { + PrintError("can not close output file"); + res = SZE_FAIL; + break; + } + } + printf("\n"); } allocImp.Free(outBuffer); } @@ -219,7 +219,7 @@ int main(int numargs, char *args[]) } if (res == SZE_OUTOFMEMORY) PrintError("can not allocate memory"); - else + else printf("\nERROR #%d\n", res); return 1; } diff --git a/archivers/7z/7zMethodID.h b/archivers/7z/7zMethodID.h index 162fcd15..1ee50b76 100755 --- a/archivers/7z/7zMethodID.h +++ b/archivers/7z/7zMethodID.h @@ -6,7 +6,7 @@ #include "7zTypes.h" #define kMethodIDSize 15 - + typedef struct _CMethodID { Byte ID[kMethodIDSize]; diff --git a/archivers/7z/7zTypes.h b/archivers/7z/7zTypes.h index 60dd68c3..4de13cae 100755 --- a/archivers/7z/7zTypes.h +++ b/archivers/7z/7zTypes.h @@ -6,12 +6,12 @@ #ifndef _7ZIP_BYTE_DEFINED #define _7ZIP_BYTE_DEFINED typedef unsigned char Byte; -#endif +#endif #ifndef _7ZIP_UINT16_DEFINED #define _7ZIP_UINT16_DEFINED typedef unsigned short UInt16; -#endif +#endif #ifndef _7ZIP_UINT32_DEFINED #define _7ZIP_UINT32_DEFINED @@ -20,7 +20,7 @@ typedef unsigned long UInt32; #else typedef unsigned int UInt32; #endif -#endif +#endif /* #define _SZ_NO_INT_64 */ /* define it your compiler doesn't support long long int */ @@ -44,9 +44,9 @@ typedef unsigned long long int UInt64; #ifndef CFileSize #ifdef _SZ_FILE_SIZE_64 -typedef UInt64 CFileSize; +typedef UInt64 CFileSize; #else -typedef UInt32 CFileSize; +typedef UInt32 CFileSize; #endif #endif diff --git a/archivers/7z/LzmaDecode.c b/archivers/7z/LzmaDecode.c index cb834537..486eff54 100755 --- a/archivers/7z/LzmaDecode.c +++ b/archivers/7z/LzmaDecode.c @@ -1,21 +1,21 @@ /* LzmaDecode.c LZMA Decoder (optimized for Speed version) - + LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01) http://www.7-zip.org/ LZMA SDK is licensed under two licenses: 1) GNU Lesser General Public License (GNU LGPL) 2) Common Public License (CPL) - It means that you can select one of these two licenses and + It means that you can select one of these two licenses and follow rules of that license. SPECIAL EXCEPTION: - Igor Pavlov, as the author of this Code, expressly permits you to - statically or dynamically link your Code (or bind by name) to the - interfaces of this file without subjecting your linked Code to the - terms of the CPL or GNU LGPL. Any modifications or additions + Igor Pavlov, as the author of this Code, expressly permits you to + statically or dynamically link your Code (or bind by name) to the + interfaces of this file without subjecting your linked Code to the + terms of the CPL or GNU LGPL. Any modifications or additions to this file, however, are subject to the LGPL or CPL terms. */ @@ -46,7 +46,7 @@ #define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; } #define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2 - + #endif #define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; } @@ -57,9 +57,9 @@ #define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \ { UpdateBit0(p); mi <<= 1; A0; } else \ - { UpdateBit1(p); mi = (mi + mi) + 1; A1; } - -#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;) + { UpdateBit1(p); mi = (mi + mi) + 1; A1; } + +#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;) #define RangeDecoderBitTreeDecode(probs, numLevels, res) \ { int i = numLevels; res = 1; \ @@ -82,7 +82,7 @@ #define LenLow (LenChoice2 + 1) #define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) #define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) -#define kNumLenProbs (LenHigh + kLenNumHighSymbols) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) #define kNumStates 12 @@ -168,7 +168,7 @@ int LzmaDecode(CLzmaDecoderState *vs, int lc = vs->Properties.lc; #ifdef _LZMA_OUT_READ - + UInt32 Range = vs->Range; UInt32 Code = vs->Code; #ifdef _LZMA_IN_CB @@ -210,7 +210,7 @@ int LzmaDecode(CLzmaDecoderState *vs, UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp)); UInt32 i; for (i = 0; i < numProbs; i++) - p[i] = kBitModelTotal >> 1; + p[i] = kBitModelTotal >> 1; rep0 = rep1 = rep2 = rep3 = 1; state = 0; globalPos = 0; @@ -261,7 +261,7 @@ int LzmaDecode(CLzmaDecoderState *vs, for (i = 0; i < numProbs; i++) p[i] = kBitModelTotal >> 1; } - + #ifdef _LZMA_IN_CB RC_INIT; #else @@ -275,283 +275,283 @@ int LzmaDecode(CLzmaDecoderState *vs, CProb *prob; UInt32 bound; int posState = (int)( - (nowPos - #ifdef _LZMA_OUT_READ - + globalPos - #endif - ) - & posStateMask); + (nowPos + #ifdef _LZMA_OUT_READ + + globalPos + #endif + ) + & posStateMask); prob = p + IsMatch + (state << kNumPosBitsMax) + posState; IfBit0(prob) { int symbol = 1; UpdateBit0(prob) - prob = p + Literal + (LZMA_LIT_SIZE * - ((( - (nowPos - #ifdef _LZMA_OUT_READ - + globalPos - #endif - ) - & literalPosMask) << lc) + (previousByte >> (8 - lc)))); + prob = p + Literal + (LZMA_LIT_SIZE * + ((( + (nowPos + #ifdef _LZMA_OUT_READ + + globalPos + #endif + ) + & literalPosMask) << lc) + (previousByte >> (8 - lc)))); if (state >= kNumLitStates) { - int matchByte; - #ifdef _LZMA_OUT_READ - UInt32 pos = dictionaryPos - rep0; - if (pos >= dictionarySize) - pos += dictionarySize; - matchByte = dictionary[pos]; - #else - matchByte = outStream[nowPos - rep0]; - #endif - do - { - int bit; - CProb *probLit; - matchByte <<= 1; - bit = (matchByte & 0x100); - probLit = prob + 0x100 + bit + symbol; - RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break) - } - while (symbol < 0x100); + int matchByte; + #ifdef _LZMA_OUT_READ + UInt32 pos = dictionaryPos - rep0; + if (pos >= dictionarySize) + pos += dictionarySize; + matchByte = dictionary[pos]; + #else + matchByte = outStream[nowPos - rep0]; + #endif + do + { + int bit; + CProb *probLit; + matchByte <<= 1; + bit = (matchByte & 0x100); + probLit = prob + 0x100 + bit + symbol; + RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break) + } + while (symbol < 0x100); } while (symbol < 0x100) { - CProb *probLit = prob + symbol; - RC_GET_BIT(probLit, symbol) + CProb *probLit = prob + symbol; + RC_GET_BIT(probLit, symbol) } previousByte = (Byte)symbol; outStream[nowPos++] = previousByte; #ifdef _LZMA_OUT_READ if (distanceLimit < dictionarySize) - distanceLimit++; + distanceLimit++; dictionary[dictionaryPos] = previousByte; if (++dictionaryPos == dictionarySize) - dictionaryPos = 0; + dictionaryPos = 0; #endif if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; } - else + else { UpdateBit1(prob); prob = p + IsRep + state; IfBit0(prob) { - UpdateBit0(prob); - rep3 = rep2; - rep2 = rep1; - rep1 = rep0; - state = state < kNumLitStates ? 0 : 3; - prob = p + LenCoder; + UpdateBit0(prob); + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + state = state < kNumLitStates ? 0 : 3; + prob = p + LenCoder; } else { - UpdateBit1(prob); - prob = p + IsRepG0 + state; - IfBit0(prob) - { - UpdateBit0(prob); - prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState; - IfBit0(prob) - { - #ifdef _LZMA_OUT_READ - UInt32 pos; - #endif - UpdateBit0(prob); - - #ifdef _LZMA_OUT_READ - if (distanceLimit == 0) - #else - if (nowPos == 0) - #endif - return LZMA_RESULT_DATA_ERROR; - - state = state < kNumLitStates ? 9 : 11; - #ifdef _LZMA_OUT_READ - pos = dictionaryPos - rep0; - if (pos >= dictionarySize) - pos += dictionarySize; - previousByte = dictionary[pos]; - dictionary[dictionaryPos] = previousByte; - if (++dictionaryPos == dictionarySize) - dictionaryPos = 0; - #else - previousByte = outStream[nowPos - rep0]; - #endif - outStream[nowPos++] = previousByte; - #ifdef _LZMA_OUT_READ - if (distanceLimit < dictionarySize) - distanceLimit++; - #endif - - continue; - } - else - { - UpdateBit1(prob); - } - } - else - { - UInt32 distance; - UpdateBit1(prob); - prob = p + IsRepG1 + state; - IfBit0(prob) - { - UpdateBit0(prob); - distance = rep1; - } - else - { - UpdateBit1(prob); - prob = p + IsRepG2 + state; - IfBit0(prob) - { - UpdateBit0(prob); - distance = rep2; - } - else - { - UpdateBit1(prob); - distance = rep3; - rep3 = rep2; - } - rep2 = rep1; - } - rep1 = rep0; - rep0 = distance; - } - state = state < kNumLitStates ? 8 : 11; - prob = p + RepLenCoder; + UpdateBit1(prob); + prob = p + IsRepG0 + state; + IfBit0(prob) + { + UpdateBit0(prob); + prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState; + IfBit0(prob) + { + #ifdef _LZMA_OUT_READ + UInt32 pos; + #endif + UpdateBit0(prob); + + #ifdef _LZMA_OUT_READ + if (distanceLimit == 0) + #else + if (nowPos == 0) + #endif + return LZMA_RESULT_DATA_ERROR; + + state = state < kNumLitStates ? 9 : 11; + #ifdef _LZMA_OUT_READ + pos = dictionaryPos - rep0; + if (pos >= dictionarySize) + pos += dictionarySize; + previousByte = dictionary[pos]; + dictionary[dictionaryPos] = previousByte; + if (++dictionaryPos == dictionarySize) + dictionaryPos = 0; + #else + previousByte = outStream[nowPos - rep0]; + #endif + outStream[nowPos++] = previousByte; + #ifdef _LZMA_OUT_READ + if (distanceLimit < dictionarySize) + distanceLimit++; + #endif + + continue; + } + else + { + UpdateBit1(prob); + } + } + else + { + UInt32 distance; + UpdateBit1(prob); + prob = p + IsRepG1 + state; + IfBit0(prob) + { + UpdateBit0(prob); + distance = rep1; + } + else + { + UpdateBit1(prob); + prob = p + IsRepG2 + state; + IfBit0(prob) + { + UpdateBit0(prob); + distance = rep2; + } + else + { + UpdateBit1(prob); + distance = rep3; + rep3 = rep2; + } + rep2 = rep1; + } + rep1 = rep0; + rep0 = distance; + } + state = state < kNumLitStates ? 8 : 11; + prob = p + RepLenCoder; } { - int numBits, offset; - CProb *probLen = prob + LenChoice; - IfBit0(probLen) - { - UpdateBit0(probLen); - probLen = prob + LenLow + (posState << kLenNumLowBits); - offset = 0; - numBits = kLenNumLowBits; - } - else - { - UpdateBit1(probLen); - probLen = prob + LenChoice2; - IfBit0(probLen) - { - UpdateBit0(probLen); - probLen = prob + LenMid + (posState << kLenNumMidBits); - offset = kLenNumLowSymbols; - numBits = kLenNumMidBits; - } - else - { - UpdateBit1(probLen); - probLen = prob + LenHigh; - offset = kLenNumLowSymbols + kLenNumMidSymbols; - numBits = kLenNumHighBits; - } - } - RangeDecoderBitTreeDecode(probLen, numBits, len); - len += offset; + int numBits, offset; + CProb *probLen = prob + LenChoice; + IfBit0(probLen) + { + UpdateBit0(probLen); + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + numBits = kLenNumLowBits; + } + else + { + UpdateBit1(probLen); + probLen = prob + LenChoice2; + IfBit0(probLen) + { + UpdateBit0(probLen); + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + numBits = kLenNumMidBits; + } + else + { + UpdateBit1(probLen); + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + numBits = kLenNumHighBits; + } + } + RangeDecoderBitTreeDecode(probLen, numBits, len); + len += offset; } if (state < 4) { - int posSlot; - state += kNumLitStates; - prob = p + PosSlot + - ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << - kNumPosSlotBits); - RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot); - if (posSlot >= kStartPosModelIndex) - { - int numDirectBits = ((posSlot >> 1) - 1); - rep0 = (2 | ((UInt32)posSlot & 1)); - if (posSlot < kEndPosModelIndex) - { - rep0 <<= numDirectBits; - prob = p + SpecPos + rep0 - posSlot - 1; - } - else - { - numDirectBits -= kNumAlignBits; - do - { - RC_NORMALIZE - Range >>= 1; - rep0 <<= 1; - if (Code >= Range) - { - Code -= Range; - rep0 |= 1; - } - } - while (--numDirectBits != 0); - prob = p + Align; - rep0 <<= kNumAlignBits; - numDirectBits = kNumAlignBits; - } - { - int i = 1; - int mi = 1; - do - { - CProb *prob3 = prob + mi; - RC_GET_BIT2(prob3, mi, ; , rep0 |= i); - i <<= 1; - } - while(--numDirectBits != 0); - } - } - else - rep0 = posSlot; - if (++rep0 == (UInt32)(0)) - { - /* it's for stream version */ - len = kLzmaStreamWasFinishedId; - break; - } + int posSlot; + state += kNumLitStates; + prob = p + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << + kNumPosSlotBits); + RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot); + if (posSlot >= kStartPosModelIndex) + { + int numDirectBits = ((posSlot >> 1) - 1); + rep0 = (2 | ((UInt32)posSlot & 1)); + if (posSlot < kEndPosModelIndex) + { + rep0 <<= numDirectBits; + prob = p + SpecPos + rep0 - posSlot - 1; + } + else + { + numDirectBits -= kNumAlignBits; + do + { + RC_NORMALIZE + Range >>= 1; + rep0 <<= 1; + if (Code >= Range) + { + Code -= Range; + rep0 |= 1; + } + } + while (--numDirectBits != 0); + prob = p + Align; + rep0 <<= kNumAlignBits; + numDirectBits = kNumAlignBits; + } + { + int i = 1; + int mi = 1; + do + { + CProb *prob3 = prob + mi; + RC_GET_BIT2(prob3, mi, ; , rep0 |= i); + i <<= 1; + } + while(--numDirectBits != 0); + } + } + else + rep0 = posSlot; + if (++rep0 == (UInt32)(0)) + { + /* it's for stream version */ + len = kLzmaStreamWasFinishedId; + break; + } } len += kMatchMinLen; #ifdef _LZMA_OUT_READ - if (rep0 > distanceLimit) + if (rep0 > distanceLimit) #else if (rep0 > nowPos) #endif - return LZMA_RESULT_DATA_ERROR; + return LZMA_RESULT_DATA_ERROR; #ifdef _LZMA_OUT_READ if (dictionarySize - distanceLimit > (UInt32)len) - distanceLimit += len; + distanceLimit += len; else - distanceLimit = dictionarySize; + distanceLimit = dictionarySize; #endif do { - #ifdef _LZMA_OUT_READ - UInt32 pos = dictionaryPos - rep0; - if (pos >= dictionarySize) - pos += dictionarySize; - previousByte = dictionary[pos]; - dictionary[dictionaryPos] = previousByte; - if (++dictionaryPos == dictionarySize) - dictionaryPos = 0; - #else - previousByte = outStream[nowPos - rep0]; - #endif - len--; - outStream[nowPos++] = previousByte; + #ifdef _LZMA_OUT_READ + UInt32 pos = dictionaryPos - rep0; + if (pos >= dictionarySize) + pos += dictionarySize; + previousByte = dictionary[pos]; + dictionary[dictionaryPos] = previousByte; + if (++dictionaryPos == dictionarySize) + dictionaryPos = 0; + #else + previousByte = outStream[nowPos - rep0]; + #endif + len--; + outStream[nowPos++] = previousByte; } while(len != 0 && nowPos < outSize); } diff --git a/archivers/7z/LzmaDecode.h b/archivers/7z/LzmaDecode.h index 2870eeb9..bd75525a 100755 --- a/archivers/7z/LzmaDecode.h +++ b/archivers/7z/LzmaDecode.h @@ -1,4 +1,4 @@ -/* +/* LzmaDecode.h LZMA Decoder interface @@ -8,14 +8,14 @@ LZMA SDK is licensed under two licenses: 1) GNU Lesser General Public License (GNU LGPL) 2) Common Public License (CPL) - It means that you can select one of these two licenses and + It means that you can select one of these two licenses and follow rules of that license. SPECIAL EXCEPTION: - Igor Pavlov, as the author of this code, expressly permits you to - statically or dynamically link your code (or bind by name) to the - interfaces of this file without subjecting your linked code to the - terms of the CPL or GNU LGPL. Any modifications or additions + Igor Pavlov, as the author of this code, expressly permits you to + statically or dynamically link your code (or bind by name) to the + interfaces of this file without subjecting your linked code to the + terms of the CPL or GNU LGPL. Any modifications or additions to this file, however, are subject to the LGPL or CPL terms. */ @@ -31,7 +31,7 @@ /* Use read function for output data */ /* #define _LZMA_PROB32 */ -/* It can increase speed on some 32-bit CPUs, +/* It can increase speed on some 32-bit CPUs, but memory usage will be doubled in that case */ /* #define _LZMA_LOC_OPT */ diff --git a/archivers/7z/LzmaTypes.h b/archivers/7z/LzmaTypes.h index 288c5e45..0072d99b 100755 --- a/archivers/7z/LzmaTypes.h +++ b/archivers/7z/LzmaTypes.h @@ -1,5 +1,5 @@ -/* -LzmaTypes.h +/* +LzmaTypes.h Types for LZMA Decoder @@ -13,12 +13,12 @@ This file is part of LZMA SDK 4.40 (2006-05-01) #ifndef _7ZIP_BYTE_DEFINED #define _7ZIP_BYTE_DEFINED typedef unsigned char Byte; -#endif +#endif #ifndef _7ZIP_UINT16_DEFINED #define _7ZIP_UINT16_DEFINED typedef unsigned short UInt16; -#endif +#endif #ifndef _7ZIP_UINT32_DEFINED #define _7ZIP_UINT32_DEFINED @@ -27,7 +27,7 @@ typedef unsigned long UInt32; #else typedef unsigned int UInt32; #endif -#endif +#endif /* #define _LZMA_SYSTEM_SIZE_T */ /* Use system's size_t. You can use it to enable 64-bit sizes supporting */ diff --git a/archivers/dms/pfile.c b/archivers/dms/pfile.c index 540d47e0..7677714b 100755 --- a/archivers/dms/pfile.c +++ b/archivers/dms/pfile.c @@ -118,18 +118,18 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o if ( (cmd == CMD_VIEW) || (cmd == CMD_VIEWFULL) ) { pv = (USHORT)(c_version/100); - write_log(" Created with DMS version %d.%02d ",pv,c_version-pv*100); + write_log (" Created with DMS version %d.%02d ",pv,c_version-pv*100); if (geninfo & 0x80) - write_log("Registered\n"); + write_log ("Registered\n"); else - write_log("Evaluation\n"); + write_log ("Evaluation\n"); - write_log(" Creation date : %s",ctime(&date)); - write_log(" Lowest track in archive : %d\n",from); - write_log(" Highest track in archive : %d\n",to); - write_log(" Packed data size : %lu\n",pkfsize); - write_log(" Unpacked data size : %lu\n",unpkfsize); - write_log(" Disk type of archive : "); + write_log (" Creation date : %s",ctime(&date)); + write_log (" Lowest track in archive : %d\n",from); + write_log (" Highest track in archive : %d\n",to); + write_log (" Packed data size : %lu\n",pkfsize); + write_log (" Unpacked data size : %lu\n",unpkfsize); + write_log (" Disk type of archive : "); /* The original DMS from SDS software (DMS up to 1.11) used other values */ /* in disk type to indicate formats as MS-DOS, AMax and Mac, but it was */ @@ -140,49 +140,49 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o case 0: case 1: /* Can also be a non-dos disk */ - write_log("AmigaOS 1.0 OFS\n"); + write_log ("AmigaOS 1.0 OFS\n"); break; case 2: - write_log("AmigaOS 2.0 FFS\n"); + write_log ("AmigaOS 2.0 FFS\n"); break; case 3: - write_log("AmigaOS 3.0 OFS / International\n"); + write_log ("AmigaOS 3.0 OFS / International\n"); break; case 4: - write_log("AmigaOS 3.0 FFS / International\n"); + write_log ("AmigaOS 3.0 FFS / International\n"); break; case 5: - write_log("AmigaOS 3.0 OFS / Dir Cache\n"); + write_log ("AmigaOS 3.0 OFS / Dir Cache\n"); break; case 6: - write_log("AmigaOS 3.0 FFS / Dir Cache\n"); + write_log ("AmigaOS 3.0 FFS / Dir Cache\n"); break; case 7: - write_log("FMS Amiga System File\n"); + write_log ("FMS Amiga System File\n"); break; default: - write_log("Unknown\n"); + write_log ("Unknown\n"); } - write_log(" Compression mode used : "); + write_log (" Compression mode used : "); if (cmode>6) - write_log("Unknown !\n"); + write_log ("Unknown !\n"); else - write_log("%s\n",modes[cmode]); - - write_log(" General info : "); - if ((geninfo==0)||(geninfo==0x80)) write_log("None"); - if (geninfo & 1) write_log("NoZero "); - if (geninfo & 2) write_log("Encrypted "); - if (geninfo & 4) write_log("Appends "); - if (geninfo & 8) write_log("Banner "); - if (geninfo & 16) write_log("HD "); - if (geninfo & 32) write_log("MS-DOS "); - if (geninfo & 64) write_log("DMS_DEV_Fixed "); - if (geninfo & 256) write_log("FILEID.DIZ"); - write_log("\n"); - - write_log(" Info Header CRC : %04X\n\n",hcrc); + write_log ("%s\n",modes[cmode]); + + write_log (" General info : "); + if ((geninfo==0)||(geninfo==0x80)) write_log ("None"); + if (geninfo & 1) write_log ("NoZero "); + if (geninfo & 2) write_log ("Encrypted "); + if (geninfo & 4) write_log ("Appends "); + if (geninfo & 8) write_log ("Banner "); + if (geninfo & 16) write_log ("HD "); + if (geninfo & 32) write_log ("MS-DOS "); + if (geninfo & 64) write_log ("DMS_DEV_Fixed "); + if (geninfo & 256) write_log ("FILEID.DIZ"); + write_log ("\n"); + + write_log (" Info Header CRC : %04X\n\n",hcrc); } @@ -196,8 +196,8 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o if (cmd == CMD_VIEWFULL) { - write_log(" Track Plength Ulength Cmode USUM HCRC DCRC Cflag\n"); - write_log(" ------ ------- ------- ------ ---- ---- ---- -----\n"); + write_log (" Track Plength Ulength Cmode USUM HCRC DCRC Cflag\n"); + write_log (" ------ ------- ------- ------ ---- ---- ---- -----\n"); } // if (((cmd==CMD_UNPACK) || (cmd==CMD_SHOWBANNER)) && (geninfo & 2) && (!pwd)) @@ -215,7 +215,7 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o } } - if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log("\n"); + if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log ("\n"); if (ret == DMS_FILE_END) ret = NO_PROBLEM; @@ -270,15 +270,15 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR if (cmd == CMD_VIEWFULL) { if (number==80) - write_log(" FileID "); + write_log (" FileID "); else if (number==0xffff) - write_log(" Banner "); + write_log (" Banner "); else if ((number==0) && (unpklen==1024)) - write_log(" FakeBB "); + write_log (" FakeBB "); else - write_log(" %2d ",(short)number); + write_log (" %2d ",(short)number); - write_log("%5d %5d %s %04X %04X %04X %0d\n", pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); + write_log ("%5d %5d %s %04X %04X %04X %0d\n", pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); } if ((pklen1 > TRACK_BUFFER_LEN) || (pklen2 >TRACK_BUFFER_LEN) || (unpklen > TRACK_BUFFER_LEN)) return ERR_BIGTRACK; @@ -296,7 +296,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR //if (pwd && (number!=80)) dms_decrypt(b1,pklen1); if ((cmd == CMD_UNPACK) && (number<80) && (unpklen>2048)) { - memset(b2, 0, unpklen); + memset(b2, 0, unpklen); if (!crcerr) Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum); if (zfile_fwrite(b2,1,(size_t)unpklen,fo) != unpklen) return ERR_CANTWRITE; @@ -420,7 +420,7 @@ static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, if (usum1 == Calc_CheckSum(b2,(ULONG)unpklen)) { passfound = maybeencrypted; if (passfound) - write_log("DMS: decryption key = 0x%04.4X\n", pass); + write_log ("DMS: decryption key = 0x%04.4X\n", pass); err = NO_PROBLEM; pass = prevpass; break; @@ -454,7 +454,7 @@ static void printbandiz(UCHAR *m, USHORT len){ while (i s_node[..] */ static unsigned short freq[TREESIZE]; diff --git a/archivers/lha/header.c b/archivers/lha/header.c index 2e908319..da1ec994 100755 --- a/archivers/lha/header.c +++ b/archivers/lha/header.c @@ -31,22 +31,22 @@ calc_sum(p, len) /* ------------------------------------------------------------------------ */ static unsigned short -get_word() +get_word () { int b0, b1; - b0 = get_byte(); - b1 = get_byte(); + b0 = get_byte (); + b1 = get_byte (); return (b1 << 8) + b0; } /* ------------------------------------------------------------------------ */ static void -put_word(v) +put_word (v) unsigned int v; { - put_byte(v); - put_byte(v >> 8); + put_byte (v); + put_byte (v >> 8); } /* ------------------------------------------------------------------------ */ @@ -55,10 +55,10 @@ get_longword() { long b0, b1, b2, b3; - b0 = get_byte(); - b1 = get_byte(); - b2 = get_byte(); - b3 = get_byte(); + b0 = get_byte (); + b1 = get_byte (); + b2 = get_byte (); + b3 = get_byte (); return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0; } @@ -67,10 +67,10 @@ static void put_longword(v) long v; { - put_byte(v); - put_byte(v >> 8); - put_byte(v >> 16); - put_byte(v >> 24); + put_byte (v); + put_byte (v >> 8); + put_byte (v >> 16); + put_byte (v >> 24); } /* ------------------------------------------------------------------------ */ @@ -422,7 +422,7 @@ get_header(fp, hdr) return FALSE; /* finish */ } setup_get(data + I_HEADER_LEVEL); - hdr->header_level = get_byte(); + hdr->header_level = get_byte (); if (hdr->header_level != 2 && zfile_fread(data + header_size, sizeof(char), 2, fp) < 2) { fatal_error("Invalid header (LHarc file ?)"); @@ -435,7 +435,7 @@ get_header(fp, hdr) } setup_get(data + I_HEADER_CHECKSUM); - checksum = get_byte(); + checksum = get_byte (); if (hdr->header_level == 2) { hdr->header_size = header_size + checksum*256; @@ -447,14 +447,14 @@ get_header(fp, hdr) hdr->packed_size = get_longword(); hdr->original_size = get_longword(); hdr->last_modified_stamp = get_longword(); - hdr->attribute = get_byte(); + hdr->attribute = get_byte (); - if ((hdr->header_level = get_byte()) != 2) { + if ((hdr->header_level = get_byte ()) != 2) { if (calc_sum(data + I_METHOD, header_size) != checksum) warning("Checksum error (LHarc file?)", ""); - name_length = get_byte(); + name_length = get_byte (); for (i = 0; i < name_length; i++) - hdr->name[i] = (char) get_byte(); + hdr->name[i] = (char) get_byte (); hdr->name[name_length] = '\0'; } else { @@ -479,55 +479,55 @@ get_header(fp, hdr) } } else { hdr->has_crc = TRUE; - hdr->crc = get_word(); + hdr->crc = get_word (); } if (extend_size >= 1) { - hdr->extend_type = get_byte(); + hdr->extend_type = get_byte (); extend_size--; } if (hdr->extend_type == EXTEND_UNIX || hdr->extend_type == EXTEND_AMIGAOS) { if (extend_size >= 11) { - hdr->minor_version = get_byte(); + hdr->minor_version = get_byte (); hdr->unix_last_modified_stamp = (time_t) get_longword(); - hdr->unix_mode = get_word(); - hdr->unix_uid = get_word(); - hdr->unix_gid = get_word(); + hdr->unix_mode = get_word (); + hdr->unix_uid = get_word (); + hdr->unix_gid = get_word (); extend_size -= 11; } else { hdr->extend_type = EXTEND_GENERIC; } } while (extend_size-- > 0) - dmy = get_byte(); + dmy = get_byte (); if (hdr->extend_type == EXTEND_UNIX) return TRUE; } else if (hdr->header_level == 1) { hdr->has_crc = TRUE; extend_size = header_size - name_length-25; - hdr->crc = get_word(); - hdr->extend_type = get_byte(); + hdr->crc = get_word (); + hdr->extend_type = get_byte (); while (extend_size-- > 0) - dmy = get_byte(); + dmy = get_byte (); } else { /* level 2 */ hdr->has_crc = TRUE; - hdr->crc = get_word(); - hdr->extend_type = get_byte(); - } + hdr->crc = get_word (); + hdr->extend_type = get_byte (); + } if (hdr->header_level > 0) { /* Extend Header */ if (hdr->header_level != 2) setup_get(data + hdr->header_size); ptr = get_ptr; - while ((header_size = get_word()) != 0) { + while ((header_size = get_word ()) != 0) { if (hdr->header_level != 2 && ((data + LZHEADER_STRAGE - get_ptr < header_size) || zfile_fread(get_ptr, sizeof(char), header_size, fp) < header_size)) { fatal_error("Invalid header (LHa file ?)"); return FALSE; } - switch (get_byte()) { + switch (get_byte ()) { case 0: /* * header crc @@ -541,7 +541,7 @@ get_header(fp, hdr) if (header_size >= 256) return FALSE; for (i = 0; i < header_size - 3; i++) - hdr->name[i] = (char) get_byte(); + hdr->name[i] = (char) get_byte (); hdr->name[header_size - 3] = '\0'; name_length = header_size - 3; break; @@ -552,7 +552,7 @@ get_header(fp, hdr) if (header_size >= FILENAME_LENGTH) return FALSE; for (i = 0; i < header_size - 3; i++) - dirname[i] = (char) get_byte(); + dirname[i] = (char) get_byte (); dirname[header_size - 3] = '\0'; convdelim(dirname, DELIM); dir_length = header_size - 3; @@ -565,22 +565,22 @@ get_header(fp, hdr) hdr->extend_type == EXTEND_HUMAN || hdr->extend_type == EXTEND_AMIGAOS || hdr->extend_type == EXTEND_GENERIC) - hdr->attribute = get_word(); + hdr->attribute = get_word (); break; case 0x50: /* * UNIX permission */ if (hdr->extend_type == EXTEND_UNIX) - hdr->unix_mode = get_word(); + hdr->unix_mode = get_word (); break; case 0x51: /* * UNIX gid and uid */ if (hdr->extend_type == EXTEND_UNIX) { - hdr->unix_gid = get_word(); - hdr->unix_uid = get_word(); + hdr->unix_gid = get_word (); + hdr->unix_uid = get_word (); } break; case 0x52: @@ -706,10 +706,10 @@ init_header(name, v_stat, hdr) strcpy(&hdr->name[len++], "/"); } -#ifdef S_IFLNK +#ifdef S_IFLNK if (is_symlink(v_stat)) { char lkname[257]; - int len; + int len; bcopy(LZHDIRS_METHOD, hdr->method, METHOD_TYPE_STRAGE); hdr->attribute = GENERIC_DIRECTORY_ATTRIBUTE; hdr->original_size = 0; diff --git a/archivers/lha/huf.c b/archivers/lha/huf.c index aee92849..33d23a25 100755 --- a/archivers/lha/huf.c +++ b/archivers/lha/huf.c @@ -21,7 +21,7 @@ unsigned short left[2 * NC - 1], right[2 * NC - 1]; unsigned char c_len[NC], pt_len[NPT]; unsigned short c_freq[2 * NC - 1], c_table[4096], c_code[NC], p_freq[2 * NP - 1], - pt_table[256], pt_code[NPT], t_freq[2 * NT - 1]; + pt_table[256], pt_code[NPT], t_freq[2 * NT - 1]; static unsigned char *buf; static unsigned int bufsiz; diff --git a/archivers/lha/slide.c b/archivers/lha/slide.c index 4d821ca6..ab721eac 100755 --- a/archivers/lha/slide.c +++ b/archivers/lha/slide.c @@ -186,8 +186,8 @@ static void update() } } #endif - n = fread_crc(&text[(unsigned)(txtsiz - dicsiz)], - (unsigned)dicsiz, infile); + n = fread_crc(&text[(unsigned)(txtsiz - dicsiz)], + (unsigned)dicsiz, infile); remainder += n; encoded_origsize += n; @@ -311,7 +311,7 @@ struct interfacing *lhinterface; crc = unpackable = 0; /* encode_alloc(); */ /* allocate_memory(); */ - init_slide(); + init_slide(); encode_set.encode_start(); memset(&text[0], ' ', (long)TXTSIZ); @@ -323,8 +323,8 @@ struct interfacing *lhinterface; pos = dicsiz; if (matchlen > remainder) matchlen = remainder; - hval = ((((text[dicsiz] << 5) ^ text[dicsiz + 1]) << 5) - ^ text[dicsiz + 2]) & (unsigned)(HSHSIZ - 1); + hval = ((((text[dicsiz] << 5) ^ text[dicsiz + 1]) << 5) + ^ text[dicsiz + 2]) & (unsigned)(HSHSIZ - 1); insert(); while (remainder > 0 && ! unpackable) { @@ -385,7 +385,7 @@ decode(lhinterface) unsigned int i, j, k, c; unsigned int dicsiz1, offset; unsigned char *dtext; - + #ifdef DEBUG fout = fopen("de", "wt"); diff --git a/archivers/lha/uae_lha.c b/archivers/lha/uae_lha.c index 8fa8602a..b48b85b5 100755 --- a/archivers/lha/uae_lha.c +++ b/archivers/lha/uae_lha.c @@ -45,7 +45,7 @@ struct zvolume *archive_directory_lha(struct zfile *zf) zn->method = i; } zfile_fseek(zf, hdr.packed_size, SEEK_CUR); - + } return zv; } @@ -73,7 +73,7 @@ struct zfile *archive_access_lha(struct znode *zn) case LARC_METHOD_NUM: /* -lzs- */ lhinterface.dicbit = 11; decode(&lhinterface); - break; + break; case LZHUFF1_METHOD_NUM: /* -lh1- */ case LZHUFF4_METHOD_NUM: /* -lh4- */ case LARC5_METHOD_NUM: /* -lz5- */ diff --git a/archivers/lzx/unlzx.c b/archivers/lzx/unlzx.c index 2354305a..2887833c 100755 --- a/archivers/lzx/unlzx.c +++ b/archivers/lzx/unlzx.c @@ -162,7 +162,7 @@ static void crc_calc(unsigned char *memory, unsigned int length) /* There is an alternate algorithm which is faster but also more complex. */ static int make_decode_table(int number_symbols, int table_size, - unsigned char *length, unsigned short *table) + unsigned char *length, unsigned short *table) { register unsigned char bit_num = 0; register int symbol; @@ -446,14 +446,14 @@ static int read_literal_table() { do /* symbol is longer than 6 bits */ { - symbol = huffman20_table[((control >> 6) & 1) + (symbol << 1)]; - if(!shift--) - { - shift += 16; - control += *source++ << 24; - control += *source++ << 16; - } - control >>= 1; + symbol = huffman20_table[((control >> 6) & 1) + (symbol << 1)]; + if(!shift--) + { + shift += 16; + control += *source++ << 24; + control += *source++ << 16; + } + control >>= 1; } while(symbol >= 20); temp = 6; } @@ -664,13 +664,13 @@ struct zfile *archive_access_lzx (struct znode *zn) unpsize -= s; crc_calc (pdest, s); } else { - write_log("LZX corrupt compressed data\n"); + write_log ("LZX corrupt compressed data\n"); goto end; } } /* pre-cache all files we just decompressed */ for (;;) { - if (znfirst->size && !znfirst->f) { + if (znfirst->size && !znfirst->f) { dstf = zfile_fopen_empty (znfirst->name, znfirst->size); zfile_fwrite(dbuf + znfirst->offset2, znfirst->size, 1, dstf); znfirst->f = dstf; @@ -741,25 +741,25 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file) actual = zfile_fread(header_comment, 1, temp, in_file); if(!zfile_ferror(in_file)) { - if(actual == temp) - { - header_comment[temp] = 0; - crc_calc(header_comment, temp); - if(sum == crc) - { + if(actual == temp) + { + header_comment[temp] = 0; + crc_calc(header_comment, temp); + if(sum == crc) + { unsigned int year, month, day; unsigned int hour, minute, second; unsigned char attributes; - attributes = archive_header[0]; /* file protection modes */ - unpack_size = (archive_header[5] << 24) + (archive_header[4] << 16) + (archive_header[3] << 8) + archive_header[2]; /* unpack size */ - pack_size = (archive_header[9] << 24) + (archive_header[8] << 16) + (archive_header[7] << 8) + archive_header[6]; /* packed size */ - temp = (archive_header[18] << 24) + (archive_header[19] << 16) + (archive_header[20] << 8) + archive_header[21]; /* date */ - year = ((temp >> 17) & 63) + 1970; - month = (temp >> 23) & 15; - day = (temp >> 27) & 31; - hour = (temp >> 12) & 31; - minute = (temp >> 6) & 63; - second = temp & 63; + attributes = archive_header[0]; /* file protection modes */ + unpack_size = (archive_header[5] << 24) + (archive_header[4] << 16) + (archive_header[3] << 8) + archive_header[2]; /* unpack size */ + pack_size = (archive_header[9] << 24) + (archive_header[8] << 16) + (archive_header[7] << 8) + archive_header[6]; /* packed size */ + temp = (archive_header[18] << 24) + (archive_header[19] << 16) + (archive_header[20] << 8) + archive_header[21]; /* date */ + year = ((temp >> 17) & 63) + 1970; + month = (temp >> 23) & 15; + day = (temp >> 27) & 31; + hour = (temp >> 12) & 31; + minute = (temp >> 6) & 63; + second = temp & 63; memset(&zai, 0, sizeof zai); zai.name = header_filename; @@ -786,26 +786,26 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file) zn = zvolume_addfile_abs(zv, &zai); zn->offset2 = merge_size; - //write_log("%d %d %d %s\n", unpack_size, merge_size, pack_size, zai.name); - total_pack += pack_size; - total_unpack += unpack_size; - total_files++; - merge_size += unpack_size; + //write_log ("%d %d %d %s\n", unpack_size, merge_size, pack_size, zai.name); + total_pack += pack_size; + total_unpack += unpack_size; + total_files++; + merge_size += unpack_size; if(pack_size) /* seek past the packed data */ - { - merge_size = 0; + { + merge_size = 0; zn->offset = zfile_ftell(in_file); zn->packedsize = pack_size; - if(!zfile_fseek(in_file, pack_size, SEEK_CUR)) - { - abort = 0; /* continue */ - } - } - else - abort = 0; /* continue */ - } - } + if(!zfile_fseek(in_file, pack_size, SEEK_CUR)) + { + abort = 0; /* continue */ + } + } + else + abort = 0; /* continue */ + } + } } } } diff --git a/archivers/xfd/main.c b/archivers/xfd/main.c new file mode 100755 index 00000000..9c590a64 --- /dev/null +++ b/archivers/xfd/main.c @@ -0,0 +1,17 @@ + + +#include + +void *xmalloc(int v) +{ + return malloc(v); +} + +void *zfile_fopen(const char *name, const char *mode) +{ + return fopen(name, mode); +} +void zfile_fclose(void *z) +{ + fclose(z); +} diff --git a/archivers/xfd/xfd.c b/archivers/xfd/xfd.c index 2796fa81..f56d5f2e 100755 --- a/archivers/xfd/xfd.c +++ b/archivers/xfd/xfd.c @@ -146,7 +146,7 @@ static int load_xfd(char *path) memcpy (codeptr + haddr, p, hsize); p += hsize; } else if (htype != 0x3eb) { - write_log("RELOC: unknown hunk %08X\n", htype); + write_log ("RELOC: unknown hunk %08X\n", htype); goto end; } htype = gl(p); @@ -154,24 +154,24 @@ static int load_xfd(char *path) if (htype == 0x3f2) continue; if (htype != 0x3ec) { - write_log("RELOC: expected 000003EC but got %08X\n", htype); + write_log ("RELOC: expected 000003EC but got %08X\n", htype); goto end; } relocnum = gl(p); p += 4; - relochunknum = gl(p); + relochunknum = gl(p); p += 4; - srchunk = hunks[relochunknum]; + srchunk = hunks[relochunknum]; for (j = 0; j < relocnum; j++) { uae_u32 off = gl(p); p += 4; pl(codeptr + haddr + off, gl(codeptr + haddr + off) + srchunk); } } - write_log("XFD slave '%s' loaded and relocated @%08X (%d bytes) succesfully\n", path, startaddr, codememory - startaddr); + write_log ("XFD slave '%s' loaded and relocated @%08X (%d bytes) succesfully\n", path, startaddr, codememory - startaddr); p = codeptr + startaddr + 8; if (gl(p + 4) != 'XFDF') { - write_log("XFD header corrupt\n"); + write_log ("XFD header corrupt\n"); goto end; } p = codeptr + gl(p + 20); @@ -184,7 +184,7 @@ static int load_xfd(char *path) uae_u8 *nameptr = codeptr + name; struct xfdslave *xfds; - write_log("- '%s' ver %d, master ver %d, minsize %d\n", + write_log ("- '%s' ver %d, master ver %d, minsize %d\n", nameptr, version, mversion, minsize); xfds = xcalloc(sizeof(struct xfdslave), 1); xfds->name = nameptr; @@ -208,7 +208,7 @@ end: static void initexec(void) { - + pl(codeptr + 4, exec); // fake memory allocation functions @@ -369,7 +369,7 @@ struct zfile *decompress_zfd(struct zfile *z) while (xfds) { uaecptr start = xfds->start; memset(&xregs, 0, sizeof xregs); - pl(codeptr + freememaddr, codememory + size); // reset start of "free memory" + pl(codeptr + freememaddr, codememory + size); // reset start of "free memory" xregs.regs[0] = size; // D0 xregs.regs[8] = codememory; // A0 xregs.regs[9] = bufferinfo; // A1 diff --git a/archivers/xfd/xfdmaster.h b/archivers/xfd/xfdmaster.h index 61b5367f..1241a332 100755 --- a/archivers/xfd/xfdmaster.h +++ b/archivers/xfd/xfdmaster.h @@ -72,7 +72,7 @@ struct xfdBufferInfo { APTR xfdbi_UserTargetBuf; /* (V38) Target buffer allocated by user */ ULONG xfdbi_UserTargetBufLen;/* (V38) Target buffer length */ ULONG xfdbi_MinSourceLen; /* (V39) minimum source length (tested by - master library */ + master library */ }; #define xfdbi_MaxSpecialLen xfdbi_Error /* Max. length of special info */ @@ -241,7 +241,7 @@ struct xfdScanHook { that support user targets */ #define XFDFB_USERTARGET 3 /* (V38) xfdbi_DecrunchBuffer() decrunchs to given xfdbi_UserTarget */ -#define XFDFB_MASTERALLOC 4 /* (V39) master allocated decrunch buffer */ +#define XFDFB_MASTERALLOC 4 /* (V39) master allocated decrunch buffer */ /* Bit masks */ #define XFDFF_RECOGEXTERN (1<changed) { rs->changed = 0; - fetch_screenshotpath(path, sizeof (path)); + fetch_screenshotpath (path, sizeof (path)); name[0] = 0; if (currprefs.dfxtype[0] >= 0) strcpy (name, currprefs.df[0]); if (!name[0]) underline[0] = 0; namesplit (name); - strcpy(extension, "wav"); - sprintf(filename,"%s%s%s%03.3d.%s", path, name, underline, cnt, extension); + strcpy (extension, "wav"); + sprintf (filename, "%s%s%s%03.3d.%s", path, name, underline, cnt, extension); wavfile = zfile_fopen(filename, "wb"); if (wavfile) { int freq = rs->per > 0 ? (currprefs.ntscmode ? 3579545 : 3546895 / rs->per) : 8000; - write_wavheader(wavfile, 0, 0); - convertsample(rs->sample, rs->len); - zfile_fwrite(rs->sample, rs->len, 1, wavfile); - convertsample(rs->sample, rs->len); - write_wavheader(wavfile, zfile_ftell(wavfile), freq); - zfile_fclose(wavfile); - write_log("SAMPLERIPPER: %d: %dHz %d bytes\n", cnt, freq, rs->len); + write_wavheader (wavfile, 0, 0); + convertsample (rs->sample, rs->len); + zfile_fwrite (rs->sample, rs->len, 1, wavfile); + convertsample (rs->sample, rs->len); + write_wavheader (wavfile, zfile_ftell(wavfile), freq); + zfile_fclose (wavfile); + write_log ("SAMPLERIPPER: %d: %dHz %d bytes\n", cnt, freq, rs->len); } else { - write_log("SAMPLERIPPER: failed to open '%s'\n", filename); + write_log ("SAMPLERIPPER: failed to open '%s'\n", filename); } } cnt++; @@ -210,14 +210,14 @@ void audio_sampleripper(int mode) } } -static void do_samplerip(struct audio_channel_data *adp) +static void do_samplerip (struct audio_channel_data *adp) { struct ripped_sample *rs = ripped_samples, *prev; int len = adp->len * 2; - uae_u8 *smp = chipmem_bank.xlateaddr(adp->pt); + uae_u8 *smp = chipmem_bank.xlateaddr (adp->pt); int cnt = 0, i; - if (!smp || !chipmem_bank.check(adp->pt, len)) + if (!smp || !chipmem_bank.check (adp->pt, len)) return; for (i = 0; i < len; i++) { if (smp[i] != 0) @@ -228,18 +228,18 @@ static void do_samplerip(struct audio_channel_data *adp) prev = NULL; while(rs) { if (rs->sample) { - if (len == rs->len && !memcmp(rs->sample, smp, len)) + if (len == rs->len && !memcmp (rs->sample, smp, len)) break; /* replace old identical but shorter sample */ - if (len > rs->len && !memcmp(rs->sample, smp, rs->len)) { + if (len > rs->len && !memcmp (rs->sample, smp, rs->len)) { xfree(rs->sample); - rs->sample = (uae_u8*)xmalloc(len); + rs->sample = (uae_u8*)xmalloc (len); memcpy(rs->sample, smp, len); - write_log("SAMPLERIPPER: replaced sample %d (%d -> %d)\n", cnt, rs->len, len); + write_log ("SAMPLERIPPER: replaced sample %d (%d -> %d)\n", cnt, rs->len, len); rs->len = len; rs->per = adp->per / CYCLE_UNIT; rs->changed = 1; - audio_sampleripper(0); + audio_sampleripper (0); return; } } @@ -256,12 +256,12 @@ static void do_samplerip(struct audio_channel_data *adp) ripped_samples = rs; rs->len = len; rs->per = adp->per / CYCLE_UNIT; - rs->sample = (uae_u8*)xmalloc(len); + rs->sample = (uae_u8*)xmalloc (len); memcpy(rs->sample, smp, len); rs->next = NULL; rs->changed = 1; - write_log("SAMPLERIPPER: sample added (%06.6X, %d bytes), total %d samples\n", adp->pt, len, ++cnt); - audio_sampleripper(0); + write_log ("SAMPLERIPPER: sample added (%06.6X, %d bytes), total %d samples\n", adp->pt, len, ++cnt); + audio_sampleripper (0); } static struct audio_channel_data audio_channel[4]; @@ -295,15 +295,15 @@ void init_sound_table8 (void) #define MULTIPLICATION_PROFITABLE #ifdef MULTIPLICATION_PROFITABLE -typedef uae_s8 sample8_t; -#define DO_CHANNEL_1(v, c) do { (v) *= audio_channel[c].vol; } while (0) -#define SBASEVAL16(logn) ((logn) == 1 ? SOUND16_BASE_VAL >> 1 : SOUND16_BASE_VAL) -#define FINISH_DATA(data,b,logn) do { if (14 - (b) + (logn) > 0) (data) >>= 14 - (b) + (logn); else (data) <<= (b) - 14 - (logn); } while (0); +typedef uae_s8 sample8_t; +#define DO_CHANNEL_1(v, c) do { (v) *= audio_channel[c].vol; } while (0) +#define SBASEVAL16(logn) ((logn) == 1 ? SOUND16_BASE_VAL >> 1 : SOUND16_BASE_VAL) +#define FINISH_DATA(data, b, logn) do { if (14 - (b) + (logn) > 0) (data) >>= 14 - (b) + (logn); else (data) <<= (b) - 14 - (logn); } while (0); #else -typedef uae_u8 sample8_t; -#define DO_CHANNEL_1(v, c) do { (v) = audio_channel[c].voltbl[(v)]; } while (0) -#define SBASEVAL16(logn) SOUND16_BASE_VAL -#define FINISH_DATA(data,b,logn) +typedef uae_u8 sample8_t; +#define DO_CHANNEL_1(v, c) do { (v) = audio_channel[c].voltbl[(v)]; } while (0) +#define SBASEVAL16(logn) SOUND16_BASE_VAL +#define FINISH_DATA(data, b, logn) #endif static uae_u32 right_word_saved[SOUND_MAX_DELAY_BUFFER]; @@ -336,7 +336,7 @@ enum { /* Amiga has two separate filtering circuits per channel, a static RC filter * on A500 and the LED filter. This code emulates both. - * + * * The Amiga filtering circuitry depends on Amiga model. Older Amigas seem * to have a 6 dB/oct RC filter with cutoff frequency such that the -6 dB * point for filter is reached at 6 kHz, while newer Amigas have no filtering. @@ -357,10 +357,10 @@ static int filter(int input, struct filter_state *fs) input = (uae_s16)input; switch (sound_use_filter) { - + case FILTER_NONE: return input; - case FILTER_MODEL_A500: + case FILTER_MODEL_A500: fs->rc1 = a500e_filter1_a0 * input + (1 - a500e_filter1_a0) * fs->rc1 + DENORMAL_OFFSET; fs->rc2 = a500e_filter2_a0 * fs->rc1 + (1-a500e_filter2_a0) * fs->rc2; normal_output = fs->rc2; @@ -370,21 +370,21 @@ static int filter(int input, struct filter_state *fs) fs->rc5 = filter_a0 * fs->rc4 + (1 - filter_a0) * fs->rc5; led_output = fs->rc5; - break; - + break; + case FILTER_MODEL_A1200: - normal_output = input; + normal_output = input; - fs->rc2 = filter_a0 * normal_output + (1 - filter_a0) * fs->rc2 + DENORMAL_OFFSET; - fs->rc3 = filter_a0 * fs->rc2 + (1 - filter_a0) * fs->rc3; - fs->rc4 = filter_a0 * fs->rc3 + (1 - filter_a0) * fs->rc4; + fs->rc2 = filter_a0 * normal_output + (1 - filter_a0) * fs->rc2 + DENORMAL_OFFSET; + fs->rc3 = filter_a0 * fs->rc2 + (1 - filter_a0) * fs->rc3; + fs->rc4 = filter_a0 * fs->rc3 + (1 - filter_a0) * fs->rc4; - led_output = fs->rc4; - break; + led_output = fs->rc4; + break; } - if (led_filter_on) + if (led_filter_on) o = led_output; else o = normal_output; @@ -451,12 +451,12 @@ STATIC_INLINE void put_sound_word_left2 (uae_u32 w) saved_ptr2 = (saved_ptr2 + 1) & mixed_stereo_size; lold = left2_word_saved[saved_ptr2] - SOUND16_BASE_VAL; - tmp = (rnew * mixed_mul1 + lold * mixed_mul2) / MIXED_STEREO_MAX; + tmp = (rnew * mixed_mul2 + lold * mixed_mul1) / MIXED_STEREO_SCALE; tmp += SOUND16_BASE_VAL; PUT_SOUND_WORD_RIGHT2 (tmp); rold = right2_word_saved[saved_ptr2] - SOUND16_BASE_VAL; - w = (lnew * mixed_mul1 + rold * mixed_mul2) / MIXED_STEREO_MAX; + w = (lnew * mixed_mul2 + rold * mixed_mul1) / MIXED_STEREO_SCALE; } PUT_SOUND_WORD_LEFT2 (w); } @@ -464,7 +464,7 @@ STATIC_INLINE void put_sound_word_left2 (uae_u32 w) #define DO_CHANNEL(v, c) do { (v) &= audio_channel[c].adk_mask; data += v; } while (0); -static void anti_prehandler(unsigned long best_evtime) +static void anti_prehandler (unsigned long best_evtime) { int i, output; struct audio_channel_data *acd; @@ -483,13 +483,13 @@ STATIC_INLINE void samplexx_anti_handler (int *datasp) int i; for (i = 0; i < 4; i++) { datasp[i] = audio_channel[i].sample_accum_time ? (audio_channel[i].sample_accum / audio_channel[i].sample_accum_time) : 0; - audio_channel[i].sample_accum = 0; + audio_channel[i].sample_accum = 0; audio_channel[i].sample_accum_time = 0; } } -static void sinc_prehandler(unsigned long best_evtime) +static void sinc_prehandler (unsigned long best_evtime) { int i, j, output; struct audio_channel_data *acd; @@ -499,29 +499,29 @@ static void sinc_prehandler(unsigned long best_evtime) output = (acd->current_sample * acd->vol) & acd->adk_mask; /* age the sinc queue and truncate it when necessary */ - for (j = 0; j < acd->sinc_queue_length; j += 1) { + for (j = 0; j < acd->sinc_queue_length; j += 1) { acd->sinc_queue[j].age += best_evtime; - if (acd->sinc_queue[j].age >= SINC_QUEUE_MAX_AGE) { - acd->sinc_queue_length = j; + if (acd->sinc_queue[j].age >= SINC_QUEUE_MAX_AGE) { + acd->sinc_queue_length = j; break; } } - - /* if output state changes, record the state change and also - * write data into sinc queue for mixing in the BLEP */ - if (acd->output_state != output) { - if (acd->sinc_queue_length > SINC_QUEUE_LENGTH - 1) { - //write_log("warning: sinc queue truncated. Last age: %d.\n", acd->sinc_queue[SINC_QUEUE_LENGTH-1].age); - acd->sinc_queue_length = SINC_QUEUE_LENGTH - 1; - } - /* make room for new and add the new value */ - memmove(&acd->sinc_queue[1], &acd->sinc_queue[0], - sizeof(acd->sinc_queue[0]) * acd->sinc_queue_length); - acd->sinc_queue_length += 1; - acd->sinc_queue[0].age = best_evtime; - acd->sinc_queue[0].output = output - acd->output_state; - acd->output_state = output; - } + + /* if output state changes, record the state change and also + * write data into sinc queue for mixing in the BLEP */ + if (acd->sinc_output_state != output) { + if (acd->sinc_queue_length > SINC_QUEUE_LENGTH - 1) { + //write_log ("warning: sinc queue truncated. Last age: %d.\n", acd->sinc_queue[SINC_QUEUE_LENGTH-1].age); + acd->sinc_queue_length = SINC_QUEUE_LENGTH - 1; + } + /* make room for new and add the new value */ + memmove (&acd->sinc_queue[1], &acd->sinc_queue[0], + sizeof(acd->sinc_queue[0]) * acd->sinc_queue_length); + acd->sinc_queue_length += 1; + acd->sinc_queue[0].age = best_evtime; + acd->sinc_queue[0].output = output - acd->sinc_output_state; + acd->sinc_output_state = output; + } } } @@ -535,22 +535,22 @@ STATIC_INLINE void samplexx_sinc_handler (int *datasp) if (sound_use_filter_sinc) { n = (sound_use_filter_sinc == FILTER_MODEL_A500) ? 0 : 2; - if (led_filter_on) - n += 1; + if (led_filter_on) + n += 1; } else { n = 4; } winsinc = winsinc_integral[n]; for (i = 0; i < 4; i += 1) { - int j, v; - struct audio_channel_data *acd = &audio_channel[i]; - /* The sum rings with harmonic components up to infinity... */ - int sum = acd->output_state << 17; - /* ...but we cancel them through mixing in BLEPs instead */ - for (j = 0; j < acd->sinc_queue_length; j += 1) - sum -= winsinc[acd->sinc_queue[j].age] * acd->sinc_queue[j].output; - v = sum >> 17; + int j, v; + struct audio_channel_data *acd = &audio_channel[i]; + /* The sum rings with harmonic components up to infinity... */ + int sum = acd->sinc_output_state << 17; + /* ...but we cancel them through mixing in BLEPs instead */ + for (j = 0; j < acd->sinc_queue_length; j += 1) + sum -= winsinc[acd->sinc_queue[j].age] * acd->sinc_queue[j].output; + v = sum >> 17; if (v > 32767) v = 32767; else if (v < -32768) @@ -562,7 +562,7 @@ STATIC_INLINE void samplexx_sinc_handler (int *datasp) static void sample16i_sinc_handler (void) { int datas[4], data1; - + samplexx_sinc_handler (datas); data1 = datas[0] + datas[3] + datas[1] + datas[2]; FINISH_DATA (data1, 16, 2); @@ -690,7 +690,7 @@ static void sample16i_crux_handler (void) { struct audio_channel_data *cdp; unsigned long ratio, ratio1; -#define INTERVAL (scaled_sample_evtime * 3) +#define INTERVAL (scaled_sample_evtime * 3) cdp = audio_channel + 0; ratio1 = cdp->per - cdp->evtime; ratio = (ratio1 << 12) / INTERVAL; @@ -888,7 +888,7 @@ static void sample16si_crux_handler (void) { struct audio_channel_data *cdp; unsigned long ratio, ratio1; -#define INTERVAL (scaled_sample_evtime * 3) +#define INTERVAL (scaled_sample_evtime * 3) cdp = audio_channel + 0; ratio1 = cdp->per - cdp->evtime; ratio = (ratio1 << 12) / INTERVAL; @@ -994,28 +994,28 @@ static void sample16si_rh_handler (void) #else void sample16s_handler (void) { - sample16_handler(); + sample16_handler (); } -void sample16si_crux_handler (void) +static void sample16si_crux_handler (void) { - sample16i_crux_handler(); + sample16i_crux_handler (); } -void sample16si_rh_handler (void) +static void sample16si_rh_handler (void) { - sample16i_rh_handler(); + sample16i_rh_handler (); } #endif static int audio_work_to_do; -static void zerostate(struct audio_channel_data *cdp) +static void zerostate (struct audio_channel_data *cdp) { cdp->state = 0; cdp->evtime = MAX_EV; cdp->request_word = 0; } -static void audio_event_reset(void) +static void audio_event_reset (void) { int i; @@ -1023,13 +1023,13 @@ static void audio_event_reset(void) next_sample_evtime = scaled_sample_evtime; for (i = 0; i < 4; i++) { struct audio_channel_data *cdp = audio_channel + i; - zerostate(cdp); + zerostate(cdp); } schedule_audio (); events_schedule (); } - -static void audio_deactivate(void) + +static void audio_deactivate (void) { if (!currprefs.sound_auto) return; @@ -1039,24 +1039,24 @@ static void audio_deactivate(void) audio_event_reset(); } -int audio_activate(void) +int audio_activate (void) { int ret = 0; - + if (!audio_work_to_do) { - restart_sound_buffer(); + restart_sound_buffer (); ret = 1; audio_event_reset(); } audio_work_to_do = 4 * maxvpos * 50; return ret; } -STATIC_INLINE int is_audio_active(void) + +STATIC_INLINE int is_audio_active (void) { return audio_work_to_do; } - void schedule_audio (void) { unsigned long best = MAX_EV; @@ -1078,7 +1078,7 @@ void schedule_audio (void) static int isirq (int nr) { - return INTREQR() & (0x80 << nr); + return INTREQR () & (0x80 << nr); } static void setirq (int nr) @@ -1328,7 +1328,7 @@ static float rc_calculate_a0(int sample_rate, int cutoff_freq) float omega; /* The BLT correction formula below blows up if the cutoff is above nyquist. */ if (cutoff_freq >= sample_rate / 2) - return 1.0; + return 1.0; omega = 2 * M_PI * cutoff_freq / sample_rate; /* Compensate for the bilinear transformation. This allows us to specify the @@ -1375,14 +1375,14 @@ void set_audio(void) currprefs.sound_stereo_swap_paula = changed_prefs.sound_stereo_swap_paula; currprefs.sound_stereo_swap_ahi = changed_prefs.sound_stereo_swap_ahi; if (currprefs.produce_sound >= 2) { - if (!init_audio ()) { + if (!init_audio ()) { if (! sound_available) { - write_log ("Sound is not supported.\n"); + write_log ("Sound is not supported.\n"); } else { - write_log ("Sorry, can't initialize sound.\n"); - currprefs.produce_sound = 0; - /* So we don't do this every frame */ - changed_prefs.produce_sound = 0; + write_log ("Sorry, can't initialize sound.\n"); + currprefs.produce_sound = 0; + /* So we don't do this every frame */ + changed_prefs.produce_sound = 0; } } } @@ -1736,7 +1736,7 @@ void audio_update_irq (uae_u16 v) if ((1 << i) & DEBUG_CHANNEL_MASK) { uae_u16 mask = 0x80 << i; if ((v2 & mask) != (v3 & mask)) - write_log("AUD%dINTREQ %d->%d %08.8X\n", i, !!(v3 & mask), !!(v2 & mask), M68K_GETPC); + write_log ("AUD%dINTREQ %d->%d %08.8X\n", i, !!(v3 & mask), !!(v2 & mask), M68K_GETPC); } } #endif @@ -1754,7 +1754,7 @@ void audio_update_adkmasks (void) if ((prevcon & 0xff) != (adkcon & 0xff)) { audio_activate(); #ifdef DEBUG_AUDIO - write_log("ADKCON=%02.2x %08.8X\n", adkcon & 0xff, M68K_GETPC); + write_log ("ADKCON=%02.2x %08.8X\n", adkcon & 0xff, M68K_GETPC); #endif prevcon = adkcon; } diff --git a/autoconf.c b/autoconf.c index 8622976b..0ceeaca5 100755 --- a/autoconf.c +++ b/autoconf.c @@ -241,7 +241,7 @@ void rtarea_init (void) #endif uae_boot_rom_size = here() - RTAREA_BASE; - init_extended_traps(); + init_extended_traps (); } volatile int uae_int_requested = 0; diff --git a/blitter.c b/blitter.c index 2357b2f5..20a5990b 100755 --- a/blitter.c +++ b/blitter.c @@ -28,13 +28,13 @@ /* we must not change ce-mode while blitter is running.. */ static int blitter_cycle_exact; -uae_u16 bltcon0,bltcon1; -uae_u32 bltapt,bltbpt,bltcpt,bltdpt; +uae_u16 bltcon0, bltcon1; +uae_u32 bltapt, bltbpt, bltcpt, bltdpt; int blinea_shift; static uae_u16 blinea, blineb; static int blitline, blitfc, blitfill, blitife, blitsing, blitdesc; -static int blitonedot,blitsign; +static int blitonedot, blitsign; static int blit_add; static int blit_modadda, blit_modaddb, blit_modaddc, blit_modaddd; static int blit_ch; @@ -71,7 +71,7 @@ static int ddat1use, ddat2use; /* -Confirmed blitter ínformation by Toni Wilen +Confirmed blitter information by Toni Wilen (order of channels or position of idle cycles are not confirmed) 1=BLTCON0 channel mask @@ -190,7 +190,7 @@ static const int blit_cycle_diagram_line[] = static const int blit_cycle_diagram_finald[] = { 0, 2, 0,4 }; -void build_blitfilltable(void) +void build_blitfilltable (void) { unsigned int d, fillmask; int i; @@ -222,22 +222,10 @@ static void blitter_dump (void) { write_log ("APT=%08.8X BPT=%08.8X CPT=%08.8X DPT=%08.8X\n", bltapt, bltbpt, bltcpt, bltdpt); write_log ("CON0=%04.4X CON1=%04.4X ADAT=%04.4X BDAT=%04.4X CDAT=%04.4X\n", - bltcon0, bltcon1, blt_info.bltadat, blt_info.bltbdat, blt_info.bltcdat); + bltcon0, bltcon1, blt_info.bltadat, blt_info.bltbdat, blt_info.bltcdat); write_log ("AFWM=%04.4X ALWM=%04.4X AMOD=%04.4X BMOD=%04.4X CMOD=%04.4X DMOD=%04.4X\n", - blt_info.bltafwm, blt_info.bltalwm, - blt_info.bltamod & 0xffff, blt_info.bltbmod & 0xffff, blt_info.bltcmod & 0xffff, blt_info.bltdmod & 0xffff); -} - -STATIC_INLINE uae_u8 *blit_xlateptr(uaecptr bltpt, int bytecount) -{ - if (!chipmem_bank.check(bltpt,bytecount)) return NULL; - return chipmem_bank.xlateaddr(bltpt); -} - -STATIC_INLINE uae_u8 *blit_xlateptr_desc(uaecptr bltpt, int bytecount) -{ - if (!chipmem_bank.check(bltpt-bytecount, bytecount)) return NULL; - return chipmem_bank.xlateaddr(bltpt); + blt_info.bltafwm, blt_info.bltalwm, + blt_info.bltamod & 0xffff, blt_info.bltbmod & 0xffff, blt_info.bltcmod & 0xffff, blt_info.bltdmod & 0xffff); } STATIC_INLINE int channel_state (int cycles) @@ -275,7 +263,7 @@ static void blitter_done (void) #endif } -static void blitter_dofast(void) +static void blitter_dofast (void) { int i,j; uaecptr bltadatptr = 0, bltbdatptr = 0, bltcdatptr = 0, bltddatptr = 0; @@ -370,7 +358,7 @@ static void blitter_dofast(void) bltstate = BLT_done; } -static void blitter_dofast_desc(void) +static void blitter_dofast_desc (void) { int i,j; uaecptr bltadatptr = 0, bltbdatptr = 0, bltcdatptr = 0, bltddatptr = 0; @@ -463,30 +451,30 @@ static void blitter_dofast_desc(void) bltstate = BLT_done; } -STATIC_INLINE void blitter_read(void) +STATIC_INLINE void blitter_read (void) { if (bltcon0 & 0x200) { - if (!dmaen(DMA_BLITTER)) + if (!dmaen (DMA_BLITTER)) return; blt_info.bltcdat = chipmem_bank.wget(bltcpt); } bltstate = BLT_work; } -STATIC_INLINE void blitter_write(void) +STATIC_INLINE void blitter_write (void) { if (blt_info.bltddat) blt_info.blitzero = 0; /* D-channel state has no effect on linedraw, but C must be enabled or nothing is drawn! */ if (bltcon0 & 0x200) { - if (!dmaen(DMA_BLITTER)) + if (!dmaen (DMA_BLITTER)) return; chipmem_bank.wput(bltdpt, blt_info.bltddat); } bltstate = BLT_next; } -STATIC_INLINE void blitter_line_incx(void) +STATIC_INLINE void blitter_line_incx (void) { if (++blinea_shift == 16) { blinea_shift = 0; @@ -494,7 +482,7 @@ STATIC_INLINE void blitter_line_incx(void) } } -STATIC_INLINE void blitter_line_decx(void) +STATIC_INLINE void blitter_line_decx (void) { if (blinea_shift-- == 0) { blinea_shift = 15; @@ -502,19 +490,19 @@ STATIC_INLINE void blitter_line_decx(void) } } -STATIC_INLINE void blitter_line_decy(void) +STATIC_INLINE void blitter_line_decy (void) { bltcpt -= blt_info.bltcmod; blitonedot = 0; } -STATIC_INLINE void blitter_line_incy(void) +STATIC_INLINE void blitter_line_incy (void) { bltcpt += blt_info.bltcmod; blitonedot = 0; } -static void blitter_line(void) +static void blitter_line (void) { uae_u16 blitahold = (blinea & blt_info.bltafwm) >> blinea_shift; uae_u16 blitbhold = blineb & 1 ? 0xFFFF : 0; @@ -526,12 +514,12 @@ static void blitter_line(void) blt_info.bltddat = blit_func(blitahold, blitbhold, blitchold, bltcon0 & 0xFF); } -static void blitter_line_proc(void) +static void blitter_line_proc (void) { - if (!blitsign){ + if (!blitsign) { if (bltcon0 & 0x800) bltapt += (uae_s16)blt_info.bltamod; - if (bltcon1 & 0x10){ + if (bltcon1 & 0x10) { if (bltcon1 & 0x8) blitter_line_decy(); else @@ -546,7 +534,7 @@ static void blitter_line_proc(void) if (bltcon0 & 0x800) bltapt += (uae_s16)blt_info.bltbmod; } - if (bltcon1 & 0x10){ + if (bltcon1 & 0x10) { if (bltcon1 & 0x4) blitter_line_decx(); else @@ -561,7 +549,7 @@ static void blitter_line_proc(void) bltstate = BLT_write; } -STATIC_INLINE void blitter_nxline(void) +STATIC_INLINE void blitter_nxline (void) { blineb = (blineb << 1) | (blineb >> 15); blt_info.vblitsize--; @@ -594,7 +582,7 @@ static void decide_blitter_line (int hpos) } break; } - if (canblit(blit_last_hpos) <= 0) + if (canblit (blit_last_hpos) <= 0) break; } blit_cyclecounter++; @@ -614,11 +602,11 @@ static void decide_blitter_line (int hpos) alloc_cycle_ext (blit_last_hpos, CYCLE_BLITTER); if (blt_info.vblitsize == 0) { bltdpt = bltcpt; - blitter_done(); - return; + blitter_done(); + return; } } - break; + break; } blit_last_hpos++; } @@ -631,33 +619,33 @@ static void decide_blitter_line (int hpos) #endif -static void actually_do_blit(void) +static void actually_do_blit (void) { if (blitline) { do { - blitter_read(); - blitter_line(); - blitter_line_proc(); - blitter_write(); + blitter_read (); + blitter_line (); + blitter_line_proc (); + blitter_write (); bltdpt = bltcpt; - blitter_nxline(); + blitter_nxline (); if (blt_info.vblitsize == 0) bltstate = BLT_done; } while (bltstate != BLT_done); } else { if (blitdesc) - blitter_dofast_desc(); + blitter_dofast_desc (); else - blitter_dofast(); + blitter_dofast (); bltstate = BLT_done; } } -void blitter_handler(uae_u32 data) +void blitter_handler (uae_u32 data) { static int blitter_stuck; - if (!dmaen(DMA_BLITTER)) { + if (!dmaen (DMA_BLITTER)) { event2_newevent (ev2_blitter, 10); blitter_stuck++; if (blitter_stuck < 20000 || !currprefs.immediate_blits) @@ -665,17 +653,17 @@ void blitter_handler(uae_u32 data) /* "free" blitter in immediate mode if it has been "stuck" ~3 frames * fixes some JIT game incompatibilities */ - write_log("Blitter force-unstuck!\n"); + write_log ("Blitter force-unstuck!\n"); } blitter_stuck = 0; if (blit_slowdown > 0 && !currprefs.immediate_blits) { event2_newevent (ev2_blitter, blit_slowdown); - blit_slowdown = -1; - return; + blit_slowdown = -1; + return; } #ifdef BLITTER_DEBUG if (!blitter_dontdo) - actually_do_blit(); + actually_do_blit (); else bltstate = BLT_done; #else @@ -812,13 +800,13 @@ void decide_blitter (int hpos) #ifdef BLITTER_DEBUG if (blitter_delayed_debug) { blitter_delayed_debug = 0; - blitter_dump(); + blitter_dump (); } #endif if (!blitter_cycle_exact) return; if (blitline) { - blt_info.got_cycle = 1; + blt_info.got_cycle = 1; decide_blitter_line (hpos); return; } @@ -852,7 +840,7 @@ void decide_blitter (int hpos) break; } - blt_info.got_cycle = 1; + blt_info.got_cycle = 1; if (c < 0) { /* no channel but bus still needs to be allocated.. */ alloc_cycle_ext (blit_last_hpos, CYCLE_BLITTER); blit_cyclecounter++; @@ -940,7 +928,7 @@ static void blit_bltset (int con) if (blitline) { if (blt_info.hblitsize != 2) write_log ("weird hblitsize in linemode: %d vsize=%d PC%=%x\n", - blt_info.hblitsize, blt_info.vblitsize, m68k_getpc(®s)); + blt_info.hblitsize, blt_info.vblitsize, m68k_getpc (®s)); blit_diag = blit_cycle_diagram_line; } else { if (con & 2) { @@ -952,7 +940,7 @@ static void blit_bltset (int con) static int warn = 1; if (warn) write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", - m68k_getpc(®s)); + m68k_getpc (®s)); warn = 0; blitife = 0; } @@ -961,13 +949,13 @@ static void blit_bltset (int con) static int warn = 1; if (warn) write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", - m68k_getpc(®s)); + m68k_getpc (®s)); warn = 0; } blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; } if ((bltcon1 & 0x80) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) - write_log("warning: ECS BLTCON1 DOFF-bit set\n"); + write_log ("warning: ECS BLTCON1 DOFF-bit set\n"); blit_dmacount = blit_dmacount2 = 0; blit_nod = 1; @@ -987,7 +975,7 @@ static void blit_bltset (int con) blt_info.blitdownbshift = 16 - blt_info.blitbshift; } -void blit_modset (void) +static void blit_modset (void) { int mult; @@ -1004,7 +992,7 @@ void reset_blit (int bltcon) if (bltstate == BLT_done) return; if (bltcon) - blit_bltset (bltcon); + blit_bltset (bltcon); blit_modset (); } @@ -1050,17 +1038,17 @@ void do_blitter (int hpos) if (1) { if (oldstate != BLT_done) write_log ("blitter was already active!\n"); - write_log("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%04.4X\n", + write_log ("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%04.4X\n", vpos, hpos, blt_info.hblitsize, blt_info.vblitsize, cycles, blit_ch, blitdesc ? 1 : 0, blitfill, - dmaen(DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, dmacon); + dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, dmacon); blitter_dump (); } #endif blit_slowdown = 0; unset_special (®s, SPCFLAG_BLTNASTY); - if (dmaen(DMA_BLITPRI)) + if (dmaen (DMA_BLITPRI)) set_special (®s, SPCFLAG_BLTNASTY); if (blt_info.vblitsize == 0 || (blitline && blt_info.hblitsize != 2)) { @@ -1068,7 +1056,7 @@ void do_blitter (int hpos) return; } - if (dmaen(DMA_BLITTER)) + if (dmaen (DMA_BLITTER)) bltstate = BLT_work; blit_maxcyclecounter = 0x7fffffff; @@ -1103,9 +1091,9 @@ void maybe_blit (int hpos, int hack) #ifndef BLITTER_DEBUG warned = 1; #endif - if (m68k_getpc(®s) < 0xe0000 || m68k_getpc(®s) >= 0x10000000) + if (m68k_getpc (®s) < 0xe0000 || m68k_getpc (®s) >= 0x10000000) write_log ("warning: Program does not wait for blitter %p vpos=%d tc=%d\n", - m68k_getpc(®s), vpos, blit_cyclecounter); + m68k_getpc (®s), vpos, blit_cyclecounter); } if (blitter_cycle_exact) { @@ -1128,7 +1116,7 @@ int blitnasty (void) int cycles, ccnt; if (bltstate == BLT_done) return 0; - if (!dmaen(DMA_BLITTER)) + if (!dmaen (DMA_BLITTER)) return 0; if (blit_last_cycle >= blit_diag[0] && blit_dmacount == blit_diag[1]) return 0; @@ -1182,7 +1170,7 @@ uae_u8 *restore_blitter (uae_u8 *src) return src; } -void restore_blitter_finish(void) +void restore_blitter_finish (void) { if (bltstate == BLT_init) { write_log ("blitter was started but DMA was inactive during save\n"); diff --git a/blitter2.c b/blitter2.c index d9aa4357..fd2d3202 100755 --- a/blitter2.c +++ b/blitter2.c @@ -376,7 +376,7 @@ STATIC_INLINE int blitter_read(void) if (bltcon0 & 0x200) { if (!dmaen(DMA_BLITTER)) return 1; - blt_info.bltcdat = chipmem_bank.wget(bltcpt); + blt_info.bltcdat = chipmem_bank.wget(bltcpt); } bltstate = BLT_work; return (bltcon0 & 0x200) != 0; @@ -492,27 +492,27 @@ static void actually_do_blit(void) blitter_dofast_desc(); else blitter_dofast(); - bltstate = BLT_done; + bltstate = BLT_done; } } void blitter_handler(void) { if (!dmaen(DMA_BLITTER)) { - eventtab[ev_blitter].active = 1; - eventtab[ev_blitter].oldcycles = get_cycles (); - eventtab[ev_blitter].evtime = 10 * CYCLE_UNIT + get_cycles (); /* wait a little */ - return; /* gotta come back later. */ + eventtab[ev_blitter].active = 1; + eventtab[ev_blitter].oldcycles = get_cycles (); + eventtab[ev_blitter].evtime = 10 * CYCLE_UNIT + get_cycles (); /* wait a little */ + return; /* gotta come back later. */ } if (blit_slowdown > 0) { eventtab[ev_blitter].active = 1; - eventtab[ev_blitter].oldcycles = get_cycles (); - eventtab[ev_blitter].evtime = blit_slowdown * CYCLE_UNIT + get_cycles (); - blit_slowdown = -1; - return; + eventtab[ev_blitter].oldcycles = get_cycles (); + eventtab[ev_blitter].evtime = blit_slowdown * CYCLE_UNIT + get_cycles (); + blit_slowdown = -1; + return; } #ifdef BLITTER_DEBUG - if (!blitter_dontdo) + if (!blitter_dontdo) actually_do_blit(); else bltstate = BLT_done; @@ -527,7 +527,7 @@ STATIC_INLINE int channel_state (int cycles) if (cycles < 0) return 0; if (cycles < blit_diag[0]) - return blit_diag[blit_diag[1] + 2 + cycles]; + return blit_diag[blit_diag[1] + 2 + cycles]; return blit_diag[((cycles - blit_diag[0]) % blit_diag[1]) + 2]; } @@ -562,24 +562,24 @@ STATIC_INLINE uae_u16 blitter_doblit (void) if (blitter_hcounter1 == blt_info.hblitsize - 1) bltadat &= blt_info.bltalwm; if (blitdesc) - blitahold = (((uae_u32)bltadat << 16) | preva) >> blt_info.blitdownashift; + blitahold = (((uae_u32)bltadat << 16) | preva) >> blt_info.blitdownashift; else - blitahold = (((uae_u32)preva << 16) | bltadat) >> blt_info.blitashift; + blitahold = (((uae_u32)preva << 16) | bltadat) >> blt_info.blitashift; preva = bltadat; ddat = blit_func (blitahold, blt_info.bltbhold, blt_info.bltcdat, mt) & 0xFFFF; if (bltcon1 & 0x18) { - uae_u16 d = ddat; - int ifemode = blitife ? 2 : 0; - int fc1 = blit_filltable[d & 255][ifemode + blitfc][1]; - ddat = (blit_filltable[d & 255][ifemode + blitfc][0] + uae_u16 d = ddat; + int ifemode = blitife ? 2 : 0; + int fc1 = blit_filltable[d & 255][ifemode + blitfc][1]; + ddat = (blit_filltable[d & 255][ifemode + blitfc][0] + (blit_filltable[d >> 8][ifemode + fc1][0] << 8)); - blitfc = blit_filltable[d >> 8][ifemode + fc1][1]; + blitfc = blit_filltable[d >> 8][ifemode + fc1][1]; } - + if (ddat) - blt_info.blitzero = 0; + blt_info.blitzero = 0; return ddat; } @@ -626,7 +626,7 @@ STATIC_INLINE void blitter_dodma (int ch) switch (ch) { case 1: - blt_info.bltadat = chipmem_agnus_wget (bltapt); + blt_info.bltadat = chipmem_agnus_wget (bltapt); bltapt += blit_add; break; case 2: @@ -675,7 +675,7 @@ static void decide_blitter_line (int hpos) while (blit_last_hpos < hpos) { int c = channel_state (blit_cyclecounter); for (;;) { - if (c && !canblit (blit_last_hpos)) + if (c && !canblit (blit_last_hpos)) break; if (c) cycle_line[blit_last_hpos] |= CYCLE_BLITTER; @@ -692,7 +692,7 @@ static void decide_blitter_line (int hpos) return; } } - break; + break; } blit_last_hpos++; } @@ -725,19 +725,19 @@ void decide_blitter (int hpos) } #endif for (;;) { - if (c && !canblit (blit_last_hpos)) { + if (c && !canblit (blit_last_hpos)) { blit_misscyclecounter++; break; } if (c == 4) { if (blitter_doddma ()) { cycle_line[blit_last_hpos] |= CYCLE_BLITTER; - blit_cyclecounter++; + blit_cyclecounter++; } } else if (c) { if (blitter_vcounter1 < blt_info.vblitsize) { cycle_line[blit_last_hpos] |= CYCLE_BLITTER; - blitter_dodma (c); + blitter_dodma (c); } blit_cyclecounter++; } else { @@ -758,7 +758,7 @@ void decide_blitter (int hpos) blit_diag = blit_cycle_diagram_finald; } } - break; + break; } blit_last_hpos++; } @@ -780,14 +780,14 @@ static void blitter_force_finish (void) if (bltstate != BLT_done) { /* blitter is currently running * force finish (no blitter state support yet) - */ + */ odmacon = dmacon; dmacon |= DMA_MASTER | DMA_BLITTER; write_log ("forcing blitter finish\n"); if (currprefs.blitter_cycle_exact) { int rounds = 10000; while (bltstate != BLT_done && rounds > 0) { - memset (cycle_line, 0, maxhpos); + memset (cycle_line, 0, maxhpos); decide_blitter (maxhpos); rounds--; } @@ -805,7 +805,7 @@ static void blit_bltset (int con) { int i; - blitline = bltcon1 & 1; + blitline = bltcon1 & 1; blitfill = bltcon1 & 0x18; blitdesc = bltcon1 & 2; blit_ch = (bltcon0 & 0x0f00) >> 8; @@ -816,7 +816,7 @@ static void blit_bltset (int con) if (blitline) { if (blt_info.hblitsize != 2) write_log ("weird hblitsize in linemode: %d vsize=%d PC%=%x\n", blt_info.hblitsize, blt_info.vblitsize, m68k_getpc()); - blit_diag = blit_cycle_diagram_line; + blit_diag = blit_cycle_diagram_line; blit_singlechannel = 1; } else { if (con & 2) { @@ -827,7 +827,7 @@ static void blit_bltset (int con) * negative effects. */ static int warn = 1; if (warn) - write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", m68k_getpc()); + write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", m68k_getpc ()); warn = 0; blitife = 0; } @@ -835,7 +835,7 @@ static void blit_bltset (int con) if (blitfill && !blitdesc) { static int warn = 1; if (warn) - write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", m68k_getpc()); + write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", m68k_getpc()); warn = 0; } blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; @@ -898,7 +898,7 @@ void do_blitter (int hpos) blit_maxcyclecounter = 0; blit_last_hpos = hpos; - reset_blit (1|2); + reset_blit (1|2); if (blitline) { blitsing = bltcon1 & 0x2; @@ -906,10 +906,10 @@ void do_blitter (int hpos) blineb = (blt_info.bltbdat >> blt_info.blitbshift) | (blt_info.bltbdat << (16 - blt_info.blitbshift)); blitsign = bltcon1 & 0x40; blitonedot = 0; - cycles = blt_info.vblitsize; + cycles = blt_info.vblitsize; } else { - blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT; - cycles = blt_info.vblitsize * blt_info.hblitsize; + blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT; + cycles = blt_info.vblitsize * blt_info.hblitsize; } #ifdef BLITTER_DEBUG @@ -917,10 +917,10 @@ void do_blitter (int hpos) if (1) { if (oldstate != BLT_done) write_log ("blitter was already active!\n"); - write_log("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%d\n", + write_log ("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%d\n", vpos, hpos, blt_info.hblitsize, blt_info.vblitsize, cycles, blit_ch, blitdesc ? 1 : 0, blitfill, - dmaen(DMA_BLITPRI) ? 1 : 0, m68k_getpc(), blitline, dmaen(DMA_BLITTER)); + dmaen(DMA_BLITPRI) ? 1 : 0, m68k_getpc (), blitline, dmaen(DMA_BLITTER)); blitter_dump (); } #endif @@ -928,11 +928,11 @@ void do_blitter (int hpos) unset_special (SPCFLAG_BLTNASTY); if (dmaen(DMA_BLITPRI)) - set_special (SPCFLAG_BLTNASTY); + set_special (SPCFLAG_BLTNASTY); if (blt_info.vblitsize == 0 || (blitline && blt_info.hblitsize != 2)) { - blitter_done (); - return; + blitter_done (); + return; } if (dmaen(DMA_BLITTER)) @@ -953,7 +953,7 @@ void do_blitter (int hpos) } if (currprefs.immediate_blits) - cycles = 1; + cycles = 1; eventtab[ev_blitter].active = 1; eventtab[ev_blitter].oldcycles = get_cycles (); @@ -974,7 +974,7 @@ void maybe_blit (int hpos, int hack) warned = 1; #endif write_log ("warning: Program does not wait for blitter %p vpos=%d tc=%d\n", - m68k_getpc(), vpos, blit_cyclecounter); + m68k_getpc (), vpos, blit_cyclecounter); } if (currprefs.blitter_cycle_exact) { @@ -998,7 +998,7 @@ int blitnasty (void) if (!dmaen(DMA_BLITTER)) return 0; if (blit_last_cycle >= blit_diag[0] && blit_dmacount == blit_diag[1]) - return 0; + return 0; cycles = (get_cycles () - blit_first_cycle) / CYCLE_UNIT; ccnt = 0; while (blit_last_cycle < cycles) { @@ -1014,7 +1014,7 @@ void blitter_slowdown (int ddfstrt, int ddfstop, int totalcycles, int freecycles { static int oddfstrt, oddfstop, ototal, ofree; static int slow; - + if (!totalcycles || ddfstrt < 0 || ddfstop < 0) return; if (ddfstrt != oddfstrt || ddfstop != oddfstop || totalcycles != ototal || ofree != freecycles) { @@ -1059,7 +1059,7 @@ uae_u8 *save_blitter (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (16); + dstbak = dst = malloc (16); save_u32((bltstate != BLT_done) ? 0 : 1); *len = dst - dstbak; return dstbak; diff --git a/blitter3.c b/blitter3.c index ae7c3b74..24d7789e 100755 --- a/blitter3.c +++ b/blitter3.c @@ -377,7 +377,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_bank.wget(bltcpt); } bltstate = BLT_work; } @@ -491,27 +491,27 @@ static void actually_do_blit(void) blitter_dofast_desc(); else blitter_dofast(); - bltstate = BLT_done; + bltstate = BLT_done; } } void blitter_handler(void) { if (!dmaen(DMA_BLITTER)) { - eventtab[ev_blitter].active = 1; - eventtab[ev_blitter].oldcycles = get_cycles (); - eventtab[ev_blitter].evtime = 10 * CYCLE_UNIT + get_cycles (); /* wait a little */ - return; /* gotta come back later. */ + eventtab[ev_blitter].active = 1; + eventtab[ev_blitter].oldcycles = get_cycles (); + eventtab[ev_blitter].evtime = 10 * CYCLE_UNIT + get_cycles (); /* wait a little */ + return; /* gotta come back later. */ } if (blit_slowdown > 0) { eventtab[ev_blitter].active = 1; - eventtab[ev_blitter].oldcycles = get_cycles (); - eventtab[ev_blitter].evtime = blit_slowdown * CYCLE_UNIT + get_cycles (); - blit_slowdown = -1; - return; + eventtab[ev_blitter].oldcycles = get_cycles (); + eventtab[ev_blitter].evtime = blit_slowdown * CYCLE_UNIT + get_cycles (); + blit_slowdown = -1; + return; } #ifdef BLITTER_DEBUG - if (!blitter_dontdo) + if (!blitter_dontdo) actually_do_blit(); else bltstate = BLT_done; @@ -526,7 +526,7 @@ STATIC_INLINE int channel_state (int cycles) if (cycles < 0) return 0; if (cycles < blit_diag[0]) - return blit_diag[blit_diag[1] + 2 + cycles]; + return blit_diag[blit_diag[1] + 2 + cycles]; return blit_diag[((cycles - blit_diag[0]) % blit_diag[1]) + 2]; } @@ -561,24 +561,24 @@ STATIC_INLINE uae_u16 blitter_doblit (void) if (blitter_hcounter1 == blt_info.hblitsize - 1) bltadat &= blt_info.bltalwm; if (blitdesc) - blitahold = (((uae_u32)bltadat << 16) | preva) >> blt_info.blitdownashift; + blitahold = (((uae_u32)bltadat << 16) | preva) >> blt_info.blitdownashift; else - blitahold = (((uae_u32)preva << 16) | bltadat) >> blt_info.blitashift; + blitahold = (((uae_u32)preva << 16) | bltadat) >> blt_info.blitashift; preva = bltadat; ddat = blit_func (blitahold, blt_info.bltbhold, blt_info.bltcdat, mt) & 0xFFFF; if (bltcon1 & 0x18) { - uae_u16 d = ddat; - int ifemode = blitife ? 2 : 0; - int fc1 = blit_filltable[d & 255][ifemode + blitfc][1]; - ddat = (blit_filltable[d & 255][ifemode + blitfc][0] + uae_u16 d = ddat; + int ifemode = blitife ? 2 : 0; + int fc1 = blit_filltable[d & 255][ifemode + blitfc][1]; + ddat = (blit_filltable[d & 255][ifemode + blitfc][0] + (blit_filltable[d >> 8][ifemode + fc1][0] << 8)); - blitfc = blit_filltable[d >> 8][ifemode + fc1][1]; + blitfc = blit_filltable[d >> 8][ifemode + fc1][1]; } - + if (ddat) - blt_info.blitzero = 0; + blt_info.blitzero = 0; return ddat; } @@ -625,7 +625,7 @@ STATIC_INLINE void blitter_dodma (int ch) switch (ch) { case 1: - blt_info.bltadat = chipmem_agnus_wget (bltapt); + blt_info.bltadat = chipmem_agnus_wget (bltapt); bltapt += blit_add; break; case 2: @@ -674,11 +674,11 @@ static void decide_blitter_line (int hpos) while (blit_last_hpos < hpos) { int c = channel_state (blit_cyclecounter); for (;;) { - if (blit_cyclecounter < 0) { + if (blit_cyclecounter < 0) { blit_cyclecounter++; break; } - if (c && !canblit (blit_last_hpos)) + if (c && !canblit (blit_last_hpos)) break; if (c) cycle_line[blit_last_hpos] |= CYCLE_BLITTER; @@ -703,11 +703,11 @@ static void decide_blitter_line (int hpos) blitter_nxline(); if (!ddat1use && !ddat2use && blt_info.vblitsize == 0) { bltstate = BLT_done; - blitter_done (); + blitter_done (); return; } } - break; + break; } blit_last_hpos++; } @@ -746,19 +746,19 @@ void decide_blitter (int hpos) } #endif for (;;) { - if (c && !canblit (blit_last_hpos)) { + if (c && !canblit (blit_last_hpos)) { blit_misscyclecounter++; break; } if (c == 4) { if (blitter_doddma ()) { cycle_line[blit_last_hpos] |= CYCLE_BLITTER; - blit_cyclecounter++; + blit_cyclecounter++; } } else if (c) { if (blitter_vcounter1 < blt_info.vblitsize) { cycle_line[blit_last_hpos] |= CYCLE_BLITTER; - blitter_dodma (c); + blitter_dodma (c); } blit_cyclecounter++; } else { @@ -779,7 +779,7 @@ void decide_blitter (int hpos) blit_diag = blit_cycle_diagram_finald; } } - break; + break; } blit_last_hpos++; } @@ -801,14 +801,14 @@ static void blitter_force_finish (void) if (bltstate != BLT_done) { /* blitter is currently running * force finish (no blitter state support yet) - */ + */ odmacon = dmacon; dmacon |= DMA_MASTER | DMA_BLITTER; write_log ("forcing blitter finish\n"); if (currprefs.blitter_cycle_exact) { int rounds = 10000; while (bltstate != BLT_done && rounds > 0) { - memset (cycle_line, 0, maxhpos); + memset (cycle_line, 0, maxhpos); decide_blitter (maxhpos); rounds--; } @@ -826,7 +826,7 @@ static void blit_bltset (int con) { int i; - blitline = bltcon1 & 1; + blitline = bltcon1 & 1; blitfill = bltcon1 & 0x18; blitdesc = bltcon1 & 2; blit_ch = (bltcon0 & 0x0f00) >> 8; @@ -837,7 +837,7 @@ static void blit_bltset (int con) if (blitline) { if (blt_info.hblitsize != 2) write_log ("weird hblitsize in linemode: %d vsize=%d PC%=%x\n", blt_info.hblitsize, blt_info.vblitsize, m68k_getpc()); - blit_diag = blit_cycle_diagram_line; + blit_diag = blit_cycle_diagram_line; blit_singlechannel = 1; } else { if (con & 2) { @@ -848,7 +848,7 @@ static void blit_bltset (int con) * negative effects. */ static int warn = 1; if (warn) - write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", m68k_getpc()); + write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", m68k_getpc ()); warn = 0; blitife = 0; } @@ -856,7 +856,7 @@ static void blit_bltset (int con) if (blitfill && !blitdesc) { static int warn = 1; if (warn) - write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", m68k_getpc()); + write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", m68k_getpc()); warn = 0; } blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; @@ -918,7 +918,7 @@ void do_blitter (int hpos) blit_maxcyclecounter = 0; blit_last_hpos = hpos; - reset_blit (1|2); + reset_blit (1|2); if (blitline) { blit_cyclecounter = -1; @@ -927,11 +927,11 @@ void do_blitter (int hpos) blineb = (blt_info.bltbdat >> blt_info.blitbshift) | (blt_info.bltbdat << (16 - blt_info.blitbshift)); blitsign = bltcon1 & 0x40; blitonedot = 0; - cycles = blt_info.vblitsize; + cycles = blt_info.vblitsize; } else { blit_cyclecounter = -1; - blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT; - cycles = blt_info.vblitsize * blt_info.hblitsize; + blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT; + cycles = blt_info.vblitsize * blt_info.hblitsize; } #ifdef BLITTER_DEBUG @@ -939,10 +939,10 @@ void do_blitter (int hpos) if (1) { if (oldstate != BLT_done) write_log ("blitter was already active!\n"); - write_log("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%d\n", + write_log ("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02.2X n=%d pc=%p l=%d dma=%d\n", vpos, hpos, blt_info.hblitsize, blt_info.vblitsize, cycles, blit_ch, blitdesc ? 1 : 0, blitfill, - dmaen(DMA_BLITPRI) ? 1 : 0, m68k_getpc(), blitline, dmaen(DMA_BLITTER)); + dmaen(DMA_BLITPRI) ? 1 : 0, m68k_getpc (), blitline, dmaen(DMA_BLITTER)); blitter_dump (); } #endif @@ -950,11 +950,11 @@ void do_blitter (int hpos) unset_special (SPCFLAG_BLTNASTY); if (dmaen(DMA_BLITPRI)) - set_special (SPCFLAG_BLTNASTY); + set_special (SPCFLAG_BLTNASTY); if (blt_info.vblitsize == 0 || (blitline && blt_info.hblitsize != 2)) { - blitter_done (); - return; + blitter_done (); + return; } if (dmaen(DMA_BLITTER)) @@ -975,7 +975,7 @@ void do_blitter (int hpos) } if (currprefs.immediate_blits) - cycles = 1; + cycles = 1; eventtab[ev_blitter].active = 1; eventtab[ev_blitter].oldcycles = get_cycles (); @@ -996,7 +996,7 @@ void maybe_blit (int hpos, int hack) warned = 1; #endif write_log ("warning: Program does not wait for blitter %p vpos=%d tc=%d\n", - m68k_getpc(), vpos, blit_cyclecounter); + m68k_getpc (), vpos, blit_cyclecounter); } if (currprefs.blitter_cycle_exact) { @@ -1024,7 +1024,7 @@ int blitnasty (void) if (!dmaen(DMA_BLITTER)) return 0; if (blit_last_cycle >= blit_diag[0] && blit_dmacount == blit_diag[1]) - return 0; + return 0; cycles = (get_cycles () - blit_first_cycle) / CYCLE_UNIT; ccnt = 0; while (blit_last_cycle < cycles) { @@ -1040,7 +1040,7 @@ void blitter_slowdown (int ddfstrt, int ddfstop, int totalcycles, int freecycles { static int oddfstrt, oddfstop, ototal, ofree; static int slow; - + if (!totalcycles || ddfstrt < 0 || ddfstop < 0) return; if (ddfstrt != oddfstrt || ddfstop != oddfstop || totalcycles != ototal || ofree != freecycles) { @@ -1085,7 +1085,7 @@ uae_u8 *save_blitter (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (16); + dstbak = dst = malloc (16); save_u32((bltstate != BLT_done) ? 0 : 1); *len = dst - dstbak; return dstbak; diff --git a/blkdev.c b/blkdev.c index 1a86c554..1bc95f55 100755 --- a/blkdev.c +++ b/blkdev.c @@ -238,7 +238,7 @@ int sys_command_ismedia (int mode, int unitnum, int quick) if (mode == DF_SCSI || !have_ioctl || !device_func[DF_IOCTL]->ismedia) { if (quick) return -1; - memset(&di, 0, sizeof di); + memset(&di, 0, sizeof di); device_func[DF_SCSI]->info (unitnum, &di); return di.media_inserted; } else { @@ -377,20 +377,20 @@ int sys_command_scsi_direct (int unitnum, uaecptr acmd) ap = get_long (acmd + 12); as.cmd_len = get_word (acmd + 16); for (i = 0; i < as.cmd_len; i++) - as.cmd[i] = get_byte(ap++); + as.cmd[i] = get_byte (ap++); as.flags = get_byte (acmd + 20); as.sense_len = get_word (acmd + 26); ret = sys_command_scsi_direct_native (unitnum, &as); - put_long(acmd + 8, as.actual); - put_word(acmd + 18, as.cmdactual); - put_byte(acmd + 21, as.status); - put_word(acmd + 28, as.sactual); + put_long (acmd + 8, as.actual); + put_word (acmd + 18, as.cmdactual); + put_byte (acmd + 21, as.status); + put_word (acmd + 28, as.sactual); - ap = get_long(acmd + 22); + ap = get_long (acmd + 22); for (i = 0; i < as.sactual; i++) - put_byte(ap, as.sensedata[i]); + put_byte (ap, as.sensedata[i]); return ret; } @@ -399,15 +399,15 @@ void scsi_log_before (uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen) { int i; for (i = 0; i < cdblen; i++) { - write_log("%s%02.2X", i > 0 ? "." : "", cdb[i]); + write_log ("%s%02.2X", i > 0 ? "." : "", cdb[i]); } - write_log("\n"); + write_log ("\n"); if (data) { write_log ("DATAOUT: %d\n", datalen); for (i = 0; i < datalen && i < 100; i++) - write_log("%s%02.2X", i > 0 ? "." : "", data[i]); + write_log ("%s%02.2X", i > 0 ? "." : "", data[i]); if (datalen > 0) - write_log("\n"); + write_log ("\n"); } } @@ -416,14 +416,14 @@ void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen) int i; write_log ("DATAIN: %d\n", datalen); for (i = 0; i < datalen && i < 100 && data; i++) - write_log("%s%02.2X", i > 0 ? "." : "", data[i]); + write_log ("%s%02.2X", i > 0 ? "." : "", data[i]); if (data && datalen > 0) - write_log("\n"); + write_log ("\n"); if (senselen > 0) { - write_log("SENSE: %d,", senselen); + write_log ("SENSE: %d,", senselen); for (i = 0; i < senselen && i < 32; i++) { - write_log("%s%02.2X", i > 0 ? "." : "", sense[i]); + write_log ("%s%02.2X", i > 0 ? "." : "", sense[i]); } - write_log("\n"); + write_log ("\n"); } } diff --git a/bsdsocket.c b/bsdsocket.c index 16060627..f80fca88 100755 --- a/bsdsocket.c +++ b/bsdsocket.c @@ -141,7 +141,7 @@ BOOL checksd(SB, int sd) if (s != INVALID_SOCKET) { for (iCounter = 1; iCounter <= sb->dtablesize; iCounter++) { if (iCounter != sd) { - if (getsock(sb,iCounter) == s) { + if (getsock(sb,iCounter) == s) { releasesock(sb,sd); return TRUE; } @@ -209,8 +209,8 @@ SOCKET_TYPE getsock (SB, int sd) if (!addr_valid("getsock4", ot1, 1)) break; if (strcmp(get_real_address (ot1), get_real_address (ot)) == 0) { - // Task with same name already exists -> use same dtable - if (sb1->dtable[sd - 1] != INVALID_SOCKET) + // Task with same name already exists -> use same dtable + if (sb1->dtable[sd - 1] != INVALID_SOCKET) return sb1->dtable[sd - 1]; } nsb = sb1->next; @@ -278,7 +278,7 @@ void bsdsock_fake_int_handler(void) bsd_int_requested = 0; if (sbsigqueue != NULL) { - SB; + SB; for (sb = sbsigqueue; sb; sb = sb->nextsig) { if (sb->dosignal == 1) { @@ -331,7 +331,7 @@ void waitsig (TrapContext *context, SB) long sigs; m68k_dreg (&context->regs, 0) = (((uae_u32) 1) << sb->signal) | sb->eintrsigs; if ((sigs = CallLib (context, get_long (4), -0x13e)) & sb->eintrsigs) { /* Wait */ - sockabort (sb); + sockabort (sb); bsdsocklib_seterrno (sb, 4); /* EINTR */ // Set signal @@ -751,8 +751,8 @@ static uae_u32 REGPARAM2 bsdsocklib_ObtainSocket (TrapContext *context) if (sd != -1) { sb->ftable[sd - 1] = sockdata->sockpoolflags[i]; - sockdata->sockpoolids[i] = UNIQUE_ID; - return sd - 1; + sockdata->sockpoolids[i] = UNIQUE_ID; + return sd - 1; } return -1; @@ -1091,7 +1091,7 @@ static const char *herrortexts[] = static uae_u32 herrnotextptrs[sizeof (herrortexts) / sizeof (*herrortexts)]; static const uae_u32 number_host_error = sizeof (herrortexts) / sizeof (*herrortexts); -static const char * const strErr = "Errlist lookup error"; +static const char * const strErr = "Errlist lookup error"; static uae_u32 strErrptr; @@ -1223,7 +1223,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) if (currtag & 1) { bsdsocklib_SetDTableSize(sb, currval); } else { - put_long(tagptr + 4, sb->dtablesize); + put_long (tagptr + 4, sb->dtablesize); } break; case SBTC_ERRNOSTRPTR: @@ -1232,12 +1232,12 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { unsigned long ulTmp; if (currtag & 0x8000) { /* SBTM_GETREF */ - ulTmp = get_long(currval); + ulTmp = get_long (currval); } else { /* SBTM_GETVAL */ ulTmp = currval; } TRACE (("ERRNOSTRPTR),%d", ulTmp)); - if (ulTmp < number_sys_error) { + if (ulTmp < number_sys_error) { tagcopy (currtag, currval, tagptr, &errnotextptrs[ulTmp]); } else { tagcopy (currtag, currval, tagptr, &strErrptr); @@ -1250,7 +1250,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { unsigned long ulTmp; if (currtag & 0x8000) { /* SBTM_GETREF */ - ulTmp = get_long(currval); + ulTmp = get_long (currval); } else { /* SBTM_GETVAL */ ulTmp = currval; } @@ -1291,7 +1291,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) TRACE (("TAG_UNKNOWN(0x%x)", currtag)); /* Aminetradio uses 0x00004e55 as an ending tag */ if ((currtag & 0xffff8000) == 0) { - write_log("bsdsocket: WARNING: Corrupted SocketBaseTagList(%x) tag detected (%08.8x)\n", + write_log ("bsdsocket: WARNING: Corrupted SocketBaseTagList(%x) tag detected (%08.8x)\n", m68k_areg (&context->regs, 0), currtag); goto done; } @@ -1489,7 +1489,7 @@ void bsdlib_install (void) if (!sockdata) { sockdata = (struct sockd*)xcalloc (sizeof (struct sockd), 1); - for (i = 0; i < SOCKPOOLSIZE; i++) + for (i = 0; i < SOCKPOOLSIZE; i++) sockdata->sockpoolids[i] = UNIQUE_ID; } diff --git a/catweasel.c b/catweasel.c index d7a1fbc7..81c68354 100755 --- a/catweasel.c +++ b/catweasel.c @@ -281,7 +281,7 @@ uae_u32 catweasel_do_bget (uaecptr addr) buf1[0] = (uae_u8)addr; if (handle != INVALID_HANDLE_VALUE) { if (!DeviceIoControl (handle, CW_PEEKREG_FULL, buf1, 1, buf2, 1, &did_read, 0)) - write_log("catweasel_do_bget fail err=%d\n", GetLastError()); + write_log ("catweasel_do_bget fail err=%d\n", GetLastError()); } else { buf2[0] = ioport_read (cwc.iobase + addr); } @@ -300,7 +300,7 @@ void catweasel_do_bput (uaecptr addr, uae_u32 b) buf[1] = b; if (handle != INVALID_HANDLE_VALUE) { if (!DeviceIoControl (handle, CW_POKEREG_FULL, buf, 2, 0, 0, &did_read, 0)) - write_log("catweasel_do_bput fail err=%d\n", GetLastError()); + write_log ("catweasel_do_bput fail err=%d\n", GetLastError()); } else { ioport_write (cwc.iobase + addr, b); } @@ -417,7 +417,7 @@ static int direct_detect(void) return 0; devInfoListDetail.cbSize = sizeof(devInfoListDetail); if(SetupDiGetDeviceInfoListDetail(devs,&devInfoListDetail)) { - devInfo.cbSize = sizeof(devInfo); + devInfo.cbSize = sizeof(devInfo); for(devIndex=0;SetupDiEnumDeviceInfo(devs,devIndex,&devInfo);devIndex++) { TCHAR devID[MAX_DEVICE_ID_LEN]; if(CM_Get_Device_ID_Ex(devInfo.DevInst,devID,MAX_DEVICE_ID_LEN,0,devInfoListDetail.RemoteMachineHandle)!=CR_SUCCESS) @@ -438,8 +438,8 @@ static int direct_detect(void) BOOL haveConfig = FALSE; ULONG dataSize; PBYTE resDesData; - RES_DES prevResDes, resDes; - RESOURCEID resId = ResType_IO; + RES_DES prevResDes, resDes; + RESOURCEID resId = ResType_IO; devInfoListDetail.cbSize = sizeof(devInfoListDetail); if((!SetupDiGetDeviceInfoListDetail(devs,&devInfoListDetail)) || @@ -491,7 +491,7 @@ static int direct_detect(void) if (resId == ResType_IO) { PIO_RESOURCE pIoData = (PIO_RESOURCE)resDesData; if(pIoData->IO_Header.IOD_Alloc_End-pIoData->IO_Header.IOD_Alloc_Base+1) { - write_log("CW: PCI SCAN: CWMK%d @%I64X - %I64X\n", cw, + write_log ("CW: PCI SCAN: CWMK%d @%I64X - %I64X\n", cw, pIoData->IO_Header.IOD_Alloc_Base,pIoData->IO_Header.IOD_Alloc_End); cwc.iobase = (int)pIoData->IO_Header.IOD_Alloc_Base; cwc.direct_type = cw; @@ -499,9 +499,9 @@ static int direct_detect(void) } free (resDesData); } - if(prevResDes != config) + if(prevResDes != config) CM_Free_Res_Des_Handle(prevResDes); - CM_Free_Log_Conf_Handle(config); + CM_Free_Log_Conf_Handle(config); } } } @@ -528,7 +528,7 @@ int catweasel_init(void) if (force_direct_catweasel >= 100) { - cwc.iobase = force_direct_catweasel & 0xffff; + cwc.iobase = force_direct_catweasel & 0xffff; if (force_direct_catweasel > 0xffff) { cwc.direct_type = force_direct_catweasel >> 16; } else { @@ -551,7 +551,7 @@ int catweasel_init(void) } if (handle == INVALID_HANDLE_VALUE) { - strcpy(name, "[DIRECT]"); + strcpy(name, "[DIRECT]"); if (cwc.direct_type && ioport_init()) { if (cwc.direct_type == 4 && catweasel4_configure()) { cwc.type = 4; @@ -630,7 +630,7 @@ int catweasel_init(void) sprintf(p, " SID1=%d", cwc.sid[1]); } } - write_log("%s\n", tmp); + write_log ("%s\n", tmp); detected = 1; return 1; @@ -671,14 +671,14 @@ int catweasel_detect (void) OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (h != INVALID_HANDLE_VALUE) { CloseHandle (h); - write_log("CW: Windows driver device detected '%s'\n", name); + write_log ("CW: Windows driver device detected '%s'\n", name); detected = 1; return TRUE; } } if (h == INVALID_HANDLE_VALUE) { if (force_direct_catweasel >= 100) { - if (ioport_init()) + if (ioport_init()) return TRUE; return FALSE; } @@ -725,7 +725,7 @@ static uae_u8 *mergepieces(uae_u8 *start,int len,int bits,uae_u8 *sync) uae_u8 b; int size; int shift; - + size=len-(sync-start); memcpy(dst,sync,size); dst+=size; @@ -739,7 +739,7 @@ static uae_u8 *mergepieces(uae_u8 *start,int len,int bits,uae_u8 *sync) start++; } return tmpmfmbuffer; -} +} #define SCANOFFSET 1 /* scanning range in bytes, -SCANOFFSET to SCANOFFSET */ #define SCANOFFSET2 20 @@ -749,7 +749,7 @@ static uae_u8* scantrack(uae_u8 *sync1,uae_u8 *sync2,int *trackbytes,int *trackb { int i,bits,bytes,matched; uae_u8 *sync2bak=sync2; - + sync1+=SCANOFFSET2; sync2+=SCANOFFSET2; while(sync1 < sync2bak - 2*SCANOFFSET - SCANOFFSET2 - SCANLENGHT) { @@ -776,7 +776,7 @@ static uae_u8* scantrack(uae_u8 *sync1,uae_u8 *sync2,int *trackbytes,int *trackb sync2++; } return 0; -} +} static unsigned char threshtab[128]; @@ -870,7 +870,7 @@ void catweasel_init_controller(catweasel_contr *c) c->drives[i].number = i; c->drives[i].contr = c; c->drives[i].diskindrive = 0; - + /* select only the respective drive, step to track 0 */ if(i == 0) { CWSetCReg(c, c->crm_sel0, c->crm_dir | c->crm_sel1); @@ -882,7 +882,7 @@ void catweasel_init_controller(catweasel_contr *c) CWTriggerStep(c); sleep_millis(6); } - + if(j < 86) { c->drives[i].type = 1; c->drives[i].track = 0; @@ -1300,7 +1300,7 @@ int catweasel_fillmfm (catweasel_drive *d, uae_u16 *mfm, int side, int clock, in } return 0; } - + int catweasel_read(catweasel_drive *d, int side, int clock, int rawmode) { int iobase = d->contr->iobase; diff --git a/cdrom.c b/cdrom.c index a19fcdee..ad869605 100755 --- a/cdrom.c +++ b/cdrom.c @@ -116,9 +116,9 @@ static uae_u8 DP[2][24] = { #define L2_P (43*2*2) #define RS_L12_BITS 8 -static uae_u32 build_edc(uae_u8 *inout, int from, int upto) +static uae_u32 build_edc (const uae_u8 *inout, int from, int upto) { - uae_u8 *p = inout + from; + const uae_u8 *p = inout + from; uae_u32 result = 0; for (; from <= upto; from++) result = EDC_crctable[(result ^ *p++) & 0xff] ^ (result >> 8); diff --git a/cdtv.c b/cdtv.c index 0e250afb..0115ba68 100755 --- a/cdtv.c +++ b/cdtv.c @@ -39,13 +39,13 @@ /* ISTR bits. */ #define ISTR_INTX (1<<8) #define ISTR_INT_F (1<<7) -#define ISTR_INTS (1<<6) +#define ISTR_INTS (1<<6) #define ISTR_E_INT (1<<5) #define ISTR_INT_P (1<<4) -#define ISTR_UE_INT (1<<3) +#define ISTR_UE_INT (1<<3) #define ISTR_OE_INT (1<<2) #define ISTR_FF_FLG (1<<1) -#define ISTR_FE_FLG (1<<0) +#define ISTR_FE_FLG (1<<0) #define AUDIO_STATUS_NOT_SUPPORTED 0x00 #define AUDIO_STATUS_IN_PROGRESS 0x11 @@ -122,7 +122,7 @@ static int get_toc(void) { uae_u8 *buf; int i; - + datatrack = 0; buf = sys_command_cd_toc (DF_IOCTL, unitnum); if (!buf) @@ -194,7 +194,7 @@ static int pause_audio (int pause) static int read_sectors(int start, int length) { - write_log("READ DATA sector %d, %d sectors (blocksize=%d)\n", start, length, cdtv_sectorsize); + write_log ("READ DATA sector %d, %d sectors (blocksize=%d)\n", start, length, cdtv_sectorsize); cdrom_sector = start; cdrom_sectors = length; cdrom_offset = start * cdtv_sectorsize; @@ -240,7 +240,7 @@ static int play_cdtrack (uae_u8 *p) i /= 11; end = last_cd_position; for (j = 0; j < i; j++) { - uae_u8 *s = cdrom_toc + 4 + j * 11; + uae_u8 *s = cdrom_toc + 4 + j * 11; if (track_start == s[3]) start = (s[8] << 16) | (s[9] << 8) | s[10]; if (track_end == s[3]) @@ -248,7 +248,7 @@ static int play_cdtrack (uae_u8 *p) } play_end = msf2lsn(end); play_start = msf2lsn(start); - write_log("PLAY CD AUDIO from %d-%d, %06.6X (%d) to %06.6X (%d)\n", + write_log ("PLAY CD AUDIO from %d-%d, %06.6X (%d) to %06.6X (%d)\n", track_start, track_end, start, msf2lsn(start), end, msf2lsn(end)); play_state = 1; return 0; @@ -286,7 +286,7 @@ static int play_cd(uae_u8 *p) end = last_cd_position; play_end = msf2lsn(end); play_start = msf2lsn(start); - write_log("PLAY CD AUDIO from %06.6X (%d) to %06.6X (%d)\n", + write_log ("PLAY CD AUDIO from %06.6X (%d) to %06.6X (%d)\n", start, msf2lsn(start), end, msf2lsn(end)); play_state = 1; return 0; @@ -340,7 +340,7 @@ static int cdrom_info(uae_u8 *out) size = ((p[8] << 16) | (p[9] << 8) | p[10]); out[2] = size >> 16; out[3] = size >> 8; - out[4] = size >> 0; + out[4] = size >> 0; cd_finished = 1; return 5; } @@ -359,7 +359,7 @@ static int read_toc(int track, int msflsn, uae_u8 *out) i -= 2; i /= 11; for (j = 0; j < i; j++) { - s = buf + 4 + j * 11; + s = buf + 4 + j * 11; if (track == s[3]) { uae_u32 msf = (s[8] << 16) | (s[9] << 8) | s[10]; uae_u32 lsn = msf2lsn (msf); @@ -382,7 +382,7 @@ static int cdrom_modeset(uae_u8 *cmd) { cdtv_sectorsize = (cmd[2] << 8) | cmd[3]; if (cdtv_sectorsize != 2048 && cdtv_sectorsize != 2336) { - write_log("CDTV: tried to set unknown sector size %d\n", cdtv_sectorsize); + write_log ("CDTV: tried to set unknown sector size %d\n", cdtv_sectorsize); cdtv_sectorsize = 2048; } return 0; @@ -399,12 +399,12 @@ static void cdrom_command_accepted(int size, uae_u8 *cdrom_command_input, int *c tmp[0] = 0; for (i = 0; i < *cdrom_command_cnt_in; i++) sprintf(tmp + i * 3, "%02.2X%c", cdrom_command_input[i], i < *cdrom_command_cnt_in - 1 ? '.' : ' '); - write_log("CD<-: %s\n", tmp); + write_log ("CD<-: %s\n", tmp); if (size > 0) { tmp[0] = 0; for (i = 0; i < size; i++) sprintf(tmp + i * 3, "%02.2X%c", cdrom_command_output[i], i < size - 1 ? '.' : ' '); - write_log("CD->: %s\n", tmp); + write_log ("CD->: %s\n", tmp); } #endif *cdrom_command_cnt_in = 0; @@ -461,8 +461,8 @@ static void cdrom_command_thread(uae_u8 b) cdrom_command_accepted(play_cdtrack(cdrom_command_input), s, &cdrom_command_cnt_in); } break; - case 0x81: - if (cdrom_command_cnt_in == 1) { + case 0x81: + if (cdrom_command_cnt_in == 1) { uae_u8 flag = 0; if (!cd_isready) flag |= 1 << 0; @@ -529,7 +529,7 @@ static void cdrom_command_thread(uae_u8 b) } break; default: - write_log("unknown CDROM command %02.2X!\n", s[0]); + write_log ("unknown CDROM command %02.2X!\n", s[0]); cd_error = 1; cdrom_command_accepted(0, s, &cdrom_command_cnt_in); break; @@ -568,13 +568,13 @@ static uae_u8 *read_raw(int sector, int size) zfile_fclose(f); f = zfile_fopen(fname, "rb"); if (!f) - write_log("failed to open '%s'\n", fname); + write_log ("failed to open '%s'\n", fname); else - write_log("opened '%s'\n", fname); + write_log ("opened '%s'\n", fname); track = trackcnt; } if (f) { - write_log("%dx%d=%d\n", sector, size, sector * size); + write_log ("%dx%d=%d\n", sector, size, sector * size); zfile_fseek (f, sector * size, SEEK_SET); zfile_fread (buf, size, 1, f); return buf; @@ -587,7 +587,7 @@ static void dma_do_thread(void) static int readsector; uae_u8 *p = NULL; - write_log("DMAC DMA: sector=%d, addr=%08.8X, words=%d\n", cdrom_offset / cdtv_sectorsize, dmac_acr, dmac_wtc); + write_log ("DMAC DMA: sector=%d, addr=%08.8X, words=%d\n", cdrom_offset / cdtv_sectorsize, dmac_acr, dmac_wtc); dma_wait += dmac_wtc * (uae_u64)312 * 50 / 75 + 1; while (dmac_wtc > 0 && dmac_dma) { if (!p || readsector != (cdrom_offset / cdtv_sectorsize)) { @@ -604,21 +604,21 @@ static void dma_do_thread(void) } } - put_byte (dmac_acr, p[(cdrom_offset % cdtv_sectorsize) + 0]); - put_byte (dmac_acr + 1, p[(cdrom_offset % cdtv_sectorsize) + 1]); - dmac_wtc--; - dmac_acr+=2; - cdrom_length-=2; + put_byte (dmac_acr, p[(cdrom_offset % cdtv_sectorsize) + 0]); + put_byte (dmac_acr + 1, p[(cdrom_offset % cdtv_sectorsize) + 1]); + dmac_wtc--; + dmac_acr+=2; + cdrom_length-=2; cdrom_offset+=2; } dmac_dma = 0; dma_finished = 1; cd_finished = 1; } - + static void *dev_thread (void *p) { - write_log("CDTV: CD thread started\n"); + write_log ("CDTV: CD thread started\n"); thread_alive = 1; for (;;) { @@ -693,7 +693,7 @@ static void tp_check_interrupts(void) static void tp_bput (int addr, uae_u8 v) { #ifdef CDTV_DEBUG_6525 - write_log("6525 write %x=%02.2X PC=%x\n", addr, v, M68K_GETPC); + write_log ("6525 write %x=%02.2X PC=%x\n", addr, v, M68K_GETPC); #endif switch (addr) { @@ -735,13 +735,13 @@ static uae_u8 tp_bget(int addr) { case 0: v = tp_a; - write_log("TPA read!\n"); + write_log ("TPA read!\n"); break; case 1: v = tp_b; break; case 2: - v = (sbcp << 0) | ((scor ^ 1) << 1) | ((stch ^ 1) << 2) | (sten << 3); + v = (sbcp << 0) | ((scor ^ 1) << 1) | ((stch ^ 1) << 2) | (sten << 3); if (tp_cr & 1) { if (!v) v |= 1 << 5; // /IRQ @@ -771,7 +771,7 @@ static uae_u8 tp_bget(int addr) #ifdef CDTV_DEBUG_6525 if (addr < 7) - write_log("6525 read %x=%02.2X PC=%x\n", addr, v, M68K_GETPC); + write_log ("6525 read %x=%02.2X PC=%x\n", addr, v, M68K_GETPC); #endif return v; } @@ -811,7 +811,7 @@ static void do_hunt(void) if (sys_command_open(DF_IOCTL, i) > 0) { unitnum = i; cd_hunt = 0; - write_log("CDTV: autodetected unit %d\n", unitnum); + write_log ("CDTV: autodetected unit %d\n", unitnum); } else { unitnum = -1; } @@ -821,8 +821,8 @@ static void checkint(void) { int irq = 0; if (currprefs.cs_cdtvscsi && (wdscsi_getauxstatus() & 0x80)) { - dmac_istr |= ISTR_INTS; - if ((dmac_cntr & CNTR_INTEN) && (dmac_istr & ISTR_INTS)) + dmac_istr |= ISTR_INTS; + if ((dmac_cntr & CNTR_INTEN) && (dmac_istr & ISTR_INTS)) irq = 1; } if ((dmac_cntr & CNTR_INTEN) && (dmac_istr & ISTR_E_INT)) @@ -843,7 +843,7 @@ void CDTV_hsync_handler(void) if (dma_wait >= 1024) dma_wait -= 1024; if (dma_wait >= 0 && dma_wait < 1024 && dma_finished) { - if ((dmac_cntr & (CNTR_INTEN | CNTR_TCEN)) == (CNTR_INTEN | CNTR_TCEN)) { + if ((dmac_cntr & (CNTR_INTEN | CNTR_TCEN)) == (CNTR_INTEN | CNTR_TCEN)) { dmac_istr |= ISTR_INT_P | ISTR_E_INT; } dma_finished = 0; @@ -869,7 +869,7 @@ void CDTV_hsync_handler(void) } else if (play_statewait > 0) { play_statewait--; } else if (play_state == 2) { - write_comm_pipe_u32 (&requests, 0x0110, 1); + write_comm_pipe_u32 (&requests, 0x0110, 1); play_state = 0; } @@ -889,13 +889,13 @@ void CDTV_hsync_handler(void) subqcnt--; if (subqcnt < 0) { - write_comm_pipe_u32 (&requests, 0x0101, 1); + write_comm_pipe_u32 (&requests, 0x0101, 1); subqcnt = 75; if (cd_hunt) do_hunt(); } if (activate_stch) - do_stch(); + do_stch(); } static void do_stch(void) @@ -905,7 +905,7 @@ static void do_stch(void) activate_stch = 0; tp_air |= 1 << 2; INT2(); - write_log("STCH %d\n", stch_cnt++); + write_log ("STCH %d\n", stch_cnt++); } } @@ -921,7 +921,7 @@ void bleh(void) static void cdtv_reset (void) { - write_log("CDTV: reset\n"); + write_log ("CDTV: reset\n"); cdaudiostop(); cd_playing = cd_paused = 0; cd_motor = 0; @@ -1057,18 +1057,18 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b) dmac_dawr |= b << 0; break; case 0x91: - if (currprefs.cs_cdtvscsi) { + if (currprefs.cs_cdtvscsi) { wdscsi_sasr (b); checkint(); } break; case 0x93: - if (currprefs.cs_cdtvscsi) { + if (currprefs.cs_cdtvscsi) { wdscsi_put (b); checkint(); } break; - case 0xa1: + case 0xa1: cdrom_command(b); break; case 0xe0: @@ -1085,7 +1085,7 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b) case 0xe4: case 0xe5: dmac_istr = 0; - checkint(); + checkint(); break; case 0xe8: case 0xe9: @@ -1202,8 +1202,8 @@ static void open_unit(void) unitnum = -1; cdtv_reset(); if (!device_func_init(DEVICE_TYPE_ANY)) { - write_log ("no CDROM support\n"); - return; + write_log ("no CDROM support\n"); + return; } for (unitnum = 0; unitnum < MAX_TOTAL_DEVICES; unitnum++) { if (sys_command_open (DF_IOCTL, unitnum)) { @@ -1223,12 +1223,12 @@ static void open_unit(void) } } } else { - write_log("Audio CD\n"); + write_log ("Audio CD\n"); if (audiounit < 0) audiounit = unitnum; } } else { - write_log("TOC read failed\n"); + write_log ("TOC read failed\n"); } } sys_command_close (DF_IOCTL, unitnum); @@ -1321,7 +1321,7 @@ static void cdtv_battram_reset (void) memset (cdtv_battram, 0, CDTV_NVRAM_SIZE); f = zfile_fopen (currprefs.flashfile, "rb+"); if (!f) { - f = zfile_fopen (currprefs.flashfile, "wb"); + f = zfile_fopen (currprefs.flashfile, "wb"); if (f) { zfile_fwrite (cdtv_battram, CDTV_NVRAM_SIZE, 1, f); zfile_fclose (f); @@ -1373,7 +1373,7 @@ int cdtv_add_scsi_unit(int ch, char *path, int blocksize, int readonly, void cdtv_free (void) { if (thread_alive > 0) { - write_comm_pipe_u32 (&requests, 0x0104, 1); + write_comm_pipe_u32 (&requests, 0x0104, 1); write_comm_pipe_u32 (&requests, 0xffff, 1); while (thread_alive > 0) sleep_millis(10); @@ -1389,14 +1389,14 @@ void cdtv_free (void) void cdtv_init (void) { if (!thread_alive) { - uae_thread_id tid; + uae_thread_id tid; init_comm_pipe (&requests, 100, 1); uae_start_thread ("cdtv", dev_thread, NULL, &tid); while (!thread_alive) sleep_millis(10); } write_comm_pipe_u32 (&requests, 0x0104, 1); - + configured = 0; tp_a = tp_b = tp_c = tp_ad = tp_bd = tp_cd = 0; tp_imr = tp_cr = tp_air = 0; diff --git a/cfgfile.c b/cfgfile.c index 5825324e..e3209f87 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -222,7 +222,7 @@ static void write_filesys_config (struct uae_prefs *p, const char *unexpanded, const char *default_path, struct zfile *f) { int i; - char tmp[MAX_DPATH]; + char tmp[MAX_DPATH], tmp2[MAX_DPATH]; char *hdcontrollers[] = { "uae", "ide0", "ide1", "ide2", "ide3", "scsi0", "scsi1", "scsi2", "scsi3", "scsi4", "scsi5", "scsi6" }; @@ -233,24 +233,32 @@ static void write_filesys_config (struct uae_prefs *p, const char *unexpanded, str = cfgfile_subst_path (default_path, unexpanded, uci->rootdir); if (!uci->ishdf) { - sprintf (tmp, "filesystem2=%s,%s:%s:%s,%d\n", uci->readonly ? "ro" : "rw", + sprintf (tmp, "%s,%s:%s:%s,%d\n", uci->readonly ? "ro" : "rw", uci->devname ? uci->devname : "", uci->volname, str, uci->bootpri); - zfile_fputs (f, tmp); - sprintf (tmp, "filesystem=%s,%s:%s\n", uci->readonly ? "ro" : "rw", + sprintf (tmp2, "filesystem2=%s", tmp); + zfile_fputs (f, tmp2); +#if 0 + sprintf (tmp2, "filesystem=%s,%s:%s\n", uci->readonly ? "ro" : "rw", uci->volname, str); - zfile_fputs (f, tmp); + zfile_fputs (f, tmp2); +#endif } else { - sprintf (tmp, "hardfile2=%s,%s:%s,%d,%d,%d,%d,%d,%s,%s\n", + sprintf (tmp, "%s,%s:%s,%d,%d,%d,%d,%d,%s,%s\n", uci->readonly ? "ro" : "rw", uci->devname ? uci->devname : "", str, uci->sectors, uci->surfaces, uci->reserved, uci->blocksize, uci->bootpri, uci->filesys ? uci->filesys : "", hdcontrollers[uci->controller]); - zfile_fputs (f, tmp); - sprintf (tmp, "hardfile=%s,%d,%d,%d,%d,%s\n", + sprintf (tmp2, "hardfile2=%s", tmp); + zfile_fputs (f, tmp2); +#if 0 + sprintf (tmp2, "hardfile=%s,%d,%d,%d,%d,%s\n", uci->readonly ? "ro" : "rw", uci->sectors, uci->surfaces, uci->reserved, uci->blocksize, str); - zfile_fputs (f, tmp); + zfile_fputs (f, tmp2); +#endif } + sprintf (tmp2, "uaehf%d=%s,%s", i, uci->ishdf ? "hdf" : "dir", tmp); + zfile_fputs (f, tmp2); xfree (str); } } @@ -269,7 +277,7 @@ static void write_compatibility_cpu(struct zfile *f, struct uae_prefs *p) strcpy (tmp, "68ec020"); else sprintf(tmp, "%d", model); - if (model == 68020 && (p->fpu_model == 68881 || p->fpu_model == 68882)) + if (model == 68020 && (p->fpu_model == 68881 || p->fpu_model == 68882)) strcat(tmp,"/68881"); cfgfile_write (f, "cpu_type=%s\n", tmp); } @@ -559,13 +567,13 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "catweasel=%d\n", p->catweasel); cfgfile_write (f, "kbd_lang=%s\n", (p->keyboard_lang == KBD_LANG_DE ? "de" - : p->keyboard_lang == KBD_LANG_DK ? "dk" - : p->keyboard_lang == KBD_LANG_ES ? "es" - : p->keyboard_lang == KBD_LANG_US ? "us" - : p->keyboard_lang == KBD_LANG_SE ? "se" - : p->keyboard_lang == KBD_LANG_FR ? "fr" - : p->keyboard_lang == KBD_LANG_IT ? "it" - : "FOO")); + : p->keyboard_lang == KBD_LANG_DK ? "dk" + : p->keyboard_lang == KBD_LANG_ES ? "es" + : p->keyboard_lang == KBD_LANG_US ? "us" + : p->keyboard_lang == KBD_LANG_SE ? "se" + : p->keyboard_lang == KBD_LANG_FR ? "fr" + : p->keyboard_lang == KBD_LANG_IT ? "it" + : "FOO")); cfgfile_write (f, "state_replay=%s\n", p->statecapture ? "yes" : "no"); cfgfile_write (f, "state_replay_rate=%d\n", p->statecapturerate); @@ -698,10 +706,10 @@ static int getintval2 (char **p, int *result, int delim) static void set_chipset_mask (struct uae_prefs *p, int val) { p->chipset_mask = (val == 0 ? 0 - : val == 1 ? CSMASK_ECS_AGNUS - : val == 2 ? CSMASK_ECS_DENISE - : val == 3 ? CSMASK_ECS_DENISE | CSMASK_ECS_AGNUS - : CSMASK_AGA | CSMASK_ECS_DENISE | CSMASK_ECS_AGNUS); + : val == 1 ? CSMASK_ECS_AGNUS + : val == 2 ? CSMASK_ECS_DENISE + : val == 3 ? CSMASK_ECS_DENISE | CSMASK_ECS_AGNUS + : CSMASK_AGA | CSMASK_ECS_DENISE | CSMASK_ECS_AGNUS); } static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) @@ -808,7 +816,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) || cfgfile_string (option, value, "config_description", p->description, sizeof p->description)) return 1; - if (cfgfile_yesno (option, value, "use_debugger", &p->start_debugger) + if (cfgfile_yesno (option, value, "use_debugger", &p->start_debugger) || cfgfile_yesno (option, value, "sound_auto", &p->sound_auto) || cfgfile_yesno (option, value, "sound_stereo_swap_paula", &p->sound_stereo_swap_paula) || cfgfile_yesno (option, value, "sound_stereo_swap_ahi", &p->sound_stereo_swap_ahi) @@ -1126,6 +1134,7 @@ int add_filesys_config (struct uae_prefs *p, int index, int blocksize, int bootpri, char *filesysdir, int hdc, int flags) { struct uaedev_config_info *uci; int i; + char *s; if (index < 0) uci = getuci(p); @@ -1163,20 +1172,11 @@ int add_filesys_config (struct uae_prefs *p, int index, continue; } } - strcpy (uci->devname, base2); - } - if (volname && !uci->volname[0] && rootdir) { - for (i = strlen(rootdir) - 1; i >= 0; i--) { - char c = rootdir[i]; - if (c == ':' || c == '/' || c == '\\') { - if (i == strlen(rootdir) - 1) - continue; - i++; - break; - } - } - strcpy (uci->volname, rootdir + i); + strcpy (uci->devname, base2); } + s = filesys_createvolname (volname, rootdir, "Harddrive"); + strcpy (uci->volname, s); + xfree (s); return 1; } @@ -1205,7 +1205,6 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu return 1; } if (cfgfile_yesno (option, value, "immediate_blits", &p->immediate_blits) - || cfgfile_yesno (option, value, "cd32cd", &p->cs_cd32cd) || cfgfile_yesno (option, value, "cd32c2p", &p->cs_cd32c2p) || cfgfile_yesno (option, value, "cd32nvram", &p->cs_cd32nvram) @@ -1581,13 +1580,13 @@ static int cfgfile_separate_line (char *line, char *line1b, char *line2b) /* Get rid of whitespace. */ i = strlen (line2); while (i > 0 && (line2[i - 1] == '\t' || line2[i - 1] == ' ' - || line2[i - 1] == '\r' || line2[i - 1] == '\n')) + || line2[i - 1] == '\r' || line2[i - 1] == '\n')) line2[--i] = '\0'; line2 += strspn (line2, "\t \r\n"); strcpy (line2b, line2); i = strlen (line); while (i > 0 && (line[i - 1] == '\t' || line[i - 1] == ' ' - || line[i - 1] == '\r' || line[i - 1] == '\n')) + || line[i - 1] == '\r' || line[i - 1] == '\n')) line[--i] = '\0'; line += strspn (line, "\t \r\n"); strcpy (line1b, line); @@ -1950,7 +1949,6 @@ static void parse_sound_spec (struct uae_prefs *p, char *spec) if (x4) p->sound_maxbsiz = atoi (x4); free (x0); - return; } @@ -2544,7 +2542,7 @@ end: xfree (parms_p); return ret; } - + uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen) { char tmp[CONFIG_BLEN]; @@ -2580,7 +2578,7 @@ uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen) uae_u8 *restore_configuration (uae_u8 *src) { - write_log(src); + write_log (src); src += strlen(src) + 1; return src; } @@ -2596,9 +2594,9 @@ uae_u8 *save_configuration(int *len) p = dst; for (;;) { char tmpout[256]; - int ret; - tmpout[0] = 0; - ret = cfgfile_modify (index, "*", 1, tmpout, sizeof (tmpout)); + int ret; + tmpout[0] = 0; + ret = cfgfile_modify (index, "*", 1, tmpout, sizeof (tmpout)); index++; if (strlen(tmpout) > 0) { if (!memcmp(tmpout, "input.", 6)) @@ -3024,7 +3022,7 @@ static int bip_a3000 (struct uae_prefs *p, int config, int compa, int romcheck) p->cpu_idle = 150; p->cs_compatible = CP_A3000; p->mbresmem_low_size = 8 * 1024 * 1024; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); p->cs_ciaatod = p->ntscmode ? 2 : 1; return configure_rom (p, roms, romcheck); } @@ -3052,7 +3050,7 @@ static int bip_a4000 (struct uae_prefs *p, int config, int compa, int romcheck) p->floppy_speed = 0; p->cpu_idle = 150; p->cs_compatible = CP_A4000; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); p->cs_ciaatod = p->ntscmode ? 2 : 1; return configure_rom (p, roms, romcheck); } @@ -3081,7 +3079,7 @@ static int bip_a4000t (struct uae_prefs *p, int config, int compa, int romcheck) p->floppy_speed = 0; p->cpu_idle = 150; p->cs_compatible = CP_A4000T; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); p->cs_ciaatod = p->ntscmode ? 2 : 1; return configure_rom (p, roms, romcheck); } @@ -3099,7 +3097,7 @@ static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck) set_68000_compa (p, compa); p->dfxtype[1] = DRV_NONE; p->cs_compatible = CP_A1000; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); if (config > 0) p->chipset_mask |= CSMASK_NO_EHB; if (config > 1) @@ -3136,7 +3134,7 @@ static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck) p->dfxtype[1] = DRV_NONE; set_68000_compa (p, compa); p->cs_compatible = CP_CDTV; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile)); strcat(p->flashfile, "cdtv.nvr"); return 1; @@ -3164,7 +3162,7 @@ static int bip_cd32 (struct uae_prefs *p, int config, int compa, int romcheck) p->dfxtype[1] = DRV_NONE; set_68020_compa (p, compa); p->cs_compatible = CP_CD32; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile)); strcat(p->flashfile, "cd32.nvr"); return 1; @@ -3181,11 +3179,11 @@ static int bip_a1200 (struct uae_prefs *p, int config, int compa, int romcheck) roms[3] = -1; if (config == 1) { p->fastmem_size = 0x400000; - p->cs_rtc = 2; + p->cs_rtc = 2; } set_68020_compa (p, compa); p->cs_compatible = CP_A1200; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); return configure_rom (p, roms, romcheck); } @@ -3206,7 +3204,7 @@ static int bip_a600 (struct uae_prefs *p, int config, int compa, int romcheck) p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; set_68000_compa (p, compa); p->cs_compatible = CP_A600; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); return configure_rom (p, roms, romcheck); } @@ -3225,7 +3223,7 @@ static int bip_a500p (struct uae_prefs *p, int config, int compa, int romcheck) p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; set_68000_compa (p, compa); p->cs_compatible = CP_A500P; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); return configure_rom (p, roms, romcheck); } static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) @@ -3235,22 +3233,22 @@ static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) roms[0] = roms[1] = roms[2] = roms[3] = -1; switch (config) { - case 0: // KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow + case 0: // KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow roms[0] = 6; roms[1] = 32; p->chipset_mask = 0; break; - case 1: // KS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow + case 1: // KS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow roms[0] = 6; roms[1] = 32; break; - case 2: // KS 1.3, ECS Agnus, 1.0M Chip + case 2: // KS 1.3, ECS Agnus, 1.0M Chip roms[0] = 6; roms[1] = 32; p->bogomem_size = 0; p->chipmem_size = 0x100000; break; - case 3: // KS 1.3, OCS Agnus, 0.5M Chip + case 3: // KS 1.3, OCS Agnus, 0.5M Chip roms[0] = 6; roms[1] = 32; p->bogomem_size = 0; @@ -3258,7 +3256,7 @@ static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) p->cs_rtc = 0; p->dfxtype[1] = DRV_NONE; break; - case 4: // KS 1.2, OCS Agnus, 0.5M Chip + case 4: // KS 1.2, OCS Agnus, 0.5M Chip roms[0] = 5; roms[1] = 4; roms[2] = 3; @@ -3267,7 +3265,7 @@ static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) p->cs_rtc = 0; p->dfxtype[1] = DRV_NONE; break; - case 5: // KS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow + case 5: // KS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow roms[0] = 5; roms[1] = 4; roms[2] = 3; @@ -3276,7 +3274,7 @@ static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) } set_68000_compa (p, compa); p->cs_compatible = CP_A500; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); return configure_rom (p, roms, romcheck); } @@ -3314,7 +3312,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) p->cart_internal = 0; p->picasso96_nocustom = 1; p->cs_compatible = 1; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); p->cs_ide = -1; p->cs_ciaatod = p->ntscmode ? 2 : 1; return configure_rom (p, roms, romcheck); @@ -3323,7 +3321,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) static int bip_arcadia (struct uae_prefs *p, int config, int compa, int romcheck) { int roms[4]; - + p->bogomem_size = 0; p->chipset_mask = 0; p->cs_rtc = 0; @@ -3332,7 +3330,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) p->dfxtype[1] = DRV_NONE; set_68000_compa (p, compa); p->cs_compatible = CP_A500; - build_in_chipset_prefs (p); + built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile)); strcat(p->flashfile, "arcadia.nvr"); roms[0] = 5; @@ -3349,47 +3347,47 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) return 1; } -int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck) +int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck) { int v = 0, i; buildin_default_prefs (p); switch (model) { - case 0: + case 0: v = bip_a500 (p, config, compa, romcheck); break; - case 1: + case 1: v = bip_a500p (p, config, compa, romcheck); break; - case 2: + case 2: v = bip_a600 (p, config, compa, romcheck); break; - case 3: + case 3: v = bip_a1000 (p, config, compa, romcheck); break; - case 4: + case 4: v = bip_a1200 (p, config, compa, romcheck); break; - case 5: + case 5: v = bip_a3000 (p, config, compa, romcheck); break; - case 6: + case 6: v = bip_a4000 (p, config, compa, romcheck); break; - case 7: + case 7: v = bip_a4000t (p, config, compa, romcheck); break; - case 8: + case 8: v = bip_cd32 (p, config, compa, romcheck); break; - case 9: + case 9: v = bip_cdtv (p, config, compa, romcheck); break; - case 10: + case 10: v = bip_arcadia (p, config , compa, romcheck); break; - case 11: + case 11: v = bip_super (p, config, compa, romcheck); break; } @@ -3400,7 +3398,7 @@ int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int r return v; } -int build_in_chipset_prefs (struct uae_prefs *p) +int built_in_chipset_prefs (struct uae_prefs *p) { if (!p->cs_compatible) return 1; @@ -3423,76 +3421,76 @@ int build_in_chipset_prefs (struct uae_prefs *p) switch (p->cs_compatible) { - case CP_GENERIC: // generic - p->cs_rtc = 2; - p->cs_fatgaryrev = 0; - p->cs_ide = -1; - p->cs_mbdmac = 1; - p->cs_ramseyrev = 0x0f; + case CP_GENERIC: // generic + p->cs_rtc = 2; + p->cs_fatgaryrev = 0; + p->cs_ide = -1; + p->cs_mbdmac = 1; + p->cs_ramseyrev = 0x0f; break; - case CP_CDTV: // CDTV - p->cs_rtc = 1; - p->cs_cdtvcd = p->cs_cdtvram = 1; - p->cs_df0idhw = 0; - p->cs_ksmirror = 0; + case CP_CDTV: // CDTV + p->cs_rtc = 1; + p->cs_cdtvcd = p->cs_cdtvram = 1; + p->cs_df0idhw = 0; + p->cs_ksmirror = 0; break; - case CP_CD32: // CD32 - p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = 1; - p->cs_ksmirror = 0; + case CP_CD32: // CD32 + p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = 1; + p->cs_ksmirror = 0; break; - case CP_A500: // A500 - p->cs_df0idhw = 0; + case CP_A500: // A500 + p->cs_df0idhw = 0; break; - case CP_A500P: // A500+ + case CP_A500P: // A500+ break; - case CP_A600: // A600 - p->cs_ide = 1; - p->cs_pcmcia = 1; + case CP_A600: // A600 + p->cs_ide = 1; + p->cs_pcmcia = 1; break; - case CP_A1000: // A1000 - p->cs_a1000ram = 1; - p->cs_ciaatod = p->ntscmode ? 2 : 1; - p->cs_ksmirror = 0; - p->cs_rtc = 0; - p->chipset_mask |= CSMASK_BLTBUSY_BUG; + case CP_A1000: // A1000 + p->cs_a1000ram = 1; + p->cs_ciaatod = p->ntscmode ? 2 : 1; + p->cs_ksmirror = 0; + p->cs_rtc = 0; + p->chipset_mask |= CSMASK_BLTBUSY_BUG; break; - case CP_A1200: // A1200 - p->cs_ide = 1; - p->cs_pcmcia = 1; - p->cs_ksmirror = 2; + case CP_A1200: // A1200 + p->cs_ide = 1; + p->cs_pcmcia = 1; + p->cs_ksmirror = 2; break; - case CP_A2000: // A2000 - p->cs_rtc = 1; - p->cs_ciaatod = p->ntscmode ? 2 : 1; - break; + case CP_A2000: // A2000 + p->cs_rtc = 1; + p->cs_ciaatod = p->ntscmode ? 2 : 1; break; - case CP_A3000: // A3000 - p->cs_rtc = 2; - p->cs_fatgaryrev = 0; - p->cs_ramseyrev = 0x0d; - p->cs_mbdmac = 1; - p->cs_ciaatod = p->ntscmode ? 2 : 1; break; - case CP_A3000T: // A3000T - p->cs_rtc = 2; - p->cs_fatgaryrev = 0; - p->cs_ramseyrev = 0x0d; - p->cs_mbdmac = 1; - p->cs_ciaatod = p->ntscmode ? 2 : 1; + case CP_A3000: // A3000 + p->cs_rtc = 2; + p->cs_fatgaryrev = 0; + p->cs_ramseyrev = 0x0d; + p->cs_mbdmac = 1; + p->cs_ciaatod = p->ntscmode ? 2 : 1; break; - case CP_A4000: // A4000 - p->cs_rtc = 2; - p->cs_fatgaryrev = 0; - p->cs_ramseyrev = 0x0f; - p->cs_ide = 2; - p->cs_mbdmac = 0; + case CP_A3000T: // A3000T + p->cs_rtc = 2; + p->cs_fatgaryrev = 0; + p->cs_ramseyrev = 0x0d; + p->cs_mbdmac = 1; + p->cs_ciaatod = p->ntscmode ? 2 : 1; break; - case CP_A4000T: // A4000T - p->cs_rtc = 2; - p->cs_fatgaryrev = 0; - p->cs_ramseyrev = 0x0f; - p->cs_ide = 2; - p->cs_mbdmac = 2; + case CP_A4000: // A4000 + p->cs_rtc = 2; + p->cs_fatgaryrev = 0; + p->cs_ramseyrev = 0x0f; + p->cs_ide = 2; + p->cs_mbdmac = 0; + break; + case CP_A4000T: // A4000T + p->cs_rtc = 2; + p->cs_fatgaryrev = 0; + p->cs_ramseyrev = 0x0f; + p->cs_ide = 2; + p->cs_mbdmac = 2; break; } return 1; diff --git a/cia.c b/cia.c index d1834e3d..f3d81fcf 100755 --- a/cia.c +++ b/cia.c @@ -121,21 +121,21 @@ static void compute_passed_time (void) /* CIA A timers */ if ((ciaacra & 0x21) == 0x01) { - assert ((ciaata+1) >= ciaclocks); + assert ((ciaata + 1) >= ciaclocks); ciaata_passed = ciaclocks; } if ((ciaacrb & 0x61) == 0x01) { - assert ((ciaatb+1) >= ciaclocks); + assert ((ciaatb + 1) >= ciaclocks); ciaatb_passed = ciaclocks; } /* CIA B timers */ if ((ciabcra & 0x21) == 0x01) { - assert ((ciabta+1) >= ciaclocks); + assert ((ciabta + 1) >= ciaclocks); ciabta_passed = ciaclocks; } if ((ciabcrb & 0x61) == 0x01) { - assert ((ciabtb+1) >= ciaclocks); + assert ((ciabtb + 1) >= ciaclocks); ciabtb_passed = ciaclocks; } } @@ -155,8 +155,8 @@ static void CIA_update (void) /* CIA A timers */ if ((ciaacra & 0x21) == 0x01) { - assert ((ciaata+1) >= ciaclocks); - if ((ciaata+1) == ciaclocks) { + assert ((ciaata + 1) >= ciaclocks); + if ((ciaata + 1) == ciaclocks) { if ((ciaacra & 0x48) == 0x40 && ciaasdr_cnt > 0 && --ciaasdr_cnt == 0) asp = 1; aovfla = 1; @@ -175,8 +175,8 @@ static void CIA_update (void) /* CIA B timers */ if ((ciabcra & 0x21) == 0x01) { - assert ((ciabta+1) >= ciaclocks); - if ((ciabta+1) == ciaclocks) { + assert ((ciabta + 1) >= ciaclocks); + if ((ciabta + 1) == ciaclocks) { if ((ciabcra & 0x48) == 0x40 && ciabsdr_cnt > 0 && --ciabsdr_cnt == 0) bsp = 1; bovfla = 1; @@ -194,30 +194,30 @@ static void CIA_update (void) } if (aovfla) { - ciaaicr |= 1; RethinkICRA(); + ciaaicr |= 1; RethinkICRA (); ciaata = ciaala; if (ciaacra & 0x8) ciaacra &= ~1; } if (aovflb) { - ciaaicr |= 2; RethinkICRA(); + ciaaicr |= 2; RethinkICRA (); ciaatb = ciaalb; if (ciaacrb & 0x8) ciaacrb &= ~1; } if (asp) { - ciaaicr |= 8; RethinkICRA(); + ciaaicr |= 8; RethinkICRA (); } if (bovfla) { - ciabicr |= 1; RethinkICRB(); + ciabicr |= 1; RethinkICRB (); ciabta = ciabla; if (ciabcra & 0x8) ciabcra &= ~1; } if (bovflb) { - ciabicr |= 2; RethinkICRB(); + ciabicr |= 2; RethinkICRB (); ciabtb = ciablb; if (ciabcrb & 0x8) ciabcrb &= ~1; } if (bsp) { - ciabicr |= 8; RethinkICRB(); + ciabicr |= 8; RethinkICRB (); } } @@ -291,12 +291,12 @@ void CIA_handler (void) void cia_diskindex (void) { ciabicr |= 0x10; - RethinkICRB(); + RethinkICRB (); } void cia_parallelack (void) { ciaaicr |= 0x10; - RethinkICRA(); + RethinkICRA (); } static int checkalarm (unsigned long tod, unsigned long alarm, int inc) @@ -320,15 +320,15 @@ STATIC_INLINE void ciab_checkalarm (int inc) { if (checkalarm (ciabtod, ciabalarm, inc)) { ciabicr |= 4; - RethinkICRB(); + RethinkICRB (); } } STATIC_INLINE void ciaa_checkalarm (int inc) { if (checkalarm (ciaatod, ciaaalarm, inc)) { - ciaaicr |= 4; - RethinkICRA(); + ciaaicr |= 4; + RethinkICRA (); } } @@ -371,7 +371,7 @@ void CIA_hsync_handler (void) break; } ciaaicr |= 8; - RethinkICRA(); + RethinkICRA (); sleepyhead = 0; } else if (!(++sleepyhead & 15)) { ciaasdr_unread = 0; /* give up on this key event after unread for a long time */ @@ -435,7 +435,7 @@ static void bfe001_change (void) int led = (v & 2) ? 0 : 1; oldled = v & 2; gui_data.powerled = led; - led_filter_audio(); + led_filter_audio (); } if ((v & 1) != oldovl) { oldovl = v & 1; @@ -455,7 +455,7 @@ static uae_u8 ReadCIAA (unsigned int addr) compute_passed_time (); #ifdef CIAA_DEBUG_R - write_log("R_CIAA: bfe%x01 %08.8X\n", addr, M68K_GETPC); + write_log ("R_CIAA: bfe%x01 %08.8X\n", addr, M68K_GETPC); #endif switch (addr & 0xf) { @@ -487,10 +487,9 @@ static uae_u8 ReadCIAA (unsigned int addr) } else if (arcadia_bios) { tmp = arcadia_parport (0, ciaaprb, ciaadrb); #endif - } else { -#else - { + } else #endif + { tmp = handle_parport_joystick (0, ciaaprb, ciaadrb); #ifdef DONGLE_DEBUG if (notinrom()) @@ -556,7 +555,7 @@ static uae_u8 ReadCIAA (unsigned int addr) ciaasdr_unread = 2; return ciaasdr; case 13: - tmp = ciaaicr; ciaaicr = 0; RethinkICRA(); + tmp = ciaaicr; ciaaicr = 0; RethinkICRA (); return tmp; case 14: return ciaacra; @@ -572,7 +571,7 @@ static uae_u8 ReadCIAB (unsigned int addr) #ifdef CIAB_DEBUG_R if (addr >= 8 && addr <= 10) - write_log("R_CIAB: bfd%x00 %08.8X\n", addr, M68K_GETPC); + write_log ("R_CIAB: bfd%x00 %08.8X\n", addr, M68K_GETPC); #endif compute_passed_time (); @@ -655,7 +654,7 @@ static uae_u8 ReadCIAB (unsigned int addr) case 12: return ciabsdr; case 13: - tmp = ciabicr; ciabicr = 0; RethinkICRB(); + tmp = ciabicr; ciabicr = 0; RethinkICRB (); return tmp; case 14: return ciabcra; @@ -668,7 +667,7 @@ static uae_u8 ReadCIAB (unsigned int addr) static void WriteCIAA (uae_u16 addr,uae_u8 val) { #ifdef CIAA_DEBUG_W - write_log("W_CIAA: bfe%x01 %02.2X %08.8X\n", addr, val, M68K_GETPC); + write_log ("W_CIAA: bfe%x01 %02.2X %08.8X\n", addr, val, M68K_GETPC); #endif #ifdef ACTION_REPLAY ar_ciaa[addr & 0xf] = val; @@ -823,7 +822,7 @@ static void WriteCIAB (uae_u16 addr,uae_u8 val) { #ifdef CIAB_DEBUG_W if (addr >= 8 && addr <= 10) - write_log("W_CIAB: bfd%x00 %02.2X %08.8X\n", addr, val, M68K_GETPC); + write_log ("W_CIAB: bfd%x00 %02.2X %08.8X\n", addr, val, M68K_GETPC); #endif #ifdef ACTION_REPLAY ar_ciab[addr & 0xf] = val; @@ -957,7 +956,7 @@ static void WriteCIAB (uae_u16 addr,uae_u8 val) } } -void CIA_inprec_prepare(void) +void CIA_inprec_prepare (void) { sleepyhead = 0; } @@ -1005,20 +1004,20 @@ void CIA_reset (void) #ifdef CD32 akiko_reset (); if (!akiko_init ()) - currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0; + currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0; #endif } void dumpcia (void) { console_out ("A: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n", - ciaacra, ciaacrb, ciaaicr, ciaaimask, ciaata, ciaala, ciaatb, ciaalb); + ciaacra, ciaacrb, ciaaicr, ciaaimask, ciaata, ciaala, ciaatb, ciaalb); console_out ("TOD %06x (%06x) ALARM %06x %c%c\n", - ciaatod, ciaatol, ciaaalarm, ciaatlatch ? 'L' : ' ', ciaatodon ? ' ' : 'S'); + ciaatod, ciaatol, ciaaalarm, ciaatlatch ? 'L' : ' ', ciaatodon ? ' ' : 'S'); console_out ("B: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n", - ciabcra, ciabcrb, ciaaicr, ciabimask, ciabta, ciabla, ciabtb, ciablb); + ciabcra, ciabcrb, ciaaicr, ciabimask, ciabta, ciabla, ciabtb, ciablb); console_out ("TOD %06x (%06x) ALARM %06x %c%c\n", - ciabtod, ciabtol, ciabalarm, ciabtlatch ? 'L' : ' ', ciabtodon ? ' ' : 'S'); + ciabtod, ciabtol, ciabalarm, ciabtlatch ? 'L' : ' ', ciabtodon ? ' ' : 'S'); } /* CIA memory access */ @@ -1077,18 +1076,17 @@ static uae_u32 REGPARAM2 cia_bget (uaecptr addr) #endif cia_wait_pre (); v = 0xff; - switch ((addr >> 12) & 3) - { - case 0: + switch ((addr >> 12) & 3) { + case 0: v = (addr & 1) ? ReadCIAA (r) : ReadCIAB (r); break; - case 1: + case 1: v = (addr & 1) ? 0xff : ReadCIAB (r); break; - case 2: + case 2: v = (addr & 1) ? ReadCIAA (r) : 0xff; break; - case 3: + case 3: if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible) v = (addr & 1) ? regs.irc : regs.irc >> 8; if (warned > 0) { @@ -1096,7 +1094,7 @@ static uae_u32 REGPARAM2 cia_bget (uaecptr addr) warned--; } break; - } + } cia_wait_post (); return v; } @@ -1113,16 +1111,16 @@ static uae_u32 REGPARAM2 cia_wget (uaecptr addr) v = 0xffff; switch ((addr >> 12) & 3) { - case 0: + case 0: v = (ReadCIAB (r) << 8) | ReadCIAA (r); break; - case 1: + case 1: v = (ReadCIAB (r) << 8) | 0xff; break; - case 2: + case 2: v = (0xff << 8) | ReadCIAA (r); break; - case 3: + case 3: if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible) v = regs.irc; if (warned > 0) { @@ -1299,7 +1297,7 @@ static uae_u32 REGPARAM2 clock_bget (uaecptr addr) } } else if (currprefs.cs_rtc == 2) { /* RF5C01A */ int bank = clock_control_d & 3; - /* memory access */ + /* memory access */ if (bank >= 2 && addr < 0x0d) return (rtc_memory[addr] >> ((bank == 2) ? 0 : 4)) & 0x0f; /* alarm */ @@ -1363,7 +1361,7 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value) } } else if (currprefs.cs_rtc == 2) { /* RF5C01A */ int bank = clock_control_d & 3; - /* memory access */ + /* memory access */ if (bank >= 2 && addr < 0x0d) { rtc_memory[addr] &= ((bank == 2) ? 0xf0 : 0x0f); rtc_memory[addr] |= value << ((bank == 2) ? 0 : 4); @@ -1538,4 +1536,4 @@ uae_u8 *save_cia (int num, int *len, uae_u8 *dstptr) return dstbak; } -#endif /* SAVESTATE */ \ No newline at end of file +#endif /* SAVESTATE */ diff --git a/compemu_fpp.c b/compemu_fpp.c index 456277e8..4ee660d5 100755 --- a/compemu_fpp.c +++ b/compemu_fpp.c @@ -768,7 +768,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) FAIL(1); return; case 6: - case 7: + case 7: { uae_u32 list = 0; int incr = 0; @@ -781,7 +781,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) case 2: break; case 1: - case 3: + case 3: default: FAIL(1); return; } @@ -808,13 +808,13 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) for (reg = 7; reg >= 0; reg--) { if (list & 0x80) { fmov_ext_mr((uintptr)temp_fp,reg); - sub_l_ri(ad,4); + sub_l_ri(ad,4); mov_l_rm(S2,(uintptr)temp_fp); writelong_clobber(ad,S2,S3); - sub_l_ri(ad,4); + sub_l_ri(ad,4); mov_l_rm(S2,(uintptr)temp_fp+4); writelong_clobber(ad,S2,S3); - sub_l_ri(ad,4); + sub_l_ri(ad,4); mov_w_rm(S2,(uintptr)temp_fp+8); writeword_clobber(ad,S2,S3); } @@ -851,7 +851,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) case 2: break; case 1: - case 3: + case 3: default: FAIL(1); return; } @@ -1278,7 +1278,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) case 0x44: /* FDMOVE */ if (prec || !currprefs.fpu_strict) { if (sreg != dreg) /* no */ - fmov_rr(dreg,sreg); + fmov_rr(dreg,sreg); } else { fmov_mr((uae_u32)temp_fp,sreg); fmov_rm(dreg,(uae_u32)temp_fp); diff --git a/compemu_raw_x86.c b/compemu_raw_x86.c index e1bc1113..4f5c0604 100755 --- a/compemu_raw_x86.c +++ b/compemu_raw_x86.c @@ -546,7 +546,7 @@ LOWFUNC(READ,NONE,3,raw_cmov_b_rr,(RW1 d, R1 s, IMM cc)) { /* replacement using branch and mov */ int uncc=(cc^1); - emit_byte(0x70+uncc); + emit_byte(0x70+uncc); emit_byte(3); /* skip next 2 bytes if not cc=true */ emit_byte(0x88); emit_byte(0xc0+8*s+d); @@ -563,7 +563,7 @@ LOWFUNC(READ,NONE,3,raw_cmov_w_rr,(RW2 d, R2 s, IMM cc)) } else { /* replacement using branch and mov */ int uncc=(cc^1); - emit_byte(0x70+uncc); + emit_byte(0x70+uncc); emit_byte(3); /* skip next 3 bytes if not cc=true */ emit_byte(0x66); emit_byte(0x89); @@ -641,7 +641,7 @@ LOWFUNC(NONE,NONE,2,raw_imul_64_32,(RW4 d, RW4 s)) { #ifdef JIT_DEBUG if (d!=MUL_NREG1 || s!=MUL_NREG2) { - write_log("JIT: Bad register in IMUL: d=%d, s=%d\n",d,s); + write_log ("JIT: Bad register in IMUL: d=%d, s=%d\n",d,s); abort(); } #endif @@ -654,7 +654,7 @@ LOWFUNC(NONE,NONE,2,raw_mul_64_32,(RW4 d, RW4 s)) { #ifdef JIT_DEBUG if (d!=MUL_NREG1 || s!=MUL_NREG2) { - write_log("JIT: Bad register in MUL: d=%d, s=%d\n",d,s); + write_log ("JIT: Bad register in MUL: d=%d, s=%d\n",d,s); abort(); } #endif @@ -1724,18 +1724,18 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) addr = (uae_u32)(pExceptRecord->ExceptionInformation[1]); } #ifdef JIT_DEBUG - write_log("JIT: fault address is 0x%x at 0x%x\n",addr,i); + write_log ("JIT: fault address is 0x%x at 0x%x\n",addr,i); #endif if (!canbang || !currprefs.cachesize) { #ifdef JIT_DEBUG - write_log("JIT: Not happy! Canbang or cachesize is 0 in SIGSEGV handler!\n"); + write_log ("JIT: Not happy! Canbang or cachesize is 0 in SIGSEGV handler!\n"); #endif return EXCEPTION_CONTINUE_SEARCH; } if (in_handler) - write_log("JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); + write_log ("JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); if (canbang && i>=compiled_code && i<=current_compile_p) { if (*i==0x66) { @@ -1809,7 +1809,7 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) if (r!=-1) { void* pr=NULL; #ifdef JIT_DEBUG - write_log("JIT: register was %d, direction was %d, size was %d\n",r,dir,size); + write_log ("JIT: register was %d, direction was %d, size was %d\n",r,dir,size); #endif switch(r) { @@ -1855,27 +1855,27 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) #ifdef JIT_DEBUG if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log ("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); } #endif if (dir==SIG_READ) { switch (size) { - case 1: *((uae_u8*)pr)=get_byte(addr); break; - case 2: *((uae_u16*)pr)=swap16(get_word(addr)); break; - case 4: *((uae_u32*)pr)=swap32(get_long(addr)); break; + case 1: *((uae_u8*)pr)=get_byte (addr); break; + case 2: *((uae_u16*)pr)=swap16(get_word (addr)); break; + case 4: *((uae_u32*)pr)=swap32(get_long (addr)); break; default: abort(); } } else { /* write */ switch (size) { - case 1: put_byte(addr,*((uae_u8*)pr)); break; - case 2: put_word(addr,swap16(*((uae_u16*)pr))); break; - case 4: put_long(addr,swap32(*((uae_u32*)pr))); break; + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; + case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; default: abort(); } } #ifdef JIT_DEBUG - write_log("JIT: Handled one access!\n"); + write_log ("JIT: Handled one access!\n"); #endif fflush(stdout); segvcount++; @@ -1891,7 +1891,7 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) #ifdef JIT_DEBUG if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log ("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); } #endif @@ -1902,8 +1902,8 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) emit_long((uae_u32)veccode-(uae_u32)target-4); #ifdef JIT_DEBUG - write_log("JIT: Create jump to %p\n",veccode); - write_log("JIT: Handled one access!\n"); + write_log ("JIT: Create jump to %p\n",veccode); + write_log ("JIT: Handled one access!\n"); #endif segvcount++; @@ -1911,17 +1911,17 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) if (dir==SIG_READ) { switch(size) { - case 1: raw_mov_b_ri(r,get_byte(addr)); break; - case 2: raw_mov_w_ri(r,swap16(get_word(addr))); break; - case 4: raw_mov_l_ri(r,swap32(get_long(addr))); break; + case 1: raw_mov_b_ri(r,get_byte (addr)); break; + case 2: raw_mov_w_ri(r,swap16(get_word (addr))); break; + case 4: raw_mov_l_ri(r,swap32(get_long (addr))); break; default: abort(); } } else { /* write */ switch(size) { - case 1: put_byte(addr,*((uae_u8*)pr)); break; - case 2: put_word(addr,swap16(*((uae_u16*)pr))); break; - case 4: put_long(addr,swap32(*((uae_u32*)pr))); break; + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; + case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; default: abort(); } } @@ -1939,7 +1939,7 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { #ifdef JIT_DEBUG - write_log("JIT: deleted trigger (%p<%p<%p) %p\n", + write_log ("JIT: deleted trigger (%p<%p<%p) %p\n", bi->handler, i, bi->nexthandler, @@ -1960,7 +1960,7 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { #ifdef JIT_DEBUG - write_log("JIT: deleted trigger (%p<%p<%p) %p\n", + write_log ("JIT: deleted trigger (%p<%p<%p) %p\n", bi->handler, i, bi->nexthandler, @@ -1974,22 +1974,22 @@ int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ) bi=bi->next; } #ifdef JIT_DEBUG - write_log("JIT: Huh? Could not find trigger!\n"); + write_log ("JIT: Huh? Could not find trigger!\n"); #endif return EXCEPTION_CONTINUE_EXECUTION; } } - write_log("JIT: Can't handle access %08.8X!\n", i); + write_log ("JIT: Can't handle access %08.8X!\n", i); #if 0 if (i) { int j; for (j=0;j<10;j++) { - write_log("JIT: instruction byte %2d is 0x%02x\n",j,i[j]); + write_log ("JIT: instruction byte %2d is 0x%02x\n",j,i[j]); } } - write_log("Please send the above info (starting at \"fault address\") to\n" + write_log ("Please send the above info (starting at \"fault address\") to\n" "bmeyer@csse.monash.edu.au\n" "This shouldn't happen ;-)\n"); #endif @@ -2006,11 +2006,11 @@ static void vec(int x, struct sigcontext sc) int len=0; int j; - write_log("JIT: fault address is %08x at %08x\n",sc.cr2,sc.eip); + write_log ("JIT: fault address is %08x at %08x\n",sc.cr2,sc.eip); if (!canbang) - write_log("JIT: Not happy! Canbang is 0 in SIGSEGV handler!\n"); + write_log ("JIT: Not happy! Canbang is 0 in SIGSEGV handler!\n"); if (in_handler) - write_log("JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); + write_log ("JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); if (canbang && i>=compiled_code && i<=current_compile_p) { if (*i==0x66) { @@ -2085,7 +2085,7 @@ static void vec(int x, struct sigcontext sc) if (r!=-1) { void* pr=NULL; - write_log("JIT: register was %d, direction was %d, size was %d\n",r,dir,size); + write_log ("JIT: register was %d, direction was %d, size was %d\n",r,dir,size); switch(r) { case 0: pr=&(sc.eax); break; @@ -2112,25 +2112,25 @@ static void vec(int x, struct sigcontext sc) if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log("JIT: Suspicious address in %x SEGV handler.\n",addr); + write_log ("JIT: Suspicious address in %x SEGV handler.\n",addr); } if (dir==SIG_READ) { switch(size) { - case 1: *((uae_u8*)pr)=get_byte(addr); break; - case 2: *((uae_u16*)pr)=get_word(addr); break; - case 4: *((uae_u32*)pr)=get_long(addr); break; + case 1: *((uae_u8*)pr)=get_byte (addr); break; + case 2: *((uae_u16*)pr)=get_word (addr); break; + case 4: *((uae_u32*)pr)=get_long (addr); break; default: abort(); } } else { /* write */ switch(size) { - case 1: put_byte(addr,*((uae_u8*)pr)); break; - case 2: put_word(addr,*((uae_u16*)pr)); break; - case 4: put_long(addr,*((uae_u32*)pr)); break; + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,*((uae_u16*)pr)); break; + case 4: put_long (addr,*((uae_u32*)pr)); break; default: abort(); } } - write_log("JIT: Handled one access!\n"); + write_log ("JIT: Handled one access!\n"); fflush(stdout); segvcount++; sc.eip+=len; @@ -2144,7 +2144,7 @@ static void vec(int x, struct sigcontext sc) if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log ("JIT: Suspicious address 0x%x in SEGV handler.\n",addr); } target=(uae_u8*)sc.eip; @@ -2152,26 +2152,26 @@ static void vec(int x, struct sigcontext sc) vecbuf[i]=target[i]; emit_byte(0xe9); emit_long((uae_u32)veccode-(uae_u32)target-4); - write_log("JIT: Create jump to %p\n",veccode); + write_log ("JIT: Create jump to %p\n",veccode); - write_log("JIT: Handled one access!\n"); + write_log ("JIT: Handled one access!\n"); segvcount++; target=veccode; if (dir==SIG_READ) { switch(size) { - case 1: raw_mov_b_ri(r,get_byte(addr)); break; - case 2: raw_mov_w_ri(r,get_word(addr)); break; - case 4: raw_mov_l_ri(r,get_long(addr)); break; + case 1: raw_mov_b_ri(r,get_byte (addr)); break; + case 2: raw_mov_w_ri(r,get_word (addr)); break; + case 4: raw_mov_l_ri(r,get_long (addr)); break; default: abort(); } } else { /* write */ switch(size) { - case 1: put_byte(addr,*((uae_u8*)pr)); break; - case 2: put_word(addr,*((uae_u16*)pr)); break; - case 4: put_long(addr,*((uae_u32*)pr)); break; + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,*((uae_u16*)pr)); break; + case 4: put_long (addr,*((uae_u32*)pr)); break; default: abort(); } } @@ -2188,7 +2188,7 @@ static void vec(int x, struct sigcontext sc) if (bi->handler && (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { - write_log("JIT: deleted trigger (%p<%p<%p) %p\n", + write_log ("JIT: deleted trigger (%p<%p<%p) %p\n", bi->handler, i, bi->nexthandler, @@ -2207,7 +2207,7 @@ static void vec(int x, struct sigcontext sc) if (bi->handler && (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { - write_log("JIT: deleted trigger (%p<%p<%p) %p\n", + write_log ("JIT: deleted trigger (%p<%p<%p) %p\n", bi->handler, i, bi->nexthandler, @@ -2219,16 +2219,16 @@ static void vec(int x, struct sigcontext sc) } bi=bi->next; } - write_log("JIT: Huh? Could not find trigger!\n"); + write_log ("JIT: Huh? Could not find trigger!\n"); return; } } - write_log("JIT: Can't handle access!\n"); + write_log ("JIT: Can't handle access!\n"); for (j=0;j<10;j++) { - write_log("JIT: instruction byte %2d is %02x\n",j,i[j]); + write_log ("JIT: instruction byte %2d is %02x\n",j,i[j]); } #if 0 - write_log("Please send the above info (starting at \"fault address\") to\n" + write_log ("Please send the above info (starting at \"fault address\") to\n" "bmeyer@csse.monash.edu.au\n" "This shouldn't happen ;-)\n"); fflush(stdout); @@ -2499,7 +2499,7 @@ static int target_check_bsf(void) } }}}} if (mismatch) - write_log("Target CPU defines all flags on BSF instruction\n"); + write_log ("Target CPU defines all flags on BSF instruction\n"); return !mismatch; } #endif @@ -2567,7 +2567,7 @@ static void raw_init_cpu(void) x=cpuid(0); maxlev=x.eax; - write_log("Max CPUID level=%d Processor is %c%c%c%c%c%c%c%c%c%c%c%c\n", + write_log ("Max CPUID level=%d Processor is %c%c%c%c%c%c%c%c%c%c%c%c\n", maxlev, x.ebx, x.ebx>>8, @@ -2598,7 +2598,7 @@ static void raw_init_cpu(void) write_log ("have_cmov=%d, avoid_cmov=%d, have_rat_stall=%d\n", have_cmov,currprefs.avoid_cmov,have_rat_stall); if (currprefs.avoid_cmov) { - write_log("Disabling cmov use despite processor claiming to support it!\n"); + write_log ("Disabling cmov use despite processor claiming to support it!\n"); have_cmov=0; } #else @@ -2689,7 +2689,7 @@ STATIC_INLINE int stackpos(int r) if (live.spos[r]<0) abort(); if (live.tosdirect_handler_to_use) { dependency* x=bi->deplist; - //write_log("JIT: bi->deplist=%p\n",bi->deplist); + //write_log ("JIT: bi->deplist=%p\n",bi->deplist); while (x) { - //write_log("JIT: x is %p\n",x); - //write_log("JIT: x->next is %p\n",x->next); - //write_log("JIT: x->prev_p is %p\n",x->prev_p); + //write_log ("JIT: x is %p\n",x); + //write_log ("JIT: x->next is %p\n",x->next); + //write_log ("JIT: x->prev_p is %p\n",x->prev_p); if (x->jmp_off) { adjust_jmpdep(x,dh); @@ -318,7 +318,7 @@ STATIC_INLINE void create_jmpdep(blockinfo* bi, int i, uae_u32* jmpaddr, uae_u32 blockinfo* tbi=get_blockinfo_addr((void*)target); Dif(!tbi) { - write_log("JIT: Could not create jmpdep!\n"); + write_log ("JIT: Could not create jmpdep!\n"); abort(); } bi->dep[i].jmp_off=jmpaddr; @@ -347,7 +347,7 @@ STATIC_INLINE void big_to_small_state(bigstate* b, smallstate* s) count++; } } - write_log("JIT: count=%d\n",count); + write_log ("JIT: count=%d\n",count); for (i=0;inat[i].dirtysize=0; } @@ -488,28 +488,28 @@ int check_prefs_changed_comp (void) if(currprefs.cachesize) { - write_log( "JIT: Reverting to \"indirect\" access, because canbang is zero!\n" ); + write_log ( "JIT: Reverting to \"indirect\" access, because canbang is zero!\n" ); } } if (!currprefs.compforcesettings && !have_done_picasso) { int stop=0; if (currprefs.comptrustbyte!=0 && currprefs.comptrustbyte!=3) - stop = 1, write_log("JIT: comptrustbyte is not 'direct' or 'afterpic'\n"); + stop = 1, write_log ("JIT: comptrustbyte is not 'direct' or 'afterpic'\n"); if (currprefs.comptrustword!=0 && currprefs.comptrustword!=3) - stop = 1, write_log("JIT: comptrustword is not 'direct' or 'afterpic'\n"); + stop = 1, write_log ("JIT: comptrustword is not 'direct' or 'afterpic'\n"); if (currprefs.comptrustlong!=0 && currprefs.comptrustlong!=3) - stop = 1, write_log("JIT: comptrustlong is not 'direct' or 'afterpic'\n"); + stop = 1, write_log ("JIT: comptrustlong is not 'direct' or 'afterpic'\n"); if (currprefs.comptrustnaddr!=0 && currprefs.comptrustnaddr!=3) - stop = 1, write_log("JIT: comptrustnaddr is not 'direct' or 'afterpic'\n"); + stop = 1, write_log ("JIT: comptrustnaddr is not 'direct' or 'afterpic'\n"); if (currprefs.compnf!=1) - stop = 1, write_log("JIT: compnf is not 'yes'\n"); + stop = 1, write_log ("JIT: compnf is not 'yes'\n"); if (currprefs.cachesize<1024) - stop = 1, write_log("JIT: cachesize is less than 1024\n"); + stop = 1, write_log ("JIT: cachesize is less than 1024\n"); if (currprefs.comp_hardflush) - stop = 1, write_log("JIT: comp_flushmode is 'hard'\n"); + stop = 1, write_log ("JIT: comp_flushmode is 'hard'\n"); if (!canbang) - stop = 1, write_log("JIT: Cannot use most direct memory access,\n" + stop = 1, write_log ("JIT: Cannot use most direct memory access,\n" " and unable to recover from failed guess!\n"); #if 0 if (stop) { @@ -604,7 +604,7 @@ static void make_flags_live_internal(void) if (live.flags_in_flags==VALID) return; Dif (live.flags_on_stack==TRASH) { - write_log("JIT: Want flags, got something on stack, but it is TRASH\n"); + write_log ("JIT: Want flags, got something on stack, but it is TRASH\n"); abort(); } if (live.flags_on_stack==VALID) { @@ -616,7 +616,7 @@ static void make_flags_live_internal(void) live.flags_in_flags=VALID; return; } - write_log("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n", + write_log ("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n", live.flags_in_flags,live.flags_on_stack); abort(); } @@ -716,17 +716,17 @@ STATIC_INLINE void log_dump(void) return; - write_log("----------------------\n"); + write_log ("----------------------\n"); for (i=0;i=rsize) { @@ -1384,7 +1384,7 @@ STATIC_INLINE int rmw_general(int r, int wsize, int rsize, int spec) live.nat[answer].touched=touchcnt++; Dif (live.state[r].val) { - write_log("JIT: Problem with val(rmw)\n"); + write_log ("JIT: Problem with val(rmw)\n"); abort(); } return answer; @@ -1487,7 +1487,7 @@ STATIC_INLINE void f_free_nreg(int r) f_evict(vr); } Dif (live.fat[r].nholds!=0) { - write_log("JIT: Failed to free nreg %d, nholds is %d\n",r,live.fat[r].nholds); + write_log ("JIT: Failed to free nreg %d, nholds is %d\n",r,live.fat[r].nholds); abort(); } } @@ -1620,13 +1620,13 @@ STATIC_INLINE void f_make_exclusive(int r, int clobber) } } Dif (live.fat[rr].nholds!=1) { - write_log("JIT: realreg %d holds %d (",rr,live.fat[rr].nholds); + write_log ("JIT: realreg %d holds %d (",rr,live.fat[rr].nholds); for (i=0;i 1) { + if (size > 1) { add_l(f,address); /* f now holds the final address */ switch (size) { case 2: gen_bswap_16(source); mov_w_Rr(f,source,0); @@ -5464,11 +5464,11 @@ static void show_checksum(blockinfo* bi) } else { while (len>0) { - write_log("%08x ",*pos); + write_log ("%08x ",*pos); pos++; len-=4; } - write_log(" bla\n"); + write_log (" bla\n"); } } @@ -5554,7 +5554,7 @@ static void check_checksum(void) bi->handler_to_use=bi->handler; set_dhtu(bi,bi->direct_handler); - /* write_log("JIT: reactivate %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, + /* write_log ("JIT: reactivate %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, c1,c2,bi->c1,bi->c2);*/ remove_from_list(bi); add_to_active(bi); @@ -5563,7 +5563,7 @@ static void check_checksum(void) else { /* This block actually changed. We need to invalidate it, and set it up to be recompiled */ - /* write_log("JIT: discard %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, + /* write_log ("JIT: discard %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, c1,c2,bi->c1,bi->c2); */ invalidate_block(bi); raise_in_cl_list(bi); @@ -5768,7 +5768,7 @@ void build_comp(void) #endif int isjmp,isaddx,iscjmp; int lvl; - + lvl = 5 - (currprefs.cpu_model - 68000) / 10; if (lvl < 0) lvl = 0; @@ -5848,7 +5848,7 @@ static void flush_icache_hard(int n) hard_flush_count++; #if 0 - write_log("JIT: Flush Icache_hard(%d/%x/%p), %u instruction bytes\n", + write_log ("JIT: Flush Icache_hard(%d/%x/%p), %u instruction bytes\n", n,regs.pc,regs.pc_p,current_compile_p-compiled_code); #endif bi=active; @@ -5958,7 +5958,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) Dif (bi!=bi2) { /* I don't think it can happen anymore. Shouldn't, in any case. So let's make sure... */ - write_log("JIT: WOOOWOO count=%d, ol=%d %p %p\n", + write_log ("JIT: WOOOWOO count=%d, ol=%d %p %p\n", bi->count,bi->optlevel,bi->handler_to_use, cache_tags[cl].handler); abort(); diff --git a/cpummu.c b/cpummu.c index 81402484..9beaa7c4 100755 --- a/cpummu.c +++ b/cpummu.c @@ -2,7 +2,7 @@ * cpummu.cpp - MMU emulation * * Copyright (c) 2001-2004 Milan Jurik of ARAnyM dev team (see AUTHORS) - * + * * Inspired by UAE MMU patch * * This file is part of the ARAnyM project which builds a new and powerful @@ -57,7 +57,7 @@ static void mmu_dump_ttr(const char * label, uae_u32 ttr) from_addr = ttr & MMU_TTR_LOGICAL_BASE; to_addr = (ttr & MMU_TTR_LOGICAL_MASK) << 8; - write_log("%s: [%08lx] %08lx - %08lx enabled=%d supervisor=%d wp=%d cm=%02d", + write_log ("%s: [%08lx] %08lx - %08lx enabled=%d supervisor=%d wp=%d cm=%02d", label, ttr, from_addr, to_addr, ttr & MMU_TTR_BIT_ENABLED ? 1 : 0, @@ -84,7 +84,7 @@ void mmu_make_transparent_region(uaecptr baseaddr, uae_u32 size, int datamode) *ttr |= ((baseaddr + size - 1) & MMU_TTR_LOGICAL_BASE) >> 8; *ttr |= MMU_TTR_BIT_ENABLED; - write_log("MMU: map transparent mapping of %08x", *ttr); + write_log ("MMU: map transparent mapping of %08x", *ttr); } /* check if an address matches a ttr */ @@ -145,7 +145,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) D(bug("%s: root=%lx", label, root_ptr)); for (root_idx = 0; root_idx < ROOT_TABLE_SIZE; root_idx++) { - root_des = phys_get_long(root_ptr + root_idx); + root_des = phys_get_long (root_ptr + root_idx); if ((root_des & 2) == 0) continue; /* invalid */ @@ -168,7 +168,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) } page_info[PAGE_TABLE_SIZE]; int n_pages_used; - ptr_des = phys_get_long(ptr_des_addr + ptr_idx); + ptr_des = phys_get_long (ptr_des_addr + ptr_idx); ptr_log = root_log | (ptr_idx << PTR_INDEX_SHIFT); if ((ptr_des & 2) == 0) @@ -179,7 +179,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) n_pages_used = -1; for (page_idx = 0; page_idx < PAGE_TABLE_SIZE; page_idx++) { - page_des = phys_get_long(page_addr + page_idx); + page_des = phys_get_long (page_addr + page_idx); page_log = ptr_log | (page_idx << 2); // ??? PAGE_INDEX_SHIFT switch (page_des & 3) { @@ -255,7 +255,7 @@ void mmu_dump_atc(void) for (j = 0; j < ATC_L2_SIZE; j++) { if (atc_l2[i][j].tag == 0x8000) continue; - write_log("ATC[%02d] G=%d TT=%d M=%d WP=%d VD=%d VI=%d tag=%08x --> phys=%08x", + write_log ("ATC[%02d] G=%d TT=%d M=%d WP=%d VD=%d VI=%d tag=%08x --> phys=%08x", j, atc_l2[i][j].global, atc_l2[i][j].tt, atc_l2[i][j].modified, atc_l2[i][j].write_protect, atc_l2[i][j].valid_data, atc_l2[i][j].valid_inst, atc_l2[i][j].tag, atc_l2[i][j].phys); @@ -267,7 +267,7 @@ void mmu_dump_atc(void) /* {{{ mmu_dump_tables */ void mmu_dump_tables(void) { - write_log("URP: %08x SRP: %08x MMUSR: %x TC: %x", regs.urp, regs.srp, regs.mmusr, regs.tcr); + write_log ("URP: %08x SRP: %08x MMUSR: %x TC: %x", regs.urp, regs.srp, regs.mmusr, regs.tcr); mmu_dump_ttr("DTT0", regs.dtt0); mmu_dump_ttr("DTT1", regs.dtt1); mmu_dump_ttr("ITT0", regs.itt0); @@ -308,7 +308,7 @@ static void mmu_bus_error(uaecptr addr, int fc, int write, int size) regs.mmu_fault_addr = addr; regs.mmu_ssw = ssw | MMU_SSW_ATC; - write_log("BUS ERROR: fc=%d w=%d log=%08x ssw=%04x", fc, write, addr, ssw); + write_log ("BUS ERROR: fc=%d w=%d log=%08x ssw=%04x", fc, write, addr, ssw); THROW(2); } @@ -357,7 +357,7 @@ static uaecptr mmu_fill_atc_l2(uaecptr addr, int super, int data, int write, SAVE_EXCEPTION; TRY(prb) { desc = mmu_lookup_pagetable(addr, super, write); - write_log("translate: %x,%u,%u,%u -> %x", addr, super, write, data, desc); + write_log ("translate: %x,%u,%u,%u -> %x", addr, super, write, data, desc); RESTORE_EXCEPTION; } CATCH(prb) { @@ -399,12 +399,12 @@ mmu_fill_atc_l1(uaecptr addr, int super, int data, int write, mmu_fill_atc_l2(addr, super, data, write, l); } if (!(data ? l->valid_data : l->valid_inst)) { - write_log("MMU: non-resident page (%x,%x,%x)!", addr, regs.pc, regs.fault_pc); + write_log ("MMU: non-resident page (%x,%x,%x)!", addr, regs.pc, regs.fault_pc); goto fail; } if (write) { if (l->write_protect) { - write_log("MMU: write protected (via %s) %lx", l->tt ? "ttr" : "atc", addr); + write_log ("MMU: write protected (via %s) %lx", l->tt ? "ttr" : "atc", addr); goto fail; } if (!l->modified) @@ -464,27 +464,27 @@ static uaecptr REGPARAM2 mmu_lookup_pagetable(uaecptr addr, int super, int write /* fetch root table descriptor */ i = (addr >> 23) & 0x1fc; desc_addr = (desc & MMU_ROOT_PTR_ADDR_MASK) | i; - desc = phys_get_long(desc_addr); + desc = phys_get_long (desc_addr); if ((desc & 2) == 0) { - write_log("MMU: invalid root descriptor for %lx", addr); + write_log ("MMU: invalid root descriptor for %lx", addr); return 0; } wp |= desc; if ((desc & MMU_DES_USED) == 0) - phys_put_long(desc_addr, desc | MMU_DES_USED); + phys_put_long (desc_addr, desc | MMU_DES_USED); /* fetch pointer table descriptor */ i = (addr >> 16) & 0x1fc; desc_addr = (desc & MMU_ROOT_PTR_ADDR_MASK) | i; - desc = phys_get_long(desc_addr); + desc = phys_get_long (desc_addr); if ((desc & 2) == 0) { - write_log("MMU: invalid ptr descriptor for %lx", addr); + write_log ("MMU: invalid ptr descriptor for %lx", addr); return 0; } wp |= desc; if ((desc & MMU_DES_USED) == 0) - phys_put_long(desc_addr, desc | MMU_DES_USED); + phys_put_long (desc_addr, desc | MMU_DES_USED); /* fetch page table descriptor */ if (regs.mmu_pagesize_8k) { @@ -496,20 +496,20 @@ static uaecptr REGPARAM2 mmu_lookup_pagetable(uaecptr addr, int super, int write } get_page_descriptor: - desc = phys_get_long(desc_addr); + desc = phys_get_long (desc_addr); if ((desc & 1) == 0) { if ((desc & 2) == 0) { - write_log("MMU: invalid page descriptor log=%08lx desc=%08lx @%08lx", addr, desc, desc_addr); + write_log ("MMU: invalid page descriptor log=%08lx desc=%08lx @%08lx", addr, desc, desc_addr); return desc; } /* indirect */ if (indirect) { - write_log("MMU: double indirect descriptor log=%lx descriptor @ %lx", addr, desc_addr); + write_log ("MMU: double indirect descriptor log=%lx descriptor @ %lx", addr, desc_addr); return desc; } wp |= desc; if ((desc & MMU_DES_USED) == 0) - phys_put_long(desc_addr, desc | MMU_DES_USED); + phys_put_long (desc_addr, desc | MMU_DES_USED); desc_addr = desc & MMU_PAGE_INDIRECT_MASK; indirect = 1; goto get_page_descriptor; @@ -520,17 +520,17 @@ get_page_descriptor: if (desc & MMU_DES_WP) { if ((desc & MMU_DES_USED) == 0) { desc |= MMU_DES_USED; - phys_put_long(desc_addr, desc); + phys_put_long (desc_addr, desc); } } else if ((desc & (MMU_DES_USED|MMU_DES_MODIFIED)) != (MMU_DES_USED|MMU_DES_MODIFIED)) { desc |= MMU_DES_USED|MMU_DES_MODIFIED; - phys_put_long(desc_addr, desc); + phys_put_long (desc_addr, desc); } } else { if ((desc & MMU_DES_USED) == 0) { desc |= MMU_DES_USED; - phys_put_long(desc_addr, desc); + phys_put_long (desc_addr, desc); } } return desc; @@ -540,10 +540,10 @@ uae_u16 REGPARAM2 mmu_get_word_unaligned(uaecptr addr, int data) { uae_u16 res; - res = (uae_u16)mmu_get_byte(addr, data, sz_word) << 8; + res = (uae_u16)mmu_get_byte (addr, data, sz_word) << 8; SAVE_EXCEPTION; TRY(prb) { - res |= mmu_get_byte(addr + 1, data, sz_word); + res |= mmu_get_byte (addr + 1, data, sz_word); RESTORE_EXCEPTION; } CATCH(prb) { @@ -560,10 +560,10 @@ uae_u32 mmu_get_long_unaligned(uaecptr addr, int data) uae_u32 res; if (likely(!(addr & 1))) { - res = (uae_u32)mmu_get_word(addr, data, sz_long) << 16; + res = (uae_u32)mmu_get_word (addr, data, sz_long) << 16; SAVE_EXCEPTION; TRY(prb) { - res |= mmu_get_word(addr + 2, data, sz_long); + res |= mmu_get_word (addr + 2, data, sz_long); RESTORE_EXCEPTION; } CATCH(prb) { @@ -573,12 +573,12 @@ uae_u32 mmu_get_long_unaligned(uaecptr addr, int data) THROW_AGAIN(prb); } } else { - res = (uae_u32)mmu_get_byte(addr, data, sz_long) << 8; + res = (uae_u32)mmu_get_byte (addr, data, sz_long) << 8; SAVE_EXCEPTION; TRY(prb) { - res = (res | mmu_get_byte(addr + 1, data, sz_long)) << 8; - res = (res | mmu_get_byte(addr + 2, data, sz_long)) << 8; - res |= mmu_get_byte(addr + 3, data, sz_long); + res = (res | mmu_get_byte (addr + 1, data, sz_long)) << 8; + res = (res | mmu_get_byte (addr + 2, data, sz_long)) << 8; + res |= mmu_get_byte (addr + 3, data, sz_long); RESTORE_EXCEPTION; } CATCH(prb) { @@ -607,7 +607,7 @@ uae_u8 REGPARAM2 mmu_get_byte_slow(uaecptr addr, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 0, cl)) goto redo; - return do_get_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl)); + return do_get_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl)); } uae_u16 REGPARAM2 mmu_get_word_slow(uaecptr addr, int super, int data, @@ -626,7 +626,7 @@ uae_u16 REGPARAM2 mmu_get_word_slow(uaecptr addr, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 0, cl)) goto redo; - return do_get_mem_word((uae_u16 *)mmu_get_real_address(addr, cl)); + return do_get_mem_word((uae_u16 *)mmu_get_real_address (addr, cl)); } uae_u32 REGPARAM2 mmu_get_long_slow(uaecptr addr, int super, int data, @@ -645,7 +645,7 @@ uae_u32 REGPARAM2 mmu_get_long_slow(uaecptr addr, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 0, cl)) goto redo; - return do_get_mem_long((uae_u32 *)mmu_get_real_address(addr, cl)); + return do_get_mem_long((uae_u32 *)mmu_get_real_address (addr, cl)); } void REGPARAM2 mmu_put_long_unaligned(uaecptr addr, uae_u32 val, int data) @@ -653,13 +653,13 @@ void REGPARAM2 mmu_put_long_unaligned(uaecptr addr, uae_u32 val, int data) SAVE_EXCEPTION; TRY(prb) { if (likely(!(addr & 1))) { - mmu_put_word(addr, val >> 16, data, sz_long); - mmu_put_word(addr + 2, val, data, sz_long); + mmu_put_word (addr, val >> 16, data, sz_long); + mmu_put_word (addr + 2, val, data, sz_long); } else { - mmu_put_byte(addr, val >> 24, data, sz_long); - mmu_put_byte(addr + 1, val >> 16, data, sz_long); - mmu_put_byte(addr + 2, val >> 8, data, sz_long); - mmu_put_byte(addr + 3, val, data, sz_long); + mmu_put_byte (addr, val >> 24, data, sz_long); + mmu_put_byte (addr + 1, val >> 16, data, sz_long); + mmu_put_byte (addr + 2, val >> 8, data, sz_long); + mmu_put_byte (addr + 3, val, data, sz_long); } RESTORE_EXCEPTION; } @@ -678,8 +678,8 @@ void REGPARAM2 mmu_put_word_unaligned(uaecptr addr, uae_u16 val, int data) { SAVE_EXCEPTION; TRY(prb) { - mmu_put_byte(addr, val >> 8, data, sz_word); - mmu_put_byte(addr + 1, val, data, sz_word); + mmu_put_byte (addr, val >> 8, data, sz_word); + mmu_put_byte (addr + 1, val, data, sz_word); RESTORE_EXCEPTION; } CATCH(prb) { @@ -712,7 +712,7 @@ void REGPARAM2 mmu_put_byte_slow(uaecptr addr, uae_u8 val, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 1, cl)) goto redo; - do_put_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl), val); + do_put_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl), val); } void REGPARAM2 mmu_put_word_slow(uaecptr addr, uae_u16 val, int super, int data, @@ -734,7 +734,7 @@ void REGPARAM2 mmu_put_word_slow(uaecptr addr, uae_u16 val, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 1, cl)) goto redo; - do_put_mem_word((uae_u16 *)mmu_get_real_address(addr, cl), val); + do_put_mem_word((uae_u16 *)mmu_get_real_address (addr, cl), val); } void REGPARAM2 mmu_put_long_slow(uaecptr addr, uae_u32 val, int super, int data, @@ -756,10 +756,10 @@ void REGPARAM2 mmu_put_long_slow(uaecptr addr, uae_u32 val, int super, int data, if (!mmu_fill_atc_l1(addr, super, data, 1, cl)) goto redo; - do_put_mem_long((uae_u32 *)mmu_get_real_address(addr, cl), val); + do_put_mem_long((uae_u32 *)mmu_get_real_address (addr, cl), val); } -uae_u32 REGPARAM2 sfc_get_long(uaecptr addr) +uae_u32 REGPARAM2 sfc_get_long (uaecptr addr) { int super = (regs.sfc & 4) != 0; int data = (regs.sfc & 3) != 2; @@ -800,7 +800,7 @@ uae_u32 REGPARAM2 sfc_get_long(uaecptr addr) return res; } -uae_u16 REGPARAM2 sfc_get_word(uaecptr addr) +uae_u16 REGPARAM2 sfc_get_word (uaecptr addr) { int super = (regs.sfc & 4) != 0; int data = (regs.sfc & 3) != 2; @@ -824,7 +824,7 @@ uae_u16 REGPARAM2 sfc_get_word(uaecptr addr) return res; } -uae_u8 REGPARAM2 sfc_get_byte(uaecptr addr) +uae_u8 REGPARAM2 sfc_get_byte (uaecptr addr) { int super = (regs.sfc & 4) != 0; int data = (regs.sfc & 3) != 2; @@ -832,7 +832,7 @@ uae_u8 REGPARAM2 sfc_get_byte(uaecptr addr) return mmu_get_user_byte(addr, super, data, sz_byte); } -void REGPARAM2 dfc_put_long(uaecptr addr, uae_u32 val) +void REGPARAM2 dfc_put_long (uaecptr addr, uae_u32 val) { int super = (regs.dfc & 4) != 0; int data = (regs.dfc & 3) != 2; @@ -863,7 +863,7 @@ void REGPARAM2 dfc_put_long(uaecptr addr, uae_u32 val) } } -void REGPARAM2 dfc_put_word(uaecptr addr, uae_u16 val) +void REGPARAM2 dfc_put_word (uaecptr addr, uae_u16 val) { int super = (regs.dfc & 4) != 0; int data = (regs.dfc & 3) != 2; @@ -889,7 +889,7 @@ void REGPARAM2 dfc_put_word(uaecptr addr, uae_u16 val) } } -void REGPARAM2 dfc_put_byte(uaecptr addr, uae_u8 val) +void REGPARAM2 dfc_put_byte (uaecptr addr, uae_u8 val) { int super = (regs.dfc & 4) != 0; int data = (regs.dfc & 3) != 2; @@ -919,11 +919,11 @@ void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u16 extra) glob = (opcode & 8) != 0; if (opcode & 16) { - write_log("pflusha(%u,%u)", glob, regs->dfc); + write_log ("pflusha(%u,%u)", glob, regs->dfc); mmu_flush_atc_all(glob); } else { - addr = m68k_areg(regs, regno); - write_log("pflush(%u,%u,%x)", glob, regs->dfc, addr); + addr = m68k_areg (regs, regno); + write_log ("pflush(%u,%u,%x)", glob, regs->dfc, addr); mmu_flush_atc(addr, super, glob); } flush_internals(); @@ -936,8 +936,8 @@ void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u16 extra) regno = opcode & 7; write = (opcode & 32) == 0; - addr = m68k_areg(regs, regno); - write_log("PTEST%c (A%d) %08x DFC=%d", write ? 'W' : 'R', regno, addr, regs->dfc); + addr = m68k_areg (regs, regno); + write_log ("PTEST%c (A%d) %08x DFC=%d", write ? 'W' : 'R', regno, addr, regs->dfc); mmu_flush_atc(addr, super, 1); SAVE_EXCEPTION; TRY(prb) { @@ -961,7 +961,7 @@ void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u16 extra) regs->mmusr = MMU_MMUSR_B; } RESTORE_EXCEPTION; - write_log("PTEST result: mmusr %08x", regs->mmusr); + write_log ("PTEST result: mmusr %08x", regs->mmusr); } else op_illg (opcode, regs); } @@ -1036,7 +1036,7 @@ void REGPARAM2 mmu_set_tc(uae_u16 tcr) regs.mmu_pagesize_8k = tcr & 0x4000 ? 1 : 0; mmu_flush_atc_all(1); - write_log("MMU: enabled=%d page8k=%d\n", regs.mmu_enabled, regs.mmu_pagesize_8k); + write_log ("MMU: enabled=%d page8k=%d\n", regs.mmu_enabled, regs.mmu_pagesize_8k); } void REGPARAM2 mmu_set_super(int super) diff --git a/crc32.c b/crc32.c index fbf94080..e9a05b46 100755 --- a/crc32.c +++ b/crc32.c @@ -47,9 +47,9 @@ uae_u16 get_crc16( uae_u8 *buf, int len) #define GET_UINT32_BE(n,b,i) \ { \ (n) = ( (unsigned long) (b)[(i) ] << 24 ) \ - | ( (unsigned long) (b)[(i) + 1] << 16 ) \ - | ( (unsigned long) (b)[(i) + 2] << 8 ) \ - | ( (unsigned long) (b)[(i) + 3] ); \ + | ( (unsigned long) (b)[(i) + 1] << 16 ) \ + | ( (unsigned long) (b)[(i) + 2] << 8 ) \ + | ( (unsigned long) (b)[(i) + 3] ); \ } #endif #ifndef PUT_UINT32_BE @@ -108,7 +108,7 @@ static void sha1_process( sha1_context *ctx, unsigned char data[64] ) #define R(t) \ ( \ temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ - W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ + W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ ( W[t & 0x0F] = S(temp,1) ) \ ) @@ -247,7 +247,7 @@ static void sha1_update( sha1_context *ctx, unsigned char *input, int ilen ) unsigned long left; if( ilen <= 0 ) - return; + return; left = ctx->total[0] & 0x3F; fill = 64 - left; @@ -256,29 +256,29 @@ static void sha1_update( sha1_context *ctx, unsigned char *input, int ilen ) ctx->total[0] &= 0xFFFFFFFF; if( ctx->total[0] < (unsigned long) ilen ) - ctx->total[1]++; + ctx->total[1]++; if( left && ilen >= fill ) { - memcpy( (void *) (ctx->buffer + left), - (void *) input, fill ); - sha1_process( ctx, ctx->buffer ); - input += fill; - ilen -= fill; - left = 0; + memcpy( (void *) (ctx->buffer + left), + (void *) input, fill ); + sha1_process( ctx, ctx->buffer ); + input += fill; + ilen -= fill; + left = 0; } while( ilen >= 64 ) { - sha1_process( ctx, input ); - input += 64; - ilen -= 64; + sha1_process( ctx, input ); + input += 64; + ilen -= 64; } if( ilen > 0 ) { - memcpy( (void *) (ctx->buffer + left), - (void *) input, ilen ); + memcpy( (void *) (ctx->buffer + left), + (void *) input, ilen ); } } @@ -300,7 +300,7 @@ static void sha1_finish( sha1_context *ctx, unsigned char output[20] ) unsigned char msglen[8]; high = ( ctx->total[0] >> 29 ) - | ( ctx->total[1] << 3 ); + | ( ctx->total[1] << 3 ); low = ( ctx->total[0] << 3 ); PUT_UINT32_BE( high, msglen, 0 ); diff --git a/custom.c b/custom.c index b266eaa7..da366c99 100755 --- a/custom.c +++ b/custom.c @@ -78,7 +78,7 @@ void uae_abort (const char *format,...) _vsnprintf(buffer, sizeof (buffer) - 1, format, parms ); va_end (parms); if (nomore) { - write_log(buffer); + write_log (buffer); return; } gui_message (buffer); @@ -397,11 +397,11 @@ STATIC_INLINE alloc_cycle(int hpos, int type) #ifdef CPUEMU_12 #if 0 if (cycle_line[hpos]) - write_log("hpos=%d, old=%d, new=%d\n", hpos, cycle_line[hpos], type); + write_log ("hpos=%d, old=%d, new=%d\n", hpos, cycle_line[hpos], type); if ((type == CYCLE_CPU || type == CYCLE_COPPER) && (hpos & 1)) - write_log("odd %d cycle %d\n", hpos); + write_log ("odd %d cycle %d\n", hpos); if (!(hpos & 1) && (type == CYCLE_SPRITE || type == CYCLE_REFRESH || type == CYCLE_MISC)) - write_log("even %d cycle %d\n", type, hpos); + write_log ("even %d cycle %d\n", type, hpos); #endif cycle_line[hpos] = type; #endif @@ -414,10 +414,10 @@ void alloc_cycle_ext(int hpos, int type) static void hsyncdelay(void) { -#if 0 +#if 0 static int prevhpos; while (current_hpos () == prevhpos) - do_cycles(CYCLE_UNIT); + do_cycles(CYCLE_UNIT); prevhpos = current_hpos(); #endif } @@ -636,16 +636,16 @@ static void debug_cycle_diagram(void) write_log ("FMODE %d\n=======\n", fm); for (res = 0; res <= 2; res++) { for (planes = 0; planes <= 8; planes++) { - write_log("%d: ",planes); + write_log ("%d: ",planes); for (cycle = 0; cycle < 32; cycle++) { v=cycle_diagram_table[fm][res][planes][cycle]; if (v==0) aa='-'; else if(v>0) aa='1'; else aa='X'; - write_log("%c",aa); + write_log ("%c",aa); } - write_log(" %d:%d\n", + write_log (" %d:%d\n", cycle_diagram_free_cycles[fm][res][planes], cycle_diagram_total_cycles[fm][res][planes]); } - write_log("\n"); + write_log ("\n"); } } fm=0; @@ -764,7 +764,7 @@ STATIC_INLINE void compute_delay_offset (void) delayoffset = 16; else /* what about 40 and 56? */ delayoffset = 0; - //write_log("%d:%d ", vpos, delayoffset); + //write_log ("%d:%d ", vpos, delayoffset); #endif } @@ -2069,7 +2069,7 @@ static void finish_decisions (void) if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { if (fetch_state != fetch_not_started) { - write_log("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n", + write_log ("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n", fetch_state, thisline_decision.plfleft, thisline_decision.plflinelen, vpos, hpos); uae_abort ("fetch_state != fetch_not_started"); @@ -2279,7 +2279,7 @@ void init_hz (void) vblank_hz = VBLANK_HZ_NTSC; sprite_vblank_endline = VBLANK_SPRITE_NTSC; } - maxvpos_max = maxvpos; + maxvpos_max = maxvpos; } if (beamcon0 & 0x80) { if (vtotal >= MAXVPOS) @@ -2461,7 +2461,7 @@ STATIC_INLINE uae_u16 VPOSR (void) vp &= 1; vp = vp | lof | csbit; #if 0 - write_log ("vposr %x at %x\n", vp, m68k_getpc(®s)); + write_log ("vposr %x at %x\n", vp, m68k_getpc (®s)); #endif if (currprefs.cpu_model >= 68020) hsyncdelay(); @@ -2470,7 +2470,7 @@ STATIC_INLINE uae_u16 VPOSR (void) static void VPOSW (uae_u16 v) { #if 0 - write_log ("vposw %x at %x\n", v, m68k_getpc(®s)); + write_log ("vposw %x at %x\n", v, m68k_getpc (®s)); #endif if (lof != (v & 0x8000)) lof_changed = 1; @@ -2510,7 +2510,7 @@ static void immediate_copper (int num) cop_state.vpos = vpos; cop_state.hpos = current_hpos () & ~1; cop_state.ip = num == 1 ? cop1lc : cop2lc; - + while (pos < (maxvpos << 5)) { if (oldpos > pos) pos = oldpos; @@ -2526,11 +2526,11 @@ static void immediate_copper (int num) if (!(cop_state.i1 & 1)) { // move cop_state.i1 &= 0x1fe; if (cop_state.i1 == 0x88) { - cop_state.ip = cop1lc; + cop_state.ip = cop1lc; continue; } if (cop_state.i1 == 0x8a) { - cop_state.ip = cop2lc; + cop_state.ip = cop2lc; continue; } if (test_copper_dangerous (cop_state.i1)) @@ -2640,17 +2640,17 @@ int intlev (void) if (!(imask && (intena & 0x4000))) return -1; if (imask & (0x4000 | 0x2000)) // 13 14 - return 6; + return 6; if (imask & (0x1000 | 0x0800)) // 11 12 - return 5; + return 5; if (imask & (0x0400 | 0x0200 | 0x0100 | 0x0080)) // 7 8 9 10 - return 4; + return 4; if (imask & (0x0040 | 0x0020 | 0x0010)) // 4 5 6 - return 3; + return 3; if (imask & 0x0008) // 3 - return 2; + return 2; if (imask & (0x0001 | 0x0002 | 0x0004)) // 0 1 2 - return 1; + return 1; return -1; } @@ -2668,7 +2668,7 @@ STATIC_INLINE void INTENA (uae_u16 v) setclr (&intena,v); #if 0 if (v & 0x40) - write_log("INTENA %04.4X (%04.4X) %p\n", intena, v, M68K_GETPC); + write_log ("INTENA %04.4X (%04.4X) %p\n", intena, v, M68K_GETPC); #endif if (v & 0x8000) { if (!use_eventmode()) @@ -2787,7 +2787,7 @@ static void BPLxPTH (int hpos, uae_u16 v, int num) decide_line (hpos); decide_fetch (hpos); bplpt[num] = (bplpt[num] & 0xffff) | ((uae_u32)v << 16); - //write_log("%d:%d:BPL%dPTH %08.8X\n", hpos, vpos, num, v); + //write_log ("%d:%d:BPL%dPTH %08.8X\n", hpos, vpos, num, v); } static void BPLxPTL (int hpos, uae_u16 v, int num) { @@ -2799,7 +2799,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num) if (is_bitplane_dma(hpos - 1) == num + 1 && num > 0) delta = 2 << fetchmode; bplpt[num] = (bplpt[num] & ~0xffff) | ((v + delta) & 0xfffe); - //write_log("%d:%d:BPL%dPTL %08.8X\n", hpos, vpos, num, v); + //write_log ("%d:%d:BPL%dPTL %08.8X\n", hpos, vpos, num, v); } static void BPLCON0 (int hpos, uae_u16 v) @@ -3104,13 +3104,12 @@ static void BLTSIZH (uae_u16 v) STATIC_INLINE void spr_arm (int num, int state) { - switch (state) - { - case 0: + switch (state) { + case 0: nr_armed -= spr[num].armed; spr[num].armed = 0; break; - default: + default: nr_armed += 1 - spr[num].armed; spr[num].armed = 1; break; @@ -3161,7 +3160,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:SPR%dCTL %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", - vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc()); + vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc ()); } #endif @@ -3174,7 +3173,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:SPR%dPOS %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", - vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc()); + vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc ()); } #endif } @@ -3190,7 +3189,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:SPR%dDATA %04.4X P=%06.6X D=%d A=%d PC=%x\n", - vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc()); + vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc ()); } #endif } @@ -3205,7 +3204,7 @@ STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos) #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:SPR%dDATB %04.4X P=%06.6X D=%d A=%d PC=%x\n", - vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc()); + vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc ()); } #endif } @@ -3467,11 +3466,11 @@ static int isagnus[]= { static void dump_copper (char *error, int until_hpos) { - write_log("%s: vpos=%d until_hpos=%d\n", + write_log ("%s: vpos=%d until_hpos=%d\n", error, vpos, until_hpos); - write_log("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04.4X ci2=%04.4X\n", + write_log ("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04.4X ci2=%04.4X\n", cop_state.vcmp,cop_state.hcmp,cop_state.hpos,cop_state.vpos,cop_state.saved_i1,cop_state.saved_i2); - write_log("cstate=%d ip=%x SPCFLAGS=%x\n", + write_log ("cstate=%d ip=%x SPCFLAGS=%x\n", cop_state.state, cop_state.ip, regs.spcflags); } @@ -3482,7 +3481,7 @@ static void update_copper (int until_hpos) if (nocustom()) return; - + if (cop_state.state == COP_wait && vp < cop_state.vcmp) { dump_copper ("error2", until_hpos); copper_enabled_thisline = 0; @@ -3764,7 +3763,7 @@ STATIC_INLINE uae_u16 sprite_fetch (struct sprite *s, int dma, int hpos, int cyc uae_u16 data = last_custom_value; if (dma) { data = last_custom_value = chipmem_agnus_wget (s->pt); - alloc_cycle(hpos, CYCLE_SPRITE); + alloc_cycle(hpos, CYCLE_SPRITE); } s->pt += 2; return data; @@ -3781,7 +3780,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) #if SPRITE_DEBUG > 3 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log("%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); + write_log ("%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); #endif if (vpos == s->vstart) { #if SPRITE_DEBUG > 0 @@ -4087,7 +4086,7 @@ static void framewait (void) curr_time = start = read_processor_time(); if (!isvsync()) { while (rpt_vsync () < 0); - curr_time = read_processor_time (); + curr_time = read_processor_time (); } vsyncmintime = curr_time + vsynctime; idletime += read_processor_time() - start; @@ -4278,17 +4277,17 @@ static void CIA_vsync_prehandler(void) CIA_vsync_handler (); #if 0 if (input_recording > 0) { - inprec_rstart(INPREC_CIAVSYNC); - inprec_ru32(ciavsync_counter); - inprec_rend(); + inprec_rstart(INPREC_CIAVSYNC); + inprec_ru32(ciavsync_counter); + inprec_rend(); } else if (input_recording < 0) { - uae_u32 v = -1; - while (inprec_pstart(INPREC_CIAVSYNC)) { + uae_u32 v = -1; + while (inprec_pstart(INPREC_CIAVSYNC)) { v = inprec_pu32(); inprec_pend(); } if (v != ciavsync_counter) - write_log("INPREC: ciavsync sync error %d <> %d\n", v, ciavsync_counter); + write_log ("INPREC: ciavsync sync error %d <> %d\n", v, ciavsync_counter); } #endif ciavsync_counter++; @@ -4300,7 +4299,7 @@ static void hsync_handler (void) if (!nocustom()) { sync_copper_with_cpu (maxhpos, 0); - finish_decisions (); + finish_decisions (); if (thisline_decision.plfleft != -1) { if (currprefs.collision_level > 1) do_sprite_collisions (); @@ -4311,7 +4310,7 @@ static void hsync_handler (void) /* reset light pen latch */ if (vpos == sprite_vblank_endline) lightpen_triggered = 0; - if (lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) { + if (lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) { vpos_lpen = vpos; hpos_lpen = lightpen_cx; lightpen_triggered = 1; @@ -4325,8 +4324,8 @@ static void hsync_handler (void) #endif #ifdef CPUEMU_12 if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) { - decide_blitter (hpos); - memset (cycle_line, 0, sizeof cycle_line); + decide_blitter (hpos); + memset (cycle_line, 0, sizeof cycle_line); alloc_cycle(1, CYCLE_REFRESH); alloc_cycle(3, CYCLE_REFRESH); alloc_cycle(5, CYCLE_REFRESH); @@ -4357,7 +4356,7 @@ static void hsync_handler (void) last_custom_value = 0xffff; if (currprefs.produce_sound) - audio_hsync (1); + audio_hsync (1); if (!nocustom()) { if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) @@ -4382,9 +4381,9 @@ static void hsync_handler (void) vsync_handler (); #if 0 if (input_recording > 0) { - inprec_rstart(INPREC_VSYNC); - inprec_ru32(vsync_counter); - inprec_rend(); + inprec_rstart (INPREC_VSYNC); + inprec_ru32 (vsync_counter); + inprec_rend (); } else if (input_recording < 0) { uae_u32 v = -1; while (inprec_pstart(INPREC_VSYNC)) { @@ -4392,12 +4391,12 @@ static void hsync_handler (void) inprec_pend(); } if (v != vsync_counter) - write_log("INPREC: vsync sync error %d <> %d\n", v, vsync_counter); + write_log ("INPREC: vsync sync error %d <> %d\n", v, vsync_counter); } #endif vsync_counter++; if (currprefs.cs_ciaatod == 0) - CIA_vsync_prehandler(); + CIA_vsync_prehandler (); } DISK_hsync (maxhpos); @@ -4407,10 +4406,10 @@ static void hsync_handler (void) if (currprefs.m68k_speed == -1) { static int count = 0; count++; - if (trigger_frh(count)) { - frh_handler(); + if (trigger_frh (count)) { + frh_handler (); } - is_lastline = trigger_frh(count+1) && ! rpt_did_reset; + is_lastline = trigger_frh (count + 1) && ! rpt_did_reset; } else { is_lastline=0; } @@ -4422,16 +4421,16 @@ static void hsync_handler (void) #endif if (!nocustom()) { - int lineno = vpos; + int lineno = vpos; if (bplcon0 & 4) notice_interlace_seen (); - nextline_how = nln_normal; - if (currprefs.gfx_linedbl) { + nextline_how = nln_normal; + if (currprefs.gfx_linedbl) { lineno *= 2; nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack; if (bplcon0 & 4) { - if (!lof) { + if (!lof) { lineno++; nextline_how = nln_lower; } else { @@ -4448,7 +4447,7 @@ static void hsync_handler (void) } { - extern void bsdsock_fake_int_handler(void); + extern void bsdsock_fake_int_handler(void); extern int bsd_int_requested; if (bsd_int_requested) bsdsock_fake_int_handler(); @@ -4463,25 +4462,25 @@ static void hsync_handler (void) do_sprites (0); #endif - while (input_recording < 0 && inprec_pstart(INPREC_KEY)) { - record_key_direct (inprec_pu8()); - inprec_pend(); + while (input_recording < 0 && inprec_pstart (INPREC_KEY)) { + record_key_direct (inprec_pu8 ()); + inprec_pend (); } - while (input_recording < 0 && inprec_pstart(INPREC_DISKREMOVE)) { - disk_eject (inprec_pu8()); - inprec_pend(); + while (input_recording < 0 && inprec_pstart (INPREC_DISKREMOVE)) { + disk_eject (inprec_pu8 ()); + inprec_pend (); } - while (input_recording < 0 && inprec_pstart(INPREC_DISKINSERT)) { - int drv = inprec_pu8(); - inprec_pstr (currprefs.df[drv]); - strcpy (changed_prefs.df[drv], currprefs.df[drv]); - disk_insert_force (drv, currprefs.df[drv]); - inprec_pend(); + while (input_recording < 0 && inprec_pstart (INPREC_DISKINSERT)) { + int drv = inprec_pu8 (); + inprec_pstr (currprefs.df[drv]); + strcpy (changed_prefs.df[drv], currprefs.df[drv]); + disk_insert_force (drv, currprefs.df[drv]); + inprec_pend (); } inputdevice_hsync (); - gayle_hsync(); - scsi_hsync(); + gayle_hsync (); + scsi_hsync (); hsync_counter++; //copper_check (2); @@ -4491,7 +4490,7 @@ static void MISC_handler(void) { int i, recheck; evt mintime; - evt ct = get_cycles(); + evt ct = get_cycles (); static int recursive; if (recursive) @@ -4506,7 +4505,7 @@ static void MISC_handler(void) if (eventtab2[i].active) { if (eventtab2[i].evtime == ct) { eventtab2[i].active = 0; - eventtab2[i].handler(eventtab2[i].data); + eventtab2[i].handler (eventtab2[i].data); if (eventtab2[i].active) recheck = 1; } else { @@ -4526,21 +4525,21 @@ static void MISC_handler(void) recursive--; } -STATIC_INLINE void event2_newevent_x(int no, evt t, uae_u32 data, evfunc2 func) +STATIC_INLINE void event2_newevent_x (int no, evt t, uae_u32 data, evfunc2 func) { - evt et = t * CYCLE_UNIT + get_cycles(); + evt et = t * CYCLE_UNIT + get_cycles (); if (no < 0) { for (no = ev2_misc; no < ev2_max; no++) { if (!eventtab2[no].active) break; if (eventtab2[no].evtime == et && eventtab2[no].handler == func) { - eventtab2[no].handler(eventtab2[no].data); + eventtab2[no].handler (eventtab2[no].data); break; } } if (no == ev2_max) { - write_log("out of event2's! PC=%x\n", M68K_GETPC); + write_log ("out of event2's! PC=%x\n", M68K_GETPC); return; } } @@ -4548,18 +4547,18 @@ STATIC_INLINE void event2_newevent_x(int no, evt t, uae_u32 data, evfunc2 func) eventtab2[no].evtime = et; eventtab2[no].handler = func; eventtab2[no].data = data; - MISC_handler(); + MISC_handler (); } -void event2_newevent(int no, evt t) +void event2_newevent (int no, evt t) { - event2_newevent_x(no, t, 0, eventtab2[no].handler); + event2_newevent_x (no, t, 0, eventtab2[no].handler); } -void event2_newevent2(evt t, uae_u32 data, evfunc2 func) +void event2_newevent2 (evt t, uae_u32 data, evfunc2 func) { - event2_newevent_x(-1, t, data, func); + event2_newevent_x (-1, t, data, func); } -void event2_remevent(int no) +void event2_remevent (int no) { eventtab2[no].active = 0; } @@ -4596,7 +4595,7 @@ void customreset (int hardreset) int i; int zero = 0; - write_log ("Reset at %08.8X\n", m68k_getpc(®s)); + write_log ("Reset at %08.8X\n", m68k_getpc (®s)); memory_map_dump(); hsync_counter = 0; @@ -4830,8 +4829,8 @@ static int allocate_sprite_tables (void) delta_color_change = 0; if (!sprite_entries[0]) { - max_sprite_entry = DEFAULT_MAX_SPRITE_ENTRY; - max_color_change = DEFAULT_MAX_COLOR_CHANGE; + max_sprite_entry = DEFAULT_MAX_SPRITE_ENTRY; + max_color_change = DEFAULT_MAX_COLOR_CHANGE; for (num = 0; num < 2; num++) { sprite_entries[num] = xmalloc (max_sprite_entry * sizeof (struct sprite_entry)); @@ -4841,7 +4840,7 @@ static int allocate_sprite_tables (void) memset (sprite_entries[num], 0, max_sprite_entry * sizeof (struct sprite_entry)); memset (color_changes[num], 0, max_color_change * sizeof (struct color_change)); } else - return 0; + return 0; } } @@ -4926,7 +4925,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput) #endif addr &= 0xfff; #ifdef CUSTOM_DEBUG - write_log ("%d:%d:wget: %04.4X=%04.4X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc()); + write_log ("%d:%d:wget: %04.4X=%04.4X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); #endif switch (addr & 0x1fe) { case 0x002: v = DMACONR (); break; @@ -5231,7 +5230,7 @@ static void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) special_mem |= S_WRITE; #endif #ifdef CUSTOM_DEBUG - write_log ("%d:%d:wput: %04.4X %04.4X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc()); + write_log ("%d:%d:wput: %04.4X %04.4X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); #endif sync_copper_with_cpu (hpos, 1); if (addr & 1) { diff --git a/custom2.c b/custom2.c index 55614bd5..d5f399ad 100755 --- a/custom2.c +++ b/custom2.c @@ -68,7 +68,7 @@ void uae_abort (const char *format,...) _vsnprintf( buffer, sizeof (buffer) -1, format, parms ); va_end (parms); if (nomore) { - write_log(buffer); + write_log (buffer); return; } gui_message (buffer); @@ -101,7 +101,7 @@ static unsigned int total_skipped = 0; STATIC_INLINE void sync_copper (int hpos); /* Events */ - + unsigned long int event_cycles, nextevent, is_lastline, currcycle; long cycles_to_next_event; long max_cycles_to_next_event; @@ -141,7 +141,7 @@ uae_u16 dmacon; uae_u16 adkcon; /* used by audio code */ static uae_u32 cop1lc,cop2lc,copcon; - + int maxhpos = MAXHPOS_PAL; int maxvpos = MAXVPOS_PAL; int minfirstline = VBLANK_ENDLINE_PAL; @@ -466,7 +466,7 @@ STATIC_INLINE void docols (struct color_entry *colentry) } } else { #endif - for (i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { int v = color_reg_get (colentry, i); if (v < 0 || v > 4095) continue; @@ -658,7 +658,7 @@ static int fm_maxplane, fm_maxplane_shift; /* The corresponding values, by fetchmode and display resolution. */ static int fetchunits[] = { 8,8,8,0, 16,8,8,0, 32,16,8,0 }; static int fetchstarts[] = { 3,2,1,0, 4,3,2,0, 5,4,3,0 }; -static int fm_maxplanes[] = { 3,2,1,0, 3,3,2,0, 3,3,3,0 }; +static int fm_maxplanes[] = { 3,2,1,0, 3,3,2,0, 3,3,3,0 }; static uae_u8 cycle_diagram_table[3][3][9][32]; static uae_u8 cycle_diagram_free_cycles[3][3][9]; @@ -675,16 +675,16 @@ static void debug_cycle_diagram(void) write_log ("FMODE %d\n=======\n", fm); for (res = 0; res <= 2; res++) { for (planes = 0; planes <= 8; planes++) { - write_log("%d: ",planes); + write_log ("%d: ",planes); for (cycle = 0; cycle < 32; cycle++) { v=cycle_diagram_table[fm][res][planes][cycle]; if (v==0) aa='-'; else if(v>0) aa='1'; else aa='X'; - write_log("%c",aa); + write_log ("%c",aa); } - write_log(" %d:%d\n", + write_log (" %d:%d\n", cycle_diagram_free_cycles[fm][res][planes], cycle_diagram_total_cycles[fm][res][planes]); } - write_log("\n"); + write_log ("\n"); } } fm=0; @@ -703,7 +703,7 @@ static void create_cycle_diagram_table(void) cycle_sequence = &cycle_sequences[(max_planes - 1) * 8]; max_planes = 1 << max_planes; for (planes = 0; planes <= 8; planes++) { - freecycles = 0; + freecycles = 0; for (cycle = 0; cycle < 32; cycle++) cycle_diagram_table[fm][res][planes][cycle] = -1; if (planes <= max_planes) { @@ -765,10 +765,10 @@ static uae_u32 fetched_aga1[MAX_PLANES]; static int toscr_res, toscr_res_first, toscr_nr_planes, fetchwidth; static int toscr_delay1x, toscr_delay2x, toscr_delay1, toscr_delay2; -/* The number of bits left from the last fetched words. +/* The number of bits left from the last fetched words. This is an optimization - conceptually, we have to make sure the result is the same as if toscr is called in each clock cycle. However, to speed this - up, we accumulate display data; this variable keeps track of how much. + up, we accumulate display data; this variable keeps track of how much. Thus, once we do call toscr_nbits (which happens at least every 16 bits), we can do more work at once. */ static int toscr_nbits; @@ -863,17 +863,17 @@ STATIC_INLINE void fetch (int nr, int fm) #endif } if (passed_plfstop == 2 && fetch_cycle >= (fetch_cycle & ~fetchunit_mask) + fetchunit - fetchstart) { - int mod; - if (fmode & 0x4000) { - if (((diwstrt >> 8) ^ vpos) & 1) - mod = bpl2mod; - else - mod = bpl1mod; - } else if (nr & 1) - mod = bpl2mod; - else - mod = bpl1mod; - bplpt[nr] += mod; + int mod; + if (fmode & 0x4000) { + if (((diwstrt >> 8) ^ vpos) & 1) + mod = bpl2mod; + else + mod = bpl1mod; + } else if (nr & 1) + mod = bpl2mod; + else + mod = bpl1mod; + bplpt[nr] += mod; } if (nr == 0) fetch_state = fetch_was_plane0; @@ -1482,8 +1482,8 @@ STATIC_INLINE void update_fetch (int until, int fm) passed_plfstop = 1; if (pos <= ddfstop_to_test && pos + count > ddf2) passed_plfstop = 2; - if (pos <= ddf2 && pos + count >= ddf2 + fm_maxplane) - add_modulos (); + if (pos <= ddf2 && pos + count >= ddf2 + fm_maxplane) + add_modulos (); pos += count; fetch_cycle += count; } @@ -1570,7 +1570,7 @@ static void maybe_start_bpl_dma (int hpos) if (hpos > plfstop) return; if (ddfstate != DIW_waiting_start) - passed_plfstop = 1; + passed_plfstop = 1; start_bpl_dma (hpos, hpos); } @@ -1590,7 +1590,7 @@ STATIC_INLINE void decide_line (int hpos) if (dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) { int ok = 0; - /* Test if we passed the start of the DDF window. */ + /* Test if we passed the start of the DDF window. */ if (last_decide_line_hpos < plfstrt && hpos >= plfstrt) { ok = 1; /* hack warning.. Writing to DDFSTRT when DMA should start must be ignored @@ -1598,7 +1598,7 @@ STATIC_INLINE void decide_line (int hpos) if (hpos - 2 == ddfstrt_old_hpos && ddfstrt_old_vpos == vpos) ok = 0; if (ok) { - start_bpl_dma (hpos, plfstrt); + start_bpl_dma (hpos, plfstrt); estimate_last_fetch_cycle (plfstrt); last_decide_line_hpos = hpos; #ifndef CUSTOM_SIMPLE @@ -1773,23 +1773,23 @@ static void do_sprite_collisions (void) if (bplcon0 & 0x400) match = 1; for (l = k; match && l < planes; l += 2) { - int t = 0; + int t = 0; if (l < thisline_decision.nr_planes) { - uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE); - uae_u32 word = ldata[offs >> 5]; - t = (word >> (31 - (offs & 31))) & 1; + uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE); + uae_u32 word = ldata[offs >> 5]; + t = (word >> (31 - (offs & 31))) & 1; #if 0 /* debug: draw collision mask */ if (1) { int m; for (m = 0; m < 5; m++) { - ldata = (uae_u32 *)(line_data[next_lineno] + 2 * m * MAX_WORDS_PER_LINE); + ldata = (uae_u32 *)(line_data[next_lineno] + 2 * m * MAX_WORDS_PER_LINE); ldata[(offs >> 5) + 1] |= 15 << (31 - (offs & 31)); } } #endif } if (clxcon_bpl_enable & (1 << l)) { - if (t != ((clxcon_bpl_match >> l) & 1)) + if (t != ((clxcon_bpl_match >> l) & 1)) match = 0; } } @@ -1939,7 +1939,7 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16 // if (ctl & 0x80) { uae_u32 state = 0x01010101 << (num & ~1); uae_u32 *stbuf = spixstate.words + (word_offs >> 2); - uae_u8 *stb1 = spixstate.bytes + word_offs; + uae_u8 *stb1 = spixstate.bytes + word_offs; for (i = 0; i < width; i += 8) { stb1[0] |= state; stb1[1] |= state; @@ -1959,7 +1959,7 @@ static void decide_sprites (int hpos) { int nrs[MAX_SPRITES], posns[MAX_SPRITES]; int count, i; - /* apparantly writes to custom registers happen in the 3/4th of cycle + /* apparantly writes to custom registers happen in the 3/4th of cycle * and sprite xpos comparator sees it immediately */ int point = hpos * 2 - 4; int width = sprite_width; @@ -2021,7 +2021,7 @@ STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_o if (dip->nr_sprites != dip_old->nr_sprites) return 1; - + if (dip->nr_sprites == 0) return 0; @@ -2044,7 +2044,7 @@ STATIC_INLINE int color_changes_differ (struct draw_info *dip, struct draw_info { if (dip->nr_color_changes != dip_old->nr_color_changes) return 1; - + if (dip->nr_color_changes == 0) return 0; if (memcmp (curr_color_changes + dip->first_color_change, @@ -2073,7 +2073,7 @@ static void finish_decisions (void) if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { if (fetch_state != fetch_not_started) { - write_log("fetch_state=%d plfleft=%d\n",fetch_state,thisline_decision.plfleft); + write_log ("fetch_state=%d plfleft=%d\n",fetch_state,thisline_decision.plfleft); uae_abort ("fetch_state != fetch_not_started"); } thisline_decision.plfright = thisline_decision.plfleft; @@ -2205,7 +2205,7 @@ void compute_vsynctime (void) } } if (!fake_vblank_hz) - fake_vblank_hz = vblank_hz; + fake_vblank_hz = vblank_hz; if (turbo_emulation) vsynctime = vsynctime_orig = 1; else @@ -2227,13 +2227,13 @@ void init_hz (void) int isntsc; if ((currprefs.chipset_refreshrate == 50 && !currprefs.ntscmode) || - (currprefs.chipset_refreshrate == 60 && currprefs.ntscmode)) { - currprefs.chipset_refreshrate = 0; - changed_prefs.chipset_refreshrate = 0; + (currprefs.chipset_refreshrate == 60 && currprefs.ntscmode)) { + currprefs.chipset_refreshrate = 0; + changed_prefs.chipset_refreshrate = 0; } if (currprefs.gfx_vsync && currprefs.gfx_afullscreen) { - currprefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate); - changed_prefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate); + currprefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate); + changed_prefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate); } beamcon0 = new_beamcon0; @@ -2427,7 +2427,7 @@ STATIC_INLINE uae_u16 VPOSR (void) static void VPOSW (uae_u16 v) { #if 0 - write_log ("vposw %x at %x\n", v, m68k_getpc()); + write_log ("vposw %x at %x\n", v, m68k_getpc ()); #endif if (lof != (v & 0x8000)) lof_changed = 1; @@ -2528,11 +2528,11 @@ static void DMACON (int hpos, uae_u16 v) if (changed & (DMA_MASTER | 0x0f)) audio_hsync (0); if (changed & (DMA_MASTER | DMA_BITPLANE)) { - ddf_change = vpos; + ddf_change = vpos; if (dmaen (DMA_BITPLANE)) maybe_start_bpl_dma (hpos); } - + events_schedule(); } @@ -2547,7 +2547,7 @@ static int intlev_2 (void) int i; if (!(imask && (intena & 0x4000))) { - unset_special (SPCFLAG_INT); + unset_special (SPCFLAG_INT); return -1; } for (i = 14; i >= 0; i--) { @@ -2633,7 +2633,7 @@ STATIC_INLINE void INTENA (uae_u16 v) setclr (&intena,v); #if 0 if (v & 0x40) - write_log("INTENA %04.4X (%04.4X) %p\n", intena, v, m68k_getpc()); + write_log ("INTENA %04.4X (%04.4X) %p\n", intena, v, m68k_getpc ()); #endif if (v & 0x8000) doint (); @@ -2652,8 +2652,8 @@ void INTREQ (uae_u16 v) rethink_cias (); #if 0 if (0 || (v & (0x8010)) == 0x8010) - write_log("%d INTREQ %04.4X (%04.4X) %x %x %x\n", - vpos, intreq, v, m68k_getpc(), cop1lc, cop2lc); + write_log ("%d INTREQ %04.4X (%04.4X) %x %x %x\n", + vpos, intreq, v, m68k_getpc (), cop1lc, cop2lc); #endif } @@ -2675,9 +2675,9 @@ static void BEAMCON0 (uae_u16 v) if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE)) v &= 0x20; if (v != new_beamcon0) { - new_beamcon0 = v; + new_beamcon0 = v; if (v & ~0x20) - write_log ("warning: %04.4X written to BEAMCON0\n", v); + write_log ("warning: %04.4X written to BEAMCON0\n", v); } } } @@ -2742,7 +2742,7 @@ static void BPLxPTH (int hpos, uae_u16 v, int num) decide_line (hpos); decide_fetch (hpos); bplpt[num] = (bplpt[num] & 0xffff) | ((uae_u32)v << 16); - //write_log("%d:%d:BPL%dPTH %08.8X\n", hpos, vpos, num, v); + //write_log ("%d:%d:BPL%dPTH %08.8X\n", hpos, vpos, num, v); } static void BPLxPTL (int hpos, uae_u16 v, int num) { @@ -2754,7 +2754,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num) if (is_bitplane_dma(hpos - 1) == num + 1) delta = 2 << fetchmode; bplpt[num] = (bplpt[num] & ~0xffff) | ((v + delta) & 0xfffe); - //write_log("%d:%d:BPL%dPTL %08.8X\n", hpos, vpos, num, v); + //write_log ("%d:%d:BPL%dPTL %08.8X\n", hpos, vpos, num, v); } static void BPLCON0 (int hpos, uae_u16 v) @@ -3062,11 +3062,11 @@ STATIC_INLINE spr_arm (int num, int state) switch (state) { case 0: - nr_armed -= spr[num].armed; + nr_armed -= spr[num].armed; spr[num].armed = 0; break; default: - nr_armed += 1 - spr[num].armed; + nr_armed += 1 - spr[num].armed; spr[num].armed = 1; break; } @@ -3075,9 +3075,9 @@ STATIC_INLINE spr_arm (int num, int state) STATIC_INLINE void sprstartstop (struct sprite *s) { if (vpos == s->vstart) - s->dmastate = 1; + s->dmastate = 1; if (vpos == s->vstop) - s->dmastate = 0; + s->dmastate = 0; } STATIC_INLINE void SPRxCTLPOS (int num) @@ -3116,7 +3116,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:SPR%dCTL %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", - vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc()); + vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc ()); } #endif @@ -3128,7 +3128,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) SPRxCTLPOS (num); #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log ("%d:%d:SPR%dPOS %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", + write_log ("%d:%d:SPR%dPOS %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc()); } #endif @@ -3144,7 +3144,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) spr_arm (num, 1); #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log ("%d:%d:SPR%dDATA %04.4X P=%06.6X D=%d A=%d PC=%x\n", + write_log ("%d:%d:SPR%dDATA %04.4X P=%06.6X D=%d A=%d PC=%x\n", vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc()); } #endif @@ -3159,7 +3159,7 @@ STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos) #endif #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log ("%d:%d:SPR%dDATB %04.4X P=%06.6X D=%d A=%d PC=%x\n", + write_log ("%d:%d:SPR%dDATB %04.4X P=%06.6X D=%d A=%d PC=%x\n", vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc()); } #endif @@ -3175,7 +3175,7 @@ static void SPRxPTH (int hpos, uae_u16 v, int num) spr[num].pt |= (uae_u32)v << 16; #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log ("%d:%d:SPR%dPTH %06.6X\n", vpos, hpos, num, spr[num].pt); + write_log ("%d:%d:SPR%dPTH %06.6X\n", vpos, hpos, num, spr[num].pt); } #endif } @@ -3196,7 +3196,7 @@ static void CLXCON (uae_u16 v) clxcon = v; clxcon_bpl_enable = (v >> 6) & 63; clxcon_bpl_match = v & 63; - //write_log("CLXCON: %04.4X PC=%x\n", v, m68k_getpc()); + //write_log ("CLXCON: %04.4X PC=%x\n", v, m68k_getpc ()); } static void CLXCON2 (uae_u16 v) @@ -3206,13 +3206,13 @@ static void CLXCON2 (uae_u16 v) clxcon2 = v; clxcon_bpl_enable |= v & (0x40|0x80); clxcon_bpl_match |= (v & (0x01|0x02)) << 6; - //write_log("CLXCON2: %04.4X\n", v); + //write_log ("CLXCON2: %04.4X\n", v); } static uae_u16 CLXDAT (void) { uae_u16 v = clxdat | 0x8000; - //write_log("%d:CLXDAT %04.4X PC=%x\n", vpos, v, m68k_getpc()); + //write_log ("%d:CLXDAT %04.4X PC=%x\n", vpos, v, m68k_getpc ()); clxdat = 0; return v; } @@ -3431,7 +3431,7 @@ static void predict_copper (void) state = COP_read1; c_hpos += 2; } - ip += 2; + ip += 2; } while (c_hpos + 1 < maxhpos) { @@ -3494,7 +3494,7 @@ static void predict_copper (void) static int test_copper_dangerous (unsigned int address) { if ((address & 0x1fe) < (copcon & 2 ? ((currprefs.chipset_mask & CSMASK_AGA) ? 0 : 0x40u) : 0x80u)) { - cop_state.state = COP_stop; + cop_state.state = COP_stop; copper_enabled_thisline = 0; unset_special (SPCFLAG_COPPER); return 1; @@ -3551,7 +3551,7 @@ static int isagnus[]= { static void dump_copper (char *error, int until_hpos) { write_log("%s: vpos=%d until_hpos=%d\n", - error, vpos, until_hpos); + error, vpos, until_hpos); write_log("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04.4X ci2=%04.4X\n", cop_state.vcmp,cop_state.hcmp,cop_state.hpos,cop_state.vpos,cop_state.saved_i1,cop_state.saved_i2); write_log("cstate=%d ip=%08.8X ev_copper=%d\n", @@ -3560,7 +3560,7 @@ static void dump_copper (char *error, int until_hpos) static void update_copper (int until_hpos) { - int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); + int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); int c_hpos = cop_state.hpos; if (eventtab[ev_copper].active) { @@ -3584,7 +3584,7 @@ static void update_copper (int until_hpos) return; uae_abort ("update_copper2"); } - + until_hpos &= ~1; if (until_hpos > (maxhpos & ~1)) @@ -3600,7 +3600,7 @@ static void update_copper (int until_hpos) /* So we know about the fetch state. */ decide_line (c_hpos); - + switch (cop_state.state) { case COP_read1_in2: cop_state.state = COP_read1; @@ -3636,7 +3636,7 @@ static void update_copper (int until_hpos) case COP_skip_in4: cop_state.state = COP_skip_in2; break; - case COP_strobe_delay: + case COP_strobe_delay: cop_state.state = COP_read1_in2; break; @@ -3646,10 +3646,10 @@ static void update_copper (int until_hpos) c_hpos += 2; #if 0 - if (copper_cant_read (old_hpos)) + if (copper_cant_read (old_hpos)) continue; #endif - if (cop_state.strobe) { + if (cop_state.strobe) { if (cop_state.strobe > 0) cop_state.ip = cop_state.strobe == 1 ? cop1lc : cop2lc; cop_state.strobe = 0; @@ -3700,7 +3700,7 @@ static void update_copper (int until_hpos) cop_state.state = COP_wait_in4; } else { unsigned int reg = cop_state.i1 & 0x1FE; - cop_state.state = isagnus[reg >> 1] ? COP_read1_wr_in2 : COP_read1_wr_in4; + cop_state.state = isagnus[reg >> 1] ? COP_read1_wr_in2 : COP_read1_wr_in4; } break; @@ -3728,7 +3728,7 @@ static void update_copper (int until_hpos) cop_state.hcmp = (cop_state.saved_i1 & cop_state.saved_i2 & 0xFE); vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); - + if (cop_state.saved_i1 == 0xFFFF && cop_state.saved_i2 == 0xFFFE) { cop_state.state = COP_stop; copper_enabled_thisline = 0; @@ -3760,7 +3760,7 @@ static void update_copper (int until_hpos) c_hpos = wait_finish; } else c_hpos = until_hpos; - } + } break; } @@ -3914,7 +3914,7 @@ STATIC_INLINE uae_u16 sprite_fetch (struct sprite *s, int dma, int hpos, int cyc { uae_u16 data = last_custom_value; if (dma) { - data = last_custom_value = chipmem_agnus_wget (s->pt); + data = last_custom_value = chipmem_agnus_wget (s->pt); #ifdef CPUEMU_6 cycle_line[hpos] |= CYCLE_SPRITE; #endif @@ -3934,33 +3934,33 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) #if SPRITE_DEBUG > 3 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log("%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); + write_log ("%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); #endif if (vpos == s->vstart) { #if SPRITE_DEBUG > 0 - if (!s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) + if (!s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) write_log ("%d:%d:SPR%d START\n", vpos, hpos, num); #endif - s->dmastate = 1; + s->dmastate = 1; } if (vpos == s->vstop || vpos == sprite_vblank_endline) { #if SPRITE_DEBUG > 0 - if (s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) + if (s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) write_log ("%d:%d:SPR%d STOP\n", vpos, hpos, num); #endif - s->dmastate = 0; + s->dmastate = 0; } if (!dmaen (DMA_SPRITE)) return; if (cycle && !s->dmacycle) - return; /* Superfrog intro flashing bee fix */ + return; /* Superfrog intro flashing bee fix */ dma = hpos < plfstrt || diwstate != DIW_waiting_stop || !dmaen (DMA_BITPLANE); if (vpos == s->vstop || vpos == sprite_vblank_endline) { s->dmastate = 0; posctl = 1; - if (dma) { + if (dma) { data = sprite_fetch (s, dma, hpos, cycle, 0); switch (sprite_width) { @@ -3972,15 +3972,15 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) break; } } else { - data = cycle == 0 ? sprpos[num] : sprctl[num]; + data = cycle == 0 ? sprpos[num] : sprctl[num]; } #if SPRITE_DEBUG > 1 - if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { + if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:dma:P=%06.6X ", vpos, hpos, s->pt); } #endif //write_log ("%d:%d: %04.4X=%04.4X\n", vpos, hpos, 0x140 + cycle * 2 + num * 8, data); - if (cycle == 0) { + if (cycle == 0) { SPRxPOS_1 (data, num, hpos); s->dmacycle = 1; } else { @@ -3990,47 +3990,47 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) } } if (s->dmastate && !posctl) { - uae_u16 data; - - data = sprite_fetch (s, dma, hpos, cycle, 1); - /* Hack for X mouse auto-calibration */ - if (num == 0 && cycle == 0) - mousehack_handle (sprctl[0], sprpos[0]); + uae_u16 data; + + data = sprite_fetch (s, dma, hpos, cycle, 1); + /* Hack for X mouse auto-calibration */ + if (num == 0 && cycle == 0) + mousehack_handle (sprctl[0], sprpos[0]); #if SPRITE_DEBUG > 1 - if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { + if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log ("%d:%d:dma:P=%06.6X ", vpos, hpos, s->pt); } #endif - if (cycle == 0) { - SPRxDATA_1 (dma ? data : sprdata[num][0], num, hpos); - s->dmacycle = 1; - } else { - SPRxDATB_1 (dma ? data : sprdatb[num][0], num, hpos); - spr_arm (num, 1); - } + if (cycle == 0) { + SPRxDATA_1 (dma ? data : sprdata[num][0], num, hpos); + s->dmacycle = 1; + } else { + SPRxDATB_1 (dma ? data : sprdatb[num][0], num, hpos); + spr_arm (num, 1); + } #ifdef AGA - switch (sprite_width) - { - case 64: - { + switch (sprite_width) + { + case 64: + { uae_u16 data32 = sprite_fetch (s, dma, hpos, cycle, 1); - uae_u16 data641 = sprite_fetch (s, dma, hpos, cycle, 1); - uae_u16 data642 = sprite_fetch (s, dma, hpos, cycle, 1); + uae_u16 data641 = sprite_fetch (s, dma, hpos, cycle, 1); + uae_u16 data642 = sprite_fetch (s, dma, hpos, cycle, 1); if (dma) { - if (cycle == 0) { + if (cycle == 0) { sprdata[num][3] = data642; sprdata[num][2] = data641; sprdata[num][1] = data32; - } else { + } else { sprdatb[num][3] = data642; sprdatb[num][2] = data641; sprdatb[num][1] = data32; } } } - break; - case 32: - { + break; + case 32: + { uae_u16 data32 = sprite_fetch (s, dma, hpos, cycle, 1); if (dma) { if (cycle == 0) @@ -4080,12 +4080,12 @@ static void do_sprites (int hpos) if (maxspr > SPR0_HPOS + MAX_SPRITES * 4) maxspr = SPR0_HPOS + MAX_SPRITES * 4; if (minspr < SPR0_HPOS) - minspr = SPR0_HPOS; + minspr = SPR0_HPOS; for (i = minspr; i < maxspr; i++) { int cycle = -1; int num = (i - SPR0_HPOS) / 4; - switch ((i - SPR0_HPOS) & 3) + switch ((i - SPR0_HPOS) & 3) { case 0: cycle = 0; @@ -4201,17 +4201,17 @@ static int rpt_vsync (void) } return v; } - + static void framewait (void) { frame_time_t curr_time; int start; for (;;) { - double v = rpt_vsync () / (syncbase / 1000.0); + double v = rpt_vsync () / (syncbase / 1000.0); if (v >= -4) break; - sleep_millis_busy (2); + sleep_millis_busy (2); } curr_time = start = read_processor_time(); if (!isvsync()) { @@ -4237,7 +4237,7 @@ void fpscounter_reset (void) static void fpscounter (void) { int now, last; - + now = read_processor_time (); last = now - lastframetime; lastframetime = now; @@ -4317,13 +4317,13 @@ static void vsync_handler (void) if (picasso_on) picasso_handle_vsync (); #endif - + vsync_handle_redraw (lof, lof_changed); if (quit_program > 0) { /* prevent possible infinite loop at wait_cycles().. */ framecnt = 0; - reset_decisions (); + reset_decisions (); return; } @@ -4440,13 +4440,13 @@ static void hsync_handler (void) ciahsync++; if (ciahsync >= (currprefs.ntscmode ? MAXVPOS_NTSC : MAXVPOS_PAL) * MAXHPOS_PAL / maxhpos) { /* not so perfect.. */ - CIA_vsync_handler (); + CIA_vsync_handler (); ciahsync = 0; } #ifdef CPUEMU_6 if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) { - decide_blitter (hpos); + decide_blitter (hpos); memset (cycle_line, 0, MAXHPOS); #if 1 { @@ -4536,7 +4536,7 @@ static void hsync_handler (void) next_lineno = lineno; reset_decisions (); } -#ifdef FILESYS +#ifdef FILESYS if (uae_int_requested) { set_uae_int_flag (); INTREQ (0x8000 | 0x0008); @@ -4637,7 +4637,7 @@ void customreset (void) int i; int zero = 0; - write_log ("reset at %x\n", m68k_getpc()); + write_log ("reset at %x\n", m68k_getpc ()); if (! savestate_state) { currprefs.chipset_mask = changed_prefs.chipset_mask; if ((currprefs.chipset_mask & CSMASK_AGA) == 0) { @@ -4647,7 +4647,7 @@ void customreset (void) } #ifdef AGA } else { - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) { current_colors.color_regs_aga[i] = 0; current_colors.acolors[i] = CONVERT_RGB (zero); } @@ -4755,7 +4755,7 @@ void customreset (void) #ifdef AGA } else { for(i = 0 ; i < 256 ; i++) { - vv = current_colors.color_regs_aga[i]; + vv = current_colors.color_regs_aga[i]; current_colors.color_regs_aga[i] = -1; record_color_change (0, i, vv); remembered_color_entry = -1; @@ -4894,7 +4894,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput) #endif addr &= 0xfff; #ifdef CUSTOM_DEBUG - write_log ("%d:%d:wget: %04.4X=%04.4X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc()); + write_log ("%d:%d:wget: %04.4X=%04.4X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); #endif switch (addr & 0x1fe) { case 0x002: v = DMACONR (); break; @@ -4930,14 +4930,14 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput) default: /* reading write-only register causes write with last value in bus */ - v = last_custom_value; + v = last_custom_value; if (!noput) { int r; int hpos = current_hpos (); - decide_line (hpos); + decide_line (hpos); decide_fetch (hpos); decide_blitter (hpos); - v = last_custom_value; + v = last_custom_value; r = custom_wput_1 (hpos, addr, v, 1); } return v; @@ -4974,14 +4974,14 @@ uae_u32 REGPARAM2 custom_wget (uaecptr addr) if (addr & 1) { /* think about move.w $dff005,d0.. (68020+ only) */ - addr &= ~1; - v = custom_wget2 (addr) << 8; + addr &= ~1; + v = custom_wget2 (addr) << 8; v |= custom_wget2 (addr + 2) >> 8; return v; } return custom_wget2 (addr); } - + uae_u32 REGPARAM2 custom_bget (uaecptr addr) { #ifdef JIT @@ -5203,7 +5203,7 @@ int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int noget) default: if (!noget) custom_wget_1 (addr, 1); - if (!(currprefs.chipset_mask & CSMASK_AGA) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) + if (!(currprefs.chipset_mask & CSMASK_AGA) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) last_custom_value = 0xffff; return 1; } @@ -5217,7 +5217,7 @@ void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) special_mem |= S_WRITE; #endif #ifdef CUSTOM_DEBUG - write_log ("%d:%d:wput: %04.4X %04.4X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc()); + write_log ("%d:%d:wput: %04.4X %04.4X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); #endif sync_copper_with_cpu (hpos, 1, addr); custom_wput_1 (hpos, addr, value, 0); @@ -5233,7 +5233,7 @@ void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value) #endif custom_wput (addr & ~1, rval); if (warned < 10) { - write_log ("Byte put to custom register %04.4X PC=%08.8X\n", addr, m68k_getpc()); + write_log ("Byte put to custom register %04.4X PC=%08.8X\n", addr, m68k_getpc ()); warned++; } } @@ -5411,7 +5411,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (8+256*2); + dstbak = dst = malloc (8+256*2); SL (currprefs.chipset_mask); SW (0); /* 000 ? */ @@ -5570,9 +5570,9 @@ uae_u8 *save_custom_agacolors (int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (256*4); + dstbak = dst = malloc (256*4); for (i = 0; i < 256; i++) -#ifdef AGA +#ifdef AGA SL (current_colors.color_regs_aga[i]); #else SL (0); @@ -5678,19 +5678,19 @@ STATIC_INLINE int dma_cycle(void) for (;;) { int bpldma; int blitpri = dmaen (DMA_BLITPRI); - do_cycles (1 * CYCLE_UNIT); + do_cycles (1 * CYCLE_UNIT); cycles += CYCLE_UNIT; - hpos = current_hpos (); + hpos = current_hpos (); sync_copper (hpos); decide_line (hpos); - decide_fetch_ce (hpos); + decide_fetch_ce (hpos); bpldma = is_bitplane_dma (hpos); if (cycle_line[hpos] == 0 && !bpldma) { if (bltstate == BLT_done || bnasty >= 3) - break; + break; decide_blitter (hpos); if (cycle_line[hpos] == 0) - break; + break; if (!blitpri || blit_singlechannel) bnasty++; } else if (bpldma && (blit_singlechannel || !blitpri)) { @@ -5740,12 +5740,12 @@ void do_cycles_ce (long cycles) { int hpos, bpldma; while (cycles > 0) { - do_cycles (1 * CYCLE_UNIT); + do_cycles (1 * CYCLE_UNIT); cycles -= CYCLE_UNIT; - hpos = current_hpos (); + hpos = current_hpos (); sync_copper (hpos); decide_line (hpos); - decide_fetch_ce (hpos); + decide_fetch_ce (hpos); bpldma = is_bitplane_dma (hpos); if (cycle_line[hpos] == 0 && !bpldma) decide_blitter (hpos); diff --git a/debug.c b/debug.c index 0467eb90..9215f530 100755 --- a/debug.c +++ b/debug.c @@ -252,15 +252,15 @@ static int next_string (char **c, char *out, int max, int forceupper) static uae_u32 lastaddr (void) { if (currprefs.z3fastmem_size) - return z3fastmem_start + currprefs.z3fastmem_size; + return z3fastmem_start + currprefs.z3fastmem_size; if (currprefs.mbresmem_high_size) return a3000hmem_start + currprefs.mbresmem_high_size; if (currprefs.mbresmem_low_size) return a3000lmem_start + currprefs.mbresmem_low_size; if (currprefs.bogomem_size) - return bogomem_start + currprefs.bogomem_size; + return bogomem_start + currprefs.bogomem_size; if (currprefs.fastmem_size) - return fastmem_start + currprefs.fastmem_size; + return fastmem_start + currprefs.fastmem_size; return currprefs.chipmem_size; } @@ -373,7 +373,7 @@ uaecptr dumpmem2 (uaecptr addr, char *out, int osize) int nonsafe = 0; if (osize <= (9 + cols * 5 + 1 + 2 * cols)) - return addr; + return addr; sprintf (out, "%08lX ", addr); for (i = 0; i < cols; i++) { uae_u8 b1, b2; @@ -390,7 +390,7 @@ uaecptr dumpmem2 (uaecptr addr, char *out, int osize) out[9 + cols * 5 + 1 + i * 2 + 0] = '*'; out[9 + cols * 5 + 1 + i * 2 + 1] = '*'; } - addr += 2; + addr += 2; } out[9 + cols * 5] = ' '; out[9 + cols * 5 + 1 + 2 * cols] = 0; @@ -406,8 +406,8 @@ static void dumpmem (uaecptr addr, uaecptr *nxmem, int lines) { char line[MAX_LINEWIDTH + 1]; for (;lines--;) { - addr = dumpmem2 (addr, line, sizeof(line)); - console_out ("%s", line); + addr = dumpmem2 (addr, line, sizeof(line)); + console_out ("%s", line); console_out ("\n"); } *nxmem = addr; @@ -504,7 +504,7 @@ static void dump_custom_regs (int aga) static void dump_vectors (uaecptr addr) { int i = 0, j = 0; - + if (addr == 0xffffffff) addr = regs.vbr; @@ -627,7 +627,7 @@ static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long ad if (find_copper_record (addr, &hpos, &vpos)) { sprintf (record, " [%03x %03x]", vpos, hpos); } - + if (get_copper_address(-1) >= addr && get_copper_address(-1) <= addr + 3) here = '*'; @@ -742,7 +742,7 @@ static int totaltrainers; static void clearcheater(void) { if (!trainerdata) - trainerdata = (struct trainerstruct*)xmalloc(MAX_CHEAT_VIEW * sizeof (struct trainerstruct)); + trainerdata = (struct trainerstruct*)xmalloc(MAX_CHEAT_VIEW * sizeof (struct trainerstruct)); memset(trainerdata, 0, sizeof (struct trainerstruct) * MAX_CHEAT_VIEW); totaltrainers = 0; } @@ -768,11 +768,11 @@ static void listcheater(int mode, int size) for(i = 0; i < totaltrainers; i++) { struct trainerstruct *ts = &trainerdata[i]; uae_u16 b; - + if (size) { - b = get_byte(ts->addr); + b = get_byte (ts->addr); } else { - b = get_word(ts->addr); + b = get_word (ts->addr); } if (mode) console_out("%08.8X=%4.4X ", ts->addr, b); @@ -795,7 +795,7 @@ static void deepcheatsearch (char **c) static int inconly, deconly, maxdiff; int addrcnt, cnt; char v; - + v = toupper(**c); if(!memtmp || v == 'S') { @@ -819,7 +819,7 @@ static void deepcheatsearch (char **c) first = 1; xfree(memtmp); memsize = 0; - addr = 0xffffffff; + addr = 0xffffffff; while ((addr = nextaddr(addr, &end)) != 0xffffffff) { memsize += end - addr; addr = end - 1; @@ -943,7 +943,7 @@ static void cheatsearch (char **c) ignore_ws (c); if (!more_params(c)) { first = 1; - console_out("search reset\n"); + console_out("search reset\n"); xfree (vlist); listsize = memsize; vlist = (uae_u8*)xcalloc (listsize >> 3, 1); @@ -980,7 +980,7 @@ static void cheatsearch (char **c) while ((addr = nextaddr(addr, &end)) != 0xffffffff) { if (addr + size < end) { for (i = 0; i < size; i++) { - if (get_byte(addr + i) != val >> ((size - i - 1) << 8)) + if (get_byte (addr + i) != val >> ((size - i - 1) << 8)) break; } if (i == size) { @@ -1056,7 +1056,7 @@ static void illg_init (void) uae_u32 e = end >> 16; memset (illghdebug + s, c, e - s); } - addr = end - 1; + addr = end - 1; } if (currprefs.gfxmem_size) memset (illghdebug + (p96ram_start >> 16), 3, currprefs.gfxmem_size >> 16); @@ -1195,7 +1195,7 @@ static void smc_detector(uaecptr addr, int rwi, int size, uae_u32 *valp) if (rwi == 2) { for (i = 0; i < size; i++) { if (smc_table[addr + i].cnt < SMC_MAXHITS) { - smc_table[addr + i].addr = m68k_getpc(®s); + smc_table[addr + i].addr = m68k_getpc (®s); } } return; @@ -1220,7 +1220,7 @@ static void smc_detector(uaecptr addr, int rwi, int size, uae_u32 *valp) return; /* BRA.B */ } if (hitcnt < 100) { - smc_table[hitaddr].cnt++; + smc_table[hitaddr].cnt++; console_out("SMC at %08.8X - %08.8X (%d) from %08.8X\n", hitaddr, hitaddr + hitcnt, hitcnt, hitpc); if (smc_table[hitaddr].cnt >= SMC_MAXHITS) @@ -1304,7 +1304,7 @@ static uae_u32 REGPARAM2 mmu_lget (uaecptr addr) int off = debug_mem_off (addr); uae_u32 v = 0; if (!mmu_hit(addr, 4, 0, &v)) - v = debug_mem_banks[off]->lget(addr); + v = debug_mem_banks[off]->lget(addr); return v; } static uae_u32 REGPARAM2 mmu_wget (uaecptr addr) @@ -1312,7 +1312,7 @@ static uae_u32 REGPARAM2 mmu_wget (uaecptr addr) int off = debug_mem_off (addr); uae_u32 v = 0; if (!mmu_hit(addr, 2, 0, &v)) - v = debug_mem_banks[off]->wget(addr); + v = debug_mem_banks[off]->wget(addr); return v; } static uae_u32 REGPARAM2 mmu_bget (uaecptr addr) @@ -1320,7 +1320,7 @@ static uae_u32 REGPARAM2 mmu_bget (uaecptr addr) int off = debug_mem_off (addr); uae_u32 v = 0; if (!mmu_hit(addr, 1, 0, &v)) - v = debug_mem_banks[off]->bget(addr); + v = debug_mem_banks[off]->bget(addr); return v; } static void REGPARAM2 mmu_lput (uaecptr addr, uae_u32 v) @@ -1355,7 +1355,7 @@ static uae_u32 REGPARAM2 mmu_lgeti (uaecptr addr) int off = debug_mem_off (addr); uae_u32 v = 0; if (!mmu_hit(addr, 4, 4, &v)) - v = debug_mem_banks[off]->lgeti(addr); + v = debug_mem_banks[off]->lgeti(addr); return v; } static uae_u32 REGPARAM2 mmu_wgeti (uaecptr addr) @@ -1363,7 +1363,7 @@ static uae_u32 REGPARAM2 mmu_wgeti (uaecptr addr) int off = debug_mem_off (addr); uae_u32 v = 0; if (!mmu_hit(addr, 2, 4, &v)) - v = debug_mem_banks[off]->wgeti(addr); + v = debug_mem_banks[off]->wgeti(addr); return v; } @@ -1527,7 +1527,7 @@ void memwatch_dump2 (char *buf, int bufsize, int num) struct memwatch_node *mwn; if (buf) - memset(buf, 0, bufsize); + memset(buf, 0, bufsize); for (i = 0; i < MEMWATCH_TOTAL; i++) { if ((num >= 0 && num == i) || (num < 0)) { mwn = &mwnodes[i]; @@ -1554,7 +1554,7 @@ static void memwatch_dump (int num) buf = (char*)malloc(50 * multiplier); if (!buf) - return; + return; memwatch_dump2 (buf, 50 * multiplier, num); f_out(stdout, "%s", buf); free(buf); @@ -1740,11 +1740,11 @@ static void memory_map_dump_2 (int log) uae_u8 *caddr; char *name; char tmp[MAX_DPATH]; - + name = a1->name; if (name == NULL) name = ""; - + k = j; caddr = dump_xlate(k << 16); mirrored = caddr ? 1 : 0; @@ -1806,27 +1806,27 @@ static char* BSTR2CSTR(uae_u8 *bstr) { char *cstr = (char*)xmalloc(bstr[0] + 1); if (cstr) { - memcpy(cstr, bstr + 1, bstr[0]); - cstr[bstr[0]] = 0; + memcpy(cstr, bstr + 1, bstr[0]); + cstr[bstr[0]] = 0; } return cstr; } static void print_task_info(uaecptr node) { - int process = get_byte(node + 8) == 13 ? 1 : 0; + int process = get_byte (node + 8) == 13 ? 1 : 0; console_out ("%08X: %08X", node, 0); console_out (process ? " PROCESS '%s'" : " TASK '%s'\n", get_real_address (get_long (node + 10))); if (process) { - uaecptr cli = BPTR2APTR(get_long(node + 172)); - int tasknum = get_long(node + 140); - if (cli && tasknum) { - uae_u8 *command_bstr = get_real_address(BPTR2APTR(get_long(cli + 16))); - char * command = BSTR2CSTR(command_bstr);; - console_out(" [%d, '%s']\n", tasknum, command); - xfree(command); + uaecptr cli = BPTR2APTR (get_long (node + 172)); + int tasknum = get_long (node + 140); + if (cli && tasknum) { + uae_u8 *command_bstr = get_real_address (BPTR2APTR (get_long (cli + 16))); + char * command = BSTR2CSTR (command_bstr); + console_out (" [%d, '%s']\n", tasknum, command); + xfree (command); } else { - console_out ("\n"); + console_out ("\n"); } } } @@ -2207,7 +2207,7 @@ static void m68k_modify (char **inptr) regs.sr = (regs.sr & ~31) | (v & 31); MakeFromSR (®s); } else if (!strcmp (parm, "PC")) { - m68k_setpc(®s, v); + m68k_setpc (®s, v); fill_prefetch_slow(®s); } else { for (i = 0; m2cregs[i].regname; i++) { @@ -2295,7 +2295,7 @@ static void debug_1 (void) inputdevice_logging = 1 | 2; if (more_params(&inptr)) inputdevice_logging = readint(&inptr); - console_out("input logging level %d\n", inputdevice_logging); + console_out("input logging level %d\n", inputdevice_logging); } else if(*inptr == 'm') { memory_map_dump_2(0); } else { @@ -2369,7 +2369,7 @@ static void debug_1 (void) case 'H': { int count, temp, badly; - uae_u32 oldpc = m68k_getpc(®s); + uae_u32 oldpc = m68k_getpc (®s); struct regstruct save_regs = regs; badly = 0; @@ -2393,7 +2393,7 @@ static void debug_1 (void) } while (temp != lasthist) { regs = history[temp]; - m68k_setpc(®s, history[temp].pc); + m68k_setpc (®s, history[temp].pc); if (badly) { m68k_dumpstate(stdout, NULL); } else { @@ -2403,7 +2403,7 @@ static void debug_1 (void) temp = 0; } regs = save_regs; - m68k_setpc(®s, oldpc); + m68k_setpc (®s, oldpc); } break; case 'm': @@ -2431,8 +2431,8 @@ static void debug_1 (void) case 'o': { if (copper_debugger(&inptr)) { - debugger_active = 0; - debugging = 0; + debugger_active = 0; + debugging = 0; return; } break; @@ -2470,11 +2470,11 @@ static void debug_1 (void) static void addhistory(void) { - uae_u32 pc = m68k_getpc(®s); + uae_u32 pc = m68k_getpc (®s); if (!notinrom()) return; history[lasthist] = regs; - history[lasthist].pc = m68k_getpc(®s); + history[lasthist].pc = m68k_getpc (®s); if (++lasthist == MAX_HIST) lasthist = 0; if (lasthist == firsthist) { @@ -2513,7 +2513,7 @@ void debug (void) if (!memwatch_triggered) { if (do_skip) { - uae_u32 pc = munge24 (m68k_getpc(®s)); + uae_u32 pc = munge24 (m68k_getpc (®s)); uae_u16 opcode = (currprefs.cpu_compatible || currprefs.cpu_cycle_exact) ? regs.ir : get_word (pc); int bp = 0; @@ -2532,30 +2532,30 @@ void debug (void) if ((processptr || processname) && notinrom()) { uaecptr execbase = get_long (4); uaecptr activetask = get_long (execbase + 276); - int process = get_byte(activetask + 8) == 13 ? 1 : 0; - char *name = (char*)get_real_address(get_long(activetask + 10)); + int process = get_byte (activetask + 8) == 13 ? 1 : 0; + char *name = (char*)get_real_address (get_long (activetask + 10)); if (process) { - uaecptr cli = BPTR2APTR(get_long(activetask + 172)); + uaecptr cli = BPTR2APTR(get_long (activetask + 172)); uaecptr seglist = 0; char *command = NULL; if (cli) { if (processname) { - uae_u8 *command_bstr = get_real_address(BPTR2APTR(get_long(cli + 16))); + uae_u8 *command_bstr = get_real_address (BPTR2APTR(get_long (cli + 16))); command = BSTR2CSTR(command_bstr); } - seglist = BPTR2APTR(get_long(cli + 60)); + seglist = BPTR2APTR(get_long (cli + 60)); } else { - seglist = BPTR2APTR(get_long(activetask + 128)); - seglist = BPTR2APTR(get_long(seglist + 12)); + seglist = BPTR2APTR(get_long (activetask + 128)); + seglist = BPTR2APTR(get_long (seglist + 12)); } if (activetask == processptr || (processname && (!stricmp(name, processname) || (command && !stricmp(command, processname))))) { while (seglist) { - uae_u32 size = get_long(seglist - 4) - 4; + uae_u32 size = get_long (seglist - 4) - 4; if (pc >= (seglist + 4) && pc < (seglist + size)) { bp = 1; break; } - seglist = BPTR2APTR(get_long(seglist)); + seglist = BPTR2APTR(get_long (seglist)); } } xfree(command); @@ -2635,7 +2635,7 @@ void debug (void) int notinrom (void) { - uaecptr pc = munge24(m68k_getpc(®s)); + uaecptr pc = munge24(m68k_getpc (®s)); if (pc < 0x00e00000 || pc > 0x00ffffff) return 1; return 0; @@ -2646,7 +2646,7 @@ const char *debuginfo (int mode) static char txt[100]; uae_u32 pc = M68K_GETPC; sprintf (txt, "PC=%08.8X INS=%04.4X %04.4X %04.4X", - pc, get_word(pc), get_word(pc+2), get_word(pc+4)); + pc, get_word (pc), get_word (pc+2), get_word (pc+4)); return txt; } @@ -2696,18 +2696,18 @@ void mmu_do_hit(void) uae_u32 pc; mmu_triggered = 0; - pc = m68k_getpc(®s); + pc = m68k_getpc (®s); p = mmu_regs + 18 * 4; put_long (p, pc); regs = mmu_backup_regs; regs.intmask = 7; regs.t0 = regs.t1 = 0; if (!regs.s) { - regs.usp = m68k_areg(®s, 7); + regs.usp = m68k_areg (®s, 7); if (currprefs.cpu_model >= 68020) - m68k_areg(®s, 7) = regs.m ? regs.msp : regs.isp; + m68k_areg (®s, 7) = regs.m ? regs.msp : regs.isp; else - m68k_areg(®s, 7) = regs.isp; + m68k_areg (®s, 7) = regs.isp; regs.s = 1; } MakeSR (®s); @@ -2716,29 +2716,29 @@ void mmu_do_hit(void) if (currprefs.cpu_model > 68000) { for (i = 0 ; i < 9; i++) { - m68k_areg(®s, 7) -= 4; - put_long (m68k_areg(®s, 7), 0); + m68k_areg (®s, 7) -= 4; + put_long (m68k_areg (®s, 7), 0); } - m68k_areg(®s, 7) -= 4; - put_long (m68k_areg(®s, 7), mmu_fault_addr); - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), 0); /* WB1S */ - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), 0); /* WB2S */ - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), 0); /* WB3S */ - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), + m68k_areg (®s, 7) -= 4; + put_long (m68k_areg (®s, 7), mmu_fault_addr); + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), 0); /* WB1S */ + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), 0); /* WB2S */ + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), 0); /* WB3S */ + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), (mmu_fault_rw ? 0 : 0x100) | (mmu_fault_size << 5)); /* SSW */ - m68k_areg(®s, 7) -= 4; - put_long (m68k_areg(®s, 7), mmu_fault_bank_addr); - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), 0x7002); + m68k_areg (®s, 7) -= 4; + put_long (m68k_areg (®s, 7), mmu_fault_bank_addr); + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), 0x7002); } - m68k_areg(®s, 7) -= 4; - put_long (m68k_areg(®s, 7), get_long (p - 4)); - m68k_areg(®s, 7) -= 2; - put_word (m68k_areg(®s, 7), mmur.sr); + m68k_areg (®s, 7) -= 4; + put_long (m68k_areg (®s, 7), get_long (p - 4)); + m68k_areg (®s, 7) -= 2; + put_word (m68k_areg (®s, 7), mmur.sr); set_special(®s, SPCFLAG_END_COMPILE); } @@ -2749,7 +2749,7 @@ static void mmu_do_hit_pre (struct mmudata *md, uaecptr addr, int size, int rwi, int i; mmur = regs; - pc = m68k_getpc(®s); + pc = m68k_getpc (®s); if (mmu_logging) console_out ("MMU: hit %08.8X SZ=%d RW=%d V=%08.8X PC=%08.8X\n", addr, size, rwi, v, pc); @@ -2789,7 +2789,7 @@ static int mmu_hit (uaecptr addr, int size, int rwi, uae_u32 *v) mn = mmunl[addr >> MMU_PAGE_SHIFT]; if (mn == NULL) return 0; - + s = regs.s; while (mn) { md = mn->mmubank; @@ -2819,26 +2819,26 @@ static int mmu_hit (uaecptr addr, int size, int rwi, uae_u32 *v) switch (size) { case 4: - put_long(maddr, *v); + put_long (maddr, *v); break; case 2: - put_word(maddr, *v); + put_word (maddr, *v); break; case 1: - put_byte(maddr, *v); + put_byte (maddr, *v); break; } } else { switch (size) { case 4: - *v = get_long(maddr); + *v = get_long (maddr); break; case 2: - *v = get_word(maddr); + *v = get_word (maddr); break; case 1: - *v = get_byte(maddr); + *v = get_byte (maddr); break; } } @@ -2897,7 +2897,7 @@ static int getmmubank(struct mmudata *snptr, uaecptr p) { snptr->flags = get_long (p); if (snptr->flags == 0xffffffff) - return 1; + return 1; snptr->addr = get_long (p + 4); snptr->len = get_long (p + 8); snptr->remap = get_long (p + 12); @@ -2988,7 +2988,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) p += 16; off = snptr->addr >> MMU_PAGE_SHIFT; if (mmunl[off] == NULL) { - mn = mmunl[off] = (struct mmunode*)xcalloc (sizeof (struct mmunode), 1); + mn = mmunl[off] = (struct mmunode*)xcalloc (sizeof (struct mmunode), 1); } else { mn = mmunl[off]; while (mn->next) diff --git a/disk.c b/disk.c index 43379654..62af5603 100755 --- a/disk.c +++ b/disk.c @@ -242,15 +242,15 @@ static void disk_date (uae_u8 *p) char tmp[10]; time (&t); today = localtime( &t ); - strftime (tmp, sizeof(tmp), "%Y", today); + strftime (tmp, sizeof (tmp), "%Y", today); year = atol (tmp); - strftime (tmp, sizeof(tmp), "%j", today); + strftime (tmp, sizeof (tmp), "%j", today); days = atol (tmp) - 1; - strftime (tmp, sizeof(tmp), "%H", today); + strftime (tmp, sizeof (tmp), "%H", today); minutes = atol (tmp) * 60; - strftime (tmp, sizeof(tmp), "%M", today); + strftime (tmp, sizeof (tmp), "%M", today); minutes += atol (tmp); - strftime (tmp, sizeof(tmp), "%S", today); + strftime (tmp, sizeof (tmp), "%S", today); ticks = atol (tmp) * 50; while (year > 1978) { if ( !(year % 100) ? !(year % 400) : !(year % 4) ) days++; @@ -267,7 +267,7 @@ static void createbootblock (uae_u8 *sector, int bootable) memset (sector, 0, FS_FLOPPY_BLOCKSIZE); memcpy (sector, "DOS", 3); if (bootable) - memcpy (sector, bootblock, sizeof(bootblock)); + memcpy (sector, bootblock, sizeof (bootblock)); } static void createrootblock (uae_u8 *sector, uae_u8 *disk_name) @@ -478,6 +478,14 @@ static int get_floppy_speed (void) return m; } +static int get_floppy_speed2 (drive *drv) +{ + int m = get_floppy_speed () * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); + if (m <= 0) + m = 1; + return m; +} + static char *drive_id_name(drive *drv) { switch(drv->drive_id) @@ -495,7 +503,7 @@ static char *drive_id_name(drive *drv) * disk or a 3.5 DD disk is inserted. Only 3.5 HD drive id is reported * when a real 3.5 HD disk is inserted. -Adil */ -static void drive_settype_id(drive *drv) +static void drive_settype_id (drive *drv) { int t = currprefs.dfxtype[drv - &floppy[0]]; @@ -524,7 +532,7 @@ static void drive_settype_id(drive *drv) break; } #ifdef DEBUG_DRIVE_ID - write_log("drive_settype_id: DF%d: set to %s\n", drv-floppy, drive_id_name(drv)); + write_log ("drive_settype_id: DF%d: set to %s\n", drv-floppy, drive_id_name(drv)); #endif } @@ -810,7 +818,7 @@ static int diskfile_iswriteprotect (const char *fname, int *needwritefile, drive *needwritefile = 1; return wrprot2; } - if (memcmp (exeheader, buffer, sizeof(exeheader)) == 0) + if (memcmp (exeheader, buffer, sizeof (exeheader)) == 0) return 0; if (wrprot1) return wrprot2; @@ -841,7 +849,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char track_reset (drv); return 0; } - + if (input_recording > 0) { inprec_rstart (INPREC_DISKINSERT); inprec_ru8 (dnum); @@ -927,8 +935,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char offs += tid->len; } - } else if (memcmp (exeheader, buffer, sizeof(exeheader)) == 0) { - + } else if (memcmp (exeheader, buffer, sizeof (exeheader)) == 0) { int i; struct zfile *z = zfile_fopen_empty ("", 512 * 1760); createimagefromexe (drv->diskfile, z); @@ -984,7 +991,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char } } openwritefile (drv, 0); - drive_settype_id(drv); /* Set DD or HD drive */ + drive_settype_id (drv); /* Set DD or HD drive */ drive_fill_bigbuf (drv, 1); drv->mfmpos = uaerand (); drv->mfmpos |= (uaerand () << 16); @@ -1031,7 +1038,7 @@ static void drive_step (drive * drv) #endif if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) { if (disk_debug_logging > 1) - write_log (" step ignored %d", (get_cycles() - drv->steplimitcycle) / CYCLE_UNIT); + write_log (" step ignored %d", (get_cycles() - drv->steplimitcycle) / CYCLE_UNIT); return; } /* A1200's floppy drive needs at least 30 raster lines between steps @@ -1050,7 +1057,7 @@ static void drive_step (drive * drv) #endif } /* else - write_log("program tried to step beyond track zero\n"); + write_log ("program tried to step beyond track zero\n"); "no-click" programs does that */ } else { @@ -1070,7 +1077,7 @@ static void drive_step (drive * drv) } rand_shifter (drv); if (disk_debug_logging > 1) - write_log (" ->step %d", drv->cyl); + write_log (" ->step %d", drv->cyl); } static int drive_track0 (drive * drv) @@ -1119,7 +1126,7 @@ static void drive_motor (drive * drv, int off) driveclick_motor (drv - floppy, 0); #endif #ifdef DEBUG_DRIVE_ID - write_log("drive_motor: Selected DF%d: reset id shift reg.\n",drv-floppy); + write_log ("drive_motor: Selected DF%d: reset id shift reg.\n",drv-floppy); #endif if (disk_debug_logging > 1) write_log (" ->motor off"); @@ -1167,9 +1174,9 @@ static uae_u8 mfmencodetable[16] = { }; -static uae_u16 dos_encode_byte(uae_u8 byte) -{ - uae_u8 b2, b1; +static uae_u16 dos_encode_byte (uae_u8 byte) +{ + uae_u8 b2, b1; uae_u16 word; b1 = byte; @@ -1179,13 +1186,13 @@ static uae_u16 dos_encode_byte(uae_u8 byte) return (word | ((word & (256 | 64)) ? 0 : 128)); } -static uae_u16 *mfmcoder(uae_u8 *src, uae_u16 *dest, int len) +static uae_u16 *mfmcoder (uae_u8 *src, uae_u16 *dest, int len) { int i; for (i = 0; i < len; i++) { - *dest = dos_encode_byte(*src++); - *dest |= ((dest[-1] & 1)||(*dest & 0x4000)) ? 0: 0x8000; + *dest = dos_encode_byte (*src++); + *dest |= ((dest[-1] & 1)||(*dest & 0x4000)) ? 0: 0x8000; dest++; } return dest; @@ -1210,12 +1217,12 @@ static void decode_pcdos (drive *drv) secbuf[54] = 0xc2; secbuf[55] = 0xfc; memset (secbuf + 56, 0x4e, 40); - dstmfmbuf = mfmcoder(secbuf, mfm2, 96); + dstmfmbuf = mfmcoder (secbuf, mfm2, 96); mfm2[52] = 0x5224; mfm2[53] = 0x5224; mfm2[54] = 0x5224; for (i = 0; i < drv->num_secs; i++) { - mfm2 = dstmfmbuf; + mfm2 = dstmfmbuf; memset (secbuf, 0x00, 12); secbuf[12] = 0xa1; secbuf[13] = 0xa1; @@ -1235,11 +1242,11 @@ static void decode_pcdos (drive *drv) secbuf[58] = 0xa1; secbuf[59] = 0xfb; read_floppy_data (drv->diskfile, ti, i * 512, &secbuf[60], 512); - crc16 = get_crc16(secbuf + 56, 3 + 1 + 512); + crc16 = get_crc16 (secbuf + 56, 3 + 1 + 512); secbuf[60 + 512] = crc16 >> 8; secbuf[61 + 512] = crc16 & 0xff; memset(secbuf + 512 + 62, 0x4e, (tracklen / 2 - 96) / drv->num_secs - 574); - dstmfmbuf = mfmcoder(secbuf, mfm2, 60 + 512 + 2 + 76 / drv->ddhd); + dstmfmbuf = mfmcoder (secbuf, mfm2, 60 + 512 + 2 + 76 / drv->ddhd); mfm2[12] = 0x4489; mfm2[13] = 0x4489; mfm2[14] = 0x4489; @@ -1248,11 +1255,11 @@ static void decode_pcdos (drive *drv) mfm2[58] = 0x4489; } while (dstmfmbuf - drv->bigmfmbuf < tracklen / 2) - *dstmfmbuf++ = 0x9254; + *dstmfmbuf++ = 0x9254; drv->skipoffset = 0; drv->tracklen = (dstmfmbuf - drv->bigmfmbuf) * 16; if (disk_debug_logging > 0) - write_log ("pcdos read track %d\n", tr); + write_log ("pcdos read track %d\n", tr); } static void decode_amigados (drive *drv) @@ -1271,39 +1278,39 @@ static void decode_amigados (drive *drv) drv->tracklen = len * 2 * 8; for (sec = 0; sec < drv->num_secs; sec++) { - uae_u8 secbuf[544]; - uae_u16 mfmbuf[544]; - int i; - uae_u32 deven, dodd; - uae_u32 hck = 0, dck = 0; - - secbuf[0] = secbuf[1] = 0x00; - secbuf[2] = secbuf[3] = 0xa1; - secbuf[4] = 0xff; - secbuf[5] = tr; - secbuf[6] = sec; - secbuf[7] = drv->num_secs - sec; - - for (i = 8; i < 24; i++) + uae_u8 secbuf[544]; + uae_u16 mfmbuf[544]; + int i; + uae_u32 deven, dodd; + uae_u32 hck = 0, dck = 0; + + secbuf[0] = secbuf[1] = 0x00; + secbuf[2] = secbuf[3] = 0xa1; + secbuf[4] = 0xff; + secbuf[5] = tr; + secbuf[6] = sec; + secbuf[7] = drv->num_secs - sec; + + for (i = 8; i < 24; i++) secbuf[i] = 0; read_floppy_data (drv->diskfile, ti, sec * 512, &secbuf[32], 512); - mfmbuf[0] = mfmbuf[1] = 0xaaaa; - mfmbuf[2] = mfmbuf[3] = 0x4489; + mfmbuf[0] = mfmbuf[1] = 0xaaaa; + mfmbuf[2] = mfmbuf[3] = 0x4489; - deven = ((secbuf[4] << 24) | (secbuf[5] << 16) + deven = ((secbuf[4] << 24) | (secbuf[5] << 16) | (secbuf[6] << 8) | (secbuf[7])); - dodd = deven >> 1; - deven &= 0x55555555; - dodd &= 0x55555555; + dodd = deven >> 1; + deven &= 0x55555555; + dodd &= 0x55555555; - mfmbuf[4] = dodd >> 16; - mfmbuf[5] = dodd; - mfmbuf[6] = deven >> 16; - mfmbuf[7] = deven; + mfmbuf[4] = dodd >> 16; + mfmbuf[5] = dodd; + mfmbuf[6] = deven >> 16; + mfmbuf[7] = deven; - for (i = 8; i < 48; i++) + for (i = 8; i < 48; i++) mfmbuf[i] = 0xaaaa; for (i = 0; i < 512; i += 4) { deven = ((secbuf[i + 32] << 24) | (secbuf[i + 33] << 16) @@ -1320,32 +1327,32 @@ static void decode_amigados (drive *drv) for (i = 4; i < 24; i += 2) hck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; - deven = dodd = hck; - dodd >>= 1; - mfmbuf[24] = dodd >> 16; - mfmbuf[25] = dodd; - mfmbuf[26] = deven >> 16; - mfmbuf[27] = deven; + deven = dodd = hck; + dodd >>= 1; + mfmbuf[24] = dodd >> 16; + mfmbuf[25] = dodd; + mfmbuf[26] = deven >> 16; + mfmbuf[27] = deven; - for (i = 32; i < 544; i += 2) + for (i = 32; i < 544; i += 2) dck ^= (mfmbuf[i] << 16) | mfmbuf[i + 1]; - deven = dodd = dck; - dodd >>= 1; - mfmbuf[28] = dodd >> 16; - mfmbuf[29] = dodd; - mfmbuf[30] = deven >> 16; - mfmbuf[31] = deven; - mfmcode (mfmbuf + 4, 544 - 4); + deven = dodd = dck; + dodd >>= 1; + mfmbuf[28] = dodd >> 16; + mfmbuf[29] = dodd; + mfmbuf[30] = deven >> 16; + mfmbuf[31] = deven; + mfmcode (mfmbuf + 4, 544 - 4); - for (i = 0; i < 544; i++) { + for (i = 0; i < 544; i++) { dstmfmbuf[dstmfmoffset % len] = mfmbuf[i]; dstmfmoffset++; } } if (disk_debug_logging > 0) - write_log ("amigados read track %d\n", tr); + write_log ("amigados read track %d\n", tr); } static void drive_fill_bigbuf (drive * drv, int force) @@ -1435,7 +1442,8 @@ static void drive_fill_bigbuf (drive * drv, int force) drv->tracklen = FLOPPY_WRITE_LEN * drv->ddhd * 2 * 8; memset (drv->bigmfmbuf, 0, FLOPPY_WRITE_LEN * 2 * drv->ddhd); } - drv->trackspeed = get_floppy_speed () * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); + + drv->trackspeed = get_floppy_speed2 (drv); updatemfmpos (drv); } @@ -1748,7 +1756,7 @@ static void drive_write_data (drive * drv) if (!longwritemode) ret = drive_write_adf_amigados (drv); if (ret) { - write_log("not an amigados track %d (error %d), writing as raw track\n", drv->cyl * 2 + side, ret); + write_log ("not an amigados track %d (error %d), writing as raw track\n", drv->cyl * 2 + side, ret); drive_write_ext2 (drv->bigmfmbuf, drv->diskfile, &drv->trackdata[drv->cyl * 2 + side], longwritemode ? dsklength2 * 8 : drv->tracklen); } @@ -1758,7 +1766,7 @@ static void drive_write_data (drive * drv) case ADF_PCDOS: ret = drive_write_pcdos (drv); if (ret) - write_log("not a PC formatted track %d (error %d)\n", drv->cyl * 2 + side, ret); + write_log ("not a PC formatted track %d (error %d)\n", drv->cyl * 2 + side, ret); break; } drv->tracktiming[0] = 0; @@ -1777,9 +1785,9 @@ static void drive_eject (drive * drv) drv->dskready_time = 0; drv->dskready_down_time = 0; drv->crc32 = 0; - drive_settype_id(drv); /* Back to 35 DD */ + drive_settype_id (drv); /* Back to 35 DD */ if (disk_debug_logging > 0) - write_log ("eject drive %d\n", drv - &floppy[0]); + write_log ("eject drive %d\n", drv - &floppy[0]); if (input_recording > 0) { inprec_rstart (INPREC_DISKREMOVE); inprec_ru8 (drv - floppy); @@ -1909,7 +1917,7 @@ static void setdskchangetime(drive *drv, int dsktime) } drv->dskchange_time = dsktime; if (disk_debug_logging > 0) - write_log("delayed insert enable %d\n", dsktime); + write_log ("delayed insert enable %d\n", dsktime); } void DISK_reinsert (int num) @@ -2171,7 +2179,7 @@ void DISK_select (uae_u8 data) if (!currprefs.cs_df0idhw && dr == 0) drv->idbit = 0; #ifdef DEBUG_DRIVE_ID - write_log("DISK_status: sel %d id %s (%08.8X) [0x%08lx, bit #%02d: %d]\n", + write_log ("DISK_status: sel %d id %s (%08.8X) [0x%08lx, bit #%02d: %d]\n", dr, drive_id_name(drv), drv->drive_id, drv->drive_id << drv->drive_id_scnt, 31 - drv->drive_id_scnt, drv->idbit); #endif } @@ -2184,7 +2192,7 @@ void DISK_select (uae_u8 data) } prevdata = data; if (disk_debug_logging > 1) - write_log ("\n"); + write_log ("\n"); } uae_u8 DISK_status (void) @@ -2287,7 +2295,7 @@ static void disk_dmafinished (void) dskdmaen = 0; if (disk_debug_logging > 0) { int dr, mfmpos = -1; - write_log("disk dma finished %08.8X MFMpos=", dskpt); + write_log ("disk dma finished %08.8X MFMpos=", dskpt); for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) write_log ("%d%s", floppy[dr].mfmpos, dr < MAX_FLOPPY_DRIVES - 1 ? "," : ""); write_log ("\n"); @@ -2296,7 +2304,7 @@ static void disk_dmafinished (void) static void fetchnextrevolution (drive *drv) { - drv->trackspeed = get_floppy_speed () * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); + drv->trackspeed = get_floppy_speed2 (drv); if (!drv->multi_revolution) return; switch (drv->filetype) @@ -2333,7 +2341,7 @@ void DISK_handler (uae_u32 data) if (flag & DISK_INDEXSYNC) cia_diskindex (); #if 0 - { + { int i; for (i = 0; i < MAX_FLOPPY_DRIVES; i++) { drive *drv = &floppy[i]; @@ -2402,14 +2410,14 @@ static void updatetrackspeed (drive *drv, int mfmpos) if (dskdmaen < 3) { uae_u16 *p = drv->tracktiming; p += mfmpos / 8; - drv->trackspeed = get_floppy_speed () * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd); + drv->trackspeed = get_floppy_speed2 (drv); drv->trackspeed = drv->trackspeed * p[0] / 1000; if (drv->trackspeed < 700 || drv->trackspeed > 3000) { static int warned; warned++; if (warned < 50) write_log ("corrupted trackspeed value %d\n", drv->trackspeed); - assert (0); + drv->trackspeed = 1000; } } } @@ -2465,7 +2473,7 @@ static void disk_doupdate_predict (drive * drv, int startcycle) updatetrackspeed (drv, drv->mfmpos); if (diskevent_flag) { disk_sync_cycle = startcycle >> 8; - event2_newevent(ev2_disk, (startcycle - firstcycle) / CYCLE_UNIT); + event2_newevent(ev2_disk, (startcycle - firstcycle) / CYCLE_UNIT); } } @@ -2524,7 +2532,7 @@ static void disk_doupdate_read (drive * drv, int floppybits) if (drv->tracktiming[0]) updatetrackspeed (drv, drv->mfmpos); word <<= 1; - if (!drive_empty (drv)) { + if (!drive_empty (drv)) { if (unformatted (drv)) word |= (uaerand() & 0x1000) ? 1 : 0; else @@ -2584,7 +2592,7 @@ static void disk_doupdate_read (drive * drv, int floppybits) #endif } -static void disk_dma_debugmsg(void) +static void disk_dma_debugmsg (void) { write_log ("LEN=%04.4X (%d) SYNC=%04.4X PT=%08.8X ADKCON=%04.4X PC=%08.8X\n", dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, M68K_GETPC); @@ -2624,7 +2632,7 @@ uae_u16 DSKBYTR (int hpos) if (dsklen & 0x4000) v |= 0x2000; if (disk_debug_logging > 1) - write_log ("DSKBYTR=%04.4X hpos=%d\n", v, hpos); + write_log ("DSKBYTR=%04.4X hpos=%d\n", v, hpos); if (disk_debug_mode & DISK_DEBUG_PIO) { int dr; for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { @@ -2633,9 +2641,9 @@ uae_u16 DSKBYTR (int hpos) continue; if (!(selected & (1 << dr))) { if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) { - disk_dma_debugmsg(); + disk_dma_debugmsg (); write_log ("DSKBYTR=%04.4X\n", v); - activate_debugger(); + activate_debugger (); break; } } @@ -2781,7 +2789,7 @@ void DSKLEN (uae_u16 v, int hpos) if (dsklength == 0) return; if (dsklength == 1) { - disk_dmafinished(); + disk_dmafinished (); return; } dskdmaen = 3; @@ -2800,8 +2808,8 @@ void DSKLEN (uae_u16 v, int hpos) continue; if (!(selected & (1 << dr))) { if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) { - disk_dma_debugmsg(); - activate_debugger(); + disk_dma_debugmsg (); + activate_debugger (); break; } } @@ -2810,23 +2818,23 @@ void DSKLEN (uae_u16 v, int hpos) motormask = 0; for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { - drive *drv = &floppy[dr]; - if (drv->motoroff) + drive *drv = &floppy[dr]; + if (drv->motoroff) continue; motormask |= 1 << dr; if ((selected & (1 << dr)) == 0) break; } if (dr == 4) { - write_log ("disk %s DMA started, drvmask=%x motormask=%x\n", - dskdmaen == 3 ? "write" : "read", selected ^ 15, motormask); + write_log ("disk %s DMA started, drvmask=%x motormask=%x\n", + dskdmaen == 3 ? "write" : "read", selected ^ 15, motormask); noselected = 1; } else { if (disk_debug_logging > 0) { write_log ("disk %s DMA started, drvmask=%x track %d mfmpos %d\n", - dskdmaen == 3 ? "write" : "read", selected ^ 15, + dskdmaen == 3 ? "write" : "read", selected ^ 15, floppy[dr].cyl * 2 + side, floppy[dr].mfmpos); - disk_dma_debugmsg(); + disk_dma_debugmsg (); } } @@ -2900,8 +2908,8 @@ void DSKLEN (uae_u16 v, int hpos) } if (!done && noselected) { while (dsklength-- > 0) { - put_word (dskpt, 0); - dskpt += 2; + put_word (dskpt, 0); + dskpt += 2; } INTREQ_f (0x8000 | 0x1000); done = 1; @@ -3143,8 +3151,8 @@ uae_u8 *restore_disk(int num,uae_u8 *src) strcpy (changed_prefs.df[num], old); drive_insert (floppy + num, &currprefs, num, changed_prefs.df[num]); if (drive_empty (floppy + num)) - drv->dskchange = 1; - } + drv->dskchange = 1; + } } } } diff --git a/drawing.c b/drawing.c index b5db5854..1aa17daa 100755 --- a/drawing.c +++ b/drawing.c @@ -52,7 +52,7 @@ int lores_factor, lores_shift; int aga_mode; /* mirror of chipset_mask & CSMASK_AGA */ -int direct_rgb; +int direct_rgb; /* The shift factor to apply when converting between Amiga coordinates and window coordinates. Zero if the resolution is the same, positive if window coordinates @@ -237,7 +237,7 @@ STATIC_INLINE void count_frame (void) if (framecnt >= currprefs.gfx_framerate) framecnt = 0; if (inhibit_frame) - framecnt = 1; + framecnt = 1; } int coord_native_to_amiga_x (int x) @@ -1141,8 +1141,8 @@ static void init_aspect_maps (void) free (amiga2aspect_line_map); /* At least for this array the +1 is necessary. */ - amiga2aspect_line_map = (int*)malloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1); - native2amiga_line_map = (int*)malloc (sizeof (int) * gfxvidinfo.height); + amiga2aspect_line_map = (int *)malloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1); + native2amiga_line_map = (int *)malloc (sizeof (int) * gfxvidinfo.height); if (currprefs.gfx_correct_aspect) native_lines_per_amiga_line = ((double)gfxvidinfo.height @@ -1256,29 +1256,6 @@ STATIC_INLINE void do_flush_screen (int start, int stop) flush_screen (0, 0); /* vsync mode */ } -static int drawing_color_matches; -static enum { color_match_acolors, color_match_full } color_match_type; - -/* Set up colors_for_drawing to the state at the beginning of the currently drawn - line. Try to avoid copying color tables around whenever possible. */ -static void adjust_drawing_colors (int ctable, int need_full) -{ - if (drawing_color_matches != ctable) { - if (need_full) { - color_reg_cpy (&colors_for_drawing, curr_color_tables + ctable); - color_match_type = color_match_full; - } else { - memcpy (colors_for_drawing.acolors, curr_color_tables[ctable].acolors, - sizeof colors_for_drawing.acolors); - color_match_type = color_match_acolors; - } - drawing_color_matches = ctable; - } else if (need_full && color_match_type != color_match_full) { - color_reg_cpy (&colors_for_drawing, &curr_color_tables[ctable]); - color_match_type = color_match_full; - } -} - /* We only save hardware registers during the hardware frame. Now, when * drawing the frame, we expand the data into a slightly more useful * form. */ @@ -1318,33 +1295,56 @@ static void pfield_expand_dp_bplcon (void) brdsprt = !brdblank && (currprefs.chipset_mask & CSMASK_AGA) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x02); #endif } -static void pfield_expand_dp_bplcon2(int regno, int v) +static void pfield_expand_dp_bplcon2 (int regno, int v) { regno -= 0x1000; switch (regno) { - case 0x100: - dp_for_drawing->bplcon0 = v; - dp_for_drawing->bplres = GET_RES(v); - dp_for_drawing->nr_planes = GET_PLANES(v); + case 0x100: + dp_for_drawing->bplcon0 = v; + dp_for_drawing->bplres = GET_RES(v); + dp_for_drawing->nr_planes = GET_PLANES(v); dp_for_drawing->ham_seen = !! (v & 0x800); - break; - case 0x104: - dp_for_drawing->bplcon2 = v; - break; + break; + case 0x104: + dp_for_drawing->bplcon2 = v; + break; #ifdef AGA case 0x106: - dp_for_drawing->bplcon3 = v; - break; - case 0x108: - dp_for_drawing->bplcon4 = v; - break; + dp_for_drawing->bplcon3 = v; + break; + case 0x108: + dp_for_drawing->bplcon4 = v; + break; #endif } - pfield_expand_dp_bplcon(); + pfield_expand_dp_bplcon (); res_shift = lores_shift - bplres; } +static int drawing_color_matches; +static enum { color_match_acolors, color_match_full } color_match_type; + +/* Set up colors_for_drawing to the state at the beginning of the currently drawn + line. Try to avoid copying color tables around whenever possible. */ +static void adjust_drawing_colors (int ctable, int need_full) +{ + if (drawing_color_matches != ctable) { + if (need_full) { + color_reg_cpy (&colors_for_drawing, curr_color_tables + ctable); + color_match_type = color_match_full; + } else { + memcpy (colors_for_drawing.acolors, curr_color_tables[ctable].acolors, + sizeof colors_for_drawing.acolors); + color_match_type = color_match_acolors; + } + drawing_color_matches = ctable; + } else if (need_full && color_match_type != color_match_full) { + color_reg_cpy (&colors_for_drawing, &curr_color_tables[ctable]); + color_match_type = color_match_full; + } +} + STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_func worker_pfield) { int i; @@ -1385,7 +1385,7 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun } if (i != dip_for_drawing->last_color_change) { if (regno >= 0x1000) { - pfield_expand_dp_bplcon2(regno, value); + pfield_expand_dp_bplcon2 (regno, value); } else { color_reg_set (&colors_for_drawing, regno, value); colors_for_drawing.acolors[regno] = getxcolor (value); @@ -1399,7 +1399,7 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun /* Move color changes in horizontal cycles 0 to HBLANK_OFFSET - 1 to previous line. * Cycles 0 to HBLANK_OFFSET are visible in right border on real Amigas. */ -static void mungedip(int lineno, int next) +static void mungedip (int lineno, int next) { int i = dip_for_drawing->last_color_change; struct draw_info *dip_for_drawing_next = curr_drawinfo + (lineno + next); @@ -1437,7 +1437,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) dp_for_drawing = line_decisions + lineno; dip_for_drawing = curr_drawinfo + lineno; - mungedip(lineno, (dp_for_drawing->bplcon0 & 4) ? 2 : 1); + mungedip (lineno, (dp_for_drawing->bplcon0 & 4) ? 2 : 1); switch (linestate[lineno]) { case LINE_REMEMBERED_AS_PREVIOUS: if (!warned) @@ -1520,21 +1520,19 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) if (plf2pri > 5 && bplplanecnt == 5 && !(currprefs.chipset_mask & CSMASK_AGA)) weird_bitplane_fix (); - { - if (dip_for_drawing->nr_sprites) { - int i; + if (dip_for_drawing->nr_sprites) { + int i; #ifdef AGA - if (brdsprt) - clear_bitplane_border_aga (); + if (brdsprt) + clear_bitplane_border_aga (); #endif - for (i = 0; i < dip_for_drawing->nr_sprites; i++) { + for (i = 0; i < dip_for_drawing->nr_sprites; i++) { #ifdef AGA - if (currprefs.chipset_mask & CSMASK_AGA) - draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i); - else + if (currprefs.chipset_mask & CSMASK_AGA) + draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i); + else #endif - draw_sprites_ecs (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i); - } + draw_sprites_ecs (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i); } } @@ -1726,7 +1724,7 @@ static void init_drawing_frame (void) changed_prefs.gfx_filter_horiz_zoom_mult = 1000 / (changed_prefs.gfx_lores + 1); changed_prefs.gfx_filter_vert_zoom_mult = (changed_prefs.gfx_linedbl + 1) * 500; } else { - *dst = *src; + *dst = *src; } break; } @@ -1830,8 +1828,7 @@ STATIC_INLINE void putpixel (int x, xcolnr c8) if (x <= 0) return; - switch(gfxvidinfo.pixbytes) - { + switch (gfxvidinfo.pixbytes) { case 1: xlinebuffer[x] = (uae_u8)c8; break; @@ -2020,7 +2017,7 @@ static void draw_lightpen_cursor (int x, int y, int line, int onscreen) xlinebuffer = gfxvidinfo.linemem; if (xlinebuffer == 0) xlinebuffer = row_map[line]; - + p = lightpen_cursor + y * LIGHTPEN_WIDTH; for (i = 0; i < LIGHTPEN_WIDTH; i++) { int xx = x + i - LIGHTPEN_WIDTH / 2; @@ -2064,8 +2061,8 @@ static void lightpen_update (void) lightpen_cy = maxvpos_max - 1; for (i = 0; i < LIGHTPEN_HEIGHT; i++) { - int line = lightpen_y + i - LIGHTPEN_HEIGHT / 2; - if (line >= 0 || line < max_ypos_thisframe) { + int line = lightpen_y + i - LIGHTPEN_HEIGHT / 2; + if (line >= 0 || line < max_ypos_thisframe) { draw_lightpen_cursor(lightpen_x, i, line, lightpen_cx > 0); flush_line (line); } @@ -2378,7 +2375,7 @@ void reset_drawing (void) void drawing_init (void) { - gen_pfield_tables(); + gen_pfield_tables (); uae_sem_init (&gui_sem, 0, 1); #ifdef PICASSO96 diff --git a/driveclick.c b/driveclick.c index 1f093d6e..84d37c78 100755 --- a/driveclick.c +++ b/driveclick.c @@ -162,7 +162,7 @@ void driveclick_init(void) break; } } else if (currprefs.dfxclick[i] == -1) { - wave_initialized = 1; + wave_initialized = 1; for (j = 0; j < CLICK_TRACKS; j++) drvs[i][DS_CLICK].lengths[j] = drvs[i][DS_CLICK].len; sprintf (tmp, "%suae_data%cdrive_click_%s", diff --git a/enforcer.c b/enforcer.c index f9290f8d..86360355 100755 --- a/enforcer.c +++ b/enforcer.c @@ -66,24 +66,28 @@ int (REGPARAM3 *saved_dummy_check) (uaecptr addr, uae_u32 size); Returns the first node entry of an exec list or 0 if empty *************************************************************/ -static uae_u32 amiga_list_first(uae_u32 list) +static uae_u32 amiga_list_first (uae_u32 list) { - uae_u32 node = get_long(list); /* lh_Head */ - if (!node) return 0; - if (!get_long(node)) return 0; /* ln_Succ */ - return node; + uae_u32 node = get_long (list); /* lh_Head */ + if (!node) + return 0; + if (!get_long (node)) + return 0; /* ln_Succ */ + return node; } /************************************************************* Returns the next node of an exec node or 0 if it was the last element *************************************************************/ -static uae_u32 amiga_node_next(uae_u32 node) +static uae_u32 amiga_node_next (uae_u32 node) { - uae_u32 next = get_long(node); /* ln_Succ */ - if (!next) return 0; - if (!get_long(next)) return 0; /* ln_Succ */ - return next; + uae_u32 next = get_long (node); /* ln_Succ */ + if (!next) + return 0; + if (!get_long (next)) + return 0; /* ln_Succ */ + return next; } /************************************************************* @@ -91,313 +95,289 @@ static uae_u32 amiga_node_next(uae_u32 node) is not possible, Size specified the number of bytes you want to access *************************************************************/ -static uae_u8 *amiga2native(uae_u32 aptr, int size) +static uae_u8 *amiga2native (uae_u32 aptr, int size) { - addrbank bank = get_mem_bank(aptr); + addrbank bank = get_mem_bank (aptr); - /* Check if the address can be translated to native */ - if (bank.check(aptr,size)) - { - return bank.xlateaddr(aptr); - } - return NULL; + /* Check if the address can be translated to native */ + if (bank.check (aptr, size)) { + return bank.xlateaddr (aptr); + } + return NULL; } /************************************************************* Writes the Hunk and Offset of the given Address into buf *************************************************************/ -static int enforcer_decode_hunk_and_offset(char *buf, uae_u32 pc) +static int enforcer_decode_hunk_and_offset (char *buf, uae_u32 pc) { - uae_u32 sysbase = get_long(4); - uae_u32 semaphore_list = sysbase + 532; - - /* First step is searching for the SegTracker semaphore */ - uae_u32 node = amiga_list_first(semaphore_list); - while (node) - { - uae_u32 string = get_long(node+10); /* ln_Name */ - uae_u8 *native_string = amiga2native(string,100); - - if (native_string) - { - if (!strcmp(native_string,"SegTracker")) - break; - } - node = amiga_node_next(node); + uae_u32 sysbase = get_long (4); + uae_u32 semaphore_list = sysbase + 532; + + /* First step is searching for the SegTracker semaphore */ + uae_u32 node = amiga_list_first (semaphore_list); + while (node) { + uae_u32 string = get_long (node + 10); /* ln_Name */ + uae_u8 *native_string = amiga2native (string, 100); + + if (native_string) { + if (!strcmp (native_string, "SegTracker")) + break; } - - if (node) - { - /* We have found the segtracker semaphore. Soon after the - * public documented semaphore structure Segtracker holds - * an own list of all segements. We will use this list to - * find out the hunk and offset (simliar to segtracker). - * - * Source of segtracker can be found at: - * http://www.sinz.org/Michael.Sinz/Enforcer/SegTracker.c.html - */ - - uae_u32 seg_list = node + 46 + 4; /* sizeof(struct SignalSemaphore) + seg find */ - - node = amiga_list_first(seg_list); - while (node) - { - uae_u32 seg_entry = node + 12; - uae_u32 address, size; - int hunk = 0; - - /* Go through all entries until an address is 0 - * or the segment has been found */ - while ((address = get_long(seg_entry))) - { - size = get_long(seg_entry+4); - - if (pc >= address && pc < address + size) - { - uae_u32 name,offset; - uae_u8 *native_name; - - offset = pc - address - 4; - name = get_long(node + 8); /* ln_Name */ - if (name) - { - native_name = amiga2native(name,100); - if (!native_name) native_name = "Unknown"; - } else native_name = "Unknown"; - - sprintf(buf,"----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n",pc,native_name,hunk,offset); - return 1; - } - - seg_entry += 8; - hunk++; - } - node = amiga_node_next(node); + node = amiga_node_next (node); + } + + if (node) { + /* We have found the segtracker semaphore. Soon after the + * public documented semaphore structure Segtracker holds + * an own list of all segements. We will use this list to + * find out the hunk and offset (simliar to segtracker). + * + * Source of segtracker can be found at: + * http://www.sinz.org/Michael.Sinz/Enforcer/SegTracker.c.html + */ + + uae_u32 seg_list = node + 46 + 4; /* sizeof(struct SignalSemaphore) + seg find */ + + node = amiga_list_first (seg_list); + while (node) { + uae_u32 seg_entry = node + 12; + uae_u32 address, size; + int hunk = 0; + + /* Go through all entries until an address is 0 + * or the segment has been found */ + while ((address = get_long (seg_entry))) { + size = get_long (seg_entry + 4); + + if (pc >= address && pc < address + size) { + uae_u32 name, offset; + uae_u8 *native_name; + + offset = pc - address - 4; + name = get_long (node + 8); /* ln_Name */ + if (name) { + native_name = amiga2native(name,100); + if (!native_name) native_name = "Unknown"; + } else native_name = "Unknown"; + + sprintf (buf, "----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n", pc, native_name, hunk, offset); + return 1; } + + seg_entry += 8; + hunk++; + } + node = amiga_node_next (node); } - return 0; + } + return 0; } /************************************************************* Display the enforcer hit *************************************************************/ -static void enforcer_display_hit(const char *addressmode, uae_u32 pc, uaecptr addr) +static void enforcer_display_hit (const char *addressmode, uae_u32 pc, uaecptr addr) { - uae_u32 a7; - uae_u32 sysbase; - uae_u32 this_task; - uae_u32 task_name; - uae_u8 *native_task_name; - int i,j; - static char buf[256],instrcode[256]; - static char lines[INSTRUCTIONLINES/2][256]; - static uaecptr bestpc_array[INSTRUCTIONLINES/2][5]; - static int bestpc_idxs[INSTRUCTIONLINES/2]; - char *enforcer_buf_ptr = enforcer_buf; - uaecptr bestpc,pospc,nextpc,temppc; - - if (enforcer_hit) - return; /* our function itself generated a hit ;), avoid endless loop */ - if (regs.vbr < 0x100 && addr >= 0x0c && addr < 0x78) - return; - - enforcer_hit = 1; - - if (!(sysbase = get_long(4))) - goto end; - if (!(this_task = get_long(sysbase + 276))) - goto end; - - task_name = get_long(this_task + 10); /* ln_Name */ - native_task_name = amiga2native(task_name,100); - /*if (strcmp(native_task_name,"c:MCP")!=0) - { - Exception (0x2d,0); - }*/ - strcpy(enforcer_buf_ptr,"Enforcer Hit! Bad program\n"); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - sprintf(buf,"Illegal %s: %08lx",addressmode, addr); - sprintf(enforcer_buf_ptr,"%-48sPC: %0lx\n",buf, pc); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - /* Data registers */ - sprintf(enforcer_buf_ptr,"Data: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - m68k_dreg (®s, 0), m68k_dreg (®s, 1), m68k_dreg (®s, 2), m68k_dreg (®s, 3), - m68k_dreg (®s, 4), m68k_dreg (®s, 5), m68k_dreg (®s, 6), m68k_dreg (®s, 7)); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - /* Address registers */ - sprintf(enforcer_buf_ptr,"Addr: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - m68k_areg (®s, 0), m68k_areg (®s, 1), m68k_areg (®s, 2), m68k_areg (®s, 3), - m68k_areg (®s, 4), m68k_areg (®s, 5), m68k_areg (®s, 6), m68k_areg (®s, 7)); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - /* Stack */ - a7 = m68k_areg(®s,7); - for (i = 0; i < 8 * STACKLINES; i++) - { - a7 -= 4; - if (!(i % 8)) - { - strcpy(enforcer_buf_ptr,"Stck:"); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - } - sprintf(enforcer_buf_ptr," %08lx",get_long(a7)); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - if (i%8 == 7) - *enforcer_buf_ptr++ = '\n'; + uae_u32 a7; + uae_u32 sysbase; + uae_u32 this_task; + uae_u32 task_name; + uae_u8 *native_task_name; + int i, j; + static char buf[256],instrcode[256]; + static char lines[INSTRUCTIONLINES/2][256]; + static uaecptr bestpc_array[INSTRUCTIONLINES/2][5]; + static int bestpc_idxs[INSTRUCTIONLINES/2]; + char *enforcer_buf_ptr = enforcer_buf; + uaecptr bestpc, pospc, nextpc, temppc; + + if (enforcer_hit) + return; /* our function itself generated a hit ;), avoid endless loop */ + if (regs.vbr < 0x100 && addr >= 0x0c && addr < 0x78) + return; + + enforcer_hit = 1; + + if (!(sysbase = get_long (4))) + goto end; + if (!(this_task = get_long (sysbase + 276))) + goto end; + + task_name = get_long (this_task + 10); /* ln_Name */ + native_task_name = amiga2native (task_name, 100); + /*if (strcmp(native_task_name,"c:MCP")!=0) + { + Exception (0x2d,0); + }*/ + strcpy (enforcer_buf_ptr, "Enforcer Hit! Bad program\n"); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + sprintf (buf, "Illegal %s: %08lx", addressmode, addr); + sprintf (enforcer_buf_ptr, "%-48sPC: %0lx\n", buf, pc); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + /* Data registers */ + sprintf (enforcer_buf_ptr, "Data: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + m68k_dreg (®s, 0), m68k_dreg (®s, 1), m68k_dreg (®s, 2), m68k_dreg (®s, 3), + m68k_dreg (®s, 4), m68k_dreg (®s, 5), m68k_dreg (®s, 6), m68k_dreg (®s, 7)); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + /* Address registers */ + sprintf(enforcer_buf_ptr, "Addr: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + m68k_areg (®s, 0), m68k_areg (®s, 1), m68k_areg (®s, 2), m68k_areg (®s, 3), + m68k_areg (®s, 4), m68k_areg (®s, 5), m68k_areg (®s, 6), m68k_areg (®s, 7)); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + /* Stack */ + a7 = m68k_areg (®s, 7); + for (i = 0; i < 8 * STACKLINES; i++) { + a7 -= 4; + if (!(i % 8)) { + strcpy (enforcer_buf_ptr, "Stck:"); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); } - - /* Segtracker output */ - a7 = m68k_areg(®s,7); - if (get_long(a7-4) != pc) - { - if (enforcer_decode_hunk_and_offset(buf,pc)) - { - strcpy(enforcer_buf_ptr, buf); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - } + sprintf (enforcer_buf_ptr, " %08lx",get_long (a7)); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + if (i%8 == 7) + *enforcer_buf_ptr++ = '\n'; + } + + /* Segtracker output */ + a7 = m68k_areg (®s, 7); + if (get_long (a7 - 4) != pc) { + if (enforcer_decode_hunk_and_offset (buf, pc)) { + strcpy (enforcer_buf_ptr, buf); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); } + } - for (i = 0; i < 8 * STACKLINES; i++) - { - a7 -= 4; - if (enforcer_decode_hunk_and_offset(buf,get_long(a7))) - { - int l= strlen(buf); - - if (ENFORCER_BUF_SIZE - (enforcer_buf_ptr - enforcer_buf) > l + 256) - { - strcpy(enforcer_buf_ptr, buf); - enforcer_buf_ptr += l; - } + for (i = 0; i < 8 * STACKLINES; i++) { + a7 -= 4; + if (enforcer_decode_hunk_and_offset (buf, get_long (a7))) { + int l = strlen (buf); + + if (ENFORCER_BUF_SIZE - (enforcer_buf_ptr - enforcer_buf) > l + 256) { + strcpy (enforcer_buf_ptr, buf); + enforcer_buf_ptr += l; + } + } + } + + /* Decode the instructions around the pc where the enforcer hit was caused. + * + * At first, the area before the pc, this not always done correctly because + * it's done backwards */ + temppc = pc; + + memset (bestpc_array, 0, sizeof (bestpc_array)); + for (i = 0; i < INSTRUCTIONLINES / 2; i++) + bestpc_idxs[i] = -1; + + for (i = 0; i < INSTRUCTIONLINES / 2; i++) { + pospc = temppc; + bestpc = 0; + + if (bestpc_idxs[i] == -1) { + for (j = 0; j < 5; j++) { + pospc -= 2; + sm68k_disasm (buf, NULL, pospc, &nextpc); + if (nextpc == temppc) { + bestpc_idxs[i] = j; + bestpc_array[i][j] = bestpc = pospc; } + } + } else { + bestpc = bestpc_array[i][bestpc_idxs[i]]; } - /* Decode the instructions around the pc where the enforcer hit was caused. - * - * At first, the area before the pc, this not always done correctly because - * it's done backwards */ - temppc = pc; + if (!bestpc) { + /* there was no best pc found, so it is high probable that + * a former used best pc was wrong. + * + * We trace back and use the former best pc instead + */ - memset(bestpc_array,0,sizeof(bestpc_array)); - for (i=0;i=0;j--) - { - if (bestpc_array[i][j]) - { - bestpc_idxs[i] = j; - break; - } - } - } while (bestpc_idxs[i] == -1); - if (leave) break; - if (i) temppc = bestpc_array[i-1][bestpc_idxs[i-1]]; - else temppc = pc; - i--; /* will be increased in after continue */ - continue; + for (j = former_idx - 1; j >= 0; j--) { + if (bestpc_array[i][j]) { + bestpc_idxs[i] = j; + break; + } } - - sm68k_disasm(buf, instrcode, bestpc, NULL); - sprintf(lines[i],"%08lx : %-20s %s\n",bestpc,instrcode,buf); - temppc = bestpc; + } while (bestpc_idxs[i] == -1); + if (leave) + break; + if (i) + temppc = bestpc_array[i-1][bestpc_idxs[i-1]]; + else + temppc = pc; + i--; /* will be increased in after continue */ + continue; } - i--; - for (;i>=0;i--) - { - strcpy(enforcer_buf_ptr,lines[i]); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - } - - /* Now the instruction after the pc including the pc */ - temppc = pc; - for (i=0;i<(INSTRUCTIONLINES+1)/2;i++) - { - sm68k_disasm(buf, instrcode, temppc, &nextpc); - sprintf(enforcer_buf_ptr,"%08lx : %s %-20s %s\n",temppc,(i==0?"*":" "),instrcode,buf); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - temppc = nextpc; - } - - if (!native_task_name) native_task_name = "Unknown"; - sprintf(enforcer_buf_ptr,"Name: \"%s\"\n\n",native_task_name); - enforcer_buf_ptr += strlen(enforcer_buf_ptr); - - console_out(enforcer_buf); - write_log(enforcer_buf); - sleep_millis (5); - flashscreen = 30; - -end: - enforcer_hit = 0; + sm68k_disasm (buf, instrcode, bestpc, NULL); + sprintf (lines[i], "%08lx : %-20s %s\n", bestpc, instrcode, buf); + temppc = bestpc; + } + + i--; + for (; i >= 0; i--) { + strcpy (enforcer_buf_ptr, lines[i]); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + } + + /* Now the instruction after the pc including the pc */ + temppc = pc; + for (i = 0; i < (INSTRUCTIONLINES + 1) / 2; i++) { + sm68k_disasm (buf, instrcode, temppc, &nextpc); + sprintf (enforcer_buf_ptr, "%08lx : %s %-20s %s\n", temppc, + (i == 0 ? "*" : " "), instrcode, buf); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + temppc = nextpc; + } + + if (!native_task_name) + native_task_name = "Unknown"; + sprintf (enforcer_buf_ptr, "Name: \"%s\"\n\n", native_task_name); + enforcer_buf_ptr += strlen (enforcer_buf_ptr); + + console_out (enforcer_buf); + write_log (enforcer_buf); + sleep_millis (5); + flashscreen = 30; + + end: + enforcer_hit = 0; } uae_u32 REGPARAM2 chipmem_lget2 (uaecptr addr) { - uae_u32 *m; + uae_u32 *m; addr -= chipmem_start & chipmem_mask; addr &= chipmem_mask; m = (uae_u32 *)(chipmemory + addr); - if (ISILLEGAL(addr)) - { - enforcer_display_hit("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - } - } + set_special (®s, SPCFLAG_TRAP); + } return do_get_mem_long (m); } @@ -409,14 +389,12 @@ uae_u32 REGPARAM2 chipmem_wget2(uaecptr addr) addr &= chipmem_mask; m = (uae_u16 *)(chipmemory + addr); - if (ISILLEGAL(addr)) - { - enforcer_display_hit("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - } - } + set_special (®s, SPCFLAG_TRAP); + } return do_get_mem_word (m); } @@ -425,14 +403,12 @@ uae_u32 REGPARAM2 chipmem_bget2 (uaecptr addr) addr -= chipmem_start & chipmem_mask; addr &= chipmem_mask; - if (ISILLEGAL(addr)) - { - enforcer_display_hit("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - } - } + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) + set_special (®s, SPCFLAG_TRAP); + } return chipmemory[addr]; } @@ -445,14 +421,13 @@ void REGPARAM2 chipmem_lput2 (uaecptr addr, uae_u32 l) addr &= chipmem_mask; m = (uae_u32 *)(chipmemory + addr); - if (ISILLEGAL(addr)) - { - enforcer_display_hit("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - if ( addr!=0x100 ) set_special (®s, SPCFLAG_TRAP); - } - } + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) + if (addr != 0x100) + set_special (®s, SPCFLAG_TRAP); + } do_put_mem_long (m, l); } @@ -464,14 +439,12 @@ void REGPARAM2 chipmem_wput2 (uaecptr addr, uae_u32 w) addr &= chipmem_mask; m = (uae_u16 *)(chipmemory + addr); - if (ISILLEGAL(addr)) - { - enforcer_display_hit("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - } - } + set_special (®s, SPCFLAG_TRAP); + } do_put_mem_word (m, w); } @@ -480,14 +453,12 @@ void REGPARAM2 chipmem_bput2 (uaecptr addr, uae_u32 b) addr -= chipmem_start & chipmem_mask; addr &= chipmem_mask; - if (ISILLEGAL(addr)) - { - enforcer_display_hit("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - } - } + if (ISILLEGAL (addr)) + { + enforcer_display_hit ("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) + set_special (®s, SPCFLAG_TRAP); + } chipmemory[addr] = b; } @@ -508,13 +479,12 @@ uae_u8 * REGPARAM2 chipmem_xlate2 (uaecptr addr) uae_u32 REGPARAM2 dummy_lget2 (uaecptr addr) { special_mem_r; - enforcer_display_hit("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET), addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return 0; - } - return 0xbadedeef; + enforcer_display_hit ("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET), addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return 0; + } + return 0xbadedeef; } #ifdef JIT @@ -523,78 +493,70 @@ static int warned_JIT_0xF10000 = 0; uae_u32 REGPARAM2 dummy_wget2 (uaecptr addr) { - special_mem_r; #ifdef JIT - if( addr >= 0x00F10000 && addr <= 0x00F7FFFF ) - { - if( !warned_JIT_0xF10000 ) - { - warned_JIT_0xF10000 = 1; - enforcer_display_hit("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - } - return 0; + if (addr >= 0x00F10000 && addr <= 0x00F7FFFF) { + if (!warned_JIT_0xF10000) { + warned_JIT_0xF10000 = 1; + enforcer_display_hit ("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); } + return 0; + } #endif - enforcer_display_hit("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return 0; - } - return 0xbadf; + enforcer_display_hit ("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return 0; + } + return 0xbadf; } uae_u32 REGPARAM2 dummy_bget2 (uaecptr addr) { special_mem_r; - enforcer_display_hit("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return 0; - } - return 0xbadedeef; + enforcer_display_hit ("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return 0; + } + return 0xbadedeef; } void REGPARAM2 dummy_lput2 (uaecptr addr, uae_u32 l) { special_mem_w; - enforcer_display_hit("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return; - } + enforcer_display_hit ("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return; + } } void REGPARAM2 dummy_wput2 (uaecptr addr, uae_u32 w) { special_mem_w; - enforcer_display_hit("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return; - } + enforcer_display_hit ("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return; + } } void REGPARAM2 dummy_bput2 (uaecptr addr, uae_u32 b) { special_mem_w; - enforcer_display_hit("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode & 1) - { - set_special (®s, SPCFLAG_TRAP); - return; - } + enforcer_display_hit ("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + if (enforcermode & 1) { + set_special (®s, SPCFLAG_TRAP); + return; + } } int REGPARAM2 dummy_check2 (uaecptr addr, uae_u32 size) { special_mem_r; - enforcer_display_hit("CHECK from ",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit ("CHECK from ",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); return 0; } @@ -604,72 +566,70 @@ int REGPARAM2 dummy_check2 (uaecptr addr, uae_u32 size) exceptions so enforcer can use it. Returns 1 if enforcer is enabled *************************************************************/ -int enforcer_enable(int enfmode) +int enforcer_enable (int enfmode) { - extern addrbank chipmem_bank,dummy_bank; - enforcermode=enfmode; - if (!enforcer_installed) - { - saved_dummy_lget = dummy_bank.lget; - saved_dummy_wget = dummy_bank.wget; - saved_dummy_bget = dummy_bank.bget; - saved_dummy_lput = dummy_bank.lput; - saved_dummy_wput = dummy_bank.wput; - saved_dummy_bput = dummy_bank.bput; - saved_chipmem_lget = chipmem_bank.lget; - saved_chipmem_wget = chipmem_bank.wget; - saved_chipmem_bget = chipmem_bank.bget; - saved_chipmem_lput = chipmem_bank.lput; - saved_chipmem_wput = chipmem_bank.wput; - saved_chipmem_bput = chipmem_bank.bput; - saved_chipmem_xlate = chipmem_bank.xlateaddr; - saved_chipmem_check = chipmem_bank.check; - - dummy_bank.lget = dummy_lget2; - dummy_bank.wget = dummy_wget2; - dummy_bank.bget = dummy_bget2; - dummy_bank.lput = dummy_lput2; - dummy_bank.wput = dummy_wput2; - dummy_bank.bput = dummy_bput2; - chipmem_bank.lget = chipmem_lget2; - chipmem_bank.wget = chipmem_wget2; - chipmem_bank.bget = chipmem_bget2; - chipmem_bank.lput = chipmem_lput2; - chipmem_bank.wput = chipmem_wput2; - chipmem_bank.bput = chipmem_bput2; - chipmem_bank.xlateaddr = chipmem_xlate2; - chipmem_bank.check = chipmem_check2; - - enforcer_installed = 1; - } - return 1; + extern addrbank chipmem_bank, dummy_bank; + enforcermode = enfmode; + if (!enforcer_installed) { + saved_dummy_lget = dummy_bank.lget; + saved_dummy_wget = dummy_bank.wget; + saved_dummy_bget = dummy_bank.bget; + saved_dummy_lput = dummy_bank.lput; + saved_dummy_wput = dummy_bank.wput; + saved_dummy_bput = dummy_bank.bput; + saved_chipmem_lget = chipmem_bank.lget; + saved_chipmem_wget = chipmem_bank.wget; + saved_chipmem_bget = chipmem_bank.bget; + saved_chipmem_lput = chipmem_bank.lput; + saved_chipmem_wput = chipmem_bank.wput; + saved_chipmem_bput = chipmem_bank.bput; + saved_chipmem_xlate = chipmem_bank.xlateaddr; + saved_chipmem_check = chipmem_bank.check; + + dummy_bank.lget = dummy_lget2; + dummy_bank.wget = dummy_wget2; + dummy_bank.bget = dummy_bget2; + dummy_bank.lput = dummy_lput2; + dummy_bank.wput = dummy_wput2; + dummy_bank.bput = dummy_bput2; + chipmem_bank.lget = chipmem_lget2; + chipmem_bank.wget = chipmem_wget2; + chipmem_bank.bget = chipmem_bget2; + chipmem_bank.lput = chipmem_lput2; + chipmem_bank.wput = chipmem_wput2; + chipmem_bank.bput = chipmem_bput2; + chipmem_bank.xlateaddr = chipmem_xlate2; + chipmem_bank.check = chipmem_check2; + + enforcer_installed = 1; + } + return 1; } /************************************************************* Disable Enforcer like support *************************************************************/ -int enforcer_disable(void) +int enforcer_disable (void) { - if (enforcer_installed) - { - dummy_bank.lget = saved_dummy_lget; - dummy_bank.wget = saved_dummy_wget; - dummy_bank.bget = saved_dummy_bget; - dummy_bank.lput = saved_dummy_lput; - dummy_bank.wput = saved_dummy_wput; - dummy_bank.bput = saved_dummy_bput; - chipmem_bank.lget = saved_chipmem_lget; - chipmem_bank.wget = saved_chipmem_wget; - chipmem_bank.bget = saved_chipmem_bget; - chipmem_bank.lput = saved_chipmem_lput; - chipmem_bank.wput = saved_chipmem_wput; - chipmem_bank.bput = saved_chipmem_bput; - chipmem_bank.xlateaddr = saved_chipmem_xlate; - chipmem_bank.check = saved_chipmem_check; - - enforcer_installed = 0; - } - return 1; + if (enforcer_installed) { + dummy_bank.lget = saved_dummy_lget; + dummy_bank.wget = saved_dummy_wget; + dummy_bank.bget = saved_dummy_bget; + dummy_bank.lput = saved_dummy_lput; + dummy_bank.wput = saved_dummy_wput; + dummy_bank.bput = saved_dummy_bput; + chipmem_bank.lget = saved_chipmem_lget; + chipmem_bank.wget = saved_chipmem_wget; + chipmem_bank.bget = saved_chipmem_bget; + chipmem_bank.lput = saved_chipmem_lput; + chipmem_bank.wput = saved_chipmem_wput; + chipmem_bank.bput = saved_chipmem_bput; + chipmem_bank.xlateaddr = saved_chipmem_xlate; + chipmem_bank.check = saved_chipmem_check; + + enforcer_installed = 0; + } + return 1; } #endif diff --git a/ersatz.c b/ersatz.c index 180465ca..5f2d1dae 100755 --- a/ersatz.c +++ b/ersatz.c @@ -79,9 +79,10 @@ static void ersatz_failed (void) static void ersatz_doio (void) { - uaecptr request = m68k_areg(®s, 1); + uaecptr request = m68k_areg (®s, 1); switch (get_word (request + 0x1C)) { case 9: /* TD_MOTOR is harmless */ + return; case 2: case 0x8002: /* READ commands */ break; @@ -125,11 +126,11 @@ static void ersatz_init (void) put_long (a, 0xF8001A); } regs.isp = regs.msp = regs.usp = 0x800; - m68k_areg(®s, 7) = 0x80000; + m68k_areg (®s, 7) = 0x80000; regs.intmask = 0; /* Build a dummy execbase */ - put_long (4, m68k_areg(®s, 6) = 0x676); + put_long (4, m68k_areg (®s, 6) = 0x676); put_byte (0x676 + 0x129, 0); for (f = 1; f < 105; f++) { put_word (0x676 - 6*f, 0x4EF9); @@ -148,10 +149,10 @@ static void ersatz_init (void) put_long (request + 0x28, 0x4000); put_long (request + 0x2C, 0); put_long (request + 0x24, 0x200 * 4); - m68k_areg(®s, 1) = request; + m68k_areg (®s, 1) = request; ersatz_doio (); /* kickstart disk loader */ - if (get_long(0x4000) == 0x4b49434b) { + if (get_long (0x4000) == 0x4b49434b) { /* a kickstart disk was found in drive 0! */ write_log ("Loading Kickstart rom image from Kickstart disk\n"); /* print some notes... */ @@ -162,7 +163,7 @@ static void ersatz_init (void) put_long (request + 0x28, 0xF80000); put_long (request + 0x2C, 0x200); put_long (request + 0x24, 0x200 * 512); - m68k_areg(®s, 1) = request; + m68k_areg (®s, 1) = request; ersatz_doio (); /* read rom image once again to mirror address space. @@ -171,7 +172,7 @@ static void ersatz_init (void) put_long (request + 0x28, 0xFC0000); put_long (request + 0x2C, 0x200); put_long (request + 0x24, 0x200 * 512); - m68k_areg(®s, 1) = request; + m68k_areg (®s, 1) = request; ersatz_doio (); disk_eject (0); @@ -225,21 +226,21 @@ void ersatz_perform (uae_u16 what) break; case EOP_AVAILMEM: - m68k_dreg(®s, 0) = m68k_dreg(®s, 1) & 4 ? 0 : 0x70000; + m68k_dreg (®s, 0) = m68k_dreg (®s, 1) & 4 ? 0 : 0x70000; break; case EOP_ALLOCMEM: - m68k_dreg(®s, 0) = m68k_dreg(®s, 1) & 4 ? 0 : 0x0F000; + m68k_dreg (®s, 0) = m68k_dreg (®s, 1) & 4 ? 0 : 0x0F000; break; case EOP_ALLOCABS: - m68k_dreg(®s, 0) = m68k_areg(®s, 1); + m68k_dreg (®s, 0) = m68k_areg (®s, 1); break; case EOP_NIMP: write_log ("Unimplemented Kickstart function called\n"); ersatz_failed (); - + /* fall through */ case EOP_LOOP: m68k_setpc (®s, 0xF80010); diff --git a/expansion.c b/expansion.c index aabddbd8..02ce1e1e 100755 --- a/expansion.c +++ b/expansion.c @@ -173,21 +173,23 @@ static void expamem_map_clear (void) { write_log ("expamem_map_clear() got called. Shouldn't happen.\n"); } + static void expamem_init_clear (void) { memset (expamem, 0xff, sizeof expamem); } + static void expamem_init_clear2 (void) { - expamem_init_clear(); + expamem_init_clear (); ecard = MAX_EXPANSION_BOARDS - 1; } static void expamem_init_last (void) { - write_log("Memory map after autoconfig:\n"); + write_log ("Memory map after autoconfig:\n"); memory_map_dump(); - expamem_init_clear(); + expamem_init_clear (); } static uae_u32 REGPARAM3 expamem_lget (uaecptr) REGPARAM; @@ -224,7 +226,7 @@ static uae_u32 REGPARAM2 expamem_bget (uaecptr addr) #endif addr &= 0xFFFF; b = expamem[addr]; - //write_log("%08x=%02.2X\n", addr, b); + //write_log ("%08x=%02.2X\n", addr, b); return b; } @@ -452,7 +454,7 @@ static uae_u32 REGPARAM2 catweasel_lget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - write_log("catweasel_lget @%08.8X!\n",addr); + write_log ("catweasel_lget @%08.8X!\n",addr); return 0; } @@ -461,7 +463,7 @@ static uae_u32 REGPARAM2 catweasel_wget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - write_log("catweasel_wget @%08.8X!\n",addr); + write_log ("catweasel_wget @%08.8X!\n",addr); return 0; } @@ -480,7 +482,7 @@ static void REGPARAM2 catweasel_lput (uaecptr addr, uae_u32 l) #ifdef JIT special_mem |= S_WRITE; #endif - write_log("catweasel_lput @%08.8X=%08.8X!\n",addr,l); + write_log ("catweasel_lput @%08.8X=%08.8X!\n",addr,l); } static void REGPARAM2 catweasel_wput (uaecptr addr, uae_u32 w) @@ -488,7 +490,7 @@ static void REGPARAM2 catweasel_wput (uaecptr addr, uae_u32 w) #ifdef JIT special_mem |= S_WRITE; #endif - write_log("catweasel_wput @%08.8X=%04.4X!\n",addr,w); + write_log ("catweasel_wput @%08.8X=%04.4X!\n",addr,w); } static void REGPARAM2 catweasel_bput (uaecptr addr, uae_u32 b) @@ -533,7 +535,7 @@ static void expamem_init_catweasel (void) catweasel_mask = (cwc.type >= CATWEASEL_TYPE_MK3) ? 0xffff : 0x1ffff; - expamem_init_clear(); + expamem_init_clear (); expamem_write (0x00, (cwc.type >= CATWEASEL_TYPE_MK3 ? Z2_MEM_64KB : Z2_MEM_128KB) | zorroII); @@ -752,7 +754,7 @@ static void expamem_init_fastcard (void) uae_u16 mid = currprefs.cs_a2091 ? commodore : uae_id; uae_u8 pid = currprefs.cs_a2091 ? commodore_a2091_ram : 1; - expamem_init_clear(); + expamem_init_clear (); if (allocated_fastmem == 0x100000) expamem_write (0x00, Z2_MEM_1MB + add_memory + zorroII); else if (allocated_fastmem == 0x200000) @@ -811,7 +813,7 @@ static void expamem_init_filesys (void) 0x01, 0x06 /* da_BootPoint */ }; - expamem_init_clear(); + expamem_init_clear (); expamem_write (0x00, Z2_MEM_64KB | rom_card | zorroII); expamem_write (0x08, no_shutup); @@ -856,15 +858,15 @@ static void expamem_map_z3fastmem (void) int z3fs = ((expamem_hi | (expamem_lo >> 4)) << 16); if (z3fastmem_start != z3fs) { - write_log("WARNING: Z3FAST mapping changed from $%lx to $%lx\n", z3fastmem_start, z3fs); - map_banks(&dummy_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, - allocated_z3fastmem); + write_log ("WARNING: Z3FAST mapping changed from $%lx to $%lx\n", z3fastmem_start, z3fs); + map_banks (&dummy_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, + allocated_z3fastmem); z3fastmem_start = z3fs; map_banks (&z3fastmem_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, - allocated_z3fastmem); + allocated_z3fastmem); } write_log ("Fastmem (32bit): mapped @$%lx: %d MB Zorro III fast memory \n", - z3fastmem_start, allocated_z3fastmem / 0x100000); + z3fastmem_start, allocated_z3fastmem / 0x100000); } static void expamem_init_z3fastmem (void) @@ -881,7 +883,7 @@ static void expamem_init_z3fastmem (void) : allocated_z3fastmem == 0x20000000 ? Z2_MEM_512MB : Z2_MEM_1GB); - expamem_init_clear(); + expamem_init_clear (); expamem_write (0x00, add_memory | zorroIII | code); expamem_write (0x08, care_addr | no_shutup | force_z3 | (allocated_z3fastmem > 0x800000 ? ext_size : Z3_MEM_AUTO)); @@ -943,7 +945,7 @@ static void expamem_init_gfxcard (void) : allocated_gfxmem == 0x800000 ? Z3_MEM_8MB : 0); - expamem_init_clear(); + expamem_init_clear (); expamem_write (0x00, zorroIII | code); expamem_write (0x08, care_addr | no_shutup | force_z3 | ext_size | subsize); @@ -1078,13 +1080,13 @@ int need_uae_boot_rom(void) void expamem_next(void) { - expamem_init_clear(); + expamem_init_clear (); map_banks (&expamem_bank, 0xE8, 1, 0); ++ecard; if (ecard < MAX_EXPANSION_BOARDS) - (*card_init[ecard]) (); + (*card_init[ecard]) (); else - expamem_init_clear2 (); + expamem_init_clear2 (); } static void expamem_init_cdtv (void) diff --git a/fdi2raw.c b/fdi2raw.c index cb31fa90..69014b59 100755 --- a/fdi2raw.c +++ b/fdi2raw.c @@ -50,7 +50,7 @@ #include #ifdef DEBUG -static char *datalog(uae_u8 *src, int len) +static char *datalog (uae_u8 *src, int len) { static char buf[1000]; static int offset; @@ -58,7 +58,7 @@ static char *datalog(uae_u8 *src, int len) offset2 = offset; buf[offset++]='\''; - while(len--) { + while (len--) { sprintf (buf + offset, "%02.2X", src[i]); offset += 2; i++; @@ -70,7 +70,7 @@ static char *datalog(uae_u8 *src, int len) return buf + offset2; } #else -static char *datalog(uae_u8 *src, int len) { return ""; } +static char *datalog (uae_u8 *src, int len) { return ""; } #endif #ifdef DEBUG @@ -269,7 +269,7 @@ static void fdi_decode (uae_u8 *stream, int size, uae_u8 *out) //huffman tree architecture decode temp = *stream++; - temp2 = 0x80; + temp2 = 0x80; stream = expand_tree (stream, &root); if (temp2 == 0x80) stream--; @@ -281,7 +281,7 @@ static void fdi_decode (uae_u8 *stream, int size, uae_u8 *out) stream = values_tree8 (stream, &root); //sub-stream data decode - temp2 = 0; + temp2 = 0; for (i = 0; i < size; i++) { uae_u32 v; uae_u8 decode = 1; @@ -406,13 +406,13 @@ static void bit_mfm_add (FDI *fdi, int bit) static void bit_drop_next (FDI *fdi) { if (fdi->nextdrop > 0) { - outlog("multiple bit_drop_next() called"); + outlog ("multiple bit_drop_next() called"); } else if (fdi->nextdrop < 0) { fdi->nextdrop = 0; - debuglog(":DNN:"); + debuglog (":DNN:"); return; } - debuglog(":DN:"); + debuglog (":DN:"); fdi->nextdrop = 1; } @@ -420,10 +420,10 @@ static void bit_drop_next (FDI *fdi) static void bit_dedrop (FDI *fdi) { if (fdi->nextdrop) { - outlog("bit_drop_next called before bit_dedrop"); + outlog ("bit_drop_next called before bit_dedrop"); } fdi->nextdrop = -1; - debuglog(":BDD:"); + debuglog (":BDD:"); } /* add one byte */ @@ -495,7 +495,7 @@ static void s0a(FDI *fdi) int i, bits = (fdi->track_src[0] << 8) | fdi->track_src[1]; uae_u8 b; fdi->track_src += 2; - debuglog ("s0a:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + debuglog ("s0a:bits=%d,data=%s", bits, datalog (fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { byte_add (fdi, *fdi->track_src++); bits -= 8; @@ -515,7 +515,7 @@ static void s0b(FDI *fdi) int i, bits = ((fdi->track_src[0] << 8) | fdi->track_src[1]) + 65536; uae_u8 b; fdi->track_src += 2; - debuglog ("s0b:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + debuglog ("s0b:bits=%d,data=%s", bits, datalog (fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { byte_add (fdi, *fdi->track_src++); bits -= 8; @@ -536,7 +536,7 @@ static void s0c(FDI *fdi) uae_u8 b; fdi->track_src += 2; bit_drop_next (fdi); - debuglog ("s0c:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + debuglog ("s0c:bits=%d,data=%s", bits, datalog (fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { byte_mfm_add (fdi, *fdi->track_src++); bits -= 8; @@ -557,7 +557,7 @@ static void s0d(FDI *fdi) uae_u8 b; fdi->track_src += 2; bit_drop_next (fdi); - debuglog ("s0d:bits=%d,data=%s", bits, datalog(fdi->track_src, (bits + 7) / 8)); + debuglog ("s0d:bits=%d,data=%s", bits, datalog (fdi->track_src, (bits + 7) / 8)); while (bits >= 8) { byte_mfm_add (fdi, *fdi->track_src++); bits -= 8; @@ -679,16 +679,16 @@ static int amiga_check_track (FDI *fdi) while (getmfmword (mbuf) == 0x4489) mbuf+= 1 * 2; - mbuf2 = mbuf + 8; + mbuf2 = mbuf + 8; odd = getmfmlong (mbuf); even = getmfmlong (mbuf + 2 * 2); - mbuf += 4 * 2; + mbuf += 4 * 2; id = (odd << 1) | even; trackoffs = (id & 0xff00) >> 8; if (trackoffs + 1 > drvsec) { - outlog("illegal sector offset %d\n",trackoffs); + outlog ("illegal sector offset %d\n",trackoffs); ok = 0; mbuf = mbuf2; continue; @@ -713,14 +713,14 @@ static int amiga_check_track (FDI *fdi) even = getmfmlong (mbuf + 2 * 2); mbuf += 4 * 2; if (((odd << 1) | even) != chksum) { - outlog("sector %d header crc error\n", trackoffs); + outlog ("sector %d header crc error\n", trackoffs); ok = 0; mbuf = mbuf2; continue; } - outlog("sector %d header crc ok\n", trackoffs); + outlog ("sector %d header crc ok\n", trackoffs); if (((id & 0x00ff0000) >> 16) != (uae_u32)fdi->current_track) { - outlog("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); + outlog ("illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); ok++; mbuf = mbuf2; continue; @@ -743,14 +743,14 @@ static int amiga_check_track (FDI *fdi) } mbuf += 256 * 2; if (chksum) { - outlog("sector %d data checksum error\n",trackoffs); + outlog ("sector %d data checksum error\n",trackoffs); ok = 0; } else if (sectable[trackoffs]) { - outlog("sector %d already found?\n", trackoffs); + outlog ("sector %d already found?\n", trackoffs); mbuf = mbuf2; } else { - outlog("sector %d ok\n",trackoffs); - if (slabel) outlog("(non-empty sector header)\n"); + outlog ("sector %d ok\n",trackoffs); + if (slabel) outlog ("(non-empty sector header)\n"); sectable[trackoffs] = 1; secwritten++; if (trackoffs == 9) @@ -815,7 +815,7 @@ static void amiga_data (FDI *fdi, uae_u8 *secbuf) word_post_mfm_add (fdi, mfmbuf[i]); } -static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int untilgap) +static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sector, int untilgap) { uae_u8 headerbuf[4], databuf[16]; uae_u32 deven, dodd, hck; @@ -839,7 +839,7 @@ static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sec else memset (databuf, 0, 16); - deven = ((headerbuf[0] << 24) | (headerbuf[1] << 16) + deven = ((headerbuf[0] << 24) | (headerbuf[1] << 16) | (headerbuf[2] << 8) | (headerbuf[3])); dodd = deven >> 1; deven &= 0x55555555; @@ -876,65 +876,65 @@ static void amiga_sector_header (FDI *fdi, uae_u8 *header, uae_u8 *data, int sec } /* standard super-extended Amiga sector header */ -static void s20(FDI *fdi) +static void s20 (FDI *fdi) { bit_drop_next (fdi); - debuglog ("s20:header=%s,data=%s", datalog(fdi->track_src, 4), datalog(fdi->track_src + 4, 16)); + debuglog ("s20:header=%s,data=%s", datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 16)); amiga_sector_header (fdi, fdi->track_src, fdi->track_src + 4, 0, 0); fdi->track_src += 4 + 16; } /* standard extended Amiga sector header */ -static void s21(FDI *fdi) +static void s21 (FDI *fdi) { bit_drop_next (fdi); - debuglog ("s21:header=%s", datalog(fdi->track_src, 4)); + debuglog ("s21:header=%s", datalog (fdi->track_src, 4)); amiga_sector_header (fdi, fdi->track_src, 0, 0, 0); fdi->track_src += 4; } /* standard Amiga sector header */ -static void s22(FDI *fdi) +static void s22 (FDI *fdi) { bit_drop_next (fdi); - debuglog("s22:sector=%d,untilgap=%d", fdi->track_src[0], fdi->track_src[1]); + debuglog ("s22:sector=%d,untilgap=%d", fdi->track_src[0], fdi->track_src[1]); amiga_sector_header (fdi, 0, 0, fdi->track_src[0], fdi->track_src[1]); fdi->track_src += 2; } /* standard 512-byte, CRC-correct Amiga data */ -static void s23(FDI *fdi) +static void s23 (FDI *fdi) { - debuglog("s23:data=%s", datalog (fdi->track_src, 512)); + debuglog ("s23:data=%s", datalog (fdi->track_src, 512)); amiga_data (fdi, fdi->track_src); fdi->track_src += 512; } /* not-decoded, 128*2^x-byte, CRC-correct Amiga data */ -static void s24(FDI *fdi) +static void s24 (FDI *fdi) { int shift = *fdi->track_src++; - debuglog("s24:shift=%d,data=%s", shift, datalog (fdi->track_src, 128 << shift)); + debuglog ("s24:shift=%d,data=%s", shift, datalog (fdi->track_src, 128 << shift)); amiga_data_raw (fdi, fdi->track_src, 0, 128 << shift); fdi->track_src += 128 << shift; } /* not-decoded, 128*2^x-byte, CRC-incorrect Amiga data */ -static void s25(FDI *fdi) +static void s25 (FDI *fdi) { int shift = *fdi->track_src++; - debuglog("s25:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 128 << shift)); + debuglog ("s25:shift=%d,crc=%s,data=%s", shift, datalog (fdi->track_src, 4), datalog (fdi->track_src + 4, 128 << shift)); amiga_data_raw (fdi, fdi->track_src + 4, fdi->track_src, 128 << shift); fdi->track_src += 4 + (128 << shift); } /* standard extended Amiga sector */ -static void s26(FDI *fdi) +static void s26 (FDI *fdi) { s21 (fdi); - debuglog("s26:data=%s", datalog (fdi->track_src, 512)); + debuglog ("s26:data=%s", datalog (fdi->track_src, 512)); amiga_data (fdi, fdi->track_src); fdi->track_src += 512; } /* standard short Amiga sector */ -static void s27(FDI *fdi) +static void s27 (FDI *fdi) { s22 (fdi); - debuglog("s27:data=%s", datalog (fdi->track_src, 512)); + debuglog ("s27:data=%s", datalog (fdi->track_src, 512)); amiga_data (fdi, fdi->track_src); fdi->track_src += 512; } @@ -1181,8 +1181,7 @@ static void track_atari_st (struct fdi *fdi, int max_sector) int i, gap3; uae_u8 *p = fdi->track_src; - switch (max_sector) - { + switch (max_sector) { case 9: gap3 = 40; break; @@ -1206,8 +1205,7 @@ static void track_pc (struct fdi *fdi, int max_sector) int i, gap3; uae_u8 *p = fdi->track_src; - switch (max_sector) - { + switch (max_sector) { case 8: gap3 = 116; break; @@ -1325,7 +1323,7 @@ static int handle_sectors_described_track (FDI *fdi) outlog ("%06.6X %06.6X %02.2X:",fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type); oldout = fdi->out; decode_sectors_described_track[fdi->track_type](fdi); - outlog(" %d\n", fdi->out - oldout); + outlog (" %d\n", fdi->out - oldout); oldout = fdi->out; if (fdi->out < 0 || fdi->err) { outlog ("\nin %d bytes, out %d bits\n", fdi->track_src - fdi->track_src_buffer, fdi->out); @@ -1336,7 +1334,7 @@ static int handle_sectors_described_track (FDI *fdi) return -1; } } while (fdi->track_type != 0xff); - outlog("\n"); + outlog ("\n"); fix_mfm_sync (fdi); return fdi->out; } @@ -1403,7 +1401,7 @@ struct pulse_sample { static int pulse_limitval = 15; /* tolerance of 15% */ static struct pulse_sample psarray[FDI_MAX_ARRAY]; static int array_index; -static unsigned long total; +static unsigned long total; static int totaldiv; static void init_array(unsigned long standard_MFM_2_bit_cell_size, int nb_of_bits) @@ -1526,8 +1524,8 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3 for (j = real_size; j > 1; j--) addbit (d, 0); addbit (d, 1); - for (j = 0; j < real_size; j++) - *pt++ = (uae_u16)(pulse / real_size); + for (j = 0; j < real_size; j++) + *pt++ = (uae_u16)(pulse / real_size); } /* prepares for the next pulse */ @@ -1557,7 +1555,7 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3 int real_size, i, j, nexti, eodat, outstep, randval; int indexoffset = *indexoffsetp; uae_u8 *d = fdi->track_dst_buffer; - uae_u16 *pt = fdi->track_dst_buffer_timing; + uae_u16 *pt = fdi->track_dst_buffer_timing; uae_u32 ref_pulse, pulse; long jitter; @@ -1925,7 +1923,7 @@ static int decode_lowlevel_track (FDI *fdi, int track, struct fdi_cache *cache) idxp[i] = sum; } len = totalavg / 100000; - debuglog("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n", + debuglog ("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n", totalavg, indexoffset, maxidx, weakbits, len); cache->avgp = avgp; cache->idxp = idxp; @@ -1956,7 +1954,7 @@ void fdi2raw_header_free (FDI *fdi) fdi_free (fdi->track_src_buffer); fdi_free (fdi->track_dst_buffer); fdi_free (fdi->track_dst_buffer_timing); - for (i = 0; i < MAX_TRACKS; i++) { + for (i = 0; i < MAX_TRACKS; i++) { struct fdi_cache *c = &fdi->cache[i]; if (c->idx_free) fdi_free (c->idxp); @@ -2035,7 +2033,7 @@ FDI *fdi2raw_header(struct zfile *f) uae_u32 crc = get_crc32(fdi->header, 508); uae_u32 crc2 = (fdi->header[508] << 24) | (fdi->header[509] << 16) | (fdi->header[510] << 8) | fdi->header[511]; if (crc != crc2) { - outlog("FDI: header checksum error\n"); + outlog ("FDI: header checksum error\n"); fdi_free(fdi); return NULL; } @@ -2096,7 +2094,7 @@ static int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *trackti cache->avgp, cache->minp, cache->maxp, cache->idxp, cache->maxidx, &idx, cache->pulses, mfm); //fdi2_gcr_decode (fdi, totalavg, avgp, minp, maxp, idxp, idx_off1, idx_off2, idx_off3, maxidx, pulses); - debuglog("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n", + debuglog ("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n", track, bitoffset, (double)cache->totalavg / bitoffset, cache->weakbits, cache->indexoffset); len = fdi->out; if (cache->weakbits >= 10 && multirev) diff --git a/filesys.c b/filesys.c index 277397b8..cf8f84fd 100755 --- a/filesys.c +++ b/filesys.c @@ -13,9 +13,7 @@ * (May - August 1989) * * Known limitations: - * Does not support ACTION_INHIBIT (big deal). - * Does not support several 2.0+ packet types. - * Does not support removable volumes. + * Does not support several (useless) 2.0+ packet types. * May not return the correct error code in some cases. * Does not check for sane values passed by AmigaDOS. May crash the emulation * if passed garbage values. @@ -215,6 +213,8 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo * mi->ismounted = 1; if (uci->rootdir && strlen(uci->rootdir) == 0) return FILESYS_VIRTUAL; + if (my_existsfile (uci->rootdir)) + return FILESYS_VIRTUAL; if (my_getvolumeinfo (uci->rootdir) < 0) return -1; return FILESYS_VIRTUAL; @@ -249,13 +249,50 @@ static void stripsemicolon(char *s) s[strlen(s) - 1] = 0; } +char *filesys_createvolname (const char *volname, const char *rootdir, const char *def) +{ + char *nvol = NULL; + int i, archivehd; + + archivehd = -1; + if (my_existsfile(rootdir)) + archivehd = 1; + else if (my_existsdir(rootdir)) + archivehd = 0; + + if ((!volname || strlen (volname) == 0) && rootdir && archivehd >= 0) { + for (i = strlen (rootdir) - 1; i >= 0; i--) { + char c = rootdir[i]; + if (c == ':' || c == '/' || c == '\\') { + if (i == strlen (rootdir) - 1) + continue; + i++; + break; + } + } + if (i >= 0) + nvol = my_strdup (rootdir + i); + } + if (!nvol && archivehd >= 0) { + char *s = NULL; + if (volname && strlen(volname) > 0) + nvol = my_strdup (volname); + else + nvol = my_strdup (def); + } + if (!nvol) + nvol = my_strdup (""); + stripsemicolon(nvol); + return nvol; +} + static int set_filesys_volume(const char *rootdir, int *flags, int *readonly, int *emptydrive, struct zvolume **zvp) { *emptydrive = 0; if (my_existsfile(rootdir)) { - struct zvolume *zv; - zv = zfile_fopen_archive(rootdir); - if (!zv) { + struct zvolume *zv; + zv = zfile_fopen_archive(rootdir); + if (!zv) { write_log ("'%s' is not a supported archive file\n", rootdir); return -1; } @@ -263,8 +300,8 @@ static int set_filesys_volume(const char *rootdir, int *flags, int *readonly, in *flags = MYVOLUMEINFO_ARCHIVE; *readonly = 1; } else { - *flags = my_getvolumeinfo (rootdir); - if (*flags < 0) { + *flags = my_getvolumeinfo (rootdir); + if (*flags < 0) { write_log ("directory '%s' not found, mounting as empty drive\n", rootdir); *emptydrive = 1; *flags = 0; @@ -293,13 +330,13 @@ static int set_filesys_unit_1 (int nr, break; } if (nr == MAX_FILESYSTEM_UNITS) { - write_log("No slot allocated for this unit\n"); + write_log ("No slot allocated for this unit\n"); return -1; } } for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) { - if (nr == i || !mountinfo.ui[i].open) + if (nr == i || !mountinfo.ui[i].open) continue; if (strlen(rootdir) > 0 && !strcmpi (mountinfo.ui[i].rootdir, rootdir)) { write_log ("directory/hardfile '%s' already added\n", rootdir); @@ -323,8 +360,7 @@ static int set_filesys_unit_1 (int nr, if (set_filesys_volume(rootdir, &flags, &readonly, &emptydrive, &ui->zarchive) < 0) return -1; if (!emptydrive) { - ui->volname = my_strdup (volname); - stripsemicolon(ui->volname); + ui->volname = filesys_createvolname (volname, rootdir, "harddrive"); } ui->volflags = flags; } else { @@ -344,17 +380,17 @@ static int set_filesys_unit_1 (int nr, goto err; } if ((ui->hf.blocksize & (ui->hf.blocksize - 1)) != 0 || ui->hf.blocksize == 0) { - write_log("Hardfile %s bad blocksize\n", ui->hf.device_name); + write_log ("Hardfile %s bad blocksize\n", ui->hf.device_name); goto err; } if ((ui->hf.secspertrack || ui->hf.surfaces || ui->hf.reservedblocks) && (ui->hf.secspertrack < 1 || ui->hf.surfaces < 1 || ui->hf.surfaces > 1023 || ui->hf.reservedblocks < 0 || ui->hf.reservedblocks > 1023) != 0) { - write_log("Hardfile %s bad hardfile geometry\n", ui->hf.device_name); + write_log ("Hardfile %s bad hardfile geometry\n", ui->hf.device_name); goto err; } if (ui->hf.blocksize > ui->hf.size || ui->hf.size == 0) { - write_log("Hardfile %s Hardfile too small\n", ui->hf.device_name); + write_log ("Hardfile %s Hardfile too small\n", ui->hf.device_name); goto err; } ui->hf.nrcyls = (int)(ui->hf.secspertrack * ui->hf.surfaces ? (ui->hf.size / ui->hf.blocksize) / (ui->hf.secspertrack * ui->hf.surfaces) : 0); @@ -507,7 +543,7 @@ struct hardfiledata *get_hardfile_data (int nr) return &uip[nr].hf; } -/* minimal AmigaDOS definitions */ +/* minimal AmigaDOS definitions */ /* field offsets in DosPacket */ #define dp_Type 8 @@ -605,11 +641,18 @@ typedef struct notify { char *partname; } Notify; +typedef struct exallkey { + uae_u32 id; + void *dirhandle; + char *fn; +} ExAllKey; + /* Since ACTION_EXAMINE_NEXT is so braindamaged, we have to keep * some of these around */ -#define EXKEYS 100 +#define EXKEYS 128 +#define EXALLKEYS 100 #define MAX_AINO_HASH 128 #define NOTIFY_HASH_SIZE 127 @@ -640,6 +683,10 @@ typedef struct _unit { int next_exkey; unsigned long total_locked_ainos; + /* ExAll */ + ExAllKey exalls[EXALLKEYS]; + int exallid; + /* Keys */ struct key *keys; @@ -687,7 +734,7 @@ static char *char1 (uaecptr addr) static char buf[1024]; unsigned int i = 0; do { - buf[i] = get_byte(addr); + buf[i] = get_byte (addr); addr++; } while (buf[i++] && i < sizeof(buf)); return buf; @@ -697,11 +744,11 @@ static char *bstr1 (uaecptr addr) { static char buf[256]; int i; - int n = get_byte(addr); + int n = get_byte (addr); addr++; for (i = 0; i < n; i++, addr++) - buf[i] = get_byte(addr); + buf[i] = get_byte (addr); buf[i] = 0; return buf; } @@ -709,11 +756,11 @@ static char *bstr1 (uaecptr addr) static char *bstr (Unit *unit, uaecptr addr) { int i; - int n = get_byte(addr); + int n = get_byte (addr); addr++; for (i = 0; i < n; i++, addr++) - unit->tmpbuf3[i] = get_byte(addr); + unit->tmpbuf3[i] = get_byte (addr); unit->tmpbuf3[i] = 0; return unit->tmpbuf3; } @@ -726,7 +773,7 @@ static char *bstr_cut (Unit *unit, uaecptr addr) addr++; for (i = 0; i < n; i++, addr++) { - uae_u8 c = get_byte(addr); + uae_u8 c = get_byte (addr); unit->tmpbuf3[i] = c; if (c == '/' || (c == ':' && colon_seen++ == 0)) p = unit->tmpbuf3 + i + 1; @@ -736,7 +783,6 @@ static char *bstr_cut (Unit *unit, uaecptr addr) } static Unit *units = 0; -static int unit_num = 0; static Unit* find_unit (uaecptr port) @@ -749,6 +795,54 @@ find_unit (uaecptr port) return u; } + +static void *fs_opendir (Unit *u, const char *nname) +{ + if (u->volflags & MYVOLUMEINFO_ARCHIVE) + return zfile_opendir_archive (nname); + else + return my_opendir (nname); +} +static void fs_closedir (Unit *u, void *d) +{ + if (u->volflags & MYVOLUMEINFO_ARCHIVE) + zfile_closedir_archive (d); + else + my_closedir (d); +} +static void *fs_open (Unit *unit, const char *name, int flags) +{ + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + if (isarch) + return zfile_open_archive(name, flags); + else + return my_open(name, flags); +} +static void fs_close(Unit *unit, void *fd) +{ + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + if (isarch) + zfile_close_archive(fd); + else + my_close(fd); +} +static unsigned int fs_read (Unit *unit, void *d, void *b, unsigned int size) +{ + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + if (isarch) + return zfile_read_archive(d, b, size); + else + return my_read (d, b, size); +} +static unsigned int fs_lseek (Unit *unit, void *d, unsigned int offset, int whence) +{ + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + if (isarch) + return zfile_lseek_archive(d, offset, whence); + else + return my_lseek (d, offset, whence); +} + static void set_volume_name(Unit *unit) { int namelen; @@ -757,7 +851,7 @@ static void set_volume_name(Unit *unit) namelen = strlen (unit->ui.volname); put_byte (unit->volume + 44, namelen); for (i = 0; i < namelen; i++) - put_byte (unit->volume + 45 + i, unit->ui.volname[i]); + put_byte (unit->volume + 45 + i, unit->ui.volname[i]); put_byte (unit->volume + 45 + namelen, 0); unit->rootnode.aname = unit->ui.volname; unit->rootnode.nname = unit->ui.rootdir; @@ -766,7 +860,7 @@ static void set_volume_name(Unit *unit) static int filesys_isvolume(Unit *unit) { - return get_byte(unit->volume + 44); + return get_byte (unit->volume + 44); } static void clear_exkeys(Unit *unit) @@ -778,6 +872,14 @@ static void clear_exkeys(Unit *unit) unit->examine_keys[i].curr_file = 0; unit->examine_keys[i].uniq = 0; } + for (i = 0; i < EXALLKEYS; i++) { + fs_closedir (unit, unit->exalls[i].dirhandle); + unit->exalls[i].dirhandle = NULL; + xfree (unit->exalls[i].fn); + unit->exalls[i].fn = NULL; + unit->exalls[i].id = 0; + } + unit->exallid = 0; unit->next_exkey = 1; a = &unit->rootnode; while (a) { @@ -792,7 +894,7 @@ static void clear_exkeys(Unit *unit) } } -int filesys_eject(int nr) +int filesys_eject (int nr) { UnitInfo *ui = &mountinfo.ui[nr]; Unit *u = ui->self; @@ -803,17 +905,17 @@ int filesys_eject(int nr) return 0; if (!filesys_isvolume(u)) return 0; - zfile_fclose_archive(u->zarchive); + zfile_fclose_archive (u->zarchive); u->zarchive = NULL; u->mountcount++; - write_log("FILESYS: removed volume '%s'\n", u->ui.volname); + write_log ("FILESYS: removed volume '%s'\n", u->ui.volname); flush_cache(u, -1); - put_byte(u->volume + 172 - 32, -1); + put_byte (u->volume + 172 - 32, -1); uae_Signal(get_long(u->volume + 176 - 32), 1 << 17); return 1; } -void filesys_vsync(void) +void filesys_vsync (void) { Unit *u; @@ -821,32 +923,33 @@ void filesys_vsync(void) if (u->reinsertdelay > 0) { u->reinsertdelay--; if (u->reinsertdelay == 0) { - filesys_insert(u->unit, u->newvolume, u->newrootdir, u->newreadonly, u->newflags); - xfree(u->newvolume); + filesys_insert (u->unit, u->newvolume, u->newrootdir, u->newreadonly, u->newflags); + xfree (u->newvolume); u->newvolume = NULL; - xfree(u->newrootdir); + xfree (u->newrootdir); u->newrootdir = NULL; } } } } -int filesys_insert(int nr, char *volume, char *rootdir, int readonly, int flags) +int filesys_insert (int nr, char *volume, char *rootdir, int readonly, int flags) { + struct uaedev_config_info *uci; int emptydrive = 0; UnitInfo *ui; Unit *u; if (nr < 0) { for (u = units; u; u = u->next) { - if (is_hardfile(u->unit) == FILESYS_VIRTUAL) { - if (!filesys_isvolume(u)) + if (is_hardfile (u->unit) == FILESYS_VIRTUAL) { + if (!filesys_isvolume (u)) break; } } if (!u) { for (u = units; u; u = u->next) { - if (is_hardfile(u->unit) == FILESYS_VIRTUAL) { + if (is_hardfile (u->unit) == FILESYS_VIRTUAL) { if (mountinfo.ui[u->unit].wasisempty) break; } @@ -860,51 +963,48 @@ int filesys_insert(int nr, char *volume, char *rootdir, int readonly, int flags) ui = &mountinfo.ui[nr]; u = ui->self; } + uci = &currprefs.mountconfig[nr]; - if (u->reinsertdelay) - return -1; if (!ui->open || u == NULL) return 0; + if (u->reinsertdelay) + return -1; if (is_hardfile(nr) != FILESYS_VIRTUAL) return 0; - if (filesys_isvolume(u)) { + if (filesys_isvolume (u)) { u->reinsertdelay = 100; u->newflags = flags; u->newreadonly = readonly; - u->newrootdir = my_strdup(rootdir); - u->newvolume = my_strdup(volume); + u->newrootdir = my_strdup (rootdir); + u->newvolume = my_strdup (volume); filesys_eject(nr); - write_log("FILESYS: delayed insert %d '%s' ('%s')\n", nr, volume, rootdir); + if (!rootdir || strlen (rootdir) == 0) + u->reinsertdelay = 0; + if (u->reinsertdelay > 0) + write_log ("FILESYS: delayed insert %d '%s' ('%s')\n", nr, volume, rootdir); return -1; } u->mountcount++; - clear_exkeys(u); + clear_exkeys (u); xfree (u->ui.rootdir); - ui->rootdir = u->ui.rootdir = my_strdup(rootdir); + ui->rootdir = u->ui.rootdir = my_strdup (rootdir); flush_cache(u, -1); if (set_filesys_volume (rootdir, &flags, &readonly, &emptydrive, &u->zarchive) < 0) return 0; if (emptydrive) return 0; xfree (u->ui.volname); - if (volume) { - ui->volname = u->ui.volname = my_strdup(volume); - } else { - char *p = strrchr (rootdir, '\\'); - if (!p) - p = strrchr (rootdir, '/'); - if (p) - ui->volname = u->ui.volname = my_strdup(p + 1); - else - ui->volname = u->ui.volname = my_strdup("removable"); - } - set_volume_name(u); - write_log("FILESYS: inserted volume %d '%s' ('%s')\n", nr, volume, rootdir); + ui->volname = u->ui.volname = filesys_createvolname (volume, rootdir, "removable"); + set_volume_name (u); + write_log ("FILESYS: inserted volume %d '%s' ('%s')\n", nr, volume, rootdir); ui->readonly = readonly; ui->volflags = u->volflags = u->ui.volflags = flags; + strcpy (uci->volname, ui->volname); + strcpy (uci->rootdir, rootdir); + uci->readonly = readonly; put_byte (u->volume + 44, 0); - put_byte(u->volume + 172 - 32, 1); - uae_Signal(get_long(u->volume + 176 - 32), 1 << 17); + put_byte (u->volume + 172 - 32, 1); + uae_Signal (get_long(u->volume + 176 - 32), 1 << 17); return 1; } @@ -920,39 +1020,6 @@ static int fsdb_cando (Unit *unit) return 0; } -static void *fs_open (Unit *unit, const char *name, int flags) -{ - int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; - if (isarch) - return zfile_open_archive(name, flags); - else - return my_open(name, flags); -} -static void fs_close(Unit *unit, void *fd) -{ - int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; - if (isarch) - zfile_close_archive(fd); - else - my_close(fd); -} -static unsigned int fs_read (Unit *unit, void *d, void *b, unsigned int size) -{ - int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; - if (isarch) - return zfile_read_archive(d, b, size); - else - return my_read (d, b, size); -} -static unsigned int fs_lseek (Unit *unit, void *d, unsigned int offset, int whence) -{ - int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; - if (isarch) - return zfile_lseek_archive(d, offset, whence); - else - return my_lseek (d, offset, whence); -} - static void prepare_for_open (char *name) { #if 0 @@ -1011,7 +1078,7 @@ static int flush_cache(Unit *unit, int num) int i = 0; int cnt = 100; - write_log("FILESYS: flushing cache unit %d (max %d items)\n", unit->unit, num); + write_log ("FILESYS: flushing cache unit %d (max %d items)\n", unit->unit, num); if (num == 0) num = -1; while (i < num || num < 0) { @@ -1023,9 +1090,9 @@ static int flush_cache(Unit *unit, int num) aino_test (parent); if (parent && !parent->locked_children) { for (;;) { - a_inode *aino = *aip; - aino_test (aino); - if (aino == 0) + a_inode *aino = *aip; + aino_test (aino); + if (aino == 0) break; /* Not recyclable if next == 0 (i.e., not chained into recyclable list), or if parent directory is being @@ -1034,14 +1101,14 @@ static int flush_cache(Unit *unit, int num) aip = &aino->sibling; } else { if (aino->shlock > 0 || aino->elock) - write_log ("panic: freeing locked a_inode!\n"); + write_log ("panic: freeing locked a_inode!\n"); de_recycle_aino (unit, aino); dispose_aino (unit, aip, aino); i++; } } } - if (unit->rootnode.next != unit->rootnode.prev) { + { //if (unit->rootnode.next != unit->rootnode.prev) { /* In the previous loop, we went through all children of one parent. Re-arrange the recycled list so that we'll find a different parent the next time around. @@ -1328,12 +1395,12 @@ static char *create_nname (Unit *unit, a_inode *base, char *rel) static int fill_file_attrs(Unit *u, a_inode *base, a_inode *c) { if (u->volflags & MYVOLUMEINFO_ARCHIVE) { - int isdir, flags; - char *comment; - zfile_fill_file_attrs_archive(c->nname, &isdir, &flags, &comment); - c->dir = isdir; - c->amigaos_mode = flags; - c->comment = comment; + int isdir, flags; + char *comment; + zfile_fill_file_attrs_archive(c->nname, &isdir, &flags, &comment); + c->dir = isdir; + c->amigaos_mode = flags; + c->comment = comment; return 1; } else { return fsdb_fill_file_attrs (base, c); @@ -1648,7 +1715,7 @@ static void startup_update_unit (Unit *unit, UnitInfo *uinfo) unit->ui.wasisempty = uinfo->wasisempty; } -static Unit *startup_create_unit (UnitInfo *uinfo) +static Unit *startup_create_unit (UnitInfo *uinfo, int num) { int i; Unit *unit, *u; @@ -1667,7 +1734,7 @@ static Unit *startup_create_unit (UnitInfo *uinfo) unit->volume = 0; unit->port = m68k_areg (®s, 5); - unit->unit = unit_num++; + unit->unit = num; startup_update_unit (unit, uinfo); @@ -1756,7 +1823,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context) } uinfo = mountinfo.ui + i; - unit = startup_create_unit (uinfo); + unit = startup_create_unit (uinfo, i); unit->volflags = uinfo->volflags; /* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/ @@ -2104,7 +2171,7 @@ static void free_lock (Unit *unit, uaecptr lock) current = next; } if (!current) { - write_log("tried to unlock non-existing lock %x\n", lock); + write_log ("tried to unlock non-existing lock %x\n", lock); return; } put_long (current << 2, get_long (lock)); @@ -2115,7 +2182,7 @@ static void free_lock (Unit *unit, uaecptr lock) } static void -action_lock(Unit *unit, dpacket packet) +action_lock (Unit *unit, dpacket packet) { uaecptr lock = GET_PCK_ARG1 (packet) << 2; uaecptr name = GET_PCK_ARG2 (packet) << 2; @@ -2208,7 +2275,7 @@ action_dup_lock (Unit *unit, dpacket packet) PUT_PCK_RES1 (packet, 0); return; } - action_dup_lock_2 (unit, packet, get_long(lock + 4)); + action_dup_lock_2 (unit, packet, get_long (lock + 4)); } @@ -2431,6 +2498,167 @@ int get_native_path(uae_u32 lock, char *out) return -1; } +static ExAllKey *getexall (Unit *unit, int id) +{ + int i; + if (id < 0) { + for (i = 0; i < EXALLKEYS; i++) { + if (unit->exalls[i].id == 0) { + unit->exallid++; + unit->exalls[i].id = unit->exallid; + return &unit->exalls[i]; + } + } + } else { + for (i = 0; i < EXALLKEYS; i++) { + if (unit->exalls[i].id == id) + return &unit->exalls[i]; + } + } + return NULL; +} + + +#if 1 + +static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaecptr control, Unit *unit, a_inode *aino) +{ + uaecptr exp = exalldata; + int i; + int size, size2; + int entrytype; + char *x = NULL, *comment = NULL; + uae_u32 flags = 15, days, mins, ticks; + struct stat statbuf; + int fsdb_can = fsdb_cando (unit); + + memset(&statbuf, 0, sizeof statbuf); + if (unit->volflags & MYVOLUMEINFO_ARCHIVE) + zfile_stat_archive (aino->nname, &statbuf); + else + stat (aino->nname, &statbuf); + + if (aino->parent == 0) { + entrytype = 2; + x = unit->ui.volname; + } else { + entrytype = aino->dir ? 2 : -3; + x = aino->aname; + } + + size = 0; + size2 = 4; + if (control >= 1) { + size2 += 4; + size += strlen (x) + 1; + size = (size + 3) & ~3; + } + if (control >= 2) + size2 += 4; + if (control >= 3) + size2 += 4; + if (control >= 4) { + flags = fsdb_can ? aino->amigaos_mode : fsdb_mode_supported(aino); + size2 += 4; + } + if (control >= 5) { + get_time (statbuf.st_mtime, &days, &mins, &ticks); + size2 += 12; + } + if (control >= 6) { + size2 += 4; + if (aino->comment == 0 || !fsdb_can) + comment = ""; + else + comment = aino->comment; + size += strlen (comment) + 1; + size = (size + 3) & ~3; + } + + i = get_long (control + 0); + while (i > 0) { + exp = get_long (exp); /* ed_Next */ + i--; + } + + if (exalldata + exalldatasize - exp < size + size2) + return 0; /* not enough space */ + + write_log("%d, %08x: '%s'%s\n", get_long (control + 0), exp, x, aino->dir ? " [DIR]" : ""); + + put_long (exp, exp + size + size2); /* ed_Next */ + if (control >= 1) { + put_long (exp + 4, exp + size2); + for (i = 0; i <= strlen (x); i++) { + put_byte (exp + size2, x[i]); + size2++; + } + } + if (control >= 2) + put_long (exp + 8, entrytype); + if (control >= 3) + put_long (exp + 12, statbuf.st_size); + if (control >= 4) + put_long (exp + 16, flags); + if (control >= 5) { + put_long (exp + 20, days); + put_long (exp + 24, mins); + put_long (exp + 28, ticks); + } + if (control >= 6) { + put_long (exp + 32, exp + size2); + put_byte (exp + size2, strlen (comment)); + for (i = 0; i <= strlen (comment); i++) { + put_byte (exp + size2, comment[i]); + size2++; + } + } + put_long (control + 0, get_long (control + 0) + 1); + return 1; +} + +static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaecptr control) +{ + a_inode *aino, *base; + int ok; + uae_u32 err; + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + void *d; + char fn[MAX_DPATH]; + + if (lock != 0) + base = lookup_aino (unit, get_long (lock + 4)); + if (base == 0) + base = &unit->rootnode; + for (;;) { + d = eak->dirhandle; + if (!eak->fn) { + do { + if (isarch) + ok = zfile_readdir_archive(d, fn); + else + ok = my_readdir (d, fn); + } while (ok && !isarch && fsdb_name_invalid (fn)); + if (!ok) + return 0; + } else { + strcpy (fn, eak->fn); + xfree (eak->fn); + eak->fn = NULL; + } + aino = lookup_child_aino_for_exnext (unit, base, fn, &err); + if (!aino) + return 0; + eak->id = unit->exallid++; + put_long (control + 4, eak->id); + if (!exalldo (exalldata, exalldatasize, type, control, unit, aino)) { + eak->fn = my_strdup (fn); /* no space in exallstruct, save current entry */ + break; + } + } + return 1; +} + static int action_examine_all (Unit *unit, dpacket packet) { uaecptr lock = GET_PCK_ARG1 (packet) << 2; @@ -2439,9 +2667,86 @@ static int action_examine_all (Unit *unit, dpacket packet) uae_u32 type = GET_PCK_ARG4 (packet); uaecptr control = GET_PCK_ARG5 (packet); - return 0; -} + ExAllKey *eak = NULL; + int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; + a_inode *base; + void *d; + int id, ok, i; + uaecptr exp; + + ok = 0; + + write_log ("exall: %08x %08x-%08x %d %d %08x\n", lock, exalldata, exalldata + exalldatasize, exalldatasize, type, control); + write_log ("exall: MatchString %08x, MatchFunc %08x\n", get_long (control + 8), get_long (control + 12)); + + put_long (control + 0, 0); /* eac_Entries */ + + if (kickstart_version < 36) + return 0; + + if (type == 0 || type > 6) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_BAD_NUMBER); + return 1; + } + + PUT_PCK_RES1 (packet, DOS_TRUE); + id = get_long (control + 4); + if (id) { + eak = getexall (unit, id); + if (!eak) { + write_log ("FILESYS: EXALL non-existing ID %d\n", id); + goto fail; + } + if (!action_examine_all_do (unit, lock, eak, exalldata, exalldatasize, type, control)) + goto fail; + } else { + eak = getexall (unit, -1); + if (!eak) + goto fail; + if (lock != 0) + base = lookup_aino (unit, get_long (lock + 4)); + if (base == 0) + base = &unit->rootnode; + write_log("exall: '%s'\n", base->nname); + d = fs_opendir (unit, base->nname); + if (!d) + goto fail; + eak->dirhandle = d; + put_long (control + 4, eak->id); + if (!action_examine_all_do (unit, lock, eak, exalldata, exalldatasize, type, control)) + goto fail; + } + ok = 1; + +fail: + /* Clear last ed_Next. This "list" is quite non-Amiga like.. */ + exp = exalldata; + i = get_long (control + 0); + for (;;) { + if (i <= 1) { + put_long (exp, 0); + break; + } + exp = get_long (exp); /* ed_Next */ + i--; + } + write_log("ok=%d, eac_Entries = %d\n", ok, get_long (control + 0)); + + if (!ok) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES); + if (eak) { + eak->id = 0; + fs_closedir (unit, eak->dirhandle); + } + xfree (eak->fn); + eak->fn = NULL; + } + return 1; +} +#endif static void action_examine_object (Unit *unit, dpacket packet) { @@ -2477,10 +2782,7 @@ static void populate_directory (Unit *unit, a_inode *base) a_inode *aino; int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE; - if (isarch) - d = zfile_opendir_archive(base->nname); - else - d = my_opendir (base->nname); + d = fs_opendir (unit, base->nname); if (!d) return; for (aino = base->child; aino; aino = aino->sibling) { @@ -2508,10 +2810,7 @@ static void populate_directory (Unit *unit, a_inode *base) being ExNext()ed, and it will increment the locked counts. */ aino = lookup_child_aino_for_exnext (unit, base, fn, &err); } - if (isarch) - zfile_closedir_archive(d); - else - my_closedir (d); + fs_closedir (unit, d); } static void do_examine (Unit *unit, dpacket packet, ExamineKey *ek, uaecptr info) @@ -2522,7 +2821,7 @@ static void do_examine (Unit *unit, dpacket packet, ExamineKey *ek, uaecptr info break; name = ek->curr_file->nname; get_fileinfo (unit, packet, info, ek->curr_file); - ek->curr_file = ek->curr_file->sibling; + ek->curr_file = ek->curr_file->sibling; if (!(unit->volflags & MYVOLUMEINFO_ARCHIVE) && !fsdb_exists(name)) { TRACE (("%s orphaned", name)); continue; @@ -2701,7 +3000,7 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb k->notifyactive = create ? 1 : 0; if (create && isarch) - fsdb_set_file_attrs (aino); + fsdb_set_file_attrs (aino); put_long (fh + 36, k->uniq); if (create == 2) @@ -2911,7 +3210,7 @@ action_read (Unit *unit, dpacket packet) int i; PUT_PCK_RES1 (packet, actual); for (i = 0; i < actual; i++) - put_byte(addr + i, buf[i]); + put_byte (addr + i, buf[i]); k->file_pos += actual; } xfree (buf); @@ -2960,7 +3259,7 @@ action_write (Unit *unit, dpacket packet) } for (i = 0; i < size; i++) - buf[i] = get_byte(addr + i); + buf[i] = get_byte (addr + i); actual = my_write (k->fd, buf, size); xfree (buf); @@ -3078,7 +3377,7 @@ static void action_set_comment (Unit * unit, dpacket packet) } if (fsdb_cando (unit)) { - commented = bstr (unit, comment); + commented = bstr (unit, comment); if (strlen (commented) > 0) { char *p = commented; commented = (char*)xmalloc (81); @@ -3387,8 +3686,8 @@ static int relock_do(Unit *unit, a_inode *a1) int wehavekeys = 0; for (k1 = unit->keys; k1; k1 = knext) { - knext = k1->next; - if (k1->aino == a1 && k1->fd) { + knext = k1->next; + if (k1->aino == a1 && k1->fd) { wehavekeys++; fs_close (unit, k1->fd); write_log ("handle %p freed\n", k1->fd); @@ -3402,16 +3701,16 @@ static void relock_re(Unit *unit, a_inode *a1, a_inode *a2, int failed) Key *k1, *knext; for (k1 = unit->keys; k1; k1 = knext) { - knext = k1->next; - if (k1->aino == a1 && k1->fd) { + knext = k1->next; + if (k1->aino == a1 && k1->fd) { int mode = (k1->dosmode & A_FIBF_READ) == 0 ? O_WRONLY : (k1->dosmode & A_FIBF_WRITE) == 0 ? O_RDONLY : O_RDWR; mode |= O_BINARY; if (failed) { - /* rename still failed, restore fd */ - k1->fd = fs_open (unit, a1->nname, mode); - write_log ("restoring old handle '%s' %d\n", a1->nname, k1->dosmode); + /* rename still failed, restore fd */ + k1->fd = fs_open (unit, a1->nname, mode); + write_log ("restoring old handle '%s' %d\n", a1->nname, k1->dosmode); } else { - /* transfer fd to new name */ + /* transfer fd to new name */ if (a2) { k1->aino = a2; k1->fd = fs_open (unit, a2->nname, mode); @@ -3424,7 +3723,7 @@ static void relock_re(Unit *unit, a_inode *a1, a_inode *a2, int failed) write_log ("relocking failed '%s' -> '%s'\n", a1->nname, a2->nname); free_key (unit, k1); } else { - fs_lseek (unit, k1->fd, k1->file_pos, SEEK_SET); + fs_lseek (unit, k1->fd, k1->file_pos, SEEK_SET); } } } @@ -3694,6 +3993,7 @@ action_inhibit (Unit *unit, dpacket packet) PUT_PCK_RES1 (packet, DOS_TRUE); flush_cache(unit, 0); unit->inhibited = GET_PCK_ARG1 (packet); + write_log("ACTION_INHIBIT %d:%d\n", unit->unit, unit->inhibited); } static void @@ -3709,7 +4009,7 @@ action_write_protect (Unit *unit, dpacket packet) } else { if (unit->ui.readonly & 2) { if (unit->lockkey == GET_PCK_ARG2 (packet) || unit->lockkey == 0) { - unit->ui.readonly &= ~2; + unit->ui.readonly &= ~2; } else { PUT_PCK_RES1 (packet, DOS_FALSE); PUT_PCK_RES2 (packet, 0); @@ -3854,7 +4154,7 @@ static uae_u32 REGPARAM2 exter_int_helper (TrapContext *context) break; case 4: /* Exit the interrupt, and release the single-threading lock. */ - filesys_in_interrupt--; + filesys_in_interrupt--; uae_sem_post (&singlethread_int_sem); break; @@ -3926,11 +4226,7 @@ static int handle_packet (Unit *unit, dpacket pck) case ACTION_PARENT_FH: action_parent_fh (unit, pck); break; case ACTION_ADD_NOTIFY: action_add_notify (unit, pck); break; case ACTION_REMOVE_NOTIFY: action_remove_notify (unit, pck); break; - - case ACTION_EXAMINE_ALL: - if (!action_examine_all (unit, pck)) - return 0; /* not yet supported */ - break; + case ACTION_EXAMINE_ALL: return action_examine_all (unit, pck); break; /* unsupported packets */ case ACTION_LOCK_RECORD: @@ -4125,7 +4421,6 @@ void filesys_reset (void) u1 = u->next; xfree (u); } - unit_num = 0; units = 0; key_uniq = 0; a_uniq = 0; @@ -4172,14 +4467,14 @@ static uaecptr uaeresource_startup (uaecptr resaddr) ROM_uaeresource_resname = ds ("uae.resource"); ROM_uaeresource_resid = ds ("uae.resource 0.1"); - put_word(resaddr + 0x0, 0x4AFC); - put_long(resaddr + 0x2, resaddr); - put_long(resaddr + 0x6, resaddr + 0x1A); // Continue scan here - put_word(resaddr + 0xA, 0x0001); // RTF_COLDSTART; Version 1 - put_word(resaddr + 0xC, 0x0801); // NT_RESOURCE; pri 01 - put_long(resaddr + 0xE, ROM_uaeresource_resname); - put_long(resaddr + 0x12, ROM_uaeresource_resid); - put_long(resaddr + 0x16, 0); + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); // Continue scan here + put_word (resaddr + 0xA, 0x0001); // RTF_COLDSTART; Version 1 + put_word (resaddr + 0xC, 0x0801); // NT_RESOURCE; pri 01 + put_long (resaddr + 0xE, ROM_uaeresource_resname); + put_long (resaddr + 0x12, ROM_uaeresource_resid); + put_long (resaddr + 0x16, 0); resaddr += 0x1A; return resaddr; } @@ -4365,7 +4660,7 @@ static char *device_dupfix (uaecptr expbase, char *devname) while (get_long (bnode)) { dnode = get_long (bnode + 16); /* device node */ name = get_long (dnode + 40) << 2; /* device name BSTR */ - len = get_byte(name); + len = get_byte (name); for (i = 0; i < len; i++) dname[i] = get_byte (name + 1 + i); dname[len] = 0; @@ -4392,14 +4687,14 @@ static void dump_partinfo (char *name, int num, uaecptr pp, int partblock) uae_u32 dostype = get_long (pp + 80); write_log ("RDB: '%s' dostype=%08.8X. PartBlock=%d\n", name, dostype, partblock); write_log ("BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n", - get_long (pp + 20) * 4, get_long (pp + 28), get_long (pp + 32)); + get_long (pp + 20) * 4, get_long (pp + 28), get_long (pp + 32)); write_log ("SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d\n", - get_long (pp + 36), get_long (pp + 40), get_long (pp + 52), get_long (pp + 56)); + get_long (pp + 36), get_long (pp + 40), get_long (pp + 52), get_long (pp + 56)); write_log ("Buffers: %d, BufMemType: %08.8x, MaxTransfer: %08.8x, BootPri: %d\n", - get_long (pp + 60), get_long (pp + 64), get_long (pp + 68), get_long (pp + 76)); + get_long (pp + 60), get_long (pp + 64), get_long (pp + 68), get_long (pp + 76)); } -#define rdbmnt write_log("Mounting uaehf.device %d (%d) (size=%I64u):\n", unit_no, partnum, hfd->size); +#define rdbmnt write_log ("Mounting uaehf.device %d (%d) (size=%I64u):\n", unit_no, partnum, hfd->size); static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacket) { @@ -4417,12 +4712,12 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke if (hfd->blocksize == 0) { rdbmnt - write_log("failed, blocksize == 0\n"); + write_log ("failed, blocksize == 0\n"); return -1; } if (lastblock * hfd->blocksize > hfd->size) { rdbmnt - write_log("failed, too small (%d*%d > %I64u)\n", lastblock, hfd->blocksize, hfd->size); + write_log ("failed, too small (%d*%d > %I64u)\n", lastblock, hfd->blocksize, hfd->size); return -2; } for (rdblock = 0; rdblock < lastblock; rdblock++) { @@ -4436,7 +4731,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke bufrdb[0xde] = 0; bufrdb[0xdf] = 0; if (rdb_checksum ("RDSK", bufrdb, rdblock)) { - write_log ("Windows trashed RDB detected, fixing..\n"); + write_log ("Windows 95/98/ME trashed RDB detected, fixing..\n"); hdf_write (hfd, bufrdb, rdblock * hfd->blocksize, hfd->blocksize); break; } @@ -4444,7 +4739,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke } if (rdblock == lastblock) { rdbmnt - write_log("failed, no RDB detected\n"); + write_log ("failed, no RDB detected\n"); return -2; } blocksize = rl (bufrdb + 16); @@ -4467,7 +4762,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke fileblock = rl (bufrdb + 32); if (partnum == 0) { - write_log("RDB: RDSK detected at %d, FSHD=%d, C=%d S=%d H=%d\n", + write_log ("RDB: RDSK detected at %d, FSHD=%d, C=%d S=%d H=%d\n", rdblock, fileblock, hfd->cylinders, hfd->sectors, hfd->heads); } @@ -4493,7 +4788,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke flags = rl (buf + 20); if (flags & 2) { /* do not mount */ err = -1; - write_log("RDB: Automount disabled, not mounting\n"); + write_log ("RDB: Automount disabled, not mounting\n"); goto error; } @@ -4512,13 +4807,13 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke dostype = get_long (parmpacket + 80); if (dostype == 0) { - write_log("RDB: mount failed, dostype=0\n"); + write_log ("RDB: mount failed, dostype=0\n"); err = -1; goto error; } if (hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->size) - write_log("RDB: WARNING: end of partition > size of disk!\n"); + write_log ("RDB: WARNING: end of partition > size of disk!\n"); err = 2; @@ -4552,13 +4847,13 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke goto error; } if (!legalrdbblock (uip, fileblock)) { - write_log("RDB: corrupt FSHD pointer %d\n", fileblock); + write_log ("RDB: corrupt FSHD pointer %d\n", fileblock); goto error; } memset (buf, 0, readblocksize); hdf_read (hfd, buf, fileblock * hfd->blocksize, readblocksize); if (!rdb_checksum ("FSHD", buf, fileblock)) { - write_log("RDB: checksum error in FSHD block %d\n", fileblock); + write_log ("RDB: checksum error in FSHD block %d\n", fileblock); goto error; } fileblock = rl (buf + 16); @@ -4715,7 +5010,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context) } if (sub_no) return -2; - write_log("Mounting uaehf.device %d (%d):\n", unit_no, sub_no); + write_log ("Mounting uaehf.device %d (%d):\n", unit_no, sub_no); get_new_device (type, parmpacket, &uip[unit_no].devname, &uip[unit_no].devname_amiga, unit_no); uip[unit_no].devno = unit_no; put_long (parmpacket, uip[unit_no].devname_amiga); @@ -4901,7 +5196,7 @@ static a_inode *restore_filesys_get_base(Unit *u, char *npath) err = 0; get_aino (u, &u->rootnode, path, &err); if (err) { - write_log("*** FS: missing path '%s'!\n", path); + write_log ("*** FS: missing path '%s'!\n", path); return NULL; } cnt++; @@ -4916,7 +5211,7 @@ static a_inode *restore_filesys_get_base(Unit *u, char *npath) a = u->rootnode.child; for (;;) { if (*p == 0) { - write_log("*** FS: base aino NOT found '%s' ('%s')\n", a->nname, npath); + write_log ("*** FS: base aino NOT found '%s' ('%s')\n", a->nname, npath); xfree (path); return NULL; } @@ -4924,14 +5219,14 @@ static a_inode *restore_filesys_get_base(Unit *u, char *npath) while(*p2 != '/' && *p2 != '\\' && *p2 != 0) p2++; *p2 = 0; - while (a) { + while (a) { if (!same_aname(p, a->aname)) { a = a->sibling; continue; } p = p2 + 1; if (*p == 0) { - write_log("FS: base aino found '%s' ('%s')\n", a->nname, npath); + write_log ("FS: base aino found '%s' ('%s')\n", a->nname, npath); xfree (path); return a; } @@ -4939,7 +5234,7 @@ static a_inode *restore_filesys_get_base(Unit *u, char *npath) break; } if (!a) { - write_log("*** FS: path part '%s' not found ('%s')\n", p, npath); + write_log ("*** FS: path part '%s' not found ('%s')\n", p, npath); xfree (path); return NULL; } @@ -4977,7 +5272,7 @@ static uae_u8 *restore_aino(UnitInfo *ui, Unit *u, uae_u8 *src) a->shlock = restore_u32 (); flags = restore_u32 (); if (flags & 1) - a->elock = 1; + a->elock = 1; /* full Amiga-side path without drive, eg. "C/SetPatch" */ p = restore_string (); /* root (p = volume label) */ @@ -4990,7 +5285,7 @@ static uae_u8 *restore_aino(UnitInfo *ui, Unit *u, uae_u8 *src) } else { a->volflags = ui->volflags; recycle_aino (u, a); - write_log("FS: Lock (root) '%s' ('%s')\n", a->aname, a->nname); + write_log ("FS: Lock (root) '%s' ('%s')\n", a->aname, a->nname); } return src; } @@ -5010,28 +5305,28 @@ static uae_u8 *restore_aino(UnitInfo *ui, Unit *u, uae_u8 *src) if (flags & 2) { a->dir = 1; if (!my_existsdir(a->nname)) - write_log("*** FS: Directory '%s' missing!\n", a->nname); - else + write_log ("*** FS: Directory '%s' missing!\n", a->nname); + else fsdb_clean_dir (a); } else { if (!my_existsfile(a->nname)) - write_log("*** FS: File '%s' missing!\n", a->nname); + write_log ("*** FS: File '%s' missing!\n", a->nname); } if (base) { fill_file_attrs (u, base, a); init_child_aino_tree (u, base, a); } else { - write_log("*** FS: parent directory missing '%s' ('%s')\n", a->aname, a->nname); + write_log ("*** FS: parent directory missing '%s' ('%s')\n", a->aname, a->nname); missing = 1; } if (missing) { - write_log("*** FS: Lock restore failed '%s' ('%s')\n", a->aname, a->nname); - xfree (a->nname); - xfree (a->aname); - xfree (a); + write_log ("*** FS: Lock restore failed '%s' ('%s')\n", a->aname, a->nname); + xfree (a->nname); + xfree (a->aname); + xfree (a); } else { - write_log("FS: Lock '%s' ('%s')\n", a->aname, a->nname); - recycle_aino (u, a); + write_log ("FS: Lock '%s' ('%s')\n", a->aname, a->nname); + recycle_aino (u, a); } return src; } @@ -5059,18 +5354,18 @@ static uae_u8 *restore_key(UnitInfo *ui, Unit *u, uae_u8 *src) openmode = ((k->dosmode & A_FIBF_READ) == 0 ? O_WRONLY : (k->dosmode & A_FIBF_WRITE) == 0 ? O_RDONLY : O_RDWR); - write_log("FS: open file '%s' ('%s'), pos=%d\n", p, pn, k->file_pos); + write_log ("FS: open file '%s' ('%s'), pos=%d\n", p, pn, k->file_pos); a = get_aino (u, &u->rootnode, p, &err); if (!a) - write_log ("*** FS: Open file aino creation failed '%s'\n", p); + write_log ("*** FS: Open file aino creation failed '%s'\n", p); missing = 1; if (a) { missing = 0; - k->aino = a; - if (a->uniq != uniq) - write_log("*** FS: Open file '%s' aino id %d != %d\n", p, uniq, a->uniq); + k->aino = a; + if (a->uniq != uniq) + write_log ("*** FS: Open file '%s' aino id %d != %d\n", p, uniq, a->uniq); if (!my_existsfile(pn)) { - write_log("*** FS: Open file '%s' is missing, creating dummy file!\n", p); + write_log ("*** FS: Open file '%s' is missing, creating dummy file!\n", p); k->fd = fs_open (u, pn, openmode | O_CREAT |O_BINARY); if (k->fd) { uae_u8 *buf = (uae_u8*)xcalloc (10000, 1); @@ -5081,24 +5376,24 @@ static uae_u8 *restore_key(UnitInfo *ui, Unit *u, uae_u8 *src) sp -= s; } xfree(buf); - write_log("*** FS: dummy file created\n"); + write_log ("*** FS: dummy file created\n"); } else { - write_log("*** FS: Open file '%s', couldn't create dummy file!\n", p); + write_log ("*** FS: Open file '%s', couldn't create dummy file!\n", p); } } else { k->fd = fs_open (u, pn, openmode | O_BINARY); } if (!k->fd) { - write_log("*** FS: Open file '%s' failed to open!\n", p); + write_log ("*** FS: Open file '%s' failed to open!\n", p); missing = 1; } else { size_t s; s = fs_lseek (u, k->fd, 0, SEEK_END); if (s != savedsize) - write_log("FS: restored file '%s' size changed! orig=%d, now=%d!!\n", p, savedsize, s); + write_log ("FS: restored file '%s' size changed! orig=%d, now=%d!!\n", p, savedsize, s); if (k->file_pos > s) { - write_log("FS: restored filepos larger than size of file '%s'!! %d > %d\n", p, k->file_pos, s); - k->file_pos = s; + write_log ("FS: restored filepos larger than size of file '%s'!! %d > %d\n", p, k->file_pos, s); + k->file_pos = s; } fs_lseek (u,k->fd, k->file_pos, SEEK_SET); } @@ -5133,7 +5428,7 @@ static uae_u8 *restore_notify(UnitInfo *ui, Unit *u, uae_u8 *src) hash = notifyhash (n->fullname); n->next = u->notifyhash[hash]; u->notifyhash[hash] = n; - write_log("FS: notify %08.8X '%s' '%s'\n", n->notifyrequest, n->fullname, n->partname); + write_log ("FS: notify %08.8X '%s' '%s'\n", n->notifyrequest, n->fullname, n->partname); return src; } @@ -5145,9 +5440,9 @@ static uae_u8 *restore_exkey(UnitInfo *ui, Unit *u, uae_u8 *src) return src; } -static uae_u8 *restore_filesys_virtual (UnitInfo *ui, uae_u8 *src) +static uae_u8 *restore_filesys_virtual (UnitInfo *ui, uae_u8 *src, int num) { - Unit *u = startup_create_unit (ui); + Unit *u = startup_create_unit (ui, num); int cnt; u->dosbase = restore_u32 (); @@ -5163,22 +5458,22 @@ static uae_u8 *restore_filesys_virtual (UnitInfo *ui, uae_u8 *src) u->volflags = ui->volflags; cnt = restore_u32 (); - write_log("FS: restoring %d locks\n", cnt); + write_log ("FS: restoring %d locks\n", cnt); while (cnt-- > 0) src = restore_aino(ui, u, src); cnt = restore_u32 (); - write_log("FS: restoring %d open files\n", cnt); + write_log ("FS: restoring %d open files\n", cnt); while (cnt-- > 0) src = restore_key(ui, u, src); cnt = restore_u32 (); - write_log("FS: restoring %d notifications\n", cnt); + write_log ("FS: restoring %d notifications\n", cnt); while (cnt-- > 0) src = restore_notify (ui, u, src); cnt = restore_u32 (); - write_log("FS: restoring %d exkeys\n", cnt); + write_log ("FS: restoring %d exkeys\n", cnt); while (cnt-- > 0) src = restore_exkey (ui, u, src); @@ -5218,7 +5513,7 @@ static int recurse_aino (UnitInfo *ui, a_inode *a, int cnt, uae_u8 **dstp) if (a->elock || a->shlock || a->uniq == 0) { if (dst) { char *fn = getfullaname(a); - write_log("%04x '%s' s=%d e=%d d=%d\n", a->uniq, fn, a->shlock, a->elock, a->dir); + write_log ("%04x '%s' s=%d e=%d d=%d\n", a->uniq, fn, a->shlock, a->elock, a->dir); save_u64 (a->uniq); save_u32 (a->locked_children); save_u32 (a->exnext_count); @@ -5255,8 +5550,8 @@ static uae_u8 *save_key(uae_u8 *dst, Key *k) save_u64 (k->aino->uniq); my_lseek(k->fd, k->file_pos, SEEK_SET); save_string (fn); - write_log("'%s' uniq=%d size=%d seekpos=%d mode=%d dosmode=%d\n", - fn, k->uniq, size, k->file_pos, k->createmode, k->dosmode); + write_log ("'%s' uniq=%d size=%d seekpos=%d mode=%d dosmode=%d\n", + fn, k->uniq, size, k->file_pos, k->createmode, k->dosmode); xfree(fn); return dst; } @@ -5269,7 +5564,7 @@ static uae_u8 *save_notify (UnitInfo *ui, uae_u8 *dst, Notify *n) if (strlen(s) >= strlen(ui->volname) && !memcmp(n->fullname, ui->volname, strlen(ui->volname))) s = n->fullname + strlen(ui->volname) + 1; save_string(s); - write_log("FS: notify %08.8X '%s'\n", n->notifyrequest, n->fullname); + write_log ("FS: notify %08.8X '%s'\n", n->notifyrequest, n->fullname); return dst; } @@ -5287,7 +5582,7 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) Key *k; int cnt, i, j; - write_log("FSSAVE: '%s'\n", ui->devname); + write_log ("FSSAVE: '%s'\n", ui->devname); save_u32 (u->dosbase); save_u32 (u->volume); save_u32 (u->port); @@ -5300,13 +5595,13 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) save_u32 (u->total_locked_ainos); cnt = recurse_aino (ui, &u->rootnode, 0, NULL); save_u32 (cnt); - write_log("%d open locks\n", cnt); + write_log ("%d open locks\n", cnt); cnt = recurse_aino (ui, &u->rootnode, 0, &dst); cnt = 0; for (k = u->keys; k; k = k->next) cnt++; save_u32 (cnt); - write_log("%d open files\n", cnt); + write_log ("%d open files\n", cnt); for (k = u->keys; k; k = k->next) dst = save_key (dst, k); for (j = 0; j < 2; j++) { @@ -5322,7 +5617,7 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) } if (j == 0) { save_u32 (cnt); - write_log("%d notify requests\n", cnt); + write_log ("%d notify requests\n", cnt); } } for (j = 0; j < 2; j++) { @@ -5337,10 +5632,10 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) } if (j == 0) { save_u32 (cnt); - write_log("%d exkeys\n", cnt); + write_log ("%d exkeys\n", cnt); } } - write_log("END\n"); + write_log ("END\n"); return dst; } @@ -5374,7 +5669,7 @@ uae_u8 *save_filesys (int num, int *len) int type = is_hardfile (num); ui = &mountinfo.ui[num]; - write_log("FS_FILESYS: '%s' '%s'\n", ui->devname, ui->volname); + write_log ("FS_FILESYS: '%s' '%s'\n", ui->devname, ui->volname); dstbak = dst = (uae_u8*)malloc (10000); save_u32 (2); /* version */ save_u32 (ui->devno); @@ -5424,7 +5719,7 @@ uae_u8 *restore_filesys (uae_u8 *src) goto end; } if (type == FILESYS_VIRTUAL) - src = restore_filesys_virtual (ui, src); + src = restore_filesys_virtual (ui, src, devno); end: xfree (rootdir); xfree (devname); diff --git a/filesys_bootrom.c b/filesys_bootrom.c index 43b9bb69..cdf6f0ad 100755 --- a/filesys_bootrom.c +++ b/filesys_bootrom.c @@ -1,35 +1,35 @@ db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); - db(0x60); db(0x00); db(0x06); db(0xb2); db(0x00); db(0x00); db(0x05); db(0x6e); + db(0x60); db(0x00); db(0x07); db(0x3e); db(0x00); db(0x00); db(0x05); db(0xfa); db(0x00); db(0x00); db(0x00); db(0x34); db(0x00); db(0x00); db(0x00); db(0xd4); db(0x00); db(0x00); db(0x00); db(0x20); db(0x00); db(0x00); db(0x01); db(0x8e); - db(0x00); db(0x00); db(0x08); db(0xc6); db(0x00); db(0x00); db(0x0a); db(0x54); - db(0x43); db(0xfa); db(0x0b); db(0xfc); db(0x4e); db(0xae); db(0xff); db(0xa0); + db(0x00); db(0x00); db(0x09); db(0x5e); db(0x00); db(0x00); db(0x0a); db(0xec); + db(0x43); db(0xfa); db(0x0c); db(0x94); db(0x4e); db(0xae); db(0xff); db(0xa0); db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x16); db(0x20); db(0x40); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xff); db(0xfe); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0xfc); - db(0x61); db(0x00); db(0x08); db(0x74); db(0x2a); db(0x50); db(0x43); db(0xfa); - db(0x0b); db(0xf4); db(0x70); db(0x24); db(0x7a); db(0x00); db(0x4e); db(0xae); + db(0x61); db(0x00); db(0x09); db(0x0c); db(0x2a); db(0x50); db(0x43); db(0xfa); + db(0x0c); db(0x8c); db(0x70); db(0x24); db(0x7a); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x66); db(0x0c); db(0x43); db(0xfa); - db(0x0b); db(0xe4); db(0x70); db(0x00); db(0x7a); db(0x01); db(0x4e); db(0xae); + db(0x0c); db(0x7c); db(0x70); db(0x00); db(0x7a); db(0x01); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x72); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x26); db(0x40); db(0x27); db(0x4c); db(0x01); db(0x9c); db(0x7c); db(0x00); db(0xbc); db(0xad); db(0x01); db(0x0c); db(0x64); db(0x24); db(0x2f); db(0x06); db(0x7e); db(0x01); db(0x2f); db(0x0b); db(0x20); db(0x4b); db(0x61); db(0x00); - db(0x04); db(0xe6); db(0x26); db(0x5f); db(0x0c); db(0x80); db(0xff); db(0xff); + db(0x05); db(0x72); db(0x26); db(0x5f); db(0x0c); db(0x80); db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xe4); db(0x2c); db(0x1f); db(0x52); db(0x46); db(0x60); db(0xd6); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x30); db(0x3c); db(0xff); db(0x80); - db(0x61); db(0x00); db(0x08); db(0x04); db(0x4e); db(0x90); db(0x72); db(0x03); + db(0x61); db(0x00); db(0x08); db(0x9c); db(0x4e); db(0x90); db(0x72); db(0x03); db(0x74); db(0xf6); db(0x20); db(0x7c); db(0x00); db(0x20); db(0x00); db(0x00); db(0x90); db(0x88); db(0x65); db(0x0a); db(0x67); db(0x08); db(0x78); db(0x00); db(0x22); db(0x44); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x4c); db(0xdf); db(0x7f); db(0xff); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x00); db(0x20); - db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x07); db(0xd8); + db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x08); db(0x70); db(0x70); db(0x00); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0xa0); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); - db(0xff); db(0x50); db(0x61); db(0x00); db(0x07); db(0xc2); db(0x70); db(0x02); + db(0xff); db(0x50); db(0x61); db(0x00); db(0x08); db(0x5a); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); db(0x00); db(0x01); db(0x6d); db(0x7a); db(0x6e); db(0x06); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0xe6); db(0x0c); db(0x40); db(0x00); db(0x02); db(0x6e); db(0x08); db(0x20); db(0x01); @@ -47,11 +47,11 @@ db(0x25); db(0x49); db(0x00); db(0x1a); db(0x20); db(0x69); db(0x00); db(0x10); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x00); db(0xff); db(0x76); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); - db(0x07); db(0x36); db(0x70); db(0x04); db(0x4e); db(0x90); db(0x70); db(0x01); + db(0x07); db(0xce); db(0x70); db(0x04); db(0x4e); db(0x90); db(0x70); db(0x01); db(0x4c); db(0xdf); db(0x04); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xc0); db(0xc0); db(0x70); db(0x1a); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); - db(0x41); db(0xfa); db(0x0a); db(0x6d); db(0x23); db(0x48); db(0x00); db(0x0a); + db(0x41); db(0xfa); db(0x0b); db(0x05); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x41); db(0xfa); db(0xff); db(0x2a); db(0x23); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xfa); db(0xff); db(0x22); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); db(0x02); db(0x14); db(0x00); db(0x08); db(0x70); db(0x03); @@ -64,7 +64,7 @@ db(0x00); db(0x00); db(0x00); db(0x0e); db(0x52); db(0x40); db(0x0c); db(0x40); db(0x00); db(0x8c); db(0x66); db(0xf2); db(0x20); db(0x0a); db(0xe4); db(0x88); db(0x21); db(0x40); db(0x00); db(0x36); db(0x22); db(0x48); db(0x41); db(0xfa); - db(0x0a); db(0x07); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x20); db(0x6b); + db(0x0a); db(0x9f); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x20); db(0x6b); db(0x01); db(0x98); db(0x41); db(0xe8); db(0x00); db(0x12); db(0x4e); db(0xae); db(0xff); db(0x10); db(0x4c); db(0xdf); db(0x4f); db(0x03); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x7f); db(0x7e); db(0x2c); db(0x78); db(0x00); db(0x04); @@ -105,13 +105,13 @@ db(0x60); db(0xd4); db(0x48); db(0xe7); db(0x40); db(0xe2); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x41); db(0xee); db(0x01); db(0x50); db(0x20); db(0x50); db(0x4a); db(0x90); db(0x67); db(0x1a); db(0x22); db(0x68); db(0x00); db(0x0a); - db(0x45); db(0xfa); db(0x08); db(0xfc); db(0x10); db(0x19); db(0x12); db(0x1a); + db(0x45); db(0xfa); db(0x09); db(0x94); db(0x10); db(0x19); db(0x12); db(0x1a); db(0xb0); db(0x01); db(0x66); db(0x06); db(0x4a); db(0x00); db(0x67); db(0x42); db(0x60); db(0xf2); db(0x20); db(0x50); db(0x60); db(0xe2); db(0x70); db(0x20); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x24); db(0x40); db(0x15); db(0x7c); db(0x00); db(0x08); - db(0x00); db(0x08); db(0x41); db(0xfa); db(0x08); db(0xd2); db(0x25); db(0x48); - db(0x00); db(0x0a); db(0x41); db(0xfa); db(0x08); db(0x8b); db(0x25); db(0x48); + db(0x00); db(0x08); db(0x41); db(0xfa); db(0x09); db(0x6a); db(0x25); db(0x48); + db(0x00); db(0x0a); db(0x41); db(0xfa); db(0x09); db(0x23); db(0x25); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xea); db(0x00); db(0x12); db(0x20); db(0x88); db(0x58); db(0x90); db(0x21); db(0x48); db(0x00); db(0x08); db(0x41); db(0xee); db(0x01); db(0x50); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xff); db(0x0a); @@ -167,104 +167,123 @@ db(0xff); db(0x62); db(0x60); db(0x14); db(0x4a); db(0x2b); db(0x00); db(0x4c); db(0x67); db(0x0e); db(0x42); db(0x2b); db(0x00); db(0x4c); db(0x61); db(0x00); db(0xfe); db(0xda); db(0x70); db(0x00); db(0x61); db(0x00); db(0xff); db(0x4c); - db(0x4e); db(0x75); db(0x4a); db(0xa8); db(0x00); db(0x14); db(0x67); db(0x08); + db(0x4e); db(0x75); db(0x4a); db(0xac); db(0x00); db(0x14); db(0x67); db(0x08); db(0x70); db(0x00); db(0x61); db(0x00); db(0xff); db(0xb8); db(0x4e); db(0x75); db(0x70); db(0x01); db(0x61); db(0x00); db(0xff); db(0xb0); db(0x4e); db(0x75); db(0x4a); db(0x2b); db(0x00); db(0xac); db(0x6b); db(0x08); db(0x70); db(0x01); db(0x61); db(0x00); db(0xff); db(0xa2); db(0x4e); db(0x75); db(0x70); db(0x00); - db(0x61); db(0x00); db(0xff); db(0x9a); db(0x4e); db(0x75); db(0x61); db(0x00); - db(0xfd); db(0xca); db(0x21); db(0x40); db(0x01); db(0x98); db(0x2f); db(0x08); - db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x03); db(0x38); - db(0x2a); db(0x50); db(0x30); db(0x3c); db(0xff); db(0x28); db(0x61); db(0x00); - db(0x03); db(0x2e); db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); - db(0x01); db(0x90); db(0x42); db(0xa8); db(0x01); db(0x94); db(0x4e); db(0x91); - db(0x26); db(0x00); db(0x0c); db(0x83); db(0xff); db(0xff); db(0xff); db(0xfe); - db(0x67); db(0x00); db(0xfb); db(0x30); db(0x0c); db(0x83); db(0x00); db(0x00); - db(0x00); db(0x02); db(0x67); db(0x0c); db(0xc0); db(0x85); db(0x67); db(0x08); - db(0x4a); db(0xa8); db(0x01); db(0x90); db(0x67); db(0x00); db(0xfb); db(0x1c); - db(0x20); db(0x28); db(0x01); db(0x90); db(0x67); db(0x12); db(0x2f); db(0x08); - db(0x72); db(0x01); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); - db(0xff); db(0x3a); db(0x20); db(0x5f); db(0x21); db(0x40); db(0x01); db(0x94); - db(0x4a); db(0x83); db(0x6a); db(0x10); db(0x22); db(0x48); db(0x30); db(0x3c); - db(0xff); db(0x20); db(0x61); db(0x00); db(0x02); db(0xda); db(0x4e); db(0x90); - db(0x60); db(0x00); db(0x00); db(0x28); db(0x2c); db(0x4c); db(0x2f); db(0x08); - db(0x4e); db(0xae); db(0xff); db(0x70); db(0x20); db(0x5f); db(0x22); db(0x48); - db(0x26); db(0x40); db(0x30); db(0x3c); db(0xff); db(0x20); db(0x61); db(0x00); - db(0x02); db(0xbe); db(0x4e); db(0x90); db(0x70); db(0x00); db(0x27); db(0x40); - db(0x00); db(0x08); db(0x27); db(0x40); db(0x00); db(0x10); db(0x27); db(0x40); - db(0x00); db(0x20); db(0x4a); db(0xa9); db(0x01); db(0x94); db(0x67); db(0x28); - db(0x20); db(0x69); db(0x01); db(0x94); db(0x61); db(0x00); db(0xfc); db(0x0a); - db(0x48); db(0xe7); db(0x80); db(0xc0); db(0x20); db(0x29); db(0x01); db(0x90); - db(0x22); db(0x69); db(0x01); db(0x94); db(0x2c); db(0x78); db(0x00); db(0x04); - db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x4c); db(0xdf); db(0x03); db(0x01); - db(0x4a); db(0x80); db(0x67); db(0x04); db(0x61); db(0x00); db(0xfb); db(0x94); - db(0x4a); db(0x83); db(0x6b); db(0x00); db(0xfa); db(0x96); db(0x30); db(0x3c); - db(0xff); db(0x18); db(0x61); db(0x00); db(0x02); db(0x72); db(0x4e); db(0x90); - db(0x20); db(0x03); db(0x16); db(0x29); db(0x00); db(0x4f); db(0x4a); db(0x80); - db(0x66); db(0x1a); db(0x27); db(0x7c); db(0x00); db(0x00); db(0x0f); db(0xa0); - db(0x00); db(0x14); db(0x43); db(0xfa); db(0xf9); db(0xa0); db(0x20); db(0x09); - db(0xe4); db(0x88); db(0x27); db(0x40); db(0x00); db(0x20); db(0x70); db(0xff); - db(0x27); db(0x40); db(0x00); db(0x24); db(0x4a); db(0x87); db(0x67); db(0x36); - db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x14); db(0x72); db(0x00); - db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); db(0x70); db(0x00); - db(0x22); db(0x80); db(0x23); db(0x40); db(0x00); db(0x04); db(0x33); db(0x40); - db(0x00); db(0x0e); db(0x30); db(0x3c); db(0x10); db(0x00); db(0x80); db(0x03); - db(0x33); db(0x40); db(0x00); db(0x08); db(0x23); db(0x6d); db(0x01); db(0x04); - db(0x00); db(0x0a); db(0x23); db(0x4b); db(0x00); db(0x10); db(0x41); db(0xec); - db(0x00); db(0x4a); db(0x4e); db(0xee); db(0xfe); db(0xf2); db(0x20); db(0x4b); - db(0x72); db(0x00); db(0x22); db(0x41); db(0x70); db(0xff); db(0x2c); db(0x4c); - db(0x4e); db(0xee); db(0xff); db(0x6a); db(0x2c); db(0x78); db(0x00); db(0x04); - db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x20); db(0x40); - db(0x4b); db(0xe8); db(0x00); db(0x5c); db(0x43); db(0xfa); db(0x05); db(0x58); - db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x24); db(0x40); - db(0x20); db(0x3c); db(0x00); db(0x00); db(0x00); db(0xb5); db(0x22); db(0x3c); - db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); - db(0x26); db(0x40); db(0x7c); db(0x00); db(0x26); db(0x86); db(0x27); db(0x46); - db(0x00); db(0x04); db(0x27); db(0x46); db(0x00); db(0x08); db(0x27); db(0x4a); - db(0x00); db(0xa0); db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); - db(0x27); db(0x40); db(0x00); db(0xb0); db(0x61); db(0x00); db(0x02); db(0x98); - db(0x27); db(0x40); db(0x00); db(0xa4); db(0x61); db(0x00); db(0x02); db(0xc4); - db(0x27); db(0x40); db(0x00); db(0xa8); db(0x7a); db(0x00); db(0x20); db(0x4d); - db(0x4e); db(0xae); db(0xfe); db(0x80); db(0x20); db(0x4d); db(0x4e); db(0xae); - db(0xfe); db(0x8c); db(0x28); db(0x40); db(0x26); db(0x2c); db(0x00); db(0x0a); - db(0x30); db(0x3c); db(0xff); db(0x40); db(0x61); db(0x00); db(0x01); db(0x90); - db(0x70); db(0x00); db(0x4e); db(0x90); db(0x61); db(0x00); db(0xfc); db(0x7c); - db(0x61); db(0x00); db(0x03); db(0x26); db(0x60); db(0x00); db(0x01); db(0x0c); - db(0x61); db(0x00); db(0x03); db(0x1e); db(0x20); db(0x4d); db(0x4e); db(0xae); - db(0xfe); db(0x8c); db(0x28); db(0x40); db(0x4a); db(0x80); db(0x66); db(0x10); - db(0x70); db(0x00); db(0x12); db(0x2d); db(0x00); db(0x0f); db(0x03); db(0xc0); - db(0x08); db(0xc0); db(0x00); db(0x11); db(0x4e); db(0xae); db(0xfe); db(0xc2); - db(0x4a); db(0x2b); db(0x00); db(0xac); db(0x67); db(0x08); db(0x61); db(0x00); - db(0xfd); db(0xf8); db(0x42); db(0x2b); db(0x00); db(0xac); db(0x20); db(0x0c); - db(0x67); db(0xce); db(0x0c); db(0x6c); db(0x00); db(0x26); db(0x00); db(0x12); - db(0x66); db(0x4c); db(0x0c); db(0xac); db(0x40); db(0x00); db(0x00); db(0x00); - db(0x00); db(0x14); db(0x66); db(0x42); db(0x0c); db(0x6c); db(0x12); db(0x34); - db(0x00); db(0x18); db(0x66); db(0x3a); db(0x20); db(0x6c); db(0x00); db(0x1a); - db(0x20); db(0x28); db(0x00); db(0x0c); db(0x02); db(0x80); db(0x80); db(0x00); - db(0x00); db(0x08); db(0x0c); db(0x80); db(0x80); db(0x00); db(0x00); db(0x08); - db(0x66); db(0x18); db(0x02); db(0xa8); db(0x7f); db(0xff); db(0xff); db(0xff); - db(0x00); db(0x0c); db(0x20); db(0x68); db(0x00); db(0x10); db(0x22); db(0x4c); - db(0x12); db(0xbc); db(0x00); db(0x08); db(0x4e); db(0xae); db(0xfe); db(0x92); - db(0x60); db(0x86); db(0x22); db(0x4c); db(0x70); db(0x26); db(0x4e); db(0xae); - db(0xff); db(0x2e); db(0x60); db(0x00); db(0xff); db(0x7c); db(0x26); db(0x2c); - db(0x00); db(0x0a); db(0x66); db(0x3e); db(0x30); db(0x3c); db(0xff); db(0x50); - db(0x61); db(0x00); db(0x00); db(0xec); db(0x70); db(0x01); db(0x4e); db(0x90); - db(0x45); db(0xeb); db(0x00); db(0x04); db(0x20); db(0x52); db(0x20); db(0x08); - db(0x67); db(0x00); db(0xff); db(0x5e); db(0x22); db(0x50); db(0x20); db(0x40); - db(0x20); db(0x28); db(0x00); db(0x04); db(0x6a); db(0x16); db(0x48); db(0xe7); - db(0x00); db(0xc0); db(0x28); db(0x68); db(0x00); db(0x0a); db(0x61); db(0x5a); - db(0x53); db(0x85); db(0x4c); db(0xdf); db(0x03); db(0x00); db(0x24); db(0x89); - db(0x20); db(0x49); db(0x60); db(0xda); db(0x24); db(0x48); db(0x20); db(0x49); - db(0x60); db(0xd4); db(0x0c); db(0x85); db(0x00); db(0x00); db(0x00); db(0x14); - db(0x65); db(0x00); db(0x00); db(0x0a); db(0x70); db(0x01); db(0x29); db(0x40); - db(0x00); db(0x04); db(0x60); db(0x12); db(0x61); db(0x42); db(0x30); db(0x3c); - db(0xff); db(0x30); db(0x61); db(0x00); db(0x00); db(0x9a); db(0x4e); db(0x90); - db(0x4a); db(0x80); db(0x67); db(0x0e); db(0x52); db(0x85); db(0x28); db(0xab); - db(0x00); db(0x04); db(0x27); db(0x4c); db(0x00); db(0x04); db(0x60); db(0x00); - db(0xff); db(0x08); db(0x20); db(0x43); db(0x0c); db(0xa8); db(0x00); db(0x00); - db(0x00); db(0x1f); db(0x00); db(0x08); db(0x66); db(0xf4); db(0x61); db(0x00); - db(0xfd); db(0x02); db(0x28); db(0x43); db(0x61); db(0x04); db(0x60); db(0x00); - db(0xfe); db(0xf0); db(0x22); db(0x54); db(0x20); db(0x6c); db(0x00); db(0x04); + db(0x61); db(0x00); db(0xff); db(0x9a); db(0x4e); db(0x75); db(0x20); db(0x6c); + db(0x00); db(0x24); db(0x4a); db(0xa8); db(0x00); db(0x08); db(0x66); db(0x08); + db(0x4a); db(0xa8); db(0x00); db(0x0c); db(0x66); db(0x02); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0x3f); db(0x3e); db(0x2a); db(0x48); db(0x24); db(0x6c); + db(0x00); db(0x18); db(0x2e); db(0x15); db(0x4a); db(0x87); db(0x67); db(0x64); + db(0x20); db(0x0a); db(0x67); db(0x60); db(0x7c); db(0x00); db(0x22); db(0x2d); + db(0x00); db(0x08); db(0x67); db(0x12); db(0x24); db(0x2a); db(0x00); db(0x04); + db(0x2c); db(0x6b); db(0x00); db(0xa0); db(0x4e); db(0xae); db(0xfc); db(0x34); + db(0x4a); db(0x80); db(0x66); db(0x02); db(0x50); db(0xc6); db(0x22); db(0x2d); + db(0x00); db(0x0c); db(0x67); db(0x1c); db(0x20); db(0x41); db(0x22); db(0x4a); + db(0x2f); db(0x0a); db(0x45); db(0xec); db(0x00); db(0x20); db(0x48); db(0x7a); + db(0x00); db(0x08); db(0x2f); db(0x28); db(0x00); db(0x08); db(0x4e); db(0x75); + db(0x24); db(0x5f); db(0x4a); db(0x80); db(0x66); db(0x02); db(0x50); db(0xc6); + db(0x4a); db(0x06); db(0x67); db(0x1a); db(0x20); db(0x2a); db(0x00); db(0x04); + db(0x90); db(0x8a); db(0x4a); db(0x92); db(0x67); db(0x0a); db(0x20); db(0x52); + db(0x22); db(0x4a); db(0x22); db(0xd8); db(0x59); db(0x81); db(0x6a); db(0xfa); + db(0x53); db(0x95); db(0x53); db(0x87); db(0x60); db(0x9e); db(0x24); db(0x52); + db(0x53); db(0x87); db(0x60); db(0x98); db(0x4c); db(0xdf); db(0x7c); db(0xfc); + db(0x4e); db(0x75); db(0x61); db(0x00); db(0xfd); db(0x3e); db(0x21); db(0x40); + db(0x01); db(0x98); db(0x2f); db(0x08); db(0x30); db(0x3c); db(0xff); db(0xfc); + db(0x61); db(0x00); db(0x03); db(0x44); db(0x2a); db(0x50); db(0x30); db(0x3c); + db(0xff); db(0x28); db(0x61); db(0x00); db(0x03); db(0x3a); db(0x22); db(0x48); + db(0x20); db(0x5f); db(0x42); db(0xa8); db(0x01); db(0x90); db(0x42); db(0xa8); + db(0x01); db(0x94); db(0x4e); db(0x91); db(0x26); db(0x00); db(0x0c); db(0x83); + db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x00); db(0xfa); db(0xa4); + db(0x0c); db(0x83); db(0x00); db(0x00); db(0x00); db(0x02); db(0x67); db(0x0c); + db(0xc0); db(0x85); db(0x67); db(0x08); db(0x4a); db(0xa8); db(0x01); db(0x90); + db(0x67); db(0x00); db(0xfa); db(0x90); db(0x20); db(0x28); db(0x01); db(0x90); + db(0x67); db(0x12); db(0x2f); db(0x08); db(0x72); db(0x01); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x5f); + db(0x21); db(0x40); db(0x01); db(0x94); db(0x4a); db(0x83); db(0x6a); db(0x10); + db(0x22); db(0x48); db(0x30); db(0x3c); db(0xff); db(0x20); db(0x61); db(0x00); + db(0x02); db(0xe6); db(0x4e); db(0x90); db(0x60); db(0x00); db(0x00); db(0x28); + db(0x2c); db(0x4c); db(0x2f); db(0x08); db(0x4e); db(0xae); db(0xff); db(0x70); + db(0x20); db(0x5f); db(0x22); db(0x48); db(0x26); db(0x40); db(0x30); db(0x3c); + db(0xff); db(0x20); db(0x61); db(0x00); db(0x02); db(0xca); db(0x4e); db(0x90); + db(0x70); db(0x00); db(0x27); db(0x40); db(0x00); db(0x08); db(0x27); db(0x40); + db(0x00); db(0x10); db(0x27); db(0x40); db(0x00); db(0x20); db(0x4a); db(0xa9); + db(0x01); db(0x94); db(0x67); db(0x28); db(0x20); db(0x69); db(0x01); db(0x94); + db(0x61); db(0x00); db(0xfb); db(0x7e); db(0x48); db(0xe7); db(0x80); db(0xc0); + db(0x20); db(0x29); db(0x01); db(0x90); db(0x22); db(0x69); db(0x01); db(0x94); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x2e); + db(0x4c); db(0xdf); db(0x03); db(0x01); db(0x4a); db(0x80); db(0x67); db(0x04); + db(0x61); db(0x00); db(0xfb); db(0x08); db(0x4a); db(0x83); db(0x6b); db(0x00); + db(0xfa); db(0x0a); db(0x30); db(0x3c); db(0xff); db(0x18); db(0x61); db(0x00); + db(0x02); db(0x7e); db(0x4e); db(0x90); db(0x20); db(0x03); db(0x16); db(0x29); + db(0x00); db(0x4f); db(0x4a); db(0x80); db(0x66); db(0x1a); db(0x27); db(0x7c); + db(0x00); db(0x00); db(0x0f); db(0xa0); db(0x00); db(0x14); db(0x43); db(0xfa); + db(0xf9); db(0x14); db(0x20); db(0x09); db(0xe4); db(0x88); db(0x27); db(0x40); + db(0x00); db(0x20); db(0x70); db(0xff); db(0x27); db(0x40); db(0x00); db(0x24); + db(0x4a); db(0x87); db(0x67); db(0x36); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x70); db(0x14); db(0x72); db(0x00); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x22); db(0x40); db(0x70); db(0x00); db(0x22); db(0x80); db(0x23); db(0x40); + db(0x00); db(0x04); db(0x33); db(0x40); db(0x00); db(0x0e); db(0x30); db(0x3c); + db(0x10); db(0x00); db(0x80); db(0x03); db(0x33); db(0x40); db(0x00); db(0x08); + db(0x23); db(0x6d); db(0x01); db(0x04); db(0x00); db(0x0a); db(0x23); db(0x4b); + db(0x00); db(0x10); db(0x41); db(0xec); db(0x00); db(0x4a); db(0x4e); db(0xee); + db(0xfe); db(0xf2); db(0x20); db(0x4b); db(0x72); db(0x00); db(0x22); db(0x41); + db(0x70); db(0xff); db(0x2c); db(0x4c); db(0x4e); db(0xee); db(0xff); db(0x6a); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x93); db(0xc9); db(0x4e); db(0xae); + db(0xfe); db(0xda); db(0x20); db(0x40); db(0x4b); db(0xe8); db(0x00); db(0x5c); + db(0x43); db(0xfa); db(0x05); db(0x64); db(0x70); db(0x00); db(0x4e); db(0xae); + db(0xfd); db(0xd8); db(0x24); db(0x40); db(0x20); db(0x3c); db(0x00); db(0x00); + db(0x00); db(0xb5); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x26); db(0x40); db(0x7c); db(0x00); + db(0x26); db(0x86); db(0x27); db(0x46); db(0x00); db(0x04); db(0x27); db(0x46); + db(0x00); db(0x08); db(0x27); db(0x4a); db(0x00); db(0xa0); db(0x93); db(0xc9); + db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x27); db(0x40); db(0x00); db(0xb0); + db(0x61); db(0x00); db(0x02); db(0xa4); db(0x27); db(0x40); db(0x00); db(0xa4); + db(0x61); db(0x00); db(0x02); db(0xd0); db(0x27); db(0x40); db(0x00); db(0xa8); + db(0x7a); db(0x00); db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x80); + db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x8c); db(0x28); db(0x40); + db(0x26); db(0x2c); db(0x00); db(0x0a); db(0x30); db(0x3c); db(0xff); db(0x40); + db(0x61); db(0x00); db(0x01); db(0x9c); db(0x70); db(0x00); db(0x4e); db(0x90); + db(0x61); db(0x00); db(0xfb); db(0xf0); db(0x61); db(0x00); db(0x03); db(0x32); + db(0x60); db(0x00); db(0x00); db(0xfc); db(0x61); db(0x00); db(0x03); db(0x2a); + db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x8c); db(0x28); db(0x40); + db(0x4a); db(0x80); db(0x66); db(0x10); db(0x70); db(0x00); db(0x12); db(0x2d); + db(0x00); db(0x0f); db(0x03); db(0xc0); db(0x08); db(0xc0); db(0x00); db(0x11); + db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x4a); db(0x2b); db(0x00); db(0xac); + db(0x67); db(0x08); db(0x61); db(0x00); db(0xfd); db(0x6c); db(0x42); db(0x2b); + db(0x00); db(0xac); db(0x20); db(0x0c); db(0x67); db(0xce); db(0x0c); db(0x6c); + db(0x00); db(0x26); db(0x00); db(0x12); db(0x66); db(0x4c); db(0x0c); db(0xac); + db(0x40); db(0x00); db(0x00); db(0x00); db(0x00); db(0x14); db(0x66); db(0x42); + db(0x0c); db(0x6c); db(0x12); db(0x34); db(0x00); db(0x18); db(0x66); db(0x3a); + db(0x20); db(0x6c); db(0x00); db(0x1a); db(0x20); db(0x28); db(0x00); db(0x0c); + db(0x02); db(0x80); db(0x80); db(0x00); db(0x00); db(0x08); db(0x0c); db(0x80); + db(0x80); db(0x00); db(0x00); db(0x08); db(0x66); db(0x18); db(0x02); db(0xa8); + db(0x7f); db(0xff); db(0xff); db(0xff); db(0x00); db(0x0c); db(0x20); db(0x68); + db(0x00); db(0x10); db(0x22); db(0x4c); db(0x12); db(0xbc); db(0x00); db(0x08); + db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x86); db(0x22); db(0x4c); + db(0x70); db(0x26); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x60); db(0x00); + db(0xff); db(0x7c); db(0x26); db(0x2c); db(0x00); db(0x0a); db(0x66); db(0x3e); + db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x00); db(0xf8); + db(0x70); db(0x01); db(0x4e); db(0x90); db(0x45); db(0xeb); db(0x00); db(0x04); + db(0x20); db(0x52); db(0x20); db(0x08); db(0x67); db(0x00); db(0xff); db(0x5e); + db(0x22); db(0x50); db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x04); + db(0x6a); db(0x16); db(0x48); db(0xe7); db(0x00); db(0xc0); db(0x28); db(0x68); + db(0x00); db(0x0a); db(0x61); db(0x4a); db(0x53); db(0x85); db(0x4c); db(0xdf); + db(0x03); db(0x00); db(0x24); db(0x89); db(0x20); db(0x49); db(0x60); db(0xda); + db(0x24); db(0x48); db(0x20); db(0x49); db(0x60); db(0xd4); db(0x0c); db(0x85); + db(0x00); db(0x00); db(0x00); db(0x14); db(0x65); db(0x00); db(0x00); db(0x0a); + db(0x70); db(0x01); db(0x29); db(0x40); db(0x00); db(0x04); db(0x60); db(0x12); + db(0x61); db(0x4e); db(0x30); db(0x3c); db(0xff); db(0x30); db(0x61); db(0x00); + db(0x00); db(0xa6); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0x0e); + db(0x52); db(0x85); db(0x28); db(0xab); db(0x00); db(0x04); db(0x27); db(0x4c); + db(0x00); db(0x04); db(0x60); db(0x00); db(0xff); db(0x08); db(0x28); db(0x43); + db(0x61); db(0x04); db(0x60); db(0x00); db(0xff); db(0x00); db(0x0c); db(0xac); + db(0x00); db(0x00); db(0x00); db(0x1f); db(0x00); db(0x08); db(0x66); db(0x04); + db(0x61); db(0x00); db(0xfc); db(0x70); db(0x0c); db(0xac); db(0x00); db(0x00); + db(0x04); db(0x09); db(0x00); db(0x08); db(0x66); db(0x04); db(0x61); db(0x00); + db(0xfc); db(0x8e); db(0x22); db(0x54); db(0x20); db(0x6c); db(0x00); db(0x04); db(0x29); db(0x4d); db(0x00); db(0x04); db(0x4e); db(0xee); db(0xfe); db(0x92); db(0x2f); db(0x05); db(0x7a); db(0xfc); db(0x24); db(0x53); db(0x2e); db(0x0a); db(0x22); db(0x0a); db(0x67); db(0x00); db(0x00); db(0x0c); db(0x52); db(0x85); @@ -278,7 +297,7 @@ db(0x70); db(0x18); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x06); db(0x86); db(0x00); db(0x01); db(0x00); db(0x00); db(0x20); db(0x0a); db(0x66); db(0xec); db(0x26); db(0x87); db(0x2a); db(0x1f); db(0x4e); db(0x75); db(0x41); db(0xfa); - db(0xf7); db(0x3c); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); + db(0xf6); db(0xa4); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); db(0xd1); db(0xc0); db(0x4e); db(0x75); db(0x00); db(0x00); db(0x0c); db(0xaf); db(0x00); db(0x00); db(0x00); db(0x22); db(0x00); db(0x08); db(0x66); db(0x30); db(0x48); db(0xe7); db(0xc0); db(0xe2); db(0x2c); db(0x78); db(0x00); db(0x04); diff --git a/fpp.c b/fpp.c index b7cb0adb..04c8b7ff 100755 --- a/fpp.c +++ b/fpp.c @@ -5,7 +5,7 @@ * * Copyright 1996 Herman ten Brugge * Modified 2005 Peter Keunecke - */ + */ #define __USE_ISOC9X /* We might be able to pick up a NaN */ @@ -144,29 +144,29 @@ static void fpu_op_illg (uae_u32 opcode, struct regstruct *regs, int pcoffset) || (currprefs.cpu_model == 68040 && currprefs.fpu_model == 0)) { /* 68040 unimplemented/68060 FPU disabled exception. * Line F exception with different stack frame.. */ - uaecptr newpc = m68k_getpc(regs); + uaecptr newpc = m68k_getpc (regs); uaecptr oldpc = newpc - pcoffset; MakeSR(regs); - if (!regs->s) { - regs->usp = m68k_areg(regs, 7); - m68k_areg(regs, 7) = regs->isp; + if (!regs->s) { + regs->usp = m68k_areg (regs, 7); + m68k_areg (regs, 7) = regs->isp; } regs->s = 1; - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), oldpc); - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), oldpc); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x4000 + 11 * 4); - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), newpc); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), regs->sr); - write_log("68040/060 FPU disabled exception PC=%x\n", newpc); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), oldpc); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), oldpc); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x4000 + 11 * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), newpc); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), regs->sr); + write_log("68040/060 FPU disabled exception PC=%x\n", newpc); newpc = get_long (regs->vbr + 11 * 4); - m68k_setpc(regs, newpc); - set_special(regs, SPCFLAG_END_COMPILE); - return; + m68k_setpc (regs, newpc); + set_special (regs, SPCFLAG_END_COMPILE); + return; } op_illg (opcode, regs); } @@ -206,7 +206,7 @@ static int get_fpu_version(void) #define fp_round_to_zero(x) ((int)(x)) #define fp_round_to_nearest(x) ((int)((x) + 0.5)) -STATIC_INLINE tointtype toint(fptype src, fptype minval, fptype maxval) +STATIC_INLINE tointtype toint (fptype src, fptype minval, fptype maxval) { if (src < minval) src = minval; @@ -225,7 +225,7 @@ STATIC_INLINE tointtype toint(fptype src, fptype minval, fptype maxval) #else /* no X86_MSVC */ switch (get_fpcr() & 0x30) { case FPCR_ROUND_ZERO: - result = fp_round_to_zero(src); + result = fp_round_to_zero(src); break; case FPCR_ROUND_MINF: result = fp_round_to_minus_infinity(src); @@ -378,16 +378,17 @@ STATIC_INLINE int get_fp_value (uae_u32 opcode, uae_u16 extra, fptype *src) uae_u16 tmp; int size, mode, reg; uae_u32 ad = 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 }; + static const int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 }; + static const int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 }; if (!(extra & 0x4000)) { *src = regs.fp[(extra >> 10) & 7]; return 1; } - reg = opcode & 7; mode = (opcode >> 3) & 7; + reg = opcode & 7; size = (extra >> 10) & 7; + switch (mode) { case 0: switch (size) { @@ -525,15 +526,15 @@ STATIC_INLINE int put_fp_value (struct regstruct *regs, fptype value, uae_u32 op case 0: switch (size) { case 6: - m68k_dreg (regs, reg) = (uae_u32)(((toint(value, -128.0, 127.0) & 0xff) + m68k_dreg (regs, reg) = (uae_u32)(((toint (value, -128.0, 127.0) & 0xff) | (m68k_dreg (regs, reg) & ~0xff))); break; case 4: - m68k_dreg (regs, reg) = (uae_u32)(((toint(value, -32768.0, 32767.0) & 0xffff) + m68k_dreg (regs, reg) = (uae_u32)(((toint (value, -32768.0, 32767.0) & 0xffff) | (m68k_dreg (regs, reg) & ~0xffff))); break; case 0: - m68k_dreg (regs, reg) = (uae_u32)toint(value, -2147483648.0, 2147483647.0); + m68k_dreg (regs, reg) = (uae_u32)toint (value, -2147483648.0, 2147483647.0); break; case 1: m68k_dreg (regs, reg) = from_single (value); @@ -588,7 +589,7 @@ STATIC_INLINE int put_fp_value (struct regstruct *regs, fptype value, uae_u32 op } switch (size) { case 0: - put_long (ad, (uae_u32)toint(value, -2147483648.0, 2147483647.0)); + put_long (ad, (uae_u32)toint (value, -2147483648.0, 2147483647.0)); break; case 1: put_long (ad, from_single (value)); @@ -616,7 +617,7 @@ STATIC_INLINE int put_fp_value (struct regstruct *regs, fptype value, uae_u32 op } break; case 4: - put_word (ad, (uae_s16) toint(value, -32768.0, 32767.0)); + put_word (ad, (uae_s16) toint (value, -32768.0, 32767.0)); break; case 5:{ uae_u32 wrd1, wrd2; @@ -627,7 +628,7 @@ STATIC_INLINE int put_fp_value (struct regstruct *regs, fptype value, uae_u32 op } break; case 6: - put_byte (ad, (uae_s8)toint(value, -128.0, 127.0)); + put_byte (ad, (uae_s8)toint (value, -128.0, 127.0)); break; default: return 0; @@ -1144,7 +1145,7 @@ void fpuop_arithmetic (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) return; } if((opcode & 0x38) == 0x20) { - if (extra & 0x1000) + if (extra & 0x1000) incr += 4; if (extra & 0x0800) incr += 4; @@ -1395,7 +1396,7 @@ void fpuop_arithmetic (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) case 0x01: /* FINT */ /* need to take the current rounding mode into account */ #if defined(X86_MSVC_ASSEMBLY) - { + { fptype tmp_fp; __asm { @@ -1639,7 +1640,7 @@ uae_u8 *restore_fpu (uae_u8 *src) restore_u32(); restore_u32(); } - write_log("FPU=%d\n", currprefs.fpu_model); + write_log ("FPU=%d\n", currprefs.fpu_model); return src; } diff --git a/fsusage.c b/fsusage.c index fc62da14..1ae4e0ee 100755 --- a/fsusage.c +++ b/fsusage.c @@ -55,7 +55,7 @@ int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp) ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; if (!GetFullPathName (path, sizeof buf2, buf2, NULL)) { - write_log("GetFullPathName() failed err=%d\n", GetLastError()); + write_log ("GetFullPathName() failed err=%d\n", GetLastError()); return -1; } @@ -75,7 +75,7 @@ int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp) if (!GetDiskFreeSpaceEx (buf2, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) { - write_log("GetDiskFreeSpaceEx() failed err=%d\n", GetLastError()); + write_log ("GetDiskFreeSpaceEx() failed err=%d\n", GetLastError()); return -1; } diff --git a/gayle.c b/gayle.c index 09978f37..3bc105bb 100755 --- a/gayle.c +++ b/gayle.c @@ -32,8 +32,8 @@ D90000 to D9FFFF 64 KB ARCNET chip select DA0000 to DA3FFF 16 KB IDE drive DA4000 to DA4FFF 16 KB IDE reserved DA8000 to DAFFFF 32 KB Credit Card and IDE configregisters -DB0000 to DBFFFF 64 KB Not used(reserved for external IDE) -* DC0000 to DCFFFF 64 KB Real Time Clock(RTC) +DB0000 to DBFFFF 64 KB Not used (reserved for external IDE) +* DC0000 to DCFFFF 64 KB Real Time Clock (RTC) DD0000 to DDFFFF 64 KB A3000 DMA controller DD0000 to DD1FFF A4000 DMAC DD2000 to DDFFFF A4000 IDE @@ -58,7 +58,7 @@ DE0000 to DEFFFF 64 KB Motherboard resources #define GAYLE_ADDRESS (0xda8000) /* gayle main registers base address */ #define GAYLE_RESET (0xa40000) /* write 0x00 to start reset, - read 1 byte to stop reset */ + read 1 byte to stop reset */ /* GAYLE_CARDSTATUS bit def */ #define GAYLE_CS_CCDET 0x40 /* credit card detect */ #define GAYLE_CS_BVD1 0x20 /* battery voltage detect 1 */ @@ -70,15 +70,15 @@ DE0000 to DEFFFF 64 KB Motherboard resources #define GAYLE_CS_IRQ 0x04 /* interrupt request */ /* GAYLE_CONFIG bit def - (bit 0-1 for program voltage, bit 2-3 for access speed */ + (bit 0-1 for program voltage, bit 2-3 for access speed */ #define GAYLE_CFG_0V 0x00 #define GAYLE_CFG_5V 0x01 #define GAYLE_CFG_12V 0x02 #define GAYLE_CFG_100NS 0x08 #define GAYLE_CFG_150NS 0x04 -#define GAYLE_CFG_250NS 0x00 -#define GAYLE_CFG_720NS 0x0c +#define GAYLE_CFG_250NS 0x00 +#define GAYLE_CFG_720NS 0x0c /* IDE stuff */ @@ -150,17 +150,17 @@ static int ide_drv, ide2, ide_splitter; static struct ide_hdf *ide; -STATIC_INLINE void pw(int offset, uae_u16 w) +STATIC_INLINE void pw (int offset, uae_u16 w) { ide->secbuf[offset * 2 + 0] = (uae_u8)w; ide->secbuf[offset * 2 + 1] = w >> 8; } -static void ps(int offset, char *s, int max) +static void ps (int offset, char *s, int max) { int i, len; offset *= 2; - len = strlen(s); + len = strlen (s); for (i = 0; i < max; i++) { char c = ' '; if (i < len) @@ -170,12 +170,12 @@ static void ps(int offset, char *s, int max) } } -static void ide_interrupt(void) +static void ide_interrupt (void) { ide->status |= IDE_STATUS_BSY; ide->irq_delay = 2; } -static void ide_interrupt_do(struct ide_hdf *ide) +static void ide_interrupt_do (struct ide_hdf *ide) { ide->status &= ~IDE_STATUS_BSY; if (gayle_intena & GAYLE_IRQ_IDE) { @@ -184,84 +184,84 @@ static void ide_interrupt_do(struct ide_hdf *ide) } } -static void ide_fail(void) +static void ide_fail (void) { ide_error |= IDE_ERR_ABRT; if (ide_drv == 1 && idedrive[ide2 + 1].hdhfd.size == 0) idedrive[ide2].status |= IDE_STATUS_ERR; ide->status |= IDE_STATUS_ERR; - ide_interrupt(); + ide_interrupt (); } -static void ide_data_ready(int blocks) +static void ide_data_ready (int blocks) { - memset(ide->secbuf, 0, 512 * 256); + memset (ide->secbuf, 0, 512 * 256); ide->data_offset = 0; ide->status |= IDE_STATUS_DRQ; ide->data_size = blocks * 512; ide->data_multi = 1; - if (!(ide_devcon & 2)) - ide_interrupt(); + if (! (ide_devcon & 2)) + ide_interrupt (); } -static void ide_recalibrate(void) +static void ide_recalibrate (void) { - write_log("IDE%d recalibrate\n", ide->num); + write_log ("IDE%d recalibrate\n", ide->num); ide_sector = 0; ide_lcyl = ide_hcyl = 0; - ide_interrupt(); + ide_interrupt (); } -static void ide_identify_drive(void) +static void ide_identify_drive (void) { int totalsecs; int v; uae_u8 *buf = ide->secbuf; if (ide->hdhfd.size == 0) { - ide_fail(); + ide_fail (); return; } if (IDE_LOG > 0) - write_log("IDE%d identify drive\n", ide->num); - ide_data_ready(1); - pw(0, (1 << 10) | (1 << 6) | (1 << 2) | (1 << 3)); - pw(1, ide->hdhfd.cyls_def); - pw(3, ide->hdhfd.heads_def); - pw(4, 512 * ide->hdhfd.secspertrack_def); - pw(5, 512); - pw(6, ide->hdhfd.secspertrack_def); - ps(10, "68000", 20); /* serial */ - pw(20, 3); - pw(21, 512); - ps(23, "0.2", 8); /* firmware revision */ - ps(27, "UAE-IDE", 40); /* model */ - pw(47, 128); /* max 128 sectors multiple mode */ - pw(48, 1); - pw(49, (1 << 9) | (1 << 8)); /* LBA and DMA supported */ - pw(51, 240 << 8); /* PIO0 to PIO2 supported */ - pw(53, 1 | 2); - pw(54, ide->hdhfd.cyls); - pw(55, ide->hdhfd.heads); - pw(56, ide->hdhfd.secspertrack); + write_log ("IDE%d identify drive\n", ide->num); + ide_data_ready (1); + pw (0, (1 << 10) | (1 << 6) | (1 << 2) | (1 << 3)); + pw (1, ide->hdhfd.cyls_def); + pw (3, ide->hdhfd.heads_def); + pw (4, 512 * ide->hdhfd.secspertrack_def); + pw (5, 512); + pw (6, ide->hdhfd.secspertrack_def); + ps (10, "68000", 20); /* serial */ + pw (20, 3); + pw (21, 512); + ps (23, "0.2", 8); /* firmware revision */ + ps (27, "UAE-IDE", 40); /* model */ + pw (47, 128); /* max 128 sectors multiple mode */ + pw (48, 1); + pw (49, (1 << 9) | (1 << 8)); /* LBA and DMA supported */ + pw (51, 240 << 8); /* PIO0 to PIO2 supported */ + pw (53, 1 | 2); + pw (54, ide->hdhfd.cyls); + pw (55, ide->hdhfd.heads); + pw (56, ide->hdhfd.secspertrack); totalsecs = ide->hdhfd.cyls * ide->hdhfd.heads * ide->hdhfd.secspertrack; - pw(57, totalsecs); - pw(58, totalsecs >> 16); + pw (57, totalsecs); + pw (58, totalsecs >> 16); v = idedrive[ide_drv].multiple_mode; - pw(59, (v > 0 ? 0x100 : 0) | v); + pw (59, (v > 0 ? 0x100 : 0) | v); totalsecs = ide->hdhfd.size / 512; - pw(60, totalsecs); - pw(61, totalsecs >> 16); - pw(62, 0x0f); - pw(63, 0x0f); - pw(64, 0x03); /* PIO3 and PIO4 */ - pw(65, 120 << 8); /* MDMA2 supported */ - pw(66, 120 << 8); - pw(67, 120 << 8); - pw(68, 120 << 8); - pw(80, (1 << 1) | (1 << 2) | (1 << 3)); /* ATA-1 to ATA-3 */ - pw(81, 0x000A); /* ATA revision */ -} -static void ide_initialize_drive_parameters(void) + pw (60, totalsecs); + pw (61, totalsecs >> 16); + pw (62, 0x0f); + pw (63, 0x0f); + pw (64, 0x03); /* PIO3 and PIO4 */ + pw (65, 120 << 8); /* MDMA2 supported */ + pw (66, 120 << 8); + pw (67, 120 << 8); + pw (68, 120 << 8); + pw (80, (1 << 1) | (1 << 2) | (1 << 3)); /* ATA-1 to ATA-3 */ + pw (81, 0x000A); /* ATA revision */ +} +static void ide_initialize_drive_parameters (void) { if (ide->hdhfd.size) { ide->hdhfd.secspertrack = ide_nsector == 0 ? 256 : ide_nsector; @@ -276,23 +276,23 @@ static void ide_initialize_drive_parameters(void) ide_error |= IDE_ERR_ABRT; ide->status |= IDE_STATUS_ERR; } - write_log("IDE%d initialize drive parameters, CYL=%d,SPT=%d,HEAD=%d\n", + write_log ("IDE%d initialize drive parameters, CYL=%d,SPT=%d,HEAD=%d\n", ide->num, ide->hdhfd.cyls, ide->hdhfd.secspertrack, ide->hdhfd.heads); - ide_interrupt(); + ide_interrupt (); } -static void ide_set_multiple_mode(void) +static void ide_set_multiple_mode (void) { - write_log("IDE%d drive multiple mode = %d\n", ide->num, ide_nsector); + write_log ("IDE%d drive multiple mode = %d\n", ide->num, ide_nsector); ide->multiple_mode = ide_nsector; - ide_interrupt(); + ide_interrupt (); } -static void ide_set_features(void) +static void ide_set_features (void) { - write_log("IDE%d set features %02.2X (%02.2X)\n", ide->num, ide_feat, ide_nsector); - ide_fail(); + write_log ("IDE%d set features %02.2X (%02.2X)\n", ide->num, ide_feat, ide_nsector); + ide_fail (); } -static void get_lbachs(struct ide_hdf *ide, int *lba, int *cyl, int *head, int *sec) +static void get_lbachs (struct ide_hdf *ide, int *lba, int *cyl, int *head, int *sec) { if (ide_select & 0x40) { *lba = ((ide_select & 15) << 24) | (ide_hcyl << 16) | (ide_lcyl << 8) | ide_sector; @@ -303,7 +303,7 @@ static void get_lbachs(struct ide_hdf *ide, int *lba, int *cyl, int *head, int * *lba = (((*cyl) * ide->hdhfd.heads + (*head)) * ide->hdhfd.secspertrack) + (*sec) - 1; } } -static void put_lbachs(struct ide_hdf *ide, int lba, int cyl, int head, int sec, int inc) +static void put_lbachs (struct ide_hdf *ide, int lba, int cyl, int head, int sec, int inc) { if (ide_select & 0x40) { lba += inc; @@ -331,106 +331,106 @@ static void put_lbachs(struct ide_hdf *ide, int lba, int cyl, int head, int sec, ide_nsector = 0; } -static void ide_read_sectors(int multi) +static void ide_read_sectors (int multi) { int cyl, head, sec, nsec, lba; if (multi && ide->multiple_mode == 0) { - ide_fail(); + ide_fail (); return; } gui_hd_led (1); nsec = ide_nsector == 0 ? 256 : ide_nsector; - get_lbachs(ide, &lba, &cyl, &head, &sec); + get_lbachs (ide, &lba, &cyl, &head, &sec); if (IDE_LOG > 0) - write_log("IDE%d read offset=%d, sectors=%d (%d)\n", ide->num, lba, nsec, ide->multiple_mode); + write_log ("IDE%d read offset=%d, sectors=%d (%d)\n", ide->num, lba, nsec, ide->multiple_mode); if (multi && ide->multiple_mode > nsec) nsec = ide->multiple_mode; if (lba * 512 >= ide->hdhfd.size) { - ide_fail(); + ide_fail (); return; } if (nsec * 512 > ide->hdhfd.size - lba * 512) nsec = (ide->hdhfd.size - lba * 512) / 512; - ide_data_ready(nsec); + ide_data_ready (nsec); #if 0 { uae_u64 offset = lba * 512; uae_u64 len = nsec * 512; write_log ("cmd_read: %04.4x-%08.8x (%d) %08.8x (%d)\n", - (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)(offset / 512), (uae_u32)len, (uae_u32)(len / 512)); + (uae_u32) (offset >> 32), (uae_u32)offset, (uae_u32) (offset / 512), (uae_u32)len, (uae_u32)(len / 512)); } #endif hdf_read (&ide->hdhfd.hfd, ide->secbuf, lba * 512, nsec * 512); - put_lbachs(ide, lba, cyl, head, sec, nsec); + put_lbachs (ide, lba, cyl, head, sec, nsec); ide->data_multi = multi ? ide->multiple_mode : 1; } -static void ide_write_sectors(int multi) +static void ide_write_sectors (int multi) { int cyl, head, sec, nsec, lba; if (multi && ide->multiple_mode == 0) { - ide_fail(); + ide_fail (); return; } gui_hd_led (2); nsec = ide_nsector == 0 ? 256 : ide_nsector; - get_lbachs(ide, &lba, &cyl, &head, &sec); + get_lbachs (ide, &lba, &cyl, &head, &sec); if (lba * 512 >= ide->hdhfd.size) { - ide_fail(); + ide_fail (); return; } if (IDE_LOG > 0) - write_log("IDE%d write offset=%d, sectors=%d (%d)\n", ide->num, lba, nsec, ide->multiple_mode); + write_log ("IDE%d write offset=%d, sectors=%d (%d)\n", ide->num, lba, nsec, ide->multiple_mode); if (nsec * 512 > ide->hdhfd.size - lba * 512) nsec = (ide->hdhfd.size - lba * 512) / 512; - ide_data_ready(nsec); + ide_data_ready (nsec); ide->data_multi = multi ? ide->multiple_mode : 1; } -static void ide_do_command(uae_u8 cmd) +static void ide_do_command (uae_u8 cmd) { if (IDE_LOG > 1) - write_log("**** IDE%d command %02.2X\n", ide->num, cmd); - ide->status &= ~(IDE_STATUS_DRDY | IDE_STATUS_DRQ | IDE_STATUS_ERR); + write_log ("**** IDE%d command %02.2X\n", ide->num, cmd); + ide->status &= ~ (IDE_STATUS_DRDY | IDE_STATUS_DRQ | IDE_STATUS_ERR); ide_error = 0; if (cmd == 0x10) { /* recalibrate */ - ide_recalibrate(); + ide_recalibrate (); } else if (cmd == 0xec) { /* identify drive */ - ide_identify_drive(); + ide_identify_drive (); } else if (cmd == 0x91) { /* initialize drive parameters */ - ide_initialize_drive_parameters(); + ide_initialize_drive_parameters (); } else if (cmd == 0xc6) { /* set multiple mode */ - ide_set_multiple_mode(); + ide_set_multiple_mode (); } else if (cmd == 0x20 || cmd == 0x21) { /* read sectors */ - ide_read_sectors(0); + ide_read_sectors (0); } else if (cmd == 0x30 || cmd == 0x31) { /* write sectors */ - ide_write_sectors(0); + ide_write_sectors (0); } else if (cmd == 0xc4) { /* read multiple */ - ide_read_sectors(1); + ide_read_sectors (1); } else if (cmd == 0xc5) { /* write multiple */ - ide_write_sectors(1); + ide_write_sectors (1); } else if (cmd == 0x50) { /* format track (nop) */ - ide_interrupt(); + ide_interrupt (); } else if (cmd == 0xa1) { /* ATAPI identify (IDE HD is not ATAPI) */ - ide_fail(); + ide_fail (); } else if (cmd == 0xef) { /* set features */ - ide_set_features(); + ide_set_features (); } else { - ide_fail(); - write_log("IDE: unknown command %x\n", cmd); + ide_fail (); + write_log ("IDE%d: unknown command %x\n", ide->num, cmd); } } -static uae_u16 ide_get_data(void) +static uae_u16 ide_get_data (void) { int irq = 0; uae_u16 v; if (ide->data_size == 0) { if (IDE_LOG > 0) - write_log("IDE%d DATA read without DRQ!?\n", ide->num); + write_log ("IDE%d DATA read without DRQ!?\n", ide->num); if (ide->hdhfd.size == 0) return 0xffff; return 0; @@ -439,22 +439,22 @@ static uae_u16 ide_get_data(void) ide->data_offset+=2; ide->data_size-=2; if (((ide->data_offset % 512) == 0) && ((ide->data_offset / 512) % ide->data_multi) == 0) - irq = 1; + irq = 1; if (ide->data_size == 0) { irq = 1; ide->status &= ~IDE_STATUS_DRQ; } if (irq) - ide_interrupt(); + ide_interrupt (); return v; } -static void ide_put_data(uae_u16 v) +static void ide_put_data (uae_u16 v) { int irq = 0; if (ide->data_size == 0) { if (IDE_LOG > 0) - write_log("IDE%d DATA write without DRQ!?\n", ide->num); + write_log ("IDE%d DATA write without DRQ!?\n", ide->num); return; } ide->secbuf[ide->data_offset + 1] = v & 0xff; @@ -463,25 +463,25 @@ static void ide_put_data(uae_u16 v) ide->data_size-=2; if (((ide->data_offset % 512) == 0) && ((ide->data_offset / 512) % ide->data_multi) == 0) { if (IDE_LOG > 0) - write_log("IDE%d write interrupt, %d total bytes transferred so far\n", ide->num, ide->data_offset); + write_log ("IDE%d write interrupt, %d total bytes transferred so far\n", ide->num, ide->data_offset); irq = 1; } if (ide->data_size == 0) { int lba, cyl, head, sec, nsec; ide->status &= ~IDE_STATUS_DRQ; nsec = ide->data_offset / 512; - get_lbachs(ide, &lba, &cyl, &head, &sec); + get_lbachs (ide, &lba, &cyl, &head, &sec); if (IDE_LOG > 0) - write_log("IDE%d write finished, %d bytes (%d) written\n", ide->num, ide->data_offset, ide->data_offset / 512); - hdf_write(&ide->hdhfd.hfd, ide->secbuf, lba * 512, ide->data_offset); - put_lbachs(ide, lba, cyl, head, sec, nsec); + write_log ("IDE%d write finished, %d bytes (%d) written\n", ide->num, ide->data_offset, ide->data_offset / 512); + hdf_write (&ide->hdhfd.hfd, ide->secbuf, lba * 512, ide->data_offset); + put_lbachs (ide, lba, cyl, head, sec, nsec); irq = 1; } if (irq) - ide_interrupt(); + ide_interrupt (); } -static int get_ide_reg(uaecptr addr) +static int get_ide_reg (uaecptr addr) { uaecptr a = addr; addr &= 0xffff; @@ -491,7 +491,7 @@ static int get_ide_reg(uaecptr addr) addr >>= 2; ide2 = 0; if (addr & 0x400) { - if (ide_splitter ) { + if (ide_splitter) { ide2 = 2; addr &= ~0x400; } @@ -514,9 +514,9 @@ static uae_u32 ide_read (uaecptr addr) return 0xff; } if (addr >= GAYLE_IRQ_4000 && addr <= GAYLE_IRQ_4000 + 1 && currprefs.cs_ide == 2) { - uae_u8 v = gayle_irq; - gayle_irq = 0; - return v; + uae_u8 v = gayle_irq; + gayle_irq = 0; + return v; } if (addr >= 0x4000) { if (addr == GAYLE_IRQ_1200) { @@ -530,7 +530,7 @@ static uae_u32 ide_read (uaecptr addr) } return 0; } - ide_reg = get_ide_reg(addr); + ide_reg = get_ide_reg (addr); /* Emulated "ide killer". Prevents long KS boot delay if no drives installed */ if (idedrive[0].hdhfd.size == 0 && idedrive[2].hdhfd.size == 0) { if (ide_reg == IDE_STATUS) @@ -574,7 +574,7 @@ static uae_u32 ide_read (uaecptr addr) case IDE_SELECT: v = ide_select; break; - case IDE_DEVCON: + case IDE_DEVCON: v = ide_devcon; break; case IDE_STATUS: @@ -589,7 +589,7 @@ static uae_u32 ide_read (uaecptr addr) break; } if (IDE_LOG > 2 && ide_reg > 0) - write_log("IDE%d register %d->%02.2X\n", ide->num, ide_reg, (uae_u32)v & 0xff); + write_log ("IDE%d register %d->%02.2X\n", ide->num, ide_reg, (uae_u32)v & 0xff); return v; } @@ -615,9 +615,9 @@ static void ide_write (uaecptr addr, uae_u32 val) } if (addr >= 0x4000) return; - ide_reg = get_ide_reg(addr); + ide_reg = get_ide_reg (addr); if (IDE_LOG > 2 && ide_reg > 0) - write_log("IDE%d register %d=%02.2X\n", ide->num, ide_reg, (uae_u32)val & 0xff); + write_log ("IDE%d register %d=%02.2X\n", ide->num, ide_reg, (uae_u32)val & 0xff); switch (ide_reg) { case IDE_DRVADDR: @@ -664,9 +664,9 @@ static int gayle_read (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - v = ide_read(addr); + v = ide_read (addr); if (GAYLE_LOG) - write_log ("GAYLE_READ %08.8X=%02.2X PC=%08.8X\n", oaddr, (uae_u32)v & 0xff, M68K_GETPC); + write_log ("GAYLE_READ %08.8X=%02.2X PC=%08.8X\n", oaddr, (uae_u32)v & 0xff, M68K_GETPC); return v; } static void gayle_write (uaecptr addr, int val) @@ -676,7 +676,7 @@ static void gayle_write (uaecptr addr, int val) #endif if (GAYLE_LOG) write_log ("GAYLE_WRITE %08.8X=%02.2X PC=%08.8X\n", addr, (uae_u32)val & 0xff, M68K_GETPC); - ide_write(addr, val); + ide_write (addr, val); } static uae_u32 REGPARAM3 gayle_lget (uaecptr) REGPARAM; @@ -693,7 +693,7 @@ addrbank gayle_bank = { dummy_lgeti, dummy_wgeti, ABFLAG_IO }; -static int isa4000t(uaecptr addr) +static int isa4000t (uaecptr addr) { if (currprefs.cs_mbdmac != 2) return 0; @@ -719,13 +719,13 @@ static uae_u32 REGPARAM2 gayle_wget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - if (isa4000t(addr)) { + if (isa4000t (addr)) { addr -= NCR_OFFSET; - return (ncr_bget2(addr) << 8) | ncr_bget2(addr + 1); + return (ncr_bget2 (addr) << 8) | ncr_bget2 (addr + 1); } - ide_reg = get_ide_reg(addr); + ide_reg = get_ide_reg (addr); if (ide_reg == IDE_DATA) - return ide_get_data(); + return ide_get_data (); v = gayle_bget (addr) << 8; v |= gayle_bget (addr + 1); return v; @@ -735,9 +735,9 @@ static uae_u32 REGPARAM2 gayle_bget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - if (isa4000t(addr)) { + if (isa4000t (addr)) { addr -= NCR_OFFSET; - return ncr_bget2(addr); + return ncr_bget2 (addr); } return gayle_read (addr); } @@ -756,15 +756,15 @@ static void REGPARAM2 gayle_wput (uaecptr addr, uae_u32 value) #ifdef JIT special_mem |= S_WRITE; #endif - if (isa4000t(addr)) { + if (isa4000t (addr)) { addr -= NCR_OFFSET; - ncr_bput2(addr, value >> 8); - ncr_bput2(addr + 1, value); + ncr_bput2 (addr, value >> 8); + ncr_bput2 (addr + 1, value); return; } - ide_reg = get_ide_reg(addr); + ide_reg = get_ide_reg (addr); if (ide_reg == IDE_DATA) { - ide_put_data(value); + ide_put_data (value); return; } gayle_bput (addr, value >> 8); @@ -776,20 +776,20 @@ static void REGPARAM2 gayle_bput (uaecptr addr, uae_u32 value) #ifdef JIT special_mem |= S_WRITE; #endif - if (isa4000t(addr)) { + if (isa4000t (addr)) { addr -= NCR_OFFSET; - ncr_bput2(addr, value); + ncr_bput2 (addr, value); return; } gayle_write (addr, value); } -static void gayle2_write(uaecptr addr, uae_u32 v) +static void gayle2_write (uaecptr addr, uae_u32 v) { gayle_id_cnt = 0; } -static uae_u32 gayle2_read(uaecptr addr) +static uae_u32 gayle2_read (uaecptr addr) { uae_u8 v = 0; addr &= 0xffff; @@ -797,7 +797,7 @@ static uae_u32 gayle2_read(uaecptr addr) /* Gayle ID */ if ((gayle_id_cnt & 3) == 2) v = 0x7f; - else + else v = 0x80; gayle_id_cnt++; } @@ -1002,7 +1002,7 @@ addrbank mbres_bank = { dummy_lgeti, dummy_wgeti, ABFLAG_IO }; -void gayle_hsync(void) +void gayle_hsync (void) { int i; @@ -1011,15 +1011,15 @@ void gayle_hsync(void) if (ide->irq_delay > 0) { ide->irq_delay--; if (ide->irq_delay == 0) - ide_interrupt_do(ide); + ide_interrupt_do (ide); } } } -static uae_u32 gayle_attr_read(uaecptr addr) +static uae_u32 gayle_attr_read (uaecptr addr) { uae_u8 v = 0; - write_log("R: %x %x\n", addr, M68K_GETPC); + write_log ("R: %x %x\n", addr, M68K_GETPC); addr &= 262144 - 1; switch (addr) { @@ -1027,7 +1027,7 @@ static uae_u32 gayle_attr_read(uaecptr addr) v = 0x91; break; case 2: - v = 0x05; + v = 0x05; break; case 4: v = 0x23; @@ -1035,15 +1035,15 @@ static uae_u32 gayle_attr_read(uaecptr addr) } return v; } -static void gayle_attr_write(uaecptr addr, uae_u32 v) +static void gayle_attr_write (uaecptr addr, uae_u32 v) { - write_log("W: %x=%x %x\n", addr, v, M68K_GETPC); + write_log ("W: %x=%x %x\n", addr, v, M68K_GETPC); addr &= 262144 - 1; if (addr == 0x40000) { if (v) - write_log("GAYLE: Reset active\n"); + write_log ("GAYLE: Reset active\n"); else - write_log("GAYLE: Reset non-active\n"); + write_log ("GAYLE: Reset non-active\n"); } } @@ -1121,18 +1121,18 @@ static int rl (uae_u8 *p) return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]); } -void gayle_free_ide_units(void) +void gayle_free_ide_units (void) { int i; for (i = 0; i < 4; i++) { struct ide_hdf *ide = &idedrive[i]; - hdf_hd_close(&ide->hdhfd); - memset(ide, 0, sizeof (struct ide_hdf)); + hdf_hd_close (&ide->hdhfd); + memset (ide, 0, sizeof (struct ide_hdf)); } } -int gayle_add_ide_unit(int ch, char *path, int blocksize, int readonly, +int gayle_add_ide_unit (int ch, char *path, int blocksize, int readonly, char *devname, int sectors, int surfaces, int reserved, int bootpri, char *filesys) { @@ -1141,16 +1141,16 @@ int gayle_add_ide_unit(int ch, char *path, int blocksize, int readonly, if (ch >= 4) return -1; ide = &idedrive[ch]; - if (!hdf_hd_open(&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys)) + if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys)) return -1; - write_log("IDE%d ('%s'), CHS=%d,%d,%d\n", ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack); + write_log ("IDE%d ('%s'), CHS=%d,%d,%d\n", ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack); ide->status = 0; ide->data_offset = 0; ide->data_size = 0; return 1; } -static void initide(void) +static void initide (void) { int i; @@ -1164,7 +1164,7 @@ static void initide(void) ide_splitter = 0; if (idedrive[2].hdhfd.size) { ide_splitter = 1; - write_log("IDE splitter enabled\n"); + write_log ("IDE splitter enabled\n"); } for (i = 0; i < 4; i++) idedrive[i].num = i; @@ -1173,32 +1173,32 @@ static void initide(void) gayle_intena = 0xff; } - + void gayle_reset (int hardreset) { static char bankname[100]; - initide(); + initide (); if (hardreset) { ramsey_config = 0; gary_coldboot = 1; gary_timeout = 0; gary_toenb = 0; } - strcpy(bankname, "Gayle (low)"); + strcpy (bankname, "Gayle (low)"); if (currprefs.cs_ide == 2) - strcpy(bankname, "A4000 IDE"); + strcpy (bankname, "A4000 IDE"); if (currprefs.cs_mbdmac == 2) { - strcat(bankname," + NCR53C710 SCSI"); - ncr_reset(); + strcat (bankname," + NCR53C710 SCSI"); + ncr_reset (); } gayle_bank.name = bankname; } -uae_u8 *restore_gayle(uae_u8 *src) +uae_u8 *restore_gayle (uae_u8 *src) { - changed_prefs.cs_ide = restore_u8(); - gayle_intena = restore_u8(); - gayle_irq = restore_u8(); + changed_prefs.cs_ide = restore_u8 (); + gayle_intena = restore_u8 (); + gayle_irq = restore_u8 (); ide_error = 0; return src; } @@ -1227,33 +1227,33 @@ uae_u8 *save_ide (int num, int *len) if (ide->hdhfd.size == 0) return NULL; dstbak = dst = (uae_u8*)malloc (1000); - save_u32(num); - save_u64(ide->hdhfd.size); - save_string(ide->hdhfd.path); - save_u32(ide->hdhfd.hfd.blocksize); - save_u32(ide->hdhfd.hfd.readonly); - save_u8(ide->multiple_mode); - save_u32(ide->hdhfd.cyls); - save_u32(ide->hdhfd.heads); - save_u32(ide->hdhfd.secspertrack); - save_u8(ide_select); - save_u8(ide_nsector); - save_u8(ide_nsector2); - save_u8(ide_sector); - save_u8(ide_sector2); - save_u8(ide_lcyl); - save_u8(ide_lcyl2); - save_u8(ide_hcyl); - save_u8(ide_hcyl2); - save_u8(ide_feat); - save_u8(ide_feat2); - save_u8(ide_error); - save_u8(ide_devcon); - save_u64(ide->hdhfd.hfd.virtual_size); - save_u32(ide->hdhfd.hfd.secspertrack); - save_u32(ide->hdhfd.hfd.heads); - save_u32(ide->hdhfd.hfd.reservedblocks); - save_u32(ide->hdhfd.bootpri); + save_u32 (num); + save_u64 (ide->hdhfd.size); + save_string (ide->hdhfd.path); + save_u32 (ide->hdhfd.hfd.blocksize); + save_u32 (ide->hdhfd.hfd.readonly); + save_u8 (ide->multiple_mode); + save_u32 (ide->hdhfd.cyls); + save_u32 (ide->hdhfd.heads); + save_u32 (ide->hdhfd.secspertrack); + save_u8 (ide_select); + save_u8 (ide_nsector); + save_u8 (ide_nsector2); + save_u8 (ide_sector); + save_u8 (ide_sector2); + save_u8 (ide_lcyl); + save_u8 (ide_lcyl2); + save_u8 (ide_hcyl); + save_u8 (ide_hcyl2); + save_u8 (ide_feat); + save_u8 (ide_feat2); + save_u8 (ide_error); + save_u8 (ide_devcon); + save_u64 (ide->hdhfd.hfd.virtual_size); + save_u32 (ide->hdhfd.hfd.secspertrack); + save_u32 (ide->hdhfd.hfd.heads); + save_u32 (ide->hdhfd.hfd.reservedblocks); + save_u32 (ide->hdhfd.bootpri); *len = dst - dstbak; return dstbak; } @@ -1265,39 +1265,39 @@ uae_u8 *restore_ide (uae_u8 *src) char *path; struct ide_hdf *ide; - num = restore_u32(); + num = restore_u32 (); ide = &idedrive[num]; - size = restore_u64(); - path = restore_string(); - blocksize = restore_u32(); - readonly = restore_u32(); - ide->multiple_mode = restore_u8(); - ide->hdhfd.cyls = restore_u32(); - ide->hdhfd.heads = restore_u32(); - ide->hdhfd.secspertrack = restore_u32(); - ide_select = restore_u8(); - ide_nsector = restore_u8(); - ide_sector = restore_u8(); - ide_lcyl = restore_u8(); - ide_hcyl = restore_u8(); - ide_feat = restore_u8(); - ide_nsector2 = restore_u8(); - ide_sector2 = restore_u8(); - ide_lcyl2 = restore_u8(); - ide_hcyl2 = restore_u8(); - ide_feat2 = restore_u8(); - ide_error = restore_u8(); - ide_devcon = restore_u8(); - ide->hdhfd.hfd.virtual_size = restore_u64(); - ide->hdhfd.hfd.secspertrack = restore_u32(); - ide->hdhfd.hfd.heads = restore_u32(); - ide->hdhfd.hfd.reservedblocks = restore_u32(); - ide->hdhfd.bootpri = restore_u32(); + size = restore_u64 (); + path = restore_string (); + blocksize = restore_u32 (); + readonly = restore_u32 (); + ide->multiple_mode = restore_u8 (); + ide->hdhfd.cyls = restore_u32 (); + ide->hdhfd.heads = restore_u32 (); + ide->hdhfd.secspertrack = restore_u32 (); + ide_select = restore_u8 (); + ide_nsector = restore_u8 (); + ide_sector = restore_u8 (); + ide_lcyl = restore_u8 (); + ide_hcyl = restore_u8 (); + ide_feat = restore_u8 (); + ide_nsector2 = restore_u8 (); + ide_sector2 = restore_u8 (); + ide_lcyl2 = restore_u8 (); + ide_hcyl2 = restore_u8 (); + ide_feat2 = restore_u8 (); + ide_error = restore_u8 (); + ide_devcon = restore_u8 (); + ide->hdhfd.hfd.virtual_size = restore_u64 (); + ide->hdhfd.hfd.secspertrack = restore_u32 (); + ide->hdhfd.hfd.heads = restore_u32 (); + ide->hdhfd.hfd.reservedblocks = restore_u32 (); + ide->hdhfd.bootpri = restore_u32 (); if (ide->hdhfd.hfd.virtual_size) gayle_add_ide_unit (num, path, blocksize, readonly, ide->hdhfd.hfd.device_name, ide->hdhfd.hfd.secspertrack, ide->hdhfd.hfd.heads, ide->hdhfd.hfd.reservedblocks, ide->hdhfd.bootpri, NULL); else - gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0); - xfree(path); + gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0); + xfree (path); return src; } diff --git a/genblitter.c b/genblitter.c index 31d67d4d..33a1b7db 100755 --- a/genblitter.c +++ b/genblitter.c @@ -8,7 +8,8 @@ */ #include "sysconfig.h" -#include "sysdeps.h" +#include +#include #include "genblitter.h" diff --git a/gencomp.c b/gencomp.c index ccc19db0..5b367e40 100755 --- a/gencomp.c +++ b/gencomp.c @@ -191,32 +191,32 @@ static __inline__ void gen_update_next_handler(void) return; /* Can anything clever be done here? */ } -static void gen_writebyte(char* address, char* source) +static void gen_writebyte (char* address, char* source) { comprintf("\twritebyte(%s,%s,scratchie);\n",address,source); } -static void gen_writeword(char* address, char* source) +static void gen_writeword (char* address, char* source) { comprintf("\twriteword(%s,%s,scratchie);\n",address,source); } -static void gen_writelong(char* address, char* source) +static void gen_writelong (char* address, char* source) { comprintf("\twritelong(%s,%s,scratchie);\n",address,source); } -static void gen_readbyte(char* address, char* dest) +static void gen_readbyte (char* address, char* dest) { comprintf("\treadbyte(%s,%s,scratchie);\n",address,dest); } -static void gen_readword(char* address, char* dest) +static void gen_readword (char* address, char* dest) { comprintf("\treadword(%s,%s,scratchie);\n",address,dest); } -static void gen_readlong(char* address, char* dest) +static void gen_readlong (char* address, char* dest) { comprintf("\treadlong(%s,%s,scratchie);\n",address,dest); } diff --git a/gencpu.c b/gencpu.c index 52f8e385..67b85374 100755 --- a/gencpu.c +++ b/gencpu.c @@ -116,17 +116,17 @@ static void cpulimit (void) static void returncycles (char *s, int cycles) { if (using_ce) return; - printf ("%sreturn %d * %d;\n", s, cycles, CYCLE_UNIT / 2); + printf ("%sreturn %d * CYCLE_UNIT / 2;\n", s, cycles); } static void addcycles (int cycles) { if (!using_ce) return; - printf ("\tdo_cycles_ce (%d * %d);\n", cycles, CYCLE_UNIT / 2); + printf ("\tdo_cycles_ce (%d * CYCLE_UNIT / 2);\n", cycles); } static void addcycles2 (char *s, int cycles) { if (!using_ce) return; - printf ("%sdo_cycles_ce (%d * %d);\n", s, cycles, CYCLE_UNIT / 2); + printf ("%sdo_cycles_ce (%d * CYCLE_UNIT / 2);\n", s, cycles); } static void addcycles3 (char *s) { @@ -358,8 +358,8 @@ static void fill_prefetch_next_delay (int extracycles) if (extracycles > 0) { printf("\t{\n"); fill_prefetch_next (); - printf("\tif (%d > 0) do_cycles(%d * %d);\n", - extracycles, CYCLE_UNIT / 2, extracycles); + printf("\tif (%d > 0) do_cycles(%d * CYCLE_UNIT / 2);\n", + extracycles, extracycles); printf("\t}\n"); } else { fill_prefetch_next (); @@ -412,13 +412,13 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g break; case sz_word: #ifdef USE_DUBIOUS_BIGENDIAN_OPTIMIZATION - printf ("\tuae_s16 %s = ((uae_s16*)&m68k_dreg(regs, %s))[1];\n", name, reg); + 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); + printf ("\tuae_s16 %s = m68k_dreg (regs, %s);\n", name, reg); #endif break; case sz_long: - printf ("\tuae_s32 %s = m68k_dreg(regs, %s);\n", name, reg); + printf ("\tuae_s32 %s = m68k_dreg (regs, %s);\n", name, reg); break; default: abort (); @@ -430,35 +430,35 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g if (getv == 1) switch (size) { case sz_word: - printf ("\tuae_s16 %s = m68k_areg(regs, %s);\n", name, reg); + printf ("\tuae_s16 %s = m68k_areg (regs, %s);\n", name, reg); break; case sz_long: - printf ("\tuae_s32 %s = m68k_areg(regs, %s);\n", name, reg); + printf ("\tuae_s32 %s = m68k_areg (regs, %s);\n", name, reg); break; default: abort (); } return; case Aind: - printf ("\tuaecptr %sa = m68k_areg(regs, %s);\n", name, reg); + printf ("\tuaecptr %sa = m68k_areg (regs, %s);\n", name, reg); break; case Aipi: - printf ("\tuaecptr %sa = m68k_areg(regs, %s);\n", name, reg); + printf ("\tuaecptr %sa = m68k_areg (regs, %s);\n", name, reg); break; case Apdi: printf ("\tuaecptr %sa;\n", name); switch (size) { case sz_byte: if (movem) - printf ("\t%sa = m68k_areg(regs, %s);\n", name, reg); + printf ("\t%sa = m68k_areg (regs, %s);\n", name, reg); else - printf ("\t%sa = m68k_areg(regs, %s) - areg_byteinc[%s];\n", name, reg, reg); + printf ("\t%sa = m68k_areg (regs, %s) - areg_byteinc[%s];\n", name, reg, reg); break; case sz_word: - printf ("\t%sa = m68k_areg(regs, %s) - %d;\n", name, reg, movem ? 0 : 2); + printf ("\t%sa = m68k_areg (regs, %s) - %d;\n", name, reg, movem ? 0 : 2); break; case sz_long: - printf ("\t%sa = m68k_areg(regs, %s) - %d;\n", name, reg, movem ? 0 : 4); + printf ("\t%sa = m68k_areg (regs, %s) - %d;\n", name, reg, movem ? 0 : 4); break; default: abort (); @@ -469,7 +469,7 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g } break; case Ad16: - printf ("\tuaecptr %sa = m68k_areg(regs, %s) + (uae_s32)(uae_s16)%s;\n", name, reg, gen_nextiword (flags & GF_NOREFILL)); + printf ("\tuaecptr %sa = m68k_areg (regs, %s) + (uae_s32)(uae_s16)%s;\n", name, reg, gen_nextiword (flags & GF_NOREFILL)); break; case Ad8r: printf ("\tuaecptr %sa;\n", name); @@ -480,9 +480,9 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g start_brace (); /* This would ordinarily be done in gen_nextiword, which we bypass. */ insn_n_cycles += 4; - printf ("\t%sa = get_disp_ea_020(regs, m68k_areg(regs, %s), next_iword(regs));\n", name, reg); + printf ("\t%sa = get_disp_ea_020 (regs, m68k_areg (regs, %s), next_iword (regs));\n", name, reg); } else { - printf ("\t%sa = get_disp_ea_000(regs, m68k_areg(regs, %s), %s);\n", name, reg, gen_nextiword (flags & GF_NOREFILL)); + printf ("\t%sa = get_disp_ea_000 (regs, m68k_areg (regs, %s), %s);\n", name, reg, gen_nextiword (flags & GF_NOREFILL)); } if (!(flags & GF_AD8R)) { addcycles (2); @@ -503,11 +503,11 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g start_brace (); /* This would ordinarily be done in gen_nextiword, which we bypass. */ insn_n_cycles += 4; - printf ("\ttmppc = m68k_getpc(regs);\n"); - printf ("\t%sa = get_disp_ea_020(regs, tmppc, next_iword(regs));\n", name); + printf ("\ttmppc = m68k_getpc (regs);\n"); + printf ("\t%sa = get_disp_ea_020 (regs, tmppc, next_iword (regs));\n", name); } else { - printf ("\ttmppc = m68k_getpc(regs) + %d;\n", m68k_pc_offset); - printf ("\t%sa = get_disp_ea_000(regs, tmppc, %s);\n", name, gen_nextiword (flags & GF_NOREFILL)); + printf ("\ttmppc = m68k_getpc (regs) + %d;\n", m68k_pc_offset); + printf ("\t%sa = get_disp_ea_000 (regs, tmppc, %s);\n", name, gen_nextiword (flags & GF_NOREFILL)); } if (!(flags & GF_PC8R)) { addcycles (2); @@ -567,7 +567,7 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g if ((using_prefetch || using_ce) && using_exception_3 && getv != 0 && size != sz_byte) { printf ("\tif (%sa & 1) {\n", name); - printf ("\t\texception3 (opcode, m68k_getpc(regs) + %d, %sa);\n", + printf ("\t\texception3 (opcode, m68k_getpc (regs) + %d, %sa);\n", m68k_pc_offset_last + e3fudge, name); printf ("\t\tgoto %s;\n", endlabelstr); printf ("\t}\n"); @@ -604,13 +604,13 @@ static void genamode2 (amodes mode, char *reg, wordsizes size, char *name, int g case Aipi: switch (size) { case sz_byte: - printf ("\tm68k_areg(regs, %s) += areg_byteinc[%s];\n", reg, reg); + printf ("\tm68k_areg (regs, %s) += areg_byteinc[%s];\n", reg, reg); break; case sz_word: - printf ("\tm68k_areg(regs, %s) += 2;\n", reg); + printf ("\tm68k_areg (regs, %s) += 2;\n", reg); break; case sz_long: - printf ("\tm68k_areg(regs, %s) += 4;\n", reg); + printf ("\tm68k_areg (regs, %s) += 4;\n", reg); break; default: abort (); @@ -639,13 +639,13 @@ static void genastore_2 (char *from, amodes mode, char *reg, wordsizes size, cha case Dreg: switch (size) { case sz_byte: - printf ("\tm68k_dreg(regs, %s) = (m68k_dreg(regs, %s) & ~0xff) | ((%s) & 0xff);\n", reg, reg, from); + printf ("\tm68k_dreg (regs, %s) = (m68k_dreg (regs, %s) & ~0xff) | ((%s) & 0xff);\n", reg, reg, from); break; case sz_word: - printf ("\tm68k_dreg(regs, %s) = (m68k_dreg(regs, %s) & ~0xffff) | ((%s) & 0xffff);\n", reg, reg, from); + printf ("\tm68k_dreg (regs, %s) = (m68k_dreg (regs, %s) & ~0xffff) | ((%s) & 0xffff);\n", reg, reg, from); break; case sz_long: - printf ("\tm68k_dreg(regs, %s) = (%s);\n", reg, from); + printf ("\tm68k_dreg (regs, %s) = (%s);\n", reg, from); break; default: abort (); @@ -654,10 +654,10 @@ static void genastore_2 (char *from, amodes mode, char *reg, wordsizes size, cha case Areg: switch (size) { case sz_word: - printf ("\tm68k_areg(regs, %s) = (uae_s32)(uae_s16)(%s);\n", reg, from); + printf ("\tm68k_areg (regs, %s) = (uae_s32)(uae_s16)(%s);\n", reg, from); break; case sz_long: - printf ("\tm68k_areg(regs, %s) = (%s);\n", reg, from); + printf ("\tm68k_areg (regs, %s) = (%s);\n", reg, from); break; default: abort (); @@ -744,22 +744,22 @@ static void genmovemel (uae_u16 opcode) int size = table68k[opcode].size == sz_long ? 4 : 2; if (table68k[opcode].size == sz_long) { - strcpy (getcode, "get_long(srca)"); + strcpy (getcode, "get_long (srca)"); } else { - strcpy (getcode, "(uae_s32)(uae_s16)get_word(srca)"); + strcpy (getcode, "(uae_s32)(uae_s16)get_word (srca)"); } printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0)); printf ("\tunsigned int dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); genamode (table68k[opcode].dmode, "dstreg", table68k[opcode].size, "src", 2, 1, 0); start_brace (); - printf ("\twhile (dmask) { m68k_dreg(regs, movem_index1[dmask]) = %s; srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { m68k_dreg (regs, movem_index1[dmask]) = %s; srca += %d; dmask = movem_next[dmask]; }\n", getcode, size); - printf ("\twhile (amask) { m68k_areg(regs, movem_index1[amask]) = %s; srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { m68k_areg (regs, movem_index1[amask]) = %s; srca += %d; amask = movem_next[amask]; }\n", getcode, size); if (table68k[opcode].dmode == Aipi) - printf ("\tm68k_areg(regs, dstreg) = srca;\n"); + printf ("\tm68k_areg (regs, dstreg) = srca;\n"); } static void genmovemel_ce (uae_u16 opcode) @@ -773,19 +773,19 @@ static void genmovemel_ce (uae_u16 opcode) addcycles (2); start_brace (); if (table68k[opcode].size == sz_long) { - printf ("\twhile (dmask) { v = get_word_ce(srca) << 16; v |= get_word_ce(srca + 2); m68k_dreg(regs, movem_index1[dmask]) = v; srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { v = get_word_ce(srca) << 16; v |= get_word_ce(srca + 2); m68k_dreg (regs, movem_index1[dmask]) = v; srca += %d; dmask = movem_next[dmask]; }\n", size); - printf ("\twhile (amask) { v = get_word_ce(srca) << 16; v |= get_word_ce(srca + 2); m68k_areg(regs, movem_index1[amask]) = v; srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { v = get_word_ce(srca) << 16; v |= get_word_ce(srca + 2); m68k_areg (regs, movem_index1[amask]) = v; srca += %d; amask = movem_next[amask]; }\n", size); } else { - printf ("\twhile (dmask) { m68k_dreg(regs, movem_index1[dmask]) = (uae_s32)(uae_s16)get_word_ce(srca); srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { m68k_dreg (regs, movem_index1[dmask]) = (uae_s32)(uae_s16)get_word_ce(srca); srca += %d; dmask = movem_next[dmask]; }\n", size); - printf ("\twhile (amask) { m68k_areg(regs, movem_index1[amask]) = (uae_s32)(uae_s16)get_word_ce(srca); srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { m68k_areg (regs, movem_index1[amask]) = (uae_s32)(uae_s16)get_word_ce(srca); srca += %d; amask = movem_next[amask]; }\n", size); } printf ("\tget_word_ce (srca);\n"); if (table68k[opcode].dmode == Aipi) - printf ("\tm68k_areg(regs, dstreg) = srca;\n"); + printf ("\tm68k_areg (regs, dstreg) = srca;\n"); } static void genmovemle (uae_u16 opcode) @@ -793,9 +793,9 @@ static void genmovemle (uae_u16 opcode) char putcode[100]; int size = table68k[opcode].size == sz_long ? 4 : 2; if (table68k[opcode].size == sz_long) { - strcpy (putcode, "put_long(srca"); + strcpy (putcode, "put_long (srca"); } else { - strcpy (putcode, "put_word(srca"); + strcpy (putcode, "put_word (srca"); } printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0)); @@ -809,18 +809,18 @@ static void genmovemle (uae_u16 opcode) printf ("\tint type = get_cpu_model() >= 68020;\n"); printf ("\twhile (amask) {\n"); printf ("\t\tsrca -= %d;\n", size); - printf ("\t\tif (type) m68k_areg(regs, dstreg) = srca;\n"); - printf ("\t\t%s, m68k_areg(regs, movem_index2[amask]));\n", putcode); + printf ("\t\tif (type) m68k_areg (regs, dstreg) = srca;\n"); + printf ("\t\t%s, m68k_areg (regs, movem_index2[amask]));\n", putcode); printf ("\t\tamask = movem_next[amask];\n"); printf ("\t}\n"); - printf ("\twhile (dmask) { srca -= %d; %s, m68k_dreg(regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { srca -= %d; %s, m68k_dreg (regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", size, putcode); - printf ("\tm68k_areg(regs, dstreg) = srca;\n"); + printf ("\tm68k_areg (regs, dstreg) = srca;\n"); } else { printf ("\tuae_u16 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (dmask) { %s, m68k_dreg(regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { %s, m68k_dreg (regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", putcode, size); - printf ("\twhile (amask) { %s, m68k_areg(regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { %s, m68k_areg (regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", putcode, size); } } @@ -837,31 +837,31 @@ static void genmovemle_ce (uae_u16 opcode) if (table68k[opcode].size == sz_long) { if (table68k[opcode].dmode == Apdi) { printf ("\tuae_u16 amask = mask & 0xff, dmask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (amask) { srca -= %d; put_word_ce (srca, m68k_areg(regs, movem_index2[amask]) >> 16); put_word_ce (srca + 2, m68k_areg(regs, movem_index2[amask])); amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { srca -= %d; put_word_ce (srca, m68k_areg (regs, movem_index2[amask]) >> 16); put_word_ce (srca + 2, m68k_areg (regs, movem_index2[amask])); amask = movem_next[amask]; }\n", size); - printf ("\twhile (dmask) { srca -= %d; put_word_ce (srca, m68k_dreg(regs, movem_index2[dmask]) >> 16); put_word_ce (srca + 2, m68k_dreg(regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { srca -= %d; put_word_ce (srca, m68k_dreg (regs, movem_index2[dmask]) >> 16); put_word_ce (srca + 2, m68k_dreg (regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", size); - printf ("\tm68k_areg(regs, dstreg) = srca;\n"); + printf ("\tm68k_areg (regs, dstreg) = srca;\n"); } else { printf ("\tuae_u16 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (dmask) { put_word_ce (srca, m68k_dreg(regs, movem_index1[dmask]) >> 16); put_word_ce (srca + 2, m68k_dreg(regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { put_word_ce (srca, m68k_dreg (regs, movem_index1[dmask]) >> 16); put_word_ce (srca + 2, m68k_dreg (regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", size); - printf ("\twhile (amask) { put_word_ce (srca, m68k_areg(regs, movem_index1[amask]) >> 16); put_word_ce (srca + 2, m68k_areg(regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { put_word_ce (srca, m68k_areg (regs, movem_index1[amask]) >> 16); put_word_ce (srca + 2, m68k_areg (regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", size); } } else { if (table68k[opcode].dmode == Apdi) { printf ("\tuae_u16 amask = mask & 0xff, dmask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (amask) { srca -= %d; put_word_ce (srca, m68k_areg(regs, movem_index2[amask])); amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { srca -= %d; put_word_ce (srca, m68k_areg (regs, movem_index2[amask])); amask = movem_next[amask]; }\n", size); - printf ("\twhile (dmask) { srca -= %d; put_word_ce (srca, m68k_dreg(regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { srca -= %d; put_word_ce (srca, m68k_dreg (regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", size); - printf ("\tm68k_areg(regs, dstreg) = srca;\n"); + printf ("\tm68k_areg (regs, dstreg) = srca;\n"); } else { printf ("\tuae_u16 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (dmask) { put_word_ce (srca, m68k_dreg(regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { put_word_ce (srca, m68k_dreg (regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", size); - printf ("\twhile (amask) { put_word_ce (srca, m68k_areg(regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { put_word_ce (srca, m68k_areg (regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", size); } } @@ -1142,8 +1142,8 @@ static void shift_ce (amodes dmode, int size) { if (using_ce && isreg (dmode)) { printf ("\t{\n"); - printf ("\t\tint cycles = %d * %d;\n", size == sz_long ? 8 : 6, CYCLE_UNIT / 2); - printf ("\t\tcycles += 2 * %d * ccnt;\n", CYCLE_UNIT / 2); + printf ("\t\tint cycles = %d * CYCLE_UNIT / 2;\n", size == sz_long ? 8 : 6); + printf ("\t\tcycles += 2 * CYCLE_UNIT / 2 * ccnt;\n"); addcycles3 ("\t\t"); printf ("\t}\n"); } @@ -1168,14 +1168,14 @@ static void gen_opcode (unsigned long int opcode) /* fall through */ case 2: /* priviledged */ - printf ("if (!regs->s) { Exception(8, regs, 0); goto %s; }\n", endlabelstr); + printf ("if (!regs->s) { Exception (8, regs, 0); goto %s; }\n", endlabelstr); need_endlabel = 1; start_brace (); break; case 3: /* privileged if size == word */ if (curi->size == sz_byte) break; - printf ("if (!regs->s) { Exception(8, regs, 0); goto %s; }\n", endlabelstr); + printf ("if (!regs->s) { Exception (8, regs, 0); goto %s; }\n", endlabelstr); need_endlabel = 1; start_brace (); break; @@ -1195,7 +1195,7 @@ static void gen_opcode (unsigned long int opcode) break; case i_ORSR: case i_EORSR: - printf ("\tMakeSR(regs);\n"); + printf ("\tMakeSR (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); if (curi->size == sz_byte) { printf ("\tsrc &= 0xFF;\n"); @@ -1203,10 +1203,10 @@ static void gen_opcode (unsigned long int opcode) addcycles (4); fill_prefetch_next (); printf ("\tregs->sr %c= src;\n", curi->mnemo == i_EORSR ? '^' : '|'); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tMakeFromSR (regs);\n"); break; case i_ANDSR: - printf ("\tMakeSR(regs);\n"); + printf ("\tMakeSR (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); if (curi->size == sz_byte) { printf ("\tsrc |= 0xFF00;\n"); @@ -1214,7 +1214,7 @@ static void gen_opcode (unsigned long int opcode) addcycles (4); fill_prefetch_next (); printf ("\tregs->sr &= src;\n"); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tMakeFromSR (regs);\n"); break; case i_SUB: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); @@ -1503,7 +1503,7 @@ static void gen_opcode (unsigned long int opcode) * weird things... */ case i_MVPRM: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); - printf ("\tuaecptr memp = m68k_areg(regs, dstreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword (0)); + printf ("\tuaecptr memp = m68k_areg (regs, dstreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword (0)); if (using_ce) { if (curi->size == sz_word) { printf ("\tput_byte_ce (memp, src >> 8); put_byte_ce (memp + 2, src);\n"); @@ -1522,7 +1522,7 @@ static void gen_opcode (unsigned long int opcode) fill_prefetch_next (); break; case i_MVPMR: - printf ("\tuaecptr memp = m68k_areg(regs, srcreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword (0)); + printf ("\tuaecptr memp = m68k_areg (regs, srcreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword (0)); genamode (curi->dmode, "dstreg", curi->size, "dst", 2, 0, 0); if (using_ce) { if (curi->size == sz_word) { @@ -1559,8 +1559,8 @@ static void gen_opcode (unsigned long int opcode) if (curi->mnemo == i_MOVEA && curi->size == sz_word) printf ("\tsrc = (uae_s32)(uae_s16)src;\n"); if (curi->dmode == Apdi) { - fill_prefetch_next (); - prefetch_done = 1; + fill_prefetch_next (); + prefetch_done = 1; } genastore ("src", curi->dmode, "dstreg", curi->size, "dst"); if (curi->mnemo == i_MOVE) @@ -1579,7 +1579,7 @@ static void gen_opcode (unsigned long int opcode) if (isreg (curi->smode)) addcycles (2); fill_prefetch_next (); - printf ("\tMakeSR(regs);\n"); + printf ("\tMakeSR (regs);\n"); if (curi->size == sz_byte) genastore ("regs->sr & 0xff", curi->smode, "srcreg", sz_word, "src"); else @@ -1589,13 +1589,13 @@ static void gen_opcode (unsigned long int opcode) genamode (curi->smode, "srcreg", sz_word, "src", 1, 0, 0); if (curi->size == sz_byte) { addcycles (8); - printf ("\tMakeSR(regs);\n\tregs->sr &= 0xFF00;\n\tregs->sr |= src & 0xFF;\n"); + printf ("\tMakeSR (regs);\n\tregs->sr &= 0xFF00;\n\tregs->sr |= src & 0xFF;\n"); } else { addcycles (4); printf ("\tregs->sr = src;\n"); } fill_prefetch_next (); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tMakeFromSR (regs);\n"); break; case i_SWAP: genamode (curi->smode, "srcreg", sz_long, "src", 1, 0, 0); @@ -1663,7 +1663,7 @@ static void gen_opcode (unsigned long int opcode) fill_prefetch_next (); printf ("\tcpureset();\n"); if (using_prefetch) - printf ("\tregs->irc = get_iword(regs, 4);\n"); + printf ("\tregs->irc = get_iword (regs, 4);\n"); break; case i_NOP: fill_prefetch_next (); @@ -1672,7 +1672,7 @@ static void gen_opcode (unsigned long int opcode) /* real stop do not prefetch anything, later... */ genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); printf ("\tregs->sr = src;\n"); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tMakeFromSR (regs);\n"); printf ("\tm68k_setstopped(regs, 1);\n"); sync_m68k_pc (); fill_prefetch_full (); @@ -1681,8 +1681,8 @@ static void gen_opcode (unsigned long int opcode) if (cpu_level == 0) { genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL); genamode (Aipi, "7", sz_long, "pc", 1, 0, GF_NOREFILL); - printf ("\tregs->sr = sr; m68k_setpc(regs, pc);\n"); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tregs->sr = sr; m68k_setpc (regs, pc);\n"); + printf ("\tMakeFromSR (regs);\n"); } else { int old_brace_level = n_braces; if (next_cpu_level < 0) @@ -1694,20 +1694,20 @@ static void gen_opcode (unsigned long int opcode) printf ("\tnewsr = sr; newpc = pc;\n"); printf ("\tif ((format & 0xF000) == 0x0000) { break; }\n"); printf ("\telse if ((format & 0xF000) == 0x1000) { ; }\n"); - printf ("\telse if ((format & 0xF000) == 0x2000) { m68k_areg(regs, 7) += 4; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x8000) { m68k_areg(regs, 7) += 50; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x7000) { m68k_areg(regs, 7) += 52; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x9000) { m68k_areg(regs, 7) += 12; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0xa000) { m68k_areg(regs, 7) += 24; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0xb000) { m68k_areg(regs, 7) += 84; break; }\n"); - printf ("\telse { Exception(14, regs, 0); goto %s; }\n", endlabelstr); - printf ("\tregs->sr = newsr; MakeFromSR(regs);\n}\n"); + printf ("\telse if ((format & 0xF000) == 0x2000) { m68k_areg (regs, 7) += 4; break; }\n"); + printf ("\telse if ((format & 0xF000) == 0x8000) { m68k_areg (regs, 7) += 50; break; }\n"); + printf ("\telse if ((format & 0xF000) == 0x7000) { m68k_areg (regs, 7) += 52; break; }\n"); + printf ("\telse if ((format & 0xF000) == 0x9000) { m68k_areg (regs, 7) += 12; break; }\n"); + printf ("\telse if ((format & 0xF000) == 0xa000) { m68k_areg (regs, 7) += 24; break; }\n"); + printf ("\telse if ((format & 0xF000) == 0xb000) { m68k_areg (regs, 7) += 84; break; }\n"); + printf ("\telse { Exception (14, regs, 0); goto %s; }\n", endlabelstr); + printf ("\tregs->sr = newsr; MakeFromSR (regs);\n}\n"); pop_braces (old_brace_level); - printf ("\tregs->sr = newsr; MakeFromSR(regs);\n"); + printf ("\tregs->sr = newsr; MakeFromSR (regs);\n"); printf ("\tif (newpc & 1)\n"); - printf ("\t\texception3 (0x%04.4X, m68k_getpc(regs), newpc);\n", opcode); + printf ("\t\texception3 (0x%04.4X, m68k_getpc (regs), newpc);\n", opcode); printf ("\telse\n"); - printf ("\t\tm68k_setpc(regs, newpc);\n"); + printf ("\t\tm68k_setpc (regs, newpc);\n"); need_endlabel = 1; } /* PC is set and prefetch filled. */ @@ -1717,11 +1717,11 @@ static void gen_opcode (unsigned long int opcode) case i_RTD: genamode (Aipi, "7", sz_long, "pc", 1, 0, 0); genamode (curi->smode, "srcreg", curi->size, "offs", 1, 0, 0); - printf ("\tm68k_areg(regs, 7) += offs;\n"); + printf ("\tm68k_areg (regs, 7) += offs;\n"); printf ("\tif (pc & 1)\n"); - printf ("\t\texception3 (0x%04.4X, m68k_getpc(regs), pc);\n", opcode); + printf ("\t\texception3 (0x%04.4X, m68k_getpc (regs), pc);\n", opcode); printf ("\telse\n"); - printf ("\t\tm68k_setpc(regs, pc);\n"); + printf ("\t\tm68k_setpc (regs, pc);\n"); /* PC is set and prefetch filled. */ m68k_pc_offset = 0; fill_prefetch_full (); @@ -1730,14 +1730,14 @@ static void gen_opcode (unsigned long int opcode) genamode (Apdi, "7", sz_long, "old", 2, 0, GF_AA); genamode (curi->smode, "srcreg", sz_long, "src", 1, 0, GF_AA); genastore ("src", Apdi, "7", sz_long, "old"); - genastore ("m68k_areg(regs, 7)", curi->smode, "srcreg", sz_long, "src"); + genastore ("m68k_areg (regs, 7)", curi->smode, "srcreg", sz_long, "src"); genamode (curi->dmode, "dstreg", curi->size, "offs", 1, 0, 0); - printf ("\tm68k_areg(regs, 7) += offs;\n"); + printf ("\tm68k_areg (regs, 7) += offs;\n"); fill_prefetch_next (); break; case i_UNLK: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); - printf ("\tm68k_areg(regs, 7) = src;\n"); + printf ("\tm68k_areg (regs, 7) = src;\n"); genamode (Aipi, "7", sz_long, "old", 1, 0, 0); fill_prefetch_next (); genastore ("old", curi->smode, "srcreg", curi->size, "src"); @@ -1762,19 +1762,19 @@ static void gen_opcode (unsigned long int opcode) need_endlabel = 1; break; case i_RTR: - printf ("\tMakeSR(regs);\n"); + printf ("\tMakeSR (regs);\n"); genamode (Aipi, "7", sz_word, "sr", 1, 0, 0); genamode (Aipi, "7", sz_long, "pc", 1, 0, 0); printf ("\tregs->sr &= 0xFF00; sr &= 0xFF;\n"); - printf ("\tregs->sr |= sr; m68k_setpc(regs, pc);\n"); - printf ("\tMakeFromSR(regs);\n"); + printf ("\tregs->sr |= sr; m68k_setpc (regs, pc);\n"); + printf ("\tMakeFromSR (regs);\n"); m68k_pc_offset = 0; fill_prefetch_full (); break; case i_JSR: genamode (curi->smode, "srcreg", curi->size, "src", 0, 0, GF_AA|GF_NOREFILL); start_brace (); - printf ("\tuaecptr oldpc = m68k_getpc(regs) + %d;\n", m68k_pc_offset); + printf ("\tuaecptr oldpc = m68k_getpc (regs) + %d;\n", m68k_pc_offset); if (using_exception_3) { printf ("\tif (srca & 1) {\n"); printf ("\t\texception3i (opcode, oldpc, srca);\n"); @@ -1798,14 +1798,14 @@ static void gen_opcode (unsigned long int opcode) genamode (curi->smode, "srcreg", curi->size, "src", 0, 0, GF_AA|GF_NOREFILL); if (using_exception_3) { printf ("\tif (srca & 1) {\n"); - printf ("\t\texception3i (opcode, m68k_getpc(regs) + 6, srca);\n"); + printf ("\t\texception3i (opcode, m68k_getpc (regs) + 6, srca);\n"); printf ("\t\tgoto %s;\n", endlabelstr); printf ("\t}\n"); need_endlabel = 1; } if (curi->smode == Ad16 || curi->smode == Ad8r || curi->smode == absw || curi->smode == PC16 || curi->smode == PC8r) addcycles (2); - printf ("\tm68k_setpc(regs, srca);\n"); + printf ("\tm68k_setpc (regs, srca);\n"); m68k_pc_offset = 0; fill_prefetch_full (); break; @@ -1815,18 +1815,18 @@ static void gen_opcode (unsigned long int opcode) printf ("\ts = (uae_s32)src + 2;\n"); if (using_exception_3) { printf ("\tif (src & 1) {\n"); - printf ("\t\texception3i (opcode, m68k_getpc(regs) + 2, m68k_getpc(regs) + s);\n"); + printf ("\t\texception3i (opcode, m68k_getpc (regs) + 2, m68k_getpc (regs) + s);\n"); printf ("\t\tgoto %s;\n", endlabelstr); printf ("\t}\n"); need_endlabel = 1; } addcycles (2); if (using_ce) - printf ("\tm68k_do_bsr_ce (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset); + printf ("\tm68k_do_bsr_ce (regs, m68k_getpc (regs) + %d, s);\n", m68k_pc_offset); else if (using_indirect) - printf ("\tm68k_do_bsri (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset); + printf ("\tm68k_do_bsri (regs, m68k_getpc (regs) + %d, s);\n", m68k_pc_offset); else - printf ("\tm68k_do_bsr (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset); + printf ("\tm68k_do_bsr (regs, m68k_getpc (regs) + %d, s);\n", m68k_pc_offset); m68k_pc_offset = 0; fill_prefetch_full (); break; @@ -1835,7 +1835,7 @@ static void gen_opcode (unsigned long int opcode) if (cpu_level < 2) { addcycles (2); printf ("\tif (cctrue(®s->ccrflags, %d)) {\n", curi->cc, endlabelstr); - printf ("\t\texception3i (opcode, m68k_getpc(regs) + 2, m68k_getpc(regs) + 1);\n"); + printf ("\t\texception3i (opcode, m68k_getpc (regs) + 2, m68k_getpc (regs) + 1);\n"); printf ("\t\tgoto %s;\n", endlabelstr); printf ("\t}\n"); sync_m68k_pc (); @@ -1853,7 +1853,7 @@ static void gen_opcode (unsigned long int opcode) printf ("\tif (!cctrue(®s->ccrflags, %d)) goto didnt_jump;\n", curi->cc); if (using_exception_3) { printf ("\tif (src & 1) {\n"); - printf ("\t\texception3i (opcode, m68k_getpc(regs) + 2, m68k_getpc(regs) + 2 + (uae_s32)src);\n"); + printf ("\t\texception3i (opcode, m68k_getpc (regs) + 2, m68k_getpc (regs) + 2 + (uae_s32)src);\n"); printf ("\t\tgoto %s;\n", endlabelstr); printf ("\t}\n"); need_endlabel = 1; @@ -1868,7 +1868,7 @@ static void gen_opcode (unsigned long int opcode) if (using_ce) printf ("\treturn;\n"); else - printf ("\treturn 10 * %d;\n", CYCLE_UNIT / 2); + printf ("\treturn 10 * CYCLE_UNIT / 2;\n"); } else { printf ("\tm68k_incpc (regs, (uae_s32)src + 2);\n"); returncycles ("\t", 10); @@ -1907,17 +1907,17 @@ static void gen_opcode (unsigned long int opcode) genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, GF_AA | GF_NOREFILL); genamode (curi->dmode, "dstreg", curi->size, "offs", 1, 0, GF_AA | GF_NOREFILL); - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); addcycles (2); printf ("\tif (!cctrue(®s->ccrflags, %d)) {\n", curi->cc); - printf ("\t\tm68k_incpc(regs, (uae_s32)offs + 2);\n"); + printf ("\t\tm68k_incpc (regs, (uae_s32)offs + 2);\n"); printf ("\t"); fill_prefetch_1 (0); printf ("\t"); genastore ("(src-1)", curi->smode, "srcreg", curi->size, "src"); printf ("\t\tif (src) {\n"); if (using_exception_3) { printf ("\t\t\tif (offs & 1) {\n"); - printf ("\t\t\t\texception3i (opcode, m68k_getpc(regs) + 2, m68k_getpc(regs) + 2 + (uae_s32)offs + 2);\n"); + printf ("\t\t\t\texception3i (opcode, m68k_getpc (regs) + 2, m68k_getpc (regs) + 2 + (uae_s32)offs + 2);\n"); printf ("\t\t\t\tgoto %s;\n", endlabelstr); printf ("\t\t\t}\n"); need_endlabel = 1; @@ -1946,13 +1946,13 @@ static void gen_opcode (unsigned long int opcode) if (using_ce) { printf ("\tint cycles = 0;\n"); if (isreg (curi->smode)) - printf ("\tif (val) cycles += 2 * %d;\n", CYCLE_UNIT / 2); + printf ("\tif (val) cycles += 2 * CYCLE_UNIT / 2;\n"); addcycles3 ("\t"); } genastore ("val", curi->smode, "srcreg", curi->size, "src"); break; case i_DIVU: - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", sz_word, "src", 1, 0, 0); genamode (curi->dmode, "dstreg", sz_long, "dst", 1, 0, 0); printf ("\tCLEAR_CZNV (®s->ccrflags);\n"); @@ -1971,7 +1971,7 @@ static void gen_opcode (unsigned long int opcode) printf ("\t\tuae_u32 newv = (uae_u32)dst / (uae_u32)(uae_u16)src;\n"); printf ("\t\tuae_u32 rem = (uae_u32)dst %% (uae_u32)(uae_u16)src;\n"); if (using_ce) { - printf ("\t\tint cycles = getDivu68kCycles((uae_u32)dst, (uae_u16)src) * %d;\n", CYCLE_UNIT / 2); + printf ("\t\tint cycles = getDivu68kCycles((uae_u32)dst, (uae_u16)src) * CYCLE_UNIT / 2;\n"); addcycles3 ("\t\t"); } /* The N flag appears to be set each time there is an overflow. @@ -1996,7 +1996,7 @@ static void gen_opcode (unsigned long int opcode) need_endlabel = 1; break; case i_DIVS: - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", sz_word, "src", 1, 0, 0); genamode (curi->dmode, "dstreg", sz_long, "dst", 1, 0, 0); printf ("\tCLEAR_CZNV (®s->ccrflags);\n"); @@ -2015,7 +2015,7 @@ static void gen_opcode (unsigned long int opcode) printf ("\t\tuae_s32 newv = (uae_s32)dst / (uae_s32)(uae_s16)src;\n"); printf ("\t\tuae_u16 rem = (uae_s32)dst %% (uae_s32)(uae_s16)src;\n"); if (using_ce) { - printf ("\t\tint cycles = getDivs68kCycles((uae_s32)dst, (uae_s16)src) * %d;\n", CYCLE_UNIT / 2); + printf ("\t\tint cycles = getDivs68kCycles((uae_s32)dst, (uae_s16)src) * CYCLE_UNIT / 2;\n"); addcycles3 ("\t\t"); } printf ("\t\tif ((newv & 0xffff8000) != 0 && (newv & 0xffff8000) != 0xffff8000) {\n"); @@ -2045,11 +2045,11 @@ static void gen_opcode (unsigned long int opcode) start_brace (); printf ("\tuae_u32 newv = (uae_u32)(uae_u16)dst * (uae_u32)(uae_u16)src;\n"); if (using_ce) - printf ("\tint cycles = 36 * %d, bits;\n", CYCLE_UNIT / 2); + printf ("\tint cycles = 36 * CYCLE_UNIT / 2, bits;\n"); genflags (flag_logical, sz_long, "newv", "", ""); if (using_ce) { printf ("\tfor(bits = 0; bits < 16 && src; bits++, src >>= 1)\n"); - printf ("\t\tif (src & 1) cycles += 2 * %d;\n", CYCLE_UNIT / 2); + printf ("\t\tif (src & 1) cycles += 2 * CYCLE_UNIT / 2;\n"); addcycles3 ("\t"); } genastore ("newv", curi->dmode, "dstreg", sz_long, "dst"); @@ -2063,21 +2063,21 @@ static void gen_opcode (unsigned long int opcode) start_brace (); printf ("\tuae_u32 newv = (uae_s32)(uae_s16)dst * (uae_s32)(uae_s16)src;\n"); if (using_ce) { - printf ("\tint cycles = 36 * %d, bits;\n", CYCLE_UNIT / 2); + printf ("\tint cycles = 36 * CYCLE_UNIT / 2, bits;\n"); printf ("\tuae_u32 usrc;\n"); } genflags (flag_logical, sz_long, "newv", "", ""); if (using_ce) { printf ("\tusrc = ((uae_u32)src) << 1;\n"); printf ("\tfor(bits = 0; bits < 16 && usrc; bits++, usrc >>= 1)\n"); - printf ("\t\tif ((usrc & 3) == 1 || (usrc & 3) == 2) cycles += 2 * %d;\n", CYCLE_UNIT / 2); + printf ("\t\tif ((usrc & 3) == 1 || (usrc & 3) == 2) cycles += 2 * CYCLE_UNIT / 2;\n"); addcycles3 ("\t"); } genastore ("newv", curi->dmode, "dstreg", sz_long, "dst"); insn_n_cycles += (70 - 38) / 2 + 38; /* average */ break; case i_CHK: - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0); genamode (curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0); sync_m68k_pc (); @@ -2095,29 +2095,29 @@ static void gen_opcode (unsigned long int opcode) need_endlabel = 1; break; case i_CHK2: - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); genamode (curi->dmode, "dstreg", curi->size, "dst", 2, 0, 0); fill_prefetch_0 (); printf ("\t{uae_s32 upper,lower,reg = regs->regs[(extra >> 12) & 15];\n"); switch (curi->size) { case sz_byte: - printf ("\tlower = (uae_s32)(uae_s8)get_byte(dsta); upper = (uae_s32)(uae_s8)get_byte(dsta+1);\n"); + printf ("\tlower = (uae_s32)(uae_s8)get_byte (dsta); upper = (uae_s32)(uae_s8)get_byte (dsta+1);\n"); printf ("\tif ((extra & 0x8000) == 0) reg = (uae_s32)(uae_s8)reg;\n"); break; case sz_word: - printf ("\tlower = (uae_s32)(uae_s16)get_word(dsta); upper = (uae_s32)(uae_s16)get_word(dsta+2);\n"); + printf ("\tlower = (uae_s32)(uae_s16)get_word (dsta); upper = (uae_s32)(uae_s16)get_word (dsta+2);\n"); printf ("\tif ((extra & 0x8000) == 0) reg = (uae_s32)(uae_s16)reg;\n"); break; case sz_long: - printf ("\tlower = get_long(dsta); upper = get_long(dsta+4);\n"); + printf ("\tlower = get_long (dsta); upper = get_long (dsta+4);\n"); break; default: abort (); } printf ("\tSET_ZFLG (®s->ccrflags, upper == reg || lower == reg);\n"); printf ("\tSET_CFLG_ALWAYS (®s->ccrflags, lower <= upper ? reg < lower || reg > upper : reg > upper || reg < lower);\n"); - printf ("\tif ((extra & 0x800) && GET_CFLG (®s->ccrflags)) { Exception(6, regs, oldpc); goto %s; }\n}\n", endlabelstr); + printf ("\tif ((extra & 0x800) && GET_CFLG (®s->ccrflags)) { Exception (6, regs, oldpc); goto %s; }\n}\n", endlabelstr); need_endlabel = 1; break; @@ -2558,15 +2558,15 @@ static void gen_opcode (unsigned long int opcode) start_brace (); printf ("\tint ru = (src >> 6) & 7;\n"); printf ("\tint rc = src & 7;\n"); - genflags (flag_cmp, curi->size, "newv", "m68k_dreg(regs, rc)", "dst"); + genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, rc)", "dst"); printf ("\tif (GET_ZFLG (®s->ccrflags))"); old_brace_level = n_braces; start_brace (); - genastore ("(m68k_dreg(regs, ru))", curi->dmode, "dstreg", curi->size, "dst"); + genastore ("(m68k_dreg (regs, ru))", curi->dmode, "dstreg", curi->size, "dst"); pop_braces (old_brace_level); printf ("else"); start_brace (); - printf ("m68k_dreg(regs, rc) = dst;\n"); + printf ("m68k_dreg (regs, rc) = dst;\n"); pop_braces (old_brace_level); } break; @@ -2576,33 +2576,33 @@ static void gen_opcode (unsigned long int opcode) printf ("\tuae_u32 rn2 = regs->regs[(extra >> 12) & 15];\n"); if (curi->size == sz_word) { int old_brace_level = n_braces; - printf ("\tuae_u16 dst1 = get_word(rn1), dst2 = get_word(rn2);\n"); - genflags (flag_cmp, curi->size, "newv", "m68k_dreg(regs, (extra >> 16) & 7)", "dst1"); + printf ("\tuae_u16 dst1 = get_word (rn1), dst2 = get_word (rn2);\n"); + genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, (extra >> 16) & 7)", "dst1"); printf ("\tif (GET_ZFLG (®s->ccrflags)) {\n"); - genflags (flag_cmp, curi->size, "newv", "m68k_dreg(regs, extra & 7)", "dst2"); + genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, extra & 7)", "dst2"); printf ("\tif (GET_ZFLG (®s->ccrflags)) {\n"); - printf ("\tput_word(rn1, m68k_dreg(regs, (extra >> 22) & 7));\n"); - printf ("\tput_word(rn1, m68k_dreg(regs, (extra >> 6) & 7));\n"); + printf ("\tput_word (rn1, m68k_dreg (regs, (extra >> 22) & 7));\n"); + printf ("\tput_word (rn1, m68k_dreg (regs, (extra >> 6) & 7));\n"); printf ("\t}}\n"); pop_braces (old_brace_level); printf ("\tif (! GET_ZFLG (®s->ccrflags)) {\n"); - printf ("\tm68k_dreg(regs, (extra >> 22) & 7) = (m68k_dreg(regs, (extra >> 22) & 7) & ~0xffff) | (dst1 & 0xffff);\n"); - printf ("\tm68k_dreg(regs, (extra >> 6) & 7) = (m68k_dreg(regs, (extra >> 6) & 7) & ~0xffff) | (dst2 & 0xffff);\n"); + printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = (m68k_dreg (regs, (extra >> 22) & 7) & ~0xffff) | (dst1 & 0xffff);\n"); + printf ("\tm68k_dreg (regs, (extra >> 6) & 7) = (m68k_dreg (regs, (extra >> 6) & 7) & ~0xffff) | (dst2 & 0xffff);\n"); printf ("\t}\n"); } else { int old_brace_level = n_braces; - printf ("\tuae_u32 dst1 = get_long(rn1), dst2 = get_long(rn2);\n"); - genflags (flag_cmp, curi->size, "newv", "m68k_dreg(regs, (extra >> 16) & 7)", "dst1"); + printf ("\tuae_u32 dst1 = get_long (rn1), dst2 = get_long (rn2);\n"); + genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, (extra >> 16) & 7)", "dst1"); printf ("\tif (GET_ZFLG (®s->ccrflags)) {\n"); - genflags (flag_cmp, curi->size, "newv", "m68k_dreg(regs, extra & 7)", "dst2"); + genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, extra & 7)", "dst2"); printf ("\tif (GET_ZFLG (®s->ccrflags)) {\n"); - printf ("\tput_long(rn1, m68k_dreg(regs, (extra >> 22) & 7));\n"); - printf ("\tput_long(rn1, m68k_dreg(regs, (extra >> 6) & 7));\n"); + printf ("\tput_long (rn1, m68k_dreg (regs, (extra >> 22) & 7));\n"); + printf ("\tput_long (rn1, m68k_dreg (regs, (extra >> 6) & 7));\n"); printf ("\t}}\n"); pop_braces (old_brace_level); printf ("\tif (! GET_ZFLG (®s->ccrflags)) {\n"); - printf ("\tm68k_dreg(regs, (extra >> 22) & 7) = dst1;\n"); - printf ("\tm68k_dreg(regs, (extra >> 6) & 7) = dst2;\n"); + printf ("\tm68k_dreg (regs, (extra >> 22) & 7) = dst1;\n"); + printf ("\tm68k_dreg (regs, (extra >> 6) & 7) = dst2;\n"); printf ("\t}\n"); } break; @@ -2622,9 +2622,9 @@ static void gen_opcode (unsigned long int opcode) genamode (curi->dmode, "dstreg", curi->size, "src", 1, 0, 0); printf ("\tif (extra & 0x8000) {\n"); switch (curi->size) { - case sz_byte: printf ("\tm68k_areg(regs, (extra >> 12) & 7) = (uae_s32)(uae_s8)src;\n"); break; - case sz_word: printf ("\tm68k_areg(regs, (extra >> 12) & 7) = (uae_s32)(uae_s16)src;\n"); break; - case sz_long: printf ("\tm68k_areg(regs, (extra >> 12) & 7) = src;\n"); break; + case sz_byte: printf ("\tm68k_areg (regs, (extra >> 12) & 7) = (uae_s32)(uae_s8)src;\n"); break; + case sz_word: printf ("\tm68k_areg (regs, (extra >> 12) & 7) = (uae_s32)(uae_s16)src;\n"); break; + case sz_long: printf ("\tm68k_areg (regs, (extra >> 12) & 7) = src;\n"); break; default: abort (); } printf ("\t} else {\n"); @@ -2635,27 +2635,27 @@ static void gen_opcode (unsigned long int opcode) break; case i_BKPT: /* only needed for hardware emulators */ sync_m68k_pc (); - printf ("\top_illg(opcode, regs);\n"); + printf ("\top_illg (opcode, regs);\n"); break; case i_CALLM: /* not present in 68030 */ sync_m68k_pc (); - printf ("\top_illg(opcode, regs);\n"); + printf ("\top_illg (opcode, regs);\n"); break; case i_RTM: /* not present in 68030 */ sync_m68k_pc (); - printf ("\top_illg(opcode, regs);\n"); + printf ("\top_illg (opcode, regs);\n"); break; case i_TRAPcc: if (curi->smode != am_unknown && curi->smode != am_illg) genamode (curi->smode, "srcreg", curi->size, "dummy", 1, 0, 0); fill_prefetch_0 (); - printf ("\tif (cctrue(®s->ccrflags, %d)) { Exception(7, regs, m68k_getpc(regs)); goto %s; }\n", curi->cc, endlabelstr); + printf ("\tif (cctrue(®s->ccrflags, %d)) { Exception (7, regs, m68k_getpc (regs)); goto %s; }\n", curi->cc, endlabelstr); need_endlabel = 1; break; case i_DIVL: sync_m68k_pc (); start_brace (); - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); genamode (curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0); sync_m68k_pc (); @@ -2678,14 +2678,14 @@ static void gen_opcode (unsigned long int opcode) genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); genamode (curi->dmode, "dstreg", sz_long, "dst", 2, 0, 0); start_brace (); - printf ("\tuae_s32 offset = extra & 0x800 ? m68k_dreg(regs, (extra >> 6) & 7) : (extra >> 6) & 0x1f;\n"); - printf ("\tint width = (((extra & 0x20 ? m68k_dreg(regs, extra & 7) : extra) -1) & 0x1f) +1;\n"); + printf ("\tuae_s32 offset = extra & 0x800 ? m68k_dreg (regs, (extra >> 6) & 7) : (extra >> 6) & 0x1f;\n"); + printf ("\tint width = (((extra & 0x20 ? m68k_dreg (regs, extra & 7) : extra) -1) & 0x1f) +1;\n"); if (curi->dmode == Dreg) { - printf ("\tuae_u32 tmp = m68k_dreg(regs, dstreg) << (offset & 0x1f);\n"); + printf ("\tuae_u32 tmp = m68k_dreg (regs, dstreg) << (offset & 0x1f);\n"); } else { printf ("\tuae_u32 tmp,bf0,bf1;\n"); printf ("\tdsta += (offset >> 3) | (offset & 0x80000000 ? ~0x1fffffff : 0);\n"); - printf ("\tbf0 = get_long(dsta);bf1 = get_byte(dsta+4) & 0xff;\n"); + printf ("\tbf0 = get_long (dsta);bf1 = get_byte (dsta+4) & 0xff;\n"); printf ("\ttmp = (bf0 << (offset & 7)) | (bf1 >> (8 - (offset & 7)));\n"); } printf ("\ttmp >>= (32 - width);\n"); @@ -2695,14 +2695,14 @@ static void gen_opcode (unsigned long int opcode) case i_BFTST: break; case i_BFEXTU: - printf ("\tm68k_dreg(regs, (extra >> 12) & 7) = tmp;\n"); + printf ("\tm68k_dreg (regs, (extra >> 12) & 7) = tmp;\n"); break; case i_BFCHG: printf ("\ttmp = ~tmp;\n"); break; case i_BFEXTS: printf ("\tif (GET_NFLG (®s->ccrflags)) tmp |= width == 32 ? 0 : (-1 << width);\n"); - printf ("\tm68k_dreg(regs, (extra >> 12) & 7) = tmp;\n"); + printf ("\tm68k_dreg (regs, (extra >> 12) & 7) = tmp;\n"); break; case i_BFCLR: printf ("\ttmp = 0;\n"); @@ -2710,13 +2710,13 @@ static void gen_opcode (unsigned long int opcode) case i_BFFFO: printf ("\t{ uae_u32 mask = 1 << (width-1);\n"); printf ("\twhile (mask) { if (tmp & mask) break; mask >>= 1; offset++; }}\n"); - printf ("\tm68k_dreg(regs, (extra >> 12) & 7) = offset;\n"); + printf ("\tm68k_dreg (regs, (extra >> 12) & 7) = offset;\n"); break; case i_BFSET: printf ("\ttmp = 0xffffffff;\n"); break; case i_BFINS: - printf ("\ttmp = m68k_dreg(regs, (extra >> 12) & 7);\n"); + printf ("\ttmp = m68k_dreg (regs, (extra >> 12) & 7);\n"); printf ("\tSET_NFLG (®s->ccrflags, tmp & (1 << (width - 1)) ? 1 : 0);\n"); printf ("\tSET_ZFLG (®s->ccrflags, tmp == 0);\n"); break; @@ -2730,53 +2730,53 @@ static void gen_opcode (unsigned long int opcode) { printf ("\ttmp <<= (32 - width);\n"); if (curi->dmode == Dreg) { - printf ("\tm68k_dreg(regs, dstreg) = (m68k_dreg(regs, dstreg) & ((offset & 0x1f) == 0 ? 0 :\n"); + printf ("\tm68k_dreg (regs, dstreg) = (m68k_dreg (regs, dstreg) & ((offset & 0x1f) == 0 ? 0 :\n"); printf ("\t\t(0xffffffff << (32 - (offset & 0x1f))))) |\n"); printf ("\t\t(tmp >> (offset & 0x1f)) |\n"); printf ("\t\t(((offset & 0x1f) + width) >= 32 ? 0 :\n"); - printf (" (m68k_dreg(regs, dstreg) & ((uae_u32)0xffffffff >> ((offset & 0x1f) + width))));\n"); + printf (" (m68k_dreg (regs, dstreg) & ((uae_u32)0xffffffff >> ((offset & 0x1f) + width))));\n"); } else { printf ("\tbf0 = (bf0 & (0xff000000 << (8 - (offset & 7)))) |\n"); printf ("\t\t(tmp >> (offset & 7)) |\n"); printf ("\t\t(((offset & 7) + width) >= 32 ? 0 :\n"); printf ("\t\t (bf0 & ((uae_u32)0xffffffff >> ((offset & 7) + width))));\n"); - printf ("\tput_long(dsta,bf0 );\n"); + printf ("\tput_long (dsta,bf0 );\n"); printf ("\tif (((offset & 7) + width) > 32) {\n"); printf ("\t\tbf1 = (bf1 & (0xff >> (width - 32 + (offset & 7)))) |\n"); printf ("\t\t\t(tmp << (8 - (offset & 7)));\n"); - printf ("\t\tput_byte(dsta+4,bf1);\n"); + printf ("\t\tput_byte (dsta+4,bf1);\n"); printf ("\t}\n"); } } break; case i_PACK: if (curi->smode == Dreg) { - printf ("\tuae_u16 val = m68k_dreg(regs, srcreg) + %s;\n", gen_nextiword (0)); - printf ("\tm68k_dreg(regs, dstreg) = (m68k_dreg(regs, dstreg) & 0xffffff00) | ((val >> 4) & 0xf0) | (val & 0xf);\n"); + printf ("\tuae_u16 val = m68k_dreg (regs, srcreg) + %s;\n", gen_nextiword (0)); + printf ("\tm68k_dreg (regs, dstreg) = (m68k_dreg (regs, dstreg) & 0xffffff00) | ((val >> 4) & 0xf0) | (val & 0xf);\n"); } else { printf ("\tuae_u16 val;\n"); - printf ("\tm68k_areg(regs, srcreg) -= areg_byteinc[srcreg];\n"); - printf ("\tval = (uae_u16)get_byte(m68k_areg(regs, srcreg));\n"); - printf ("\tm68k_areg(regs, srcreg) -= areg_byteinc[srcreg];\n"); - printf ("\tval = (val | ((uae_u16)get_byte(m68k_areg(regs, srcreg)) << 8)) + %s;\n", gen_nextiword (0)); - printf ("\tm68k_areg(regs, dstreg) -= areg_byteinc[dstreg];\n"); - printf ("\tput_byte(m68k_areg(regs, dstreg),((val >> 4) & 0xf0) | (val & 0xf));\n"); + printf ("\tm68k_areg (regs, srcreg) -= areg_byteinc[srcreg];\n"); + printf ("\tval = (uae_u16)get_byte (m68k_areg (regs, srcreg));\n"); + printf ("\tm68k_areg (regs, srcreg) -= areg_byteinc[srcreg];\n"); + printf ("\tval = (val | ((uae_u16)get_byte (m68k_areg (regs, srcreg)) << 8)) + %s;\n", gen_nextiword (0)); + printf ("\tm68k_areg (regs, dstreg) -= areg_byteinc[dstreg];\n"); + printf ("\tput_byte (m68k_areg (regs, dstreg),((val >> 4) & 0xf0) | (val & 0xf));\n"); } break; case i_UNPK: if (curi->smode == Dreg) { - printf ("\tuae_u16 val = m68k_dreg(regs, srcreg);\n"); + printf ("\tuae_u16 val = m68k_dreg (regs, srcreg);\n"); printf ("\tval = (((val << 4) & 0xf00) | (val & 0xf)) + %s;\n", gen_nextiword (0)); - printf ("\tm68k_dreg(regs, dstreg) = (m68k_dreg(regs, dstreg) & 0xffff0000) | (val & 0xffff);\n"); + printf ("\tm68k_dreg (regs, dstreg) = (m68k_dreg (regs, dstreg) & 0xffff0000) | (val & 0xffff);\n"); } else { printf ("\tuae_u16 val;\n"); - printf ("\tm68k_areg(regs, srcreg) -= areg_byteinc[srcreg];\n"); - printf ("\tval = (uae_u16)get_byte(m68k_areg(regs, srcreg));\n"); + printf ("\tm68k_areg (regs, srcreg) -= areg_byteinc[srcreg];\n"); + printf ("\tval = (uae_u16)get_byte (m68k_areg (regs, srcreg));\n"); printf ("\tval = (((val << 4) & 0xf00) | (val & 0xf)) + %s;\n", gen_nextiword (0)); - printf ("\tm68k_areg(regs, dstreg) -= areg_byteinc[dstreg];\n"); - printf ("\tput_byte(m68k_areg(regs, dstreg),val);\n"); - printf ("\tm68k_areg(regs, dstreg) -= areg_byteinc[dstreg];\n"); - printf ("\tput_byte(m68k_areg(regs, dstreg),val >> 8);\n"); + printf ("\tm68k_areg (regs, dstreg) -= areg_byteinc[dstreg];\n"); + printf ("\tput_byte (m68k_areg (regs, dstreg),val);\n"); + printf ("\tm68k_areg (regs, dstreg) -= areg_byteinc[dstreg];\n"); + printf ("\tput_byte (m68k_areg (regs, dstreg),val >> 8);\n"); } break; case i_TAS: @@ -2798,42 +2798,42 @@ static void gen_opcode (unsigned long int opcode) fpulimit(); genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); sync_m68k_pc (); - printf ("\tfpuop_dbcc(opcode, regs, extra);\n"); + printf ("\tfpuop_dbcc (opcode, regs, extra);\n"); break; case i_FScc: fpulimit(); genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); sync_m68k_pc (); - printf ("\tfpuop_scc(opcode, regs, extra);\n"); + printf ("\tfpuop_scc (opcode, regs, extra);\n"); break; case i_FTRAPcc: fpulimit(); sync_m68k_pc (); start_brace (); - printf ("\tuaecptr oldpc = m68k_getpc(regs);\n"); + printf ("\tuaecptr oldpc = m68k_getpc (regs);\n"); if (curi->smode != am_unknown && curi->smode != am_illg) genamode (curi->smode, "srcreg", curi->size, "dummy", 1, 0, 0); sync_m68k_pc (); - printf ("\tfpuop_trapcc(opcode, regs, oldpc);\n"); + printf ("\tfpuop_trapcc (opcode, regs, oldpc);\n"); break; case i_FBcc: fpulimit(); sync_m68k_pc (); start_brace (); - printf ("\tuaecptr pc = m68k_getpc(regs);\n"); + printf ("\tuaecptr pc = m68k_getpc (regs);\n"); genamode (curi->dmode, "srcreg", curi->size, "extra", 1, 0, 0); sync_m68k_pc (); - printf ("\tfpuop_bcc(opcode,regs, pc,extra);\n"); + printf ("\tfpuop_bcc (opcode,regs, pc,extra);\n"); break; case i_FSAVE: fpulimit(); sync_m68k_pc (); - printf ("\tfpuop_save(opcode, regs);\n"); + printf ("\tfpuop_save (opcode, regs);\n"); break; case i_FRESTORE: fpulimit(); sync_m68k_pc (); - printf ("\tfpuop_restore(opcode, regs);\n"); + printf ("\tfpuop_restore (opcode, regs);\n"); break; case i_CINVL: @@ -2863,52 +2863,52 @@ static void gen_opcode (unsigned long int opcode) case i_MOVE16: if ((opcode & 0xfff8) == 0xf620) { /* MOVE16 (Ax)+,(Ay)+ */ - printf ("\tuaecptr mems = m68k_areg(regs, srcreg) & ~15, memd;\n"); - printf ("\tdstreg = (%s >> 12) & 7;\n", gen_nextiword(0)); - printf ("\tmemd = m68k_areg(regs, dstreg) & ~15;\n"); - printf ("\tput_long(memd, get_long(mems));\n"); - printf ("\tput_long(memd+4, get_long(mems+4));\n"); - printf ("\tput_long(memd+8, get_long(mems+8));\n"); - printf ("\tput_long(memd+12, get_long(mems+12));\n"); + printf ("\tuaecptr mems = m68k_areg (regs, srcreg) & ~15, memd;\n"); + printf ("\tdstreg = (%s >> 12) & 7;\n", gen_nextiword (0)); + printf ("\tmemd = m68k_areg (regs, dstreg) & ~15;\n"); + printf ("\tput_long (memd, get_long (mems));\n"); + printf ("\tput_long (memd+4, get_long (mems+4));\n"); + printf ("\tput_long (memd+8, get_long (mems+8));\n"); + printf ("\tput_long (memd+12, get_long (mems+12));\n"); printf ("\tif (srcreg != dstreg)\n"); - printf ("\tm68k_areg(regs, srcreg) += 16;\n"); - printf ("\tm68k_areg(regs, dstreg) += 16;\n"); + printf ("\tm68k_areg (regs, srcreg) += 16;\n"); + printf ("\tm68k_areg (regs, dstreg) += 16;\n"); } else { /* Other variants */ genamode (curi->smode, "srcreg", curi->size, "mems", 0, 2, 0); genamode (curi->dmode, "dstreg", curi->size, "memd", 0, 2, 0); printf ("\tmemsa &= ~15;\n"); printf ("\tmemda &= ~15;\n"); - printf ("\tput_long(memda, get_long(memsa));\n"); - printf ("\tput_long(memda+4, get_long(memsa+4));\n"); - printf ("\tput_long(memda+8, get_long(memsa+8));\n"); - printf ("\tput_long(memda+12, get_long(memsa+12));\n"); + printf ("\tput_long (memda, get_long (memsa));\n"); + printf ("\tput_long (memda+4, get_long (memsa+4));\n"); + printf ("\tput_long (memda+8, get_long (memsa+8));\n"); + printf ("\tput_long (memda+12, get_long (memsa+12));\n"); if ((opcode & 0xfff8) == 0xf600) - printf ("\tm68k_areg(regs, srcreg) += 16;\n"); + printf ("\tm68k_areg (regs, srcreg) += 16;\n"); else if ((opcode & 0xfff8) == 0xf608) - printf ("\tm68k_areg(regs, dstreg) += 16;\n"); + printf ("\tm68k_areg (regs, dstreg) += 16;\n"); } break; case i_MMUOP: genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); sync_m68k_pc (); - printf ("\tmmu_op(opcode, regs, extra);\n"); + printf ("\tmmu_op (opcode, regs, extra);\n"); break; case i_MMUOP30A: printf ("\tuaecptr pc = m68k_getpc (regs);\n"); if (curi->smode == Areg || curi->smode == Dreg) printf("\tuae_u16 extraa = 0;\n"); - else + else genamode (curi->smode, "srcreg", curi->size, "extra", 0, 0, 0); sync_m68k_pc (); - printf ("\tmmu_op30(pc, opcode, regs, 1, extraa);\n"); + printf ("\tmmu_op30 (pc, opcode, regs, 1, extraa);\n"); break; case i_MMUOP30B: printf ("\tuaecptr pc = m68k_getpc (regs);\n"); genamode (curi->smode, "srcreg", curi->size, "extra", 0, 0, 0); sync_m68k_pc (); - printf ("\tmmu_op30(pc, opcode, regs, 0, 0);\n"); + printf ("\tmmu_op30 (pc, opcode, regs, 0, 0);\n"); break; default: abort (); diff --git a/gencpu_mini.c b/gencpu_mini.c index cf40f3a7..0b9c7e6a 100755 --- a/gencpu_mini.c +++ b/gencpu_mini.c @@ -138,7 +138,7 @@ static const char *gen_nextilong (void) int r = m68k_pc_offset; m68k_pc_offset += 4; - sprintf (buffer, "xget_ilong(%d)", r); + sprintf (buffer, "xget_ilong (%d)", r); return buffer; } @@ -148,7 +148,7 @@ static const char *gen_nextiword (void) int r = m68k_pc_offset; m68k_pc_offset += 2; - sprintf (buffer, "xget_iword(%d)", r); + sprintf (buffer, "xget_iword (%d)", r); return buffer; } @@ -158,7 +158,7 @@ static const char *gen_nextibyte (void) int r = m68k_pc_offset; m68k_pc_offset += 2; - sprintf (buffer, "xget_ibyte(%d)", r); + sprintf (buffer, "xget_ibyte (%d)", r); return buffer; } @@ -186,20 +186,20 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge #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); + printf ("\tuae_s8 %s = ((uae_u8*)&m68k_dreg (regs, %s))[3];\n", name, reg); #else - printf ("\tuae_s8 %s = xm68k_dreg(%s);\n", name, reg); + printf ("\tuae_s8 %s = xm68k_dreg (%s);\n", name, reg); #endif break; case sz_word: #if defined(AMIGA) && !defined(WARPUP) - printf ("\tuae_s16 %s = ((uae_s16*)&m68k_dreg(regs, %s))[1];\n", name, reg); + printf ("\tuae_s16 %s = ((uae_s16*)&m68k_dreg (regs, %s))[1];\n", name, reg); #else - printf ("\tuae_s16 %s = xm68k_dreg(%s);\n", name, reg); + printf ("\tuae_s16 %s = xm68k_dreg (%s);\n", name, reg); #endif break; case sz_long: - printf ("\tuae_s32 %s = xm68k_dreg(%s);\n", name, reg); + printf ("\tuae_s32 %s = xm68k_dreg (%s);\n", name, reg); break; default: abort (); @@ -211,41 +211,41 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge if (getv == 1) switch (size) { case sz_word: - printf ("\tuae_s16 %s = xm68k_areg(%s);\n", name, reg); + printf ("\tuae_s16 %s = xm68k_areg (%s);\n", name, reg); break; case sz_long: - printf ("\tuae_s32 %s = xm68k_areg(%s);\n", name, reg); + printf ("\tuae_s32 %s = xm68k_areg (%s);\n", name, reg); break; default: abort (); } return; case Aind: - printf ("\tuaecptr %sa = xm68k_areg(%s);\n", name, reg); + printf ("\tuaecptr %sa = xm68k_areg (%s);\n", name, reg); break; case Aipi: - printf ("\tuaecptr %sa = xm68k_areg(%s);\n", name, reg); + printf ("\tuaecptr %sa = xm68k_areg (%s);\n", name, reg); break; case Apdi: switch (size) { case sz_byte: if (movem) - printf ("\tuaecptr %sa = xm68k_areg(%s);\n", name, reg); + printf ("\tuaecptr %sa = xm68k_areg (%s);\n", name, reg); else - printf ("\tuaecptr %sa = xm68k_areg(%s) - xareg_byteinc[%s];\n", name, reg, reg); + printf ("\tuaecptr %sa = xm68k_areg (%s) - xareg_byteinc[%s];\n", name, reg, reg); break; case sz_word: - printf ("\tuaecptr %sa = xm68k_areg(%s) - %d;\n", name, reg, movem ? 0 : 2); + printf ("\tuaecptr %sa = xm68k_areg (%s) - %d;\n", name, reg, movem ? 0 : 2); break; case sz_long: - printf ("\tuaecptr %sa = xm68k_areg(%s) - %d;\n", name, reg, movem ? 0 : 4); + printf ("\tuaecptr %sa = xm68k_areg (%s) - %d;\n", name, reg, movem ? 0 : 4); break; default: abort (); } break; case Ad16: - printf ("\tuaecptr %sa = xm68k_areg(%s) + (uae_s32)(uae_s16)%s;\n", name, reg, gen_nextiword ()); + printf ("\tuaecptr %sa = xm68k_areg (%s) + (uae_s32)(uae_s16)%s;\n", name, reg, gen_nextiword ()); break; case Ad8r: if (cpu_level > 1) { @@ -254,9 +254,9 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge sync_m68k_pc (); start_brace (); /* This would ordinarily be done in gen_nextiword, which we bypass. */ - printf ("\tuaecptr %sa = xget_disp_ea_020(xm68k_areg(%s), xnext_iword());\n", name, reg); + printf ("\tuaecptr %sa = xget_disp_ea_020 (xm68k_areg (%s), xnext_iword ());\n", name, reg); } else - printf ("\tuaecptr %sa = xget_disp_ea_000(xm68k_areg(%s), %s);\n", name, reg, gen_nextiword ()); + printf ("\tuaecptr %sa = xget_disp_ea_000 (xm68k_areg (%s), %s);\n", name, reg, gen_nextiword ()); break; case PC16: @@ -270,11 +270,11 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge sync_m68k_pc (); start_brace (); /* This would ordinarily be done in gen_nextiword, which we bypass. */ - printf ("\tuaecptr tmppc = xm68k_getpc();\n"); - printf ("\tuaecptr %sa = xget_disp_ea_020(tmppc, xnext_iword());\n", name); + printf ("\tuaecptr tmppc = xm68k_getpc ();\n"); + printf ("\tuaecptr %sa = xget_disp_ea_020(tmppc, xnext_iword ());\n", name); } else { - printf ("\tuaecptr tmppc = xm68k_getpc() + %d;\n", m68k_pc_offset); - printf ("\tuaecptr %sa = xget_disp_ea_000(tmppc, %s);\n", name, gen_nextiword ()); + printf ("\tuaecptr tmppc = xm68k_getpc () + %d;\n", m68k_pc_offset); + printf ("\tuaecptr %sa = xget_disp_ea_000 (tmppc, %s);\n", name, gen_nextiword ()); } break; @@ -328,9 +328,9 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge if (getv == 1) { start_brace (); switch (size) { - case sz_byte: printf ("\tuae_s8 %s = xget_byte(%sa);\n", name, name); break; - case sz_word: printf ("\tuae_s16 %s = xget_word(%sa);\n", name, name); break; - case sz_long: printf ("\tuae_s32 %s = xget_long(%sa);\n", name, name); break; + case sz_byte: printf ("\tuae_s8 %s = xget_byte (%sa);\n", name, name); break; + case sz_word: printf ("\tuae_s16 %s = xget_word (%sa);\n", name, name); break; + case sz_long: printf ("\tuae_s32 %s = xget_long (%sa);\n", name, name); break; default: abort (); } } @@ -342,13 +342,13 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge case Aipi: switch (size) { case sz_byte: - printf ("\txm68k_areg(%s) += xareg_byteinc[%s];\n", reg, reg); + printf ("\txm68k_areg (%s) += xareg_byteinc[%s];\n", reg, reg); break; case sz_word: - printf ("\txm68k_areg(%s) += 2;\n", reg); + printf ("\txm68k_areg (%s) += 2;\n", reg); break; case sz_long: - printf ("\txm68k_areg(%s) += 4;\n", reg); + printf ("\txm68k_areg (%s) += 4;\n", reg); break; default: abort (); @@ -368,13 +368,13 @@ static void genastore (char *from, amodes mode, char *reg, wordsizes size, char case Dreg: switch (size) { case sz_byte: - printf ("\txm68k_dreg(%s) = (xm68k_dreg(%s) & ~0xff) | ((%s) & 0xff);\n", reg, reg, from); + printf ("\txm68k_dreg (%s) = (xm68k_dreg (%s) & ~0xff) | ((%s) & 0xff);\n", reg, reg, from); break; case sz_word: - printf ("\txm68k_dreg(%s) = (xm68k_dreg(%s) & ~0xffff) | ((%s) & 0xffff);\n", reg, reg, from); + printf ("\txm68k_dreg (%s) = (xm68k_dreg (%s) & ~0xffff) | ((%s) & 0xffff);\n", reg, reg, from); break; case sz_long: - printf ("\txm68k_dreg(%s) = (%s);\n", reg, from); + printf ("\txm68k_dreg (%s) = (%s);\n", reg, from); break; default: abort (); @@ -383,10 +383,10 @@ static void genastore (char *from, amodes mode, char *reg, wordsizes size, char case Areg: switch (size) { case sz_word: - printf ("\txm68k_areg(%s) = (uae_s32)(uae_s16)(%s);\n", reg, from); + printf ("\txm68k_areg (%s) = (uae_s32)(uae_s16)(%s);\n", reg, from); break; case sz_long: - printf ("\txm68k_areg(%s) = (%s);\n", reg, from); + printf ("\txm68k_areg (%s) = (%s);\n", reg, from); break; default: abort (); @@ -405,17 +405,17 @@ static void genastore (char *from, amodes mode, char *reg, wordsizes size, char sync_m68k_pc (); switch (size) { case sz_byte: - printf ("\txput_byte(%sa,%s);\n", to, from); + printf ("\txput_byte (%sa,%s);\n", to, from); break; case sz_word: if (cpu_level < 2 && (mode == PC16 || mode == PC8r)) abort (); - printf ("\txput_word(%sa,%s);\n", to, from); + printf ("\txput_word (%sa,%s);\n", to, from); break; case sz_long: if (cpu_level < 2 && (mode == PC16 || mode == PC8r)) abort (); - printf ("\txput_long(%sa,%s);\n", to, from); + printf ("\txput_long (%sa,%s);\n", to, from); break; default: abort (); @@ -439,22 +439,22 @@ static void genmovemel (uae_u16 opcode) int size = table68k[opcode].size == sz_long ? 4 : 2; if (table68k[opcode].size == sz_long) { - strcpy (getcode, "xget_long(srca)"); + strcpy (getcode, "xget_long (srca)"); } else { - strcpy (getcode, "(uae_s32)(uae_s16)xget_word(srca)"); + strcpy (getcode, "(uae_s32)(uae_s16)xget_word (srca)"); } printf ("\tuae_u16 mask = %s;\n", gen_nextiword ()); printf ("\tunsigned int dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); genamode (table68k[opcode].dmode, "dstreg", table68k[opcode].size, "src", 2, 1); start_brace (); - printf ("\twhile (dmask) { xm68k_dreg(xmovem_index1[dmask]) = %s; srca += %d; dmask = xmovem_next[dmask]; }\n", + printf ("\twhile (dmask) { xm68k_dreg (xmovem_index1[dmask]) = %s; srca += %d; dmask = xmovem_next[dmask]; }\n", getcode, size); - printf ("\twhile (amask) { xm68k_areg(xmovem_index1[amask]) = %s; srca += %d; amask = xmovem_next[amask]; }\n", + printf ("\twhile (amask) { xm68k_areg (xmovem_index1[amask]) = %s; srca += %d; amask = xmovem_next[amask]; }\n", getcode, size); if (table68k[opcode].dmode == Aipi) - printf ("\txm68k_areg(dstreg) = srca;\n"); + printf ("\txm68k_areg (dstreg) = srca;\n"); } static void genmovemle (uae_u16 opcode) @@ -462,9 +462,9 @@ static void genmovemle (uae_u16 opcode) char putcode[100]; int size = table68k[opcode].size == sz_long ? 4 : 2; if (table68k[opcode].size == sz_long) { - strcpy (putcode, "xput_long(srca,"); + strcpy (putcode, "xput_long (srca,"); } else { - strcpy (putcode, "xput_word(srca,"); + strcpy (putcode, "xput_word (srca,"); } printf ("\tuae_u16 mask = %s;\n", gen_nextiword ()); @@ -475,16 +475,16 @@ static void genmovemle (uae_u16 opcode) start_brace (); if (table68k[opcode].dmode == Apdi) { printf ("\tuae_u16 amask = mask & 0xff, dmask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (amask) { srca -= %d; %s xm68k_areg(xmovem_index2[amask])); amask = xmovem_next[amask]; }\n", + printf ("\twhile (amask) { srca -= %d; %s xm68k_areg (xmovem_index2[amask])); amask = xmovem_next[amask]; }\n", size, putcode); - printf ("\twhile (dmask) { srca -= %d; %s xm68k_dreg(xmovem_index2[dmask])); dmask = xmovem_next[dmask]; }\n", + printf ("\twhile (dmask) { srca -= %d; %s xm68k_dreg (xmovem_index2[dmask])); dmask = xmovem_next[dmask]; }\n", size, putcode); - printf ("\txm68k_areg(dstreg) = srca;\n"); + printf ("\txm68k_areg (dstreg) = srca;\n"); } else { printf ("\tuae_u16 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (dmask) { %s xm68k_dreg(xmovem_index1[dmask])); srca += %d; dmask = xmovem_next[dmask]; }\n", + printf ("\twhile (dmask) { %s xm68k_dreg (xmovem_index1[dmask])); srca += %d; dmask = xmovem_next[dmask]; }\n", putcode, size); - printf ("\twhile (amask) { %s xm68k_areg(xmovem_index1[amask])); srca += %d; amask = xmovem_next[amask]; }\n", + printf ("\twhile (amask) { %s xm68k_areg (xmovem_index1[amask])); srca += %d; amask = xmovem_next[amask]; }\n", putcode, size); } } @@ -710,7 +710,7 @@ static void genflags (flagtypes type, wordsizes size, char *value, char *src, ch case sz_long: printf ("\toptflag_cmpl ((uae_s32)(%s), (uae_s32)(%s));\n", src, dst); break; } return; - + default: break; } @@ -972,22 +972,22 @@ static void gen_opcode (unsigned long int opcode) case i_MVPRM: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0); - printf ("\tuaecptr memp = xm68k_areg(dstreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword ()); + printf ("\tuaecptr memp = xm68k_areg (dstreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword ()); if (curi->size == sz_word) { - printf ("\txput_byte(memp, src >> 8); xput_byte(memp + 2, src);\n"); + printf ("\txput_byte (memp, src >> 8); xput_byte (memp + 2, src);\n"); } else { - printf ("\txput_byte(memp, src >> 24); xput_byte(memp + 2, src >> 16);\n"); - printf ("\txput_byte(memp + 4, src >> 8); xput_byte(memp + 6, src);\n"); + printf ("\txput_byte (memp, src >> 24); xput_byte (memp + 2, src >> 16);\n"); + printf ("\txput_byte (memp + 4, src >> 8); xput_byte (memp + 6, src);\n"); } break; case i_MVPMR: - printf ("\tuaecptr memp = xm68k_areg(srcreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword ()); + printf ("\tuaecptr memp = xm68k_areg (srcreg) + (uae_s32)(uae_s16)%s;\n", gen_nextiword ()); genamode (curi->dmode, "dstreg", curi->size, "dst", 2, 0); if (curi->size == sz_word) { - printf ("\tuae_u16 val = (xget_byte(memp) << 8) + xget_byte(memp + 2);\n"); + printf ("\tuae_u16 val = (xget_byte (memp) << 8) + xget_byte (memp + 2);\n"); } else { - printf ("\tuae_u32 val = (xget_byte(memp) << 24) + (xget_byte(memp + 2) << 16)\n"); - printf (" + (xget_byte(memp + 4) << 8) + xget_byte(memp + 6);\n"); + printf ("\tuae_u32 val = (xget_byte (memp) << 24) + (xget_byte (memp + 2) << 16)\n"); + printf (" + (xget_byte (memp + 4) << 8) + xget_byte (memp + 6);\n"); } genastore ("val", curi->dmode, "dstreg", curi->size, "dst"); break; @@ -1046,45 +1046,45 @@ static void gen_opcode (unsigned long int opcode) genamode (Apdi, "7", sz_long, "old", 2, 0); genamode (curi->smode, "srcreg", sz_long, "src", 1, 0); genastore ("src", Apdi, "7", sz_long, "old"); - genastore ("xm68k_areg(7)", curi->smode, "srcreg", sz_long, "src"); + genastore ("xm68k_areg (7)", curi->smode, "srcreg", sz_long, "src"); genamode (curi->dmode, "dstreg", curi->size, "offs", 1, 0); - printf ("\txm68k_areg(7) += offs;\n"); + printf ("\txm68k_areg (7) += offs;\n"); break; case i_UNLK: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0); - printf ("\txm68k_areg(7) = src;\n"); + printf ("\txm68k_areg (7) = src;\n"); genamode (Aipi, "7", sz_long, "old", 1, 0); genastore ("old", curi->smode, "srcreg", curi->size, "src"); break; case i_RTS: - printf ("\txm68k_setpc(xget_long(xm68k_areg(7)));\n"); - printf ("\txm68k_areg(7) += 4;\n"); + printf ("\txm68k_setpc (xget_long (xm68k_areg (7)));\n"); + printf ("\txm68k_areg (7) += 4;\n"); m68k_pc_offset = 0; break; case i_JSR: genamode (curi->smode, "srcreg", curi->size, "src", 0, 0); - printf ("\txm68k_areg(7) -= 4;\n"); - printf ("\txput_long(xm68k_areg(7), xm68k_getpc() + %d);\n", m68k_pc_offset); - printf ("\txm68k_setpc(srca);\n"); + printf ("\txm68k_areg (7) -= 4;\n"); + printf ("\txput_long (xm68k_areg (7), xm68k_getpc () + %d);\n", m68k_pc_offset); + printf ("\txm68k_setpc (srca);\n"); m68k_pc_offset = 0; break; case i_JMP: genamode (curi->smode, "srcreg", curi->size, "src", 0, 0); - printf ("\txm68k_setpc(srca);\n"); + printf ("\txm68k_setpc (srca);\n"); m68k_pc_offset = 0; break; case i_BSR: genamode (curi->smode, "srcreg", curi->size, "src", 1, 0); printf ("\tuae_s32 s = (uae_s32)src + 2;\n"); - printf ("\txm68k_areg(7) -= 4;\n"); - printf ("\txput_long(xm68k_areg(7), xm68k_getpc() + %d);\n", m68k_pc_offset); + printf ("\txm68k_areg (7) -= 4;\n"); + printf ("\txput_long (xm68k_areg (7), xm68k_getpc () + %d);\n", m68k_pc_offset); printf ("\txm68k_incpc(s);\n"); m68k_pc_offset = 0; break; case i_Bcc: if (curi->size == sz_long) { if (next_cpu_level < 1) - next_cpu_level = 1; + next_cpu_level = 1; } genamode (curi->smode, "srcreg", curi->size, "src", 1, 0); printf ("\tif (!xcctrue(%d)) goto didnt_jump;\n", curi->cc); @@ -1121,7 +1121,7 @@ static void gen_opcode (unsigned long int opcode) genastore ("val", curi->smode, "srcreg", curi->size, "src"); break; case i_DIVU: - printf ("\tuaecptr oldpc = xm68k_getpc();\n"); + printf ("\tuaecptr oldpc = xm68k_getpc ();\n"); genamode (curi->smode, "srcreg", sz_word, "src", 1, 0); genamode (curi->dmode, "dstreg", sz_long, "dst", 1, 0); sync_m68k_pc (); @@ -1140,7 +1140,7 @@ static void gen_opcode (unsigned long int opcode) need_endlabel = 1; break; case i_DIVS: - printf ("\tuaecptr oldpc = xm68k_getpc();\n"); + printf ("\tuaecptr oldpc = xm68k_getpc ();\n"); genamode (curi->smode, "srcreg", sz_word, "src", 1, 0); genamode (curi->dmode, "dstreg", sz_long, "dst", 1, 0); sync_m68k_pc (); @@ -1646,7 +1646,7 @@ static void generate_one_opcode (int rp) /* Check that we can do the little endian optimization safely. */ if (pos < 8 && (dmsk >> (8 - pos)) != 0) abort (); -#endif +#endif if (pos) printf ("\tuae_u32 dstreg = (opcode >> %d) & %d;\n", pos, dmsk); diff --git a/gfxlib.c b/gfxlib.c index 64ddd9c5..73e13a0f 100755 --- a/gfxlib.c +++ b/gfxlib.c @@ -65,7 +65,7 @@ static struct uniq_head *find_uniq (uniq_list *a, uae_u32 uniq) while (b && b->uniq != uniq) b = b->next; if (!b) - write_log("Couldn't find structure. Bad\n"); + write_log ("Couldn't find structure. Bad\n"); return b; } @@ -76,7 +76,7 @@ static struct uniq_head *find_and_rem_uniq (uniq_list *a, uae_u32 uniq) b = &(*b)->next; c = *b; if (!c) - write_log("Couldn't find structure. Bad\n"); + write_log ("Couldn't find structure. Bad\n"); else *b = c->next; return c; @@ -85,7 +85,7 @@ static struct uniq_head *find_and_rem_uniq (uniq_list *a, uae_u32 uniq) static void add_uniq (uniq_list *a, struct uniq_head *item, uaecptr amem) { item->uniq = a->uniq++; - put_long(amem, item->uniq); + put_long (amem, item->uniq); if (a->uniq == 0) a->uniq++; item->next = a->head; @@ -103,18 +103,18 @@ static void do_LockLayer(uaecptr layer) { #if 0 /* Later.. */ uaecptr sigsem = layer + 72; - m68k_areg(regs, 0) = sigsem; - CallLib(get_long(4), -564); + m68k_areg (regs, 0) = sigsem; + CallLib (get_long (4), -564); #else - m68k_areg(regs, 1) = layer; - CallLib(layersbase, -96); + m68k_areg (regs, 1) = layer; + CallLib (layersbase, -96); #endif } static void do_UnlockLayer(uaecptr layer) { - m68k_areg(regs, 0) = layer; - CallLib(layersbase, -102); + m68k_areg (regs, 0) = layer; + CallLib (layersbase, -102); } static uae_u32 gfxlibname, layerslibname; @@ -125,10 +125,10 @@ struct Rectangle { static int GFX_PointInRectangle(uaecptr rect, int x, int y) { - uae_s16 minx = get_word(rect); - uae_s16 miny = get_word(rect+2); - uae_s16 maxx = get_word(rect+4); - uae_s16 maxy = get_word(rect+6); + uae_s16 minx = get_word (rect); + uae_s16 miny = get_word (rect+2); + uae_s16 maxx = get_word (rect+4); + uae_s16 maxy = get_word (rect+6); if (x < minx || x > maxx || y < miny || y > maxy) return 0; @@ -143,10 +143,10 @@ static int GFX_RectContainsRect(struct Rectangle *r1, struct Rectangle *r2) static struct Rectangle *GFX_RectFA(struct Rectangle *rp, uaecptr rect) { - rp->MinX = (uae_s16)get_word(rect); - rp->MinY = (uae_s16)get_word(rect+2); - rp->MaxX = (uae_s16)get_word(rect+4); - rp->MaxY = (uae_s16)get_word(rect+6); + rp->MinX = (uae_s16)get_word (rect); + rp->MinY = (uae_s16)get_word (rect+2); + rp->MaxX = (uae_s16)get_word (rect+4); + rp->MaxY = (uae_s16)get_word (rect+6); return rp; } @@ -157,10 +157,10 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp) unsigned int rows = get_word (bitmap + 2); uae_u16 mask; - uae_u8 planemask = get_byte(rp + 24); - uae_u8 fgpen = get_byte(rp + 25); - uae_u8 bgpen = get_byte(rp + 26); - uae_u8 drmd = get_byte(rp + 28); + uae_u8 planemask = get_byte (rp + 24); + uae_u8 fgpen = get_byte (rp + 25); + uae_u8 bgpen = get_byte (rp + 26); + uae_u8 drmd = get_byte (rp + 28); uae_u8 pen = drmd & 4 ? bgpen : fgpen; if (x < 0 || y < 0 || x >= 8*bpr || y >= rows) @@ -175,8 +175,8 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp) if ((planemask & (1 << i)) == 0) continue; - planeptr = get_long(bitmap + 8 + i*4); - data = get_word(planeptr + offs); + planeptr = get_long (bitmap + 8 + i*4); + data = get_word (planeptr + offs); mask = 0x8000 >> (x & 15); @@ -188,7 +188,7 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp) if ((pen & (1 << i)) != 0) data |= mask; } - put_word(planeptr + offs, data); + put_word (planeptr + offs, data); } return 0; } @@ -196,8 +196,8 @@ static int GFX_Bitmap_WritePixel(uaecptr bitmap, int x, int y, uaecptr rp) int GFX_WritePixel(uaecptr rp, int x, int y) { int v; - uaecptr layer = get_long(rp); - uaecptr bitmap = get_long(rp + 4); + uaecptr layer = get_long (rp); + uaecptr bitmap = get_long (rp + 4); uaecptr cliprect; int x2, y2; @@ -218,17 +218,17 @@ int GFX_WritePixel(uaecptr rp, int x, int y) * Not good. */ - x2 = x + (uae_s16)get_word(layer + 16); - y2 = y + (uae_s16)get_word(layer + 18); + x2 = x + (uae_s16)get_word (layer + 16); + y2 = y + (uae_s16)get_word (layer + 18); if (!GFX_PointInRectangle (layer + 16, x2, y2)) { do_UnlockLayer(layer); return -1; } /* Find the right ClipRect */ - cliprect = get_long(layer + 8); + cliprect = get_long (layer + 8); while (cliprect != 0 && !GFX_PointInRectangle (cliprect + 16, x2, y2)) - cliprect = get_long(cliprect); + cliprect = get_long (cliprect); if (cliprect == 0) { /* Don't complain: The "Dots" demo does this all the time. I * suppose if we can't find a ClipRect, we aren't supposed to draw @@ -236,29 +236,29 @@ int GFX_WritePixel(uaecptr rp, int x, int y) */ /*write_log ("Weirdness in WritePixel\n");*/ v = -1; - } else if (get_long(cliprect + 8) == 0) { + } else if (get_long (cliprect + 8) == 0) { v = GFX_Bitmap_WritePixel(bitmap, x2, y2, rp); - } else if (get_long(cliprect + 12) == 0) { + } else if (get_long (cliprect + 12) == 0) { /* I don't really know what to do here... */ v = 0; } else { /* This appears to be normal for smart refresh layers which are obscured */ - v = GFX_Bitmap_WritePixel (get_long(cliprect + 12), x2 - (uae_s16)get_word(cliprect + 16), - y2 - (uae_s16)get_word(cliprect + 18), rp); + v = GFX_Bitmap_WritePixel (get_long (cliprect + 12), x2 - (uae_s16)get_word (cliprect + 16), + y2 - (uae_s16)get_word (cliprect + 18), rp); } do_UnlockLayer(layer); return v; } -static uae_u32 gfxl_WritePixel(void) { return GFX_WritePixel(m68k_areg(regs, 1), (uae_s16)m68k_dreg(regs, 0), (uae_s16)m68k_dreg(regs, 1)); } +static uae_u32 gfxl_WritePixel(void) { return GFX_WritePixel(m68k_areg (regs, 1), (uae_s16)m68k_dreg (regs, 0), (uae_s16)m68k_dreg (regs, 1)); } static uae_u32 gfxl_BltClear(void) { - uaecptr mem=m68k_areg(regs, 1); - uae_u8 *mptr = chipmem_bank.xlateaddr(m68k_areg(regs, 1)); - uae_u32 count=m68k_dreg(regs, 0); - uae_u32 flags=m68k_dreg(regs, 1); + uaecptr mem=m68k_areg (regs, 1); + uae_u8 *mptr = chipmem_bank.xlateaddr(m68k_areg (regs, 1)); + uae_u32 count=m68k_dreg (regs, 0); + uae_u32 flags=m68k_dreg (regs, 1); unsigned int i; uae_u32 pattern; @@ -293,26 +293,26 @@ static uae_u32 gfxl_BltClear(void) static uae_u32 gfxl_BltBitmap(void) { - uaecptr srcbitmap = m68k_areg(regs, 0), dstbitmap = m68k_areg(regs, 1); - int srcx = (uae_s16)m68k_dreg(regs, 0), srcy = (uae_s16)m68k_dreg(regs, 1); - int dstx = (uae_s16)m68k_dreg(regs, 2), dsty = (uae_s16)m68k_dreg(regs, 3); - int sizex = (uae_s16)m68k_dreg(regs, 4), sizey = (uae_s16)m68k_dreg(regs, 5); - uae_u8 minterm = (uae_u8)m68k_dreg(regs, 6), mask = m68k_dreg(regs, 7); + uaecptr srcbitmap = m68k_areg (regs, 0), dstbitmap = m68k_areg (regs, 1); + int srcx = (uae_s16)m68k_dreg (regs, 0), srcy = (uae_s16)m68k_dreg (regs, 1); + int dstx = (uae_s16)m68k_dreg (regs, 2), dsty = (uae_s16)m68k_dreg (regs, 3); + int sizex = (uae_s16)m68k_dreg (regs, 4), sizey = (uae_s16)m68k_dreg (regs, 5); + uae_u8 minterm = (uae_u8)m68k_dreg (regs, 6), mask = m68k_dreg (regs, 7); return 0; /* sam: a return was missing here ! */ } static uaecptr amiga_malloc(int len) { - m68k_dreg(regs, 0) = len; - m68k_dreg(regs, 1) = 1; /* MEMF_PUBLIC */ - return CallLib(get_long(4), -198); /* AllocMem */ + m68k_dreg (regs, 0) = len; + m68k_dreg (regs, 1) = 1; /* MEMF_PUBLIC */ + return CallLib (get_long (4), -198); /* AllocMem */ } static void amiga_free(uaecptr addr, int len) { - m68k_areg(regs, 1) = addr; - m68k_dreg(regs, 0) = len; - CallLib(get_long(4), -210); /* FreeMem */ + m68k_areg (regs, 1) = addr; + m68k_dreg (regs, 0) = len; + CallLib (get_long (4), -210); /* FreeMem */ } /* @@ -636,21 +636,21 @@ static int copy_rects (uaecptr region, struct RectList *rl) uaecptr regionrect; int numrects = 0; struct Rectangle b; - regionrect = get_long(region+8); - b.MinX = get_word(region); - b.MinY = get_word(region+2); - b.MaxX = get_word(region+4); - b.MaxY = get_word(region+6); + regionrect = get_long (region+8); + b.MinX = get_word (region); + b.MinY = get_word (region+2); + b.MaxX = get_word (region+4); + b.MaxY = get_word (region+6); while (regionrect != 0) { struct Rectangle tmpr; - tmpr.MinX = (uae_s16)get_word(regionrect+8) + b.MinX; - tmpr.MinY = (uae_s16)get_word(regionrect+10) + b.MinY; - tmpr.MaxX = (uae_s16)get_word(regionrect+12) + b.MinX; - tmpr.MaxY = (uae_s16)get_word(regionrect+14) + b.MinY; + tmpr.MinX = (uae_s16)get_word (regionrect+8) + b.MinX; + tmpr.MinY = (uae_s16)get_word (regionrect+10) + b.MinY; + tmpr.MaxX = (uae_s16)get_word (regionrect+12) + b.MinX; + tmpr.MaxY = (uae_s16)get_word (regionrect+14) + b.MinY; add_rect(rl, tmpr); - regionrect = get_long(regionrect); + regionrect = get_long (regionrect); numrects++; } return numrects; @@ -1010,16 +1010,16 @@ static uae_u32 gfxl_perform_regionop(regionop op, int with_rect) if (with_rect) { struct Rectangle tmpr; - reg2 = m68k_areg(regs, 0); + reg2 = m68k_areg (regs, 0); numrects2 = copy_rects(reg2, &rl2); - tmpr.MinX = get_word(m68k_areg(regs, 1)); - tmpr.MinY = get_word(m68k_areg(regs, 1) + 2); - tmpr.MaxX = get_word(m68k_areg(regs, 1) + 4); - tmpr.MaxY = get_word(m68k_areg(regs, 1) + 6); + tmpr.MinX = get_word (m68k_areg (regs, 1)); + tmpr.MinY = get_word (m68k_areg (regs, 1) + 2); + tmpr.MaxX = get_word (m68k_areg (regs, 1) + 4); + tmpr.MaxY = get_word (m68k_areg (regs, 1) + 6); add_rect(&rl1, tmpr); } else { - reg1 = m68k_areg(regs, 0); - reg2 = m68k_areg(regs, 1); + reg1 = m68k_areg (regs, 0); + reg2 = m68k_areg (regs, 1); copy_rects(reg1, &rl1); numrects2 = copy_rects(reg2, &rl2); @@ -1039,43 +1039,43 @@ static uae_u32 gfxl_perform_regionop(regionop op, int with_rect) rpp = reg2 + 8; if (rl3.count < numrects2) { while (numrects2-- != rl3.count) { - tmp = get_long(rpp); - put_long(rpp, get_long(tmp)); + tmp = get_long (rpp); + put_long (rpp, get_long (tmp)); amiga_free(tmp, 16); } if (rl3.count > 0) - put_long(get_long(rpp) + 4, rpp); + put_long (get_long (rpp) + 4, rpp); } else if (rl3.count > numrects2) { while(numrects2++ != rl3.count) { - uaecptr prev = get_long(rpp); + uaecptr prev = get_long (rpp); tmp = amiga_malloc(16); if (tmp == 0) goto done; - put_long(tmp, prev); - put_long(tmp + 4, rpp); + put_long (tmp, prev); + put_long (tmp + 4, rpp); if (prev != 0) - put_long(prev + 4, tmp); - put_long(rpp, tmp); + put_long (prev + 4, tmp); + put_long (rpp, tmp); } } if (rl3.count > 0) { rpp = reg2 + 8; for (i = 0; i < rl3.count; i++) { - uaecptr rr = get_long(rpp); - put_word(rr+8, rl3.rects[i].MinX - rl3.bounds.MinX); - put_word(rr+10, rl3.rects[i].MinY - rl3.bounds.MinY); - put_word(rr+12, rl3.rects[i].MaxX - rl3.bounds.MinX); - put_word(rr+14, rl3.rects[i].MaxY - rl3.bounds.MinY); + uaecptr rr = get_long (rpp); + put_word (rr+8, rl3.rects[i].MinX - rl3.bounds.MinX); + put_word (rr+10, rl3.rects[i].MinY - rl3.bounds.MinY); + put_word (rr+12, rl3.rects[i].MaxX - rl3.bounds.MinX); + put_word (rr+14, rl3.rects[i].MaxY - rl3.bounds.MinY); rpp = rr; } - if (get_long(rpp) != 0) + if (get_long (rpp) != 0) write_log ("BUG\n"); } - put_word(reg2+0, rl3.bounds.MinX); - put_word(reg2+2, rl3.bounds.MinY); - put_word(reg2+4, rl3.bounds.MaxX); - put_word(reg2+6, rl3.bounds.MaxY); + put_word (reg2+0, rl3.bounds.MinX); + put_word (reg2+2, rl3.bounds.MinY); + put_word (reg2+4, rl3.bounds.MaxX); + put_word (reg2+6, rl3.bounds.MaxY); retval = 1; done: @@ -1124,42 +1124,42 @@ static uae_u32 LY_TryLockLayer(uaecptr layer) { uaecptr sigsem = layer + 72; - m68k_areg(regs, 0) = sigsem; - return CallLib(get_long(4), -576); + m68k_areg (regs, 0) = sigsem; + return CallLib (get_long (4), -576); } static void LY_LockLayer(uaecptr layer) { uaecptr sigsem = layer + 72; - m68k_areg(regs, 0) = sigsem; - CallLib(get_long(4), -564); + m68k_areg (regs, 0) = sigsem; + CallLib (get_long (4), -564); } static void LY_UnlockLayer(uaecptr layer) { uaecptr sigsem = layer + 72; - m68k_areg(regs, 0) = sigsem; - CallLib(get_long(4), -570); + m68k_areg (regs, 0) = sigsem; + CallLib (get_long (4), -570); } static void LY_LockLayerInfo(uaecptr li) { uaecptr sigsem = li + 24; - m68k_areg(regs, 0) = sigsem; - CallLib(get_long(4), -564); - put_byte(li+91, get_byte(li+91)+1); + m68k_areg (regs, 0) = sigsem; + CallLib (get_long (4), -564); + put_byte (li+91, get_byte (li+91)+1); } static void LY_UnlockLayerInfo(uaecptr li) { uaecptr sigsem = li + 24; - put_byte(li+91, get_byte(li+91)-1); - m68k_areg(regs, 0) = sigsem; - CallLib(get_long(4), -570); + put_byte (li+91, get_byte (li+91)-1); + m68k_areg (regs, 0) = sigsem; + CallLib (get_long (4), -570); } static void LY_LockLayers(uaecptr li) @@ -1168,7 +1168,7 @@ static void LY_LockLayers(uaecptr li) LY_LockLayerInfo(li); while (l != 0) { LY_LockLayer(l); - l = get_long(l); + l = get_long (l); } LY_UnlockLayerInfo(li); } @@ -1179,7 +1179,7 @@ static void LY_UnlockLayers(uaecptr li) LY_LockLayerInfo(li); while (l != 0) { LY_UnlockLayer(l); - l = get_long(l); + l = get_long (l); } LY_UnlockLayerInfo(li); } @@ -1214,12 +1214,12 @@ static uniq_list MyLayerInfo_list = UNIQ_INIT; static void LY_InitLayers(uaecptr li) { - memset (get_real_address(li), 0, 92); - put_long(li + 0, 0); /* top layer */ - put_long(li+84, 0); /* uniq: */ - m68k_areg(regs, 0) = li + 24; CallLib(get_long(4), -558); /* InitSemaphore() */ - put_word(li+88, 0); /* flags (???) */ - put_byte(li+89, 0); /* fatten_count */ + memset (get_real_address (li), 0, 92); + put_long (li + 0, 0); /* top layer */ + put_long (li+84, 0); /* uniq: */ + m68k_areg (regs, 0) = li + 24; CallLib (get_long (4), -558); /* InitSemaphore() */ + put_word (li+88, 0); /* flags (???) */ + put_byte (li+89, 0); /* fatten_count */ /* @@@ How big can I assume the structure? What's all this 1.0/1.1 cruft? */ } @@ -1241,7 +1241,7 @@ static void LY_ThinLayerInfo(uaecptr li) int fatten_count = get_byte (li + 89)-1; put_byte (li + 89, fatten_count); if (fatten_count == 0) { - struct MyLayerInfo *mli = (struct MyLayerInfo *)find_and_rem_uniq(&MyLayerInfo_list, get_long(li+84)); + struct MyLayerInfo *mli = (struct MyLayerInfo *)find_and_rem_uniq(&MyLayerInfo_list, get_long (li+84)); if (mli) free(mli); } @@ -1270,7 +1270,7 @@ static void build_cliprects (struct MyLayer *l) uaecptr layer = l->amigaos_layer; uaecptr cr = layer + 8; uaecptr prev = 0; - uae_u16 flags = get_word(layer + 30); + uae_u16 flags = get_word (layer + 30); int i; if ((flags & LAYER_CR_CHANGED) == 0) @@ -1292,28 +1292,28 @@ static void propagate_clueless_redo (struct MyLayerInfo *mli) { /* For all CLUELESS layers, set the REDO bit for all layers below it that overlap it * and delete the data associated with them. */ - uaecptr current_l = get_long(mli->amigaos_linfo); + uaecptr current_l = get_long (mli->amigaos_linfo); while (current_l) { - struct MyLayer *l = (struct MyLayer *)find_uniq(&mli->layer_list, get_long(current_l + 24)); - if ((get_word(l->amigaos_layer + 32) & LAYER_CLUELESS) != 0) { - uaecptr next_l = get_long(current_l); - put_word(l->amigaos_layer + 32, get_word(l->amigaos_layer + 32) | LAYER_REDO); + struct MyLayer *l = (struct MyLayer *)find_uniq(&mli->layer_list, get_long (current_l + 24)); + if ((get_word (l->amigaos_layer + 32) & LAYER_CLUELESS) != 0) { + uaecptr next_l = get_long (current_l); + put_word (l->amigaos_layer + 32, get_word (l->amigaos_layer + 32) | LAYER_REDO); while (next_l) { - struct MyLayer *l2 = (struct MyLayer *)find_uniq(&mli->layer_list, get_long(next_l + 24)); - uae_u16 flags = get_word(l2->amigaos_layer + 32); + struct MyLayer *l2 = (struct MyLayer *)find_uniq(&mli->layer_list, get_long (next_l + 24)); + uae_u16 flags = get_word (l2->amigaos_layer + 32); if (l2->bounds.MinX <= l->bounds.MaxX && l->bounds.MinX <= l2->bounds.MaxX && l2->bounds.MinY <= l->bounds.MaxY && l->bounds.MinY <= l2->bounds.MaxY) - put_word(l2->amigaos_layer + 32, flags | LAYER_REDO); + put_word (l2->amigaos_layer + 32, flags | LAYER_REDO); if ((flags & (LAYER_REDO|LAYER_CLUELESS)) == 0) { free_rectlist(&l->obscured); free_rectlist(&l->visible); free_bandlist(&l->big_bands); free_bandlist(&l->small_bands); } - next_l = get_long(next_l); + next_l = get_long (next_l); } } - current_l = get_long(current_l); + current_l = get_long (current_l); } } @@ -1323,13 +1323,13 @@ static void redo_layers(struct MyLayerInfo *mli, uaecptr bm) struct RectList tmp_rl; propagate_clueless_redo(mli); - current_l = get_long(mli->amigaos_linfo); + current_l = get_long (mli->amigaos_linfo); while (current_l) { - struct MyLayer *l = (struct MyLayer *)find_uniq(&mli->layer_list, get_long(current_l + 24)); - uae_u16 flags = get_word(l->amigaos_layer + 32); + struct MyLayer *l = (struct MyLayer *)find_uniq(&mli->layer_list, get_long (current_l + 24)); + uae_u16 flags = get_word (l->amigaos_layer + 32); if ((flags & LAYER_REDO) != 0) { - uaecptr next_l = get_long(current_l+4); + uaecptr next_l = get_long (current_l+4); int have_rects = 0; init_rectlist(&l->obscured); @@ -1337,7 +1337,7 @@ static void redo_layers(struct MyLayerInfo *mli, uaecptr bm) add_rect_to_bands(&l->big_bands, &l->bounds); while (next_l) { - struct MyLayer *l2 = (struct MyLayer *)find_uniq(&mli->layer_list, get_long(next_l + 24)); + struct MyLayer *l2 = (struct MyLayer *)find_uniq(&mli->layer_list, get_long (next_l + 24)); if (l2->visible.bounds.MinX <= l->bounds.MaxX && l->bounds.MinX <= l2->visible.bounds.MaxX && l2->visible.bounds.MinY <= l->bounds.MaxY && l->bounds.MinY <= l2->visible.bounds.MaxY && !rect_in_region (&l->obscured, &l2->visible.bounds)) @@ -1346,7 +1346,7 @@ static void redo_layers(struct MyLayerInfo *mli, uaecptr bm) add_rect(&l->obscured, l2->visible.bounds); have_rects++; } - next_l = get_long(next_l+4); + next_l = get_long (next_l+4); } init_rectlist(&l->visible); init_rectlist(&tmp_rl); @@ -1358,7 +1358,7 @@ static void redo_layers(struct MyLayerInfo *mli, uaecptr bm) flags |= LAYER_CR_CHANGED; } put_word (l->amigaos_layer + 32, flags & ~(LAYER_CLUELESS|LAYER_REDO)); - current_l = get_long(current_l); + current_l = get_long (current_l); } } @@ -1367,17 +1367,17 @@ static struct MyLayer *LY_NewLayer(struct MyLayerInfo *mli, int x0, int x1, int { struct MyLayer *l = (struct MyLayer *)malloc(sizeof (struct MyLayer)); uaecptr layer = amiga_malloc(LAYER_SIZE); - memset (get_real_address(layer), 0, LAYER_SIZE); + memset (get_real_address (layer), 0, LAYER_SIZE); l->amigaos_layer = layer; - put_word(layer + 16, x0); /* bounds */ - put_word(layer + 18, y0); - put_word(layer + 20, x1); - put_word(layer + 22, y1); - put_word(layer + 30, flags | LAYER_CLUELESS); - put_long(layer + 32, flags & 4 ? sbm : 0); /* ClipRect */ - put_long(layer + 68, mli->amigaos_linfo); - m68k_areg(regs, 0) = layer + 72; CallLib(get_long(4), -558); /* InitSemaphore() */ + put_word (layer + 16, x0); /* bounds */ + put_word (layer + 18, y0); + put_word (layer + 20, x1); + put_word (layer + 22, y1); + put_word (layer + 30, flags | LAYER_CLUELESS); + put_long (layer + 32, flags & 4 ? sbm : 0); /* ClipRect */ + put_long (layer + 68, mli->amigaos_linfo); + m68k_areg (regs, 0) = layer + 72; CallLib (get_long (4), -558); /* InitSemaphore() */ add_uniq(&mli->layer_list, &l->head, layer + 24); l->mli = mli; @@ -1394,7 +1394,7 @@ static void LY_DeleteLayer(uaecptr layer) struct MyLayer *l = (struct MyLayer *)find_and_rem_uniq(&l->mli->layer_list, get_long (layer + 24)); /* Free ClipRects */ while ((cr = get_long (l->amigaos_layer + 8))) { - put_long (l->amigaos_layer + 8, get_long(cr)); + put_long (l->amigaos_layer + 8, get_long (cr)); amiga_free(cr, CLIPRECT_SIZE); } amiga_free (l->amigaos_layer, LAYER_SIZE); @@ -1410,7 +1410,7 @@ static uaecptr find_behindlayer_position(uaecptr li, uae_u16 flags) if (other == 0) break; /* Backdrop? */ - if ((get_word(other + 30) & 0x40) > (flags & 0x40)) + if ((get_word (other + 30) & 0x40) > (flags & 0x40)) break; where = other; } @@ -1427,11 +1427,11 @@ static uaecptr LY_CreateLayer(uaecptr li, int x0, int x1, int y0, int y1, l = LY_NewLayer(mli, x0, x1, y0, y1, flags, bm, sbm); /* Chain into list */ - put_long(l->amigaos_layer, get_long (where)); - put_long(l->amigaos_layer + 4, where == li ? 0 : where); + put_long (l->amigaos_layer, get_long (where)); + put_long (l->amigaos_layer + 4, where == li ? 0 : where); if (get_long (where) != 0) - put_long(get_long (where) + 4, l->amigaos_layer); - put_long(where, l->amigaos_layer); + put_long (get_long (where) + 4, l->amigaos_layer); + put_long (where, l->amigaos_layer); redo_layers(mli, bm); build_cliprects(l); LY_UnlockLayerInfo(li); @@ -1454,25 +1454,25 @@ static uae_u32 layers_NewLayerInfo(void) static uae_u32 layers_InitLayers(void) { LY_InitLayers (m68k_areg (regs, 0)); return 0; } static uae_u32 layers_DisposeLayerInfo(void) { LY_DisposeLayerInfo (m68k_areg (regs, 0)); return 0; } -static uae_u32 layers_FattenLayerInfo(void) { LY_FattenLayerInfo(m68k_areg(regs, 0)); return 0; } -static uae_u32 layers_ThinLayerInfo(void) { LY_ThinLayerInfo(m68k_areg(regs, 0)); return 0; } +static uae_u32 layers_FattenLayerInfo(void) { LY_FattenLayerInfo(m68k_areg (regs, 0)); return 0; } +static uae_u32 layers_ThinLayerInfo(void) { LY_ThinLayerInfo(m68k_areg (regs, 0)); return 0; } static uae_u32 layers_CreateUpfrontLayer(void) { - return LY_CreateLayer(m68k_areg(regs, 0), (uae_s32)m68k_dreg(regs, 0), - (uae_s32)m68k_dreg(regs, 1), (uae_s32)m68k_dreg(regs, 2), - (uae_s32)m68k_dreg(regs, 3), - m68k_dreg(regs, 4), - m68k_areg(regs, 1), m68k_areg(regs, 2), m68k_areg(regs, 0)); + return LY_CreateLayer(m68k_areg (regs, 0), (uae_s32)m68k_dreg (regs, 0), + (uae_s32)m68k_dreg (regs, 1), (uae_s32)m68k_dreg (regs, 2), + (uae_s32)m68k_dreg (regs, 3), + m68k_dreg (regs, 4), + m68k_areg (regs, 1), m68k_areg (regs, 2), m68k_areg (regs, 0)); } static uae_u32 layers_CreateBehindLayer(void) { - return LY_CreateLayer(m68k_areg(regs, 0), (uae_s32)m68k_dreg(regs, 0), - (uae_s32)m68k_dreg(regs, 1), (uae_s32)m68k_dreg(regs, 2), - (uae_s32)m68k_dreg(regs, 3), - m68k_dreg(regs, 4), - m68k_areg(regs, 1), m68k_areg(regs, 2), - find_behindlayer_position (m68k_areg(regs, 0), m68k_dreg(regs, 4))); + return LY_CreateLayer(m68k_areg (regs, 0), (uae_s32)m68k_dreg (regs, 0), + (uae_s32)m68k_dreg (regs, 1), (uae_s32)m68k_dreg (regs, 2), + (uae_s32)m68k_dreg (regs, 3), + m68k_dreg (regs, 4), + m68k_areg (regs, 1), m68k_areg (regs, 2), + find_behindlayer_position (m68k_areg (regs, 0), m68k_dreg (regs, 4))); } static uae_u32 layers_DeleteLayer(void) { LY_DeleteLayer (m68k_areg (regs, 1)); return 0; } @@ -1496,15 +1496,15 @@ static uae_u32 LY_TryLockLayer1(uaecptr layer) build_cliprects (l); return 1; } -static uae_u32 gfx_TryLockLayer(void) { return LY_TryLockLayer1 (m68k_areg(regs, 5)); } -static uae_u32 gfx_LockLayer(void) { LY_LockLayer1 (m68k_areg(regs, 5)); return 0; } -static uae_u32 gfx_UnlockLayer(void) { LY_UnlockLayer(m68k_areg(regs, 5)); return 0; } -static uae_u32 layers_LockLayer(void) { LY_LockLayer1 (m68k_areg(regs, 1)); return 0; } -static uae_u32 layers_LockLayers(void) { LY_LockLayers(m68k_areg(regs, 0)); return 0; } -static uae_u32 layers_LockLayerInfo(void) { LY_LockLayerInfo(m68k_areg(regs, 0)); return 0; } -static uae_u32 layers_UnlockLayer(void) { LY_UnlockLayer(m68k_areg(regs, 0)); return 0; } -static uae_u32 layers_UnlockLayers(void) { LY_UnlockLayers(m68k_areg(regs, 0)); return 0; } -static uae_u32 layers_UnlockLayerInfo(void) { LY_UnlockLayerInfo(m68k_areg(regs, 0)); return 0; } +static uae_u32 gfx_TryLockLayer(void) { return LY_TryLockLayer1 (m68k_areg (regs, 5)); } +static uae_u32 gfx_LockLayer(void) { LY_LockLayer1 (m68k_areg (regs, 5)); return 0; } +static uae_u32 gfx_UnlockLayer(void) { LY_UnlockLayer(m68k_areg (regs, 5)); return 0; } +static uae_u32 layers_LockLayer(void) { LY_LockLayer1 (m68k_areg (regs, 1)); return 0; } +static uae_u32 layers_LockLayers(void) { LY_LockLayers(m68k_areg (regs, 0)); return 0; } +static uae_u32 layers_LockLayerInfo(void) { LY_LockLayerInfo(m68k_areg (regs, 0)); return 0; } +static uae_u32 layers_UnlockLayer(void) { LY_UnlockLayer(m68k_areg (regs, 0)); return 0; } +static uae_u32 layers_UnlockLayers(void) { LY_UnlockLayers(m68k_areg (regs, 0)); return 0; } +static uae_u32 layers_UnlockLayerInfo(void) { LY_UnlockLayerInfo(m68k_areg (regs, 0)); return 0; } static uae_u32 layers_ScrollLayer(void) { @@ -1567,16 +1567,16 @@ static uae_u32 layers_SwapBitsRastPortClipRect(void) static uae_u32 gfxlib_init(void) { uae_u32 old_arr; - uaecptr sysbase=m68k_areg(regs, 6); + uaecptr sysbase=m68k_areg (regs, 6); int i=0; /* Install new routines */ - m68k_dreg(regs, 0)=0; - m68k_areg(regs, 1)=gfxlibname; - gfxbase=CallLib(sysbase, -408); /* OpenLibrary */ - m68k_dreg(regs, 0)=0; - m68k_areg(regs, 1)=layerslibname; - layersbase=CallLib(sysbase, -408); /* OpenLibrary */ + m68k_dreg (regs, 0)=0; + m68k_areg (regs, 1)=gfxlibname; + gfxbase=CallLib (sysbase, -408); /* OpenLibrary */ + m68k_dreg (regs, 0)=0; + m68k_areg (regs, 1)=layerslibname; + layersbase=CallLib (sysbase, -408); /* OpenLibrary */ libemu_InstallFunctionFlags(gfxl_WritePixel, gfxbase, -324, TRAPFLAG_EXTRA_STACK, ""); libemu_InstallFunctionFlags(gfxl_BltClear, gfxbase, -300, 0, ""); diff --git a/gfxutil.c b/gfxutil.c index 6842bfe0..0dd3a1fc 100755 --- a/gfxutil.c +++ b/gfxutil.c @@ -99,13 +99,13 @@ static float video_gamma(float value, float gamma, float bri, float con) value *= con; if (value <= 0.0f) - return 0.0f; + return 0.0f; factor = pow(255.0f, 1.0f - gamma); ret = (float)(factor * pow(value, gamma)); if (ret < 0.0f) - ret = 0.0f; + ret = 0.0f; return ret; } @@ -120,7 +120,7 @@ static void video_calc_gammatable(void) uae_u32 vi; bri = ((float)(currprefs.gfx_luminance)) - * (128.0f / 1000.0f); + * (128.0f / 1000.0f); con = ((float)(currprefs.gfx_contrast + 1000)) / 1000.0f; gam = ((float)(1000 - currprefs.gfx_gamma)) / 1000.0f; @@ -128,16 +128,16 @@ static void video_calc_gammatable(void) hf = 256 - lf * 2; for (i = 0; i < (256 * 3); i++) { - v = video_gamma((float)(i - 256), gam, bri, con); + v = video_gamma((float)(i - 256), gam, bri, con); + + vi = (uae_u32)v; + if (vi > 255) + vi = 255; - vi = (uae_u32)v; - if (vi > 255) - vi = 255; - if (currprefs.gfx_luminance == 0 && currprefs.gfx_contrast == 0 && currprefs.gfx_gamma == 0) vi = i & 0xff; - gamma[i] = vi; + gamma[i] = vi; } } @@ -204,15 +204,15 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in int r = ((i >> 8) << 4) | (i >> 8); int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f); int b = ((i & 0xf) << 4) | (i & 0x0f); - r = gamma[r + j]; - g = gamma[g + j]; - b = gamma[b + j]; - xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as); - if (byte_swap) { + r = gamma[r + j]; + g = gamma[g + j]; + b = gamma[b + j]; + xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as); + if (byte_swap) { if (bpp <= 16) - xcolors[i] = bswap_16 (xcolors[i]); + xcolors[i] = bswap_16 (xcolors[i]); else - xcolors[i] = bswap_32 (xcolors[i]); + xcolors[i] = bswap_32 (xcolors[i]); } if (bpp <= 16) { /* Fill upper 16 bits of each colour value @@ -248,19 +248,19 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in } /* copy original color table */ for (i = 0; i < 256; i++) { - redc[0 * 256 + i] = xredcolors[0]; - grec[0 * 256 + i] = xgreencolors[0]; - bluc[0 * 256 + i] = xbluecolors[0]; - redc[1 * 256 + i] = xredcolors[i]; - grec[1 * 256 + i] = xgreencolors[i]; - bluc[1 * 256 + i] = xbluecolors[i]; - redc[2 * 256 + i] = xredcolors[255]; - grec[2 * 256 + i] = xgreencolors[255]; - bluc[2 * 256 + i] = xbluecolors[255]; + redc[0 * 256 + i] = xredcolors[0]; + grec[0 * 256 + i] = xgreencolors[0]; + bluc[0 * 256 + i] = xbluecolors[0]; + redc[1 * 256 + i] = xredcolors[i]; + grec[1 * 256 + i] = xgreencolors[i]; + bluc[1 * 256 + i] = xbluecolors[i]; + redc[2 * 256 + i] = xredcolors[255]; + grec[2 * 256 + i] = xgreencolors[255]; + bluc[2 * 256 + i] = xbluecolors[255]; } if (usedfilter && usedfilter->yuv) { /* create internal 5:6:5 color tables */ - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) { j = i + 256; xredcolors[i] = doColor (gamma[j], 5, 11); xgreencolors[i] = doColor (gamma[j], 6, 5); @@ -296,7 +296,7 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in /* create RGB 5:6:5 -> YUV tables */ for (i = 0; i < 65536; i++) { - uae_u32 r, g, b; + uae_u32 r, g, b; r = (((i >> 11) & 31) << 3) | lowbits (i, 11, 3); r = gamma[r + 256]; g = (((i >> 5) & 63) << 2) | lowbits (i, 5, 2); diff --git a/hardfile.c b/hardfile.c index 8dacb748..910ffc71 100755 --- a/hardfile.c +++ b/hardfile.c @@ -216,7 +216,7 @@ static void rdb_crc(uae_u8 *p) { uae_u32 sum; int i, blocksize; - + sum =0; blocksize = rl (p + 1 * 4); for (i = 0; i < blocksize; i++) @@ -347,7 +347,7 @@ int hdf_hd_open(struct hd_hardfiledata *hfd, char *path, int blocksize, int read hfd->heads_def = hfd->heads; if (hfd->hfd.heads && hfd->hfd.secspertrack) { uae_u8 buf[512] = { 0 }; - hdf_read(&hfd->hfd, buf, 0, 512); + hdf_read(&hfd->hfd, buf, 0, 512); if (buf[0] != 0 && memcmp(buf, "RDSK", 4)) { hfd->hfd.nrcyls = (hfd->hfd.size / blocksize) / (sectors * surfaces); create_virtual_rdb(&hfd->hfd, rl (buf), hfd->bootpri, filesys); @@ -492,7 +492,7 @@ int scsi_emulate(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 } else { getchs (hfd, &cyl, &cylsec, &head, &tracksec); } - //write_log("MODE SENSE PC=%d CODE=%d DBD=%d\n", pc, pcode, dbd); + //write_log ("MODE SENSE PC=%d CODE=%d DBD=%d\n", pc, pcode, dbd); p = r; p[0] = 4 - 1; p[1] = 0; @@ -507,7 +507,7 @@ int scsi_emulate(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 p += 8; } if (pcode == 0) { - p[0] = 0; + p[0] = 0; p[1] = 0; p[2] = 0x20; p[3] = 0; @@ -563,7 +563,7 @@ int scsi_emulate(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 lba = blocks; blocks = lba; } - wl (r, blocks); + wl (r, blocks); wl (r + 4, hfd->blocksize); scsi_len = lr = 8; } @@ -612,7 +612,7 @@ int scsi_emulate(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 break; default: err: - lr = -1; + lr = -1; write_log ("UAEHF: unsupported scsi command 0x%02.2X\n", cmdbuf[0]); status = 2; /* CHECK CONDITION */ s[0] = 0x70; @@ -771,7 +771,7 @@ static int start_thread (TrapContext *context, int unit) if (hfpd->thread_running) return 1; memset (hfpd, 0, sizeof (struct hardfileprivdata)); - hfpd->base = m68k_areg(&context->regs, 6); + hfpd->base = m68k_areg (&context->regs, 6); init_comm_pipe (&hfpd->requests, 100, 1); uae_sem_init (&hfpd->sync_sem, 0, 0); uae_start_thread ("hardfile", hardfile_thread, hfpd, &hfpd->tid); @@ -792,7 +792,7 @@ static int mangleunit (int unit) static uae_u32 REGPARAM2 hardfile_open (TrapContext *context) { - uaecptr tmp1 = m68k_areg(&context->regs, 1); /* IOReq */ + uaecptr tmp1 = m68k_areg (&context->regs, 1); /* IOReq */ int unit = mangleunit (m68k_dreg (&context->regs, 0)); struct hardfileprivdata *hfpd = &hardfpd[unit]; int err = -1; @@ -816,14 +816,14 @@ static uae_u32 REGPARAM2 hardfile_open (TrapContext *context) static uae_u32 REGPARAM2 hardfile_close (TrapContext *context) { - uaecptr request = m68k_areg(&context->regs, 1); /* IOReq */ + uaecptr request = m68k_areg (&context->regs, 1); /* IOReq */ int unit = mangleunit (get_long (request + 24)); struct hardfileprivdata *hfpd = &hardfpd[unit]; if (!hfpd) return 0; put_word (hfpd->base + 32, get_word (hfpd->base + 32) - 1); - if (get_word(hfpd->base + 32) == 0) + if (get_word (hfpd->base + 32) == 0) write_comm_pipe_u32 (&hfpd->requests, 0, 1); return 0; } @@ -1019,14 +1019,14 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata put_byte (request + 31, error); hf_log2 ("hf: unit=%d, request=%p, cmd=%d offset=%u len=%d, actual=%d error%=%d\n", unit, request, - get_word(request + 28), get_long (request + 44), get_long (request + 36), actual, error); + get_word (request + 28), get_long (request + 44), get_long (request + 36), actual, error); return async; } static uae_u32 REGPARAM2 hardfile_abortio (TrapContext *context) { - uae_u32 request = m68k_areg(&context->regs, 1); + uae_u32 request = m68k_areg (&context->regs, 1); int unit = mangleunit (get_long (request + 24)); struct hardfiledata *hfd = get_hardfile_data (unit); struct hardfileprivdata *hfpd = &hardfpd[unit]; @@ -1071,7 +1071,7 @@ static int hardfile_canquick (struct hardfiledata *hfd, uaecptr request) static uae_u32 REGPARAM2 hardfile_beginio (TrapContext *context) { - uae_u32 request = m68k_areg(&context->regs, 1); + uae_u32 request = m68k_areg (&context->regs, 1); uae_u8 flags = get_byte (request + 30); int cmd = get_word (request + 28); int unit = mangleunit (get_long (request + 24)); @@ -1132,7 +1132,7 @@ void hardfile_reset (void) for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) { hfpd = &hardfpd[i]; - if (hfpd->base && valid_address(hfpd->base, 36) && get_word(hfpd->base + 32) > 0) { + if (hfpd->base && valid_address(hfpd->base, 36) && get_word (hfpd->base + 32) > 0) { for (j = 0; j < MAX_ASYNC_REQUESTS; j++) { uaecptr request; if ((request = hfpd->d_request[i])) diff --git a/include/autoconf.h b/include/autoconf.h index 1b3495d5..764f9b40 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -55,6 +55,8 @@ extern int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to); int filesys_insert(int nr, char *volume, char *rootdir, int readonly, int flags); int filesys_eject(int nr); +extern char *filesys_createvolname (const char *volname, const char *rootdir, const char *def); + extern int sprintf_filesys_unit (char *buffer, int num); extern void filesys_reset (void); diff --git a/include/blkdev.h b/include/blkdev.h index 394e126c..8498c6d4 100755 --- a/include/blkdev.h +++ b/include/blkdev.h @@ -107,7 +107,7 @@ struct device_functions { scsiinfo_func scsiinfo; ismedia_func ismedia; - + }; extern struct device_functions *device_func[2]; diff --git a/include/cpu_prefetch.h b/include/cpu_prefetch.h index 43146c4a..4fecc825 100755 --- a/include/cpu_prefetch.h +++ b/include/cpu_prefetch.h @@ -2,7 +2,7 @@ STATIC_INLINE uae_u32 get_word_prefetch (struct regstruct *regs, int o) { uae_u32 v = regs->irc; - regs->irc = get_wordi (m68k_getpc(regs) + o); + regs->irc = get_wordi (m68k_getpc (regs) + o); return v; } STATIC_INLINE uae_u32 get_long_prefetch (struct regstruct *regs, int o) @@ -79,7 +79,7 @@ STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr) STATIC_INLINE uae_u32 get_word_ce_prefetch (struct regstruct *regs, int o) { uae_u32 v = regs->irc; - regs->irc = get_wordi_ce (m68k_getpc(regs) + o); + regs->irc = get_wordi_ce (m68k_getpc (regs) + o); return v; } @@ -100,7 +100,7 @@ STATIC_INLINE void m68k_do_rts_ce (struct regstruct *regs) pc |= get_word_ce (m68k_areg (regs, 7) + 2); m68k_areg (regs, 7) += 4; if (pc & 1) - exception3 (0x4e75, m68k_getpc(regs), pc); + exception3 (0x4e75, m68k_getpc (regs), pc); else m68k_setpc (regs, pc); } diff --git a/include/cpummu.h b/include/cpummu.h index 02e8f3a7..6078a4d5 100755 --- a/include/cpummu.h +++ b/include/cpummu.h @@ -2,7 +2,7 @@ * cpummu.h - MMU emulation * * Copyright (c) 2001-2004 Milan Jurik of ARAnyM dev team (see AUTHORS) - * + * * Inspired by UAE MMU patch * * This file is part of the ARAnyM project which builds a new and powerful @@ -242,12 +242,12 @@ STATIC_INLINE void mmu_set_root_pointer(int regno, uae_u32 val) extern uaecptr REGPARAM3 mmu_translate(uaecptr addr, int super, int data, int write); -extern uae_u32 REGPARAM3 sfc_get_long(uaecptr addr) REGPARAM; -extern uae_u16 REGPARAM3 sfc_get_word(uaecptr addr) REGPARAM; -extern uae_u8 REGPARAM3 sfc_get_byte(uaecptr addr) REGPARAM; -extern void REGPARAM3 dfc_put_long(uaecptr addr, uae_u32 val) REGPARAM; -extern void REGPARAM3 dfc_put_word(uaecptr addr, uae_u16 val) REGPARAM; -extern void REGPARAM3 dfc_put_byte(uaecptr addr, uae_u8 val) REGPARAM; +extern uae_u32 REGPARAM3 sfc_get_long (uaecptr addr) REGPARAM; +extern uae_u16 REGPARAM3 sfc_get_word (uaecptr addr) REGPARAM; +extern uae_u8 REGPARAM3 sfc_get_byte (uaecptr addr) REGPARAM; +extern void REGPARAM3 dfc_put_long (uaecptr addr, uae_u32 val) REGPARAM; +extern void REGPARAM3 dfc_put_word (uaecptr addr, uae_u16 val) REGPARAM; +extern void REGPARAM3 dfc_put_byte (uaecptr addr, uae_u8 val) REGPARAM; extern void REGPARAM3 mmu_flush_atc(uaecptr addr, int super, int global) REGPARAM; extern void REGPARAM3 mmu_flush_atc_all(int global) REGPARAM; @@ -263,18 +263,18 @@ STATIC_INLINE int phys_valid_address(uaecptr a,int b, int c) { return 1; } -STATIC_INLINE uae_u32 phys_get_long(uaecptr addr) +STATIC_INLINE uae_u32 phys_get_long (uaecptr addr) { #if ARAM_PAGE_CHECK if (((addr ^ read_page) <= ARAM_PAGE_MASK)) - return do_get_mem_long((uae_u32*)(addr + read_offset)); + return do_get_mem_long((uae_u32*)(addr + read_offset)); #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) return HWget_l(addr); #endif check_ram_boundary(addr, 4, false); - uae_u32 * const m = (uae_u32 *)phys_get_real_address(addr); + uae_u32 * const m = (uae_u32 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK read_page = addr; read_offset = (uintptr)m - (uintptr)addr; @@ -282,18 +282,18 @@ STATIC_INLINE uae_u32 phys_get_long(uaecptr addr) return do_get_mem_long(m); } -STATIC_INLINE uae_u32 phys_get_word(uaecptr addr) +STATIC_INLINE uae_u32 phys_get_word (uaecptr addr) { #if ARAM_PAGE_CHECK if (((addr ^ read_page) <= ARAM_PAGE_MASK)) - return do_get_mem_word((uae_u16*)(addr + read_offset)); + return do_get_mem_word((uae_u16*)(addr + read_offset)); #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) return HWget_w(addr); #endif check_ram_boundary(addr, 2, false); - uae_u16 * const m = (uae_u16 *)phys_get_real_address(addr); + uae_u16 * const m = (uae_u16 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK read_page = addr; read_offset = (uintptr)m - (uintptr)addr; @@ -301,18 +301,18 @@ STATIC_INLINE uae_u32 phys_get_word(uaecptr addr) return do_get_mem_word(m); } -STATIC_INLINE uae_u32 phys_get_byte(uaecptr addr) +STATIC_INLINE uae_u32 phys_get_byte (uaecptr addr) { #if ARAM_PAGE_CHECK if (((addr ^ read_page) <= ARAM_PAGE_MASK)) - return do_get_mem_byte((uae_u8*)(addr + read_offset)); + return do_get_mem_byte((uae_u8*)(addr + read_offset)); #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) return HWget_b(addr); #endif check_ram_boundary(addr, 1, false); - uae_u8 * const m = (uae_u8 *)phys_get_real_address(addr); + uae_u8 * const m = (uae_u8 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK read_page = addr; read_offset = (uintptr)m - (uintptr)addr; @@ -320,23 +320,23 @@ STATIC_INLINE uae_u32 phys_get_byte(uaecptr addr) return do_get_mem_byte(m); } -STATIC_INLINE void phys_put_long(uaecptr addr, uae_u32 l) +STATIC_INLINE void phys_put_long (uaecptr addr, uae_u32 l) { #if ARAM_PAGE_CHECK if (((addr ^ write_page) <= ARAM_PAGE_MASK)) { - do_put_mem_long((uae_u32*)(addr + write_offset), l); - return; + do_put_mem_long((uae_u32*)(addr + write_offset), l); + return; } #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) { - HWput_l(addr, l); - return; - } + HWput_l(addr, l); + return; + } #endif check_ram_boundary(addr, 4, true); - uae_u32 * const m = (uae_u32 *)phys_get_real_address(addr); + uae_u32 * const m = (uae_u32 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK write_page = addr; write_offset = (uintptr)m - (uintptr)addr; @@ -344,23 +344,23 @@ STATIC_INLINE void phys_put_long(uaecptr addr, uae_u32 l) do_put_mem_long(m, l); } -STATIC_INLINE void phys_put_word(uaecptr addr, uae_u32 w) +STATIC_INLINE void phys_put_word (uaecptr addr, uae_u32 w) { #if ARAM_PAGE_CHECK if (((addr ^ write_page) <= ARAM_PAGE_MASK)) { - do_put_mem_word((uae_u16*)(addr + write_offset), w); - return; + do_put_mem_word((uae_u16*)(addr + write_offset), w); + return; } #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) { - HWput_w(addr, w); - return; + HWput_w(addr, w); + return; } #endif check_ram_boundary(addr, 2, true); - uae_u16 * const m = (uae_u16 *)phys_get_real_address(addr); + uae_u16 * const m = (uae_u16 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK write_page = addr; write_offset = (uintptr)m - (uintptr)addr; @@ -368,23 +368,23 @@ STATIC_INLINE void phys_put_word(uaecptr addr, uae_u32 w) do_put_mem_word(m, w); } -STATIC_INLINE void phys_put_byte(uaecptr addr, uae_u32 b) +STATIC_INLINE void phys_put_byte (uaecptr addr, uae_u32 b) { #if ARAM_PAGE_CHECK if (((addr ^ write_page) <= ARAM_PAGE_MASK)) { - do_put_mem_byte((uae_u8*)(addr + write_offset), b); - return; + do_put_mem_byte((uae_u8*)(addr + write_offset), b); + return; } #endif #ifndef HW_SIGSEGV addr = addr < 0xff000000 ? addr : addr & 0x00ffffff; if ((addr & 0xfff00000) == 0x00f00000) { - HWput_b(addr, b); - return; + HWput_b(addr, b); + return; } #endif check_ram_boundary(addr, 1, true); - uae_u8 * const m = (uae_u8 *)phys_get_real_address(addr); + uae_u8 * const m = (uae_u8 *)phys_get_real_address (addr); #if ARAM_PAGE_CHECK write_page = addr; write_offset = (uintptr)m - (uintptr)addr; @@ -398,112 +398,112 @@ STATIC_INLINE int is_unaligned(uaecptr addr, int size) return unlikely((addr & (size - 1)) && (addr ^ (addr + size - 1)) & 0x1000); } -STATIC_INLINE uae_u8 *mmu_get_real_address(uaecptr addr, struct mmu_atc_line *cl) +STATIC_INLINE uae_u8 *mmu_get_real_address (uaecptr addr, struct mmu_atc_line *cl) { - return do_get_real_address(cl->phys + addr); + return do_get_real_address (cl->phys + addr); } -STATIC_INLINE uae_u32 mmu_get_long(uaecptr addr, int data, int size) +STATIC_INLINE uae_u32 mmu_get_long (uaecptr addr, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 0, &cl))) - return do_get_mem_long((uae_u32 *)mmu_get_real_address(addr, cl)); + return do_get_mem_long((uae_u32 *)mmu_get_real_address (addr, cl)); return mmu_get_long_slow(addr, regs.s, data, size, cl); } -STATIC_INLINE uae_u32 get_long(uaecptr addr) +STATIC_INLINE uae_u32 get_long (uaecptr addr) { if (unlikely(is_unaligned(addr, 4))) return mmu_get_long_unaligned(addr, 1); - return mmu_get_long(addr, 1, sz_long); + return mmu_get_long (addr, 1, sz_long); } -STATIC_INLINE uae_u16 mmu_get_word(uaecptr addr, int data, int size) +STATIC_INLINE uae_u16 mmu_get_word (uaecptr addr, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 0, &cl))) - return do_get_mem_word((uae_u16 *)mmu_get_real_address(addr, cl)); + return do_get_mem_word((uae_u16 *)mmu_get_real_address (addr, cl)); return mmu_get_word_slow(addr, regs.s, data, size, cl); } -STATIC_INLINE uae_u16 get_word(uaecptr addr) +STATIC_INLINE uae_u16 get_word (uaecptr addr) { if (unlikely(is_unaligned(addr, 2))) return mmu_get_word_unaligned(addr, 1); - return mmu_get_word(addr, 1, sz_word); + return mmu_get_word (addr, 1, sz_word); } -STATIC_INLINE uae_u8 mmu_get_byte(uaecptr addr, int data, int size) +STATIC_INLINE uae_u8 mmu_get_byte (uaecptr addr, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 0, &cl))) - return do_get_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl)); + return do_get_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl)); return mmu_get_byte_slow(addr, regs.s, data, size, cl); } -STATIC_INLINE uae_u8 get_byte(uaecptr addr) +STATIC_INLINE uae_u8 get_byte (uaecptr addr) { - return mmu_get_byte(addr, 1, sz_byte); + return mmu_get_byte (addr, 1, sz_byte); } -STATIC_INLINE void mmu_put_long(uaecptr addr, uae_u32 val, int data, int size) +STATIC_INLINE void mmu_put_long (uaecptr addr, uae_u32 val, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 1, &cl))) - do_put_mem_long((uae_u32 *)mmu_get_real_address(addr, cl), val); + do_put_mem_long((uae_u32 *)mmu_get_real_address (addr, cl), val); else mmu_put_long_slow(addr, val, regs.s, data, size, cl); } -STATIC_INLINE void put_long(uaecptr addr, uae_u32 val) +STATIC_INLINE void put_long (uaecptr addr, uae_u32 val) { if (unlikely(is_unaligned(addr, 4))) mmu_put_long_unaligned(addr, val, 1); else - mmu_put_long(addr, val, 1, sz_long); + mmu_put_long (addr, val, 1, sz_long); } -STATIC_INLINE void mmu_put_word(uaecptr addr, uae_u16 val, int data, int size) +STATIC_INLINE void mmu_put_word (uaecptr addr, uae_u16 val, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 1, &cl))) - do_put_mem_word((uae_u16 *)mmu_get_real_address(addr, cl), val); + do_put_mem_word((uae_u16 *)mmu_get_real_address (addr, cl), val); else mmu_put_word_slow(addr, val, regs.s, data, size, cl); } -STATIC_INLINE void put_word(uaecptr addr, uae_u16 val) +STATIC_INLINE void put_word (uaecptr addr, uae_u16 val) { if (unlikely(is_unaligned(addr, 2))) mmu_put_word_unaligned(addr, val, 1); else - mmu_put_word(addr, val, 1, sz_word); + mmu_put_word (addr, val, 1, sz_word); } -STATIC_INLINE void mmu_put_byte(uaecptr addr, uae_u8 val, int data, int size) +STATIC_INLINE void mmu_put_byte (uaecptr addr, uae_u8 val, int data, int size) { struct mmu_atc_line *cl; if (likely(mmu_lookup(addr, data, 1, &cl))) - do_put_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl), val); + do_put_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl), val); else mmu_put_byte_slow(addr, val, regs.s, data, size, cl); } -STATIC_INLINE void put_byte(uaecptr addr, uae_u8 val) +STATIC_INLINE void put_byte (uaecptr addr, uae_u8 val) { - mmu_put_byte(addr, val, 1, sz_byte); + mmu_put_byte (addr, val, 1, sz_byte); } -STATIC_INLINE uae_u8 *get_real_address(uaecptr addr, int write, int sz) +STATIC_INLINE uae_u8 *get_real_address (uaecptr addr, int write, int sz) { (void)sz; - return phys_get_real_address(mmu_translate(addr, regs.s, 1, write)); + return phys_get_real_address (mmu_translate(addr, regs.s, 1, write)); } STATIC_INLINE uae_u32 mmu_get_user_long(uaecptr addr, int super, int data, int size) @@ -511,7 +511,7 @@ STATIC_INLINE uae_u32 mmu_get_user_long(uaecptr addr, int super, int data, int s struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 0, &cl))) - return do_get_mem_long((uae_u32 *)mmu_get_real_address(addr, cl)); + return do_get_mem_long((uae_u32 *)mmu_get_real_address (addr, cl)); return mmu_get_long_slow(addr, super, data, size, cl); } @@ -520,7 +520,7 @@ STATIC_INLINE uae_u16 mmu_get_user_word(uaecptr addr, int super, int data, int s struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 0, &cl))) - return do_get_mem_word((uae_u16 *)mmu_get_real_address(addr, cl)); + return do_get_mem_word((uae_u16 *)mmu_get_real_address (addr, cl)); return mmu_get_word_slow(addr, super, data, size, cl); } @@ -529,7 +529,7 @@ STATIC_INLINE uae_u8 mmu_get_user_byte(uaecptr addr, int super, int data, int si struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 0, &cl))) - return do_get_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl)); + return do_get_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl)); return mmu_get_byte_slow(addr, super, data, size, cl); } @@ -538,7 +538,7 @@ STATIC_INLINE void mmu_put_user_long(uaecptr addr, uae_u32 val, int super, int d struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 1, &cl))) - do_put_mem_long((uae_u32 *)mmu_get_real_address(addr, cl), val); + do_put_mem_long((uae_u32 *)mmu_get_real_address (addr, cl), val); else mmu_put_long_slow(addr, val, super, data, size, cl); } @@ -548,7 +548,7 @@ STATIC_INLINE void mmu_put_user_word(uaecptr addr, uae_u16 val, int super, int d struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 1, &cl))) - do_put_mem_word((uae_u16 *)mmu_get_real_address(addr, cl), val); + do_put_mem_word((uae_u16 *)mmu_get_real_address (addr, cl), val); else mmu_put_word_slow(addr, val, super, data, size, cl); } @@ -558,7 +558,7 @@ STATIC_INLINE void mmu_put_user_byte(uaecptr addr, uae_u8 val, int super, int da struct mmu_atc_line *cl; if (likely(mmu_user_lookup(addr, super, data, 1, &cl))) - do_put_mem_byte((uae_u8 *)mmu_get_real_address(addr, cl), val); + do_put_mem_byte((uae_u8 *)mmu_get_real_address (addr, cl), val); else mmu_put_byte_slow(addr, val, super, data, size, cl); } @@ -575,18 +575,18 @@ STATIC_INLINE int valid_address(uaecptr addr, int write, int sz) CATCH(prb) { RESTORE_EXCEPTION; return false; - } + } } #else -#define get_long(a) phys_get_long(a) -#define get_word(a) phys_get_word(a) -#define get_byte(a) phys_get_byte(a) -#define put_long(a,b) phys_put_long(a,b) -#define put_word(a,b) phys_put_word(a,b) -#define put_byte(a,b) phys_put_byte(a,b) -#define get_real_address(a,w,s) phys_get_real_address(a) +#define get_long (a) phys_get_long (a) +#define get_word (a) phys_get_word (a) +#define get_byte (a) phys_get_byte (a) +#define put_long (a,b) phys_put_long (a,b) +#define put_word (a,b) phys_put_word (a,b) +#define put_byte (a,b) phys_put_byte (a,b) +#define get_real_address (a,w,s) phys_get_real_address (a) #define valid_address(a,w,s) phys_valid_address(a,w,s) #endif diff --git a/include/events_jit.h b/include/events_jit.h index 8686178d..feea61a4 100755 --- a/include/events_jit.h +++ b/include/events_jit.h @@ -14,7 +14,7 @@ STATIC_INLINE void events_schedule (void) unsigned long int eventtime = eventtab[i].evtime - currcycle; #ifdef EVENT_DEBUG if (eventtime == 0) { - write_log("event %d bug\n",i); + write_log ("event %d bug\n",i); } #endif if (eventtime < mintime) diff --git a/include/filesys.h b/include/filesys.h index 1bd7f11d..31b67f66 100755 --- a/include/filesys.h +++ b/include/filesys.h @@ -77,8 +77,8 @@ extern struct uaedev_mount_info options_mountinfo; extern struct hardfiledata *get_hardfile_data (int nr); #define FILESYS_MAX_BLOCKSIZE 2048 -extern int hdf_open (struct hardfiledata *hfd, char *name); -extern int hdf_dup (struct hardfiledata *dhfd, struct hardfiledata *shfd); +extern int hdf_open (struct hardfiledata *hfd, const char *name); +extern int hdf_dup (struct hardfiledata *dhfd, const struct hardfiledata *shfd); extern void hdf_close (struct hardfiledata *hfd); extern int hdf_read (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len); extern int hdf_write (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len); diff --git a/include/filter.h b/include/filter.h index c31b34fc..2c78b18e 100755 --- a/include/filter.h +++ b/include/filter.h @@ -18,9 +18,9 @@ extern void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint extern void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); extern void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height); extern void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height); + u8 *dstPtr, u32 dstPitch, int width, int height); extern void AdMame2x32(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height); + u8 *dstPtr, u32 dstPitch, int width, int height); extern void hq_init(int rb, int gb, int bb, int rs, int gs, int bs); extern void hq2x_32(unsigned char*, unsigned char*, int, int, int, int, int); diff --git a/include/flags_x86.h b/include/flags_x86.h index 89503a21..f3129ea5 100755 --- a/include/flags_x86.h +++ b/include/flags_x86.h @@ -7,7 +7,7 @@ * Gwenole Beauchesne * * Basilisk II (C) 1997-2005 Christian Bauer - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/include/inputdevice.h b/include/inputdevice.h index 3a87e3dc..0041bd79 100755 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -51,7 +51,7 @@ struct uae_input_device_kbr_default { extern int inputdevice_iterate (int devnum, int num, char *name, int *af); extern int inputdevice_set_mapping (int devnum, int num, char *name, char *custom, int af, int sub); extern int inputdevice_get_mapped_name (int devnum, int num, int *pflags, char *name, char *custom, int sub); -extern void inputdevice_copyconfig (struct uae_prefs *src, struct uae_prefs *dst); +extern void inputdevice_copyconfig (const struct uae_prefs *src, struct uae_prefs *dst); extern void inputdevice_copy_single_config (struct uae_prefs *p, int src, int dst, int devnum); extern void inputdevice_swap_ports (struct uae_prefs *p, int devnum); extern void inputdevice_config_change (void); @@ -150,12 +150,12 @@ extern void inputdevice_handle_inputcode (void); #define JSEM_LASTKBD 5 #define JSEM_ISANYKBD(port,p) (jsem_iskbdjoy(port,p) >= JSEM_KBDLAYOUT && jsem_iskbdjoy(port,p) < JSEM_KBDLAYOUT + JSEM_LASTKBD) -extern int jsem_isjoy (int port, struct uae_prefs *p); -extern int jsem_ismouse (int port, struct uae_prefs *p); -extern int jsem_iskbdjoy (int port, struct uae_prefs *p); -extern void do_fake_joystick(int nr, int *fake); +extern int jsem_isjoy (int port, const struct uae_prefs *p); +extern int jsem_ismouse (int port, const struct uae_prefs *p); +extern int jsem_iskbdjoy (int port, const struct uae_prefs *p); +extern void do_fake_joystick (int nr, int *fake); -extern int inputdevice_uaelib (char*, char*); +extern int inputdevice_uaelib (char *, char *); #define INPREC_JOYPORT 1 #define INPREC_JOYBUTTON 2 diff --git a/include/keyboard.h b/include/keyboard.h index baf77fdb..f9c5b4f1 100755 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -155,4 +155,4 @@ enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT, AKS_FREEZEBUTTON, AKS_INPUT_CONFIG_1,AKS_INPUT_CONFIG_2,AKS_INPUT_CONFIG_3,AKS_INPUT_CONFIG_4, AKS_DISKSWAPPER_NEXT,AKS_DISKSWAPPER_PREV, AKS_DISKSWAPPER_INSERT0,AKS_DISKSWAPPER_INSERT1,AKS_DISKSWAPPER_INSERT2,AKS_DISKSWAPPER_INSERT3, -}; +}; diff --git a/include/keybuf.h b/include/keybuf.h index e4fe8457..16e541f3 100755 --- a/include/keybuf.h +++ b/include/keybuf.h @@ -14,4 +14,4 @@ extern void record_key_direct (int); extern void keybuf_init (void); extern void joystick_setting_changed (void); extern int getcapslockstate (void); -extern void setcapslockstate (int); \ No newline at end of file +extern void setcapslockstate (int); diff --git a/include/memory.h b/include/memory.h index 07e7ba84..46b1ac9c 100755 --- a/include/memory.h +++ b/include/memory.h @@ -172,15 +172,15 @@ extern void memory_hardreset (void); #define wordput(addr,w) (call_mem_put_func(get_mem_bank(addr).wput, addr, w)) #define byteput(addr,b) (call_mem_put_func(get_mem_bank(addr).bput, addr, b)) -STATIC_INLINE uae_u32 get_long(uaecptr addr) +STATIC_INLINE uae_u32 get_long (uaecptr addr) { return longget(addr); } -STATIC_INLINE uae_u32 get_word(uaecptr addr) +STATIC_INLINE uae_u32 get_word (uaecptr addr) { return wordget(addr); } -STATIC_INLINE uae_u32 get_byte(uaecptr addr) +STATIC_INLINE uae_u32 get_byte (uaecptr addr) { return byteget(addr); } @@ -197,7 +197,7 @@ STATIC_INLINE uae_u32 get_wordi(uaecptr addr) * Read a host pointer from addr */ #if SIZEOF_VOID_P == 4 -# define get_pointer(addr) ((void *)get_long(addr)) +# define get_pointer(addr) ((void *)get_long (addr)) #else # if SIZEOF_VOID_P == 8 STATIC_INLINE void *get_pointer (uaecptr addr) @@ -223,15 +223,15 @@ STATIC_INLINE void *get_pointer (uaecptr addr) # endif #endif -STATIC_INLINE void put_long(uaecptr addr, uae_u32 l) +STATIC_INLINE void put_long (uaecptr addr, uae_u32 l) { longput(addr, l); } -STATIC_INLINE void put_word(uaecptr addr, uae_u32 w) +STATIC_INLINE void put_word (uaecptr addr, uae_u32 w) { wordput(addr, w); } -STATIC_INLINE void put_byte(uaecptr addr, uae_u32 b) +STATIC_INLINE void put_byte (uaecptr addr, uae_u32 b) { byteput(addr, b); } @@ -240,7 +240,7 @@ STATIC_INLINE void put_byte(uaecptr addr, uae_u32 b) * Store host pointer v at addr */ #if SIZEOF_VOID_P == 4 -# define put_pointer(addr, p) (put_long((addr), (uae_u32)(p))) +# define put_pointer(addr, p) (put_long ((addr), (uae_u32)(p))) #else # if SIZEOF_VOID_P == 8 STATIC_INLINE void put_pointer (uaecptr addr, void *v) @@ -265,7 +265,7 @@ STATIC_INLINE void put_pointer (uaecptr addr, void *v) # endif #endif -STATIC_INLINE uae_u8 *get_real_address(uaecptr addr) +STATIC_INLINE uae_u8 *get_real_address (uaecptr addr) { return get_mem_bank(addr).xlateaddr(addr); } diff --git a/include/moduleripper.h b/include/moduleripper.h index 7f836dc4..02e8ad14 100755 --- a/include/moduleripper.h +++ b/include/moduleripper.h @@ -1,4 +1,4 @@ extern int prowizard_search (unsigned char *in_data, int in_size); extern void moduleripper (void); extern FILE *moduleripper_fopen(const char *, const char *); -extern FILE *moduleripper2_fopen(const char *, const char *, const char *); +extern FILE *moduleripper2_fopen(const char *, const char *, const char *, int, int); diff --git a/include/native2amiga.h b/include/native2amiga.h index ff08885d..31ca6f85 100755 --- a/include/native2amiga.h +++ b/include/native2amiga.h @@ -5,7 +5,7 @@ * and without stack magic. * * Copyright 1999 Patrick Ohly - * + * * Uses the EXTER interrupt that is setup in filesys.c * and some of it needs thread support. */ @@ -26,7 +26,7 @@ void uae_NewList(uaecptr list); /* * The following functions are shortcuts for calling - * the exec.library function with CallLib(), so they + * the exec.library function with CallLib (), so they * are only available in a trap function. This trap * function has to be setup with deftrap2() and * TRAPFLAG_EXTRA_STACK and stack magic is required. diff --git a/include/newcpu.h b/include/newcpu.h index 150b7fb3..593af345 100755 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -95,6 +95,9 @@ extern struct regstruct uae_u8 *pc_p; uae_u8 *pc_oldp; + uae_u16 irc, ir; + uae_u32 spcflags; + uaecptr usp, isp, msp; uae_u16 sr; flagtype t1; @@ -111,7 +114,7 @@ extern struct regstruct fptype fp[8]; fptype fp_result; - uae_u32 fpcr,fpsr, fpiar; + uae_u32 fpcr, fpsr, fpiar; uae_u32 fpsr_highbyte; #endif #ifndef CPUEMU_68000_ONLY @@ -128,12 +131,9 @@ extern struct regstruct #endif uae_u32 pcr; - uae_u32 spcflags; uae_u32 kick_mask; uae_u32 address_space_mask; - uae_u16 irc, ir; - uae_u8 panic; uae_u32 panic_pc, panic_addr; @@ -156,7 +156,7 @@ typedef union { extern signed long pissoff; -STATIC_INLINE uae_u32 munge24(uae_u32 x) +STATIC_INLINE uae_u32 munge24 (uae_u32 x) { return x & regs.address_space_mask; } @@ -169,7 +169,7 @@ extern int cpu_cycles; STATIC_INLINE void set_special (struct regstruct *regs, uae_u32 x) { regs->spcflags |= x; - cycles_do_special(); + cycles_do_special (); } STATIC_INLINE void unset_special (struct regstruct *regs, uae_u32 x) @@ -197,6 +197,8 @@ STATIC_INLINE uaecptr m68k_getpc_p (struct regstruct *regs, uae_u8 *p) return (uaecptr)(regs->pc + ((char *)p - (char *)regs->pc_oldp)); } +#define m68k_incpc(regs, o) ((regs)->pc_p += (o)) + STATIC_INLINE void m68k_setpci(struct regstruct *regs, uaecptr newpc) { regs->pc = newpc; @@ -210,6 +212,37 @@ STATIC_INLINE void m68k_incpci(struct regstruct *regs, int o) regs->pc += o; } +STATIC_INLINE void m68k_do_rts(struct regstruct *regs) +{ + m68k_setpc(regs, get_long(m68k_areg (regs, 7))); + m68k_areg (regs, 7) += 4; +} +STATIC_INLINE void m68k_do_rtsi(struct regstruct *regs) +{ + m68k_setpci(regs, get_long(m68k_areg (regs, 7))); + m68k_areg (regs, 7) += 4; +} + +STATIC_INLINE void m68k_do_bsr(struct regstruct *regs, uaecptr oldpc, uae_s32 offset) +{ + m68k_areg (regs, 7) -= 4; + put_long(m68k_areg (regs, 7), oldpc); + m68k_incpc(regs, offset); +} +STATIC_INLINE void m68k_do_bsri(struct regstruct *regs, uaecptr oldpc, uae_s32 offset) +{ + m68k_areg (regs, 7) -= 4; + put_long(m68k_areg (regs, 7), oldpc); + m68k_incpci(regs, offset); +} + +STATIC_INLINE void m68k_do_jsr(struct regstruct *regs, uaecptr oldpc, uaecptr dest) +{ + m68k_areg (regs, 7) -= 4; + put_long(m68k_areg (regs, 7), oldpc); + m68k_setpc(regs, dest); +} + #define get_ibyte(regs, o) do_get_mem_byte((uae_u8 *)((regs)->pc_p + (o) + 1)) #define get_iword(regs, o) do_get_mem_word((uae_u16 *)((regs)->pc_p + (o))) #define get_ilong(regs, o) do_get_mem_long((uae_u32 *)((regs)->pc_p + (o))) @@ -217,8 +250,6 @@ STATIC_INLINE void m68k_incpci(struct regstruct *regs, int o) #define get_iwordi(o) get_wordi(o) #define get_ilongi(o) get_longi(o) -#define m68k_incpc(regs, o) ((regs)->pc_p += (o)) - /* These are only used by the 68020/68881 code, and therefore don't * need to handle prefetch. */ STATIC_INLINE uae_u32 next_ibyte (struct regstruct *regs) @@ -254,37 +285,6 @@ STATIC_INLINE uae_u32 next_ilongi (struct regstruct *regs) return r; } -STATIC_INLINE void m68k_do_rts(struct regstruct *regs) -{ - m68k_setpc(regs, get_long(m68k_areg(regs, 7))); - m68k_areg(regs, 7) += 4; -} -STATIC_INLINE void m68k_do_rtsi(struct regstruct *regs) -{ - m68k_setpci(regs, get_long(m68k_areg(regs, 7))); - m68k_areg(regs, 7) += 4; -} - -STATIC_INLINE void m68k_do_bsr(struct regstruct *regs, uaecptr oldpc, uae_s32 offset) -{ - m68k_areg(regs, 7) -= 4; - put_long(m68k_areg(regs, 7), oldpc); - m68k_incpc(regs, offset); -} -STATIC_INLINE void m68k_do_bsri(struct regstruct *regs, uaecptr oldpc, uae_s32 offset) -{ - m68k_areg(regs, 7) -= 4; - put_long(m68k_areg(regs, 7), oldpc); - m68k_incpci(regs, offset); -} - -STATIC_INLINE void m68k_do_jsr(struct regstruct *regs, uaecptr oldpc, uaecptr dest) -{ - m68k_areg(regs, 7) -= 4; - put_long(m68k_areg(regs, 7), oldpc); - m68k_setpc(regs, dest); -} - STATIC_INLINE void m68k_setstopped (struct regstruct *regs, int stop) { regs->stopped = stop; @@ -391,4 +391,4 @@ struct cpum2c { int regno; char *regname; }; -extern struct cpum2c m2cregs[]; \ No newline at end of file +extern struct cpum2c m2cregs[]; diff --git a/include/options.h b/include/options.h index 045cb4d3..742469f4 100755 --- a/include/options.h +++ b/include/options.h @@ -67,8 +67,8 @@ struct uaedev_config_info { int controller; }; -typedef enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, - CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T }; +enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, + CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T }; struct uae_prefs { @@ -348,7 +348,7 @@ extern int target_cfgfile_load (struct uae_prefs *, char *filename, int type, in extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type); extern int cfgfile_load (struct uae_prefs *p, const char *filename, int *type, int ignorelink); -extern int cfgfile_save (struct uae_prefs *, const char *filename, int); +extern int cfgfile_save (struct uae_prefs *p, const char *filename, int); extern void cfgfile_parse_line (struct uae_prefs *p, char *, int); extern int cfgfile_parse_option (struct uae_prefs *p, char *option, char *value, int); extern int cfgfile_get_description (const char *filename, char *description, char *hostlink, char *hardwarelink, int *type); @@ -357,8 +357,8 @@ extern uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxl extern uae_u32 cfgfile_uaelib_modify (uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize); extern uae_u32 cfgfile_modify (uae_u32 index, char *parms, uae_u32 size, char *out, uae_u32 outsize); extern void cfgfile_addcfgparam (char *); -extern int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck); -extern int build_in_chipset_prefs (struct uae_prefs *p); +extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck); +extern int built_in_chipset_prefs (struct uae_prefs *p); extern int cmdlineparser (char *s, char *outp[], int max); extern int cfgfile_configuration_change(int); extern void fixup_prefs_dimensions (struct uae_prefs *prefs); diff --git a/include/osemu.h b/include/osemu.h index acd536b6..4295f55c 100755 --- a/include/osemu.h +++ b/include/osemu.h @@ -8,7 +8,7 @@ STATIC_INLINE char *raddr(uaecptr p) { - return p == 0 ? NULL : (char *)get_real_address(p); + return p == 0 ? NULL : (char *)get_real_address (p); } extern void gfxlib_install(void); diff --git a/include/savestate.h b/include/savestate.h index 8637329b..13936d23 100755 --- a/include/savestate.h +++ b/include/savestate.h @@ -20,7 +20,7 @@ extern uae_u32 restore_u32_func (uae_u8 **); extern uae_u16 restore_u16_func (uae_u8 **); extern uae_u8 restore_u8_func (uae_u8 **); -extern void save_string_func (uae_u8 **, char*); +extern void save_string_func (uae_u8 **, const char*); extern char *restore_string_func (uae_u8 **); #define save_u64(x) save_u64_func (&dst, (x)) diff --git a/include/serial.h b/include/serial.h index 5ea7e41d..0ba55c7d 100755 --- a/include/serial.h +++ b/include/serial.h @@ -7,24 +7,24 @@ * Copyright 1997 Christian Schmitt */ -extern void serial_init(void); -extern void serial_exit(void); -extern void serial_dtr_off(void); +extern void serial_init (void); +extern void serial_exit (void); +extern void serial_dtr_off (void); extern void serial_dtr_on (void); -extern uae_u16 SERDATR(void); -extern int SERDATS(void); -extern void SERPER(uae_u16 w); -extern void SERDAT(uae_u16 w); +extern uae_u16 SERDATR (void); +extern int SERDATS (void); +extern void SERPER (uae_u16 w); +extern void SERDAT (uae_u16 w); -extern uae_u8 serial_writestatus(uae_u8, uae_u8); +extern uae_u8 serial_writestatus (uae_u8, uae_u8); extern uae_u8 serial_readstatus (uae_u8); extern void serial_uartbreak (int); extern uae_u16 serdat; extern int doreadser, serstat; -extern void serial_flush_buffer(void); +extern void serial_flush_buffer (void); extern void serial_hsynchandler (void); extern void serial_check_irq (void); diff --git a/include/uaeexe.h b/include/uaeexe.h index e85b42ac..49c96168 100755 --- a/include/uaeexe.h +++ b/include/uaeexe.h @@ -5,7 +5,7 @@ */ struct uae_xcmd { - struct uae_xcmd *prev,*next; + struct uae_xcmd *prev, *next; char *cmd; }; @@ -15,7 +15,7 @@ struct uae_xcmd { #define UAEEXE_NOTRUNNING 1 #define UAEEXE_NOMEM 2 -extern void uaeexe_install(void); -extern int uaeexe(const char *cmd); +extern void uaeexe_install (void); +extern int uaeexe (const char *cmd); diff --git a/inputdevice.c b/inputdevice.c index ea1ce054..9b810629 100755 --- a/inputdevice.c +++ b/inputdevice.c @@ -140,7 +140,7 @@ int inprec_open(char *fname, int record) zfile_fseek (inprec_zf, 0, SEEK_END); inprec_size = zfile_ftell (inprec_zf); zfile_fseek (inprec_zf, 0, SEEK_SET); - inprec_buffer = inprec_p = (uae_u8*)xmalloc (inprec_size); + inprec_buffer = inprec_p = (uae_u8*)xmalloc (inprec_size); zfile_fread (inprec_buffer, inprec_size, 1, inprec_zf); inprec_plastptr = inprec_buffer; id = inprec_pu32(); @@ -194,9 +194,9 @@ void inprec_close(void) xfree (inprec_buffer); inprec_buffer = NULL; input_recording = 0; - write_log("inprec finished\n"); + write_log ("inprec finished\n"); } - + void inprec_ru8(uae_u8 v) { *inprec_p++= v; @@ -221,7 +221,7 @@ void inprec_rstr(const char *s) } void inprec_rstart(uae_u8 type) { - write_log("INPREC: %08.8X: %d\n", hsync_counter, type); + write_log ("INPREC: %08.8X: %d\n", hsync_counter, type); inprec_ru32(hsync_counter); inprec_ru8(0); inprec_plast = inprec_p; @@ -256,23 +256,23 @@ int inprec_pstart(uae_u8 type) for (;;) { uae_u32 hc2 = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; if (p > lastp) { - write_log("INPREC: Next %08.8x (%08.8x=%d): %d (%d)\n", hc2, hc, hc2 - hc, p[5 + 1], p[5]); + write_log ("INPREC: Next %08.8x (%08.8x=%d): %d (%d)\n", hc2, hc, hc2 - hc, p[5 + 1], p[5]); lastp = p; } hc2_orig = hc2; hc2 /= inprec_div; hc2 *= inprec_div; if (hc > hc2) { - write_log("INPREC: %08.8x > %08.8x: %d (%d) missed!\n", hc, hc2, p[5 + 1], p[5]); + write_log ("INPREC: %08.8x > %08.8x: %d (%d) missed!\n", hc, hc2, p[5 + 1], p[5]); inprec_close(); return 0; } if (hc2 != hc) { - lastp = p; + lastp = p; break; } if (p[5 + 1] == type) { - write_log("INPREC: %08.8x: %d (%d) (%+d)\n", hc, type, p[5], hc_orig - hc2_orig); + write_log ("INPREC: %08.8x: %d (%d) (%+d)\n", hc, type, p[5], hc_orig - hc2_orig); inprec_plast = p; inprec_plastptr = p + 5 + 2; return 1; @@ -545,9 +545,9 @@ void write_inputdevice_config (struct uae_prefs *p, struct zfile *f) } } -static int getnum (char **pp) +static int getnum (const char **pp) { - char *p = *pp; + const char *p = *pp; int v = atol (p); while (*p != 0 && *p !='.' && *p != ',') p++; @@ -555,17 +555,19 @@ static int getnum (char **pp) *pp = p; return v; } -static char *getstring (char **pp) +static char *getstring (const char **pp) { int i; static char str[1000]; - char *p = *pp; + const char *p = *pp; if (*p == 0) return 0; i = 0; - while (*p != 0 && *p !='.' && *p != ',') str[i++] = *p++; - if (*p == '.' || *p == ',') p++; + while (*p != 0 && *p !='.' && *p != ',') + str[i++] = *p++; + if (*p == '.' || *p == ',') + p++; str[i] = 0; *pp = p; return str; @@ -759,13 +761,13 @@ static uae_u32 magicmouse_ibase = 0; static uaecptr get_intuitionbase(void) { - uaecptr v = get_long(4); + uaecptr v = get_long (4); addrbank *b = &get_mem_bank(v); if (!b || !b->check(v, 400) || b->flags != ABFLAG_RAM) return 0; v += 378; // liblist - while (v = get_long(v)) { + while (v = get_long (v)) { uae_u32 v2; uae_u8 *p; b = &get_mem_bank(v); @@ -773,7 +775,7 @@ static uaecptr get_intuitionbase(void) magicmouse_ibase = 0xffffffff; return 0; } - v2 = get_long(v + 10); // name + v2 = get_long (v + 10); // name b = &get_mem_bank(v2); if (!b || !b->check (v2, 20)) { magicmouse_ibase = 0xffffffff; @@ -807,7 +809,7 @@ static void mousehack_setpos(int mousexpos, int mouseypos) p[1] = mousexpos; p[2] = mouseypos >> 8; p[3] = mouseypos; - //write_log("%dx%d\n", mousexpos, mouseypos); + //write_log ("%dx%d\n", mousexpos, mouseypos); } static int mouseedge_x, mouseedge_y, mouseedge_time; @@ -843,11 +845,11 @@ static void mouseedge(void) ib = magicmouse_ibase; if (!ib) return; - x = get_word(ib + 70); - y = get_word(ib + 68); + x = get_word (ib + 70); + y = get_word (ib + 68); if (x || y) isnonzero = 1; - //write_log("%x x %d\n", x, y); + //write_log ("%x x %d\n", x, y); if (!isnonzero) return; if (melast_x == x) { @@ -863,7 +865,7 @@ static void mouseedge(void) } } else { mouseedge_x = 0; - melast_x = x; + melast_x = x; } if (melast_y == y) { if (mouseedge_y < -MOUSEEDGE_RANGE) { @@ -878,7 +880,7 @@ static void mouseedge(void) } } else { mouseedge_y = 0; - melast_y = y; + melast_y = y; } return; @@ -888,7 +890,7 @@ end: if (!picasso_on) { drawing_adjust_mousepos(&x, &y); } - //write_log("%d\n", dir); + //write_log ("%d\n", dir); if (!dmaen(DMA_SPRITE)) setmouseactivexy(x, y, 0); else @@ -1066,7 +1068,7 @@ int getjoystate (int joy) uae_u16 v = 0; if (inputdevice_logging & 2) - write_log("JOY%dDAT %x\n", joy, m68k_getpc(®s)); + write_log ("JOY%dDAT %x\n", joy, m68k_getpc (®s)); readinput (); if (joydir[joy] & DIR_LEFT) left = 1; @@ -1191,7 +1193,7 @@ uae_u8 handle_joystick_buttons (uae_u8 dra) } } if (inputdevice_logging & 4) - write_log("BFE001: %02.2X:%02.2X %x\n", dra, but, M68K_GETPC); + write_log ("BFE001: %02.2X:%02.2X %x\n", dra, but, M68K_GETPC); return but; } @@ -1386,7 +1388,7 @@ uae_u16 POTGOR (void) write_log ("POTGOR %04.4X %s\n", v, debuginfo(0)); #endif if (inputdevice_logging & 16) - write_log("POTGO_R: %04.4X %d %p\n", v, cd32_shifter[1], M68K_GETPC); + write_log ("POTGO_R: %04.4X %d %p\n", v, cd32_shifter[1], M68K_GETPC); return v; } @@ -1435,18 +1437,18 @@ static void queue_input_event (int event, int state, int max, int framecnt, int static uae_u8 keybuf[256]; static int inputcode_pending, inputcode_pending_state; - void inputdevice_release_all_keys (void) - { - int i; - - for (i = 0; i < 0x80; i++) { - if (keybuf[i] != 0) { - keybuf[i] = 0; - record_key (i << 1|1); - } - } - } - +void inputdevice_release_all_keys (void) +{ + int i; + + for (i = 0; i < 0x80; i++) { + if (keybuf[i] != 0) { + keybuf[i] = 0; + record_key (i << 1|1); + } + } +} + void inputdevice_add_inputcode (int code, int state) { @@ -1466,7 +1468,7 @@ void inputdevice_do_keyboard (int code, int state) } record_key ((uae_u8)((key << 1) | (key >> 7))); if (inputdevice_logging & 1) - write_log("Amiga key %02.2X %d\n", key & 0x7f, key >> 7); + write_log ("Amiga key %02.2X %d\n", key & 0x7f, key >> 7); return; } inputdevice_add_inputcode (code, state); @@ -1633,8 +1635,8 @@ void inputdevice_handle_inputcode (void) case AKS_DECREASEREFRESHRATE: case AKS_INCREASEREFRESHRATE: { - int dir = code == AKS_INCREASEREFRESHRATE ? 5 : -5; - if (currprefs.chipset_refreshrate == 0) + int dir = code == AKS_INCREASEREFRESHRATE ? 5 : -5; + if (currprefs.chipset_refreshrate == 0) currprefs.chipset_refreshrate = currprefs.ntscmode ? 60 : 50; changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate + dir; if (changed_prefs.chipset_refreshrate < 10) @@ -1662,7 +1664,7 @@ void inputdevice_handle_inputcode (void) case AKS_DISKSWAPPER_INSERT1: case AKS_DISKSWAPPER_INSERT2: case AKS_DISKSWAPPER_INSERT3: - strcpy (changed_prefs.df[code - AKS_DISKSWAPPER_INSERT0], currprefs.dfxlist[swapperslot]); + strcpy (changed_prefs.df[code - AKS_DISKSWAPPER_INSERT0], currprefs.dfxlist[swapperslot]); break; break; @@ -1684,7 +1686,7 @@ int handle_custom_event (char *custom) return 0; p = buf = my_strdup (custom); while (p && *p) { - char *p2; + char *p2; if (*p != '\"') break; p++; @@ -1695,9 +1697,9 @@ int handle_custom_event (char *custom) *p2++ = 0; nextp = p2 + 1; while (*nextp == ' ') - nextp++; + nextp++; } - write_log("'%s'\n", p); + write_log ("'%s'\n", p); cfgfile_parse_line (&changed_prefs, p, 0); p = nextp; } @@ -1714,7 +1716,7 @@ int handle_input_event (int nr, int state, int max, int autofire) return 0; ie = &events[nr]; if (inputdevice_logging & 1) - write_log("'%s' %d %d\n", ie->name, state, max); + write_log ("'%s' %d %d\n", ie->name, state, max); if (autofire) { if (state) queue_input_event (nr, state, max, currprefs.input_autofire_framecnt, 1); @@ -1921,18 +1923,18 @@ static void process_custom_event (struct uae_input_device *id, int offset, int s char *custom; if (state < 0) { - idx = 0; - custompos = 0; + idx = 0; + custompos = 0; } else { - idx = state > 0 ? 0 : 1; - if (custompos) + idx = state > 0 ? 0 : 1; + if (custompos) idx += 2; if (state == 0) custompos ^= 1; } custom = id->custom[offset][idx]; if (custom == NULL) { - if (idx >= 2) + if (idx >= 2) custom = id->custom[offset][idx - 2]; } handle_custom_event (custom); @@ -2024,7 +2026,7 @@ static int ismouse (int ei) static void scanevents(struct uae_prefs *p) { int i, j, k, ei; - struct inputevent *e; + const struct inputevent *e; int n_joy = idev[IDTYPE_JOYSTICK].get_num(); int n_mouse = idev[IDTYPE_MOUSE].get_num(); @@ -2114,6 +2116,7 @@ static void setcd32 (int joy, int n) #endif int compatibility_device[2]; + static void compatibility_mode (struct uae_prefs *prefs) { int joy, i; @@ -2232,7 +2235,7 @@ void inputdevice_updateconfig (struct uae_prefs *prefs) #endif if (mousehack_allowed()) - mousehack_enable(); + mousehack_enable(); } static void set_kbr_default (struct uae_prefs *p, int index, int num) @@ -2384,7 +2387,7 @@ void inputdevice_close (void) inprec_close (); } -static struct uae_input_device *get_uid (struct inputdevice_functions *id, int devnum) +static struct uae_input_device *get_uid (const struct inputdevice_functions *id, int devnum) { struct uae_input_device *uid = 0; if (id == &idev[IDTYPE_JOYSTICK]) { @@ -2397,9 +2400,9 @@ static struct uae_input_device *get_uid (struct inputdevice_functions *id, int d return uid; } -static int get_event_data (struct inputdevice_functions *id, int devnum, int num, int *eventid, char **custom, int *flags, int sub) +static int get_event_data (const struct inputdevice_functions *id, int devnum, int num, int *eventid, char **custom, int *flags, int sub) { - struct uae_input_device *uid = get_uid (id, devnum); + const struct uae_input_device *uid = get_uid (id, devnum); int type = id->get_widget_type (devnum, num, 0, 0); int i; if (type == IDEV_WIDGET_BUTTON) { @@ -2424,7 +2427,7 @@ static int get_event_data (struct inputdevice_functions *id, int devnum, int num return -1; } -static int put_event_data (struct inputdevice_functions *id, int devnum, int num, int eventid, char *custom, int flags, int sub) +static int put_event_data (const struct inputdevice_functions *id, int devnum, int num, int eventid, char *custom, int flags, int sub) { struct uae_input_device *uid = get_uid (id, devnum); int type = id->get_widget_type (devnum, num, 0, 0); @@ -2454,7 +2457,7 @@ static int put_event_data (struct inputdevice_functions *id, int devnum, int num return -1; } -static int is_event_used (struct inputdevice_functions *id, int devnum, int isnum, int isevent) +static int is_event_used (const struct inputdevice_functions *id, int devnum, int isnum, int isevent) { struct uae_input_device *uid = get_uid (id, devnum); int num, evt, flag, sub; @@ -2514,7 +2517,7 @@ char *inputdevice_get_device_name (int type, int devnum) /* returns state (enabled/disabled) */ int inputdevice_get_device_status (int devnum) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); return uid->enabled; } @@ -2522,7 +2525,7 @@ int inputdevice_get_device_status (int devnum) /* set state (enabled/disabled) */ void inputdevice_set_device_status (int devnum, int enabled) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); uid->enabled = enabled; } @@ -2530,11 +2533,11 @@ void inputdevice_set_device_status (int devnum, int enabled) /* returns number of axis/buttons and keys from selected device */ int inputdevice_get_widget_num (int devnum) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); return idf->get_widget_num (inputdevice_get_device_index (devnum)); } -static void get_ename (struct inputevent *ie, char *out) +static void get_ename (const struct inputevent *ie, char *out) { if (!out) return; @@ -2546,7 +2549,7 @@ static void get_ename (struct inputevent *ie, char *out) int inputdevice_iterate (int devnum, int num, char *name, int *af) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); static int id_iterator; struct inputevent *ie; int mask, data, flags, type; @@ -2603,8 +2606,8 @@ int inputdevice_iterate (int devnum, int num, char *name, int *af) int inputdevice_get_mapped_name (int devnum, int num, int *pflags, char *name, char *custom, int sub) { - struct inputdevice_functions *idf = getidf (devnum); - struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); + const struct inputdevice_functions *idf = getidf (devnum); + const struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); int flags = 0, flag, data; int devindex = inputdevice_get_device_index (devnum); char *customp = NULL; @@ -2635,8 +2638,8 @@ int inputdevice_get_mapped_name (int devnum, int num, int *pflags, char *name, c int inputdevice_set_mapping (int devnum, int num, char *name, char *custom, int af, int sub) { - struct inputdevice_functions *idf = getidf (devnum); - struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); + const struct inputdevice_functions *idf = getidf (devnum); + const struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); int eid, data, flag, amask; char ename[256]; int devindex = inputdevice_get_device_index (devnum); @@ -2673,7 +2676,7 @@ int inputdevice_set_mapping (int devnum, int num, char *name, char *custom, int int inputdevice_get_widget_type (int devnum, int num, char *name) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); return idf->get_widget_type (inputdevice_get_device_index (devnum), num, name, 0); } @@ -2691,7 +2694,7 @@ int inputdevice_config_change_test (void) return v; } -void inputdevice_copyconfig (struct uae_prefs *src, struct uae_prefs *dst) +void inputdevice_copyconfig (const struct uae_prefs *src, struct uae_prefs *dst) { int i, j; @@ -2718,10 +2721,10 @@ void inputdevice_copyconfig (struct uae_prefs *src, struct uae_prefs *dst) void inputdevice_swap_ports (struct uae_prefs *p, int devnum) { - struct inputdevice_functions *idf = getidf (devnum); + const struct inputdevice_functions *idf = getidf (devnum); struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum)); int i, j, k, event, unit; - struct inputevent *ie, *ie2; + const struct inputevent *ie, *ie2; for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) { for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) { @@ -2791,7 +2794,7 @@ void inputdevice_unacquire (void) static int ignoreoldinput(int joy) { if (currprefs.input_selected_setting == 0) { - if (jsem_isjoy (0, &currprefs) != joy && jsem_isjoy (1, &currprefs) != joy) + if (jsem_isjoy (0, &currprefs) != joy && jsem_isjoy (1, &currprefs) != joy) return 1; } return 0; @@ -2989,7 +2992,7 @@ void pausemode (int mode) pause_emulation = mode; } -int jsem_isjoy (int port, struct uae_prefs *p) +int jsem_isjoy (int port, const struct uae_prefs *p) { int v = JSEM_DECODEVAL (port, p); if (v < JSEM_JOYS) @@ -2999,7 +3002,8 @@ int jsem_isjoy (int port, struct uae_prefs *p) return -1; return v; } -int jsem_ismouse (int port, struct uae_prefs *p) + +int jsem_ismouse (int port, const struct uae_prefs *p) { int v = JSEM_DECODEVAL (port, p); if (v < JSEM_MICE) @@ -3009,7 +3013,8 @@ int jsem_ismouse (int port, struct uae_prefs *p) return -1; return v; } -int jsem_iskbdjoy (int port, struct uae_prefs *p) + +int jsem_iskbdjoy (int port, const struct uae_prefs *p) { int v = JSEM_DECODEVAL (port, p); if (v < JSEM_KBDLAYOUT) @@ -3019,6 +3024,3 @@ int jsem_iskbdjoy (int port, struct uae_prefs *p) return -1; return v; } - -extern int jsem_ismouse (int v, struct uae_prefs*); -extern int jsem_iskbd (int v, struct uae_prefs*); diff --git a/keybuf.c b/keybuf.c index 86f345a3..019d2fa2 100755 --- a/keybuf.c +++ b/keybuf.c @@ -190,7 +190,7 @@ void record_key_direct (int kc) void joystick_setting_changed (void) { fs_np = fs_ck = fs_se = 0; -#ifdef ARCADIA +#ifdef ARCADIA fs_xa1 = fs_xa2 = 0; #endif @@ -209,7 +209,7 @@ void joystick_setting_changed (void) else if (JSEM_ISSOMEWHEREELSE (1, &currprefs)) fs_se = fakestate[1]; -#ifdef ARCADIA +#ifdef ARCADIA if (JSEM_ISXARCADE1 (0, &currprefs)) fs_xa1 = fakestate[0]; else if (JSEM_ISXARCADE1 (1, &currprefs)) @@ -220,7 +220,7 @@ void joystick_setting_changed (void) else if (JSEM_ISXARCADE2 (1, &currprefs)) fs_xa2 = fakestate[1]; #endif - } +} void keybuf_init (void) { diff --git a/main.c b/main.c index 6114f876..3dfaae23 100755 --- a/main.c +++ b/main.c @@ -65,9 +65,9 @@ char warning_buffer[256]; char optionsfile[256]; -int uaerand(void) +int uaerand (void) { - return rand(); + return rand (); } /* If you want to pipe printer output to a file, put something like * "cat >>printerfile.tmp" above. @@ -120,33 +120,33 @@ static void fixup_prefs_dim2 (struct wh *wh) void fixup_prefs_dimensions (struct uae_prefs *prefs) { - fixup_prefs_dim2(&prefs->gfx_size_fs); - fixup_prefs_dim2(&prefs->gfx_size_win); + fixup_prefs_dim2 (&prefs->gfx_size_fs); + fixup_prefs_dim2 (&prefs->gfx_size_win); } -void fixup_cpu(struct uae_prefs *p) +void fixup_cpu (struct uae_prefs *p) { - switch(p->cpu_model) + switch (p->cpu_model) { - case 68000: + case 68000: p->address_space_24 = 1; p->fpu_model = 0; - break; - case 68010: + break; + case 68010: p->address_space_24 = 1; p->fpu_model = 0; break; - case 68020: + case 68020: break; - case 68030: + case 68030: p->address_space_24 = 0; break; - case 68040: + case 68040: p->address_space_24 = 0; if (p->fpu_model) p->fpu_model = 68040; break; - case 68060: + case 68060: p->address_space_24 = 0; if (p->fpu_model) p->fpu_model = 68060; @@ -159,8 +159,8 @@ void fixup_prefs (struct uae_prefs *p) { int err = 0; - build_in_chipset_prefs (p); - fixup_cpu(p); + built_in_chipset_prefs (p); + fixup_cpu (p); if ((p->chipmem_size & (p->chipmem_size - 1)) != 0 || p->chipmem_size < 0x40000 @@ -295,7 +295,7 @@ void fixup_prefs (struct uae_prefs *p) p->gfxmem_size = 0; err = 1; } -#if !defined(BSDSOCKET) +#if !defined (BSDSOCKET) if (p->socket_emu) { write_log ("Compile-time option of BSDSOCKET_SUPPORTED was not enabled. You can't use bsd-socket emulation.\n"); p->socket_emu = 0; @@ -345,7 +345,7 @@ void fixup_prefs (struct uae_prefs *p) p->cpu_compatible = 1; p->address_space_24 = 1; #endif -#if !defined(CPUEMU_11) && !defined (CPUEMU_12) +#if !defined (CPUEMU_11) && !defined (CPUEMU_12) p->cpu_compatible = 0; p->address_space_24 = 0; #endif @@ -370,7 +370,7 @@ void fixup_prefs (struct uae_prefs *p) #if !defined (UAESERIAL) p->uaeserial = 0; #endif -#if defined(CPUEMU_12) +#if defined (CPUEMU_12) if (p->cpu_cycle_exact) p->gfx_framerate = 1; #endif @@ -392,7 +392,7 @@ void uae_reset (int hardreset) void uae_quit (void) { - deactivate_debugger(); + deactivate_debugger (); if (quit_program != -1) quit_program = -1; } @@ -435,7 +435,7 @@ static void parse_diskswapper (char *s) int num = 0; p1 = tmp; - for(;;) { + for (;;) { p2 = strtok (p1, delim); if (!p2) break; @@ -467,7 +467,7 @@ static void parse_cmdline (int argc, char **argv) if (i + 1 == argc) { write_log ("Missing argument for '-f' option.\n"); } else { - currprefs.mountitems = 0; + currprefs.mountitems = 0; target_cfgfile_load (&currprefs, argv[++i], -1, 1); } } else if (strcmp (argv[i], "-s") == 0) { @@ -540,7 +540,7 @@ void reset_all_systems (void) filesys_reset (); #endif memory_reset (); -#if defined(BSDSOCKET) +#if defined (BSDSOCKET) bsdlib_reset (); #endif #ifdef FILESYS @@ -558,11 +558,11 @@ void reset_all_systems (void) /* Okay, this stuff looks strange, but it is here to encourage people who * port UAE to re-use as much of this code as possible. Functions that you - * should be using are do_start_program() and do_leave_program(), as well - * as real_main(). Some OSes don't call main() (which is braindamaged IMHO, - * but unfortunately very common), so you need to call real_main() from + * should be using are do_start_program () and do_leave_program (), as well + * as real_main (). Some OSes don't call main () (which is braindamaged IMHO, + * but unfortunately very common), so you need to call real_main () from * whatever entry point you have. You may want to write your own versions - * of start_program() and leave_program() if you need to do anything special. + * of start_program () and leave_program () if you need to do anything special. * Add #ifdefs around these as appropriate. */ @@ -614,7 +614,7 @@ void do_leave_program (void) #ifdef FILESYS filesys_cleanup (); #endif - device_func_reset(); + device_func_reset (); savestate_free (); memory_cleanup (); cfgfile_addcfgparam (0); @@ -633,7 +633,7 @@ void leave_program (void) static void real_main2 (int argc, char **argv) { -#if defined (JIT) && (defined( _WIN32 ) || defined(_WIN64)) && !defined( NO_WIN32_EXCEPTION_HANDLER ) +#if defined (JIT) && (defined ( _WIN32 ) || defined (_WIN64)) && !defined ( NO_WIN32_EXCEPTION_HANDLER ) extern int EvalException ( LPEXCEPTION_POINTERS blah, int n_except ); __try #endif @@ -653,7 +653,7 @@ static void real_main2 (int argc, char **argv) } #ifdef NATMEM_OFFSET - init_shm(); + init_shm (); #endif #ifdef FILESYS @@ -672,7 +672,7 @@ static void real_main2 (int argc, char **argv) write_log ("Sound driver unavailable: Sound output disabled\n"); currprefs.produce_sound = 0; } - inputdevice_init(); + inputdevice_init (); changed_prefs = currprefs; no_gui = ! currprefs.start_gui; @@ -696,7 +696,7 @@ static void real_main2 (int argc, char **argv) canbang = 0; #endif - logging_init(); /* Yes, we call this twice - the first case handles when the user has loaded + logging_init (); /* Yes, we call this twice - the first case handles when the user has loaded a config using the cmd-line. This case handles loads through the GUI. */ fixup_prefs (&currprefs); changed_prefs = currprefs; @@ -729,7 +729,7 @@ static void real_main2 (int argc, char **argv) #ifdef AUTOCONFIG gfxlib_install (); -#if defined(BSDSOCKET) +#if defined (BSDSOCKET) bsdlib_install (); #endif emulib_install (); @@ -744,7 +744,7 @@ static void real_main2 (int argc, char **argv) DISK_init (); reset_frame_rate_hack (); - init_m68k(); /* must come after reset_frame_rate_hack (); */ + init_m68k (); /* must come after reset_frame_rate_hack (); */ gui_update (); @@ -762,8 +762,8 @@ static void real_main2 (int argc, char **argv) } } -#if defined (JIT) && (defined( _WIN32 ) || defined(_WIN64)) && !defined(NO_WIN32_EXCEPTION_HANDLER) - __except(EvalException(GetExceptionInformation(), GetExceptionCode())) +#if defined (JIT) && (defined ( _WIN32 ) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) + __except (EvalException (GetExceptionInformation (), GetExceptionCode ())) { // EvalException does the good stuff... } diff --git a/memory.c b/memory.c index 8188dc4e..320419bf 100755 --- a/memory.c +++ b/memory.c @@ -59,6 +59,14 @@ uae_u32 max_z3fastmem = 512 * 1024 * 1024; static size_t bootrom_filepos, chip_filepos, bogo_filepos, rom_filepos, a3000lmem_filepos, a3000hmem_filepos; +/* Set if we notice during initialization that settings changed, + and we must clear all memory to prevent bogus contents from confusing + the Kickstart. */ +static int need_hardreset; + +/* The address space setting used during the last reset. */ +static int last_address_space_24; + static struct romlist *rl; static int romlist_cnt; @@ -263,7 +271,7 @@ struct romlist **getromlistbyident(int ver, int rev, int subver, int subrev, cha struct romlist **rdout, *rltmp; void *buf; static struct romlist rlstatic; - + for (i = 0; roms[i].name; i++); if (all) max = i; @@ -274,7 +282,7 @@ struct romlist **getromlistbyident(int ver, int rev, int subver, int subrev, cha rltmp = (struct romlist*)((uae_u8*)buf + (i + 1) * sizeof (struct romlist*)); out = 0; for (i = 0; i < max; i++) { - ok = 0; + ok = 0; if (!all) rd = rl[i].rd; else @@ -407,7 +415,7 @@ int decode_cloanto_rom_do (uae_u8 *mem, int size, int real_size) uae_u8 *key; for (i = ROM_KEY_NUM - 1; i >= 0; i--) { - keysize = keyring[i].size; + keysize = keyring[i].size; key = keyring[i].key; if (!key) continue; @@ -473,7 +481,7 @@ int load_keyring (struct uae_prefs *p, char *path) keybuf = target_load_keyfile(p, path, &keysize, tmp); addkey(&keyid, keybuf, keysize, tmp); for (i = 0; keyids[i] >= 0 && keyid < ROM_KEY_NUM; i++) { - struct romdata *rd = getromdatabyid (keyids[i]); + struct romdata *rd = getromdatabyid (keyids[i]); char *s; if (rd) { s = romlist_get (rd); @@ -493,10 +501,10 @@ int load_keyring (struct uae_prefs *p, char *path) } } } - + cnt = 0; for (;;) { - keybuf = NULL; + keybuf = NULL; keysize = 0; tmp[0] = 0; switch (cnt) @@ -719,7 +727,7 @@ void getromname (struct romdata *rd, char *name) struct romlist *getromlistbyromdata(struct romdata *rd) { int ids[2]; - + ids[0] = rd->id; ids[1] = 0; return getromlistbyids(ids); @@ -757,11 +765,11 @@ void romwarning(int *ids) struct romdata *rd = getromdatabyid (ids[i]); getromname (rd, tmp1); strcat (tmp2, "- "); - strcat (tmp2, tmp1); - strcat (tmp2, "\n"); + strcat (tmp2, tmp1); + strcat (tmp2, "\n"); if (rd->type & (ROMTYPE_A2091BOOT | ROMTYPE_A4091BOOT)) exp++; - i++; + i++; } translate_message (exp ? NUMSG_EXPROMNEED : NUMSG_ROMNEED, tmp3); gui_message (tmp3, tmp2); @@ -808,7 +816,7 @@ int addr_valid(char *txt, uaecptr addr, uae_u32 len) { addrbank *ab = &get_mem_bank(addr); if (ab == 0 || !(ab->flags & ABFLAG_RAM) || addr < 0x100 || len < 0 || len > 16777215 || !valid_address(addr, len)) { - write_log("corrupt %s pointer %x (%d) detected!\n", txt, addr, len); + write_log ("corrupt %s pointer %x (%d) detected!\n", txt, addr, len); return 0; } return 1; @@ -1699,7 +1707,7 @@ uae_u8 *REGPARAM2 default_xlate (uaecptr a) if (be_cnt < 3) { int i, j; uaecptr a2 = a - 32; - uaecptr a3 = m68k_getpc(®s) - 32; + uaecptr a3 = m68k_getpc (®s) - 32; write_log ("Your Amiga program just did something terribly stupid %08.8X PC=%08.8X\n", a, M68K_GETPC); m68k_dumpstate (0, 0); for (i = 0; i < 10; i++) { @@ -1826,7 +1834,7 @@ void a3000_fakekick(int map) map_banks(&extendedkickmem_bank, 0xf0, 1, 1); f0 = 1; } else { - write_log("A3000 Bonus hack: can't map bonus when uae boot rom is enabled\n"); + write_log ("A3000 Bonus hack: can't map bonus when uae boot rom is enabled\n"); } } } else { @@ -2056,7 +2064,7 @@ static void patch_kick(void) { int patched = 0; if (kickmem_size >= 524288 && currprefs.kickshifter) - patched += patch_shapeshifter (kickmemory); + patched += patch_shapeshifter (kickmemory); patched += patch_residents (kickmemory, kickmem_size); if (extendedkickmemory) { patched += patch_residents (extendedkickmemory, extendedkickmem_size); @@ -2064,7 +2072,7 @@ static void patch_kick(void) kickstart_fix_checksum (extendedkickmemory, extendedkickmem_size); } if (patched) - kickstart_fix_checksum (kickmemory, kickmem_size); + kickstart_fix_checksum (kickmemory, kickmem_size); } static int load_kickstart (void) @@ -2136,7 +2144,7 @@ static int load_kickstart (void) size = read_kickstart (f, kickmemory, maxsize, 1, &cloanto_rom); if (size == 0) goto err; - kickmem_mask = size - 1; + kickmem_mask = size - 1; kickmem_size = size; if (filesize >= 524288 * 2 && !extendedkickmem_type) { extendedkickmem_size = 0x80000; @@ -2342,7 +2350,7 @@ static void allocate_memory (void) write_log ("Fatal error: out of memory for chipmem.\n"); allocated_chipmem = 0; } else { - memory_hardreset(); + need_hardreset = 1; if (memsize != allocated_chipmem) memset (chipmemory + allocated_chipmem, 0xff, memsize - allocated_chipmem); } @@ -2351,7 +2359,7 @@ static void allocate_memory (void) currprefs.chipset_mask = changed_prefs.chipset_mask; chipmem_full_mask = allocated_chipmem - 1; if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && allocated_chipmem < 0x100000) - chipmem_full_mask = 0x100000 - 1; + chipmem_full_mask = 0x100000 - 1; if (allocated_bogomem != currprefs.bogomem_size) { if (bogomemory) @@ -2368,7 +2376,7 @@ static void allocate_memory (void) allocated_bogomem = 0; } } - memory_hardreset(); + need_hardreset = 1; } if (allocated_a3000lmem != currprefs.mbresmem_low_size) { if (a3000lmemory) @@ -2385,7 +2393,7 @@ static void allocate_memory (void) allocated_a3000lmem = 0; } } - memory_hardreset(); + need_hardreset = 1; } if (allocated_a3000hmem != currprefs.mbresmem_high_size) { if (a3000hmemory) @@ -2402,7 +2410,7 @@ static void allocate_memory (void) allocated_a3000hmem = 0; } } - memory_hardreset(); + need_hardreset = 1; } if (allocated_cardmem != currprefs.cs_cdtvcard * 1024) { if (cardmemory) @@ -2455,12 +2463,12 @@ void map_overlay (int chip) else map_banks (&kickmem_bank, 0, i, 0x80000); if (savestate_state != STATE_RESTORE && savestate_state != STATE_REWIND) - m68k_setpc(®s, m68k_getpc(®s)); + m68k_setpc (®s, m68k_getpc (®s)); } void memory_reset (void) { - int bnk; + int bnk, bnk_end; be_cnt = 0; currprefs.chipmem_size = changed_prefs.chipmem_size; @@ -2471,6 +2479,16 @@ void memory_reset (void) currprefs.cs_cdtvram = changed_prefs.cs_cdtvram; currprefs.cs_cdtvcard = changed_prefs.cs_cdtvcard; currprefs.cs_a1000ram = changed_prefs.cs_a1000ram; + currprefs.cs_ide = changed_prefs.cs_ide; + currprefs.cs_fatgaryrev = changed_prefs.cs_fatgaryrev; + currprefs.cs_ramseyrev = changed_prefs.cs_ramseyrev; + + need_hardreset = 0; + /* Use changed_prefs, as m68k_reset is called later. */ + if (last_address_space_24 != changed_prefs.address_space_24) + need_hardreset = 1; + + last_address_space_24 = changed_prefs.address_space_24; init_mem_banks (); allocate_memory (); @@ -2483,10 +2501,10 @@ void memory_reset (void) xfree (a1000_bootrom); a1000_bootrom = 0; a1000_kickstart_mode = 0; + memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile); memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile); - if (savestate_state != STATE_RESTORE) - memory_hardreset(); + need_hardreset = 1; mapped_free (extendedkickmemory); extendedkickmemory = 0; extendedkickmem_size = 0; @@ -2519,8 +2537,9 @@ void memory_reset (void) } if (rd->cloanto) cloanto_rom = 1; - if ((rd->cpu & 4) && currprefs.cs_compatible) { /* A4000 ROM = need ramsey, gary and ide */ - if (currprefs.cs_ramseyrev < 0) + if ((rd->cpu & 4) && currprefs.cs_compatible) { + /* A4000 ROM = need ramsey, gary and ide */ + if (currprefs.cs_ramseyrev < 0) changed_prefs.cs_ramseyrev = currprefs.cs_ramseyrev = 0x0f; changed_prefs.cs_fatgaryrev = currprefs.cs_fatgaryrev = 0; if (currprefs.cs_ide != 2) @@ -2537,13 +2556,15 @@ void memory_reset (void) map_banks (&custom_bank, 0xC0, 0xE0 - 0xC0, 0); map_banks (&cia_bank, 0xA0, 32, 0); if (!currprefs.cs_a1000ram) - map_banks (&dummy_bank, 0xD8, 6, 0); /* D80000 - DDFFFF not mapped (A1000 = custom chips) */ + /* D80000 - DDFFFF not mapped (A1000 = custom chips) */ + map_banks (&dummy_bank, 0xD8, 6, 0); /* map "nothing" to 0x200000 - 0x9FFFFF (0xBEFFFF if PCMCIA or AGA) */ bnk = allocated_chipmem >> 16; if (bnk < 0x20 + (currprefs.fastmem_size >> 16)) bnk = 0x20 + (currprefs.fastmem_size >> 16); - map_banks (&dummy_bank, bnk, (((currprefs.chipset_mask & CSMASK_AGA) || currprefs.cs_pcmcia) ? 0xBF : 0xA0) - bnk, 0); + bnk_end = (((currprefs.chipset_mask & CSMASK_AGA) || currprefs.cs_pcmcia) ? 0xBF : 0xA0); + map_banks (&dummy_bank, bnk, bnk_end - bnk, 0); if (currprefs.chipset_mask & CSMASK_AGA) map_banks (&dummy_bank, 0xc0, 0xd8 - 0xc0, 0); @@ -2556,7 +2577,7 @@ void memory_reset (void) map_banks (&bogomem_bank, 0xC0, t, 0); } if (currprefs.cs_ide) { - if(currprefs.cs_ide == 1) { + if (currprefs.cs_ide == 1) { map_banks (&gayle_bank, 0xD8, 6, 0); map_banks (&gayle2_bank, 0xDD, 2, 0); // map_banks (&gayle_attr_bank, 0xA0, 8, 0); only if PCMCIA card inserted */ @@ -2571,17 +2592,17 @@ void memory_reset (void) } if (currprefs.cs_rtc) map_banks (&clock_bank, 0xDC, 1, 0); - if (currprefs.cs_fatgaryrev >= 0|| currprefs.cs_ramseyrev >= 0) + if (currprefs.cs_fatgaryrev >= 0 || currprefs.cs_ramseyrev >= 0) map_banks (&mbres_bank, 0xDE, 1, 0); if (currprefs.cs_cd32c2p || currprefs.cs_cd32cd || currprefs.cs_cd32nvram) map_banks (&akiko_bank, AKIKO_BASE >> 16, 1, 0); if (currprefs.cs_mbdmac == 1) - a3000scsi_reset(); + a3000scsi_reset (); if (a3000lmemory != 0) - map_banks (&a3000lmem_bank, a3000lmem_start >> 16, allocated_a3000lmem >> 16, 0); + map_banks (&a3000lmem_bank, a3000lmem_start >> 16, allocated_a3000lmem >> 16, 0); if (a3000hmemory != 0) - map_banks (&a3000hmem_bank, a3000hmem_start >> 16, allocated_a3000hmem >> 16, 0); + map_banks (&a3000hmem_bank, a3000hmem_start >> 16, allocated_a3000hmem >> 16, 0); if (cardmemory != 0) map_banks (&cardmem_bank, cardmem_start >> 16, allocated_cardmem >> 16, 0); @@ -2611,9 +2632,7 @@ void memory_reset (void) /* Map the chipmem into all of the lower 8MB */ map_overlay (1); - switch (extendedkickmem_type) - { - + switch (extendedkickmem_type) { case EXTENDED_ROM_KS: map_banks (&extendedkickmem_bank, 0xE0, 8, 0); break; @@ -2628,9 +2647,9 @@ void memory_reset (void) break; #endif } - + if ((cloanto_rom || currprefs.cs_ksmirror) && !currprefs.maprom && !extendedkickmem_type) - map_banks (&kickmem_bank, 0xE0, 8, 0); + map_banks (&kickmem_bank, 0xE0, 8, 0); if (currprefs.cs_ksmirror == 2) { /* unexpanded A1200 also maps ROM here.. */ struct romdata *rd = getromdatabypath(currprefs.cartfile); if (!rd || rd->id != 63) { @@ -2644,7 +2663,7 @@ void memory_reset (void) memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile); if (strcmp (currprefs.cartfile, changed_prefs.cartfile) != 0) memcpy (currprefs.cartfile, changed_prefs.cartfile, sizeof currprefs.cartfile); - arcadia_unmap (); + arcadia_unmap (); is_arcadia_rom (currprefs.romextfile); is_arcadia_rom (currprefs.cartfile); arcadia_map_banks (); @@ -2784,7 +2803,7 @@ void map_banks (addrbank *bank, int start, int size, int realsize) return; } #endif - if (currprefs.address_space_24) + if (last_address_space_24) endhioffs = 0x10000; #ifdef ADDRESS_SPACE_24BIT endhioffs = 0x100; @@ -3004,12 +3023,12 @@ void memcpyah_safe (uae_u8 *dst, uaecptr src, int size) if (!addr_valid("memcpyah", src, size)) return; while (size--) - *dst++ = get_byte(src++); + *dst++ = get_byte (src++); } void memcpyah (uae_u8 *dst, uaecptr src, int size) { while (size--) - *dst++ = get_byte(src++); + *dst++ = get_byte (src++); } char *strcpyah_safe (char *dst, uaecptr src) { @@ -3018,7 +3037,7 @@ char *strcpyah_safe (char *dst, uaecptr src) do { if (!addr_valid("strcpyah", src, 1)) return res; - b = get_byte(src++); + b = get_byte (src++); *dst++ = b; } while (b); return res; diff --git a/moduleripper.c b/moduleripper.c index 0239932d..1afcb7a9 100755 --- a/moduleripper.c +++ b/moduleripper.c @@ -68,7 +68,7 @@ void moduleripper (void) prowizard_search (buf, size); #ifdef _WIN32 } __except(ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) { - write_log("prowizard scan crashed\n"); + write_log ("prowizard scan crashed\n"); } #endif if (!got) @@ -83,7 +83,7 @@ FILE *moduleripper_fopen (const char *name, const char *mode) return fopen (name, mode); } -FILE *moduleripper2_fopen (const char *name, const char *mode, const char *id) +FILE *moduleripper2_fopen (const char *name, const char *mode, const char *id, int addr, int size) { char msg[MAX_DPATH], msg2[MAX_DPATH]; int ret; @@ -92,7 +92,7 @@ FILE *moduleripper2_fopen (const char *name, const char *mode, const char *id) return NULL; got++; translate_message (NUMSG_MODRIP_SAVE, msg); - sprintf (msg2, msg, id); + sprintf (msg2, msg, id, addr, size); ret = gui_message_multibutton (2, msg2); if (ret < 0) canceled = 1; diff --git a/native2amiga.c b/native2amiga.c index de6f2c70..119191d7 100755 --- a/native2amiga.c +++ b/native2amiga.c @@ -48,7 +48,7 @@ void uae_Cause (uaecptr interrupt) uae_sem_wait (&n2asem); write_comm_pipe_int (&native2amiga_pending, 3, 0); write_comm_pipe_u32 (&native2amiga_pending, interrupt, 1); - do_uae_int_requested(); + do_uae_int_requested (); uae_sem_post (&n2asem); } @@ -57,7 +57,7 @@ void uae_ReplyMsg (uaecptr msg) uae_sem_wait (&n2asem); write_comm_pipe_int (&native2amiga_pending, 2, 0); write_comm_pipe_u32 (&native2amiga_pending, msg, 1); - do_uae_int_requested(); + do_uae_int_requested (); uae_sem_post (&n2asem); } @@ -67,7 +67,7 @@ void uae_PutMsg (uaecptr port, uaecptr msg) write_comm_pipe_int (&native2amiga_pending, 1, 0); write_comm_pipe_u32 (&native2amiga_pending, port, 0); write_comm_pipe_u32 (&native2amiga_pending, msg, 1); - do_uae_int_requested(); + do_uae_int_requested (); uae_sem_post (&n2asem); } @@ -77,7 +77,7 @@ void uae_Signal (uaecptr task, uae_u32 mask) write_comm_pipe_int (&native2amiga_pending, 0, 0); write_comm_pipe_u32 (&native2amiga_pending, task, 0); write_comm_pipe_int (&native2amiga_pending, mask, 1); - do_uae_int_requested(); + do_uae_int_requested (); uae_sem_post (&n2asem); } @@ -87,7 +87,7 @@ void uae_NotificationHack (uaecptr port, uaecptr nr) write_comm_pipe_int (&native2amiga_pending, 4, 0); write_comm_pipe_int (&native2amiga_pending, port, 0); write_comm_pipe_int (&native2amiga_pending, nr, 1); - do_uae_int_requested(); + do_uae_int_requested (); uae_sem_post (&n2asem); } diff --git a/ncr_scsi.c b/ncr_scsi.c index 3b24c9e7..766039c4 100755 --- a/ncr_scsi.c +++ b/ncr_scsi.c @@ -128,7 +128,7 @@ static char *regname(uaecptr addr) #define AUTO_ATN 0x02 #define SCNTL1_REG 0x02 #define SLOW_BUS 0x80 -#define ENABLE_SELECT 0x20 +#define ENABLE_SELECT 0x20 #define ASSERT_RST 0x08 #define ASSERT_EVEN_PARITY 0x04 #define SDID_REG 0x01 @@ -137,20 +137,20 @@ static char *regname(uaecptr addr) #define FUNC_COMP_INT 0x40 #define SEL_TIMEOUT_INT 0x20 #define SELECT_INT 0x10 -#define GROSS_ERR_INT 0x08 -#define UX_DISC_INT 0x04 -#define RST_INT 0x02 +#define GROSS_ERR_INT 0x08 +#define UX_DISC_INT 0x04 +#define RST_INT 0x02 #define PAR_ERR_INT 0x01 #define SCID_REG 0x07 #define SXFER_REG 0x06 -#define ASYNC_OPERATION 0x00 -#define SODL_REG 0x05 +#define ASYNC_OPERATION 0x00 +#define SODL_REG 0x05 #define SOCL_REG 0x04 #define SFBR_REG 0x0b #define SIDL_REG 0x0a #define SBDL_REG 0x0a #define SBCL_REG 0x08 -#define SBCL_IO 0x01 +#define SBCL_IO 0x01 #define SYNC_DIV_AS_ASYNC 0x00 #define SYNC_DIV_1_0 0x01 #define SYNC_DIV_1_5 0x02 @@ -168,19 +168,19 @@ static char *regname(uaecptr addr) #define SELECTED 0x10 #define SELECTION_TIMEOUT 0x20 #define FUNCTION_COMPLETE 0x40 -#define PHASE_MISMATCH 0x80 -#define SSTAT1_REG 0x0d +#define PHASE_MISMATCH 0x80 +#define SSTAT1_REG 0x0d #define SIDL_REG_FULL 0x80 #define SODR_REG_FULL 0x40 #define SODL_REG_FULL 0x20 -#define SSTAT2_REG 0x0c +#define SSTAT2_REG 0x0c #define CTEST0_REG 0x17 #define BTB_TIMER_DISABLE 0x40 #define CTEST1_REG 0x16 #define CTEST2_REG 0x15 #define CTEST3_REG 0x14 #define CTEST4_REG 0x1b -#define DISABLE_FIFO 0x00 +#define DISABLE_FIFO 0x00 #define SLBE 0x10 #define SFWR 0x08 #define BYTE_LANE0 0x04 @@ -189,21 +189,21 @@ static char *regname(uaecptr addr) #define BYTE_LANE3 0x07 #define SCSI_ZMODE 0x20 #define ZMODE 0x40 -#define CTEST5_REG 0x1a -#define MASTER_CONTROL 0x10 -#define DMA_DIRECTION 0x08 +#define CTEST5_REG 0x1a +#define MASTER_CONTROL 0x10 +#define DMA_DIRECTION 0x08 #define CTEST7_REG 0x18 #define BURST_DISABLE 0x80 /* 710 only */ #define SEL_TIMEOUT_DISABLE 0x10 /* 710 only */ -#define DFP 0x08 -#define EVP 0x04 +#define DFP 0x08 +#define EVP 0x04 #define DIFF 0x01 #define CTEST6_REG 0x19 #define TEMP_REG 0x1C #define DFIFO_REG 0x20 #define FLUSH_DMA_FIFO 0x80 #define CLR_FIFO 0x40 -#define ISTAT_REG 0x22 +#define ISTAT_REG 0x22 #define ABORT_OPERATION 0x80 #define SOFTWARE_RESET_710 0x40 #define DMA_INT_PENDING 0x01 @@ -222,12 +222,12 @@ static char *regname(uaecptr addr) #define DNAD_REG 0x28 #define DIEN_REG 0x3a #define BUS_FAULT 0x20 -#define ABORT_INT 0x10 -#define INT_INST_INT 0x04 +#define ABORT_INT 0x10 +#define INT_INST_INT 0x04 #define WD_INT 0x02 #define ILGL_INST_INT 0x01 #define DCNTL_REG 0x38 -#define SOFTWARE_RESET 0x01 +#define SOFTWARE_RESET 0x01 #define COMPAT_700_MODE 0x01 #define SCRPTS_16BITS 0x20 #define ASYNC_DIV_2_0 0x00 @@ -242,24 +242,24 @@ static char *regname(uaecptr addr) #define BURST_LENGTH_8 0xC0 #define DMODE_FC1 0x10 #define DMODE_FC2 0x20 -#define BW16 32 -#define MODE_286 16 -#define IO_XFER 8 -#define FIXED_ADDR 4 +#define BW16 32 +#define MODE_286 16 +#define IO_XFER 8 +#define FIXED_ADDR 4 static void INT2(void) { if (ncrregs[SIEN_REG] == 0) return; INTREQ_f(0x8000 | 0x0008); - write_log("IRQ\n"); + write_log ("IRQ\n"); } static uae_u8 read_rom(uaecptr addr) { uae_u8 v = rom[addr]; - //write_log("%08.8X = %02.2X PC=%08X\n", addr, v, M68K_GETPC); + //write_log ("%08.8X = %02.2X PC=%08X\n", addr, v, M68K_GETPC); return v; } @@ -271,14 +271,14 @@ void ncr_bput2(uaecptr addr, uae_u32 val) return; switch (addr) { - case ISTAT_REG: + case ISTAT_REG: if (val & 0x80) val |= 1; val &= ~0x80; INT2(); break; } - write_log("%s write %04.4X (%s) = %02.2X PC=%08.8X\n", NCRNAME, addr, regname(addr), v & 0xff, M68K_GETPC); + write_log ("%s write %04.4X (%s) = %02.2X PC=%08.8X\n", NCRNAME, addr, regname(addr), v & 0xff, M68K_GETPC); ncrregs[addr] = val; } @@ -305,7 +305,7 @@ uae_u32 ncr_bget2(uaecptr addr) v &= 0x0f; // revision 0 break; } - write_log("%s read %04.4X (%s) = %02.2X PC=%08.8X\n", NCRNAME, addr, regname(addr), v, M68K_GETPC); + write_log ("%s read %04.4X (%s) = %02.2X PC=%08.8X\n", NCRNAME, addr, regname(addr), v, M68K_GETPC); if (v2 != v) ncrregs[addr] = v2; return v; @@ -444,7 +444,7 @@ void ncr_free (void) void ncr_reset (void) { board_mask = 131072 - 1; - configured = 0; + configured = 0; if (currprefs.cs_mbdmac == 2) { board_mask = 65535 - 1; configured = -1; @@ -483,20 +483,20 @@ void ncr_init (void) rl = getromlistbyids(roms); if (rl) { - write_log("A4091 BOOT ROM '%s' %d.%d ", rl->path, rl->rd->ver, rl->rd->rev); + write_log ("A4091 BOOT ROM '%s' %d.%d ", rl->path, rl->rd->ver, rl->rd->rev); z = zfile_fopen(rl->path, "rb"); if (z) { - write_log("loaded\n"); + write_log ("loaded\n"); rom = (uae_u8*)xmalloc (ROM_SIZE * 4); for (i = 0; i < ROM_SIZE; i++) { uae_u8 b; - zfile_fread(&b, 1, 1, z); + zfile_fread(&b, 1, 1, z); rom[i * 4 + 0] = b; rom[i * 4 + 2] = b << 4; } zfile_fclose(z); } else { - write_log("failed to load\n"); + write_log ("failed to load\n"); } } else { romwarning(roms); diff --git a/newcpu.c b/newcpu.c index 57595ece..65649619 100755 --- a/newcpu.c +++ b/newcpu.c @@ -1,4 +1,4 @@ -/* + /* * UAE - The Un*x Amiga Emulator * * MC68000 emulation @@ -40,7 +40,7 @@ signed long pissoff = 0; int gonebad = 0; #else /* Need to have these somewhere */ -static void build_comp(void) {} +static void build_comp (void) {} void check_prefs_changed_comp (void) {} #endif @@ -59,8 +59,8 @@ int irqdelay[15]; int mmu_enabled, mmu_triggered; int cpu_cycles; -const int areg_byteinc[] = { 1,1,1,1,1,1,1,2 }; -const int imm8_table[] = { 8,1,2,3,4,5,6,7 }; +const int areg_byteinc[] = { 1, 1, 1, 1, 1, 1, 1, 2 }; +const int imm8_table[] = { 8, 1, 2, 3, 4, 5, 6, 7 }; int movem_index1[256]; int movem_index2[256]; @@ -76,7 +76,7 @@ int fpp_movem_next[256]; cpuop_func *cpufunctbl[65536]; -extern uae_u32 get_fpsr(void); +extern uae_u32 get_fpsr (void); #define COUNT_INSTRS 0 #define MC68060_PCR 0x04300000 @@ -114,7 +114,7 @@ void dump_counts (void) opcodenums[i] = i; total += instrcount[i]; } - qsort (opcodenums, 65536, sizeof(uae_u16), compfn); + qsort (opcodenums, 65536, sizeof (uae_u16), compfn); fprintf (f, "Total: %lu\n", total); for (i=0; i < 65536; i++) { @@ -136,17 +136,17 @@ void dump_counts (void) } #endif -static void set_cpu_caches(void) +static void set_cpu_caches (void) { #ifdef JIT if (currprefs.cpu_model < 68040) { - set_cache_state(regs.cacr & 1); + set_cache_state (regs.cacr & 1); if (regs.cacr & 0x08) { regs.cacr &= ~0x08; - flush_icache(1); + flush_icache (1); } } else { - set_cache_state((regs.cacr & 0x8000) ? 1 : 0); + set_cache_state ((regs.cacr & 0x8000) ? 1 : 0); } #endif } @@ -154,7 +154,7 @@ static void set_cpu_caches(void) STATIC_INLINE void count_instr (unsigned int opcode) { } - + static unsigned long REGPARAM3 op_illg_1 (uae_u32 opcode, struct regstruct *regs) REGPARAM; static unsigned long REGPARAM2 op_illg_1 (uae_u32 opcode, struct regstruct *regs) @@ -193,7 +193,7 @@ static void build_cpufunctbl (void) case 68010: lvl = 1; tbl = op_smalltbl_4_ff; - break; + break; #endif #endif case 68000: @@ -230,7 +230,7 @@ static void build_cpufunctbl (void) if (table68k[opcode].handler != -1) { f = cpufunctbl[table68k[opcode].handler]; if (f == op_illg_1) - abort(); + abort (); cpufunctbl[opcode] = f; opcnt++; } @@ -356,7 +356,7 @@ void init_m68k (void) while (fscanf (f, "%lx: %lu %s\n", &opcode, &count, name) == 3) { instrcount[opcode] = count; } - fclose(f); + fclose (f); } } #endif @@ -367,7 +367,7 @@ void init_m68k (void) currprefs.address_space_24 = 0; } if (currprefs.fpu_model > 0) - write_log("/%d", currprefs.fpu_model); + write_log ("/%d", currprefs.fpu_model); if (currprefs.cpu_cycle_exact) { if (currprefs.cpu_model == 68000) write_log (" prefetch and cycle-exact"); @@ -400,9 +400,9 @@ static struct regstruct regs_backup[16]; static int backup_pointer = 0; static long int m68kpc_offset; -#define get_ibyte_1(o) get_byte(regs.pc + (regs.pc_p - regs.pc_oldp) + (o) + 1) -#define get_iword_1(o) get_word(regs.pc + (regs.pc_p - regs.pc_oldp) + (o)) -#define get_ilong_1(o) get_long(regs.pc + (regs.pc_p - regs.pc_oldp) + (o)) +#define get_ibyte_1(o) get_byte (regs.pc + (regs.pc_p - regs.pc_oldp) + (o) + 1) +#define get_iword_1(o) get_word (regs.pc + (regs.pc_p - regs.pc_oldp) + (o)) +#define get_ilong_1(o) get_long (regs.pc + (regs.pc_p - regs.pc_oldp) + (o)) static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes size, char *buf, uae_u32 *eaddr, int safemode) { @@ -417,21 +417,21 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes switch (mode){ case Dreg: - sprintf (buffer,"D%d", reg); + sprintf (buffer, "D%d", reg); break; case Areg: - sprintf (buffer,"A%d", reg); + sprintf (buffer, "A%d", reg); break; case Aind: - sprintf (buffer,"(A%d)", reg); + sprintf (buffer, "(A%d)", reg); addr = regs.regs[reg + 8]; break; case Aipi: - sprintf (buffer,"(A%d)+", reg); + sprintf (buffer, "(A%d)+", reg); addr = regs.regs[reg + 8]; break; case Apdi: - sprintf (buffer,"-(A%d)", reg); + sprintf (buffer, "-(A%d)", reg); addr = regs.regs[reg + 8]; break; case Ad16: @@ -442,23 +442,23 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes sprintf (offtxt, "-$%04x", -disp16); else sprintf (offtxt, "$%04x", disp16); - addr = m68k_areg(®s,reg) + disp16; - sprintf (buffer,"(A%d,%s) == $%08lx", reg, offtxt, (unsigned long)addr); + addr = m68k_areg (®s, reg) + disp16; + sprintf (buffer, "(A%d, %s) == $%08lx", reg, offtxt, (unsigned long)addr); } break; case Ad8r: dp = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; disp8 = dp & 0xFF; r = (dp & 0x7000) >> 12; - dispreg = dp & 0x8000 ? m68k_areg(®s,r) : m68k_dreg(®s,r); + dispreg = dp & 0x8000 ? m68k_areg (®s, r) : m68k_dreg (®s, r); if (!(dp & 0x800)) dispreg = (uae_s32)(uae_s16)(dispreg); dispreg <<= (dp >> 9) & 3; if (dp & 0x100) { uae_s32 outer = 0, disp = 0; - uae_s32 base = m68k_areg(®s,reg); + uae_s32 base = m68k_areg (®s, reg); char name[10]; - sprintf (name,"A%d, ",reg); + sprintf (name, "A%d, ", reg); if (dp & 0x80) { base = 0; name[0] = 0; } if (dp & 0x40) dispreg = 0; if ((dp & 0x30) == 0x20) { disp = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; } @@ -473,14 +473,14 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes if (dp & 4) base += dispreg; addr = base + outer; - sprintf (buffer,"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, + sprintf (buffer, "(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), - disp,outer, + disp, outer, (unsigned long)addr); } else { - addr = m68k_areg(®s,reg) + (uae_s32)((uae_s8)disp8) + dispreg; - sprintf (buffer,"(A%d, %c%d.%c*%d, $%02x) == $%08lx", reg, + addr = m68k_areg (®s, 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, (unsigned long)addr); @@ -490,22 +490,22 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes addr = m68k_getpc (®s) + m68kpc_offset; disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; addr += (uae_s16)disp16; - sprintf (buffer,"(PC,$%04x) == $%08lx", disp16 & 0xffff,(unsigned long)addr); + sprintf (buffer, "(PC,$%04x) == $%08lx", disp16 & 0xffff, (unsigned long)addr); break; case PC8r: addr = m68k_getpc (®s) + m68kpc_offset; dp = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; disp8 = dp & 0xFF; r = (dp & 0x7000) >> 12; - dispreg = dp & 0x8000 ? m68k_areg(®s,r) : m68k_dreg(®s,r); + dispreg = dp & 0x8000 ? m68k_areg (®s, r) : m68k_dreg (®s, r); if (!(dp & 0x800)) dispreg = (uae_s32)(uae_s16)(dispreg); dispreg <<= (dp >> 9) & 3; if (dp & 0x100) { - uae_s32 outer = 0,disp = 0; + uae_s32 outer = 0, disp = 0; uae_s32 base = addr; char name[10]; - sprintf (name,"PC, "); + sprintf (name, "PC, "); if (dp & 0x80) { base = 0; name[0] = 0; } if (dp & 0x40) dispreg = 0; if ((dp & 0x30) == 0x20) { disp = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; } @@ -520,40 +520,40 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes if (dp & 4) base += dispreg; addr = base + outer; - sprintf (buffer,"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, + sprintf (buffer, "(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), - disp,outer, + disp, outer, (unsigned long)addr); } else { addr += (uae_s32)((uae_s8)disp8) + dispreg; - sprintf (buffer,"(PC, %c%d.%c*%d, $%02x) == $%08lx", dp & 0x8000 ? 'A' : 'D', + sprintf (buffer, "(PC, %c%d.%c*%d, $%02x) == $%08lx", dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp8, (unsigned long)addr); } break; case absw: addr = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); - sprintf (buffer,"$%08lx", (unsigned long)addr); + sprintf (buffer, "$%08lx", (unsigned long)addr); m68kpc_offset += 2; break; case absl: addr = get_ilong_1 (m68kpc_offset); - sprintf (buffer,"$%08lx", (unsigned long)addr); + sprintf (buffer, "$%08lx", (unsigned long)addr); m68kpc_offset += 4; break; case imm: switch (size){ case sz_byte: - sprintf (buffer,"#$%02x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xff)); + sprintf (buffer, "#$%02x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xff)); m68kpc_offset += 2; break; case sz_word: - sprintf (buffer,"#$%04x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xffff)); + sprintf (buffer, "#$%04x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xffff)); m68kpc_offset += 2; break; case sz_long: - sprintf (buffer,"#$%08lx", (unsigned long)(get_ilong_1 (m68kpc_offset))); + sprintf (buffer, "#$%08lx", (unsigned long)(get_ilong_1 (m68kpc_offset))); m68kpc_offset += 4; break; default: @@ -563,22 +563,22 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes case imm0: offset = (uae_s32)(uae_s8)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; - sprintf (buffer,"#$%02x", (unsigned int)(offset & 0xff)); + sprintf (buffer, "#$%02x", (unsigned int)(offset & 0xff)); break; case imm1: offset = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; buffer[0] = 0; - sprintf (buffer,"#$%04x", (unsigned int)(offset & 0xffff)); + sprintf (buffer, "#$%04x", (unsigned int)(offset & 0xffff)); break; case imm2: offset = (uae_s32)get_ilong_1 (m68kpc_offset); m68kpc_offset += 4; - sprintf (buffer,"#$%08lx", (unsigned long)offset); + sprintf (buffer, "#$%08lx", (unsigned long)offset); break; case immi: offset = (uae_s32)(uae_s8)(reg & 0xff); - sprintf (buffer,"#$%08lx", (unsigned long)offset); + sprintf (buffer, "#$%08lx", (unsigned long)offset); break; default: break; @@ -623,7 +623,7 @@ static int verify_ea (int reg, amodes mode, wordsizes size, uae_u32 *val) break; case Ad16: disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; - addr = m68k_areg(®s,reg) + (uae_s16)disp16; + addr = m68k_areg (®s, reg) + (uae_s16)disp16; break; case Ad8r: addr = m68k_areg (®s, reg); @@ -631,7 +631,7 @@ static int verify_ea (int reg, amodes mode, wordsizes size, uae_u32 *val) dp = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; disp8 = dp & 0xFF; r = (dp & 0x7000) >> 12; - dispreg = dp & 0x8000 ? m68k_areg(®s,r) : m68k_dreg(®s,r); + dispreg = dp & 0x8000 ? m68k_areg (®s, r) : m68k_dreg (®s, r); if (!(dp & 0x800)) dispreg = (uae_s32)(uae_s16)(dispreg); dispreg <<= (dp >> 9) & 3; @@ -720,7 +720,7 @@ static int verify_ea (int reg, amodes mode, wordsizes size, uae_u32 *val) } #endif -int get_cpu_model(void) +int get_cpu_model (void) { return currprefs.cpu_model; } @@ -737,11 +737,11 @@ uae_u32 REGPARAM2 get_disp_ea_020 (struct regstruct *regs, uae_u32 base, uae_u32 if (dp & 0x80) base = 0; if (dp & 0x40) regd = 0; - if ((dp & 0x30) == 0x20) base += (uae_s32)(uae_s16)next_iword(regs); - if ((dp & 0x30) == 0x30) base += next_ilong(regs); + if ((dp & 0x30) == 0x20) base += (uae_s32)(uae_s16) next_iword (regs); + if ((dp & 0x30) == 0x30) base += next_ilong (regs); - if ((dp & 0x3) == 0x2) outer = (uae_s32)(uae_s16)next_iword(regs); - if ((dp & 0x3) == 0x3) outer = next_ilong(regs); + if ((dp & 0x3) == 0x2) outer = (uae_s32)(uae_s16) next_iword (regs); + if ((dp & 0x3) == 0x3) outer = next_ilong (regs); if ((dp & 0x4) == 0) base += regd; if (dp & 0x3) base = get_long (base); @@ -780,21 +780,21 @@ uae_u32 REGPARAM3 get_disp_ea_000 (struct regstruct *regs, uae_u32 base, uae_u32 void REGPARAM2 MakeSR (struct regstruct *regs) { #if 0 - assert((regs.t1 & 1) == regs->t1); - assert((regs.t0 & 1) == regs->t0); - assert((regs.s & 1) == regs->s); - assert((regs.m & 1) == regs->m); - assert((XFLG & 1) == XFLG); - assert((NFLG & 1) == NFLG); - assert((ZFLG & 1) == ZFLG); - assert((VFLG & 1) == VFLG); - assert((CFLG & 1) == CFLG); + assert ((regs.t1 & 1) == regs->t1); + assert ((regs.t0 & 1) == regs->t0); + assert ((regs.s & 1) == regs->s); + assert ((regs.m & 1) == regs->m); + assert ((XFLG & 1) == XFLG); + assert ((NFLG & 1) == NFLG); + assert ((ZFLG & 1) == ZFLG); + assert ((VFLG & 1) == VFLG); + assert ((CFLG & 1) == CFLG); #endif regs->sr = ((regs->t1 << 15) | (regs->t0 << 14) | (regs->s << 13) | (regs->m << 12) | (regs->intmask << 8) - | (GET_XFLG(®s->ccrflags) << 4) | (GET_NFLG(®s->ccrflags) << 3) - | (GET_ZFLG(®s->ccrflags) << 2) | (GET_VFLG(®s->ccrflags) << 1) - | GET_CFLG(®s->ccrflags)); + | (GET_XFLG (®s->ccrflags) << 4) | (GET_NFLG (®s->ccrflags) << 3) + | (GET_ZFLG (®s->ccrflags) << 2) | (GET_VFLG (®s->ccrflags) << 1) + | GET_CFLG (®s->ccrflags)); } void REGPARAM2 MakeFromSR (struct regstruct *regs) @@ -825,13 +825,13 @@ void REGPARAM2 MakeFromSR (struct regstruct *regs) if (olds != regs->s) { if (olds) { if (oldm) - regs->msp = m68k_areg(regs, 7); + regs->msp = m68k_areg (regs, 7); else - regs->isp = m68k_areg(regs, 7); - m68k_areg(regs, 7) = regs->usp; + regs->isp = m68k_areg (regs, 7); + m68k_areg (regs, 7) = regs->usp; } else { - regs->usp = m68k_areg(regs, 7); - m68k_areg(regs, 7) = regs->m ? regs->msp : regs->isp; + regs->usp = m68k_areg (regs, 7); + m68k_areg (regs, 7) = regs->m ? regs->msp : regs->isp; } } else if (olds && oldm != regs->m) { if (oldm) { @@ -857,7 +857,7 @@ void REGPARAM2 MakeFromSR (struct regstruct *regs) } } - doint(); + doint (); if (regs->t1 || regs->t0) set_special (regs, SPCFLAG_TRACE); else @@ -873,7 +873,7 @@ static void exception_trace (int nr) /* trace stays pending if exception is div by zero, chk, * trapv or trap #x */ - if (nr == 5 || nr == 6 || nr == 7 || (nr >= 32 && nr <= 47)) + if (nr == 5 || nr == 6 || nr == 7 || (nr >= 32 && nr <= 47)) set_special (®s, SPCFLAG_DOTRACE); } regs.t1 = regs.t0 = regs.m = 0; @@ -884,7 +884,7 @@ static void exception_debug (int nr) #ifdef DEBUGGER if (!exception_debugging) return; - console_out ("Exception %d, PC=%08.8X\n", nr, m68k_getpc(®s)); + console_out ("Exception %d, PC=%08.8X\n", nr, m68k_getpc (®s)); #endif } @@ -899,7 +899,7 @@ static void Exception_ce (int nr, struct regstruct *regs, uaecptr oldpc) int sv = regs->s; exception_debug (nr); - MakeSR(regs); + MakeSR (regs); c = 0; switch (nr) @@ -959,29 +959,29 @@ static void Exception_ce (int nr, struct regstruct *regs, uaecptr oldpc) if (c) do_cycles_ce (c * CYCLE_UNIT / 2); if (!regs->s) { - regs->usp = m68k_areg(regs, 7); - m68k_areg(regs, 7) = regs->isp; + regs->usp = m68k_areg (regs, 7); + m68k_areg (regs, 7) = regs->isp; regs->s = 1; } - if (nr == 2 || nr == 3) { /* 2=bus error,3=address error */ + if (nr == 2 || nr == 3) { /* 2=bus error, 3=address error */ uae_u16 mode = (sv ? 4 : 0) | (last_instructionaccess_for_exception_3 ? 2 : 1); mode |= last_writeaccess_for_exception_3 ? 0 : 16; - m68k_areg(regs, 7) -= 14; + m68k_areg (regs, 7) -= 14; /* fixme: bit3=I/N */ - put_word_ce (m68k_areg(regs, 7) + 12, last_addr_for_exception_3); - put_word_ce (m68k_areg(regs, 7) + 8, regs->sr); - put_word_ce (m68k_areg(regs, 7) + 10, last_addr_for_exception_3 >> 16); - put_word_ce (m68k_areg(regs, 7) + 6, last_op_for_exception_3); - put_word_ce (m68k_areg(regs, 7) + 4, last_fault_for_exception_3); - put_word_ce (m68k_areg(regs, 7) + 0, mode); - put_word_ce (m68k_areg(regs, 7) + 2, last_fault_for_exception_3 >> 16); + put_word_ce (m68k_areg (regs, 7) + 12, last_addr_for_exception_3); + put_word_ce (m68k_areg (regs, 7) + 8, regs->sr); + put_word_ce (m68k_areg (regs, 7) + 10, last_addr_for_exception_3 >> 16); + put_word_ce (m68k_areg (regs, 7) + 6, last_op_for_exception_3); + put_word_ce (m68k_areg (regs, 7) + 4, last_fault_for_exception_3); + put_word_ce (m68k_areg (regs, 7) + 0, mode); + put_word_ce (m68k_areg (regs, 7) + 2, last_fault_for_exception_3 >> 16); write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (4 * nr)); goto kludge_me_do; } m68k_areg (regs, 7) -= 6; - put_word_ce (m68k_areg(regs, 7) + 4, currpc); - put_word_ce (m68k_areg(regs, 7) + 0, regs->sr); - put_word_ce (m68k_areg(regs, 7) + 2, currpc >> 16); + put_word_ce (m68k_areg (regs, 7) + 4, currpc); + put_word_ce (m68k_areg (regs, 7) + 0, regs->sr); + put_word_ce (m68k_areg (regs, 7) + 2, currpc >> 16); kludge_me_do: newpc = get_word_ce (4 * nr) << 16; newpc |= get_word_ce (4 * nr + 2); @@ -989,12 +989,12 @@ kludge_me_do: if (nr == 2 || nr == 3) uae_reset (1); /* there is nothing else we can do.. */ else - exception3 (regs->ir, m68k_getpc(regs), newpc); + exception3 (regs->ir, m68k_getpc (regs), newpc); return; } m68k_setpc (regs, newpc); fill_prefetch_slow (regs); - set_special(regs, SPCFLAG_END_COMPILE); + set_special (regs, SPCFLAG_END_COMPILE); exception_trace (nr); } #endif @@ -1005,14 +1005,14 @@ static void Exception_normal (int nr, struct regstruct *regs, uaecptr oldpc) int sv = regs->s; exception_debug (nr); - MakeSR(regs); + MakeSR (regs); if (!regs->s) { - regs->usp = m68k_areg(regs, 7); + regs->usp = m68k_areg (regs, 7); if (currprefs.cpu_model >= 68020) - m68k_areg(regs, 7) = regs->m ? regs->msp : regs->isp; + m68k_areg (regs, 7) = regs->m ? regs->msp : regs->isp; else - m68k_areg(regs, 7) = regs->isp; + m68k_areg (regs, 7) = regs->isp; regs->s = 1; } if (currprefs.cpu_model > 68000) { @@ -1021,100 +1021,100 @@ static void Exception_normal (int nr, struct regstruct *regs, uaecptr oldpc) if (currprefs.cpu_model >= 68040) { if (nr == 2) { for (i = 0 ; i < 18 ; i++) { - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); } - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), last_fault_for_exception_3); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x0140 | (sv ? 6 : 2)); /* SSW */ - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), last_addr_for_exception_3); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x7000 + nr * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), last_fault_for_exception_3); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x0140 | (sv ? 6 : 2)); /* SSW */ + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), last_addr_for_exception_3); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x7000 + nr * 4); } else { - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), last_fault_for_exception_3); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x2000 + nr * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), last_fault_for_exception_3); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x2000 + nr * 4); } } else { uae_u16 ssw = (sv ? 4 : 0) | (last_instructionaccess_for_exception_3 ? 2 : 1); ssw |= last_writeaccess_for_exception_3 ? 0 : 0x40; ssw |= 0x20; for (i = 0 ; i < 36; i++) { - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); } - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), last_fault_for_exception_3); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), ssw); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0xb000 + nr * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), last_fault_for_exception_3); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), ssw); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0xb000 + nr * 4); } write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (regs->vbr + 4*nr)); } else if (nr ==5 || nr == 6 || nr == 7 || nr == 9) { - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), oldpc); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x2000 + nr * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), oldpc); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x2000 + nr * 4); } else if (regs->m && nr >= 24 && nr < 32) { /* M + Interrupt */ - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), nr * 4); - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), currpc); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), regs->sr); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), nr * 4); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), currpc); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), regs->sr); regs->sr |= (1 << 13); - regs->msp = m68k_areg(regs, 7); - m68k_areg(regs, 7) = regs->isp; - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), 0x1000 + nr * 4); + regs->msp = m68k_areg (regs, 7); + m68k_areg (regs, 7) = regs->isp; + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), 0x1000 + nr * 4); } else { - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), nr * 4); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), nr * 4); } } else if (nr == 2 || nr == 3) { uae_u16 mode = (sv ? 4 : 0) | (last_instructionaccess_for_exception_3 ? 2 : 1); mode |= last_writeaccess_for_exception_3 ? 0 : 16; - m68k_areg(regs, 7) -= 14; + m68k_areg (regs, 7) -= 14; /* fixme: bit3=I/N */ - put_word (m68k_areg(regs, 7) + 0, mode); - put_long (m68k_areg(regs, 7) + 2, last_fault_for_exception_3); - put_word (m68k_areg(regs, 7) + 6, last_op_for_exception_3); - put_word (m68k_areg(regs, 7) + 8, regs->sr); - put_long (m68k_areg(regs, 7) + 10, last_addr_for_exception_3); + put_word (m68k_areg (regs, 7) + 0, mode); + put_long (m68k_areg (regs, 7) + 2, last_fault_for_exception_3); + put_word (m68k_areg (regs, 7) + 6, last_op_for_exception_3); + put_word (m68k_areg (regs, 7) + 8, regs->sr); + put_long (m68k_areg (regs, 7) + 10, last_addr_for_exception_3); write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (regs->vbr + 4*nr)); goto kludge_me_do; } - m68k_areg(regs, 7) -= 4; - put_long (m68k_areg(regs, 7), currpc); - m68k_areg(regs, 7) -= 2; - put_word (m68k_areg(regs, 7), regs->sr); + m68k_areg (regs, 7) -= 4; + put_long (m68k_areg (regs, 7), currpc); + m68k_areg (regs, 7) -= 2; + put_word (m68k_areg (regs, 7), regs->sr); kludge_me_do: newpc = get_long (regs->vbr + 4 * nr); if (newpc & 1) { if (nr == 2 || nr == 3) uae_reset (1); /* there is nothing else we can do.. */ else - exception3 (regs->ir, m68k_getpc(regs), newpc); + exception3 (regs->ir, m68k_getpc (regs), newpc); return; } m68k_setpc (regs, newpc); - set_special(regs, SPCFLAG_END_COMPILE); + set_special (regs, SPCFLAG_END_COMPILE); fill_prefetch_slow (regs); exception_trace (nr); } @@ -1124,7 +1124,7 @@ void REGPARAM2 Exception (int nr, struct regstruct *regs, uaecptr oldpc) #if 0 if (1 || nr < 24) write_log ("exception %d %08.8X %08.8X (%04.4X %04.4X)\n", - nr, oldpc, m68k_getpc(regs), intena, intreq); + nr, oldpc, m68k_getpc (regs), intena, intreq); #endif #ifdef CPUEMU_12 if (currprefs.cpu_cycle_exact && currprefs.cpu_model == 68000) @@ -1134,23 +1134,23 @@ void REGPARAM2 Exception (int nr, struct regstruct *regs, uaecptr oldpc) Exception_normal (nr, regs, oldpc); } -STATIC_INLINE void do_interrupt(int nr, struct regstruct *regs) +STATIC_INLINE void do_interrupt (int nr, struct regstruct *regs) { #if 0 if (nr == 2) - write_log("."); - //write_log("irq %d at %x (%04.4X) ", nr, m68k_getpc(regs), intena & intreq); + write_log ("."); + //write_log ("irq %d at %x (%04.4X) ", nr, m68k_getpc (regs), intena & intreq); #endif regs->stopped = 0; unset_special (regs, SPCFLAG_STOP); - assert(nr < 8 && nr >= 0); + assert (nr < 8 && nr >= 0); Exception (nr + 24, regs, 0); regs->intmask = nr; - doint(); + doint (); } -void NMI(void) +void NMI (void) { do_interrupt (7, ®s); } @@ -1194,7 +1194,7 @@ int movec_illg (int regno) int m68k_move2c (int regno, uae_u32 *regp) { #if MOVEC_DEBUG > 0 - write_log("move2c %04.4X <- %08.8X PC=%x\n", regno, *regp, M68K_GETPC); + write_log ("move2c %04.4X <- %08.8X PC=%x\n", regno, *regp, M68K_GETPC); #endif if (movec_illg (regno)) { op_illg (0x4E7B, ®s); @@ -1215,7 +1215,7 @@ int m68k_move2c (int regno, uae_u32 *regp) else if (currprefs.cpu_model == 68060) cacr_mask = 0xf8e0e000; regs.cacr = *regp & cacr_mask; - set_cpu_caches(); + set_cpu_caches (); } break; /* 68040/060 only */ @@ -1233,8 +1233,8 @@ int m68k_move2c (int regno, uae_u32 *regp) case 0x800: regs.usp = *regp; break; case 0x801: regs.vbr = *regp; break; case 0x802: regs.caar = *regp & 0xfc; break; - case 0x803: regs.msp = *regp; if (regs.m == 1) m68k_areg(®s, 7) = regs.msp; break; - case 0x804: regs.isp = *regp; if (regs.m == 0) m68k_areg(®s, 7) = regs.isp; break; + case 0x803: regs.msp = *regp; if (regs.m == 1) m68k_areg (®s, 7) = regs.msp; break; + case 0x804: regs.isp = *regp; if (regs.m == 0) m68k_areg (®s, 7) = regs.isp; break; /* 68040 only */ case 0x805: regs.mmusr = *regp; break; /* 68040/060 */ @@ -1247,9 +1247,9 @@ int m68k_move2c (int regno, uae_u32 *regp) regs.pcr &= ~(0x40 | 2 | 1); regs.pcr |= (*regp) & (0x40 | 2 | 1); if (((opcr ^ regs.pcr) & 2) == 2) { - write_log("68060 FPU state: %s\n", regs.pcr & 2 ? "disabled" : "enabled"); + write_log ("68060 FPU state: %s\n", regs.pcr & 2 ? "disabled" : "enabled"); /* flush possible already translated FPU instructions */ - flush_icache(2); + flush_icache (2); } } break; @@ -1264,7 +1264,7 @@ int m68k_move2c (int regno, uae_u32 *regp) int m68k_movec2 (int regno, uae_u32 *regp) { #if MOVEC_DEBUG > 0 - write_log("movec2 %04.4X PC=%x\n", regno, M68K_GETPC); + write_log ("movec2 %04.4X PC=%x\n", regno, M68K_GETPC); #endif if (movec_illg (regno)) { op_illg (0x4E7A, ®s); @@ -1273,7 +1273,7 @@ int m68k_movec2 (int regno, uae_u32 *regp) switch (regno) { case 0: *regp = regs.sfc; break; case 1: *regp = regs.dfc; break; - case 2: + case 2: { uae_u32 v = regs.cacr; uae_u32 cacr_mask = 0; @@ -1298,8 +1298,8 @@ int m68k_movec2 (int regno, uae_u32 *regp) case 0x800: *regp = regs.usp; break; case 0x801: *regp = regs.vbr; break; case 0x802: *regp = regs.caar; break; - case 0x803: *regp = regs.m == 1 ? m68k_areg(®s, 7) : regs.msp; break; - case 0x804: *regp = regs.m == 0 ? m68k_areg(®s, 7) : regs.isp; break; + case 0x803: *regp = regs.m == 1 ? m68k_areg (®s, 7) : regs.msp; break; + case 0x804: *regp = regs.m == 0 ? m68k_areg (®s, 7) : regs.isp; break; case 0x805: *regp = regs.mmusr; break; case 0x806: *regp = regs.urp; break; case 0x807: *regp = regs.srp; break; @@ -1311,13 +1311,13 @@ int m68k_movec2 (int regno, uae_u32 *regp) } } #if MOVEC_DEBUG > 0 - write_log("-> %08.8X\n", *regp); + write_log ("-> %08.8X\n", *regp); #endif return 1; } STATIC_INLINE int -div_unsigned(uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae_u32 *quot, uae_u32 *rem) +div_unsigned (uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae_u32 *quot, uae_u32 *rem) { uae_u32 q = 0, cbit = 0; int i; @@ -1343,24 +1343,24 @@ div_unsigned(uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae_u32 *quot, uae_u32 void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) { -#if defined(uae_s64) +#if defined (uae_s64) if (src == 0) { Exception (5, ®s, oldpc); return; } if (extra & 0x800) { /* signed variant */ - uae_s64 a = (uae_s64)(uae_s32)m68k_dreg(®s, (extra >> 12) & 7); + uae_s64 a = (uae_s64)(uae_s32)m68k_dreg (®s, (extra >> 12) & 7); uae_s64 quot, rem; if (extra & 0x400) { a &= 0xffffffffu; - a |= (uae_s64)m68k_dreg(®s, extra & 7) << 32; + a |= (uae_s64)m68k_dreg (®s, extra & 7) << 32; } rem = a % (uae_s64)(uae_s32)src; quot = a / (uae_s64)(uae_s32)src; - if ((quot & UVAL64(0xffffffff80000000)) != 0 - && (quot & UVAL64(0xffffffff80000000)) != UVAL64(0xffffffff80000000)) + if ((quot & UVAL64 (0xffffffff80000000)) != 0 + && (quot & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000)) { SET_VFLG (®s.ccrflags, 1); SET_NFLG (®s.ccrflags, 1); @@ -1371,17 +1371,17 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) SET_CFLG (®s.ccrflags, 0); SET_ZFLG (®s.ccrflags, ((uae_s32)quot) == 0); SET_NFLG (®s.ccrflags, ((uae_s32)quot) < 0); - m68k_dreg(®s, extra & 7) = (uae_u32)rem; - m68k_dreg(®s, (extra >> 12) & 7) = (uae_u32)quot; + m68k_dreg (®s, extra & 7) = (uae_u32)rem; + m68k_dreg (®s, (extra >> 12) & 7) = (uae_u32)quot; } } else { /* unsigned */ - uae_u64 a = (uae_u64)(uae_u32)m68k_dreg(®s, (extra >> 12) & 7); + uae_u64 a = (uae_u64)(uae_u32)m68k_dreg (®s, (extra >> 12) & 7); uae_u64 quot, rem; if (extra & 0x400) { a &= 0xffffffffu; - a |= (uae_u64)m68k_dreg(®s, extra & 7) << 32; + a |= (uae_u64)m68k_dreg (®s, extra & 7) << 32; } rem = a % (uae_u64)src; quot = a / (uae_u64)src; @@ -1394,8 +1394,8 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) SET_CFLG (®s.ccrflags, 0); SET_ZFLG (®s.ccrflags, ((uae_s32)quot) == 0); SET_NFLG (®s.ccrflags, ((uae_s32)quot) < 0); - m68k_dreg(®s, extra & 7) = (uae_u32)rem; - m68k_dreg(®s, (extra >> 12) & 7) = (uae_u32)quot; + m68k_dreg (®s, extra & 7) = (uae_u32)rem; + m68k_dreg (®s, (extra >> 12) & 7) = (uae_u32)quot; } } #else @@ -1405,14 +1405,14 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) } if (extra & 0x800) { /* signed variant */ - uae_s32 lo = (uae_s32)m68k_dreg(®s, (extra >> 12) & 7); + uae_s32 lo = (uae_s32)m68k_dreg (®s, (extra >> 12) & 7); uae_s32 hi = lo < 0 ? -1 : 0; uae_s32 save_high; uae_u32 quot, rem; uae_u32 sign; if (extra & 0x400) { - hi = (uae_s32)m68k_dreg(®s, extra & 7); + hi = (uae_s32)m68k_dreg (®s, extra & 7); } save_high = hi; sign = (hi ^ src); @@ -1422,7 +1422,7 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) if (lo == 0) hi++; } if ((uae_s32)src < 0) src = -src; - if (div_unsigned(hi, lo, src, ", &rem) || + if (div_unsigned (hi, lo, src, ", &rem) || (sign & 0x80000000) ? quot > 0x80000000 : quot > 0x7fffffff) { SET_VFLG (1); SET_NFLG (1); @@ -1434,19 +1434,19 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) SET_CFLG (0); SET_ZFLG (((uae_s32)quot) == 0); SET_NFLG (((uae_s32)quot) < 0); - m68k_dreg(regs, extra & 7) = rem; - m68k_dreg(regs, (extra >> 12) & 7) = quot; + m68k_dreg (regs, extra & 7) = rem; + m68k_dreg (regs, (extra >> 12) & 7) = quot; } } else { /* unsigned */ - uae_u32 lo = (uae_u32)m68k_dreg(®s, (extra >> 12) & 7); + uae_u32 lo = (uae_u32)m68k_dreg (®s, (extra >> 12) & 7); uae_u32 hi = 0; uae_u32 quot, rem; if (extra & 0x400) { - hi = (uae_u32)m68k_dreg(®s, extra & 7); + hi = (uae_u32)m68k_dreg (®s, extra & 7); } - if (div_unsigned(hi, lo, src, ", &rem)) { + if (div_unsigned (hi, lo, src, ", &rem)) { SET_VFLG (1); SET_NFLG (1); SET_CFLG (0); @@ -1455,15 +1455,15 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra, uaecptr oldpc) SET_CFLG (0); SET_ZFLG (((uae_s32)quot) == 0); SET_NFLG (((uae_s32)quot) < 0); - m68k_dreg(regs, extra & 7) = rem; - m68k_dreg(regs, (extra >> 12) & 7) = quot; + m68k_dreg (regs, extra & 7) = rem; + m68k_dreg (regs, (extra >> 12) & 7) = quot; } } #endif } STATIC_INLINE void -mul_unsigned(uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo) +mul_unsigned (uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo) { uae_u32 r0 = (src1 & 0xffff) * (src2 & 0xffff); uae_u32 r1 = ((src1 >> 16) & 0xffff) * (src2 & 0xffff); @@ -1483,10 +1483,10 @@ mul_unsigned(uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo) void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) { -#if defined(uae_s64) +#if defined (uae_s64) if (extra & 0x800) { /* signed variant */ - uae_s64 a = (uae_s64)(uae_s32)m68k_dreg(®s, (extra >> 12) & 7); + uae_s64 a = (uae_s64)(uae_s32)m68k_dreg (®s, (extra >> 12) & 7); a *= (uae_s64)(uae_s32)src; SET_VFLG (®s.ccrflags, 0); @@ -1494,16 +1494,16 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) SET_ZFLG (®s.ccrflags, a == 0); SET_NFLG (®s.ccrflags, a < 0); if (extra & 0x400) - m68k_dreg(®s, extra & 7) = (uae_u32)(a >> 32); - else if ((a & UVAL64(0xffffffff80000000)) != 0 - && (a & UVAL64(0xffffffff80000000)) != UVAL64(0xffffffff80000000)) + m68k_dreg (®s, extra & 7) = (uae_u32)(a >> 32); + else if ((a & UVAL64 (0xffffffff80000000)) != 0 + && (a & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000)) { SET_VFLG (®s.ccrflags, 1); } - m68k_dreg(®s, (extra >> 12) & 7) = (uae_u32)a; + m68k_dreg (®s, (extra >> 12) & 7) = (uae_u32)a; } else { /* unsigned */ - uae_u64 a = (uae_u64)(uae_u32)m68k_dreg(®s, (extra >> 12) & 7); + uae_u64 a = (uae_u64)(uae_u32)m68k_dreg (®s, (extra >> 12) & 7); a *= (uae_u64)src; SET_VFLG (®s.ccrflags, 0); @@ -1511,25 +1511,25 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) SET_ZFLG (®s.ccrflags, a == 0); SET_NFLG (®s.ccrflags, ((uae_s64)a) < 0); if (extra & 0x400) - m68k_dreg(®s, extra & 7) = (uae_u32)(a >> 32); - else if ((a & UVAL64(0xffffffff00000000)) != 0) { + m68k_dreg (®s, extra & 7) = (uae_u32)(a >> 32); + else if ((a & UVAL64 (0xffffffff00000000)) != 0) { SET_VFLG (®s.ccrflags, 1); } - m68k_dreg(®s, (extra >> 12) & 7) = (uae_u32)a; + m68k_dreg (®s, (extra >> 12) & 7) = (uae_u32)a; } #else if (extra & 0x800) { /* signed variant */ - uae_s32 src1,src2; - uae_u32 dst_lo,dst_hi; + uae_s32 src1, src2; + uae_u32 dst_lo, dst_hi; uae_u32 sign; src1 = (uae_s32)src; - src2 = (uae_s32)m68k_dreg(®s, (extra >> 12) & 7); + src2 = (uae_s32)m68k_dreg (®s, (extra >> 12) & 7); sign = (src1 ^ src2); if (src1 < 0) src1 = -src1; if (src2 < 0) src2 = -src2; - mul_unsigned((uae_u32)src1,(uae_u32)src2,&dst_hi,&dst_lo); + mul_unsigned ((uae_u32)src1, (uae_u32)src2, &dst_hi, &dst_lo); if (sign & 0x80000000) { dst_hi = ~dst_hi; dst_lo = -dst_lo; @@ -1540,30 +1540,30 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) SET_ZFLG (dst_hi == 0 && dst_lo == 0); SET_NFLG (((uae_s32)dst_hi) < 0); if (extra & 0x400) - m68k_dreg(®s, extra & 7) = dst_hi; + m68k_dreg (®s, extra & 7) = dst_hi; else if ((dst_hi != 0 || (dst_lo & 0x80000000) != 0) && ((dst_hi & 0xffffffff) != 0xffffffff || (dst_lo & 0x80000000) != 0x80000000)) { SET_VFLG (1); } - m68k_dreg(®s, (extra >> 12) & 7) = dst_lo; + m68k_dreg (®s, (extra >> 12) & 7) = dst_lo; } else { /* unsigned */ - uae_u32 dst_lo,dst_hi; + uae_u32 dst_lo, dst_hi; - mul_unsigned(src,(uae_u32)m68k_dreg(®s, (extra >> 12) & 7),&dst_hi,&dst_lo); + mul_unsigned (src, (uae_u32)m68k_dreg (®s, (extra >> 12) & 7), &dst_hi, &dst_lo); SET_VFLG (0); SET_CFLG (0); SET_ZFLG (dst_hi == 0 && dst_lo == 0); SET_NFLG (((uae_s32)dst_hi) < 0); if (extra & 0x400) - m68k_dreg(®s, extra & 7) = dst_hi; + m68k_dreg (®s, extra & 7) = dst_hi; else if (dst_hi != 0) { SET_VFLG (1); } - m68k_dreg(regs, (extra >> 12) & 7) = dst_lo; + m68k_dreg (regs, (extra >> 12) & 7) = dst_lo; } #endif } @@ -1577,14 +1577,14 @@ void m68k_reset (int hardreset) #ifdef SAVESTATE if (savestate_state == STATE_RESTORE || savestate_state == STATE_REWIND) { m68k_setpc (®s, regs.pc); - /* MakeFromSR() must not swap stack pointer */ + /* MakeFromSR () must not swap stack pointer */ regs.s = (regs.sr >> 13) & 1; - MakeFromSR(®s); + MakeFromSR (®s); /* set stack pointer */ if (regs.s) - m68k_areg(®s, 7) = regs.isp; + m68k_areg (®s, 7) = regs.isp; else - m68k_areg(®s, 7) = regs.usp; + m68k_areg (®s, 7) = regs.usp; return; } #endif @@ -1611,7 +1611,7 @@ void m68k_reset (int hardreset) regs.itt0 = regs.itt1 = regs.dtt0 = regs.dtt1 = 0; regs.tcr = regs.mmusr = regs.urp = regs.srp = regs.buscr = 0; - a3000_fakekick(0); + a3000_fakekick (0); /* only (E)nable bit is zeroed when CPU is reset, A3000 SuperKickstart expects this */ tc_030 &= ~0x80000000; tt0_030 &= ~0x80000000; @@ -1627,7 +1627,7 @@ void m68k_reset (int hardreset) */ regs.pcr = 0; if (currprefs.cpu_model == 68060) { - regs.pcr = currprefs.fpu_model ? MC68060_PCR : MC68EC060_PCR; + regs.pcr = currprefs.fpu_model ? MC68060_PCR : MC68EC060_PCR; regs.pcr |= (currprefs.cpu060_revision & 0xff) << 8; regs.pcr |= 2; } @@ -1648,8 +1648,8 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode, struct regstruct *regs) { uaecptr pc = m68k_getpc (regs); static int warned; - int inrom = in_rom(pc); - int inrt = in_rtarea(pc); + int inrom = in_rom (pc); + int inrt = in_rtarea (pc); if (cloanto_rom && (opcode & 0xF100) == 0x7100) { m68k_dreg (regs, (opcode >> 9) & 7) = (uae_s8)(opcode & 0xFF); @@ -1681,7 +1681,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode, struct regstruct *regs) if ((opcode & 0xF000) == 0xA000 && inrt) { /* Calltrap. */ - m68k_incpc(regs, 2); + m68k_incpc (regs, 2); m68k_handle_trap (opcode & 0xFFF, regs); fill_prefetch_slow (regs); return 4; @@ -1693,7 +1693,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode, struct regstruct *regs) write_log ("B-Trap %x at %x (%p)\n", opcode, pc, regs->pc_p); warned++; } - Exception(0xB, regs, 0); + Exception (0xB, regs, 0); return 4; } if ((opcode & 0xF000) == 0xA000) { @@ -1701,7 +1701,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode, struct regstruct *regs) write_log ("A-Trap %x at %x (%p)\n", opcode, pc, regs->pc_p); warned++; } - Exception(0xA, regs, 0); + Exception (0xA, regs, 0); return 4; } if (warned < 20) { @@ -1717,7 +1717,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode, struct regstruct *regs) static char *mmu30regs[] = { "TCR", "", "SRP", "CRP", "", "", "", "" }; -static void mmu_op30_pmove(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) +static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) { int preg = (next >> 10) & 31; int rw = (next >> 9) & 1; @@ -1732,114 +1732,114 @@ static void mmu_op30_pmove(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ext reg = "TC"; siz = 4; if (rw) - put_long(extra, tc_030); + put_long (extra, tc_030); else - tc_030 = get_long(extra); + tc_030 = get_long (extra); break; case 0x12: // SRP reg = "SRP"; siz = 8; if (rw) { - put_long(extra, srp_030 >> 32); - put_long(extra + 4, srp_030); + put_long (extra, srp_030 >> 32); + put_long (extra + 4, srp_030); } else { - srp_030 = (uae_u64)get_long(extra) << 32; - srp_030 |= get_long(extra + 4); + srp_030 = (uae_u64)get_long (extra) << 32; + srp_030 |= get_long (extra + 4); } break; case 0x13: // CRP reg = "CRP"; siz = 8; if (rw) { - put_long(extra, crp_030 >> 32); - put_long(extra + 4, crp_030); + put_long (extra, crp_030 >> 32); + put_long (extra + 4, crp_030); } else { - crp_030 = (uae_u64)get_long(extra) << 32; - crp_030 |= get_long(extra + 4); + crp_030 = (uae_u64)get_long (extra) << 32; + crp_030 |= get_long (extra + 4); } break; case 0x18: // MMUSR reg = "MMUSR"; siz = 2; if (rw) - put_word(extra, mmusr_030); + put_word (extra, mmusr_030); else - mmusr_030 = get_word(extra); + mmusr_030 = get_word (extra); break; case 0x02: // TT0 reg = "TT0"; siz = 4; if (rw) - put_long(extra, tt0_030); + put_long (extra, tt0_030); else - tt0_030 = get_long(extra); + tt0_030 = get_long (extra); break; case 0x03: // TT1 reg = "TT1"; siz = 4; if (rw) - put_long(extra, tt1_030); + put_long (extra, tt1_030); else - tt1_030 = get_long(extra); + tt1_030 = get_long (extra); break; } if (!reg) { - op_illg(opcode, ®s); + op_illg (opcode, ®s); return; } #if MMUOP_DEBUG > 0 { uae_u32 val; if (siz == 8) { - uae_u32 val2 = get_long(extra); - val = get_long(extra + 4); + uae_u32 val2 = get_long (extra); + val = get_long (extra + 4); if (rw) - write_log("PMOVE %s,%08X%08X", reg, val2, val); + write_log ("PMOVE %s,%08X%08X", reg, val2, val); else - write_log("PMOVE %08X%08X,%s", val2, val, reg); + write_log ("PMOVE %08X%08X,%s", val2, val, reg); } else { if (siz == 4) - val = get_long(extra); + val = get_long (extra); else - val = get_word(extra); + val = get_word (extra); if (rw) - write_log("PMOVE %s,%08X", reg, val); + write_log ("PMOVE %s,%08X", reg, val); else - write_log("PMOVE %08X,%s", val, reg); + write_log ("PMOVE %08X,%s", val, reg); } write_log (" PC=%08X\n", pc); } #endif if (currprefs.cs_mbdmac == 1 && currprefs.mbresmem_low_size > 0) { if (otc != tc_030) { - a3000_fakekick(tc_030 & 0x80000000); + a3000_fakekick (tc_030 & 0x80000000); } } } -static void mmu_op30_ptest(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) +static void mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) { #if MMUOP_DEBUG > 0 char tmp[10]; tmp[0] = 0; if ((next >> 8) & 1) - sprintf(tmp,",A%d", (next >> 4) & 15); - write_log("PTEST%c %02X,%08X,#%X%s PC=%08X\n", - ((next >> 9) & 1) ? 'W' : 'R', (next & 15), extra, (next >> 10) & 7, tmp, pc); + sprintf (tmp, ",A%d", (next >> 4) & 15); + write_log ("PTEST%c %02X,%08X,#%X%s PC=%08X\n", + ((next >> 9) & 1) ? 'W' : 'R', (next & 15), extra, (next >> 10) & 7, tmp, pc); #endif mmusr_030 = 0; } -static void mmu_op30_pflush(uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) +static void mmu_op30_pflush (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) { #if MMUOP_DEBUG > 0 - write_log("PFLUSH PC=%08X\n", pc); + write_log ("PFLUSH PC=%08X\n", pc); #endif } -void mmu_op30(uaecptr pc, uae_u32 opcode, struct regstruct *regs, int isnext, uaecptr extra) +void mmu_op30 (uaecptr pc, uae_u32 opcode, struct regstruct *regs, int isnext, uaecptr extra) { if (currprefs.cpu_model != 68030) { m68k_setpc (regs, pc); @@ -1847,26 +1847,26 @@ void mmu_op30(uaecptr pc, uae_u32 opcode, struct regstruct *regs, int isnext, ua return; } if (isnext) { - uae_u16 next = get_word(pc + 2); + uae_u16 next = get_word (pc + 2); if (next & 0x8000) - mmu_op30_ptest(pc, opcode, next, extra); + mmu_op30_ptest (pc, opcode, next, extra); else if (next & 0x2000) mmu_op30_pflush (pc, opcode, next, extra); else - mmu_op30_pmove(pc, opcode, next, extra); + mmu_op30_pmove (pc, opcode, next, extra); m68k_setpc (regs, m68k_getpc (regs) + 2); } else { #if MMUOP_DEBUG > 0 - write_log("MMU030: %04x PC=%08x\n", opcode, m68k_getpc(regs)); + write_log ("MMU030: %04x PC=%08x\n", opcode, m68k_getpc (regs)); #endif } return; } -void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u32 extra) +void mmu_op (uae_u32 opcode, struct regstruct *regs, uae_u32 extra) { #if MMUOP_DEBUG > 1 - write_log("mmu_op %04X PC=%08X\n", opcode, m68k_getpc(regs)); + write_log ("mmu_op %04X PC=%08X\n", opcode, m68k_getpc (regs)); #endif if ((opcode & 0xFE0) == 0x0500) { /* PFLUSH */ @@ -1887,7 +1887,7 @@ void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u32 extra) /* PLPA */ if (currprefs.cpu_model == 68060) { #if MMUOP_DEBUG > 0 - write_log("PLPA\n"); + write_log ("PLPA\n"); #endif return; } @@ -1895,13 +1895,13 @@ void mmu_op(uae_u32 opcode, struct regstruct *regs, uae_u32 extra) /* LPSTOP */ if (currprefs.cpu_model == 68060) { #if MMUOP_DEBUG > 0 - write_log("LPSTOP\n"); + write_log ("LPSTOP\n"); #endif return; } } #if MMUOP_DEBUG > 0 - write_log("Unknown MMU OP %04X\n", opcode); + write_log ("Unknown MMU OP %04X\n", opcode); #endif m68k_setpc (regs, m68k_getpc (regs) - 2); op_illg (opcode, regs); @@ -1930,10 +1930,10 @@ static void do_trace (void) || (opcode & 0xffc0) == 0x4ec0 /* JMP */ || (opcode & 0xff00) == 0x6100 /* BSR */ || ((opcode & 0xf000) == 0x6000 /* Bcc */ - && cctrue(®s.ccrflags, (opcode >> 8) & 0xf)) + && cctrue (®s.ccrflags, (opcode >> 8) & 0xf)) || ((opcode & 0xf0f0) == 0x5050 /* DBcc */ - && !cctrue(®s.ccrflags, (opcode >> 8) & 0xf) - && (uae_s16)m68k_dreg(®s, opcode & 7) != 0)) + && !cctrue (®s.ccrflags, (opcode >> 8) & 0xf) + && (uae_s16)m68k_dreg (®s, opcode & 7) != 0)) { last_trace_ad = m68k_getpc (®s); unset_special (®s, SPCFLAG_TRACE); @@ -1953,35 +1953,32 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs) #ifdef ACTION_REPLAY #ifdef ACTION_REPLAY_HRTMON if ((regs->spcflags & SPCFLAG_ACTION_REPLAY) && hrtmon_flag != ACTION_REPLAY_INACTIVE) { - int isinhrt = (m68k_getpc(regs) >= hrtmem_start && m68k_getpc(regs) < hrtmem_start + hrtmem_size); + int isinhrt = (m68k_getpc (regs) >= hrtmem_start && m68k_getpc (regs) < hrtmem_start + hrtmem_size); /* exit from HRTMon? */ - if(hrtmon_flag == ACTION_REPLAY_ACTIVE && !isinhrt) - hrtmon_hide(); + if (hrtmon_flag == ACTION_REPLAY_ACTIVE && !isinhrt) + hrtmon_hide (); /* HRTMon breakpoint? (not via IRQ7) */ - if(hrtmon_flag == ACTION_REPLAY_IDLE && isinhrt) - hrtmon_breakenter(); - if(hrtmon_flag == ACTION_REPLAY_ACTIVATE) - hrtmon_enter(); - if(!(regs->spcflags & ~SPCFLAG_ACTION_REPLAY)) + if (hrtmon_flag == ACTION_REPLAY_IDLE && isinhrt) + hrtmon_breakenter (); + if (hrtmon_flag == ACTION_REPLAY_ACTIVATE) + hrtmon_enter (); + if (!(regs->spcflags & ~SPCFLAG_ACTION_REPLAY)) return 0; } #endif - if ((regs->spcflags & SPCFLAG_ACTION_REPLAY) && action_replay_flag != ACTION_REPLAY_INACTIVE ) { - /*if(action_replay_flag == ACTION_REPLAY_ACTIVE && !is_ar_pc_in_rom())*/ - /* write_log("PC:%p\n",m68k_getpc());*/ - - if(action_replay_flag == ACTION_REPLAY_ACTIVATE || action_replay_flag == ACTION_REPLAY_DORESET) - action_replay_enter(); - if(action_replay_flag == ACTION_REPLAY_HIDE && !is_ar_pc_in_rom()) - { - action_replay_hide(); - unset_special(regs, SPCFLAG_ACTION_REPLAY); - } - if (action_replay_flag == ACTION_REPLAY_WAIT_PC ) - { - /*write_log("Waiting for PC: %p, current PC= %p\n",wait_for_pc, m68k_getpc());*/ - if (m68k_getpc(regs) == wait_for_pc) - { + if ((regs->spcflags & SPCFLAG_ACTION_REPLAY) && action_replay_flag != ACTION_REPLAY_INACTIVE) { + /*if (action_replay_flag == ACTION_REPLAY_ACTIVE && !is_ar_pc_in_rom ())*/ + /* write_log ("PC:%p\n", m68k_getpc ());*/ + + if (action_replay_flag == ACTION_REPLAY_ACTIVATE || action_replay_flag == ACTION_REPLAY_DORESET) + action_replay_enter (); + if (action_replay_flag == ACTION_REPLAY_HIDE && !is_ar_pc_in_rom ()) { + action_replay_hide (); + unset_special (regs, SPCFLAG_ACTION_REPLAY); + } + if (action_replay_flag == ACTION_REPLAY_WAIT_PC) { + /*write_log ("Waiting for PC: %p, current PC= %p\n", wait_for_pc, m68k_getpc ());*/ + if (m68k_getpc (regs) == wait_for_pc) { action_replay_flag = ACTION_REPLAY_ACTIVATE; /* Activate after next instruction. */ } } @@ -1993,11 +1990,11 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs) /*n_spcinsns++;*/ #ifdef JIT - unset_special(regs, SPCFLAG_END_COMPILE); /* has done its job */ + unset_special (regs, SPCFLAG_END_COMPILE); /* has done its job */ #endif while ((regs->spcflags & SPCFLAG_BLTNASTY) && dmaen (DMA_BLITTER) && cycles > 0 && !currprefs.blitter_cycle_exact) { - int c = blitnasty(); + int c = blitnasty (); if (c > 0) { cycles -= c * CYCLE_UNIT * 2; if (cycles < CYCLE_UNIT) @@ -2011,7 +2008,7 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs) if (regs->spcflags & SPCFLAG_DOTRACE) Exception (9, regs, last_trace_ad); - + if (regs->spcflags & SPCFLAG_TRAP) { unset_special (regs, SPCFLAG_TRAP); Exception (3, regs, 0); @@ -2059,13 +2056,13 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs) if (regs->spcflags & SPCFLAG_INT) { int intr = intlev (); - unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT); + unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT); if (intr != -1 && intr > regs->intmask) do_interrupt (intr, regs); } if (regs->spcflags & SPCFLAG_DOINT) { - unset_special (regs, SPCFLAG_DOINT); - set_special (regs, SPCFLAG_INT); + unset_special (regs, SPCFLAG_DOINT); + set_special (regs, SPCFLAG_INT); } if ((regs->spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE))) { @@ -2090,7 +2087,7 @@ void doint (void) static uae_u32 cd32nextpc, cd32request; -static void out_cd32io2(void) +static void out_cd32io2 (void) { uae_u32 request = cd32request; //write_log ("ACTUAL=%d ERROR=%d\n", get_long (request + 32), get_byte (request + 31)); @@ -2105,7 +2102,7 @@ static void out_cd32io (uae_u32 pc) uae_u32 request = m68k_areg (®s, 1); if (pc == cd32nextpc) { - out_cd32io2(); + out_cd32io2 (); return; } out[0] = 0; @@ -2135,8 +2132,8 @@ static void out_cd32io (uae_u32 pc) if (cd32request) write_log ("old request still not returned!\n"); cd32request = request; - cd32nextpc = get_long(m68k_areg (®s, 7)); - write_log("%s A1=%08.8X\n", out, request); + cd32nextpc = get_long (m68k_areg (®s, 7)); + write_log ("%s A1=%08.8X\n", out, request); if (ioreq) { static int cnt = 26; int cmd = get_word (request + 28); @@ -2144,15 +2141,15 @@ static void out_cd32io (uae_u32 pc) if (cmd == 2) { cnt--; if (cnt == 0) - activate_debugger(1); + activate_debugger (1); } #endif write_log ("CMD=%d DATA=%08.8X LEN=%d %OFF=%d\n", - cmd, get_long(request + 40), - get_long(request + 36), get_long(request + 44)); + cmd, get_long (request + 40), + get_long (request + 36), get_long (request + 44)); } if (ioreq < 0) - ;//activate_debugger(); + ;//activate_debugger (); } #endif @@ -2179,17 +2176,17 @@ static void m68k_run_1 (void) count_instr (opcode); #ifdef DEBUG_CD32IO - out_cd32io(m68k_getpc(®s)); + out_cd32io (m68k_getpc (®s)); #endif #if 0 - int pc = m68k_getpc(); + int pc = m68k_getpc (); if (pc == 0xdff002) - write_log("hip\n"); + write_log ("hip\n"); if (pc != pcs[0] && (pc < 0xd00000 || pc > 0x1000000)) { memmove (pcs + 1, pcs, 998 * 4); pcs[0] = pc; - //write_log("%08.8X-%04.4X ",pc, opcode); + //write_log ("%08.8X-%04.4X ", pc, opcode); } #endif do_cycles (cpu_cycles); @@ -2215,7 +2212,7 @@ static void m68k_run_1_ce (void) #else -/* cycle-exact m68k_run() */ +/* cycle-exact m68k_run () */ static void m68k_run_1_ce (void) { @@ -2237,20 +2234,20 @@ static void m68k_run_1_ce (void) #ifdef JIT /* Completely different run_2 replacement */ -void do_nothing(void) +void do_nothing (void) { /* What did you expect this to do? */ - do_cycles(0); + do_cycles (0); /* I bet you didn't expect *that* ;-) */ } -void exec_nostats(void) +void exec_nostats (void) { struct regstruct *r = ®s; for (;;) { - uae_u16 opcode = get_iword(r, 0); + uae_u16 opcode = get_iword (r, 0); cpu_cycles = (*cpufunctbl[opcode])(opcode, r); @@ -2259,7 +2256,7 @@ void exec_nostats(void) do_cycles (cpu_cycles); - if (end_block(opcode) || r->spcflags) + if (end_block (opcode) || r->spcflags) return; /* We will deal with the spcflags in the caller */ } } @@ -2268,14 +2265,14 @@ static int triggered; extern volatile int bsd_int_requested; -void execute_normal(void) +void execute_normal (void) { struct regstruct *r = ®s; int blocklen; cpu_history pc_hist[MAXRUN]; int total_cycles; - if (check_for_cache_miss()) + if (check_for_cache_miss ()) return; total_cycles = 0; @@ -2297,8 +2294,8 @@ void execute_normal(void) total_cycles += cpu_cycles; pc_hist[blocklen].specmem = special_mem; blocklen++; - if (end_block(opcode) || blocklen >= MAXRUN || r->spcflags || uae_int_requested) { - compile_block(pc_hist,blocklen,total_cycles); + if (end_block (opcode) || blocklen >= MAXRUN || r->spcflags || uae_int_requested) { + compile_block (pc_hist, blocklen, total_cycles); return; /* We will deal with the spcflags in the caller */ } /* No need to check regs.spcflags, because if they were set, @@ -2306,7 +2303,7 @@ void execute_normal(void) } } -typedef void compiled_handler(void); +typedef void compiled_handler (void); static void m68k_run_2a (void) { @@ -2347,7 +2344,7 @@ static void m68k_run_2p (void) uae_u32 pc = m68k_getpc (r); #ifdef DEBUG_CD32IO - out_cd32io(m68k_getpc(®s)); + out_cd32io (m68k_getpc (®s)); #endif do_cycles (cpu_cycles); @@ -2404,7 +2401,7 @@ static void m68k_run_mmu (void) cpu_cycles &= cycles_mask; cpu_cycles |= cycles_val; if (mmu_triggered) - mmu_do_hit(); + mmu_do_hit (); if (regs.spcflags) { if (do_specialties (cpu_cycles, ®s)) return; @@ -2457,7 +2454,7 @@ void m68k_go (int may_quit) customreset (hardreset); m68k_reset (hardreset); if (hardreset) { - memory_hardreset(); + memory_hardreset (); write_log ("hardreset, memory cleared\n"); } #ifdef SAVESTATE @@ -2465,7 +2462,7 @@ void m68k_go (int may_quit) if (savestate_state == STATE_RESTORE || savestate_state == STATE_REWIND) { map_overlay (1); fill_prefetch_slow (®s); /* compatibility with old state saves */ - memory_map_dump(); + memory_map_dump (); } savestate_restore_finish (); #endif @@ -2531,7 +2528,7 @@ static void m68k_verify (uaecptr addr, uaecptr *nextpc) uae_u32 opcode, val; struct instr *dp; - opcode = get_iword_1(0); + opcode = get_iword_1 (0); last_op_for_exception_3 = opcode; m68kpc_offset = 2; @@ -2565,7 +2562,7 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c m68kpc_offset = addr - m68k_getpc (®s); if (buf) - memset(buf, 0, bufsize); + memset (buf, 0, bufsize); while (cnt-- > 0) { char instrname[100], *ccpt; int i; @@ -2583,7 +2580,7 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c for (lookup = lookuptab;lookup->mnemo != dp->mnemo; lookup++) ; - buf = buf_out(buf, &bufsize, "%08lX ", m68k_getpc (®s) + m68kpc_offset); + buf = buf_out (buf, &bufsize, "%08lX ", m68k_getpc (®s) + m68kpc_offset); m68kpc_offset += 2; @@ -2615,8 +2612,8 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c } while (i++ < 5) buf = buf_out (buf, &bufsize, " "); - if (strlen(instrname) > 79) { - int i = 0; + if (strlen (instrname) > 79) { + int i = 0; } buf = buf_out (buf, &bufsize, instrname); @@ -2624,7 +2621,7 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c if (ccpt != 0) { if (deaddr) *deaddr = newpc; - if (cctrue(®s.ccrflags, dp->cc)) + if (cctrue (®s.ccrflags, dp->cc)) buf = buf_out (buf, &bufsize, " == %08lX (TRUE)", newpc); else buf = buf_out (buf, &bufsize, " == %08lX (FALSE)", newpc); @@ -2643,30 +2640,30 @@ void m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *s { char *buf; - buf = (char*)malloc((MAX_LINEWIDTH + 1) * cnt); + buf = (char*)malloc ((MAX_LINEWIDTH + 1) * cnt); if (!buf) - return; + return; m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, seaddr, deaddr, 1); - f_out(f, "%s", buf); - free(buf); + f_out (f, "%s", buf); + free (buf); } void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt) { char *buf; - buf = (char*)malloc((MAX_LINEWIDTH + 1) * cnt); + buf = (char*)malloc ((MAX_LINEWIDTH + 1) * cnt); if (!buf) - return; + return; m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, NULL, NULL, 0); - f_out(f, "%s", buf); - free(buf); + f_out (f, "%s", buf); + free (buf); } /************************************************************* Disasm the m68kcode at the given address into instrname and instrcode *************************************************************/ -void sm68k_disasm(char *instrname, char *instrcode, uaecptr addr, uaecptr *nextpc) +void sm68k_disasm (char *instrname, char *instrcode, uaecptr addr, uaecptr *nextpc) { char *ccpt; uae_u32 opcode; @@ -2716,8 +2713,8 @@ void sm68k_disasm(char *instrname, char *instrcode, uaecptr addr, uaecptr *nextp int i; for (i = 0; i < (m68kpc_offset - oldpc) / 2; i++) { - sprintf(instrcode,"%04x ",get_iword_1 (oldpc + i * 2)); - instrcode += strlen(instrcode); + sprintf (instrcode, "%04x ", get_iword_1 (oldpc + i * 2)); + instrcode += strlen (instrcode); } } @@ -2769,7 +2766,7 @@ void val_move2c2 (int regno, uae_u32 val) case 0x807: regs.srp = val; break; case 0x808: regs.pcr = val; break; } -} +} uae_u32 val_move2c (int regno) { @@ -2794,30 +2791,30 @@ uae_u32 val_move2c (int regno) case 0x808: return regs.pcr; default: return 0; } -} +} void m68k_dumpstate (void *f, uaecptr *nextpc) { int i, j; for (i = 0; i < 8; i++){ - f_out (f, " D%d %08lX ", i, m68k_dreg(®s, i)); + f_out (f, " D%d %08lX ", i, m68k_dreg (®s, i)); if ((i & 3) == 3) f_out (f, "\n"); } for (i = 0; i < 8; i++){ - f_out (f, " A%d %08lX ", i, m68k_areg(®s, i)); + f_out (f, " A%d %08lX ", i, m68k_areg (®s, i)); if ((i & 3) == 3) f_out (f, "\n"); } - if (regs.s == 0) regs.usp = m68k_areg(®s, 7); - if (regs.s && regs.m) regs.msp = m68k_areg(®s, 7); - if (regs.s && regs.m == 0) regs.isp = m68k_areg(®s, 7); + if (regs.s == 0) regs.usp = m68k_areg (®s, 7); + if (regs.s && regs.m) regs.msp = m68k_areg (®s, 7); + if (regs.s && regs.m == 0) regs.isp = m68k_areg (®s, 7); j = 2; - f_out(f, "USP %08.8X ISP %08.8X ", regs.usp, regs.isp); + f_out (f, "USP %08.8X ISP %08.8X ", regs.usp, regs.isp); for (i = 0; m2cregs[i].regno>= 0; i++) { - if (!movec_illg(m2cregs[i].regno)) { + if (!movec_illg (m2cregs[i].regno)) { if (j > 0 && (j % 4) == 0) - f_out(f, "\n"); - f_out (f, "%-4s %08.8X ", m2cregs[i].regname, val_move2c(m2cregs[i].regno)); + f_out (f, "\n"); + f_out (f, "%-4s %08.8X ", m2cregs[i].regname, val_move2c (m2cregs[i].regno)); j++; } } @@ -2825,8 +2822,8 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) f_out (f, "\n"); f_out (f, "T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d STP=%d\n", regs.t1, regs.t0, regs.s, regs.m, - GET_XFLG(®s.ccrflags), GET_NFLG(®s.ccrflags), GET_ZFLG(®s.ccrflags), - GET_VFLG(®s.ccrflags), GET_CFLG(®s.ccrflags), + GET_XFLG (®s.ccrflags), GET_NFLG (®s.ccrflags), GET_ZFLG (®s.ccrflags), + GET_VFLG (®s.ccrflags), GET_CFLG (®s.ccrflags), regs.intmask, regs.stopped); #ifdef FPUEMU if (currprefs.fpu_model) { @@ -2835,7 +2832,7 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) f_out (f, "FP%d: %g ", i, regs.fp[i]); if ((i & 3) == 3) f_out (f, "\n"); } - fpsr = get_fpsr(); + fpsr = get_fpsr (); f_out (f, "N=%d Z=%d I=%d NAN=%d\n", (fpsr & 0x8000000) != 0, (fpsr & 0x4000000) != 0, @@ -2870,8 +2867,8 @@ uae_u8 *restore_cpu (uae_u8 *src) int i, flags, model; uae_u32 l; - changed_prefs.cpu_model = model = restore_u32(); - flags = restore_u32(); + changed_prefs.cpu_model = model = restore_u32 (); + flags = restore_u32 (); changed_prefs.address_space_24 = 0; if (flags & CPUTYPE_EC) changed_prefs.address_space_24 = 1; @@ -2889,7 +2886,7 @@ uae_u8 *restore_cpu (uae_u8 *src) regs.usp = restore_u32 (); regs.isp = restore_u32 (); regs.sr = restore_u16 (); - l = restore_u32(); + l = restore_u32 (); if (l & CPUMODE_HALT) { regs.stopped = 1; set_special (®s, SPCFLAG_STOP); @@ -2909,29 +2906,29 @@ uae_u8 *restore_cpu (uae_u8 *src) currprefs.m68k_speed = changed_prefs.m68k_speed = -1; } if (model >= 68030) { - crp_030 = restore_u64(); - srp_030 = restore_u64(); - tt0_030 =restore_u32(); - tt1_030 = restore_u32(); - tc_030 = restore_u32(); - mmusr_030 = restore_u16(); + crp_030 = restore_u64 (); + srp_030 = restore_u64 (); + tt0_030 =restore_u32 (); + tt1_030 = restore_u32 (); + tc_030 = restore_u32 (); + mmusr_030 = restore_u16 (); } if (model >= 68040) { - regs.itt0 = restore_u32(); - regs.itt1 = restore_u32(); - regs.dtt0 = restore_u32(); - regs.dtt1 = restore_u32(); - regs.tcr = restore_u32(); - regs.urp = restore_u32(); - regs.srp = restore_u32(); + regs.itt0 = restore_u32 (); + regs.itt1 = restore_u32 (); + regs.dtt0 = restore_u32 (); + regs.dtt1 = restore_u32 (); + regs.tcr = restore_u32 (); + regs.urp = restore_u32 (); + regs.srp = restore_u32 (); } if (model >= 68060) { - regs.buscr = restore_u32(); - regs.pcr = restore_u32(); + regs.buscr = restore_u32 (); + regs.pcr = restore_u32 (); } if (flags & 0x80000000) { - int khz = restore_u32(); - restore_u32(); + int khz = restore_u32 (); + restore_u32 (); if (khz > 0 && khz < 800000) currprefs.m68k_speed = changed_prefs.m68k_speed = 0; } @@ -2941,26 +2938,26 @@ uae_u8 *restore_cpu (uae_u8 *src) return src; } -void restore_cpu_finish(void) +void restore_cpu_finish (void) { init_m68k (); m68k_setpc (®s, regs.pc); - set_cpu_caches(); + set_cpu_caches (); } uae_u8 *save_cpu (int *len, uae_u8 *dstptr) { - uae_u8 *dstbak,*dst; + uae_u8 *dstbak, *dst; int model, i, khz; if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = (uae_u8*)malloc(1000); + dstbak = dst = (uae_u8*)malloc (1000); model = currprefs.cpu_model; save_u32 (model); /* MODEL */ save_u32 (0x80000000 | (currprefs.address_space_24 ? 1 : 0)); /* FLAGS */ - for(i = 0;i < 15; i++) + for (i = 0;i < 15; i++) save_u32 (regs.regs[i]); /* D0-D7 A0-A6 */ save_u32 (m68k_getpc (®s)); /* PC */ save_u16 (regs.irc); /* prefetch */ @@ -2970,17 +2967,17 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) save_u32 (regs.s ? regs.regs[15] : regs.isp); /* ISP */ save_u16 (regs.sr); /* SR/CCR */ save_u32 (regs.stopped ? CPUMODE_HALT : 0); /* flags */ - if(model >= 68010) { + if (model >= 68010) { save_u32 (regs.dfc); /* DFC */ save_u32 (regs.sfc); /* SFC */ save_u32 (regs.vbr); /* VBR */ } - if(model >= 68020) { + if (model >= 68020) { save_u32 (regs.caar); /* CAAR */ save_u32 (regs.cacr); /* CACR */ save_u32 (regs.msp); /* MSP */ } - if(model >= 68030) { + if (model >= 68030) { save_u64 (crp_030); /* CRP */ save_u64 (srp_030); /* SRP */ save_u32 (tt0_030); /* TT0/AC0 */ @@ -2988,7 +2985,7 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) save_u32 (tc_030); /* TCR */ save_u16 (mmusr_030); /* MMUSR/ACUSR */ } - if(model >= 68040) { + if (model >= 68040) { save_u32 (regs.itt0); /* ITT0 */ save_u32 (regs.itt1); /* ITT1 */ save_u32 (regs.dtt0); /* DTT0 */ @@ -2997,7 +2994,7 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) save_u32 (regs.urp); /* URP */ save_u32 (regs.srp); /* SRP */ } - if(model >= 68060) { + if (model >= 68060) { save_u32 (regs.buscr); /* BUSCR */ save_u32 (regs.pcr); /* PCR */ } @@ -3007,7 +3004,7 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr) if (currprefs.cpu_model >= 68020) khz *= 2; } - save_u32 (khz); // clock rate in KHz: -1 = fastest possible + save_u32 (khz); // clock rate in KHz: -1 = fastest possible save_u32 (0); // spare *len = dst - dstbak; return dstbak; @@ -3044,7 +3041,7 @@ void exception2 (uaecptr addr, uaecptr fault) set_special (®s, SPCFLAG_BRK); m68k_setpc (®s, 0xf80000); #ifdef JIT - set_special(®s, SPCFLAG_END_COMPILE); + set_special (®s, SPCFLAG_END_COMPILE); #endif fill_prefetch_slow (®s); } @@ -3056,18 +3053,18 @@ void cpureset (void) uae_u16 ins; if (currprefs.cpu_compatible || currprefs.cpu_cycle_exact) { - customreset (0); + customreset (0); return; } - pc = m68k_getpc(®s); + pc = m68k_getpc (®s); if (pc >= currprefs.chipmem_size) { - addrbank *b = &get_mem_bank(pc); - if (b->check(pc, 2 + 2)) { + addrbank *b = &get_mem_bank (pc); + if (b->check (pc, 2 + 2)) { /* We have memory, hope for the best.. */ customreset (0); return; } - write_log("M68K RESET PC=%x, rebooting..\n", pc); + write_log ("M68K RESET PC=%x, rebooting..\n", pc); customreset (0); m68k_setpc (®s, ksboot); return; @@ -3084,7 +3081,7 @@ void cpureset (void) m68k_setpc (®s, addr - 2); return; } - write_log("M68K RESET PC=%x, rebooting..\n", pc); + write_log ("M68K RESET PC=%x, rebooting..\n", pc); customreset (0); m68k_setpc (®s, ksboot); } @@ -3131,50 +3128,45 @@ void cpureset (void) // Unsigned division // -STATIC_INLINE int getDivu68kCycles_2(uae_u32 dividend, uae_u16 divisor) +STATIC_INLINE int getDivu68kCycles_2 (uae_u32 dividend, uae_u16 divisor) { - int mcycles; - uae_u32 hdivisor; - int i; + int mcycles; + uae_u32 hdivisor; + int i; - if(divisor == 0) - return 0; + if (divisor == 0) + return 0; - // Overflow - if((dividend >> 16) >= divisor) - return (mcycles = 5) * 2; + // Overflow + if ((dividend >> 16) >= divisor) + return (mcycles = 5) * 2; - mcycles = 38; - hdivisor = divisor << 16; + mcycles = 38; + hdivisor = divisor << 16; - for( i = 0; i < 15; i++) - { - uae_u32 temp; - temp = dividend; + for (i = 0; i < 15; i++) { + uae_u32 temp; + temp = dividend; - dividend <<= 1; + dividend <<= 1; - // If carry from shift - if((uae_s32)temp < 0) - { - dividend -= hdivisor; - } - else - { - mcycles += 2; - if(dividend >= hdivisor) - { - dividend -= hdivisor; - mcycles--; - } - } + // If carry from shift + if ((uae_s32)temp < 0) + dividend -= hdivisor; + else { + mcycles += 2; + if (dividend >= hdivisor) { + dividend -= hdivisor; + mcycles--; + } } - return mcycles * 2; + } + return mcycles * 2; } -int getDivu68kCycles(uae_u32 dividend, uae_u16 divisor) +int getDivu68kCycles (uae_u32 dividend, uae_u16 divisor) { - int v = getDivu68kCycles_2(dividend, divisor) - 4; -// write_log("U%d ", v); + int v = getDivu68kCycles_2 (dividend, divisor) - 4; +// write_log ("U%d ", v); return v; } @@ -3183,53 +3175,49 @@ int getDivu68kCycles(uae_u32 dividend, uae_u16 divisor) // Signed division // -STATIC_INLINE int getDivs68kCycles_2(uae_s32 dividend, uae_s16 divisor) +STATIC_INLINE int getDivs68kCycles_2 (uae_s32 dividend, uae_s16 divisor) { - int mcycles; - uae_u32 aquot; - int i; + int mcycles; + uae_u32 aquot; + int i; - if(divisor == 0) - return 0; + if (divisor == 0) + return 0; - mcycles = 6; + mcycles = 6; - if( dividend < 0) - mcycles++; + if (dividend < 0) + mcycles++; - // Check for absolute overflow - if(((uae_u32)abs(dividend) >> 16) >= (uae_u16)abs(divisor)) - { - return (mcycles + 2) * 2; - } + // Check for absolute overflow + if (((uae_u32)abs (dividend) >> 16) >= (uae_u16)abs (divisor)) + return (mcycles + 2) * 2; - // Absolute quotient - aquot = (uae_u32) abs(dividend) / (uae_u16)abs(divisor); + // Absolute quotient + aquot = (uae_u32) abs (dividend) / (uae_u16)abs (divisor); - mcycles += 55; + mcycles += 55; - if(divisor >= 0) - { - if(dividend >= 0) - mcycles--; - else - mcycles++; - } + if (divisor >= 0) { + if (dividend >= 0) + mcycles--; + else + mcycles++; + } - // Count 15 msbits in absolute of quotient + // Count 15 msbits in absolute of quotient - for( i = 0; i < 15; i++) - { - if((uae_s16)aquot >= 0) - mcycles++; - aquot <<= 1; - } + for (i = 0; i < 15; i++) { + if ((uae_s16)aquot >= 0) + mcycles++; + aquot <<= 1; + } - return mcycles * 2; + return mcycles * 2; } -int getDivs68kCycles(uae_s32 dividend, uae_s16 divisor) +int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor) { - int v = getDivs68kCycles_2(dividend, divisor) - 4; -// write_log("S%d ", v); + int v = getDivs68kCycles_2 (dividend, divisor) - 4; +// write_log ("S%d ", v); return v; } diff --git a/od-win32/7zplugin.c b/od-win32/7zplugin.c index 9610fad1..1e0b238a 100755 --- a/od-win32/7zplugin.c +++ b/od-win32/7zplugin.c @@ -74,12 +74,12 @@ int arcacc_init (void) { if (arcacc_mod) return 1; - arcacc_mod = LoadLibrary ("archiveaccess-debug.dll"); + arcacc_mod = LoadLibrary ("archiveaccess-debug.dll"); if (!arcacc_mod) return 0; - openArchive = (pOpenArchive) GetProcAddress (arcacc_mode, "openArchive"); + openArchive = (pOpenArchive) GetProcAddress (arcacc_mode, "openArchive"); getFileCount = (pGetFileCount) GetProcAddress (arcacc_mode, "getFileCount"); - getFileInfo = (pGetFileInfo) GetProcAddress (arcacc_mode, "getFileInfo"); + getFileInfo = (pGetFileInfo) GetProcAddress (arcacc_mode, "getFileInfo"); extract = (pExtract) GetProcAddress (arcacc_mode, "extract"); closeArchive = (pCloseArchive) GetProcAddress (arcacc_mode, "closeArchive"); if (!OpenArchive || !getFileCount || !getFileInfo || !extract || !closeArchive) { diff --git a/od-win32/ahidsound.c b/od-win32/ahidsound.c index b3e40260..5062245c 100755 --- a/od-win32/ahidsound.c +++ b/od-win32/ahidsound.c @@ -1,13 +1,13 @@ /* * UAE - The Un*x Amiga Emulator - * + * * Win32 interface * * Copyright 1997 Mathias Ortmann * Copyright 1997-2001 Brian King * Copyright 2000-2002 Bernd Roesch */ - + #define NATIVBUFFNUM 4 #define RECORDBUFFER 50 //survive 9 sec of blocking at 44100 @@ -49,7 +49,7 @@ static char *sndptrmax, soundneutral, sndptr; static LPSTR lpData,sndptrout; extern uae_u32 chipmem_mask; unsigned int *sndbufrecpt; -static char *ahisndbuffer,*sndrecbuffer; +static char *ahisndbuffer,*sndrecbuffer; static int ahisndbufsize,*ahisndbufpt,ahitweak;; int ahi_pollrate = 40; @@ -72,11 +72,11 @@ static LPDIRECTSOUNDCAPTURE lpDS2r = NULL; static LPDIRECTSOUNDCAPTUREBUFFER lpDSBprimary2r = NULL; static LPDIRECTSOUNDCAPTUREBUFFER lpDSB2r = NULL; -struct winuae //this struct is put in a6 if you call +struct winuae //this struct is put in a6 if you call //execute native function { HWND amigawnd; //adress of amiga Window Windows Handle - unsigned int changenum; //number to detect screen close/open + unsigned int changenum; //number to detect screen close/open unsigned int z3offset; //the offset to add to acsess Z3 mem from Dll side }; static struct winuae uaevar; @@ -90,27 +90,27 @@ static struct winuae *a6; #define CALL_NATIVE_FUNC2( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6,a7) if(native_func) return native_func( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6,a7,regs_ ) static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context) -{ +{ unsigned int espstore; - uae_u8* object_UAM = (uae_u8*) m68k_areg(&context->regs, 0); - uae_u32 d1 = m68k_dreg(&context->regs, 1); - uae_u32 d2 = m68k_dreg(&context->regs, 2); - uae_u32 d3 = m68k_dreg(&context->regs, 3); - uae_u32 d4 = m68k_dreg(&context->regs, 4); - uae_u32 d5 = m68k_dreg(&context->regs, 5); - uae_u32 d6 = m68k_dreg(&context->regs, 6); - uae_u32 d7 = m68k_dreg(&context->regs, 7); - uae_u32 a1 = m68k_areg(&context->regs, 1); - uae_u32 a2 = m68k_areg(&context->regs, 2); - uae_u32 a3 = m68k_areg(&context->regs, 3); - uae_u32 a4 = m68k_areg(&context->regs, 4); - uae_u32 a5 = m68k_areg(&context->regs, 5); - uae_u32 a7 = m68k_areg(&context->regs, 7); + uae_u8* object_UAM = (uae_u8*) m68k_areg (&context->regs, 0); + uae_u32 d1 = m68k_dreg (&context->regs, 1); + uae_u32 d2 = m68k_dreg (&context->regs, 2); + uae_u32 d3 = m68k_dreg (&context->regs, 3); + uae_u32 d4 = m68k_dreg (&context->regs, 4); + uae_u32 d5 = m68k_dreg (&context->regs, 5); + uae_u32 d6 = m68k_dreg (&context->regs, 6); + uae_u32 d7 = m68k_dreg (&context->regs, 7); + uae_u32 a1 = m68k_areg (&context->regs, 1); + uae_u32 a2 = m68k_areg (&context->regs, 2); + uae_u32 a3 = m68k_areg (&context->regs, 3); + uae_u32 a4 = m68k_areg (&context->regs, 4); + uae_u32 a5 = m68k_areg (&context->regs, 5); + uae_u32 a7 = m68k_areg (&context->regs, 7); uae_u32 regs_ = (uae_u32)&context->regs; CREATE_NATIVE_FUNC_PTR2; uaevar.z3offset = (uae_u32)(get_real_address (0x10000000) - 0x10000000); uaevar.amigawnd = hAmigaWnd; - a6 = &uaevar; + a6 = &uaevar; if(object_UAM) { SET_NATIVE_FUNC2(object_UAM); __asm @@ -135,7 +135,7 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context) } //CALL_NATIVE_FUNC2( d1, d2,d3, d4, d5, d6, d7, a1, a2, a3, a4 , a5 , a6 , a7); } else { - return 0; + return 0; } } @@ -144,7 +144,7 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context) void ahi_close_sound (void) { HRESULT hr = DS_OK; - + if (!ahi_on) return; ahi_on = 0; @@ -154,9 +154,9 @@ void ahi_close_sound (void) if (lpDSB2) { hr = IDirectSoundBuffer_Stop (lpDSB2); if(FAILED(hr)) - write_log( "AHI: SoundStop() failure: %s\n", DXError(hr)); + write_log ( "AHI: SoundStop() failure: %s\n", DXError(hr)); } else { - write_log( "AHI: Sound Stopped...\n" ); + write_log ( "AHI: Sound Stopped...\n" ); } if (lpDSB2) @@ -168,7 +168,7 @@ void ahi_close_sound (void) if (lpDS2) IDirectSound_Release (lpDS2); lpDS2 = NULL; - + if (lpDSB2r) IDirectSoundCaptureBuffer_Release (lpDSB2r); lpDSB2r = NULL; @@ -203,7 +203,7 @@ void ahi_updatesound(int force) if(hr != DSERR_BUFFERLOST) { pos -= ahitweak; if (pos < 0) - pos += ahisndbufsize; + pos += ahisndbufsize; if (pos >= ahisndbufsize) pos -= ahisndbufsize; pos = (pos / (amigablksize * 4)) * (amigablksize * 4); @@ -220,7 +220,7 @@ void ahi_updatesound(int force) hr = IDirectSoundBuffer_Lock(lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); if(hr == DSERR_BUFFERLOST) { - write_log("AHI: lostbuf %d %x\n", pos, amigablksize); + write_log ("AHI: lostbuf %d %x\n", pos, amigablksize); IDirectSoundBuffer_Restore(lpDSB2); hr = IDirectSoundBuffer_Lock(lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); } @@ -244,8 +244,8 @@ void ahi_updatesound(int force) sndptrmax = ahisndbuffer + ahisndbufsize; ahisndbufpt = (int*)ahisndbuffer; - - IDirectSoundBuffer_Unlock(lpDSB2, dwData1, dwBytes1, dwData2, dwBytes2); + + IDirectSoundBuffer_Unlock(lpDSB2, dwData1, dwBytes1, dwData2, dwBytes2); oldpos += amigablksize * 4; if (oldpos >= ahisndbufsize) @@ -274,7 +274,7 @@ static int ahi_init_record_win32 (void) // Record begin hr = DirectSoundCaptureCreate(NULL, &lpDS2r, NULL); if (FAILED(hr)) { - write_log( "AHI: DirectSoundCaptureCreate() failure: %s\n", DXError(hr)); + write_log ( "AHI: DirectSoundCaptureCreate() failure: %s\n", DXError(hr)); record_enabled = -1; return 0; } @@ -283,22 +283,22 @@ static int ahi_init_record_win32 (void) sound_buffer_rec.dwBufferBytes = amigablksize * 4 * RECORDBUFFER; sound_buffer_rec.lpwfxFormat = &wavfmt; sound_buffer_rec.dwFlags = 0 ; - + hr = IDirectSoundCapture_CreateCaptureBuffer(lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL); if (FAILED(hr)) { - write_log ("AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr)); - record_enabled = -1; + write_log ("AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr)); + record_enabled = -1; return 0; } hr = IDirectSoundCaptureBuffer_Start(lpDSB2r, DSCBSTART_LOOPING); if (FAILED(hr)) { - write_log("AHI: DirectSoundCaptureBuffer_Start failed: %s\n", DXError(hr)); + write_log ("AHI: DirectSoundCaptureBuffer_Start failed: %s\n", DXError(hr)); record_enabled = -1; return 0; } record_enabled = 1; - write_log("AHI: Init AHI Audio Recording \n"); + write_log ("AHI: Init AHI Audio Recording \n"); return 1; } @@ -309,7 +309,7 @@ void setvolume_ahi (LONG vol) return; hr = IDirectSoundBuffer_SetVolume (lpDSB2, vol); if (FAILED(hr)) - write_log ("AHI: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log ("AHI: SetVolume(%d) failed: %s\n", vol, DXError (hr)); } static int ahi_init_sound_win32 (void) @@ -317,7 +317,7 @@ static int ahi_init_sound_win32 (void) HRESULT hr; DSBUFFERDESC sound_buffer; DSCAPS DSCaps; - + if (lpDS2) return 0; @@ -337,7 +337,7 @@ static int ahi_init_sound_win32 (void) return 0; hr = DirectSoundCreate(&sound_device_guid[currprefs.win32_soundcard], &lpDS2, NULL); if (FAILED(hr)) { - write_log( "AHI: DirectSoundCreate() failure: %s\n", DXError(hr)); + write_log ( "AHI: DirectSoundCreate() failure: %s\n", DXError(hr)); return 0; } memset (&sound_buffer, 0, sizeof(DSBUFFERDESC)); @@ -350,18 +350,18 @@ static int ahi_init_sound_win32 (void) hr = IDirectSound_GetCaps(lpDS2, &DSCaps); if(SUCCEEDED(hr)) { if(DSCaps.dwFlags & DSCAPS_EMULDRIVER) - write_log( "AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n" ); + write_log ( "AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n" ); } if FAILED(IDirectSound_SetCooperativeLevel(lpDS2, hMainWnd, DSSCL_PRIORITY)) return 0; hr = IDirectSound_CreateSoundBuffer(lpDS2, &sound_buffer, &lpDSBprimary2, NULL); if(FAILED(hr)) { - write_log("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); + write_log ("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); return 0; } hr = IDirectSoundBuffer_SetFormat(lpDSBprimary2, &wavfmt); if(FAILED(hr)) { - write_log( "AHI: SetFormat() failure: %s\n", DXError(hr)); + write_log ( "AHI: SetFormat() failure: %s\n", DXError(hr)); return 0; } sound_buffer.dwBufferBytes = ahisndbufsize; @@ -371,7 +371,7 @@ static int ahi_init_sound_win32 (void) sound_buffer.guid3DAlgorithm = GUID_NULL; hr = IDirectSound_CreateSoundBuffer(lpDS2, &sound_buffer, &lpDSB2, NULL); if (FAILED(hr)) { - write_log("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); + write_log ("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); return 0; } @@ -379,21 +379,21 @@ static int ahi_init_sound_win32 (void) hr = IDirectSoundBuffer_GetFormat(lpDSBprimary2,&wavfmt,500,0); if(FAILED(hr)) { - write_log("AHI: GetFormat() failure: %s\n", DXError(hr)); + write_log ("AHI: GetFormat() failure: %s\n", DXError(hr)); return 0; } ahisndbufpt =(int*)ahisndbuffer; sndptrmax = ahisndbuffer + ahisndbufsize; memset(ahisndbuffer, soundneutral, amigablksize * 8); - write_log("AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n", - sound_freq_ahi, sound_channels_ahi, sound_bits_ahi, amigablksize); + write_log ("AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n", + sound_freq_ahi, sound_channels_ahi, sound_bits_ahi, amigablksize); ahi_on = 1; return sound_freq_ahi; } int ahi_open_sound (void) -{ +{ int rate; uaevar.changenum++; @@ -405,7 +405,7 @@ int ahi_open_sound (void) if ((rate = ahi_init_sound_win32 ())) return rate; return 0; -} +} static void *bswap_buffer = NULL; @@ -414,13 +414,13 @@ static double syncdivisor; uae_u32 REGPARAM2 ahi_demux (TrapContext *context) { -//use the extern int (6 #13) +//use the extern int (6 #13) // d0 0=opensound d1=unit d2=samplerate d3=blksize ret: sound frequency // d0 6=opensound_new d1=unit d2=samplerate d3=blksize ret d4=channels d5=bits d6=zero: sound frequency // d0 1=closesound d1=unit -// d0 2=writesamples d1=unit a0=addr write blksize samples to card +// d0 2=writesamples d1=unit a0=addr write blksize samples to card // d0 3=readsamples d1=unit a0=addr read samples from card ret: d0=samples read - // make sure you have from amigaside blksize*4 mem alloced + // make sure you have from amigaside blksize*4 mem alloced // d0=-1 no data available d0=-2 no recording open // d0 > 0 there are more blksize Data in the que // do the loop until d0 get 0 @@ -437,7 +437,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) // d0=12 write clipboard data a0=clipboarddata // d0=13 setp96mouserate d1=hz value // d0=100 open dll d1=dll name in windows name conventions -// d0=101 get dll function addr d1=dllhandle a0 function/var name +// d0=101 get dll function addr d1=dllhandle a0 function/var name // d0=102 exec dllcode a0=addr of function (see 101) // d0=103 close dll // d0=104 screenlost @@ -483,7 +483,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) int i; uaecptr addr = m68k_areg (&context->regs, 0); for (i = 0; i < amigablksize * 4; i += 4) - *ahisndbufpt++ = get_long(addr + i); + *ahisndbufpt++ = get_long (addr + i); ahi_finish_sound_buffer(); } return amigablksize; @@ -518,12 +518,12 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) if ((cap_pos + t) < (t * RECORDBUFFER)) cap_pos = cap_pos + t; else - cap_pos = 0; + cap_pos = 0; addr = m68k_areg (&context->regs, 0); sndbufrecpt = (unsigned int*)pos1; t /= 4; for (i = 0; i < t; i++) { - put_long(addr, *sndbufrecpt++); + put_long (addr, *sndbufrecpt++); addr += 4; } t *= 4; @@ -562,7 +562,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) { int i; for (i = 0; i < clipsize; i++) - put_byte(m68k_areg (&context->regs, 0) + i, clipdat[i]); + put_byte (m68k_areg (&context->regs, 0) + i, clipdat[i]); CloseClipboard(); } return 0; @@ -588,7 +588,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) GlobalUnlock (p); SetClipboardData (CF_TEXT,p2); } - } + } CloseClipboard (); } } @@ -628,7 +628,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) dllname = (char *) m68k_areg (&context->regs, 0); dllname = (char *)get_real_address ((uae_u32)dllname); result=(uae_u32) LoadLibrary(dllname); - write_log("%s windows dll/alib loaded at %d (0 mean failure)\n",dllname,result); + write_log ("%s windows dll/alib loaded at %d (0 mean failure)\n",dllname,result); syncdivisor = (3580000.0 * CYCLE_UNIT) / (double)syncbase; return result; } @@ -648,7 +648,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) uae_u32 ret; unsigned long rate1; double v; - rate1 = read_processor_time(); + rate1 = read_processor_time(); ret = emulib_ExecuteNativeCode2 (context); rate1 = read_processor_time() - rate1; v = syncdivisor * rate1; @@ -681,14 +681,14 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) #if defined(X86_MSVC_ASSEMBLY) case 105: //returns memory offset - return (uae_u32) get_real_address(0); + return (uae_u32) get_real_address (0); case 106: //byteswap 16bit vars //a0 = start address //d1 = number of 16bit vars //returns address of new array - src = m68k_areg(&context->regs, 0); - num_vars = m68k_dreg(&context->regs, 1); + src = m68k_areg (&context->regs, 0); + num_vars = m68k_dreg (&context->regs, 1); if (bswap_buffer_size < num_vars * 2) { bswap_buffer_size = (num_vars + 1024) * 2; @@ -750,8 +750,8 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) //a0 = start address //d1 = number of 32bit vars //returns address of new array - src = m68k_areg(&context->regs, 0); - num_vars = m68k_dreg(&context->regs, 1); + src = m68k_areg (&context->regs, 0); + num_vars = m68k_dreg (&context->regs, 1); if (bswap_buffer_size < num_vars * 4) { bswap_buffer_size = (num_vars + 16384) * 4; free(bswap_buffer); @@ -761,7 +761,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) mov esi, dword ptr [src] mov edi, dword ptr [bswap_buffer] mov ecx, num_vars - + mov ebx, ecx and ecx, 3 je BSWAP_DWORD_4X diff --git a/od-win32/avioutput.c b/od-win32/avioutput.c index c2de4f81..fc9c7208 100755 --- a/od-win32/avioutput.c +++ b/od-win32/avioutput.c @@ -1,8 +1,8 @@ /* UAE - The Ultimate Amiga Emulator - + avioutput.c - + Copyright(c) 2001 - 2002; §ane 2005-2006; Toni Wilen @@ -149,7 +149,7 @@ static UINT CALLBACK acmFilterChooseHookProc(HWND hwnd, UINT uMsg, WPARAM wParam { case FORMATCHOOSE_FORMATTAG_VERIFY: switch(lParam) // remove known error prone codecs - { + { case WAVE_FORMAT_ADPCM: // 0x0002 Microsoft Corporation case WAVE_FORMAT_IMA_ADPCM: // 0x0011 Intel Corporation case WAVE_FORMAT_GSM610: // 0x0031 Microsoft Corporation @@ -209,7 +209,7 @@ static int AVIOutput_AllocateAudio(void) wfxSrc.cbSize = 0; if(!(pwfxDst = (LPWAVEFORMATEX) malloc(wfxMaxFmtSize))) - return 0; + return 0; // set the initial destination format to match source memset(pwfxDst, 0, wfxMaxFmtSize); @@ -309,8 +309,8 @@ int AVIOutput_GetAudioCodec(char *name, int len) if (!AVIOutput_AllocateAudio()) return 0; if (AVIOutput_GetAudioFromRegistry(pwfxDst)) { - AVIOutput_GetAudioCodecName(pwfxDst, name, len); - return 1; + AVIOutput_GetAudioCodecName(pwfxDst, name, len); + return 1; } AVIOutput_ReleaseAudio(); return 0; @@ -320,7 +320,7 @@ int AVIOutput_ChooseAudioCodec(HWND hwnd, char *s, int len) { AVIOutput_End(); if (!AVIOutput_AllocateAudio()) - return 0; + return 0; acmopt.hwndOwner = hwnd; acmopt.pfnHook = acmFilterChooseHookProc; @@ -339,32 +339,32 @@ int AVIOutput_ChooseAudioCodec(HWND hwnd, char *s, int len) } return 1; } - + case ACMERR_CANCELED: AVIOutput_GetAudioFromRegistry(NULL); AVIOutput_ReleaseAudio(); break; - + case ACMERR_NOTPOSSIBLE: MessageBox(hwnd, "The buffer identified by the pwfx member of the ACMFORMATCHOOSE structure is too small to contain the selected format.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; - + case MMSYSERR_INVALFLAG: MessageBox(hwnd, "At least one flag is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; - + case MMSYSERR_INVALHANDLE: MessageBox(hwnd, "The specified handle is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; - + case MMSYSERR_INVALPARAM: MessageBox(hwnd, "At least one parameter is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; - + case MMSYSERR_NODRIVER: MessageBox(hwnd, "A suitable driver is not available to provide valid format selections.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; - + default: MessageBox(hwnd, "acmFormatChoose() FAILED", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; @@ -388,11 +388,11 @@ static int AVIOutput_AllocateVideo(void) if (!avioutput_width || !avioutput_height || !avioutput_bits) { avioutput_width = workprefs.gfx_size.width; avioutput_height = workprefs.gfx_size.height; - avioutput_bits = 24; + avioutput_bits = 24; } if(!(lpbi = (LPBITMAPINFOHEADER) malloc(sizeof(BITMAPINFOHEADER) + (((avioutput_bits <= 8) ? 1 << avioutput_bits : 0) * sizeof(RGBQUAD))))) - return 0; + return 0; lpbi->biSize = sizeof(BITMAPINFOHEADER); lpbi->biWidth = avioutput_width; @@ -438,7 +438,7 @@ static int AVIOutput_GetCOMPVARSFromRegistry(COMPVARS *pcv) pcv->cbState = 0; if (RegQueryValueEx(avikey, "VideoConfigurationState", 0, NULL, NULL, &ss) == ERROR_SUCCESS) { if (ss > 0) { - LPBYTE state = xmalloc (ss); + LPBYTE state = xmalloc (ss); if (RegQueryValueEx(avikey, "VideoConfigurationState", 0, NULL, state, &ss) == ERROR_SUCCESS) { pcv->hic = ICOpen(pcv->fccType, pcv->fccHandler, ICMODE_COMPRESS); if (pcv->hic) { @@ -446,7 +446,7 @@ static int AVIOutput_GetCOMPVARSFromRegistry(COMPVARS *pcv) ICSetState(pcv->hic, state, ss); } } - xfree (state); + xfree (state); } else { ok = 1; } @@ -471,7 +471,7 @@ static int AVIOutput_GetVideoCodecName(COMPVARS *pcv, char *name, int len) return 1; } if(ICGetInfo(pcv->hic, &icinfo, sizeof(ICINFO)) != 0) { - if(WideCharToMultiByte(CP_ACP, 0, icinfo.szDescription, -1, name, len, NULL, NULL) != 0) + if(WideCharToMultiByte(CP_ACP, 0, icinfo.szDescription, -1, name, len, NULL, NULL) != 0) return 1; } return 0; @@ -485,8 +485,8 @@ int AVIOutput_GetVideoCodec(char *name, int len) return 0; AVIOutput_FreeCOMPVARS(pcompvars); if (AVIOutput_GetCOMPVARSFromRegistry(pcompvars)) { - AVIOutput_GetVideoCodecName(pcompvars, name, len); - return 1; + AVIOutput_GetVideoCodecName(pcompvars, name, len); + return 1; } AVIOutput_ReleaseVideo(); return 0; @@ -496,7 +496,7 @@ int AVIOutput_ChooseVideoCodec(HWND hwnd, char *s, int len) { AVIOutput_End(); if (!AVIOutput_AllocateVideo()) - return 0; + return 0; AVIOutput_FreeCOMPVARS(pcompvars); // we really should check first to see if the user has a particular compressor installed before we set one @@ -542,7 +542,7 @@ int AVIOutput_ChooseVideoCodec(HWND hwnd, char *s, int len) return AVIOutput_GetVideoCodecName(pcompvars, s, len); } else { AVIOutput_GetCOMPVARSFromRegistry(NULL); - AVIOutput_ReleaseVideo(); + AVIOutput_ReleaseVideo(); return 0; } } @@ -558,7 +558,7 @@ static void checkAVIsize (int force) return; strcpy (fn, avioutput_filename_tmp); sprintf (avioutput_filename, "%s_%d.avi", fn, tmp_partcnt); - write_log("AVI split %d at %d bytes, %d frames\n", + write_log ("AVI split %d at %d bytes, %d frames\n", tmp_partcnt, total_avi_size, frame_count); AVIOutput_End (); first_frame = 0; @@ -639,7 +639,7 @@ static void AVIOuput_AVIWriteAudio (uae_u8 *sndbuffer, int sndbufsize) total_avi_size += written; acmStreamUnprepareHeader(has, &ash, 0); - + if(lpAudio) { free(lpAudio); lpAudio = NULL; @@ -801,7 +801,7 @@ void AVIOutput_WriteVideo(void) goto error; } } - + if((err = AVIStreamWrite(AVIVideoStream, frame_count, 1, lpVideo, lpbi->biSizeImage, 0, NULL, &written)) != 0) { gui_message("AVIStreamWrite() FAILED (%X)\n", err); @@ -915,9 +915,9 @@ void AVIOutput_End(void) partcnt = 0; if (wavfile) { - writewavheader (ftell (wavfile)); - fclose (wavfile); - wavfile = 0; + writewavheader (ftell (wavfile)); + fclose (wavfile); + wavfile = 0; } LeaveCriticalSection(&AVIOutput_CriticalSection); @@ -930,30 +930,30 @@ void AVIOutput_Begin(void) char *ext1, *ext2; if (avioutput_enabled) { - if (!avioutput_requested) + if (!avioutput_requested) AVIOutput_End (); return; } if (!avioutput_requested) - return; + return; changed_prefs.sound_auto = currprefs.sound_auto = 0; reset_sound (); if (avioutput_audio == AVIAUDIO_WAV) { - ext1 = ".wav"; ext2 = ".avi"; + ext1 = ".wav"; ext2 = ".avi"; } else { - ext1 = ".avi"; ext2 = ".wav"; + ext1 = ".avi"; ext2 = ".wav"; } if (strlen (avioutput_filename) >= 4 && !strcmpi (avioutput_filename + strlen (avioutput_filename) - 4, ext2)) - avioutput_filename[strlen (avioutput_filename) - 4] = 0; + avioutput_filename[strlen (avioutput_filename) - 4] = 0; if (strlen (avioutput_filename) >= 4 && strcmpi (avioutput_filename + strlen (avioutput_filename) - 4, ext1)) - strcat (avioutput_filename, ext1); + strcat (avioutput_filename, ext1); strcpy (avioutput_filename_tmp, avioutput_filename); i = strlen (avioutput_filename_tmp) - 1; while (i > 0 && avioutput_filename_tmp[i] != '.') i--; if (i > 0) - avioutput_filename_tmp[i] = 0; + avioutput_filename_tmp[i] = 0; avioutput_needs_restart = 0; avioutput_enabled = avioutput_audio || avioutput_video; @@ -965,8 +965,8 @@ void AVIOutput_Begin(void) DeleteFile(avioutput_filename); if (avioutput_audio == AVIAUDIO_WAV) { - wavfile = fopen (avioutput_filename, "wb"); - if (!wavfile) { + wavfile = fopen (avioutput_filename, "wb"); + if (!wavfile) { gui_message("Failed to open wave-file\n\nThis can happen if the path and or file name was entered incorrectly.\n"); goto error; } @@ -974,12 +974,12 @@ void AVIOutput_Begin(void) write_log ("wave-output to '%s' started\n", avioutput_filename); return; } - + if(((err = AVIFileOpen(&pfile, avioutput_filename, OF_CREATE | OF_WRITE, NULL)) != 0)) { gui_message("AVIFileOpen() FAILED (Error %X)\n\nThis can happen if the path and or file name was entered incorrectly.\nRequired *.avi extension.\n", err); goto error; } - + if(avioutput_audio) { if (!AVIOutput_AllocateAudio()) goto error; @@ -1093,7 +1093,7 @@ error: void AVIOutput_Release(void) { AVIOutput_End(); - + AVIOutput_ReleaseAudio(); AVIOutput_ReleaseVideo(); @@ -1117,7 +1117,7 @@ void AVIOutput_Initialize(void) pcompvars = (PCOMPVARS) malloc(sizeof(COMPVARS)); if (!pcompvars) - return; + return; memset(pcompvars, 0, sizeof(COMPVARS)); pcompvars->cbSize = sizeof(COMPVARS); @@ -1158,12 +1158,12 @@ void frame_drawn(void) skipsample += idiff / 10; if (skipsample > 4) skipsample = 4; - write_log("%d ", skipsample); + write_log ("%d ", skipsample); } sound_setadjust (0.0); #if 0 - write_log("%d ", idiff); + write_log ("%d ", idiff); diff = idiff / 20.0; skipmode = pow (diff < 0 ? -diff : diff, EXP); if (idiff < 0) @@ -1172,12 +1172,12 @@ void frame_drawn(void) skipmode = -ADJUST_SIZE; if (skipmode > ADJUST_SIZE) skipmode = ADJUST_SIZE; - write_log("%d/%.2f\n", idiff, skipmode); + write_log ("%d/%.2f\n", idiff, skipmode); sound_setadjust (skipmode); if (0 && !(frame_count % avioutput_fps)) - write_log("AVIOutput: diff=%.2f skip=%.2f (%d-%d=%d)\n", diff, skipmode, + write_log ("AVIOutput: diff=%.2f skip=%.2f (%d-%d=%d)\n", diff, skipmode, StreamSizeAudio, StreamSizeAudioExpected, idiff); #endif } diff --git a/od-win32/avioutput.h b/od-win32/avioutput.h index 693cbead..d764d54e 100755 --- a/od-win32/avioutput.h +++ b/od-win32/avioutput.h @@ -1,8 +1,8 @@ /* UAE - The Ultimate Amiga Emulator - + avioutput.h - + Copyright(c) 2001 - 2002 §ane */ diff --git a/od-win32/blkdev_win32_aspi.c b/od-win32/blkdev_win32_aspi.c index b762eb58..0fa60c3e 100755 --- a/od-win32/blkdev_win32_aspi.c +++ b/od-win32/blkdev_win32_aspi.c @@ -62,7 +62,7 @@ static int getversion(const char *name, VS_FIXEDFILEINFO *ver) if(vsFileInfo) { memcpy (ver, vsFileInfo, sizeof (*ver)); ok = TRUE; - write_log("%s version %d.%d.%d.%d\n", name, + write_log ("%s version %d.%d.%d.%d\n", name, vsFileInfo->dwFileVersionMS >> 16, vsFileInfo->dwFileVersionMS & 0xffff, vsFileInfo->dwFileVersionLS >> 16, @@ -92,13 +92,13 @@ const char *get_aspi_path(int aspitype) if (frog < 0) return NULL; frog = -1; - if (getversion(path_frog, &ver)) + if (getversion(path_frog, &ver)) frog = 1; return path_frog; case 1: // Nero { - HKEY key; + HKEY key; DWORD type = REG_SZ; DWORD size = sizeof (path_nero); if (nero > 0) @@ -120,7 +120,7 @@ const char *get_aspi_path(int aspitype) } return NULL; } - RegCloseKey (key); + RegCloseKey (key); } } return NULL; @@ -350,7 +350,7 @@ err: struct scg_local { int dummy; }; -#define scglocal(p) ((struct scg_local *)((p)->local)) +#define scglocal(p) ((struct scg_local *)((p)->local)) static SCSI *openscsi (int busno, int tgt, int tlun) { @@ -457,7 +457,7 @@ static void set_error(SRB_ExecSCSICmd *cp, struct scg_cmd *sp) case SS_MISMATCHED_COMPONENTS: /* 0xE7 The DLLs/EXEs of ASPI don't */ /* version check */ case SS_NO_ADAPTERS: /* 0xE8 No host adapters to manager */ - + case SS_ASPI_IS_SHUTDOWN: /* 0xEA Call came to ASPI after */ /* PROCESS_DETACH */ case SS_BAD_INSTALL: /* 0xEB The DLL or other components */ @@ -567,7 +567,7 @@ static int scsicmd(SCSI *scgp) s.SRB_CDBLen = sp->cdb_len; /* SCSI command length */ s.SRB_PostProc = Event; /* Post proc event */ s.SRB_SenseLen = SENSE_LEN; /* Lenght of sense buffer */ - + /* * Do we receive data from this ASPI command? */ @@ -698,7 +698,7 @@ static void scan_scsi_bus (SCSI *scgp, int flags) cis->isatapi = 1; } else write_log (",SCSI"); - write_log("]"); + write_log ("]"); if (use) { unitcnt++; cis->buf = malloc (DEVICE_SCSI_BUFSIZE); @@ -818,12 +818,12 @@ static int mediacheck_full (int unitnum, struct device_info *di) return 0; ok = execscsicmd_in(unitnum, cmd1, sizeof cmd1, &outlen) ? 1 : 0; if (ok) { - di->bytespersector = (p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7]; + di->bytespersector = (p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7]; di->cylinders = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; } if (di->type == INQ_DASD) { - uae_u8 cmd2[10] = { 0x5a,0x08,0,0,0,0,0,0,0x10,0 }; /* MODE SENSE */ - ok = execscsicmd_in(unitnum, cmd2, sizeof cmd2, &outlen) ? 1 : 0; + uae_u8 cmd2[10] = { 0x5a,0x08,0,0,0,0,0,0,0x10,0 }; /* MODE SENSE */ + ok = execscsicmd_in(unitnum, cmd2, sizeof cmd2, &outlen) ? 1 : 0; if (ok) { di->write_protected = (p[3]& 0x80) ? 1 : 0; } diff --git a/od-win32/blkdev_win32_ioctl.c b/od-win32/blkdev_win32_ioctl.c index 5c38ccdf..38586ceb 100755 --- a/od-win32/blkdev_win32_ioctl.c +++ b/od-win32/blkdev_win32_ioctl.c @@ -62,7 +62,7 @@ static void mcierr(char *str, DWORD err) if (err == MMSYSERR_NOERROR) return; if (mciGetErrorString(err, es, sizeof es)) - write_log("MCIErr: %s: %d = '%s'\n", str, err, es); + write_log ("MCIErr: %s: %d = '%s'\n", str, err, es); } static int win32_error (int unitnum, const char *format,...) @@ -96,10 +96,10 @@ static int close_createfile(int unitnum) if (ciw->h != INVALID_HANDLE_VALUE) { if (log_scsi) - write_log("IOCTL: IOCTL close\n"); + write_log ("IOCTL: IOCTL close\n"); CloseHandle(ciw->h); if (log_scsi) - write_log("IOCTL: IOCTL close completed\n"); + write_log ("IOCTL: IOCTL close completed\n"); ciw->h = INVALID_HANDLE_VALUE; return 1; } @@ -114,12 +114,12 @@ static int close_mci(int unitnum) ciw->playend = -1; if (ciw->mciid > 0) { if (log_scsi) - write_log("IOCTL: MCI close\n"); + write_log ("IOCTL: MCI close\n"); mcierr("MCI_STOP", mciSendCommand(ciw->mciid, MCI_STOP, MCI_WAIT, (DWORD_PTR)&gp)); mcierr("MCI_CLOSE", mciSendCommand(ciw->mciid, MCI_CLOSE, MCI_WAIT, (DWORD_PTR)&gp)); if (log_scsi) - write_log("IOCTL: MCI close completed\n"); - ciw->mciid = 0; + write_log ("IOCTL: MCI close completed\n"); + ciw->mciid = 0; return 1; } return 0; @@ -136,7 +136,7 @@ static int open_createfile(int unitnum) return 1; closed = close_mci(unitnum); if (log_scsi) - write_log("IOCTL: opening IOCTL %s\n", ciw->devname); + write_log ("IOCTL: opening IOCTL %s\n", ciw->devname); for (;;) { flags = GENERIC_READ; ciw->h = CreateFile(ciw->devname, flags, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -155,7 +155,7 @@ static int open_createfile(int unitnum) } } if (closed) - write_log("IOCTL: failed to re-open '%s', err=%d\n", ciw->devname, GetLastError()); + write_log ("IOCTL: failed to re-open '%s', err=%d\n", ciw->devname, GetLastError()); return 0; } } @@ -163,7 +163,7 @@ static int open_createfile(int unitnum) break; } if (log_scsi) - write_log("IOCTL: IOCTL open completed\n"); + write_log ("IOCTL: IOCTL open completed\n"); return 1; } @@ -181,7 +181,7 @@ static int open_mci(int unitnum) ciw->playend = -1; closed = close_createfile(unitnum); if (log_scsi) - write_log("IOCTL: MCI opening %c:\n", ciw->drvletter); + write_log ("IOCTL: MCI opening %c:\n", ciw->drvletter); memset (&mciOpen, 0, sizeof(mciOpen)); mciOpen.lpstrDeviceType = (LPSTR)MCI_DEVTYPE_CD_AUDIO; sprintf(elname,"%c:", ciw->drvletter); @@ -197,7 +197,7 @@ static int open_mci(int unitnum) return 0; } if (log_scsi) - write_log("IOCTL: MCI open completed\n"); + write_log ("IOCTL: MCI open completed\n"); return 1; } @@ -208,7 +208,7 @@ static int ioctl_command_pause (int unitnum, int paused) if (ciw->mciid > 0) { - MCI_GENERIC_PARMS gp = { 0 }; + MCI_GENERIC_PARMS gp = { 0 }; if (paused) mcierr("MCI_PAUSE", mciSendCommand(ciw->mciid, MCI_PAUSE, MCI_WAIT, (DWORD_PTR)&gp)); else @@ -242,7 +242,7 @@ static int ioctl_command_stop (int unitnum) if (ciw->mciid > 0) { - MCI_GENERIC_PARMS gp = { 0 }; + MCI_GENERIC_PARMS gp = { 0 }; mcierr("MCI_STOP", mciSendCommand(ciw->mciid, MCI_STOP, MCI_WAIT, (DWORD_PTR)&gp)); ciw->playend = -1; @@ -295,15 +295,15 @@ static int ioctl_command_play (int unitnum, uae_u32 start, uae_u32 end, int scan { VOLUME_CONTROL vc; if (!DeviceIoControl(ciw32[unitnum].h, IOCTL_CDROM_GET_VOLUME, NULL, 0, &vc, sizeof(vc), &len, NULL)) - write_log("IOCTL_CDROM_GET_VOLUME %d\n", GetLastError()); + write_log ("IOCTL_CDROM_GET_VOLUME %d\n", GetLastError()); vc.PortVolume[0] = 0xff; vc.PortVolume[1] = 0xff; vc.PortVolume[2] = 0xff; vc.PortVolume[3] = 0xff; if (!DeviceIoControl(ciw32[unitnum].h, IOCTL_CDROM_SET_VOLUME, &vc, sizeof(vc), NULL, 0, &len, NULL)) - write_log("IOCTL_CDROM_SET_VOLUME %d\n", GetLastError()); + write_log ("IOCTL_CDROM_SET_VOLUME %d\n", GetLastError()); } -#endif +#endif while (cnt-- > 0) { pa.StartingM = start >> 16; @@ -351,8 +351,8 @@ static uae_u8 *ioctl_command_qcode (int unitnum) if (ciw->mciid > 0) { - static uae_u8 buf[4 + 12]; - MCI_STATUS_PARMS mciStatusParms; + static uae_u8 buf[4 + 12]; + MCI_STATUS_PARMS mciStatusParms; DWORD err, mode; uae_u8 *p; uae_u32 pos, pos2; @@ -361,19 +361,19 @@ static uae_u8 *ioctl_command_qcode (int unitnum) memset(buf, 0, sizeof buf); memset(&mciStatusParms, 0, sizeof mciStatusParms); mciStatusParms.dwItem = MCI_STATUS_MODE; - err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); + err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); if (err != MMSYSERR_NOERROR) return 0; mode = mciStatusParms.dwReturn; mciStatusParms.dwItem = MCI_STATUS_CURRENT_TRACK; - err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); + err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); if (err != MMSYSERR_NOERROR) return 0; trk = mciStatusParms.dwReturn - 1; if (trk < 0) trk = 0; mciStatusParms.dwItem = MCI_STATUS_POSITION; - err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); + err = mciSendCommand(ciw->mciid, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD)(LPVOID)&mciStatusParms); if (err != MMSYSERR_NOERROR) return 0; pos = (((mciStatusParms.dwReturn >> 16) & 0xff) << 0) | (((mciStatusParms.dwReturn >> 8) & 0xff) << 8) | (((mciStatusParms.dwReturn >> 0) & 0xff) << 16); @@ -455,7 +455,7 @@ static uae_u8 *ioctl_command_rawread_2 (int unitnum, int sector, int size) uae_u8 *p = ciw32[unitnum].tempbuffer; if (log_scsi) - write_log("rawread unit=%d sector=%d blocksize=%d tm=%d\n", unitnum, sector, size, tm[track_mode]); + write_log ("rawread unit=%d sector=%d blocksize=%d tm=%d\n", unitnum, sector, size, tm[track_mode]); if (!open_createfile(unitnum)) return 0; if (size != 2336 && size != 2352 && size != 2048) @@ -471,7 +471,7 @@ static uae_u8 *ioctl_command_rawread_2 (int unitnum, int sector, int size) p, IOCTL_DATA_BUFFER, &len, NULL)) { reseterrormode (unitnum); if (win32_error (unitnum, "IOCTL_CDROM_RAW_READ") < 0) - continue; + continue; return 0; } reseterrormode (unitnum); @@ -783,9 +783,9 @@ static int ioctl_ismedia (int unitnum, int quick) if (!unitcheck (unitnum)) return 0; if (quick) { - struct dev_info_ioctl *ciw = &ciw32[unitnum]; + struct dev_info_ioctl *ciw = &ciw32[unitnum]; return ciw->mediainserted; - } + } return ismedia(unitnum); } diff --git a/od-win32/blkdev_win32_spti.c b/od-win32/blkdev_win32_spti.c index 2399bb06..859cdad7 100755 --- a/od-win32/blkdev_win32_spti.c +++ b/od-win32/blkdev_win32_spti.c @@ -25,7 +25,7 @@ #include -#include +#include #include #include #include // Guid definition @@ -85,8 +85,8 @@ static int doscsi (int unitnum, SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER *swb, int * if (!status) { int lasterror = GetLastError(); *err = lasterror; - write_log("SCSI ERROR, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun); - write_log("Status = %d, Error code = %d, LastError=%d\n", status, swb->spt.ScsiStatus, lasterror); + write_log ("SCSI ERROR, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun); + write_log ("Status = %d, Error code = %d, LastError=%d\n", status, swb->spt.ScsiStatus, lasterror); scsi_log_before (swb->spt.Cdb, swb->spt.CdbLength, swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? swb->spt.DataBuffer : 0,swb->spt.DataTransferLength); } @@ -283,7 +283,7 @@ static int inquiry (int unitnum, int *type, uae_u8 *inquirydata, int *inqlen) *type = 0x1f; if (!p) { if (log_scsi) - write_log("SPTI: INQUIRY failed\n"); + write_log ("SPTI: INQUIRY failed\n"); return 0; } *inqlen = outlen > INQUIRY_SIZE ? INQUIRY_SIZE : outlen; @@ -293,8 +293,8 @@ static int inquiry (int unitnum, int *type, uae_u8 *inquirydata, int *inqlen) v = 1; memcpy (inquirydata, p, *inqlen); if (log_scsi) { - if (outlen >= INQUIRY_SIZE) - write_log("SPTI: INQUIRY: %02.2X%02.2X%02.2X %d '%-8.8s' '%-16.16s'\n", + if (outlen >= INQUIRY_SIZE) + write_log ("SPTI: INQUIRY: %02.2X%02.2X%02.2X %d '%-8.8s' '%-16.16s'\n", p[0], p[1], p[2], v, p + 8, p + 16); } return v; @@ -353,7 +353,7 @@ int open_scsi_device (int unitnum) dev = xmalloc (100); sprintf (dev, "\\\\.\\Scsi%d:", di->bus); } else { - dev = my_strdup(di->drvpath); + dev = my_strdup(di->drvpath); } if (!di->scsibuf) di->scsibuf = VirtualAlloc (NULL, DEVICE_SCSI_BUFSIZE, MEM_COMMIT, PAGE_READWRITE); @@ -364,7 +364,7 @@ int open_scsi_device (int unitnum) } else { uae_u8 inqdata[INQUIRY_SIZE + 1] = { 0 }; int inqlen; - dev_info[unitnum].isatapi = inquiry (unitnum, &dev_info[unitnum].type, inqdata, &inqlen); + dev_info[unitnum].isatapi = inquiry (unitnum, &dev_info[unitnum].type, inqdata, &inqlen); if (inqlen == 0) { write_log ("SPTI: inquiry failed unit %d ('%s':%d:%d:%d:%d)\n", unitnum, dev, di->bus, di->path, di->target, di->lun); @@ -385,7 +385,7 @@ int open_scsi_device (int unitnum) dev_info[unitnum].name = my_strdup (inqdata + 8); dev_info[unitnum].inquirydata = xmalloc (INQUIRY_SIZE); memcpy (dev_info[unitnum].inquirydata, inqdata, INQUIRY_SIZE); - xfree (dev); + xfree (dev); return 1; } xfree (dev); @@ -405,7 +405,7 @@ static int adddrive (char *drvpath, int bus, int pathid, int targetid, int lunid if (!strcmp(drvpath, di->drvpath)) return 0; } - write_log("SPTI: unit %d '%s' added\n", total_devices, drvpath); + write_log ("SPTI: unit %d '%s' added\n", total_devices, drvpath); di = &dev_info[total_devices]; di->drvpath = my_strdup(drvpath); di->type = 0; @@ -418,7 +418,7 @@ static int adddrive (char *drvpath, int bus, int pathid, int targetid, int lunid if (open_scsi_device(cnt)) { for (i = 0; i < cnt; i++) { if (!memcmp(di->inquirydata, dev_info[i].inquirydata, INQUIRY_SIZE) && di->scanmode != dev_info[i].scanmode) { - write_log("duplicate device, skipped..\n"); + write_log ("duplicate device, skipped..\n"); break; } } @@ -495,7 +495,7 @@ static int getCDROMProperty(int idx, HDEVINFO DevInfo, const GUID *guid) DWORD status, errorCode; interfaceData.cbSize = sizeof (SP_INTERFACE_DEVICE_DATA); - status = SetupDiEnumDeviceInterfaces ( + status = SetupDiEnumDeviceInterfaces ( DevInfo, // Interface Device Info handle 0, // Device Info data guid, // Interface registered by driver @@ -565,8 +565,8 @@ static void scanscsi(void) idx = 0; for (;;) { - sprintf(DeviceName, "\\\\.\\Scsi%d:", idx++); - h = CreateFile (DeviceName, + sprintf(DeviceName, "\\\\.\\Scsi%d:", idx++); + h = CreateFile (DeviceName, GENERIC_READ | GENERIC_WRITE, 0, NULL, // no SECURITY_ATTRIBUTES structure @@ -584,13 +584,13 @@ static void scanscsi(void) 0, &bytesTransferred, NULL)) { - write_log( "Rescan SCSI port %d failed [Error %d]\n", idx - 1, GetLastError()); + write_log ( "Rescan SCSI port %d failed [Error %d]\n", idx - 1, GetLastError()); CloseHandle(h); - continue; - } + continue; + } // Get the SCSI inquiry data for all devices for the given SCSI bus - status = DeviceIoControl( + status = DeviceIoControl( h, IOCTL_SCSI_GET_INQUIRY_DATA, NULL, @@ -616,7 +616,7 @@ static void scanscsi(void) Claimed = InquiryData->DeviceClaimed; write_log ("SCSI=%d Initiator=%d Path=%d Target=%d LUN=%d Claimed=%s Type=%d\n", idx - 1, - BusData->InitiatorBusId, InquiryData->PathId, InquiryData->TargetId, + BusData->InitiatorBusId, InquiryData->PathId, InquiryData->TargetId, InquiryData->Lun, Claimed ? "Yes" : "No ", type); if (Claimed == 0 && !luncheck) { luncheck = 1; @@ -673,9 +673,9 @@ static int rescan(void) } } if (currprefs.win32_uaescsimode == UAESCSI_SPTISCAN) { - write_log("SCSI adapter enumeration..\n"); + write_log ("SCSI adapter enumeration..\n"); scanscsi(); - write_log("SCSI adapter enumeration ends\n"); + write_log ("SCSI adapter enumeration ends\n"); } return 1; } diff --git a/od-win32/bsdsock.c b/od-win32/bsdsock.c index b4c49b29..0f133977 100755 --- a/od-win32/bsdsock.c +++ b/od-win32/bsdsock.c @@ -22,7 +22,7 @@ #include "memory.h" #include "custom.h" #include "events.h" -#include "newcpu.h" +#include "newcpu.h" #include "autoconf.h" #include "traps.h" #include "bsdsocket.h" @@ -154,7 +154,7 @@ static int mySockStartup(void) WIN32GUI_LoadUIString(IDS_WSOCK2NEEDED, szMessage, MAX_DPATH); gui_message(szMessage); } else - write_log("BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n", lasterror); + write_log ("BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n", lasterror); return 0; } @@ -165,14 +165,14 @@ static int mySockStartup(void) return 0; } else { - write_log("BSDSOCK: using %s\n", bsd->wsbData.szDescription); + write_log ("BSDSOCK: using %s\n", bsd->wsbData.szDescription); // make sure WSP/NSPStartup gets called from within the regular stack // (Windows 95/98 need this) if((dummy = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) != INVALID_SOCKET) { closesocket(dummy); result = 1; } else { - write_log("BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n", + write_log ("BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n", WSAGetLastError()); result = 0; } @@ -193,7 +193,7 @@ int init_socket_layer(void) if(bsd->hSockThread == NULL) { WNDCLASS wc; // Set up an invisible window and dummy wndproc - + InitializeCriticalSection(&bsd->SockThreadCS); bsd->hSockReq = CreateEvent(NULL, FALSE, FALSE, NULL); bsd->hSockReqHandled = CreateEvent(NULL, FALSE, FALSE, NULL); @@ -213,7 +213,7 @@ int init_socket_layer(void) "SocketFun", "WinUAE Socket Window", WS_POPUP, 0, 0, - 1, 1, + 1, 1, NULL, NULL, 0, NULL); bsd->hSockThread = THREAD(sock_thread, NULL); } @@ -280,14 +280,14 @@ void unlocksigqueue(void) int host_sbinit(TrapContext *context, SB) { sb->sockAbort = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP); - + if (sb->sockAbort == INVALID_SOCKET) return 0; if ((sb->hEvent = CreateEvent(NULL,FALSE,FALSE,NULL)) == NULL) return 0; sb->mtable = calloc(sb->dtablesize, sizeof(*sb->mtable)); - + return 1; } @@ -313,11 +313,11 @@ void host_sbcleanup(SB) if (sb->hEvent != NULL) CloseHandle(sb->hEvent); - + for (i = sb->dtablesize; i--; ) { if (sb->dtable[i] != INVALID_SOCKET) host_closesocketquick(sb->dtable[i]); - + if (sb->mtable[i]) bsd->asyncsb[(sb->mtable[i] - 0xb000) / 2] = NULL; } @@ -349,7 +349,7 @@ static void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam) index = (msg - 0xb000) / 2; sb = bsd->asyncsb[index]; - + if (!(msg & 1)) { // is this one really for us? @@ -398,7 +398,7 @@ static void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam) if (sb->sb_errno >= 1001 && sb->sb_errno <= 1005) { bsdsocklib_setherrno(sb, sb->sb_errno - 1000); } else if (sb->sb_errno == 55) { // ENOBUFS - write_log("BSDSOCK: ERROR - Buffer overflow - %d bytes requested\n", + write_log ("BSDSOCK: ERROR - Buffer overflow - %d bytes requested\n", WSAGETASYNCBUFLEN(lParam)); } } else { @@ -407,7 +407,7 @@ static void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam) SETSIGNAL; } - + unlocksigqueue(); } @@ -436,15 +436,15 @@ static unsigned int allocasyncmsg(SB,uae_u32 sd,SOCKET s) unlocksigqueue(); bsdsocklib_seterrno(sb, 12); // ENOMEM - write_log("BSDSOCK: ERROR - Async operation completion table overflow\n"); - + write_log ("BSDSOCK: ERROR - Async operation completion table overflow\n"); + return 0; } static void cancelasyncmsg(TrapContext *context, unsigned int wMsg) { SB; - + wMsg = (wMsg-0xb000) / 2; sb = bsd->asyncsb[wMsg]; @@ -469,7 +469,7 @@ void setWSAAsyncSelect(SB, uae_u32 sd, SOCKET s, long lEvent ) long eventflags; int i; locksigqueue(); - + eventflags = sb->ftable[sd - 1] & REP_ALL; @@ -506,7 +506,7 @@ static void prepamigaaddr(struct sockaddr *realpt, int len) { // little endian address family value to the byte sin_family member ((char *)realpt)[1] = *((char *)realpt); - + // set size of address *((char *)realpt) = len; } @@ -597,8 +597,8 @@ uae_u32 host_bind(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) if (namelen <= sizeof buf) { if (!addr_valid("host_bind", name, namelen)) return 0; - memcpy(buf, get_real_address(name), namelen); - + memcpy(buf, get_real_address (name), namelen); + // some Amiga programs set this field to bogus values prephostaddr((SOCKADDR_IN *)buf); @@ -608,7 +608,7 @@ uae_u32 host_bind(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) } else TRACE(("OK\n")); } else - write_log("BSDSOCK: ERROR - Excessive namelen (%d) in bind()!\n", namelen); + write_log ("BSDSOCK: ERROR - Excessive namelen (%d) in bind()!\n", namelen); } return success; @@ -627,7 +627,7 @@ uae_u32 host_listen(SB, uae_u32 sd, uae_u32 backlog) if ((success = listen(s,backlog)) != 0) { SETERRNO; TRACE(("failed (%d)\n",sb->sb_errno)); - } else + } else TRACE(("OK\n")); } return success; @@ -641,29 +641,29 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam SOCKET s, s2; int success = 0; unsigned int wMsg; - + sd++; if (name != 0) { if (!addr_valid("host_accept1", name, sizeof(struct sockaddr)) || !addr_valid("host_accept2", namelen, 4)) return; - rp_nameuae = rp_name = (struct sockaddr *)get_real_address(name); - hlenuae = hlen = get_long(namelen); + rp_nameuae = rp_name = (struct sockaddr *)get_real_address (name); + hlenuae = hlen = get_long (namelen); if (hlenuae < sizeof(sockaddr)) { // Fix for CNET BBS Windows must have 16 Bytes (sizeof(sockaddr)) otherwise Error WSAEFAULT - rp_name = &sockaddr; + rp_name = &sockaddr; hlen = sizeof(sockaddr); } } else { - rp_name = &sockaddr; + rp_name = &sockaddr; hlen = sizeof(sockaddr); } TRACE(("accept(%d,%d,%d) -> ",sd,name,hlenuae)); s = (SOCKET)getsock(sb, (int)sd); - + if (s != INVALID_SOCKET) { BEGINBLOCKING; - + s2 = accept(s,rp_name,&hlen); if (s2 == INVALID_SOCKET) { @@ -684,7 +684,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam } else { setWSAAsyncSelect(sb,sd,s,0); } - + if (sb->eintr) { TRACE(("[interrupted]\n")); ENDBLOCKING; @@ -697,12 +697,12 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam SETERRNO; if (sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR) - write_log("BSDSOCK: ERRRO - accept() would block despite FD_ACCEPT message\n"); + write_log ("BSDSOCK: ERRRO - accept() would block despite FD_ACCEPT message\n"); } } } } - + if (s2 == INVALID_SOCKET) { sb->resultval = -1; TRACE(("failed (%d)\n",sb->sb_errno)); @@ -714,13 +714,13 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam if (hlen <= hlenuae) { // Fix for CNET BBS Part 2 prepamigaaddr(rp_name,hlen); if (namelen != 0) { - put_long(namelen,hlen); + put_long (namelen,hlen); } } else { // Copy only the number of bytes requested - if (hlenuae != 0) { + if (hlenuae != 0) { prepamigaaddr(rp_name,hlenuae); memcpy(rp_nameuae,rp_name,hlenuae); - put_long(namelen,hlenuae); + put_long (namelen,hlenuae); } } } @@ -822,7 +822,7 @@ static BOOL HandleStuff(void) break; case last_req: default: - write_log( "BSDSOCK: Invalid sock-thread request!\n" ); + write_log ( "BSDSOCK: Invalid sock-thread request!\n" ); handled = FALSE; break; } @@ -844,7 +844,7 @@ static LRESULT CALLBACK SocketWindowProc(HWND hwnd, UINT message, WPARAM wParam, { if(message >= 0xB000 && message < 0xB000 + MAXPENDINGASYNC * 2) { #if DEBUG_SOCKETS - write_log( "sockmsg(0x%x, 0x%x, 0x%x)\n", message, wParam, lParam ); + write_log ( "sockmsg(0x%x, 0x%x, 0x%x)\n", message, wParam, lParam ); #endif sockmsg(message, wParam, lParam); return 0; @@ -871,7 +871,7 @@ static unsigned int sock_thread2(void *blah) pri++; } SetThreadPriority(GetCurrentThread(), pri); - + while(TRUE) { if(bsd->hSockReq) { DWORD wait; @@ -891,7 +891,7 @@ static unsigned int sock_thread2(void *blah) } } } - write_log( "BSDSOCK: We have exited our sock_thread()\n" ); + write_log ( "BSDSOCK: We have exited our sock_thread()\n" ); THREADEND(result); return result; } @@ -919,7 +919,7 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na return; s = (SOCKET)getsock(sb,(int)sd); - + if (s != INVALID_SOCKET) { if (namelen <= MAXADDRLEN) { if (sb->mtable[sd-1] || (wMsg = allocasyncmsg(sb,sd,s)) != 0) { @@ -932,9 +932,9 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na BEGINBLOCKING; PREPARE_THREAD; - memcpy(buf, get_real_address(name), namelen); + memcpy(buf, get_real_address (name), namelen); prephostaddr((SOCKADDR_IN *)buf); - + sockreq.packet_type = connect_req; sockreq.s = s; sockreq.sb = sb; @@ -947,7 +947,7 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na if (sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR) { if (sb->ftable[sd-1] & SF_BLOCKING) { bsdsocklib_seterrno(sb, 0); - + WAITSIGNAL; if (sb->eintr) { @@ -973,7 +973,7 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na } } } else - write_log("BSDSOCK: WARNING - Excessive namelen (%d) in connect()!\n", namelen); + write_log ("BSDSOCK: WARNING - Excessive namelen (%d) in connect()!\n", namelen); } TRACE(("%d\n",sb->sb_errno)); } @@ -998,15 +998,15 @@ void host_sendto(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len, if (s != INVALID_SOCKET) { if (!addr_valid("host_sendto1", msg, 4)) return; - realpt = get_real_address(msg); - + realpt = get_real_address (msg); + if (to) { if (tolen > sizeof buf) { - write_log("BSDSOCK: WARNING - Target address in sendto() too large (%d)!\n", tolen); + write_log ("BSDSOCK: WARNING - Target address in sendto() too large (%d)!\n", tolen); } else { if (!addr_valid("host_sendto2", to, tolen)) return; - memcpy(buf, get_real_address(to), tolen); + memcpy(buf, get_real_address (to), tolen); // some Amiga software sets this field to bogus values prephostaddr((SOCKADDR_IN *)buf); } @@ -1043,7 +1043,7 @@ void host_sendto(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len, sb->ftable[sd-1]|= SF_RAW_RUDP; } } - + BEGINBLOCKING; for (;;) { @@ -1112,15 +1112,15 @@ void host_sendto(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len, } else { setWSAAsyncSelect(sb, sd, s, FD_WRITE); } - + WAITSIGNAL; - + if (sb->mtable[sd-1] == 0) { cancelasyncmsg(context, wMsg); } else { setWSAAsyncSelect(sb, sd, s, 0); } - + if (sb->eintr) { TRACE(("[interrupted]\n")); return; @@ -1153,7 +1153,7 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le #ifdef TRACING_ENABLED if (addr) - TRACE(("recvfrom(%d,0x%lx,%d,0x%lx,0x%lx,%d) -> ",sd,msg,len,flags,addr,get_long(addrlen))); + TRACE(("recvfrom(%d,0x%lx,%d,0x%lx,0x%lx,%d) -> ",sd,msg,len,flags,addr,get_long (addrlen))); else TRACE(("recv(%d,0x%lx,%d,0x%lx) -> ",sd,msg,len,flags)); #endif @@ -1163,15 +1163,15 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le if (s != INVALID_SOCKET) { if (!addr_valid("host_recvfrom1", msg, 4)) return; - realpt = get_real_address(msg); + realpt = get_real_address (msg); if (addr) { if (!addr_valid("host_recvfrom1", addrlen, 4)) return; - hlen = get_long(addrlen); + hlen = get_long (addrlen); if (!addr_valid("host_recvfrom2", addr, hlen)) return; - rp_addr = (struct sockaddr *)get_real_address(addr); + rp_addr = (struct sockaddr *)get_real_address (addr); } BEGINBLOCKING; @@ -1202,7 +1202,7 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le } WAITSIGNAL; - + if (sb->mtable[sd-1] == 0) { cancelasyncmsg(context, wMsg); } else { @@ -1220,12 +1220,12 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le } else break; } - + ENDBLOCKING; if (addr) { prepamigaaddr(rp_addr,hlen); - put_long(addrlen,hlen); + put_long (addrlen,hlen); } } else sb->resultval = -1; @@ -1242,7 +1242,7 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le uae_u32 host_shutdown(SB, uae_u32 sd, uae_u32 how) { SOCKET s; - + TRACE(("shutdown(%d,%d) -> ",sd,how)); sd++; s = getsock(sb,sd); @@ -1271,29 +1271,29 @@ void host_setsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 opt if (s != INVALID_SOCKET) { if (len > sizeof buf) { - write_log("BSDSOCK: WARNING - Excessive optlen in setsockopt() (%d)\n", len); + write_log ("BSDSOCK: WARNING - Excessive optlen in setsockopt() (%d)\n", len); len = sizeof buf; - } + } if (level == IPPROTO_IP && optname == 2) { // IP_HDRINCL emulated by icmp.dll sb->resultval = 0; return; } if (level == SOL_SOCKET && optname == SO_LINGER) { - ((LINGER *)buf)->l_onoff = get_long(optval); - ((LINGER *)buf)->l_linger = get_long(optval + 4); + ((LINGER *)buf)->l_onoff = get_long (optval); + ((LINGER *)buf)->l_linger = get_long (optval + 4); } else { if (len == 4) - *(long *)buf = get_long(optval); + *(long *)buf = get_long (optval); else if (len == 2) - *(short *)buf = get_word(optval); + *(short *)buf = get_word (optval); else - write_log("BSDSOCK: ERROR - Unknown optlen (%d) in setsockopt(%d,%d)\n", len, level, optname); + write_log ("BSDSOCK: ERROR - Unknown optlen (%d) in setsockopt(%d,%d)\n", len, level, optname); } // handle SO_EVENTMASK if (level == 0xffff && optname == 0x2001) { long wsbevents = 0; - uae_u32 eventflags = get_long(optval); + uae_u32 eventflags = get_long (optval); sb->ftable[sd-1] = (sb->ftable[sd-1] & ~REP_ALL) | (eventflags & REP_ALL); @@ -1309,7 +1309,7 @@ void host_setsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 opt wsbevents |= FD_WRITE; if (eventflags & REP_CLOSE) wsbevents |= FD_CLOSE; - + if (sb->mtable[sd-1] || (sb->mtable[sd-1] = allocasyncmsg(sb,sd,s))) { WSAAsyncSelect(s,hWndSelector ? hAmigaWnd : bsd->hSockWnd,sb->mtable[sd-1],wsbevents); sb->resultval = 0; @@ -1317,13 +1317,13 @@ void host_setsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 opt sb->resultval = -1; } else sb->resultval = setsockopt(s,level,optname,buf,len); - + if (!sb->resultval) { TRACE(("OK\n")); return; } else SETERRNO; - + TRACE(("failed (%d)\n",sb->sb_errno)); } } @@ -1337,22 +1337,22 @@ uae_u32 host_getsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 TRACE(("getsockopt(%d,%d,0x%lx,0x%lx,0x%lx) -> ",sd,(short)level,optname,optval,optlen)); sd++; s = getsock(sb,sd); - + if (s != INVALID_SOCKET) { if (!getsockopt(s,level,optname,buf,&len)) { if (level == SOL_SOCKET && optname == SO_LINGER) { - put_long(optval,((LINGER *)buf)->l_onoff); - put_long(optval+4,((LINGER *)buf)->l_linger); + put_long (optval,((LINGER *)buf)->l_onoff); + put_long (optval+4,((LINGER *)buf)->l_linger); } else { if (len == 4) - put_long(optval,*(long *)buf); + put_long (optval,*(long *)buf); else if (len == 2) - put_word(optval,*(short *)buf); + put_word (optval,*(short *)buf); else - write_log("BSDSOCK: ERROR - Unknown optlen (%d) in setsockopt(%d,%d)\n", len, level, optname); + write_log ("BSDSOCK: ERROR - Unknown optlen (%d) in setsockopt(%d,%d)\n", len, level, optname); } -// put_long(optlen,len); // some programs pass the actual length instead of a pointer to the length, so... +// put_long (optlen,len); // some programs pass the actual length instead of a pointer to the length, so... TRACE(("OK (%d,%d)\n",len,*(long *)buf)); return 0; } else { @@ -1373,27 +1373,27 @@ uae_u32 host_getsockname(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) sd++; if (!addr_valid("host_getsockname1", namelen, 4)) return -1; - len = get_long(namelen); - + len = get_long (namelen); + TRACE(("getsockname(%d,0x%lx,%d) -> ",sd,name,len)); - + s = getsock(sb,sd); - + if (s != INVALID_SOCKET) { if (!addr_valid("host_getsockname2", name, len)) return -1; - rp_name = (struct sockaddr *)get_real_address(name); - + rp_name = (struct sockaddr *)get_real_address (name); + if (getsockname(s,rp_name,&len)) { SETERRNO; TRACE(("failed (%d)\n",sb->sb_errno)); } else { TRACE(("%d\n",len)); prepamigaaddr(rp_name,len); - put_long(namelen,len); + put_long (namelen,len); return 0; } - } + } return -1; } @@ -1403,31 +1403,31 @@ uae_u32 host_getpeername(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) SOCKET s; int len; struct sockaddr *rp_name; - + sd++; if (!addr_valid("host_getpeername1", namelen, 4)) return -1; - len = get_long(namelen); - + len = get_long (namelen); + TRACE(("getpeername(%d,0x%lx,%d) -> ",sd,name,len)); - + s = getsock(sb,sd); - + if (s != INVALID_SOCKET) { if (!addr_valid("host_getpeername2", name, len)) return -1; - rp_name = (struct sockaddr *)get_real_address(name); - + rp_name = (struct sockaddr *)get_real_address (name); + if (getpeername(s,rp_name,&len)) { SETERRNO; TRACE(("failed (%d)\n",sb->sb_errno)); } else { TRACE(("%d\n",len)); prepamigaaddr(rp_name,len); - put_long(namelen,len); + put_long (namelen,len); return 0; } - } + } return -1; } @@ -1446,16 +1446,16 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, switch (request) { case FIOSETOWN: - sb->ownertask = get_long(arg); + sb->ownertask = get_long (arg); success = 0; break; case FIOGETOWN: - put_long(arg,sb->ownertask); + put_long (arg,sb->ownertask); success = 0; break; case FIONBIO: TRACE(("[FIONBIO] -> ")); - if (get_long(arg)) { + if (get_long (arg)) { TRACE(("nonblocking\n")); sb->ftable[sd-1] &= ~SF_BLOCKING; } else { @@ -1467,11 +1467,11 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, case FIONREAD: ioctlsocket(s,request,(u_long *)&data); TRACE(("[FIONREAD] -> %d\n",data)); - put_long(arg,data); + put_long (arg,data); success = 0; break; case FIOASYNC: - if (get_long(arg)) { + if (get_long (arg)) { sb->ftable[sd-1] |= REP_ALL; TRACE(("[FIOASYNC] -> enabled\n")); @@ -1483,17 +1483,17 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, } } else - write_log(("BSDSOCK: WARNING - FIOASYNC disabling unsupported.\n")); + write_log (("BSDSOCK: WARNING - FIOASYNC disabling unsupported.\n")); success = -1; break; default: - write_log("BSDSOCK: WARNING - Unknown IoctlSocket request: 0x%08lx\n", request); + write_log ("BSDSOCK: WARNING - Unknown IoctlSocket request: 0x%08lx\n", request); bsdsocklib_seterrno(sb, 22); // EINVAL break; } } - + return success; } @@ -1536,9 +1536,9 @@ int host_CloseSocket(TrapContext *context, SB, int sd) WSAAsyncSelect(s,hWndSelector ? hAmigaWnd : bsd->hSockWnd,wMsg,FD_CLOSE); WAITSIGNAL; - + cancelasyncmsg(context, wMsg); - + if (sb->eintr) { TRACE(("[interrupted]\n")); break; @@ -1551,7 +1551,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd) } TRACE(("failed (%d)\n",sb->sb_errno)); - + return -1; } @@ -1575,29 +1575,29 @@ static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, i } if (nfds > sb->dtablesize) { - write_log("BSDSOCK: ERROR - select()ing more sockets (%d) than socket descriptors available (%d)!\n", nfds, sb->dtablesize); + write_log ("BSDSOCK: ERROR - select()ing more sockets (%d) than socket descriptors available (%d)!\n", nfds, sb->dtablesize); nfds = sb->dtablesize; } for (j = 0; ; j += 32, fd_set_amiga += 4) { - currlong = get_long(fd_set_amiga); + currlong = get_long (fd_set_amiga); mask = 1; - + for (i = 0; i < 32; i++, mask <<= 1) { if (i+j > nfds) { fd_set_win->fd_array[fd_set_win->fd_count] = INVALID_SOCKET; return; } - + if (currlong & mask) { s = getsock(sb,j+i+1); - + if (s != INVALID_SOCKET) { fd_set_win->fd_array[fd_set_win->fd_count++] = s; if (fd_set_win->fd_count >= FD_SETSIZE) { - write_log("BSDSOCK: ERROR - select()ing more sockets (%d) than the hard-coded fd_set limit (%d) - please report\n", nfds, FD_SETSIZE); + write_log ("BSDSOCK: ERROR - select()ing more sockets (%d) than the hard-coded fd_set limit (%d) - please report\n", nfds, FD_SETSIZE); return; } } @@ -1616,7 +1616,7 @@ static void makesockbitfield(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win for (n = 0; n < nfds; n += 32) { val = 0; mask = 1; - + for (i = 0; i < 32; i++, mask <<= 1) { if ((currsock = getsock(sb, n+i+1)) != INVALID_SOCKET) { // Do not use sb->dtable directly because of Newsrog @@ -1628,7 +1628,7 @@ static void makesockbitfield(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win } } } - put_long(fd_set_amiga, val); + put_long (fd_set_amiga, val); fd_set_amiga += 4; } } @@ -1637,7 +1637,7 @@ static void fd_zero(uae_u32 fdset, uae_u32 nfds) { unsigned int i; for (i = 0; i < nfds; i += 32, fdset += 4) - put_long(fdset,0); + put_long (fdset,0); } // This seems to be the only way of implementing a cancelable WinSock2 select() call... sigh. @@ -1664,25 +1664,25 @@ static unsigned int thread_WaitSelect2(void *indexp) writefds = args->writefds; exceptfds = args->exceptfds; timeout = args->timeout; - + // construct descriptor tables makesocktable(sb, readfds, &readsocks, nfds, sb->sockAbort); if (writefds) makesocktable(sb, writefds, &writesocks, nfds, INVALID_SOCKET); if (exceptfds) makesocktable(sb, exceptfds, &exceptsocks, nfds, INVALID_SOCKET); - + if (timeout) { - tv.tv_sec = get_long(timeout); - tv.tv_usec = get_long(timeout+4); + tv.tv_sec = get_long (timeout); + tv.tv_usec = get_long (timeout+4); TRACE(("(timeout: %d.%06d) ",tv.tv_sec,tv.tv_usec)); } - + TRACE(("-> ")); - + sb->resultval = select(nfds+1, &readsocks, writefds ? &writesocks : NULL, exceptfds ? &exceptsocks : NULL, timeout ? &tv : 0); - if (sb->resultval == SOCKET_ERROR) { + if (sb->resultval == SOCKET_ERROR) { // select was stopped by sb->sockAbort if (readsocks.fd_count > 1) { makesocktable(sb, readfds, &readsocks, nfds, INVALID_SOCKET); @@ -1695,7 +1695,7 @@ static unsigned int thread_WaitSelect2(void *indexp) sb->resultval = SOCKET_ERROR; // Set old resultval } - } + } } } if (FD_ISSET(sb->sockAbort,&readsocks)) { @@ -1722,7 +1722,7 @@ static unsigned int thread_WaitSelect2(void *indexp) if (exceptfds) makesockbitfield(sb,exceptfds,&exceptsocks,nfds); } - + SETSIGNAL; bsd->threadargsw[index] = NULL; @@ -1748,7 +1748,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua int i; struct threadargsw taw; - wssigs = sigmp ? get_long(sigmp) : 0; + wssigs = sigmp ? get_long (sigmp) : 0; TRACE(("WaitSelect(%d,0x%lx,0x%lx,0x%lx,0x%lx,0x%lx) ", nfds, readfds, writefds, exceptfds, timeout, wssigs)); @@ -1759,13 +1759,13 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua return; } if (wssigs) { - m68k_dreg(&context->regs,0) = 0; - m68k_dreg(&context->regs,1) = wssigs; - sigs = CallLib(context, get_long(4),-0x132) & wssigs; // SetSignal() - + m68k_dreg (&context->regs,0) = 0; + m68k_dreg (&context->regs,1) = wssigs; + sigs = CallLib (context, get_long (4),-0x132) & wssigs; // SetSignal() + if (sigs) { TRACE(("-> [preempted by signals 0x%08lx]\n",sigs & wssigs)); - put_long(sigmp,sigs & wssigs); + put_long (sigmp,sigs & wssigs); // Check for zero address -> otherwise WinUAE crashes if (readfds) fd_zero(readfds,nfds); @@ -1781,11 +1781,11 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua if (nfds == 0) { // No sockets to check, only wait for signals if (wssigs != 0) { - m68k_dreg(&context->regs, 0) = wssigs; - sigs = CallLib(context, get_long(4),-0x13e); // Wait() - put_long(sigmp, sigs & wssigs); + m68k_dreg (&context->regs, 0) = wssigs; + sigs = CallLib (context, get_long (4),-0x13e); // Wait() + put_long (sigmp, sigs & wssigs); } - + if (readfds) fd_zero(readfds,nfds); if (writefds) @@ -1812,7 +1812,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua bsd->hThreads[i] = THREAD(thread_WaitSelect, &threadindextable[i]); if (bsd->hEvents[i] == NULL || bsd->hThreads[i] == NULL) { bsd->hThreads[i] = 0; - write_log("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", + write_log ("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", GetLastError()); bsdsocklib_seterrno(sb,12); // ENOMEM sb->resultval = -1; @@ -1824,9 +1824,9 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua } } } - + if (i >= MAX_SELECT_THREADS) - write_log("BSDSOCK: ERROR - Too many select()s\n"); + write_log ("BSDSOCK: ERROR - Too many select()s\n"); else { SOCKET newsock = INVALID_SOCKET; @@ -1841,8 +1841,8 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua SetEvent(bsd->hEvents[i]); - m68k_dreg(&context->regs, 0) = (((uae_u32)1) << sb->signal) | sb->eintrsigs | wssigs; - sigs = CallLib(context, get_long(4), -0x13e); // Wait() + m68k_dreg (&context->regs, 0) = (((uae_u32)1) << sb->signal) | sb->eintrsigs | wssigs; + sigs = CallLib (context, get_long (4), -0x13e); // Wait() /* if ((1<signal) & sigs) { // 2.3.2002/SR Fix for AmiFTP -> Thread is ready, no need to Abort @@ -1851,7 +1851,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua */ if (sb->needAbort) { if ((newsock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) == INVALID_SOCKET) - write_log("BSDSOCK: ERROR - Cannot create socket: %d\n", WSAGetLastError()); + write_log ("BSDSOCK: ERROR - Cannot create socket: %d\n", WSAGetLastError()); shutdown(sb->sockAbort,1); if (newsock != sb->sockAbort) { shutdown(sb->sockAbort, 1); @@ -1867,7 +1867,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua sb->sockAbort = newsock; if(sigmp) { - put_long(sigmp,sigs & wssigs); + put_long (sigmp,sigs & wssigs); if (sigs & sb->eintrsigs) { TRACE(("[interrupted]\n")); @@ -1902,7 +1902,7 @@ uae_u32 host_Inet_NtoA(TrapContext *context, SB, uae_u32 in) TRACE(("Inet_NtoA(%lx) -> ",in)); if ((addr = inet_ntoa(ina)) != NULL) { - scratchbuf = m68k_areg(&context->regs,6) + offsetof(struct UAEBSDBase,scratchbuf); + scratchbuf = m68k_areg (&context->regs,6) + offsetof(struct UAEBSDBase,scratchbuf); strncpyha(scratchbuf,addr,SCRATCHBUFSIZE); TRACE(("%s\n",addr)); return scratchbuf; @@ -1921,7 +1921,7 @@ uae_u32 host_inet_addr(uae_u32 cp) if (!addr_valid("host_inet_addr", cp, 4)) return 0; - cp_rp = get_real_address(cp); + cp_rp = get_real_address (cp); addr = htonl(inet_addr(cp_rp)); @@ -1982,7 +1982,7 @@ static unsigned int thread_get2(void *indexp) addrtype = args->args4; name_rp = ""; if (addr_valid("thread_get1", name, 1)) - name_rp = get_real_address(name); + name_rp = get_real_address (name); if (strchr(name_rp, '.') == 0 || CheckOnline(sb) == TRUE) { // Local Address or Internet Online ? @@ -1994,7 +1994,7 @@ static unsigned int thread_get2(void *indexp) if (bsd->threadGetargs_inuse[index] != -1) { // No CTRL-C Signal if (host == 0) { - // Error occured + // Error occured SETERRNO; TRACE(("failed (%d) - ", sb->sb_errno)); } else { @@ -2012,11 +2012,11 @@ static unsigned int thread_get2(void *indexp) name = args->args2; name_rp = ""; if (addr_valid("thread_get2", name, 1)) - name_rp = get_real_address(name); + name_rp = get_real_address (name); proto = getprotobyname (name_rp); if (bsd->threadGetargs_inuse[index] != -1) { // No CTRL-C Signal if (proto == 0) { - // Error occured + // Error occured SETERRNO; TRACE(("failed (%d) - ", sb->sb_errno)); } else { @@ -2037,23 +2037,23 @@ static unsigned int thread_get2(void *indexp) nameport = args->args2; proto = args->args3; type = args->args4; - + if (proto) { if (addr_valid("thread_get3", proto, 1)) - proto_rp = get_real_address(proto); + proto_rp = get_real_address (proto); } if (type) { serv = getservbyport(nameport, proto_rp); } else { if (addr_valid("thread_get4", nameport, 1)) - name_rp = get_real_address(nameport); + name_rp = get_real_address (nameport); serv = getservbyname(name_rp, proto_rp); } if (bsd->threadGetargs_inuse[index] != -1) { // No CTRL-C Signal if (serv == 0) { - // Error occured + // Error occured SETERRNO; TRACE(("failed (%d) - ", sb->sb_errno)); } else { @@ -2064,7 +2064,7 @@ static unsigned int thread_get2(void *indexp) } TRACE(("-> ")); - + if (bsd->threadGetargs_inuse[index] != -1) SETSIGNAL; @@ -2104,7 +2104,7 @@ static volatile struct threadargs *run_get_thread(TrapContext *context, SB, stru bsd->hGetThreads[i] = THREAD(thread_get, &threadindextable[i]); if (bsd->hGetEvents[i] == NULL || bsd->hGetThreads[i] == NULL) { bsd->hGetThreads[i] = NULL; - write_log("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", + write_log ("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", GetLastError()); bsdsocklib_seterrno(sb, 12); // ENOMEM sb->resultval = -1; @@ -2114,9 +2114,9 @@ static volatile struct threadargs *run_get_thread(TrapContext *context, SB, stru } } } - + if (i >= MAX_GET_THREADS) { - write_log("BSDSOCK: ERROR - Too many gethostbyname()s\n"); + write_log ("BSDSOCK: ERROR - Too many gethostbyname()s\n"); bsdsocklib_seterrno(sb, 12); // ENOMEM sb->resultval = -1; return 0; @@ -2128,7 +2128,7 @@ static volatile struct threadargs *run_get_thread(TrapContext *context, SB, stru } sb->eintr = 0; - while (bsd->threadGetargs_inuse[i] != 0 && sb->eintr == 0) { + while (bsd->threadGetargs_inuse[i] != 0 && sb->eintr == 0) { WAITSIGNAL; if (sb->eintr == 1) bsd->threadGetargs_inuse[i] = -1; @@ -2162,11 +2162,11 @@ void host_gethostbynameaddr(TrapContext *context, SB, uae_u32 name, uae_u32 name name_rp = ""; if (addr_valid("host_gethostbynameaddr", name, 1)) - name_rp = get_real_address(name); + name_rp = get_real_address (name); if (addrtype == -1) { TRACE(("gethostbyname(%s) -> ",name_rp)); - + // workaround for numeric host "names" if ((addr = inet_addr(name_rp)) != INADDR_NONE) { bsdsocklib_seterrno(sb,0); @@ -2177,7 +2177,7 @@ void host_gethostbynameaddr(TrapContext *context, SB, uae_u32 name, uae_u32 name ((HOSTENT *)buf)->h_addr_list = (char **)&addr_list; addr_list[0] = &addr; addr_list[1] = NULL; - + goto kludge; } } else { @@ -2198,7 +2198,7 @@ void host_gethostbynameaddr(TrapContext *context, SB, uae_u32 name, uae_u32 name if (!sb->sb_errno) { kludge: h = (HOSTENT *)buf; - + // compute total size of hostent size = 28; if (h->h_name != NULL) @@ -2220,30 +2220,30 @@ kludge: sb->hostent = uae_AllocMem(context, size, 0); if (!sb->hostent) { - write_log("BSDSOCK: WARNING - gethostby%s() ran out of Amiga memory " + write_log ("BSDSOCK: WARNING - gethostby%s() ran out of Amiga memory " "(couldn't allocate %ld bytes) while returning result of lookup for '%s'\n", addrtype == -1 ? "name" : "addr", size, name_rp); bsdsocklib_seterrno(sb, 12); // ENOMEM return; } - + sb->hostentsize = size; - + aptr = sb->hostent + 28 + numaliases * 4 + numaddr * 4; - + // transfer hostent to Amiga memory - put_long(sb->hostent + 4, sb->hostent + 20); - put_long(sb->hostent + 8, h->h_addrtype); - put_long(sb->hostent + 12, h->h_length); - put_long(sb->hostent + 16, sb->hostent + 24 + numaliases * 4); - + put_long (sb->hostent + 4, sb->hostent + 20); + put_long (sb->hostent + 8, h->h_addrtype); + put_long (sb->hostent + 12, h->h_length); + put_long (sb->hostent + 16, sb->hostent + 24 + numaliases * 4); + for (i = 0; i < numaliases; i++) - put_long(sb->hostent + 20 + i * 4, addstr(&aptr, h->h_aliases[i])); - put_long(sb->hostent + 20 + numaliases * 4, 0); + put_long (sb->hostent + 20 + i * 4, addstr(&aptr, h->h_aliases[i])); + put_long (sb->hostent + 20 + numaliases * 4, 0); for (i = 0; i < numaddr; i++) - put_long(sb->hostent + 24 + (numaliases + i) * 4, addmem(&aptr, h->h_addr_list[i], h->h_length)); - put_long(sb->hostent + 24 + numaliases * 4 + numaddr * 4, 0); - put_long(sb->hostent, aptr); + put_long (sb->hostent + 24 + (numaliases + i) * 4, addmem(&aptr, h->h_addr_list[i], h->h_length)); + put_long (sb->hostent + 24 + numaliases * 4 + numaddr * 4, 0); + put_long (sb->hostent, aptr); addstr(&aptr, h->h_name); TRACE(("OK (%s)\n", h->h_name)); @@ -2267,7 +2267,7 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) name_rp = ""; if (addr_valid("host_gethostbynameaddr", name, 1)) - name_rp = get_real_address(name); + name_rp = get_real_address (name); TRACE(("getprotobyname(%s) -> ",name_rp)); @@ -2299,7 +2299,7 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) sb->protoent = uae_AllocMem(context, size, 0); if (!sb->protoent) { - write_log("BSDSOCK: WARNING - getprotobyname() ran out of Amiga memory " + write_log ("BSDSOCK: WARNING - getprotobyname() ran out of Amiga memory " "(couldn't allocate %ld bytes) while returning result of lookup for '%s'\n", size, name_rp); bsdsocklib_seterrno(sb,12); // ENOMEM @@ -2307,17 +2307,17 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) } sb->protoentsize = size; - + aptr = sb->protoent+16+numaliases*4; - + // transfer protoent to Amiga memory - put_long(sb->protoent+4,sb->protoent+12); - put_long(sb->protoent+8,p->p_proto); - + put_long (sb->protoent+4,sb->protoent+12); + put_long (sb->protoent+8,p->p_proto); + for (i = 0; i < numaliases; i++) - put_long(sb->protoent + 12 + i * 4, addstr(&aptr, p->p_aliases[i])); - put_long(sb->protoent + 12 + numaliases * 4,0); - put_long(sb->protoent, aptr); + put_long (sb->protoent + 12 + i * 4, addstr(&aptr, p->p_aliases[i])); + put_long (sb->protoent + 12 + numaliases * 4,0); + put_long (sb->protoent, aptr); addstr(&aptr, p->p_name); TRACE(("OK (%s, %d)\n", p->p_name, p->p_proto)); bsdsocklib_seterrno(sb,0); @@ -2345,14 +2345,14 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 if (proto) { if (addr_valid("host_getservbynameport1", proto, 1)) - proto_rp = get_real_address(proto); + proto_rp = get_real_address (proto); } if (type) { TRACE(("getservbyport(%d,%s) -> ",nameport,proto_rp ? proto_rp : "NULL")); } else { if (addr_valid("host_getservbynameport2", nameport, 1)) - name_rp = get_real_address(nameport); + name_rp = get_real_address (nameport); TRACE(("getservbyname(%s,%s) -> ",name_rp,proto_rp ? proto_rp : "NULL")); } @@ -2389,25 +2389,25 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 sb->servent = uae_AllocMem(context, size, 0); if (!sb->servent) { - write_log("BSDSOCK: WARNING - getservby%s() ran out of Amiga memory (couldn't allocate %ld bytes)\n", type ? "port" : "name", size); + write_log ("BSDSOCK: WARNING - getservby%s() ran out of Amiga memory (couldn't allocate %ld bytes)\n", type ? "port" : "name", size); bsdsocklib_seterrno(sb, 12); // ENOMEM return; } sb->serventsize = size; - + aptr = sb->servent + 20 + numaliases * 4; - + // transfer servent to Amiga memory - put_long(sb->servent + 4, sb->servent + 16); - put_long(sb->servent + 8, (unsigned short)htons(s->s_port)); - + put_long (sb->servent + 4, sb->servent + 16); + put_long (sb->servent + 8, (unsigned short)htons(s->s_port)); + for (i = 0; i < numaliases; i++) - put_long(sb->servent + 16 + i * 4,addstr(&aptr,s->s_aliases[i])); - put_long(sb->servent + 16 + numaliases * 4,0); - put_long(sb->servent, aptr); + put_long (sb->servent + 16 + i * 4,addstr(&aptr,s->s_aliases[i])); + put_long (sb->servent + 16 + numaliases * 4,0); + put_long (sb->servent, aptr); addstr(&aptr, s->s_name); - put_long(sb->servent + 12, aptr); + put_long (sb->servent + 12, aptr); addstr(&aptr, s->s_proto); TRACE(("OK (%s, %d)\n", s->s_name, (unsigned short)htons(s->s_port))); @@ -2423,7 +2423,7 @@ uae_u32 host_gethostname(uae_u32 name, uae_u32 namelen) { if (!addr_valid("host_gethostname", name, namelen)) return -1; - return gethostname(get_real_address(name),namelen); + return gethostname(get_real_address (name),namelen); } #endif diff --git a/od-win32/caps/CapsAPI.h b/od-win32/caps/CapsAPI.h index efd7489b..4f8820a9 100755 --- a/od-win32/caps/CapsAPI.h +++ b/od-win32/caps/CapsAPI.h @@ -80,7 +80,7 @@ struct CapsTrackInfo { UDWORD sectorcnt; // available sectors UDWORD sectorsize; // sector size UDWORD trackcnt; // track variant count - PUBYTE trackbuf; // track buffer memory + PUBYTE trackbuf; // track buffer memory UDWORD tracklen; // track buffer memory length PUBYTE trackdata[CAPS_MTRS]; // track data pointer if available UDWORD tracksize[CAPS_MTRS]; // track data size @@ -97,7 +97,7 @@ struct CapsTrackInfoT1 { UDWORD head; // head# UDWORD sectorcnt; // available sectors UDWORD sectorsize; // sector size - PUBYTE trackbuf; // track buffer memory + PUBYTE trackbuf; // track buffer memory UDWORD tracklen; // track buffer memory length UDWORD timelen; // timing buffer length PUDWORD timebuf; // timing buffer diff --git a/od-win32/caps/caps_win32.c b/od-win32/caps/caps_win32.c index 93eb7b06..61c404c7 100755 --- a/od-win32/caps/caps_win32.c +++ b/od-win32/caps/caps_win32.c @@ -133,7 +133,7 @@ static void outdisk (void) int tr; FILE *f; static int done; - + if (done) return; done = 1; @@ -161,8 +161,8 @@ int caps_loadrevolution (uae_u16 *mfmbuf, int drv, int track, int *tracklength) *tracklength = len * 8; mfm = mfmbuf; for (i = 0; i < (len + 1) / 2; i++) { - uae_u8 *data = ci.trackbuf + i * 2; - *mfm++ = 256 * *data + *(data + 1); + uae_u8 *data = ci.trackbuf + i * 2; + *mfm++ = 256 * *data + *(data + 1); } return 1; } @@ -183,8 +183,8 @@ int caps_loadtrack (uae_u16 *mfmbuf, uae_u16 *tracktiming, int drv, int track, i *tracklength = len * 8; *gapoffset = ci.overlap >= 0 ? ci.overlap * 8 : -1; for (i = 0; i < (len + 1) / 2; i++) { - uae_u8 *data = ci.trackbuf + i * 2; - *mfm++ = 256 * *data + *(data + 1); + uae_u8 *data = ci.trackbuf + i * 2; + *mfm++ = 256 * *data + *(data + 1); } #if 0 { diff --git a/od-win32/debug_win32.c b/od-win32/debug_win32.c index 6923fee9..03f6a993 100755 --- a/od-win32/debug_win32.c +++ b/od-win32/debug_win32.c @@ -78,38 +78,38 @@ static void OutputCurrHistNode(HWND hWnd) char *buf; if (currhist->command) { - txtlen = GetWindowTextLength(hWnd); - buf = malloc(txtlen + 1); - GetWindowText(hWnd, buf, txtlen + 1); - if (strcmp(buf, currhist->command)) { - SetWindowText(hWnd, currhist->command); - txtlen = strlen(currhist->command); - SendMessage(hWnd, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); - SendMessage(hWnd, EM_SETSEL, -1, -1); - } + txtlen = GetWindowTextLength(hWnd); + buf = malloc(txtlen + 1); + GetWindowText(hWnd, buf, txtlen + 1); + if (strcmp(buf, currhist->command)) { + SetWindowText(hWnd, currhist->command); + txtlen = strlen(currhist->command); + SendMessage(hWnd, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); + SendMessage(hWnd, EM_SETSEL, -1, -1); + } } } static void SetPrevHistNode(HWND hWnd) { if (currhist) { - if (currhist->prev) - currhist = currhist->prev; - OutputCurrHistNode(hWnd); + if (currhist->prev) + currhist = currhist->prev; + OutputCurrHistNode(hWnd); } else if (lasthist) { - currhist = lasthist; - OutputCurrHistNode(hWnd); + currhist = lasthist; + OutputCurrHistNode(hWnd); } } static void SetNextHistNode(HWND hWnd) { if (currhist) { - if (currhist->next) - currhist = currhist->next; - OutputCurrHistNode(hWnd); + if (currhist->next) + currhist = currhist->next; + OutputCurrHistNode(hWnd); } } @@ -119,17 +119,17 @@ static void DeleteFromHistory(int count) struct histnode *tmp; for (i = 0; i < count && histcount; i++) { - tmp = firsthist; - firsthist = firsthist->next; - if (currhist == tmp) - currhist = NULL; - if (lasthist == tmp) - lasthist = NULL; - if (firsthist) - firsthist->prev = NULL; - free(tmp->command); - free(tmp); - histcount--; + tmp = firsthist; + firsthist = firsthist->next; + if (currhist == tmp) + currhist = NULL; + if (lasthist == tmp) + lasthist = NULL; + if (firsthist) + firsthist->prev = NULL; + free(tmp->command); + free(tmp); + histcount--; } } @@ -139,18 +139,18 @@ static void AddToHistory(const char *command) currhist = NULL; if (histcount > 0 && !strcmp(command, lasthist->command)) - return; + return; else if (histcount == MAXINPUTHIST) - DeleteFromHistory(1); + DeleteFromHistory(1); tmp = lasthist; lasthist = malloc(sizeof(struct histnode)); if (histcount == 0) - firsthist = lasthist; + firsthist = lasthist; lasthist->command = strdup(command); lasthist->next = NULL; lasthist->prev = tmp; if (tmp) - tmp->next = lasthist; + tmp->next = lasthist; histcount++; } @@ -160,12 +160,12 @@ int GetInput (char *out, int maxlen) int chars; if (!hDbgWnd) - return 0; + return 0; inputfinished = 0; hInput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); chars = GetWindowText(hInput, out, maxlen); if (chars == 0) - return 0; + return 0; WriteOutput(linebreak + 1, 2); WriteOutput(out, strlen(out)); WriteOutput(linebreak + 1, 2); @@ -182,24 +182,24 @@ static int CheckLineLimit(HWND hWnd, const char *out) tmp = (char *)out; lines_have = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0); while (strlen(tmp) > 0 && (p = strchr(tmp, '\n')) > 0) { - lines_new++; - tmp = p + 1; + lines_new++; + tmp = p + 1; } lines_new++; if (lines_new > MAXLINES) - return 0; + return 0; if (lines_have + lines_new > MAXLINES) { - visible = IsWindowVisible(hWnd); - if (visible) - SendMessage(hWnd, WM_SETREDRAW, FALSE, 0); - lastchr = SendMessage(hWnd, EM_LINEINDEX, lines_have + lines_new - MAXLINES, 0); - SendMessage(hWnd, EM_SETSEL, 0, lastchr); - SendMessage(hWnd, EM_REPLACESEL, FALSE, (LPARAM)""); - txtlen = GetWindowTextLength(hWnd); - SendMessage(hWnd, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); - SendMessage(hWnd, EM_SETSEL, -1, -1); - if (visible) - SendMessage(hWnd, WM_SETREDRAW, TRUE, 0); + visible = IsWindowVisible(hWnd); + if (visible) + SendMessage(hWnd, WM_SETREDRAW, FALSE, 0); + lastchr = SendMessage(hWnd, EM_LINEINDEX, lines_have + lines_new - MAXLINES, 0); + SendMessage(hWnd, EM_SETSEL, 0, lastchr); + SendMessage(hWnd, EM_REPLACESEL, FALSE, (LPARAM)""); + txtlen = GetWindowTextLength(hWnd); + SendMessage(hWnd, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); + SendMessage(hWnd, EM_SETSEL, -1, -1); + if (visible) + SendMessage(hWnd, WM_SETREDRAW, TRUE, 0); } return 1; } @@ -210,44 +210,44 @@ void WriteOutput(const char *out, int len) char *buf = 0, *p, *tmp; if (!hOutput || !strcmp(out, ">") || len == 0) - return; + return; if (!CheckLineLimit(hOutput, out)) - return; + return; tmp = (char *)out; for(;;) { - p = strchr(tmp, '\n'); - if (p) { - pos = p - tmp + 1; - if (pos > (MAX_LINEWIDTH + 1)) - pos = MAX_LINEWIDTH + 1; - buf = xmalloc(pos + 2); - memset(buf, 0, pos + 2); - strncpy(buf, tmp, pos - 1); - strcat(buf, linebreak); - } else if (strlen(tmp) == 0) { - leave = 1; + p = strchr(tmp, '\n'); + if (p) { + pos = p - tmp + 1; + if (pos > (MAX_LINEWIDTH + 1)) + pos = MAX_LINEWIDTH + 1; + buf = xmalloc(pos + 2); + memset(buf, 0, pos + 2); + strncpy(buf, tmp, pos - 1); + strcat(buf, linebreak); + } else if (strlen(tmp) == 0) { + leave = 1; } else { - count = SendMessage(hOutput, EM_GETLINECOUNT, 0, 0); - index = SendMessage(hOutput, EM_LINEINDEX, count - 1, 0); - txtlen = SendMessage(hOutput, EM_LINELENGTH, index, 0); - if (strlen(tmp) + txtlen > MAX_LINEWIDTH) { - buf = xmalloc(MAX_LINEWIDTH + 3 - txtlen); - memset(buf, 0, MAX_LINEWIDTH + 3 - txtlen); - strncpy(buf, tmp, MAX_LINEWIDTH - txtlen); - strcat(buf, linebreak); - } - leave = 1; - } - txtlen = GetWindowTextLength(hOutput); - SendMessage(hOutput, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); - SendMessage(hOutput, EM_REPLACESEL, FALSE, (LPARAM)(buf ? buf : tmp)); - if (buf) { - xfree(buf); - buf = 0; - tmp += pos; - } - if (leave) - return; + count = SendMessage(hOutput, EM_GETLINECOUNT, 0, 0); + index = SendMessage(hOutput, EM_LINEINDEX, count - 1, 0); + txtlen = SendMessage(hOutput, EM_LINELENGTH, index, 0); + if (strlen(tmp) + txtlen > MAX_LINEWIDTH) { + buf = xmalloc(MAX_LINEWIDTH + 3 - txtlen); + memset(buf, 0, MAX_LINEWIDTH + 3 - txtlen); + strncpy(buf, tmp, MAX_LINEWIDTH - txtlen); + strcat(buf, linebreak); + } + leave = 1; + } + txtlen = GetWindowTextLength(hOutput); + SendMessage(hOutput, EM_SETSEL, (WPARAM)txtlen, (LPARAM)txtlen); + SendMessage(hOutput, EM_REPLACESEL, FALSE, (LPARAM)(buf ? buf : tmp)); + if (buf) { + xfree(buf); + buf = 0; + tmp += pos; + } + if (leave) + return; } } @@ -260,23 +260,23 @@ static void UpdateListboxString(HWND hWnd, int pos, char *out, int mark) COLORREF cr; if (!IsWindowEnabled(hWnd)) { - p = strchr(out, ':'); - if (p) - *(p + 1) = '\0'; + p = strchr(out, ':'); + if (p) + *(p + 1) = '\0'; } if (strlen(out) > MAX_LINEWIDTH) - out[MAX_LINEWIDTH] = '\0'; + out[MAX_LINEWIDTH] = '\0'; p = strchr(out, '\n'); if (p) - *p = '\0'; + *p = '\0'; cr = GetSysColor(COLOR_WINDOWTEXT); count = SendMessage(hWnd, (UINT) LB_GETCOUNT, 0, 0); if (pos < count) { - memset(text, 0, MAX_LINEWIDTH + 1); - SendMessage(hWnd, LB_GETTEXT, pos, (LPARAM)((LPTSTR)text)); - if (strcmp(out, text) != 0 && mark) - cr = GetSysColor(COLOR_HIGHLIGHT); - SendMessage(hWnd, LB_DELETESTRING, pos, 0); + memset(text, 0, MAX_LINEWIDTH + 1); + SendMessage(hWnd, LB_GETTEXT, pos, (LPARAM)((LPTSTR)text)); + if (strcmp(out, text) != 0 && mark) + cr = GetSysColor(COLOR_HIGHLIGHT); + SendMessage(hWnd, LB_DELETESTRING, pos, 0); } SendMessage(hWnd, LB_INSERTSTRING, pos, (LPARAM)out); SendMessage(hWnd, LB_SETITEMDATA, pos, cr); @@ -310,10 +310,10 @@ static int GetLBOutputLines(HWND hWnd) GetClientRect(hWnd, &rc); clientsize = rc.bottom - rc.top; - itemsize = SendMessage(hWnd, LB_GETITEMHEIGHT, 0, 0); + itemsize = SendMessage(hWnd, LB_GETITEMHEIGHT, 0, 0); while (clientsize > itemsize) { - lines ++; - clientsize -= itemsize; + lines ++; + clientsize -= itemsize; } return lines; } @@ -414,7 +414,7 @@ static void ShowMisc(void) (p[23] << 16) | (p[22] << 8) | p[21], (p[26] << 16) | (p[25] << 8) | p[24], (p[27] & 1) ? 'L' : ' ', (p[27] & 2) ? ' ' : 'S'); - free(p2); + free(p2); } for (i = 0; i < 4; i++) { p = p2 = save_disk (i, &len, NULL); @@ -497,29 +497,29 @@ static void ShowBreakpoints(void) ULBS(""); got = 0; for (i = 0; i < BREAKPOINT_TOTAL; i++) { - if (!bpnodes[i].enabled) - continue; + if (!bpnodes[i].enabled) + continue; m68k_disasm_2(outbp, sizeof(outbp), bpnodes[i].addr, NULL, 1, NULL, NULL, 0); - ULBS(outbp); - got = 1; + ULBS(outbp); + got = 1; } if (!got) - ULBS("none"); + ULBS("none"); ULBS(""); ULBS("Memwatch breakpoints:"); ULBS(""); got = 0; for (i = 0; i < MEMWATCH_TOTAL; i++) { - if (mwnodes[i].size == 0) - continue; + if (mwnodes[i].size == 0) + continue; memwatch_dump2(outw, sizeof(outw), i); - ULBS(outw); - got = 1; + ULBS(outw); + got = 1; } if (!got) - ULBS("none"); + ULBS("none"); for (i = ulbs_pos; i < lines_old; i++) - SendMessage(hBrkpts, LB_DELETESTRING, line, 0); + SendMessage(hBrkpts, LB_DELETESTRING, line, 0); } static void ShowMem(int offset) @@ -535,11 +535,11 @@ static void ShowMem(int offset) lines_old = SendMessage(hMemory, LB_GETCOUNT, 0, 0); lines_new = GetLBOutputLines(hMemory); for (i = 0; i < lines_new; i++) { - addr = dumpmem2(addr, out, sizeof(out)); - UpdateListboxString(hMemory, i, out, FALSE); + addr = dumpmem2(addr, out, sizeof(out)); + UpdateListboxString(hMemory, i, out, FALSE); } for (i = lines_new; i < lines_old; i++) { - SendMessage(hMemory, LB_DELETESTRING, lines_new, 0); + SendMessage(hMemory, LB_DELETESTRING, lines_new, 0); } SendMessage(hMemory, LB_SETTOPINDEX, 0, 0); } @@ -552,12 +552,12 @@ static int GetPrevAddr(uae_u32 addr, uae_u32 *prevaddr) dasmaddr = addr - 20; while (dasmaddr < addr) { next = dasmaddr + 2; - m68k_disasm_2(NULL, 0, dasmaddr, &next, 1, NULL, NULL, 0); - if (next == addr) { - *prevaddr = dasmaddr; - return 1; - } - dasmaddr = next; + m68k_disasm_2(NULL, 0, dasmaddr, &next, 1, NULL, NULL, 0); + if (next == addr) { + *prevaddr = dasmaddr; + return 1; + } + dasmaddr = next; } return 0; } @@ -571,36 +571,36 @@ static void ShowDasm(int direction) hDasm = GetDlgItem(hDbgWnd, IDC_DBG_DASM); if (!dbgpage[currpage].init) { - addr = m68k_getpc(®s); - dbgpage[currpage].init = 1; + addr = m68k_getpc (®s); + dbgpage[currpage].init = 1; } else - addr = dbgpage[currpage].addr; + addr = dbgpage[currpage].addr; if (direction > 0) { - m68k_disasm_2(NULL, 0, addr, &addr, 1, NULL, NULL, 0); - if (!addr || addr < dbgpage[currpage].addr) - addr = dbgpage[currpage].addr; + m68k_disasm_2(NULL, 0, addr, &addr, 1, NULL, NULL, 0); + if (!addr || addr < dbgpage[currpage].addr) + addr = dbgpage[currpage].addr; } else if (direction < 0 && addr > 0) { - if (GetPrevAddr(addr, &prev)) - addr = prev; - else - addr -= 2; + if (GetPrevAddr(addr, &prev)) + addr = prev; + else + addr -= 2; } if (addr % 2) - return; + return; dbgpage[currpage].addr = addr; lines_old = SendMessage(hDasm, LB_GETCOUNT, 0, 0); lines_new = GetLBOutputLines(hDasm); for (i = 0; i < lines_new; i++) { - m68k_disasm_2(out, sizeof(out), addr, &addr, 1, NULL, NULL, 0); - if (addr > dbgpage[currpage].addr) - UpdateListboxString(hDasm, i, out, FALSE); - else - UpdateListboxString(hDasm, i, "", FALSE); + m68k_disasm_2(out, sizeof(out), addr, &addr, 1, NULL, NULL, 0); + if (addr > dbgpage[currpage].addr) + UpdateListboxString(hDasm, i, out, FALSE); + else + UpdateListboxString(hDasm, i, "", FALSE); } for (i = lines_new; i < lines_old; i++) { - SendMessage(hDasm, LB_DELETESTRING, lines_new, 0); + SendMessage(hDasm, LB_DELETESTRING, lines_new, 0); } SendMessage(hDasm, LB_SETTOPINDEX, 0, 0); } @@ -609,12 +609,12 @@ static void SetMemToPC(void) { int i, id; - dbgpage[currpage].addr = m68k_getpc(®s); + dbgpage[currpage].addr = m68k_getpc (®s); sprintf(dbgpage[currpage].addrinput, "%08lX", dbgpage[currpage].addr); for (i = 0; i < MAXPAGECONTROLS; i++) { - id = GetDlgCtrlID(dbgpage[currpage].ctrl[i]); - if (id == IDC_DBG_MEMINPUT) - SetWindowText(dbgpage[currpage].ctrl[i], dbgpage[currpage].addrinput); + id = GetDlgCtrlID(dbgpage[currpage].ctrl[i]); + if (id == IDC_DBG_MEMINPUT) + SetWindowText(dbgpage[currpage].ctrl[i], dbgpage[currpage].addrinput); } ShowDasm(0); } @@ -625,43 +625,43 @@ static void ShowPage(int index, int force) HWND hwnd; if (index >= pages || ((index == currpage) && !force)) - return; + return; if (currpage >= 0) { - pstatuscolor[currpage] = (currpage < 2 && index > 1) ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT; - if (index < 2) - pstatuscolor[index == 0 ? 1 : 0] = COLOR_GRAYTEXT; - for (i = 0; i < MAXPAGECONTROLS; i++) { - if (dbgpage[currpage].ctrl[i]) { - id = GetDlgCtrlID(dbgpage[currpage].ctrl[i]); - if (id == IDC_DBG_MEMINPUT) - GetWindowText(dbgpage[currpage].ctrl[i], dbgpage[currpage].addrinput, 9); - ShowWindow(dbgpage[currpage].ctrl[i], SW_HIDE); - } - } + pstatuscolor[currpage] = (currpage < 2 && index > 1) ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT; + if (index < 2) + pstatuscolor[index == 0 ? 1 : 0] = COLOR_GRAYTEXT; + for (i = 0; i < MAXPAGECONTROLS; i++) { + if (dbgpage[currpage].ctrl[i]) { + id = GetDlgCtrlID(dbgpage[currpage].ctrl[i]); + if (id == IDC_DBG_MEMINPUT) + GetWindowText(dbgpage[currpage].ctrl[i], dbgpage[currpage].addrinput, 9); + ShowWindow(dbgpage[currpage].ctrl[i], SW_HIDE); + } + } } pagetype = 0; for (i = 0; i < MAXPAGECONTROLS; i++) { - if (dbgpage[index].ctrl[i]) { - id = GetDlgCtrlID(dbgpage[index].ctrl[i]); + if (dbgpage[index].ctrl[i]) { + id = GetDlgCtrlID(dbgpage[index].ctrl[i]); if (id == IDC_DBG_OUTPUT1 || id == IDC_DBG_OUTPUT2) { - hOutput = dbgpage[index].ctrl[i]; - } else if (id == IDC_DBG_MEM) { - ShowMem(0); + hOutput = dbgpage[index].ctrl[i]; + } else if (id == IDC_DBG_MEM) { + ShowMem(0); pagetype = id; } else if (id == IDC_DBG_DASM) { - ShowDasm(0); + ShowDasm(0); pagetype = id; } else if (id == IDC_DBG_MEMINPUT) { - SetWindowText(dbgpage[index].ctrl[i], dbgpage[index].addrinput); - } else if (id == IDC_DBG_BRKPTS) { - ShowBreakpoints(); - } else if (id == IDC_DBG_MISC) { - ShowMisc(); - } else if (id == IDC_DBG_CUSTOM) { - ShowCustom(); - } + SetWindowText(dbgpage[index].ctrl[i], dbgpage[index].addrinput); + } else if (id == IDC_DBG_BRKPTS) { + ShowBreakpoints(); + } else if (id == IDC_DBG_MISC) { + ShowMisc(); + } else if (id == IDC_DBG_CUSTOM) { + ShowCustom(); + } ShowWindow(dbgpage[index].ctrl[i], SW_SHOW); - } + } } currpage = index; pstatuscolor[currpage] = COLOR_HIGHLIGHT; @@ -674,11 +674,11 @@ static void AddPage(int *iddata) int i; if (pages >= MAXPAGES) - return; + return; memset(&dbgpage[pages], 0, sizeof(struct debuggerpage)); for (i = 0; iddata[i] > 0; i++) { - dbgpage[pages].ctrl[i] = GetDlgItem(hDbgWnd, iddata[i]); - ShowWindow(dbgpage[pages].ctrl[i], SW_HIDE); + dbgpage[pages].ctrl[i] = GetDlgItem(hDbgWnd, iddata[i]); + ShowWindow(dbgpage[pages].ctrl[i], SW_HIDE); } pages++; } @@ -695,9 +695,9 @@ static int GetTextSize(HWND hWnd, char *text, int width) SelectObject(hdc, hfontold); ReleaseDC(hWnd, hdc); if (!width) - return tm.tmHeight + tm.tmExternalLeading; + return tm.tmHeight + tm.tmExternalLeading; else if (text) - return tm.tmMaxCharWidth * strlen(text); + return tm.tmMaxCharWidth * strlen(text); return 0; } @@ -707,31 +707,31 @@ static void InitPages(void) HWND hwnd; int dpage[][MAXPAGECONTROLS + 1] = { - { IDC_DBG_OUTPUT1, -1 }, - { IDC_DBG_OUTPUT2, -1 }, - { IDC_DBG_MEM, IDC_DBG_MEMINPUT, -1 }, - { IDC_DBG_MEM, IDC_DBG_MEMINPUT, -1 }, - { IDC_DBG_DASM, IDC_DBG_MEMINPUT, IDC_DBG_MEMTOPC, -1 }, - { IDC_DBG_DASM, IDC_DBG_MEMINPUT, IDC_DBG_MEMTOPC, -1 }, - { IDC_DBG_BRKPTS, -1 }, - { IDC_DBG_MISC, -1 }, - { IDC_DBG_CUSTOM, -1 } + { IDC_DBG_OUTPUT1, -1 }, + { IDC_DBG_OUTPUT2, -1 }, + { IDC_DBG_MEM, IDC_DBG_MEMINPUT, -1 }, + { IDC_DBG_MEM, IDC_DBG_MEMINPUT, -1 }, + { IDC_DBG_DASM, IDC_DBG_MEMINPUT, IDC_DBG_MEMTOPC, -1 }, + { IDC_DBG_DASM, IDC_DBG_MEMINPUT, IDC_DBG_MEMTOPC, -1 }, + { IDC_DBG_BRKPTS, -1 }, + { IDC_DBG_MISC, -1 }, + { IDC_DBG_CUSTOM, -1 } }; pages = 0; for (i = 0; i < (sizeof(dpage) / sizeof(dpage[0])); i++) - AddPage(dpage[i]); + AddPage(dpage[i]); memset(parts, 0, MAXPAGES * sizeof(int)); width = GetTextSize(hDbgWnd, "12345678", TRUE); // longest pagename + 2 for (i = 0; i < pages; i++) { - pwidth += width; - parts[i] = pwidth; + pwidth += width; + parts[i] = pwidth; } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_STATUS); SendMessage(hwnd, SB_SETPARTS, (WPARAM)pages, (LPARAM)parts); for (i = 0; i < pages; i++) { - SendMessage(hwnd, SB_SETTEXT, i | SBT_OWNERDRAW, 0); - pstatuscolor[i] = COLOR_GRAYTEXT; + SendMessage(hwnd, SB_SETTEXT, i | SBT_OWNERDRAW, 0); + pstatuscolor[i] = COLOR_GRAYTEXT; } } @@ -740,21 +740,21 @@ static LRESULT CALLBACK InputProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM WNDPROC oldproc; switch (message) { - case WM_KEYUP: - switch (wParam) { - case VK_RETURN: - inputfinished = 1; - break; - case VK_UP: - SetPrevHistNode(hWnd); - return TRUE; - case VK_DOWN: - SetNextHistNode(hWnd); - return TRUE; - } - break; + case WM_KEYUP: + switch (wParam) { + case VK_RETURN: + inputfinished = 1; + break; + case VK_UP: + SetPrevHistNode(hWnd); + return TRUE; + case VK_DOWN: + SetNextHistNode(hWnd); + return TRUE; + } + break; } - oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); + oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); return CallWindowProc(oldproc, hWnd, message, wParam, lParam); } @@ -769,41 +769,41 @@ static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LP WNDPROC oldproc; switch (message) { - case WM_CHAR: - if (wParam == VK_BACK) - break; - if (!strchr(allowed, wParam)) - return TRUE; - break; - case WM_PASTE: - if (!OpenClipboard(NULL)) - return TRUE; - hdata = GetClipboardData(CF_TEXT); - if (hdata) { - lptstr = GlobalLock(hdata); - if (lptstr) { - if (strspn(lptstr, allowed) != strlen(lptstr)) - ok = 0; - GlobalUnlock(hdata); - } - } - CloseClipboard(); - if (!ok) - return TRUE; - break; - case WM_KEYUP: - switch (wParam) { - case VK_RETURN: - sprintf(addrstr, "0x"); - GetWindowText(hWnd, addrstr + 2, 9); - addr = strtoul(addrstr, NULL, 0); - dbgpage[currpage].addr = addr; - ShowPage(currpage, TRUE); - break; - } - break; + case WM_CHAR: + if (wParam == VK_BACK) + break; + if (!strchr(allowed, wParam)) + return TRUE; + break; + case WM_PASTE: + if (!OpenClipboard(NULL)) + return TRUE; + hdata = GetClipboardData(CF_TEXT); + if (hdata) { + lptstr = GlobalLock(hdata); + if (lptstr) { + if (strspn(lptstr, allowed) != strlen(lptstr)) + ok = 0; + GlobalUnlock(hdata); + } + } + CloseClipboard(); + if (!ok) + return TRUE; + break; + case WM_KEYUP: + switch (wParam) { + case VK_RETURN: + sprintf(addrstr, "0x"); + GetWindowText(hWnd, addrstr + 2, 9); + addr = strtoul(addrstr, NULL, 0); + dbgpage[currpage].addr = addr; + ShowPage(currpage, TRUE); + break; + } + break; } - oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); + oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); return CallWindowProc(oldproc, hWnd, message, wParam, lParam); } @@ -818,68 +818,68 @@ static LRESULT CALLBACK ListboxProc(HWND hWnd, UINT message, WPARAM wParam, LPAR HFONT oldfont, font; HDC hdc, compdc; HBITMAP compbmp, oldbmp; - + switch (message) { - case WM_CHAR: - hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); - SetFocus(hinput); - SendMessage(hinput, WM_CHAR, wParam, lParam); - return TRUE; - case WM_ERASEBKGND: - return TRUE; - case WM_SETFOCUS: - return TRUE; - case WM_PAINT: - hdc = BeginPaint(hWnd, &ps); - GetClientRect(hWnd, &rc); - height = rc.bottom - rc.top; - width = rc.right - rc.left; - bottom = rc.bottom; - itemheight = SendMessage(hWnd, LB_GETITEMHEIGHT, 0, 0); - rc.bottom = itemheight; - count = SendMessage(hWnd, LB_GETCOUNT, 0, 0); - compdc = CreateCompatibleDC(hdc); - compbmp = CreateCompatibleBitmap(hdc, width, height); - oldbmp = SelectObject(compdc, compbmp); - font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); - oldfont = SelectObject(compdc, font); - id = GetDlgCtrlID(hWnd); - dis.CtlType = ODT_LISTBOX; - dis.CtlID = id; - dis.itemAction = 0; - dis.itemState = 0; - dis.hwndItem = hWnd; - dis.hDC = compdc; + case WM_CHAR: + hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); + SetFocus(hinput); + SendMessage(hinput, WM_CHAR, wParam, lParam); + return TRUE; + case WM_ERASEBKGND: + return TRUE; + case WM_SETFOCUS: + return TRUE; + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + GetClientRect(hWnd, &rc); + height = rc.bottom - rc.top; + width = rc.right - rc.left; + bottom = rc.bottom; + itemheight = SendMessage(hWnd, LB_GETITEMHEIGHT, 0, 0); + rc.bottom = itemheight; + count = SendMessage(hWnd, LB_GETCOUNT, 0, 0); + compdc = CreateCompatibleDC(hdc); + compbmp = CreateCompatibleBitmap(hdc, width, height); + oldbmp = SelectObject(compdc, compbmp); + font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0); + oldfont = SelectObject(compdc, font); + id = GetDlgCtrlID(hWnd); + dis.CtlType = ODT_LISTBOX; + dis.CtlID = id; + dis.itemAction = 0; + dis.itemState = 0; + dis.hwndItem = hWnd; + dis.hDC = compdc; top = SendMessage(hWnd, LB_GETTOPINDEX, 0, 0); for (i = top; i < count && rc.top < height; i++) { dis.itemID = i; - dis.rcItem = rc; - dis.itemData = SendMessage(hWnd, LB_GETITEMDATA, i, 0); - SendMessage(hDbgWnd, WM_DRAWITEM, id, (LPARAM)&dis); - rc.top += itemheight; - rc.bottom += itemheight; - } - rc.bottom = bottom; - if (!IsWindowEnabled(hWnd)) - FillRect(compdc, &rc, GetSysColorBrush(COLOR_3DFACE)); - else - FillRect(compdc, &rc, GetSysColorBrush(COLOR_WINDOW)); - GetWindowRect(hWnd, &rc); - hsbar = GetDlgItem(hDbgWnd, IDC_DBG_STATUS); - GetWindowRect(hsbar, &r); - if (rc.top < r.top) { // not below status bar - if (rc.bottom > r.top) // partly visible - height -= rc.bottom - r.top; - BitBlt(hdc, 0, 0, width, height, compdc, 0, 0, SRCCOPY); - } - SelectObject(compdc, oldfont); - SelectObject(compdc, oldbmp); - DeleteObject(compbmp); - DeleteDC(compdc); - EndPaint(hWnd, &ps); - return TRUE; + dis.rcItem = rc; + dis.itemData = SendMessage(hWnd, LB_GETITEMDATA, i, 0); + SendMessage(hDbgWnd, WM_DRAWITEM, id, (LPARAM)&dis); + rc.top += itemheight; + rc.bottom += itemheight; + } + rc.bottom = bottom; + if (!IsWindowEnabled(hWnd)) + FillRect(compdc, &rc, GetSysColorBrush(COLOR_3DFACE)); + else + FillRect(compdc, &rc, GetSysColorBrush(COLOR_WINDOW)); + GetWindowRect(hWnd, &rc); + hsbar = GetDlgItem(hDbgWnd, IDC_DBG_STATUS); + GetWindowRect(hsbar, &r); + if (rc.top < r.top) { // not below status bar + if (rc.bottom > r.top) // partly visible + height -= rc.bottom - r.top; + BitBlt(hdc, 0, 0, width, height, compdc, 0, 0, SRCCOPY); + } + SelectObject(compdc, oldfont); + SelectObject(compdc, oldbmp); + DeleteObject(compbmp); + DeleteDC(compdc); + EndPaint(hWnd, &ps); + return TRUE; } - oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); + oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); return CallWindowProc(oldproc, hWnd, message, wParam, lParam); } @@ -889,16 +889,16 @@ static LRESULT CALLBACK EditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM HWND hinput; switch (message) { - case WM_CHAR: - if (wParam != VK_CANCEL) { // not for Ctrl-C for copying - hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); - SetFocus(hinput); - SendMessage(hinput, WM_CHAR, wParam, lParam); - return TRUE; - } - break; + case WM_CHAR: + if (wParam != VK_CANCEL) { // not for Ctrl-C for copying + hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); + SetFocus(hinput); + SendMessage(hinput, WM_CHAR, wParam, lParam); + return TRUE; + } + break; } - oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); + oldproc = (WNDPROC)GetWindowLongPtr(hWnd, GWL_USERDATA); return CallWindowProc(oldproc, hWnd, message, wParam, lParam); } @@ -1009,54 +1009,54 @@ static BOOL CALLBACK InitChildWindows(HWND hWnd, LPARAM lParam) id = GetDlgCtrlID(hWnd); switch (id) { - case IDC_DBG_INPUT: - newproc = InputProc; - SendMessage(hWnd, EM_LIMITTEXT, MAX_LINEWIDTH, 0); - break; - case IDC_DBG_MEMINPUT: - newproc = MemInputProc; - SendMessage(hWnd, EM_LIMITTEXT, 8, 0); - break; - case IDC_DBG_PREFETCH: - newproc = ListboxProc; - enable = currprefs.cpu_compatible ? TRUE : FALSE; - break; - case IDC_DBG_FPREG: - case IDC_DBG_FPSR: - newproc = ListboxProc; - enable = currprefs.cpu_model < 68020 ? FALSE : TRUE; - break; - case IDC_DBG_MISCCPU: - if (currprefs.cpu_model == 68000) { - items = 4; - enable = FALSE; - } - else { - for (i = 0; m2cregs[i].regno>= 0; i++) { - if (!movec_illg(m2cregs[i].regno)) - items++; - } - } - pwi.cbSize = sizeof pwi; - GetWindowInfo(hWnd, &pwi); - r = &pwi.rcClient; - r->bottom = r->top + items * GetTextSize(hWnd, NULL, FALSE); - AdjustWindowRectEx(r, pwi.dwStyle, FALSE, pwi.dwExStyle); - SetWindowPos(hWnd, 0, 0, 0, r->right - r->left, r->bottom - r->top, SWP_NOMOVE | SWP_NOZORDER); - newproc = ListboxProc; - break; - default: - if (GetClassName(hWnd, classname, CLASSNAMELENGTH)) { - if (!strcmp(classname, "ListBox")) - newproc = ListboxProc; - else if (!strcmp(classname, "Edit")) - newproc = EditProc; - } - break; + case IDC_DBG_INPUT: + newproc = InputProc; + SendMessage(hWnd, EM_LIMITTEXT, MAX_LINEWIDTH, 0); + break; + case IDC_DBG_MEMINPUT: + newproc = MemInputProc; + SendMessage(hWnd, EM_LIMITTEXT, 8, 0); + break; + case IDC_DBG_PREFETCH: + newproc = ListboxProc; + enable = currprefs.cpu_compatible ? TRUE : FALSE; + break; + case IDC_DBG_FPREG: + case IDC_DBG_FPSR: + newproc = ListboxProc; + enable = currprefs.cpu_model < 68020 ? FALSE : TRUE; + break; + case IDC_DBG_MISCCPU: + if (currprefs.cpu_model == 68000) { + items = 4; + enable = FALSE; + } + else { + for (i = 0; m2cregs[i].regno>= 0; i++) { + if (!movec_illg(m2cregs[i].regno)) + items++; + } + } + pwi.cbSize = sizeof pwi; + GetWindowInfo(hWnd, &pwi); + r = &pwi.rcClient; + r->bottom = r->top + items * GetTextSize(hWnd, NULL, FALSE); + AdjustWindowRectEx(r, pwi.dwStyle, FALSE, pwi.dwExStyle); + SetWindowPos(hWnd, 0, 0, 0, r->right - r->left, r->bottom - r->top, SWP_NOMOVE | SWP_NOZORDER); + newproc = ListboxProc; + break; + default: + if (GetClassName(hWnd, classname, CLASSNAMELENGTH)) { + if (!strcmp(classname, "ListBox")) + newproc = ListboxProc; + else if (!strcmp(classname, "Edit")) + newproc = EditProc; + } + break; } if (newproc) { - oldproc = (WNDPROC)SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)newproc); - SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG_PTR)oldproc); + oldproc = (WNDPROC)SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)newproc); + SetWindowLongPtr(hWnd, GWL_USERDATA, (LONG_PTR)oldproc); } EnableWindow(hWnd, enable); return TRUE; @@ -1071,16 +1071,16 @@ static LRESULT CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP char text[MAX_LINEWIDTH + 1]; switch (message) { - case WM_INITDIALOG: + case WM_INITDIALOG: { int newpos = 0; LONG x, y, w, h; DWORD regkeytype; DWORD regkeysize = sizeof(LONG); - RECT rw; - GetWindowRect(hDlg, &rw); - dbgwnd_minx = rw.right - rw.left; - dbgwnd_miny = rw.bottom - rw.top; + RECT rw; + GetWindowRect(hDlg, &rw); + dbgwnd_minx = rw.right - rw.left; + dbgwnd_miny = rw.bottom - rw.top; GetClientRect(hDlg, &dlgRect); if (hWinUAEKey) { newpos = 1; @@ -1109,28 +1109,28 @@ static LRESULT CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP histcount = 0; inputfinished = 0; AdjustDialog(hDlg); - return TRUE; + return TRUE; } - case WM_CLOSE: - DestroyWindow(hDlg); + case WM_CLOSE: + DestroyWindow(hDlg); uae_quit(); - return TRUE; - case WM_DESTROY: + return TRUE; + case WM_DESTROY: { RECT r; if (GetWindowRect (hDlg, &r) && hWinUAEKey) { r.right -= r.left; r.bottom -= r.top; - RegSetValueEx (hWinUAEKey, "DebuggerPosX", 0, REG_DWORD, (LPBYTE)&r.left, sizeof(LONG)); - RegSetValueEx (hWinUAEKey, "DebuggerPosY", 0, REG_DWORD, (LPBYTE)&r.top, sizeof(LONG)); - RegSetValueEx (hWinUAEKey, "DebuggerPosW", 0, REG_DWORD, (LPBYTE)&r.right, sizeof(LONG)); - RegSetValueEx (hWinUAEKey, "DebuggerPosH", 0, REG_DWORD, (LPBYTE)&r.bottom, sizeof(LONG)); + RegSetValueEx (hWinUAEKey, "DebuggerPosX", 0, REG_DWORD, (LPBYTE)&r.left, sizeof(LONG)); + RegSetValueEx (hWinUAEKey, "DebuggerPosY", 0, REG_DWORD, (LPBYTE)&r.top, sizeof(LONG)); + RegSetValueEx (hWinUAEKey, "DebuggerPosW", 0, REG_DWORD, (LPBYTE)&r.right, sizeof(LONG)); + RegSetValueEx (hWinUAEKey, "DebuggerPosH", 0, REG_DWORD, (LPBYTE)&r.bottom, sizeof(LONG)); } - hDbgWnd = 0; - PostQuitMessage(0); + hDbgWnd = 0; + PostQuitMessage(0); DeleteFromHistory(histcount); consoleopen = 0; - return TRUE; + return TRUE; } case WM_GETMINMAXINFO: { @@ -1142,96 +1142,96 @@ static LRESULT CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP case WM_EXITSIZEMOVE: { AdjustDialog(hDlg); - ShowPage(currpage, TRUE); + ShowPage(currpage, TRUE); return TRUE; } - case WM_CTLCOLORSTATIC: - SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); - return (LRESULT)GetSysColorBrush(COLOR_WINDOW); - case WM_CTLCOLORLISTBOX: - hwnd = (HWND)lParam; - if (!IsWindowEnabled(hwnd)) { - SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE)); - return (LRESULT)GetSysColorBrush(COLOR_3DFACE); - } - SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); - return (LRESULT)GetSysColorBrush(COLOR_WINDOW); - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_DBG_HELP: - { - HWND hinput; - WriteOutput(linebreak + 1, 2); - debug_help(); - hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); - SetFocus(hinput); - return TRUE; - } - case ID_DBG_PAGE1: - case ID_DBG_PAGE2: - case ID_DBG_PAGE3: - case ID_DBG_PAGE4: - case ID_DBG_PAGE5: - case ID_DBG_PAGE6: - case ID_DBG_PAGE7: - case ID_DBG_PAGE8: - case ID_DBG_PAGE9: - // IDs have to be consecutive and in order of page order for this to work - ShowPage(LOWORD(wParam) - ID_DBG_PAGE1, FALSE); - return TRUE; - case IDC_DBG_MEMUP: + case WM_CTLCOLORSTATIC: + SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); + return (LRESULT)GetSysColorBrush(COLOR_WINDOW); + case WM_CTLCOLORLISTBOX: + hwnd = (HWND)lParam; + if (!IsWindowEnabled(hwnd)) { + SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE)); + return (LRESULT)GetSysColorBrush(COLOR_3DFACE); + } + SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW)); + return (LRESULT)GetSysColorBrush(COLOR_WINDOW); + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_DBG_HELP: + { + HWND hinput; + WriteOutput(linebreak + 1, 2); + debug_help(); + hinput = GetDlgItem(hDbgWnd, IDC_DBG_INPUT); + SetFocus(hinput); + return TRUE; + } + case ID_DBG_PAGE1: + case ID_DBG_PAGE2: + case ID_DBG_PAGE3: + case ID_DBG_PAGE4: + case ID_DBG_PAGE5: + case ID_DBG_PAGE6: + case ID_DBG_PAGE7: + case ID_DBG_PAGE8: + case ID_DBG_PAGE9: + // IDs have to be consecutive and in order of page order for this to work + ShowPage(LOWORD(wParam) - ID_DBG_PAGE1, FALSE); + return TRUE; + case IDC_DBG_MEMUP: moveupdown(-1); return TRUE; - case IDC_DBG_MEMDOWN: - moveupdown(1); - return TRUE; - case IDC_DBG_MEMUPFAST: + case IDC_DBG_MEMDOWN: + moveupdown(1); + return TRUE; + case IDC_DBG_MEMUPFAST: moveupdown(-2); return TRUE; - case IDC_DBG_MEMDOWNFAST: - moveupdown(2); - return TRUE; - case IDC_DBG_MEMTOPC: - { - HWND hmeminput; - SetMemToPC(); - hmeminput = GetDlgItem(hDbgWnd, IDC_DBG_MEMINPUT); - SetFocus(hmeminput); - return TRUE; - } - } - break; - case WM_MEASUREITEM: - ((MEASUREITEMSTRUCT*)(lParam))->itemHeight = GetTextSize(hDlg, NULL, FALSE); - return TRUE; - case WM_DRAWITEM: - pdis = (DRAWITEMSTRUCT *)lParam; - hdc = pdis->hDC; - rc = pdis->rcItem; - SetBkMode(hdc, TRANSPARENT); - if (wParam == IDC_DBG_STATUS) { - SetTextColor(hdc, GetSysColor(pstatuscolor[pdis->itemID])); - DrawText(hdc, pname[pdis->itemID], lstrlen(pname[pdis->itemID]), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER); - } - else { - if (pdis->itemID < 0) { - return TRUE; - } - memset(text, 0, MAX_LINEWIDTH + 1); - SendMessage(pdis->hwndItem, LB_GETTEXT, pdis->itemID, (LPARAM)(LPSTR)text); - if (!IsWindowEnabled(pdis->hwndItem)) { - FillRect(hdc, &rc, GetSysColorBrush(COLOR_3DFACE)); - SetBkColor(hdc, GetSysColor(COLOR_3DFACE)); - } - else { - FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW)); - SetBkColor(hdc, GetSysColor(COLOR_WINDOW)); - } - SetTextColor(hdc, pdis->itemData); - TextOut(hdc, rc.left, rc.top, text, strlen(text)); - return TRUE; - } - break; + case IDC_DBG_MEMDOWNFAST: + moveupdown(2); + return TRUE; + case IDC_DBG_MEMTOPC: + { + HWND hmeminput; + SetMemToPC(); + hmeminput = GetDlgItem(hDbgWnd, IDC_DBG_MEMINPUT); + SetFocus(hmeminput); + return TRUE; + } + } + break; + case WM_MEASUREITEM: + ((MEASUREITEMSTRUCT*)(lParam))->itemHeight = GetTextSize(hDlg, NULL, FALSE); + return TRUE; + case WM_DRAWITEM: + pdis = (DRAWITEMSTRUCT *)lParam; + hdc = pdis->hDC; + rc = pdis->rcItem; + SetBkMode(hdc, TRANSPARENT); + if (wParam == IDC_DBG_STATUS) { + SetTextColor(hdc, GetSysColor(pstatuscolor[pdis->itemID])); + DrawText(hdc, pname[pdis->itemID], lstrlen(pname[pdis->itemID]), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + } + else { + if (pdis->itemID < 0) { + return TRUE; + } + memset(text, 0, MAX_LINEWIDTH + 1); + SendMessage(pdis->hwndItem, LB_GETTEXT, pdis->itemID, (LPARAM)(LPSTR)text); + if (!IsWindowEnabled(pdis->hwndItem)) { + FillRect(hdc, &rc, GetSysColorBrush(COLOR_3DFACE)); + SetBkColor(hdc, GetSysColor(COLOR_3DFACE)); + } + else { + FillRect(hdc, &rc, GetSysColorBrush(COLOR_WINDOW)); + SetBkColor(hdc, GetSysColor(COLOR_WINDOW)); + } + SetTextColor(hdc, pdis->itemData); + TextOut(hdc, rc.left, rc.top, text, strlen(text)); + return TRUE; + } + break; } return FALSE; } @@ -1242,16 +1242,16 @@ int open_debug_window(void) struct newresource *nr; if (hDbgWnd) - return 0; + return 0; reopen = 0; dbgaccel = LoadAccelerators(hUIDLL ? hUIDLL : hInst, MAKEINTRESOURCE (IDR_DBGACCEL)); nr = getresource(IDD_DEBUGGER); if (nr) { - hDbgWnd = CreateDialogIndirect (nr->inst, nr->resource, NULL, DebuggerProc); - freescaleresource(nr); + hDbgWnd = CreateDialogIndirect (nr->inst, nr->resource, NULL, DebuggerProc); + freescaleresource(nr); } if (!hDbgWnd) - return 0; + return 0; InitPages(); ShowPage(0, TRUE); ShowWindow(hDbgWnd, SW_SHOWNORMAL); @@ -1294,21 +1294,21 @@ void update_debug_info(void) char *fpsrflag[] = { "N: ", "Z: ", "I: ", "NAN: " }; if (!hDbgWnd) - return; + return; hwnd = GetDlgItem(hDbgWnd, IDC_DBG_DREG); for (i = 0; i < 8; i++) { - sprintf(out, "D%d: %08lX", i, m68k_dreg(®s, i)); - UpdateListboxString(hwnd, i, out, TRUE); + sprintf(out, "D%d: %08lX", i, m68k_dreg (®s, i)); + UpdateListboxString(hwnd, i, out, TRUE); } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AREG); for (i = 0; i < 8; i++) { - hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AREG); - sprintf(out, "A%d: %08lX", i, m68k_areg(®s, i)); - UpdateListboxString(hwnd, i, out, TRUE); - hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AMEM); - dumpmem2(m68k_areg(®s, i), out, sizeof(out)); - UpdateListboxString(hwnd, i, out + 9, TRUE); + hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AREG); + sprintf(out, "A%d: %08lX", i, m68k_areg (®s, i)); + UpdateListboxString(hwnd, i, out, TRUE); + hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AMEM); + dumpmem2(m68k_areg (®s, i), out, sizeof(out)); + UpdateListboxString(hwnd, i, out + 9, TRUE); } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_CCR); @@ -1339,7 +1339,7 @@ void update_debug_info(void) UpdateListboxString(hwnd, 4, out, TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_PC); - sprintf(out, "PC: %08lX", m68k_getpc(®s)); + sprintf(out, "PC: %08lX", m68k_getpc (®s)); UpdateListboxString(hwnd, 0, out, TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_PREFETCH); @@ -1354,15 +1354,15 @@ void update_debug_info(void) hwnd = GetDlgItem(hDbgWnd, IDC_DBG_FPREG); for (i = 0; i < 8; i++) { - sprintf(out, "FP%d: %g", i, regs.fp[i]); - UpdateListboxString(hwnd, i, out, TRUE); + sprintf(out, "FP%d: %g", i, regs.fp[i]); + UpdateListboxString(hwnd, i, out, TRUE); } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_FPSR); fpsr = get_fpsr(); for (i = 0; i < 4; i++) { - sprintf(out, "%s%d", fpsrflag[i], (fpsr & (0x8000000 >> i)) != 0 ? 1 : 0); - UpdateListboxString(hwnd, i, out, TRUE); + sprintf(out, "%s%d", fpsrflag[i], (fpsr & (0x8000000 >> i)) != 0 ? 1 : 0); + UpdateListboxString(hwnd, i, out, TRUE); } ShowPage(currpage, TRUE); } diff --git a/od-win32/dinput.c b/od-win32/dinput.c index 539a860c..a4c5c389 100755 --- a/od-win32/dinput.c +++ b/od-win32/dinput.c @@ -236,9 +236,9 @@ static int initialize_catweasel(void) static int rdpmouse(char *buf) { if (!memcmp (RDP_MOUSE1, buf, strlen (RDP_MOUSE1))) - return 1; + return 1; if (!memcmp (RDP_MOUSE2, buf, strlen (RDP_MOUSE2))) - return 1; + return 1; return 0; } @@ -357,7 +357,7 @@ static int initialize_rawinput (void) continue; if (type == RIM_TYPEMOUSE) { PRID_DEVICE_INFO_MOUSE rdim = &rdi->mouse; - write_log ("id=%d buttons=%d hw=%d rate=%d\n", + write_log ("id=%d buttons=%d hw=%d rate=%d\n", rdim->dwId, rdim->dwNumberOfButtons, rdim->fHasHorizontalWheel, rdim->dwSampleRate); did->buttons = rdim->dwNumberOfButtons; did->axles = 3; @@ -462,7 +462,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) if (raw->header.dwType == RIM_TYPEMOUSE) { PRAWMOUSE rm = &raw->data.mouse; - + for (num = 0; num < num_mouse; num++) { did = &di_mouse[num]; if (!did->disabled && did->rawinput == raw->header.hDevice) @@ -471,12 +471,12 @@ static void handle_rawinput_2 (RAWINPUT *raw) #ifdef DI_DEBUG2 write_log ("HANDLE=%08.8x %04.4x %04.4x %04.4x %08.8x %3d %3d %08.8x M=%d\n", raw->header.hDevice, - rm->usFlags, - rm->usButtonFlags, - rm->usButtonData, - rm->ulRawButtons, - rm->lLastX, - rm->lLastY, + rm->usFlags, + rm->usButtonFlags, + rm->usButtonData, + rm->ulRawButtons, + rm->lLastX, + rm->lLastY, rm->ulExtraInformation, num < num_mouse ? num + 1 : -1); #endif if (num == num_mouse) { @@ -628,7 +628,7 @@ static void fixbuttons (struct didata *did) { if (did->buttons > 0) return; - write_log("'%s' has no buttons, adding single default button\n", did->name); + write_log ("'%s' has no buttons, adding single default button\n", did->name); did->buttonmappings[0] = DIJOFS_BUTTON(0); did->buttonsort[0] = 0; did->buttonname[0] = my_strdup("Button"); @@ -834,37 +834,37 @@ static LPDIRECTINPUT8 g_lpdi; static int di_do_init (void) { - HRESULT hr; + HRESULT hr; num_mouse = num_joystick = num_keyboard = 0; memset (&di_mouse, 0, sizeof (di_mouse)); memset (&di_joystick, 0, sizeof (di_joystick)); memset (&di_keyboard, 0, sizeof (di_keyboard)); - hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (LPVOID *)&g_lpdi, NULL); + hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, &IID_IDirectInput8A, (LPVOID *)&g_lpdi, NULL); if (FAILED(hr)) { write_log ("DirectInput8Create failed, %s\n", DXError (hr)); gui_message ("Failed to initialize DirectInput!"); return 0; } if (dinput_enum_all) { - write_log("DirectInput enumeration..\n"); + write_log ("DirectInput enumeration..\n"); IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); } else { - write_log("DirectInput enumeration.. Keyboards..\n"); + write_log ("DirectInput enumeration.. Keyboards..\n"); IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_KEYBOARD, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); - write_log("DirectInput enumeration.. Pointing devices..\n"); + write_log ("DirectInput enumeration.. Pointing devices..\n"); IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_POINTER, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); - write_log("DirectInput enumeration.. Game controllers..\n"); + write_log ("DirectInput enumeration.. Game controllers..\n"); IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_GAMECTRL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); } - write_log("RawInput enumeration..\n"); + write_log ("RawInput enumeration..\n"); initialize_rawinput(); - write_log("Windowsmouse initialization..\n"); + write_log ("Windowsmouse initialization..\n"); initialize_windowsmouse(); - write_log("Catweasel joymouse initialization..\n"); + write_log ("Catweasel joymouse initialization..\n"); initialize_catweasel(); - write_log("end\n"); + write_log ("end\n"); sortdd (di_joystick, num_joystick, DID_JOYSTICK); sortdd (di_mouse, num_mouse, DID_MOUSE); @@ -953,7 +953,7 @@ static int init_mouse (void) { int i; LPDIRECTINPUTDEVICE8 lpdi; - HRESULT hr; + HRESULT hr; struct didata *did; if (mouse_inited) @@ -965,7 +965,7 @@ static int init_mouse (void) if (!did->disabled && did->connection == DIDC_DX) { hr = IDirectInput8_CreateDevice (g_lpdi, &did->guid, &lpdi, NULL); if (hr == DI_OK) { - hr = IDirectInputDevice8_SetDataFormat(lpdi, &c_dfDIMouse); + hr = IDirectInputDevice8_SetDataFormat(lpdi, &c_dfDIMouse); IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL); fixbuttons (did); sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles); @@ -1298,7 +1298,7 @@ static int init_kb (void) if (!did->disabled && did->connection == DIDC_DX) { hr = IDirectInput8_CreateDevice (g_lpdi, &did->guid, &lpdi, NULL); if (hr == DI_OK) { - hr = IDirectInputDevice8_SetDataFormat(lpdi, &c_dfDIKeyboard); + hr = IDirectInputDevice8_SetDataFormat(lpdi, &c_dfDIKeyboard); if (hr != DI_OK) write_log ("keyboard setdataformat failed, %s\n", DXError (hr)); memset (&dipdw, 0, sizeof (dipdw)); @@ -1399,8 +1399,8 @@ static int refresh_kb (LPDIRECTINPUTDEVICE8 lpdi, int num) static int keyhack (int scancode,int pressed, int num) { static byte backslashstate,apostrophstate; - - //check ALT-F4 + + //check ALT-F4 if (pressed && !di_keycodes[num][DIK_F4] && scancode == DIK_F4 && di_keycodes[num][DIK_LALT] && !currprefs.win32_ctrl_F11_is_quit) { uae_quit (); return -1; @@ -1412,7 +1412,7 @@ static int keyhack (int scancode,int pressed, int num) } #endif - // release mouse if TAB and ALT is pressed + // release mouse if TAB and ALT is pressed if (pressed && di_keycodes[num][DIK_LALT] && scancode == DIK_TAB) { disablecapture (); return -1; @@ -1420,7 +1420,7 @@ static int keyhack (int scancode,int pressed, int num) if (!keyboard_german || currprefs.input_selected_setting > 0) return scancode; - + //This code look so ugly because there is no Directinput //key for # (called numbersign on win standard message) //available @@ -1429,7 +1429,7 @@ static int keyhack (int scancode,int pressed, int num) if (scancode == DIK_BACKSLASH) // The # key { if (di_keycodes[num][DIK_LSHIFT] || di_keycodes[num][DIK_RSHIFT] || apostrophstate) - { + { if (pressed) { apostrophstate=1; inputdevice_translatekeycode (num, DIK_RSHIFT, 0); @@ -1459,15 +1459,15 @@ static int keyhack (int scancode,int pressed, int num) inputdevice_translatekeycode (num, DIK_LSHIFT, 0); // Here is the same not nice but do the job return 4; // the german # key - - } + + } } if ((di_keycodes[num][DIK_RALT]) || (backslashstate)) { switch (scancode) { case 12: if (pressed) - { + { backslashstate=1; inputdevice_translatekeycode (num, DIK_RALT, 0); return DIK_BACKSLASH; @@ -1606,7 +1606,7 @@ static int acquire_kb (int num, int flags) currprefs.kbledmode = 1; #endif oldleds = get_leds (); - if (oldusedleds < 0) + if (oldusedleds < 0) oldusedleds = newleds = oldleds; set_leds (oldusedleds); } @@ -1744,7 +1744,7 @@ static void read_joystick (void) int data2 = data; int state = (data & 0x80) ? 1 : 0; data -= 32768; - + for (k = 0; k < did->buttons; k++) { if (did->buttonmappings[k] == dimofs) { #ifdef DI_DEBUG2 @@ -1880,7 +1880,7 @@ int dinput_wmkey (uae_u32 key) int input_get_default_mouse (struct uae_input_device *uid, int i, int port) { if (di_mouse[i].wininput) - port = 0; + port = 0; uid[i].eventid[ID_AXIS_OFFSET + 0][0] = port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ; uid[i].eventid[ID_AXIS_OFFSET + 1][0] = port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT; uid[i].eventid[ID_AXIS_OFFSET + 2][0] = port ? 0 : INPUTEVENT_MOUSE1_WHEEL; @@ -1888,10 +1888,10 @@ int input_get_default_mouse (struct uae_input_device *uid, int i, int port) uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON; uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON; if (port == 0) { /* map back and forward to ALT+LCUR and ALT+RCUR */ - uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = INPUTEVENT_KEY_ALT_LEFT; - uid[i].eventid[ID_BUTTON_OFFSET + 3][1] = INPUTEVENT_KEY_CURSOR_LEFT; - uid[i].eventid[ID_BUTTON_OFFSET + 4][0] = INPUTEVENT_KEY_ALT_LEFT; - uid[i].eventid[ID_BUTTON_OFFSET + 4][1] = INPUTEVENT_KEY_CURSOR_RIGHT; + uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = INPUTEVENT_KEY_ALT_LEFT; + uid[i].eventid[ID_BUTTON_OFFSET + 3][1] = INPUTEVENT_KEY_CURSOR_LEFT; + uid[i].eventid[ID_BUTTON_OFFSET + 4][0] = INPUTEVENT_KEY_ALT_LEFT; + uid[i].eventid[ID_BUTTON_OFFSET + 4][1] = INPUTEVENT_KEY_CURSOR_RIGHT; } if (i == 0) return 1; @@ -1909,7 +1909,7 @@ int input_get_default_joystick (struct uae_input_device *uid, int i, int port) uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON; uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON; for (j = 2; j < MAX_MAPPINGS - 1; j++) { - int am = did->axismappings[j]; + int am = did->axismappings[j]; if (am == DIJOFS_POV(0) || am == DIJOFS_POV(1) || am == DIJOFS_POV(2) || am == DIJOFS_POV(3)) { uid[i].eventid[ID_AXIS_OFFSET + j + 0][0] = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ; uid[i].eventid[ID_AXIS_OFFSET + j + 1][0] = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT; @@ -1917,13 +1917,13 @@ int input_get_default_joystick (struct uae_input_device *uid, int i, int port) } } if (currprefs.cs_cd32cd) { - uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED; - uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE; - uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW; - uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN; - uid[i].eventid[ID_BUTTON_OFFSET + 4][0] = port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW; - uid[i].eventid[ID_BUTTON_OFFSET + 5][0] = port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD; - uid[i].eventid[ID_BUTTON_OFFSET + 6][0] = port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY; + uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED; + uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE; + uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW; + uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN; + uid[i].eventid[ID_BUTTON_OFFSET + 4][0] = port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW; + uid[i].eventid[ID_BUTTON_OFFSET + 5][0] = port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD; + uid[i].eventid[ID_BUTTON_OFFSET + 6][0] = port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY; } if (i == 0) return 1; diff --git a/od-win32/direct3d.c b/od-win32/direct3d.c index cb7abc29..197fb98e 100755 --- a/od-win32/direct3d.c +++ b/od-win32/direct3d.c @@ -60,7 +60,7 @@ static D3DXMATRIX* xD3DXMatrixPerspectiveFovLH(D3DXMATRIX *pOut, FLOAT fovy, FLO sine = sin(fovy); dz = zf - zn; if (sine == 0 || dz == 0 || Aspect == 0) - return pOut; + return pOut; yscale = cos(fovy) / sine; xscale = yscale / Aspect; pOut->_11 = xscale; @@ -110,7 +110,7 @@ static int restoredeviceobjects(void) hr = IDirect3DSurface9_GetDesc (bb, &dsdbb); hr = IDirect3DSurface9_Release (bb); - // Set up the texture + // Set up the texture hr = IDirect3DDevice9_SetTextureStageState(d3ddev, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); hr = IDirect3DDevice9_SetTextureStageState(d3ddev, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); hr = IDirect3DDevice9_SetTextureStageState(d3ddev, 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); @@ -329,7 +329,7 @@ const char *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) else vsync2 = 1; } - } + } } ret = IDirect3D9_CreateDevice(d3d, adapter, D3DDEVTYPE_HAL, ahwnd, @@ -343,7 +343,7 @@ const char *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) max_texture_w = d3dCaps.MaxTextureWidth; max_texture_h = d3dCaps.MaxTextureHeight; - write_log("D3D: max texture width: %d, max texture height: %d\n", + write_log ("D3D: max texture width: %d, max texture height: %d\n", max_texture_w, max_texture_h); if (max_texture_w < t_w || max_texture_h < t_h) { diff --git a/od-win32/diskutil.c b/od-win32/diskutil.c index fe2aaa67..57a95fba 100755 --- a/od-win32/diskutil.c +++ b/od-win32/diskutil.c @@ -54,7 +54,7 @@ static UBYTE *mergepieces(UBYTE *start,int len,int bits,UBYTE *sync) UBYTE b; int size; int shift; - + size=len-(sync-start); memcpy(dst,sync,size); dst+=size; @@ -68,8 +68,8 @@ static UBYTE *mergepieces(UBYTE *start,int len,int bits,UBYTE *sync) start++; } return tmpmfmbuffer; -} - +} + #define SCANOFFSET 1 /* scanning range in bytes, -SCANOFFSET to SCANOFFSET */ #define SCANOFFSET2 20 #define SCANLENGHT 200 /* scanning length in bytes */ @@ -78,7 +78,7 @@ static UBYTE* scantrack(UBYTE *sync1,UBYTE *sync2,int *trackbytes,int *trackbits { int i,bits,bytes,matched; UBYTE *sync2bak=sync2; - + sync1+=SCANOFFSET2; sync2+=SCANOFFSET2; while(sync1 < sync2bak - 2*SCANOFFSET - SCANOFFSET2 - SCANLENGHT) { @@ -105,7 +105,7 @@ static UBYTE* scantrack(UBYTE *sync1,UBYTE *sync2,int *trackbytes,int *trackbits sync2++; } return 0; -} +} #endif #define MFMMASK 0x55555555 diff --git a/od-win32/dxwrap.c b/od-win32/dxwrap.c index 1aedc0e5..34c1de95 100755 --- a/od-win32/dxwrap.c +++ b/od-win32/dxwrap.c @@ -58,12 +58,12 @@ static HRESULT restoresurface (LPDIRECTDRAWSURFACE7 surface) write_log ("Restore succeeded but following Blt failed with lost surface. Display driver bug?\n"); return hr; } - write_log("Surface clear failed: %s\n", DXError (hr2)); + write_log ("Surface clear failed: %s\n", DXError (hr2)); } surfacedesc.dwSize = sizeof surfacedesc; hr2 = IDirectDrawSurface7_Lock(surface, NULL, &surfacedesc, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); if (SUCCEEDED(hr2)) { - write_log("Surface Pointer: %p\n", surfacedesc.lpSurface); + write_log ("Surface Pointer: %p\n", surfacedesc.lpSurface); IDirectDrawSurface7_Unlock(surface, NULL); } } @@ -131,60 +131,60 @@ static void ShowDDCaps( DDCAPS_DX7 caps, int hw ) if( shown < 2) { - dxwrite_log( "DirectDraw Capabilities for %s:\n", hw ? "Display Driver Hardware" : "Display Driver Emulation Layer" ); + dxwrite_log ( "DirectDraw Capabilities for %s:\n", hw ? "Display Driver Hardware" : "Display Driver Emulation Layer" ); if( caps.dwCaps & DDCAPS_BLT ) - dxwrite_log( "DDCAPS_BLT - Capable of blitting\n" ); + dxwrite_log ( "DDCAPS_BLT - Capable of blitting\n" ); if( caps.dwCaps & DDCAPS_BLTCOLORFILL ) - dxwrite_log( "DDCAPS_BLTCOLORFILL - Color filling with blitter\n" ); + dxwrite_log ( "DDCAPS_BLTCOLORFILL - Color filling with blitter\n" ); if( caps.dwCaps & DDCAPS_BLTSTRETCH ) - dxwrite_log( "DDCAPS_BLTSTRETCH - Stretch blitting\n" ); + dxwrite_log ( "DDCAPS_BLTSTRETCH - Stretch blitting\n" ); if( caps.dwCaps & DDCAPS_CANBLTSYSMEM ) - dxwrite_log( "DDCAPS_CANBLTSYSMEM - Blits from system memory\n" ); + dxwrite_log ( "DDCAPS_CANBLTSYSMEM - Blits from system memory\n" ); if( caps.dwCaps & DDCAPS_CANCLIP ) - dxwrite_log( "DDCAPS_CANCLIP - Can clip while blitting\n" ); + dxwrite_log ( "DDCAPS_CANCLIP - Can clip while blitting\n" ); if( caps.dwCaps & DDCAPS_CANCLIPSTRETCHED ) - dxwrite_log( "DDCAPS_CANCLIPSTRETCHED - Can clip while stretch-blitting\n" ); + dxwrite_log ( "DDCAPS_CANCLIPSTRETCHED - Can clip while stretch-blitting\n" ); if( caps.dwCaps & DDCAPS_COLORKEY ) { - dxwrite_log( "DDCAPS_COLORKEY - Can color-key with blits/overlays\n" ); + dxwrite_log ( "DDCAPS_COLORKEY - Can color-key with blits/overlays\n" ); bColourKeyAvailable = TRUE; } if( caps.dwCaps & DDCAPS_GDI ) - dxwrite_log( "DDCAPS_GDI - Display h/w shared with GDI\n" ); + dxwrite_log ( "DDCAPS_GDI - Display h/w shared with GDI\n" ); if( caps.dwCaps & DDCAPS_NOHARDWARE ) - dxwrite_log( "DDCAPS_NOHARDWARE - no h/w support!\n" ); + dxwrite_log ( "DDCAPS_NOHARDWARE - no h/w support!\n" ); if( caps.dwCaps & DDCAPS_OVERLAY ) { - dxwrite_log( "DDCAPS_OVERLAY - support for %d overlay(s)\n", caps.dwMaxVisibleOverlays ); + dxwrite_log ( "DDCAPS_OVERLAY - support for %d overlay(s)\n", caps.dwMaxVisibleOverlays ); if( bColourKeyAvailable ) { if( caps.dwCKeyCaps & DDCKEYCAPS_DESTOVERLAY ) { - dxwrite_log( "DDCKEYCAPS_DESTOVERLAY - colour-keyed overlays\n" ); + dxwrite_log ( "DDCKEYCAPS_DESTOVERLAY - colour-keyed overlays\n" ); bOverlayAvailable = TRUE; } } } if( caps.dwCaps & DDCAPS_OVERLAYFOURCC ) - dxwrite_log( "DDCAPS_OVERLAYFOURCC - overlay can do color-space conversions\n" ); + dxwrite_log ( "DDCAPS_OVERLAYFOURCC - overlay can do color-space conversions\n" ); if( caps.dwCaps & DDCAPS_OVERLAYSTRETCH ) - dxwrite_log( "DDCAPS_OVERLAYSTRETCH - overlay can stretch with min=%d/max=%d\n", caps.dwMinOverlayStretch, caps.dwMaxOverlayStretch ); + dxwrite_log ( "DDCAPS_OVERLAYSTRETCH - overlay can stretch with min=%d/max=%d\n", caps.dwMinOverlayStretch, caps.dwMaxOverlayStretch ); if( caps.dwCaps & DDCAPS_VBI ) - dxwrite_log( "DDCAPS_VBI - h/w can generate a vertical-blanking interrupt\n" ); + dxwrite_log ( "DDCAPS_VBI - h/w can generate a vertical-blanking interrupt\n" ); if( caps.dwCaps2 & DDCAPS2_CERTIFIED ) - dxwrite_log( "DDCAPS2_CERTIFIED - certified driver\n" ); + dxwrite_log ( "DDCAPS2_CERTIFIED - certified driver\n" ); if( caps.dwCaps2 & DDCAPS2_CANRENDERWINDOWED ) - dxwrite_log( "DDCAPS2_CANRENDERWINDOWED - GDI windows can be seen when in full-screen\n" ); + dxwrite_log ( "DDCAPS2_CANRENDERWINDOWED - GDI windows can be seen when in full-screen\n" ); if( caps.dwCaps2 & DDCAPS2_NOPAGELOCKREQUIRED ) - dxwrite_log( "DDCAPS2_NOPAGELOCKREQUIRED - no page locking needed for DMA blits\n" ); + dxwrite_log ( "DDCAPS2_NOPAGELOCKREQUIRED - no page locking needed for DMA blits\n" ); if( caps.dwCaps2 & DDCAPS2_FLIPNOVSYNC ) - dxwrite_log( "DDCAPS2_FLIPNOVSYNC - can pass DDFLIP_NOVSYNC to Flip calls\n" ); + dxwrite_log ( "DDCAPS2_FLIPNOVSYNC - can pass DDFLIP_NOVSYNC to Flip calls\n" ); if( caps.dwCaps2 & DDCAPS2_FLIPINTERVAL ) { - dxwrite_log( "DDCAPS2_FLIPINTERVAL - can pass DDFLIP_INTERVALx to Flip calls\n" ); + dxwrite_log ( "DDCAPS2_FLIPINTERVAL - can pass DDFLIP_INTERVALx to Flip calls\n" ); flipinterval_supported = 1; } - - dxwrite_log( "Video memory: %d/%d\n", caps.dwVidMemFree, caps.dwVidMemTotal ); + + dxwrite_log ( "Video memory: %d/%d\n", caps.dwVidMemFree, caps.dwVidMemTotal ); } shown++; } @@ -271,7 +271,7 @@ static int LockStub( surface_type_e type ) if (FAILED(ddrval)) break; } - else if (ddrval != DDERR_SURFACEBUSY) + else if (ddrval != DDERR_SURFACEBUSY) { write_log ("lpDDS->Lock() failed - %s\n", DXError (ddrval)); break; @@ -281,7 +281,7 @@ static int LockStub( surface_type_e type ) static int warned = 10; DWORD_PTR pixels = (DWORD_PTR)(surfacedesc->lpSurface); if (warned > 0 && (pixels & 7)) { - write_log("bogus surface pointer %x!\n", pixels); + write_log ("bogus surface pointer %x!\n", pixels); warned--; } lockcnt++; @@ -595,19 +595,19 @@ static surface_type_e try_surface_locks(int want_fullscreen) if(DirectDrawState.isoverlay && DirectDraw_SurfaceLock(overlay_surface)) { result = overlay_surface; - write_log("try_surface_locks() returning overlay\n"); + write_log ("try_surface_locks() returning overlay\n"); } else if(want_fullscreen && WIN32GFX_IsPicassoScreen()) { if(DirectDraw_SurfaceLock(primary_surface)) { result = primary_surface; - write_log("try_surface_locks() returning primary\n"); + write_log ("try_surface_locks() returning primary\n"); } else if(DirectDraw_SurfaceLock(secondary_surface)) { result = secondary_surface; - write_log("try_surface_locks() returning secondary\n"); + write_log ("try_surface_locks() returning secondary\n"); } } else @@ -615,7 +615,7 @@ static surface_type_e try_surface_locks(int want_fullscreen) if(DirectDraw_SurfaceLock(secondary_surface)) { result = secondary_surface; - write_log("try_surface_locks() returning secondary\n"); + write_log ("try_surface_locks() returning secondary\n"); } } @@ -925,7 +925,7 @@ static DWORD ConvertGDIColor(COLORREF dwGDIColor) memset(&pdds,0,sizeof(pdds)); pdds.dwSize = sizeof(pdds); - + IDirectDrawSurface7_GetSurfaceDesc(DirectDrawState.primary.surface, &pdds); // Use GDI SetPixel to color match for us @@ -939,7 +939,7 @@ static DWORD ConvertGDIColor(COLORREF dwGDIColor) ddsd.dwSize = sizeof(ddsd); hr = IDirectDrawSurface7_Lock(DirectDrawState.primary.surface, NULL, &ddsd, DDLOCK_WAIT, NULL ); if(SUCCEEDED(hr)) { - dw = *(DWORD *) ddsd.lpSurface; + dw = *(DWORD *) ddsd.lpSurface; if(ddsd.ddpfPixelFormat.dwRGBBitCount < 32) // Mask it to bpp dw &= (1 << ddsd.ddpfPixelFormat.dwRGBBitCount) - 1; IDirectDrawSurface7_Unlock(DirectDrawState.primary.surface,NULL); @@ -951,7 +951,7 @@ static DWORD ConvertGDIColor(COLORREF dwGDIColor) IDirectDrawSurface7_ReleaseDC(DirectDrawState.primary.surface,hdc); } - return dw; + return dw; } @@ -968,33 +968,33 @@ HRESULT DirectDraw_CreateOverlaySurface(int width, int height, int bits, int typ ZeroMemory(&ddsd, sizeof(ddsd)); if (bOverlayAvailable) { - write_log( "CreateOverlaySurface being called with %d-bits!\n", bits ); + write_log ( "CreateOverlaySurface being called with %d-bits!\n", bits ); if(bits == 16) { // Set the overlay format to 16 bit RGB 5:6:5 ddpfOverlayFormat.dwFlags = flags; ddpfOverlayFormat.dwRGBBitCount = 16; - ddpfOverlayFormat.dwRBitMask = 0xF800; + ddpfOverlayFormat.dwRBitMask = 0xF800; ddpfOverlayFormat.dwGBitMask = 0x07E0; - ddpfOverlayFormat.dwBBitMask = 0x001F; + ddpfOverlayFormat.dwBBitMask = 0x001F; } else if(bits == 32) { // Set the overlay format to 32 bit ARGB 8:8:8:8 ddpfOverlayFormat.dwFlags = flags; ddpfOverlayFormat.dwRGBBitCount = 32; - ddpfOverlayFormat.dwRBitMask = 0x00FF0000; + ddpfOverlayFormat.dwRBitMask = 0x00FF0000; ddpfOverlayFormat.dwGBitMask = 0x0000FF00; - ddpfOverlayFormat.dwBBitMask = 0x000000FF; + ddpfOverlayFormat.dwBBitMask = 0x000000FF; } else if(bits == 8) { // Set the overlay format to 8 bit palette ddpfOverlayFormat.dwFlags = flags | DDPF_PALETTEINDEXED8; ddpfOverlayFormat.dwRGBBitCount = 8; - ddpfOverlayFormat.dwRBitMask = 0x00000000; + ddpfOverlayFormat.dwRBitMask = 0x00000000; ddpfOverlayFormat.dwGBitMask = 0x00000000; - ddpfOverlayFormat.dwBBitMask = 0x00000000; + ddpfOverlayFormat.dwBBitMask = 0x00000000; } else { // We don't handle this case... return DDERR_INVALIDPIXELFORMAT; } - + // Setup the overlay surface's attributes in the surface descriptor ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; @@ -1019,7 +1019,7 @@ HRESULT DirectDraw_CreateOverlaySurface(int width, int height, int bits, int typ DirectDrawState.isoverlay = 0; } } else { - write_log( "CreateOverlaySurface being called, but no overlay support with this card...!\n" ); + write_log ( "CreateOverlaySurface being called, but no overlay support with this card...!\n" ); } return ddrval; } @@ -1053,7 +1053,7 @@ HRESULT DirectDraw_CreateSurface(int width, int height) DirectDrawState.primary.desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; DirectDrawState.primary.desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; DirectDrawState.primary.desc.dwBackBufferCount = 2; - ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, + ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, &DirectDrawState.primary.desc, &DirectDrawState.primary.surface, NULL); if (FAILED(ddrval)) { // Create a non-flipping pair, since the flipping pair creation failed... @@ -1061,7 +1061,7 @@ HRESULT DirectDraw_CreateSurface(int width, int height) DirectDrawState.primary.desc.dwSize = sizeof(DDSURFACEDESC2); DirectDrawState.primary.desc.dwFlags = DDSD_CAPS; DirectDrawState.primary.desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, + ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, &DirectDrawState.primary.desc, &DirectDrawState.primary.surface, NULL); @@ -1075,14 +1075,14 @@ HRESULT DirectDraw_CreateSurface(int width, int height) DirectDrawState.primary.desc.dwSize = sizeof(DDSURFACEDESC2); DirectDrawState.primary.desc.dwFlags = DDSD_CAPS; DirectDrawState.primary.desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, + ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, &DirectDrawState.primary.desc, &DirectDrawState.primary.surface, NULL); } if(FAILED(ddrval)) goto errout; else - write_log( "DDRAW: Primary %ssurface created in video-memory\n", + write_log ( "DDRAW: Primary %ssurface created in video-memory\n", DirectDrawState.flipping != single_buffer ? "flipping " : ""); // Check if we can access the back-buffer of our flipping-pair (if present) @@ -1118,20 +1118,20 @@ HRESULT DirectDraw_CreateSurface(int width, int height) DirectDrawState.secondary.desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | xtraflag; DirectDrawState.secondary.desc.dwWidth = width; DirectDrawState.secondary.desc.dwHeight = height; - ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, + ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, &DirectDrawState.secondary.desc, &DirectDrawState.secondary.surface, NULL); if(FAILED(ddrval)) { - write_log( "DDRAW:Secondary surface creation attempt #1 failed with %s\n", DXError(ddrval)); + write_log ( "DDRAW:Secondary surface creation attempt #1 failed with %s\n", DXError(ddrval)); DirectDrawState.secondary.desc.ddsCaps.dwCaps &= ~DDSCAPS_VIDEOMEMORY; DirectDrawState.secondary.desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; - ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, + ddrval = IDirectDraw7_CreateSurface(DirectDrawState.directdraw.dd, &DirectDrawState.secondary.desc, &DirectDrawState.secondary.surface, NULL); if(SUCCEEDED(ddrval)) - write_log("DDRAW: Secondary surface created in plain system-memory\n"); + write_log ("DDRAW: Secondary surface created in plain system-memory\n"); else goto errout; } else { - write_log("DDRAW: Secondary surface created in video-memory\n"); + write_log ("DDRAW: Secondary surface created in video-memory\n"); } } DirectDraw_ClearSurfaces (); @@ -1166,7 +1166,7 @@ int DirectDraw_DetermineLocking( int wantfull ) DirectDrawState.lockable.lpdesc = NULL; DirectDrawState.lockable.surface = NULL; DirectDrawState.lockable.surface = NULL; - write_log("set_ddraw: Couldn't lock primary, and no secondary available.\n"); + write_log ("set_ddraw: Couldn't lock primary, and no secondary available.\n"); break; case primary_surface: DirectDrawState.lockable.lpdesc = &DirectDrawState.primary.desc; @@ -1329,7 +1329,7 @@ HRESULT DirectDraw_CreatePalette(LPPALETTEENTRY pal) ddrval = IDirectDraw_CreatePalette(DirectDrawState.directdraw.dd, DDPCAPS_8BIT | DDPCAPS_ALLOW256, pal, &DirectDrawState.lpDDP, NULL); if(SUCCEEDED(ddrval)) - ddrval = DirectDraw_SetPalette(0); + ddrval = DirectDraw_SetPalette(0); return ddrval; } @@ -1428,7 +1428,7 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat(LPDDSURFACEDESC2 surface) if (r == 0x0000FF00 && g == 0x00FF0000 && b == 0xFF000000) return RGBFB_A8R8G8B8; break; - + default: write_log ("Unknown %d bit format %d %d %d\n", pfp->dwRGBBitCount, r, g, b); break; @@ -1546,7 +1546,7 @@ static int DirectDraw_BltFastStub4(LPDIRECTDRAWSURFACE7 dstsurf, DWORD x, DWORD if (FAILED(ddrval)) break; } else if (ddrval != DDERR_SURFACEBUSY) { - write_log("BltFastStub7(): DirectDrawSURFACE7_BltFast() failed with %s\n", DXError (ddrval)); + write_log ("BltFastStub7(): DirectDrawSURFACE7_BltFast() failed with %s\n", DXError (ddrval)); break; } } @@ -1620,7 +1620,7 @@ static HRESULT DirectDraw_BltStub(LPDIRECTDRAWSURFACE7 dstsurf, LPRECT dstrect, break; } } else if (ddrval != DDERR_SURFACEBUSY) { - write_log("BltStub(): DirectDrawSURFACE7_Blt() failed with %s\n", DXError (ddrval)); + write_log ("BltStub(): DirectDrawSURFACE7_Blt() failed with %s\n", DXError (ddrval)); break; } } @@ -1650,7 +1650,7 @@ int DirectDraw_Flip(int wait) DWORD flags = DDFLIP_WAIT; static int skip; frame_time_t start; - + start = read_processor_time (); if (DirectDrawState.flipping == triple_buffer) { if (!currprefs.gfx_afullscreen && !currprefs.gfx_avsync) { @@ -1703,7 +1703,7 @@ int DirectDraw_Flip(int wait) recurse--; } } else { - write_log("FLIP: DirectDrawSurface_Flip() failed with %s\n", DXError (ddrval)); + write_log ("FLIP: DirectDrawSurface_Flip() failed with %s\n", DXError (ddrval)); } } return result; @@ -1729,7 +1729,7 @@ HRESULT DirectDraw_Blt(surface_type_e dsttype, LPRECT dstrect, DWORD flags, LPDDBLTFX fx) { LPDIRECTDRAWSURFACE7 lpDDS4_dst, lpDDS4_src; - + if(dsttype == primary_surface) { if(DirectDrawState.isoverlay) lpDDS4_dst = DirectDrawState.overlay.surface; @@ -1902,11 +1902,11 @@ HRESULT DirectDraw_UpdateOverlay(RECT sr, RECT dr) if ((drivercaps.dwCaps & DDCAPS_ALIGNSIZESRC) && drivercaps.dwAlignSizeSrc) sr.right = sr.left + (sr.right - sr.left + drivercaps.dwAlignSizeSrc / 2) & ~(drivercaps.dwAlignSizeSrc - 1); if ((drivercaps.dwCaps & DDCAPS_ALIGNBOUNDARYDEST) && drivercaps.dwAlignBoundaryDest) - dr.left = (dr.left + drivercaps.dwAlignBoundaryDest / 2) & ~(drivercaps.dwAlignBoundaryDest - 1); + dr.left = (dr.left + drivercaps.dwAlignBoundaryDest / 2) & ~(drivercaps.dwAlignBoundaryDest - 1); if ((drivercaps.dwCaps & DDCAPS_ALIGNSIZEDEST) && drivercaps.dwAlignSizeDest) dr.right = dr.left + (dr.right - dr.left) & ~(drivercaps.dwAlignSizeDest - 1); result = IDirectDrawSurface7_UpdateOverlay(DirectDrawState.overlay.surface, &sr, DirectDrawState.primary.surface, &dr, overlayflags, &overlayfx); - + } if (FAILED(result)) { if (result == DDERR_SURFACELOST) @@ -1932,7 +1932,7 @@ int DirectDraw_GetPrimaryPixelFormat (LPDDPIXELFORMAT ddpf) { surface_type_e surface_type; HRESULT ddrval; - + surface_type = DirectDraw_GetLockableType (); ddpf->dwSize = sizeof (DDPIXELFORMAT); if (surface_type == overlay_surface) diff --git a/od-win32/dxwrap.h b/od-win32/dxwrap.h index 67b7401d..4141774c 100755 --- a/od-win32/dxwrap.h +++ b/od-win32/dxwrap.h @@ -158,42 +158,42 @@ struct DirectDrawSurfaceMapper HWND window; struct { - LPDIRECTDRAW ddx; - LPDIRECTDRAW7 dd; + LPDIRECTDRAW ddx; + LPDIRECTDRAW7 dd; } directdraw; struct { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; + LPDIRECTDRAWSURFACE7 surface; + DDSURFACEDESC2 desc; } primary; struct { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; + LPDIRECTDRAWSURFACE7 surface; + DDSURFACEDESC2 desc; } secondary; struct { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; + LPDIRECTDRAWSURFACE7 surface; + DDSURFACEDESC2 desc; } tertiary; struct { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; + LPDIRECTDRAWSURFACE7 surface; + DDSURFACEDESC2 desc; } overlay; struct { - LPDIRECTDRAWSURFACE7 surface; - DDSURFACEDESC2 desc; + LPDIRECTDRAWSURFACE7 surface; + DDSURFACEDESC2 desc; } temporary; struct { - DDSURFACEDESC2 desc; + DDSURFACEDESC2 desc; } current; struct { - LPDIRECTDRAWSURFACE7 surface; - LPDDSURFACEDESC2 lpdesc; + LPDIRECTDRAWSURFACE7 surface; + LPDDSURFACEDESC2 lpdesc; } lockable; LPDIRECTDRAWCLIPPER lpDDC; LPDIRECTDRAWPALETTE lpDDP; diff --git a/od-win32/fdrawcmd.c b/od-win32/fdrawcmd.c index 51ad9f20..5022afa6 100755 --- a/od-win32/fdrawcmd.c +++ b/od-win32/fdrawcmd.c @@ -63,7 +63,7 @@ static int opendevice(void) h = CreateFile("\\\\.\\fdraw0", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (h == INVALID_HANDLE_VALUE) return 0; - b = 0; // 500Kbps + b = 0; // 500Kbps if (!DeviceIoControl(h, IOCTL_FD_SET_DATA_RATE, &b, sizeof b, NULL, 0, &ret, NULL)) { printf("IOCTL_FD_SET_DATA_RATE=%d failed err=%d\n", b, GetLastError()); closedevice(); @@ -95,7 +95,7 @@ static int readraw(int cyl, int head) if (!seek(cyl, head)) return 0; - rrp.flags = FD_OPTION_MFM; + rrp.flags = FD_OPTION_MFM; rrp.head = head; rrp.size = 7; memset (trackbuffer, 0, TRACK_SIZE); diff --git a/od-win32/filesys.asm b/od-win32/filesys.asm new file mode 100755 index 00000000..21b93a7d --- /dev/null +++ b/od-win32/filesys.asm @@ -0,0 +1,1354 @@ + SECTION code,code +; This file can be translated with A68k or PhxAss and then linked with BLink +; to produce an Amiga executable. Make sure it does not contain any +; relocations, then run it through the filesys.sh script +; +; Patrick: It also works with SAS/C asm+slink, but I had to remove +; the .l from jsr.l and jmp.l. +; Toni Wilen: modified SECTION, compiles now with AsmOne and clones(?) +; Removed absolute RT_AREA references +; 2002.08.06 RDB automount/autoboot support (Toni Wilen) +; 2002.09.11 KS1.3 RDB support (TW) +; 200?.??.?? Picasso96 vblank hack (TW) +; 2006.03.04 Mousehack code integrated (TW) +; 2006.18.07 FileSystem.resource find routine access fault fixed (TW) +; 2007.03.30 mousehack do not start multiple times anymore (TW) +; 2007.06.15 uninitialized variable in memory type selection fixed (stupid me) (TW) +; 2007.08.09 started implementing removable drive support (TW) + +AllocMem = -198 +FreeMem = -210 + +; don't forget filesys.c! */ +PP_MAXSIZE = 4 * 96 +PP_FSSIZE = 400 +PP_FSPTR = 404 +PP_FSRES = 408 +PP_EXPLIB = 412 +PP_FSHDSTART = 416 +PP_TOTAL = (PP_FSHDSTART+140) + +NOTIFY_CLASS = $40000000 +NOTIFY_CODE = $1234 +NRF_SEND_MESSAGE = 1 +NRF_SEND_SIGNAL = 2 +NRF_WAIT_REPLY = 8 +NRF_NOTIFY_INITIAL = 16 +NRF_MAGIC = $80000000 + + dc.l 16 +our_seglist: + dc.l 0 ;/* NextSeg */ +start: + bra filesys_mainloop + dc.l make_dev-start + dc.l filesys_init-start + dc.l exter_server-start + dc.l bootcode-start + dc.l setup_exter-start + + dc.l p96vsyncfix1-start + dc.l mousehack_x-start + +bootcode: + lea.l doslibname(pc),a1 + jsr -96(a6) ; FindResident + move.l d0,a0 + move.l 22(a0),d0 + move.l d0,a0 + jsr (a0) + rts + +filesys_init: + movem.l d0-d7/a0-a6,-(sp) + move.l 4.w,a6 + move.w #$FFFC,d0 ; filesys base + bsr getrtbase + move.l (a0),a5 + lea.l explibname(pc),a1 ; expansion lib name + moveq #36,d0 + moveq #0,d5 + jsr -552(a6) ; OpenLibrary + tst.l d0 + bne.b FSIN_explibok + lea.l explibname(pc),a1 ; expansion lib name + moveq #0,d0 + moveq #1,d5 + jsr -552(a6) ; OpenLibrary +FSIN_explibok: + move.l d0,a4 + move.l #PP_TOTAL,d0 + moveq #1,d1 ; MEMF_PUBLIC + jsr AllocMem(a6) + move.l d0,a3 ; param packet + move.l a4,PP_EXPLIB(a3) + + moveq #0,d6 +FSIN_init_units: + cmp.l $10c(a5),d6 + bcc.b FSIN_units_ok + move.l d6,-(sp) +FSIN_nextsub: + moveq #1,d7 + move.l a3,-(sp) + move.l a3,a0 + bsr.w make_dev + move.l (sp)+,a3 + cmp.l #-2,d0 + beq.s FSIN_nomoresub + swap d6 + addq.w #1,d6 + swap d6 + bra.s FSIN_nextsub +FSIN_nomoresub: + move.l (sp)+,d6 + addq.w #1,d6 + bra.b FSIN_init_units + +FSIN_units_ok: + move.l 4.w,a6 + move.l a4,a1 + jsr -414(a6) ; CloseLibrary + +; move.w #$FF80,d0 +; bsr.w getrtbase +; jsr (a0) +; jsr -$0078(a6) ; Disable +; lea 322(a6),a0 ; MemHeader +;FSIN_scanchip: +; move.l (a0),a0 ; first MemList +; tst.l (a0) +; beq.s FSIN_scandone +; move.w 14(a0),d1 ; attributes +; and #2,d1 ; MEMF_CHIP? +; beq.s FSIN_scanchip +; sub.l 24(a0),d0 ; did KS detect all chip? +; bmi.s FSIN_scandone +; beq.s FSIN_scandone +; ; add the missing piece +; add.l d0,24(a0) ; mh_Upper +; add.l d0,28(a0) ; mh_Free +; add.l d0,62(a6) ; MaxLocMem +; ; we still need to update last node's free space +; move.l 16(a0),a0 ; mh_First +;FSIN_chiploop2 +; tst.l (a0) +; beq.s FSIN_chiploop +; move.l (a0),a0 +; bra.s FSIN_chiploop2 +;FSIN_chiploop: +; add.l d0,4(a0) +;FSIN_scandone: +; jsr -$007e(a6) ; Enable + + ; add >2MB chip RAM to memory list + move.w #$FF80,d0 + bsr.w getrtbase + jsr (a0) + moveq.l #3,d1 + moveq.l #-10,d2 + move.l #$200000,a0 + sub.l a0,d0 + bcs.b FSIN_chip_done + beq.b FSIN_chip_done + moveq.l #0,d4 + move.l d4,a1 + jsr -618(a6) ; AddMemList +FSIN_chip_done + + movem.l (sp)+,d0-d7/a0-a6 +general_ret: + rts + +exter_data: +exter_server: + movem.l a2,-(sp) + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbase + moveq.l #0,d0 + jsr (a0) + tst.l d0 + beq.w exter_server_exit + ; This is the hard part - we have to send some messages. + move.l 4.w,a6 +EXTS_loop: + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbase + moveq.l #2,d0 + jsr (a0) + cmp.w #1,d0 + blt.b EXTS_done + bgt.b EXTS_signal_reply + jsr -366(a6) ; PutMsg + bra.b EXTS_loop +EXTS_signal_reply: + cmp.w #2,d0 + bgt.b EXTS_reply + move.l d1,d0 + jsr -$144(a6) ; Signal + bra.b EXTS_loop +EXTS_reply: + cmp.w #3,d0 + bgt.b EXTS_cause + jsr -$17a(a6) ; ReplyMsg + bra.b EXTS_loop +EXTS_cause: + cmp.w #4,d0 + bgt.b EXTS_notificationhack + jsr -$b4(a6) ; Cause + bra.b EXTS_loop +EXTS_notificationhack: + cmp.w #5,d0 + bgt.b EXTS_done + movem.l a0-a1,-(sp) + moveq #38,d0 + move.l #65536+1,d1 + jsr AllocMem(a6) + movem.l (sp)+,a0-a1 + move.l d0,a2 + move.b #8,8(a2) + move.l a0,14(a2) + move.w #38,18(a2) + move.l #NOTIFY_CLASS,20(a2) + move.w #NOTIFY_CODE,24(a2) + move.l a1,26(a2) + move.l 16(a1),a0 + move.l a2,a1 + jsr -366(a6) ; PutMsg + bra.w EXTS_loop +EXTS_done: + move.w #$FF50,d0 ;exter_int_helper + bsr.w getrtbase + moveq.l #4,d0 + jsr (a0) + moveq.l #1,d0 ; clear Z - it was for us. +exter_server_exit: + movem.l (sp)+,a2 + rts + +setup_exter: + movem.l d0-d1/a0-a1,-(sp) + moveq.l #26,d0 + move.l #$10001,d1 + jsr AllocMem(a6) + move.l d0,a1 + lea.l exter_name(pc),a0 + move.l a0,10(a1) + lea.l exter_data(pc),a0 + move.l a0,14(a1) + lea.l exter_server(pc),a0 + move.l a0,18(a1) + move.w #$0214,8(a1) + moveq.l #3,d0 + jsr -168(a6) ; AddIntServer + movem.l (sp)+,d0-d1/a0-a1 + rts + +addfs: ; a0 = first hunk, a1 = parmpacket + movem.l d0-d1/a0-a3/a6,-(sp) + move.l 4.w,a6 + move.l a0,a2 + move.l a1,a3 + move.l #62+128,d0 ; sizeof(FileSysEntry) + patchflags; + move.l #$10001,d1 + jsr -198(a6) + move.l d0,a0 + moveq #0,d0 + lea PP_FSHDSTART(a3),a1 +af1 move.b 0(a1,d0.w),14(a0,d0.w) + addq.w #1,d0 + cmp.w #140,d0 + bne.s af1 + move.l a2,d0 + lsr.l #2,d0 + move.l d0,54(a0) ;seglist + move.l a0,a1 + lea exter_name(pc),a0 + move.l a0,10(a1) ; name + move.l PP_FSRES(a3),a0 ; FileSystem.resource + lea 18(a0),a0 ; fsr_FileSysEntries + jsr -$f0(a6) ;AddHead + movem.l (sp)+,d0-d1/a0-a3/a6 + rts + +relocate: ;a0=pointer to executable, returns first segment in A0 + movem.l d1-d7/a1-a6,-(sp) + move.l 4.w,a6 + move.l a0,a2 + cmp.l #$3f3,(a2)+ + bne.w ree + addq.l #8,a2 ; skip name end and skip total hunks + 1 + move.l 4(a2),d7 ; last hunk + sub.l (a2),d7 ; first hunk + addq.l #8,a2 ; skip hunk to load first and hunk to load last + addq.l #1,d7 + move.l a2,a3 + move.l d7,d0 + add.l d0,d0 + add.l d0,d0 + add.l d0,a3 + move.l a2,a4 + + ; allocate hunks + sub.l a5,a5 ;prev segment + moveq #0,d6 +r15 move.l (a2),d2 ; hunk size (header) + moveq #1,d1 + btst #30,d2 ; chip mem? + beq.s r2 + bset #1,d1 +r2 bset #16,d1 + lsl.l #2,d2 + move.l d2,d0 + bne.s r17 + clr.l (a2)+ ; empty hunk + bra.s r18 +r17 addq.l #8,d0 ; size + pointer to next hunk + hunk size + jsr AllocMem(a6) + tst.l d0 + beq.w ree + move.l d0,a0 + move.l d2,(a0)+ ; store size + move.l a0,(a2)+ ; store new pointer + move.l a5,d1 + beq.s r10 + move.l a0,d0 + lsr.l #2,d0 + move.l d0,(a5) +r10 move.l a0,a5 +r18 addq.l #1,d6 + cmp.l d6,d7 + bne.s r15 + + moveq #0,d6 +r3 move.l d6,d1 + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),a0 + addq.l #4,a0 + move.l (a3)+,d3 ; hunk type + move.l (a3)+,d4 ; hunk size + lsl.l #2,d4 + cmp.l #$3e9,d3 ;code + beq.s r4 + cmp.l #$3ea,d3 ;data + bne.s r5 +r4 + ; code and data + move.l d4,d0 +r6 tst.l d0 + beq.s r7 + move.b (a3)+,(a0)+ + subq.l #1,d0 + bra.s r6 +r5 + cmp.l #$3eb,d3 ;bss + bne.s ree + +r7 ; scan for reloc32 or hunk_end + move.l (a3)+,d3 + cmp.l #$3ec,d3 ;reloc32 + bne.s r13 + + ; relocate + move.l d6,d1 + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),a0 ; current hunk + addq.l #4,a0 +r11 move.l (a3)+,d0 ;number of relocs + beq.s r7 + move.l (a3)+,d1 ;hunk + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),d3 ;hunk start address + addq.l #4,d3 +r9 move.l (a3)+,d2 ;offset + add.l d3,0(a0,d2.l) + subq.l #1,d0 + bne.s r9 + bra.s r11 +r13 + cmp.l #$3f2,d3 ;end + bne.s ree + + addq.l #1,d6 + cmp.l d6,d7 + bne.w r3 + + moveq #1,d7 + move.l (a4),a0 +r0 move.l d7,d0 + movem.l (sp)+,d1-d7/a1-a6 + rts +ree move.w #30000,d0 +re1 move.w #$f00,$dff180 + move.w #$00f,$dff180 + move.w #$0f0,$dff180 + dbf d0,re1 + moveq #0,d7 + bra.s r0 + +fsres + movem.l d1/a0-a2/a6,-(sp) + move.l 4.w,a6 + lea $150(a6),a0 ;ResourceList + move.l (a0),a0 ;lh_Head +fsres3 + tst.l (a0) ;end of list? + beq.s fsres1 + move.l 10(a0),a1 ;name + lea fsresname(pc),a2 +fsres5 + move.b (a1)+,d0 + move.b (a2)+,d1 + cmp.b d1,d0 + bne.s fsres2 + tst.b d0 + beq.s fsres4 + bra.s fsres5 +fsres2 + move.l (a0),a0 + bra.s fsres3 + ; FileSystem.resource does not exist -> create it +fsres1 + moveq #32,d0 ; sizeof(FileSysResource) + move.l #$10001,d1 + jsr AllocMem(a6) + move.l d0,a2 + move.b #8,8(a2) ; NT_RESOURCE + lea fsresname(pc),a0 + move.l a0,10(a2) ; node name + lea exter_name(pc),a0 + move.l a0,14(a2) ; fsr_Creator + lea 18(a2),a0 + move.l a0,(a0) ; NewList() fsr_FileSysEntries + addq.l #4,(a0) + move.l a0,8(a0) + lea $150(a6),a0 ; ResourceList + move.l a2,a1 + jsr -$f6(a6) ; AddTail + move.l a2,a0 +fsres4 + move.l a0,d0 + movem.l (sp)+,d1/a0-a2/a6 + rts + +addvolumenode + move.l a6,-(sp) + tst.b 32+44(a3) + beq.s .end ;empty volume string = empty drive + move.l 160(a3),a6 + cmp.w #37, 20(a6) + bcs.s .prev37 + moveq #(1<<1)+(1<<3),d1 ;LDF_WRITE | LDF_VOLUMES + jsr -$29A(a6) ;AttemptLockDosList + and.l #~1,d0 + beq.s .end + lea 32(a3),a0 + move.l a0,d1 + jsr -$2A6(a6) ;AddDosEntry + moveq #(1<<1)+(1<<3),d1 ;LDF_WRITE | LDF_VOLUMES + jsr -$294(a6) ;UnLockDosList + bra.s .end +.prev37 move.l 4.w,a6 + jsr -$0084(a6) ; Forbid + move.l 160(a3),a0 + move.l 34(a0),a0 ; rootnode + add.l a0,a0 + add.l a0,a0 + move.l 24(a0),a0 ; dosinfo + add.l a0,a0 + add.l a0,a0 + lea 32(a3),a1 + move.l 4(a0),(a1) + move.l a1,d0 + lsr.l #2,d0 + move.l d0,4(a0) + jsr -$008a(a6) ;Permit +.end move.l (sp)+,a6 + rts +remvolumenode + movem.l a2/a6,-(sp) + move.l 160(a3),a6 + cmp.w #37, 20(a6) + bcs.s .prev37 + moveq #(1<<1)+(1<<3),d1 ;LDF_WRITE | LDF_VOLUMES + jsr -$29A(a6) ;AttemptLockDosList + and.l #~1,d0 + beq.s .end + lea 32(a3),a0 + move.l a0,d1 + jsr -$2A0(a6) ;RemDosEntry + moveq #(1<<1)+(1<<3),d1 ;LDF_WRITE | LDF_VOLUMES + jsr -$294(a6) ;UnLockDosList + bra.s .end +.prev37 move.l 4.w,a6 + jsr -$0084(a6) ; Forbid + move.l 160(a3),a0 + move.l 34(a0),a0 ; rootnode + add.l a0,a0 + add.l a0,a0 + move.l 24(a0),a0 ; dosinfo + add.l a0,a0 + add.l a0,a0 + lea 4(a0),a1 + lea 32(a3),a2 +.pr2 move.l 4(a0),d0 + beq.s .pr1 + add.l d0,d0 + add.l d0,d0 + cmp.l d0,a2 + beq.s .pr3 + move.l d0,a1 + move.l (a1),a0 + add.l a0,a0 + add.l a0,a0 + bra.s .pr2 +.pr3 move.l (a2),(a1) +.pr1 jsr -$008a(a6) ;Permit +.end movem.l (sp)+,a2/a6 + rts + +diskinsertremove: + movem.l d2/a2/a6,-(sp) + moveq #22,d2 + sub.l d2,sp + move.l sp,a2 + move.w d2,d1 +.l1 clr.b 0(a2,d1.w) + subq.w #1,d1 + bne.s .l1 + move.l 4.w,a6 + moveq #15,d1 ;IECLASS_DISKREMOVED + tst.l d0 + beq.s .l2 + moveq #16,d1 ;IECLASS_DISKINSERTED +.l2 move.b d1,4(a2) ;ie_Class + move.w #$0800,8(a2); ie_Qualifier=IEQUALIFIER_MULTIBROADCAST + + move.l 164(a3),a1 + move.w #11,28(a1) ;IND_WRITEEVENT + move.l #22,36(a1) ;sizeof(struct InputEvent) + move.l a2,40(a1) + move.b #1,30(a1) ;IOF_QUICK + + move.l 168(a3),a1 + move.w #10,28(a1) ;TR_GETSYSTIME + move.b #1,30(a1) ;IOF_QUICK + jsr -$01c8(a6) ;DoIO + + move.l 168(a3),a1 + move.l 32(a1),14(a2) + move.l 36(a1),18(a2) + + move.l 164(a3),a1 + jsr -$01c8(a6) ;DoIO + + add.l d2,sp + movem.l (sp)+,d2/a2/a6 + rts + +dodiskchange + tst.b d0 + beq.s .eject + tst.b 32+44(a3) + bne.s .end + moveq #0,d0 +.dc2 + tst.b 32+45(a3,d0.w) + beq.s .dc1 + addq.b #1,d0 + bra.s .dc2 +.dc1 + move.b d0,32+44(a3) + beq.s .end + bsr.w addvolumenode + moveq #1,d0 + bsr.w diskinsertremove + bra.s .end +.eject + tst.b 32+44(a3) + beq.s .end + clr.b 32+44(a3) + bsr.w remvolumenode + moveq #0,d0 + bsr.w diskinsertremove +.end + rts + +action_inhibit + tst.l 20(a4) ;dp_Arg1 + beq.s .add + moveq #0,d0 + bsr dodiskchange + rts +.add + moveq #1,d0 + bsr dodiskchange + rts + +diskchange + tst.b 172(a3) + bmi.s .nodisk + moveq #1,d0 + bsr dodiskchange + rts +.nodisk + moveq #0,d0 + bsr dodiskchange + rts + + ; exall is complex, need to emulate eac_MatchString and/or eac_MatchFunc +action_exall + move.l 36(a4),a0 ; dp_Arg5, struct ExAllControl + tst.l 8(a0) ; eac_MatchString + bne.s .ex1 + tst.l 12(a0) ; eac_MatchFunc + bne.s .ex1 + rts ;nothing to do here +.ex1: movem.l d2-d7/a2-a6,-(sp) + move.l a0,a5 + move.l 24(a4),a2 ;dp_Arg2, ExAllData + move.l (a5),d7 ; eac_Entries +.ex4 tst.l d7 + beq.s .ex3 + move.l a2,d0 + beq.s .ex3 + moveq #0,d6 + move.l 8(a5),d1 ; MatchString + beq.s .ex5 + move.l 4(a2),d2 ; dir/file name + move.l 160(a3),a6 ; dosbase + jsr -$03cc(a6) ; MatchPatternNoCase + tst.l d0 + bne.s .ex5 + st d6 +.ex5 move.l 12(a5),d1 ; MatchFunc + beq.s .ex6 + move.l d1,a0 + move.l a2,a1 + move.l a2,-(sp) + lea 32(a4),a2 ; dp_Arg4, Type + pea .pop(pc) + move.l 8(a0),-(sp) + rts +.pop move.l (sp)+,a2 + tst.l d0 + bne.s .ex6 + st d6 +.ex6 tst.b d6 + beq.s .ex7 + ; need to delete current entry.. this is not really the proper way.. + move.l 4(a2),d0 ; pointer to filename (which is first address after structure) + sub.l a2,d0 ; copy this much data + tst.l (a2) ; eac_Next + beq.s .ex8 + move.l (a2),a0 + move.l a2,a1 +.ex9 move.l (a0)+,(a1)+ + subq.l #4,d1 + bpl.s .ex9 +.ex8 subq.l #1,(a5) ; eac_Entries + subq.l #1,d7 + bra.s .ex4 +.ex7 move.l (a2),a2 + subq.l #1,d7 + bra.s .ex4 +.ex3 movem.l (sp)+,d2-d7/a2-a6 + rts + + + +make_dev: ; IN: A0 param_packet, D6: unit_no, D7: boot, A4: expansionbase + + bsr.w fsres + move.l d0,PP_FSRES(a0) ; pointer to FileSystem.resource + move.l a0,-(sp) + move.w #$FFFC,d0 ; filesys base + bsr.w getrtbase + move.l (a0),a5 + move.w #$FF28,d0 ; fill in unit-dependent info (filesys_dev_storeinfo) + bsr.w getrtbase + move.l a0,a1 + move.l (sp)+,a0 + clr.l PP_FSSIZE(a0) ; filesystem size + clr.l PP_FSPTR(a0) ; filesystem memory + jsr (a1) + ; ret:0=virtual,1=hardfile,2=rdbhardfile,-1=hardfile-donotmount,-2=no more subunits + move.l d0,d3 + cmp.l #-2,d3 + beq.w general_ret + cmp.l #2,d3 + beq.s mountalways + + ; KS < V36: init regular hardfiles only if filesystem is loaded + and.l d5,d0 + beq.s mountalways ; >= 36 + tst.l PP_FSSIZE(a0) + beq.w general_ret ; no filesystem -> don't mount + +mountalways + ; allocate memory for loaded filesystem + move.l PP_FSSIZE(a0),d0 + beq.s nordbfs1 + move.l a0,-(sp) + moveq #1,d1 + move.l 4.w,a6 + jsr AllocMem(a6) + move.l (sp)+,a0 + move.l d0,PP_FSPTR(a0) +nordbfs1: + + tst.l d3 + bpl.s do_mount + + ; do not mount but we might need to load possible custom filesystem(s) + move.l a0,a1 + move.w #$FF20,d0 ; record in ui.startup (filesys_dev_remember) + bsr.w getrtbase + jsr (a0) + bra.w dont_mount + +do_mount: + move.l a4,a6 + move.l a0,-(sp) + jsr -144(a6) ; MakeDosNode() + move.l (sp)+,a0 ; parmpacket + move.l a0,a1 + move.l d0,a3 ; devicenode + move.w #$FF20,d0 ; record in ui.startup (filesys_dev_remember) + bsr.w getrtbase + jsr (a0) + moveq #0,d0 + move.l d0,8(a3) ; dn_Task + move.l d0,16(a3) ; dn_Handler + move.l d0,32(a3) ; dn_SegList + +dont_mount + tst.l PP_FSPTR(a1) ; filesystem? + beq.s nordbfs2 + move.l PP_FSPTR(a1),a0 + bsr.w relocate + movem.l d0/a0-a1,-(sp) + move.l PP_FSSIZE(a1),d0 + move.l PP_FSPTR(a1),a1 + move.l 4.w,a6 + jsr FreeMem(a6) + movem.l (sp)+,d0/a0-a1 + tst.l d0 + beq.s nordbfs2 + bsr.w addfs +nordbfs2: + + tst.l d3 + bmi.w general_ret + + move.w #$FF18,d0 ; update dn_SegList if needed (filesys_dev_bootfilesys) + bsr.w getrtbase + jsr (a0) + + move.l d3,d0 + move.b 79(a1),d3 ; bootpri + tst.l d0 + bne.b MKDV_doboot + +MKDV_is_filesys: + move.l #4000,20(a3) ; dn_StackSize + lea.l our_seglist(pc),a1 + move.l a1,d0 + lsr.l #2,d0 + move.l d0,32(a3) ; dn_SegList + moveq #-1,d0 + move.l d0,36(a3) ; dn_GlobalVec + +MKDV_doboot: + tst.l d7 + beq.b MKDV_noboot + + move.l 4.w,a6 + moveq.l #20,d0 + moveq.l #0,d1 + jsr AllocMem(a6) + move.l d0,a1 ; bootnode + moveq #0,d0 + move.l d0,(a1) + move.l d0,4(a1) + move.w d0,14(a1) + move.w #$1000,d0 + or.b d3,d0 + move.w d0,8(a1) + move.l $104(a5),10(a1) ; filesys_configdev + move.l a3,16(a1) ; devicenode + lea.l 74(a4),a0 ; MountList + jmp -270(a6) ; Enqueue() + +MKDV_noboot: + move.l a3,a0 + moveq #0,d1 + move.l d1,a1 + moveq #-1,d0 + move.l a4,a6 ; expansion base + jmp -150(a6) ; AddDosNode + +filesys_mainloop: + move.l 4.w,a6 + sub.l a1,a1 + jsr -294(a6) ; FindTask + move.l d0,a0 + lea.l $5c(a0),a5 ; pr_MsgPort + + ; Open DOS library + lea.l doslibname(pc),a1 + moveq.l #0,d0 + jsr -552(a6) ; OpenLibrary + move.l d0,a2 + + ; Allocate some memory. Usage: + ; 0: lock chain + ; 4: command chain + ; 8: second thread's lock chain + ; 12: dummy message + ; 32: the volume (80+44+1 bytes) + ; 157: mousehack started-flag + ; 160: dosbase + ; 164: input.device ioreq (disk inserted/removed input message) + ; 168: timer.device ioreq + ; 172: disk change from host + ; 176: my task + move.l #12+20+(80+44+1)+(1+3)+4+4+4+(1+3)+4,d0 + move.l #$10001,d1 ; MEMF_PUBLIC | MEMF_CLEAR + jsr AllocMem(a6) + move.l d0,a3 + moveq.l #0,d6 + move.l d6,(a3) + move.l d6,4(a3) + move.l d6,8(a3) + move.l a2,160(a3) + + sub.l a1,a1 + jsr -294(a6) ; FindTask + move.l d0,176(a3) + + bsr.w allocinputdevice + move.l d0,164(a3) + bsr.w alloctimerdevice + move.l d0,168(a3) + + moveq.l #0,d5 ; No commands queued. + + ; Fetch our startup packet + move.l a5,a0 + jsr -384(a6) ; WaitPort + move.l a5,a0 + jsr -372(a6) ; GetMsg + move.l d0,a4 + move.l 10(a4),d3 ; ln_Name + move.w #$FF40,d0 ; startup_handler + bsr.w getrtbase + moveq.l #0,d0 + jsr (a0) + + bsr.w addvolumenode + + bsr.w mousehack_init + bra.w FSML_Reply + + ; We abuse some of the fields of the message we get. Offset 0 is + ; used for chaining unprocessed commands, and offset 1 is used for + ; indicating the status of a command. 0 means the command was handed + ; off to some UAE thread and did not complete yet, 1 means we didn't + ; even hand it over yet because we were afraid that might blow some + ; pipe limit, and -1 means the command was handed over and has completed + ; processing by now, so it's safe to reply to it. + +FSML_loop: + bsr.w mousehack_init + + move.l a5,a0 + jsr -372(a6) ; GetMsg + move.l d0,a4 + tst.l d0 + bne.s .msg + + moveq #0,d0 + move.b 15(a5),d1 ;mp_SigBit + bset d1,d0 + bset #17,d0 ; SIGBREAK_CTRL_D + jsr -$013e(a6) ;Wait +.msg + ; disk changed? + tst.b 172(a3) + beq.s .nodc + bsr.w diskchange + clr.b 172(a3) +.nodc + move.l a4,d0 + beq.s FSML_loop + + ; notify reply? + cmp.w #38, 18(a4) + bne.s nonotif + cmp.l #NOTIFY_CLASS, 20(a4) + bne.s nonotif + cmp.w #NOTIFY_CODE, 24(a4) + bne.s nonotif + move.l 26(a4),a0 ; NotifyRequest + move.l 12(a0),d0 ; flags + and.l #NRF_WAIT_REPLY|NRF_MAGIC,d0 + cmp.l #NRF_WAIT_REPLY|NRF_MAGIC,d0 + bne.s nonoti + and.l #~NRF_MAGIC,12(a0) + move.l 16(a0),a0 + move.l a4,a1 + move.b #8,(a1) + jsr -366(a6) ; PutMsg + bra.s FSML_loop +nonoti + move.l a4,a1 + moveq #38,d0 + jsr FreeMem(a6) + bra.w FSML_loop + +nonotif + move.l 10(a4),d3 ; ln_Name + bne.b FSML_FromDOS + + ; It's a dummy packet indicating that some queued command finished. + move.w #$FF50,d0 ; exter_int_helper + bsr.w getrtbase + moveq.l #1,d0 + jsr (a0) + ; Go through the queue and reply all those that finished. + lea.l 4(a3),a2 + move.l (a2),a0 +FSML_check_old: + move.l a0,d0 + beq.w FSML_loop + move.l (a0),a1 + move.l d0,a0 + ; This field may be accessed concurrently by several UAE threads. + ; This _should_ be harmless on all reasonable machines. + move.l 4(a0),d0 + bpl.b FSML_check_next + movem.l a0/a1,-(a7) + move.l 10(a0),a4 + bsr.b ReplyOne + subq.l #1,d5 ; One command less in the queue + movem.l (a7)+,a0/a1 + move.l a1,(a2) + move.l a1,a0 + bra.b FSML_check_old +FSML_check_next: + move.l a0,a2 + move.l a1,a0 + bra.b FSML_check_old + +FSML_FromDOS: + ; Limit the number of outstanding started commands. We can handle an + ; unlimited number of unstarted commands. + cmp.l #20,d5 + bcs FSML_DoCommand + ; Too many commands queued. + moveq.l #1,d0 + move.l d0,4(a4) + bra.b FSML_Enqueue + +FSML_DoCommand: + bsr.b LockCheck ; Make sure there are enough locks for the C code to grab. + move.w #$FF30,d0 ; filesys_handler + bsr.w getrtbase + jsr (a0) + tst.l d0 + beq.b FSML_Reply + ; The command did not complete yet. Enqueue it and increase number of + ; queued commands + ; The C code already set 4(a4) to 0 + addq.l #1,d5 +FSML_Enqueue: + move.l 4(a3),(a4) + move.l a4,4(a3) + bra.w FSML_loop + +FSML_Reply: + move.l d3,a4 + bsr.b ReplyOne + bra.w FSML_loop + +ReplyOne: + cmp.l #31,8(a4) ;ACTION_INHIBIT? + bne.s FSML_ReplyOne2 + bsr.w action_inhibit +FSML_ReplyOne2: + cmp.l #1033,8(a4) ;ACTION_EXAMINE_ALL + bne.s FSML_ReplyOne3 + bsr.w action_exall +FSML_ReplyOne3: + move.l (a4),a1 ; dp_Link + move.l 4(a4),a0 ; dp_Port + move.l a5,4(a4) + jmp -366(a6) ; PutMsg + +; ugly code to avoid calling AllocMem / FreeMem from native C code. +; We keep a linked list of 3 locks. In theory, only one should ever +; be used. Before handling every packet, we check that the list has the +; right length. + +LockCheck: + move.l d5,-(a7) + moveq.l #-4,d5 ; Keep three locks + move.l (a3),a2 + move.l a2,d7 +LKCK_Loop: + move.l a2,d1 + beq LKCK_ListEnd + addq.l #1,d5 + beq.b LKCK_TooMany + move.l a2,a1 + move.l (a2),a2 + bra.b LKCK_Loop +LKCK_ListEnd: + addq.l #1,d5 + beq.b LKCK_ret + move.l d7,a2 + moveq.l #24,d0 ; sizeof Lock is 20, 4 for chain + moveq.l #1,d1 ; MEMF_PUBLIC + jsr AllocMem(a6) + addq.w #1,d6 + move.l d0,a2 + move.l d7,(a2) + move.l a2,d7 + bra.b LKCK_ListEnd +LKCK_TooMany: + move.l (a2),d0 ; We have too many, but we tolerate that to some extent. + beq.b LKCK_ret + move.l d0,a0 + move.l (a0),d0 + beq.b LKCK_ret + move.l d0,a0 + move.l (a0),d0 + beq.b LKCK_ret + + moveq.l #0,d0 ; Now we are sure that we really have too many. Delete some. + move.l d0,(a1) +LKCK_TooManyLoop: + move.l a2,a1 + move.l (a1),a2 + moveq.l #24,d0 + jsr FreeMem(a6) + add.l #$10000,d6 + move.l a2,d0 + bne.b LKCK_TooManyLoop +LKCK_ret: + move.l d7,(a3) + move.l (a7)+,d5 + rts + +getrtbase: + lea start-8-4(pc),a0 + and.l #$FFFF,d0 + add.l d0,a0 + rts + + ;p96 stuff + +p96flag dc.w 0 +p96vsyncfix1 + cmp.l #34,8(sp) ; picasso_WaitVerticalSync? + bne.s p961 + movem.l d0-d1/a0-a2/a6,-(sp) + move.l 4.w,a6 + sub.l a1,a1 + jsr -$126(a6) ; FindTask + move.l d0,a2 + move.l a2,a1 + moveq #-20,d0 + jsr -$12c(a6) ; SetTaskPri + lea p96flag(pc),a0 + move.w (a0),d1 +p962 cmp.w (a0),d1 + beq.s p962 + move.l a2,a1 + jsr -$12c(a6) ; SetTaskPri + moveq #1,d1 + movem.l (sp)+,d0-d1/a0-a2/a6 + addq.l #4,sp ; return directly to caller +p961 rts + + +; mouse hack + +newlist: + move.l a0,(a0) + addq.l #4,(a0) + clr.l 4(a0) + move.l a0,8(a0) + rts + +createport: + movem.l d2/a2/a6,-(sp) + move.l 4,a6 + moveq #-1,d0 + jsr -$014a(a6) ;AllocSignal + sub.l a0,a0 + move.l d0,d2 + bmi.s .f + moveq #34,d0 + move.l #65536+1,d1 + jsr AllocMem(a6) + sub.l a0,a0 + move.l d0,a2 + tst.l d0 + beq.s .f + move.b #4,8(a2) ;NT_MSGPORT + move.b d2,15(a2) + sub.l a1,a1 + jsr -$0126(a6) ;FindTask + move.l d0,16(a2) + lea 20(a2),a0 + bsr.w newlist + move.l a2,a0 +.f move.l a0,d0 + movem.l (sp)+,d2/a2/a6 + rts + +createio: + movem.l d2/a2/a6,-(sp) + move.l 4,a6 + tst.l d0 + beq.s .f + move.l d0,a2 + moveq #48,d2 + move.l d2,d0 + move.l #65536+1,d1 + jsr AllocMem(a6) + move.l d0,a0 + move.b #10,8(a0) ;NT_MESSAGE + move.l d2,18(a0) + move.l a2,14(a0) +.f tst.l d0 + movem.l (sp)+,d2/a2/a6 + rts + +allocinputdevice + movem.l a2/a6,-(sp) + move.l 4.w,a6 + bsr.w createport + bsr.w createio + beq.s .f + move.l d0,a1 + move.l d0,a2 + lea inp_dev(pc),a0 + moveq #0,d0 + moveq #0,d1 + jsr -$01bc(a6) ;OpenDevice + move.l d0,d1 + moveq #0,d0 + tst.l d1 + bne.s .f + move.l a2,d0 +.f tst.l d0 + movem.l (sp)+,a2/a6 + rts + +alloctimerdevice + movem.l a2/a6,-(sp) + move.l 4.w,a6 + bsr.w createport + bsr.w createio + beq.s .f + move.l d0,a2 + move.l d0,a1 + lea tim_dev(pc),a0 + moveq #0,d0 + moveq #0,d1 + jsr -$01bc(a6) ;OpenDevice + move.l d0,d1 + moveq #0,d0 + tst.l d1 + bne.s .f + move.l a2,d0 +.f tst.l d0 + movem.l (sp)+,a2/a6 + rts + +createtask: + movem.l d2/d3/a2/a3/a6,-(sp) + move.l 4,a6 + move.l a0,d2 + move.l a1,d3 + move.l #92+2048,d0 + move.l #65536+1,d1 + jsr AllocMem(a6) + tst.l d0 + beq .f + move.l d0,a2 + move.b #1,8(a2) ;NT_TASK + move.l d2,10(a2) + lea 92(a2),a3 + move.l a3,58(a2) + lea 2048(a3),a3 + move.l a3,62(a2) + move.l a3,54(a2) + move.l a2,a1 + move.l d3,a2 + sub.l a3,a3 + jsr -$011a(a6) ;AddTask +.f movem.l (sp)+,d2/d3/a2/a3/a6 + rts + +mousehack_e: dc.w 0 +mousehack_x: dc.w 0 +mousehack_y: dc.w 0 + +MH_INT = 0 +MH_FOO = (MH_INT+22) +MH_IEV = (MH_FOO+16) +MH_IO = (MH_IEV+22) +MH_TM = (MH_IO+4) +MH_END = (MH_TM+4) + +mousehack_init: + move.l a0,-(sp) + tst.b 157(a3) + bne.s .no + lea mousehack_e(pc),a0 + cmp.b #1,(a0) + bne.s .no + lea mhname(pc),a0 + lea mousehack_task(pc),a1 + bsr createtask + st 157(a3) + ;tell native side that mousehack is active + move.w #$FF38,d0 + bsr.w getrtbase + jsr (a0) +.no move.l (sp)+,a0 + rts + +mousehack_task: + move.l 4,a6 + + moveq #-1,d0 + jsr -$014a(a6) ;AllocSignal + moveq #0,d2 + bset d0,d2 + + sub.l a1,a1 + jsr -$0126(a6) ;FindTask + move.l d0,a4 + + moveq #20,d0 + move.l a4,a1 + jsr -$012c(a6) ;SetTaskPri + + moveq #0,d0 + lea intlibname(pc),a1 + jsr -$0228(a6) + move.l d0,d7 + + moveq #0,d0 + move.w #MH_END,d0 + move.l #65536+1,d1 + jsr AllocMem(a6) + move.l d0,a5 + + bsr.w allocinputdevice + move.l d0,MH_IO(a5) + beq.w .f + bsr.w alloctimerdevice + move.l d0,MH_TM(a5) + beq.w .f + + lea MH_FOO(a5),a3 + move.l a4,12(a3);task + move.l d2,8(a3) ;sigmask + moveq #-1,d0 + move.l d0,(a3) ;mx + move.l d0,4(a3) ;my + + lea MH_INT(a5),a1 + move.b #2,8(a1) ;NT_INTERRUPT + move.b #5,9(a1) ;priority + lea mhname(pc),a0 + move.l a0,10(a1) + lea mousehackint(pc),a0 + move.l a0,18(a1) + move.l a3,14(a1) + moveq #5,d0 ;INTB_VERTB + jsr -$00a8(a6) + bra.s mhloop +.f rts + +mhloop + move.l d2,d0 + jsr -$013e(a6) ;Wait + + move.l MH_IO(a5),a1 + lea MH_IEV(a5),a2 + move.w #11,28(a1) ;IND_WRITEEVENT + move.l #22,36(a1) ;sizeof(struct InputEvent) + move.l a2,40(a1) + move.b #1,30(a1) ;IOF_QUICK + + move.b #4,4(a2) ;IECLASS_POINTERPOS + clr.b 5(a2) ;ie_SubClass + clr.w 6(a2) ;ie_Code + clr.w 8(a2) ;ie_Qualifier + + move.l d7,a0 ;intbase + + move.l MH_FOO+0(a5),d0 + move.w 34+14(a0),d1 + add.w d1,d1 + sub.w d1,d0 + move.w d0,10(a2) + + move.l MH_FOO+4(a5),d0 + move.w 34+12(a0),d1 + add.w d1,d1 + sub.w d1,d0 + ext.l d0 + move.w d0,12(a2) + + move.l MH_TM(a5),a1 + move.w #10,28(a1) ;TR_GETSYSTIME + move.b #1,30(a1) ;IOF_QUICK + jsr -$01c8(a6) ;DoIO + move.l MH_TM(a5),a1 + move.l 32(a1),14(a2) + move.l 36(a1),18(a2) + + move.l MH_IO(a5),a1 + jsr -$01c8(a6) ;DoIO + + bra.w mhloop + +mousehackint: + move.w mousehack_x(pc),d0 + ext.l d0 + move.w mousehack_y(pc),d1 + ext.l d1 + cmp.l (a1),d0 + bne .l1 + cmp.l 4(a1),d1 + beq .l2 +.l1 move.l d1,4(a1) + move.l d0,(a1) + move.l 8(a1),d0 + move.l 12(a1),a1 + move.l 4.w,a6 + jsr -$0144(a6) ; Signal +.l2 lea $dff000,a0 + moveq #0,d0 + rts + +inp_dev: dc.b 'input.device',0 +tim_dev: dc.b 'timer.device',0 +mhname: dc.b 'UAE mouse hack',0 +exter_name: dc.b 'UAE filesystem',0 +doslibname: dc.b 'dos.library',0 +intlibname: dc.b 'intuition.library',0 +explibname: dc.b 'expansion.library',0 +fsresname: dc.b 'FileSystem.resource',0 + END diff --git a/od-win32/fsdb_win32.c b/od-win32/fsdb_win32.c index 84e2f773..b12864f9 100755 --- a/od-win32/fsdb_win32.c +++ b/od-win32/fsdb_win32.c @@ -46,7 +46,7 @@ static char *make_uaefsdbpath (const char *dir, const char *name) { int len; char *p; - + len = strlen (dir) + 1 + 1; if (name) len += 1 + strlen (name); @@ -88,7 +88,7 @@ static int delete_uaefsdb (const char *dir) p = make_uaefsdbpath (dir, NULL); ret = DeleteFile(p); - //write_log("delete FSDB stream '%s' = %d\n", p, ret); + //write_log ("delete FSDB stream '%s' = %d\n", p, ret); xfree (p); return ret; } @@ -102,7 +102,7 @@ static int write_uaefsdb (const char *dir, uae_u8 *fsdb) FILETIME t1, t2, t3; int time_valid = FALSE; int ret = 0; - + p = make_uaefsdbpath (dir, NULL); dirattr = GetFileAttributes (dir); dirflag = FILE_ATTRIBUTE_NORMAL; @@ -110,7 +110,7 @@ static int write_uaefsdb (const char *dir, uae_u8 *fsdb) dirflag = FILE_FLAG_BACKUP_SEMANTICS; /* argh... */ h = CreateFile (dir, GENERIC_READ, 0, NULL, OPEN_EXISTING, dirflag, NULL); - if (h != INVALID_HANDLE_VALUE) { + if (h != INVALID_HANDLE_VALUE) { if (GetFileTime (h, &t1, &t2, &t3)) time_valid = TRUE; CloseHandle (h); @@ -118,7 +118,7 @@ static int write_uaefsdb (const char *dir, uae_u8 *fsdb) h = CreateFile (p, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE && GetLastError () == ERROR_ACCESS_DENIED) { - attr = GetFileAttributes (p); + attr = GetFileAttributes (p); if (attr != INVALID_FILE_ATTRIBUTES) { if (attr & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)) { SetFileAttributes (p, attr & ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)); @@ -142,7 +142,7 @@ end: if (time_valid) { h = CreateFile (dir, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, dirflag, NULL); - if (h != INVALID_HANDLE_VALUE) { + if (h != INVALID_HANDLE_VALUE) { SetFileTime (h, &t1, &t2, &t3); CloseHandle (h); } @@ -161,7 +161,7 @@ static void create_uaefsdb (a_inode *aino, uae_u8 *buf, int winmode) buf[5 + 257 + 256] = '\0'; strncpy (buf + 5 + 2 * 257, aino->comment ? aino->comment : "", 80); buf[5 + 2 * 257 + 80] = '\0'; - do_put_mem_long ((uae_u32 *)(buf + 5 + 2 * 257 + 81), winmode); + do_put_mem_long ((uae_u32 *)(buf + 5 + 2 * 257 + 81), winmode); aino->has_dbentry = 0; aino->dirty = 0; } @@ -186,7 +186,7 @@ static a_inode *aino_from_buf (a_inode *base, uae_u8 *buf, int *winmode) aino->dirty = 0; aino->db_offset = 0; if((mode = GetFileAttributes(aino->nname)) == INVALID_FILE_ATTRIBUTES) { - write_log("xGetFileAttributes('%s') failed! error=%d, aino=%p\n", + write_log ("xGetFileAttributes('%s') failed! error=%d, aino=%p\n", aino->nname, GetLastError(), aino); return aino; } @@ -261,7 +261,7 @@ int fsdb_fill_file_attrs (a_inode *base, a_inode *aino) int reset = 0; if((mode = GetFileAttributes(aino->nname)) == INVALID_FILE_ATTRIBUTES) { - write_log("GetFileAttributes('%s') failed! error=%d, aino=%p dir=%d\n", + write_log ("GetFileAttributes('%s') failed! error=%d, aino=%p dir=%d\n", aino->nname, GetLastError(), aino, aino->dir); return 0; } @@ -330,13 +330,13 @@ int fsdb_set_file_attrs (a_inode *aino) mode = 0; if ((tmpmask & (A_FIBF_WRITE | A_FIBF_DELETE)) == 0) - mode |= FILE_ATTRIBUTE_READONLY; + mode |= FILE_ATTRIBUTE_READONLY; if (!(tmpmask & A_FIBF_ARCHIVE)) - mode |= FILE_ATTRIBUTE_ARCHIVE; + mode |= FILE_ATTRIBUTE_ARCHIVE; if (tmpmask & A_FIBF_PURE) - mode |= FILE_ATTRIBUTE_SYSTEM; + mode |= FILE_ATTRIBUTE_SYSTEM; if (tmpmask & A_FIBF_HIDDEN) - mode |= FILE_ATTRIBUTE_HIDDEN; + mode |= FILE_ATTRIBUTE_HIDDEN; SetFileAttributes (aino->nname, mode); aino->dirty = 1; @@ -358,16 +358,16 @@ int fsdb_mode_supported (const a_inode *aino) if (0 && aino->dir) return 0; if (fsdb_mode_representable_p (aino, mask)) - return mask; + return mask; mask &= ~(A_FIBF_SCRIPT | A_FIBF_READ | A_FIBF_EXECUTE); if (fsdb_mode_representable_p (aino, mask)) - return mask; + return mask; mask &= ~A_FIBF_WRITE; if (fsdb_mode_representable_p (aino, mask)) - return mask; + return mask; mask &= ~A_FIBF_DELETE; if (fsdb_mode_representable_p (aino, mask)) - return mask; + return mask; return 0; } @@ -400,7 +400,7 @@ char *fsdb_create_unique_nname (a_inode *base, const char *suggestion) int i; strncat (tmp, suggestion, 240); - + /* replace the evil ones... */ for (i=0; i < NUM_EVILCHARS; i++) while ((c = strchr (tmp, evilchars[i])) != 0) @@ -452,7 +452,7 @@ static a_inode *custom_fsdb_lookup_aino (a_inode *base, const char *aname, int o HANDLE h; WIN32_FIND_DATA fd; static a_inode dummy; - + tmp1 = build_nname (base->nname, UAEFSDB_BEGINSX); if (!tmp1) return NULL; @@ -503,13 +503,13 @@ static int recycle (const char *name) DWORD dirattr = GetFileAttributes (name); if (dirattr != INVALID_FILE_ATTRIBUTES && (dirattr & FILE_ATTRIBUTE_DIRECTORY)) return RemoveDirectory (name) ? 0 : -1; - return DeleteFile(name) ? 0 : -1; + return DeleteFile(name) ? 0 : -1; } else { - SHFILEOPSTRUCT fos; + SHFILEOPSTRUCT fos; /* name must be terminated by \0\0 */ char *p = xcalloc (strlen (name) + 2, 1); int v; - + strcpy (p, name); memset (&fos, 0, sizeof (fos)); fos.wFunc = FO_DELETE; @@ -570,7 +570,7 @@ void *my_opendir (const char *name) { struct my_opendirs *mod; char tmp[MAX_DPATH]; - + strcpy (tmp, name); strcat (tmp, "\\*.*"); mod = xmalloc (sizeof (struct my_opendirs)); @@ -588,7 +588,8 @@ void *my_opendir (const char *name) void my_closedir (void *d) { struct my_opendirs *mod = d; - FindClose (mod->h); + if (d) + FindClose (mod->h); xfree (mod); } @@ -679,7 +680,7 @@ void *my_open (const char *name, int flags) DWORD CreationDisposition = OPEN_EXISTING; DWORD FlagsAndAttributes = FILE_ATTRIBUTE_NORMAL; DWORD attr; - + mos = xmalloc (sizeof (struct my_opens)); if (!mos) return NULL; diff --git a/od-win32/gencpu_msvc/cpustbl_small.c b/od-win32/gencpu_msvc/cpustbl_small.c deleted file mode 100755 index 65d594c9..00000000 --- a/od-win32/gencpu_msvc/cpustbl_small.c +++ /dev/null @@ -1,1890 +0,0 @@ -struct xcputbl XCPUFUNC(xop_smalltbl_0)[] = { -{ XCPUFUNC(op_0_0), 0, 0 }, /* OR */ -{ XCPUFUNC(op_10_0), 0, 16 }, /* OR */ -{ XCPUFUNC(op_18_0), 0, 24 }, /* OR */ -{ XCPUFUNC(op_20_0), 0, 32 }, /* OR */ -{ XCPUFUNC(op_28_0), 0, 40 }, /* OR */ -{ XCPUFUNC(op_30_0), 0, 48 }, /* OR */ -{ XCPUFUNC(op_38_0), 0, 56 }, /* OR */ -{ XCPUFUNC(op_39_0), 0, 57 }, /* OR */ -{ XCPUFUNC(op_3c_0), 0, 60 }, /* ORSR */ -{ XCPUFUNC(op_40_0), 0, 64 }, /* OR */ -{ XCPUFUNC(op_50_0), 0, 80 }, /* OR */ -{ XCPUFUNC(op_58_0), 0, 88 }, /* OR */ -{ XCPUFUNC(op_60_0), 0, 96 }, /* OR */ -{ XCPUFUNC(op_68_0), 0, 104 }, /* OR */ -{ XCPUFUNC(op_70_0), 0, 112 }, /* OR */ -{ XCPUFUNC(op_78_0), 0, 120 }, /* OR */ -{ XCPUFUNC(op_79_0), 0, 121 }, /* OR */ -{ XCPUFUNC(op_7c_0), 0, 124 }, /* ORSR */ -{ XCPUFUNC(op_80_0), 0, 128 }, /* OR */ -{ XCPUFUNC(op_90_0), 0, 144 }, /* OR */ -{ XCPUFUNC(op_98_0), 0, 152 }, /* OR */ -{ XCPUFUNC(op_a0_0), 0, 160 }, /* OR */ -{ XCPUFUNC(op_a8_0), 0, 168 }, /* OR */ -{ XCPUFUNC(op_b0_0), 0, 176 }, /* OR */ -{ XCPUFUNC(op_b8_0), 0, 184 }, /* OR */ -{ XCPUFUNC(op_b9_0), 0, 185 }, /* OR */ -{ XCPUFUNC(op_d0_0), 0, 208 }, /* CHK2 */ -{ XCPUFUNC(op_e8_0), 0, 232 }, /* CHK2 */ -{ XCPUFUNC(op_f0_0), 0, 240 }, /* CHK2 */ -{ XCPUFUNC(op_f8_0), 0, 248 }, /* CHK2 */ -{ XCPUFUNC(op_f9_0), 0, 249 }, /* CHK2 */ -{ XCPUFUNC(op_fa_0), 0, 250 }, /* CHK2 */ -{ XCPUFUNC(op_fb_0), 0, 251 }, /* CHK2 */ -{ XCPUFUNC(op_100_0), 0, 256 }, /* BTST */ -{ XCPUFUNC(op_108_0), 0, 264 }, /* MVPMR */ -{ XCPUFUNC(op_110_0), 0, 272 }, /* BTST */ -{ XCPUFUNC(op_118_0), 0, 280 }, /* BTST */ -{ XCPUFUNC(op_120_0), 0, 288 }, /* BTST */ -{ XCPUFUNC(op_128_0), 0, 296 }, /* BTST */ -{ XCPUFUNC(op_130_0), 0, 304 }, /* BTST */ -{ XCPUFUNC(op_138_0), 0, 312 }, /* BTST */ -{ XCPUFUNC(op_139_0), 0, 313 }, /* BTST */ -{ XCPUFUNC(op_13a_0), 0, 314 }, /* BTST */ -{ XCPUFUNC(op_13b_0), 0, 315 }, /* BTST */ -{ XCPUFUNC(op_13c_0), 0, 316 }, /* BTST */ -{ XCPUFUNC(op_140_0), 0, 320 }, /* BCHG */ -{ XCPUFUNC(op_148_0), 0, 328 }, /* MVPMR */ -{ XCPUFUNC(op_150_0), 0, 336 }, /* BCHG */ -{ XCPUFUNC(op_158_0), 0, 344 }, /* BCHG */ -{ XCPUFUNC(op_160_0), 0, 352 }, /* BCHG */ -{ XCPUFUNC(op_168_0), 0, 360 }, /* BCHG */ -{ XCPUFUNC(op_170_0), 0, 368 }, /* BCHG */ -{ XCPUFUNC(op_178_0), 0, 376 }, /* BCHG */ -{ XCPUFUNC(op_179_0), 0, 377 }, /* BCHG */ -{ XCPUFUNC(op_17a_0), 0, 378 }, /* BCHG */ -{ XCPUFUNC(op_17b_0), 0, 379 }, /* BCHG */ -{ XCPUFUNC(op_180_0), 0, 384 }, /* BCLR */ -{ XCPUFUNC(op_188_0), 0, 392 }, /* MVPRM */ -{ XCPUFUNC(op_190_0), 0, 400 }, /* BCLR */ -{ XCPUFUNC(op_198_0), 0, 408 }, /* BCLR */ -{ XCPUFUNC(op_1a0_0), 0, 416 }, /* BCLR */ -{ XCPUFUNC(op_1a8_0), 0, 424 }, /* BCLR */ -{ XCPUFUNC(op_1b0_0), 0, 432 }, /* BCLR */ -{ XCPUFUNC(op_1b8_0), 0, 440 }, /* BCLR */ -{ XCPUFUNC(op_1b9_0), 0, 441 }, /* BCLR */ -{ XCPUFUNC(op_1ba_0), 0, 442 }, /* BCLR */ -{ XCPUFUNC(op_1bb_0), 0, 443 }, /* BCLR */ -{ XCPUFUNC(op_1c0_0), 0, 448 }, /* BSET */ -{ XCPUFUNC(op_1c8_0), 0, 456 }, /* MVPRM */ -{ XCPUFUNC(op_1d0_0), 0, 464 }, /* BSET */ -{ XCPUFUNC(op_1d8_0), 0, 472 }, /* BSET */ -{ XCPUFUNC(op_1e0_0), 0, 480 }, /* BSET */ -{ XCPUFUNC(op_1e8_0), 0, 488 }, /* BSET */ -{ XCPUFUNC(op_1f0_0), 0, 496 }, /* BSET */ -{ XCPUFUNC(op_1f8_0), 0, 504 }, /* BSET */ -{ XCPUFUNC(op_1f9_0), 0, 505 }, /* BSET */ -{ XCPUFUNC(op_1fa_0), 0, 506 }, /* BSET */ -{ XCPUFUNC(op_1fb_0), 0, 507 }, /* BSET */ -{ XCPUFUNC(op_200_0), 0, 512 }, /* AND */ -{ XCPUFUNC(op_210_0), 0, 528 }, /* AND */ -{ XCPUFUNC(op_218_0), 0, 536 }, /* AND */ -{ XCPUFUNC(op_220_0), 0, 544 }, /* AND */ -{ XCPUFUNC(op_228_0), 0, 552 }, /* AND */ -{ XCPUFUNC(op_230_0), 0, 560 }, /* AND */ -{ XCPUFUNC(op_238_0), 0, 568 }, /* AND */ -{ XCPUFUNC(op_239_0), 0, 569 }, /* AND */ -{ XCPUFUNC(op_23c_0), 0, 572 }, /* ANDSR */ -{ XCPUFUNC(op_240_0), 0, 576 }, /* AND */ -{ XCPUFUNC(op_250_0), 0, 592 }, /* AND */ -{ XCPUFUNC(op_258_0), 0, 600 }, /* AND */ -{ XCPUFUNC(op_260_0), 0, 608 }, /* AND */ -{ XCPUFUNC(op_268_0), 0, 616 }, /* AND */ -{ XCPUFUNC(op_270_0), 0, 624 }, /* AND */ -{ XCPUFUNC(op_278_0), 0, 632 }, /* AND */ -{ XCPUFUNC(op_279_0), 0, 633 }, /* AND */ -{ XCPUFUNC(op_27c_0), 0, 636 }, /* ANDSR */ -{ XCPUFUNC(op_280_0), 0, 640 }, /* AND */ -{ XCPUFUNC(op_290_0), 0, 656 }, /* AND */ -{ XCPUFUNC(op_298_0), 0, 664 }, /* AND */ -{ XCPUFUNC(op_2a0_0), 0, 672 }, /* AND */ -{ XCPUFUNC(op_2a8_0), 0, 680 }, /* AND */ -{ XCPUFUNC(op_2b0_0), 0, 688 }, /* AND */ -{ XCPUFUNC(op_2b8_0), 0, 696 }, /* AND */ -{ XCPUFUNC(op_2b9_0), 0, 697 }, /* AND */ -{ XCPUFUNC(op_2d0_0), 0, 720 }, /* CHK2 */ -{ XCPUFUNC(op_2e8_0), 0, 744 }, /* CHK2 */ -{ XCPUFUNC(op_2f0_0), 0, 752 }, /* CHK2 */ -{ XCPUFUNC(op_2f8_0), 0, 760 }, /* CHK2 */ -{ XCPUFUNC(op_2f9_0), 0, 761 }, /* CHK2 */ -{ XCPUFUNC(op_2fa_0), 0, 762 }, /* CHK2 */ -{ XCPUFUNC(op_2fb_0), 0, 763 }, /* CHK2 */ -{ XCPUFUNC(op_400_0), 0, 1024 }, /* SUB */ -{ XCPUFUNC(op_410_0), 0, 1040 }, /* SUB */ -{ XCPUFUNC(op_418_0), 0, 1048 }, /* SUB */ -{ XCPUFUNC(op_420_0), 0, 1056 }, /* SUB */ -{ XCPUFUNC(op_428_0), 0, 1064 }, /* SUB */ -{ XCPUFUNC(op_430_0), 0, 1072 }, /* SUB */ -{ XCPUFUNC(op_438_0), 0, 1080 }, /* SUB */ -{ XCPUFUNC(op_439_0), 0, 1081 }, /* SUB */ -{ XCPUFUNC(op_440_0), 0, 1088 }, /* SUB */ -{ XCPUFUNC(op_450_0), 0, 1104 }, /* SUB */ -{ XCPUFUNC(op_458_0), 0, 1112 }, /* SUB */ -{ XCPUFUNC(op_460_0), 0, 1120 }, /* SUB */ -{ XCPUFUNC(op_468_0), 0, 1128 }, /* SUB */ -{ XCPUFUNC(op_470_0), 0, 1136 }, /* SUB */ -{ XCPUFUNC(op_478_0), 0, 1144 }, /* SUB */ -{ XCPUFUNC(op_479_0), 0, 1145 }, /* SUB */ -{ XCPUFUNC(op_480_0), 0, 1152 }, /* SUB */ -{ XCPUFUNC(op_490_0), 0, 1168 }, /* SUB */ -{ XCPUFUNC(op_498_0), 0, 1176 }, /* SUB */ -{ XCPUFUNC(op_4a0_0), 0, 1184 }, /* SUB */ -{ XCPUFUNC(op_4a8_0), 0, 1192 }, /* SUB */ -{ XCPUFUNC(op_4b0_0), 0, 1200 }, /* SUB */ -{ XCPUFUNC(op_4b8_0), 0, 1208 }, /* SUB */ -{ XCPUFUNC(op_4b9_0), 0, 1209 }, /* SUB */ -{ XCPUFUNC(op_4d0_0), 0, 1232 }, /* CHK2 */ -{ XCPUFUNC(op_4e8_0), 0, 1256 }, /* CHK2 */ -{ XCPUFUNC(op_4f0_0), 0, 1264 }, /* CHK2 */ -{ XCPUFUNC(op_4f8_0), 0, 1272 }, /* CHK2 */ -{ XCPUFUNC(op_4f9_0), 0, 1273 }, /* CHK2 */ -{ XCPUFUNC(op_4fa_0), 0, 1274 }, /* CHK2 */ -{ XCPUFUNC(op_4fb_0), 0, 1275 }, /* CHK2 */ -{ XCPUFUNC(op_600_0), 0, 1536 }, /* ADD */ -{ XCPUFUNC(op_610_0), 0, 1552 }, /* ADD */ -{ XCPUFUNC(op_618_0), 0, 1560 }, /* ADD */ -{ XCPUFUNC(op_620_0), 0, 1568 }, /* ADD */ -{ XCPUFUNC(op_628_0), 0, 1576 }, /* ADD */ -{ XCPUFUNC(op_630_0), 0, 1584 }, /* ADD */ -{ XCPUFUNC(op_638_0), 0, 1592 }, /* ADD */ -{ XCPUFUNC(op_639_0), 0, 1593 }, /* ADD */ -{ XCPUFUNC(op_640_0), 0, 1600 }, /* ADD */ -{ XCPUFUNC(op_650_0), 0, 1616 }, /* ADD */ -{ XCPUFUNC(op_658_0), 0, 1624 }, /* ADD */ -{ XCPUFUNC(op_660_0), 0, 1632 }, /* ADD */ -{ XCPUFUNC(op_668_0), 0, 1640 }, /* ADD */ -{ XCPUFUNC(op_670_0), 0, 1648 }, /* ADD */ -{ XCPUFUNC(op_678_0), 0, 1656 }, /* ADD */ -{ XCPUFUNC(op_679_0), 0, 1657 }, /* ADD */ -{ XCPUFUNC(op_680_0), 0, 1664 }, /* ADD */ -{ XCPUFUNC(op_690_0), 0, 1680 }, /* ADD */ -{ XCPUFUNC(op_698_0), 0, 1688 }, /* ADD */ -{ XCPUFUNC(op_6a0_0), 0, 1696 }, /* ADD */ -{ XCPUFUNC(op_6a8_0), 0, 1704 }, /* ADD */ -{ XCPUFUNC(op_6b0_0), 0, 1712 }, /* ADD */ -{ XCPUFUNC(op_6b8_0), 0, 1720 }, /* ADD */ -{ XCPUFUNC(op_6b9_0), 0, 1721 }, /* ADD */ -{ XCPUFUNC(op_6c0_0), 0, 1728 }, /* RTM */ -{ XCPUFUNC(op_6c8_0), 0, 1736 }, /* RTM */ -{ XCPUFUNC(op_6d0_0), 0, 1744 }, /* CALLM */ -{ XCPUFUNC(op_6e8_0), 0, 1768 }, /* CALLM */ -{ XCPUFUNC(op_6f0_0), 0, 1776 }, /* CALLM */ -{ XCPUFUNC(op_6f8_0), 0, 1784 }, /* CALLM */ -{ XCPUFUNC(op_6f9_0), 0, 1785 }, /* CALLM */ -{ XCPUFUNC(op_6fa_0), 0, 1786 }, /* CALLM */ -{ XCPUFUNC(op_6fb_0), 0, 1787 }, /* CALLM */ -{ XCPUFUNC(op_800_0), 0, 2048 }, /* BTST */ -{ XCPUFUNC(op_810_0), 0, 2064 }, /* BTST */ -{ XCPUFUNC(op_818_0), 0, 2072 }, /* BTST */ -{ XCPUFUNC(op_820_0), 0, 2080 }, /* BTST */ -{ XCPUFUNC(op_828_0), 0, 2088 }, /* BTST */ -{ XCPUFUNC(op_830_0), 0, 2096 }, /* BTST */ -{ XCPUFUNC(op_838_0), 0, 2104 }, /* BTST */ -{ XCPUFUNC(op_839_0), 0, 2105 }, /* BTST */ -{ XCPUFUNC(op_83a_0), 0, 2106 }, /* BTST */ -{ XCPUFUNC(op_83b_0), 0, 2107 }, /* BTST */ -{ XCPUFUNC(op_83c_0), 0, 2108 }, /* BTST */ -{ XCPUFUNC(op_840_0), 0, 2112 }, /* BCHG */ -{ XCPUFUNC(op_850_0), 0, 2128 }, /* BCHG */ -{ XCPUFUNC(op_858_0), 0, 2136 }, /* BCHG */ -{ XCPUFUNC(op_860_0), 0, 2144 }, /* BCHG */ -{ XCPUFUNC(op_868_0), 0, 2152 }, /* BCHG */ -{ XCPUFUNC(op_870_0), 0, 2160 }, /* BCHG */ -{ XCPUFUNC(op_878_0), 0, 2168 }, /* BCHG */ -{ XCPUFUNC(op_879_0), 0, 2169 }, /* BCHG */ -{ XCPUFUNC(op_87a_0), 0, 2170 }, /* BCHG */ -{ XCPUFUNC(op_87b_0), 0, 2171 }, /* BCHG */ -{ XCPUFUNC(op_880_0), 0, 2176 }, /* BCLR */ -{ XCPUFUNC(op_890_0), 0, 2192 }, /* BCLR */ -{ XCPUFUNC(op_898_0), 0, 2200 }, /* BCLR */ -{ XCPUFUNC(op_8a0_0), 0, 2208 }, /* BCLR */ -{ XCPUFUNC(op_8a8_0), 0, 2216 }, /* BCLR */ -{ XCPUFUNC(op_8b0_0), 0, 2224 }, /* BCLR */ -{ XCPUFUNC(op_8b8_0), 0, 2232 }, /* BCLR */ -{ XCPUFUNC(op_8b9_0), 0, 2233 }, /* BCLR */ -{ XCPUFUNC(op_8ba_0), 0, 2234 }, /* BCLR */ -{ XCPUFUNC(op_8bb_0), 0, 2235 }, /* BCLR */ -{ XCPUFUNC(op_8c0_0), 0, 2240 }, /* BSET */ -{ XCPUFUNC(op_8d0_0), 0, 2256 }, /* BSET */ -{ XCPUFUNC(op_8d8_0), 0, 2264 }, /* BSET */ -{ XCPUFUNC(op_8e0_0), 0, 2272 }, /* BSET */ -{ XCPUFUNC(op_8e8_0), 0, 2280 }, /* BSET */ -{ XCPUFUNC(op_8f0_0), 0, 2288 }, /* BSET */ -{ XCPUFUNC(op_8f8_0), 0, 2296 }, /* BSET */ -{ XCPUFUNC(op_8f9_0), 0, 2297 }, /* BSET */ -{ XCPUFUNC(op_8fa_0), 0, 2298 }, /* BSET */ -{ XCPUFUNC(op_8fb_0), 0, 2299 }, /* BSET */ -{ XCPUFUNC(op_a00_0), 0, 2560 }, /* EOR */ -{ XCPUFUNC(op_a10_0), 0, 2576 }, /* EOR */ -{ XCPUFUNC(op_a18_0), 0, 2584 }, /* EOR */ -{ XCPUFUNC(op_a20_0), 0, 2592 }, /* EOR */ -{ XCPUFUNC(op_a28_0), 0, 2600 }, /* EOR */ -{ XCPUFUNC(op_a30_0), 0, 2608 }, /* EOR */ -{ XCPUFUNC(op_a38_0), 0, 2616 }, /* EOR */ -{ XCPUFUNC(op_a39_0), 0, 2617 }, /* EOR */ -{ XCPUFUNC(op_a3c_0), 0, 2620 }, /* EORSR */ -{ XCPUFUNC(op_a40_0), 0, 2624 }, /* EOR */ -{ XCPUFUNC(op_a50_0), 0, 2640 }, /* EOR */ -{ XCPUFUNC(op_a58_0), 0, 2648 }, /* EOR */ -{ XCPUFUNC(op_a60_0), 0, 2656 }, /* EOR */ -{ XCPUFUNC(op_a68_0), 0, 2664 }, /* EOR */ -{ XCPUFUNC(op_a70_0), 0, 2672 }, /* EOR */ -{ XCPUFUNC(op_a78_0), 0, 2680 }, /* EOR */ -{ XCPUFUNC(op_a79_0), 0, 2681 }, /* EOR */ -{ XCPUFUNC(op_a7c_0), 0, 2684 }, /* EORSR */ -{ XCPUFUNC(op_a80_0), 0, 2688 }, /* EOR */ -{ XCPUFUNC(op_a90_0), 0, 2704 }, /* EOR */ -{ XCPUFUNC(op_a98_0), 0, 2712 }, /* EOR */ -{ XCPUFUNC(op_aa0_0), 0, 2720 }, /* EOR */ -{ XCPUFUNC(op_aa8_0), 0, 2728 }, /* EOR */ -{ XCPUFUNC(op_ab0_0), 0, 2736 }, /* EOR */ -{ XCPUFUNC(op_ab8_0), 0, 2744 }, /* EOR */ -{ XCPUFUNC(op_ab9_0), 0, 2745 }, /* EOR */ -{ XCPUFUNC(op_ad0_0), 0, 2768 }, /* CAS */ -{ XCPUFUNC(op_ad8_0), 0, 2776 }, /* CAS */ -{ XCPUFUNC(op_ae0_0), 0, 2784 }, /* CAS */ -{ XCPUFUNC(op_ae8_0), 0, 2792 }, /* CAS */ -{ XCPUFUNC(op_af0_0), 0, 2800 }, /* CAS */ -{ XCPUFUNC(op_af8_0), 0, 2808 }, /* CAS */ -{ XCPUFUNC(op_af9_0), 0, 2809 }, /* CAS */ -{ XCPUFUNC(op_c00_0), 0, 3072 }, /* CMP */ -{ XCPUFUNC(op_c10_0), 0, 3088 }, /* CMP */ -{ XCPUFUNC(op_c18_0), 0, 3096 }, /* CMP */ -{ XCPUFUNC(op_c20_0), 0, 3104 }, /* CMP */ -{ XCPUFUNC(op_c28_0), 0, 3112 }, /* CMP */ -{ XCPUFUNC(op_c30_0), 0, 3120 }, /* CMP */ -{ XCPUFUNC(op_c38_0), 0, 3128 }, /* CMP */ -{ XCPUFUNC(op_c39_0), 0, 3129 }, /* CMP */ -{ XCPUFUNC(op_c3a_0), 0, 3130 }, /* CMP */ -{ XCPUFUNC(op_c3b_0), 0, 3131 }, /* CMP */ -{ XCPUFUNC(op_c40_0), 0, 3136 }, /* CMP */ -{ XCPUFUNC(op_c50_0), 0, 3152 }, /* CMP */ -{ XCPUFUNC(op_c58_0), 0, 3160 }, /* CMP */ -{ XCPUFUNC(op_c60_0), 0, 3168 }, /* CMP */ -{ XCPUFUNC(op_c68_0), 0, 3176 }, /* CMP */ -{ XCPUFUNC(op_c70_0), 0, 3184 }, /* CMP */ -{ XCPUFUNC(op_c78_0), 0, 3192 }, /* CMP */ -{ XCPUFUNC(op_c79_0), 0, 3193 }, /* CMP */ -{ XCPUFUNC(op_c7a_0), 0, 3194 }, /* CMP */ -{ XCPUFUNC(op_c7b_0), 0, 3195 }, /* CMP */ -{ XCPUFUNC(op_c80_0), 0, 3200 }, /* CMP */ -{ XCPUFUNC(op_c90_0), 0, 3216 }, /* CMP */ -{ XCPUFUNC(op_c98_0), 0, 3224 }, /* CMP */ -{ XCPUFUNC(op_ca0_0), 0, 3232 }, /* CMP */ -{ XCPUFUNC(op_ca8_0), 0, 3240 }, /* CMP */ -{ XCPUFUNC(op_cb0_0), 0, 3248 }, /* CMP */ -{ XCPUFUNC(op_cb8_0), 0, 3256 }, /* CMP */ -{ XCPUFUNC(op_cb9_0), 0, 3257 }, /* CMP */ -{ XCPUFUNC(op_cba_0), 0, 3258 }, /* CMP */ -{ XCPUFUNC(op_cbb_0), 0, 3259 }, /* CMP */ -{ XCPUFUNC(op_cd0_0), 0, 3280 }, /* CAS */ -{ XCPUFUNC(op_cd8_0), 0, 3288 }, /* CAS */ -{ XCPUFUNC(op_ce0_0), 0, 3296 }, /* CAS */ -{ XCPUFUNC(op_ce8_0), 0, 3304 }, /* CAS */ -{ XCPUFUNC(op_cf0_0), 0, 3312 }, /* CAS */ -{ XCPUFUNC(op_cf8_0), 0, 3320 }, /* CAS */ -{ XCPUFUNC(op_cf9_0), 0, 3321 }, /* CAS */ -{ XCPUFUNC(op_cfc_0), 0, 3324 }, /* CAS2 */ -{ XCPUFUNC(op_e10_0), 0, 3600 }, /* MOVES */ -{ XCPUFUNC(op_e18_0), 0, 3608 }, /* MOVES */ -{ XCPUFUNC(op_e20_0), 0, 3616 }, /* MOVES */ -{ XCPUFUNC(op_e28_0), 0, 3624 }, /* MOVES */ -{ XCPUFUNC(op_e30_0), 0, 3632 }, /* MOVES */ -{ XCPUFUNC(op_e38_0), 0, 3640 }, /* MOVES */ -{ XCPUFUNC(op_e39_0), 0, 3641 }, /* MOVES */ -{ XCPUFUNC(op_e50_0), 0, 3664 }, /* MOVES */ -{ XCPUFUNC(op_e58_0), 0, 3672 }, /* MOVES */ -{ XCPUFUNC(op_e60_0), 0, 3680 }, /* MOVES */ -{ XCPUFUNC(op_e68_0), 0, 3688 }, /* MOVES */ -{ XCPUFUNC(op_e70_0), 0, 3696 }, /* MOVES */ -{ XCPUFUNC(op_e78_0), 0, 3704 }, /* MOVES */ -{ XCPUFUNC(op_e79_0), 0, 3705 }, /* MOVES */ -{ XCPUFUNC(op_e90_0), 0, 3728 }, /* MOVES */ -{ XCPUFUNC(op_e98_0), 0, 3736 }, /* MOVES */ -{ XCPUFUNC(op_ea0_0), 0, 3744 }, /* MOVES */ -{ XCPUFUNC(op_ea8_0), 0, 3752 }, /* MOVES */ -{ XCPUFUNC(op_eb0_0), 0, 3760 }, /* MOVES */ -{ XCPUFUNC(op_eb8_0), 0, 3768 }, /* MOVES */ -{ XCPUFUNC(op_eb9_0), 0, 3769 }, /* MOVES */ -{ XCPUFUNC(op_ed0_0), 0, 3792 }, /* CAS */ -{ XCPUFUNC(op_ed8_0), 0, 3800 }, /* CAS */ -{ XCPUFUNC(op_ee0_0), 0, 3808 }, /* CAS */ -{ XCPUFUNC(op_ee8_0), 0, 3816 }, /* CAS */ -{ XCPUFUNC(op_ef0_0), 0, 3824 }, /* CAS */ -{ XCPUFUNC(op_ef8_0), 0, 3832 }, /* CAS */ -{ XCPUFUNC(op_ef9_0), 0, 3833 }, /* CAS */ -{ XCPUFUNC(op_efc_0), 0, 3836 }, /* CAS2 */ -{ XCPUFUNC(op_1000_0), 0, 4096 }, /* MOVE */ -{ XCPUFUNC(op_1010_0), 0, 4112 }, /* MOVE */ -{ XCPUFUNC(op_1018_0), 0, 4120 }, /* MOVE */ -{ XCPUFUNC(op_1020_0), 0, 4128 }, /* MOVE */ -{ XCPUFUNC(op_1028_0), 0, 4136 }, /* MOVE */ -{ XCPUFUNC(op_1030_0), 0, 4144 }, /* MOVE */ -{ XCPUFUNC(op_1038_0), 0, 4152 }, /* MOVE */ -{ XCPUFUNC(op_1039_0), 0, 4153 }, /* MOVE */ -{ XCPUFUNC(op_103a_0), 0, 4154 }, /* MOVE */ -{ XCPUFUNC(op_103b_0), 0, 4155 }, /* MOVE */ -{ XCPUFUNC(op_103c_0), 0, 4156 }, /* MOVE */ -{ XCPUFUNC(op_1080_0), 0, 4224 }, /* MOVE */ -{ XCPUFUNC(op_1090_0), 0, 4240 }, /* MOVE */ -{ XCPUFUNC(op_1098_0), 0, 4248 }, /* MOVE */ -{ XCPUFUNC(op_10a0_0), 0, 4256 }, /* MOVE */ -{ XCPUFUNC(op_10a8_0), 0, 4264 }, /* MOVE */ -{ XCPUFUNC(op_10b0_0), 0, 4272 }, /* MOVE */ -{ XCPUFUNC(op_10b8_0), 0, 4280 }, /* MOVE */ -{ XCPUFUNC(op_10b9_0), 0, 4281 }, /* MOVE */ -{ XCPUFUNC(op_10ba_0), 0, 4282 }, /* MOVE */ -{ XCPUFUNC(op_10bb_0), 0, 4283 }, /* MOVE */ -{ XCPUFUNC(op_10bc_0), 0, 4284 }, /* MOVE */ -{ XCPUFUNC(op_10c0_0), 0, 4288 }, /* MOVE */ -{ XCPUFUNC(op_10d0_0), 0, 4304 }, /* MOVE */ -{ XCPUFUNC(op_10d8_0), 0, 4312 }, /* MOVE */ -{ XCPUFUNC(op_10e0_0), 0, 4320 }, /* MOVE */ -{ XCPUFUNC(op_10e8_0), 0, 4328 }, /* MOVE */ -{ XCPUFUNC(op_10f0_0), 0, 4336 }, /* MOVE */ -{ XCPUFUNC(op_10f8_0), 0, 4344 }, /* MOVE */ -{ XCPUFUNC(op_10f9_0), 0, 4345 }, /* MOVE */ -{ XCPUFUNC(op_10fa_0), 0, 4346 }, /* MOVE */ -{ XCPUFUNC(op_10fb_0), 0, 4347 }, /* MOVE */ -{ XCPUFUNC(op_10fc_0), 0, 4348 }, /* MOVE */ -{ XCPUFUNC(op_1100_0), 0, 4352 }, /* MOVE */ -{ XCPUFUNC(op_1110_0), 0, 4368 }, /* MOVE */ -{ XCPUFUNC(op_1118_0), 0, 4376 }, /* MOVE */ -{ XCPUFUNC(op_1120_0), 0, 4384 }, /* MOVE */ -{ XCPUFUNC(op_1128_0), 0, 4392 }, /* MOVE */ -{ XCPUFUNC(op_1130_0), 0, 4400 }, /* MOVE */ -{ XCPUFUNC(op_1138_0), 0, 4408 }, /* MOVE */ -{ XCPUFUNC(op_1139_0), 0, 4409 }, /* MOVE */ -{ XCPUFUNC(op_113a_0), 0, 4410 }, /* MOVE */ -{ XCPUFUNC(op_113b_0), 0, 4411 }, /* MOVE */ -{ XCPUFUNC(op_113c_0), 0, 4412 }, /* MOVE */ -{ XCPUFUNC(op_1140_0), 0, 4416 }, /* MOVE */ -{ XCPUFUNC(op_1150_0), 0, 4432 }, /* MOVE */ -{ XCPUFUNC(op_1158_0), 0, 4440 }, /* MOVE */ -{ XCPUFUNC(op_1160_0), 0, 4448 }, /* MOVE */ -{ XCPUFUNC(op_1168_0), 0, 4456 }, /* MOVE */ -{ XCPUFUNC(op_1170_0), 0, 4464 }, /* MOVE */ -{ XCPUFUNC(op_1178_0), 0, 4472 }, /* MOVE */ -{ XCPUFUNC(op_1179_0), 0, 4473 }, /* MOVE */ -{ XCPUFUNC(op_117a_0), 0, 4474 }, /* MOVE */ -{ XCPUFUNC(op_117b_0), 0, 4475 }, /* MOVE */ -{ XCPUFUNC(op_117c_0), 0, 4476 }, /* MOVE */ -{ XCPUFUNC(op_1180_0), 0, 4480 }, /* MOVE */ -{ XCPUFUNC(op_1190_0), 0, 4496 }, /* MOVE */ -{ XCPUFUNC(op_1198_0), 0, 4504 }, /* MOVE */ -{ XCPUFUNC(op_11a0_0), 0, 4512 }, /* MOVE */ -{ XCPUFUNC(op_11a8_0), 0, 4520 }, /* MOVE */ -{ XCPUFUNC(op_11b0_0), 0, 4528 }, /* MOVE */ -{ XCPUFUNC(op_11b8_0), 0, 4536 }, /* MOVE */ -{ XCPUFUNC(op_11b9_0), 0, 4537 }, /* MOVE */ -{ XCPUFUNC(op_11ba_0), 0, 4538 }, /* MOVE */ -{ XCPUFUNC(op_11bb_0), 0, 4539 }, /* MOVE */ -{ XCPUFUNC(op_11bc_0), 0, 4540 }, /* MOVE */ -{ XCPUFUNC(op_11c0_0), 0, 4544 }, /* MOVE */ -{ XCPUFUNC(op_11d0_0), 0, 4560 }, /* MOVE */ -{ XCPUFUNC(op_11d8_0), 0, 4568 }, /* MOVE */ -{ XCPUFUNC(op_11e0_0), 0, 4576 }, /* MOVE */ -{ XCPUFUNC(op_11e8_0), 0, 4584 }, /* MOVE */ -{ XCPUFUNC(op_11f0_0), 0, 4592 }, /* MOVE */ -{ XCPUFUNC(op_11f8_0), 0, 4600 }, /* MOVE */ -{ XCPUFUNC(op_11f9_0), 0, 4601 }, /* MOVE */ -{ XCPUFUNC(op_11fa_0), 0, 4602 }, /* MOVE */ -{ XCPUFUNC(op_11fb_0), 0, 4603 }, /* MOVE */ -{ XCPUFUNC(op_11fc_0), 0, 4604 }, /* MOVE */ -{ XCPUFUNC(op_13c0_0), 0, 5056 }, /* MOVE */ -{ XCPUFUNC(op_13d0_0), 0, 5072 }, /* MOVE */ -{ XCPUFUNC(op_13d8_0), 0, 5080 }, /* MOVE */ -{ XCPUFUNC(op_13e0_0), 0, 5088 }, /* MOVE */ -{ XCPUFUNC(op_13e8_0), 0, 5096 }, /* MOVE */ -{ XCPUFUNC(op_13f0_0), 0, 5104 }, /* MOVE */ -{ XCPUFUNC(op_13f8_0), 0, 5112 }, /* MOVE */ -{ XCPUFUNC(op_13f9_0), 0, 5113 }, /* MOVE */ -{ XCPUFUNC(op_13fa_0), 0, 5114 }, /* MOVE */ -{ XCPUFUNC(op_13fb_0), 0, 5115 }, /* MOVE */ -{ XCPUFUNC(op_13fc_0), 0, 5116 }, /* MOVE */ -{ XCPUFUNC(op_2000_0), 0, 8192 }, /* MOVE */ -{ XCPUFUNC(op_2008_0), 0, 8200 }, /* MOVE */ -{ XCPUFUNC(op_2010_0), 0, 8208 }, /* MOVE */ -{ XCPUFUNC(op_2018_0), 0, 8216 }, /* MOVE */ -{ XCPUFUNC(op_2020_0), 0, 8224 }, /* MOVE */ -{ XCPUFUNC(op_2028_0), 0, 8232 }, /* MOVE */ -{ XCPUFUNC(op_2030_0), 0, 8240 }, /* MOVE */ -{ XCPUFUNC(op_2038_0), 0, 8248 }, /* MOVE */ -{ XCPUFUNC(op_2039_0), 0, 8249 }, /* MOVE */ -{ XCPUFUNC(op_203a_0), 0, 8250 }, /* MOVE */ -{ XCPUFUNC(op_203b_0), 0, 8251 }, /* MOVE */ -{ XCPUFUNC(op_203c_0), 0, 8252 }, /* MOVE */ -{ XCPUFUNC(op_2040_0), 0, 8256 }, /* MOVEA */ -{ XCPUFUNC(op_2048_0), 0, 8264 }, /* MOVEA */ -{ XCPUFUNC(op_2050_0), 0, 8272 }, /* MOVEA */ -{ XCPUFUNC(op_2058_0), 0, 8280 }, /* MOVEA */ -{ XCPUFUNC(op_2060_0), 0, 8288 }, /* MOVEA */ -{ XCPUFUNC(op_2068_0), 0, 8296 }, /* MOVEA */ -{ XCPUFUNC(op_2070_0), 0, 8304 }, /* MOVEA */ -{ XCPUFUNC(op_2078_0), 0, 8312 }, /* MOVEA */ -{ XCPUFUNC(op_2079_0), 0, 8313 }, /* MOVEA */ -{ XCPUFUNC(op_207a_0), 0, 8314 }, /* MOVEA */ -{ XCPUFUNC(op_207b_0), 0, 8315 }, /* MOVEA */ -{ XCPUFUNC(op_207c_0), 0, 8316 }, /* MOVEA */ -{ XCPUFUNC(op_2080_0), 0, 8320 }, /* MOVE */ -{ XCPUFUNC(op_2088_0), 0, 8328 }, /* MOVE */ -{ XCPUFUNC(op_2090_0), 0, 8336 }, /* MOVE */ -{ XCPUFUNC(op_2098_0), 0, 8344 }, /* MOVE */ -{ XCPUFUNC(op_20a0_0), 0, 8352 }, /* MOVE */ -{ XCPUFUNC(op_20a8_0), 0, 8360 }, /* MOVE */ -{ XCPUFUNC(op_20b0_0), 0, 8368 }, /* MOVE */ -{ XCPUFUNC(op_20b8_0), 0, 8376 }, /* MOVE */ -{ XCPUFUNC(op_20b9_0), 0, 8377 }, /* MOVE */ -{ XCPUFUNC(op_20ba_0), 0, 8378 }, /* MOVE */ -{ XCPUFUNC(op_20bb_0), 0, 8379 }, /* MOVE */ -{ XCPUFUNC(op_20bc_0), 0, 8380 }, /* MOVE */ -{ XCPUFUNC(op_20c0_0), 0, 8384 }, /* MOVE */ -{ XCPUFUNC(op_20c8_0), 0, 8392 }, /* MOVE */ -{ XCPUFUNC(op_20d0_0), 0, 8400 }, /* MOVE */ -{ XCPUFUNC(op_20d8_0), 0, 8408 }, /* MOVE */ -{ XCPUFUNC(op_20e0_0), 0, 8416 }, /* MOVE */ -{ XCPUFUNC(op_20e8_0), 0, 8424 }, /* MOVE */ -{ XCPUFUNC(op_20f0_0), 0, 8432 }, /* MOVE */ -{ XCPUFUNC(op_20f8_0), 0, 8440 }, /* MOVE */ -{ XCPUFUNC(op_20f9_0), 0, 8441 }, /* MOVE */ -{ XCPUFUNC(op_20fa_0), 0, 8442 }, /* MOVE */ -{ XCPUFUNC(op_20fb_0), 0, 8443 }, /* MOVE */ -{ XCPUFUNC(op_20fc_0), 0, 8444 }, /* MOVE */ -{ XCPUFUNC(op_2100_0), 0, 8448 }, /* MOVE */ -{ XCPUFUNC(op_2108_0), 0, 8456 }, /* MOVE */ -{ XCPUFUNC(op_2110_0), 0, 8464 }, /* MOVE */ -{ XCPUFUNC(op_2118_0), 0, 8472 }, /* MOVE */ -{ XCPUFUNC(op_2120_0), 0, 8480 }, /* MOVE */ -{ XCPUFUNC(op_2128_0), 0, 8488 }, /* MOVE */ -{ XCPUFUNC(op_2130_0), 0, 8496 }, /* MOVE */ -{ XCPUFUNC(op_2138_0), 0, 8504 }, /* MOVE */ -{ XCPUFUNC(op_2139_0), 0, 8505 }, /* MOVE */ -{ XCPUFUNC(op_213a_0), 0, 8506 }, /* MOVE */ -{ XCPUFUNC(op_213b_0), 0, 8507 }, /* MOVE */ -{ XCPUFUNC(op_213c_0), 0, 8508 }, /* MOVE */ -{ XCPUFUNC(op_2140_0), 0, 8512 }, /* MOVE */ -{ XCPUFUNC(op_2148_0), 0, 8520 }, /* MOVE */ -{ XCPUFUNC(op_2150_0), 0, 8528 }, /* MOVE */ -{ XCPUFUNC(op_2158_0), 0, 8536 }, /* MOVE */ -{ XCPUFUNC(op_2160_0), 0, 8544 }, /* MOVE */ -{ XCPUFUNC(op_2168_0), 0, 8552 }, /* MOVE */ -{ XCPUFUNC(op_2170_0), 0, 8560 }, /* MOVE */ -{ XCPUFUNC(op_2178_0), 0, 8568 }, /* MOVE */ -{ XCPUFUNC(op_2179_0), 0, 8569 }, /* MOVE */ -{ XCPUFUNC(op_217a_0), 0, 8570 }, /* MOVE */ -{ XCPUFUNC(op_217b_0), 0, 8571 }, /* MOVE */ -{ XCPUFUNC(op_217c_0), 0, 8572 }, /* MOVE */ -{ XCPUFUNC(op_2180_0), 0, 8576 }, /* MOVE */ -{ XCPUFUNC(op_2188_0), 0, 8584 }, /* MOVE */ -{ XCPUFUNC(op_2190_0), 0, 8592 }, /* MOVE */ -{ XCPUFUNC(op_2198_0), 0, 8600 }, /* MOVE */ -{ XCPUFUNC(op_21a0_0), 0, 8608 }, /* MOVE */ -{ XCPUFUNC(op_21a8_0), 0, 8616 }, /* MOVE */ -{ XCPUFUNC(op_21b0_0), 0, 8624 }, /* MOVE */ -{ XCPUFUNC(op_21b8_0), 0, 8632 }, /* MOVE */ -{ XCPUFUNC(op_21b9_0), 0, 8633 }, /* MOVE */ -{ XCPUFUNC(op_21ba_0), 0, 8634 }, /* MOVE */ -{ XCPUFUNC(op_21bb_0), 0, 8635 }, /* MOVE */ -{ XCPUFUNC(op_21bc_0), 0, 8636 }, /* MOVE */ -{ XCPUFUNC(op_21c0_0), 0, 8640 }, /* MOVE */ -{ XCPUFUNC(op_21c8_0), 0, 8648 }, /* MOVE */ -{ XCPUFUNC(op_21d0_0), 0, 8656 }, /* MOVE */ -{ XCPUFUNC(op_21d8_0), 0, 8664 }, /* MOVE */ -{ XCPUFUNC(op_21e0_0), 0, 8672 }, /* MOVE */ -{ XCPUFUNC(op_21e8_0), 0, 8680 }, /* MOVE */ -{ XCPUFUNC(op_21f0_0), 0, 8688 }, /* MOVE */ -{ XCPUFUNC(op_21f8_0), 0, 8696 }, /* MOVE */ -{ XCPUFUNC(op_21f9_0), 0, 8697 }, /* MOVE */ -{ XCPUFUNC(op_21fa_0), 0, 8698 }, /* MOVE */ -{ XCPUFUNC(op_21fb_0), 0, 8699 }, /* MOVE */ -{ XCPUFUNC(op_21fc_0), 0, 8700 }, /* MOVE */ -{ XCPUFUNC(op_23c0_0), 0, 9152 }, /* MOVE */ -{ XCPUFUNC(op_23c8_0), 0, 9160 }, /* MOVE */ -{ XCPUFUNC(op_23d0_0), 0, 9168 }, /* MOVE */ -{ XCPUFUNC(op_23d8_0), 0, 9176 }, /* MOVE */ -{ XCPUFUNC(op_23e0_0), 0, 9184 }, /* MOVE */ -{ XCPUFUNC(op_23e8_0), 0, 9192 }, /* MOVE */ -{ XCPUFUNC(op_23f0_0), 0, 9200 }, /* MOVE */ -{ XCPUFUNC(op_23f8_0), 0, 9208 }, /* MOVE */ -{ XCPUFUNC(op_23f9_0), 0, 9209 }, /* MOVE */ -{ XCPUFUNC(op_23fa_0), 0, 9210 }, /* MOVE */ -{ XCPUFUNC(op_23fb_0), 0, 9211 }, /* MOVE */ -{ XCPUFUNC(op_23fc_0), 0, 9212 }, /* MOVE */ -{ XCPUFUNC(op_3000_0), 0, 12288 }, /* MOVE */ -{ XCPUFUNC(op_3008_0), 0, 12296 }, /* MOVE */ -{ XCPUFUNC(op_3010_0), 0, 12304 }, /* MOVE */ -{ XCPUFUNC(op_3018_0), 0, 12312 }, /* MOVE */ -{ XCPUFUNC(op_3020_0), 0, 12320 }, /* MOVE */ -{ XCPUFUNC(op_3028_0), 0, 12328 }, /* MOVE */ -{ XCPUFUNC(op_3030_0), 0, 12336 }, /* MOVE */ -{ XCPUFUNC(op_3038_0), 0, 12344 }, /* MOVE */ -{ XCPUFUNC(op_3039_0), 0, 12345 }, /* MOVE */ -{ XCPUFUNC(op_303a_0), 0, 12346 }, /* MOVE */ -{ XCPUFUNC(op_303b_0), 0, 12347 }, /* MOVE */ -{ XCPUFUNC(op_303c_0), 0, 12348 }, /* MOVE */ -{ XCPUFUNC(op_3040_0), 0, 12352 }, /* MOVEA */ -{ XCPUFUNC(op_3048_0), 0, 12360 }, /* MOVEA */ -{ XCPUFUNC(op_3050_0), 0, 12368 }, /* MOVEA */ -{ XCPUFUNC(op_3058_0), 0, 12376 }, /* MOVEA */ -{ XCPUFUNC(op_3060_0), 0, 12384 }, /* MOVEA */ -{ XCPUFUNC(op_3068_0), 0, 12392 }, /* MOVEA */ -{ XCPUFUNC(op_3070_0), 0, 12400 }, /* MOVEA */ -{ XCPUFUNC(op_3078_0), 0, 12408 }, /* MOVEA */ -{ XCPUFUNC(op_3079_0), 0, 12409 }, /* MOVEA */ -{ XCPUFUNC(op_307a_0), 0, 12410 }, /* MOVEA */ -{ XCPUFUNC(op_307b_0), 0, 12411 }, /* MOVEA */ -{ XCPUFUNC(op_307c_0), 0, 12412 }, /* MOVEA */ -{ XCPUFUNC(op_3080_0), 0, 12416 }, /* MOVE */ -{ XCPUFUNC(op_3088_0), 0, 12424 }, /* MOVE */ -{ XCPUFUNC(op_3090_0), 0, 12432 }, /* MOVE */ -{ XCPUFUNC(op_3098_0), 0, 12440 }, /* MOVE */ -{ XCPUFUNC(op_30a0_0), 0, 12448 }, /* MOVE */ -{ XCPUFUNC(op_30a8_0), 0, 12456 }, /* MOVE */ -{ XCPUFUNC(op_30b0_0), 0, 12464 }, /* MOVE */ -{ XCPUFUNC(op_30b8_0), 0, 12472 }, /* MOVE */ -{ XCPUFUNC(op_30b9_0), 0, 12473 }, /* MOVE */ -{ XCPUFUNC(op_30ba_0), 0, 12474 }, /* MOVE */ -{ XCPUFUNC(op_30bb_0), 0, 12475 }, /* MOVE */ -{ XCPUFUNC(op_30bc_0), 0, 12476 }, /* MOVE */ -{ XCPUFUNC(op_30c0_0), 0, 12480 }, /* MOVE */ -{ XCPUFUNC(op_30c8_0), 0, 12488 }, /* MOVE */ -{ XCPUFUNC(op_30d0_0), 0, 12496 }, /* MOVE */ -{ XCPUFUNC(op_30d8_0), 0, 12504 }, /* MOVE */ -{ XCPUFUNC(op_30e0_0), 0, 12512 }, /* MOVE */ -{ XCPUFUNC(op_30e8_0), 0, 12520 }, /* MOVE */ -{ XCPUFUNC(op_30f0_0), 0, 12528 }, /* MOVE */ -{ XCPUFUNC(op_30f8_0), 0, 12536 }, /* MOVE */ -{ XCPUFUNC(op_30f9_0), 0, 12537 }, /* MOVE */ -{ XCPUFUNC(op_30fa_0), 0, 12538 }, /* MOVE */ -{ XCPUFUNC(op_30fb_0), 0, 12539 }, /* MOVE */ -{ XCPUFUNC(op_30fc_0), 0, 12540 }, /* MOVE */ -{ XCPUFUNC(op_3100_0), 0, 12544 }, /* MOVE */ -{ XCPUFUNC(op_3108_0), 0, 12552 }, /* MOVE */ -{ XCPUFUNC(op_3110_0), 0, 12560 }, /* MOVE */ -{ XCPUFUNC(op_3118_0), 0, 12568 }, /* MOVE */ -{ XCPUFUNC(op_3120_0), 0, 12576 }, /* MOVE */ -{ XCPUFUNC(op_3128_0), 0, 12584 }, /* MOVE */ -{ XCPUFUNC(op_3130_0), 0, 12592 }, /* MOVE */ -{ XCPUFUNC(op_3138_0), 0, 12600 }, /* MOVE */ -{ XCPUFUNC(op_3139_0), 0, 12601 }, /* MOVE */ -{ XCPUFUNC(op_313a_0), 0, 12602 }, /* MOVE */ -{ XCPUFUNC(op_313b_0), 0, 12603 }, /* MOVE */ -{ XCPUFUNC(op_313c_0), 0, 12604 }, /* MOVE */ -{ XCPUFUNC(op_3140_0), 0, 12608 }, /* MOVE */ -{ XCPUFUNC(op_3148_0), 0, 12616 }, /* MOVE */ -{ XCPUFUNC(op_3150_0), 0, 12624 }, /* MOVE */ -{ XCPUFUNC(op_3158_0), 0, 12632 }, /* MOVE */ -{ XCPUFUNC(op_3160_0), 0, 12640 }, /* MOVE */ -{ XCPUFUNC(op_3168_0), 0, 12648 }, /* MOVE */ -{ XCPUFUNC(op_3170_0), 0, 12656 }, /* MOVE */ -{ XCPUFUNC(op_3178_0), 0, 12664 }, /* MOVE */ -{ XCPUFUNC(op_3179_0), 0, 12665 }, /* MOVE */ -{ XCPUFUNC(op_317a_0), 0, 12666 }, /* MOVE */ -{ XCPUFUNC(op_317b_0), 0, 12667 }, /* MOVE */ -{ XCPUFUNC(op_317c_0), 0, 12668 }, /* MOVE */ -{ XCPUFUNC(op_3180_0), 0, 12672 }, /* MOVE */ -{ XCPUFUNC(op_3188_0), 0, 12680 }, /* MOVE */ -{ XCPUFUNC(op_3190_0), 0, 12688 }, /* MOVE */ -{ XCPUFUNC(op_3198_0), 0, 12696 }, /* MOVE */ -{ XCPUFUNC(op_31a0_0), 0, 12704 }, /* MOVE */ -{ XCPUFUNC(op_31a8_0), 0, 12712 }, /* MOVE */ -{ XCPUFUNC(op_31b0_0), 0, 12720 }, /* MOVE */ -{ XCPUFUNC(op_31b8_0), 0, 12728 }, /* MOVE */ -{ XCPUFUNC(op_31b9_0), 0, 12729 }, /* MOVE */ -{ XCPUFUNC(op_31ba_0), 0, 12730 }, /* MOVE */ -{ XCPUFUNC(op_31bb_0), 0, 12731 }, /* MOVE */ -{ XCPUFUNC(op_31bc_0), 0, 12732 }, /* MOVE */ -{ XCPUFUNC(op_31c0_0), 0, 12736 }, /* MOVE */ -{ XCPUFUNC(op_31c8_0), 0, 12744 }, /* MOVE */ -{ XCPUFUNC(op_31d0_0), 0, 12752 }, /* MOVE */ -{ XCPUFUNC(op_31d8_0), 0, 12760 }, /* MOVE */ -{ XCPUFUNC(op_31e0_0), 0, 12768 }, /* MOVE */ -{ XCPUFUNC(op_31e8_0), 0, 12776 }, /* MOVE */ -{ XCPUFUNC(op_31f0_0), 0, 12784 }, /* MOVE */ -{ XCPUFUNC(op_31f8_0), 0, 12792 }, /* MOVE */ -{ XCPUFUNC(op_31f9_0), 0, 12793 }, /* MOVE */ -{ XCPUFUNC(op_31fa_0), 0, 12794 }, /* MOVE */ -{ XCPUFUNC(op_31fb_0), 0, 12795 }, /* MOVE */ -{ XCPUFUNC(op_31fc_0), 0, 12796 }, /* MOVE */ -{ XCPUFUNC(op_33c0_0), 0, 13248 }, /* MOVE */ -{ XCPUFUNC(op_33c8_0), 0, 13256 }, /* MOVE */ -{ XCPUFUNC(op_33d0_0), 0, 13264 }, /* MOVE */ -{ XCPUFUNC(op_33d8_0), 0, 13272 }, /* MOVE */ -{ XCPUFUNC(op_33e0_0), 0, 13280 }, /* MOVE */ -{ XCPUFUNC(op_33e8_0), 0, 13288 }, /* MOVE */ -{ XCPUFUNC(op_33f0_0), 0, 13296 }, /* MOVE */ -{ XCPUFUNC(op_33f8_0), 0, 13304 }, /* MOVE */ -{ XCPUFUNC(op_33f9_0), 0, 13305 }, /* MOVE */ -{ XCPUFUNC(op_33fa_0), 0, 13306 }, /* MOVE */ -{ XCPUFUNC(op_33fb_0), 0, 13307 }, /* MOVE */ -{ XCPUFUNC(op_33fc_0), 0, 13308 }, /* MOVE */ -{ XCPUFUNC(op_4000_0), 0, 16384 }, /* NEGX */ -{ XCPUFUNC(op_4010_0), 0, 16400 }, /* NEGX */ -{ XCPUFUNC(op_4018_0), 0, 16408 }, /* NEGX */ -{ XCPUFUNC(op_4020_0), 0, 16416 }, /* NEGX */ -{ XCPUFUNC(op_4028_0), 0, 16424 }, /* NEGX */ -{ XCPUFUNC(op_4030_0), 0, 16432 }, /* NEGX */ -{ XCPUFUNC(op_4038_0), 0, 16440 }, /* NEGX */ -{ XCPUFUNC(op_4039_0), 0, 16441 }, /* NEGX */ -{ XCPUFUNC(op_4040_0), 0, 16448 }, /* NEGX */ -{ XCPUFUNC(op_4050_0), 0, 16464 }, /* NEGX */ -{ XCPUFUNC(op_4058_0), 0, 16472 }, /* NEGX */ -{ XCPUFUNC(op_4060_0), 0, 16480 }, /* NEGX */ -{ XCPUFUNC(op_4068_0), 0, 16488 }, /* NEGX */ -{ XCPUFUNC(op_4070_0), 0, 16496 }, /* NEGX */ -{ XCPUFUNC(op_4078_0), 0, 16504 }, /* NEGX */ -{ XCPUFUNC(op_4079_0), 0, 16505 }, /* NEGX */ -{ XCPUFUNC(op_4080_0), 0, 16512 }, /* NEGX */ -{ XCPUFUNC(op_4090_0), 0, 16528 }, /* NEGX */ -{ XCPUFUNC(op_4098_0), 0, 16536 }, /* NEGX */ -{ XCPUFUNC(op_40a0_0), 0, 16544 }, /* NEGX */ -{ XCPUFUNC(op_40a8_0), 0, 16552 }, /* NEGX */ -{ XCPUFUNC(op_40b0_0), 0, 16560 }, /* NEGX */ -{ XCPUFUNC(op_40b8_0), 0, 16568 }, /* NEGX */ -{ XCPUFUNC(op_40b9_0), 0, 16569 }, /* NEGX */ -{ XCPUFUNC(op_40c0_0), 0, 16576 }, /* MVSR2 */ -{ XCPUFUNC(op_40d0_0), 0, 16592 }, /* MVSR2 */ -{ XCPUFUNC(op_40d8_0), 0, 16600 }, /* MVSR2 */ -{ XCPUFUNC(op_40e0_0), 0, 16608 }, /* MVSR2 */ -{ XCPUFUNC(op_40e8_0), 0, 16616 }, /* MVSR2 */ -{ XCPUFUNC(op_40f0_0), 0, 16624 }, /* MVSR2 */ -{ XCPUFUNC(op_40f8_0), 0, 16632 }, /* MVSR2 */ -{ XCPUFUNC(op_40f9_0), 0, 16633 }, /* MVSR2 */ -{ XCPUFUNC(op_4100_0), 0, 16640 }, /* CHK */ -{ XCPUFUNC(op_4110_0), 0, 16656 }, /* CHK */ -{ XCPUFUNC(op_4118_0), 0, 16664 }, /* CHK */ -{ XCPUFUNC(op_4120_0), 0, 16672 }, /* CHK */ -{ XCPUFUNC(op_4128_0), 0, 16680 }, /* CHK */ -{ XCPUFUNC(op_4130_0), 0, 16688 }, /* CHK */ -{ XCPUFUNC(op_4138_0), 0, 16696 }, /* CHK */ -{ XCPUFUNC(op_4139_0), 0, 16697 }, /* CHK */ -{ XCPUFUNC(op_413a_0), 0, 16698 }, /* CHK */ -{ XCPUFUNC(op_413b_0), 0, 16699 }, /* CHK */ -{ XCPUFUNC(op_413c_0), 0, 16700 }, /* CHK */ -{ XCPUFUNC(op_4180_0), 0, 16768 }, /* CHK */ -{ XCPUFUNC(op_4190_0), 0, 16784 }, /* CHK */ -{ XCPUFUNC(op_4198_0), 0, 16792 }, /* CHK */ -{ XCPUFUNC(op_41a0_0), 0, 16800 }, /* CHK */ -{ XCPUFUNC(op_41a8_0), 0, 16808 }, /* CHK */ -{ XCPUFUNC(op_41b0_0), 0, 16816 }, /* CHK */ -{ XCPUFUNC(op_41b8_0), 0, 16824 }, /* CHK */ -{ XCPUFUNC(op_41b9_0), 0, 16825 }, /* CHK */ -{ XCPUFUNC(op_41ba_0), 0, 16826 }, /* CHK */ -{ XCPUFUNC(op_41bb_0), 0, 16827 }, /* CHK */ -{ XCPUFUNC(op_41bc_0), 0, 16828 }, /* CHK */ -{ XCPUFUNC(op_41d0_0), 0, 16848 }, /* LEA */ -{ XCPUFUNC(op_41e8_0), 0, 16872 }, /* LEA */ -{ XCPUFUNC(op_41f0_0), 0, 16880 }, /* LEA */ -{ XCPUFUNC(op_41f8_0), 0, 16888 }, /* LEA */ -{ XCPUFUNC(op_41f9_0), 0, 16889 }, /* LEA */ -{ XCPUFUNC(op_41fa_0), 0, 16890 }, /* LEA */ -{ XCPUFUNC(op_41fb_0), 0, 16891 }, /* LEA */ -{ XCPUFUNC(op_4200_0), 0, 16896 }, /* CLR */ -{ XCPUFUNC(op_4210_0), 0, 16912 }, /* CLR */ -{ XCPUFUNC(op_4218_0), 0, 16920 }, /* CLR */ -{ XCPUFUNC(op_4220_0), 0, 16928 }, /* CLR */ -{ XCPUFUNC(op_4228_0), 0, 16936 }, /* CLR */ -{ XCPUFUNC(op_4230_0), 0, 16944 }, /* CLR */ -{ XCPUFUNC(op_4238_0), 0, 16952 }, /* CLR */ -{ XCPUFUNC(op_4239_0), 0, 16953 }, /* CLR */ -{ XCPUFUNC(op_4240_0), 0, 16960 }, /* CLR */ -{ XCPUFUNC(op_4250_0), 0, 16976 }, /* CLR */ -{ XCPUFUNC(op_4258_0), 0, 16984 }, /* CLR */ -{ XCPUFUNC(op_4260_0), 0, 16992 }, /* CLR */ -{ XCPUFUNC(op_4268_0), 0, 17000 }, /* CLR */ -{ XCPUFUNC(op_4270_0), 0, 17008 }, /* CLR */ -{ XCPUFUNC(op_4278_0), 0, 17016 }, /* CLR */ -{ XCPUFUNC(op_4279_0), 0, 17017 }, /* CLR */ -{ XCPUFUNC(op_4280_0), 0, 17024 }, /* CLR */ -{ XCPUFUNC(op_4290_0), 0, 17040 }, /* CLR */ -{ XCPUFUNC(op_4298_0), 0, 17048 }, /* CLR */ -{ XCPUFUNC(op_42a0_0), 0, 17056 }, /* CLR */ -{ XCPUFUNC(op_42a8_0), 0, 17064 }, /* CLR */ -{ XCPUFUNC(op_42b0_0), 0, 17072 }, /* CLR */ -{ XCPUFUNC(op_42b8_0), 0, 17080 }, /* CLR */ -{ XCPUFUNC(op_42b9_0), 0, 17081 }, /* CLR */ -{ XCPUFUNC(op_42c0_0), 0, 17088 }, /* MVSR2 */ -{ XCPUFUNC(op_42d0_0), 0, 17104 }, /* MVSR2 */ -{ XCPUFUNC(op_42d8_0), 0, 17112 }, /* MVSR2 */ -{ XCPUFUNC(op_42e0_0), 0, 17120 }, /* MVSR2 */ -{ XCPUFUNC(op_42e8_0), 0, 17128 }, /* MVSR2 */ -{ XCPUFUNC(op_42f0_0), 0, 17136 }, /* MVSR2 */ -{ XCPUFUNC(op_42f8_0), 0, 17144 }, /* MVSR2 */ -{ XCPUFUNC(op_42f9_0), 0, 17145 }, /* MVSR2 */ -{ XCPUFUNC(op_4400_0), 0, 17408 }, /* NEG */ -{ XCPUFUNC(op_4410_0), 0, 17424 }, /* NEG */ -{ XCPUFUNC(op_4418_0), 0, 17432 }, /* NEG */ -{ XCPUFUNC(op_4420_0), 0, 17440 }, /* NEG */ -{ XCPUFUNC(op_4428_0), 0, 17448 }, /* NEG */ -{ XCPUFUNC(op_4430_0), 0, 17456 }, /* NEG */ -{ XCPUFUNC(op_4438_0), 0, 17464 }, /* NEG */ -{ XCPUFUNC(op_4439_0), 0, 17465 }, /* NEG */ -{ XCPUFUNC(op_4440_0), 0, 17472 }, /* NEG */ -{ XCPUFUNC(op_4450_0), 0, 17488 }, /* NEG */ -{ XCPUFUNC(op_4458_0), 0, 17496 }, /* NEG */ -{ XCPUFUNC(op_4460_0), 0, 17504 }, /* NEG */ -{ XCPUFUNC(op_4468_0), 0, 17512 }, /* NEG */ -{ XCPUFUNC(op_4470_0), 0, 17520 }, /* NEG */ -{ XCPUFUNC(op_4478_0), 0, 17528 }, /* NEG */ -{ XCPUFUNC(op_4479_0), 0, 17529 }, /* NEG */ -{ XCPUFUNC(op_4480_0), 0, 17536 }, /* NEG */ -{ XCPUFUNC(op_4490_0), 0, 17552 }, /* NEG */ -{ XCPUFUNC(op_4498_0), 0, 17560 }, /* NEG */ -{ XCPUFUNC(op_44a0_0), 0, 17568 }, /* NEG */ -{ XCPUFUNC(op_44a8_0), 0, 17576 }, /* NEG */ -{ XCPUFUNC(op_44b0_0), 0, 17584 }, /* NEG */ -{ XCPUFUNC(op_44b8_0), 0, 17592 }, /* NEG */ -{ XCPUFUNC(op_44b9_0), 0, 17593 }, /* NEG */ -{ XCPUFUNC(op_44c0_0), 0, 17600 }, /* MV2SR */ -{ XCPUFUNC(op_44d0_0), 0, 17616 }, /* MV2SR */ -{ XCPUFUNC(op_44d8_0), 0, 17624 }, /* MV2SR */ -{ XCPUFUNC(op_44e0_0), 0, 17632 }, /* MV2SR */ -{ XCPUFUNC(op_44e8_0), 0, 17640 }, /* MV2SR */ -{ XCPUFUNC(op_44f0_0), 0, 17648 }, /* MV2SR */ -{ XCPUFUNC(op_44f8_0), 0, 17656 }, /* MV2SR */ -{ XCPUFUNC(op_44f9_0), 0, 17657 }, /* MV2SR */ -{ XCPUFUNC(op_44fa_0), 0, 17658 }, /* MV2SR */ -{ XCPUFUNC(op_44fb_0), 0, 17659 }, /* MV2SR */ -{ XCPUFUNC(op_44fc_0), 0, 17660 }, /* MV2SR */ -{ XCPUFUNC(op_4600_0), 0, 17920 }, /* NOT */ -{ XCPUFUNC(op_4610_0), 0, 17936 }, /* NOT */ -{ XCPUFUNC(op_4618_0), 0, 17944 }, /* NOT */ -{ XCPUFUNC(op_4620_0), 0, 17952 }, /* NOT */ -{ XCPUFUNC(op_4628_0), 0, 17960 }, /* NOT */ -{ XCPUFUNC(op_4630_0), 0, 17968 }, /* NOT */ -{ XCPUFUNC(op_4638_0), 0, 17976 }, /* NOT */ -{ XCPUFUNC(op_4639_0), 0, 17977 }, /* NOT */ -{ XCPUFUNC(op_4640_0), 0, 17984 }, /* NOT */ -{ XCPUFUNC(op_4650_0), 0, 18000 }, /* NOT */ -{ XCPUFUNC(op_4658_0), 0, 18008 }, /* NOT */ -{ XCPUFUNC(op_4660_0), 0, 18016 }, /* NOT */ -{ XCPUFUNC(op_4668_0), 0, 18024 }, /* NOT */ -{ XCPUFUNC(op_4670_0), 0, 18032 }, /* NOT */ -{ XCPUFUNC(op_4678_0), 0, 18040 }, /* NOT */ -{ XCPUFUNC(op_4679_0), 0, 18041 }, /* NOT */ -{ XCPUFUNC(op_4680_0), 0, 18048 }, /* NOT */ -{ XCPUFUNC(op_4690_0), 0, 18064 }, /* NOT */ -{ XCPUFUNC(op_4698_0), 0, 18072 }, /* NOT */ -{ XCPUFUNC(op_46a0_0), 0, 18080 }, /* NOT */ -{ XCPUFUNC(op_46a8_0), 0, 18088 }, /* NOT */ -{ XCPUFUNC(op_46b0_0), 0, 18096 }, /* NOT */ -{ XCPUFUNC(op_46b8_0), 0, 18104 }, /* NOT */ -{ XCPUFUNC(op_46b9_0), 0, 18105 }, /* NOT */ -{ XCPUFUNC(op_46c0_0), 0, 18112 }, /* MV2SR */ -{ XCPUFUNC(op_46d0_0), 0, 18128 }, /* MV2SR */ -{ XCPUFUNC(op_46d8_0), 0, 18136 }, /* MV2SR */ -{ XCPUFUNC(op_46e0_0), 0, 18144 }, /* MV2SR */ -{ XCPUFUNC(op_46e8_0), 0, 18152 }, /* MV2SR */ -{ XCPUFUNC(op_46f0_0), 0, 18160 }, /* MV2SR */ -{ XCPUFUNC(op_46f8_0), 0, 18168 }, /* MV2SR */ -{ XCPUFUNC(op_46f9_0), 0, 18169 }, /* MV2SR */ -{ XCPUFUNC(op_46fa_0), 0, 18170 }, /* MV2SR */ -{ XCPUFUNC(op_46fb_0), 0, 18171 }, /* MV2SR */ -{ XCPUFUNC(op_46fc_0), 0, 18172 }, /* MV2SR */ -{ XCPUFUNC(op_4800_0), 0, 18432 }, /* NBCD */ -{ XCPUFUNC(op_4808_0), 0, 18440 }, /* LINK */ -{ XCPUFUNC(op_4810_0), 0, 18448 }, /* NBCD */ -{ XCPUFUNC(op_4818_0), 0, 18456 }, /* NBCD */ -{ XCPUFUNC(op_4820_0), 0, 18464 }, /* NBCD */ -{ XCPUFUNC(op_4828_0), 0, 18472 }, /* NBCD */ -{ XCPUFUNC(op_4830_0), 0, 18480 }, /* NBCD */ -{ XCPUFUNC(op_4838_0), 0, 18488 }, /* NBCD */ -{ XCPUFUNC(op_4839_0), 0, 18489 }, /* NBCD */ -{ XCPUFUNC(op_4840_0), 0, 18496 }, /* SWAP */ -{ XCPUFUNC(op_4848_0), 0, 18504 }, /* BKPT */ -{ XCPUFUNC(op_4850_0), 0, 18512 }, /* PEA */ -{ XCPUFUNC(op_4868_0), 0, 18536 }, /* PEA */ -{ XCPUFUNC(op_4870_0), 0, 18544 }, /* PEA */ -{ XCPUFUNC(op_4878_0), 0, 18552 }, /* PEA */ -{ XCPUFUNC(op_4879_0), 0, 18553 }, /* PEA */ -{ XCPUFUNC(op_487a_0), 0, 18554 }, /* PEA */ -{ XCPUFUNC(op_487b_0), 0, 18555 }, /* PEA */ -{ XCPUFUNC(op_4880_0), 0, 18560 }, /* EXT */ -{ XCPUFUNC(op_4890_0), 0, 18576 }, /* MVMLE */ -{ XCPUFUNC(op_48a0_0), 0, 18592 }, /* MVMLE */ -{ XCPUFUNC(op_48a8_0), 0, 18600 }, /* MVMLE */ -{ XCPUFUNC(op_48b0_0), 0, 18608 }, /* MVMLE */ -{ XCPUFUNC(op_48b8_0), 0, 18616 }, /* MVMLE */ -{ XCPUFUNC(op_48b9_0), 0, 18617 }, /* MVMLE */ -{ XCPUFUNC(op_48c0_0), 0, 18624 }, /* EXT */ -{ XCPUFUNC(op_48d0_0), 0, 18640 }, /* MVMLE */ -{ XCPUFUNC(op_48e0_0), 0, 18656 }, /* MVMLE */ -{ XCPUFUNC(op_48e8_0), 0, 18664 }, /* MVMLE */ -{ XCPUFUNC(op_48f0_0), 0, 18672 }, /* MVMLE */ -{ XCPUFUNC(op_48f8_0), 0, 18680 }, /* MVMLE */ -{ XCPUFUNC(op_48f9_0), 0, 18681 }, /* MVMLE */ -{ XCPUFUNC(op_49c0_0), 0, 18880 }, /* EXT */ -{ XCPUFUNC(op_4a00_0), 0, 18944 }, /* TST */ -{ XCPUFUNC(op_4a10_0), 0, 18960 }, /* TST */ -{ XCPUFUNC(op_4a18_0), 0, 18968 }, /* TST */ -{ XCPUFUNC(op_4a20_0), 0, 18976 }, /* TST */ -{ XCPUFUNC(op_4a28_0), 0, 18984 }, /* TST */ -{ XCPUFUNC(op_4a30_0), 0, 18992 }, /* TST */ -{ XCPUFUNC(op_4a38_0), 0, 19000 }, /* TST */ -{ XCPUFUNC(op_4a39_0), 0, 19001 }, /* TST */ -{ XCPUFUNC(op_4a3a_0), 0, 19002 }, /* TST */ -{ XCPUFUNC(op_4a3b_0), 0, 19003 }, /* TST */ -{ XCPUFUNC(op_4a3c_0), 0, 19004 }, /* TST */ -{ XCPUFUNC(op_4a40_0), 0, 19008 }, /* TST */ -{ XCPUFUNC(op_4a48_0), 0, 19016 }, /* TST */ -{ XCPUFUNC(op_4a50_0), 0, 19024 }, /* TST */ -{ XCPUFUNC(op_4a58_0), 0, 19032 }, /* TST */ -{ XCPUFUNC(op_4a60_0), 0, 19040 }, /* TST */ -{ XCPUFUNC(op_4a68_0), 0, 19048 }, /* TST */ -{ XCPUFUNC(op_4a70_0), 0, 19056 }, /* TST */ -{ XCPUFUNC(op_4a78_0), 0, 19064 }, /* TST */ -{ XCPUFUNC(op_4a79_0), 0, 19065 }, /* TST */ -{ XCPUFUNC(op_4a7a_0), 0, 19066 }, /* TST */ -{ XCPUFUNC(op_4a7b_0), 0, 19067 }, /* TST */ -{ XCPUFUNC(op_4a7c_0), 0, 19068 }, /* TST */ -{ XCPUFUNC(op_4a80_0), 0, 19072 }, /* TST */ -{ XCPUFUNC(op_4a88_0), 0, 19080 }, /* TST */ -{ XCPUFUNC(op_4a90_0), 0, 19088 }, /* TST */ -{ XCPUFUNC(op_4a98_0), 0, 19096 }, /* TST */ -{ XCPUFUNC(op_4aa0_0), 0, 19104 }, /* TST */ -{ XCPUFUNC(op_4aa8_0), 0, 19112 }, /* TST */ -{ XCPUFUNC(op_4ab0_0), 0, 19120 }, /* TST */ -{ XCPUFUNC(op_4ab8_0), 0, 19128 }, /* TST */ -{ XCPUFUNC(op_4ab9_0), 0, 19129 }, /* TST */ -{ XCPUFUNC(op_4aba_0), 0, 19130 }, /* TST */ -{ XCPUFUNC(op_4abb_0), 0, 19131 }, /* TST */ -{ XCPUFUNC(op_4abc_0), 0, 19132 }, /* TST */ -{ XCPUFUNC(op_4ac0_0), 0, 19136 }, /* TAS */ -{ XCPUFUNC(op_4ad0_0), 0, 19152 }, /* TAS */ -{ XCPUFUNC(op_4ad8_0), 0, 19160 }, /* TAS */ -{ XCPUFUNC(op_4ae0_0), 0, 19168 }, /* TAS */ -{ XCPUFUNC(op_4ae8_0), 0, 19176 }, /* TAS */ -{ XCPUFUNC(op_4af0_0), 0, 19184 }, /* TAS */ -{ XCPUFUNC(op_4af8_0), 0, 19192 }, /* TAS */ -{ XCPUFUNC(op_4af9_0), 0, 19193 }, /* TAS */ -{ XCPUFUNC(op_4c00_0), 0, 19456 }, /* MULL */ -{ XCPUFUNC(op_4c10_0), 0, 19472 }, /* MULL */ -{ XCPUFUNC(op_4c18_0), 0, 19480 }, /* MULL */ -{ XCPUFUNC(op_4c20_0), 0, 19488 }, /* MULL */ -{ XCPUFUNC(op_4c28_0), 0, 19496 }, /* MULL */ -{ XCPUFUNC(op_4c30_0), 0, 19504 }, /* MULL */ -{ XCPUFUNC(op_4c38_0), 0, 19512 }, /* MULL */ -{ XCPUFUNC(op_4c39_0), 0, 19513 }, /* MULL */ -{ XCPUFUNC(op_4c3a_0), 0, 19514 }, /* MULL */ -{ XCPUFUNC(op_4c3b_0), 0, 19515 }, /* MULL */ -{ XCPUFUNC(op_4c3c_0), 0, 19516 }, /* MULL */ -{ XCPUFUNC(op_4c40_0), 0, 19520 }, /* DIVL */ -{ XCPUFUNC(op_4c50_0), 0, 19536 }, /* DIVL */ -{ XCPUFUNC(op_4c58_0), 0, 19544 }, /* DIVL */ -{ XCPUFUNC(op_4c60_0), 0, 19552 }, /* DIVL */ -{ XCPUFUNC(op_4c68_0), 0, 19560 }, /* DIVL */ -{ XCPUFUNC(op_4c70_0), 0, 19568 }, /* DIVL */ -{ XCPUFUNC(op_4c78_0), 0, 19576 }, /* DIVL */ -{ XCPUFUNC(op_4c79_0), 0, 19577 }, /* DIVL */ -{ XCPUFUNC(op_4c7a_0), 0, 19578 }, /* DIVL */ -{ XCPUFUNC(op_4c7b_0), 0, 19579 }, /* DIVL */ -{ XCPUFUNC(op_4c7c_0), 0, 19580 }, /* DIVL */ -{ XCPUFUNC(op_4c90_0), 0, 19600 }, /* MVMEL */ -{ XCPUFUNC(op_4c98_0), 0, 19608 }, /* MVMEL */ -{ XCPUFUNC(op_4ca8_0), 0, 19624 }, /* MVMEL */ -{ XCPUFUNC(op_4cb0_0), 0, 19632 }, /* MVMEL */ -{ XCPUFUNC(op_4cb8_0), 0, 19640 }, /* MVMEL */ -{ XCPUFUNC(op_4cb9_0), 0, 19641 }, /* MVMEL */ -{ XCPUFUNC(op_4cba_0), 0, 19642 }, /* MVMEL */ -{ XCPUFUNC(op_4cbb_0), 0, 19643 }, /* MVMEL */ -{ XCPUFUNC(op_4cd0_0), 0, 19664 }, /* MVMEL */ -{ XCPUFUNC(op_4cd8_0), 0, 19672 }, /* MVMEL */ -{ XCPUFUNC(op_4ce8_0), 0, 19688 }, /* MVMEL */ -{ XCPUFUNC(op_4cf0_0), 0, 19696 }, /* MVMEL */ -{ XCPUFUNC(op_4cf8_0), 0, 19704 }, /* MVMEL */ -{ XCPUFUNC(op_4cf9_0), 0, 19705 }, /* MVMEL */ -{ XCPUFUNC(op_4cfa_0), 0, 19706 }, /* MVMEL */ -{ XCPUFUNC(op_4cfb_0), 0, 19707 }, /* MVMEL */ -{ XCPUFUNC(op_4e40_0), 0, 20032 }, /* TRAP */ -{ XCPUFUNC(op_4e50_0), 0, 20048 }, /* LINK */ -{ XCPUFUNC(op_4e58_0), 0, 20056 }, /* UNLK */ -{ XCPUFUNC(op_4e60_0), 0, 20064 }, /* MVR2USP */ -{ XCPUFUNC(op_4e68_0), 0, 20072 }, /* MVUSP2R */ -{ XCPUFUNC(op_4e70_0), 0, 20080 }, /* RESET */ -{ XCPUFUNC(op_4e71_0), 0, 20081 }, /* NOP */ -{ XCPUFUNC(op_4e72_0), 0, 20082 }, /* STOP */ -{ XCPUFUNC(op_4e73_0), 0, 20083 }, /* RTE */ -{ XCPUFUNC(op_4e74_0), 0, 20084 }, /* RTD */ -{ XCPUFUNC(op_4e75_0), 0, 20085 }, /* RTS */ -{ XCPUFUNC(op_4e76_0), 0, 20086 }, /* TRAPV */ -{ XCPUFUNC(op_4e77_0), 0, 20087 }, /* RTR */ -{ XCPUFUNC(op_4e7a_0), 0, 20090 }, /* MOVEC2 */ -{ XCPUFUNC(op_4e7b_0), 0, 20091 }, /* MOVE2C */ -{ XCPUFUNC(op_4e90_0), 0, 20112 }, /* JSR */ -{ XCPUFUNC(op_4ea8_0), 0, 20136 }, /* JSR */ -{ XCPUFUNC(op_4eb0_0), 0, 20144 }, /* JSR */ -{ XCPUFUNC(op_4eb8_0), 0, 20152 }, /* JSR */ -{ XCPUFUNC(op_4eb9_0), 0, 20153 }, /* JSR */ -{ XCPUFUNC(op_4eba_0), 0, 20154 }, /* JSR */ -{ XCPUFUNC(op_4ebb_0), 0, 20155 }, /* JSR */ -{ XCPUFUNC(op_4ed0_0), 0, 20176 }, /* JMP */ -{ XCPUFUNC(op_4ee8_0), 0, 20200 }, /* JMP */ -{ XCPUFUNC(op_4ef0_0), 0, 20208 }, /* JMP */ -{ XCPUFUNC(op_4ef8_0), 0, 20216 }, /* JMP */ -{ XCPUFUNC(op_4ef9_0), 0, 20217 }, /* JMP */ -{ XCPUFUNC(op_4efa_0), 0, 20218 }, /* JMP */ -{ XCPUFUNC(op_4efb_0), 0, 20219 }, /* JMP */ -{ XCPUFUNC(op_5000_0), 0, 20480 }, /* ADD */ -{ XCPUFUNC(op_5010_0), 0, 20496 }, /* ADD */ -{ XCPUFUNC(op_5018_0), 0, 20504 }, /* ADD */ -{ XCPUFUNC(op_5020_0), 0, 20512 }, /* ADD */ -{ XCPUFUNC(op_5028_0), 0, 20520 }, /* ADD */ -{ XCPUFUNC(op_5030_0), 0, 20528 }, /* ADD */ -{ XCPUFUNC(op_5038_0), 0, 20536 }, /* ADD */ -{ XCPUFUNC(op_5039_0), 0, 20537 }, /* ADD */ -{ XCPUFUNC(op_5040_0), 0, 20544 }, /* ADD */ -{ XCPUFUNC(op_5048_0), 0, 20552 }, /* ADDA */ -{ XCPUFUNC(op_5050_0), 0, 20560 }, /* ADD */ -{ XCPUFUNC(op_5058_0), 0, 20568 }, /* ADD */ -{ XCPUFUNC(op_5060_0), 0, 20576 }, /* ADD */ -{ XCPUFUNC(op_5068_0), 0, 20584 }, /* ADD */ -{ XCPUFUNC(op_5070_0), 0, 20592 }, /* ADD */ -{ XCPUFUNC(op_5078_0), 0, 20600 }, /* ADD */ -{ XCPUFUNC(op_5079_0), 0, 20601 }, /* ADD */ -{ XCPUFUNC(op_5080_0), 0, 20608 }, /* ADD */ -{ XCPUFUNC(op_5088_0), 0, 20616 }, /* ADDA */ -{ XCPUFUNC(op_5090_0), 0, 20624 }, /* ADD */ -{ XCPUFUNC(op_5098_0), 0, 20632 }, /* ADD */ -{ XCPUFUNC(op_50a0_0), 0, 20640 }, /* ADD */ -{ XCPUFUNC(op_50a8_0), 0, 20648 }, /* ADD */ -{ XCPUFUNC(op_50b0_0), 0, 20656 }, /* ADD */ -{ XCPUFUNC(op_50b8_0), 0, 20664 }, /* ADD */ -{ XCPUFUNC(op_50b9_0), 0, 20665 }, /* ADD */ -{ XCPUFUNC(op_50c0_0), 0, 20672 }, /* Scc */ -{ XCPUFUNC(op_50c8_0), 0, 20680 }, /* DBcc */ -{ XCPUFUNC(op_50d0_0), 0, 20688 }, /* Scc */ -{ XCPUFUNC(op_50d8_0), 0, 20696 }, /* Scc */ -{ XCPUFUNC(op_50e0_0), 0, 20704 }, /* Scc */ -{ XCPUFUNC(op_50e8_0), 0, 20712 }, /* Scc */ -{ XCPUFUNC(op_50f0_0), 0, 20720 }, /* Scc */ -{ XCPUFUNC(op_50f8_0), 0, 20728 }, /* Scc */ -{ XCPUFUNC(op_50f9_0), 0, 20729 }, /* Scc */ -{ XCPUFUNC(op_50fa_0), 0, 20730 }, /* TRAPcc */ -{ XCPUFUNC(op_50fb_0), 0, 20731 }, /* TRAPcc */ -{ XCPUFUNC(op_50fc_0), 0, 20732 }, /* TRAPcc */ -{ XCPUFUNC(op_5100_0), 0, 20736 }, /* SUB */ -{ XCPUFUNC(op_5110_0), 0, 20752 }, /* SUB */ -{ XCPUFUNC(op_5118_0), 0, 20760 }, /* SUB */ -{ XCPUFUNC(op_5120_0), 0, 20768 }, /* SUB */ -{ XCPUFUNC(op_5128_0), 0, 20776 }, /* SUB */ -{ XCPUFUNC(op_5130_0), 0, 20784 }, /* SUB */ -{ XCPUFUNC(op_5138_0), 0, 20792 }, /* SUB */ -{ XCPUFUNC(op_5139_0), 0, 20793 }, /* SUB */ -{ XCPUFUNC(op_5140_0), 0, 20800 }, /* SUB */ -{ XCPUFUNC(op_5148_0), 0, 20808 }, /* SUBA */ -{ XCPUFUNC(op_5150_0), 0, 20816 }, /* SUB */ -{ XCPUFUNC(op_5158_0), 0, 20824 }, /* SUB */ -{ XCPUFUNC(op_5160_0), 0, 20832 }, /* SUB */ -{ XCPUFUNC(op_5168_0), 0, 20840 }, /* SUB */ -{ XCPUFUNC(op_5170_0), 0, 20848 }, /* SUB */ -{ XCPUFUNC(op_5178_0), 0, 20856 }, /* SUB */ -{ XCPUFUNC(op_5179_0), 0, 20857 }, /* SUB */ -{ XCPUFUNC(op_5180_0), 0, 20864 }, /* SUB */ -{ XCPUFUNC(op_5188_0), 0, 20872 }, /* SUBA */ -{ XCPUFUNC(op_5190_0), 0, 20880 }, /* SUB */ -{ XCPUFUNC(op_5198_0), 0, 20888 }, /* SUB */ -{ XCPUFUNC(op_51a0_0), 0, 20896 }, /* SUB */ -{ XCPUFUNC(op_51a8_0), 0, 20904 }, /* SUB */ -{ XCPUFUNC(op_51b0_0), 0, 20912 }, /* SUB */ -{ XCPUFUNC(op_51b8_0), 0, 20920 }, /* SUB */ -{ XCPUFUNC(op_51b9_0), 0, 20921 }, /* SUB */ -{ XCPUFUNC(op_51c0_0), 0, 20928 }, /* Scc */ -{ XCPUFUNC(op_51c8_0), 0, 20936 }, /* DBcc */ -{ XCPUFUNC(op_51d0_0), 0, 20944 }, /* Scc */ -{ XCPUFUNC(op_51d8_0), 0, 20952 }, /* Scc */ -{ XCPUFUNC(op_51e0_0), 0, 20960 }, /* Scc */ -{ XCPUFUNC(op_51e8_0), 0, 20968 }, /* Scc */ -{ XCPUFUNC(op_51f0_0), 0, 20976 }, /* Scc */ -{ XCPUFUNC(op_51f8_0), 0, 20984 }, /* Scc */ -{ XCPUFUNC(op_51f9_0), 0, 20985 }, /* Scc */ -{ XCPUFUNC(op_51fa_0), 0, 20986 }, /* TRAPcc */ -{ XCPUFUNC(op_51fb_0), 0, 20987 }, /* TRAPcc */ -{ XCPUFUNC(op_51fc_0), 0, 20988 }, /* TRAPcc */ -{ XCPUFUNC(op_52c0_0), 0, 21184 }, /* Scc */ -{ XCPUFUNC(op_52c8_0), 0, 21192 }, /* DBcc */ -{ XCPUFUNC(op_52d0_0), 0, 21200 }, /* Scc */ -{ XCPUFUNC(op_52d8_0), 0, 21208 }, /* Scc */ -{ XCPUFUNC(op_52e0_0), 0, 21216 }, /* Scc */ -{ XCPUFUNC(op_52e8_0), 0, 21224 }, /* Scc */ -{ XCPUFUNC(op_52f0_0), 0, 21232 }, /* Scc */ -{ XCPUFUNC(op_52f8_0), 0, 21240 }, /* Scc */ -{ XCPUFUNC(op_52f9_0), 0, 21241 }, /* Scc */ -{ XCPUFUNC(op_52fa_0), 0, 21242 }, /* TRAPcc */ -{ XCPUFUNC(op_52fb_0), 0, 21243 }, /* TRAPcc */ -{ XCPUFUNC(op_52fc_0), 0, 21244 }, /* TRAPcc */ -{ XCPUFUNC(op_53c0_0), 0, 21440 }, /* Scc */ -{ XCPUFUNC(op_53c8_0), 0, 21448 }, /* DBcc */ -{ XCPUFUNC(op_53d0_0), 0, 21456 }, /* Scc */ -{ XCPUFUNC(op_53d8_0), 0, 21464 }, /* Scc */ -{ XCPUFUNC(op_53e0_0), 0, 21472 }, /* Scc */ -{ XCPUFUNC(op_53e8_0), 0, 21480 }, /* Scc */ -{ XCPUFUNC(op_53f0_0), 0, 21488 }, /* Scc */ -{ XCPUFUNC(op_53f8_0), 0, 21496 }, /* Scc */ -{ XCPUFUNC(op_53f9_0), 0, 21497 }, /* Scc */ -{ XCPUFUNC(op_53fa_0), 0, 21498 }, /* TRAPcc */ -{ XCPUFUNC(op_53fb_0), 0, 21499 }, /* TRAPcc */ -{ XCPUFUNC(op_53fc_0), 0, 21500 }, /* TRAPcc */ -{ XCPUFUNC(op_54c0_0), 0, 21696 }, /* Scc */ -{ XCPUFUNC(op_54c8_0), 0, 21704 }, /* DBcc */ -{ XCPUFUNC(op_54d0_0), 0, 21712 }, /* Scc */ -{ XCPUFUNC(op_54d8_0), 0, 21720 }, /* Scc */ -{ XCPUFUNC(op_54e0_0), 0, 21728 }, /* Scc */ -{ XCPUFUNC(op_54e8_0), 0, 21736 }, /* Scc */ -{ XCPUFUNC(op_54f0_0), 0, 21744 }, /* Scc */ -{ XCPUFUNC(op_54f8_0), 0, 21752 }, /* Scc */ -{ XCPUFUNC(op_54f9_0), 0, 21753 }, /* Scc */ -{ XCPUFUNC(op_54fa_0), 0, 21754 }, /* TRAPcc */ -{ XCPUFUNC(op_54fb_0), 0, 21755 }, /* TRAPcc */ -{ XCPUFUNC(op_54fc_0), 0, 21756 }, /* TRAPcc */ -{ XCPUFUNC(op_55c0_0), 0, 21952 }, /* Scc */ -{ XCPUFUNC(op_55c8_0), 0, 21960 }, /* DBcc */ -{ XCPUFUNC(op_55d0_0), 0, 21968 }, /* Scc */ -{ XCPUFUNC(op_55d8_0), 0, 21976 }, /* Scc */ -{ XCPUFUNC(op_55e0_0), 0, 21984 }, /* Scc */ -{ XCPUFUNC(op_55e8_0), 0, 21992 }, /* Scc */ -{ XCPUFUNC(op_55f0_0), 0, 22000 }, /* Scc */ -{ XCPUFUNC(op_55f8_0), 0, 22008 }, /* Scc */ -{ XCPUFUNC(op_55f9_0), 0, 22009 }, /* Scc */ -{ XCPUFUNC(op_55fa_0), 0, 22010 }, /* TRAPcc */ -{ XCPUFUNC(op_55fb_0), 0, 22011 }, /* TRAPcc */ -{ XCPUFUNC(op_55fc_0), 0, 22012 }, /* TRAPcc */ -{ XCPUFUNC(op_56c0_0), 0, 22208 }, /* Scc */ -{ XCPUFUNC(op_56c8_0), 0, 22216 }, /* DBcc */ -{ XCPUFUNC(op_56d0_0), 0, 22224 }, /* Scc */ -{ XCPUFUNC(op_56d8_0), 0, 22232 }, /* Scc */ -{ XCPUFUNC(op_56e0_0), 0, 22240 }, /* Scc */ -{ XCPUFUNC(op_56e8_0), 0, 22248 }, /* Scc */ -{ XCPUFUNC(op_56f0_0), 0, 22256 }, /* Scc */ -{ XCPUFUNC(op_56f8_0), 0, 22264 }, /* Scc */ -{ XCPUFUNC(op_56f9_0), 0, 22265 }, /* Scc */ -{ XCPUFUNC(op_56fa_0), 0, 22266 }, /* TRAPcc */ -{ XCPUFUNC(op_56fb_0), 0, 22267 }, /* TRAPcc */ -{ XCPUFUNC(op_56fc_0), 0, 22268 }, /* TRAPcc */ -{ XCPUFUNC(op_57c0_0), 0, 22464 }, /* Scc */ -{ XCPUFUNC(op_57c8_0), 0, 22472 }, /* DBcc */ -{ XCPUFUNC(op_57d0_0), 0, 22480 }, /* Scc */ -{ XCPUFUNC(op_57d8_0), 0, 22488 }, /* Scc */ -{ XCPUFUNC(op_57e0_0), 0, 22496 }, /* Scc */ -{ XCPUFUNC(op_57e8_0), 0, 22504 }, /* Scc */ -{ XCPUFUNC(op_57f0_0), 0, 22512 }, /* Scc */ -{ XCPUFUNC(op_57f8_0), 0, 22520 }, /* Scc */ -{ XCPUFUNC(op_57f9_0), 0, 22521 }, /* Scc */ -{ XCPUFUNC(op_57fa_0), 0, 22522 }, /* TRAPcc */ -{ XCPUFUNC(op_57fb_0), 0, 22523 }, /* TRAPcc */ -{ XCPUFUNC(op_57fc_0), 0, 22524 }, /* TRAPcc */ -{ XCPUFUNC(op_58c0_0), 0, 22720 }, /* Scc */ -{ XCPUFUNC(op_58c8_0), 0, 22728 }, /* DBcc */ -{ XCPUFUNC(op_58d0_0), 0, 22736 }, /* Scc */ -{ XCPUFUNC(op_58d8_0), 0, 22744 }, /* Scc */ -{ XCPUFUNC(op_58e0_0), 0, 22752 }, /* Scc */ -{ XCPUFUNC(op_58e8_0), 0, 22760 }, /* Scc */ -{ XCPUFUNC(op_58f0_0), 0, 22768 }, /* Scc */ -{ XCPUFUNC(op_58f8_0), 0, 22776 }, /* Scc */ -{ XCPUFUNC(op_58f9_0), 0, 22777 }, /* Scc */ -{ XCPUFUNC(op_58fa_0), 0, 22778 }, /* TRAPcc */ -{ XCPUFUNC(op_58fb_0), 0, 22779 }, /* TRAPcc */ -{ XCPUFUNC(op_58fc_0), 0, 22780 }, /* TRAPcc */ -{ XCPUFUNC(op_59c0_0), 0, 22976 }, /* Scc */ -{ XCPUFUNC(op_59c8_0), 0, 22984 }, /* DBcc */ -{ XCPUFUNC(op_59d0_0), 0, 22992 }, /* Scc */ -{ XCPUFUNC(op_59d8_0), 0, 23000 }, /* Scc */ -{ XCPUFUNC(op_59e0_0), 0, 23008 }, /* Scc */ -{ XCPUFUNC(op_59e8_0), 0, 23016 }, /* Scc */ -{ XCPUFUNC(op_59f0_0), 0, 23024 }, /* Scc */ -{ XCPUFUNC(op_59f8_0), 0, 23032 }, /* Scc */ -{ XCPUFUNC(op_59f9_0), 0, 23033 }, /* Scc */ -{ XCPUFUNC(op_59fa_0), 0, 23034 }, /* TRAPcc */ -{ XCPUFUNC(op_59fb_0), 0, 23035 }, /* TRAPcc */ -{ XCPUFUNC(op_59fc_0), 0, 23036 }, /* TRAPcc */ -{ XCPUFUNC(op_5ac0_0), 0, 23232 }, /* Scc */ -{ XCPUFUNC(op_5ac8_0), 0, 23240 }, /* DBcc */ -{ XCPUFUNC(op_5ad0_0), 0, 23248 }, /* Scc */ -{ XCPUFUNC(op_5ad8_0), 0, 23256 }, /* Scc */ -{ XCPUFUNC(op_5ae0_0), 0, 23264 }, /* Scc */ -{ XCPUFUNC(op_5ae8_0), 0, 23272 }, /* Scc */ -{ XCPUFUNC(op_5af0_0), 0, 23280 }, /* Scc */ -{ XCPUFUNC(op_5af8_0), 0, 23288 }, /* Scc */ -{ XCPUFUNC(op_5af9_0), 0, 23289 }, /* Scc */ -{ XCPUFUNC(op_5afa_0), 0, 23290 }, /* TRAPcc */ -{ XCPUFUNC(op_5afb_0), 0, 23291 }, /* TRAPcc */ -{ XCPUFUNC(op_5afc_0), 0, 23292 }, /* TRAPcc */ -{ XCPUFUNC(op_5bc0_0), 0, 23488 }, /* Scc */ -{ XCPUFUNC(op_5bc8_0), 0, 23496 }, /* DBcc */ -{ XCPUFUNC(op_5bd0_0), 0, 23504 }, /* Scc */ -{ XCPUFUNC(op_5bd8_0), 0, 23512 }, /* Scc */ -{ XCPUFUNC(op_5be0_0), 0, 23520 }, /* Scc */ -{ XCPUFUNC(op_5be8_0), 0, 23528 }, /* Scc */ -{ XCPUFUNC(op_5bf0_0), 0, 23536 }, /* Scc */ -{ XCPUFUNC(op_5bf8_0), 0, 23544 }, /* Scc */ -{ XCPUFUNC(op_5bf9_0), 0, 23545 }, /* Scc */ -{ XCPUFUNC(op_5bfa_0), 0, 23546 }, /* TRAPcc */ -{ XCPUFUNC(op_5bfb_0), 0, 23547 }, /* TRAPcc */ -{ XCPUFUNC(op_5bfc_0), 0, 23548 }, /* TRAPcc */ -{ XCPUFUNC(op_5cc0_0), 0, 23744 }, /* Scc */ -{ XCPUFUNC(op_5cc8_0), 0, 23752 }, /* DBcc */ -{ XCPUFUNC(op_5cd0_0), 0, 23760 }, /* Scc */ -{ XCPUFUNC(op_5cd8_0), 0, 23768 }, /* Scc */ -{ XCPUFUNC(op_5ce0_0), 0, 23776 }, /* Scc */ -{ XCPUFUNC(op_5ce8_0), 0, 23784 }, /* Scc */ -{ XCPUFUNC(op_5cf0_0), 0, 23792 }, /* Scc */ -{ XCPUFUNC(op_5cf8_0), 0, 23800 }, /* Scc */ -{ XCPUFUNC(op_5cf9_0), 0, 23801 }, /* Scc */ -{ XCPUFUNC(op_5cfa_0), 0, 23802 }, /* TRAPcc */ -{ XCPUFUNC(op_5cfb_0), 0, 23803 }, /* TRAPcc */ -{ XCPUFUNC(op_5cfc_0), 0, 23804 }, /* TRAPcc */ -{ XCPUFUNC(op_5dc0_0), 0, 24000 }, /* Scc */ -{ XCPUFUNC(op_5dc8_0), 0, 24008 }, /* DBcc */ -{ XCPUFUNC(op_5dd0_0), 0, 24016 }, /* Scc */ -{ XCPUFUNC(op_5dd8_0), 0, 24024 }, /* Scc */ -{ XCPUFUNC(op_5de0_0), 0, 24032 }, /* Scc */ -{ XCPUFUNC(op_5de8_0), 0, 24040 }, /* Scc */ -{ XCPUFUNC(op_5df0_0), 0, 24048 }, /* Scc */ -{ XCPUFUNC(op_5df8_0), 0, 24056 }, /* Scc */ -{ XCPUFUNC(op_5df9_0), 0, 24057 }, /* Scc */ -{ XCPUFUNC(op_5dfa_0), 0, 24058 }, /* TRAPcc */ -{ XCPUFUNC(op_5dfb_0), 0, 24059 }, /* TRAPcc */ -{ XCPUFUNC(op_5dfc_0), 0, 24060 }, /* TRAPcc */ -{ XCPUFUNC(op_5ec0_0), 0, 24256 }, /* Scc */ -{ XCPUFUNC(op_5ec8_0), 0, 24264 }, /* DBcc */ -{ XCPUFUNC(op_5ed0_0), 0, 24272 }, /* Scc */ -{ XCPUFUNC(op_5ed8_0), 0, 24280 }, /* Scc */ -{ XCPUFUNC(op_5ee0_0), 0, 24288 }, /* Scc */ -{ XCPUFUNC(op_5ee8_0), 0, 24296 }, /* Scc */ -{ XCPUFUNC(op_5ef0_0), 0, 24304 }, /* Scc */ -{ XCPUFUNC(op_5ef8_0), 0, 24312 }, /* Scc */ -{ XCPUFUNC(op_5ef9_0), 0, 24313 }, /* Scc */ -{ XCPUFUNC(op_5efa_0), 0, 24314 }, /* TRAPcc */ -{ XCPUFUNC(op_5efb_0), 0, 24315 }, /* TRAPcc */ -{ XCPUFUNC(op_5efc_0), 0, 24316 }, /* TRAPcc */ -{ XCPUFUNC(op_5fc0_0), 0, 24512 }, /* Scc */ -{ XCPUFUNC(op_5fc8_0), 0, 24520 }, /* DBcc */ -{ XCPUFUNC(op_5fd0_0), 0, 24528 }, /* Scc */ -{ XCPUFUNC(op_5fd8_0), 0, 24536 }, /* Scc */ -{ XCPUFUNC(op_5fe0_0), 0, 24544 }, /* Scc */ -{ XCPUFUNC(op_5fe8_0), 0, 24552 }, /* Scc */ -{ XCPUFUNC(op_5ff0_0), 0, 24560 }, /* Scc */ -{ XCPUFUNC(op_5ff8_0), 0, 24568 }, /* Scc */ -{ XCPUFUNC(op_5ff9_0), 0, 24569 }, /* Scc */ -{ XCPUFUNC(op_5ffa_0), 0, 24570 }, /* TRAPcc */ -{ XCPUFUNC(op_5ffb_0), 0, 24571 }, /* TRAPcc */ -{ XCPUFUNC(op_5ffc_0), 0, 24572 }, /* TRAPcc */ -{ XCPUFUNC(op_6000_0), 0, 24576 }, /* Bcc */ -{ XCPUFUNC(op_6001_0), 0, 24577 }, /* Bcc */ -{ XCPUFUNC(op_60ff_0), 0, 24831 }, /* Bcc */ -{ XCPUFUNC(op_6100_0), 0, 24832 }, /* BSR */ -{ XCPUFUNC(op_6101_0), 0, 24833 }, /* BSR */ -{ XCPUFUNC(op_61ff_0), 0, 25087 }, /* BSR */ -{ XCPUFUNC(op_6200_0), 0, 25088 }, /* Bcc */ -{ XCPUFUNC(op_6201_0), 0, 25089 }, /* Bcc */ -{ XCPUFUNC(op_62ff_0), 0, 25343 }, /* Bcc */ -{ XCPUFUNC(op_6300_0), 0, 25344 }, /* Bcc */ -{ XCPUFUNC(op_6301_0), 0, 25345 }, /* Bcc */ -{ XCPUFUNC(op_63ff_0), 0, 25599 }, /* Bcc */ -{ XCPUFUNC(op_6400_0), 0, 25600 }, /* Bcc */ -{ XCPUFUNC(op_6401_0), 0, 25601 }, /* Bcc */ -{ XCPUFUNC(op_64ff_0), 0, 25855 }, /* Bcc */ -{ XCPUFUNC(op_6500_0), 0, 25856 }, /* Bcc */ -{ XCPUFUNC(op_6501_0), 0, 25857 }, /* Bcc */ -{ XCPUFUNC(op_65ff_0), 0, 26111 }, /* Bcc */ -{ XCPUFUNC(op_6600_0), 0, 26112 }, /* Bcc */ -{ XCPUFUNC(op_6601_0), 0, 26113 }, /* Bcc */ -{ XCPUFUNC(op_66ff_0), 0, 26367 }, /* Bcc */ -{ XCPUFUNC(op_6700_0), 0, 26368 }, /* Bcc */ -{ XCPUFUNC(op_6701_0), 0, 26369 }, /* Bcc */ -{ XCPUFUNC(op_67ff_0), 0, 26623 }, /* Bcc */ -{ XCPUFUNC(op_6800_0), 0, 26624 }, /* Bcc */ -{ XCPUFUNC(op_6801_0), 0, 26625 }, /* Bcc */ -{ XCPUFUNC(op_68ff_0), 0, 26879 }, /* Bcc */ -{ XCPUFUNC(op_6900_0), 0, 26880 }, /* Bcc */ -{ XCPUFUNC(op_6901_0), 0, 26881 }, /* Bcc */ -{ XCPUFUNC(op_69ff_0), 0, 27135 }, /* Bcc */ -{ XCPUFUNC(op_6a00_0), 0, 27136 }, /* Bcc */ -{ XCPUFUNC(op_6a01_0), 0, 27137 }, /* Bcc */ -{ XCPUFUNC(op_6aff_0), 0, 27391 }, /* Bcc */ -{ XCPUFUNC(op_6b00_0), 0, 27392 }, /* Bcc */ -{ XCPUFUNC(op_6b01_0), 0, 27393 }, /* Bcc */ -{ XCPUFUNC(op_6bff_0), 0, 27647 }, /* Bcc */ -{ XCPUFUNC(op_6c00_0), 0, 27648 }, /* Bcc */ -{ XCPUFUNC(op_6c01_0), 0, 27649 }, /* Bcc */ -{ XCPUFUNC(op_6cff_0), 0, 27903 }, /* Bcc */ -{ XCPUFUNC(op_6d00_0), 0, 27904 }, /* Bcc */ -{ XCPUFUNC(op_6d01_0), 0, 27905 }, /* Bcc */ -{ XCPUFUNC(op_6dff_0), 0, 28159 }, /* Bcc */ -{ XCPUFUNC(op_6e00_0), 0, 28160 }, /* Bcc */ -{ XCPUFUNC(op_6e01_0), 0, 28161 }, /* Bcc */ -{ XCPUFUNC(op_6eff_0), 0, 28415 }, /* Bcc */ -{ XCPUFUNC(op_6f00_0), 0, 28416 }, /* Bcc */ -{ XCPUFUNC(op_6f01_0), 0, 28417 }, /* Bcc */ -{ XCPUFUNC(op_6fff_0), 0, 28671 }, /* Bcc */ -{ XCPUFUNC(op_7000_0), 0, 28672 }, /* MOVE */ -{ XCPUFUNC(op_8000_0), 0, 32768 }, /* OR */ -{ XCPUFUNC(op_8010_0), 0, 32784 }, /* OR */ -{ XCPUFUNC(op_8018_0), 0, 32792 }, /* OR */ -{ XCPUFUNC(op_8020_0), 0, 32800 }, /* OR */ -{ XCPUFUNC(op_8028_0), 0, 32808 }, /* OR */ -{ XCPUFUNC(op_8030_0), 0, 32816 }, /* OR */ -{ XCPUFUNC(op_8038_0), 0, 32824 }, /* OR */ -{ XCPUFUNC(op_8039_0), 0, 32825 }, /* OR */ -{ XCPUFUNC(op_803a_0), 0, 32826 }, /* OR */ -{ XCPUFUNC(op_803b_0), 0, 32827 }, /* OR */ -{ XCPUFUNC(op_803c_0), 0, 32828 }, /* OR */ -{ XCPUFUNC(op_8040_0), 0, 32832 }, /* OR */ -{ XCPUFUNC(op_8050_0), 0, 32848 }, /* OR */ -{ XCPUFUNC(op_8058_0), 0, 32856 }, /* OR */ -{ XCPUFUNC(op_8060_0), 0, 32864 }, /* OR */ -{ XCPUFUNC(op_8068_0), 0, 32872 }, /* OR */ -{ XCPUFUNC(op_8070_0), 0, 32880 }, /* OR */ -{ XCPUFUNC(op_8078_0), 0, 32888 }, /* OR */ -{ XCPUFUNC(op_8079_0), 0, 32889 }, /* OR */ -{ XCPUFUNC(op_807a_0), 0, 32890 }, /* OR */ -{ XCPUFUNC(op_807b_0), 0, 32891 }, /* OR */ -{ XCPUFUNC(op_807c_0), 0, 32892 }, /* OR */ -{ XCPUFUNC(op_8080_0), 0, 32896 }, /* OR */ -{ XCPUFUNC(op_8090_0), 0, 32912 }, /* OR */ -{ XCPUFUNC(op_8098_0), 0, 32920 }, /* OR */ -{ XCPUFUNC(op_80a0_0), 0, 32928 }, /* OR */ -{ XCPUFUNC(op_80a8_0), 0, 32936 }, /* OR */ -{ XCPUFUNC(op_80b0_0), 0, 32944 }, /* OR */ -{ XCPUFUNC(op_80b8_0), 0, 32952 }, /* OR */ -{ XCPUFUNC(op_80b9_0), 0, 32953 }, /* OR */ -{ XCPUFUNC(op_80ba_0), 0, 32954 }, /* OR */ -{ XCPUFUNC(op_80bb_0), 0, 32955 }, /* OR */ -{ XCPUFUNC(op_80bc_0), 0, 32956 }, /* OR */ -{ XCPUFUNC(op_80c0_0), 0, 32960 }, /* DIVU */ -{ XCPUFUNC(op_80d0_0), 0, 32976 }, /* DIVU */ -{ XCPUFUNC(op_80d8_0), 0, 32984 }, /* DIVU */ -{ XCPUFUNC(op_80e0_0), 0, 32992 }, /* DIVU */ -{ XCPUFUNC(op_80e8_0), 0, 33000 }, /* DIVU */ -{ XCPUFUNC(op_80f0_0), 0, 33008 }, /* DIVU */ -{ XCPUFUNC(op_80f8_0), 0, 33016 }, /* DIVU */ -{ XCPUFUNC(op_80f9_0), 0, 33017 }, /* DIVU */ -{ XCPUFUNC(op_80fa_0), 0, 33018 }, /* DIVU */ -{ XCPUFUNC(op_80fb_0), 0, 33019 }, /* DIVU */ -{ XCPUFUNC(op_80fc_0), 0, 33020 }, /* DIVU */ -{ XCPUFUNC(op_8100_0), 0, 33024 }, /* SBCD */ -{ XCPUFUNC(op_8108_0), 0, 33032 }, /* SBCD */ -{ XCPUFUNC(op_8110_0), 0, 33040 }, /* OR */ -{ XCPUFUNC(op_8118_0), 0, 33048 }, /* OR */ -{ XCPUFUNC(op_8120_0), 0, 33056 }, /* OR */ -{ XCPUFUNC(op_8128_0), 0, 33064 }, /* OR */ -{ XCPUFUNC(op_8130_0), 0, 33072 }, /* OR */ -{ XCPUFUNC(op_8138_0), 0, 33080 }, /* OR */ -{ XCPUFUNC(op_8139_0), 0, 33081 }, /* OR */ -{ XCPUFUNC(op_8140_0), 0, 33088 }, /* PACK */ -{ XCPUFUNC(op_8148_0), 0, 33096 }, /* PACK */ -{ XCPUFUNC(op_8150_0), 0, 33104 }, /* OR */ -{ XCPUFUNC(op_8158_0), 0, 33112 }, /* OR */ -{ XCPUFUNC(op_8160_0), 0, 33120 }, /* OR */ -{ XCPUFUNC(op_8168_0), 0, 33128 }, /* OR */ -{ XCPUFUNC(op_8170_0), 0, 33136 }, /* OR */ -{ XCPUFUNC(op_8178_0), 0, 33144 }, /* OR */ -{ XCPUFUNC(op_8179_0), 0, 33145 }, /* OR */ -{ XCPUFUNC(op_8180_0), 0, 33152 }, /* UNPK */ -{ XCPUFUNC(op_8188_0), 0, 33160 }, /* UNPK */ -{ XCPUFUNC(op_8190_0), 0, 33168 }, /* OR */ -{ XCPUFUNC(op_8198_0), 0, 33176 }, /* OR */ -{ XCPUFUNC(op_81a0_0), 0, 33184 }, /* OR */ -{ XCPUFUNC(op_81a8_0), 0, 33192 }, /* OR */ -{ XCPUFUNC(op_81b0_0), 0, 33200 }, /* OR */ -{ XCPUFUNC(op_81b8_0), 0, 33208 }, /* OR */ -{ XCPUFUNC(op_81b9_0), 0, 33209 }, /* OR */ -{ XCPUFUNC(op_81c0_0), 0, 33216 }, /* DIVS */ -{ XCPUFUNC(op_81d0_0), 0, 33232 }, /* DIVS */ -{ XCPUFUNC(op_81d8_0), 0, 33240 }, /* DIVS */ -{ XCPUFUNC(op_81e0_0), 0, 33248 }, /* DIVS */ -{ XCPUFUNC(op_81e8_0), 0, 33256 }, /* DIVS */ -{ XCPUFUNC(op_81f0_0), 0, 33264 }, /* DIVS */ -{ XCPUFUNC(op_81f8_0), 0, 33272 }, /* DIVS */ -{ XCPUFUNC(op_81f9_0), 0, 33273 }, /* DIVS */ -{ XCPUFUNC(op_81fa_0), 0, 33274 }, /* DIVS */ -{ XCPUFUNC(op_81fb_0), 0, 33275 }, /* DIVS */ -{ XCPUFUNC(op_81fc_0), 0, 33276 }, /* DIVS */ -{ XCPUFUNC(op_9000_0), 0, 36864 }, /* SUB */ -{ XCPUFUNC(op_9010_0), 0, 36880 }, /* SUB */ -{ XCPUFUNC(op_9018_0), 0, 36888 }, /* SUB */ -{ XCPUFUNC(op_9020_0), 0, 36896 }, /* SUB */ -{ XCPUFUNC(op_9028_0), 0, 36904 }, /* SUB */ -{ XCPUFUNC(op_9030_0), 0, 36912 }, /* SUB */ -{ XCPUFUNC(op_9038_0), 0, 36920 }, /* SUB */ -{ XCPUFUNC(op_9039_0), 0, 36921 }, /* SUB */ -{ XCPUFUNC(op_903a_0), 0, 36922 }, /* SUB */ -{ XCPUFUNC(op_903b_0), 0, 36923 }, /* SUB */ -{ XCPUFUNC(op_903c_0), 0, 36924 }, /* SUB */ -{ XCPUFUNC(op_9040_0), 0, 36928 }, /* SUB */ -{ XCPUFUNC(op_9048_0), 0, 36936 }, /* SUB */ -{ XCPUFUNC(op_9050_0), 0, 36944 }, /* SUB */ -{ XCPUFUNC(op_9058_0), 0, 36952 }, /* SUB */ -{ XCPUFUNC(op_9060_0), 0, 36960 }, /* SUB */ -{ XCPUFUNC(op_9068_0), 0, 36968 }, /* SUB */ -{ XCPUFUNC(op_9070_0), 0, 36976 }, /* SUB */ -{ XCPUFUNC(op_9078_0), 0, 36984 }, /* SUB */ -{ XCPUFUNC(op_9079_0), 0, 36985 }, /* SUB */ -{ XCPUFUNC(op_907a_0), 0, 36986 }, /* SUB */ -{ XCPUFUNC(op_907b_0), 0, 36987 }, /* SUB */ -{ XCPUFUNC(op_907c_0), 0, 36988 }, /* SUB */ -{ XCPUFUNC(op_9080_0), 0, 36992 }, /* SUB */ -{ XCPUFUNC(op_9088_0), 0, 37000 }, /* SUB */ -{ XCPUFUNC(op_9090_0), 0, 37008 }, /* SUB */ -{ XCPUFUNC(op_9098_0), 0, 37016 }, /* SUB */ -{ XCPUFUNC(op_90a0_0), 0, 37024 }, /* SUB */ -{ XCPUFUNC(op_90a8_0), 0, 37032 }, /* SUB */ -{ XCPUFUNC(op_90b0_0), 0, 37040 }, /* SUB */ -{ XCPUFUNC(op_90b8_0), 0, 37048 }, /* SUB */ -{ XCPUFUNC(op_90b9_0), 0, 37049 }, /* SUB */ -{ XCPUFUNC(op_90ba_0), 0, 37050 }, /* SUB */ -{ XCPUFUNC(op_90bb_0), 0, 37051 }, /* SUB */ -{ XCPUFUNC(op_90bc_0), 0, 37052 }, /* SUB */ -{ XCPUFUNC(op_90c0_0), 0, 37056 }, /* SUBA */ -{ XCPUFUNC(op_90c8_0), 0, 37064 }, /* SUBA */ -{ XCPUFUNC(op_90d0_0), 0, 37072 }, /* SUBA */ -{ XCPUFUNC(op_90d8_0), 0, 37080 }, /* SUBA */ -{ XCPUFUNC(op_90e0_0), 0, 37088 }, /* SUBA */ -{ XCPUFUNC(op_90e8_0), 0, 37096 }, /* SUBA */ -{ XCPUFUNC(op_90f0_0), 0, 37104 }, /* SUBA */ -{ XCPUFUNC(op_90f8_0), 0, 37112 }, /* SUBA */ -{ XCPUFUNC(op_90f9_0), 0, 37113 }, /* SUBA */ -{ XCPUFUNC(op_90fa_0), 0, 37114 }, /* SUBA */ -{ XCPUFUNC(op_90fb_0), 0, 37115 }, /* SUBA */ -{ XCPUFUNC(op_90fc_0), 0, 37116 }, /* SUBA */ -{ XCPUFUNC(op_9100_0), 0, 37120 }, /* SUBX */ -{ XCPUFUNC(op_9108_0), 0, 37128 }, /* SUBX */ -{ XCPUFUNC(op_9110_0), 0, 37136 }, /* SUB */ -{ XCPUFUNC(op_9118_0), 0, 37144 }, /* SUB */ -{ XCPUFUNC(op_9120_0), 0, 37152 }, /* SUB */ -{ XCPUFUNC(op_9128_0), 0, 37160 }, /* SUB */ -{ XCPUFUNC(op_9130_0), 0, 37168 }, /* SUB */ -{ XCPUFUNC(op_9138_0), 0, 37176 }, /* SUB */ -{ XCPUFUNC(op_9139_0), 0, 37177 }, /* SUB */ -{ XCPUFUNC(op_9140_0), 0, 37184 }, /* SUBX */ -{ XCPUFUNC(op_9148_0), 0, 37192 }, /* SUBX */ -{ XCPUFUNC(op_9150_0), 0, 37200 }, /* SUB */ -{ XCPUFUNC(op_9158_0), 0, 37208 }, /* SUB */ -{ XCPUFUNC(op_9160_0), 0, 37216 }, /* SUB */ -{ XCPUFUNC(op_9168_0), 0, 37224 }, /* SUB */ -{ XCPUFUNC(op_9170_0), 0, 37232 }, /* SUB */ -{ XCPUFUNC(op_9178_0), 0, 37240 }, /* SUB */ -{ XCPUFUNC(op_9179_0), 0, 37241 }, /* SUB */ -{ XCPUFUNC(op_9180_0), 0, 37248 }, /* SUBX */ -{ XCPUFUNC(op_9188_0), 0, 37256 }, /* SUBX */ -{ XCPUFUNC(op_9190_0), 0, 37264 }, /* SUB */ -{ XCPUFUNC(op_9198_0), 0, 37272 }, /* SUB */ -{ XCPUFUNC(op_91a0_0), 0, 37280 }, /* SUB */ -{ XCPUFUNC(op_91a8_0), 0, 37288 }, /* SUB */ -{ XCPUFUNC(op_91b0_0), 0, 37296 }, /* SUB */ -{ XCPUFUNC(op_91b8_0), 0, 37304 }, /* SUB */ -{ XCPUFUNC(op_91b9_0), 0, 37305 }, /* SUB */ -{ XCPUFUNC(op_91c0_0), 0, 37312 }, /* SUBA */ -{ XCPUFUNC(op_91c8_0), 0, 37320 }, /* SUBA */ -{ XCPUFUNC(op_91d0_0), 0, 37328 }, /* SUBA */ -{ XCPUFUNC(op_91d8_0), 0, 37336 }, /* SUBA */ -{ XCPUFUNC(op_91e0_0), 0, 37344 }, /* SUBA */ -{ XCPUFUNC(op_91e8_0), 0, 37352 }, /* SUBA */ -{ XCPUFUNC(op_91f0_0), 0, 37360 }, /* SUBA */ -{ XCPUFUNC(op_91f8_0), 0, 37368 }, /* SUBA */ -{ XCPUFUNC(op_91f9_0), 0, 37369 }, /* SUBA */ -{ XCPUFUNC(op_91fa_0), 0, 37370 }, /* SUBA */ -{ XCPUFUNC(op_91fb_0), 0, 37371 }, /* SUBA */ -{ XCPUFUNC(op_91fc_0), 0, 37372 }, /* SUBA */ -{ XCPUFUNC(op_b000_0), 0, 45056 }, /* CMP */ -{ XCPUFUNC(op_b010_0), 0, 45072 }, /* CMP */ -{ XCPUFUNC(op_b018_0), 0, 45080 }, /* CMP */ -{ XCPUFUNC(op_b020_0), 0, 45088 }, /* CMP */ -{ XCPUFUNC(op_b028_0), 0, 45096 }, /* CMP */ -{ XCPUFUNC(op_b030_0), 0, 45104 }, /* CMP */ -{ XCPUFUNC(op_b038_0), 0, 45112 }, /* CMP */ -{ XCPUFUNC(op_b039_0), 0, 45113 }, /* CMP */ -{ XCPUFUNC(op_b03a_0), 0, 45114 }, /* CMP */ -{ XCPUFUNC(op_b03b_0), 0, 45115 }, /* CMP */ -{ XCPUFUNC(op_b03c_0), 0, 45116 }, /* CMP */ -{ XCPUFUNC(op_b040_0), 0, 45120 }, /* CMP */ -{ XCPUFUNC(op_b048_0), 0, 45128 }, /* CMP */ -{ XCPUFUNC(op_b050_0), 0, 45136 }, /* CMP */ -{ XCPUFUNC(op_b058_0), 0, 45144 }, /* CMP */ -{ XCPUFUNC(op_b060_0), 0, 45152 }, /* CMP */ -{ XCPUFUNC(op_b068_0), 0, 45160 }, /* CMP */ -{ XCPUFUNC(op_b070_0), 0, 45168 }, /* CMP */ -{ XCPUFUNC(op_b078_0), 0, 45176 }, /* CMP */ -{ XCPUFUNC(op_b079_0), 0, 45177 }, /* CMP */ -{ XCPUFUNC(op_b07a_0), 0, 45178 }, /* CMP */ -{ XCPUFUNC(op_b07b_0), 0, 45179 }, /* CMP */ -{ XCPUFUNC(op_b07c_0), 0, 45180 }, /* CMP */ -{ XCPUFUNC(op_b080_0), 0, 45184 }, /* CMP */ -{ XCPUFUNC(op_b088_0), 0, 45192 }, /* CMP */ -{ XCPUFUNC(op_b090_0), 0, 45200 }, /* CMP */ -{ XCPUFUNC(op_b098_0), 0, 45208 }, /* CMP */ -{ XCPUFUNC(op_b0a0_0), 0, 45216 }, /* CMP */ -{ XCPUFUNC(op_b0a8_0), 0, 45224 }, /* CMP */ -{ XCPUFUNC(op_b0b0_0), 0, 45232 }, /* CMP */ -{ XCPUFUNC(op_b0b8_0), 0, 45240 }, /* CMP */ -{ XCPUFUNC(op_b0b9_0), 0, 45241 }, /* CMP */ -{ XCPUFUNC(op_b0ba_0), 0, 45242 }, /* CMP */ -{ XCPUFUNC(op_b0bb_0), 0, 45243 }, /* CMP */ -{ XCPUFUNC(op_b0bc_0), 0, 45244 }, /* CMP */ -{ XCPUFUNC(op_b0c0_0), 0, 45248 }, /* CMPA */ -{ XCPUFUNC(op_b0c8_0), 0, 45256 }, /* CMPA */ -{ XCPUFUNC(op_b0d0_0), 0, 45264 }, /* CMPA */ -{ XCPUFUNC(op_b0d8_0), 0, 45272 }, /* CMPA */ -{ XCPUFUNC(op_b0e0_0), 0, 45280 }, /* CMPA */ -{ XCPUFUNC(op_b0e8_0), 0, 45288 }, /* CMPA */ -{ XCPUFUNC(op_b0f0_0), 0, 45296 }, /* CMPA */ -{ XCPUFUNC(op_b0f8_0), 0, 45304 }, /* CMPA */ -{ XCPUFUNC(op_b0f9_0), 0, 45305 }, /* CMPA */ -{ XCPUFUNC(op_b0fa_0), 0, 45306 }, /* CMPA */ -{ XCPUFUNC(op_b0fb_0), 0, 45307 }, /* CMPA */ -{ XCPUFUNC(op_b0fc_0), 0, 45308 }, /* CMPA */ -{ XCPUFUNC(op_b100_0), 0, 45312 }, /* EOR */ -{ XCPUFUNC(op_b108_0), 0, 45320 }, /* CMPM */ -{ XCPUFUNC(op_b110_0), 0, 45328 }, /* EOR */ -{ XCPUFUNC(op_b118_0), 0, 45336 }, /* EOR */ -{ XCPUFUNC(op_b120_0), 0, 45344 }, /* EOR */ -{ XCPUFUNC(op_b128_0), 0, 45352 }, /* EOR */ -{ XCPUFUNC(op_b130_0), 0, 45360 }, /* EOR */ -{ XCPUFUNC(op_b138_0), 0, 45368 }, /* EOR */ -{ XCPUFUNC(op_b139_0), 0, 45369 }, /* EOR */ -{ XCPUFUNC(op_b140_0), 0, 45376 }, /* EOR */ -{ XCPUFUNC(op_b148_0), 0, 45384 }, /* CMPM */ -{ XCPUFUNC(op_b150_0), 0, 45392 }, /* EOR */ -{ XCPUFUNC(op_b158_0), 0, 45400 }, /* EOR */ -{ XCPUFUNC(op_b160_0), 0, 45408 }, /* EOR */ -{ XCPUFUNC(op_b168_0), 0, 45416 }, /* EOR */ -{ XCPUFUNC(op_b170_0), 0, 45424 }, /* EOR */ -{ XCPUFUNC(op_b178_0), 0, 45432 }, /* EOR */ -{ XCPUFUNC(op_b179_0), 0, 45433 }, /* EOR */ -{ XCPUFUNC(op_b180_0), 0, 45440 }, /* EOR */ -{ XCPUFUNC(op_b188_0), 0, 45448 }, /* CMPM */ -{ XCPUFUNC(op_b190_0), 0, 45456 }, /* EOR */ -{ XCPUFUNC(op_b198_0), 0, 45464 }, /* EOR */ -{ XCPUFUNC(op_b1a0_0), 0, 45472 }, /* EOR */ -{ XCPUFUNC(op_b1a8_0), 0, 45480 }, /* EOR */ -{ XCPUFUNC(op_b1b0_0), 0, 45488 }, /* EOR */ -{ XCPUFUNC(op_b1b8_0), 0, 45496 }, /* EOR */ -{ XCPUFUNC(op_b1b9_0), 0, 45497 }, /* EOR */ -{ XCPUFUNC(op_b1c0_0), 0, 45504 }, /* CMPA */ -{ XCPUFUNC(op_b1c8_0), 0, 45512 }, /* CMPA */ -{ XCPUFUNC(op_b1d0_0), 0, 45520 }, /* CMPA */ -{ XCPUFUNC(op_b1d8_0), 0, 45528 }, /* CMPA */ -{ XCPUFUNC(op_b1e0_0), 0, 45536 }, /* CMPA */ -{ XCPUFUNC(op_b1e8_0), 0, 45544 }, /* CMPA */ -{ XCPUFUNC(op_b1f0_0), 0, 45552 }, /* CMPA */ -{ XCPUFUNC(op_b1f8_0), 0, 45560 }, /* CMPA */ -{ XCPUFUNC(op_b1f9_0), 0, 45561 }, /* CMPA */ -{ XCPUFUNC(op_b1fa_0), 0, 45562 }, /* CMPA */ -{ XCPUFUNC(op_b1fb_0), 0, 45563 }, /* CMPA */ -{ XCPUFUNC(op_b1fc_0), 0, 45564 }, /* CMPA */ -{ XCPUFUNC(op_c000_0), 0, 49152 }, /* AND */ -{ XCPUFUNC(op_c010_0), 0, 49168 }, /* AND */ -{ XCPUFUNC(op_c018_0), 0, 49176 }, /* AND */ -{ XCPUFUNC(op_c020_0), 0, 49184 }, /* AND */ -{ XCPUFUNC(op_c028_0), 0, 49192 }, /* AND */ -{ XCPUFUNC(op_c030_0), 0, 49200 }, /* AND */ -{ XCPUFUNC(op_c038_0), 0, 49208 }, /* AND */ -{ XCPUFUNC(op_c039_0), 0, 49209 }, /* AND */ -{ XCPUFUNC(op_c03a_0), 0, 49210 }, /* AND */ -{ XCPUFUNC(op_c03b_0), 0, 49211 }, /* AND */ -{ XCPUFUNC(op_c03c_0), 0, 49212 }, /* AND */ -{ XCPUFUNC(op_c040_0), 0, 49216 }, /* AND */ -{ XCPUFUNC(op_c050_0), 0, 49232 }, /* AND */ -{ XCPUFUNC(op_c058_0), 0, 49240 }, /* AND */ -{ XCPUFUNC(op_c060_0), 0, 49248 }, /* AND */ -{ XCPUFUNC(op_c068_0), 0, 49256 }, /* AND */ -{ XCPUFUNC(op_c070_0), 0, 49264 }, /* AND */ -{ XCPUFUNC(op_c078_0), 0, 49272 }, /* AND */ -{ XCPUFUNC(op_c079_0), 0, 49273 }, /* AND */ -{ XCPUFUNC(op_c07a_0), 0, 49274 }, /* AND */ -{ XCPUFUNC(op_c07b_0), 0, 49275 }, /* AND */ -{ XCPUFUNC(op_c07c_0), 0, 49276 }, /* AND */ -{ XCPUFUNC(op_c080_0), 0, 49280 }, /* AND */ -{ XCPUFUNC(op_c090_0), 0, 49296 }, /* AND */ -{ XCPUFUNC(op_c098_0), 0, 49304 }, /* AND */ -{ XCPUFUNC(op_c0a0_0), 0, 49312 }, /* AND */ -{ XCPUFUNC(op_c0a8_0), 0, 49320 }, /* AND */ -{ XCPUFUNC(op_c0b0_0), 0, 49328 }, /* AND */ -{ XCPUFUNC(op_c0b8_0), 0, 49336 }, /* AND */ -{ XCPUFUNC(op_c0b9_0), 0, 49337 }, /* AND */ -{ XCPUFUNC(op_c0ba_0), 0, 49338 }, /* AND */ -{ XCPUFUNC(op_c0bb_0), 0, 49339 }, /* AND */ -{ XCPUFUNC(op_c0bc_0), 0, 49340 }, /* AND */ -{ XCPUFUNC(op_c0c0_0), 0, 49344 }, /* MULU */ -{ XCPUFUNC(op_c0d0_0), 0, 49360 }, /* MULU */ -{ XCPUFUNC(op_c0d8_0), 0, 49368 }, /* MULU */ -{ XCPUFUNC(op_c0e0_0), 0, 49376 }, /* MULU */ -{ XCPUFUNC(op_c0e8_0), 0, 49384 }, /* MULU */ -{ XCPUFUNC(op_c0f0_0), 0, 49392 }, /* MULU */ -{ XCPUFUNC(op_c0f8_0), 0, 49400 }, /* MULU */ -{ XCPUFUNC(op_c0f9_0), 0, 49401 }, /* MULU */ -{ XCPUFUNC(op_c0fa_0), 0, 49402 }, /* MULU */ -{ XCPUFUNC(op_c0fb_0), 0, 49403 }, /* MULU */ -{ XCPUFUNC(op_c0fc_0), 0, 49404 }, /* MULU */ -{ XCPUFUNC(op_c100_0), 0, 49408 }, /* ABCD */ -{ XCPUFUNC(op_c108_0), 0, 49416 }, /* ABCD */ -{ XCPUFUNC(op_c110_0), 0, 49424 }, /* AND */ -{ XCPUFUNC(op_c118_0), 0, 49432 }, /* AND */ -{ XCPUFUNC(op_c120_0), 0, 49440 }, /* AND */ -{ XCPUFUNC(op_c128_0), 0, 49448 }, /* AND */ -{ XCPUFUNC(op_c130_0), 0, 49456 }, /* AND */ -{ XCPUFUNC(op_c138_0), 0, 49464 }, /* AND */ -{ XCPUFUNC(op_c139_0), 0, 49465 }, /* AND */ -{ XCPUFUNC(op_c140_0), 0, 49472 }, /* EXG */ -{ XCPUFUNC(op_c148_0), 0, 49480 }, /* EXG */ -{ XCPUFUNC(op_c150_0), 0, 49488 }, /* AND */ -{ XCPUFUNC(op_c158_0), 0, 49496 }, /* AND */ -{ XCPUFUNC(op_c160_0), 0, 49504 }, /* AND */ -{ XCPUFUNC(op_c168_0), 0, 49512 }, /* AND */ -{ XCPUFUNC(op_c170_0), 0, 49520 }, /* AND */ -{ XCPUFUNC(op_c178_0), 0, 49528 }, /* AND */ -{ XCPUFUNC(op_c179_0), 0, 49529 }, /* AND */ -{ XCPUFUNC(op_c188_0), 0, 49544 }, /* EXG */ -{ XCPUFUNC(op_c190_0), 0, 49552 }, /* AND */ -{ XCPUFUNC(op_c198_0), 0, 49560 }, /* AND */ -{ XCPUFUNC(op_c1a0_0), 0, 49568 }, /* AND */ -{ XCPUFUNC(op_c1a8_0), 0, 49576 }, /* AND */ -{ XCPUFUNC(op_c1b0_0), 0, 49584 }, /* AND */ -{ XCPUFUNC(op_c1b8_0), 0, 49592 }, /* AND */ -{ XCPUFUNC(op_c1b9_0), 0, 49593 }, /* AND */ -{ XCPUFUNC(op_c1c0_0), 0, 49600 }, /* MULS */ -{ XCPUFUNC(op_c1d0_0), 0, 49616 }, /* MULS */ -{ XCPUFUNC(op_c1d8_0), 0, 49624 }, /* MULS */ -{ XCPUFUNC(op_c1e0_0), 0, 49632 }, /* MULS */ -{ XCPUFUNC(op_c1e8_0), 0, 49640 }, /* MULS */ -{ XCPUFUNC(op_c1f0_0), 0, 49648 }, /* MULS */ -{ XCPUFUNC(op_c1f8_0), 0, 49656 }, /* MULS */ -{ XCPUFUNC(op_c1f9_0), 0, 49657 }, /* MULS */ -{ XCPUFUNC(op_c1fa_0), 0, 49658 }, /* MULS */ -{ XCPUFUNC(op_c1fb_0), 0, 49659 }, /* MULS */ -{ XCPUFUNC(op_c1fc_0), 0, 49660 }, /* MULS */ -{ XCPUFUNC(op_d000_0), 0, 53248 }, /* ADD */ -{ XCPUFUNC(op_d010_0), 0, 53264 }, /* ADD */ -{ XCPUFUNC(op_d018_0), 0, 53272 }, /* ADD */ -{ XCPUFUNC(op_d020_0), 0, 53280 }, /* ADD */ -{ XCPUFUNC(op_d028_0), 0, 53288 }, /* ADD */ -{ XCPUFUNC(op_d030_0), 0, 53296 }, /* ADD */ -{ XCPUFUNC(op_d038_0), 0, 53304 }, /* ADD */ -{ XCPUFUNC(op_d039_0), 0, 53305 }, /* ADD */ -{ XCPUFUNC(op_d03a_0), 0, 53306 }, /* ADD */ -{ XCPUFUNC(op_d03b_0), 0, 53307 }, /* ADD */ -{ XCPUFUNC(op_d03c_0), 0, 53308 }, /* ADD */ -{ XCPUFUNC(op_d040_0), 0, 53312 }, /* ADD */ -{ XCPUFUNC(op_d048_0), 0, 53320 }, /* ADD */ -{ XCPUFUNC(op_d050_0), 0, 53328 }, /* ADD */ -{ XCPUFUNC(op_d058_0), 0, 53336 }, /* ADD */ -{ XCPUFUNC(op_d060_0), 0, 53344 }, /* ADD */ -{ XCPUFUNC(op_d068_0), 0, 53352 }, /* ADD */ -{ XCPUFUNC(op_d070_0), 0, 53360 }, /* ADD */ -{ XCPUFUNC(op_d078_0), 0, 53368 }, /* ADD */ -{ XCPUFUNC(op_d079_0), 0, 53369 }, /* ADD */ -{ XCPUFUNC(op_d07a_0), 0, 53370 }, /* ADD */ -{ XCPUFUNC(op_d07b_0), 0, 53371 }, /* ADD */ -{ XCPUFUNC(op_d07c_0), 0, 53372 }, /* ADD */ -{ XCPUFUNC(op_d080_0), 0, 53376 }, /* ADD */ -{ XCPUFUNC(op_d088_0), 0, 53384 }, /* ADD */ -{ XCPUFUNC(op_d090_0), 0, 53392 }, /* ADD */ -{ XCPUFUNC(op_d098_0), 0, 53400 }, /* ADD */ -{ XCPUFUNC(op_d0a0_0), 0, 53408 }, /* ADD */ -{ XCPUFUNC(op_d0a8_0), 0, 53416 }, /* ADD */ -{ XCPUFUNC(op_d0b0_0), 0, 53424 }, /* ADD */ -{ XCPUFUNC(op_d0b8_0), 0, 53432 }, /* ADD */ -{ XCPUFUNC(op_d0b9_0), 0, 53433 }, /* ADD */ -{ XCPUFUNC(op_d0ba_0), 0, 53434 }, /* ADD */ -{ XCPUFUNC(op_d0bb_0), 0, 53435 }, /* ADD */ -{ XCPUFUNC(op_d0bc_0), 0, 53436 }, /* ADD */ -{ XCPUFUNC(op_d0c0_0), 0, 53440 }, /* ADDA */ -{ XCPUFUNC(op_d0c8_0), 0, 53448 }, /* ADDA */ -{ XCPUFUNC(op_d0d0_0), 0, 53456 }, /* ADDA */ -{ XCPUFUNC(op_d0d8_0), 0, 53464 }, /* ADDA */ -{ XCPUFUNC(op_d0e0_0), 0, 53472 }, /* ADDA */ -{ XCPUFUNC(op_d0e8_0), 0, 53480 }, /* ADDA */ -{ XCPUFUNC(op_d0f0_0), 0, 53488 }, /* ADDA */ -{ XCPUFUNC(op_d0f8_0), 0, 53496 }, /* ADDA */ -{ XCPUFUNC(op_d0f9_0), 0, 53497 }, /* ADDA */ -{ XCPUFUNC(op_d0fa_0), 0, 53498 }, /* ADDA */ -{ XCPUFUNC(op_d0fb_0), 0, 53499 }, /* ADDA */ -{ XCPUFUNC(op_d0fc_0), 0, 53500 }, /* ADDA */ -{ XCPUFUNC(op_d100_0), 0, 53504 }, /* ADDX */ -{ XCPUFUNC(op_d108_0), 0, 53512 }, /* ADDX */ -{ XCPUFUNC(op_d110_0), 0, 53520 }, /* ADD */ -{ XCPUFUNC(op_d118_0), 0, 53528 }, /* ADD */ -{ XCPUFUNC(op_d120_0), 0, 53536 }, /* ADD */ -{ XCPUFUNC(op_d128_0), 0, 53544 }, /* ADD */ -{ XCPUFUNC(op_d130_0), 0, 53552 }, /* ADD */ -{ XCPUFUNC(op_d138_0), 0, 53560 }, /* ADD */ -{ XCPUFUNC(op_d139_0), 0, 53561 }, /* ADD */ -{ XCPUFUNC(op_d140_0), 0, 53568 }, /* ADDX */ -{ XCPUFUNC(op_d148_0), 0, 53576 }, /* ADDX */ -{ XCPUFUNC(op_d150_0), 0, 53584 }, /* ADD */ -{ XCPUFUNC(op_d158_0), 0, 53592 }, /* ADD */ -{ XCPUFUNC(op_d160_0), 0, 53600 }, /* ADD */ -{ XCPUFUNC(op_d168_0), 0, 53608 }, /* ADD */ -{ XCPUFUNC(op_d170_0), 0, 53616 }, /* ADD */ -{ XCPUFUNC(op_d178_0), 0, 53624 }, /* ADD */ -{ XCPUFUNC(op_d179_0), 0, 53625 }, /* ADD */ -{ XCPUFUNC(op_d180_0), 0, 53632 }, /* ADDX */ -{ XCPUFUNC(op_d188_0), 0, 53640 }, /* ADDX */ -{ XCPUFUNC(op_d190_0), 0, 53648 }, /* ADD */ -{ XCPUFUNC(op_d198_0), 0, 53656 }, /* ADD */ -{ XCPUFUNC(op_d1a0_0), 0, 53664 }, /* ADD */ -{ XCPUFUNC(op_d1a8_0), 0, 53672 }, /* ADD */ -{ XCPUFUNC(op_d1b0_0), 0, 53680 }, /* ADD */ -{ XCPUFUNC(op_d1b8_0), 0, 53688 }, /* ADD */ -{ XCPUFUNC(op_d1b9_0), 0, 53689 }, /* ADD */ -{ XCPUFUNC(op_d1c0_0), 0, 53696 }, /* ADDA */ -{ XCPUFUNC(op_d1c8_0), 0, 53704 }, /* ADDA */ -{ XCPUFUNC(op_d1d0_0), 0, 53712 }, /* ADDA */ -{ XCPUFUNC(op_d1d8_0), 0, 53720 }, /* ADDA */ -{ XCPUFUNC(op_d1e0_0), 0, 53728 }, /* ADDA */ -{ XCPUFUNC(op_d1e8_0), 0, 53736 }, /* ADDA */ -{ XCPUFUNC(op_d1f0_0), 0, 53744 }, /* ADDA */ -{ XCPUFUNC(op_d1f8_0), 0, 53752 }, /* ADDA */ -{ XCPUFUNC(op_d1f9_0), 0, 53753 }, /* ADDA */ -{ XCPUFUNC(op_d1fa_0), 0, 53754 }, /* ADDA */ -{ XCPUFUNC(op_d1fb_0), 0, 53755 }, /* ADDA */ -{ XCPUFUNC(op_d1fc_0), 0, 53756 }, /* ADDA */ -{ XCPUFUNC(op_e000_0), 0, 57344 }, /* ASR */ -{ XCPUFUNC(op_e008_0), 0, 57352 }, /* LSR */ -{ XCPUFUNC(op_e010_0), 0, 57360 }, /* ROXR */ -{ XCPUFUNC(op_e018_0), 0, 57368 }, /* ROR */ -{ XCPUFUNC(op_e020_0), 0, 57376 }, /* ASR */ -{ XCPUFUNC(op_e028_0), 0, 57384 }, /* LSR */ -{ XCPUFUNC(op_e030_0), 0, 57392 }, /* ROXR */ -{ XCPUFUNC(op_e038_0), 0, 57400 }, /* ROR */ -{ XCPUFUNC(op_e040_0), 0, 57408 }, /* ASR */ -{ XCPUFUNC(op_e048_0), 0, 57416 }, /* LSR */ -{ XCPUFUNC(op_e050_0), 0, 57424 }, /* ROXR */ -{ XCPUFUNC(op_e058_0), 0, 57432 }, /* ROR */ -{ XCPUFUNC(op_e060_0), 0, 57440 }, /* ASR */ -{ XCPUFUNC(op_e068_0), 0, 57448 }, /* LSR */ -{ XCPUFUNC(op_e070_0), 0, 57456 }, /* ROXR */ -{ XCPUFUNC(op_e078_0), 0, 57464 }, /* ROR */ -{ XCPUFUNC(op_e080_0), 0, 57472 }, /* ASR */ -{ XCPUFUNC(op_e088_0), 0, 57480 }, /* LSR */ -{ XCPUFUNC(op_e090_0), 0, 57488 }, /* ROXR */ -{ XCPUFUNC(op_e098_0), 0, 57496 }, /* ROR */ -{ XCPUFUNC(op_e0a0_0), 0, 57504 }, /* ASR */ -{ XCPUFUNC(op_e0a8_0), 0, 57512 }, /* LSR */ -{ XCPUFUNC(op_e0b0_0), 0, 57520 }, /* ROXR */ -{ XCPUFUNC(op_e0b8_0), 0, 57528 }, /* ROR */ -{ XCPUFUNC(op_e0d0_0), 0, 57552 }, /* ASRW */ -{ XCPUFUNC(op_e0d8_0), 0, 57560 }, /* ASRW */ -{ XCPUFUNC(op_e0e0_0), 0, 57568 }, /* ASRW */ -{ XCPUFUNC(op_e0e8_0), 0, 57576 }, /* ASRW */ -{ XCPUFUNC(op_e0f0_0), 0, 57584 }, /* ASRW */ -{ XCPUFUNC(op_e0f8_0), 0, 57592 }, /* ASRW */ -{ XCPUFUNC(op_e0f9_0), 0, 57593 }, /* ASRW */ -{ XCPUFUNC(op_e100_0), 0, 57600 }, /* ASL */ -{ XCPUFUNC(op_e108_0), 0, 57608 }, /* LSL */ -{ XCPUFUNC(op_e110_0), 0, 57616 }, /* ROXL */ -{ XCPUFUNC(op_e118_0), 0, 57624 }, /* ROL */ -{ XCPUFUNC(op_e120_0), 0, 57632 }, /* ASL */ -{ XCPUFUNC(op_e128_0), 0, 57640 }, /* LSL */ -{ XCPUFUNC(op_e130_0), 0, 57648 }, /* ROXL */ -{ XCPUFUNC(op_e138_0), 0, 57656 }, /* ROL */ -{ XCPUFUNC(op_e140_0), 0, 57664 }, /* ASL */ -{ XCPUFUNC(op_e148_0), 0, 57672 }, /* LSL */ -{ XCPUFUNC(op_e150_0), 0, 57680 }, /* ROXL */ -{ XCPUFUNC(op_e158_0), 0, 57688 }, /* ROL */ -{ XCPUFUNC(op_e160_0), 0, 57696 }, /* ASL */ -{ XCPUFUNC(op_e168_0), 0, 57704 }, /* LSL */ -{ XCPUFUNC(op_e170_0), 0, 57712 }, /* ROXL */ -{ XCPUFUNC(op_e178_0), 0, 57720 }, /* ROL */ -{ XCPUFUNC(op_e180_0), 0, 57728 }, /* ASL */ -{ XCPUFUNC(op_e188_0), 0, 57736 }, /* LSL */ -{ XCPUFUNC(op_e190_0), 0, 57744 }, /* ROXL */ -{ XCPUFUNC(op_e198_0), 0, 57752 }, /* ROL */ -{ XCPUFUNC(op_e1a0_0), 0, 57760 }, /* ASL */ -{ XCPUFUNC(op_e1a8_0), 0, 57768 }, /* LSL */ -{ XCPUFUNC(op_e1b0_0), 0, 57776 }, /* ROXL */ -{ XCPUFUNC(op_e1b8_0), 0, 57784 }, /* ROL */ -{ XCPUFUNC(op_e1d0_0), 0, 57808 }, /* ASLW */ -{ XCPUFUNC(op_e1d8_0), 0, 57816 }, /* ASLW */ -{ XCPUFUNC(op_e1e0_0), 0, 57824 }, /* ASLW */ -{ XCPUFUNC(op_e1e8_0), 0, 57832 }, /* ASLW */ -{ XCPUFUNC(op_e1f0_0), 0, 57840 }, /* ASLW */ -{ XCPUFUNC(op_e1f8_0), 0, 57848 }, /* ASLW */ -{ XCPUFUNC(op_e1f9_0), 0, 57849 }, /* ASLW */ -{ XCPUFUNC(op_e2d0_0), 0, 58064 }, /* LSRW */ -{ XCPUFUNC(op_e2d8_0), 0, 58072 }, /* LSRW */ -{ XCPUFUNC(op_e2e0_0), 0, 58080 }, /* LSRW */ -{ XCPUFUNC(op_e2e8_0), 0, 58088 }, /* LSRW */ -{ XCPUFUNC(op_e2f0_0), 0, 58096 }, /* LSRW */ -{ XCPUFUNC(op_e2f8_0), 0, 58104 }, /* LSRW */ -{ XCPUFUNC(op_e2f9_0), 0, 58105 }, /* LSRW */ -{ XCPUFUNC(op_e3d0_0), 0, 58320 }, /* LSLW */ -{ XCPUFUNC(op_e3d8_0), 0, 58328 }, /* LSLW */ -{ XCPUFUNC(op_e3e0_0), 0, 58336 }, /* LSLW */ -{ XCPUFUNC(op_e3e8_0), 0, 58344 }, /* LSLW */ -{ XCPUFUNC(op_e3f0_0), 0, 58352 }, /* LSLW */ -{ XCPUFUNC(op_e3f8_0), 0, 58360 }, /* LSLW */ -{ XCPUFUNC(op_e3f9_0), 0, 58361 }, /* LSLW */ -{ XCPUFUNC(op_e4d0_0), 0, 58576 }, /* ROXRW */ -{ XCPUFUNC(op_e4d8_0), 0, 58584 }, /* ROXRW */ -{ XCPUFUNC(op_e4e0_0), 0, 58592 }, /* ROXRW */ -{ XCPUFUNC(op_e4e8_0), 0, 58600 }, /* ROXRW */ -{ XCPUFUNC(op_e4f0_0), 0, 58608 }, /* ROXRW */ -{ XCPUFUNC(op_e4f8_0), 0, 58616 }, /* ROXRW */ -{ XCPUFUNC(op_e4f9_0), 0, 58617 }, /* ROXRW */ -{ XCPUFUNC(op_e5d0_0), 0, 58832 }, /* ROXLW */ -{ XCPUFUNC(op_e5d8_0), 0, 58840 }, /* ROXLW */ -{ XCPUFUNC(op_e5e0_0), 0, 58848 }, /* ROXLW */ -{ XCPUFUNC(op_e5e8_0), 0, 58856 }, /* ROXLW */ -{ XCPUFUNC(op_e5f0_0), 0, 58864 }, /* ROXLW */ -{ XCPUFUNC(op_e5f8_0), 0, 58872 }, /* ROXLW */ -{ XCPUFUNC(op_e5f9_0), 0, 58873 }, /* ROXLW */ -{ XCPUFUNC(op_e6d0_0), 0, 59088 }, /* RORW */ -{ XCPUFUNC(op_e6d8_0), 0, 59096 }, /* RORW */ -{ XCPUFUNC(op_e6e0_0), 0, 59104 }, /* RORW */ -{ XCPUFUNC(op_e6e8_0), 0, 59112 }, /* RORW */ -{ XCPUFUNC(op_e6f0_0), 0, 59120 }, /* RORW */ -{ XCPUFUNC(op_e6f8_0), 0, 59128 }, /* RORW */ -{ XCPUFUNC(op_e6f9_0), 0, 59129 }, /* RORW */ -{ XCPUFUNC(op_e7d0_0), 0, 59344 }, /* ROLW */ -{ XCPUFUNC(op_e7d8_0), 0, 59352 }, /* ROLW */ -{ XCPUFUNC(op_e7e0_0), 0, 59360 }, /* ROLW */ -{ XCPUFUNC(op_e7e8_0), 0, 59368 }, /* ROLW */ -{ XCPUFUNC(op_e7f0_0), 0, 59376 }, /* ROLW */ -{ XCPUFUNC(op_e7f8_0), 0, 59384 }, /* ROLW */ -{ XCPUFUNC(op_e7f9_0), 0, 59385 }, /* ROLW */ -{ XCPUFUNC(op_e8c0_0), 0, 59584 }, /* BFTST */ -{ XCPUFUNC(op_e8d0_0), 0, 59600 }, /* BFTST */ -{ XCPUFUNC(op_e8e8_0), 0, 59624 }, /* BFTST */ -{ XCPUFUNC(op_e8f0_0), 0, 59632 }, /* BFTST */ -{ XCPUFUNC(op_e8f8_0), 0, 59640 }, /* BFTST */ -{ XCPUFUNC(op_e8f9_0), 0, 59641 }, /* BFTST */ -{ XCPUFUNC(op_e8fa_0), 0, 59642 }, /* BFTST */ -{ XCPUFUNC(op_e8fb_0), 0, 59643 }, /* BFTST */ -{ XCPUFUNC(op_e9c0_0), 0, 59840 }, /* BFEXTU */ -{ XCPUFUNC(op_e9d0_0), 0, 59856 }, /* BFEXTU */ -{ XCPUFUNC(op_e9e8_0), 0, 59880 }, /* BFEXTU */ -{ XCPUFUNC(op_e9f0_0), 0, 59888 }, /* BFEXTU */ -{ XCPUFUNC(op_e9f8_0), 0, 59896 }, /* BFEXTU */ -{ XCPUFUNC(op_e9f9_0), 0, 59897 }, /* BFEXTU */ -{ XCPUFUNC(op_e9fa_0), 0, 59898 }, /* BFEXTU */ -{ XCPUFUNC(op_e9fb_0), 0, 59899 }, /* BFEXTU */ -{ XCPUFUNC(op_eac0_0), 0, 60096 }, /* BFCHG */ -{ XCPUFUNC(op_ead0_0), 0, 60112 }, /* BFCHG */ -{ XCPUFUNC(op_eae8_0), 0, 60136 }, /* BFCHG */ -{ XCPUFUNC(op_eaf0_0), 0, 60144 }, /* BFCHG */ -{ XCPUFUNC(op_eaf8_0), 0, 60152 }, /* BFCHG */ -{ XCPUFUNC(op_eaf9_0), 0, 60153 }, /* BFCHG */ -{ XCPUFUNC(op_ebc0_0), 0, 60352 }, /* BFEXTS */ -{ XCPUFUNC(op_ebd0_0), 0, 60368 }, /* BFEXTS */ -{ XCPUFUNC(op_ebe8_0), 0, 60392 }, /* BFEXTS */ -{ XCPUFUNC(op_ebf0_0), 0, 60400 }, /* BFEXTS */ -{ XCPUFUNC(op_ebf8_0), 0, 60408 }, /* BFEXTS */ -{ XCPUFUNC(op_ebf9_0), 0, 60409 }, /* BFEXTS */ -{ XCPUFUNC(op_ebfa_0), 0, 60410 }, /* BFEXTS */ -{ XCPUFUNC(op_ebfb_0), 0, 60411 }, /* BFEXTS */ -{ XCPUFUNC(op_ecc0_0), 0, 60608 }, /* BFCLR */ -{ XCPUFUNC(op_ecd0_0), 0, 60624 }, /* BFCLR */ -{ XCPUFUNC(op_ece8_0), 0, 60648 }, /* BFCLR */ -{ XCPUFUNC(op_ecf0_0), 0, 60656 }, /* BFCLR */ -{ XCPUFUNC(op_ecf8_0), 0, 60664 }, /* BFCLR */ -{ XCPUFUNC(op_ecf9_0), 0, 60665 }, /* BFCLR */ -{ XCPUFUNC(op_edc0_0), 0, 60864 }, /* BFFFO */ -{ XCPUFUNC(op_edd0_0), 0, 60880 }, /* BFFFO */ -{ XCPUFUNC(op_ede8_0), 0, 60904 }, /* BFFFO */ -{ XCPUFUNC(op_edf0_0), 0, 60912 }, /* BFFFO */ -{ XCPUFUNC(op_edf8_0), 0, 60920 }, /* BFFFO */ -{ XCPUFUNC(op_edf9_0), 0, 60921 }, /* BFFFO */ -{ XCPUFUNC(op_edfa_0), 0, 60922 }, /* BFFFO */ -{ XCPUFUNC(op_edfb_0), 0, 60923 }, /* BFFFO */ -{ XCPUFUNC(op_eec0_0), 0, 61120 }, /* BFSET */ -{ XCPUFUNC(op_eed0_0), 0, 61136 }, /* BFSET */ -{ XCPUFUNC(op_eee8_0), 0, 61160 }, /* BFSET */ -{ XCPUFUNC(op_eef0_0), 0, 61168 }, /* BFSET */ -{ XCPUFUNC(op_eef8_0), 0, 61176 }, /* BFSET */ -{ XCPUFUNC(op_eef9_0), 0, 61177 }, /* BFSET */ -{ XCPUFUNC(op_efc0_0), 0, 61376 }, /* BFINS */ -{ XCPUFUNC(op_efd0_0), 0, 61392 }, /* BFINS */ -{ XCPUFUNC(op_efe8_0), 0, 61416 }, /* BFINS */ -{ XCPUFUNC(op_eff0_0), 0, 61424 }, /* BFINS */ -{ XCPUFUNC(op_eff8_0), 0, 61432 }, /* BFINS */ -{ XCPUFUNC(op_eff9_0), 0, 61433 }, /* BFINS */ -{ XCPUFUNC(op_f000_0), 0, 61440 }, /* MMUOP30A */ -{ XCPUFUNC(op_f008_0), 0, 61448 }, /* MMUOP30A */ -{ XCPUFUNC(op_f010_0), 0, 61456 }, /* MMUOP30A */ -{ XCPUFUNC(op_f018_0), 0, 61464 }, /* MMUOP30A */ -{ XCPUFUNC(op_f020_0), 0, 61472 }, /* MMUOP30A */ -{ XCPUFUNC(op_f028_0), 0, 61480 }, /* MMUOP30A */ -{ XCPUFUNC(op_f030_0), 0, 61488 }, /* MMUOP30A */ -{ XCPUFUNC(op_f038_0), 0, 61496 }, /* MMUOP30A */ -{ XCPUFUNC(op_f039_0), 0, 61497 }, /* MMUOP30A */ -{ XCPUFUNC(op_f03a_0), 0, 61498 }, /* MMUOP30A */ -{ XCPUFUNC(op_f03b_0), 0, 61499 }, /* MMUOP30A */ -{ XCPUFUNC(op_f200_0), 0, 61952 }, /* FPP */ -{ XCPUFUNC(op_f208_0), 0, 61960 }, /* FPP */ -{ XCPUFUNC(op_f210_0), 0, 61968 }, /* FPP */ -{ XCPUFUNC(op_f218_0), 0, 61976 }, /* FPP */ -{ XCPUFUNC(op_f220_0), 0, 61984 }, /* FPP */ -{ XCPUFUNC(op_f228_0), 0, 61992 }, /* FPP */ -{ XCPUFUNC(op_f230_0), 0, 62000 }, /* FPP */ -{ XCPUFUNC(op_f238_0), 0, 62008 }, /* FPP */ -{ XCPUFUNC(op_f239_0), 0, 62009 }, /* FPP */ -{ XCPUFUNC(op_f23a_0), 0, 62010 }, /* FPP */ -{ XCPUFUNC(op_f23b_0), 0, 62011 }, /* FPP */ -{ XCPUFUNC(op_f23c_0), 0, 62012 }, /* FPP */ -{ XCPUFUNC(op_f240_0), 0, 62016 }, /* FScc */ -{ XCPUFUNC(op_f248_0), 0, 62024 }, /* FDBcc */ -{ XCPUFUNC(op_f250_0), 0, 62032 }, /* FScc */ -{ XCPUFUNC(op_f258_0), 0, 62040 }, /* FScc */ -{ XCPUFUNC(op_f260_0), 0, 62048 }, /* FScc */ -{ XCPUFUNC(op_f268_0), 0, 62056 }, /* FScc */ -{ XCPUFUNC(op_f270_0), 0, 62064 }, /* FScc */ -{ XCPUFUNC(op_f278_0), 0, 62072 }, /* FScc */ -{ XCPUFUNC(op_f279_0), 0, 62073 }, /* FScc */ -{ XCPUFUNC(op_f27a_0), 0, 62074 }, /* FTRAPcc */ -{ XCPUFUNC(op_f27b_0), 0, 62075 }, /* FTRAPcc */ -{ XCPUFUNC(op_f27c_0), 0, 62076 }, /* FTRAPcc */ -{ XCPUFUNC(op_f280_0), 0, 62080 }, /* FBcc */ -{ XCPUFUNC(op_f2c0_0), 0, 62144 }, /* FBcc */ -{ XCPUFUNC(op_f310_0), 0, 62224 }, /* FSAVE */ -{ XCPUFUNC(op_f320_0), 0, 62240 }, /* FSAVE */ -{ XCPUFUNC(op_f328_0), 0, 62248 }, /* FSAVE */ -{ XCPUFUNC(op_f330_0), 0, 62256 }, /* FSAVE */ -{ XCPUFUNC(op_f338_0), 0, 62264 }, /* FSAVE */ -{ XCPUFUNC(op_f339_0), 0, 62265 }, /* FSAVE */ -{ XCPUFUNC(op_f350_0), 0, 62288 }, /* FRESTORE */ -{ XCPUFUNC(op_f358_0), 0, 62296 }, /* FRESTORE */ -{ XCPUFUNC(op_f368_0), 0, 62312 }, /* FRESTORE */ -{ XCPUFUNC(op_f370_0), 0, 62320 }, /* FRESTORE */ -{ XCPUFUNC(op_f378_0), 0, 62328 }, /* FRESTORE */ -{ XCPUFUNC(op_f379_0), 0, 62329 }, /* FRESTORE */ -{ XCPUFUNC(op_f37a_0), 0, 62330 }, /* FRESTORE */ -{ XCPUFUNC(op_f37b_0), 0, 62331 }, /* FRESTORE */ -{ XCPUFUNC(op_f408_0), 0, 62472 }, /* CINVL */ -{ XCPUFUNC(op_f410_0), 0, 62480 }, /* CINVP */ -{ XCPUFUNC(op_f418_0), 0, 62488 }, /* CINVA */ -{ XCPUFUNC(op_f419_0), 0, 62489 }, /* CINVA */ -{ XCPUFUNC(op_f41a_0), 0, 62490 }, /* CINVA */ -{ XCPUFUNC(op_f41b_0), 0, 62491 }, /* CINVA */ -{ XCPUFUNC(op_f41c_0), 0, 62492 }, /* CINVA */ -{ XCPUFUNC(op_f41d_0), 0, 62493 }, /* CINVA */ -{ XCPUFUNC(op_f41e_0), 0, 62494 }, /* CINVA */ -{ XCPUFUNC(op_f41f_0), 0, 62495 }, /* CINVA */ -{ XCPUFUNC(op_f428_0), 0, 62504 }, /* CPUSHL */ -{ XCPUFUNC(op_f430_0), 0, 62512 }, /* CPUSHP */ -{ XCPUFUNC(op_f438_0), 0, 62520 }, /* CPUSHA */ -{ XCPUFUNC(op_f439_0), 0, 62521 }, /* CPUSHA */ -{ XCPUFUNC(op_f43a_0), 0, 62522 }, /* CPUSHA */ -{ XCPUFUNC(op_f43b_0), 0, 62523 }, /* CPUSHA */ -{ XCPUFUNC(op_f43c_0), 0, 62524 }, /* CPUSHA */ -{ XCPUFUNC(op_f43d_0), 0, 62525 }, /* CPUSHA */ -{ XCPUFUNC(op_f43e_0), 0, 62526 }, /* CPUSHA */ -{ XCPUFUNC(op_f43f_0), 0, 62527 }, /* CPUSHA */ -{ XCPUFUNC(op_f500_0), 0, 62720 }, /* MMUOP */ -{ XCPUFUNC(op_f600_0), 0, 62976 }, /* MOVE16 */ -{ XCPUFUNC(op_f608_0), 0, 62984 }, /* MOVE16 */ -{ XCPUFUNC(op_f610_0), 0, 62992 }, /* MOVE16 */ -{ XCPUFUNC(op_f618_0), 0, 63000 }, /* MOVE16 */ -{ XCPUFUNC(op_f620_0), 0, 63008 }, /* MOVE16 */ -{ XCPUFUNC(op_f800_0), 0, 63488 }, /* MMUOP30B */ -{ XCPUFUNC(op_f808_0), 0, 63496 }, /* MMUOP30B */ -{ XCPUFUNC(op_f810_0), 0, 63504 }, /* MMUOP30B */ -{ XCPUFUNC(op_f818_0), 0, 63512 }, /* MMUOP30B */ -{ XCPUFUNC(op_f820_0), 0, 63520 }, /* MMUOP30B */ -{ XCPUFUNC(op_f828_0), 0, 63528 }, /* MMUOP30B */ -{ XCPUFUNC(op_f830_0), 0, 63536 }, /* MMUOP30B */ -{ XCPUFUNC(op_f838_0), 0, 63544 }, /* MMUOP30B */ -{ XCPUFUNC(op_f839_0), 0, 63545 }, /* MMUOP30B */ -{ XCPUFUNC(op_f83a_0), 0, 63546 }, /* MMUOP30B */ -{ XCPUFUNC(op_f83b_0), 0, 63547 }, /* MMUOP30B */ -{ 0, 0, 0 }}; diff --git a/od-win32/gencpu_msvc/cputbl_small.h b/od-win32/gencpu_msvc/cputbl_small.h deleted file mode 100755 index d35e6e15..00000000 --- a/od-win32/gencpu_msvc/cputbl_small.h +++ /dev/null @@ -1,3776 +0,0 @@ -extern xcpuop_func op_0_0_nf; -extern xcpuop_func op_0_0_ff; -extern xcpuop_func op_10_0_nf; -extern xcpuop_func op_10_0_ff; -extern xcpuop_func op_18_0_nf; -extern xcpuop_func op_18_0_ff; -extern xcpuop_func op_20_0_nf; -extern xcpuop_func op_20_0_ff; -extern xcpuop_func op_28_0_nf; -extern xcpuop_func op_28_0_ff; -extern xcpuop_func op_30_0_nf; -extern xcpuop_func op_30_0_ff; -extern xcpuop_func op_38_0_nf; -extern xcpuop_func op_38_0_ff; -extern xcpuop_func op_39_0_nf; -extern xcpuop_func op_39_0_ff; -extern xcpuop_func op_3c_0_nf; -extern xcpuop_func op_3c_0_ff; -extern xcpuop_func op_40_0_nf; -extern xcpuop_func op_40_0_ff; -extern xcpuop_func op_50_0_nf; -extern xcpuop_func op_50_0_ff; -extern xcpuop_func op_58_0_nf; -extern xcpuop_func op_58_0_ff; -extern xcpuop_func op_60_0_nf; -extern xcpuop_func op_60_0_ff; -extern xcpuop_func op_68_0_nf; -extern xcpuop_func op_68_0_ff; -extern xcpuop_func op_70_0_nf; -extern xcpuop_func op_70_0_ff; -extern xcpuop_func op_78_0_nf; -extern xcpuop_func op_78_0_ff; -extern xcpuop_func op_79_0_nf; -extern xcpuop_func op_79_0_ff; -extern xcpuop_func op_7c_0_nf; -extern xcpuop_func op_7c_0_ff; -extern xcpuop_func op_80_0_nf; -extern xcpuop_func op_80_0_ff; -extern xcpuop_func op_90_0_nf; -extern xcpuop_func op_90_0_ff; -extern xcpuop_func op_98_0_nf; -extern xcpuop_func op_98_0_ff; -extern xcpuop_func op_a0_0_nf; -extern xcpuop_func op_a0_0_ff; -extern xcpuop_func op_a8_0_nf; -extern xcpuop_func op_a8_0_ff; -extern xcpuop_func op_b0_0_nf; -extern xcpuop_func op_b0_0_ff; -extern xcpuop_func op_b8_0_nf; -extern xcpuop_func op_b8_0_ff; -extern xcpuop_func op_b9_0_nf; -extern xcpuop_func op_b9_0_ff; -extern xcpuop_func op_d0_0_nf; -extern xcpuop_func op_d0_0_ff; -extern xcpuop_func op_e8_0_nf; -extern xcpuop_func op_e8_0_ff; -extern xcpuop_func op_f0_0_nf; -extern xcpuop_func op_f0_0_ff; -extern xcpuop_func op_f8_0_nf; -extern xcpuop_func op_f8_0_ff; -extern xcpuop_func op_f9_0_nf; -extern xcpuop_func op_f9_0_ff; -extern xcpuop_func op_fa_0_nf; -extern xcpuop_func op_fa_0_ff; -extern xcpuop_func op_fb_0_nf; -extern xcpuop_func op_fb_0_ff; -extern xcpuop_func op_100_0_nf; -extern xcpuop_func op_100_0_ff; -extern xcpuop_func op_108_0_nf; -extern xcpuop_func op_108_0_ff; -extern xcpuop_func op_110_0_nf; -extern xcpuop_func op_110_0_ff; -extern xcpuop_func op_118_0_nf; -extern xcpuop_func op_118_0_ff; -extern xcpuop_func op_120_0_nf; -extern xcpuop_func op_120_0_ff; -extern xcpuop_func op_128_0_nf; -extern xcpuop_func op_128_0_ff; -extern xcpuop_func op_130_0_nf; -extern xcpuop_func op_130_0_ff; -extern xcpuop_func op_138_0_nf; -extern xcpuop_func op_138_0_ff; -extern xcpuop_func op_139_0_nf; -extern xcpuop_func op_139_0_ff; -extern xcpuop_func op_13a_0_nf; -extern xcpuop_func op_13a_0_ff; -extern xcpuop_func op_13b_0_nf; -extern xcpuop_func op_13b_0_ff; -extern xcpuop_func op_13c_0_nf; -extern xcpuop_func op_13c_0_ff; -extern xcpuop_func op_140_0_nf; -extern xcpuop_func op_140_0_ff; -extern xcpuop_func op_148_0_nf; -extern xcpuop_func op_148_0_ff; -extern xcpuop_func op_150_0_nf; -extern xcpuop_func op_150_0_ff; -extern xcpuop_func op_158_0_nf; -extern xcpuop_func op_158_0_ff; -extern xcpuop_func op_160_0_nf; -extern xcpuop_func op_160_0_ff; -extern xcpuop_func op_168_0_nf; -extern xcpuop_func op_168_0_ff; -extern xcpuop_func op_170_0_nf; -extern xcpuop_func op_170_0_ff; -extern xcpuop_func op_178_0_nf; -extern xcpuop_func op_178_0_ff; -extern xcpuop_func op_179_0_nf; -extern xcpuop_func op_179_0_ff; -extern xcpuop_func op_17a_0_nf; -extern xcpuop_func op_17a_0_ff; -extern xcpuop_func op_17b_0_nf; -extern xcpuop_func op_17b_0_ff; -extern xcpuop_func op_180_0_nf; -extern xcpuop_func op_180_0_ff; -extern xcpuop_func op_188_0_nf; -extern xcpuop_func op_188_0_ff; -extern xcpuop_func op_190_0_nf; -extern xcpuop_func op_190_0_ff; -extern xcpuop_func op_198_0_nf; -extern xcpuop_func op_198_0_ff; -extern xcpuop_func op_1a0_0_nf; -extern xcpuop_func op_1a0_0_ff; -extern xcpuop_func op_1a8_0_nf; -extern xcpuop_func op_1a8_0_ff; -extern xcpuop_func op_1b0_0_nf; -extern xcpuop_func op_1b0_0_ff; -extern xcpuop_func op_1b8_0_nf; -extern xcpuop_func op_1b8_0_ff; -extern xcpuop_func op_1b9_0_nf; -extern xcpuop_func op_1b9_0_ff; -extern xcpuop_func op_1ba_0_nf; -extern xcpuop_func op_1ba_0_ff; -extern xcpuop_func op_1bb_0_nf; -extern xcpuop_func op_1bb_0_ff; -extern xcpuop_func op_1c0_0_nf; -extern xcpuop_func op_1c0_0_ff; -extern xcpuop_func op_1c8_0_nf; -extern xcpuop_func op_1c8_0_ff; -extern xcpuop_func op_1d0_0_nf; -extern xcpuop_func op_1d0_0_ff; -extern xcpuop_func op_1d8_0_nf; -extern xcpuop_func op_1d8_0_ff; -extern xcpuop_func op_1e0_0_nf; -extern xcpuop_func op_1e0_0_ff; -extern xcpuop_func op_1e8_0_nf; -extern xcpuop_func op_1e8_0_ff; -extern xcpuop_func op_1f0_0_nf; -extern xcpuop_func op_1f0_0_ff; -extern xcpuop_func op_1f8_0_nf; -extern xcpuop_func op_1f8_0_ff; -extern xcpuop_func op_1f9_0_nf; -extern xcpuop_func op_1f9_0_ff; -extern xcpuop_func op_1fa_0_nf; -extern xcpuop_func op_1fa_0_ff; -extern xcpuop_func op_1fb_0_nf; -extern xcpuop_func op_1fb_0_ff; -extern xcpuop_func op_200_0_nf; -extern xcpuop_func op_200_0_ff; -extern xcpuop_func op_210_0_nf; -extern xcpuop_func op_210_0_ff; -extern xcpuop_func op_218_0_nf; -extern xcpuop_func op_218_0_ff; -extern xcpuop_func op_220_0_nf; -extern xcpuop_func op_220_0_ff; -extern xcpuop_func op_228_0_nf; -extern xcpuop_func op_228_0_ff; -extern xcpuop_func op_230_0_nf; -extern xcpuop_func op_230_0_ff; -extern xcpuop_func op_238_0_nf; -extern xcpuop_func op_238_0_ff; -extern xcpuop_func op_239_0_nf; -extern xcpuop_func op_239_0_ff; -extern xcpuop_func op_23c_0_nf; -extern xcpuop_func op_23c_0_ff; -extern xcpuop_func op_240_0_nf; -extern xcpuop_func op_240_0_ff; -extern xcpuop_func op_250_0_nf; -extern xcpuop_func op_250_0_ff; -extern xcpuop_func op_258_0_nf; -extern xcpuop_func op_258_0_ff; -extern xcpuop_func op_260_0_nf; -extern xcpuop_func op_260_0_ff; -extern xcpuop_func op_268_0_nf; -extern xcpuop_func op_268_0_ff; -extern xcpuop_func op_270_0_nf; -extern xcpuop_func op_270_0_ff; -extern xcpuop_func op_278_0_nf; -extern xcpuop_func op_278_0_ff; -extern xcpuop_func op_279_0_nf; -extern xcpuop_func op_279_0_ff; -extern xcpuop_func op_27c_0_nf; -extern xcpuop_func op_27c_0_ff; -extern xcpuop_func op_280_0_nf; -extern xcpuop_func op_280_0_ff; -extern xcpuop_func op_290_0_nf; -extern xcpuop_func op_290_0_ff; -extern xcpuop_func op_298_0_nf; -extern xcpuop_func op_298_0_ff; -extern xcpuop_func op_2a0_0_nf; -extern xcpuop_func op_2a0_0_ff; -extern xcpuop_func op_2a8_0_nf; -extern xcpuop_func op_2a8_0_ff; -extern xcpuop_func op_2b0_0_nf; -extern xcpuop_func op_2b0_0_ff; -extern xcpuop_func op_2b8_0_nf; -extern xcpuop_func op_2b8_0_ff; -extern xcpuop_func op_2b9_0_nf; -extern xcpuop_func op_2b9_0_ff; -extern xcpuop_func op_2d0_0_nf; -extern xcpuop_func op_2d0_0_ff; -extern xcpuop_func op_2e8_0_nf; -extern xcpuop_func op_2e8_0_ff; -extern xcpuop_func op_2f0_0_nf; -extern xcpuop_func op_2f0_0_ff; -extern xcpuop_func op_2f8_0_nf; -extern xcpuop_func op_2f8_0_ff; -extern xcpuop_func op_2f9_0_nf; -extern xcpuop_func op_2f9_0_ff; -extern xcpuop_func op_2fa_0_nf; -extern xcpuop_func op_2fa_0_ff; -extern xcpuop_func op_2fb_0_nf; -extern xcpuop_func op_2fb_0_ff; -extern xcpuop_func op_400_0_nf; -extern xcpuop_func op_400_0_ff; -extern xcpuop_func op_410_0_nf; -extern xcpuop_func op_410_0_ff; -extern xcpuop_func op_418_0_nf; -extern xcpuop_func op_418_0_ff; -extern xcpuop_func op_420_0_nf; -extern xcpuop_func op_420_0_ff; -extern xcpuop_func op_428_0_nf; -extern xcpuop_func op_428_0_ff; -extern xcpuop_func op_430_0_nf; -extern xcpuop_func op_430_0_ff; -extern xcpuop_func op_438_0_nf; -extern xcpuop_func op_438_0_ff; -extern xcpuop_func op_439_0_nf; -extern xcpuop_func op_439_0_ff; -extern xcpuop_func op_440_0_nf; -extern xcpuop_func op_440_0_ff; -extern xcpuop_func op_450_0_nf; -extern xcpuop_func op_450_0_ff; -extern xcpuop_func op_458_0_nf; -extern xcpuop_func op_458_0_ff; -extern xcpuop_func op_460_0_nf; -extern xcpuop_func op_460_0_ff; -extern xcpuop_func op_468_0_nf; -extern xcpuop_func op_468_0_ff; -extern xcpuop_func op_470_0_nf; -extern xcpuop_func op_470_0_ff; -extern xcpuop_func op_478_0_nf; -extern xcpuop_func op_478_0_ff; -extern xcpuop_func op_479_0_nf; -extern xcpuop_func op_479_0_ff; -extern xcpuop_func op_480_0_nf; -extern xcpuop_func op_480_0_ff; -extern xcpuop_func op_490_0_nf; -extern xcpuop_func op_490_0_ff; -extern xcpuop_func op_498_0_nf; -extern xcpuop_func op_498_0_ff; -extern xcpuop_func op_4a0_0_nf; -extern xcpuop_func op_4a0_0_ff; -extern xcpuop_func op_4a8_0_nf; -extern xcpuop_func op_4a8_0_ff; -extern xcpuop_func op_4b0_0_nf; -extern xcpuop_func op_4b0_0_ff; -extern xcpuop_func op_4b8_0_nf; -extern xcpuop_func op_4b8_0_ff; -extern xcpuop_func op_4b9_0_nf; -extern xcpuop_func op_4b9_0_ff; -extern xcpuop_func op_4d0_0_nf; -extern xcpuop_func op_4d0_0_ff; -extern xcpuop_func op_4e8_0_nf; -extern xcpuop_func op_4e8_0_ff; -extern xcpuop_func op_4f0_0_nf; -extern xcpuop_func op_4f0_0_ff; -extern xcpuop_func op_4f8_0_nf; -extern xcpuop_func op_4f8_0_ff; -extern xcpuop_func op_4f9_0_nf; -extern xcpuop_func op_4f9_0_ff; -extern xcpuop_func op_4fa_0_nf; -extern xcpuop_func op_4fa_0_ff; -extern xcpuop_func op_4fb_0_nf; -extern xcpuop_func op_4fb_0_ff; -extern xcpuop_func op_600_0_nf; -extern xcpuop_func op_600_0_ff; -extern xcpuop_func op_610_0_nf; -extern xcpuop_func op_610_0_ff; -extern xcpuop_func op_618_0_nf; -extern xcpuop_func op_618_0_ff; -extern xcpuop_func op_620_0_nf; -extern xcpuop_func op_620_0_ff; -extern xcpuop_func op_628_0_nf; -extern xcpuop_func op_628_0_ff; -extern xcpuop_func op_630_0_nf; -extern xcpuop_func op_630_0_ff; -extern xcpuop_func op_638_0_nf; -extern xcpuop_func op_638_0_ff; -extern xcpuop_func op_639_0_nf; -extern xcpuop_func op_639_0_ff; -extern xcpuop_func op_640_0_nf; -extern xcpuop_func op_640_0_ff; -extern xcpuop_func op_650_0_nf; -extern xcpuop_func op_650_0_ff; -extern xcpuop_func op_658_0_nf; -extern xcpuop_func op_658_0_ff; -extern xcpuop_func op_660_0_nf; -extern xcpuop_func op_660_0_ff; -extern xcpuop_func op_668_0_nf; -extern xcpuop_func op_668_0_ff; -extern xcpuop_func op_670_0_nf; -extern xcpuop_func op_670_0_ff; -extern xcpuop_func op_678_0_nf; -extern xcpuop_func op_678_0_ff; -extern xcpuop_func op_679_0_nf; -extern xcpuop_func op_679_0_ff; -extern xcpuop_func op_680_0_nf; -extern xcpuop_func op_680_0_ff; -extern xcpuop_func op_690_0_nf; -extern xcpuop_func op_690_0_ff; -extern xcpuop_func op_698_0_nf; -extern xcpuop_func op_698_0_ff; -extern xcpuop_func op_6a0_0_nf; -extern xcpuop_func op_6a0_0_ff; -extern xcpuop_func op_6a8_0_nf; -extern xcpuop_func op_6a8_0_ff; -extern xcpuop_func op_6b0_0_nf; -extern xcpuop_func op_6b0_0_ff; -extern xcpuop_func op_6b8_0_nf; -extern xcpuop_func op_6b8_0_ff; -extern xcpuop_func op_6b9_0_nf; -extern xcpuop_func op_6b9_0_ff; -extern xcpuop_func op_6c0_0_nf; -extern xcpuop_func op_6c0_0_ff; -extern xcpuop_func op_6c8_0_nf; -extern xcpuop_func op_6c8_0_ff; -extern xcpuop_func op_6d0_0_nf; -extern xcpuop_func op_6d0_0_ff; -extern xcpuop_func op_6e8_0_nf; -extern xcpuop_func op_6e8_0_ff; -extern xcpuop_func op_6f0_0_nf; -extern xcpuop_func op_6f0_0_ff; -extern xcpuop_func op_6f8_0_nf; -extern xcpuop_func op_6f8_0_ff; -extern xcpuop_func op_6f9_0_nf; -extern xcpuop_func op_6f9_0_ff; -extern xcpuop_func op_6fa_0_nf; -extern xcpuop_func op_6fa_0_ff; -extern xcpuop_func op_6fb_0_nf; -extern xcpuop_func op_6fb_0_ff; -extern xcpuop_func op_800_0_nf; -extern xcpuop_func op_800_0_ff; -extern xcpuop_func op_810_0_nf; -extern xcpuop_func op_810_0_ff; -extern xcpuop_func op_818_0_nf; -extern xcpuop_func op_818_0_ff; -extern xcpuop_func op_820_0_nf; -extern xcpuop_func op_820_0_ff; -extern xcpuop_func op_828_0_nf; -extern xcpuop_func op_828_0_ff; -extern xcpuop_func op_830_0_nf; -extern xcpuop_func op_830_0_ff; -extern xcpuop_func op_838_0_nf; -extern xcpuop_func op_838_0_ff; -extern xcpuop_func op_839_0_nf; -extern xcpuop_func op_839_0_ff; -extern xcpuop_func op_83a_0_nf; -extern xcpuop_func op_83a_0_ff; -extern xcpuop_func op_83b_0_nf; -extern xcpuop_func op_83b_0_ff; -extern xcpuop_func op_83c_0_nf; -extern xcpuop_func op_83c_0_ff; -extern xcpuop_func op_840_0_nf; -extern xcpuop_func op_840_0_ff; -extern xcpuop_func op_850_0_nf; -extern xcpuop_func op_850_0_ff; -extern xcpuop_func op_858_0_nf; -extern xcpuop_func op_858_0_ff; -extern xcpuop_func op_860_0_nf; -extern xcpuop_func op_860_0_ff; -extern xcpuop_func op_868_0_nf; -extern xcpuop_func op_868_0_ff; -extern xcpuop_func op_870_0_nf; -extern xcpuop_func op_870_0_ff; -extern xcpuop_func op_878_0_nf; -extern xcpuop_func op_878_0_ff; -extern xcpuop_func op_879_0_nf; -extern xcpuop_func op_879_0_ff; -extern xcpuop_func op_87a_0_nf; -extern xcpuop_func op_87a_0_ff; -extern xcpuop_func op_87b_0_nf; -extern xcpuop_func op_87b_0_ff; -extern xcpuop_func op_880_0_nf; -extern xcpuop_func op_880_0_ff; -extern xcpuop_func op_890_0_nf; -extern xcpuop_func op_890_0_ff; -extern xcpuop_func op_898_0_nf; -extern xcpuop_func op_898_0_ff; -extern xcpuop_func op_8a0_0_nf; -extern xcpuop_func op_8a0_0_ff; -extern xcpuop_func op_8a8_0_nf; -extern xcpuop_func op_8a8_0_ff; -extern xcpuop_func op_8b0_0_nf; -extern xcpuop_func op_8b0_0_ff; -extern xcpuop_func op_8b8_0_nf; -extern xcpuop_func op_8b8_0_ff; -extern xcpuop_func op_8b9_0_nf; -extern xcpuop_func op_8b9_0_ff; -extern xcpuop_func op_8ba_0_nf; -extern xcpuop_func op_8ba_0_ff; -extern xcpuop_func op_8bb_0_nf; -extern xcpuop_func op_8bb_0_ff; -extern xcpuop_func op_8c0_0_nf; -extern xcpuop_func op_8c0_0_ff; -extern xcpuop_func op_8d0_0_nf; -extern xcpuop_func op_8d0_0_ff; -extern xcpuop_func op_8d8_0_nf; -extern xcpuop_func op_8d8_0_ff; -extern xcpuop_func op_8e0_0_nf; -extern xcpuop_func op_8e0_0_ff; -extern xcpuop_func op_8e8_0_nf; -extern xcpuop_func op_8e8_0_ff; -extern xcpuop_func op_8f0_0_nf; -extern xcpuop_func op_8f0_0_ff; -extern xcpuop_func op_8f8_0_nf; -extern xcpuop_func op_8f8_0_ff; -extern xcpuop_func op_8f9_0_nf; -extern xcpuop_func op_8f9_0_ff; -extern xcpuop_func op_8fa_0_nf; -extern xcpuop_func op_8fa_0_ff; -extern xcpuop_func op_8fb_0_nf; -extern xcpuop_func op_8fb_0_ff; -extern xcpuop_func op_a00_0_nf; -extern xcpuop_func op_a00_0_ff; -extern xcpuop_func op_a10_0_nf; -extern xcpuop_func op_a10_0_ff; -extern xcpuop_func op_a18_0_nf; -extern xcpuop_func op_a18_0_ff; -extern xcpuop_func op_a20_0_nf; -extern xcpuop_func op_a20_0_ff; -extern xcpuop_func op_a28_0_nf; -extern xcpuop_func op_a28_0_ff; -extern xcpuop_func op_a30_0_nf; -extern xcpuop_func op_a30_0_ff; -extern xcpuop_func op_a38_0_nf; -extern xcpuop_func op_a38_0_ff; -extern xcpuop_func op_a39_0_nf; -extern xcpuop_func op_a39_0_ff; -extern xcpuop_func op_a3c_0_nf; -extern xcpuop_func op_a3c_0_ff; -extern xcpuop_func op_a40_0_nf; -extern xcpuop_func op_a40_0_ff; -extern xcpuop_func op_a50_0_nf; -extern xcpuop_func op_a50_0_ff; -extern xcpuop_func op_a58_0_nf; -extern xcpuop_func op_a58_0_ff; -extern xcpuop_func op_a60_0_nf; -extern xcpuop_func op_a60_0_ff; -extern xcpuop_func op_a68_0_nf; -extern xcpuop_func op_a68_0_ff; -extern xcpuop_func op_a70_0_nf; -extern xcpuop_func op_a70_0_ff; -extern xcpuop_func op_a78_0_nf; -extern xcpuop_func op_a78_0_ff; -extern xcpuop_func op_a79_0_nf; -extern xcpuop_func op_a79_0_ff; -extern xcpuop_func op_a7c_0_nf; -extern xcpuop_func op_a7c_0_ff; -extern xcpuop_func op_a80_0_nf; -extern xcpuop_func op_a80_0_ff; -extern xcpuop_func op_a90_0_nf; -extern xcpuop_func op_a90_0_ff; -extern xcpuop_func op_a98_0_nf; -extern xcpuop_func op_a98_0_ff; -extern xcpuop_func op_aa0_0_nf; -extern xcpuop_func op_aa0_0_ff; -extern xcpuop_func op_aa8_0_nf; -extern xcpuop_func op_aa8_0_ff; -extern xcpuop_func op_ab0_0_nf; -extern xcpuop_func op_ab0_0_ff; -extern xcpuop_func op_ab8_0_nf; -extern xcpuop_func op_ab8_0_ff; -extern xcpuop_func op_ab9_0_nf; -extern xcpuop_func op_ab9_0_ff; -extern xcpuop_func op_ad0_0_nf; -extern xcpuop_func op_ad0_0_ff; -extern xcpuop_func op_ad8_0_nf; -extern xcpuop_func op_ad8_0_ff; -extern xcpuop_func op_ae0_0_nf; -extern xcpuop_func op_ae0_0_ff; -extern xcpuop_func op_ae8_0_nf; -extern xcpuop_func op_ae8_0_ff; -extern xcpuop_func op_af0_0_nf; -extern xcpuop_func op_af0_0_ff; -extern xcpuop_func op_af8_0_nf; -extern xcpuop_func op_af8_0_ff; -extern xcpuop_func op_af9_0_nf; -extern xcpuop_func op_af9_0_ff; -extern xcpuop_func op_c00_0_nf; -extern xcpuop_func op_c00_0_ff; -extern xcpuop_func op_c10_0_nf; -extern xcpuop_func op_c10_0_ff; -extern xcpuop_func op_c18_0_nf; -extern xcpuop_func op_c18_0_ff; -extern xcpuop_func op_c20_0_nf; -extern xcpuop_func op_c20_0_ff; -extern xcpuop_func op_c28_0_nf; -extern xcpuop_func op_c28_0_ff; -extern xcpuop_func op_c30_0_nf; -extern xcpuop_func op_c30_0_ff; -extern xcpuop_func op_c38_0_nf; -extern xcpuop_func op_c38_0_ff; -extern xcpuop_func op_c39_0_nf; -extern xcpuop_func op_c39_0_ff; -extern xcpuop_func op_c3a_0_nf; -extern xcpuop_func op_c3a_0_ff; -extern xcpuop_func op_c3b_0_nf; -extern xcpuop_func op_c3b_0_ff; -extern xcpuop_func op_c40_0_nf; -extern xcpuop_func op_c40_0_ff; -extern xcpuop_func op_c50_0_nf; -extern xcpuop_func op_c50_0_ff; -extern xcpuop_func op_c58_0_nf; -extern xcpuop_func op_c58_0_ff; -extern xcpuop_func op_c60_0_nf; -extern xcpuop_func op_c60_0_ff; -extern xcpuop_func op_c68_0_nf; -extern xcpuop_func op_c68_0_ff; -extern xcpuop_func op_c70_0_nf; -extern xcpuop_func op_c70_0_ff; -extern xcpuop_func op_c78_0_nf; -extern xcpuop_func op_c78_0_ff; -extern xcpuop_func op_c79_0_nf; -extern xcpuop_func op_c79_0_ff; -extern xcpuop_func op_c7a_0_nf; -extern xcpuop_func op_c7a_0_ff; -extern xcpuop_func op_c7b_0_nf; -extern xcpuop_func op_c7b_0_ff; -extern xcpuop_func op_c80_0_nf; -extern xcpuop_func op_c80_0_ff; -extern xcpuop_func op_c90_0_nf; -extern xcpuop_func op_c90_0_ff; -extern xcpuop_func op_c98_0_nf; -extern xcpuop_func op_c98_0_ff; -extern xcpuop_func op_ca0_0_nf; -extern xcpuop_func op_ca0_0_ff; -extern xcpuop_func op_ca8_0_nf; -extern xcpuop_func op_ca8_0_ff; -extern xcpuop_func op_cb0_0_nf; -extern xcpuop_func op_cb0_0_ff; -extern xcpuop_func op_cb8_0_nf; -extern xcpuop_func op_cb8_0_ff; -extern xcpuop_func op_cb9_0_nf; -extern xcpuop_func op_cb9_0_ff; -extern xcpuop_func op_cba_0_nf; -extern xcpuop_func op_cba_0_ff; -extern xcpuop_func op_cbb_0_nf; -extern xcpuop_func op_cbb_0_ff; -extern xcpuop_func op_cd0_0_nf; -extern xcpuop_func op_cd0_0_ff; -extern xcpuop_func op_cd8_0_nf; -extern xcpuop_func op_cd8_0_ff; -extern xcpuop_func op_ce0_0_nf; -extern xcpuop_func op_ce0_0_ff; -extern xcpuop_func op_ce8_0_nf; -extern xcpuop_func op_ce8_0_ff; -extern xcpuop_func op_cf0_0_nf; -extern xcpuop_func op_cf0_0_ff; -extern xcpuop_func op_cf8_0_nf; -extern xcpuop_func op_cf8_0_ff; -extern xcpuop_func op_cf9_0_nf; -extern xcpuop_func op_cf9_0_ff; -extern xcpuop_func op_cfc_0_nf; -extern xcpuop_func op_cfc_0_ff; -extern xcpuop_func op_e10_0_nf; -extern xcpuop_func op_e10_0_ff; -extern xcpuop_func op_e18_0_nf; -extern xcpuop_func op_e18_0_ff; -extern xcpuop_func op_e20_0_nf; -extern xcpuop_func op_e20_0_ff; -extern xcpuop_func op_e28_0_nf; -extern xcpuop_func op_e28_0_ff; -extern xcpuop_func op_e30_0_nf; -extern xcpuop_func op_e30_0_ff; -extern xcpuop_func op_e38_0_nf; -extern xcpuop_func op_e38_0_ff; -extern xcpuop_func op_e39_0_nf; -extern xcpuop_func op_e39_0_ff; -extern xcpuop_func op_e50_0_nf; -extern xcpuop_func op_e50_0_ff; -extern xcpuop_func op_e58_0_nf; -extern xcpuop_func op_e58_0_ff; -extern xcpuop_func op_e60_0_nf; -extern xcpuop_func op_e60_0_ff; -extern xcpuop_func op_e68_0_nf; -extern xcpuop_func op_e68_0_ff; -extern xcpuop_func op_e70_0_nf; -extern xcpuop_func op_e70_0_ff; -extern xcpuop_func op_e78_0_nf; -extern xcpuop_func op_e78_0_ff; -extern xcpuop_func op_e79_0_nf; -extern xcpuop_func op_e79_0_ff; -extern xcpuop_func op_e90_0_nf; -extern xcpuop_func op_e90_0_ff; -extern xcpuop_func op_e98_0_nf; -extern xcpuop_func op_e98_0_ff; -extern xcpuop_func op_ea0_0_nf; -extern xcpuop_func op_ea0_0_ff; -extern xcpuop_func op_ea8_0_nf; -extern xcpuop_func op_ea8_0_ff; -extern xcpuop_func op_eb0_0_nf; -extern xcpuop_func op_eb0_0_ff; -extern xcpuop_func op_eb8_0_nf; -extern xcpuop_func op_eb8_0_ff; -extern xcpuop_func op_eb9_0_nf; -extern xcpuop_func op_eb9_0_ff; -extern xcpuop_func op_ed0_0_nf; -extern xcpuop_func op_ed0_0_ff; -extern xcpuop_func op_ed8_0_nf; -extern xcpuop_func op_ed8_0_ff; -extern xcpuop_func op_ee0_0_nf; -extern xcpuop_func op_ee0_0_ff; -extern xcpuop_func op_ee8_0_nf; -extern xcpuop_func op_ee8_0_ff; -extern xcpuop_func op_ef0_0_nf; -extern xcpuop_func op_ef0_0_ff; -extern xcpuop_func op_ef8_0_nf; -extern xcpuop_func op_ef8_0_ff; -extern xcpuop_func op_ef9_0_nf; -extern xcpuop_func op_ef9_0_ff; -extern xcpuop_func op_efc_0_nf; -extern xcpuop_func op_efc_0_ff; -extern xcpuop_func op_1000_0_nf; -extern xcpuop_func op_1000_0_ff; -extern xcpuop_func op_1010_0_nf; -extern xcpuop_func op_1010_0_ff; -extern xcpuop_func op_1018_0_nf; -extern xcpuop_func op_1018_0_ff; -extern xcpuop_func op_1020_0_nf; -extern xcpuop_func op_1020_0_ff; -extern xcpuop_func op_1028_0_nf; -extern xcpuop_func op_1028_0_ff; -extern xcpuop_func op_1030_0_nf; -extern xcpuop_func op_1030_0_ff; -extern xcpuop_func op_1038_0_nf; -extern xcpuop_func op_1038_0_ff; -extern xcpuop_func op_1039_0_nf; -extern xcpuop_func op_1039_0_ff; -extern xcpuop_func op_103a_0_nf; -extern xcpuop_func op_103a_0_ff; -extern xcpuop_func op_103b_0_nf; -extern xcpuop_func op_103b_0_ff; -extern xcpuop_func op_103c_0_nf; -extern xcpuop_func op_103c_0_ff; -extern xcpuop_func op_1080_0_nf; -extern xcpuop_func op_1080_0_ff; -extern xcpuop_func op_1090_0_nf; -extern xcpuop_func op_1090_0_ff; -extern xcpuop_func op_1098_0_nf; -extern xcpuop_func op_1098_0_ff; -extern xcpuop_func op_10a0_0_nf; -extern xcpuop_func op_10a0_0_ff; -extern xcpuop_func op_10a8_0_nf; -extern xcpuop_func op_10a8_0_ff; -extern xcpuop_func op_10b0_0_nf; -extern xcpuop_func op_10b0_0_ff; -extern xcpuop_func op_10b8_0_nf; -extern xcpuop_func op_10b8_0_ff; -extern xcpuop_func op_10b9_0_nf; -extern xcpuop_func op_10b9_0_ff; -extern xcpuop_func op_10ba_0_nf; -extern xcpuop_func op_10ba_0_ff; -extern xcpuop_func op_10bb_0_nf; -extern xcpuop_func op_10bb_0_ff; -extern xcpuop_func op_10bc_0_nf; -extern xcpuop_func op_10bc_0_ff; -extern xcpuop_func op_10c0_0_nf; -extern xcpuop_func op_10c0_0_ff; -extern xcpuop_func op_10d0_0_nf; -extern xcpuop_func op_10d0_0_ff; -extern xcpuop_func op_10d8_0_nf; -extern xcpuop_func op_10d8_0_ff; -extern xcpuop_func op_10e0_0_nf; -extern xcpuop_func op_10e0_0_ff; -extern xcpuop_func op_10e8_0_nf; -extern xcpuop_func op_10e8_0_ff; -extern xcpuop_func op_10f0_0_nf; -extern xcpuop_func op_10f0_0_ff; -extern xcpuop_func op_10f8_0_nf; -extern xcpuop_func op_10f8_0_ff; -extern xcpuop_func op_10f9_0_nf; -extern xcpuop_func op_10f9_0_ff; -extern xcpuop_func op_10fa_0_nf; -extern xcpuop_func op_10fa_0_ff; -extern xcpuop_func op_10fb_0_nf; -extern xcpuop_func op_10fb_0_ff; -extern xcpuop_func op_10fc_0_nf; -extern xcpuop_func op_10fc_0_ff; -extern xcpuop_func op_1100_0_nf; -extern xcpuop_func op_1100_0_ff; -extern xcpuop_func op_1110_0_nf; -extern xcpuop_func op_1110_0_ff; -extern xcpuop_func op_1118_0_nf; -extern xcpuop_func op_1118_0_ff; -extern xcpuop_func op_1120_0_nf; -extern xcpuop_func op_1120_0_ff; -extern xcpuop_func op_1128_0_nf; -extern xcpuop_func op_1128_0_ff; -extern xcpuop_func op_1130_0_nf; -extern xcpuop_func op_1130_0_ff; -extern xcpuop_func op_1138_0_nf; -extern xcpuop_func op_1138_0_ff; -extern xcpuop_func op_1139_0_nf; -extern xcpuop_func op_1139_0_ff; -extern xcpuop_func op_113a_0_nf; -extern xcpuop_func op_113a_0_ff; -extern xcpuop_func op_113b_0_nf; -extern xcpuop_func op_113b_0_ff; -extern xcpuop_func op_113c_0_nf; -extern xcpuop_func op_113c_0_ff; -extern xcpuop_func op_1140_0_nf; -extern xcpuop_func op_1140_0_ff; -extern xcpuop_func op_1150_0_nf; -extern xcpuop_func op_1150_0_ff; -extern xcpuop_func op_1158_0_nf; -extern xcpuop_func op_1158_0_ff; -extern xcpuop_func op_1160_0_nf; -extern xcpuop_func op_1160_0_ff; -extern xcpuop_func op_1168_0_nf; -extern xcpuop_func op_1168_0_ff; -extern xcpuop_func op_1170_0_nf; -extern xcpuop_func op_1170_0_ff; -extern xcpuop_func op_1178_0_nf; -extern xcpuop_func op_1178_0_ff; -extern xcpuop_func op_1179_0_nf; -extern xcpuop_func op_1179_0_ff; -extern xcpuop_func op_117a_0_nf; -extern xcpuop_func op_117a_0_ff; -extern xcpuop_func op_117b_0_nf; -extern xcpuop_func op_117b_0_ff; -extern xcpuop_func op_117c_0_nf; -extern xcpuop_func op_117c_0_ff; -extern xcpuop_func op_1180_0_nf; -extern xcpuop_func op_1180_0_ff; -extern xcpuop_func op_1190_0_nf; -extern xcpuop_func op_1190_0_ff; -extern xcpuop_func op_1198_0_nf; -extern xcpuop_func op_1198_0_ff; -extern xcpuop_func op_11a0_0_nf; -extern xcpuop_func op_11a0_0_ff; -extern xcpuop_func op_11a8_0_nf; -extern xcpuop_func op_11a8_0_ff; -extern xcpuop_func op_11b0_0_nf; -extern xcpuop_func op_11b0_0_ff; -extern xcpuop_func op_11b8_0_nf; -extern xcpuop_func op_11b8_0_ff; -extern xcpuop_func op_11b9_0_nf; -extern xcpuop_func op_11b9_0_ff; -extern xcpuop_func op_11ba_0_nf; -extern xcpuop_func op_11ba_0_ff; -extern xcpuop_func op_11bb_0_nf; -extern xcpuop_func op_11bb_0_ff; -extern xcpuop_func op_11bc_0_nf; -extern xcpuop_func op_11bc_0_ff; -extern xcpuop_func op_11c0_0_nf; -extern xcpuop_func op_11c0_0_ff; -extern xcpuop_func op_11d0_0_nf; -extern xcpuop_func op_11d0_0_ff; -extern xcpuop_func op_11d8_0_nf; -extern xcpuop_func op_11d8_0_ff; -extern xcpuop_func op_11e0_0_nf; -extern xcpuop_func op_11e0_0_ff; -extern xcpuop_func op_11e8_0_nf; -extern xcpuop_func op_11e8_0_ff; -extern xcpuop_func op_11f0_0_nf; -extern xcpuop_func op_11f0_0_ff; -extern xcpuop_func op_11f8_0_nf; -extern xcpuop_func op_11f8_0_ff; -extern xcpuop_func op_11f9_0_nf; -extern xcpuop_func op_11f9_0_ff; -extern xcpuop_func op_11fa_0_nf; -extern xcpuop_func op_11fa_0_ff; -extern xcpuop_func op_11fb_0_nf; -extern xcpuop_func op_11fb_0_ff; -extern xcpuop_func op_11fc_0_nf; -extern xcpuop_func op_11fc_0_ff; -extern xcpuop_func op_13c0_0_nf; -extern xcpuop_func op_13c0_0_ff; -extern xcpuop_func op_13d0_0_nf; -extern xcpuop_func op_13d0_0_ff; -extern xcpuop_func op_13d8_0_nf; -extern xcpuop_func op_13d8_0_ff; -extern xcpuop_func op_13e0_0_nf; -extern xcpuop_func op_13e0_0_ff; -extern xcpuop_func op_13e8_0_nf; -extern xcpuop_func op_13e8_0_ff; -extern xcpuop_func op_13f0_0_nf; -extern xcpuop_func op_13f0_0_ff; -extern xcpuop_func op_13f8_0_nf; -extern xcpuop_func op_13f8_0_ff; -extern xcpuop_func op_13f9_0_nf; -extern xcpuop_func op_13f9_0_ff; -extern xcpuop_func op_13fa_0_nf; -extern xcpuop_func op_13fa_0_ff; -extern xcpuop_func op_13fb_0_nf; -extern xcpuop_func op_13fb_0_ff; -extern xcpuop_func op_13fc_0_nf; -extern xcpuop_func op_13fc_0_ff; -extern xcpuop_func op_2000_0_nf; -extern xcpuop_func op_2000_0_ff; -extern xcpuop_func op_2008_0_nf; -extern xcpuop_func op_2008_0_ff; -extern xcpuop_func op_2010_0_nf; -extern xcpuop_func op_2010_0_ff; -extern xcpuop_func op_2018_0_nf; -extern xcpuop_func op_2018_0_ff; -extern xcpuop_func op_2020_0_nf; -extern xcpuop_func op_2020_0_ff; -extern xcpuop_func op_2028_0_nf; -extern xcpuop_func op_2028_0_ff; -extern xcpuop_func op_2030_0_nf; -extern xcpuop_func op_2030_0_ff; -extern xcpuop_func op_2038_0_nf; -extern xcpuop_func op_2038_0_ff; -extern xcpuop_func op_2039_0_nf; -extern xcpuop_func op_2039_0_ff; -extern xcpuop_func op_203a_0_nf; -extern xcpuop_func op_203a_0_ff; -extern xcpuop_func op_203b_0_nf; -extern xcpuop_func op_203b_0_ff; -extern xcpuop_func op_203c_0_nf; -extern xcpuop_func op_203c_0_ff; -extern xcpuop_func op_2040_0_nf; -extern xcpuop_func op_2040_0_ff; -extern xcpuop_func op_2048_0_nf; -extern xcpuop_func op_2048_0_ff; -extern xcpuop_func op_2050_0_nf; -extern xcpuop_func op_2050_0_ff; -extern xcpuop_func op_2058_0_nf; -extern xcpuop_func op_2058_0_ff; -extern xcpuop_func op_2060_0_nf; -extern xcpuop_func op_2060_0_ff; -extern xcpuop_func op_2068_0_nf; -extern xcpuop_func op_2068_0_ff; -extern xcpuop_func op_2070_0_nf; -extern xcpuop_func op_2070_0_ff; -extern xcpuop_func op_2078_0_nf; -extern xcpuop_func op_2078_0_ff; -extern xcpuop_func op_2079_0_nf; -extern xcpuop_func op_2079_0_ff; -extern xcpuop_func op_207a_0_nf; -extern xcpuop_func op_207a_0_ff; -extern xcpuop_func op_207b_0_nf; -extern xcpuop_func op_207b_0_ff; -extern xcpuop_func op_207c_0_nf; -extern xcpuop_func op_207c_0_ff; -extern xcpuop_func op_2080_0_nf; -extern xcpuop_func op_2080_0_ff; -extern xcpuop_func op_2088_0_nf; -extern xcpuop_func op_2088_0_ff; -extern xcpuop_func op_2090_0_nf; -extern xcpuop_func op_2090_0_ff; -extern xcpuop_func op_2098_0_nf; -extern xcpuop_func op_2098_0_ff; -extern xcpuop_func op_20a0_0_nf; -extern xcpuop_func op_20a0_0_ff; -extern xcpuop_func op_20a8_0_nf; -extern xcpuop_func op_20a8_0_ff; -extern xcpuop_func op_20b0_0_nf; -extern xcpuop_func op_20b0_0_ff; -extern xcpuop_func op_20b8_0_nf; -extern xcpuop_func op_20b8_0_ff; -extern xcpuop_func op_20b9_0_nf; -extern xcpuop_func op_20b9_0_ff; -extern xcpuop_func op_20ba_0_nf; -extern xcpuop_func op_20ba_0_ff; -extern xcpuop_func op_20bb_0_nf; -extern xcpuop_func op_20bb_0_ff; -extern xcpuop_func op_20bc_0_nf; -extern xcpuop_func op_20bc_0_ff; -extern xcpuop_func op_20c0_0_nf; -extern xcpuop_func op_20c0_0_ff; -extern xcpuop_func op_20c8_0_nf; -extern xcpuop_func op_20c8_0_ff; -extern xcpuop_func op_20d0_0_nf; -extern xcpuop_func op_20d0_0_ff; -extern xcpuop_func op_20d8_0_nf; -extern xcpuop_func op_20d8_0_ff; -extern xcpuop_func op_20e0_0_nf; -extern xcpuop_func op_20e0_0_ff; -extern xcpuop_func op_20e8_0_nf; -extern xcpuop_func op_20e8_0_ff; -extern xcpuop_func op_20f0_0_nf; -extern xcpuop_func op_20f0_0_ff; -extern xcpuop_func op_20f8_0_nf; -extern xcpuop_func op_20f8_0_ff; -extern xcpuop_func op_20f9_0_nf; -extern xcpuop_func op_20f9_0_ff; -extern xcpuop_func op_20fa_0_nf; -extern xcpuop_func op_20fa_0_ff; -extern xcpuop_func op_20fb_0_nf; -extern xcpuop_func op_20fb_0_ff; -extern xcpuop_func op_20fc_0_nf; -extern xcpuop_func op_20fc_0_ff; -extern xcpuop_func op_2100_0_nf; -extern xcpuop_func op_2100_0_ff; -extern xcpuop_func op_2108_0_nf; -extern xcpuop_func op_2108_0_ff; -extern xcpuop_func op_2110_0_nf; -extern xcpuop_func op_2110_0_ff; -extern xcpuop_func op_2118_0_nf; -extern xcpuop_func op_2118_0_ff; -extern xcpuop_func op_2120_0_nf; -extern xcpuop_func op_2120_0_ff; -extern xcpuop_func op_2128_0_nf; -extern xcpuop_func op_2128_0_ff; -extern xcpuop_func op_2130_0_nf; -extern xcpuop_func op_2130_0_ff; -extern xcpuop_func op_2138_0_nf; -extern xcpuop_func op_2138_0_ff; -extern xcpuop_func op_2139_0_nf; -extern xcpuop_func op_2139_0_ff; -extern xcpuop_func op_213a_0_nf; -extern xcpuop_func op_213a_0_ff; -extern xcpuop_func op_213b_0_nf; -extern xcpuop_func op_213b_0_ff; -extern xcpuop_func op_213c_0_nf; -extern xcpuop_func op_213c_0_ff; -extern xcpuop_func op_2140_0_nf; -extern xcpuop_func op_2140_0_ff; -extern xcpuop_func op_2148_0_nf; -extern xcpuop_func op_2148_0_ff; -extern xcpuop_func op_2150_0_nf; -extern xcpuop_func op_2150_0_ff; -extern xcpuop_func op_2158_0_nf; -extern xcpuop_func op_2158_0_ff; -extern xcpuop_func op_2160_0_nf; -extern xcpuop_func op_2160_0_ff; -extern xcpuop_func op_2168_0_nf; -extern xcpuop_func op_2168_0_ff; -extern xcpuop_func op_2170_0_nf; -extern xcpuop_func op_2170_0_ff; -extern xcpuop_func op_2178_0_nf; -extern xcpuop_func op_2178_0_ff; -extern xcpuop_func op_2179_0_nf; -extern xcpuop_func op_2179_0_ff; -extern xcpuop_func op_217a_0_nf; -extern xcpuop_func op_217a_0_ff; -extern xcpuop_func op_217b_0_nf; -extern xcpuop_func op_217b_0_ff; -extern xcpuop_func op_217c_0_nf; -extern xcpuop_func op_217c_0_ff; -extern xcpuop_func op_2180_0_nf; -extern xcpuop_func op_2180_0_ff; -extern xcpuop_func op_2188_0_nf; -extern xcpuop_func op_2188_0_ff; -extern xcpuop_func op_2190_0_nf; -extern xcpuop_func op_2190_0_ff; -extern xcpuop_func op_2198_0_nf; -extern xcpuop_func op_2198_0_ff; -extern xcpuop_func op_21a0_0_nf; -extern xcpuop_func op_21a0_0_ff; -extern xcpuop_func op_21a8_0_nf; -extern xcpuop_func op_21a8_0_ff; -extern xcpuop_func op_21b0_0_nf; -extern xcpuop_func op_21b0_0_ff; -extern xcpuop_func op_21b8_0_nf; -extern xcpuop_func op_21b8_0_ff; -extern xcpuop_func op_21b9_0_nf; -extern xcpuop_func op_21b9_0_ff; -extern xcpuop_func op_21ba_0_nf; -extern xcpuop_func op_21ba_0_ff; -extern xcpuop_func op_21bb_0_nf; -extern xcpuop_func op_21bb_0_ff; -extern xcpuop_func op_21bc_0_nf; -extern xcpuop_func op_21bc_0_ff; -extern xcpuop_func op_21c0_0_nf; -extern xcpuop_func op_21c0_0_ff; -extern xcpuop_func op_21c8_0_nf; -extern xcpuop_func op_21c8_0_ff; -extern xcpuop_func op_21d0_0_nf; -extern xcpuop_func op_21d0_0_ff; -extern xcpuop_func op_21d8_0_nf; -extern xcpuop_func op_21d8_0_ff; -extern xcpuop_func op_21e0_0_nf; -extern xcpuop_func op_21e0_0_ff; -extern xcpuop_func op_21e8_0_nf; -extern xcpuop_func op_21e8_0_ff; -extern xcpuop_func op_21f0_0_nf; -extern xcpuop_func op_21f0_0_ff; -extern xcpuop_func op_21f8_0_nf; -extern xcpuop_func op_21f8_0_ff; -extern xcpuop_func op_21f9_0_nf; -extern xcpuop_func op_21f9_0_ff; -extern xcpuop_func op_21fa_0_nf; -extern xcpuop_func op_21fa_0_ff; -extern xcpuop_func op_21fb_0_nf; -extern xcpuop_func op_21fb_0_ff; -extern xcpuop_func op_21fc_0_nf; -extern xcpuop_func op_21fc_0_ff; -extern xcpuop_func op_23c0_0_nf; -extern xcpuop_func op_23c0_0_ff; -extern xcpuop_func op_23c8_0_nf; -extern xcpuop_func op_23c8_0_ff; -extern xcpuop_func op_23d0_0_nf; -extern xcpuop_func op_23d0_0_ff; -extern xcpuop_func op_23d8_0_nf; -extern xcpuop_func op_23d8_0_ff; -extern xcpuop_func op_23e0_0_nf; -extern xcpuop_func op_23e0_0_ff; -extern xcpuop_func op_23e8_0_nf; -extern xcpuop_func op_23e8_0_ff; -extern xcpuop_func op_23f0_0_nf; -extern xcpuop_func op_23f0_0_ff; -extern xcpuop_func op_23f8_0_nf; -extern xcpuop_func op_23f8_0_ff; -extern xcpuop_func op_23f9_0_nf; -extern xcpuop_func op_23f9_0_ff; -extern xcpuop_func op_23fa_0_nf; -extern xcpuop_func op_23fa_0_ff; -extern xcpuop_func op_23fb_0_nf; -extern xcpuop_func op_23fb_0_ff; -extern xcpuop_func op_23fc_0_nf; -extern xcpuop_func op_23fc_0_ff; -extern xcpuop_func op_3000_0_nf; -extern xcpuop_func op_3000_0_ff; -extern xcpuop_func op_3008_0_nf; -extern xcpuop_func op_3008_0_ff; -extern xcpuop_func op_3010_0_nf; -extern xcpuop_func op_3010_0_ff; -extern xcpuop_func op_3018_0_nf; -extern xcpuop_func op_3018_0_ff; -extern xcpuop_func op_3020_0_nf; -extern xcpuop_func op_3020_0_ff; -extern xcpuop_func op_3028_0_nf; -extern xcpuop_func op_3028_0_ff; -extern xcpuop_func op_3030_0_nf; -extern xcpuop_func op_3030_0_ff; -extern xcpuop_func op_3038_0_nf; -extern xcpuop_func op_3038_0_ff; -extern xcpuop_func op_3039_0_nf; -extern xcpuop_func op_3039_0_ff; -extern xcpuop_func op_303a_0_nf; -extern xcpuop_func op_303a_0_ff; -extern xcpuop_func op_303b_0_nf; -extern xcpuop_func op_303b_0_ff; -extern xcpuop_func op_303c_0_nf; -extern xcpuop_func op_303c_0_ff; -extern xcpuop_func op_3040_0_nf; -extern xcpuop_func op_3040_0_ff; -extern xcpuop_func op_3048_0_nf; -extern xcpuop_func op_3048_0_ff; -extern xcpuop_func op_3050_0_nf; -extern xcpuop_func op_3050_0_ff; -extern xcpuop_func op_3058_0_nf; -extern xcpuop_func op_3058_0_ff; -extern xcpuop_func op_3060_0_nf; -extern xcpuop_func op_3060_0_ff; -extern xcpuop_func op_3068_0_nf; -extern xcpuop_func op_3068_0_ff; -extern xcpuop_func op_3070_0_nf; -extern xcpuop_func op_3070_0_ff; -extern xcpuop_func op_3078_0_nf; -extern xcpuop_func op_3078_0_ff; -extern xcpuop_func op_3079_0_nf; -extern xcpuop_func op_3079_0_ff; -extern xcpuop_func op_307a_0_nf; -extern xcpuop_func op_307a_0_ff; -extern xcpuop_func op_307b_0_nf; -extern xcpuop_func op_307b_0_ff; -extern xcpuop_func op_307c_0_nf; -extern xcpuop_func op_307c_0_ff; -extern xcpuop_func op_3080_0_nf; -extern xcpuop_func op_3080_0_ff; -extern xcpuop_func op_3088_0_nf; -extern xcpuop_func op_3088_0_ff; -extern xcpuop_func op_3090_0_nf; -extern xcpuop_func op_3090_0_ff; -extern xcpuop_func op_3098_0_nf; -extern xcpuop_func op_3098_0_ff; -extern xcpuop_func op_30a0_0_nf; -extern xcpuop_func op_30a0_0_ff; -extern xcpuop_func op_30a8_0_nf; -extern xcpuop_func op_30a8_0_ff; -extern xcpuop_func op_30b0_0_nf; -extern xcpuop_func op_30b0_0_ff; -extern xcpuop_func op_30b8_0_nf; -extern xcpuop_func op_30b8_0_ff; -extern xcpuop_func op_30b9_0_nf; -extern xcpuop_func op_30b9_0_ff; -extern xcpuop_func op_30ba_0_nf; -extern xcpuop_func op_30ba_0_ff; -extern xcpuop_func op_30bb_0_nf; -extern xcpuop_func op_30bb_0_ff; -extern xcpuop_func op_30bc_0_nf; -extern xcpuop_func op_30bc_0_ff; -extern xcpuop_func op_30c0_0_nf; -extern xcpuop_func op_30c0_0_ff; -extern xcpuop_func op_30c8_0_nf; -extern xcpuop_func op_30c8_0_ff; -extern xcpuop_func op_30d0_0_nf; -extern xcpuop_func op_30d0_0_ff; -extern xcpuop_func op_30d8_0_nf; -extern xcpuop_func op_30d8_0_ff; -extern xcpuop_func op_30e0_0_nf; -extern xcpuop_func op_30e0_0_ff; -extern xcpuop_func op_30e8_0_nf; -extern xcpuop_func op_30e8_0_ff; -extern xcpuop_func op_30f0_0_nf; -extern xcpuop_func op_30f0_0_ff; -extern xcpuop_func op_30f8_0_nf; -extern xcpuop_func op_30f8_0_ff; -extern xcpuop_func op_30f9_0_nf; -extern xcpuop_func op_30f9_0_ff; -extern xcpuop_func op_30fa_0_nf; -extern xcpuop_func op_30fa_0_ff; -extern xcpuop_func op_30fb_0_nf; -extern xcpuop_func op_30fb_0_ff; -extern xcpuop_func op_30fc_0_nf; -extern xcpuop_func op_30fc_0_ff; -extern xcpuop_func op_3100_0_nf; -extern xcpuop_func op_3100_0_ff; -extern xcpuop_func op_3108_0_nf; -extern xcpuop_func op_3108_0_ff; -extern xcpuop_func op_3110_0_nf; -extern xcpuop_func op_3110_0_ff; -extern xcpuop_func op_3118_0_nf; -extern xcpuop_func op_3118_0_ff; -extern xcpuop_func op_3120_0_nf; -extern xcpuop_func op_3120_0_ff; -extern xcpuop_func op_3128_0_nf; -extern xcpuop_func op_3128_0_ff; -extern xcpuop_func op_3130_0_nf; -extern xcpuop_func op_3130_0_ff; -extern xcpuop_func op_3138_0_nf; -extern xcpuop_func op_3138_0_ff; -extern xcpuop_func op_3139_0_nf; -extern xcpuop_func op_3139_0_ff; -extern xcpuop_func op_313a_0_nf; -extern xcpuop_func op_313a_0_ff; -extern xcpuop_func op_313b_0_nf; -extern xcpuop_func op_313b_0_ff; -extern xcpuop_func op_313c_0_nf; -extern xcpuop_func op_313c_0_ff; -extern xcpuop_func op_3140_0_nf; -extern xcpuop_func op_3140_0_ff; -extern xcpuop_func op_3148_0_nf; -extern xcpuop_func op_3148_0_ff; -extern xcpuop_func op_3150_0_nf; -extern xcpuop_func op_3150_0_ff; -extern xcpuop_func op_3158_0_nf; -extern xcpuop_func op_3158_0_ff; -extern xcpuop_func op_3160_0_nf; -extern xcpuop_func op_3160_0_ff; -extern xcpuop_func op_3168_0_nf; -extern xcpuop_func op_3168_0_ff; -extern xcpuop_func op_3170_0_nf; -extern xcpuop_func op_3170_0_ff; -extern xcpuop_func op_3178_0_nf; -extern xcpuop_func op_3178_0_ff; -extern xcpuop_func op_3179_0_nf; -extern xcpuop_func op_3179_0_ff; -extern xcpuop_func op_317a_0_nf; -extern xcpuop_func op_317a_0_ff; -extern xcpuop_func op_317b_0_nf; -extern xcpuop_func op_317b_0_ff; -extern xcpuop_func op_317c_0_nf; -extern xcpuop_func op_317c_0_ff; -extern xcpuop_func op_3180_0_nf; -extern xcpuop_func op_3180_0_ff; -extern xcpuop_func op_3188_0_nf; -extern xcpuop_func op_3188_0_ff; -extern xcpuop_func op_3190_0_nf; -extern xcpuop_func op_3190_0_ff; -extern xcpuop_func op_3198_0_nf; -extern xcpuop_func op_3198_0_ff; -extern xcpuop_func op_31a0_0_nf; -extern xcpuop_func op_31a0_0_ff; -extern xcpuop_func op_31a8_0_nf; -extern xcpuop_func op_31a8_0_ff; -extern xcpuop_func op_31b0_0_nf; -extern xcpuop_func op_31b0_0_ff; -extern xcpuop_func op_31b8_0_nf; -extern xcpuop_func op_31b8_0_ff; -extern xcpuop_func op_31b9_0_nf; -extern xcpuop_func op_31b9_0_ff; -extern xcpuop_func op_31ba_0_nf; -extern xcpuop_func op_31ba_0_ff; -extern xcpuop_func op_31bb_0_nf; -extern xcpuop_func op_31bb_0_ff; -extern xcpuop_func op_31bc_0_nf; -extern xcpuop_func op_31bc_0_ff; -extern xcpuop_func op_31c0_0_nf; -extern xcpuop_func op_31c0_0_ff; -extern xcpuop_func op_31c8_0_nf; -extern xcpuop_func op_31c8_0_ff; -extern xcpuop_func op_31d0_0_nf; -extern xcpuop_func op_31d0_0_ff; -extern xcpuop_func op_31d8_0_nf; -extern xcpuop_func op_31d8_0_ff; -extern xcpuop_func op_31e0_0_nf; -extern xcpuop_func op_31e0_0_ff; -extern xcpuop_func op_31e8_0_nf; -extern xcpuop_func op_31e8_0_ff; -extern xcpuop_func op_31f0_0_nf; -extern xcpuop_func op_31f0_0_ff; -extern xcpuop_func op_31f8_0_nf; -extern xcpuop_func op_31f8_0_ff; -extern xcpuop_func op_31f9_0_nf; -extern xcpuop_func op_31f9_0_ff; -extern xcpuop_func op_31fa_0_nf; -extern xcpuop_func op_31fa_0_ff; -extern xcpuop_func op_31fb_0_nf; -extern xcpuop_func op_31fb_0_ff; -extern xcpuop_func op_31fc_0_nf; -extern xcpuop_func op_31fc_0_ff; -extern xcpuop_func op_33c0_0_nf; -extern xcpuop_func op_33c0_0_ff; -extern xcpuop_func op_33c8_0_nf; -extern xcpuop_func op_33c8_0_ff; -extern xcpuop_func op_33d0_0_nf; -extern xcpuop_func op_33d0_0_ff; -extern xcpuop_func op_33d8_0_nf; -extern xcpuop_func op_33d8_0_ff; -extern xcpuop_func op_33e0_0_nf; -extern xcpuop_func op_33e0_0_ff; -extern xcpuop_func op_33e8_0_nf; -extern xcpuop_func op_33e8_0_ff; -extern xcpuop_func op_33f0_0_nf; -extern xcpuop_func op_33f0_0_ff; -extern xcpuop_func op_33f8_0_nf; -extern xcpuop_func op_33f8_0_ff; -extern xcpuop_func op_33f9_0_nf; -extern xcpuop_func op_33f9_0_ff; -extern xcpuop_func op_33fa_0_nf; -extern xcpuop_func op_33fa_0_ff; -extern xcpuop_func op_33fb_0_nf; -extern xcpuop_func op_33fb_0_ff; -extern xcpuop_func op_33fc_0_nf; -extern xcpuop_func op_33fc_0_ff; -extern xcpuop_func op_4000_0_nf; -extern xcpuop_func op_4000_0_ff; -extern xcpuop_func op_4010_0_nf; -extern xcpuop_func op_4010_0_ff; -extern xcpuop_func op_4018_0_nf; -extern xcpuop_func op_4018_0_ff; -extern xcpuop_func op_4020_0_nf; -extern xcpuop_func op_4020_0_ff; -extern xcpuop_func op_4028_0_nf; -extern xcpuop_func op_4028_0_ff; -extern xcpuop_func op_4030_0_nf; -extern xcpuop_func op_4030_0_ff; -extern xcpuop_func op_4038_0_nf; -extern xcpuop_func op_4038_0_ff; -extern xcpuop_func op_4039_0_nf; -extern xcpuop_func op_4039_0_ff; -extern xcpuop_func op_4040_0_nf; -extern xcpuop_func op_4040_0_ff; -extern xcpuop_func op_4050_0_nf; -extern xcpuop_func op_4050_0_ff; -extern xcpuop_func op_4058_0_nf; -extern xcpuop_func op_4058_0_ff; -extern xcpuop_func op_4060_0_nf; -extern xcpuop_func op_4060_0_ff; -extern xcpuop_func op_4068_0_nf; -extern xcpuop_func op_4068_0_ff; -extern xcpuop_func op_4070_0_nf; -extern xcpuop_func op_4070_0_ff; -extern xcpuop_func op_4078_0_nf; -extern xcpuop_func op_4078_0_ff; -extern xcpuop_func op_4079_0_nf; -extern xcpuop_func op_4079_0_ff; -extern xcpuop_func op_4080_0_nf; -extern xcpuop_func op_4080_0_ff; -extern xcpuop_func op_4090_0_nf; -extern xcpuop_func op_4090_0_ff; -extern xcpuop_func op_4098_0_nf; -extern xcpuop_func op_4098_0_ff; -extern xcpuop_func op_40a0_0_nf; -extern xcpuop_func op_40a0_0_ff; -extern xcpuop_func op_40a8_0_nf; -extern xcpuop_func op_40a8_0_ff; -extern xcpuop_func op_40b0_0_nf; -extern xcpuop_func op_40b0_0_ff; -extern xcpuop_func op_40b8_0_nf; -extern xcpuop_func op_40b8_0_ff; -extern xcpuop_func op_40b9_0_nf; -extern xcpuop_func op_40b9_0_ff; -extern xcpuop_func op_40c0_0_nf; -extern xcpuop_func op_40c0_0_ff; -extern xcpuop_func op_40d0_0_nf; -extern xcpuop_func op_40d0_0_ff; -extern xcpuop_func op_40d8_0_nf; -extern xcpuop_func op_40d8_0_ff; -extern xcpuop_func op_40e0_0_nf; -extern xcpuop_func op_40e0_0_ff; -extern xcpuop_func op_40e8_0_nf; -extern xcpuop_func op_40e8_0_ff; -extern xcpuop_func op_40f0_0_nf; -extern xcpuop_func op_40f0_0_ff; -extern xcpuop_func op_40f8_0_nf; -extern xcpuop_func op_40f8_0_ff; -extern xcpuop_func op_40f9_0_nf; -extern xcpuop_func op_40f9_0_ff; -extern xcpuop_func op_4100_0_nf; -extern xcpuop_func op_4100_0_ff; -extern xcpuop_func op_4110_0_nf; -extern xcpuop_func op_4110_0_ff; -extern xcpuop_func op_4118_0_nf; -extern xcpuop_func op_4118_0_ff; -extern xcpuop_func op_4120_0_nf; -extern xcpuop_func op_4120_0_ff; -extern xcpuop_func op_4128_0_nf; -extern xcpuop_func op_4128_0_ff; -extern xcpuop_func op_4130_0_nf; -extern xcpuop_func op_4130_0_ff; -extern xcpuop_func op_4138_0_nf; -extern xcpuop_func op_4138_0_ff; -extern xcpuop_func op_4139_0_nf; -extern xcpuop_func op_4139_0_ff; -extern xcpuop_func op_413a_0_nf; -extern xcpuop_func op_413a_0_ff; -extern xcpuop_func op_413b_0_nf; -extern xcpuop_func op_413b_0_ff; -extern xcpuop_func op_413c_0_nf; -extern xcpuop_func op_413c_0_ff; -extern xcpuop_func op_4180_0_nf; -extern xcpuop_func op_4180_0_ff; -extern xcpuop_func op_4190_0_nf; -extern xcpuop_func op_4190_0_ff; -extern xcpuop_func op_4198_0_nf; -extern xcpuop_func op_4198_0_ff; -extern xcpuop_func op_41a0_0_nf; -extern xcpuop_func op_41a0_0_ff; -extern xcpuop_func op_41a8_0_nf; -extern xcpuop_func op_41a8_0_ff; -extern xcpuop_func op_41b0_0_nf; -extern xcpuop_func op_41b0_0_ff; -extern xcpuop_func op_41b8_0_nf; -extern xcpuop_func op_41b8_0_ff; -extern xcpuop_func op_41b9_0_nf; -extern xcpuop_func op_41b9_0_ff; -extern xcpuop_func op_41ba_0_nf; -extern xcpuop_func op_41ba_0_ff; -extern xcpuop_func op_41bb_0_nf; -extern xcpuop_func op_41bb_0_ff; -extern xcpuop_func op_41bc_0_nf; -extern xcpuop_func op_41bc_0_ff; -extern xcpuop_func op_41d0_0_nf; -extern xcpuop_func op_41d0_0_ff; -extern xcpuop_func op_41e8_0_nf; -extern xcpuop_func op_41e8_0_ff; -extern xcpuop_func op_41f0_0_nf; -extern xcpuop_func op_41f0_0_ff; -extern xcpuop_func op_41f8_0_nf; -extern xcpuop_func op_41f8_0_ff; -extern xcpuop_func op_41f9_0_nf; -extern xcpuop_func op_41f9_0_ff; -extern xcpuop_func op_41fa_0_nf; -extern xcpuop_func op_41fa_0_ff; -extern xcpuop_func op_41fb_0_nf; -extern xcpuop_func op_41fb_0_ff; -extern xcpuop_func op_4200_0_nf; -extern xcpuop_func op_4200_0_ff; -extern xcpuop_func op_4210_0_nf; -extern xcpuop_func op_4210_0_ff; -extern xcpuop_func op_4218_0_nf; -extern xcpuop_func op_4218_0_ff; -extern xcpuop_func op_4220_0_nf; -extern xcpuop_func op_4220_0_ff; -extern xcpuop_func op_4228_0_nf; -extern xcpuop_func op_4228_0_ff; -extern xcpuop_func op_4230_0_nf; -extern xcpuop_func op_4230_0_ff; -extern xcpuop_func op_4238_0_nf; -extern xcpuop_func op_4238_0_ff; -extern xcpuop_func op_4239_0_nf; -extern xcpuop_func op_4239_0_ff; -extern xcpuop_func op_4240_0_nf; -extern xcpuop_func op_4240_0_ff; -extern xcpuop_func op_4250_0_nf; -extern xcpuop_func op_4250_0_ff; -extern xcpuop_func op_4258_0_nf; -extern xcpuop_func op_4258_0_ff; -extern xcpuop_func op_4260_0_nf; -extern xcpuop_func op_4260_0_ff; -extern xcpuop_func op_4268_0_nf; -extern xcpuop_func op_4268_0_ff; -extern xcpuop_func op_4270_0_nf; -extern xcpuop_func op_4270_0_ff; -extern xcpuop_func op_4278_0_nf; -extern xcpuop_func op_4278_0_ff; -extern xcpuop_func op_4279_0_nf; -extern xcpuop_func op_4279_0_ff; -extern xcpuop_func op_4280_0_nf; -extern xcpuop_func op_4280_0_ff; -extern xcpuop_func op_4290_0_nf; -extern xcpuop_func op_4290_0_ff; -extern xcpuop_func op_4298_0_nf; -extern xcpuop_func op_4298_0_ff; -extern xcpuop_func op_42a0_0_nf; -extern xcpuop_func op_42a0_0_ff; -extern xcpuop_func op_42a8_0_nf; -extern xcpuop_func op_42a8_0_ff; -extern xcpuop_func op_42b0_0_nf; -extern xcpuop_func op_42b0_0_ff; -extern xcpuop_func op_42b8_0_nf; -extern xcpuop_func op_42b8_0_ff; -extern xcpuop_func op_42b9_0_nf; -extern xcpuop_func op_42b9_0_ff; -extern xcpuop_func op_42c0_0_nf; -extern xcpuop_func op_42c0_0_ff; -extern xcpuop_func op_42d0_0_nf; -extern xcpuop_func op_42d0_0_ff; -extern xcpuop_func op_42d8_0_nf; -extern xcpuop_func op_42d8_0_ff; -extern xcpuop_func op_42e0_0_nf; -extern xcpuop_func op_42e0_0_ff; -extern xcpuop_func op_42e8_0_nf; -extern xcpuop_func op_42e8_0_ff; -extern xcpuop_func op_42f0_0_nf; -extern xcpuop_func op_42f0_0_ff; -extern xcpuop_func op_42f8_0_nf; -extern xcpuop_func op_42f8_0_ff; -extern xcpuop_func op_42f9_0_nf; -extern xcpuop_func op_42f9_0_ff; -extern xcpuop_func op_4400_0_nf; -extern xcpuop_func op_4400_0_ff; -extern xcpuop_func op_4410_0_nf; -extern xcpuop_func op_4410_0_ff; -extern xcpuop_func op_4418_0_nf; -extern xcpuop_func op_4418_0_ff; -extern xcpuop_func op_4420_0_nf; -extern xcpuop_func op_4420_0_ff; -extern xcpuop_func op_4428_0_nf; -extern xcpuop_func op_4428_0_ff; -extern xcpuop_func op_4430_0_nf; -extern xcpuop_func op_4430_0_ff; -extern xcpuop_func op_4438_0_nf; -extern xcpuop_func op_4438_0_ff; -extern xcpuop_func op_4439_0_nf; -extern xcpuop_func op_4439_0_ff; -extern xcpuop_func op_4440_0_nf; -extern xcpuop_func op_4440_0_ff; -extern xcpuop_func op_4450_0_nf; -extern xcpuop_func op_4450_0_ff; -extern xcpuop_func op_4458_0_nf; -extern xcpuop_func op_4458_0_ff; -extern xcpuop_func op_4460_0_nf; -extern xcpuop_func op_4460_0_ff; -extern xcpuop_func op_4468_0_nf; -extern xcpuop_func op_4468_0_ff; -extern xcpuop_func op_4470_0_nf; -extern xcpuop_func op_4470_0_ff; -extern xcpuop_func op_4478_0_nf; -extern xcpuop_func op_4478_0_ff; -extern xcpuop_func op_4479_0_nf; -extern xcpuop_func op_4479_0_ff; -extern xcpuop_func op_4480_0_nf; -extern xcpuop_func op_4480_0_ff; -extern xcpuop_func op_4490_0_nf; -extern xcpuop_func op_4490_0_ff; -extern xcpuop_func op_4498_0_nf; -extern xcpuop_func op_4498_0_ff; -extern xcpuop_func op_44a0_0_nf; -extern xcpuop_func op_44a0_0_ff; -extern xcpuop_func op_44a8_0_nf; -extern xcpuop_func op_44a8_0_ff; -extern xcpuop_func op_44b0_0_nf; -extern xcpuop_func op_44b0_0_ff; -extern xcpuop_func op_44b8_0_nf; -extern xcpuop_func op_44b8_0_ff; -extern xcpuop_func op_44b9_0_nf; -extern xcpuop_func op_44b9_0_ff; -extern xcpuop_func op_44c0_0_nf; -extern xcpuop_func op_44c0_0_ff; -extern xcpuop_func op_44d0_0_nf; -extern xcpuop_func op_44d0_0_ff; -extern xcpuop_func op_44d8_0_nf; -extern xcpuop_func op_44d8_0_ff; -extern xcpuop_func op_44e0_0_nf; -extern xcpuop_func op_44e0_0_ff; -extern xcpuop_func op_44e8_0_nf; -extern xcpuop_func op_44e8_0_ff; -extern xcpuop_func op_44f0_0_nf; -extern xcpuop_func op_44f0_0_ff; -extern xcpuop_func op_44f8_0_nf; -extern xcpuop_func op_44f8_0_ff; -extern xcpuop_func op_44f9_0_nf; -extern xcpuop_func op_44f9_0_ff; -extern xcpuop_func op_44fa_0_nf; -extern xcpuop_func op_44fa_0_ff; -extern xcpuop_func op_44fb_0_nf; -extern xcpuop_func op_44fb_0_ff; -extern xcpuop_func op_44fc_0_nf; -extern xcpuop_func op_44fc_0_ff; -extern xcpuop_func op_4600_0_nf; -extern xcpuop_func op_4600_0_ff; -extern xcpuop_func op_4610_0_nf; -extern xcpuop_func op_4610_0_ff; -extern xcpuop_func op_4618_0_nf; -extern xcpuop_func op_4618_0_ff; -extern xcpuop_func op_4620_0_nf; -extern xcpuop_func op_4620_0_ff; -extern xcpuop_func op_4628_0_nf; -extern xcpuop_func op_4628_0_ff; -extern xcpuop_func op_4630_0_nf; -extern xcpuop_func op_4630_0_ff; -extern xcpuop_func op_4638_0_nf; -extern xcpuop_func op_4638_0_ff; -extern xcpuop_func op_4639_0_nf; -extern xcpuop_func op_4639_0_ff; -extern xcpuop_func op_4640_0_nf; -extern xcpuop_func op_4640_0_ff; -extern xcpuop_func op_4650_0_nf; -extern xcpuop_func op_4650_0_ff; -extern xcpuop_func op_4658_0_nf; -extern xcpuop_func op_4658_0_ff; -extern xcpuop_func op_4660_0_nf; -extern xcpuop_func op_4660_0_ff; -extern xcpuop_func op_4668_0_nf; -extern xcpuop_func op_4668_0_ff; -extern xcpuop_func op_4670_0_nf; -extern xcpuop_func op_4670_0_ff; -extern xcpuop_func op_4678_0_nf; -extern xcpuop_func op_4678_0_ff; -extern xcpuop_func op_4679_0_nf; -extern xcpuop_func op_4679_0_ff; -extern xcpuop_func op_4680_0_nf; -extern xcpuop_func op_4680_0_ff; -extern xcpuop_func op_4690_0_nf; -extern xcpuop_func op_4690_0_ff; -extern xcpuop_func op_4698_0_nf; -extern xcpuop_func op_4698_0_ff; -extern xcpuop_func op_46a0_0_nf; -extern xcpuop_func op_46a0_0_ff; -extern xcpuop_func op_46a8_0_nf; -extern xcpuop_func op_46a8_0_ff; -extern xcpuop_func op_46b0_0_nf; -extern xcpuop_func op_46b0_0_ff; -extern xcpuop_func op_46b8_0_nf; -extern xcpuop_func op_46b8_0_ff; -extern xcpuop_func op_46b9_0_nf; -extern xcpuop_func op_46b9_0_ff; -extern xcpuop_func op_46c0_0_nf; -extern xcpuop_func op_46c0_0_ff; -extern xcpuop_func op_46d0_0_nf; -extern xcpuop_func op_46d0_0_ff; -extern xcpuop_func op_46d8_0_nf; -extern xcpuop_func op_46d8_0_ff; -extern xcpuop_func op_46e0_0_nf; -extern xcpuop_func op_46e0_0_ff; -extern xcpuop_func op_46e8_0_nf; -extern xcpuop_func op_46e8_0_ff; -extern xcpuop_func op_46f0_0_nf; -extern xcpuop_func op_46f0_0_ff; -extern xcpuop_func op_46f8_0_nf; -extern xcpuop_func op_46f8_0_ff; -extern xcpuop_func op_46f9_0_nf; -extern xcpuop_func op_46f9_0_ff; -extern xcpuop_func op_46fa_0_nf; -extern xcpuop_func op_46fa_0_ff; -extern xcpuop_func op_46fb_0_nf; -extern xcpuop_func op_46fb_0_ff; -extern xcpuop_func op_46fc_0_nf; -extern xcpuop_func op_46fc_0_ff; -extern xcpuop_func op_4800_0_nf; -extern xcpuop_func op_4800_0_ff; -extern xcpuop_func op_4808_0_nf; -extern xcpuop_func op_4808_0_ff; -extern xcpuop_func op_4810_0_nf; -extern xcpuop_func op_4810_0_ff; -extern xcpuop_func op_4818_0_nf; -extern xcpuop_func op_4818_0_ff; -extern xcpuop_func op_4820_0_nf; -extern xcpuop_func op_4820_0_ff; -extern xcpuop_func op_4828_0_nf; -extern xcpuop_func op_4828_0_ff; -extern xcpuop_func op_4830_0_nf; -extern xcpuop_func op_4830_0_ff; -extern xcpuop_func op_4838_0_nf; -extern xcpuop_func op_4838_0_ff; -extern xcpuop_func op_4839_0_nf; -extern xcpuop_func op_4839_0_ff; -extern xcpuop_func op_4840_0_nf; -extern xcpuop_func op_4840_0_ff; -extern xcpuop_func op_4848_0_nf; -extern xcpuop_func op_4848_0_ff; -extern xcpuop_func op_4850_0_nf; -extern xcpuop_func op_4850_0_ff; -extern xcpuop_func op_4868_0_nf; -extern xcpuop_func op_4868_0_ff; -extern xcpuop_func op_4870_0_nf; -extern xcpuop_func op_4870_0_ff; -extern xcpuop_func op_4878_0_nf; -extern xcpuop_func op_4878_0_ff; -extern xcpuop_func op_4879_0_nf; -extern xcpuop_func op_4879_0_ff; -extern xcpuop_func op_487a_0_nf; -extern xcpuop_func op_487a_0_ff; -extern xcpuop_func op_487b_0_nf; -extern xcpuop_func op_487b_0_ff; -extern xcpuop_func op_4880_0_nf; -extern xcpuop_func op_4880_0_ff; -extern xcpuop_func op_4890_0_nf; -extern xcpuop_func op_4890_0_ff; -extern xcpuop_func op_48a0_0_nf; -extern xcpuop_func op_48a0_0_ff; -extern xcpuop_func op_48a8_0_nf; -extern xcpuop_func op_48a8_0_ff; -extern xcpuop_func op_48b0_0_nf; -extern xcpuop_func op_48b0_0_ff; -extern xcpuop_func op_48b8_0_nf; -extern xcpuop_func op_48b8_0_ff; -extern xcpuop_func op_48b9_0_nf; -extern xcpuop_func op_48b9_0_ff; -extern xcpuop_func op_48c0_0_nf; -extern xcpuop_func op_48c0_0_ff; -extern xcpuop_func op_48d0_0_nf; -extern xcpuop_func op_48d0_0_ff; -extern xcpuop_func op_48e0_0_nf; -extern xcpuop_func op_48e0_0_ff; -extern xcpuop_func op_48e8_0_nf; -extern xcpuop_func op_48e8_0_ff; -extern xcpuop_func op_48f0_0_nf; -extern xcpuop_func op_48f0_0_ff; -extern xcpuop_func op_48f8_0_nf; -extern xcpuop_func op_48f8_0_ff; -extern xcpuop_func op_48f9_0_nf; -extern xcpuop_func op_48f9_0_ff; -extern xcpuop_func op_49c0_0_nf; -extern xcpuop_func op_49c0_0_ff; -extern xcpuop_func op_4a00_0_nf; -extern xcpuop_func op_4a00_0_ff; -extern xcpuop_func op_4a10_0_nf; -extern xcpuop_func op_4a10_0_ff; -extern xcpuop_func op_4a18_0_nf; -extern xcpuop_func op_4a18_0_ff; -extern xcpuop_func op_4a20_0_nf; -extern xcpuop_func op_4a20_0_ff; -extern xcpuop_func op_4a28_0_nf; -extern xcpuop_func op_4a28_0_ff; -extern xcpuop_func op_4a30_0_nf; -extern xcpuop_func op_4a30_0_ff; -extern xcpuop_func op_4a38_0_nf; -extern xcpuop_func op_4a38_0_ff; -extern xcpuop_func op_4a39_0_nf; -extern xcpuop_func op_4a39_0_ff; -extern xcpuop_func op_4a3a_0_nf; -extern xcpuop_func op_4a3a_0_ff; -extern xcpuop_func op_4a3b_0_nf; -extern xcpuop_func op_4a3b_0_ff; -extern xcpuop_func op_4a3c_0_nf; -extern xcpuop_func op_4a3c_0_ff; -extern xcpuop_func op_4a40_0_nf; -extern xcpuop_func op_4a40_0_ff; -extern xcpuop_func op_4a48_0_nf; -extern xcpuop_func op_4a48_0_ff; -extern xcpuop_func op_4a50_0_nf; -extern xcpuop_func op_4a50_0_ff; -extern xcpuop_func op_4a58_0_nf; -extern xcpuop_func op_4a58_0_ff; -extern xcpuop_func op_4a60_0_nf; -extern xcpuop_func op_4a60_0_ff; -extern xcpuop_func op_4a68_0_nf; -extern xcpuop_func op_4a68_0_ff; -extern xcpuop_func op_4a70_0_nf; -extern xcpuop_func op_4a70_0_ff; -extern xcpuop_func op_4a78_0_nf; -extern xcpuop_func op_4a78_0_ff; -extern xcpuop_func op_4a79_0_nf; -extern xcpuop_func op_4a79_0_ff; -extern xcpuop_func op_4a7a_0_nf; -extern xcpuop_func op_4a7a_0_ff; -extern xcpuop_func op_4a7b_0_nf; -extern xcpuop_func op_4a7b_0_ff; -extern xcpuop_func op_4a7c_0_nf; -extern xcpuop_func op_4a7c_0_ff; -extern xcpuop_func op_4a80_0_nf; -extern xcpuop_func op_4a80_0_ff; -extern xcpuop_func op_4a88_0_nf; -extern xcpuop_func op_4a88_0_ff; -extern xcpuop_func op_4a90_0_nf; -extern xcpuop_func op_4a90_0_ff; -extern xcpuop_func op_4a98_0_nf; -extern xcpuop_func op_4a98_0_ff; -extern xcpuop_func op_4aa0_0_nf; -extern xcpuop_func op_4aa0_0_ff; -extern xcpuop_func op_4aa8_0_nf; -extern xcpuop_func op_4aa8_0_ff; -extern xcpuop_func op_4ab0_0_nf; -extern xcpuop_func op_4ab0_0_ff; -extern xcpuop_func op_4ab8_0_nf; -extern xcpuop_func op_4ab8_0_ff; -extern xcpuop_func op_4ab9_0_nf; -extern xcpuop_func op_4ab9_0_ff; -extern xcpuop_func op_4aba_0_nf; -extern xcpuop_func op_4aba_0_ff; -extern xcpuop_func op_4abb_0_nf; -extern xcpuop_func op_4abb_0_ff; -extern xcpuop_func op_4abc_0_nf; -extern xcpuop_func op_4abc_0_ff; -extern xcpuop_func op_4ac0_0_nf; -extern xcpuop_func op_4ac0_0_ff; -extern xcpuop_func op_4ad0_0_nf; -extern xcpuop_func op_4ad0_0_ff; -extern xcpuop_func op_4ad8_0_nf; -extern xcpuop_func op_4ad8_0_ff; -extern xcpuop_func op_4ae0_0_nf; -extern xcpuop_func op_4ae0_0_ff; -extern xcpuop_func op_4ae8_0_nf; -extern xcpuop_func op_4ae8_0_ff; -extern xcpuop_func op_4af0_0_nf; -extern xcpuop_func op_4af0_0_ff; -extern xcpuop_func op_4af8_0_nf; -extern xcpuop_func op_4af8_0_ff; -extern xcpuop_func op_4af9_0_nf; -extern xcpuop_func op_4af9_0_ff; -extern xcpuop_func op_4c00_0_nf; -extern xcpuop_func op_4c00_0_ff; -extern xcpuop_func op_4c10_0_nf; -extern xcpuop_func op_4c10_0_ff; -extern xcpuop_func op_4c18_0_nf; -extern xcpuop_func op_4c18_0_ff; -extern xcpuop_func op_4c20_0_nf; -extern xcpuop_func op_4c20_0_ff; -extern xcpuop_func op_4c28_0_nf; -extern xcpuop_func op_4c28_0_ff; -extern xcpuop_func op_4c30_0_nf; -extern xcpuop_func op_4c30_0_ff; -extern xcpuop_func op_4c38_0_nf; -extern xcpuop_func op_4c38_0_ff; -extern xcpuop_func op_4c39_0_nf; -extern xcpuop_func op_4c39_0_ff; -extern xcpuop_func op_4c3a_0_nf; -extern xcpuop_func op_4c3a_0_ff; -extern xcpuop_func op_4c3b_0_nf; -extern xcpuop_func op_4c3b_0_ff; -extern xcpuop_func op_4c3c_0_nf; -extern xcpuop_func op_4c3c_0_ff; -extern xcpuop_func op_4c40_0_nf; -extern xcpuop_func op_4c40_0_ff; -extern xcpuop_func op_4c50_0_nf; -extern xcpuop_func op_4c50_0_ff; -extern xcpuop_func op_4c58_0_nf; -extern xcpuop_func op_4c58_0_ff; -extern xcpuop_func op_4c60_0_nf; -extern xcpuop_func op_4c60_0_ff; -extern xcpuop_func op_4c68_0_nf; -extern xcpuop_func op_4c68_0_ff; -extern xcpuop_func op_4c70_0_nf; -extern xcpuop_func op_4c70_0_ff; -extern xcpuop_func op_4c78_0_nf; -extern xcpuop_func op_4c78_0_ff; -extern xcpuop_func op_4c79_0_nf; -extern xcpuop_func op_4c79_0_ff; -extern xcpuop_func op_4c7a_0_nf; -extern xcpuop_func op_4c7a_0_ff; -extern xcpuop_func op_4c7b_0_nf; -extern xcpuop_func op_4c7b_0_ff; -extern xcpuop_func op_4c7c_0_nf; -extern xcpuop_func op_4c7c_0_ff; -extern xcpuop_func op_4c90_0_nf; -extern xcpuop_func op_4c90_0_ff; -extern xcpuop_func op_4c98_0_nf; -extern xcpuop_func op_4c98_0_ff; -extern xcpuop_func op_4ca8_0_nf; -extern xcpuop_func op_4ca8_0_ff; -extern xcpuop_func op_4cb0_0_nf; -extern xcpuop_func op_4cb0_0_ff; -extern xcpuop_func op_4cb8_0_nf; -extern xcpuop_func op_4cb8_0_ff; -extern xcpuop_func op_4cb9_0_nf; -extern xcpuop_func op_4cb9_0_ff; -extern xcpuop_func op_4cba_0_nf; -extern xcpuop_func op_4cba_0_ff; -extern xcpuop_func op_4cbb_0_nf; -extern xcpuop_func op_4cbb_0_ff; -extern xcpuop_func op_4cd0_0_nf; -extern xcpuop_func op_4cd0_0_ff; -extern xcpuop_func op_4cd8_0_nf; -extern xcpuop_func op_4cd8_0_ff; -extern xcpuop_func op_4ce8_0_nf; -extern xcpuop_func op_4ce8_0_ff; -extern xcpuop_func op_4cf0_0_nf; -extern xcpuop_func op_4cf0_0_ff; -extern xcpuop_func op_4cf8_0_nf; -extern xcpuop_func op_4cf8_0_ff; -extern xcpuop_func op_4cf9_0_nf; -extern xcpuop_func op_4cf9_0_ff; -extern xcpuop_func op_4cfa_0_nf; -extern xcpuop_func op_4cfa_0_ff; -extern xcpuop_func op_4cfb_0_nf; -extern xcpuop_func op_4cfb_0_ff; -extern xcpuop_func op_4e40_0_nf; -extern xcpuop_func op_4e40_0_ff; -extern xcpuop_func op_4e50_0_nf; -extern xcpuop_func op_4e50_0_ff; -extern xcpuop_func op_4e58_0_nf; -extern xcpuop_func op_4e58_0_ff; -extern xcpuop_func op_4e60_0_nf; -extern xcpuop_func op_4e60_0_ff; -extern xcpuop_func op_4e68_0_nf; -extern xcpuop_func op_4e68_0_ff; -extern xcpuop_func op_4e70_0_nf; -extern xcpuop_func op_4e70_0_ff; -extern xcpuop_func op_4e71_0_nf; -extern xcpuop_func op_4e71_0_ff; -extern xcpuop_func op_4e72_0_nf; -extern xcpuop_func op_4e72_0_ff; -extern xcpuop_func op_4e73_0_nf; -extern xcpuop_func op_4e73_0_ff; -extern xcpuop_func op_4e74_0_nf; -extern xcpuop_func op_4e74_0_ff; -extern xcpuop_func op_4e75_0_nf; -extern xcpuop_func op_4e75_0_ff; -extern xcpuop_func op_4e76_0_nf; -extern xcpuop_func op_4e76_0_ff; -extern xcpuop_func op_4e77_0_nf; -extern xcpuop_func op_4e77_0_ff; -extern xcpuop_func op_4e7a_0_nf; -extern xcpuop_func op_4e7a_0_ff; -extern xcpuop_func op_4e7b_0_nf; -extern xcpuop_func op_4e7b_0_ff; -extern xcpuop_func op_4e90_0_nf; -extern xcpuop_func op_4e90_0_ff; -extern xcpuop_func op_4ea8_0_nf; -extern xcpuop_func op_4ea8_0_ff; -extern xcpuop_func op_4eb0_0_nf; -extern xcpuop_func op_4eb0_0_ff; -extern xcpuop_func op_4eb8_0_nf; -extern xcpuop_func op_4eb8_0_ff; -extern xcpuop_func op_4eb9_0_nf; -extern xcpuop_func op_4eb9_0_ff; -extern xcpuop_func op_4eba_0_nf; -extern xcpuop_func op_4eba_0_ff; -extern xcpuop_func op_4ebb_0_nf; -extern xcpuop_func op_4ebb_0_ff; -extern xcpuop_func op_4ed0_0_nf; -extern xcpuop_func op_4ed0_0_ff; -extern xcpuop_func op_4ee8_0_nf; -extern xcpuop_func op_4ee8_0_ff; -extern xcpuop_func op_4ef0_0_nf; -extern xcpuop_func op_4ef0_0_ff; -extern xcpuop_func op_4ef8_0_nf; -extern xcpuop_func op_4ef8_0_ff; -extern xcpuop_func op_4ef9_0_nf; -extern xcpuop_func op_4ef9_0_ff; -extern xcpuop_func op_4efa_0_nf; -extern xcpuop_func op_4efa_0_ff; -extern xcpuop_func op_4efb_0_nf; -extern xcpuop_func op_4efb_0_ff; -extern xcpuop_func op_5000_0_nf; -extern xcpuop_func op_5000_0_ff; -extern xcpuop_func op_5010_0_nf; -extern xcpuop_func op_5010_0_ff; -extern xcpuop_func op_5018_0_nf; -extern xcpuop_func op_5018_0_ff; -extern xcpuop_func op_5020_0_nf; -extern xcpuop_func op_5020_0_ff; -extern xcpuop_func op_5028_0_nf; -extern xcpuop_func op_5028_0_ff; -extern xcpuop_func op_5030_0_nf; -extern xcpuop_func op_5030_0_ff; -extern xcpuop_func op_5038_0_nf; -extern xcpuop_func op_5038_0_ff; -extern xcpuop_func op_5039_0_nf; -extern xcpuop_func op_5039_0_ff; -extern xcpuop_func op_5040_0_nf; -extern xcpuop_func op_5040_0_ff; -extern xcpuop_func op_5048_0_nf; -extern xcpuop_func op_5048_0_ff; -extern xcpuop_func op_5050_0_nf; -extern xcpuop_func op_5050_0_ff; -extern xcpuop_func op_5058_0_nf; -extern xcpuop_func op_5058_0_ff; -extern xcpuop_func op_5060_0_nf; -extern xcpuop_func op_5060_0_ff; -extern xcpuop_func op_5068_0_nf; -extern xcpuop_func op_5068_0_ff; -extern xcpuop_func op_5070_0_nf; -extern xcpuop_func op_5070_0_ff; -extern xcpuop_func op_5078_0_nf; -extern xcpuop_func op_5078_0_ff; -extern xcpuop_func op_5079_0_nf; -extern xcpuop_func op_5079_0_ff; -extern xcpuop_func op_5080_0_nf; -extern xcpuop_func op_5080_0_ff; -extern xcpuop_func op_5088_0_nf; -extern xcpuop_func op_5088_0_ff; -extern xcpuop_func op_5090_0_nf; -extern xcpuop_func op_5090_0_ff; -extern xcpuop_func op_5098_0_nf; -extern xcpuop_func op_5098_0_ff; -extern xcpuop_func op_50a0_0_nf; -extern xcpuop_func op_50a0_0_ff; -extern xcpuop_func op_50a8_0_nf; -extern xcpuop_func op_50a8_0_ff; -extern xcpuop_func op_50b0_0_nf; -extern xcpuop_func op_50b0_0_ff; -extern xcpuop_func op_50b8_0_nf; -extern xcpuop_func op_50b8_0_ff; -extern xcpuop_func op_50b9_0_nf; -extern xcpuop_func op_50b9_0_ff; -extern xcpuop_func op_50c0_0_nf; -extern xcpuop_func op_50c0_0_ff; -extern xcpuop_func op_50c8_0_nf; -extern xcpuop_func op_50c8_0_ff; -extern xcpuop_func op_50d0_0_nf; -extern xcpuop_func op_50d0_0_ff; -extern xcpuop_func op_50d8_0_nf; -extern xcpuop_func op_50d8_0_ff; -extern xcpuop_func op_50e0_0_nf; -extern xcpuop_func op_50e0_0_ff; -extern xcpuop_func op_50e8_0_nf; -extern xcpuop_func op_50e8_0_ff; -extern xcpuop_func op_50f0_0_nf; -extern xcpuop_func op_50f0_0_ff; -extern xcpuop_func op_50f8_0_nf; -extern xcpuop_func op_50f8_0_ff; -extern xcpuop_func op_50f9_0_nf; -extern xcpuop_func op_50f9_0_ff; -extern xcpuop_func op_50fa_0_nf; -extern xcpuop_func op_50fa_0_ff; -extern xcpuop_func op_50fb_0_nf; -extern xcpuop_func op_50fb_0_ff; -extern xcpuop_func op_50fc_0_nf; -extern xcpuop_func op_50fc_0_ff; -extern xcpuop_func op_5100_0_nf; -extern xcpuop_func op_5100_0_ff; -extern xcpuop_func op_5110_0_nf; -extern xcpuop_func op_5110_0_ff; -extern xcpuop_func op_5118_0_nf; -extern xcpuop_func op_5118_0_ff; -extern xcpuop_func op_5120_0_nf; -extern xcpuop_func op_5120_0_ff; -extern xcpuop_func op_5128_0_nf; -extern xcpuop_func op_5128_0_ff; -extern xcpuop_func op_5130_0_nf; -extern xcpuop_func op_5130_0_ff; -extern xcpuop_func op_5138_0_nf; -extern xcpuop_func op_5138_0_ff; -extern xcpuop_func op_5139_0_nf; -extern xcpuop_func op_5139_0_ff; -extern xcpuop_func op_5140_0_nf; -extern xcpuop_func op_5140_0_ff; -extern xcpuop_func op_5148_0_nf; -extern xcpuop_func op_5148_0_ff; -extern xcpuop_func op_5150_0_nf; -extern xcpuop_func op_5150_0_ff; -extern xcpuop_func op_5158_0_nf; -extern xcpuop_func op_5158_0_ff; -extern xcpuop_func op_5160_0_nf; -extern xcpuop_func op_5160_0_ff; -extern xcpuop_func op_5168_0_nf; -extern xcpuop_func op_5168_0_ff; -extern xcpuop_func op_5170_0_nf; -extern xcpuop_func op_5170_0_ff; -extern xcpuop_func op_5178_0_nf; -extern xcpuop_func op_5178_0_ff; -extern xcpuop_func op_5179_0_nf; -extern xcpuop_func op_5179_0_ff; -extern xcpuop_func op_5180_0_nf; -extern xcpuop_func op_5180_0_ff; -extern xcpuop_func op_5188_0_nf; -extern xcpuop_func op_5188_0_ff; -extern xcpuop_func op_5190_0_nf; -extern xcpuop_func op_5190_0_ff; -extern xcpuop_func op_5198_0_nf; -extern xcpuop_func op_5198_0_ff; -extern xcpuop_func op_51a0_0_nf; -extern xcpuop_func op_51a0_0_ff; -extern xcpuop_func op_51a8_0_nf; -extern xcpuop_func op_51a8_0_ff; -extern xcpuop_func op_51b0_0_nf; -extern xcpuop_func op_51b0_0_ff; -extern xcpuop_func op_51b8_0_nf; -extern xcpuop_func op_51b8_0_ff; -extern xcpuop_func op_51b9_0_nf; -extern xcpuop_func op_51b9_0_ff; -extern xcpuop_func op_51c0_0_nf; -extern xcpuop_func op_51c0_0_ff; -extern xcpuop_func op_51c8_0_nf; -extern xcpuop_func op_51c8_0_ff; -extern xcpuop_func op_51d0_0_nf; -extern xcpuop_func op_51d0_0_ff; -extern xcpuop_func op_51d8_0_nf; -extern xcpuop_func op_51d8_0_ff; -extern xcpuop_func op_51e0_0_nf; -extern xcpuop_func op_51e0_0_ff; -extern xcpuop_func op_51e8_0_nf; -extern xcpuop_func op_51e8_0_ff; -extern xcpuop_func op_51f0_0_nf; -extern xcpuop_func op_51f0_0_ff; -extern xcpuop_func op_51f8_0_nf; -extern xcpuop_func op_51f8_0_ff; -extern xcpuop_func op_51f9_0_nf; -extern xcpuop_func op_51f9_0_ff; -extern xcpuop_func op_51fa_0_nf; -extern xcpuop_func op_51fa_0_ff; -extern xcpuop_func op_51fb_0_nf; -extern xcpuop_func op_51fb_0_ff; -extern xcpuop_func op_51fc_0_nf; -extern xcpuop_func op_51fc_0_ff; -extern xcpuop_func op_52c0_0_nf; -extern xcpuop_func op_52c0_0_ff; -extern xcpuop_func op_52c8_0_nf; -extern xcpuop_func op_52c8_0_ff; -extern xcpuop_func op_52d0_0_nf; -extern xcpuop_func op_52d0_0_ff; -extern xcpuop_func op_52d8_0_nf; -extern xcpuop_func op_52d8_0_ff; -extern xcpuop_func op_52e0_0_nf; -extern xcpuop_func op_52e0_0_ff; -extern xcpuop_func op_52e8_0_nf; -extern xcpuop_func op_52e8_0_ff; -extern xcpuop_func op_52f0_0_nf; -extern xcpuop_func op_52f0_0_ff; -extern xcpuop_func op_52f8_0_nf; -extern xcpuop_func op_52f8_0_ff; -extern xcpuop_func op_52f9_0_nf; -extern xcpuop_func op_52f9_0_ff; -extern xcpuop_func op_52fa_0_nf; -extern xcpuop_func op_52fa_0_ff; -extern xcpuop_func op_52fb_0_nf; -extern xcpuop_func op_52fb_0_ff; -extern xcpuop_func op_52fc_0_nf; -extern xcpuop_func op_52fc_0_ff; -extern xcpuop_func op_53c0_0_nf; -extern xcpuop_func op_53c0_0_ff; -extern xcpuop_func op_53c8_0_nf; -extern xcpuop_func op_53c8_0_ff; -extern xcpuop_func op_53d0_0_nf; -extern xcpuop_func op_53d0_0_ff; -extern xcpuop_func op_53d8_0_nf; -extern xcpuop_func op_53d8_0_ff; -extern xcpuop_func op_53e0_0_nf; -extern xcpuop_func op_53e0_0_ff; -extern xcpuop_func op_53e8_0_nf; -extern xcpuop_func op_53e8_0_ff; -extern xcpuop_func op_53f0_0_nf; -extern xcpuop_func op_53f0_0_ff; -extern xcpuop_func op_53f8_0_nf; -extern xcpuop_func op_53f8_0_ff; -extern xcpuop_func op_53f9_0_nf; -extern xcpuop_func op_53f9_0_ff; -extern xcpuop_func op_53fa_0_nf; -extern xcpuop_func op_53fa_0_ff; -extern xcpuop_func op_53fb_0_nf; -extern xcpuop_func op_53fb_0_ff; -extern xcpuop_func op_53fc_0_nf; -extern xcpuop_func op_53fc_0_ff; -extern xcpuop_func op_54c0_0_nf; -extern xcpuop_func op_54c0_0_ff; -extern xcpuop_func op_54c8_0_nf; -extern xcpuop_func op_54c8_0_ff; -extern xcpuop_func op_54d0_0_nf; -extern xcpuop_func op_54d0_0_ff; -extern xcpuop_func op_54d8_0_nf; -extern xcpuop_func op_54d8_0_ff; -extern xcpuop_func op_54e0_0_nf; -extern xcpuop_func op_54e0_0_ff; -extern xcpuop_func op_54e8_0_nf; -extern xcpuop_func op_54e8_0_ff; -extern xcpuop_func op_54f0_0_nf; -extern xcpuop_func op_54f0_0_ff; -extern xcpuop_func op_54f8_0_nf; -extern xcpuop_func op_54f8_0_ff; -extern xcpuop_func op_54f9_0_nf; -extern xcpuop_func op_54f9_0_ff; -extern xcpuop_func op_54fa_0_nf; -extern xcpuop_func op_54fa_0_ff; -extern xcpuop_func op_54fb_0_nf; -extern xcpuop_func op_54fb_0_ff; -extern xcpuop_func op_54fc_0_nf; -extern xcpuop_func op_54fc_0_ff; -extern xcpuop_func op_55c0_0_nf; -extern xcpuop_func op_55c0_0_ff; -extern xcpuop_func op_55c8_0_nf; -extern xcpuop_func op_55c8_0_ff; -extern xcpuop_func op_55d0_0_nf; -extern xcpuop_func op_55d0_0_ff; -extern xcpuop_func op_55d8_0_nf; -extern xcpuop_func op_55d8_0_ff; -extern xcpuop_func op_55e0_0_nf; -extern xcpuop_func op_55e0_0_ff; -extern xcpuop_func op_55e8_0_nf; -extern xcpuop_func op_55e8_0_ff; -extern xcpuop_func op_55f0_0_nf; -extern xcpuop_func op_55f0_0_ff; -extern xcpuop_func op_55f8_0_nf; -extern xcpuop_func op_55f8_0_ff; -extern xcpuop_func op_55f9_0_nf; -extern xcpuop_func op_55f9_0_ff; -extern xcpuop_func op_55fa_0_nf; -extern xcpuop_func op_55fa_0_ff; -extern xcpuop_func op_55fb_0_nf; -extern xcpuop_func op_55fb_0_ff; -extern xcpuop_func op_55fc_0_nf; -extern xcpuop_func op_55fc_0_ff; -extern xcpuop_func op_56c0_0_nf; -extern xcpuop_func op_56c0_0_ff; -extern xcpuop_func op_56c8_0_nf; -extern xcpuop_func op_56c8_0_ff; -extern xcpuop_func op_56d0_0_nf; -extern xcpuop_func op_56d0_0_ff; -extern xcpuop_func op_56d8_0_nf; -extern xcpuop_func op_56d8_0_ff; -extern xcpuop_func op_56e0_0_nf; -extern xcpuop_func op_56e0_0_ff; -extern xcpuop_func op_56e8_0_nf; -extern xcpuop_func op_56e8_0_ff; -extern xcpuop_func op_56f0_0_nf; -extern xcpuop_func op_56f0_0_ff; -extern xcpuop_func op_56f8_0_nf; -extern xcpuop_func op_56f8_0_ff; -extern xcpuop_func op_56f9_0_nf; -extern xcpuop_func op_56f9_0_ff; -extern xcpuop_func op_56fa_0_nf; -extern xcpuop_func op_56fa_0_ff; -extern xcpuop_func op_56fb_0_nf; -extern xcpuop_func op_56fb_0_ff; -extern xcpuop_func op_56fc_0_nf; -extern xcpuop_func op_56fc_0_ff; -extern xcpuop_func op_57c0_0_nf; -extern xcpuop_func op_57c0_0_ff; -extern xcpuop_func op_57c8_0_nf; -extern xcpuop_func op_57c8_0_ff; -extern xcpuop_func op_57d0_0_nf; -extern xcpuop_func op_57d0_0_ff; -extern xcpuop_func op_57d8_0_nf; -extern xcpuop_func op_57d8_0_ff; -extern xcpuop_func op_57e0_0_nf; -extern xcpuop_func op_57e0_0_ff; -extern xcpuop_func op_57e8_0_nf; -extern xcpuop_func op_57e8_0_ff; -extern xcpuop_func op_57f0_0_nf; -extern xcpuop_func op_57f0_0_ff; -extern xcpuop_func op_57f8_0_nf; -extern xcpuop_func op_57f8_0_ff; -extern xcpuop_func op_57f9_0_nf; -extern xcpuop_func op_57f9_0_ff; -extern xcpuop_func op_57fa_0_nf; -extern xcpuop_func op_57fa_0_ff; -extern xcpuop_func op_57fb_0_nf; -extern xcpuop_func op_57fb_0_ff; -extern xcpuop_func op_57fc_0_nf; -extern xcpuop_func op_57fc_0_ff; -extern xcpuop_func op_58c0_0_nf; -extern xcpuop_func op_58c0_0_ff; -extern xcpuop_func op_58c8_0_nf; -extern xcpuop_func op_58c8_0_ff; -extern xcpuop_func op_58d0_0_nf; -extern xcpuop_func op_58d0_0_ff; -extern xcpuop_func op_58d8_0_nf; -extern xcpuop_func op_58d8_0_ff; -extern xcpuop_func op_58e0_0_nf; -extern xcpuop_func op_58e0_0_ff; -extern xcpuop_func op_58e8_0_nf; -extern xcpuop_func op_58e8_0_ff; -extern xcpuop_func op_58f0_0_nf; -extern xcpuop_func op_58f0_0_ff; -extern xcpuop_func op_58f8_0_nf; -extern xcpuop_func op_58f8_0_ff; -extern xcpuop_func op_58f9_0_nf; -extern xcpuop_func op_58f9_0_ff; -extern xcpuop_func op_58fa_0_nf; -extern xcpuop_func op_58fa_0_ff; -extern xcpuop_func op_58fb_0_nf; -extern xcpuop_func op_58fb_0_ff; -extern xcpuop_func op_58fc_0_nf; -extern xcpuop_func op_58fc_0_ff; -extern xcpuop_func op_59c0_0_nf; -extern xcpuop_func op_59c0_0_ff; -extern xcpuop_func op_59c8_0_nf; -extern xcpuop_func op_59c8_0_ff; -extern xcpuop_func op_59d0_0_nf; -extern xcpuop_func op_59d0_0_ff; -extern xcpuop_func op_59d8_0_nf; -extern xcpuop_func op_59d8_0_ff; -extern xcpuop_func op_59e0_0_nf; -extern xcpuop_func op_59e0_0_ff; -extern xcpuop_func op_59e8_0_nf; -extern xcpuop_func op_59e8_0_ff; -extern xcpuop_func op_59f0_0_nf; -extern xcpuop_func op_59f0_0_ff; -extern xcpuop_func op_59f8_0_nf; -extern xcpuop_func op_59f8_0_ff; -extern xcpuop_func op_59f9_0_nf; -extern xcpuop_func op_59f9_0_ff; -extern xcpuop_func op_59fa_0_nf; -extern xcpuop_func op_59fa_0_ff; -extern xcpuop_func op_59fb_0_nf; -extern xcpuop_func op_59fb_0_ff; -extern xcpuop_func op_59fc_0_nf; -extern xcpuop_func op_59fc_0_ff; -extern xcpuop_func op_5ac0_0_nf; -extern xcpuop_func op_5ac0_0_ff; -extern xcpuop_func op_5ac8_0_nf; -extern xcpuop_func op_5ac8_0_ff; -extern xcpuop_func op_5ad0_0_nf; -extern xcpuop_func op_5ad0_0_ff; -extern xcpuop_func op_5ad8_0_nf; -extern xcpuop_func op_5ad8_0_ff; -extern xcpuop_func op_5ae0_0_nf; -extern xcpuop_func op_5ae0_0_ff; -extern xcpuop_func op_5ae8_0_nf; -extern xcpuop_func op_5ae8_0_ff; -extern xcpuop_func op_5af0_0_nf; -extern xcpuop_func op_5af0_0_ff; -extern xcpuop_func op_5af8_0_nf; -extern xcpuop_func op_5af8_0_ff; -extern xcpuop_func op_5af9_0_nf; -extern xcpuop_func op_5af9_0_ff; -extern xcpuop_func op_5afa_0_nf; -extern xcpuop_func op_5afa_0_ff; -extern xcpuop_func op_5afb_0_nf; -extern xcpuop_func op_5afb_0_ff; -extern xcpuop_func op_5afc_0_nf; -extern xcpuop_func op_5afc_0_ff; -extern xcpuop_func op_5bc0_0_nf; -extern xcpuop_func op_5bc0_0_ff; -extern xcpuop_func op_5bc8_0_nf; -extern xcpuop_func op_5bc8_0_ff; -extern xcpuop_func op_5bd0_0_nf; -extern xcpuop_func op_5bd0_0_ff; -extern xcpuop_func op_5bd8_0_nf; -extern xcpuop_func op_5bd8_0_ff; -extern xcpuop_func op_5be0_0_nf; -extern xcpuop_func op_5be0_0_ff; -extern xcpuop_func op_5be8_0_nf; -extern xcpuop_func op_5be8_0_ff; -extern xcpuop_func op_5bf0_0_nf; -extern xcpuop_func op_5bf0_0_ff; -extern xcpuop_func op_5bf8_0_nf; -extern xcpuop_func op_5bf8_0_ff; -extern xcpuop_func op_5bf9_0_nf; -extern xcpuop_func op_5bf9_0_ff; -extern xcpuop_func op_5bfa_0_nf; -extern xcpuop_func op_5bfa_0_ff; -extern xcpuop_func op_5bfb_0_nf; -extern xcpuop_func op_5bfb_0_ff; -extern xcpuop_func op_5bfc_0_nf; -extern xcpuop_func op_5bfc_0_ff; -extern xcpuop_func op_5cc0_0_nf; -extern xcpuop_func op_5cc0_0_ff; -extern xcpuop_func op_5cc8_0_nf; -extern xcpuop_func op_5cc8_0_ff; -extern xcpuop_func op_5cd0_0_nf; -extern xcpuop_func op_5cd0_0_ff; -extern xcpuop_func op_5cd8_0_nf; -extern xcpuop_func op_5cd8_0_ff; -extern xcpuop_func op_5ce0_0_nf; -extern xcpuop_func op_5ce0_0_ff; -extern xcpuop_func op_5ce8_0_nf; -extern xcpuop_func op_5ce8_0_ff; -extern xcpuop_func op_5cf0_0_nf; -extern xcpuop_func op_5cf0_0_ff; -extern xcpuop_func op_5cf8_0_nf; -extern xcpuop_func op_5cf8_0_ff; -extern xcpuop_func op_5cf9_0_nf; -extern xcpuop_func op_5cf9_0_ff; -extern xcpuop_func op_5cfa_0_nf; -extern xcpuop_func op_5cfa_0_ff; -extern xcpuop_func op_5cfb_0_nf; -extern xcpuop_func op_5cfb_0_ff; -extern xcpuop_func op_5cfc_0_nf; -extern xcpuop_func op_5cfc_0_ff; -extern xcpuop_func op_5dc0_0_nf; -extern xcpuop_func op_5dc0_0_ff; -extern xcpuop_func op_5dc8_0_nf; -extern xcpuop_func op_5dc8_0_ff; -extern xcpuop_func op_5dd0_0_nf; -extern xcpuop_func op_5dd0_0_ff; -extern xcpuop_func op_5dd8_0_nf; -extern xcpuop_func op_5dd8_0_ff; -extern xcpuop_func op_5de0_0_nf; -extern xcpuop_func op_5de0_0_ff; -extern xcpuop_func op_5de8_0_nf; -extern xcpuop_func op_5de8_0_ff; -extern xcpuop_func op_5df0_0_nf; -extern xcpuop_func op_5df0_0_ff; -extern xcpuop_func op_5df8_0_nf; -extern xcpuop_func op_5df8_0_ff; -extern xcpuop_func op_5df9_0_nf; -extern xcpuop_func op_5df9_0_ff; -extern xcpuop_func op_5dfa_0_nf; -extern xcpuop_func op_5dfa_0_ff; -extern xcpuop_func op_5dfb_0_nf; -extern xcpuop_func op_5dfb_0_ff; -extern xcpuop_func op_5dfc_0_nf; -extern xcpuop_func op_5dfc_0_ff; -extern xcpuop_func op_5ec0_0_nf; -extern xcpuop_func op_5ec0_0_ff; -extern xcpuop_func op_5ec8_0_nf; -extern xcpuop_func op_5ec8_0_ff; -extern xcpuop_func op_5ed0_0_nf; -extern xcpuop_func op_5ed0_0_ff; -extern xcpuop_func op_5ed8_0_nf; -extern xcpuop_func op_5ed8_0_ff; -extern xcpuop_func op_5ee0_0_nf; -extern xcpuop_func op_5ee0_0_ff; -extern xcpuop_func op_5ee8_0_nf; -extern xcpuop_func op_5ee8_0_ff; -extern xcpuop_func op_5ef0_0_nf; -extern xcpuop_func op_5ef0_0_ff; -extern xcpuop_func op_5ef8_0_nf; -extern xcpuop_func op_5ef8_0_ff; -extern xcpuop_func op_5ef9_0_nf; -extern xcpuop_func op_5ef9_0_ff; -extern xcpuop_func op_5efa_0_nf; -extern xcpuop_func op_5efa_0_ff; -extern xcpuop_func op_5efb_0_nf; -extern xcpuop_func op_5efb_0_ff; -extern xcpuop_func op_5efc_0_nf; -extern xcpuop_func op_5efc_0_ff; -extern xcpuop_func op_5fc0_0_nf; -extern xcpuop_func op_5fc0_0_ff; -extern xcpuop_func op_5fc8_0_nf; -extern xcpuop_func op_5fc8_0_ff; -extern xcpuop_func op_5fd0_0_nf; -extern xcpuop_func op_5fd0_0_ff; -extern xcpuop_func op_5fd8_0_nf; -extern xcpuop_func op_5fd8_0_ff; -extern xcpuop_func op_5fe0_0_nf; -extern xcpuop_func op_5fe0_0_ff; -extern xcpuop_func op_5fe8_0_nf; -extern xcpuop_func op_5fe8_0_ff; -extern xcpuop_func op_5ff0_0_nf; -extern xcpuop_func op_5ff0_0_ff; -extern xcpuop_func op_5ff8_0_nf; -extern xcpuop_func op_5ff8_0_ff; -extern xcpuop_func op_5ff9_0_nf; -extern xcpuop_func op_5ff9_0_ff; -extern xcpuop_func op_5ffa_0_nf; -extern xcpuop_func op_5ffa_0_ff; -extern xcpuop_func op_5ffb_0_nf; -extern xcpuop_func op_5ffb_0_ff; -extern xcpuop_func op_5ffc_0_nf; -extern xcpuop_func op_5ffc_0_ff; -extern xcpuop_func op_6000_0_nf; -extern xcpuop_func op_6000_0_ff; -extern xcpuop_func op_6001_0_nf; -extern xcpuop_func op_6001_0_ff; -extern xcpuop_func op_60ff_0_nf; -extern xcpuop_func op_60ff_0_ff; -extern xcpuop_func op_6100_0_nf; -extern xcpuop_func op_6100_0_ff; -extern xcpuop_func op_6101_0_nf; -extern xcpuop_func op_6101_0_ff; -extern xcpuop_func op_61ff_0_nf; -extern xcpuop_func op_61ff_0_ff; -extern xcpuop_func op_6200_0_nf; -extern xcpuop_func op_6200_0_ff; -extern xcpuop_func op_6201_0_nf; -extern xcpuop_func op_6201_0_ff; -extern xcpuop_func op_62ff_0_nf; -extern xcpuop_func op_62ff_0_ff; -extern xcpuop_func op_6300_0_nf; -extern xcpuop_func op_6300_0_ff; -extern xcpuop_func op_6301_0_nf; -extern xcpuop_func op_6301_0_ff; -extern xcpuop_func op_63ff_0_nf; -extern xcpuop_func op_63ff_0_ff; -extern xcpuop_func op_6400_0_nf; -extern xcpuop_func op_6400_0_ff; -extern xcpuop_func op_6401_0_nf; -extern xcpuop_func op_6401_0_ff; -extern xcpuop_func op_64ff_0_nf; -extern xcpuop_func op_64ff_0_ff; -extern xcpuop_func op_6500_0_nf; -extern xcpuop_func op_6500_0_ff; -extern xcpuop_func op_6501_0_nf; -extern xcpuop_func op_6501_0_ff; -extern xcpuop_func op_65ff_0_nf; -extern xcpuop_func op_65ff_0_ff; -extern xcpuop_func op_6600_0_nf; -extern xcpuop_func op_6600_0_ff; -extern xcpuop_func op_6601_0_nf; -extern xcpuop_func op_6601_0_ff; -extern xcpuop_func op_66ff_0_nf; -extern xcpuop_func op_66ff_0_ff; -extern xcpuop_func op_6700_0_nf; -extern xcpuop_func op_6700_0_ff; -extern xcpuop_func op_6701_0_nf; -extern xcpuop_func op_6701_0_ff; -extern xcpuop_func op_67ff_0_nf; -extern xcpuop_func op_67ff_0_ff; -extern xcpuop_func op_6800_0_nf; -extern xcpuop_func op_6800_0_ff; -extern xcpuop_func op_6801_0_nf; -extern xcpuop_func op_6801_0_ff; -extern xcpuop_func op_68ff_0_nf; -extern xcpuop_func op_68ff_0_ff; -extern xcpuop_func op_6900_0_nf; -extern xcpuop_func op_6900_0_ff; -extern xcpuop_func op_6901_0_nf; -extern xcpuop_func op_6901_0_ff; -extern xcpuop_func op_69ff_0_nf; -extern xcpuop_func op_69ff_0_ff; -extern xcpuop_func op_6a00_0_nf; -extern xcpuop_func op_6a00_0_ff; -extern xcpuop_func op_6a01_0_nf; -extern xcpuop_func op_6a01_0_ff; -extern xcpuop_func op_6aff_0_nf; -extern xcpuop_func op_6aff_0_ff; -extern xcpuop_func op_6b00_0_nf; -extern xcpuop_func op_6b00_0_ff; -extern xcpuop_func op_6b01_0_nf; -extern xcpuop_func op_6b01_0_ff; -extern xcpuop_func op_6bff_0_nf; -extern xcpuop_func op_6bff_0_ff; -extern xcpuop_func op_6c00_0_nf; -extern xcpuop_func op_6c00_0_ff; -extern xcpuop_func op_6c01_0_nf; -extern xcpuop_func op_6c01_0_ff; -extern xcpuop_func op_6cff_0_nf; -extern xcpuop_func op_6cff_0_ff; -extern xcpuop_func op_6d00_0_nf; -extern xcpuop_func op_6d00_0_ff; -extern xcpuop_func op_6d01_0_nf; -extern xcpuop_func op_6d01_0_ff; -extern xcpuop_func op_6dff_0_nf; -extern xcpuop_func op_6dff_0_ff; -extern xcpuop_func op_6e00_0_nf; -extern xcpuop_func op_6e00_0_ff; -extern xcpuop_func op_6e01_0_nf; -extern xcpuop_func op_6e01_0_ff; -extern xcpuop_func op_6eff_0_nf; -extern xcpuop_func op_6eff_0_ff; -extern xcpuop_func op_6f00_0_nf; -extern xcpuop_func op_6f00_0_ff; -extern xcpuop_func op_6f01_0_nf; -extern xcpuop_func op_6f01_0_ff; -extern xcpuop_func op_6fff_0_nf; -extern xcpuop_func op_6fff_0_ff; -extern xcpuop_func op_7000_0_nf; -extern xcpuop_func op_7000_0_ff; -extern xcpuop_func op_8000_0_nf; -extern xcpuop_func op_8000_0_ff; -extern xcpuop_func op_8010_0_nf; -extern xcpuop_func op_8010_0_ff; -extern xcpuop_func op_8018_0_nf; -extern xcpuop_func op_8018_0_ff; -extern xcpuop_func op_8020_0_nf; -extern xcpuop_func op_8020_0_ff; -extern xcpuop_func op_8028_0_nf; -extern xcpuop_func op_8028_0_ff; -extern xcpuop_func op_8030_0_nf; -extern xcpuop_func op_8030_0_ff; -extern xcpuop_func op_8038_0_nf; -extern xcpuop_func op_8038_0_ff; -extern xcpuop_func op_8039_0_nf; -extern xcpuop_func op_8039_0_ff; -extern xcpuop_func op_803a_0_nf; -extern xcpuop_func op_803a_0_ff; -extern xcpuop_func op_803b_0_nf; -extern xcpuop_func op_803b_0_ff; -extern xcpuop_func op_803c_0_nf; -extern xcpuop_func op_803c_0_ff; -extern xcpuop_func op_8040_0_nf; -extern xcpuop_func op_8040_0_ff; -extern xcpuop_func op_8050_0_nf; -extern xcpuop_func op_8050_0_ff; -extern xcpuop_func op_8058_0_nf; -extern xcpuop_func op_8058_0_ff; -extern xcpuop_func op_8060_0_nf; -extern xcpuop_func op_8060_0_ff; -extern xcpuop_func op_8068_0_nf; -extern xcpuop_func op_8068_0_ff; -extern xcpuop_func op_8070_0_nf; -extern xcpuop_func op_8070_0_ff; -extern xcpuop_func op_8078_0_nf; -extern xcpuop_func op_8078_0_ff; -extern xcpuop_func op_8079_0_nf; -extern xcpuop_func op_8079_0_ff; -extern xcpuop_func op_807a_0_nf; -extern xcpuop_func op_807a_0_ff; -extern xcpuop_func op_807b_0_nf; -extern xcpuop_func op_807b_0_ff; -extern xcpuop_func op_807c_0_nf; -extern xcpuop_func op_807c_0_ff; -extern xcpuop_func op_8080_0_nf; -extern xcpuop_func op_8080_0_ff; -extern xcpuop_func op_8090_0_nf; -extern xcpuop_func op_8090_0_ff; -extern xcpuop_func op_8098_0_nf; -extern xcpuop_func op_8098_0_ff; -extern xcpuop_func op_80a0_0_nf; -extern xcpuop_func op_80a0_0_ff; -extern xcpuop_func op_80a8_0_nf; -extern xcpuop_func op_80a8_0_ff; -extern xcpuop_func op_80b0_0_nf; -extern xcpuop_func op_80b0_0_ff; -extern xcpuop_func op_80b8_0_nf; -extern xcpuop_func op_80b8_0_ff; -extern xcpuop_func op_80b9_0_nf; -extern xcpuop_func op_80b9_0_ff; -extern xcpuop_func op_80ba_0_nf; -extern xcpuop_func op_80ba_0_ff; -extern xcpuop_func op_80bb_0_nf; -extern xcpuop_func op_80bb_0_ff; -extern xcpuop_func op_80bc_0_nf; -extern xcpuop_func op_80bc_0_ff; -extern xcpuop_func op_80c0_0_nf; -extern xcpuop_func op_80c0_0_ff; -extern xcpuop_func op_80d0_0_nf; -extern xcpuop_func op_80d0_0_ff; -extern xcpuop_func op_80d8_0_nf; -extern xcpuop_func op_80d8_0_ff; -extern xcpuop_func op_80e0_0_nf; -extern xcpuop_func op_80e0_0_ff; -extern xcpuop_func op_80e8_0_nf; -extern xcpuop_func op_80e8_0_ff; -extern xcpuop_func op_80f0_0_nf; -extern xcpuop_func op_80f0_0_ff; -extern xcpuop_func op_80f8_0_nf; -extern xcpuop_func op_80f8_0_ff; -extern xcpuop_func op_80f9_0_nf; -extern xcpuop_func op_80f9_0_ff; -extern xcpuop_func op_80fa_0_nf; -extern xcpuop_func op_80fa_0_ff; -extern xcpuop_func op_80fb_0_nf; -extern xcpuop_func op_80fb_0_ff; -extern xcpuop_func op_80fc_0_nf; -extern xcpuop_func op_80fc_0_ff; -extern xcpuop_func op_8100_0_nf; -extern xcpuop_func op_8100_0_ff; -extern xcpuop_func op_8108_0_nf; -extern xcpuop_func op_8108_0_ff; -extern xcpuop_func op_8110_0_nf; -extern xcpuop_func op_8110_0_ff; -extern xcpuop_func op_8118_0_nf; -extern xcpuop_func op_8118_0_ff; -extern xcpuop_func op_8120_0_nf; -extern xcpuop_func op_8120_0_ff; -extern xcpuop_func op_8128_0_nf; -extern xcpuop_func op_8128_0_ff; -extern xcpuop_func op_8130_0_nf; -extern xcpuop_func op_8130_0_ff; -extern xcpuop_func op_8138_0_nf; -extern xcpuop_func op_8138_0_ff; -extern xcpuop_func op_8139_0_nf; -extern xcpuop_func op_8139_0_ff; -extern xcpuop_func op_8140_0_nf; -extern xcpuop_func op_8140_0_ff; -extern xcpuop_func op_8148_0_nf; -extern xcpuop_func op_8148_0_ff; -extern xcpuop_func op_8150_0_nf; -extern xcpuop_func op_8150_0_ff; -extern xcpuop_func op_8158_0_nf; -extern xcpuop_func op_8158_0_ff; -extern xcpuop_func op_8160_0_nf; -extern xcpuop_func op_8160_0_ff; -extern xcpuop_func op_8168_0_nf; -extern xcpuop_func op_8168_0_ff; -extern xcpuop_func op_8170_0_nf; -extern xcpuop_func op_8170_0_ff; -extern xcpuop_func op_8178_0_nf; -extern xcpuop_func op_8178_0_ff; -extern xcpuop_func op_8179_0_nf; -extern xcpuop_func op_8179_0_ff; -extern xcpuop_func op_8180_0_nf; -extern xcpuop_func op_8180_0_ff; -extern xcpuop_func op_8188_0_nf; -extern xcpuop_func op_8188_0_ff; -extern xcpuop_func op_8190_0_nf; -extern xcpuop_func op_8190_0_ff; -extern xcpuop_func op_8198_0_nf; -extern xcpuop_func op_8198_0_ff; -extern xcpuop_func op_81a0_0_nf; -extern xcpuop_func op_81a0_0_ff; -extern xcpuop_func op_81a8_0_nf; -extern xcpuop_func op_81a8_0_ff; -extern xcpuop_func op_81b0_0_nf; -extern xcpuop_func op_81b0_0_ff; -extern xcpuop_func op_81b8_0_nf; -extern xcpuop_func op_81b8_0_ff; -extern xcpuop_func op_81b9_0_nf; -extern xcpuop_func op_81b9_0_ff; -extern xcpuop_func op_81c0_0_nf; -extern xcpuop_func op_81c0_0_ff; -extern xcpuop_func op_81d0_0_nf; -extern xcpuop_func op_81d0_0_ff; -extern xcpuop_func op_81d8_0_nf; -extern xcpuop_func op_81d8_0_ff; -extern xcpuop_func op_81e0_0_nf; -extern xcpuop_func op_81e0_0_ff; -extern xcpuop_func op_81e8_0_nf; -extern xcpuop_func op_81e8_0_ff; -extern xcpuop_func op_81f0_0_nf; -extern xcpuop_func op_81f0_0_ff; -extern xcpuop_func op_81f8_0_nf; -extern xcpuop_func op_81f8_0_ff; -extern xcpuop_func op_81f9_0_nf; -extern xcpuop_func op_81f9_0_ff; -extern xcpuop_func op_81fa_0_nf; -extern xcpuop_func op_81fa_0_ff; -extern xcpuop_func op_81fb_0_nf; -extern xcpuop_func op_81fb_0_ff; -extern xcpuop_func op_81fc_0_nf; -extern xcpuop_func op_81fc_0_ff; -extern xcpuop_func op_9000_0_nf; -extern xcpuop_func op_9000_0_ff; -extern xcpuop_func op_9010_0_nf; -extern xcpuop_func op_9010_0_ff; -extern xcpuop_func op_9018_0_nf; -extern xcpuop_func op_9018_0_ff; -extern xcpuop_func op_9020_0_nf; -extern xcpuop_func op_9020_0_ff; -extern xcpuop_func op_9028_0_nf; -extern xcpuop_func op_9028_0_ff; -extern xcpuop_func op_9030_0_nf; -extern xcpuop_func op_9030_0_ff; -extern xcpuop_func op_9038_0_nf; -extern xcpuop_func op_9038_0_ff; -extern xcpuop_func op_9039_0_nf; -extern xcpuop_func op_9039_0_ff; -extern xcpuop_func op_903a_0_nf; -extern xcpuop_func op_903a_0_ff; -extern xcpuop_func op_903b_0_nf; -extern xcpuop_func op_903b_0_ff; -extern xcpuop_func op_903c_0_nf; -extern xcpuop_func op_903c_0_ff; -extern xcpuop_func op_9040_0_nf; -extern xcpuop_func op_9040_0_ff; -extern xcpuop_func op_9048_0_nf; -extern xcpuop_func op_9048_0_ff; -extern xcpuop_func op_9050_0_nf; -extern xcpuop_func op_9050_0_ff; -extern xcpuop_func op_9058_0_nf; -extern xcpuop_func op_9058_0_ff; -extern xcpuop_func op_9060_0_nf; -extern xcpuop_func op_9060_0_ff; -extern xcpuop_func op_9068_0_nf; -extern xcpuop_func op_9068_0_ff; -extern xcpuop_func op_9070_0_nf; -extern xcpuop_func op_9070_0_ff; -extern xcpuop_func op_9078_0_nf; -extern xcpuop_func op_9078_0_ff; -extern xcpuop_func op_9079_0_nf; -extern xcpuop_func op_9079_0_ff; -extern xcpuop_func op_907a_0_nf; -extern xcpuop_func op_907a_0_ff; -extern xcpuop_func op_907b_0_nf; -extern xcpuop_func op_907b_0_ff; -extern xcpuop_func op_907c_0_nf; -extern xcpuop_func op_907c_0_ff; -extern xcpuop_func op_9080_0_nf; -extern xcpuop_func op_9080_0_ff; -extern xcpuop_func op_9088_0_nf; -extern xcpuop_func op_9088_0_ff; -extern xcpuop_func op_9090_0_nf; -extern xcpuop_func op_9090_0_ff; -extern xcpuop_func op_9098_0_nf; -extern xcpuop_func op_9098_0_ff; -extern xcpuop_func op_90a0_0_nf; -extern xcpuop_func op_90a0_0_ff; -extern xcpuop_func op_90a8_0_nf; -extern xcpuop_func op_90a8_0_ff; -extern xcpuop_func op_90b0_0_nf; -extern xcpuop_func op_90b0_0_ff; -extern xcpuop_func op_90b8_0_nf; -extern xcpuop_func op_90b8_0_ff; -extern xcpuop_func op_90b9_0_nf; -extern xcpuop_func op_90b9_0_ff; -extern xcpuop_func op_90ba_0_nf; -extern xcpuop_func op_90ba_0_ff; -extern xcpuop_func op_90bb_0_nf; -extern xcpuop_func op_90bb_0_ff; -extern xcpuop_func op_90bc_0_nf; -extern xcpuop_func op_90bc_0_ff; -extern xcpuop_func op_90c0_0_nf; -extern xcpuop_func op_90c0_0_ff; -extern xcpuop_func op_90c8_0_nf; -extern xcpuop_func op_90c8_0_ff; -extern xcpuop_func op_90d0_0_nf; -extern xcpuop_func op_90d0_0_ff; -extern xcpuop_func op_90d8_0_nf; -extern xcpuop_func op_90d8_0_ff; -extern xcpuop_func op_90e0_0_nf; -extern xcpuop_func op_90e0_0_ff; -extern xcpuop_func op_90e8_0_nf; -extern xcpuop_func op_90e8_0_ff; -extern xcpuop_func op_90f0_0_nf; -extern xcpuop_func op_90f0_0_ff; -extern xcpuop_func op_90f8_0_nf; -extern xcpuop_func op_90f8_0_ff; -extern xcpuop_func op_90f9_0_nf; -extern xcpuop_func op_90f9_0_ff; -extern xcpuop_func op_90fa_0_nf; -extern xcpuop_func op_90fa_0_ff; -extern xcpuop_func op_90fb_0_nf; -extern xcpuop_func op_90fb_0_ff; -extern xcpuop_func op_90fc_0_nf; -extern xcpuop_func op_90fc_0_ff; -extern xcpuop_func op_9100_0_nf; -extern xcpuop_func op_9100_0_ff; -extern xcpuop_func op_9108_0_nf; -extern xcpuop_func op_9108_0_ff; -extern xcpuop_func op_9110_0_nf; -extern xcpuop_func op_9110_0_ff; -extern xcpuop_func op_9118_0_nf; -extern xcpuop_func op_9118_0_ff; -extern xcpuop_func op_9120_0_nf; -extern xcpuop_func op_9120_0_ff; -extern xcpuop_func op_9128_0_nf; -extern xcpuop_func op_9128_0_ff; -extern xcpuop_func op_9130_0_nf; -extern xcpuop_func op_9130_0_ff; -extern xcpuop_func op_9138_0_nf; -extern xcpuop_func op_9138_0_ff; -extern xcpuop_func op_9139_0_nf; -extern xcpuop_func op_9139_0_ff; -extern xcpuop_func op_9140_0_nf; -extern xcpuop_func op_9140_0_ff; -extern xcpuop_func op_9148_0_nf; -extern xcpuop_func op_9148_0_ff; -extern xcpuop_func op_9150_0_nf; -extern xcpuop_func op_9150_0_ff; -extern xcpuop_func op_9158_0_nf; -extern xcpuop_func op_9158_0_ff; -extern xcpuop_func op_9160_0_nf; -extern xcpuop_func op_9160_0_ff; -extern xcpuop_func op_9168_0_nf; -extern xcpuop_func op_9168_0_ff; -extern xcpuop_func op_9170_0_nf; -extern xcpuop_func op_9170_0_ff; -extern xcpuop_func op_9178_0_nf; -extern xcpuop_func op_9178_0_ff; -extern xcpuop_func op_9179_0_nf; -extern xcpuop_func op_9179_0_ff; -extern xcpuop_func op_9180_0_nf; -extern xcpuop_func op_9180_0_ff; -extern xcpuop_func op_9188_0_nf; -extern xcpuop_func op_9188_0_ff; -extern xcpuop_func op_9190_0_nf; -extern xcpuop_func op_9190_0_ff; -extern xcpuop_func op_9198_0_nf; -extern xcpuop_func op_9198_0_ff; -extern xcpuop_func op_91a0_0_nf; -extern xcpuop_func op_91a0_0_ff; -extern xcpuop_func op_91a8_0_nf; -extern xcpuop_func op_91a8_0_ff; -extern xcpuop_func op_91b0_0_nf; -extern xcpuop_func op_91b0_0_ff; -extern xcpuop_func op_91b8_0_nf; -extern xcpuop_func op_91b8_0_ff; -extern xcpuop_func op_91b9_0_nf; -extern xcpuop_func op_91b9_0_ff; -extern xcpuop_func op_91c0_0_nf; -extern xcpuop_func op_91c0_0_ff; -extern xcpuop_func op_91c8_0_nf; -extern xcpuop_func op_91c8_0_ff; -extern xcpuop_func op_91d0_0_nf; -extern xcpuop_func op_91d0_0_ff; -extern xcpuop_func op_91d8_0_nf; -extern xcpuop_func op_91d8_0_ff; -extern xcpuop_func op_91e0_0_nf; -extern xcpuop_func op_91e0_0_ff; -extern xcpuop_func op_91e8_0_nf; -extern xcpuop_func op_91e8_0_ff; -extern xcpuop_func op_91f0_0_nf; -extern xcpuop_func op_91f0_0_ff; -extern xcpuop_func op_91f8_0_nf; -extern xcpuop_func op_91f8_0_ff; -extern xcpuop_func op_91f9_0_nf; -extern xcpuop_func op_91f9_0_ff; -extern xcpuop_func op_91fa_0_nf; -extern xcpuop_func op_91fa_0_ff; -extern xcpuop_func op_91fb_0_nf; -extern xcpuop_func op_91fb_0_ff; -extern xcpuop_func op_91fc_0_nf; -extern xcpuop_func op_91fc_0_ff; -extern xcpuop_func op_b000_0_nf; -extern xcpuop_func op_b000_0_ff; -extern xcpuop_func op_b010_0_nf; -extern xcpuop_func op_b010_0_ff; -extern xcpuop_func op_b018_0_nf; -extern xcpuop_func op_b018_0_ff; -extern xcpuop_func op_b020_0_nf; -extern xcpuop_func op_b020_0_ff; -extern xcpuop_func op_b028_0_nf; -extern xcpuop_func op_b028_0_ff; -extern xcpuop_func op_b030_0_nf; -extern xcpuop_func op_b030_0_ff; -extern xcpuop_func op_b038_0_nf; -extern xcpuop_func op_b038_0_ff; -extern xcpuop_func op_b039_0_nf; -extern xcpuop_func op_b039_0_ff; -extern xcpuop_func op_b03a_0_nf; -extern xcpuop_func op_b03a_0_ff; -extern xcpuop_func op_b03b_0_nf; -extern xcpuop_func op_b03b_0_ff; -extern xcpuop_func op_b03c_0_nf; -extern xcpuop_func op_b03c_0_ff; -extern xcpuop_func op_b040_0_nf; -extern xcpuop_func op_b040_0_ff; -extern xcpuop_func op_b048_0_nf; -extern xcpuop_func op_b048_0_ff; -extern xcpuop_func op_b050_0_nf; -extern xcpuop_func op_b050_0_ff; -extern xcpuop_func op_b058_0_nf; -extern xcpuop_func op_b058_0_ff; -extern xcpuop_func op_b060_0_nf; -extern xcpuop_func op_b060_0_ff; -extern xcpuop_func op_b068_0_nf; -extern xcpuop_func op_b068_0_ff; -extern xcpuop_func op_b070_0_nf; -extern xcpuop_func op_b070_0_ff; -extern xcpuop_func op_b078_0_nf; -extern xcpuop_func op_b078_0_ff; -extern xcpuop_func op_b079_0_nf; -extern xcpuop_func op_b079_0_ff; -extern xcpuop_func op_b07a_0_nf; -extern xcpuop_func op_b07a_0_ff; -extern xcpuop_func op_b07b_0_nf; -extern xcpuop_func op_b07b_0_ff; -extern xcpuop_func op_b07c_0_nf; -extern xcpuop_func op_b07c_0_ff; -extern xcpuop_func op_b080_0_nf; -extern xcpuop_func op_b080_0_ff; -extern xcpuop_func op_b088_0_nf; -extern xcpuop_func op_b088_0_ff; -extern xcpuop_func op_b090_0_nf; -extern xcpuop_func op_b090_0_ff; -extern xcpuop_func op_b098_0_nf; -extern xcpuop_func op_b098_0_ff; -extern xcpuop_func op_b0a0_0_nf; -extern xcpuop_func op_b0a0_0_ff; -extern xcpuop_func op_b0a8_0_nf; -extern xcpuop_func op_b0a8_0_ff; -extern xcpuop_func op_b0b0_0_nf; -extern xcpuop_func op_b0b0_0_ff; -extern xcpuop_func op_b0b8_0_nf; -extern xcpuop_func op_b0b8_0_ff; -extern xcpuop_func op_b0b9_0_nf; -extern xcpuop_func op_b0b9_0_ff; -extern xcpuop_func op_b0ba_0_nf; -extern xcpuop_func op_b0ba_0_ff; -extern xcpuop_func op_b0bb_0_nf; -extern xcpuop_func op_b0bb_0_ff; -extern xcpuop_func op_b0bc_0_nf; -extern xcpuop_func op_b0bc_0_ff; -extern xcpuop_func op_b0c0_0_nf; -extern xcpuop_func op_b0c0_0_ff; -extern xcpuop_func op_b0c8_0_nf; -extern xcpuop_func op_b0c8_0_ff; -extern xcpuop_func op_b0d0_0_nf; -extern xcpuop_func op_b0d0_0_ff; -extern xcpuop_func op_b0d8_0_nf; -extern xcpuop_func op_b0d8_0_ff; -extern xcpuop_func op_b0e0_0_nf; -extern xcpuop_func op_b0e0_0_ff; -extern xcpuop_func op_b0e8_0_nf; -extern xcpuop_func op_b0e8_0_ff; -extern xcpuop_func op_b0f0_0_nf; -extern xcpuop_func op_b0f0_0_ff; -extern xcpuop_func op_b0f8_0_nf; -extern xcpuop_func op_b0f8_0_ff; -extern xcpuop_func op_b0f9_0_nf; -extern xcpuop_func op_b0f9_0_ff; -extern xcpuop_func op_b0fa_0_nf; -extern xcpuop_func op_b0fa_0_ff; -extern xcpuop_func op_b0fb_0_nf; -extern xcpuop_func op_b0fb_0_ff; -extern xcpuop_func op_b0fc_0_nf; -extern xcpuop_func op_b0fc_0_ff; -extern xcpuop_func op_b100_0_nf; -extern xcpuop_func op_b100_0_ff; -extern xcpuop_func op_b108_0_nf; -extern xcpuop_func op_b108_0_ff; -extern xcpuop_func op_b110_0_nf; -extern xcpuop_func op_b110_0_ff; -extern xcpuop_func op_b118_0_nf; -extern xcpuop_func op_b118_0_ff; -extern xcpuop_func op_b120_0_nf; -extern xcpuop_func op_b120_0_ff; -extern xcpuop_func op_b128_0_nf; -extern xcpuop_func op_b128_0_ff; -extern xcpuop_func op_b130_0_nf; -extern xcpuop_func op_b130_0_ff; -extern xcpuop_func op_b138_0_nf; -extern xcpuop_func op_b138_0_ff; -extern xcpuop_func op_b139_0_nf; -extern xcpuop_func op_b139_0_ff; -extern xcpuop_func op_b140_0_nf; -extern xcpuop_func op_b140_0_ff; -extern xcpuop_func op_b148_0_nf; -extern xcpuop_func op_b148_0_ff; -extern xcpuop_func op_b150_0_nf; -extern xcpuop_func op_b150_0_ff; -extern xcpuop_func op_b158_0_nf; -extern xcpuop_func op_b158_0_ff; -extern xcpuop_func op_b160_0_nf; -extern xcpuop_func op_b160_0_ff; -extern xcpuop_func op_b168_0_nf; -extern xcpuop_func op_b168_0_ff; -extern xcpuop_func op_b170_0_nf; -extern xcpuop_func op_b170_0_ff; -extern xcpuop_func op_b178_0_nf; -extern xcpuop_func op_b178_0_ff; -extern xcpuop_func op_b179_0_nf; -extern xcpuop_func op_b179_0_ff; -extern xcpuop_func op_b180_0_nf; -extern xcpuop_func op_b180_0_ff; -extern xcpuop_func op_b188_0_nf; -extern xcpuop_func op_b188_0_ff; -extern xcpuop_func op_b190_0_nf; -extern xcpuop_func op_b190_0_ff; -extern xcpuop_func op_b198_0_nf; -extern xcpuop_func op_b198_0_ff; -extern xcpuop_func op_b1a0_0_nf; -extern xcpuop_func op_b1a0_0_ff; -extern xcpuop_func op_b1a8_0_nf; -extern xcpuop_func op_b1a8_0_ff; -extern xcpuop_func op_b1b0_0_nf; -extern xcpuop_func op_b1b0_0_ff; -extern xcpuop_func op_b1b8_0_nf; -extern xcpuop_func op_b1b8_0_ff; -extern xcpuop_func op_b1b9_0_nf; -extern xcpuop_func op_b1b9_0_ff; -extern xcpuop_func op_b1c0_0_nf; -extern xcpuop_func op_b1c0_0_ff; -extern xcpuop_func op_b1c8_0_nf; -extern xcpuop_func op_b1c8_0_ff; -extern xcpuop_func op_b1d0_0_nf; -extern xcpuop_func op_b1d0_0_ff; -extern xcpuop_func op_b1d8_0_nf; -extern xcpuop_func op_b1d8_0_ff; -extern xcpuop_func op_b1e0_0_nf; -extern xcpuop_func op_b1e0_0_ff; -extern xcpuop_func op_b1e8_0_nf; -extern xcpuop_func op_b1e8_0_ff; -extern xcpuop_func op_b1f0_0_nf; -extern xcpuop_func op_b1f0_0_ff; -extern xcpuop_func op_b1f8_0_nf; -extern xcpuop_func op_b1f8_0_ff; -extern xcpuop_func op_b1f9_0_nf; -extern xcpuop_func op_b1f9_0_ff; -extern xcpuop_func op_b1fa_0_nf; -extern xcpuop_func op_b1fa_0_ff; -extern xcpuop_func op_b1fb_0_nf; -extern xcpuop_func op_b1fb_0_ff; -extern xcpuop_func op_b1fc_0_nf; -extern xcpuop_func op_b1fc_0_ff; -extern xcpuop_func op_c000_0_nf; -extern xcpuop_func op_c000_0_ff; -extern xcpuop_func op_c010_0_nf; -extern xcpuop_func op_c010_0_ff; -extern xcpuop_func op_c018_0_nf; -extern xcpuop_func op_c018_0_ff; -extern xcpuop_func op_c020_0_nf; -extern xcpuop_func op_c020_0_ff; -extern xcpuop_func op_c028_0_nf; -extern xcpuop_func op_c028_0_ff; -extern xcpuop_func op_c030_0_nf; -extern xcpuop_func op_c030_0_ff; -extern xcpuop_func op_c038_0_nf; -extern xcpuop_func op_c038_0_ff; -extern xcpuop_func op_c039_0_nf; -extern xcpuop_func op_c039_0_ff; -extern xcpuop_func op_c03a_0_nf; -extern xcpuop_func op_c03a_0_ff; -extern xcpuop_func op_c03b_0_nf; -extern xcpuop_func op_c03b_0_ff; -extern xcpuop_func op_c03c_0_nf; -extern xcpuop_func op_c03c_0_ff; -extern xcpuop_func op_c040_0_nf; -extern xcpuop_func op_c040_0_ff; -extern xcpuop_func op_c050_0_nf; -extern xcpuop_func op_c050_0_ff; -extern xcpuop_func op_c058_0_nf; -extern xcpuop_func op_c058_0_ff; -extern xcpuop_func op_c060_0_nf; -extern xcpuop_func op_c060_0_ff; -extern xcpuop_func op_c068_0_nf; -extern xcpuop_func op_c068_0_ff; -extern xcpuop_func op_c070_0_nf; -extern xcpuop_func op_c070_0_ff; -extern xcpuop_func op_c078_0_nf; -extern xcpuop_func op_c078_0_ff; -extern xcpuop_func op_c079_0_nf; -extern xcpuop_func op_c079_0_ff; -extern xcpuop_func op_c07a_0_nf; -extern xcpuop_func op_c07a_0_ff; -extern xcpuop_func op_c07b_0_nf; -extern xcpuop_func op_c07b_0_ff; -extern xcpuop_func op_c07c_0_nf; -extern xcpuop_func op_c07c_0_ff; -extern xcpuop_func op_c080_0_nf; -extern xcpuop_func op_c080_0_ff; -extern xcpuop_func op_c090_0_nf; -extern xcpuop_func op_c090_0_ff; -extern xcpuop_func op_c098_0_nf; -extern xcpuop_func op_c098_0_ff; -extern xcpuop_func op_c0a0_0_nf; -extern xcpuop_func op_c0a0_0_ff; -extern xcpuop_func op_c0a8_0_nf; -extern xcpuop_func op_c0a8_0_ff; -extern xcpuop_func op_c0b0_0_nf; -extern xcpuop_func op_c0b0_0_ff; -extern xcpuop_func op_c0b8_0_nf; -extern xcpuop_func op_c0b8_0_ff; -extern xcpuop_func op_c0b9_0_nf; -extern xcpuop_func op_c0b9_0_ff; -extern xcpuop_func op_c0ba_0_nf; -extern xcpuop_func op_c0ba_0_ff; -extern xcpuop_func op_c0bb_0_nf; -extern xcpuop_func op_c0bb_0_ff; -extern xcpuop_func op_c0bc_0_nf; -extern xcpuop_func op_c0bc_0_ff; -extern xcpuop_func op_c0c0_0_nf; -extern xcpuop_func op_c0c0_0_ff; -extern xcpuop_func op_c0d0_0_nf; -extern xcpuop_func op_c0d0_0_ff; -extern xcpuop_func op_c0d8_0_nf; -extern xcpuop_func op_c0d8_0_ff; -extern xcpuop_func op_c0e0_0_nf; -extern xcpuop_func op_c0e0_0_ff; -extern xcpuop_func op_c0e8_0_nf; -extern xcpuop_func op_c0e8_0_ff; -extern xcpuop_func op_c0f0_0_nf; -extern xcpuop_func op_c0f0_0_ff; -extern xcpuop_func op_c0f8_0_nf; -extern xcpuop_func op_c0f8_0_ff; -extern xcpuop_func op_c0f9_0_nf; -extern xcpuop_func op_c0f9_0_ff; -extern xcpuop_func op_c0fa_0_nf; -extern xcpuop_func op_c0fa_0_ff; -extern xcpuop_func op_c0fb_0_nf; -extern xcpuop_func op_c0fb_0_ff; -extern xcpuop_func op_c0fc_0_nf; -extern xcpuop_func op_c0fc_0_ff; -extern xcpuop_func op_c100_0_nf; -extern xcpuop_func op_c100_0_ff; -extern xcpuop_func op_c108_0_nf; -extern xcpuop_func op_c108_0_ff; -extern xcpuop_func op_c110_0_nf; -extern xcpuop_func op_c110_0_ff; -extern xcpuop_func op_c118_0_nf; -extern xcpuop_func op_c118_0_ff; -extern xcpuop_func op_c120_0_nf; -extern xcpuop_func op_c120_0_ff; -extern xcpuop_func op_c128_0_nf; -extern xcpuop_func op_c128_0_ff; -extern xcpuop_func op_c130_0_nf; -extern xcpuop_func op_c130_0_ff; -extern xcpuop_func op_c138_0_nf; -extern xcpuop_func op_c138_0_ff; -extern xcpuop_func op_c139_0_nf; -extern xcpuop_func op_c139_0_ff; -extern xcpuop_func op_c140_0_nf; -extern xcpuop_func op_c140_0_ff; -extern xcpuop_func op_c148_0_nf; -extern xcpuop_func op_c148_0_ff; -extern xcpuop_func op_c150_0_nf; -extern xcpuop_func op_c150_0_ff; -extern xcpuop_func op_c158_0_nf; -extern xcpuop_func op_c158_0_ff; -extern xcpuop_func op_c160_0_nf; -extern xcpuop_func op_c160_0_ff; -extern xcpuop_func op_c168_0_nf; -extern xcpuop_func op_c168_0_ff; -extern xcpuop_func op_c170_0_nf; -extern xcpuop_func op_c170_0_ff; -extern xcpuop_func op_c178_0_nf; -extern xcpuop_func op_c178_0_ff; -extern xcpuop_func op_c179_0_nf; -extern xcpuop_func op_c179_0_ff; -extern xcpuop_func op_c188_0_nf; -extern xcpuop_func op_c188_0_ff; -extern xcpuop_func op_c190_0_nf; -extern xcpuop_func op_c190_0_ff; -extern xcpuop_func op_c198_0_nf; -extern xcpuop_func op_c198_0_ff; -extern xcpuop_func op_c1a0_0_nf; -extern xcpuop_func op_c1a0_0_ff; -extern xcpuop_func op_c1a8_0_nf; -extern xcpuop_func op_c1a8_0_ff; -extern xcpuop_func op_c1b0_0_nf; -extern xcpuop_func op_c1b0_0_ff; -extern xcpuop_func op_c1b8_0_nf; -extern xcpuop_func op_c1b8_0_ff; -extern xcpuop_func op_c1b9_0_nf; -extern xcpuop_func op_c1b9_0_ff; -extern xcpuop_func op_c1c0_0_nf; -extern xcpuop_func op_c1c0_0_ff; -extern xcpuop_func op_c1d0_0_nf; -extern xcpuop_func op_c1d0_0_ff; -extern xcpuop_func op_c1d8_0_nf; -extern xcpuop_func op_c1d8_0_ff; -extern xcpuop_func op_c1e0_0_nf; -extern xcpuop_func op_c1e0_0_ff; -extern xcpuop_func op_c1e8_0_nf; -extern xcpuop_func op_c1e8_0_ff; -extern xcpuop_func op_c1f0_0_nf; -extern xcpuop_func op_c1f0_0_ff; -extern xcpuop_func op_c1f8_0_nf; -extern xcpuop_func op_c1f8_0_ff; -extern xcpuop_func op_c1f9_0_nf; -extern xcpuop_func op_c1f9_0_ff; -extern xcpuop_func op_c1fa_0_nf; -extern xcpuop_func op_c1fa_0_ff; -extern xcpuop_func op_c1fb_0_nf; -extern xcpuop_func op_c1fb_0_ff; -extern xcpuop_func op_c1fc_0_nf; -extern xcpuop_func op_c1fc_0_ff; -extern xcpuop_func op_d000_0_nf; -extern xcpuop_func op_d000_0_ff; -extern xcpuop_func op_d010_0_nf; -extern xcpuop_func op_d010_0_ff; -extern xcpuop_func op_d018_0_nf; -extern xcpuop_func op_d018_0_ff; -extern xcpuop_func op_d020_0_nf; -extern xcpuop_func op_d020_0_ff; -extern xcpuop_func op_d028_0_nf; -extern xcpuop_func op_d028_0_ff; -extern xcpuop_func op_d030_0_nf; -extern xcpuop_func op_d030_0_ff; -extern xcpuop_func op_d038_0_nf; -extern xcpuop_func op_d038_0_ff; -extern xcpuop_func op_d039_0_nf; -extern xcpuop_func op_d039_0_ff; -extern xcpuop_func op_d03a_0_nf; -extern xcpuop_func op_d03a_0_ff; -extern xcpuop_func op_d03b_0_nf; -extern xcpuop_func op_d03b_0_ff; -extern xcpuop_func op_d03c_0_nf; -extern xcpuop_func op_d03c_0_ff; -extern xcpuop_func op_d040_0_nf; -extern xcpuop_func op_d040_0_ff; -extern xcpuop_func op_d048_0_nf; -extern xcpuop_func op_d048_0_ff; -extern xcpuop_func op_d050_0_nf; -extern xcpuop_func op_d050_0_ff; -extern xcpuop_func op_d058_0_nf; -extern xcpuop_func op_d058_0_ff; -extern xcpuop_func op_d060_0_nf; -extern xcpuop_func op_d060_0_ff; -extern xcpuop_func op_d068_0_nf; -extern xcpuop_func op_d068_0_ff; -extern xcpuop_func op_d070_0_nf; -extern xcpuop_func op_d070_0_ff; -extern xcpuop_func op_d078_0_nf; -extern xcpuop_func op_d078_0_ff; -extern xcpuop_func op_d079_0_nf; -extern xcpuop_func op_d079_0_ff; -extern xcpuop_func op_d07a_0_nf; -extern xcpuop_func op_d07a_0_ff; -extern xcpuop_func op_d07b_0_nf; -extern xcpuop_func op_d07b_0_ff; -extern xcpuop_func op_d07c_0_nf; -extern xcpuop_func op_d07c_0_ff; -extern xcpuop_func op_d080_0_nf; -extern xcpuop_func op_d080_0_ff; -extern xcpuop_func op_d088_0_nf; -extern xcpuop_func op_d088_0_ff; -extern xcpuop_func op_d090_0_nf; -extern xcpuop_func op_d090_0_ff; -extern xcpuop_func op_d098_0_nf; -extern xcpuop_func op_d098_0_ff; -extern xcpuop_func op_d0a0_0_nf; -extern xcpuop_func op_d0a0_0_ff; -extern xcpuop_func op_d0a8_0_nf; -extern xcpuop_func op_d0a8_0_ff; -extern xcpuop_func op_d0b0_0_nf; -extern xcpuop_func op_d0b0_0_ff; -extern xcpuop_func op_d0b8_0_nf; -extern xcpuop_func op_d0b8_0_ff; -extern xcpuop_func op_d0b9_0_nf; -extern xcpuop_func op_d0b9_0_ff; -extern xcpuop_func op_d0ba_0_nf; -extern xcpuop_func op_d0ba_0_ff; -extern xcpuop_func op_d0bb_0_nf; -extern xcpuop_func op_d0bb_0_ff; -extern xcpuop_func op_d0bc_0_nf; -extern xcpuop_func op_d0bc_0_ff; -extern xcpuop_func op_d0c0_0_nf; -extern xcpuop_func op_d0c0_0_ff; -extern xcpuop_func op_d0c8_0_nf; -extern xcpuop_func op_d0c8_0_ff; -extern xcpuop_func op_d0d0_0_nf; -extern xcpuop_func op_d0d0_0_ff; -extern xcpuop_func op_d0d8_0_nf; -extern xcpuop_func op_d0d8_0_ff; -extern xcpuop_func op_d0e0_0_nf; -extern xcpuop_func op_d0e0_0_ff; -extern xcpuop_func op_d0e8_0_nf; -extern xcpuop_func op_d0e8_0_ff; -extern xcpuop_func op_d0f0_0_nf; -extern xcpuop_func op_d0f0_0_ff; -extern xcpuop_func op_d0f8_0_nf; -extern xcpuop_func op_d0f8_0_ff; -extern xcpuop_func op_d0f9_0_nf; -extern xcpuop_func op_d0f9_0_ff; -extern xcpuop_func op_d0fa_0_nf; -extern xcpuop_func op_d0fa_0_ff; -extern xcpuop_func op_d0fb_0_nf; -extern xcpuop_func op_d0fb_0_ff; -extern xcpuop_func op_d0fc_0_nf; -extern xcpuop_func op_d0fc_0_ff; -extern xcpuop_func op_d100_0_nf; -extern xcpuop_func op_d100_0_ff; -extern xcpuop_func op_d108_0_nf; -extern xcpuop_func op_d108_0_ff; -extern xcpuop_func op_d110_0_nf; -extern xcpuop_func op_d110_0_ff; -extern xcpuop_func op_d118_0_nf; -extern xcpuop_func op_d118_0_ff; -extern xcpuop_func op_d120_0_nf; -extern xcpuop_func op_d120_0_ff; -extern xcpuop_func op_d128_0_nf; -extern xcpuop_func op_d128_0_ff; -extern xcpuop_func op_d130_0_nf; -extern xcpuop_func op_d130_0_ff; -extern xcpuop_func op_d138_0_nf; -extern xcpuop_func op_d138_0_ff; -extern xcpuop_func op_d139_0_nf; -extern xcpuop_func op_d139_0_ff; -extern xcpuop_func op_d140_0_nf; -extern xcpuop_func op_d140_0_ff; -extern xcpuop_func op_d148_0_nf; -extern xcpuop_func op_d148_0_ff; -extern xcpuop_func op_d150_0_nf; -extern xcpuop_func op_d150_0_ff; -extern xcpuop_func op_d158_0_nf; -extern xcpuop_func op_d158_0_ff; -extern xcpuop_func op_d160_0_nf; -extern xcpuop_func op_d160_0_ff; -extern xcpuop_func op_d168_0_nf; -extern xcpuop_func op_d168_0_ff; -extern xcpuop_func op_d170_0_nf; -extern xcpuop_func op_d170_0_ff; -extern xcpuop_func op_d178_0_nf; -extern xcpuop_func op_d178_0_ff; -extern xcpuop_func op_d179_0_nf; -extern xcpuop_func op_d179_0_ff; -extern xcpuop_func op_d180_0_nf; -extern xcpuop_func op_d180_0_ff; -extern xcpuop_func op_d188_0_nf; -extern xcpuop_func op_d188_0_ff; -extern xcpuop_func op_d190_0_nf; -extern xcpuop_func op_d190_0_ff; -extern xcpuop_func op_d198_0_nf; -extern xcpuop_func op_d198_0_ff; -extern xcpuop_func op_d1a0_0_nf; -extern xcpuop_func op_d1a0_0_ff; -extern xcpuop_func op_d1a8_0_nf; -extern xcpuop_func op_d1a8_0_ff; -extern xcpuop_func op_d1b0_0_nf; -extern xcpuop_func op_d1b0_0_ff; -extern xcpuop_func op_d1b8_0_nf; -extern xcpuop_func op_d1b8_0_ff; -extern xcpuop_func op_d1b9_0_nf; -extern xcpuop_func op_d1b9_0_ff; -extern xcpuop_func op_d1c0_0_nf; -extern xcpuop_func op_d1c0_0_ff; -extern xcpuop_func op_d1c8_0_nf; -extern xcpuop_func op_d1c8_0_ff; -extern xcpuop_func op_d1d0_0_nf; -extern xcpuop_func op_d1d0_0_ff; -extern xcpuop_func op_d1d8_0_nf; -extern xcpuop_func op_d1d8_0_ff; -extern xcpuop_func op_d1e0_0_nf; -extern xcpuop_func op_d1e0_0_ff; -extern xcpuop_func op_d1e8_0_nf; -extern xcpuop_func op_d1e8_0_ff; -extern xcpuop_func op_d1f0_0_nf; -extern xcpuop_func op_d1f0_0_ff; -extern xcpuop_func op_d1f8_0_nf; -extern xcpuop_func op_d1f8_0_ff; -extern xcpuop_func op_d1f9_0_nf; -extern xcpuop_func op_d1f9_0_ff; -extern xcpuop_func op_d1fa_0_nf; -extern xcpuop_func op_d1fa_0_ff; -extern xcpuop_func op_d1fb_0_nf; -extern xcpuop_func op_d1fb_0_ff; -extern xcpuop_func op_d1fc_0_nf; -extern xcpuop_func op_d1fc_0_ff; -extern xcpuop_func op_e000_0_nf; -extern xcpuop_func op_e000_0_ff; -extern xcpuop_func op_e008_0_nf; -extern xcpuop_func op_e008_0_ff; -extern xcpuop_func op_e010_0_nf; -extern xcpuop_func op_e010_0_ff; -extern xcpuop_func op_e018_0_nf; -extern xcpuop_func op_e018_0_ff; -extern xcpuop_func op_e020_0_nf; -extern xcpuop_func op_e020_0_ff; -extern xcpuop_func op_e028_0_nf; -extern xcpuop_func op_e028_0_ff; -extern xcpuop_func op_e030_0_nf; -extern xcpuop_func op_e030_0_ff; -extern xcpuop_func op_e038_0_nf; -extern xcpuop_func op_e038_0_ff; -extern xcpuop_func op_e040_0_nf; -extern xcpuop_func op_e040_0_ff; -extern xcpuop_func op_e048_0_nf; -extern xcpuop_func op_e048_0_ff; -extern xcpuop_func op_e050_0_nf; -extern xcpuop_func op_e050_0_ff; -extern xcpuop_func op_e058_0_nf; -extern xcpuop_func op_e058_0_ff; -extern xcpuop_func op_e060_0_nf; -extern xcpuop_func op_e060_0_ff; -extern xcpuop_func op_e068_0_nf; -extern xcpuop_func op_e068_0_ff; -extern xcpuop_func op_e070_0_nf; -extern xcpuop_func op_e070_0_ff; -extern xcpuop_func op_e078_0_nf; -extern xcpuop_func op_e078_0_ff; -extern xcpuop_func op_e080_0_nf; -extern xcpuop_func op_e080_0_ff; -extern xcpuop_func op_e088_0_nf; -extern xcpuop_func op_e088_0_ff; -extern xcpuop_func op_e090_0_nf; -extern xcpuop_func op_e090_0_ff; -extern xcpuop_func op_e098_0_nf; -extern xcpuop_func op_e098_0_ff; -extern xcpuop_func op_e0a0_0_nf; -extern xcpuop_func op_e0a0_0_ff; -extern xcpuop_func op_e0a8_0_nf; -extern xcpuop_func op_e0a8_0_ff; -extern xcpuop_func op_e0b0_0_nf; -extern xcpuop_func op_e0b0_0_ff; -extern xcpuop_func op_e0b8_0_nf; -extern xcpuop_func op_e0b8_0_ff; -extern xcpuop_func op_e0d0_0_nf; -extern xcpuop_func op_e0d0_0_ff; -extern xcpuop_func op_e0d8_0_nf; -extern xcpuop_func op_e0d8_0_ff; -extern xcpuop_func op_e0e0_0_nf; -extern xcpuop_func op_e0e0_0_ff; -extern xcpuop_func op_e0e8_0_nf; -extern xcpuop_func op_e0e8_0_ff; -extern xcpuop_func op_e0f0_0_nf; -extern xcpuop_func op_e0f0_0_ff; -extern xcpuop_func op_e0f8_0_nf; -extern xcpuop_func op_e0f8_0_ff; -extern xcpuop_func op_e0f9_0_nf; -extern xcpuop_func op_e0f9_0_ff; -extern xcpuop_func op_e100_0_nf; -extern xcpuop_func op_e100_0_ff; -extern xcpuop_func op_e108_0_nf; -extern xcpuop_func op_e108_0_ff; -extern xcpuop_func op_e110_0_nf; -extern xcpuop_func op_e110_0_ff; -extern xcpuop_func op_e118_0_nf; -extern xcpuop_func op_e118_0_ff; -extern xcpuop_func op_e120_0_nf; -extern xcpuop_func op_e120_0_ff; -extern xcpuop_func op_e128_0_nf; -extern xcpuop_func op_e128_0_ff; -extern xcpuop_func op_e130_0_nf; -extern xcpuop_func op_e130_0_ff; -extern xcpuop_func op_e138_0_nf; -extern xcpuop_func op_e138_0_ff; -extern xcpuop_func op_e140_0_nf; -extern xcpuop_func op_e140_0_ff; -extern xcpuop_func op_e148_0_nf; -extern xcpuop_func op_e148_0_ff; -extern xcpuop_func op_e150_0_nf; -extern xcpuop_func op_e150_0_ff; -extern xcpuop_func op_e158_0_nf; -extern xcpuop_func op_e158_0_ff; -extern xcpuop_func op_e160_0_nf; -extern xcpuop_func op_e160_0_ff; -extern xcpuop_func op_e168_0_nf; -extern xcpuop_func op_e168_0_ff; -extern xcpuop_func op_e170_0_nf; -extern xcpuop_func op_e170_0_ff; -extern xcpuop_func op_e178_0_nf; -extern xcpuop_func op_e178_0_ff; -extern xcpuop_func op_e180_0_nf; -extern xcpuop_func op_e180_0_ff; -extern xcpuop_func op_e188_0_nf; -extern xcpuop_func op_e188_0_ff; -extern xcpuop_func op_e190_0_nf; -extern xcpuop_func op_e190_0_ff; -extern xcpuop_func op_e198_0_nf; -extern xcpuop_func op_e198_0_ff; -extern xcpuop_func op_e1a0_0_nf; -extern xcpuop_func op_e1a0_0_ff; -extern xcpuop_func op_e1a8_0_nf; -extern xcpuop_func op_e1a8_0_ff; -extern xcpuop_func op_e1b0_0_nf; -extern xcpuop_func op_e1b0_0_ff; -extern xcpuop_func op_e1b8_0_nf; -extern xcpuop_func op_e1b8_0_ff; -extern xcpuop_func op_e1d0_0_nf; -extern xcpuop_func op_e1d0_0_ff; -extern xcpuop_func op_e1d8_0_nf; -extern xcpuop_func op_e1d8_0_ff; -extern xcpuop_func op_e1e0_0_nf; -extern xcpuop_func op_e1e0_0_ff; -extern xcpuop_func op_e1e8_0_nf; -extern xcpuop_func op_e1e8_0_ff; -extern xcpuop_func op_e1f0_0_nf; -extern xcpuop_func op_e1f0_0_ff; -extern xcpuop_func op_e1f8_0_nf; -extern xcpuop_func op_e1f8_0_ff; -extern xcpuop_func op_e1f9_0_nf; -extern xcpuop_func op_e1f9_0_ff; -extern xcpuop_func op_e2d0_0_nf; -extern xcpuop_func op_e2d0_0_ff; -extern xcpuop_func op_e2d8_0_nf; -extern xcpuop_func op_e2d8_0_ff; -extern xcpuop_func op_e2e0_0_nf; -extern xcpuop_func op_e2e0_0_ff; -extern xcpuop_func op_e2e8_0_nf; -extern xcpuop_func op_e2e8_0_ff; -extern xcpuop_func op_e2f0_0_nf; -extern xcpuop_func op_e2f0_0_ff; -extern xcpuop_func op_e2f8_0_nf; -extern xcpuop_func op_e2f8_0_ff; -extern xcpuop_func op_e2f9_0_nf; -extern xcpuop_func op_e2f9_0_ff; -extern xcpuop_func op_e3d0_0_nf; -extern xcpuop_func op_e3d0_0_ff; -extern xcpuop_func op_e3d8_0_nf; -extern xcpuop_func op_e3d8_0_ff; -extern xcpuop_func op_e3e0_0_nf; -extern xcpuop_func op_e3e0_0_ff; -extern xcpuop_func op_e3e8_0_nf; -extern xcpuop_func op_e3e8_0_ff; -extern xcpuop_func op_e3f0_0_nf; -extern xcpuop_func op_e3f0_0_ff; -extern xcpuop_func op_e3f8_0_nf; -extern xcpuop_func op_e3f8_0_ff; -extern xcpuop_func op_e3f9_0_nf; -extern xcpuop_func op_e3f9_0_ff; -extern xcpuop_func op_e4d0_0_nf; -extern xcpuop_func op_e4d0_0_ff; -extern xcpuop_func op_e4d8_0_nf; -extern xcpuop_func op_e4d8_0_ff; -extern xcpuop_func op_e4e0_0_nf; -extern xcpuop_func op_e4e0_0_ff; -extern xcpuop_func op_e4e8_0_nf; -extern xcpuop_func op_e4e8_0_ff; -extern xcpuop_func op_e4f0_0_nf; -extern xcpuop_func op_e4f0_0_ff; -extern xcpuop_func op_e4f8_0_nf; -extern xcpuop_func op_e4f8_0_ff; -extern xcpuop_func op_e4f9_0_nf; -extern xcpuop_func op_e4f9_0_ff; -extern xcpuop_func op_e5d0_0_nf; -extern xcpuop_func op_e5d0_0_ff; -extern xcpuop_func op_e5d8_0_nf; -extern xcpuop_func op_e5d8_0_ff; -extern xcpuop_func op_e5e0_0_nf; -extern xcpuop_func op_e5e0_0_ff; -extern xcpuop_func op_e5e8_0_nf; -extern xcpuop_func op_e5e8_0_ff; -extern xcpuop_func op_e5f0_0_nf; -extern xcpuop_func op_e5f0_0_ff; -extern xcpuop_func op_e5f8_0_nf; -extern xcpuop_func op_e5f8_0_ff; -extern xcpuop_func op_e5f9_0_nf; -extern xcpuop_func op_e5f9_0_ff; -extern xcpuop_func op_e6d0_0_nf; -extern xcpuop_func op_e6d0_0_ff; -extern xcpuop_func op_e6d8_0_nf; -extern xcpuop_func op_e6d8_0_ff; -extern xcpuop_func op_e6e0_0_nf; -extern xcpuop_func op_e6e0_0_ff; -extern xcpuop_func op_e6e8_0_nf; -extern xcpuop_func op_e6e8_0_ff; -extern xcpuop_func op_e6f0_0_nf; -extern xcpuop_func op_e6f0_0_ff; -extern xcpuop_func op_e6f8_0_nf; -extern xcpuop_func op_e6f8_0_ff; -extern xcpuop_func op_e6f9_0_nf; -extern xcpuop_func op_e6f9_0_ff; -extern xcpuop_func op_e7d0_0_nf; -extern xcpuop_func op_e7d0_0_ff; -extern xcpuop_func op_e7d8_0_nf; -extern xcpuop_func op_e7d8_0_ff; -extern xcpuop_func op_e7e0_0_nf; -extern xcpuop_func op_e7e0_0_ff; -extern xcpuop_func op_e7e8_0_nf; -extern xcpuop_func op_e7e8_0_ff; -extern xcpuop_func op_e7f0_0_nf; -extern xcpuop_func op_e7f0_0_ff; -extern xcpuop_func op_e7f8_0_nf; -extern xcpuop_func op_e7f8_0_ff; -extern xcpuop_func op_e7f9_0_nf; -extern xcpuop_func op_e7f9_0_ff; -extern xcpuop_func op_e8c0_0_nf; -extern xcpuop_func op_e8c0_0_ff; -extern xcpuop_func op_e8d0_0_nf; -extern xcpuop_func op_e8d0_0_ff; -extern xcpuop_func op_e8e8_0_nf; -extern xcpuop_func op_e8e8_0_ff; -extern xcpuop_func op_e8f0_0_nf; -extern xcpuop_func op_e8f0_0_ff; -extern xcpuop_func op_e8f8_0_nf; -extern xcpuop_func op_e8f8_0_ff; -extern xcpuop_func op_e8f9_0_nf; -extern xcpuop_func op_e8f9_0_ff; -extern xcpuop_func op_e8fa_0_nf; -extern xcpuop_func op_e8fa_0_ff; -extern xcpuop_func op_e8fb_0_nf; -extern xcpuop_func op_e8fb_0_ff; -extern xcpuop_func op_e9c0_0_nf; -extern xcpuop_func op_e9c0_0_ff; -extern xcpuop_func op_e9d0_0_nf; -extern xcpuop_func op_e9d0_0_ff; -extern xcpuop_func op_e9e8_0_nf; -extern xcpuop_func op_e9e8_0_ff; -extern xcpuop_func op_e9f0_0_nf; -extern xcpuop_func op_e9f0_0_ff; -extern xcpuop_func op_e9f8_0_nf; -extern xcpuop_func op_e9f8_0_ff; -extern xcpuop_func op_e9f9_0_nf; -extern xcpuop_func op_e9f9_0_ff; -extern xcpuop_func op_e9fa_0_nf; -extern xcpuop_func op_e9fa_0_ff; -extern xcpuop_func op_e9fb_0_nf; -extern xcpuop_func op_e9fb_0_ff; -extern xcpuop_func op_eac0_0_nf; -extern xcpuop_func op_eac0_0_ff; -extern xcpuop_func op_ead0_0_nf; -extern xcpuop_func op_ead0_0_ff; -extern xcpuop_func op_eae8_0_nf; -extern xcpuop_func op_eae8_0_ff; -extern xcpuop_func op_eaf0_0_nf; -extern xcpuop_func op_eaf0_0_ff; -extern xcpuop_func op_eaf8_0_nf; -extern xcpuop_func op_eaf8_0_ff; -extern xcpuop_func op_eaf9_0_nf; -extern xcpuop_func op_eaf9_0_ff; -extern xcpuop_func op_ebc0_0_nf; -extern xcpuop_func op_ebc0_0_ff; -extern xcpuop_func op_ebd0_0_nf; -extern xcpuop_func op_ebd0_0_ff; -extern xcpuop_func op_ebe8_0_nf; -extern xcpuop_func op_ebe8_0_ff; -extern xcpuop_func op_ebf0_0_nf; -extern xcpuop_func op_ebf0_0_ff; -extern xcpuop_func op_ebf8_0_nf; -extern xcpuop_func op_ebf8_0_ff; -extern xcpuop_func op_ebf9_0_nf; -extern xcpuop_func op_ebf9_0_ff; -extern xcpuop_func op_ebfa_0_nf; -extern xcpuop_func op_ebfa_0_ff; -extern xcpuop_func op_ebfb_0_nf; -extern xcpuop_func op_ebfb_0_ff; -extern xcpuop_func op_ecc0_0_nf; -extern xcpuop_func op_ecc0_0_ff; -extern xcpuop_func op_ecd0_0_nf; -extern xcpuop_func op_ecd0_0_ff; -extern xcpuop_func op_ece8_0_nf; -extern xcpuop_func op_ece8_0_ff; -extern xcpuop_func op_ecf0_0_nf; -extern xcpuop_func op_ecf0_0_ff; -extern xcpuop_func op_ecf8_0_nf; -extern xcpuop_func op_ecf8_0_ff; -extern xcpuop_func op_ecf9_0_nf; -extern xcpuop_func op_ecf9_0_ff; -extern xcpuop_func op_edc0_0_nf; -extern xcpuop_func op_edc0_0_ff; -extern xcpuop_func op_edd0_0_nf; -extern xcpuop_func op_edd0_0_ff; -extern xcpuop_func op_ede8_0_nf; -extern xcpuop_func op_ede8_0_ff; -extern xcpuop_func op_edf0_0_nf; -extern xcpuop_func op_edf0_0_ff; -extern xcpuop_func op_edf8_0_nf; -extern xcpuop_func op_edf8_0_ff; -extern xcpuop_func op_edf9_0_nf; -extern xcpuop_func op_edf9_0_ff; -extern xcpuop_func op_edfa_0_nf; -extern xcpuop_func op_edfa_0_ff; -extern xcpuop_func op_edfb_0_nf; -extern xcpuop_func op_edfb_0_ff; -extern xcpuop_func op_eec0_0_nf; -extern xcpuop_func op_eec0_0_ff; -extern xcpuop_func op_eed0_0_nf; -extern xcpuop_func op_eed0_0_ff; -extern xcpuop_func op_eee8_0_nf; -extern xcpuop_func op_eee8_0_ff; -extern xcpuop_func op_eef0_0_nf; -extern xcpuop_func op_eef0_0_ff; -extern xcpuop_func op_eef8_0_nf; -extern xcpuop_func op_eef8_0_ff; -extern xcpuop_func op_eef9_0_nf; -extern xcpuop_func op_eef9_0_ff; -extern xcpuop_func op_efc0_0_nf; -extern xcpuop_func op_efc0_0_ff; -extern xcpuop_func op_efd0_0_nf; -extern xcpuop_func op_efd0_0_ff; -extern xcpuop_func op_efe8_0_nf; -extern xcpuop_func op_efe8_0_ff; -extern xcpuop_func op_eff0_0_nf; -extern xcpuop_func op_eff0_0_ff; -extern xcpuop_func op_eff8_0_nf; -extern xcpuop_func op_eff8_0_ff; -extern xcpuop_func op_eff9_0_nf; -extern xcpuop_func op_eff9_0_ff; -extern xcpuop_func op_f000_0_nf; -extern xcpuop_func op_f000_0_ff; -extern xcpuop_func op_f008_0_nf; -extern xcpuop_func op_f008_0_ff; -extern xcpuop_func op_f010_0_nf; -extern xcpuop_func op_f010_0_ff; -extern xcpuop_func op_f018_0_nf; -extern xcpuop_func op_f018_0_ff; -extern xcpuop_func op_f020_0_nf; -extern xcpuop_func op_f020_0_ff; -extern xcpuop_func op_f028_0_nf; -extern xcpuop_func op_f028_0_ff; -extern xcpuop_func op_f030_0_nf; -extern xcpuop_func op_f030_0_ff; -extern xcpuop_func op_f038_0_nf; -extern xcpuop_func op_f038_0_ff; -extern xcpuop_func op_f039_0_nf; -extern xcpuop_func op_f039_0_ff; -extern xcpuop_func op_f03a_0_nf; -extern xcpuop_func op_f03a_0_ff; -extern xcpuop_func op_f03b_0_nf; -extern xcpuop_func op_f03b_0_ff; -extern xcpuop_func op_f200_0_nf; -extern xcpuop_func op_f200_0_ff; -extern xcpuop_func op_f208_0_nf; -extern xcpuop_func op_f208_0_ff; -extern xcpuop_func op_f210_0_nf; -extern xcpuop_func op_f210_0_ff; -extern xcpuop_func op_f218_0_nf; -extern xcpuop_func op_f218_0_ff; -extern xcpuop_func op_f220_0_nf; -extern xcpuop_func op_f220_0_ff; -extern xcpuop_func op_f228_0_nf; -extern xcpuop_func op_f228_0_ff; -extern xcpuop_func op_f230_0_nf; -extern xcpuop_func op_f230_0_ff; -extern xcpuop_func op_f238_0_nf; -extern xcpuop_func op_f238_0_ff; -extern xcpuop_func op_f239_0_nf; -extern xcpuop_func op_f239_0_ff; -extern xcpuop_func op_f23a_0_nf; -extern xcpuop_func op_f23a_0_ff; -extern xcpuop_func op_f23b_0_nf; -extern xcpuop_func op_f23b_0_ff; -extern xcpuop_func op_f23c_0_nf; -extern xcpuop_func op_f23c_0_ff; -extern xcpuop_func op_f240_0_nf; -extern xcpuop_func op_f240_0_ff; -extern xcpuop_func op_f248_0_nf; -extern xcpuop_func op_f248_0_ff; -extern xcpuop_func op_f250_0_nf; -extern xcpuop_func op_f250_0_ff; -extern xcpuop_func op_f258_0_nf; -extern xcpuop_func op_f258_0_ff; -extern xcpuop_func op_f260_0_nf; -extern xcpuop_func op_f260_0_ff; -extern xcpuop_func op_f268_0_nf; -extern xcpuop_func op_f268_0_ff; -extern xcpuop_func op_f270_0_nf; -extern xcpuop_func op_f270_0_ff; -extern xcpuop_func op_f278_0_nf; -extern xcpuop_func op_f278_0_ff; -extern xcpuop_func op_f279_0_nf; -extern xcpuop_func op_f279_0_ff; -extern xcpuop_func op_f27a_0_nf; -extern xcpuop_func op_f27a_0_ff; -extern xcpuop_func op_f27b_0_nf; -extern xcpuop_func op_f27b_0_ff; -extern xcpuop_func op_f27c_0_nf; -extern xcpuop_func op_f27c_0_ff; -extern xcpuop_func op_f280_0_nf; -extern xcpuop_func op_f280_0_ff; -extern xcpuop_func op_f2c0_0_nf; -extern xcpuop_func op_f2c0_0_ff; -extern xcpuop_func op_f310_0_nf; -extern xcpuop_func op_f310_0_ff; -extern xcpuop_func op_f320_0_nf; -extern xcpuop_func op_f320_0_ff; -extern xcpuop_func op_f328_0_nf; -extern xcpuop_func op_f328_0_ff; -extern xcpuop_func op_f330_0_nf; -extern xcpuop_func op_f330_0_ff; -extern xcpuop_func op_f338_0_nf; -extern xcpuop_func op_f338_0_ff; -extern xcpuop_func op_f339_0_nf; -extern xcpuop_func op_f339_0_ff; -extern xcpuop_func op_f350_0_nf; -extern xcpuop_func op_f350_0_ff; -extern xcpuop_func op_f358_0_nf; -extern xcpuop_func op_f358_0_ff; -extern xcpuop_func op_f368_0_nf; -extern xcpuop_func op_f368_0_ff; -extern xcpuop_func op_f370_0_nf; -extern xcpuop_func op_f370_0_ff; -extern xcpuop_func op_f378_0_nf; -extern xcpuop_func op_f378_0_ff; -extern xcpuop_func op_f379_0_nf; -extern xcpuop_func op_f379_0_ff; -extern xcpuop_func op_f37a_0_nf; -extern xcpuop_func op_f37a_0_ff; -extern xcpuop_func op_f37b_0_nf; -extern xcpuop_func op_f37b_0_ff; -extern xcpuop_func op_f408_0_nf; -extern xcpuop_func op_f408_0_ff; -extern xcpuop_func op_f410_0_nf; -extern xcpuop_func op_f410_0_ff; -extern xcpuop_func op_f418_0_nf; -extern xcpuop_func op_f418_0_ff; -extern xcpuop_func op_f419_0_nf; -extern xcpuop_func op_f419_0_ff; -extern xcpuop_func op_f41a_0_nf; -extern xcpuop_func op_f41a_0_ff; -extern xcpuop_func op_f41b_0_nf; -extern xcpuop_func op_f41b_0_ff; -extern xcpuop_func op_f41c_0_nf; -extern xcpuop_func op_f41c_0_ff; -extern xcpuop_func op_f41d_0_nf; -extern xcpuop_func op_f41d_0_ff; -extern xcpuop_func op_f41e_0_nf; -extern xcpuop_func op_f41e_0_ff; -extern xcpuop_func op_f41f_0_nf; -extern xcpuop_func op_f41f_0_ff; -extern xcpuop_func op_f428_0_nf; -extern xcpuop_func op_f428_0_ff; -extern xcpuop_func op_f430_0_nf; -extern xcpuop_func op_f430_0_ff; -extern xcpuop_func op_f438_0_nf; -extern xcpuop_func op_f438_0_ff; -extern xcpuop_func op_f439_0_nf; -extern xcpuop_func op_f439_0_ff; -extern xcpuop_func op_f43a_0_nf; -extern xcpuop_func op_f43a_0_ff; -extern xcpuop_func op_f43b_0_nf; -extern xcpuop_func op_f43b_0_ff; -extern xcpuop_func op_f43c_0_nf; -extern xcpuop_func op_f43c_0_ff; -extern xcpuop_func op_f43d_0_nf; -extern xcpuop_func op_f43d_0_ff; -extern xcpuop_func op_f43e_0_nf; -extern xcpuop_func op_f43e_0_ff; -extern xcpuop_func op_f43f_0_nf; -extern xcpuop_func op_f43f_0_ff; -extern xcpuop_func op_f500_0_nf; -extern xcpuop_func op_f500_0_ff; -extern xcpuop_func op_f600_0_nf; -extern xcpuop_func op_f600_0_ff; -extern xcpuop_func op_f608_0_nf; -extern xcpuop_func op_f608_0_ff; -extern xcpuop_func op_f610_0_nf; -extern xcpuop_func op_f610_0_ff; -extern xcpuop_func op_f618_0_nf; -extern xcpuop_func op_f618_0_ff; -extern xcpuop_func op_f620_0_nf; -extern xcpuop_func op_f620_0_ff; -extern xcpuop_func op_f800_0_nf; -extern xcpuop_func op_f800_0_ff; -extern xcpuop_func op_f808_0_nf; -extern xcpuop_func op_f808_0_ff; -extern xcpuop_func op_f810_0_nf; -extern xcpuop_func op_f810_0_ff; -extern xcpuop_func op_f818_0_nf; -extern xcpuop_func op_f818_0_ff; -extern xcpuop_func op_f820_0_nf; -extern xcpuop_func op_f820_0_ff; -extern xcpuop_func op_f828_0_nf; -extern xcpuop_func op_f828_0_ff; -extern xcpuop_func op_f830_0_nf; -extern xcpuop_func op_f830_0_ff; -extern xcpuop_func op_f838_0_nf; -extern xcpuop_func op_f838_0_ff; -extern xcpuop_func op_f839_0_nf; -extern xcpuop_func op_f839_0_ff; -extern xcpuop_func op_f83a_0_nf; -extern xcpuop_func op_f83a_0_ff; -extern xcpuop_func op_f83b_0_nf; -extern xcpuop_func op_f83b_0_ff; diff --git a/od-win32/hardfile_win32.c b/od-win32/hardfile_win32.c index 77567a36..c3e3ac6c 100755 --- a/od-win32/hardfile_win32.c +++ b/od-win32/hardfile_win32.c @@ -16,7 +16,7 @@ #define hfd_log write_log #ifdef WINDDK -#include +#include #include #include #include // Guid definition @@ -70,11 +70,11 @@ static void rdbdump (HANDLE *h, uae_u64 offset, uae_u8 *buf, int blocksize) if (!f) return; for (i = 0; i <= blocks; i++) { - DWORD outlen, high; - high = (DWORD)(offset >> 32); + DWORD outlen, high; + high = (DWORD)(offset >> 32); if (SetFilePointer (h, (DWORD)offset, &high, FILE_BEGIN) == INVALID_FILE_SIZE) break; - ReadFile (h, buf, blocksize, &outlen, NULL); + ReadFile (h, buf, blocksize, &outlen, NULL); fwrite (buf, 1, blocksize, f); offset += blocksize; } @@ -114,8 +114,8 @@ static int safetycheck (HANDLE *h, uae_u64 offset, uae_u8 *buf, int blocksize) offset += blocksize; } if (!empty) { - write_log ("hd ignored, not empty and no RDB detected\n"); - return 0; + write_log ("hd ignored, not empty and no RDB detected\n"); + return 0; } write_log ("hd accepted (empty)\n"); return -2; @@ -128,7 +128,7 @@ static void trim (char *s) s[strlen(s) - 1] = 0; } -int isharddrive (char *name) +int isharddrive (const char *name) { int i; @@ -141,7 +141,7 @@ int isharddrive (char *name) static char *hdz[] = { "hdz", "zip", "rar", "7z", NULL }; -int hdf_open (struct hardfiledata *hfd, char *name) +int hdf_open (struct hardfiledata *hfd, const char *name) { HANDLE h = INVALID_HANDLE_VALUE; DWORD flags; @@ -177,7 +177,7 @@ int hdf_open (struct hardfiledata *hfd, char *name) return 0; } if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL)) - write_log("FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", GetLastError()); + write_log ("FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", GetLastError()); strncpy (hfd->vendor_id, udi->vendor_id, 8); strncpy (hfd->product_id, udi->product_id, 16); strncpy (hfd->product_rev, udi->product_rev, 4); @@ -210,7 +210,7 @@ int hdf_open (struct hardfiledata *hfd, char *name) } } else { int zmode = 0; - char *ext = strrchr (name, '.'); + char *ext = strrchr (name, '.'); if (ext != NULL) { ext++; for (i = 0; hdz[i]; i++) { @@ -220,8 +220,8 @@ int hdf_open (struct hardfiledata *hfd, char *name) } h = CreateFile (name, GENERIC_READ | (hfd->readonly ? 0 : GENERIC_WRITE), hfd->readonly ? FILE_SHARE_READ : 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - hfd->handle = h; - i = strlen (name) - 1; + hfd->handle = h; + i = strlen (name) - 1; while (i >= 0) { if ((i > 0 && (name[i - 1] == '/' || name[i - 1] == '\\')) || i == 0) { strcpy (hfd->vendor_id, "UAE"); @@ -295,12 +295,12 @@ void hdf_close (struct hardfiledata *hfd) hfd->cache_valid = 0; } -int hdf_dup (struct hardfiledata *dhfd, struct hardfiledata *shfd) +int hdf_dup (struct hardfiledata *dhfd, const struct hardfiledata *shfd) { if (!shfd->handle_valid) return 0; if (shfd->handle_valid == HDF_HANDLE_WIN32) { - HANDLE duphandle; + HANDLE duphandle; if (!DuplicateHandle (GetCurrentProcess(), shfd->handle, GetCurrentProcess() , &duphandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) return 0; dhfd->handle = duphandle; @@ -344,7 +344,7 @@ static int hdf_seek (struct hardfiledata *hfd, uae_u64 offset) abort (); } if (hfd->handle_valid == HDF_HANDLE_WIN32) { - high = (DWORD)(offset >> 32); + high = (DWORD)(offset >> 32); ret = SetFilePointer (hfd->handle, (DWORD)offset, &high, FILE_BEGIN); if (ret == INVALID_FILE_SIZE && GetLastError() != NO_ERROR) return -1; @@ -371,7 +371,7 @@ static void poscheck (struct hardfiledata *hfd, int len) gui_message ("hd: poscheck failed. seek failure, error %d", err); abort (); } - pos = ((uae_u64)high) << 32 | ret; + pos = ((uae_u64)high) << 32 | ret; } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) { pos = zfile_ftell (hfd->handle); } @@ -413,7 +413,7 @@ void hfd_flush_cache (struct hardfiledata *hfd, int now) hdf_seek (hfd, hfd->cache_offset); poscheck (hfd, CACHE_SIZE); WriteFile (hfd->handle, hfd->cache, CACHE_SIZE, &outlen, NULL); - hfd->cache_needs_flush = 0; + hfd->cache_needs_flush = 0; } } #endif @@ -468,7 +468,7 @@ static int hdf_rw (struct hardfiledata *hfd, void *bufferp, uae_u64 offset, int memcpy (buffer, hfd->cache + coff, size); outlen2 = size; } else { - ReadFile (hfd->handle, hfd->cache, size, &outlen2, NULL); + ReadFile (hfd->handle, hfd->cache, size, &outlen2, NULL); if (outlen2 == size) memcpy (buffer, hfd->cache, size); } @@ -624,7 +624,7 @@ Arguments: IntDevInfo - Handles to the interface device information list - Index - Device member + Index - Device member Return Value: @@ -642,12 +642,12 @@ Return Value: PUCHAR p; UCHAR outBuf[20000]; ULONG length = 0, - returned = 0, - returnedLength; + returned = 0, + returnedLength; DWORD interfaceDetailDataSize = 0, - reqSize, - errorCode, - i, j; + reqSize, + errorCode, + i, j; DRIVE_LAYOUT_INFORMATION *dli; DISK_GEOMETRY dg; GET_LENGTH_INFORMATION gli; @@ -658,49 +658,49 @@ Return Value: interfaceData.cbSize = sizeof (SP_INTERFACE_DEVICE_DATA); - status = SetupDiEnumDeviceInterfaces ( - IntDevInfo, // Interface Device Info handle - 0, // Device Info data - &GUID_DEVINTERFACE_DISK, // Interface registered by driver - Index, // Member - &interfaceData // Device Interface Data - ); + status = SetupDiEnumDeviceInterfaces ( + IntDevInfo, // Interface Device Info handle + 0, // Device Info data + &GUID_DEVINTERFACE_DISK, // Interface registered by driver + Index, // Member + &interfaceData // Device Interface Data + ); if (status == FALSE) { - errorCode = GetLastError(); - if (errorCode != ERROR_NO_MORE_ITEMS) { - write_log ("SetupDiEnumDeviceInterfaces failed with error: %d\n", errorCode); - } + errorCode = GetLastError(); + if (errorCode != ERROR_NO_MORE_ITEMS) { + write_log ("SetupDiEnumDeviceInterfaces failed with error: %d\n", errorCode); + } ret = 0; goto end; } - + // - // Find out required buffer size, so pass NULL + // Find out required buffer size, so pass NULL // status = SetupDiGetDeviceInterfaceDetail ( - IntDevInfo, // Interface Device info handle - &interfaceData, // Interface data for the event class - NULL, // Checking for buffer size - 0, // Checking for buffer size - &reqSize, // Buffer size required to get the detail data - NULL // Checking for buffer size - ); + IntDevInfo, // Interface Device info handle + &interfaceData, // Interface data for the event class + NULL, // Checking for buffer size + 0, // Checking for buffer size + &reqSize, // Buffer size required to get the detail data + NULL // Checking for buffer size + ); // - // This call returns ERROR_INSUFFICIENT_BUFFER with reqSize + // This call returns ERROR_INSUFFICIENT_BUFFER with reqSize // set to the required buffer size. Ignore the above error and // pass a bigger buffer to get the detail data // if (status == FALSE) { - errorCode = GetLastError(); - if (errorCode != ERROR_INSUFFICIENT_BUFFER) { - write_log("SetupDiGetDeviceInterfaceDetail failed with error: %d\n", errorCode); + errorCode = GetLastError(); + if (errorCode != ERROR_INSUFFICIENT_BUFFER) { + write_log ("SetupDiGetDeviceInterfaceDetail failed with error: %d\n", errorCode); ret = 0; goto end; - } + } } // @@ -711,22 +711,22 @@ Return Value: interfaceDetailDataSize = reqSize; interfaceDetailData = malloc (interfaceDetailDataSize); if ( interfaceDetailData == NULL ) { - write_log ("Unable to allocate memory to get the interface detail data.\n"); + write_log ("Unable to allocate memory to get the interface detail data.\n"); ret = 0; goto end; } interfaceDetailData->cbSize = sizeof (SP_INTERFACE_DEVICE_DETAIL_DATA); status = SetupDiGetDeviceInterfaceDetail ( - IntDevInfo, // Interface Device info handle - &interfaceData, // Interface data for the event class - interfaceDetailData, // Interface detail data - interfaceDetailDataSize, // Interface detail data size - &reqSize, // Buffer size required to get the detail data - NULL); // Interface device info + IntDevInfo, // Interface Device info handle + &interfaceData, // Interface data for the event class + interfaceDetailData, // Interface detail data + interfaceDetailDataSize, // Interface detail data size + &reqSize, // Buffer size required to get the detail data + NULL); // Interface device info if ( status == FALSE ) { - write_log("Error in SetupDiGetDeviceInterfaceDetail failed with error: %d\n", GetLastError()); + write_log ("Error in SetupDiGetDeviceInterfaceDetail failed with error: %d\n", GetLastError()); ret = 0; goto end; } @@ -739,17 +739,17 @@ Return Value: strcpy (udi->device_path, interfaceDetailData->DevicePath); write_log ("opening device '%s'\n", udi->device_path); hDevice = CreateFile( - interfaceDetailData->DevicePath, // device interface name - GENERIC_READ | GENERIC_WRITE, // dwDesiredAccess - FILE_SHARE_READ | FILE_SHARE_WRITE, // dwShareMode - NULL, // lpSecurityAttributes - OPEN_EXISTING, // dwCreationDistribution - 0, // dwFlagsAndAttributes - NULL // hTemplateFile - ); - + interfaceDetailData->DevicePath, // device interface name + GENERIC_READ | GENERIC_WRITE, // dwDesiredAccess + FILE_SHARE_READ | FILE_SHARE_WRITE, // dwShareMode + NULL, // lpSecurityAttributes + OPEN_EXISTING, // dwCreationDistribution + 0, // dwFlagsAndAttributes + NULL // hTemplateFile + ); + // - // We have the handle to talk to the device. + // We have the handle to talk to the device. // So we can release the interfaceDetailData buffer // @@ -757,7 +757,7 @@ Return Value: interfaceDetailData = NULL; if (hDevice == INVALID_HANDLE_VALUE) { - write_log ("CreateFile failed with error: %d\n", GetLastError()); + write_log ("CreateFile failed with error: %d\n", GetLastError()); ret = 1; goto end; } @@ -766,17 +766,17 @@ Return Value: query.QueryType = PropertyStandardQuery; status = DeviceIoControl( - hDevice, - IOCTL_STORAGE_QUERY_PROPERTY, - &query, - sizeof( STORAGE_PROPERTY_QUERY ), - &outBuf, - sizeof (outBuf), - &returnedLength, - NULL - ); + hDevice, + IOCTL_STORAGE_QUERY_PROPERTY, + &query, + sizeof( STORAGE_PROPERTY_QUERY ), + &outBuf, + sizeof (outBuf), + &returnedLength, + NULL + ); if ( !status ) { - write_log("IOCTL_STORAGE_QUERY_PROPERTY failed with error code%d.\n", GetLastError()); + write_log ("IOCTL_STORAGE_QUERY_PROPERTY failed with error code%d.\n", GetLastError()); ret = 1; goto end; } @@ -785,46 +785,46 @@ Return Value: query.PropertyId = StorageDeviceProperty; query.QueryType = PropertyStandardQuery; status = DeviceIoControl( - hDevice, - IOCTL_STORAGE_QUERY_PROPERTY, - &query, - sizeof( STORAGE_PROPERTY_QUERY ), - &outBuf, - sizeof (outBuf), - &returnedLength, - NULL); - if (!status) { - write_log ("IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n", GetLastError()); + hDevice, + IOCTL_STORAGE_QUERY_PROPERTY, + &query, + sizeof( STORAGE_PROPERTY_QUERY ), + &outBuf, + sizeof (outBuf), + &returnedLength, + NULL); + if (!status) { + write_log ("IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n", GetLastError()); ret = 1; goto end; - } - devDesc = (PSTORAGE_DEVICE_DESCRIPTOR) outBuf; - p = (PUCHAR) outBuf; - if (devDesc->DeviceType != INQ_DASD && devDesc->DeviceType != INQ_ROMD && devDesc->DeviceType != INQ_OPTD) { + } + devDesc = (PSTORAGE_DEVICE_DESCRIPTOR) outBuf; + p = (PUCHAR) outBuf; + if (devDesc->DeviceType != INQ_DASD && devDesc->DeviceType != INQ_ROMD && devDesc->DeviceType != INQ_OPTD) { ret = 1; write_log ("not a direct access device, ignored (type=%d)\n", devDesc->DeviceType); goto end; } - if (devDesc->VendorIdOffset && p[devDesc->VendorIdOffset]) { - j = 0; - for (i = devDesc->VendorIdOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) - udi->vendor_id[j++] = p[i]; - } - if (devDesc->ProductIdOffset && p[devDesc->ProductIdOffset]) { - j = 0; - for (i = devDesc->ProductIdOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) - udi->product_id[j++] = p[i]; - } - if (devDesc->ProductRevisionOffset && p[devDesc->ProductRevisionOffset]) { + if (devDesc->VendorIdOffset && p[devDesc->VendorIdOffset]) { + j = 0; + for (i = devDesc->VendorIdOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) + udi->vendor_id[j++] = p[i]; + } + if (devDesc->ProductIdOffset && p[devDesc->ProductIdOffset]) { + j = 0; + for (i = devDesc->ProductIdOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) + udi->product_id[j++] = p[i]; + } + if (devDesc->ProductRevisionOffset && p[devDesc->ProductRevisionOffset]) { j = 0; for (i = devDesc->ProductRevisionOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) - udi->product_rev[j++] = p[i]; - } - if (devDesc->SerialNumberOffset && p[devDesc->SerialNumberOffset]) { + udi->product_rev[j++] = p[i]; + } + if (devDesc->SerialNumberOffset && p[devDesc->SerialNumberOffset]) { j = 0; for (i = devDesc->SerialNumberOffset; p[i] != (UCHAR) NULL && i < returnedLength; i++) - udi->product_serial[j++] = p[i]; - } + udi->product_serial[j++] = p[i]; + } if (udi->vendor_id[0]) strcat (udi->device_name, udi->vendor_id); if (udi->product_id[0]) { @@ -843,19 +843,19 @@ Return Value: strcat (udi->device_name, udi->product_serial); } if (!udi->device_name[0]) { - write_log("empty device id?!?, replacing with device path\n"); + write_log ("empty device id?!?, replacing with device path\n"); strcpy (udi->device_name, udi->device_path); } write_log ("device id string: '%s'\n", udi->device_name); if (!DeviceIoControl (hDevice, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, (void*)&dg, sizeof (dg), &returnedLength, NULL)) { - write_log ("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with error code %d.\n", GetLastError()); - ret = 1; - goto end; + write_log ("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with error code %d.\n", GetLastError()); + ret = 1; + goto end; } gli_ok = 1; if (!DeviceIoControl (hDevice, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (void*)&gli, sizeof (gli), &returnedLength, NULL)) { - write_log ("IOCTL_DISK_GET_LENGTH_INFO failed with error code %d.\n", GetLastError()); + write_log ("IOCTL_DISK_GET_LENGTH_INFO failed with error code %d.\n", GetLastError()); gli_ok = 0; write_log ("IOCTL_DISK_GET_LENGTH_INFO not supported, detected disk size may not be correct.\n"); } @@ -881,9 +881,9 @@ Return Value: memset (outBuf, 0, sizeof (outBuf)); status = DeviceIoControl(hDevice, IOCTL_DISK_GET_DRIVE_LAYOUT, NULL, 0, - &outBuf, sizeof (outBuf), &returnedLength, NULL); + &outBuf, sizeof (outBuf), &returnedLength, NULL); if (!status) { - write_log("IOCTL_DISK_GET_DRIVE_LAYOUT failed with error code%d.\n", GetLastError()); + write_log ("IOCTL_DISK_GET_DRIVE_LAYOUT failed with error code%d.\n", GetLastError()); ret = 1; goto end; } @@ -891,9 +891,9 @@ Return Value: trim (orgname); dli = (DRIVE_LAYOUT_INFORMATION*)outBuf; if (dli->PartitionCount) { - struct uae_driveinfo *udi2 = udi; - int nonzeropart = 0; - int gotpart = 0; + struct uae_driveinfo *udi2 = udi; + int nonzeropart = 0; + int gotpart = 0; int safepart = 0; write_log ("%d MBR partitions found\n", dli->PartitionCount); for (i = 0; i < dli->PartitionCount && (*index2) < MAX_FILESYSTEM_UNITS; i++) { @@ -972,7 +972,7 @@ int hdf_init (void) if (hIntDevInfo != INVALID_HANDLE_VALUE) { while (index < MAX_FILESYSTEM_UNITS) { memset (uae_drives + index2, 0, sizeof (struct uae_driveinfo)); - if (!GetDeviceProperty (hIntDevInfo, index, &index2, buffer)) + if (!GetDeviceProperty (hIntDevInfo, index, &index2, buffer)) break; index++; num_drives = index2; @@ -1073,7 +1073,7 @@ int harddrive_to_hdf(HWND hDlg, struct uae_prefs *p, int idx) HWND hwnd, hwndprogress, hwndprogresstxt; MSG msg; int pct, cnt; - + cache = VirtualAlloc (NULL, COPY_CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE); if (!cache) goto err; @@ -1115,7 +1115,7 @@ int harddrive_to_hdf(HWND hDlg, struct uae_prefs *p, int idx) written = 0; for (;;) { if (progressdialogreturn >= 0) - break; + break; if (cnt > 0) { SendMessage(hwndprogress, PBM_SETPOS, (WPARAM)pct, 0); sprintf (tmp, "%dM / %dM (%d%%)", (int)(written >> 20), (int)(size >> 20), pct); @@ -1187,7 +1187,7 @@ err: WIN32GUI_LoadUIString (IDS_HDCLONE_FAIL, tmp, MAX_DPATH); sprintf (tmp2, tmp, progressdialogreturn, GetLastError()); gui_message (tmp2); - + ok: if (h != INVALID_HANDLE_VALUE) CloseHandle(h); diff --git a/od-win32/hq2x.c b/od-win32/hq2x.c index f9aa1c20..db73bd1a 100755 --- a/od-win32/hq2x.c +++ b/od-win32/hq2x.c @@ -49,7 +49,7 @@ inline void Interp6(unsigned char * pc, int c1, int c2, int c3) //*((int*)pc) = (c1*5+c2*2+c3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) + - (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; + (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; } inline void Interp7(unsigned char * pc, int c1, int c2, int c3) @@ -57,7 +57,7 @@ inline void Interp7(unsigned char * pc, int c1, int c2, int c3) //*((int*)pc) = (c1*6+c2+c3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) + - (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; + (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3; } inline void Interp9(unsigned char * pc, int c1, int c2, int c3) @@ -65,7 +65,7 @@ inline void Interp9(unsigned char * pc, int c1, int c2, int c3) //*((int*)pc) = (c1*2+(c2+c3)*3)/8; *((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) + - (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3; + (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3; } inline void Interp10(unsigned char * pc, int c1, int c2, int c3) @@ -73,7 +73,7 @@ inline void Interp10(unsigned char * pc, int c1, int c2, int c3) //*((int*)pc) = (c1*14+c2+c3)/16; *((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) + - (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4; + (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4; } @@ -133,8 +133,8 @@ inline bool Diff(unsigned int w1, unsigned int w2) YUV1 = RGBtoYUV[w1]; YUV2 = RGBtoYUV[w2]; return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || - ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || - ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ); } void hq2x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int BpL ) @@ -168,28 +168,28 @@ void hq2x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int if (i>0) { - w[1] = *((unsigned short*)(pIn + prevline - 2)); - w[4] = *((unsigned short*)(pIn - 2)); - w[7] = *((unsigned short*)(pIn + nextline - 2)); + w[1] = *((unsigned short*)(pIn + prevline - 2)); + w[4] = *((unsigned short*)(pIn - 2)); + w[7] = *((unsigned short*)(pIn + nextline - 2)); } else { - w[1] = w[2]; - w[4] = w[5]; - w[7] = w[8]; + w[1] = w[2]; + w[4] = w[5]; + w[7] = w[8]; } if (i trY ) || - ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || - ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) - pattern |= flag; - } - flag <<= 1; + if ( w[k] != w[5] ) + { + YUV2 = RGBtoYUV[w[k]]; + if ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) || + ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) || + ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) ) + pattern |= flag; + } + flag <<= 1; } for (k=1; k<=9; k++) - c[k] = LUT16to32[w[k]]; + c[k] = LUT16to32[w[k]]; switch (pattern) { - case 0: - case 1: - case 4: - case 32: - case 128: - case 5: - case 132: - case 160: - case 33: - case 129: - case 36: - case 133: - case 164: - case 161: - case 37: - case 165: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_20 - PIXEL11_20 - break; - } - case 2: - case 34: - case 130: - case 162: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - break; - } - case 16: - case 17: - case 48: - case 49: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_21 - break; - } - case 64: - case 65: - case 68: - case 69: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_22 - break; - } - case 8: - case 12: - case 136: - case 140: - { - PIXEL00_21 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - break; - } - case 3: - case 35: - case 131: - case 163: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_20 - PIXEL11_20 - break; - } - case 6: - case 38: - case 134: - case 166: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 20: - case 21: - case 52: - case 53: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_21 - break; - } - case 144: - case 145: - case 176: - case 177: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_20 - PIXEL11_12 - break; - } - case 192: - case 193: - case 196: - case 197: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_21 - PIXEL11_11 - break; - } - case 96: - case 97: - case 100: - case 101: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_22 - break; - } - case 40: - case 44: - case 168: - case 172: - { - PIXEL00_21 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 9: - case 13: - case 137: - case 141: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_22 - PIXEL11_20 - break; - } - case 18: - case 50: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_20 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 80: - case 81: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_20 - } - break; - } - case 72: - case 76: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 10: - case 138: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - break; - } - case 66: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - break; - } - case 24: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - break; - } - case 7: - case 39: - case 135: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 148: - case 149: - case 180: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - break; - } - case 224: - case 228: - case 225: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - break; - } - case 41: - case 169: - case 45: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 22: - case 54: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 208: - case 209: - { - PIXEL00_20 - PIXEL01_22 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 104: - case 108: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 11: - case 139: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_22 - PIXEL11_20 - break; - } - case 19: - case 51: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_10 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 146: - case 178: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_20 - break; - } - case 84: - case 85: - { - PIXEL00_20 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_10 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_21 - break; - } - case 112: - case 113: - { - PIXEL00_20 - PIXEL01_22 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_10 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 200: - case 204: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 73: - case 77: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_10 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_20 - PIXEL11_22 - break; - } - case 42: - case 170: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_21 - PIXEL11_20 - break; - } - case 14: - case 142: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_22 - PIXEL11_20 - break; - } - case 67: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_22 - break; - } - case 70: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - break; - } - case 28: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - break; - } - case 152: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - break; - } - case 194: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - break; - } - case 98: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - break; - } - case 56: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - break; - } - case 25: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_21 - break; - } - case 26: - case 31: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_21 - break; - } - case 82: - case 214: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 88: - case 248: - { - PIXEL00_21 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 74: - case 107: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 27: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_22 - PIXEL11_21 - break; - } - case 86: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - PIXEL11_10 - break; - } - case 216: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 106: - { - PIXEL00_10 - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 30: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_21 - break; - } - case 210: - { - PIXEL00_22 - PIXEL01_10 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 120: - { - PIXEL00_21 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 75: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_10 - PIXEL11_22 - break; - } - case 29: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_21 - break; - } - case 198: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - break; - } - case 184: - { - PIXEL00_21 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - break; - } - case 99: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_22 - break; - } - case 57: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_21 - break; - } - case 71: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_22 - break; - } - case 156: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - break; - } - case 226: - { - PIXEL00_22 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - break; - } - case 60: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - break; - } - case 195: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_21 - PIXEL11_11 - break; - } - case 102: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - break; - } - case 153: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_22 - PIXEL11_12 - break; - } - case 58: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 83: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 92: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 202: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 78: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_22 - break; - } - case 154: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 114: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 89: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 90: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 55: - case 23: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_0 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_20 - PIXEL11_21 - break; - } - case 182: - case 150: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_20 - break; - } - case 213: - case 212: - { - PIXEL00_20 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_0 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_21 - break; - } - case 241: - case 240: - { - PIXEL00_20 - PIXEL01_22 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_0 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 236: - case 232: - { - PIXEL00_21 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 109: - case 105: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_0 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_20 - PIXEL11_22 - break; - } - case 171: - case 43: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_21 - PIXEL11_20 - break; - } - case 143: - case 15: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_22 - PIXEL11_20 - break; - } - case 124: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 203: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - PIXEL10_10 - PIXEL11_11 - break; - } - case 62: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 211: - { - PIXEL00_11 - PIXEL01_10 - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 118: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_12 - PIXEL11_10 - break; - } - case 217: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 110: - { - PIXEL00_10 - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 155: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_22 - PIXEL11_12 - break; - } - case 188: - { - PIXEL00_21 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - break; - } - case 185: - { - PIXEL00_12 - PIXEL01_22 - PIXEL10_11 - PIXEL11_12 - break; - } - case 61: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_21 - break; - } - case 157: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_22 - PIXEL11_12 - break; - } - case 103: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_22 - break; - } - case 227: - { - PIXEL00_11 - PIXEL01_21 - PIXEL10_12 - PIXEL11_11 - break; - } - case 230: - { - PIXEL00_22 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - break; - } - case 199: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_21 - PIXEL11_11 - break; - } - case 220: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 158: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 234: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_11 - break; - } - case 242: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 59: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 121: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 87: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 79: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_22 - break; - } - case 122: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 94: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 218: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 91: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 229: - { - PIXEL00_20 - PIXEL01_20 - PIXEL10_12 - PIXEL11_11 - break; - } - case 167: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_20 - PIXEL11_20 - break; - } - case 173: - { - PIXEL00_12 - PIXEL01_20 - PIXEL10_11 - PIXEL11_20 - break; - } - case 181: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_20 - PIXEL11_12 - break; - } - case 186: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_11 - PIXEL11_12 - break; - } - case 115: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 93: - { - PIXEL00_12 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 206: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 205: - case 201: - { - PIXEL00_12 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_10 - } - else - { - PIXEL10_70 - } - PIXEL11_11 - break; - } - case 174: - case 46: - { - if (Diff(w[4], w[2])) - { - PIXEL00_10 - } - else - { - PIXEL00_70 - } - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - break; - } - case 179: - case 147: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_10 - } - else - { - PIXEL01_70 - } - PIXEL10_20 - PIXEL11_12 - break; - } - case 117: - case 116: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_10 - } - else - { - PIXEL11_70 - } - break; - } - case 189: - { - PIXEL00_12 - PIXEL01_11 - PIXEL10_11 - PIXEL11_12 - break; - } - case 231: - { - PIXEL00_11 - PIXEL01_12 - PIXEL10_12 - PIXEL11_11 - break; - } - case 126: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 219: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 125: - { - if (Diff(w[8], w[4])) - { - PIXEL00_12 - PIXEL10_0 - } - else - { - PIXEL00_61 - PIXEL10_90 - } - PIXEL01_11 - PIXEL11_10 - break; - } - case 221: - { - PIXEL00_12 - if (Diff(w[6], w[8])) - { - PIXEL01_11 - PIXEL11_0 - } - else - { - PIXEL01_60 - PIXEL11_90 - } - PIXEL10_10 - break; - } - case 207: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL01_12 - } - else - { - PIXEL00_90 - PIXEL01_61 - } - PIXEL10_10 - PIXEL11_11 - break; - } - case 238: - { - PIXEL00_10 - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - PIXEL11_11 - } - else - { - PIXEL10_90 - PIXEL11_60 - } - break; - } - case 190: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - PIXEL11_12 - } - else - { - PIXEL01_90 - PIXEL11_61 - } - PIXEL10_11 - break; - } - case 187: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - PIXEL10_11 - } - else - { - PIXEL00_90 - PIXEL10_60 - } - PIXEL01_10 - PIXEL11_12 - break; - } - case 243: - { - PIXEL00_11 - PIXEL01_10 - if (Diff(w[6], w[8])) - { - PIXEL10_12 - PIXEL11_0 - } - else - { - PIXEL10_61 - PIXEL11_90 - } - break; - } - case 119: - { - if (Diff(w[2], w[6])) - { - PIXEL00_11 - PIXEL01_0 - } - else - { - PIXEL00_60 - PIXEL01_90 - } - PIXEL10_12 - PIXEL11_10 - break; - } - case 237: - case 233: - { - PIXEL00_12 - PIXEL01_20 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 175: - case 47: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - PIXEL10_11 - PIXEL11_20 - break; - } - case 183: - case 151: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_20 - PIXEL11_12 - break; - } - case 245: - case 244: - { - PIXEL00_20 - PIXEL01_11 - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 250: - { - PIXEL00_10 - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 123: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 95: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_10 - PIXEL11_10 - break; - } - case 222: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 252: - { - PIXEL00_21 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 249: - { - PIXEL00_12 - PIXEL01_22 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 235: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_21 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 111: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_22 - break; - } - case 63: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_11 - PIXEL11_21 - break; - } - case 159: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_22 - PIXEL11_12 - break; - } - case 215: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_21 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 246: - { - PIXEL00_22 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 254: - { - PIXEL00_10 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 253: - { - PIXEL00_12 - PIXEL01_11 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 251: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - PIXEL01_10 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 239: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - PIXEL01_12 - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - PIXEL11_11 - break; - } - case 127: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_20 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_20 - } - PIXEL11_10 - break; - } - case 191: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_11 - PIXEL11_12 - break; - } - case 223: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_20 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_10 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_20 - } - break; - } - case 247: - { - PIXEL00_11 - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - PIXEL10_12 - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } - case 255: - { - if (Diff(w[4], w[2])) - { - PIXEL00_0 - } - else - { - PIXEL00_100 - } - if (Diff(w[2], w[6])) - { - PIXEL01_0 - } - else - { - PIXEL01_100 - } - if (Diff(w[8], w[4])) - { - PIXEL10_0 - } - else - { - PIXEL10_100 - } - if (Diff(w[6], w[8])) - { - PIXEL11_0 - } - else - { - PIXEL11_100 - } - break; - } + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_20 + PIXEL11_20 + break; + } + case 2: + case 34: + case 130: + case 162: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + break; + } + case 16: + case 17: + case 48: + case 49: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_21 + break; + } + case 64: + case 65: + case 68: + case 69: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_22 + break; + } + case 8: + case 12: + case 136: + case 140: + { + PIXEL00_21 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + break; + } + case 3: + case 35: + case 131: + case 163: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + break; + } + case 6: + case 38: + case 134: + case 166: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + } + case 20: + case 21: + case 52: + case 53: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_21 + break; + } + case 144: + case 145: + case 176: + case 177: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_12 + break; + } + case 192: + case 193: + case 196: + case 197: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_11 + break; + } + case 96: + case 97: + case 100: + case 101: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_22 + break; + } + case 40: + case 44: + case 168: + case 172: + { + PIXEL00_21 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + } + case 9: + case 13: + case 137: + case 141: + { + PIXEL00_12 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + break; + } + case 18: + case 50: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 80: + case 81: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_20 + } + break; + } + case 72: + case 76: + { + PIXEL00_21 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 10: + case 138: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + } + case 66: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + } + case 24: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + } + case 7: + case 39: + case 135: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + } + case 148: + case 149: + case 180: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + } + case 224: + case 228: + case 225: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + } + case 41: + case 169: + case 45: + { + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + } + case 22: + case 54: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 208: + case 209: + { + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 104: + case 108: + { + PIXEL00_21 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 11: + case 139: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + } + case 19: + case 51: + { + if (Diff(w[2], w[6])) + { + PIXEL00_11 + PIXEL01_10 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 146: + case 178: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + } + case 84: + case 85: + { + PIXEL00_20 + if (Diff(w[6], w[8])) + { + PIXEL01_11 + PIXEL11_10 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + } + case 112: + case 113: + { + PIXEL00_20 + PIXEL01_22 + if (Diff(w[6], w[8])) + { + PIXEL10_12 + PIXEL11_10 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 200: + case 204: + { + PIXEL00_21 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 73: + case 77: + { + if (Diff(w[8], w[4])) + { + PIXEL00_12 + PIXEL10_10 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + } + case 42: + case 170: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + } + case 14: + case 142: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + } + case 67: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + } + case 70: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + } + case 28: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + } + case 152: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + } + case 194: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + } + case 98: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + } + case 56: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + } + case 25: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + } + case 26: + case 31: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + } + case 82: + case 214: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 88: + case 248: + { + PIXEL00_21 + PIXEL01_22 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 74: + case 107: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 27: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_21 + break; + } + case 86: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + PIXEL11_10 + break; + } + case 216: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_10 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 106: + { + PIXEL00_10 + PIXEL01_21 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 30: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + } + case 210: + { + PIXEL00_22 + PIXEL01_10 + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 120: + { + PIXEL00_21 + PIXEL01_22 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 75: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_22 + break; + } + case 29: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + } + case 198: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + } + case 184: + { + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + } + case 99: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + } + case 57: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + } + case 71: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + } + case 156: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + } + case 226: + { + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + } + case 60: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + } + case 195: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + } + case 102: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + } + case 153: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + } + case 58: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 83: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 92: + { + PIXEL00_21 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 202: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_21 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 78: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_22 + break; + } + case 154: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 114: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 89: + { + PIXEL00_12 + PIXEL01_22 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 90: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 55: + case 23: + { + if (Diff(w[2], w[6])) + { + PIXEL00_11 + PIXEL01_0 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + } + case 182: + case 150: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + } + case 213: + case 212: + { + PIXEL00_20 + if (Diff(w[6], w[8])) + { + PIXEL01_11 + PIXEL11_0 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + } + case 241: + case 240: + { + PIXEL00_20 + PIXEL01_22 + if (Diff(w[6], w[8])) + { + PIXEL10_12 + PIXEL11_0 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 236: + case 232: + { + PIXEL00_21 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 109: + case 105: + { + if (Diff(w[8], w[4])) + { + PIXEL00_12 + PIXEL10_0 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + } + case 171: + case 43: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + } + case 143: + case 15: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + } + case 124: + { + PIXEL00_21 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 203: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_11 + break; + } + case 62: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 211: + { + PIXEL00_11 + PIXEL01_10 + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 118: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_12 + PIXEL11_10 + break; + } + case 217: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_10 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 110: + { + PIXEL00_10 + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 155: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_12 + break; + } + case 188: + { + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + } + case 185: + { + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + } + case 61: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + } + case 157: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + } + case 103: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + } + case 227: + { + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + } + case 230: + { + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + } + case 199: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + } + case 220: + { + PIXEL00_21 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 158: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 234: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_21 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_11 + break; + } + case 242: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 59: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 121: + { + PIXEL00_12 + PIXEL01_22 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 87: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 79: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_22 + break; + } + case 122: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 94: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 218: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 91: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 229: + { + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + } + case 167: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + } + case 173: + { + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + } + case 181: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + } + case 186: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_12 + break; + } + case 115: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 93: + { + PIXEL00_12 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 206: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 205: + case 201: + { + PIXEL00_12 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_10 + } + else + { + PIXEL10_70 + } + PIXEL11_11 + break; + } + case 174: + case 46: + { + if (Diff(w[4], w[2])) + { + PIXEL00_10 + } + else + { + PIXEL00_70 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + } + case 179: + case 147: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_10 + } + else + { + PIXEL01_70 + } + PIXEL10_20 + PIXEL11_12 + break; + } + case 117: + case 116: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_10 + } + else + { + PIXEL11_70 + } + break; + } + case 189: + { + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + } + case 231: + { + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + } + case 126: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 219: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_10 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 125: + { + if (Diff(w[8], w[4])) + { + PIXEL00_12 + PIXEL10_0 + } + else + { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_11 + PIXEL11_10 + break; + } + case 221: + { + PIXEL00_12 + if (Diff(w[6], w[8])) + { + PIXEL01_11 + PIXEL11_0 + } + else + { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_10 + break; + } + case 207: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL01_12 + } + else + { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_10 + PIXEL11_11 + break; + } + case 238: + { + PIXEL00_10 + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + PIXEL11_11 + } + else + { + PIXEL10_90 + PIXEL11_60 + } + break; + } + case 190: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + PIXEL11_12 + } + else + { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_11 + break; + } + case 187: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + PIXEL10_11 + } + else + { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_10 + PIXEL11_12 + break; + } + case 243: + { + PIXEL00_11 + PIXEL01_10 + if (Diff(w[6], w[8])) + { + PIXEL10_12 + PIXEL11_0 + } + else + { + PIXEL10_61 + PIXEL11_90 + } + break; + } + case 119: + { + if (Diff(w[2], w[6])) + { + PIXEL00_11 + PIXEL01_0 + } + else + { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_12 + PIXEL11_10 + break; + } + case 237: + case 233: + { + PIXEL00_12 + PIXEL01_20 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 175: + case 47: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + } + case 183: + case 151: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_20 + PIXEL11_12 + break; + } + case 245: + case 244: + { + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 250: + { + PIXEL00_10 + PIXEL01_10 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 123: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 95: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_10 + PIXEL11_10 + break; + } + case 222: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_10 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 252: + { + PIXEL00_21 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 249: + { + PIXEL00_12 + PIXEL01_22 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 235: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_21 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 111: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_22 + break; + } + case 63: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + } + case 159: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_22 + PIXEL11_12 + break; + } + case 215: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_21 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 246: + { + PIXEL00_22 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 254: + { + PIXEL00_10 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 253: + { + PIXEL00_12 + PIXEL01_11 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 251: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + PIXEL01_10 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 239: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + PIXEL01_12 + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + PIXEL11_11 + break; + } + case 127: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_20 + } + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_20 + } + PIXEL11_10 + break; + } + case 191: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_11 + PIXEL11_12 + break; + } + case 223: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_20 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_10 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_20 + } + break; + } + case 247: + { + PIXEL00_11 + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + PIXEL10_12 + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } + case 255: + { + if (Diff(w[4], w[2])) + { + PIXEL00_0 + } + else + { + PIXEL00_100 + } + if (Diff(w[2], w[6])) + { + PIXEL01_0 + } + else + { + PIXEL01_100 + } + if (Diff(w[8], w[4])) + { + PIXEL10_0 + } + else + { + PIXEL10_100 + } + if (Diff(w[6], w[8])) + { + PIXEL11_0 + } + else + { + PIXEL11_100 + } + break; + } } pIn+=2; pOut+=8; diff --git a/od-win32/ioport.c b/od-win32/ioport.c index 8032c871..d35f4392 100755 --- a/od-win32/ioport.c +++ b/od-win32/ioport.c @@ -203,20 +203,20 @@ int paraport_init (void) write_log ("PARAPORT: GetProcAddress() failed\n"); paraport_free (); } - write_log("PARAPORT:"); + write_log ("PARAPORT:"); for (i = 0; i < 4 ; i++) { sprintf (tmp, "LPT%d", i + 1); pp = pp_openport (tmp); if (pp != INVALID_HANDLE_VALUE) { mask |= 1 << i; pp_closeport (pp); - write_log(" %s", tmp); + write_log (" %s", tmp); } pp = 0; } if (!mask) write_log ("no parallel ports detected"); - write_log("\n"); + write_log ("\n"); return mask; } @@ -236,12 +236,12 @@ int paraport_open (char *port) return 0; } strcpy (oldport, port); - write_log("PARAPORT: port '%s' opened\n", port); + write_log ("PARAPORT: port '%s' opened\n", port); memset (c, 0, sizeof (PARAPORT_CYCLE)); c[0].MaskControl = PARAPORT_MASK_CONTROL | PARAPORT_MASK_CONTROL_DIRECTION; c[0].Control = PARAPORT_MASK_CONTROL_INIT | PARAPORT_MASK_CONTROL_DIRECTION; if (!pp_executecycle (pport, c, 1)) { - write_log ("PARAPORT: init executeCycle failed\n"); + write_log ("PARAPORT: init executeCycle failed\n"); } return 1; } diff --git a/od-win32/ipctester.c b/od-win32/ipctester.c index f9e3a38c..e0bb238a 100755 --- a/od-win32/ipctester.c +++ b/od-win32/ipctester.c @@ -1,5 +1,5 @@ -#include +#include #include #include @@ -15,7 +15,7 @@ static DWORD WINAPI readroutine(void *parm) DWORD ret, avail; for (;;) { - Sleep(50); + Sleep(50); if (!threadmode_in) continue; threadmode_out = 1; @@ -24,7 +24,7 @@ static DWORD WINAPI readroutine(void *parm) return 0; } if (avail > 0) { - if (!ReadFile(p, buf, sizeof buf, &ret, NULL)) { + if (!ReadFile(p, buf, sizeof buf, &ret, NULL)) { printf ("ReadFile() failed, err=%d\n", GetLastError()); return 0; } @@ -34,8 +34,8 @@ static DWORD WINAPI readroutine(void *parm) } } -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) +{ DWORD mode; DWORD tid; diff --git a/od-win32/keyboard_win32.c b/od-win32/keyboard_win32.c index 84fe1fec..309ee87d 100755 --- a/od-win32/keyboard_win32.c +++ b/od-win32/keyboard_win32.c @@ -46,7 +46,7 @@ static struct uae_input_device_kbr_default keytrans[] = { { DIK_ESCAPE, INPUTEVENT_KEY_ESC }, - + { DIK_F1, INPUTEVENT_KEY_F1 }, { DIK_F2, INPUTEVENT_KEY_F2 }, { DIK_F3, INPUTEVENT_KEY_F3 }, @@ -267,8 +267,8 @@ static int handlecdtv (int scancode, int state) int e = 0; switch (scancode) { - case DIK_UP: - if (specialpressed()) + case DIK_UP: + if (specialpressed()) e = INPUTEVENT_KEY_CDTV_PLAYPAUSE; break; case DIK_DOWN: @@ -357,7 +357,7 @@ void my_kbd_handler (int keyboard, int scancode, int newstate) if (scancode == specialkeycode()) return; - //write_log( "keyboard = %d scancode = 0x%02.2x state = %d\n", keyboard, scancode, newstate ); + //write_log ( "keyboard = %d scancode = 0x%02.2x state = %d\n", keyboard, scancode, newstate ); if (newstate) { switch (scancode) { diff --git a/od-win32/lcd.c b/od-win32/lcd.c index e090b30e..9ea401e3 100755 --- a/od-win32/lcd.c +++ b/od-win32/lcd.c @@ -73,7 +73,7 @@ static int lcd_init(void) octx.index = 0; ret = lgLcdOpen(&octx); if (ret != ERROR_SUCCESS) { - write_log("LCD: lgLcdOpen() returned %d\n", ret); + write_log ("LCD: lgLcdOpen() returned %d\n", ret); lcd_close(); return 0; } @@ -84,7 +84,7 @@ static int lcd_init(void) SelectObject(dc, bmp); GetObject (bmp, sizeof (binfo), &binfo); for (y = 0; y < binfo.bmHeight; y++) { - for (x = 0; x < binfo.bmWidth; x++) { + for (x = 0; x < binfo.bmWidth; x++) { bitmap[y * binfo.bmWidth + x] = GetPixel(dc, x, y) == 0 ? 0xff : 0; } } @@ -92,7 +92,7 @@ static int lcd_init(void) memcpy (origbitmap, bitmap, desc.Width * desc.Height); DeleteDC(dc); - write_log("LCD: Logitech LCD system initialized\n"); + write_log ("LCD: Logitech LCD system initialized\n"); return 1; } @@ -153,14 +153,14 @@ void lcd_update(int led, int on) return; if (led < 0) { - lgLcdUpdateBitmap(device, lbh, LGLCD_PRIORITY_IDLE_NO_SHOW); + lgLcdUpdateBitmap(device, lbh, LGLCD_PRIORITY_IDLE_NO_SHOW); return; } if (led >= 1 && led <= 4) { x = 23 + (led - 1) * 40; y = 17; - track = gui_data.drive_track[led - 1]; + track = gui_data.drive_track[led - 1]; if (gui_data.drive_disabled[led - 1]) track = -1; putnumbers(x, y, track, on); @@ -169,7 +169,7 @@ void lcd_update(int led, int on) } else if (led == 5) { dorect(&coords[4 * 1], on); } else if (led == 6) { - dorect(&coords[4 * 0], on); + dorect(&coords[4 * 0], on); } else if (led == 7) { y = 2; x = 125; diff --git a/od-win32/machdep/maccess.h b/od-win32/machdep/maccess.h index 36960652..9a725692 100755 --- a/od-win32/machdep/maccess.h +++ b/od-win32/machdep/maccess.h @@ -1,8 +1,8 @@ #ifndef __MACCESS_H__ #define __MACCESS_H__ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Memory access functions * * Copyright 1996 Bernd Schmidt @@ -29,7 +29,7 @@ STATIC_INLINE uae_u32 do_get_mem_long(uae_u32 *a) STATIC_INLINE uae_u16 do_get_mem_word(uae_u16 *a) { uae_u8 *b = (uae_u8 *)a; - + return (*b << 8) | (*(b+1)); } @@ -39,9 +39,9 @@ STATIC_INLINE void do_put_mem_long(uae_u32 *a, uae_u32 v) { #if !defined(X86_MSVC_ASSEMBLY) uae_u8 *b = (uae_u8 *)a; - + *b = v >> 24; - *(b+1) = v >> 16; + *(b+1) = v >> 16; *(b+2) = v >> 8; *(b+3) = v; #else @@ -58,7 +58,7 @@ STATIC_INLINE void do_put_mem_long(uae_u32 *a, uae_u32 v) STATIC_INLINE void do_put_mem_word(uae_u16 *a, uae_u16 v) { uae_u8 *b = (uae_u8 *)a; - + *b = v >> 8; *(b+1) = (uae_u8)v; } diff --git a/od-win32/machdep/support.c b/od-win32/machdep/support.c index 5bb9514c..e35927d4 100755 --- a/od-win32/machdep/support.c +++ b/od-win32/machdep/support.c @@ -1,6 +1,6 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Miscellaneous machine dependent support functions and definitions * * Copyright 1996 Bernd Schmidt diff --git a/od-win32/md-fpp.h b/od-win32/md-fpp.h index dd89ea46..db3bf5fe 100755 --- a/od-win32/md-fpp.h +++ b/od-win32/md-fpp.h @@ -100,7 +100,7 @@ STATIC_INLINE void from_exten(double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u3 *wrd2 = longarray[1]; *wrd3 = longarray[0]; // little endian if (!srcarray[0] && (srcarray[1]==0x7ff00000 || srcarray[1]==0xfff00000)) - *wrd2 = 0; // The MSB of the mantissa was set wrongly for infinity, causing a NaN + *wrd2 = 0; // The MSB of the mantissa was set wrongly for infinity, causing a NaN } #endif #endif /* X86_MSVC_ASSEMBLY */ @@ -167,10 +167,10 @@ STATIC_INLINE double to_exten(uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3) double frac; if ((wrd1 & 0x7fff0000) == 0 && wrd2 == 0 && wrd3 == 0) - return 0.0; + return 0.0; frac = ((double)wrd2 + ((double)wrd3 / twoto32)) / 2147483648.0; if (wrd1 & 0x80000000) - frac = -frac; + frac = -frac; return ldexp (frac, ((wrd1 >> 16) & 0x7fff) - 16383); } #endif @@ -183,22 +183,22 @@ STATIC_INLINE void from_exten(double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u3 double frac; if (src == 0.0) { - *wrd1 = 0; - *wrd2 = 0; - *wrd3 = 0; - return; + *wrd1 = 0; + *wrd2 = 0; + *wrd3 = 0; + return; } if (src < 0) { - *wrd1 = 0x80000000; - src = -src; + *wrd1 = 0x80000000; + src = -src; } else { - *wrd1 = 0; + *wrd1 = 0; } frac = frexp (src, &expon); frac += 0.5 / (twoto32 * twoto32); if (frac >= 1.0) { - frac /= 2.0; - expon++; + frac /= 2.0; + expon++; } *wrd1 |= (((expon + 16383 - 1) & 0x7fff) << 16); *wrd2 = (uae_u32) (frac * twoto32); diff --git a/od-win32/midi.c b/od-win32/midi.c index d5c47a25..95f069c7 100755 --- a/od-win32/midi.c +++ b/od-win32/midi.c @@ -2,7 +2,7 @@ * MODULE: midi.c * * DESCRIPTION: MIDI-handling code for MIDI-I/O. Parses the MIDI-output stream and - * sends system-exclusive MIDI-messages out using midiOutLongMsg(), while using + * sends system-exclusive MIDI-messages out using midiOutLongMsg(), while using * midiOutShortMsg() for normal MIDI-messages. MIDI-input is passed byte-for-byte * up to the Amiga's serial-port. * @@ -14,7 +14,7 @@ * 1999.09.05 1.0 Brian King - creation * 2000.01.30 1.1 Brian King - addition of midi-input * 2002.05.xx 1.2 Bernd Roesch - sysex in/MTC/Song Position pointer add - */ + */ #include "sysconfig.h" #include @@ -42,7 +42,7 @@ #define TRACE(x) #endif #define MIDI_INBUFFERS 800 //use 13 MB Buffer with this settings - //on my system it work ok with 10 but who + //on my system it work ok with 10 but who //know when windows rest for a while //with sysex size of 40 win can 8 sec sleep #define INBUFFLEN 16000 //if this is not enough a warning come @@ -128,7 +128,7 @@ static int MidiOut_Alloc(void) } outbufferselect = 0; } else { - write_log("MIDI: ERROR - MidiOutAlloc() called twice?\n"); + write_log ("MIDI: ERROR - MidiOutAlloc() called twice?\n"); } return out_allocated; } @@ -194,7 +194,7 @@ static int MidiOut_PrepareHeader(LPMIDIHDR out, LPSTR data, DWORD length) out->dwFlags = 0; if((result = midiOutPrepareHeader(outHandle, out, sizeof( MIDIHDR)))) { - write_log( "MIDI: error %s / %d\n", getmidiouterr(err, result), result); + write_log ( "MIDI: error %s / %d\n", getmidiouterr(err, result), result); result = 0; } return result; @@ -259,7 +259,7 @@ static int MidiIn_Alloc(void) } } } else { - write_log("MIDI: ERROR - MidiInAlloc() called twice?\n"); + write_log ("MIDI: ERROR - MidiInAlloc() called twice?\n"); } return in_allocated; } @@ -295,7 +295,7 @@ static void MidiIn_Free( void ) only_one_time = 0; } -static unsigned char plen[128] = { +static unsigned char plen[128] = { 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, @@ -339,16 +339,16 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr) if(data >= MIDI_CLOCK) { switch(data) { - case MIDI_CLOCK: + case MIDI_CLOCK: TRACE(( "MIDI: MIDI_CLOCK\n" )); break; - case MIDI_START: + case MIDI_START: TRACE(( "MIDI: MIDI_START\n" )); break; - case MIDI_CONTINUE: + case MIDI_CONTINUE: TRACE(( "MIDI: MIDI_CONTINUE\n" )); break; - case MIDI_STOP: + case MIDI_STOP: TRACE(( "MIDI: MIDI_STOP\n" )); break; default: @@ -407,7 +407,7 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr) midiOutShortMsg(outHandle, shortMsg); } } else { // handle input-data - + } return result; } @@ -418,25 +418,25 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr) * PURPOSE: Translate Midi in messages to raw serial data * NOTES: Sysex in not supported - + */ - + static unsigned char midibuf[BUFFLEN]; static long midi_inptr = 0, midi_inlast = 0; static void add1byte(DWORD_PTR w) //put 1 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE(("add1byte buffer full %d %d (%02.2X)\n", midi_inlast, midi_inptr, w)); - return; + TRACE(("add1byte buffer full %d %d (%02.2X)\n", midi_inlast, midi_inptr, w)); + return; } midibuf[midi_inlast++] = (uae_u8)w; } static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE(("add2byte buffer full %d %d (%04.4X)\n", midi_inlast, midi_inptr, w)); - return; + TRACE(("add2byte buffer full %d %d (%04.4X)\n", midi_inlast, midi_inptr, w)); + return; } midibuf[midi_inlast++] = (uae_u8)w; w = w >> 8; @@ -445,8 +445,8 @@ static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer static void add3byte(DWORD_PTR w) //put 3 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE(("add3byte buffer full %d %d (%08.8X)\n", midi_inlast, midi_inptr, w)); - return; + TRACE(("add3byte buffer full %d %d (%08.8X)\n", midi_inlast, midi_inptr, w)); + return; } midibuf[midi_inlast++] = (uae_u8)w; w = w >> 8; @@ -457,13 +457,13 @@ static void add3byte(DWORD_PTR w) //put 3 Byte to Midibuffer int ismidibyte(void) { - if (midi_inptr < midi_inlast) + if (midi_inptr < midi_inlast) return 1; return 0; -} +} LONG getmidibyte(void) //return midibyte or -1 if none -{ +{ int i; LONG rv; @@ -475,18 +475,18 @@ LONG getmidibyte(void) //return midibyte or -1 if none overflow = 0; } TRACE(("getmidibyte(%02.2X)\n", midibuf[midi_inptr])); - if (midibuf[midi_inptr] >= 0xf0) { // only check for free buffers if status sysex + if (midibuf[midi_inptr] >= 0xf0) { // only check for free buffers if status sysex for (i = 0;i < MIDI_INBUFFERS;i++) { if (midiin[i].dwFlags == (MHDR_DONE|MHDR_PREPARED)) { // add a buffer if one is free LeaveCriticalSection(&cs_proc); midiInAddBuffer(inHandle, &midiin[i], sizeof(MIDIHDR)); EnterCriticalSection(&cs_proc); - } + } } } rv = -1; - if (midi_inptr < midi_inlast) + if (midi_inptr < midi_inlast) rv = midibuf[midi_inptr++]; if (midi_inptr >= midi_inlast) midi_inptr = midi_inlast = 0; @@ -498,13 +498,13 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D { EnterCriticalSection (&cs_proc); if(wMsg == MIM_ERROR) { - TRACE(("MIDI Data Lost\n")); + TRACE(("MIDI Data Lost\n")); } if(wMsg == MIM_LONGDATA) { - LPMIDIHDR midiin = (LPMIDIHDR)dwParam1; - static long synum; - TRACE(("MIM_LONGDATA bytes=%d ts=%u\n", midiin->dwBytesRecorded, dwParam2)); - if (exitin == 1) + LPMIDIHDR midiin = (LPMIDIHDR)dwParam1; + static long synum; + TRACE(("MIM_LONGDATA bytes=%d ts=%u\n", midiin->dwBytesRecorded, dwParam2)); + if (exitin == 1) goto end; //for safeness midi want close if ((midi_inlast + midiin->dwBytesRecorded) >= (BUFFLEN-6)) { overflow = 1; @@ -523,14 +523,14 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D } if(wMsg == MM_MIM_DATA || wMsg == MM_MIM_MOREDATA) { - BYTE state = (BYTE)dwParam1; + BYTE state = (BYTE)dwParam1; TRACE(("%s %08.8X\n", wMsg == MM_MIM_DATA ? "MM_MIM_DATA" : "MM_MIM_MOREDATA", dwParam1)); if(state == 254) goto end; if(state < 0xf0) state = state & 0xf0; switch (state) - { + { case 0x80: //Note OFF add3byte(dwParam1); break; @@ -609,26 +609,26 @@ int Midi_Open(void) { unsigned long result = 0, i; char err[MAX_DPATH]; - + if((result = midiOutOpen(&outHandle, currprefs.win32_midioutdev, 0, 0,CALLBACK_NULL))) { - write_log("MIDI OUT: error %s / %d while opening port %d\n", getmidiouterr(err, result), result, currprefs.win32_midioutdev); + write_log ("MIDI OUT: error %s / %d while opening port %d\n", getmidiouterr(err, result), result, currprefs.win32_midioutdev); result = 0; } else { InitializeCriticalSection(&cs_proc); // We don't need input for output... - if((currprefs.win32_midiindev >= 0) && + if((currprefs.win32_midiindev >= 0) && (result = midiInOpen( &inHandle, currprefs.win32_midiindev, (DWORD_PTR)MidiInProc, 0, CALLBACK_FUNCTION|MIDI_IO_STATUS))) { - write_log( "MIDI IN: error %s / %d while opening port %d\n", getmidiinerr(err, result), result, currprefs.win32_midiindev); + write_log ( "MIDI IN: error %s / %d while opening port %d\n", getmidiinerr(err, result), result, currprefs.win32_midiindev); } else { midi_in_ready = TRUE; result=midiInStart(inHandle); } - + if(MidiOut_Alloc()) { if(midi_in_ready) { if(!MidiIn_Alloc()) { midiInClose(inHandle); - midi_in_ready = FALSE; + midi_in_ready = FALSE; } else { for (i = 0;i < MIDI_INBUFFERS; i++) { midiin[i].lpData = inbuffer[i]; @@ -647,8 +647,8 @@ int Midi_Open(void) } else { midiOutClose(outHandle); if(midi_in_ready) { - midiInClose(inHandle); - midi_in_ready = FALSE; + midiInClose(inHandle); + midi_in_ready = FALSE; } result = 0; DeleteCriticalSection(&cs_proc); @@ -697,7 +697,7 @@ void Midi_Close(void) exitin = 0; } midi_ready = FALSE; - write_log("MIDI: closed.\n"); + write_log ("MIDI: closed.\n"); DeleteCriticalSection(&cs_proc); } } diff --git a/od-win32/midiin.c b/od-win32/midiin.c index c982aac2..01845b6d 100755 --- a/od-win32/midiin.c +++ b/od-win32/midiin.c @@ -86,9 +86,9 @@ static void setmax() Disable(); max = gettime(0); for (;;) { - i = gettime(i); - if (i >= max) max = i; - else break; + i = gettime(i); + if (i >= max) max = i; + else break; } max -= 2; Enable(); @@ -110,7 +110,7 @@ static timeout() return (newtime > (lasttime + 60)); } - + static char *buffer[2] = { 0, 0} ; static long bufferlength[2] = { 0,0 }; @@ -125,39 +125,39 @@ allocbuffers() short sysex = 0; short i; for (;track;track = track->next) { - tool = (struct MIDITool *) track->toollist; - if (tool->tool.toolid == ID_MDIN) { - sysex |= tool->status; - } + tool = (struct MIDITool *) track->toollist; + if (tool->tool.toolid == ID_MDIN) { + sysex |= tool->status; + } } if (sysex & 128) { - if (allocated < 2) { - for (i=0;i<2;i++) { - if (!buffer[i]) { - buffer[i] = (char *) (*functions->myalloc)(BUFFLEN,MEMF_PUBLIC); - if (buffer[i]) { - bufferlength[i] = BUFFLEN; - allocated++; - } - else bufferlength[i] = 0; - } - } - bufferselect = 0; - } + if (allocated < 2) { + for (i=0;i<2;i++) { + if (!buffer[i]) { + buffer[i] = (char *) (*functions->myalloc)(BUFFLEN,MEMF_PUBLIC); + if (buffer[i]) { + bufferlength[i] = BUFFLEN; + allocated++; + } + else bufferlength[i] = 0; + } + } + bufferselect = 0; + } } else { - if (allocated) { - for (i=0;i<2;i++) { - if (buffer[i]) { - allocated--; - (*functions->myfree)(buffer[i],bufferlength[i]); - bufferlength[i] = 0; - buffer[i] = 0; - } - } - bufferselect = 0; - } - allocated = 0; + if (allocated) { + for (i=0;i<2;i++) { + if (buffer[i]) { + allocated--; + (*functions->myfree)(buffer[i],bufferlength[i]); + bufferlength[i] = 0; + buffer[i] = 0; + } + } + bufferselect = 0; + } + allocated = 0; } return(allocated); } @@ -168,18 +168,18 @@ struct MIDITool *copy; { struct MIDITool *tool; - tool = (struct MIDITool *) - (*functions->myalloc)(sizeof(struct MIDITool),MEMF_CLEAR); + tool = (struct MIDITool *) + (*functions->myalloc)(sizeof(struct MIDITool),MEMF_CLEAR); if (tool) { - if (copy) { - memcpy((char *)tool,(char *)copy,sizeof(struct MIDITool)); - tool->tool.next = 0; - if (tool->status & 128) allocbuffers(); - } - tool->tool.tooltype = TOOL_INPUT; - tool->tool.toolid = ID_MDIN; - tool->status = 0x7F; - tool->tool.touched = TOUCH_INIT; + if (copy) { + memcpy((char *)tool,(char *)copy,sizeof(struct MIDITool)); + tool->tool.next = 0; + if (tool->status & 128) allocbuffers(); + } + tool->tool.tooltype = TOOL_INPUT; + tool->tool.toolid = ID_MDIN; + tool->status = 0x7F; + tool->tool.touched = TOUCH_INIT; } return((struct Tool *)tool); } @@ -190,8 +190,8 @@ struct MIDITool *tool; { if (tool->status & 128) { - tool->status = 0; - allocbuffers(); + tool->status = 0; + allocbuffers(); } (*functions->myfree)(tool,sizeof(struct MIDITool)); } @@ -216,14 +216,14 @@ struct MIDITool *tool; char menuname[100]; midiinNewWindowStructure1.Screen = functions->screen; if (tool->tool.touched & TOUCH_EDIT) { - midiinNewWindowStructure1.LeftEdge = tool->tool.left; - midiinNewWindowStructure1.TopEdge = tool->tool.top; - midiinNewWindowStructure1.Width = tool->tool.width; - midiinNewWindowStructure1.Height = tool->tool.height; + midiinNewWindowStructure1.LeftEdge = tool->tool.left; + midiinNewWindowStructure1.TopEdge = tool->tool.top; + midiinNewWindowStructure1.Width = tool->tool.width; + midiinNewWindowStructure1.Height = tool->tool.height; } if (!(tool->tool.touched & TOUCH_INIT)) tool->status = 0x7F; - newwindow = (struct NewWindow *) - (*functions->DupeNewWindow)(&midiinNewWindowStructure1); + newwindow = (struct NewWindow *) + (*functions->DupeNewWindow)(&midiinNewWindowStructure1); if (!newwindow) return; newwindow->Title = 0; newwindow->Flags |= BORDERLESS; @@ -231,7 +231,7 @@ struct MIDITool *tool; window = (struct Window *) (*functions->FlashyOpenWindow)(newwindow); if (!window) return; (*functions->EmbossWindowOn)(window,WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG, - "Midi In",-1,-1,0,0); + "Midi In",-1,-1,0,0); tool->tool.window = window; (*functions->EmbossOn)(window,1,1); (*functions->EmbossOn)(window,2,1); @@ -251,37 +251,37 @@ struct MIDITool *tool; TitleMenu.MenuName = menuname; SetMenuStrip(window,&TitleMenu); for (;;) { - message = (struct IntuiMessage *)(*functions->GetIntuiMessage)(window); - class = message->Class; - code = message->Code; - gadget = (struct Gadget *) message->IAddress; - class = (*functions->SystemGadgets)(window,class,gadget,code); - ReplyMsg((struct Message *)message); - if (class == CLOSEWINDOW) break; - else if (class == GADGETUP) { - class = gadget->GadgetID; - switch (class) { - case 1 : - tool->status ^= 3; - (*functions->SelectEmbossed)(window,1,tool->status & 1); - break; - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - class = 1 << (class); - tool->status ^= class; - if (class & 128) { - if (!allocbuffers() && (tool->status & 128)) - tool->status &= ~128; - } - (*functions->SelectEmbossed) - (window,gadget->GadgetID,tool->status & class); - break; - } - } + message = (struct IntuiMessage *)(*functions->GetIntuiMessage)(window); + class = message->Class; + code = message->Code; + gadget = (struct Gadget *) message->IAddress; + class = (*functions->SystemGadgets)(window,class,gadget,code); + ReplyMsg((struct Message *)message); + if (class == CLOSEWINDOW) break; + else if (class == GADGETUP) { + class = gadget->GadgetID; + switch (class) { + case 1 : + tool->status ^= 3; + (*functions->SelectEmbossed)(window,1,tool->status & 1); + break; + case 2 : + case 3 : + case 4 : + case 5 : + case 6 : + case 7 : + class = 1 << (class); + tool->status ^= class; + if (class & 128) { + if (!allocbuffers() && (tool->status & 128)) + tool->status &= ~128; + } + (*functions->SelectEmbossed) + (window,gadget->GadgetID,tool->status & class); + break; + } + } } ClearMenuStrip(window); (*functions->EmbossOff)(window,1); @@ -315,7 +315,7 @@ extern long stdout; static struct Interrupt midiintin; -static unsigned char plen[128] = { +static unsigned char plen[128] = { 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, @@ -334,12 +334,12 @@ struct String *string; short i; unsigned long j; if (string) { - dprintf("Length: %ld\n",string->length); - for (i=0;ilength;i++) { - j = string->string[i]; - j &= 0xFF; - dprintf("%lx ",j); - } + dprintf("Length: %ld\n",string->length); + for (i=0;ilength;i++) { + j = string->string[i]; + j &= 0xFF; + dprintf("%lx ",j); + } } else dprintf("No string"); dprintf("\n"); @@ -366,103 +366,103 @@ static void eventcode() eventsignal = 1 << AllocSignal(-1); index = 0; for (;;) { - Wait(eventsignal); - for (;index != eventindex;) { - event = &eventarray[index]; - status = 1 << ((event->status >> 4) - 8); - if (status == 2) { - if (!event->byte1) { - index++; - index &= 0x1F; - continue; - } - if (event->byte2 && functions->remotecontrol[event->byte1]) { - if (functions->processinputevent) { - (*functions->processinputevent) - (functions->remotecontrol[event->byte1]); - index++; - index &= 0x1F; - continue; - } - } - } - if (status == 128) { - if (functions->multiin) { - for (track = functions->tracklist;track;track = track->next) { - tool = (struct MIDITool *) track->toollist; - if (tool->tool.toolid == ID_MDIN) { - if (tool->status & 128) break; - } - } - } - else track = master.intrack; - if (track) { - tool = (struct MIDITool *) track->toollist; - stringevent = (struct StringEvent *) - (*functions->fastallocevent)(); - if (stringevent) { - stringevent->type = EVENT_SYSX; - stringevent->tool = tool->tool.next; - stringevent->time = event->time; - if (!event->tool) { - index++; - index &= 0x1F; - continue; - } - stringevent->string = (struct String *) - (*functions->myalloc)(event->data + 3,0); - if (stringevent->string) { - stringevent->string->length = event->data + 2; - memcpy(stringevent->string->string,event->tool, - event->data); - } - stringevent->status = MIDI_SYSX; - (*functions->qevent)(stringevent); - } - } - index++; - index &= 0x1F; - continue; - } - if (functions->multiin) { - channel = event->status & 15; - track = (struct Track *) functions->tracklist; - for (;track;track = track->next) { - tool = (struct MIDITool *) track->toollist; - if (tool && (tool->tool.toolid == ID_MDIN) && - (tool->status & status)) { - if (track->channelin == channel) { - break; - } - } - } - } - else { - track = master.intrack; - } - if (track) { - tool = (struct MIDITool *) track->toollist; - if (tool && (tool->tool.toolid == ID_MDIN) && - (tool->status & status)) { - copy = (struct Event *) (*functions->fastallocevent)(); - if (copy) { - copy->type = EVENT_VOICE; - copy->tool = tool->tool.next; - copy->status = (event->status & 0xF0); - copy->byte1 = event->byte1; - copy->byte2 = event->byte2; - if (copy->status == MIDI_NOTEON) { - if (!copy->byte2) copy->status = MIDI_NOTEOFF; - } - copy->time = event->time; - (*functions->qevent)(copy); - } - } - } - index++; - index &= 0x1F; - continue; - } + Wait(eventsignal); + for (;index != eventindex;) { + event = &eventarray[index]; + status = 1 << ((event->status >> 4) - 8); + if (status == 2) { + if (!event->byte1) { + index++; + index &= 0x1F; + continue; + } + if (event->byte2 && functions->remotecontrol[event->byte1]) { + if (functions->processinputevent) { + (*functions->processinputevent) + (functions->remotecontrol[event->byte1]); + index++; + index &= 0x1F; + continue; + } + } + } + if (status == 128) { + if (functions->multiin) { + for (track = functions->tracklist;track;track = track->next) { + tool = (struct MIDITool *) track->toollist; + if (tool->tool.toolid == ID_MDIN) { + if (tool->status & 128) break; + } + } + } + else track = master.intrack; + if (track) { + tool = (struct MIDITool *) track->toollist; + stringevent = (struct StringEvent *) + (*functions->fastallocevent)(); + if (stringevent) { + stringevent->type = EVENT_SYSX; + stringevent->tool = tool->tool.next; + stringevent->time = event->time; + if (!event->tool) { + index++; + index &= 0x1F; + continue; + } + stringevent->string = (struct String *) + (*functions->myalloc)(event->data + 3,0); + if (stringevent->string) { + stringevent->string->length = event->data + 2; + memcpy(stringevent->string->string,event->tool, + event->data); + } + stringevent->status = MIDI_SYSX; + (*functions->qevent)(stringevent); + } + } + index++; + index &= 0x1F; + continue; + } + if (functions->multiin) { + channel = event->status & 15; + track = (struct Track *) functions->tracklist; + for (;track;track = track->next) { + tool = (struct MIDITool *) track->toollist; + if (tool && (tool->tool.toolid == ID_MDIN) && + (tool->status & status)) { + if (track->channelin == channel) { + break; + } + } + } + } + else { + track = master.intrack; + } + if (track) { + tool = (struct MIDITool *) track->toollist; + if (tool && (tool->tool.toolid == ID_MDIN) && + (tool->status & status)) { + copy = (struct Event *) (*functions->fastallocevent)(); + if (copy) { + copy->type = EVENT_VOICE; + copy->tool = tool->tool.next; + copy->status = (event->status & 0xF0); + copy->byte1 = event->byte1; + copy->byte2 = event->byte2; + if (copy->status == MIDI_NOTEON) { + if (!copy->byte2) copy->status = MIDI_NOTEOFF; + } + copy->time = event->time; + (*functions->qevent)(copy); + } + } + } + index++; + index &= 0x1F; + continue; + } } } @@ -487,128 +487,128 @@ static void midiincode() static char *bufferpoint = 0; for (data = custom.serdatr;;data = custom.serdatr) { - if (!(data & 0x4000)) { - if (sysexon && master.readsysex && !timeout()) continue; - return; - } - if (data & 0x8000) unknownstatus = 1; - if (sysexon && master.readsysex) reset(); - event = &eventarray[eventindex]; - custom.intreq = INTF_RBF; - data &= 0xFF; - if (data & 0x80) { - if (data >= MIDI_CLOCK) { - if (data == MIDI_CLOCK) { - timeevent.status = MIDI_CLOCK; - if (functions->midiclock) - (*functions->processmidiclock)(&timeevent); - continue; - } - if (data == MIDI_START) { - timeevent.status = MIDI_START; - if (functions->midiclock) - (*functions->processmidiclock)(&timeevent); - continue; - } - if (data == MIDI_CONTINUE) { - timeevent.status = MIDI_CONTINUE; - if (functions->midiclock) - (*functions->processmidiclock)(&timeevent); - continue; - } - if (data == MIDI_STOP) { - timeevent.status = MIDI_STOP; - if (functions->midiclock) - (*functions->processmidiclock)(&timeevent); - continue; - } - continue; - } - else if (data == MIDI_MTC) { - miditimecode = 1; - continue; - } - else if (sysexon) { /* End of Sysex. */ - if (master.readsysex) { - (*master.readsysex)(MIDI_EOX); - } - else if (allocated) { - bufferpoint[bufferindex++] = MIDI_EOX; - if (bufferindex >= BUFFLEN) bufferindex = (BUFFLEN - 1); - eventindex++; - eventindex &= 0x1F; - event->status = MIDI_SYSX; - event->time = functions->timenow; - event->byte1 = bufferselect; - event->data = bufferindex; - event->tool = (struct Tool *) bufferpoint; - Signal(eventtask,eventsignal); - bufferselect = !bufferselect; - if (bufferselect >= allocated) bufferselect = 0; - bufferpoint = buffer[bufferselect]; - } - sysexon = 0; - unknownstatus = 1; - if (data == MIDI_EOX) continue; - } - status = data; - midiinlen = plen[data & 0x7F]; - midiinpos = 0; - unknownstatus = 0; - if (data == MIDI_SYSX) { - sysexon = 1; - if (master.readsysex) { - reset(); - (*master.readsysex)(MIDI_SYSX); - } - else if (allocated) { - bufferindex = 0; - bufferpoint = buffer[bufferselect]; - bufferpoint[bufferindex++] = MIDI_SYSX; - } - continue; - } - } - else if (miditimecode) { + if (!(data & 0x4000)) { + if (sysexon && master.readsysex && !timeout()) continue; + return; + } + if (data & 0x8000) unknownstatus = 1; + if (sysexon && master.readsysex) reset(); + event = &eventarray[eventindex]; + custom.intreq = INTF_RBF; + data &= 0xFF; + if (data & 0x80) { + if (data >= MIDI_CLOCK) { + if (data == MIDI_CLOCK) { + timeevent.status = MIDI_CLOCK; + if (functions->midiclock) + (*functions->processmidiclock)(&timeevent); + continue; + } + if (data == MIDI_START) { + timeevent.status = MIDI_START; + if (functions->midiclock) + (*functions->processmidiclock)(&timeevent); + continue; + } + if (data == MIDI_CONTINUE) { + timeevent.status = MIDI_CONTINUE; + if (functions->midiclock) + (*functions->processmidiclock)(&timeevent); + continue; + } + if (data == MIDI_STOP) { + timeevent.status = MIDI_STOP; + if (functions->midiclock) + (*functions->processmidiclock)(&timeevent); + continue; + } + continue; + } + else if (data == MIDI_MTC) { + miditimecode = 1; + continue; + } + else if (sysexon) { /* End of Sysex. */ + if (master.readsysex) { + (*master.readsysex)(MIDI_EOX); + } + else if (allocated) { + bufferpoint[bufferindex++] = MIDI_EOX; + if (bufferindex >= BUFFLEN) bufferindex = (BUFFLEN - 1); + eventindex++; + eventindex &= 0x1F; + event->status = MIDI_SYSX; + event->time = functions->timenow; + event->byte1 = bufferselect; + event->data = bufferindex; + event->tool = (struct Tool *) bufferpoint; + Signal(eventtask,eventsignal); + bufferselect = !bufferselect; + if (bufferselect >= allocated) bufferselect = 0; + bufferpoint = buffer[bufferselect]; + } + sysexon = 0; + unknownstatus = 1; + if (data == MIDI_EOX) continue; + } + status = data; + midiinlen = plen[data & 0x7F]; + midiinpos = 0; + unknownstatus = 0; + if (data == MIDI_SYSX) { + sysexon = 1; + if (master.readsysex) { + reset(); + (*master.readsysex)(MIDI_SYSX); + } + else if (allocated) { + bufferindex = 0; + bufferpoint = buffer[bufferselect]; + bufferpoint[bufferindex++] = MIDI_SYSX; + } + continue; + } + } + else if (miditimecode) { // if (functions->smpteclock) { - timeevent.status = MIDI_MTC; - timeevent.byte1 = data; - (*functions->processsmpteclock)(&timeevent); + timeevent.status = MIDI_MTC; + timeevent.byte1 = data; + (*functions->processsmpteclock)(&timeevent); // } - miditimecode = 0; - continue; - } - else if (sysexon) { - if (master.readsysex) { - (*master.readsysex)(data); - } - else if (allocated) { - bufferpoint[bufferindex++] = data; - if (bufferindex >= BUFFLEN) bufferindex = (BUFFLEN - 1); - } - continue; - } - else if (unknownstatus) { - continue; - } - else if (++midiinpos == 1) event->byte1 = data; - else event->byte2 = data; - if (midiinpos >= midiinlen) { - event->status = status; - midiinpos = 0; - if (status == MIDI_SONGPP) { - if (functions->midiclock) - (*functions->processmidiclock)(event); - continue; - } - else { - eventindex++; - eventindex &= 0x1F; - event->time = functions->timenow; - Signal(eventtask,eventsignal); - continue; - } - } + miditimecode = 0; + continue; + } + else if (sysexon) { + if (master.readsysex) { + (*master.readsysex)(data); + } + else if (allocated) { + bufferpoint[bufferindex++] = data; + if (bufferindex >= BUFFLEN) bufferindex = (BUFFLEN - 1); + } + continue; + } + else if (unknownstatus) { + continue; + } + else if (++midiinpos == 1) event->byte1 = data; + else event->byte2 = data; + if (midiinpos >= midiinlen) { + event->status = status; + midiinpos = 0; + if (status == MIDI_SONGPP) { + if (functions->midiclock) + (*functions->processmidiclock)(event); + continue; + } + else { + eventindex++; + eventindex &= 0x1F; + event->time = functions->timenow; + Signal(eventtask,eventsignal); + continue; + } + } } } @@ -646,7 +646,7 @@ void stealint() Disable(); oldserin = (struct Interrupt *) SetIntVector(INTB_RBF,&midiintin); Enable(); - custom.serper = 114; + custom.serper = 114; custom.intena = INTF_SETCLR | INTF_RBF; functions->releasemidi = releaseint; functions->stealmidi = 0; @@ -661,7 +661,7 @@ struct ToolMaster *inittoolmaster() midiintin.is_Code = midiincode; eventtask = CreateTask("midi in",40,eventcode,4000); if (functions->releasemidi) { - (*functions->releasemidi)(); + (*functions->releasemidi)(); } functions->releasemidi = releaseint; stealint(); diff --git a/od-win32/mman.c b/od-win32/mman.c index ae654525..76fc2910 100755 --- a/od-win32/mman.c +++ b/od-win32/mman.c @@ -4,7 +4,7 @@ #include -#include "sysconfig.h" +#include "sysconfig.h" #include "sysdeps.h" #include "sys/mman.h" #include "memory.h" @@ -31,7 +31,7 @@ static uae_u8 *p96mem_offset; static uae_u8 *p96fakeram; static int p96fakeramsize; -static void *virtualallocwithlock(LPVOID addr, SIZE_T size, DWORD allocationtype, DWORD protect) +static void *virtualallocwithlock(LPVOID addr, SIZE_T size, DWORD allocationtype, DWORD protect) { void *p = VirtualAlloc (addr, size, allocationtype, protect); if (p && memorylocking && os_winnt) @@ -63,7 +63,7 @@ static void setworkingset(void) pSetProcessWorkingSetSize = (SETPROCESSWORKINGSETSIZE)GetProcAddress(GetModuleHandle("kernal32.dll", "GetProcessWorkingSetSize"); if (!pSetProcessWorkingSetSize) return; - pSetProcessWorkingSetSize(GetCurrentProcess (), + pSetProcessWorkingSetSize(GetCurrentProcess (), ); #endif @@ -128,10 +128,10 @@ void init_shm(void) blah = VirtualAlloc(NULL, size + add, MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (blah) break; - write_log("NATMEM: %dM area failed to allocate, err=%d\n", (size + add) >> 20, GetLastError()); + write_log ("NATMEM: %dM area failed to allocate, err=%d\n", (size + add) >> 20, GetLastError()); size >>= 1; if (size < 0x10000000) { - write_log("NATMEM: No special area could be allocated (2)!\n"); + write_log ("NATMEM: No special area could be allocated (2)!\n"); return; } } @@ -140,7 +140,7 @@ void init_shm(void) if (p96mode) { p96mem_offset = VirtualAlloc(natmem_offset + size + add, 128 * 1024 * 1024, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_EXECUTE_READWRITE); if (!p96mem_offset) { - write_log("NATMEM: failed to allocate special Picasso96 GFX RAM\n"); + write_log ("NATMEM: failed to allocate special Picasso96 GFX RAM\n"); p96mode = 0; } } @@ -160,16 +160,16 @@ void init_shm(void) } if (!natmem_offset) { - write_log("NATMEM: No special area could be allocated! (1)\n"); + write_log ("NATMEM: No special area could be allocated! (1)\n"); } else { max_z3fastmem = size; - write_log("NATMEM: Our special area: 0x%p-0x%p (%dM)\n", + write_log ("NATMEM: Our special area: 0x%p-0x%p (%dM)\n", natmem_offset, (uae_u8*)natmem_offset + size + add, (size + add) >> 20); canbang = 1; allocated = 1; } - write_log("Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20); + write_log ("Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20); } @@ -239,10 +239,10 @@ int mprotect(void *addr, size_t len, int prot) } void *shmat(int shmid, void *shmaddr, int shmflg) -{ +{ void *result = (void *)-1; BOOL got = FALSE; - + #ifdef NATMEM_OFFSET unsigned int size=shmids[shmid].size; if(shmids[shmid].attached) @@ -341,7 +341,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg) } } #endif - + if ((shmids[shmid].key == shmid) && shmids[shmid].size) { got = FALSE; if (got == FALSE) { @@ -357,7 +357,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg) } else { if (memorylocking && os_winnt) VirtualLock(shmaddr, size); - shmids[shmid].attached = result; + shmids[shmid].attached = result; write_log ("VirtualAlloc %08.8X - %08.8X %x (%dk) ok\n", (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, size, size >> 10); diff --git a/od-win32/opengl.c b/od-win32/opengl.c index cb5c6064..b6bae926 100755 --- a/od-win32/opengl.c +++ b/od-win32/opengl.c @@ -1,4 +1,4 @@ -/* +/* * UAE - The Un*x Amiga Emulator * * OpenGL renderer @@ -128,14 +128,14 @@ static int WGLisExtensionSupported(const char *extension) // InitMultisample: Used To Query The Multisample Frequencies static int InitMultisample(HDC hDC, PIXELFORMATDESCRIPTOR *pfd) -{ +{ PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; int pixelFormat; int valid, i; UINT numFormats; float fAttributes[] = {0,0}; // These Attributes Are The Bits We Want To Test For In Our Sample - // Everything Is Pretty Standard, The Only One We Want To + // Everything Is Pretty Standard, The Only One We Want To // Really Focus On Is The SAMPLE BUFFERS ARB And WGL SAMPLES // These Two Are Going To Do The Main Testing For Whether Or Not // We Support Multisampling On This Hardware. @@ -158,8 +158,8 @@ static int InitMultisample(HDC hDC, PIXELFORMATDESCRIPTOR *pfd) return 0; // Get Our Pixel Format - wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB"); - if (!wglChoosePixelFormatARB) + wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB"); + if (!wglChoosePixelFormatARB) return 0; for (i = 8; i >= 2; i -= 2) { @@ -168,7 +168,7 @@ static int InitMultisample(HDC hDC, PIXELFORMATDESCRIPTOR *pfd) // If We Returned True, And Our Format Count Is Greater Than 1 if (valid && numFormats >= 1) { arbMultisampleSupported = i; - arbMultisampleFormat = pixelFormat; + arbMultisampleFormat = pixelFormat; write_log ("OPENGL: max FSAA = %d\n", i); return arbMultisampleSupported; } @@ -207,7 +207,7 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) for (;;) { - memset (&pfd, 0, sizeof (pfd)); + memset (&pfd, 0, sizeof (pfd)); pfd.nSize = sizeof (PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_TYPE_RGBA; @@ -230,12 +230,12 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) sprintf (errmsg, "OPENGL: can't set pixelformat %x", PixelFormat); return errmsg; } - + if (!(hrc = wglCreateContext (openglhdc))) { strcpy (errmsg, "OPENGL: can't create gl rendering context"); return errmsg; } - + if (!wglMakeCurrent (openglhdc, hrc)) { strcpy (errmsg, "OPENGL: can't activate gl rendering context"); return errmsg; @@ -269,7 +269,7 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) ext1 = glGetString (GL_EXTENSIONS); if (!init) - write_log("OpenGL extensions: %s\n", ext1); + write_log ("OpenGL extensions: %s\n", ext1); if (strstr (ext1, "EXT_packed_pixels")) packed_pixels = 1; if (strstr (ext1, "WGL_EXT_swap_control")) { @@ -293,10 +293,10 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) "EXT_packed_pixels extension was not found."); OGL_free(); return errmsg; - } + } ti2d_internalformat = GL_RGB5_A1; - ti2d_format = GL_RGBA; - ti2d_type = GL_UNSIGNED_SHORT_5_5_5_1_EXT; + ti2d_format = GL_RGBA; + ti2d_type = GL_UNSIGNED_SHORT_5_5_5_1_EXT; } if (depth == 32) { ti2d_internalformat = GL_RGBA; @@ -309,11 +309,11 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) } } if (ti2d_type < 0) { - sprintf (errmsg, "OPENGL: Only 15, 16 or 32 bit screen depths supported (was %d)", depth); - OGL_free(); + sprintf (errmsg, "OPENGL: Only 15, 16 or 32 bit screen depths supported (was %d)", depth); + OGL_free(); return errmsg; } - + glGenTextures (total_textures, tex); /* "bitplane" texture */ @@ -326,7 +326,7 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glClearColor (0.0, 0.0, 0.0, 0.0); - glShadeModel (GL_FLAT); + glShadeModel (GL_FLAT); glDisable (GL_DEPTH_TEST); glEnable (GL_TEXTURE_2D); glDisable (GL_LIGHTING); @@ -337,7 +337,7 @@ const char *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth) OGL_refresh (); init = 1; - write_log("OPENGL: using texture depth %d texture size %d * %d scanline texture size %d * %d\n", + write_log ("OPENGL: using texture depth %d texture size %d * %d scanline texture size %d * %d\n", depth, required_texture_size, required_texture_size, required_sl_texture_size, required_sl_texture_size); return 0; } @@ -356,15 +356,15 @@ static void createscanlines (int force) osl3 = currprefs.gfx_filter_scanlinelevel; osl2 = currprefs.gfx_filter_scanlineratio; if (!currprefs.gfx_filter_scanlines) { - glDisable (GL_BLEND); + glDisable (GL_BLEND); return; - } + } glEnable (GL_BLEND); scanlinetex = tex[total_textures - 1]; glBindTexture (GL_TEXTURE_2D, scanlinetex); glTexImage2D (GL_TEXTURE_2D, 0, sl_ti2d_internalformat, - required_sl_texture_size, required_sl_texture_size, 0, sl_ti2d_format, sl_ti2d_type, 0); + required_sl_texture_size, required_sl_texture_size, 0, sl_ti2d_format, sl_ti2d_type, 0); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -388,12 +388,12 @@ static void createscanlines (int force) if (packed_pixels) { /* 16-bit, R4G4B4A4 */ uae_u8 sll = sl42; - p = &sld[((y + yy) * w_width + x) * 2]; + p = &sld[((y + yy) * w_width + x) * 2]; p[0] = sl4 | (sll << 4); p[1] = (sll << 4) | (sll << 0); } else { /* 32-bit, R8G8B8A8 */ - p = &sld[((y + yy) * w_width + x) * 4]; + p = &sld[((y + yy) * w_width + x) * 4]; p[0] = p[1] = p[2] = sl82; p[3] = sl8; } @@ -418,7 +418,7 @@ static void setfilter (void) break; } if (currprefs.gfx_filter_scanlines > 0) { - glBindTexture (GL_TEXTURE_2D, scanlinetex); + glBindTexture (GL_TEXTURE_2D, scanlinetex); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); } @@ -535,7 +535,7 @@ static void OGL_dorender (int newtex) float v = (float)required_sl_texture_size; glBindTexture (GL_TEXTURE_2D, scanlinetex); glBegin (GL_QUADS); - glTexCoord2f (0, -1.0f); glVertex2f (0, 0); + glTexCoord2f (0, -1.0f); glVertex2f (0, 0); glTexCoord2f (0, 0); glVertex2f (0, v); glTexCoord2f (1.0f, 0); glVertex2f (v, v); glTexCoord2f (1.0f, -1.0f); glVertex2f (v, 0); @@ -576,7 +576,7 @@ void OGL_getpixelformat (int depth,int *rb, int *gb, int *bb, int *rs, int *gs, switch (depth) { case 32: - *rb = 8; + *rb = 8; *gb = 8; *bb = 8; *ab = 8; @@ -588,7 +588,7 @@ void OGL_getpixelformat (int depth,int *rb, int *gb, int *bb, int *rs, int *gs, break; case 15: case 16: - *rb = 5; + *rb = 5; *gb = 5; *bb = 5; *ab = 1; @@ -604,9 +604,9 @@ void OGL_getpixelformat (int depth,int *rb, int *gb, int *bb, int *rs, int *gs, void OGL_free (void) { if (hrc) { - wglMakeCurrent (NULL, NULL); - wglDeleteContext (hrc); - hrc = 0; + wglMakeCurrent (NULL, NULL); + wglDeleteContext (hrc); + hrc = 0; } if (openglhdc) { ReleaseDC (hwnd, openglhdc); diff --git a/od-win32/parser.c b/od-win32/parser.c index 0e6ad4bd..0e661099 100755 --- a/od-win32/parser.c +++ b/od-win32/parser.c @@ -1,4 +1,4 @@ -/* +/* * UAE - The Un*x Amiga Emulator * * Not a parser, but parallel and serial emulation for Win32 @@ -117,7 +117,7 @@ static void freepsbuffers (void) static int openprinter_ps (void) { char *gsargv[] = { - "-dNOPAUSE", "-dBATCH", "-dNOPAGEPROMPT", "-dNOPROMPT", "-dQUIET", "-dNoCancel", + "-dNOPAUSE", "-dBATCH", "-dNOPAGEPROMPT", "-dNOPROMPT", "-dQUIET", "-dNoCancel", "-sDEVICE=mswinpr2", NULL }; int gsargc, gsargc2, i; @@ -137,17 +137,17 @@ static int openprinter_ps (void) } if (postscript_print_debugging) { for(i = 0; i < gsargc2; i++) - write_log("GSPARM%d: '%s'\n", i, tmpparms[i]); + write_log ("GSPARM%d: '%s'\n", i, tmpparms[i]); } __try { int rc = ptr_gsapi_init_with_args (gsinstance, gsargc2, tmpparms); if (rc != 0) { - write_log("GS failed, returncode %d\n", rc); + write_log ("GS failed, returncode %d\n", rc); return 0; } ptr_gsapi_run_string_begin (gsinstance, 0, &gs_exitcode); } __except(ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) { - write_log("GS crashed\n"); + write_log ("GS crashed\n"); return 0; } psmode = 1; @@ -225,12 +225,12 @@ static void flushprtbuf (void) } else if (hPrt != INVALID_HANDLE_VALUE) { if (WritePrinter(hPrt, prtbuf, prtbufbytes, &written)) { if (written != prtbufbytes) - write_log("PRINTER: Only wrote %d of %d bytes!\n", written, prtbufbytes); + write_log ("PRINTER: Only wrote %d of %d bytes!\n", written, prtbufbytes); } else { - write_log("PRINTER: Couldn't write data!\n"); + write_log ("PRINTER: Couldn't write data!\n"); } } else { - write_log("PRINTER: Not open!\n"); + write_log ("PRINTER: Not open!\n"); } prtbufbytes = 0; } @@ -274,7 +274,7 @@ static void DoSomeWeirdPrintingStuff (char val) freepsbuffers (); return; } else if (!psmode && !stricmp (prev, "%!PS")) { - + if (postscript_print_debugging) prtdump = zfile_fopen ("psdump.dat", "wb"); @@ -363,12 +363,12 @@ int load_ghostscript (void) ptr_gsapi_revision = (GSAPI_REVISION)GetProcAddress (gsdll, "gsapi_revision"); if (!ptr_gsapi_revision) { unload_ghostscript (); - write_log("incompatible %s! (1)\n", path); + write_log ("incompatible %s! (1)\n", path); return -1; } if (ptr_gsapi_revision(&r, sizeof(r))) { unload_ghostscript (); - write_log("incompatible %s! (2)\n", path); + write_log ("incompatible %s! (2)\n", path); return -2; } ptr_gsapi_new_instance = (GSAPI_NEW_INSTANCE)GetProcAddress (gsdll, "gsapi_new_instance"); @@ -383,7 +383,7 @@ int load_ghostscript (void) !ptr_gsapi_run_string_begin || !ptr_gsapi_run_string_continue || !ptr_gsapi_run_string_end || !ptr_gsapi_init_with_args) { unload_ghostscript (); - write_log("incompatible %s! (3)\n", path); + write_log ("incompatible %s! (3)\n", path); return -3; } write_log ("%s: %s rev %d initialized\n", path, r.product, r.revision); @@ -407,7 +407,7 @@ void openprinter( void ) { DOC_INFO_1 DocInfo; static int first; - + closeprinter (); if (!currprefs.prtname[0]) return; @@ -434,9 +434,9 @@ void openprinter( void ) } } if (hPrt != INVALID_HANDLE_VALUE) { - write_log( "PRINTER: Opening printer \"%s\" with handle 0x%x.\n", currprefs.prtname, hPrt ); + write_log ( "PRINTER: Opening printer \"%s\" with handle 0x%x.\n", currprefs.prtname, hPrt ); } else if (*currprefs.prtname) { - write_log( "PRINTER: ERROR - Couldn't open printer \"%s\" for output.\n", currprefs.prtname ); + write_log ( "PRINTER: ERROR - Couldn't open printer \"%s\" for output.\n", currprefs.prtname ); } } @@ -519,7 +519,7 @@ int uaeser_query (struct uaeserialdatawin32 *sd, uae_u16 *status, uae_u32 *pendi uae_u16 s = 0; if (!ClearCommError (sd->hCom, &err, &ComStat)) - return 0; + return 0; *pending = ComStat.cbInQue; if (status) { s |= (err & CE_BREAK) ? (1 << 10) : 0; @@ -562,14 +562,14 @@ int uaeser_setparams (struct uaeserialdatawin32 *sd, int baud, int rbuffer, int dcb.fDsrSensitivity = FALSE; dcb.fOutxDsrFlow = FALSE; dcb.fDtrControl = DTR_CONTROL_DISABLE; - + if (rtscts) { - dcb.fOutxCtsFlow = TRUE; - dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; + dcb.fOutxCtsFlow = TRUE; + dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; } else { - dcb.fRtsControl = RTS_CONTROL_DISABLE; - dcb.fOutxCtsFlow = FALSE; - } + dcb.fRtsControl = RTS_CONTROL_DISABLE; + dcb.fOutxCtsFlow = FALSE; + } dcb.fTXContinueOnXoff = FALSE; if (xonxoff & 1) { @@ -590,7 +590,7 @@ int uaeser_setparams (struct uaeserialdatawin32 *sd, int baud, int rbuffer, int //dcb.XonLim = 2048; if (!SetCommState (sd->hCom, &dcb)) { - write_log("uaeserial: SetCommState() failed %d\n", GetLastError()); + write_log ("uaeserial: SetCommState() failed %d\n", GetLastError()); return 5; } SetupComm (sd->hCom, rbuffer, rbuffer); @@ -672,7 +672,7 @@ int uaeser_read (struct uaeserialdatawin32 *sd, uae_u8 *data, uae_u32 len) COMSTAT ComStat; if (!ClearCommError (sd->hCom, &err, &ComStat)) - return 0; + return 0; if (len > ComStat.cbInQue) return 0; if (!ReadFile (sd->hCom, data, len, NULL, &sd->olr)) { @@ -709,7 +709,7 @@ int uaeser_open (struct uaeserialdatawin32 *sd, void *user, int unit) sd->hCom = CreateFile (buf, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if (sd->hCom == INVALID_HANDLE_VALUE) { - write_log("UAESER: '%s' failed to open, err=%d\n", buf, GetLastError()); + write_log ("UAESER: '%s' failed to open, err=%d\n", buf, GetLastError()); goto end; } uae_sem_init (&sd->sync_sem, 0, 0); @@ -735,9 +735,9 @@ end: void uaeser_close (struct uaeserialdatawin32 *sd) { if (sd->threadactive) { - sd->threadactive = -1; - SetEvent (sd->evtt); - while (sd->threadactive) + sd->threadactive = -1; + SetEvent (sd->evtt); + while (sd->threadactive) Sleep(10); CloseHandle (sd->evtt); } @@ -819,14 +819,14 @@ int openser (char *sername) dcb.fDsrSensitivity = FALSE; dcb.fOutxDsrFlow = FALSE; dcb.fDtrControl = DTR_CONTROL_DISABLE; - + if (currprefs.serial_hwctsrts) { - dcb.fOutxCtsFlow = TRUE; - dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; + dcb.fOutxCtsFlow = TRUE; + dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; } else { - dcb.fRtsControl = RTS_CONTROL_DISABLE; - dcb.fOutxCtsFlow = FALSE; - } + dcb.fRtsControl = RTS_CONTROL_DISABLE; + dcb.fOutxCtsFlow = FALSE; + } dcb.fTXContinueOnXoff = FALSE; dcb.fOutX = FALSE; @@ -835,13 +835,13 @@ int openser (char *sername) dcb.fErrorChar = FALSE; dcb.fNull = FALSE; dcb.fAbortOnError = FALSE; - + //dcb.XoffLim = 512; //dcb.XonLim = 2048; if (SetCommState (hCom, &dcb)) { - write_log ("SERIAL: Using %s CTS/RTS=%d\n", sername, currprefs.serial_hwctsrts); - return 1; + write_log ("SERIAL: Using %s CTS/RTS=%d\n", sername, currprefs.serial_hwctsrts); + return 1; } write_log ("SERIAL: serial driver didn't accept new parameters\n"); @@ -860,7 +860,7 @@ void closeser (void) Midi_Close(); //need for camd Midi Stuff(it close midi and reopen it but serial.c think the baudrate //is the same and do not open midi), so setting serper to different value helps - serper = 0x30; + serper = 0x30; } if(writeevent) CloseHandle(writeevent); @@ -939,8 +939,8 @@ int readser (int *buffer) COMSTAT ComStat; DWORD dwErrorFlags; DWORD actual; - - + + if (midi_ready) { *buffer = getmidibyte (); if (*buffer < 0) @@ -998,7 +998,7 @@ void getserstat (int *pstatus) *pstatus = 0; if (hCom == INVALID_HANDLE_VALUE || !currprefs.use_serial) return; - + GetCommModemStatus (hCom, &stat); if (stat & MS_CTS_ON) status |= TIOCM_CTS; @@ -1065,12 +1065,12 @@ void initparallel (void) } void hsyncstuff(void) -//only generate Interrupts when +//only generate Interrupts when //writebuffer is complete flushed //check state of lwin rwin { static int keycheck = 0; - + #ifdef AHI { //begin ahi_sound static int count; @@ -1115,7 +1115,7 @@ void hsyncstuff(void) static int enumserialports_2(void) { - // Create a device information set that will be the container for + // Create a device information set that will be the container for // the device interfaces. HDEVINFO hDevInfo = INVALID_HANDLE_VALUE; SP_DEVICE_INTERFACE_DETAIL_DATA *pDetData = NULL; @@ -1127,7 +1127,7 @@ static int enumserialports_2(void) hDevInfo = SetupDiGetClassDevs(&GUID_CLASS_COMPORT, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); if(hDevInfo == INVALID_HANDLE_VALUE) - return 0; + return 0; // Enumerate the serial ports pDetData = xmalloc (dwDetDataSize); // This is required, according to the documentation. Yes, @@ -1135,17 +1135,17 @@ static int enumserialports_2(void) ifcData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); pDetData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); for (ii = 0; bOk; ii++) { - bOk = SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &GUID_CLASS_COMPORT, ii, &ifcData); - if (bOk) { + bOk = SetupDiEnumDeviceInterfaces(hDevInfo, NULL, &GUID_CLASS_COMPORT, ii, &ifcData); + if (bOk) { // Got a device. Get the details. SP_DEVINFO_DATA devdata = {sizeof(SP_DEVINFO_DATA)}; bOk = SetupDiGetDeviceInterfaceDetail(hDevInfo, - &ifcData, pDetData, dwDetDataSize, NULL, &devdata); + &ifcData, pDetData, dwDetDataSize, NULL, &devdata); if (bOk) { - // Got a path to the device. Try to get some more info. - TCHAR fname[256]; - TCHAR desc[256]; - BOOL bSuccess = SetupDiGetDeviceRegistryProperty( + // Got a path to the device. Try to get some more info. + TCHAR fname[256]; + TCHAR desc[256]; + BOOL bSuccess = SetupDiGetDeviceRegistryProperty( hDevInfo, &devdata, SPDRP_FRIENDLYNAME, NULL, (PBYTE)fname, sizeof(fname), NULL); bSuccess = bSuccess && SetupDiGetDeviceRegistryProperty( @@ -1165,17 +1165,17 @@ static int enumserialports_2(void) } else { comports[cnt].cfgname = my_strdup (pDetData->DevicePath); } - write_log("SERPORT: '%s' = '%s' = '%s'\n", comports[cnt].name, comports[cnt].cfgname, comports[cnt].dev); + write_log ("SERPORT: '%s' = '%s' = '%s'\n", comports[cnt].name, comports[cnt].cfgname, comports[cnt].dev); cnt++; } } else { - write_log("SetupDiGetDeviceInterfaceDetail failed, err=%d", GetLastError()); - goto end; + write_log ("SetupDiGetDeviceInterfaceDetail failed, err=%d", GetLastError()); + goto end; } } else { DWORD err = GetLastError(); if (err != ERROR_NO_MORE_ITEMS) { - write_log("SetupDiEnumDeviceInterfaces failed, err=%d", err); + write_log ("SetupDiEnumDeviceInterfaces failed, err=%d", err); goto end; } } @@ -1194,7 +1194,7 @@ int enumserialports(void) DWORD size = sizeof(COMMCONFIG); char devname[1000]; - write_log("Serial port enumeration..\n"); + write_log ("Serial port enumeration..\n"); cnt = 0; if (os_winnt) cnt = enumserialports_2(); @@ -1214,12 +1214,12 @@ int enumserialports(void) sprintf(comports[cnt].dev, "\\.\\\\%s", name); comports[j].cfgname = my_strdup (name); comports[j].name = my_strdup (name); - write_log("SERPORT: %d:'%s' = '%s' (%s)\n", cnt, comports[j].name, comports[j].dev, devname); + write_log ("SERPORT: %d:'%s' = '%s' (%s)\n", cnt, comports[j].name, comports[j].dev, devname); cnt++; } } } - write_log("Serial port enumeration end\n"); + write_log ("Serial port enumeration end\n"); return cnt; } diff --git a/od-win32/parser.h b/od-win32/parser.h index f5b0b380..88a300a3 100755 --- a/od-win32/parser.h +++ b/od-win32/parser.h @@ -1,4 +1,4 @@ -/* +/* * UAE - The Un*x Amiga Emulator * * Not a parser, but parallel and serial emulation for Win32 diff --git a/od-win32/picasso96_win.c b/od-win32/picasso96_win.c index 00298edb..a0e7227b 100755 --- a/od-win32/picasso96_win.c +++ b/od-win32/picasso96_win.c @@ -35,7 +35,7 @@ #include "options.h" #include "threaddep/thread.h" -#include "memory.h" +#include "memory.h" #include "custom.h" #include "events.h" #include "newcpu.h" @@ -50,9 +50,9 @@ #include "picasso96_win.h" #include "win32gfx.h" -int p96hack_vpos, p96hack_vpos2, p96refresh_active; +int p96hack_vpos, p96hack_vpos2, p96refresh_active; int have_done_picasso; /* For the JIT compiler */ -static int vsyncgfxwrite = 0; +static int vsyncgfxwrite = 0; static int p96syncrate, vsyncgfxcount; int p96hsync_counter, palette_changed; #if defined(X86_MSVC_ASSEMBLY) @@ -121,22 +121,22 @@ static void checkrtglibrary(void) return; v = get_long (4); // execbase v += 378; // liblist - while ((v = get_long(v))) { - uae_u32 v2 = get_long(v + 10); // name + while ((v = get_long (v))) { + uae_u32 v2 = get_long (v + 10); // name uae_u8 *p; addrbank *b = &get_mem_bank(v2); if (!b || !b->check (v2, 12)) continue; p = b->xlateaddr(v2); if (!memcmp(p, "rtg.library\0", 12)) { - uae_u16 ver = get_word(v + 20); - uae_u16 rev = get_word(v + 22); + uae_u16 ver = get_word (v + 20); + uae_u16 rev = get_word (v + 22); if (ver * 10000 + rev < UAE_RTG_LIBRARY_VERSION * 10000 + UAE_RTG_LIBRARY_REVISION) { char msg[2000]; WIN32GUI_LoadUIString(IDS_OLDRTGLIBRARY, msg, sizeof(msg)); gui_message(msg, ver, rev, UAE_RTG_LIBRARY_VERSION, UAE_RTG_LIBRARY_REVISION); } else { - write_log("P96: rtg.library %d.%d detected\n", ver, rev); + write_log ("P96: rtg.library %d.%d detected\n", ver, rev); } checked = TRUE; } @@ -156,13 +156,13 @@ void PICASSO96_Unlock(void) #ifdef LOCK_UNLOCK_MADNESS #if defined(P96TRACING_ENABLED) && P96TRACING_LEVEL > 1 // This format of output lets you double-click and jump to file/line - write_log( "%s(%d) : calling P96 UNLOCK with picasso_on=%d\n", filename, linenum, picasso_on); + write_log ( "%s(%d) : calling P96 UNLOCK with picasso_on=%d\n", filename, linenum, picasso_on); #endif if(picasso_on) { #ifdef PIXEL_LOCK flushpixels(); -#endif +#endif gfx_unlock_picasso (); } #endif @@ -177,7 +177,7 @@ void PICASSO96_Lock(void) #ifdef LOCK_UNLOCK_MADNESS #if defined(P96TRACING_ENABLED) && P96TRACING_LEVEL > 1 // This format of output lets you double-click and jump to file/line - write_log( "%s(%d) : calling P96 LOCK with picasso_on=%d\n", filename, linenum, picasso_on); + write_log ( "%s(%d) : calling P96 LOCK with picasso_on=%d\n", filename, linenum, picasso_on); #endif if(picasso_on) { @@ -224,9 +224,9 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr) int i; uaecptr amigamodeinfoptr; struct LibResolution *uaememptr = (struct LibResolution *)get_mem_bank(amigalibresptr).xlateaddr(amigalibresptr); - + write_log ("LibResolution Structure Dump:\n"); - + if (get_long (amigalibresptr + PSSO_LibResolution_DisplayID) == 0xFFFFFFFF) { write_log (" Finished With LibResolutions...\n"); } else { @@ -287,29 +287,29 @@ static void DumpTemplate (struct Template *tmp, unsigned long w, unsigned long h static void DumpLine( struct Line *line ) { if(line) { - write_log("Line->X = %d\n", line->X); - write_log("Line->Y = %d\n", line->Y); - write_log("Line->Length = %d\n", line->Length); - write_log("Line->dX = %d\n", line->dX); - write_log("Line->dY = %d\n", line->dY); - write_log("Line->sDelta = %d\n", line->sDelta); - write_log("Line->lDelta = %d\n", line->lDelta); - write_log("Line->twoSDminusLD = %d\n", line->twoSDminusLD); - write_log("Line->LinePtrn = %d\n", line->LinePtrn); - write_log("Line->PatternShift = %d\n", line->PatternShift); - write_log("Line->FgPen = 0x%x\n", line->FgPen); - write_log("Line->BgPen = 0x%x\n", line->BgPen); - write_log("Line->Horizontal = %d\n", line->Horizontal); - write_log("Line->DrawMode = %d\n", line->DrawMode); - write_log("Line->Xorigin = %d\n", line->Xorigin); - write_log("Line->Yorigin = %d\n", line->Yorigin); + write_log ("Line->X = %d\n", line->X); + write_log ("Line->Y = %d\n", line->Y); + write_log ("Line->Length = %d\n", line->Length); + write_log ("Line->dX = %d\n", line->dX); + write_log ("Line->dY = %d\n", line->dY); + write_log ("Line->sDelta = %d\n", line->sDelta); + write_log ("Line->lDelta = %d\n", line->lDelta); + write_log ("Line->twoSDminusLD = %d\n", line->twoSDminusLD); + write_log ("Line->LinePtrn = %d\n", line->LinePtrn); + write_log ("Line->PatternShift = %d\n", line->PatternShift); + write_log ("Line->FgPen = 0x%x\n", line->FgPen); + write_log ("Line->BgPen = 0x%x\n", line->BgPen); + write_log ("Line->Horizontal = %d\n", line->Horizontal); + write_log ("Line->DrawMode = %d\n", line->DrawMode); + write_log ("Line->Xorigin = %d\n", line->Xorigin); + write_log ("Line->Yorigin = %d\n", line->Yorigin); } #endif static void ShowSupportedResolutions (void) { int i = 0; - + write_log ("-----------------\n"); while (DisplayModes[i].depth >= 0) { write_log ("%s\n", DisplayModes[i].name); @@ -325,17 +325,17 @@ static uae_u8 GetBytesPerPixel2(uae_u32 RGBfmt, char *file, int line) switch (RGBfmt) { case RGBFB_CLUT: return 1; - + case RGBFB_A8R8G8B8: case RGBFB_A8B8G8R8: case RGBFB_R8G8B8A8: case RGBFB_B8G8R8A8: return 4; - + case RGBFB_B8G8R8: case RGBFB_R8G8B8: return 3; - + case RGBFB_R5G5B5: case RGBFB_R5G6B5: case RGBFB_R5G6B5PC: @@ -365,7 +365,7 @@ static uae_u8 GetBytesPerPixel2(uae_u32 RGBfmt, char *file, int line) static int CopyRenderInfoStructureA2U (uaecptr amigamemptr, struct RenderInfo *ri) { uaecptr memp = get_long (amigamemptr + PSSO_RenderInfo_Memory); - + if (valid_address (memp, PSSO_RenderInfo_sizeof)) { ri->Memory = get_real_address (memp); ri->BytesPerRow = get_word (amigamemptr + PSSO_RenderInfo_BytesPerRow); @@ -404,16 +404,16 @@ static void CopyColorIndexMappingA2U (uaecptr amigamemptr, struct ColorIndexMapp static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm) { int i; - + bm->BytesPerRow = get_word (amigamemptr + PSSO_BitMap_BytesPerRow); bm->Rows = get_word (amigamemptr + PSSO_BitMap_Rows); bm->Flags = get_byte (amigamemptr + PSSO_BitMap_Flags); bm->Depth = get_byte (amigamemptr + PSSO_BitMap_Depth); - + /* ARGH - why is THIS happening? */ if(bm->Depth > 8) bm->Depth = 8; - + for (i = 0; i < bm->Depth; i++) { uaecptr plane = get_long (amigamemptr + PSSO_BitMap_Planes + i*4); switch (plane) { @@ -437,7 +437,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm) static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) { uaecptr memp = get_long (amigamemptr + PSSO_Template_Memory); - + if (valid_address (memp, sizeof(struct Template))) { tmpl->Memory = get_real_address (memp); tmpl->BytesPerRow = get_word (amigamemptr + PSSO_Template_BytesPerRow); @@ -454,25 +454,25 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) static int CopyLineStructureA2U(uaecptr amigamemptr, struct Line *line) { if(valid_address(amigamemptr, sizeof(struct Line))) { - line->X = get_word(amigamemptr + PSSO_Line_X); - line->Y = get_word(amigamemptr + PSSO_Line_Y); - line->Length = get_word(amigamemptr + PSSO_Line_Length); - line->dX = get_word(amigamemptr + PSSO_Line_dX); - line->dY = get_word(amigamemptr + PSSO_Line_dY); - line->lDelta = get_word(amigamemptr + PSSO_Line_lDelta); - line->sDelta = get_word(amigamemptr + PSSO_Line_sDelta); - line->twoSDminusLD = get_word(amigamemptr + PSSO_Line_twoSDminusLD); - line->LinePtrn = get_word(amigamemptr + PSSO_Line_LinePtrn); - line->PatternShift = get_word(amigamemptr + PSSO_Line_PatternShift); - line->FgPen = get_long(amigamemptr + PSSO_Line_FgPen); - line->BgPen = get_long(amigamemptr + PSSO_Line_BgPen); - line->Horizontal = get_word(amigamemptr + PSSO_Line_Horizontal); - line->DrawMode = get_byte(amigamemptr + PSSO_Line_DrawMode); - line->Xorigin = get_word(amigamemptr + PSSO_Line_Xorigin); - line->Yorigin = get_word(amigamemptr + PSSO_Line_Yorigin); + line->X = get_word (amigamemptr + PSSO_Line_X); + line->Y = get_word (amigamemptr + PSSO_Line_Y); + line->Length = get_word (amigamemptr + PSSO_Line_Length); + line->dX = get_word (amigamemptr + PSSO_Line_dX); + line->dY = get_word (amigamemptr + PSSO_Line_dY); + line->lDelta = get_word (amigamemptr + PSSO_Line_lDelta); + line->sDelta = get_word (amigamemptr + PSSO_Line_sDelta); + line->twoSDminusLD = get_word (amigamemptr + PSSO_Line_twoSDminusLD); + line->LinePtrn = get_word (amigamemptr + PSSO_Line_LinePtrn); + line->PatternShift = get_word (amigamemptr + PSSO_Line_PatternShift); + line->FgPen = get_long (amigamemptr + PSSO_Line_FgPen); + line->BgPen = get_long (amigamemptr + PSSO_Line_BgPen); + line->Horizontal = get_word (amigamemptr + PSSO_Line_Horizontal); + line->DrawMode = get_byte (amigamemptr + PSSO_Line_DrawMode); + line->Xorigin = get_word (amigamemptr + PSSO_Line_Xorigin); + line->Yorigin = get_word (amigamemptr + PSSO_Line_Yorigin); return 1; } - write_log("ERROR - Invalid Line structure...\n"); + write_log ("ERROR - Invalid Line structure...\n"); return 0; } @@ -480,7 +480,7 @@ static void CopyLibResolutionStructureU2A (struct LibResolution *libres, uaecptr { char *uaememptr = 0; int i; - + uaememptr = gfxmem_xlate (amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ memset (uaememptr, 0, PSSO_LibResolution_sizeof); /* zero out our LibResolution structure */ strcpy (uaememptr + PSSO_LibResolution_P96ID, libres->P96ID); @@ -524,11 +524,11 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, uae_u32 pen, int Bpp, RGBFTYPE rgbtype) { uae_u8 *dst; - + /* Try OS specific fillrect function here; and return if successful. Make sure we adjust for * the pen values if we're doing 8-bit display-emulation on a 16-bit or higher screen. */ #ifdef PIXEL_LOCK - flushpixels(); + flushpixels(); #endif if(picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) @@ -537,13 +537,13 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, return; } else - { + { if(DX_Fill(x, y, width, height, picasso_vidinfo.clut[src[0]], rgbtype)) return; } P96TRACE(("P96_WARNING: do_fillrect() using fall-back routine!\n")); - + if(y + height > picasso_vidinfo.height) height = picasso_vidinfo.height - y; if(x + width > picasso_vidinfo.width) @@ -561,10 +561,10 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, #endif if (!dst) goto out; - + width *= Bpp; dst += y * picasso_vidinfo.rowbytes + x * picasso_vidinfo.pixbytes; - if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) + if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { if(Bpp == 1) { @@ -572,7 +572,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, { memset(dst, pen, width); dst += picasso_vidinfo.rowbytes; - } + } } else { @@ -580,7 +580,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, { memcpy (dst, src, width); dst += picasso_vidinfo.rowbytes; - } + } } } else @@ -591,11 +591,11 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, write_log ("ERROR - do_fillrect() failure1 (%d)\n", picasso96_state.RGBFormat); goto out; } - - while (height-- > 0) + + while (height-- > 0) { unsigned int i; - switch (psiz) + switch (psiz) { case 2: for (i = 0; i < width; i++) @@ -628,8 +628,8 @@ out:; * must do it by hand using the data in the frame-buffer, calculated using * the RenderInfo data and our coordinates. */ -static void do_blit(struct RenderInfo *ri, int Bpp, - unsigned int srcx, unsigned int srcy, unsigned int dstx, unsigned int dsty, +static void do_blit(struct RenderInfo *ri, int Bpp, + unsigned int srcx, unsigned int srcy, unsigned int dstx, unsigned int dsty, unsigned int width, unsigned int height, BLIT_OPCODE opcode, int can_do_blit) { uae_u8 *dstp, *srcp; @@ -642,7 +642,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, } //hack to use cpu rotines for scrolling in big Screens if (picasso96_state.XOffset < 0) can_do_blit = 0; - + dstx=dstx - picasso96_state.XOffset; dsty=dsty - picasso96_state.YOffset; if((int)dstx <= 0) { @@ -671,7 +671,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, if(dstx + width >= picasso_vidinfo.width) width = picasso_vidinfo.width - dstx; - if (can_do_blit) + if (can_do_blit) { // // Call OS blitting function that can do it in video memory. @@ -679,8 +679,8 @@ static void do_blit(struct RenderInfo *ri, int Bpp, // if(DX_Blit(srcx, srcy, dstx, dsty, width, height, opcode)) return; - srcx = dstx; - srcy = dsty; + srcx = dstx; + srcy = dsty; } #ifdef LOCK_UNLOCK_MADNESS PICASSO96_Lock(); @@ -693,7 +693,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, { #ifdef LOCK_UNLOCK_MADNESS goto out; - #else + #else return; #endif } @@ -708,19 +708,19 @@ static void do_blit(struct RenderInfo *ri, int Bpp, write_log ("WARNING: do_blit() couldn't lock\n"); goto out; } - + /* The areas can't overlap: the source is always in the Picasso frame buffer, * and the destination is a different buffer owned by the graphics code. */ dstp += dsty * picasso_vidinfo.rowbytes + dstx * picasso_vidinfo.pixbytes; P96TRACE(("do_blit with srcp 0x%x, dstp 0x%x, dst_rowbytes %d, srcx %d, srcy %d, dstx %d, dsty %d, w %d, h %d, dst_pixbytes %d\n", srcp, dstp, picasso_vidinfo.rowbytes, srcx, srcy, dstx, dsty, width, height, picasso_vidinfo.pixbytes)); P96TRACE(("gfxmem is at 0x%x\n",gfxmemory)); - - if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) + + if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { P96TRACE(("do_blit type-a\n")); width *= Bpp; - while (height-- > 0) + while (height-- > 0) { memcpy (dstp, srcp, width); srcp += ri->BytesPerRow; @@ -737,10 +737,10 @@ static void do_blit(struct RenderInfo *ri, int Bpp, write_log ("ERROR: do_blit() failure, %d!\n", picasso96_state.RGBFormat); goto out; } - while (height-- > 0) + while (height-- > 0) { unsigned int i; - switch (psiz) + switch (psiz) { case 2: for (i = 0; i < width; i++) @@ -775,7 +775,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, static void do_invertrect( struct RenderInfo *ri, int Bpp, int x, int y, int width, int height) { /* if(DX_InvertRect(x, y, width, height)) - return;*/ //deactivate in 0.8.20 + return;*/ //deactivate in 0.8.20 P96TRACE(("do_invertrect falling back to do_blit!\n")); do_blit (ri, Bpp, x, y, x, y, width, height, BLIT_SRC, 0); } @@ -794,7 +794,7 @@ static void wgfx_do_flushline (void) if (! picasso_vidinfo.extra_mem) /* The "out" will flush the dirty lines directly */ goto out; - + #ifdef LOCK_UNLOCK_MADNESS dstp = picasso96_state.HostAddress; @@ -807,7 +807,7 @@ static void wgfx_do_flushline (void) P96TRACE(("flushing %d\n", wgfx_y)); #endif src = gfxmemory + wgfx_min; - + if(picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { #if P96TRACING_LEVEL > 0 @@ -827,7 +827,7 @@ static void wgfx_do_flushline (void) write_log ("ERROR - wgfx_do_flushline() failure, %d!\n", picasso96_state.RGBFormat); goto out; } - + dstp += wgfx_y * picasso_vidinfo.rowbytes + (wgfx_min - wgfx_linestart) * psiz; switch (psiz) { case 2: @@ -843,7 +843,7 @@ static void wgfx_do_flushline (void) goto out; } } - + out: #ifndef LOCK_UNLOCK_MADNESS gfx_unlock_picasso (); @@ -865,7 +865,7 @@ static int renderinfo_is_current_screen (struct RenderInfo *ri) return 0; if (ri->Memory != gfxmemory + (picasso96_state.Address - gfxmem_start)) return 0; - + return 1; } @@ -883,21 +883,21 @@ STATIC_INLINE void do_fillrect_frame_buffer(struct RenderInfo *ri, int X, int Y, /* Do our virtual frame-buffer memory. First, we do a single line fill by hand */ oldstart = start = src = ri->Memory + X * Bpp + Y * ri->BytesPerRow; - - switch (Bpp) + + switch (Bpp) { case 1: memset (start, Pen, Width); break; case 2: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { do_put_mem_word ((uae_u16 *)start, (uae_u16)Pen); start += 2; } break; case 3: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { do_put_mem_byte (start, (uae_u8)Pen); start++; @@ -906,7 +906,7 @@ STATIC_INLINE void do_fillrect_frame_buffer(struct RenderInfo *ri, int X, int Y, } break; case 4: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { /**start = Pen; */ do_put_mem_long ((uae_u32 *)start, Pen); @@ -944,13 +944,13 @@ void picasso_handle_vsync (void) if (vsyncgfxcount > 1) { if (picasso_on) { if (picasso96_state.RGBFormat == picasso_vidinfo.rgbformat - || picasso96_state.RGBFormat == RGBFB_CHUNKY) { + || picasso96_state.RGBFormat == RGBFB_CHUNKY) { static frame_time_t cycles; blitcount++; cycles = read_processor_time(); picasso_refresh(1); vsyncgfxcount = 0; - write_log("%d Blitnum %.3fms\n", blitcount, + write_log ("%d Blitnum %.3fms\n", blitcount, (read_processor_time() - cycles) * 1000 / (double)syncbase); } } @@ -972,7 +972,7 @@ void picasso_refresh (int call_setpalette) { struct RenderInfo ri; static int beamcon0_before, p96refresh_was; - + if (! picasso_on) return; { //for higher P96 mousedraw rate @@ -994,7 +994,7 @@ void picasso_refresh (int call_setpalette) /* HACK until ntsc timing is fixed.. */ } //end for higher P96 mousedraw rate have_done_picasso = 1; - + /* Make sure that the first time we show a Picasso video mode, we don't blit any crap. * We can do this by checking if we have an Address yet. */ if (picasso96_state.Address) { @@ -1025,7 +1025,7 @@ void picasso_refresh (int call_setpalette) height = picasso96_state.Height; } do_blit(&ri, picasso96_state.BytesPerPixel, 0, 0, 0, 0, width, height, BLIT_SRC, 0); - } + } else { write_log ("ERROR - picasso_refresh() can't refresh!\n"); @@ -1041,7 +1041,7 @@ RenderInfo *dstri, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 mask, BLIT_OPCODE opcode) { - + uae_u8 *src, *dst, *tmp, *tmp2, *tmp3; uae_u8 Bpp = GetBytesPerPixel(ri->RGBFormat); unsigned long total_width = width * Bpp; @@ -1055,19 +1055,19 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) { write_log ("WARNING - BlitRect() has mask 0x%x with Bpp %d.\n", mask, Bpp); } - - if (mask == 0xFF || Bpp > 1) + + if (mask == 0xFF || Bpp > 1) { if(opcode == BLIT_SRC) { /* handle normal case efficiently */ - if (ri->Memory == dstri->Memory && dsty == srcy) + if (ri->Memory == dstri->Memory && dsty == srcy) { unsigned long i; for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) memmove (dst, src, total_width); } - else if (dsty < srcy) + else if (dsty < srcy) { unsigned long i; for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) @@ -1090,7 +1090,7 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) uae_u32 *src2_32 = (uae_u32*)src; uae_u32 *dst2_32 = (uae_u32*)dst; unsigned int y; - + for(y = 0; y < height; y++) /* Vertical lines */ { uae_u8 *bound = src + total_width - 4; @@ -1130,13 +1130,13 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) *dst2_32 = ~(*src2_32 ^ *dst2_32); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2_32 = ~(*src2_32) | *dst2_32; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2_32 = ~(*dst2_32) | *src2_32; @@ -1148,7 +1148,7 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) *dst2_32 = 0xFFFFFFFF; break; case 30: //code for swap source with dest in byte - { + { uae_u32 temp; temp = *src2_32; *src2_32 = *dst2_32; @@ -1156,7 +1156,7 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) } break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; } /* switch opcode */ }// for end @@ -1196,13 +1196,13 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) *dst2 = ~(*src2 ^ *dst2); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2 = ~(*src2) | *dst2; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2 = ~(*dst2) | *src2; @@ -1214,7 +1214,7 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) *dst2 = 0xFF; break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; case 30: //code for swap source with dest in long { @@ -1239,16 +1239,16 @@ memory for the src-rect */ return; /* copy the src-rect into our temporary buffer space */ - for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) + for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) { memcpy (tmp2, src, total_width); } /* copy the temporary buffer to the destination */ - for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp += linewidth) + for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp += linewidth) { unsigned long cols; - for (cols = 0; cols < width; cols++) + for (cols = 0; cols < width; cols++) { dst[cols] &= ~mask; dst[cols] |= tmp[cols] & mask; @@ -1256,7 +1256,7 @@ memory for the src-rect */ } /* free the temp-buf */ free (tmp3); -} +} #if 0 /* @@ -1265,7 +1265,7 @@ memory for the src-rect */ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct RenderInfo *dstri, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 mask, BLIT_OPCODE opcode ) { - + uae_u8 *src, *dst, *tmp, *tmp2, *tmp3; uae_u8 Bpp = GetBytesPerPixel(ri->RGBFormat); unsigned long total_width = width * Bpp; @@ -1279,19 +1279,19 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende { write_log ("WARNING - BlitRect() has mask 0x%x with Bpp %d.\n", mask, Bpp); } - - if (mask == 0xFF || Bpp > 1) + + if (mask == 0xFF || Bpp > 1) { if( opcode == BLIT_SRC ) { /* handle normal case efficiently */ - if (ri->Memory == dstri->Memory && dsty == srcy) + if (ri->Memory == dstri->Memory && dsty == srcy) { unsigned long i; for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) memmove (dst, src, total_width); } - else if (dsty < srcy) + else if (dsty < srcy) { unsigned long i; for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) @@ -1312,7 +1312,7 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende uae_u8 *src2 = src; uae_u8 *dst2 = dst; unsigned int y; - + for( y = 0; y < height; y++ ) /* Vertical lines */ { for( src2 = src, dst2 = dst; src2 < src + total_width; src2++, dst2++ ) /* Horizontal bytes */ @@ -1350,13 +1350,13 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende *dst2 = ~(*src2 ^ *dst2); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n" ); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n" ); break; case BLIT_NOTONLYSRC: *dst2 = ~(*src2) | *dst2; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n" ); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n" ); break; case BLIT_NOTONLYDST: *dst2 = ~(*dst2) | *src2; @@ -1368,7 +1368,7 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende *dst2 = 0xFF; break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n" ); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n" ); break; } /* switch opcode */ } /* for width */ @@ -1384,16 +1384,16 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende return; /* copy the src-rect into our temporary buffer space */ - for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) + for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) { memcpy (tmp2, src, total_width); } /* copy the temporary buffer to the destination */ - for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp += linewidth) + for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp += linewidth) { unsigned long cols; - for (cols = 0; cols < width; cols++) + for (cols = 0; cols < width; cols++) { dst[cols] &= ~mask; dst[cols] |= tmp[cols] & mask; @@ -1405,16 +1405,16 @@ STATIC_INLINE void do_blitrect_frame_buffer( struct RenderInfo *ri, struct Rende #endif /* -DrawLine: -Synopsis: DrawLine(bi, ri, line, Mask, RGBFormat); -Inputs: a0: struct BoardInfo *bi -a1: struct RenderInfo *ri -a2: struct Line *line -d0.b: Mask -d7.l: RGBFormat +DrawLine: +Synopsis: DrawLine(bi, ri, line, Mask, RGBFormat); +Inputs: a0: struct BoardInfo *bi +a1: struct RenderInfo *ri +a2: struct Line *line +d0.b: Mask +d7.l: RGBFormat This function is used to paint a line on the board memory possibly using the blitter. It is called by Draw -and obeyes the destination RGBFormat as well as ForeGround and BackGround pens and draw modes. +and obeyes the destination RGBFormat as well as ForeGround and BackGround pens and draw modes. */ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) { @@ -1422,11 +1422,11 @@ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) #ifdef P96_DRAWLINE struct Line line; struct RenderInfo ri; - uae_u8 Mask = m68k_dreg(regs, 0); - RGBFTYPE RGBFormat = m68k_dreg(regs, 7); + uae_u8 Mask = m68k_dreg (regs, 0); + RGBFTYPE RGBFormat = m68k_dreg (regs, 7); - CopyRenderInfoStructureA2U(m68k_areg(regs, 1), &ri); - CopyLineStructureA2U(m68k_areg(regs, 2), &line); + CopyRenderInfoStructureA2U(m68k_areg (regs, 1), &ri); + CopyLineStructureA2U(m68k_areg (regs, 2), &line); #if defined( P96TRACING_ENABLED ) && P96TRACING_LEVEL > 0 DumpLine( &line ); #endif @@ -1438,40 +1438,40 @@ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) #ifdef HARDWARE_SPRITE_EMULATION /* -SetSprite: -Synopsis: SetSprite(bi, activate, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d0: BOOL activate -d7: RGBFTYPE RGBFormat +SetSprite: +Synopsis: SetSprite(bi, activate, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d0: BOOL activate +d7: RGBFTYPE RGBFormat -This function activates or deactivates the hardware sprite. +This function activates or deactivates the hardware sprite. */ uae_u32 picasso_SetSprite (void) { uae_u32 result = 0; - uae_u32 activate = m68k_dreg( regs, 0 ); + uae_u32 activate = m68k_dreg ( regs, 0 ); result = DX_ShowCursor( activate ); write_log ("SetSprite() - trying to %s cursor, result = %d\n", activate ? "show":"hide", result); return result; } /* -SetSpritePosition: -Synopsis: SetSpritePosition(bi, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d7: RGBFTYPE RGBFormat +SetSpritePosition: +Synopsis: SetSpritePosition(bi, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d7: RGBFTYPE RGBFormat This function sets the hardware mouse sprite position according to the values in the BoardInfo structure. MouseX and MouseY are the coordinates relative to the screen bitmap. XOffset and YOffset must be subtracted -to account for possible screen panning. +to account for possible screen panning. */ uae_u32 picasso_SetSpritePosition (void) { uae_u32 result = 0; - uaecptr bi = m68k_areg( regs, 0 ); - uae_u16 MouseX = get_word( bi + PSSO_BoardInfo_MouseX ) - picasso96_state.XOffset; - uae_u16 MouseY = get_word( bi + PSSO_BoardInfo_MouseY ) - picasso96_state.YOffset; - + uaecptr bi = m68k_areg ( regs, 0 ); + uae_u16 MouseX = get_word ( bi + PSSO_BoardInfo_MouseX ) - picasso96_state.XOffset; + uae_u16 MouseY = get_word ( bi + PSSO_BoardInfo_MouseY ) - picasso96_state.YOffset; + // Keep these around, because we don't want flickering static uae_u16 OldMouseX = -1; static uae_u16 OldMouseY = -1; @@ -1496,29 +1496,29 @@ uae_u32 picasso_SetSpritePosition (void) } /* -SetSpriteImage: -Synopsis: SetSpriteImage(bi, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d7: RGBFTYPE RGBFormat +SetSpriteImage: +Synopsis: SetSpriteImage(bi, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d7: RGBFTYPE RGBFormat This function gets new sprite image data from the MouseImage field of the BoardInfo structure and writes it to the board. -There are three possible cases: +There are three possible cases: BIB_HIRESSPRITE is set: skip the first two long words and the following sprite data is arranged as an array of two longwords. Those form the -two bit planes for one image line respectively. +two bit planes for one image line respectively. BIB_HIRESSPRITE and BIB_BIGSPRITE are not set: skip the first two words and the following sprite data is arranged as an array of two words. Those form the two -bit planes for one image line respectively. +bit planes for one image line respectively. BIB_HIRESSPRITE is not set and BIB_BIGSPRITE is set: skip the first two words and the following sprite data is arranged as an array of two words. Those form the two bit planes for one image line respectively. You have to double each pixel horizontally and vertically. All coordinates used in this case already assume a zoomed sprite, only the sprite data is not zoomed yet. You will have to -compensate for this when accounting for hotspot offsets and sprite dimensions. +compensate for this when accounting for hotspot offsets and sprite dimensions. */ uae_u32 picasso_SetSpriteImage (void) { @@ -1528,16 +1528,16 @@ uae_u32 picasso_SetSpriteImage (void) } /* -SetSpriteColor: -Synopsis: SetSpriteColor(bi, index, red, green, blue, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d0.b: index -d1.b: red -d2.b: green -d3.b: blue -d7: RGBFTYPE RGBFormat - -This function changes one of the possible three colors of the hardware sprite. +SetSpriteColor: +Synopsis: SetSpriteColor(bi, index, red, green, blue, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d0.b: index +d1.b: red +d2.b: green +d3.b: blue +d7: RGBFTYPE RGBFormat + +This function changes one of the possible three colors of the hardware sprite. */ uae_u32 picasso_SetSpriteColor (void) { @@ -1567,7 +1567,7 @@ uae_u32 REGPARAM2 picasso_FindCard (struct regstruct *regs) uaecptr AmigaBoardInfo = m68k_areg (regs, 0); /* NOTES: See BoardInfo struct definition in Picasso96 dev info */ - + if (allocated_gfxmem && !picasso96_state.CardFound) { /* Fill in MemoryBase, MemorySize */ put_long (AmigaBoardInfo + PSSO_BoardInfo_MemoryBase, gfxmem_start); @@ -1598,7 +1598,7 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc } uaememptr = gfxmem_xlate(amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ memset(uaememptr, 0, PSSO_ModeInfo_sizeof); /* zero out our ModeInfo struct */ - + put_word (amigamemptr + PSSO_ModeInfo_Width, dm->res.width); put_word (amigamemptr + PSSO_ModeInfo_Height, dm->res.height); put_byte (amigamemptr + PSSO_ModeInfo_Depth, dm->depth * 8); @@ -1609,15 +1609,15 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc put_word (amigamemptr + PSSO_ModeInfo_HorSyncSize, 0); put_byte (amigamemptr + PSSO_ModeInfo_HorSyncSkew, 0); put_byte (amigamemptr + PSSO_ModeInfo_HorEnableSkew, 0); - + put_word (amigamemptr + PSSO_ModeInfo_VerTotal, dm->res.height); put_word (amigamemptr + PSSO_ModeInfo_VerBlankSize, 0); put_word (amigamemptr + PSSO_ModeInfo_VerSyncStart, 0); put_word (amigamemptr + PSSO_ModeInfo_VerSyncSize, 0); - + put_byte (amigamemptr + PSSO_ModeInfo_first_union, 98); put_byte (amigamemptr + PSSO_ModeInfo_second_union, 14); - + put_long (amigamemptr + PSSO_ModeInfo_PixelClock, dm->res.width * dm->res.height * (currprefs.gfx_refreshrate ? abs (currprefs.gfx_refreshrate) : default_freq)); } @@ -1700,7 +1700,7 @@ static int AssignModeID(int dm, int count, int *unkcnt) return 0x50001000 | (mi[i].id * 0x10000); } (*unkcnt)++; - write_log("P96: Non-unique mode %dx%d\n", w, h); + write_log ("P96: Non-unique mode %dx%d\n", w, h); return 0x51000000 - (*unkcnt) * 0x10000; #if 0 int result; @@ -1770,10 +1770,10 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 4, hicolour.height); put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 6, truecolour.height); put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 8, alphacolour.height); - + i = 0; unkcnt = 0; - while (DisplayModes[i].depth >= 0) { + while (DisplayModes[i].depth >= 0) { int j = i; /* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */ res.DisplayID = AssignModeID(i, LibResolutionStructureCount, &unkcnt); @@ -1788,10 +1788,10 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) res.Modes[HICOLOR] = 0; res.Modes[TRUECOLOR] = 0; res.Modes[TRUEALPHA] = 0; - + do { /* Handle this display mode's depth */ - + /* New: Only add the modes when there is enough P96 RTG memory to hold the bitmap */ if((allocated_gfxmem - 32768) > (DisplayModes[i].res.width * DisplayModes[i].res.height * DisplayModes[i].depth)) @@ -1803,7 +1803,7 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) } while (DisplayModes[i].depth >= 0 && DisplayModes[i].res.width == DisplayModes[j].res.width && DisplayModes[i].res.height == DisplayModes[j].res.height); - + amigamemptr = gfxmem_start + allocated_gfxmem - 16384 + (PSSO_LibResolution_sizeof * LibResolutionStructureCount++); CopyLibResolutionStructureU2A (&res, amigamemptr); #if defined P96TRACING_ENABLED && P96TRACING_LEVEL > 1 @@ -1811,7 +1811,7 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) #endif AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amigamemptr); } - + return -1; } @@ -1836,7 +1836,7 @@ uae_u32 REGPARAM2 picasso_SetSwitch (struct regstruct *regs) * whenever it is ready to change the screen state. */ picasso_requested_on = flag; write_log ("SetSwitch() - trying to show %s screen\n", flag ? "picasso96":"amiga"); - + /* Put old switch-state in D0 */ return !flag; @@ -1845,7 +1845,7 @@ uae_u32 REGPARAM2 picasso_SetSwitch (struct regstruct *regs) static void init_picasso_screen(void); void picasso_enablescreen (int on) -{ +{ if (!init_picasso_screen_called) init_picasso_screen(); wgfx_linestart = 0xFFFFFFFF; @@ -1875,17 +1875,17 @@ uae_u32 REGPARAM2 picasso_SetColorArray (struct regstruct *regs) int i; uaecptr boardinfo = m68k_areg (regs, 0); uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT + start * 3; - + for (i = start; i < start + count; i++) { int r = get_byte (clut); int g = get_byte (clut + 1); int b = get_byte (clut + 2); - - palette_changed |= (picasso96_state.CLUT[i].Red != r + + palette_changed |= (picasso96_state.CLUT[i].Red != r || picasso96_state.CLUT[i].Green != g || picasso96_state.CLUT[i].Blue != b); - - picasso96_state.CLUT[i].Red = r; + + picasso96_state.CLUT[i].Red = r; picasso96_state.CLUT[i].Green = g; picasso96_state.CLUT[i].Blue = b; clut += 3; @@ -1906,7 +1906,7 @@ uae_u32 REGPARAM2 picasso_SetDAC (struct regstruct *regs) { /* Fill in some static UAE related structure about this new DAC setting * Lets us keep track of what pixel format the Amiga is thinking about in our frame-buffer */ - + P96TRACE(("SetDAC()\n")); return 1; } @@ -1917,7 +1917,7 @@ static void init_picasso_screen(void) if(set_panning_called) { picasso96_state.Extent = picasso96_state.Address + picasso96_state.BytesPerRow * picasso96_state.VirtualHeight; } - if (set_gc_called) { + if (set_gc_called) { gfx_set_picasso_modeinfo (picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth, picasso96_state.RGBFormat); } @@ -1927,7 +1927,7 @@ static void init_picasso_screen(void) (picasso_vidinfo.selected_rgbformat == picasso96_state.RGBFormat)) { DX_SetPalette (0, 256); - picasso_refresh (1); + picasso_refresh (1); } init_picasso_screen_called = 1; } @@ -1948,16 +1948,16 @@ uae_u32 REGPARAM2 picasso_SetGC (struct regstruct *regs) /* Fill in some static UAE related structure about this new ModeInfo setting */ uae_u32 border = m68k_dreg (regs, 0); uaecptr modeinfo = m68k_areg (regs, 1); - + picasso96_state.Width = get_word (modeinfo + PSSO_ModeInfo_Width); picasso96_state.VirtualWidth = picasso96_state.Width; /* in case SetPanning doesn't get called */ - + picasso96_state.Height = get_word (modeinfo + PSSO_ModeInfo_Height); picasso96_state.VirtualHeight = picasso96_state.Height; /* in case SetPanning doesn't get called */ - + picasso96_state.GC_Depth = get_byte (modeinfo + PSSO_ModeInfo_Depth); picasso96_state.GC_Flags = get_byte (modeinfo + PSSO_ModeInfo_Flags); - + P96TRACE(("SetGC(%d,%d,%d,%d)\n", picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth, border)); set_gc_called = 1; picasso96_state.HostAddress = NULL; @@ -1998,27 +1998,27 @@ static void picasso_SetPanningInit(void) else picasso96_state.BigAssBitmap = 0; picasso96_state.BytesPerRow = picasso96_state.VirtualWidth * picasso96_state.BytesPerPixel; -} +} uae_u32 REGPARAM2 picasso_SetPanning (struct regstruct *regs) -{ +{ uae_u16 Width = m68k_dreg (regs, 0); uaecptr start_of_screen = m68k_areg (regs, 1); - uaecptr bi = m68k_areg(regs, 0); - uaecptr bmeptr = get_long(bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */ + uaecptr bi = m68k_areg (regs, 0); + uaecptr bmeptr = get_long (bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */ uae_u16 bme_width, bme_height; if(oldscr == 0) { - oldscr = start_of_screen; + oldscr = start_of_screen; } if (oldscr != start_of_screen) { set_gc_called = 0; oldscr = start_of_screen; } - bme_width = get_word(bmeptr + PSSO_BitMapExtra_Width); - bme_height = get_word(bmeptr + PSSO_BitMapExtra_Height); - + bme_width = get_word (bmeptr + PSSO_BitMapExtra_Width); + bme_height = get_word (bmeptr + PSSO_BitMapExtra_Height); + picasso96_state.Address = start_of_screen; /* Amiga-side address */ picasso96_state.XOffset = (uae_s16)(m68k_dreg (regs, 1) & 0xFFFF); picasso96_state.YOffset = (uae_s16)(m68k_dreg (regs, 2) & 0xFFFF); @@ -2034,7 +2034,7 @@ uae_u32 REGPARAM2 picasso_SetPanning (struct regstruct *regs) start_of_screen, picasso96_state.BytesPerRow, picasso96_state.BytesPerPixel, picasso96_state.RGBFormat)); init_picasso_screen (); set_panning_called = 0; - + return 1; } @@ -2044,7 +2044,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) #if 0 && defined ALIGN_POINTER_TO32 int align_adjust = ALIGN_POINTER_TO32(ptr); int len2; - + len -= align_adjust; while (align_adjust) { *ptr ^= val; @@ -2070,7 +2070,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) /* * InvertRect: -* +* * Inputs: * a0:struct BoardInfo *bi * a1:struct RenderInfo *ri @@ -2080,7 +2080,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) * d3.w:Height * d4.l:Mask * d7.l:RGBFormat -* +* * This function is used to invert a rectangular area on the board. It is called by BltBitMap, * BltPattern and BltTemplate. */ @@ -2100,16 +2100,16 @@ uae_u32 REGPARAM2 picasso_InvertRect (struct regstruct *regs) unsigned long width_in_bytes; uae_u32 result = 0; - + #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (renderinfo, &ri)) { P96TRACE(("InvertRect %dbpp 0x%lx\n", Bpp, (long)mask)); - - if (mask != 0xFF && Bpp > 1) + + if (mask != 0xFF && Bpp > 1) { mask = 0xFF; } @@ -2117,10 +2117,10 @@ uae_u32 REGPARAM2 picasso_InvertRect (struct regstruct *regs) xorval = 0x01010101 * (mask & 0xFF); width_in_bytes = Bpp * Width; rectstart = uae_mem = ri.Memory + Y*ri.BytesPerRow + X*Bpp; - + for (lines = 0; lines < Height; lines++, uae_mem += ri.BytesPerRow) do_xor8 (uae_mem, width_in_bytes, xorval); - + if (vsyncgfxwrite == 0) { if (renderinfo_is_current_screen (&ri)) { if (mask == 0xFF) @@ -2158,7 +2158,7 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) uae_u32 Pen = m68k_dreg (regs, 4); uae_u8 Mask = (uae_u8)m68k_dreg (regs, 5); RGBFTYPE RGBFormat = m68k_dreg (regs, 7); - + uae_u8 *src; uae_u8 *oldstart; int Bpp; @@ -2172,21 +2172,21 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (renderinfo, &ri) && Y != 0xFFFF) { if (ri.RGBFormat != RGBFormat) write_log ("Weird Stuff!\n"); - + Bpp = GetBytesPerPixel (RGBFormat); - + P96TRACE(("FillRect(%d, %d, %d, %d) Pen 0x%x BPP %d BPR %d Mask 0x%x\n", X, Y, Width, Height, Pen, Bpp, ri.BytesPerRow, Mask)); - + if(Bpp > 1) Mask = 0xFF; - - if (Mask == 0xFF) + + if (Mask == 0xFF) { if(Width == 1 || Height == 1) { @@ -2231,7 +2231,7 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) { src = ri.Memory + X * Bpp + Y * ri.BytesPerRow; X = X - picasso96_state.XOffset; - Y = Y - picasso96_state.YOffset; + Y = Y - picasso96_state.YOffset; if((int)X < 0) { Width = Width + X; X = 0; } if((int)Width < 1) return 1; if((int)Y < 0) { Height = Height + Y; Y = 0; } @@ -2254,9 +2254,9 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) else { /* We get here only if Mask != 0xFF */ - if (Bpp != 1) + if (Bpp != 1) { - write_log( "WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp ); + write_log ( "WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp ); } else { @@ -2266,11 +2266,11 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) { uae_u8 *start = oldstart; uae_u8 *end = start + Height * ri.BytesPerRow; - for (; start != end; start += ri.BytesPerRow) + for (; start != end; start += ri.BytesPerRow) { uae_u8 *p = start; unsigned long cols; - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { uae_u32 tmpval = do_get_mem_byte (p + cols) & Mask; do_put_mem_byte (p + cols, (uae_u8)(Pen | tmpval)); @@ -2338,18 +2338,18 @@ STATIC_INLINE int BlitRectHelper( void ) unsigned long height = blitrectdata.height; uae_u8 mask = blitrectdata.mask; BLIT_OPCODE opcode = blitrectdata.opcode; - + uae_u8 Bpp = GetBytesPerPixel(ri->RGBFormat); unsigned long total_width = width * Bpp; unsigned long linewidth = (total_width + 15) & ~15; int can_do_visible_blit = 0; - + if(opcode == BLIT_DST) { - write_log( "WARNING: BlitRect() being called with opcode of BLIT_DST\n" ); + write_log ( "WARNING: BlitRect() being called with opcode of BLIT_DST\n" ); return 1; } - + /* * If we have no destination RenderInfo, then we're dealing with a single-buffer action, called * from picasso_BlitRect(). The code in do_blitrect_frame_buffer() deals with the frame-buffer, @@ -2361,14 +2361,14 @@ STATIC_INLINE int BlitRectHelper( void ) //if (dstri->Memory == ri->Memory) if (dstri == NULL || dstri->Memory == ri->Memory) { - if(mask != 0xFF && Bpp > 1) + if(mask != 0xFF && Bpp > 1) { mask = 0xFF; } dstri = ri; can_do_visible_blit = 1; } - + /* Do our virtual frame-buffer memory first */ do_blitrect_frame_buffer(ri, dstri, srcx, srcy, dstx, dsty, width, height, mask, opcode); /* Now we do the on-screen display, if renderinfo points to it */ @@ -2390,7 +2390,7 @@ STATIC_INLINE int BlitRectHelper( void ) { P96TRACE(("Did not do_blit 1 in BlitRect()\n")); } - + return 1; } @@ -2418,7 +2418,7 @@ STATIC_INLINE int BlitRect (uaecptr ri, uaecptr dstri, blitrectdata.height = height; blitrectdata.mask = mask; blitrectdata.opcode = opcode; - + return BlitRectHelper(); } @@ -2449,11 +2449,11 @@ uae_u32 REGPARAM2 picasso_BlitRect (struct regstruct *regs) uae_u32 result = 0; P96_SM_RW; - + #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif - + P96TRACE(("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask)); result = BlitRect(renderinfo, (uaecptr)NULL, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC); @@ -2493,14 +2493,14 @@ uae_u32 REGPARAM2 picasso_BlitRectNoMaskComplete (struct regstruct *regs) uae_u32 result = 0; P96_SM_RW; - + #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif P96TRACE(("BlitRectNoMaskComplete() op 0x%2x, xy(%4d,%4d) --> xy(%4d,%4d), wh(%4d,%4d)\n", OpCode, srcx, srcy, dstx, dsty, width, height)); - + result = BlitRect(srcri, dstri, srcx, srcy, dstx, dsty, width, height, 0xFF, OpCode); return result; @@ -2553,7 +2553,7 @@ STATIC_INLINE void PixelWrite(uae_u8 *mem, int bits, uae_u32 fgpen, uae_u8 Bpp, /* * BlitPattern: -* +* * Synopsis:BlitPattern(bi, ri, pattern, X, Y, Width, Height, Mask, RGBFormat); * Inputs: * a0:struct BoardInfo *bi @@ -2565,7 +2565,7 @@ STATIC_INLINE void PixelWrite(uae_u8 *mem, int bits, uae_u32 fgpen, uae_u8 Bpp, * d3.w:Height * d4.w:Mask * d7.l:RGBFormat -* +* * This function is used to paint a pattern on the board memory using the blitter. It is called by * BltPattern, if a AreaPtrn is used with positive AreaPtSz. The pattern consists of a b/w image * using a single plane of image data which will be expanded repeatedly to the destination RGBFormat @@ -2595,21 +2595,21 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) uae_u32 result = 0; P96_SM_RW; - + #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if(CopyRenderInfoStructureA2U (rinf, &ri) && CopyPatternStructureA2U (pinf, &pattern)) { Bpp = GetBytesPerPixel(ri.RGBFormat); uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset with address */ - + if (pattern.DrawMode & INVERS) inversion = 1; - + pattern.DrawMode &= 0x03; - if (Mask != 0xFF) + if (Mask != 0xFF) { if(Bpp > 1) Mask = 0xFF; @@ -2637,26 +2637,26 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) #endif ysize_mask = (1 << pattern.Size) - 1; xshift = pattern.XOffset & 15; - + for (rows = 0; rows < H; rows++, uae_mem += ri.BytesPerRow) { unsigned long prow = (rows + pattern.YOffset) & ysize_mask; unsigned int d = do_get_mem_word (((uae_u16 *)pattern.Memory) + prow); uae_u8 *uae_mem2 = uae_mem; unsigned long cols; - + if (xshift != 0) d = (d << xshift) | (d >> (16 - xshift)); - - for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp << 4) + + for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp << 4) { long bits; long max = W - cols; unsigned int data = d; - + if (max > 16) max = 16; - - for (bits = 0; bits < max; bits++) + + for (bits = 0; bits < max; bits++) { int bit_set = data & 0x8000; data <<= 1; @@ -2678,7 +2678,7 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) case COMP: if (bit_set) { fgpen = pattern.FgPen; - + switch (Bpp) { case 1: { @@ -2711,7 +2711,7 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) } } } - + /* If we need to update a second-buffer (extra_mem is set), then do it only if visible! */ if (picasso_vidinfo.extra_mem && renderinfo_is_current_screen (&ri)) { if (vsyncgfxwrite == 0) @@ -2770,18 +2770,18 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (rinf, &ri) && CopyTemplateStructureA2U (tmpl, &tmp)) { Bpp = GetBytesPerPixel(ri.RGBFormat); uae_mem = ri.Memory + Y*ri.BytesPerRow + X*Bpp; /* offset into address */ - + if (tmp.DrawMode & INVERS) inversion = 1; - + tmp.DrawMode &= 0x03; - if (Mask != 0xFF) + if (Mask != 0xFF) { if(Bpp > 1) Mask = 0xFF; @@ -2812,34 +2812,34 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) { P96TRACE(("BlitTemplate() xy(%d,%d), wh(%d,%d) draw 0x%x fg 0x%x bg 0x%x \n", X, Y, W, H, tmp.DrawMode, tmp.FgPen, tmp.BgPen)); - + bitoffset = tmp.XOffset % 8; - + #if defined(P96TRACING_ENABLED) && (P96TRACING_LEVEL > 0) DumpTemplate(&tmp, W, H); #endif - + tmpl_base = tmp.Memory + tmp.XOffset / 8; - + for (rows = 0; rows < H; rows++, uae_mem += ri.BytesPerRow, tmpl_base += tmp.BytesPerRow) { unsigned long cols; uae_u8 *tmpl_mem = tmpl_base; uae_u8 *uae_mem2 = uae_mem; unsigned int data = *tmpl_mem; - + for (cols = 0; cols < W; cols += 8, uae_mem2 += Bpp << 3) { unsigned int byte; long bits; long max = W - cols; - + if (max > 8) max = 8; - + data <<= 8; data |= *++tmpl_mem; - + byte = data >> (8 - bitoffset); - + for (bits = 0; bits < max; bits++) { int bit_set = (byte & 0x80); byte <<= 1; @@ -2858,13 +2858,13 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) fgpen = tmp.BgPen; if (bit_set) fgpen = tmp.FgPen; - + PixelWrite(uae_mem2, bits, fgpen, Bpp, Mask); break; case COMP: if (bit_set) { fgpen = tmp.FgPen; - + switch (Bpp) { case 1: { @@ -2897,16 +2897,16 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) } } } - + /* If we need to update a second-buffer (extra_mem is set), then do it only if visible! */ if(picasso_vidinfo.extra_mem && renderinfo_is_current_screen(&ri)) { if (vsyncgfxwrite == 0) do_blit(&ri, Bpp, X, Y, X, Y, W, H, BLIT_SRC, 0); } - + result = 1; } - } + } return 1; } @@ -2923,10 +2923,10 @@ uae_u32 REGPARAM2 picasso_CalculateBytesPerRow (struct regstruct *regs) { uae_u16 width = m68k_dreg (regs, 0); uae_u32 type = m68k_dreg (regs, 7); - + width = GetBytesPerPixel(type) * width; P96TRACE(("CalculateBytesPerRow() = %d\n",width)); - + return width; } @@ -2935,7 +2935,7 @@ uae_u32 REGPARAM2 picasso_CalculateBytesPerRow (struct regstruct *regs) * a0: struct BoardInfo * d0: BOOL state * This function enables and disables the video display. -* +* * NOTE: return the opposite of the state */ uae_u32 REGPARAM2 picasso_SetDisplay (struct regstruct *regs) @@ -2948,7 +2948,7 @@ uae_u32 REGPARAM2 picasso_SetDisplay (struct regstruct *regs) void picasso_handle_hsync (void) { static int p96hsync; - + if (currprefs.gfxmem_size == 0) return; if (WIN32GFX_IsPicassoScreen () && currprefs.gfx_pfullscreen && currprefs.gfx_pvsync) { @@ -2985,15 +2985,15 @@ static void PlanarToChunky(struct RenderInfo *ri, struct BitMap *bm, uae_u8 mask) { int j; - + uae_u8 *PLANAR[8], *image = ri->Memory + dstx * GetBytesPerPixel (ri->RGBFormat) + dsty * ri->BytesPerRow; int Depth = bm->Depth; unsigned long rows, bitoffset = srcx & 7; long eol_offset; - - /* if (mask != 0xFF) + + /* if (mask != 0xFF) write_log ("P2C - pixel-width = %d, bit-offset = %d\n", width, bitoffset); */ - + /* Set up our bm->Planes[] pointers to the right horizontal offset */ for (j = 0; j < Depth; j++) { uae_u8 *p = bm->Planes[j]; @@ -3006,7 +3006,7 @@ static void PlanarToChunky(struct RenderInfo *ri, struct BitMap *bm, eol_offset = (long)bm->BytesPerRow - (long)((width + 7) >> 3); for (rows = 0; rows < height; rows++, image += ri->BytesPerRow) { unsigned long cols; - + for (cols = 0; cols < width; cols += 8) { int k; uae_u32 a = 0, b = 0; @@ -3082,7 +3082,7 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Chunky (struct regstruct *regs) uae_u32 result = 0; P96_SM_RW; - + #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif @@ -3091,7 +3091,7 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Chunky (struct regstruct *regs) write_log ("ERROR - BlitPlanar2Chunky() has minterm 0x%x, which I don't handle. Using fall-back routine.\n", minterm); } - else if(CopyRenderInfoStructureA2U (ri, &local_ri) && + else if(CopyRenderInfoStructureA2U (ri, &local_ri) && CopyBitMapStructureA2U (bm, &local_bm)) { P96TRACE(("BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n", @@ -3123,10 +3123,10 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, int Depth = bm->Depth; unsigned long rows; long eol_offset; - + if(!bpp) return; - + /* Set up our bm->Planes[] pointers to the right horizontal offset */ for (j = 0; j < Depth; j++) { uae_u8 *p = bm->Planes[j]; @@ -3136,14 +3136,14 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, if ((mask & (1 << j)) == 0) PLANAR[j] = &all_zeros_bitmap; } - + eol_offset = (long)bm->BytesPerRow - (long)((width + (srcx & 7)) >> 3); for (rows = 0; rows < height; rows++, image += ri->BytesPerRow) { unsigned long cols; uae_u8 *image2 = image; unsigned int bitoffs = 7 - (srcx & 7); int i; - + for (cols = 0; cols < width; cols ++) { int v = 0, k; for (k = 0; k < Depth; k++) { @@ -3153,7 +3153,7 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, v |= ((*PLANAR[k] >> bitoffs) & 1) << k; } } - + switch (bpp) { case 2: do_put_mem_word ((uae_u16 *)image2, (uae_u16)(cim->Colors[v])); @@ -3180,7 +3180,7 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, } } } - + for (i = 0; i < Depth; i++) { if (PLANAR[i] != &all_zeros_bitmap && PLANAR[i] != &all_ones_bitmap) { PLANAR[i] += eol_offset; @@ -3190,8 +3190,8 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, } /* -* BlitPlanar2Direct: -* +* BlitPlanar2Direct: +* * Synopsis: * BlitPlanar2Direct(bi, bm, ri, cim, SrcX, SrcY, DstX, DstY, SizeX, SizeY, MinTerm, Mask); * Inputs: @@ -3207,14 +3207,14 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, * d5.w:SizeY * d6.b:MinTerm * d7.b:Mask -* +* * This function is currently used to blit from planar bitmaps within system memory to direct color * bitmaps (15, 16, 24 or 32 bit) on the board. Watch out for plane pointers that are 0x00000000 (represents * a plane with all bits "0") or 0xffffffff (represents a plane with all bits "1"). The ColorIndexMapping is * used to map the color index of each pixel formed by the bits in the bitmap's planes to a direct color value * which is written to the destination RenderInfo. The color mask and all colors within the mapping are words, * triple bytes or longwords respectively similar to the color values used in FillRect(), BlitPattern() or -* BlitTemplate(). +* BlitTemplate(). */ uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (struct regstruct *regs) { @@ -3235,11 +3235,11 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (struct regstruct *regs) uae_u32 result = 0; P96_SM_RW; - + #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (minterm != 0x0C) { write_log ("WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.\n", minterm); @@ -3287,67 +3287,67 @@ static void flushpixels_paletted(uae_u8 *dst) if (picasso96_state.RGBFormat != RGBFB_CHUNKY) { - write_log ("ERROR - flushpixels() has non RGBFB_CHUNKY mode!\n"); + write_log ("ERROR - flushpixels() has non RGBFB_CHUNKY mode!\n"); return; } if (!picasso_vidinfo.extra_mem) return; for (i = 0; i < pixelcount; i++) - { - uaecptr addr = pixelbase[i].addr; - uae_u32 value = pixelbase[i].value; - int y = addr / picasso96_state.BytesPerRow; - int xbytes = addr % picasso96_state.BytesPerRow; - + { + uaecptr addr = pixelbase[i].addr; + uae_u32 value = pixelbase[i].value; + int y = addr / picasso96_state.BytesPerRow; + int xbytes = addr % picasso96_state.BytesPerRow; + if (xbytes < picasso96_state.Width * picasso96_state.BytesPerPixel && y < picasso96_state.Height) - { + { if(psiz == 4) { - uae_u8 *addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 4; - switch (pixelbase[i].size) - { + uae_u8 *addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 4; + switch (pixelbase[i].size) + { case 4: { - *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; - addr += 4; - *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; - addr += 4; - *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 16) & 0xff]; - addr += 4; - *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 24) & 0xff]; - break; + *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; + addr += 4; + *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; + addr += 4; + *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 16) & 0xff]; + addr += 4; + *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 24) & 0xff]; + break; } case 2: { - *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; - addr += 4; - *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; - break; + *(uae_u32 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; + addr += 4; + *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; + break; } case 1: { - *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; - break; + *(uae_u32 *)addr = picasso_vidinfo.clut[value & 0xff]; + break; } } } else { - uae_u8 *addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 2; + uae_u8 *addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 2; - switch (pixelbase[i].size) - { + switch (pixelbase[i].size) + { case 4: { - *(uae_u16 *)addr = picasso_vidinfo.clut[value & 0xff]; - addr += 2; - *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; - addr += 2; - *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 16) & 0xff]; - addr += 2; - *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 24) & 0xff]; - break; + *(uae_u16 *)addr = picasso_vidinfo.clut[value & 0xff]; + addr += 2; + *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 8) & 0xff]; + addr += 2; + *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 16) & 0xff]; + addr += 2; + *(uae_u16 *)addr = picasso_vidinfo.clut[(value >> 24) & 0xff]; + break; } case 2: { @@ -3358,9 +3358,9 @@ static void flushpixels_paletted(uae_u8 *dst) } case 1: { - *(uae_u16 *)addr = picasso_vidinfo.clut[value & 0xff]; - break; - } + *(uae_u16 *)addr = picasso_vidinfo.clut[value & 0xff]; + break; + } } } } @@ -3381,7 +3381,7 @@ static void flushpixels_rgbx(uae_u8 *dst) ULONG_PTR gwwcnt; if (!picasso_vidinfo.extra_mem) - return; + return; if (!gwwbuf) { gwwbufsize = allocated_gfxmem / 4096 + 1; gwwbuf = xmalloc (gwwbufsize * sizeof (void*)); @@ -3395,7 +3395,7 @@ static void flushpixels_rgbx(uae_u8 *dst) for (j = 0; j < ps / 4; j++) { int xbytes, y; uae_u32 *dst2; - y = addr / picasso96_state.BytesPerRow; + y = addr / picasso96_state.BytesPerRow; xbytes = addr % picasso96_state.BytesPerRow; dst2 = (uae_u32*)(dst + y * picasso_vidinfo.rowbytes + xbytes); if (xbytes < rowwidth_dst && y < picasso96_state.Height) @@ -3415,50 +3415,50 @@ static void flushpixels_rgb(uae_u8 *dst) int rowwidth_dst = picasso96_state.Width * picasso96_state.BytesPerPixel; if (!picasso_vidinfo.extra_mem) - return; + return; for (i = 0; i < pixelcount; i++) - { - uaecptr addr = pixelbase[i].addr; - uae_u32 value = pixelbase[i].value; - if(addr > xminaddr && addr < xmaxaddr) - { + { + uaecptr addr = pixelbase[i].addr; + uae_u32 value = pixelbase[i].value; + if(addr > xminaddr && addr < xmaxaddr) + { switch (pixelbase[i].size) { - case 4: + case 4: #ifdef SWAPSPEEDUP - *(uae_u32 *)(ydestaddr + addr) = value; - #else - do_put_mem_long ((uae_u32 *)(ydestaddr + addr), value); - #endif - break;; - case 2: - do_put_mem_word ((uae_u16 *)(ydestaddr + addr), value); - break; - case 1: - *(uae_u8 *)(ydestaddr + addr) = value; - break; + *(uae_u32 *)(ydestaddr + addr) = value; + #else + do_put_mem_long ((uae_u32 *)(ydestaddr + addr), value); + #endif + break;; + case 2: + do_put_mem_word ((uae_u16 *)(ydestaddr + addr), value); + break; + case 1: + *(uae_u8 *)(ydestaddr + addr) = value; + break; } } else { int xbytes, y; - y = addr / picasso96_state.BytesPerRow; + y = addr / picasso96_state.BytesPerRow; xbytes = addr % picasso96_state.BytesPerRow; - xminaddr = y * picasso96_state.BytesPerRow; + xminaddr = y * picasso96_state.BytesPerRow; xmaxaddr = xminaddr + rowwidth_src; ydestaddr = dst + y * picasso_vidinfo.rowbytes - xminaddr; - + if (xbytes < rowwidth_dst && y < picasso96_state.Height) - { - switch (pixelbase[i].size) - { + { + switch (pixelbase[i].size) + { case 4: #ifdef SWAPSPEEDUP *(uae_u32 *)(ydestaddr + addr) = value; - #else + #else do_put_mem_long ((uae_u32 *)(ydestaddr + addr), value); - #endif + #endif break;; case 2: do_put_mem_word ((uae_u16 *)(ydestaddr + addr), value); @@ -3468,11 +3468,11 @@ static void flushpixels_rgb(uae_u8 *dst) break; } } - else + else { - xmaxaddr = 0; + xmaxaddr = 0; } - } + } } } @@ -3480,7 +3480,7 @@ static void flushpixels(void) { uae_u8 *dst; int lock = 0; - + if (pixelcount == 0 && p96mode == 0) return; if (!picasso_on) { @@ -3492,7 +3492,7 @@ static void flushpixels(void) if(DirectDraw_IsLocked() == FALSE) { dst = gfx_lock_picasso (); lock = 1; - } else + } else #endif dst = picasso96_state.HostAddress; if (dst) { @@ -3539,7 +3539,7 @@ STATIC_INLINE void write_gfx_x (uaecptr addr, uae_u32 value, int size) } return; #else -#ifndef LOCK_UNLOCK_MADNESS +#ifndef LOCK_UNLOCK_MADNESS /* * Several writes to successive memory locations are a common access pattern. * Try to optimize it. @@ -3560,17 +3560,17 @@ STATIC_INLINE void write_gfx_x (uaecptr addr, uae_u32 value, int size) return; addr -= picasso96_state.Address + (picasso96_state.XOffset * picasso96_state.BytesPerPixel) + (picasso96_state.YOffset * picasso96_state.BytesPerRow); - + y = addr / picasso96_state.BytesPerRow; xbytes = addr % picasso96_state.BytesPerRow; x = xbytes / picasso96_state.BytesPerPixel; - + #ifdef LOCK_UNLOCK_MADNESS if (! picasso_vidinfo.extra_mem) { pixelcount = 0; return; } - + if (x < picasso96_state.Width && y < picasso96_state.Height) { dst = picasso96_state.HostAddress; if (dst) { @@ -3583,7 +3583,7 @@ STATIC_INLINE void write_gfx_x (uaecptr addr, uae_u32 value, int size) do_put_mem_word ((uae_u16 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); break; case 4: - do_put_mem_long ((uae_u32 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); + do_put_mem_long ((uae_u32 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); break; } } @@ -3661,7 +3661,7 @@ static void REGPARAM2 gfxmem_wput (uaecptr addr, uae_u32 w) addr &= gfxmem_mask; m = (uae_u16 *)(gfxmemory + addr); do_put_mem_word(m, (uae_u16)w); - + /* write the word to our displayable memory */ if (vsyncgfxwrite == 0) write_gfx_x(addr, w, 2); @@ -3673,7 +3673,7 @@ static void REGPARAM2 gfxmem_bput (uaecptr addr, uae_u32 b) addr -= gfxmem_start & gfxmem_mask; addr &= gfxmem_mask; gfxmemory[addr] = b; - + /* write the byte to our displayable memory */ if (vsyncgfxwrite == 0) write_gfx_x(addr, b, 1); @@ -3770,10 +3770,10 @@ void InitPicasso96 (void) oldscr=0; //fastscreen memset (&picasso96_state, 0, sizeof(struct picasso96_state_struct)); - + if (1) { int i, count; - + for (i = 0; i < 256; i++) { p2ctab[i][0] = (((i & 128) ? 0x01000000 : 0) | ((i & 64) ? 0x010000 : 0) @@ -3832,7 +3832,7 @@ uae_u8 *restore_p96 (uae_u8 *src) init_picasso_screen_called = 0; set_gc_called = !!(flags & 2); set_panning_called = !!(flags & 4); - changed_prefs.gfxmem_size = restore_u32(); + changed_prefs.gfxmem_size = restore_u32(); picasso96_state.Address = restore_u32(); picasso96_state.RGBFormat = restore_u32(); picasso96_state.Width = restore_u16(); diff --git a/od-win32/picasso96_win.h b/od-win32/picasso96_win.h index 35ceadac..138d8563 100755 --- a/od-win32/picasso96_win.h +++ b/od-win32/picasso96_win.h @@ -83,9 +83,9 @@ typedef enum { typedef enum { GCT_Unknown, GCT_ET4000, - GCT_ETW32, + GCT_ETW32, GCT_CirrusGD542x, - GCT_NCR77C32BLT, + GCT_NCR77C32BLT, GCT_CirrusGD5446, GCT_CirrusGD5434, GCT_S3Trio64, diff --git a/od-win32/picasso96_xp_win.c b/od-win32/picasso96_xp_win.c index 36b43044..ca1017ec 100755 --- a/od-win32/picasso96_xp_win.c +++ b/od-win32/picasso96_xp_win.c @@ -35,7 +35,7 @@ #include "options.h" #include "threaddep/thread.h" -#include "memory.h" +#include "memory.h" #include "custom.h" #include "events.h" #include "newcpu.h" @@ -50,9 +50,9 @@ #include "picasso96_win.h" #include "win32gfx.h" -int p96hack_vpos, p96hack_vpos2, p96refresh_active; +int p96hack_vpos, p96hack_vpos2, p96refresh_active; int have_done_picasso; /* For the JIT compiler */ -static int vsyncgfxwrite = 0; +static int vsyncgfxwrite = 0; static int p96syncrate, vsyncgfxcount; static int p96hsync_counter; @@ -124,22 +124,22 @@ static void checkrtglibrary(void) return; v = get_long (4); // execbase v += 378; // liblist - while ((v = get_long(v))) { - uae_u32 v2 = get_long(v + 10); // name + while ((v = get_long (v))) { + uae_u32 v2 = get_long (v + 10); // name uae_u8 *p; addrbank *b = &get_mem_bank(v2); if (!b || !b->check (v2, 12)) continue; p = b->xlateaddr(v2); if (!memcmp(p, "rtg.library\0", 12)) { - uae_u16 ver = get_word(v + 20); - uae_u16 rev = get_word(v + 22); + uae_u16 ver = get_word (v + 20); + uae_u16 rev = get_word (v + 22); if (ver * 10000 + rev < UAE_RTG_LIBRARY_VERSION * 10000 + UAE_RTG_LIBRARY_REVISION) { char msg[2000]; WIN32GUI_LoadUIString(IDS_OLDRTGLIBRARY, msg, sizeof(msg)); gui_message(msg, ver, rev, UAE_RTG_LIBRARY_VERSION, UAE_RTG_LIBRARY_REVISION); } else { - write_log("P96: rtg.library %d.%d detected\n", ver, rev); + write_log ("P96: rtg.library %d.%d detected\n", ver, rev); } checked = TRUE; } @@ -159,12 +159,12 @@ static void PICASSO96_Unlock(void) #ifdef LOCK_UNLOCK_MADNESS #if defined(P96TRACING_ENABLED) && P96TRACING_LEVEL > 1 // This format of output lets you double-click and jump to file/line - write_log("%s(%d) : calling P96 UNLOCK with picasso_on=%d\n", filename, linenum, picasso_on); + write_log ("%s(%d) : calling P96 UNLOCK with picasso_on=%d\n", filename, linenum, picasso_on); #endif if(picasso_on) { #ifdef PIXEL_LOCK flushpixels(); -#endif +#endif gfx_unlock_picasso (); picasso96_state.HostAddress = NULL; } @@ -180,7 +180,7 @@ static void PICASSO96_Lock(void) #ifdef LOCK_UNLOCK_MADNESS #if defined(P96TRACING_ENABLED) && P96TRACING_LEVEL > 1 // This format of output lets you double-click and jump to file/line - write_log( "%s(%d) : calling P96 LOCK with picasso_on=%d\n", filename, linenum, picasso_on ); + write_log ( "%s(%d) : calling P96 LOCK with picasso_on=%d\n", filename, linenum, picasso_on ); #endif if(picasso_on) { picasso96_state.HostAddress = gfx_lock_picasso (); @@ -226,9 +226,9 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr) int i; uaecptr amigamodeinfoptr; struct LibResolution *uaememptr = (struct LibResolution *)get_mem_bank(amigalibresptr).xlateaddr(amigalibresptr); - + write_log ("LibResolution Structure Dump:\n"); - + if (get_long (amigalibresptr + PSSO_LibResolution_DisplayID) == 0xFFFFFFFF) { write_log (" Finished With LibResolutions...\n"); } else { @@ -289,22 +289,22 @@ static void DumpTemplate (struct Template *tmp, unsigned long w, unsigned long h static void DumpLine( struct Line *line ) { if(line) { - write_log("Line->X = %d\n", line->X); - write_log("Line->Y = %d\n", line->Y); - write_log("Line->Length = %d\n", line->Length); - write_log("Line->dX = %d\n", line->dX); - write_log("Line->dY = %d\n", line->dY); - write_log("Line->sDelta = %d\n", line->sDelta); - write_log("Line->lDelta = %d\n", line->lDelta); - write_log("Line->twoSDminusLD = %d\n", line->twoSDminusLD); - write_log("Line->LinePtrn = %d\n", line->LinePtrn); - write_log("Line->PatternShift = %d\n", line->PatternShift); - write_log("Line->FgPen = 0x%x\n", line->FgPen); - write_log("Line->BgPen = 0x%x\n", line->BgPen); - write_log("Line->Horizontal = %d\n", line->Horizontal); - write_log("Line->DrawMode = %d\n", line->DrawMode); - write_log("Line->Xorigin = %d\n", line->Xorigin); - write_log("Line->Yorigin = %d\n", line->Yorigin); + write_log ("Line->X = %d\n", line->X); + write_log ("Line->Y = %d\n", line->Y); + write_log ("Line->Length = %d\n", line->Length); + write_log ("Line->dX = %d\n", line->dX); + write_log ("Line->dY = %d\n", line->dY); + write_log ("Line->sDelta = %d\n", line->sDelta); + write_log ("Line->lDelta = %d\n", line->lDelta); + write_log ("Line->twoSDminusLD = %d\n", line->twoSDminusLD); + write_log ("Line->LinePtrn = %d\n", line->LinePtrn); + write_log ("Line->PatternShift = %d\n", line->PatternShift); + write_log ("Line->FgPen = 0x%x\n", line->FgPen); + write_log ("Line->BgPen = 0x%x\n", line->BgPen); + write_log ("Line->Horizontal = %d\n", line->Horizontal); + write_log ("Line->DrawMode = %d\n", line->DrawMode); + write_log ("Line->Xorigin = %d\n", line->Xorigin); + write_log ("Line->Yorigin = %d\n", line->Yorigin); } } #endif @@ -312,7 +312,7 @@ static void DumpLine( struct Line *line ) static void ShowSupportedResolutions (void) { int i = 0; - + write_log ("-----------------\n"); while (DisplayModes[i].depth >= 0) { write_log ("%s\n", DisplayModes[i].name); @@ -328,17 +328,17 @@ static uae_u8 GetBytesPerPixel2(uae_u32 RGBfmt, char *file, int line) switch (RGBfmt) { case RGBFB_CLUT: return 1; - + case RGBFB_A8R8G8B8: case RGBFB_A8B8G8R8: case RGBFB_R8G8B8A8: case RGBFB_B8G8R8A8: return 4; - + case RGBFB_B8G8R8: case RGBFB_R8G8B8: return 3; - + case RGBFB_R5G5B5: case RGBFB_R5G6B5: case RGBFB_R5G6B5PC: @@ -365,7 +365,7 @@ static uae_u8 GetBytesPerPixel2(uae_u32 RGBfmt, char *file, int line) static int CopyRenderInfoStructureA2U (uaecptr amigamemptr, struct RenderInfo *ri) { uaecptr memp = get_long (amigamemptr + PSSO_RenderInfo_Memory); - + if (valid_address (memp, PSSO_RenderInfo_sizeof)) { ri->Memory = get_real_address (memp); ri->BytesPerRow = get_word (amigamemptr + PSSO_RenderInfo_BytesPerRow); @@ -404,16 +404,16 @@ static void CopyColorIndexMappingA2U (uaecptr amigamemptr, struct ColorIndexMapp static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm) { int i; - + bm->BytesPerRow = get_word (amigamemptr + PSSO_BitMap_BytesPerRow); bm->Rows = get_word (amigamemptr + PSSO_BitMap_Rows); bm->Flags = get_byte (amigamemptr + PSSO_BitMap_Flags); bm->Depth = get_byte (amigamemptr + PSSO_BitMap_Depth); - + /* ARGH - why is THIS happening? */ if(bm->Depth > 8) bm->Depth = 8; - + for (i = 0; i < bm->Depth; i++) { uaecptr plane = get_long (amigamemptr + PSSO_BitMap_Planes + i * 4); switch (plane) { @@ -437,7 +437,7 @@ static int CopyBitMapStructureA2U (uaecptr amigamemptr, struct BitMap *bm) static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) { uaecptr memp = get_long (amigamemptr + PSSO_Template_Memory); - + if (valid_address (memp, sizeof(struct Template))) { tmpl->Memory = get_real_address (memp); tmpl->BytesPerRow = get_word (amigamemptr + PSSO_Template_BytesPerRow); @@ -454,25 +454,25 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) static int CopyLineStructureA2U(uaecptr amigamemptr, struct Line *line) { if(valid_address(amigamemptr, sizeof(struct Line))) { - line->X = get_word(amigamemptr + PSSO_Line_X); - line->Y = get_word(amigamemptr + PSSO_Line_Y); - line->Length = get_word(amigamemptr + PSSO_Line_Length); - line->dX = get_word(amigamemptr + PSSO_Line_dX); - line->dY = get_word(amigamemptr + PSSO_Line_dY); - line->lDelta = get_word(amigamemptr + PSSO_Line_lDelta); - line->sDelta = get_word(amigamemptr + PSSO_Line_sDelta); - line->twoSDminusLD = get_word(amigamemptr + PSSO_Line_twoSDminusLD); - line->LinePtrn = get_word(amigamemptr + PSSO_Line_LinePtrn); - line->PatternShift = get_word(amigamemptr + PSSO_Line_PatternShift); - line->FgPen = get_long(amigamemptr + PSSO_Line_FgPen); - line->BgPen = get_long(amigamemptr + PSSO_Line_BgPen); - line->Horizontal = get_word(amigamemptr + PSSO_Line_Horizontal); - line->DrawMode = get_byte(amigamemptr + PSSO_Line_DrawMode); - line->Xorigin = get_word(amigamemptr + PSSO_Line_Xorigin); - line->Yorigin = get_word(amigamemptr + PSSO_Line_Yorigin); + line->X = get_word (amigamemptr + PSSO_Line_X); + line->Y = get_word (amigamemptr + PSSO_Line_Y); + line->Length = get_word (amigamemptr + PSSO_Line_Length); + line->dX = get_word (amigamemptr + PSSO_Line_dX); + line->dY = get_word (amigamemptr + PSSO_Line_dY); + line->lDelta = get_word (amigamemptr + PSSO_Line_lDelta); + line->sDelta = get_word (amigamemptr + PSSO_Line_sDelta); + line->twoSDminusLD = get_word (amigamemptr + PSSO_Line_twoSDminusLD); + line->LinePtrn = get_word (amigamemptr + PSSO_Line_LinePtrn); + line->PatternShift = get_word (amigamemptr + PSSO_Line_PatternShift); + line->FgPen = get_long (amigamemptr + PSSO_Line_FgPen); + line->BgPen = get_long (amigamemptr + PSSO_Line_BgPen); + line->Horizontal = get_word (amigamemptr + PSSO_Line_Horizontal); + line->DrawMode = get_byte (amigamemptr + PSSO_Line_DrawMode); + line->Xorigin = get_word (amigamemptr + PSSO_Line_Xorigin); + line->Yorigin = get_word (amigamemptr + PSSO_Line_Yorigin); return 1; } - write_log("ERROR - Invalid Line structure...\n"); + write_log ("ERROR - Invalid Line structure...\n"); return 0; } @@ -480,7 +480,7 @@ static void CopyLibResolutionStructureU2A (struct LibResolution *libres, uaecptr { char *uaememptr = 0; int i; - + uaememptr = gfxmem_xlate (amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ memset (uaememptr, 0, PSSO_LibResolution_sizeof); /* zero out our LibResolution structure */ strcpy (uaememptr + PSSO_LibResolution_P96ID, libres->P96ID); @@ -528,19 +528,19 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in /* Try OS specific fillrect function here; and return if successful. Make sure we adjust for * the pen values if we're doing 8-bit display-emulation on a 16-bit or higher screen. */ #ifdef PIXEL_LOCK - flushpixels(); + flushpixels(); #endif if(picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { if(DX_Fill(x, y, width, height, pen, rgbtype)) return; - } else { + } else { if(DX_Fill(x, y, width, height, picasso_vidinfo.clut[src[0]], rgbtype)) return; } P96TRACE(("P96_WARNING: do_fillrect() using fall-back routine!\n")); - + if(y + height > picasso_vidinfo.height) height = picasso_vidinfo.height - y; if(x + width > picasso_vidinfo.width) @@ -548,7 +548,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in if (! picasso_vidinfo.extra_mem) return; - + #ifdef LOCK_UNLOCK_MADNESS PICASSO96_Lock(); dst = picasso96_state.HostAddress; @@ -557,10 +557,10 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in #endif if (!dst) goto out; - + width *= Bpp; dst += y * picasso_vidinfo.rowbytes + x * picasso_vidinfo.pixbytes; - if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) + if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { if(Bpp == 1) { @@ -568,7 +568,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in { memset(dst, pen, width); dst += picasso_vidinfo.rowbytes; - } + } } else { @@ -576,7 +576,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in { memcpy (dst, src, width); dst += picasso_vidinfo.rowbytes; - } + } } } else @@ -587,11 +587,11 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in write_log ("ERROR - do_fillrect() calling abort 1!\n"); abort (); } - - while (height-- > 0) + + while (height-- > 0) { unsigned int i; - switch (psiz) + switch (psiz) { case 2: for (i = 0; i < width; i++) @@ -603,7 +603,7 @@ static void do_fillrect(uae_u8 *src, unsigned int x, unsigned int y, unsigned in break; default: write_log ("ERROR - do_fillrect() calling abort 2!\n"); - abort (); + abort (); break; } dst += picasso_vidinfo.rowbytes; @@ -625,8 +625,8 @@ out:; * must do it by hand using the data in the frame-buffer, calculated using * the RenderInfo data and our coordinates. */ -static void do_blit(struct RenderInfo *ri, int Bpp, - unsigned int srcx, unsigned int srcy, +static void do_blit(struct RenderInfo *ri, int Bpp, + unsigned int srcx, unsigned int srcy, unsigned int dstx, unsigned int dsty, unsigned int width, unsigned int height, BLIT_OPCODE opcode, int can_do_blit) @@ -641,7 +641,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, } //hack to use cpu rotines for scrolling in big Screens if (picasso96_state.XOffset < 0) can_do_blit = 0; - + dstx = dstx - picasso96_state.XOffset; dsty = dsty - picasso96_state.YOffset; if((int)dstx <= 0) { @@ -684,7 +684,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, srcy = dsty; } if (opcode != BLIT_SRC) { - write_log("do_blit() opcode = %d!\n", opcode); + write_log ("do_blit() opcode = %d!\n", opcode); return; } @@ -698,7 +698,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, { #ifdef LOCK_UNLOCK_MADNESS goto out; - #else + #else return; #endif } @@ -712,19 +712,19 @@ static void do_blit(struct RenderInfo *ri, int Bpp, write_log ("WARNING: do_blit() couldn't lock\n"); goto out; } - + /* The areas can't overlap: the source is always in the Picasso frame buffer, * and the destination is a different buffer owned by the graphics code. */ dstp += dsty * picasso_vidinfo.rowbytes + dstx * picasso_vidinfo.pixbytes; P96TRACE(("do_blit with srcp %p, dstp %p, dst_rowbytes %d, srcx %d, srcy %d, dstx %d, dsty %d, w %d, h %d, dst_pixbytes %d\n", srcp, dstp, picasso_vidinfo.rowbytes, srcx, srcy, dstx, dsty, width, height, picasso_vidinfo.pixbytes)); P96TRACE(("gfxmem is at %p\n", gfxmemory)); - - if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) + + if (picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { P96TRACE(("do_blit type-a\n")); width *= Bpp; - while (height-- > 0) + while (height-- > 0) { memcpy (dstp, srcp, width); srcp += ri->BytesPerRow; @@ -741,10 +741,10 @@ static void do_blit(struct RenderInfo *ri, int Bpp, write_log ("ERROR: do_blit() calling abort 1!\n"); abort (); } - while (height-- > 0) + while (height-- > 0) { unsigned int i; - switch (psiz) + switch (psiz) { case 2: for (i = 0; i < width; i++) @@ -780,7 +780,7 @@ static void do_blit(struct RenderInfo *ri, int Bpp, static void do_invertrect(struct RenderInfo *ri, int Bpp, int x, int y, int width, int height) { /* if(DX_InvertRect(x, y, width, height)) - return;*/ //deactivate in 0.8.20 + return;*/ //deactivate in 0.8.20 P96TRACE(("do_invertrect falling back to do_blit!\n")); do_blit (ri, Bpp, x, y, x, y, width, height, BLIT_SRC, 0); } @@ -799,7 +799,7 @@ static void wgfx_do_flushline (void) if (! picasso_vidinfo.extra_mem) /* The "out" will flush the dirty lines directly */ goto out; - + #ifdef LOCK_UNLOCK_MADNESS dstp = picasso96_state.HostAddress; #else @@ -813,7 +813,7 @@ static void wgfx_do_flushline (void) #endif src = gfxmemory + wgfx_min; - + if(picasso_vidinfo.rgbformat == picasso96_state.RGBFormat) { #if P96TRACING_LEVEL > 0 @@ -833,7 +833,7 @@ static void wgfx_do_flushline (void) write_log ("ERROR - wgfx_do_flushline() calling abort 1!\n"); abort (); } - + dstp += wgfx_y * picasso_vidinfo.rowbytes + (wgfx_min - wgfx_linestart) * psiz; switch (psiz) { case 2: @@ -846,11 +846,11 @@ static void wgfx_do_flushline (void) break; default: write_log ("ERROR - wgfx_do_flushline() calling abort 2!\n"); - abort (); + abort (); break; } } - + out: #ifndef LOCK_UNLOCK_MADNESS gfx_unlock_picasso (); @@ -874,7 +874,7 @@ static int renderinfo_is_current_screen (struct RenderInfo *ri) return 0; if (ri->Memory != gfxmemory + (picasso96_state.Address - gfxmem_start)) return 0; - + return 1; } @@ -890,21 +890,21 @@ static void do_fillrect_frame_buffer(struct RenderInfo *ri, int X, int Y, int Wi /* Do our virtual frame-buffer memory. First, we do a single line fill by hand */ oldstart = start = src = ri->Memory + X * Bpp + Y * ri->BytesPerRow; - - switch (Bpp) + + switch (Bpp) { case 1: memset (start, Pen, Width); break; case 2: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { do_put_mem_word ((uae_u16 *)start, (uae_u16)Pen); start += 2; } break; case 3: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { do_put_mem_byte (start, (uae_u8)Pen); start++; @@ -913,7 +913,7 @@ static void do_fillrect_frame_buffer(struct RenderInfo *ri, int X, int Y, int Wi } break; case 4: - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { /**start = Pen; */ do_put_mem_long ((uae_u32 *)start, Pen); @@ -950,13 +950,13 @@ void picasso_handle_vsync (void) if (vsyncgfxcount > 1) { if (picasso_on) { if (picasso96_state.RGBFormat == picasso_vidinfo.rgbformat - || picasso96_state.RGBFormat == RGBFB_CHUNKY) { + || picasso96_state.RGBFormat == RGBFB_CHUNKY) { static frame_time_t cycles; blitcount++; cycles = read_processor_time(); picasso_refresh(1); vsyncgfxcount = 0; - write_log("%d Blitnum %.3fms\n", blitcount, + write_log ("%d Blitnum %.3fms\n", blitcount, (read_processor_time() - cycles) * 1000 / (double)syncbase); } } @@ -1031,7 +1031,7 @@ void picasso_refresh (int call_setpalette) height = picasso96_state.Height; } do_blit(&ri, picasso96_state.BytesPerPixel, 0, 0, 0, 0, width, height, BLIT_SRC, 0); - } + } else { write_log ("ERROR - picasso_refresh() can't refresh!\n"); @@ -1048,7 +1048,7 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d unsigned long width, unsigned long height, uae_u8 mask, BLIT_OPCODE opcode) { - + uae_u8 *src, *dst, *tmp, *tmp2, *tmp3; uae_u8 Bpp = GetBytesPerPixel(ri->RGBFormat); unsigned long total_width = width * Bpp; @@ -1062,8 +1062,8 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d { write_log ("WARNING - BlitRect() has mask 0x%x with Bpp %d.\n", mask, Bpp); } - - if (mask == 0xFF || Bpp > 1) + + if (mask == 0xFF || Bpp > 1) { if(opcode == BLIT_SRC) { @@ -1074,7 +1074,7 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) memmove (dst, src, total_width); } - else if (dsty < srcy) + else if (dsty < srcy) { unsigned long i; for (i = 0; i < height; i++, src += ri->BytesPerRow, dst += dstri->BytesPerRow) @@ -1137,13 +1137,13 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d *dst2_32 = ~(*src2_32 ^ *dst2_32); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2_32 = ~(*src2_32) | *dst2_32; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2_32 = ~(*dst2_32) | *src2_32; @@ -1155,7 +1155,7 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d *dst2_32 = 0xFFFFFFFF; break; case 30: //code for swap source with dest in byte - { + { uae_u32 temp; temp = *src2_32; *src2_32 = *dst2_32; @@ -1163,7 +1163,7 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d } break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; } /* switch opcode */ }// for end @@ -1203,13 +1203,13 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d *dst2 = ~(*src2 ^ *dst2); break; case BLIT_DST: - write_log("do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ("do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2 = ~(*src2) | *dst2; break; case BLIT_SRC: - write_log("do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ("do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2 = ~(*dst2) | *src2; @@ -1221,7 +1221,7 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d *dst2 = 0xFF; break; case BLIT_LAST: - write_log("do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ("do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; case 30: //code for swap source with dest in long { @@ -1242,19 +1242,19 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d tmp3 = tmp2 = tmp = xmalloc (linewidth * height); /* allocate enough memory for the src-rect */ if (!tmp) - return; + return; /* copy the src-rect into our temporary buffer space */ - for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) + for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) { memcpy (tmp2, src, total_width); } /* copy the temporary buffer to the destination */ - for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp+= linewidth) + for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp+= linewidth) { unsigned long cols; - for (cols = 0; cols < width; cols++) + for (cols = 0; cols < width; cols++) { dst[cols] &= ~mask; dst[cols] |= tmp[cols] & mask; @@ -1262,19 +1262,19 @@ static void do_blitrect_frame_buffer(struct RenderInfo *ri, struct RenderInfo *d } /* free the temp-buf */ xfree (tmp3); -} +} /* -DrawLine: -Synopsis: DrawLine(bi, ri, line, Mask, RGBFormat); -Inputs: a0: struct BoardInfo *bi -a1: struct RenderInfo *ri -a2: struct Line *line -d0.b: Mask -d7.l: RGBFormat +DrawLine: +Synopsis: DrawLine(bi, ri, line, Mask, RGBFormat); +Inputs: a0: struct BoardInfo *bi +a1: struct RenderInfo *ri +a2: struct Line *line +d0.b: Mask +d7.l: RGBFormat This function is used to paint a line on the board memory possibly using the blitter. It is called by Draw -and obeyes the destination RGBFormat as well as ForeGround and BackGround pens and draw modes. +and obeyes the destination RGBFormat as well as ForeGround and BackGround pens and draw modes. */ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) { @@ -1282,11 +1282,11 @@ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) #ifdef P96_DRAWLINE struct Line line; struct RenderInfo ri; - uae_u8 Mask = m68k_dreg(regs, 0); - RGBFTYPE RGBFormat = m68k_dreg(regs, 7); + uae_u8 Mask = m68k_dreg (regs, 0); + RGBFTYPE RGBFormat = m68k_dreg (regs, 7); - CopyRenderInfoStructureA2U(m68k_areg(regs, 1), &ri); - CopyLineStructureA2U(m68k_areg(regs, 2), &line); + CopyRenderInfoStructureA2U(m68k_areg (regs, 1), &ri); + CopyLineStructureA2U(m68k_areg (regs, 2), &line); #if defined( P96TRACING_ENABLED ) && P96TRACING_LEVEL > 0 DumpLine( &line ); #endif @@ -1298,40 +1298,40 @@ uae_u32 REGPARAM2 picasso_DrawLine (struct regstruct *regs) #ifdef HARDWARE_SPRITE_EMULATION /* -SetSprite: -Synopsis: SetSprite(bi, activate, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d0: BOOL activate -d7: RGBFTYPE RGBFormat +SetSprite: +Synopsis: SetSprite(bi, activate, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d0: BOOL activate +d7: RGBFTYPE RGBFormat -This function activates or deactivates the hardware sprite. +This function activates or deactivates the hardware sprite. */ uae_u32 picasso_SetSprite (void) { uae_u32 result = 0; - uae_u32 activate = m68k_dreg( regs, 0 ); + uae_u32 activate = m68k_dreg ( regs, 0 ); result = DX_ShowCursor( activate ); write_log ("SetSprite() - trying to %s cursor, result = %d\n", activate ? "show":"hide", result); return result; } /* -SetSpritePosition: -Synopsis: SetSpritePosition(bi, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d7: RGBFTYPE RGBFormat +SetSpritePosition: +Synopsis: SetSpritePosition(bi, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d7: RGBFTYPE RGBFormat This function sets the hardware mouse sprite position according to the values in the BoardInfo structure. MouseX and MouseY are the coordinates relative to the screen bitmap. XOffset and YOffset must be subtracted -to account for possible screen panning. +to account for possible screen panning. */ uae_u32 picasso_SetSpritePosition (void) { uae_u32 result = 0; - uaecptr bi = m68k_areg(regs, 0); - uae_u16 MouseX = get_word(bi + PSSO_BoardInfo_MouseX) - picasso96_state.XOffset; - uae_u16 MouseY = get_word(bi + PSSO_BoardInfo_MouseY) - picasso96_state.YOffset; - + uaecptr bi = m68k_areg (regs, 0); + uae_u16 MouseX = get_word (bi + PSSO_BoardInfo_MouseX) - picasso96_state.XOffset; + uae_u16 MouseY = get_word (bi + PSSO_BoardInfo_MouseY) - picasso96_state.YOffset; + // Keep these around, because we don't want flickering static uae_u16 OldMouseX = -1; static uae_u16 OldMouseY = -1; @@ -1356,29 +1356,29 @@ uae_u32 picasso_SetSpritePosition (void) } /* -SetSpriteImage: -Synopsis: SetSpriteImage(bi, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d7: RGBFTYPE RGBFormat +SetSpriteImage: +Synopsis: SetSpriteImage(bi, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d7: RGBFTYPE RGBFormat This function gets new sprite image data from the MouseImage field of the BoardInfo structure and writes it to the board. -There are three possible cases: +There are three possible cases: BIB_HIRESSPRITE is set: skip the first two long words and the following sprite data is arranged as an array of two longwords. Those form the -two bit planes for one image line respectively. +two bit planes for one image line respectively. BIB_HIRESSPRITE and BIB_BIGSPRITE are not set: skip the first two words and the following sprite data is arranged as an array of two words. Those form the two -bit planes for one image line respectively. +bit planes for one image line respectively. BIB_HIRESSPRITE is not set and BIB_BIGSPRITE is set: skip the first two words and the following sprite data is arranged as an array of two words. Those form the two bit planes for one image line respectively. You have to double each pixel horizontally and vertically. All coordinates used in this case already assume a zoomed sprite, only the sprite data is not zoomed yet. You will have to -compensate for this when accounting for hotspot offsets and sprite dimensions. +compensate for this when accounting for hotspot offsets and sprite dimensions. */ uae_u32 picasso_SetSpriteImage (void) { @@ -1388,16 +1388,16 @@ uae_u32 picasso_SetSpriteImage (void) } /* -SetSpriteColor: -Synopsis: SetSpriteColor(bi, index, red, green, blue, RGBFormat); -Inputs: a0: struct BoardInfo *bi -d0.b: index -d1.b: red -d2.b: green -d3.b: blue -d7: RGBFTYPE RGBFormat - -This function changes one of the possible three colors of the hardware sprite. +SetSpriteColor: +Synopsis: SetSpriteColor(bi, index, red, green, blue, RGBFormat); +Inputs: a0: struct BoardInfo *bi +d0.b: index +d1.b: red +d2.b: green +d3.b: blue +d7: RGBFTYPE RGBFormat + +This function changes one of the possible three colors of the hardware sprite. */ uae_u32 picasso_SetSpriteColor (void) { @@ -1427,7 +1427,7 @@ uae_u32 REGPARAM2 picasso_FindCard (struct regstruct *regs) uaecptr AmigaBoardInfo = m68k_areg (regs, 0); /* NOTES: See BoardInfo struct definition in Picasso96 dev info */ - + if (allocated_gfxmem && !picasso96_state.CardFound) { /* Fill in MemoryBase, MemorySize */ put_long (AmigaBoardInfo + PSSO_BoardInfo_MemoryBase, gfxmem_start); @@ -1458,7 +1458,7 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc } uaememptr = gfxmem_xlate(amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ memset(uaememptr, 0, PSSO_ModeInfo_sizeof); /* zero out our ModeInfo struct */ - + put_word (amigamemptr + PSSO_ModeInfo_Width, dm->res.width); put_word (amigamemptr + PSSO_ModeInfo_Height, dm->res.height); put_byte (amigamemptr + PSSO_ModeInfo_Depth, dm->depth * 8); @@ -1469,15 +1469,15 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc put_word (amigamemptr + PSSO_ModeInfo_HorSyncSize, 0); put_byte (amigamemptr + PSSO_ModeInfo_HorSyncSkew, 0); put_byte (amigamemptr + PSSO_ModeInfo_HorEnableSkew, 0); - + put_word (amigamemptr + PSSO_ModeInfo_VerTotal, dm->res.height); put_word (amigamemptr + PSSO_ModeInfo_VerBlankSize, 0); put_word (amigamemptr + PSSO_ModeInfo_VerSyncStart, 0); put_word (amigamemptr + PSSO_ModeInfo_VerSyncSize, 0); - + put_byte (amigamemptr + PSSO_ModeInfo_first_union, 98); put_byte (amigamemptr + PSSO_ModeInfo_second_union, 14); - + put_long (amigamemptr + PSSO_ModeInfo_PixelClock, dm->res.width * dm->res.height * (currprefs.gfx_refreshrate ? abs (currprefs.gfx_refreshrate) : default_freq)); } @@ -1556,7 +1556,7 @@ static int AssignModeID(int dm, int count, int *unkcnt) return 0x50001000 | (mi[i].id * 0x10000); } (*unkcnt)++; - write_log("P96: Non-unique mode %dx%d\n", w, h); + write_log ("P96: Non-unique mode %dx%d\n", w, h); return 0x51000000 - (*unkcnt) * 0x10000; #if 0 int result; @@ -1626,10 +1626,10 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 4, hicolour.height); put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 6, truecolour.height); put_word (AmigaBoardInfo + PSSO_BoardInfo_MaxVerResolution + 8, alphacolour.height); - + i = 0; unkcnt = 0; - while (DisplayModes[i].depth >= 0) { + while (DisplayModes[i].depth >= 0) { int j = i; /* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */ res.DisplayID = AssignModeID(i, LibResolutionStructureCount, &unkcnt); @@ -1644,10 +1644,10 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) res.Modes[HICOLOR] = 0; res.Modes[TRUECOLOR] = 0; res.Modes[TRUEALPHA] = 0; - + do { /* Handle this display mode's depth */ - + /* New: Only add the modes when there is enough P96 RTG memory to hold the bitmap */ if((allocated_gfxmem - 32768) > (DisplayModes[i].res.width * DisplayModes[i].res.height * DisplayModes[i].depth)) @@ -1659,7 +1659,7 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) } while (DisplayModes[i].depth >= 0 && DisplayModes[i].res.width == DisplayModes[j].res.width && DisplayModes[i].res.height == DisplayModes[j].res.height); - + amigamemptr = gfxmem_start + allocated_gfxmem - 16384 + (PSSO_LibResolution_sizeof * LibResolutionStructureCount++); CopyLibResolutionStructureU2A (&res, amigamemptr); #if defined P96TRACING_ENABLED && P96TRACING_LEVEL > 1 @@ -1667,7 +1667,7 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) #endif AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amigamemptr); } - + return -1; } @@ -1692,14 +1692,14 @@ uae_u32 REGPARAM2 picasso_SetSwitch (struct regstruct *regs) * whenever it is ready to change the screen state. */ picasso_requested_on = flag; write_log ("SetSwitch() - trying to show %s screen\n", flag ? "picasso96" : "amiga"); - + /* Put old switch-state in D0 */ return !flag; } void picasso_enablescreen (int on) -{ +{ #if 0 wgfx_linestart = 0xFFFFFFFF; #endif @@ -1729,17 +1729,17 @@ uae_u32 REGPARAM2 picasso_SetColorArray (struct regstruct *regs) int i; uaecptr boardinfo = m68k_areg (regs, 0); uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT + start * 3; - + for (i = start; i < start + count; i++) { int r = get_byte (clut); int g = get_byte (clut + 1); int b = get_byte (clut + 2); - - palette_changed |= (picasso96_state.CLUT[i].Red != r + + palette_changed |= (picasso96_state.CLUT[i].Red != r || picasso96_state.CLUT[i].Green != g || picasso96_state.CLUT[i].Blue != b); - - picasso96_state.CLUT[i].Red = r; + + picasso96_state.CLUT[i].Red = r; picasso96_state.CLUT[i].Green = g; picasso96_state.CLUT[i].Blue = b; clut += 3; @@ -1760,7 +1760,7 @@ uae_u32 REGPARAM2 picasso_SetDAC (struct regstruct *regs) { /* Fill in some static UAE related structure about this new DAC setting * Lets us keep track of what pixel format the Amiga is thinking about in our frame-buffer */ - + P96TRACE(("SetDAC()\n")); return 1; } @@ -1778,10 +1778,10 @@ static void init_picasso_screen(void) if((picasso_vidinfo.width == picasso96_state.Width) && (picasso_vidinfo.height == picasso96_state.Height) && (picasso_vidinfo.depth == (picasso96_state.GC_Depth >> 3)) && - (picasso_vidinfo.selected_rgbformat == picasso96_state.RGBFormat)) + (picasso_vidinfo.selected_rgbformat == picasso96_state.RGBFormat)) { DX_SetPalette (0, 256); - picasso_refresh (1); + picasso_refresh (1); } } @@ -1801,16 +1801,16 @@ uae_u32 REGPARAM2 picasso_SetGC (struct regstruct *regs) /* Fill in some static UAE related structure about this new ModeInfo setting */ uae_u32 border = m68k_dreg (regs, 0); uaecptr modeinfo = m68k_areg (regs, 1); - + picasso96_state.Width = get_word (modeinfo + PSSO_ModeInfo_Width); picasso96_state.VirtualWidth = picasso96_state.Width; /* in case SetPanning doesn't get called */ - + picasso96_state.Height = get_word (modeinfo + PSSO_ModeInfo_Height); picasso96_state.VirtualHeight = picasso96_state.Height; /* in case SetPanning doesn't get called */ - + picasso96_state.GC_Depth = get_byte (modeinfo + PSSO_ModeInfo_Depth); picasso96_state.GC_Flags = get_byte (modeinfo + PSSO_ModeInfo_Flags); - + P96TRACE(("SetGC(%d,%d,%d,%d)\n", picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth, border)); set_gc_called = 1; picasso96_state.HostAddress = NULL; @@ -1843,24 +1843,24 @@ uae_u32 REGPARAM2 picasso_SetGC (struct regstruct *regs) */ uae_u32 REGPARAM2 picasso_SetPanning (struct regstruct *regs) -{ +{ uae_u16 Width = m68k_dreg (regs, 0); uaecptr start_of_screen = m68k_areg (regs, 1); - uaecptr bi = m68k_areg(regs, 0); - uaecptr bmeptr = get_long(bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */ + uaecptr bi = m68k_areg (regs, 0); + uaecptr bmeptr = get_long (bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */ uae_u16 bme_width, bme_height; if(oldscr == 0) { - oldscr = start_of_screen; + oldscr = start_of_screen; } if (oldscr != start_of_screen) { set_gc_called = 0; oldscr = start_of_screen; } - bme_width = get_word(bmeptr + PSSO_BitMapExtra_Width); - bme_height = get_word(bmeptr + PSSO_BitMapExtra_Height); - + bme_width = get_word (bmeptr + PSSO_BitMapExtra_Width); + bme_height = get_word (bmeptr + PSSO_BitMapExtra_Height); + picasso96_state.Address = start_of_screen; /* Amiga-side address */ picasso96_state.XOffset = (uae_s16)(m68k_dreg (regs, 1) & 0xFFFF); picasso96_state.YOffset = (uae_s16)(m68k_dreg (regs, 2) & 0xFFFF); @@ -1873,14 +1873,14 @@ uae_u32 REGPARAM2 picasso_SetPanning (struct regstruct *regs) picasso96_state.RGBFormat = m68k_dreg (regs, 7); picasso96_state.BytesPerPixel = GetBytesPerPixel (picasso96_state.RGBFormat); picasso96_state.BytesPerRow = bme_width * picasso96_state.BytesPerPixel; - + set_panning_called = 1; P96TRACE(("SetPanning(%d, %d, %d) Start 0x%x, BPR %d Bpp %d RGBF %d\n", Width, picasso96_state.XOffset, picasso96_state.YOffset, start_of_screen, picasso96_state.BytesPerRow, picasso96_state.BytesPerPixel, picasso96_state.RGBFormat)); init_picasso_screen (); set_panning_called = 0; - + return 1; } @@ -1890,7 +1890,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) #if 0 && defined ALIGN_POINTER_TO32 int align_adjust = ALIGN_POINTER_TO32(ptr); int len2; - + len -= align_adjust; while (align_adjust) { *ptr ^= val; @@ -1916,7 +1916,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) /* * InvertRect: -* +* * Inputs: * a0:struct BoardInfo *bi * a1:struct RenderInfo *ri @@ -1926,7 +1926,7 @@ static void do_xor8 (uae_u8 *ptr, long len, uae_u32 val) * d3.w:Height * d4.l:Mask * d7.l:RGBFormat -* +* * This function is used to invert a rectangular area on the board. It is called by BltBitMap, * BltPattern and BltTemplate. */ @@ -1953,23 +1953,23 @@ uae_u32 REGPARAM2 picasso_InvertRect (struct regstruct *regs) return 0; #endif #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (renderinfo, &ri)) { P96TRACE(("InvertRect %dbpp 0x%lx\n", Bpp, (long)mask)); - - if (mask != 0xFF && Bpp > 1) + + if (mask != 0xFF && Bpp > 1) mask = 0xFF; xorval = 0x01010101 * (mask & 0xFF); width_in_bytes = Bpp * Width; rectstart = uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; - + for (lines = 0; lines < Height; lines++, uae_mem += ri.BytesPerRow) do_xor8 (uae_mem, width_in_bytes, xorval); - + if (vsyncgfxwrite == 0) { if (renderinfo_is_current_screen (&ri)) { if (mask == 0xFF) @@ -2007,7 +2007,7 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) uae_u32 Pen = m68k_dreg (regs, 4); uae_u8 Mask = (uae_u8)m68k_dreg (regs, 5); RGBFTYPE RGBFormat = m68k_dreg (regs, 7); - + uae_u8 *src; uae_u8 *oldstart; int Bpp; @@ -2023,21 +2023,21 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (renderinfo, &ri) && Y != 0xFFFF) { if (ri.RGBFormat != RGBFormat) write_log ("Weird Stuff!\n"); - + Bpp = GetBytesPerPixel (RGBFormat); - + P96TRACE(("FillRect(%d, %d, %d, %d) Pen 0x%x BPP %d BPR %d Mask 0x%x\n", X, Y, Width, Height, Pen, Bpp, ri.BytesPerRow, Mask)); - + if(Bpp > 1) Mask = 0xFF; - - if (Mask == 0xFF) + + if (Mask == 0xFF) { if((Width == 1) || (Height == 1)) { @@ -2081,7 +2081,7 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) { src = ri.Memory + X * Bpp + Y * ri.BytesPerRow; X = X - picasso96_state.XOffset; - Y = Y - picasso96_state.YOffset; + Y = Y - picasso96_state.YOffset; if((int)X < 0) { Width = Width + X; X = 0; @@ -2112,9 +2112,9 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) else { /* We get here only if Mask != 0xFF */ - if (Bpp != 1) + if (Bpp != 1) { - write_log("WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp); + write_log ("WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp); } else { @@ -2124,11 +2124,11 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs) { uae_u8 *start = oldstart; uae_u8 *end = start + Height * ri.BytesPerRow; - for (; start != end; start += ri.BytesPerRow) + for (; start != end; start += ri.BytesPerRow) { uae_u8 *p = start; unsigned long cols; - for (cols = 0; cols < Width; cols++) + for (cols = 0; cols < Width; cols++) { uae_u32 tmpval = do_get_mem_byte (p + cols) & Mask; do_put_mem_byte (p + cols, (uae_u8)(Pen | tmpval)); @@ -2196,16 +2196,16 @@ static int BlitRectHelper(void) unsigned long height = blitrectdata.height; uae_u8 mask = blitrectdata.mask; BLIT_OPCODE opcode = blitrectdata.opcode; - + uae_u8 Bpp = GetBytesPerPixel(ri->RGBFormat); int can_do_visible_blit = 0; if(opcode == BLIT_DST) { - write_log("WARNING: BlitRect() being called with opcode of BLIT_DST\n"); + write_log ("WARNING: BlitRect() being called with opcode of BLIT_DST\n"); return 1; } - + /* * If we have no destination RenderInfo, then we're dealing with a single-buffer action, called * from picasso_BlitRect(). The code in do_blitrect_frame_buffer() deals with the frame-buffer, @@ -2216,12 +2216,12 @@ static int BlitRectHelper(void) */ if (dstri == NULL || dstri->Memory == ri->Memory) { - if(mask != 0xFF && Bpp > 1) + if(mask != 0xFF && Bpp > 1) mask = 0xFF; dstri = ri; can_do_visible_blit = 1; } - + /* Do our virtual frame-buffer memory first */ do_blitrect_frame_buffer(ri, dstri, srcx, srcy, dstx, dsty, width, height, mask, opcode); /* Now we do the on-screen display, if renderinfo points to it */ @@ -2268,7 +2268,7 @@ static int BlitRect (uaecptr ri, uaecptr dstri, blitrectdata.height = height; blitrectdata.mask = mask; blitrectdata.opcode = opcode; - + return BlitRectHelper(); } @@ -2305,7 +2305,7 @@ uae_u32 REGPARAM2 picasso_BlitRect (struct regstruct *regs) return 0; #endif #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif P96TRACE(("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask)); result = BlitRect(renderinfo, 0, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC); @@ -2352,12 +2352,12 @@ uae_u32 REGPARAM2 picasso_BlitRectNoMaskComplete (struct regstruct *regs) return 0; #endif #ifndef LOCK_UNLOCK_MADNESS - wgfx_flushline (); + wgfx_flushline (); #endif P96TRACE(("BlitRectNoMaskComplete() op 0x%2x, xy(%4d,%4d) --> xy(%4d,%4d), wh(%4d,%4d)\n", OpCode, srcx, srcy, dstx, dsty, width, height)); - + result = BlitRect(srcri, dstri, srcx, srcy, dstx, dsty, width, height, 0xFF, OpCode); return result; @@ -2410,7 +2410,7 @@ STATIC_INLINE void PixelWrite(uae_u8 *mem, int bits, uae_u32 fgpen, uae_u8 Bpp, /* * BlitPattern: -* +* * Synopsis:BlitPattern(bi, ri, pattern, X, Y, Width, Height, Mask, RGBFormat); * Inputs: * a0:struct BoardInfo *bi @@ -2422,7 +2422,7 @@ STATIC_INLINE void PixelWrite(uae_u8 *mem, int bits, uae_u32 fgpen, uae_u8 Bpp, * d3.w:Height * d4.w:Mask * d7.l:RGBFormat -* +* * This function is used to paint a pattern on the board memory using the blitter. It is called by * BltPattern, if a AreaPtrn is used with positive AreaPtSz. The pattern consists of a b/w image * using a single plane of image data which will be expanded repeatedly to the destination RGBFormat @@ -2460,17 +2460,17 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if(CopyRenderInfoStructureA2U (rinf, &ri) && CopyPatternStructureA2U (pinf, &pattern)) { Bpp = GetBytesPerPixel(ri.RGBFormat); uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset with address */ - + if (pattern.DrawMode & INVERS) inversion = 1; - + pattern.DrawMode &= 0x03; - if (Mask != 0xFF) + if (Mask != 0xFF) { if(Bpp > 1) Mask = 0xFF; @@ -2498,26 +2498,26 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) #endif ysize_mask = (1 << pattern.Size) - 1; xshift = pattern.XOffset & 15; - + for (rows = 0; rows < H; rows++, uae_mem += ri.BytesPerRow) { unsigned long prow = (rows + pattern.YOffset) & ysize_mask; unsigned int d = do_get_mem_word (((uae_u16 *)pattern.Memory) + prow); uae_u8 *uae_mem2 = uae_mem; unsigned long cols; - + if (xshift != 0) d = (d << xshift) | (d >> (16 - xshift)); - - for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp << 4) + + for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp << 4) { long bits; long max = W - cols; unsigned int data = d; - + if (max > 16) max = 16; - - for (bits = 0; bits < max; bits++) + + for (bits = 0; bits < max; bits++) { int bit_set = data & 0x8000; data <<= 1; @@ -2539,7 +2539,7 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs) case COMP: if (bit_set) { fgpen = pattern.FgPen; - + switch (Bpp) { case 1: { @@ -2635,18 +2635,18 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (CopyRenderInfoStructureA2U (rinf, &ri) && CopyTemplateStructureA2U (tmpl, &tmp)) { Bpp = GetBytesPerPixel(ri.RGBFormat); uae_mem = ri.Memory + Y*ri.BytesPerRow + X*Bpp; /* offset into address */ - + if (tmp.DrawMode & INVERS) inversion = 1; - + tmp.DrawMode &= 0x03; - if (Mask != 0xFF) + if (Mask != 0xFF) { if(Bpp > 1) Mask = 0xFF; @@ -2677,34 +2677,34 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) { P96TRACE(("BlitTemplate() xy(%d,%d), wh(%d,%d) draw 0x%x fg 0x%x bg 0x%x \n", X, Y, W, H, tmp.DrawMode, tmp.FgPen, tmp.BgPen)); - + bitoffset = tmp.XOffset % 8; - + #if defined(P96TRACING_ENABLED) && (P96TRACING_LEVEL > 0) DumpTemplate(&tmp, W, H); #endif - + tmpl_base = tmp.Memory + tmp.XOffset / 8; - + for (rows = 0; rows < H; rows++, uae_mem += ri.BytesPerRow, tmpl_base += tmp.BytesPerRow) { unsigned long cols; uae_u8 *tmpl_mem = tmpl_base; uae_u8 *uae_mem2 = uae_mem; unsigned int data = *tmpl_mem; - + for (cols = 0; cols < W; cols += 8, uae_mem2 += Bpp << 3) { unsigned int byte; long bits; long max = W - cols; - + if (max > 8) max = 8; - + data <<= 8; data |= *++tmpl_mem; - + byte = data >> (8 - bitoffset); - + for (bits = 0; bits < max; bits++) { int bit_set = (byte & 0x80); byte <<= 1; @@ -2723,13 +2723,13 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) fgpen = tmp.BgPen; if (bit_set) fgpen = tmp.FgPen; - + PixelWrite(uae_mem2, bits, fgpen, Bpp, Mask); break; case COMP: if (bit_set) { fgpen = tmp.FgPen; - + switch (Bpp) { case 1: { @@ -2762,7 +2762,7 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) } } } - + #ifdef PIXEL_LOCK flushpixels(); #endif @@ -2773,7 +2773,7 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs) } result = 1; } -} +} return 1; } @@ -2789,10 +2789,10 @@ uae_u32 REGPARAM2 picasso_CalculateBytesPerRow (struct regstruct *regs) { uae_u16 width = m68k_dreg (regs, 0); uae_u32 type = m68k_dreg (regs, 7); - + width = GetBytesPerPixel(type) * width; P96TRACE(("CalculateBytesPerRow() = %d\n",width)); - + return width; } @@ -2801,7 +2801,7 @@ uae_u32 REGPARAM2 picasso_CalculateBytesPerRow (struct regstruct *regs) * a0: struct BoardInfo * d0: BOOL state * This function enables and disables the video display. -* +* * NOTE: return the opposite of the state */ uae_u32 REGPARAM2 picasso_SetDisplay (struct regstruct *regs) @@ -2814,7 +2814,7 @@ uae_u32 REGPARAM2 picasso_SetDisplay (struct regstruct *regs) void picasso_handle_hsync (void) { static int p96hsync; - + if (currprefs.gfxmem_size == 0) return; if (WIN32GFX_IsPicassoScreen () && currprefs.gfx_pfullscreen && currprefs.gfx_vsync) { @@ -2850,15 +2850,15 @@ static void PlanarToChunky(struct RenderInfo *ri, struct BitMap *bm, uae_u8 mask) { int j; - + uae_u8 *PLANAR[8], *image = ri->Memory + dstx * GetBytesPerPixel (ri->RGBFormat) + dsty * ri->BytesPerRow; int Depth = bm->Depth; unsigned long rows, bitoffset = srcx & 7; long eol_offset; - - /* if (mask != 0xFF) + + /* if (mask != 0xFF) write_log ("P2C - pixel-width = %d, bit-offset = %d\n", width, bitoffset); */ - + /* Set up our bm->Planes[] pointers to the right horizontal offset */ for (j = 0; j < Depth; j++) { uae_u8 *p = bm->Planes[j]; @@ -2871,7 +2871,7 @@ static void PlanarToChunky(struct RenderInfo *ri, struct BitMap *bm, eol_offset = (long)bm->BytesPerRow - (long)((width + 7) >> 3); for (rows = 0; rows < height; rows++, image += ri->BytesPerRow) { unsigned long cols; - + for (cols = 0; cols < width; cols += 8) { int k; uae_u32 a = 0, b = 0; @@ -2960,7 +2960,7 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Chunky (struct regstruct *regs) write_log ("ERROR - BlitPlanar2Chunky() has minterm 0x%x, which I don't handle. Using fall-back routine.\n", minterm); } - else if(CopyRenderInfoStructureA2U (ri, &local_ri) && + else if(CopyRenderInfoStructureA2U (ri, &local_ri) && CopyBitMapStructureA2U (bm, &local_bm)) { P96TRACE(("BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n", @@ -2992,10 +2992,10 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, int Depth = bm->Depth; unsigned long rows; long eol_offset; - + if(!bpp) return; - + /* Set up our bm->Planes[] pointers to the right horizontal offset */ for (j = 0; j < Depth; j++) { uae_u8 *p = bm->Planes[j]; @@ -3005,14 +3005,14 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, if ((mask & (1 << j)) == 0) PLANAR[j] = &all_zeros_bitmap; } - + eol_offset = (long)bm->BytesPerRow - (long)((width + (srcx & 7)) >> 3); for (rows = 0; rows < height; rows++, image += ri->BytesPerRow) { unsigned long cols; uae_u8 *image2 = image; unsigned int bitoffs = 7 - (srcx & 7); int i; - + for (cols = 0; cols < width; cols ++) { int v = 0, k; for (k = 0; k < Depth; k++) { @@ -3022,7 +3022,7 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, v |= ((*PLANAR[k] >> bitoffs) & 1) << k; } } - + switch (bpp) { case 2: do_put_mem_word ((uae_u16 *)image2, (uae_u16)(cim->Colors[v])); @@ -3049,7 +3049,7 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, } } } - + for (i = 0; i < Depth; i++) { if (PLANAR[i] != &all_zeros_bitmap && PLANAR[i] != &all_ones_bitmap) { PLANAR[i] += eol_offset; @@ -3059,8 +3059,8 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, } /* -* BlitPlanar2Direct: -* +* BlitPlanar2Direct: +* * Synopsis: * BlitPlanar2Direct(bi, bm, ri, cim, SrcX, SrcY, DstX, DstY, SizeX, SizeY, MinTerm, Mask); * Inputs: @@ -3076,14 +3076,14 @@ static void PlanarToDirect(struct RenderInfo *ri, struct BitMap *bm, * d5.w:SizeY * d6.b:MinTerm * d7.b:Mask -* +* * This function is currently used to blit from planar bitmaps within system memory to direct color * bitmaps (15, 16, 24 or 32 bit) on the board. Watch out for plane pointers that are 0x00000000 (represents * a plane with all bits "0") or 0xffffffff (represents a plane with all bits "1"). The ColorIndexMapping is * used to map the color index of each pixel formed by the bits in the bitmap's planes to a direct color value * which is written to the destination RenderInfo. The color mask and all colors within the mapping are words, * triple bytes or longwords respectively similar to the color values used in FillRect(), BlitPattern() or -* BlitTemplate(). +* BlitTemplate(). */ uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (struct regstruct *regs) { @@ -3112,7 +3112,7 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (struct regstruct *regs) #ifndef LOCK_UNLOCK_MADNESS wgfx_flushline (); #endif - + if (minterm != 0x0C) { write_log ("WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.\n", @@ -3219,7 +3219,7 @@ static void flushpixels_2(void) int lock = 0; int needrefresh; struct frect r; - + if (pixelcount == 0) return; if (!picasso_on) { @@ -3246,20 +3246,20 @@ static void flushpixels_2(void) write_log ("ERROR - flushpixels() has non RGBFB_CHUNKY mode!\n"); goto out; } - for (i = 0; i < pixelcount; i++) { + for (i = 0; i < pixelcount; i++) { int i2 = pixelbase[i].size; uaecptr addr = pixelbase[i].addr; - uae_u32 value = pixelbase[i].value; + uae_u32 value = pixelbase[i].value; int y = addr / picasso96_state.BytesPerRow; int xbytes = addr % picasso96_state.BytesPerRow; if (! picasso_vidinfo.extra_mem) break; - - if (xbytes < picasso96_state.Width * picasso96_state.BytesPerPixel && y < picasso96_state.Height) { + + if (xbytes < picasso96_state.Width * picasso96_state.BytesPerPixel && y < picasso96_state.Height) { if(psiz == 4) { uae_u8 *addr; - + addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 4; if (i2 == 4) { *(uae_u32 *) addr = picasso_vidinfo.clut[value & 0xff]; @@ -3281,7 +3281,7 @@ static void flushpixels_2(void) } } else { uae_u8 *addr; - + addr = dst + y * picasso_vidinfo.rowbytes + xbytes * 2; if (i2 == 4) { *(uae_u16 *) addr = picasso_vidinfo.clut[value & 0xff]; @@ -3309,17 +3309,17 @@ static void flushpixels_2(void) } else { - for (i = 0;i < pixelcount; i++) { + for (i = 0;i < pixelcount; i++) { uaecptr addr = pixelbase[i].addr; uae_u32 value = pixelbase[i].value; int y = addr / picasso96_state.BytesPerRow; int xbytes = addr % picasso96_state.BytesPerRow; uae_u8 *p = dst + y * picasso_vidinfo.rowbytes + xbytes; - + if (! picasso_vidinfo.extra_mem) - continue; + continue; - if (xbytes < picasso96_state.Width * picasso96_state.BytesPerPixel && y < picasso96_state.Height) { + if (xbytes < picasso96_state.Width * picasso96_state.BytesPerPixel && y < picasso96_state.Height) { switch (pixelbase[i].size) { case 1: @@ -3328,7 +3328,7 @@ static void flushpixels_2(void) case 2: *(uae_u16 *)p = value; break; - case 4: + case 4: *(uae_u32 *)p = value; break; } @@ -3339,7 +3339,7 @@ static void flushpixels_2(void) } out:; if(lock) - gfx_unlock_picasso(); + gfx_unlock_picasso(); pixelcount = 0; flush_it(&r); } @@ -3370,7 +3370,7 @@ static void dowatch(void) cnt = watchbuffersize; if (GetWriteWatch(WRITE_WATCH_FLAG_RESET, gfxmemory, allocated_gfxmem, watchbuffer, &cnt, &pagesize)) { - write_log("GetWriteWatch failed, err=%d\n", GetLastError()); + write_log ("GetWriteWatch failed, err=%d\n", GetLastError()); return; } if (cnt == 0) @@ -3402,11 +3402,11 @@ static void dowatch(void) continue; addr -= (picasso96_state.XOffset * picasso96_state.BytesPerPixel) + (picasso96_state.YOffset * picasso96_state.BytesPerRow); - y = addr / picasso96_state.BytesPerRow; + y = addr / picasso96_state.BytesPerRow; if (y >= picasso96_state.Height) continue; - xbytes = addr % picasso96_state.BytesPerRow; - p = dst + y * picasso_vidinfo.rowbytes + xbytes; + xbytes = addr % picasso96_state.BytesPerRow; + p = dst + y * picasso_vidinfo.rowbytes + xbytes; tonextrow_p = picasso_vidinfo.rowbytes - xbytes; tonextrow_addr = (picasso96_state.BytesPerRow - xbytes) / 4; @@ -3432,10 +3432,10 @@ static void dowatch(void) } } } - write_log("%d ", total); + write_log ("%d ", total); out:; if(lock) - gfx_unlock_picasso(); + gfx_unlock_picasso(); flush_it(&r); } @@ -3473,7 +3473,7 @@ static void write_gfx_x (uaecptr addr, uae_u32 value, int size) } return; #endif -#ifndef LOCK_UNLOCK_MADNESS +#ifndef LOCK_UNLOCK_MADNESS /* * Several writes to successive memory locations are a common access pattern. * Try to optimize it. @@ -3494,17 +3494,17 @@ static void write_gfx_x (uaecptr addr, uae_u32 value, int size) return; addr -= picasso96_state.Address + (picasso96_state.XOffset * picasso96_state.BytesPerPixel) + (picasso96_state.YOffset * picasso96_state.BytesPerRow); - + y = addr / picasso96_state.BytesPerRow; xbytes = addr % picasso96_state.BytesPerRow; x = xbytes / picasso96_state.BytesPerPixel; - + #ifdef LOCK_UNLOCK_MADNESS if (! picasso_vidinfo.extra_mem) { pixelcount = 0; return; } - + if (x < picasso96_state.Width && y < picasso96_state.Height) { dst = picasso96_state.HostAddress; //dst = gfx_lock_picasso (); @@ -3518,7 +3518,7 @@ static void write_gfx_x (uaecptr addr, uae_u32 value, int size) do_put_mem_word ((uae_u16 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); break; case 4: - do_put_mem_long ((uae_u32 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); + do_put_mem_long ((uae_u32 *)(dst + y * picasso_vidinfo.rowbytes + xbytes), value); break; } //gfx_unlock_picasso (); @@ -3630,10 +3630,10 @@ void InitPicasso96 (void) oldscr = 0; //fastscreen memset (&picasso96_state, 0, sizeof(struct picasso96_state_struct)); - + if (1) { int i, count; - + for (i = 0; i < 256; i++) { p2ctab[i][0] = (((i & 128) ? 0x01000000 : 0) | ((i & 64) ? 0x010000 : 0) diff --git a/od-win32/posixemu.c b/od-win32/posixemu.c index d5e68654..7260dff7 100755 --- a/od-win32/posixemu.c +++ b/od-win32/posixemu.c @@ -1,4 +1,4 @@ -/* +/* * UAE - The Un*x Amiga Emulator * * Win32 interface @@ -79,8 +79,8 @@ static DWORD getattr(const char *name, LPFILETIME lpft, size_t *size) WIN32_FIND_DATA fd; if ((hFind = FindFirstFile(name,&fd)) == INVALID_HANDLE_VALUE) { - fd.dwFileAttributes = GetFileAttributes(name); - return fd.dwFileAttributes; + fd.dwFileAttributes = GetFileAttributes(name); + return fd.dwFileAttributes; } FindClose(hFind); @@ -126,16 +126,16 @@ int posixemu_chmod(const char *name, int mode) static void tmToSystemTime(struct tm *tmtime, LPSYSTEMTIME systime) { if (tmtime == NULL) { - GetSystemTime (systime); + GetSystemTime (systime); } else { - systime->wDay = tmtime->tm_mday; - systime->wDayOfWeek = tmtime->tm_wday; - systime->wMonth = tmtime->tm_mon + 1; - systime->wYear = tmtime->tm_year + 1900; - systime->wHour = tmtime->tm_hour; - systime->wMinute = tmtime->tm_min; - systime->wSecond = tmtime->tm_sec; - systime->wMilliseconds = 0; + systime->wDay = tmtime->tm_mday; + systime->wDayOfWeek = tmtime->tm_wday; + systime->wMonth = tmtime->tm_mon + 1; + systime->wYear = tmtime->tm_year + 1900; + systime->wHour = tmtime->tm_hour; + systime->wMinute = tmtime->tm_min; + systime->wSecond = tmtime->tm_sec; + systime->wMilliseconds = 0; } } @@ -148,17 +148,17 @@ static int setfiletime(const char *name, unsigned int days, int minute, int tick return 0; *(__int64 *)&LocalFileTime = (((__int64)(377*365+91+days)*(__int64)1440+(__int64)minute)*(__int64)(60*50)+(__int64)tick)*(__int64)200000; - + if (tolocal) { if (!LocalFileTimeToFileTime(&LocalFileTime,&FileTime)) FileTime = LocalFileTime; } else { FileTime = LocalFileTime; } - + success = SetFileTime(hFile,&FileTime,&FileTime,&FileTime); CloseHandle(hFile); - + return success; } @@ -178,7 +178,7 @@ int posixemu_utime( const char *name, struct utimbuf *ttime ) get_time(actime, &days, &mins, &ticks); if(setfiletime (name, days, mins, ticks, tolocal)) - result = 0; + result = 0; return result; } @@ -253,12 +253,12 @@ int uae_start_thread (char *name, void *(*f)(void *), void *arg, uae_thread_id * hThread = (HANDLE)_beginthreadex(NULL, 0, thread_init, thp, 0, &foo); *tid = hThread; if (hThread) { - SetThreadPriority (hThread, THREAD_PRIORITY_ABOVE_NORMAL); + SetThreadPriority (hThread, THREAD_PRIORITY_ABOVE_NORMAL); if (name) - write_log("Thread '%s' started (%d)\n", name, foo); + write_log ("Thread '%s' started (%d)\n", name, foo); } else { - result = 0; - write_log("Thread '%s' failed to start!?\n", name ? name : ""); + result = 0; + write_log ("Thread '%s' failed to start!?\n", name ? name : ""); } return result; } @@ -273,6 +273,6 @@ DWORD_PTR cpu_affinity = 1; void uae_set_thread_priority (int pri) { /* workaround for filesystem emulation freeze with some dual core systems */ - //SetThreadAffinityMask(GetCurrentThread(), cpu_affinity); + //SetThreadAffinityMask(GetCurrentThread(), cpu_affinity); } diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 7ddf1078..cb542cb9 100755 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -653,8 +653,6 @@ #define IDC_AVIOUTPUT_FILETEXT 1610 #define IDC_INPUTDEVICETEXT 1610 #define IDC_ALWAYSONTOP 1610 -#define IDC_MAPROM2 1610 -#define IDC_HRTMON 1610 #define IDC_AVIOUTPUT_FILE 1611 #define IDC_INPUTLIST 1611 #define IDC_CATWEASEL 1611 @@ -907,7 +905,10 @@ #define IDC_CS_SCSIMODE 1772 #define IDC_DF0ENABLE 1773 #define IDC_DF1ENABLE 1774 +#define IDC_FS_SELECT_DIR 1774 +#define IDC_FS_SELECT_FILE 1775 #define IDC_DF2ENABLE 1776 +#define IDC_FS_SELECT_EJECT 1776 #define IDC_DF3ENABLE 1778 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 @@ -938,7 +939,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 334 #define _APS_NEXT_COMMAND_VALUE 40029 -#define _APS_NEXT_CONTROL_VALUE 1774 +#define _APS_NEXT_CONTROL_VALUE 1775 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 59863c13..d71d869e 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1,1327 +1,1323 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource." - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDR_DBGACCEL ACCELERATORS -BEGIN - VK_F1, ID_DBG_PAGE1, VIRTKEY, NOINVERT - VK_F2, ID_DBG_PAGE2, VIRTKEY, NOINVERT - VK_F3, ID_DBG_PAGE3, VIRTKEY, NOINVERT - VK_F4, ID_DBG_PAGE4, VIRTKEY, NOINVERT - VK_F5, ID_DBG_PAGE5, VIRTKEY, NOINVERT - VK_F6, ID_DBG_PAGE6, VIRTKEY, NOINVERT - VK_F7, ID_DBG_PAGE7, VIRTKEY, NOINVERT - VK_F8, ID_DBG_PAGE8, VIRTKEY, NOINVERT - VK_F9, ID_DBG_PAGE9, VIRTKEY, NOINVERT - VK_DOWN, IDC_DBG_MEMDOWN, VIRTKEY, ALT, NOINVERT - VK_RIGHT, IDC_DBG_MEMDOWNFAST, VIRTKEY, ALT, NOINVERT - VK_UP, IDC_DBG_MEMUP, VIRTKEY, ALT, NOINVERT - VK_LEFT, IDC_DBG_MEMUPFAST, VIRTKEY, ALT, NOINVERT - "H", IDC_DBG_HELP, VIRTKEY, ALT, NOINVERT - "P", IDC_DBG_MEMTOPC, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_KICKSTART DIALOGEX 0, 0, 300, 176 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -EXSTYLE WS_EX_CONTEXTHELP -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "System ROM Settings",-1,5,0,290,74 - RTEXT "Main ROM file:",IDC_ROMTEXT,10,15,75,10 - COMBOBOX IDC_ROMFILE,89,12,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "...",IDC_KICKCHOOSER,280,10,10,15 - RTEXT "Extended ROM file:",IDC_ROMFILE2TEXT,10,35,75,10 - COMBOBOX IDC_ROMFILE2,89,31,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "...",IDC_ROMCHOOSER2,280,30,10,15 - CONTROL "MapROM emulation [] Creates a BlizKick-compatible memory area.",IDC_MAPROM, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,95,54,87,10 - CONTROL "ShapeShifter support [] Patches the system ROM for ShapeShifter compatibility.",IDC_KICKSHIFTER, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,54,87,10 - GROUPBOX "Miscellaneous",-1,5,76,290,57 - RTEXT "Cartridge ROM file:",IDC_FLASHTEXT2,8,93,75,10 - COMBOBOX IDC_CARTFILE,89,90,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "...",IDC_CARTCHOOSER,280,90,10,15 - RTEXT "Flash RAM file:",IDC_FLASHTEXT,8,112,75,10 - EDITTEXT IDC_FLASHFILE,89,110,185,13,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_FLASHCHOOSER,280,110,10,15 - GROUPBOX "HRTMon Settings",-1,5,136,290,31,NOT WS_VISIBLE - CONTROL "Enable HRTMon [] HRTMon is monitor/debugger similar to Action Replay series, default activation key is Page Up.",IDC_HRTMON, - "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,89,148,84,10 -END - -IDD_DISPLAY DIALOGEX 0, 0, 300, 235 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Screen",IDC_SCREENRESTEXT,12,0,199,67,BS_LEFT - RTEXT "Full screen:",IDC_SELECTRESTEXT,15,17,40,15,SS_CENTERIMAGE - COMBOBOX IDC_DISPLAYSELECT,59,10,147,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_RESOLUTION,59,27,52,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_REFRESHRATE,145,27,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_XSIZE,59,48,35,12,ES_NUMBER - EDITTEXT IDC_YSIZE,103,48,35,12,ES_NUMBER - GROUPBOX "Settings",IDC_SETTINGSTEXT,12,73,199,125 - CONTROL "Correct aspect ratio",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,19,126,92,10 - CONTROL "Force low resolution",IDC_LORES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,126,89,10 - LTEXT "Refresh:",IDC_REFRESHTEXT,18,162,28,8 - CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,157,75,20 - EDITTEXT IDC_RATETEXT,127,161,77,12,ES_CENTER | ES_READONLY - GROUPBOX "Centering",IDC_STATIC,221,0,61,67 - CONTROL "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,16,49,10 - CONTROL "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,32,49,10 - GROUPBOX "Line Mode",IDC_LINEMODE,222,73,61,73 - CONTROL "Normal",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,231,89,44,10 - CONTROL "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,105,45,10 - CONTROL "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,121,46,10 - COMBOBOX IDC_DA_MODE,20,211,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,84,207,101,20 - LTEXT "FPS adj.:",IDC_REFRESH2TEXT,16,182,32,8 - CONTROL "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,177,127,20 - EDITTEXT IDC_RATE2TEXT,178,181,26,12,ES_CENTER | ES_READONLY - COMBOBOX IDC_RESOLUTIONDEPTH,112,27,32,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,140,89,10 - COMBOBOX IDC_SCREENMODE_NATIVE,100,85,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SCREENMODE_RTG,100,103,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "Native mode:",IDC_STATIC,19,85,59,15,SS_CENTERIMAGE - RTEXT "Windowed:",IDC_WINDOWEDTEXT,15,51,40,8 - RTEXT "RTG mode:",IDC_STATIC,19,101,59,15,SS_CENTERIMAGE - PUSHBUTTON "Reset to defaults",IDC_DA_RESET,212,211,73,14 -END - -IDD_MEMORY DIALOGEX 0, 0, 300, 175 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -EXSTYLE WS_EX_CONTEXTHELP -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Memory Settings",-1,14,7,274,91 - RTEXT "Chip:",-1,24,31,20,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_CHIPMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,54,22,50,20 - EDITTEXT IDC_CHIPRAM,105,26,30,12,ES_CENTER | ES_READONLY - RTEXT "Slow:",-1,149,31,20,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_SLOWMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,22,60,20 - EDITTEXT IDC_SLOWRAM,243,25,30,12,ES_CENTER | ES_READONLY - RTEXT "Fast:",IDC_FASTTEXT,24,52,20,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FASTMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,54,47,50,20 - EDITTEXT IDC_FASTRAM,105,53,30,12,ES_CENTER | ES_READONLY - RTEXT "Z3 Fast:",IDC_Z3TEXT,139,52,30,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_Z3FASTMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,47,60,20 - EDITTEXT IDC_Z3FASTRAM,243,52,30,12,ES_CENTER | ES_READONLY - RTEXT "RTG: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,81,77,90,10,SS_NOTIFY | SS_CENTERIMAGE - CONTROL "Slider1",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,72,60,20 - EDITTEXT IDC_P96RAM,243,75,30,12,ES_CENTER | ES_READONLY - GROUPBOX "Advanced Memory Settings",-1,13,104,275,65 - RTEXT "Motherboard RAM (Low area):",-1,39,122,129,10,SS_CENTERIMAGE - CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,117,59,20 - EDITTEXT IDC_MBRAM1,243,121,30,12,ES_CENTER | ES_READONLY - RTEXT "Motherboard RAM (High area):",-1,39,144,127,10,SS_CENTERIMAGE - CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,139,59,20 - EDITTEXT IDC_MBRAM2,243,142,30,12,ES_CENTER | ES_READONLY -END - -IDD_CPU DIALOGEX 0, 0, 300, 226 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - GROUPBOX "CPU",IDC_STATIC,5,3,81,139,BS_LEFT - CONTROL "68000",IDC_CPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,16,63,10 - CONTROL "68010",IDC_CPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,30,65,10 - CONTROL "68020",IDC_CPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,44,63,10 - CONTROL "68030",IDC_CPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,58,64,10 - CONTROL "68040",IDC_CPU4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,72,66,10 - CONTROL "68060",IDC_CPU5,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,85,66,10 - CONTROL "More compatible [] Emulate 68000's prefetch registers. More compatible but slower.",IDC_COMPATIBLE, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,114,73,8 - CONTROL "JIT [] Enable just-in-time CPU emulator. Significantly increases the speed of the CPU emulation. Requires 68020 or higher CPU.",IDC_JITENABLE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,127,73,10 - GROUPBOX "CPU Emulation Speed",IDC_STATIC,90,3,205,90 - CONTROL "Fastest possible, but maintain chipset timing",IDC_CS_HOST, - "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,95,18,195,10 - CONTROL "Match A500 speed",IDC_CS_68000,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,32,195,10 - CONTROL "Adjustable between CPU and chipset",IDC_CS_ADJUSTABLE, - "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,47,195,10 - RTEXT "CPU",IDC_CS_CPU_TEXT,96,73,15,10,SS_CENTERIMAGE | WS_TABSTOP - CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,114,68,67,20 - LTEXT "Chipset",IDC_CS_CHIPSET_TEXT,182,73,25,10,SS_CENTERIMAGE | NOT WS_GROUP | WS_TABSTOP - RTEXT "CPU idle",IDC_CS_CPU_TEXT2,236,56,32,10,SS_CENTERIMAGE | WS_TABSTOP - CONTROL "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,219,68,69,20 - GROUPBOX "Advanced JIT Settings",IDC_STATIC,90,94,205,93 - RTEXT "Cache size:",IDC_CS_CACHE_TEXT,95,113,45,10,SS_CENTERIMAGE | WS_TABSTOP - CONTROL "Slider1",IDC_CACHE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,140,108,115,20 - EDITTEXT IDC_CACHETEXT,255,113,30,12,ES_CENTER | ES_READONLY - CONTROL "Hard flush",IDC_HARDFLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,141,63,10 - CONTROL "Constant jump",IDC_CONSTJUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,155,63,10 - CONTROL "FPU support",IDC_JITFPU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,168,62,10 - CONTROL "Force settings",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,141,62,10 - CONTROL "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,155,62,10 - CONTROL "Direct",IDC_TRUST0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,235,141,52,10 - CONTROL "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,155,52,10 - CONTROL "After RTG",IDC_TRUST2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,168,52,10 - CONTROL "More compatible [] More compatible but slower FPU emulation.",IDC_COMPATIBLE_FPU, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,206,73,10 - GROUPBOX "FPU",IDC_STATIC,6,144,81,76,BS_LEFT - CONTROL "24-bit addressing",IDC_COMPATIBLE24,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,100,73,8 - CONTROL "None",IDC_FPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,154,63,10 - CONTROL "68881",IDC_FPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,166,63,10 - CONTROL "68882",IDC_FPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,179,63,10 - CONTROL "CPU internal",IDC_FPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,192,63,10 -END - -IDD_FLOPPY DIALOGEX 0, 0, 300, 240 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - COMBOBOX IDC_DF0TEXT,2,22,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DF0TYPE,123,6,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Write-protected",IDC_STATIC,174,8,59,10,SS_CENTERIMAGE - CONTROL "",IDC_DF0WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,4,10,15 - PUSHBUTTON "Eject",IDC_EJECT0,253,4,30,15 - PUSHBUTTON "...",IDC_DF0,287,4,10,15 - COMBOBOX IDC_DF1TEXT,2,58,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DF1TYPE,123,42,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Write-protected",IDC_STATIC,174,43,59,10,SS_CENTERIMAGE - CONTROL "",IDC_DF1WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,40,10,15 - PUSHBUTTON "Eject",IDC_EJECT1,253,40,30,15 - PUSHBUTTON "...",IDC_DF1,287,40,10,15 - COMBOBOX IDC_DF2TEXT,2,93,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DF2TYPE,123,77,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Write-protected",IDC_STATIC,174,77,59,10,SS_CENTERIMAGE - CONTROL "",IDC_DF2WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,75,9,15 - PUSHBUTTON "Eject",IDC_EJECT2,253,75,30,15 - PUSHBUTTON "...",IDC_DF2,287,75,10,15 - COMBOBOX IDC_DF3TEXT,2,128,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_DF3TYPE,123,112,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Write-protected",IDC_STATIC,174,113,59,10,SS_CENTERIMAGE - CONTROL "",IDC_DF3WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,111,9,15 - PUSHBUTTON "Eject",IDC_EJECT3,253,110,30,15 - PUSHBUTTON "...",IDC_DF3,287,109,10,15 - GROUPBOX "New Floppy Disk Image",IDC_SETTINGSTEXT,5,183,289,49 - COMBOBOX IDC_FLOPPYTYPE,16,196,51,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,76,196,97,15 - PUSHBUTTON "Create Custom Disk [] Creates a low level (MFM) ADF disk image (about 2MB). Useful for programs that use non-standard disk formats (for example some save disks or DOS-formatted floppies)",IDC_CREATE_RAW,183,196,101,15 - GROUPBOX "Floppy Drive Emulation Speed",IDC_SETTINGSTEXT2,5,144,289,35 - CONTROL "",IDC_FLOPPYSPD,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,32,152,116,20 - EDITTEXT IDC_FLOPPYSPDTEXT,169,155,107,12,ES_CENTER | ES_READONLY - PUSHBUTTON "Delete save image",IDC_SAVEIMAGE0,43,5,70,15,NOT WS_VISIBLE - PUSHBUTTON "Delete save image",IDC_SAVEIMAGE1,43,40,70,15,NOT WS_VISIBLE - PUSHBUTTON "Delete save image",IDC_SAVEIMAGE2,43,75,70,15,NOT WS_VISIBLE - PUSHBUTTON "Delete save image",IDC_SAVEIMAGE3,43,110,70,15,NOT WS_VISIBLE - EDITTEXT IDC_CREATE_NAME,75,215,98,13,ES_AUTOHSCROLL - RTEXT "Disk label:",IDC_STATIC,14,216,52,10,SS_CENTERIMAGE - CONTROL "DF0:",IDC_DF0ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,6,34,15 - CONTROL "DF1:",IDC_DF1ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,41,34,15 - CONTROL "DF2:",IDC_DF2ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,76,34,15 - CONTROL "DF3:",IDC_DF3ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,111,34,15 -END - -IDD_HARDDISK DIALOGEX 0, 0, 300, 240 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -EXSTYLE WS_EX_CONTEXTHELP -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,182 - PUSHBUTTON "Add &Directory...",IDC_NEW_FS,10,186,64,15 - PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,153,186,64,15 - PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,223,186,65,15 - PUSHBUTTON "Remove",IDC_REMOVE,232,207,60,15 - PUSHBUTTON "&Properties",IDC_EDIT,232,225,60,15 - CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,209,100,10 - CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,209,119,10 - CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,220,121,10 - CONTROL "Include network drives",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,220,101,10 - PUSHBUTTON "Add Archive...",IDC_NEW_FSARCH,82,186,64,15 -END - -IDD_SOUND DIALOGEX 0, 0, 300, 231 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - RTEXT "Sound device:",IDC_SOUNDCARD,8,9,51,13,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDCARDLIST,64,9,229,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Sound Emulation",IDC_SOUNDSETTINGS,5,30,120,81 - CONTROL "Disabled",IDC_SOUND0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,45,101,10 - CONTROL "Disabled, but emulated",IDC_SOUND1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,57,102,10 - CONTROL "Enabled",IDC_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,69,102,10 - CONTROL "Enabled, 100% accurate",IDC_SOUND3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,81,101,10 - GROUPBOX "Volume",IDC_STATIC,131,36,164,31 - CONTROL "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,44,105,20 - EDITTEXT IDC_SOUNDVOLUME2,247,47,40,12,ES_CENTER | ES_READONLY - GROUPBOX "Sound Buffer Size",IDC_STATIC,132,73,164,31 - CONTROL "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,138,81,106,19 - EDITTEXT IDC_SOUNDBUFFERMEM,248,84,40,12,ES_CENTER | ES_READONLY - GROUPBOX "Settings",IDC_SOUNDINTERPOLATION2,6,114,290,60 - LTEXT "Frequency:",IDC_SOUNDFREQTXT,11,147,53,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDFREQ,13,156,51,75,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Audio filter:",IDC_SOUNDFILTERTXT,209,148,77,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDFILTER,209,157,80,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Channel mode:",IDC_SOUNDSTEREOTXT,11,124,57,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDSTEREO,13,133,122,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Interpolation:",IDC_SOUNDINTERPOLATIONTXT,209,124,75,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDINTERPOLATION,209,132,80,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Stereo separation:",IDC_SOUNDSTEREOSEPTXT,141,124,63,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDSTEREOSEP,142,133,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Stereo delay:",IDC_SOUNDSTEREOMIXTXT,141,148,63,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDSTEREOMIX,142,157,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Floppy Drive Sound Emulation",IDC_STATIC,6,177,290,46 - CONTROL "",IDC_SOUNDDRIVEVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,185,107,19 - EDITTEXT IDC_SOUNDDRIVEVOLUME2,124,191,40,12,ES_CENTER | ES_READONLY - COMBOBOX IDC_SOUNDDRIVE,237,187,46,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SOUNDDRIVESELECT,18,205,265,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SOUNDSWAP,73,157,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Swap channels:",IDC_SOUNDSWAPTXT,74,148,61,8,SS_CENTERIMAGE - CONTROL "Automatic switching",IDC_SOUND_AUTO,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,95,103,10 -END - -IDD_LOADSAVE DIALOGEX 0, 0, 302, 241 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_CONFIGTREE,"SysTreeView32",TVS_HASLINES | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,6,3,289,153,WS_EX_CLIENTEDGE - RTEXT "Name:",IDC_STATIC,4,161,40,15,SS_CENTERIMAGE - EDITTEXT IDC_EDITNAME,48,162,146,13,ES_AUTOHSCROLL - RTEXT "Description:",IDC_STATIC,4,183,41,15,SS_CENTERIMAGE - EDITTEXT IDC_EDITDESCRIPTION,48,183,146,13,ES_AUTOHSCROLL - RTEXT "Link:",IDC_STATIC,4,204,40,15,SS_CENTERIMAGE - COMBOBOX IDC_CONFIGLINK,48,205,93,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "Ignore link",IDC_CONFIGNOLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,146,206,48,10 - EDITTEXT IDC_EDITPATH,199,161,49,15,ES_AUTOHSCROLL | WS_DISABLED - CONTROL "Autoload",IDC_CONFIGAUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,253,163,42,10 - GROUPBOX "Additional Information",IDC_STATIC,199,179,96,38,BS_LEFT - PUSHBUTTON "View",IDC_VIEWINFO,208,195,37,15 - PUSHBUTTON "Set",IDC_SETINFO,250,195,37,15 - PUSHBUTTON "Load",IDC_QUICKLOAD,5,225,44,15 - PUSHBUTTON "Save",IDC_QUICKSAVE,54,225,44,15 - PUSHBUTTON "Load From...",IDC_LOAD,121,225,49,15 - PUSHBUTTON "Delete",IDC_DELETE,251,225,44,15 - PUSHBUTTON "Save As...",IDC_SAVE,175,225,44,15 -END - -IDD_PORTS DIALOGEX 0, 0, 300, 238 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Parallel Port",IDC_SERPARFRAME,5,2,291,68 - RTEXT "Printer:",IDC_STATIC,12,15,25,15,SS_CENTERIMAGE - COMBOBOX IDC_PRINTERLIST,49,15,153,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,220,14,58,12 - CONTROL "PostScript detection",IDC_PSPRINTERDETECT,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,11,33,79,12 - CONTROL "PostScript printer emulation",IDC_PSPRINTER,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,95,33,110,12 - RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,202,32,57,15,SS_NOTIFY | SS_CENTERIMAGE - EDITTEXT IDC_PRINTERAUTOFLUSH,263,33,25,12,ES_NUMBER - RTEXT "Ghostscript extra parameters:",IDC_STATIC,12,49,102,15,SS_CENTERIMAGE - EDITTEXT IDC_PS_PARAMS,124,50,165,12,ES_AUTOHSCROLL - GROUPBOX "Serial Port",IDC_SERIALFRAME,4,72,292,48 - COMBOBOX IDC_SERIAL,49,84,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,11,102,48,13 - CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,65,102,55,12 - GROUPBOX "MIDI",IDC_MIDIFRAME,4,123,292,33 - RTEXT "Out:",IDC_MIDI,10,134,34,15,SS_CENTERIMAGE - COMBOBOX IDC_MIDIOUTLIST,50,134,95,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "In:",IDC_MIDI2,150,134,29,15,SS_CENTERIMAGE - COMBOBOX IDC_MIDIINLIST,185,134,95,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Mouse/Joystick Ports",IDC_PORT0,4,158,292,75 - COMBOBOX IDC_PORT0_JOYS,45,174,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_PORT1_JOYS,45,195,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Swap ports",IDC_SWAP,211,214,75,14 - RTEXT "Port 0:",IDC_STATIC,11,173,25,15,SS_CENTERIMAGE - RTEXT "Port 1:",IDC_STATIC,11,194,25,15,SS_CENTERIMAGE - LTEXT "X-Arcade layout information []#1",IDC_STATIC,16,213,106,15,SS_NOTIFY | SS_CENTERIMAGE - CONTROL "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT, - "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,132,103,65,12 - CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,207,103,78,13 -END - -IDD_CONTRIBUTORS DIALOGEX 0, 0, 411, 242 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION -CAPTION "UAE Authors and Contributors..." -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - DEFPUSHBUTTON "Ok",ID_OK,177,219,53,14 - CONTROL "",IDC_CONTRIBUTORS,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_RAGGEDRIGHT | TCS_OWNERDRAWFIXED | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,4,5,404,206 -END - -IDD_ABOUT DIALOGEX 0, 0, 300, 191 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - CONTROL "",IDC_RICHEDIT1,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,45,10,210,15 - CONTROL "",IDC_RICHEDIT2,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,30,260,13 - PUSHBUTTON "Contributors",IDC_CONTRIBUTORS,110,55,80,15 - CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,120,80,15 - CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,90,80,20 - CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,109,90,80,20 - CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,120,80,15 - CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,110,120,80,15 - CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,145,80,15 - CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,145,80,15 - CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,110,145,80,15 - CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,90,80,20 - CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,63,169,80,15 - CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,157,169,80,15 -END - -IDD_MISC1 DIALOGEX 0, 0, 300, 237 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Advanced",IDC_STATIC,8,2,285,110 - CONTROL "Untrap mouse with middle button",IDC_JULIAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,15,129,10 - CONTROL "Show GUI on startup",IDC_SHOWGUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,27,120,10 - CONTROL "On-screen LEDs",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,40,115,10 - CONTROL "uaescsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,53,117,10 - CONTROL "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,66,117,10 - CONTROL "bsdsocket.library emulation",IDC_SOCKETS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,15,120,10 - CONTROL "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,27,120,10 - CONTROL "Don't use RGB overlays",IDC_NOOVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,40,120,10 - CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,66,115,10 - GROUPBOX "Keyboard LEDs",IDC_STATIC,7,140,85,94 - COMBOBOX IDC_KBLED1,22,154,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_KBLED2,22,173,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_KBLED3,22,193,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Logging",IDC_STATIC,97,140,195,25 - CONTROL "Create log file",IDC_CREATELOGFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,151,72,10 - CONTROL "Illegal memory accesses",IDC_ILLEGAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,151,95,10 - GROUPBOX "State Files",IDC_STATIC,98,165,195,69 - PUSHBUTTON "Load state...",IDC_DOLOADSTATE,105,182,49,14 - PUSHBUTTON "Save state...",IDC_DOSAVESTATE,105,208,49,14 - CONTROL "Enable state recording",IDC_STATE_CAPTURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,181,88,10 - RTEXT "Recording rate (seconds):",IDC_STATIC,157,199,86,10,SS_CENTERIMAGE | WS_TABSTOP - COMBOBOX IDC_STATE_RATE,248,197,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - RTEXT "Recording buffer (MB):",IDC_STATIC,157,219,83,10,SS_CENTERIMAGE | WS_TABSTOP - COMBOBOX IDC_STATE_BUFFERSIZE,248,217,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - CONTROL "Always on top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,79,117,10 - CONTROL "Catweasel",IDC_CATWEASEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,79,115,10 - CONTROL "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,216,64,10 - COMBOBOX IDC_SCSIMODE,161,51,104,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_LANGUAGE,103,121,179,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Language",IDC_STATIC,7,112,285,25 - CONTROL "Disable powersaving features",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,120,10 - CONTROL "Magic Mouse",IDC_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,92,119,10 -END - -IDD_HARDFILE DIALOGEX 0, 0, 299, 212 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Hardfile Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - GROUPBOX "Settings",IDC_STATIC,10,5,280,113 - RTEXT "Path:",IDC_HARDFILE_DIR_TEXT,26,18,22,10 - EDITTEXT IDC_PATH_NAME,52,15,213,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_SELECTOR,271,15,11,15 - RTEXT "FileSys:",IDC_HARDFILE_FILESYS_TEXT,14,37,34,10 - EDITTEXT IDC_PATH_FILESYS,52,34,213,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_FILESYS_SELECTOR,271,34,11,15 - RTEXT "Device:",IDC_HARDFILE_DEVICE_TEXT,17,58,31,10 - EDITTEXT IDC_HARDFILE_DEVICE,52,54,40,15,ES_AUTOHSCROLL - RTEXT "Boot priority:",IDC_HARDFILE_BOOTPRI_TEXT,24,79,44,8 - EDITTEXT IDC_HARDFILE_BOOTPRI,74,75,40,15 - CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,57,50,10 - PUSHBUTTON "Enable RDB mode",IDC_HDF_RDB,192,55,92,14 - RTEXT "Surfaces:",IDC_SURFACES_TEXT,120,79,30,10 - EDITTEXT IDC_HEADS,155,75,35,15,ES_NUMBER - RTEXT "Reserved:",IDC_RESERVED_TEXT,197,79,35,10 - EDITTEXT IDC_RESERVED,237,75,35,15,ES_NUMBER - RTEXT "Sectors:",IDC_SECTORS_TEXT,120,101,30,10 - EDITTEXT IDC_SECTORS,155,96,35,15,ES_NUMBER - RTEXT "Block size:",IDC_BLOCKSIZE_TEXT,197,101,35,10 - EDITTEXT IDC_BLOCKSIZE,237,96,35,15,ES_NUMBER - GROUPBOX "New hard disk image file",IDC_STATIC,10,120,280,62 - PUSHBUTTON "Create",IDC_HF_CREATE,50,135,80,14 - EDITTEXT IDC_HF_SIZE,146,135,61,15,ES_NUMBER - PUSHBUTTON "OK",IDOK,102,191,50,14 - PUSHBUTTON "Cancel",IDCANCEL,158,191,50,14 - EDITTEXT IDC_HF_DOSTYPE,146,158,61,15 - COMBOBOX IDC_HDF_CONTROLLER,73,97,41,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "DOS type",IDC_STATIC,214,160,32,10,SS_CENTERIMAGE - RTEXT "MB",IDC_STATIC,214,138,13,10,SS_CENTERIMAGE - RTEXT "Type:",IDC_STATIC,18,160,25,10,SS_CENTERIMAGE - RTEXT "HD Controller:",IDC_STATIC,13,98,52,10,SS_CENTERIMAGE -END - -IDD_FILESYS DIALOGEX 15, 25, 299, 111 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Volume Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - LTEXT "Device name:",-1,5,9,54,10 - EDITTEXT IDC_VOLUME_DEVICE,65,5,86,15,ES_AUTOHSCROLL - LTEXT "Volume label:",-1,5,31,54,10 - EDITTEXT IDC_VOLUME_NAME,65,25,85,15,ES_AUTOHSCROLL - LTEXT "Path:",-1,5,51,44,10 - EDITTEXT IDC_PATH_NAME,65,46,213,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_SELECTOR,283,46,10,15 - CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,72,70,50,10 - RTEXT "Boot priority:",IDC_VOLUME_BOOTPRI_TEXT,135,70,51,8 - EDITTEXT IDC_VOLUME_BOOTPRI,199,68,27,15 - PUSHBUTTON "OK",IDOK,120,91,48,15 - PUSHBUTTON "Cancel",IDCANCEL,175,91,48,15 -END - -IDD_SETINFO DIALOGEX 0, 0, 229, 85 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Additional Information Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - RTEXT "Path:",-1,5,20,24,15,SS_CENTERIMAGE - EDITTEXT IDC_PATH_NAME,35,20,169,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_SELECTOR,210,20,10,15 - PUSHBUTTON "OK",IDOK,120,65,48,15 - PUSHBUTTON "Cancel",IDCANCEL,175,65,48,15 -END - -IDD_CHIPSET DIALOGEX 0, 65490, 300, 229 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - GROUPBOX "Chipset",IDC_STATIC,14,11,145,90 - CONTROL "OCS [] Original chipset. A1000 and most A500s.",IDC_OCS, - "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,26,51,10 - CONTROL "ECS Agnus [] Enhanced chipset (ECS Agnus chip only). Later A500 and A2000 hardware revisions.",IDC_ECS_AGNUS, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,42,55,10 - CONTROL "Full ECS [] Full ECS chipset (ECS Agnus and ECS Denise chips). A500+, A600 and A3000.",IDC_ECS, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,58,52,10 - CONTROL "AGA [] Advanced Graphics Architecture chipset. A1200, A4000 and CD32.",IDC_AGA, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,26,51,10 - CONTROL "NTSC [] North American and Japanese display standard, 60Hz refresh rate. Other countries use PAL (50Hz. display refresh rate)",IDC_NTSC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,58,50,10 - GROUPBOX "Options",IDC_STATIC,168,11,114,89 - CONTROL "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,30,96,10 - CONTROL "Cycle-exact [] The most compatible A500 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,43,100,10 - GROUPBOX "Collision Level",IDC_STATIC,14,105,267,48 - CONTROL "None [] Collision hardware emulation disabled.",IDC_COLLISION0, - "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,40,121,59,10 - CONTROL "Sprites only [] Emulate only sprite vs. sprite collisions.",IDC_COLLISION1, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,137,62,10 - CONTROL "Sprites and Sprites vs. Playfield [] Recommended collision emulation level.",IDC_COLLISION2, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,109,121,161,10 - CONTROL "Full [] 100% collision hardware emulation. Only very few games need this option. Slowest.",IDC_COLLISION3, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,109,137,119,10 - GROUPBOX "Sound Emulation",IDC_STATIC,13,159,268,65 - CONTROL "Disabled",IDC_CS_SOUND0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,39,175,102,10 - CONTROL "Emulated",IDC_CS_SOUND1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,190,91,10 - CONTROL "Emulated, 100% accurate",IDC_CS_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,205,95,10 - CONTROL "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,56,100,10 - CONTROL "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,68,100,10 - COMBOBOX IDC_CS_EXT,101,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE -END - -IDD_CHIPSET2 DIALOGEX 0, 65490, 300, 247 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - GROUPBOX "Advanced Chipset Options",IDC_STATIC,7,6,287,239 - GROUPBOX "Battery Backed Up Real Time Clock",IDC_STATIC,14,37,275,29 - CONTROL "None",IDC_CS_RTC1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,22,49,55,10 - CONTROL "MSM6242B",IDC_CS_RTC2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,91,49,52,10 - CONTROL "RF5C01A",IDC_CS_RTC3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,160,49,46,10 - EDITTEXT IDC_CS_RTCADJUST,218,47,64,13,ES_AUTOHSCROLL - GROUPBOX "CIA-A TOD Clock Source",IDC_STATIC,12,69,275,29 - CONTROL "Vertical Sync",IDC_CS_CIAA_TOD1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,25,81,63,10 - CONTROL "Power Supply 50Hz",IDC_CS_CIAA_TOD2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,95,81,85,10 - CONTROL "Power Supply 60Hz",IDC_CS_CIAA_TOD3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,192,81,88,10 - CONTROL "Boot ROM Mirror",IDC_CS_KSMIRROR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,108,80,10 - CONTROL "A1000 Boot RAM/ROM",IDC_CS_A1000RAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,108,88,10 - CONTROL "CD32 CD",IDC_CS_CD32CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,121,76,10 - CONTROL "CD32 C2P",IDC_CS_CD32C2P,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,121,87,10 - CONTROL "CD32 NVRAM",IDC_CS_CD32NVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,121,84,10 - CONTROL "CDTV CD",IDC_CS_CDTVCD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,134,47,10 - CONTROL "CDTV SRAM",IDC_CS_CDTVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,133,87,10 - CONTROL "CDTV SRAM Expansion",IDC_CS_CDTVRAMEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,133,90,10 - CONTROL "A600/A1200 IDE",IDC_CS_IDE1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,146,79,10 - CONTROL "A4000/A4000T IDE",IDC_CS_IDE2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,146,88,10 - CONTROL "Ramsey revision:",IDC_CS_RAMSEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,211,71,10 - EDITTEXT IDC_CS_RAMSEYREV,94,209,45,13,ES_AUTOHSCROLL - CONTROL "Fat Gary revision:",IDC_CS_FATGARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,224,71,10 - EDITTEXT IDC_CS_FATGARYREV,94,223,45,13,ES_AUTOHSCROLL - CONTROL "A3000 SCSI",IDC_CS_DMAC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,175,76,10 - CONTROL "Compatible Settings",IDC_CS_COMPATIBLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,21,234,10 - CONTROL "DF0: ID Hardware",IDC_CS_DF0IDHW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,108,92,10 - CONTROL "Agnus/Alice revision:",IDC_CS_AGNUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,211,81,10 - EDITTEXT IDC_CS_AGNUSREV,235,209,45,13,ES_AUTOHSCROLL - CONTROL "Denise/Lisa revision:",IDC_CS_DENISE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,227,81,10 - EDITTEXT IDC_CS_DENISEREV,235,226,45,13,ES_AUTOHSCROLL - CONTROL "A590/A2091 SCSI",IDC_CS_A2091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,175,76,10 - CONTROL "A4000T SCSI",IDC_CS_DMAC2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,175,88,10 - LTEXT "A4091/A4000T SCSI not yet implemented.",IDC_STATIC,25,161,224,8,SS_CENTERIMAGE - CONTROL "PCMCIA",IDC_CS_PCMCIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,146,92,10 - CONTROL "A4091 SCSI",IDC_CS_A4091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,187,76,10 - CONTROL "CDTV SCSI",IDC_CS_CDTVSCSI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,187,76,10 - CONTROL "Include host SCSI devices",IDC_CS_SCSIMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,187,101,10 -END - -IDD_AVIOUTPUT DIALOGEX 0, 0, 288, 203 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Output Properties",IDC_STATIC,5,8,274,118 - EDITTEXT IDC_AVIOUTPUT_FILETEXT,15,21,226,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_CLIENTEDGE - PUSHBUTTON "...",IDC_AVIOUTPUT_FILE,249,20,19,12 - CONTROL "Audio",IDC_AVIOUTPUT_AUDIO,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_TABSTOP,15,36,39,11 - CONTROL "",IDC_AVIOUTPUT_AUDIO_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,59,36,209,11 - CONTROL "Video",IDC_AVIOUTPUT_VIDEO,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_TABSTOP,15,50,39,11 - CONTROL "",IDC_AVIOUTPUT_VIDEO_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,59,50,209,11 - CONTROL "Disable frame rate limit while recording",IDC_AVIOUTPUT_FRAMELIMITER, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,68,158,10 - CONTROL "AVI output enabled",IDC_AVIOUTPUT_ACTIVATED,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,15,103,108,14 - CONTROL "PAL",IDC_AVIOUTPUT_PAL,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,133,103,66,14 - CONTROL "NTSC",IDC_AVIOUTPUT_NTSC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,204,103,66,14 - CONTROL "Slider1",IDC_AVIOUTPUT_FPS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_ENABLESELRANGE | WS_TABSTOP,166,84,87,11 - LTEXT "fps",IDC_AVIOUTPUT_FPS_STATIC,255,84,19,8 - PUSHBUTTON "Save screenshot",IDC_SCREENSHOT,16,141,76,14 - GROUPBOX "Ripper",IDC_STATIC,5,127,274,38 - PUSHBUTTON "Pro Wizard",IDC_PROWIZARD,100,141,76,14,WS_DISABLED - CONTROL "Sample ripper",IDC_SAMPLERIPPER_ACTIVATED,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,192,141,77,14 - GROUPBOX "Input Recorder",IDC_STATIC,5,166,274,33 - CONTROL "Record",IDC_INPREC_RECORD,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,191,177,77,14 - CONTROL "Playback",IDC_INPREC_PLAY,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,16,178,77,14 - CONTROL "Alt. playback mode",IDC_INPREC_PLAYMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,103,180,78,10 - CONTROL "Disable sound output while recording",IDC_AVIOUTPUT_NOSOUNDOUTPUT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,85,148,10 -END - -IDD_INPUT DIALOGEX 0, 0, 300, 242 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_INPUTTYPE,5,5,98,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_INPUTDEVICE,109,5,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_INPUTDEVICEDISABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,282,8,9,8 - CONTROL "List1",IDC_INPUTLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,22,290,146 - COMBOBOX IDC_INPUTAMIGACNT,5,174,24,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_INPUTAMIGA,33,174,262,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "Joystick dead zone (%):",-1,7,196,79,10,SS_CENTERIMAGE - EDITTEXT IDC_INPUTDEADZONE,92,195,25,12,ES_NUMBER - RTEXT "Autofire rate (frames):",-1,10,212,76,10,SS_CENTERIMAGE - EDITTEXT IDC_INPUTAUTOFIRERATE,92,210,25,12,ES_NUMBER - RTEXT "Digital joy-mouse speed:",-1,124,196,84,10,SS_CENTERIMAGE - EDITTEXT IDC_INPUTSPEEDD,215,195,25,12,ES_NUMBER - RTEXT "Analog joy-mouse speed:",-1,120,212,88,10,SS_CENTERIMAGE - EDITTEXT IDC_INPUTSPEEDA,215,211,25,12,ES_NUMBER - RTEXT "Mouse speed:",-1,132,228,76,10,SS_CENTERIMAGE - EDITTEXT IDC_INPUTSPEEDM,215,227,25,12,ES_NUMBER - PUSHBUTTON "Copy from:",IDC_INPUTCOPY,249,195,45,14 - COMBOBOX IDC_INPUTCOPYFROM,249,211,45,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,249,226,45,14 -END - -IDD_FILTER DIALOGEX 0, 0, 296, 224 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Filter Settings",-1,0,0,294,186 - CONTROL "Enable",IDC_FILTERENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,17,46,10 - COMBOBOX IDC_FILTERMODE,62,15,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_FILTERFILTER,128,15,81,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Reset to defaults",IDC_FILTERDEFAULT,213,15,73,14 - RTEXT "Horiz. size:",-1,4,44,54,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,37,152,19 - EDITTEXT IDC_FILTERHZV,253,40,34,12,ES_CENTER | ES_READONLY - RTEXT "Vert. size:",-1,5,64,54,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,57,152,19 - EDITTEXT IDC_FILTERVZV,253,59,34,12,ES_CENTER | ES_READONLY - RTEXT "Horiz. position:",-1,5,84,55,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,77,151,19 - EDITTEXT IDC_FILTERHOV,253,79,34,12,ES_CENTER | ES_READONLY - RTEXT "Vert. position:",-1,5,103,55,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,99,151,19 - EDITTEXT IDC_FILTERVOV,253,101,34,12,ES_CENTER | ES_READONLY - RTEXT "Extra settings:",-1,27,133,57,10,SS_CENTERIMAGE - CONTROL "Slider1",IDC_FILTERXL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,157,151,19 - EDITTEXT IDC_FILTERXLV,253,159,34,12,ES_CENTER | ES_READONLY - COMBOBOX IDC_FILTERSLR,253,130,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Presets",-1,0,187,296,36 - COMBOBOX IDC_FILTERPRESETS,8,201,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,200,47,14 - PUSHBUTTON "Save",IDC_FILTERPRESETSAVE,184,200,47,14 - PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,200,47,14 - COMBOBOX IDC_FILTERHZMULT,67,43,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_FILTERVZMULT,67,63,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,26,168,63,10 - COMBOBOX IDC_FILTERXTRA,105,130,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP -END - -IDD_HARDDRIVE DIALOGEX 0, 0, 380, 66 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Harddrive Settings" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - LTEXT "Hard drive:",-1,7,11,35,10 - COMBOBOX IDC_HARDDRIVE,49,9,325,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,247,33,55,10 - DEFPUSHBUTTON "Add hard drive",IDOK,173,30,65,14 - PUSHBUTTON "Cancel",IDCANCEL,321,30,54,14 - DEFPUSHBUTTON "Create hard disk image file",IDC_HARDDRIVE_IMAGE,49,30,115,14 - EDITTEXT IDC_PATH_NAME,89,49,169,15,ES_AUTOHSCROLL | NOT WS_VISIBLE -END - -IDD_MISC2 DIALOGEX 0, 0, 300, 92 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "When Active",IDC_STATIC,8,7,88,73 - RTEXT "Run at priority:",IDC_ACTIVE_PRI,14,17,52,10,SS_CENTERIMAGE | WS_TABSTOP - COMBOBOX IDC_ACTIVE_PRIORITY,14,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "When Inactive",IDC_STATIC,102,7,92,73 - RTEXT "Run at priority:",IDC_INACTIVE_PRI,109,17,51,10,SS_CENTERIMAGE | WS_TABSTOP - COMBOBOX IDC_INACTIVE_PRIORITY,109,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,50,69,10 - CONTROL "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,63,79,10 - GROUPBOX "When Minimized",IDC_STATIC,199,7,92,73 - RTEXT "Run at priority:",IDC_MINIMIZED_PRI,207,18,51,10,SS_CENTERIMAGE | WS_TABSTOP - COMBOBOX IDC_MINIMIZED_PRIORITY,207,30,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,50,69,10 - CONTROL "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,63,79,10 -END - -IDD_DISK DIALOGEX 0, 0, 300, 242 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_CONTROL | DS_CENTER | DS_CENTERMOUSE | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - CONTROL "",IDC_DISKLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,6,292,196 - PUSHBUTTON "Remove floppy disk image",IDC_DISKLISTREMOVE,149,223,101,15 - COMBOBOX IDC_DISKTEXT,3,205,293,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Insert floppy disk image",IDC_DISKLISTINSERT,34,223,101,15 -END - -IDD_PANEL DIALOGEX 0, 0, 420, 278 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT -CAPTION "WinUAE Properties" -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - GROUPBOX "",IDC_PANEL_FRAME,112,4,303,247,NOT WS_VISIBLE - CONTROL "",IDC_PANELTREE,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_NOSCROLL | WS_BORDER | WS_TABSTOP,5,5,101,248,WS_EX_CLIENTEDGE - GROUPBOX "",IDC_PANEL_FRAME_OUTER,110,2,307,251 - PUSHBUTTON "Reset",IDC_RESETAMIGA,6,259,47,14 - PUSHBUTTON "Quit",IDC_QUITEMU,57,259,47,14 - DEFPUSHBUTTON "OK",IDOK,260,259,50,14 - PUSHBUTTON "Cancel",IDCANCEL,313,259,50,14 - PUSHBUTTON "Help",IDHELP,366,259,50,14,WS_DISABLED -END - -IDD_PATHS DIALOGEX 0, 0, 300, 237 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - LTEXT "System ROMs:",IDC_PATHS_ROML,14,9,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_ROM,14,22,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_ROMS,281,22,11,15 - LTEXT "Configuration files:",IDC_PATHS_CONFIGL,14,40,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_CONFIG,14,52,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_CONFIGS,281,52,11,15 - LTEXT "Screenshots:",IDC_PATHS_SCREENSHOTL,14,71,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_SCREENSHOT,14,83,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_SCREENSHOTS,281,83,11,15 - LTEXT "State files:",IDC_PATHS_STATEFILEL,14,102,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_SAVESTATE,14,114,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_SAVESTATES,281,114,11,15 - LTEXT "Videos:",IDC_PATHS_AVIOUTPUTL,14,132,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_AVIOUTPUT,14,144,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_AVIOUTPUTS,282,144,11,15 - LTEXT "Saveimages:",IDC_PATHS_SAVEIMAGEL,14,163,260,8,SS_CENTERIMAGE - EDITTEXT IDC_PATHS_SAVEIMAGE,14,175,261,15,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_PATHS_SAVEIMAGES,281,175,11,15 - PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,14,199,92,14 - PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,14,218,92,14 - PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,112,218,77,14 - COMBOBOX IDC_PATHS_DEFAULTTYPE,112,199,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,198,218,77,14 -END - -IDD_QUICKSTART DIALOGEX 0, 0, 300, 242 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - GROUPBOX "Emulated Hardware",IDC_QUICKSTART_CONFIG,3,0,294,54 - RTEXT "Model:",IDC_STATIC,5,14,50,10,SS_CENTERIMAGE - COMBOBOX IDC_QUICKSTART_MODEL,59,12,233,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Configuration:",IDC_STATIC,5,33,50,10,SS_CENTERIMAGE - COMBOBOX IDC_QUICKSTART_CONFIGURATION,59,31,233,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Compatibility vs Required CPU Power ",IDC_QUICKSTART_COMPA,3,56,294,33 - RTEXT "Best compatibility",IDC_STATIC,13,70,67,10,SS_CENTERIMAGE - CONTROL "",IDC_QUICKSTART_COMPATIBILITY,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,65,115,21 - RTEXT "Low compatibility",IDC_STATIC,215,70,63,10,SS_CENTERIMAGE - GROUPBOX "Host Configuration",IDC_QUICKSTART_HOST,3,91,294,33 - RTEXT "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE - COMBOBOX IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Emulated Floppy Drives",IDC_QUICKSTART_DF,3,126,294,84 - CONTROL "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,136,72,15 - PUSHBUTTON "Select disk image",IDC_DF0QQ,85,136,98,15 - RTEXT "Write-protected",IDC_STATIC,185,139,56,10,SS_CENTERIMAGE - CONTROL "",IDC_DF0WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,137,10,15 - PUSHBUTTON "Eject",IDC_EJECT0Q,261,136,30,15 - COMBOBOX IDC_DF0TEXTQ,9,154,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - CONTROL "Floppy drive DF1:",IDC_DF1QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,172,71,15 - PUSHBUTTON "Select disk image",IDC_DF1QQ,85,172,98,15 - RTEXT "Write-protected",IDC_STATIC,185,175,55,10,SS_CENTERIMAGE - CONTROL "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,173,10,15 - PUSHBUTTON "Eject",IDC_EJECT1Q,261,172,30,15 - COMBOBOX IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Set configuration",IDC_QUICKSTART_SETCONFIG,9,219,72,15,NOT WS_VISIBLE - GROUPBOX "Mode",IDC_STATIC,190,211,107,27,BS_LEFT - CONTROL "Start in Quickstart mode",IDC_QUICKSTARTMODE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,197,222,94,10 -END - -IDD_FRONTEND DIALOGEX 0, 0, 420, 242 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_FE_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,6,9,235,124 - GROUPBOX "",IDC_FE_INFO,249,140,160,95 - GROUPBOX "",IDC_FE_SCREENSHOT,249,7,160,128 -END - -IDD_PROGRESSBAR DIALOGEX 0, 0, 229, 58 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Processing..." -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,88,40,50,14 - CONTROL "",IDC_PROGRESSBAR,"msctls_progress32",WS_BORDER | 0x1,7,19,215,14 - CTEXT "x",IDC_PROGRESSBAR_TEXT,23,5,187,10,SS_CENTERIMAGE | WS_TABSTOP -END - -IDD_STRINGBOX DIALOGEX 0, 0, 229, 58 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Enter text..." -FONT 8, "MS Sans Serif", 0, 0, 0x0 -BEGIN - DEFPUSHBUTTON "OK",IDOK,48,39,50,14 - PUSHBUTTON "Cancel",IDCANCEL,151,39,50,14 - EDITTEXT IDC_STRINGBOXEDIT,7,17,214,14,ES_AUTOHSCROLL | ES_WANTRETURN - CTEXT "Custom input event",IDC_STRINGBOX_TEXT,23,5,187,10,SS_CENTERIMAGE | WS_TABSTOP -END - -IDD_DEBUGGER DIALOGEX 0, 0, 454, 368 -STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_THICKFRAME -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "WinUAE Debugger" -FONT 8, "Courier New", 0, 0, 0x0 -BEGIN - EDITTEXT IDC_DBG_OUTPUT1,1,79,370,262,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | NOT WS_TABSTOP - EDITTEXT IDC_DBG_OUTPUT2,1,79,370,262,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | NOT WS_TABSTOP - LISTBOX IDC_DBG_MEM,1,92,370,249,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_DASM,1,92,370,249,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - EDITTEXT IDC_DBG_MEMINPUT,1,79,36,12,ES_AUTOHSCROLL | ES_WANTRETURN - EDITTEXT IDC_DBG_INPUT,1,342,354,12,ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "?",IDC_DBG_HELP,356,342,15,12,NOT WS_TABSTOP - PUSHBUTTON "Set to PC",IDC_DBG_MEMTOPC,38,79,45,12,NOT WS_TABSTOP - LISTBOX IDC_DBG_DREG,1,1,52,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_AREG,54,1,52,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_AMEM,106,1,231,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_CCR,338,1,57,42,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_SP_VBR,338,44,115,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_MMISC,396,1,57,42,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_PC,1,68,52,10,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_PREFETCH,54,68,283,10,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_FPREG,372,218,81,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_FPSR,372,285,81,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_MISCCPU,372,320,81,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - CONTROL "",IDC_DBG_STATUS,"msctls_statusbar32",0x103,0,355,453,12 - LISTBOX IDC_DBG_BRKPTS,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL - LISTBOX IDC_DBG_MCUSTOM,372,79,81,138,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT - LISTBOX IDC_DBG_MISC,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL - LISTBOX IDC_DBG_CUSTOM,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APPICON ICON "winuae.ico" -IDI_FLOPPY ICON "35floppy.ico" -IDI_ABOUT ICON "amigainfo.ico" -IDI_HARDDISK ICON "Drive.ico" -IDI_CPU ICON "cpu.ico" -IDI_PORTS ICON "joystick.ico" -IDI_INPUT ICON "joystick.ico" -IDI_MISC1 ICON "misc.ico" -IDI_MISC2 ICON "misc.ico" -IDI_MOVE_UP ICON "move_up.ico" -IDI_MOVE_DOWN ICON "move_dow.ico" -IDI_AVIOUTPUT ICON "avioutput.ico" -IDI_DISK ICON "Drive.ico" -IDI_CONFIGFILE ICON "file.ico" -IDI_FOLDER ICON "folder.ico" -IDI_SOUND ICON "sound.ico" -IDI_DISPLAY ICON "screen.ico" -IDI_ROOT ICON "root.ico" -IDI_MEMORY ICON "chip.ico" -IDI_QUICKSTART ICON "quickstart.ico" -IDI_PATHS ICON "paths.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,4,0 - PRODUCTVERSION 1,4,4,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "WinUAE" - VALUE "FileVersion", "1.4.4" - VALUE "InternalName", "WinUAE" - VALUE "LegalCopyright", "© 1996-2007 under the GNU Public License (GPL)" - VALUE "OriginalFilename", "WinUAE.exe" - VALUE "ProductName", "WinUAE" - VALUE "ProductVersion", "1.4.4" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Cursor -// - -IDC_MYHAND CURSOR "H_arrow.cur" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDM_SYSTRAY MENU -BEGIN - POPUP "Menu" - BEGIN - MENUITEM "Configuration", ID_ST_CONFIGURATION - POPUP "Floppy drives" - BEGIN - MENUITEM "Eject all drives", ID_ST_EJECTALL - MENUITEM "DF0:", ID_ST_DF0 - MENUITEM "DF1:", ID_ST_DF1 - MENUITEM "DF2:", ID_ST_DF2 - MENUITEM "DF3:", ID_ST_DF3 - END - MENUITEM "Reset", ID_ST_RESET - MENUITEM "Help", ID_ST_HELP - MENUITEM "Quit WinUAE", ID_ST_QUIT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// WAVE -// - -IDR_DRIVE_STARTUP_A500_1 WAVE "drive_startup.wav" -IDR_DRIVE_CLICK_A500_1 WAVE "drive_click.wav" -IDR_DRIVE_SPIN_A500_1 WAVE "drive_spin.wav" -IDR_DRIVE_SNATCH_A500_1 WAVE "drive_snatch.wav" -IDR_DRIVE_SPINND_A500_1 WAVE "drive_spinnd.wav" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_XARCADE BITMAP "xarcade-winuae.bmp" -IDB_LCD160X43 BITMAP "lcd.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_KICKSTART "ROM" - IDS_DISK "Disk swapper" - IDS_DISPLAY "Display" - IDS_HARDDISK "Hard drives" - IDS_FLOPPY "Floppy drives" - IDS_ABOUT "About" - IDS_LOADSAVE "Configurations" - IDS_AVIOUTPUT "Output" - IDS_PORTS "Game & I/O ports" - IDS_MISC1 "Misc" - IDS_MEMORY "RAM" - IDS_CPU "CPU and FPU" - IDS_CHIPSET "Chipset" - IDS_INPUT "Input" - IDS_FILTER "Filter" -END - -STRINGTABLE -BEGIN - IDS_MISC2 "Priority" - IDS_PATHS "Paths" - IDS_QUICKSTART "Quickstart" - IDS_FRONTEND "Frontend" - IDS_CHIPSET2 "Adv. Chipset" -END - -STRINGTABLE -BEGIN - IDS_EXTTEXT "Floppy disk image files" - IDS_EXTACTUAL "ADF" - IDS_SOUND "Sound" - IDS_CDROM "CD-ROM" - IDS_FRAMERATE "Every %1Frame" - IDS_SECOND "second " - IDS_THIRD "third " - IDS_FOURTH "fourth " - IDS_FIFTH "fifth " - IDS_SIXTH "sixth " - IDS_SEVENTH "seventh " - IDS_EIGHTH "eighth " -END - -STRINGTABLE -BEGIN - IDS_NINTH "ninth " - IDS_TENTH "tenth " - IDS_SELECTADF "Select a floppy disk image file..." - IDS_ADF "Floppy disk image files" - IDS_CHOOSEBLANK "Choose a blank floppy disk image file..." - IDS_SELECTHDF "Select a hard disk image file..." - IDS_HDF "Hard disk image files" - IDS_SELECTUAE "Select a WinUAE configuration file..." - IDS_UAE "WinUAE configuration files" - IDS_SELECTROM "Select a system ROM file..." - IDS_ROM "System ROM files" - IDS_SELECTKEY "Select a system ROM key file..." - IDS_KEY "System ROM key files" - IDS_SELECTINFO "Select information for your configuration..." - IDS_NONE "none" - IDS_VOLUME "Volume" -END - -STRINGTABLE -BEGIN - IDS_SELECTFILESYSROOT "Please select the root directory of the file system..." - IDS_DEFAULTMIDIOUT "Default MIDI-Out Device" - IDS_CONTRIBUTORS1 "Bernd Schmidt - The Grand-Master\nSam Jordan - Custom-chip, floppy-DMA, etc.\nMathias Ortmann - Original WinUAE Main Guy, BSD Socket support\nBrian King - Picasso96 Support, Integrated GUI for WinUAE, previous WinUAE Main Guy\nToni Wilen - Core updates, WinUAE Main Guy\nGustavo Goedert/Peter Remmers/Michael Sontheimer/Tomi Hakala/Tim Gunn/Nemo Pohle - DOS Port Stuff\nSamuel Devulder/Olaf Barthel/Sam Jordan - Amiga Ports\nKrister Bergman - XFree86 and OS/2 Port\nA. Blanchard/Ernesto Corvi - MacOS Port\nChristian Bauer - BeOS Port\nIan Stephenson - NextStep Port\nPeter Teichmann - Acorn/RiscOS Port\nStefan Reinauer - ZorroII/III AutoConfig, Serial Support\nChristian Schmitt/Chris Hames - Serial Support\nHerman ten Brugge - 68020/68881 Emulation Code\nTauno Taipaleenmaki - Various UAE-Control/UAE-Library Support\nBrett Eden/Tim Gunn/Paolo Besser/Nemo Pohle - Various Docs and Web-Sites\nGeorg Veichtlbauer - Help File coordinator, German GUI\nFulvio Leonardi - Italian translator for WinUAE\n" - IDS_CONTRIBUTORS2 "Bill Panagouleas - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nPéter Tóth /Balázs Rátkai/Iván Herczeg/András Arató - Hungarian translation.\nKarsten Bock, Gavin Fance, Dirk Trowe and Christoph Meier - Freezer cartridge hardware support." - IDS_INVALIDPRTPORT "The printer you have in this configuration is not valid on this machine.\n" - IDS_RESTOREUSS "Restore a WinUAE snapshot file" - IDS_USS "WinUAE snapshot files" - IDS_WRONGOSVERSION "WinUAE is no longer supported on Windows NT. Please upgrade to either Windows 2000 or Windows XP or a later version." - IDS_SELECTFLASH "Select a flash or battery-backed RAM file..." - IDS_FLASH "WinUAE flash or battery-backed RAM file" - IDS_INPUTHOSTWIDGET "Input source" - IDS_INPUTAMIGAEVENT "Input target" - IDS_INPUTAUTOFIRE "Autofire" - IDS_SAVEUSS "Save a WinUAE snapshot file" - IDS_MIDIOVERFLOW "Sysexbuffer overflow. Should not happen. Please report this to\nberndroesch1@compuserve.de" -END - -STRINGTABLE -BEGIN - IDS_PATH "Path" - IDS_RW "R/W" - IDS_SECTORS "Sectors" - IDS_SURFACES "Bill Panagouleas - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nHungarian translation - Péter Tóth , Balázs Rátkai , Iván Herczeg , András Arató" - IDS_RESERVED "Reserved" - IDS_BLOCKSIZE "Block size" - IDS_NAME "Name" - IDS_DESCRIPTION "Description" - IDS_COULDNOTLOADCONFIG "Could not load the selected configuration!\n" - IDS_NOHELP "Online help is disabled because the HTML Help functionality is not installed on this system. HTML Help is available from http://www.microsoft.com/downloads/.\n" - IDS_MUSTSELECTCONFIG "You must select a configuration or enter a name before selecting Load...\n" - IDS_INVALIDCOMPORT "The serial port you have in this configuration is not valid on this machine.\n" -END - -STRINGTABLE -BEGIN - IDS_HFDSIZE "Size" - IDS_DEVICE "Device" - IDS_BOOTPRI "BootPri" - IDS_FLOPPY_COMPATIBLE " (compatible)" - IDS_FLOPPY_TURBO "Turbo" - IDS_YES "yes" - IDS_NO "no" - IDS_PRI_ABOVENORMAL "Above Normal" - IDS_PRI_NORMAL "Normal" - IDS_PRI_BELOWNORMAL "Below Normal" - IDS_PRI_LOW "Low" - IDS_OLDRTGLIBRARY "The installed LIBS:Picasso96/rtg.library (%d.%d) should be updated.\nA newer version is included in the ""Amiga Programs"" directory\n of the WinUAE distribution archive.\n\nNewer library version fixes graphics problems and increases performance." - IDS_DEFAULT_AF2005 "Amiga Forever 2005+" - IDS_DEFAULT_AF "Amiga Forever" - IDS_DEFAULT_WINUAE "WinUAE default (old)" -END - -STRINGTABLE -BEGIN - IDS_SOUND_STEREO2 "Cloned Stereo (4 Channels)" - IDS_INPUT_CUSTOMEVENT "" - IDS_DEFAULT_NEWWINUAE "WinUAE default (new)" -END - -STRINGTABLE -BEGIN - IDS_UNSUPPORTEDPIXELFORMAT - "Error: unsupported pixel format. Please use a different screen mode.\n" - IDS_MUSTENTERNAME "You must select a configuration or enter a name before selecting Save...\n" - IDS_MUSTSELECTCONFIGFORDELETE - "You must select a configuration or enter a name before selecting Delete...\n" - IDS_DELETECONFIGCONFIRMATION - "Are you sure you want to Delete this configuration?\n" - IDS_DELETECONFIGTITLE "Confirm Delete" - IDS_MUSTSELECTPATH "You must select a path!" - IDS_SETTINGSERROR "Settings error" - IDS_MUSTSELECTNAME "You must select a name for the volume!" - IDS_MUSTSELECTFILE "You must select a file!" - IDS_FAILEDHARDFILECREATION "Failed to create hard disk image file..." - IDS_CREATIONERROR "Creation error" - IDS_ERRORTITLE "WinUAE message" -END - -STRINGTABLE -BEGIN - IDS_INP "WinUAE Input Recording" - IDS_RESTOREINP "Playback a WinUAE input recording" - IDS_SAVEINP "Record a WinUAE input recording" - IDS_SCREEN_WINDOWED "Windowed" - IDS_SCREEN_FULLSCREEN "Fullscreen" - IDS_SCREEN_FULLWINDOW "Full-window" - IDS_SCREEN_VSYNC "VSync" - IDS_SOUND_MONO "Mono" - IDS_SOUND_MIXED "Mixed" - IDS_SOUND_STEREO "Stereo" - IDS_SOUND_INTERPOL_DISABLED "Disabled" - IDS_SOUND_FILTER_OFF "Always off" - IDS_SOUND_FILTER_EMULATED "Emulated (A500)" -END - -STRINGTABLE -BEGIN - IDS_SOUND_FILTER_EMULATED_E "Emulated (A1200)" - IDS_INPUT_COMPATIBILITY "Compatibility mode" - IDS_INPUT_CUSTOM "Configuration #%d" - IDS_INPUT_COPY_DEFAULT "Default" - IDS_INPUT_COPY_CUSTOM "Config #%d" - IDS_3D_NO_FILTER "Point (%d-bit)" - IDS_3D_BILINEAR "Bilinear (%d-bit)" - IDS_VSYNC_DEFAULT "Default" - IDS_DRIVESOUND_NONE "No sound" - IDS_DRIVESOUND_DEFAULT_A500 "A500 (WinUAE built-in)" - IDS_AVIOUTPUT_NOCODEC "no codec selected" - IDS_DISK_IMAGENAME "Disk image" - IDS_DISK_DRIVENAME "Drive" - IDS_AGA8BIT "AGA emulation requires a 16-bit or higher display depth.\nSwitching from 8-bit to 16-bit." - IDS_UNSUPPORTEDSCREENMODE - "The selected screen mode can't be displayed in a window, because %s\nSwitching to full-screen display." - IDS_UNSUPPORTEDSCREENMODE_1 - "the desktop is running in an unknown color mode." -END - -STRINGTABLE -BEGIN - IDS_UNSUPPORTEDSCREENMODE_2 - "the desktop is running in 8-bit color depth, which WinUAE can't use in windowed mode." - IDS_UNSUPPORTEDSCREENMODE_3 - "the desktop is too small for the specified window size." - IDS_UNSUPPORTEDSCREENMODE_4 - "you selected an RTG (Picasso96) display with a color depth different from that of the desktop and an overlay was unavailable." - IDS_FLOPPYTYPE35DD "3.5"" DD" - IDS_FLOPPYTYPE35HD "3.5"" HD" - IDS_FLOPPYTYPE525SD "5.25"" SD" - IDS_FLOPPYTYPEDISABLED "Disabled" - IDS_STMENUNOFLOPPY "No floppy disk inserted" - IDS_TREEVIEW_HARDWARE "Hardware" - IDS_TREEVIEW_HOST "Host" - IDS_TREEVIEW_MISC "Miscellaneous" - IDS_TREEVIEW_SETTINGS "Settings" - IDS_WINUAETITLE_MMB "[Mouse active - press ALT+TAB or middle mouse button to cancel]" - IDS_WINUAETITLE_NORMAL "[Mouse active - press ALT+TAB to cancel]" - IDS_STARTEMULATION "Start" - IDS_TREEVIEW_ABOUT "About" -END - -STRINGTABLE -BEGIN - IDS_NOHARDDRIVES "No hard disks detected that were either empty or RDB-partitioned." - IDS_DEFAULT_HOST "Default Configuration" - IDS_SOUND_4CHANNEL "4 Channels" - IDS_HF_FS_CUSTOM "Custom" - IDS_SELECTFS "Select file system handler (FastFileSystem, SmartFilesystem, etc.)" - IDS_KEYJOY "Keyboard Layout A (Numeric keypad, 0 and 5 = Fire)\nKeyboard Layout B (Cursor keys, Right CTRL and ALT = Fire)\nKeyboard Layout C (W=Up S=Down A=Left D=Right, Left ALT = Fire)\nX-Arcade (Left)\nX-Arcade (Right)" - IDS_STATEFILE_UNCOMPRESSED "Uncompressed" - IDS_STATEFILE_RAMDUMP "RAM dump" - IDS_STATEFILE_WAVE "Wave audio dump" - IDS_SOUND_SWAP_PAULA "Paula only" - IDS_SOUND_SWAP_AHI "AHI only" - IDS_SOUND_SWAP_BOTH "Both" - IDS_SOUND_FILTER_ON_AGA "Always on (A500)" - IDS_SOUND_FILTER_ON_A500 "Always on (A1200)" - IDS_DRIVESOUND_PC_FLOPPY "PC floppy drive %c" - IDS_FLOPPYTYPE35DDESCOM "3.5"" ESCOM" -END - -STRINGTABLE -BEGIN - IDS_NUMSG_NEEDEXT2 "The software uses a non-standard floppy disk format. You may need to use a custom floppy disk image file instead of a standard one. This message will not appear again." - IDS_NUMSG_NOROMKEY "Could not find system ROM key file." - IDS_NUMSG_KSROMCRCERROR "System ROM checksum incorrect. The system ROM image file may be corrupt." - IDS_NUMSG_KSROMREADERROR "Error while reading system ROM." -END - -STRINGTABLE -BEGIN - IDS_NUMSG_NOEXTROM "No extended ROM found." - IDS_NUMSG_MODRIP_NOTFOUND "No music modules or packed data found." - IDS_NUMSG_MODRIP_FINISHED "Scan finished." - IDS_NUMSG_MODRIP_SAVE "Module/packed data found\n%s\nWould you like to save it?" - IDS_NUMSG_KS68020 "The selected system ROM requires a 68020 with 32-bit addressing or 68030 or higher CPU." - IDS_NUMSG_ROMNEED "One of the following system ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." - IDS_NUMSG_STATEHD "WARNING: Current configuration is not fully compatible with state saves.\nThis message will not appear again." - IDS_NUMSG_NOCAPS "Selected disk image needs the SPS plugin\nwhich is available from\nhttp//www.softpres.org/" - IDS_NUMSG_OLDCAPS "You need an updated SPS plugin\nwhich is available from\nhttp//www.softpres.org/" - IDS_IMGCHK_BOOTBLOCKCRCERROR - "The selected floppy disk image is not bootable (boot block checksum error)" - IDS_IMGCHK_BOOTBLOCKNO "The selected floppy disk image is not bootable (no boot block)" - IDS_IMGCHK_DAMAGED "The selected floppy disk image is damaged or unformatted" - IDS_IMGCHK_KS2 "The selected floppy disk image requires a 2.04 or later system ROM.\nThe configuration has been updated." - IDS_IMGCHK_KS3 "The selected floppy disk image requires a 3.0 or later system ROM.\nThe configuration has been updated." - IDS_ROMSCANEND "Scan of ROMs finished" -END - -STRINGTABLE -BEGIN - IDS_ROM_AVAILABLE "available" - IDS_ROM_UNAVAILABLE "unavailable" - IDS_HARDDRIVESAFETYWARNING1 - "Warning: The drive safety check is active. Selected drive is not empty and non-RDB partitioned." - IDS_NUMSG_KS68EC020 "The selected system ROM requires a 68020 with 24-bit addressing or higher CPU." - IDS_ROMSCANNOROMS "No supported system ROMs detected." - IDS_NUMSG_KICKREP "You need to have a floppy disk (image file) in DF0: to use the system ROM replacement." - IDS_NUMSG_KICKREPNO "The floppy disk (image file) in DF0: is not compatible with the system ROM replacement functionality." - IDS_NUMSG_NOROM "Could not load system ROM, trying system ROM replacement." - IDS_HDCLONE_OK "Hard drive image file created succesfully." - IDS_HDCLONE_FAIL "Hard drive image file creation failed.\nError code %d:%d." - IDS_NUMSG_KS68030 "The selected system ROM requires a 68030 CPU." - IDS_NUMSG_EXPROMNEED "One of the following expansion boot ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." - IDS_HARDDRIVESAFETYWARNING2 - "Warning: The drive safety check has been disabled, and non-empty and non-RDB partitioned hard disk(s) were detected." -END - -STRINGTABLE -BEGIN - IDS_QS_MODELS "A500\nA500+\nA600\nA1000\nA1200\nA3000\nCD32\nCDTV\nArcadia Multi Select system\nExpanded WinUAE example configuration" - IDS_QS_MODEL_A500 "1.3 ROM, OCS, 512 KB Chip + 512 KB Slow RAM (most common)\nThis configuration is capable of running most games and demos produced for first-generation hardware. Only few exceptions need a different configuration (e.g. the oldest games tend to be incompatible with this configuration).\n1.3 ROM, ECS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nLater hardware revision of the A500. Nearly 100% compatible with the previous configuration.\n1.3 ROM, ECS Agnus, 1 MB Chip RAM\nFew newer games and demos require this configuration.\n1.3 ROM, OCS Agnus, 512 KB Chip RAM\nVery old (e.g. pre-1988) games and demos may require this configuration.\n1.2 ROM, OCS Agnus, 512 KB Chip RAM\nAs available for the A1000, and installed on the first A500 and A2000 series. Some very old programs only work correctly with this configuration. Note: This system ROM version can only boot from floppy disk (no hard disk boot support).\n1.2 ROM, OCS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nThis configuration adds expansion memory to the first A500 produced. Try this if your game does not work with newer configurations, but works with the previous one. It could add some features to the game, including faster loading times. Note: This system ROM version can only boot from floppy disk (no hard disk boot support)." - IDS_QS_MODEL_A500P "Basic non-expanded configuration\nThe A500+ adds an ECS Agnus chip, 1 MB of Chip RAM and a 2.0 ROM to the A500. Many A500 games and demos don't work properly on an A500+.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" - IDS_QS_MODEL_A600 "Basic non-expanded configuration\nThe A600 is smaller than the A500+ and has an updated 2.0 ROM.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" - IDS_QS_MODEL_A1000 "512 KB Chip RAM\nThe A1000 was the first model produced, with a configuration equivalent to that of an A500 with OCS chipset. You normally don't need to use this configuration, unless you are nostalgic and would like to hear the short A1000 boot tune\n""ICS"" Denise without EHB support\nVery first A1000 models had Denise without EHB capability.\n256 KB Chip RAM\n Unexpanded A1000. All later A1000 models were sold with a 256 KB RAM expansion built-in." - IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4 MB Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run." - IDS_QS_MODEL_CD32 "CD32\nThe CD32 was one the first 32-bit consoles on the market. It is basically an A1200 with a built-in CD-ROM drive. Insert your CD32 or CDTV CD-ROM into a free CD-ROM drive before starting the emulation." - IDS_QS_MODEL_CDTV "CDTV\nThe CDTV was the first model with a built-in CD-ROM drive. Looking like a black CD player, it featured a configuration equivalent to that of an A500 with 1 MB RAM and an ECS chipset.\nFloppy drive and 64KB SRAM card expanded CDTV\n" -END - -STRINGTABLE -BEGIN - IDS_QS_MODEL_UAE "High-end expanded configuration" - IDS_QS_MODEL_ARCADIA "Arcadia\nArcadia Multi Select system is arcade platform developed by Arcadia and Mastertronic. It is based on an A500 mainboard with ROM cage attached to expansion port. Arcadia ROM files go to ""Cartridge ROM File"" in ROM-panel." - IDS_QS_MODEL_A3000 "1.4 ROM, 2MB Chip + 8MB Fast\n\n3.1 ROM, 2MB Chip + 8MB Fast\n" - IDS_QS_MODEL_A4000 "A4000 (test)\nA4000" - IDS_QS_MODEL_A4000T "A4000T (test)\nA4000T" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Finnish resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN) -#ifdef _WIN32 -LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // Finnish resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDR_DBGACCEL ACCELERATORS +BEGIN + VK_F1, ID_DBG_PAGE1, VIRTKEY, NOINVERT + VK_F2, ID_DBG_PAGE2, VIRTKEY, NOINVERT + VK_F3, ID_DBG_PAGE3, VIRTKEY, NOINVERT + VK_F4, ID_DBG_PAGE4, VIRTKEY, NOINVERT + VK_F5, ID_DBG_PAGE5, VIRTKEY, NOINVERT + VK_F6, ID_DBG_PAGE6, VIRTKEY, NOINVERT + VK_F7, ID_DBG_PAGE7, VIRTKEY, NOINVERT + VK_F8, ID_DBG_PAGE8, VIRTKEY, NOINVERT + VK_F9, ID_DBG_PAGE9, VIRTKEY, NOINVERT + VK_DOWN, IDC_DBG_MEMDOWN, VIRTKEY, ALT, NOINVERT + VK_RIGHT, IDC_DBG_MEMDOWNFAST, VIRTKEY, ALT, NOINVERT + VK_UP, IDC_DBG_MEMUP, VIRTKEY, ALT, NOINVERT + VK_LEFT, IDC_DBG_MEMUPFAST, VIRTKEY, ALT, NOINVERT + "H", IDC_DBG_HELP, VIRTKEY, ALT, NOINVERT + "P", IDC_DBG_MEMTOPC, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_KICKSTART DIALOGEX 0, 0, 300, 176 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +EXSTYLE WS_EX_CONTEXTHELP +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "System ROM Settings",-1,5,0,290,74 + RTEXT "Main ROM file:",IDC_ROMTEXT,10,15,75,10 + COMBOBOX IDC_ROMFILE,89,12,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "...",IDC_KICKCHOOSER,280,10,10,15 + RTEXT "Extended ROM file:",IDC_ROMFILE2TEXT,10,35,75,10 + COMBOBOX IDC_ROMFILE2,89,31,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "...",IDC_ROMCHOOSER2,280,30,10,15 + CONTROL "MapROM emulation [] Creates a BlizKick-compatible memory area.",IDC_MAPROM, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,95,54,87,10 + CONTROL "ShapeShifter support [] Patches the system ROM for ShapeShifter compatibility.",IDC_KICKSHIFTER, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,54,87,10 + GROUPBOX "Miscellaneous",-1,5,76,290,57 + RTEXT "Cartridge ROM file:",IDC_FLASHTEXT2,8,93,75,10 + COMBOBOX IDC_CARTFILE,89,90,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "...",IDC_CARTCHOOSER,280,90,10,15 + RTEXT "Flash RAM file:",IDC_FLASHTEXT,8,112,75,10 + EDITTEXT IDC_FLASHFILE,89,110,185,13,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_FLASHCHOOSER,280,110,10,15 +END + +IDD_DISPLAY DIALOGEX 0, 0, 300, 235 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Screen",IDC_SCREENRESTEXT,12,0,199,67,BS_LEFT + RTEXT "Full screen:",IDC_SELECTRESTEXT,15,17,40,15,SS_CENTERIMAGE + COMBOBOX IDC_DISPLAYSELECT,59,10,147,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RESOLUTION,59,27,52,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_REFRESHRATE,145,27,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_XSIZE,59,48,35,12,ES_NUMBER + EDITTEXT IDC_YSIZE,103,48,35,12,ES_NUMBER + GROUPBOX "Settings",IDC_SETTINGSTEXT,12,73,199,125 + CONTROL "Correct aspect ratio",IDC_ASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,19,126,92,10 + CONTROL "Force low resolution",IDC_LORES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,126,89,10 + LTEXT "Refresh:",IDC_REFRESHTEXT,18,162,28,8 + CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,157,75,20 + EDITTEXT IDC_RATETEXT,127,161,77,12,ES_CENTER | ES_READONLY + GROUPBOX "Centering",IDC_STATIC,221,0,61,67 + CONTROL "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,16,49,10 + CONTROL "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,32,49,10 + GROUPBOX "Line Mode",IDC_LINEMODE,222,73,61,73 + CONTROL "Normal",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,231,89,44,10 + CONTROL "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,105,45,10 + CONTROL "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,121,46,10 + COMBOBOX IDC_DA_MODE,20,211,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,84,207,101,20 + LTEXT "FPS adj.:",IDC_REFRESH2TEXT,16,182,32,8 + CONTROL "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,177,127,20 + EDITTEXT IDC_RATE2TEXT,178,181,26,12,ES_CENTER | ES_READONLY + COMBOBOX IDC_RESOLUTIONDEPTH,112,27,32,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,140,89,10 + COMBOBOX IDC_SCREENMODE_NATIVE,100,85,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_RTG,100,103,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + RTEXT "Native mode:",IDC_STATIC,19,85,59,15,SS_CENTERIMAGE + RTEXT "Windowed:",IDC_WINDOWEDTEXT,15,51,40,8 + RTEXT "RTG mode:",IDC_STATIC,19,101,59,15,SS_CENTERIMAGE + PUSHBUTTON "Reset to defaults",IDC_DA_RESET,212,211,73,14 +END + +IDD_MEMORY DIALOGEX 0, 0, 300, 175 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +EXSTYLE WS_EX_CONTEXTHELP +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Memory Settings",-1,14,7,274,91 + RTEXT "Chip:",-1,24,31,20,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_CHIPMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,54,22,50,20 + EDITTEXT IDC_CHIPRAM,105,26,30,12,ES_CENTER | ES_READONLY + RTEXT "Slow:",-1,149,31,20,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_SLOWMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,22,60,20 + EDITTEXT IDC_SLOWRAM,243,25,30,12,ES_CENTER | ES_READONLY + RTEXT "Fast:",IDC_FASTTEXT,24,52,20,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FASTMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,54,47,50,20 + EDITTEXT IDC_FASTRAM,105,53,30,12,ES_CENTER | ES_READONLY + RTEXT "Z3 Fast:",IDC_Z3TEXT,139,52,30,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_Z3FASTMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,47,60,20 + EDITTEXT IDC_Z3FASTRAM,243,52,30,12,ES_CENTER | ES_READONLY + RTEXT "RTG: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,81,77,90,10,SS_NOTIFY | SS_CENTERIMAGE + CONTROL "Slider1",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,72,60,20 + EDITTEXT IDC_P96RAM,243,75,30,12,ES_CENTER | ES_READONLY + GROUPBOX "Advanced Memory Settings",-1,13,104,275,65 + RTEXT "Motherboard RAM (Low area):",-1,39,122,129,10,SS_CENTERIMAGE + CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,117,59,20 + EDITTEXT IDC_MBRAM1,243,121,30,12,ES_CENTER | ES_READONLY + RTEXT "Motherboard RAM (High area):",-1,39,144,127,10,SS_CENTERIMAGE + CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,139,59,20 + EDITTEXT IDC_MBRAM2,243,142,30,12,ES_CENTER | ES_READONLY +END + +IDD_CPU DIALOGEX 0, 0, 300, 226 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "CPU",IDC_STATIC,5,3,81,139,BS_LEFT + CONTROL "68000",IDC_CPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,16,63,10 + CONTROL "68010",IDC_CPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,30,65,10 + CONTROL "68020",IDC_CPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,44,63,10 + CONTROL "68030",IDC_CPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,58,64,10 + CONTROL "68040",IDC_CPU4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,72,66,10 + CONTROL "68060",IDC_CPU5,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,85,66,10 + CONTROL "More compatible [] Emulate 68000's prefetch registers. More compatible but slower.",IDC_COMPATIBLE, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,114,73,8 + CONTROL "JIT [] Enable just-in-time CPU emulator. Significantly increases the speed of the CPU emulation. Requires 68020 or higher CPU.",IDC_JITENABLE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,127,73,10 + GROUPBOX "CPU Emulation Speed",IDC_STATIC,90,3,205,90 + CONTROL "Fastest possible, but maintain chipset timing",IDC_CS_HOST, + "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,95,18,195,10 + CONTROL "Match A500 speed",IDC_CS_68000,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,32,195,10 + CONTROL "Adjustable between CPU and chipset",IDC_CS_ADJUSTABLE, + "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,47,195,10 + RTEXT "CPU",IDC_CS_CPU_TEXT,96,73,15,10,SS_CENTERIMAGE | WS_TABSTOP + CONTROL "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,114,68,67,20 + LTEXT "Chipset",IDC_CS_CHIPSET_TEXT,182,73,25,10,SS_CENTERIMAGE | NOT WS_GROUP | WS_TABSTOP + RTEXT "CPU idle",IDC_CS_CPU_TEXT2,236,56,32,10,SS_CENTERIMAGE | WS_TABSTOP + CONTROL "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,219,68,69,20 + GROUPBOX "Advanced JIT Settings",IDC_STATIC,90,94,205,93 + RTEXT "Cache size:",IDC_CS_CACHE_TEXT,95,113,45,10,SS_CENTERIMAGE | WS_TABSTOP + CONTROL "Slider1",IDC_CACHE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,140,108,115,20 + EDITTEXT IDC_CACHETEXT,255,113,30,12,ES_CENTER | ES_READONLY + CONTROL "Hard flush",IDC_HARDFLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,141,63,10 + CONTROL "Constant jump",IDC_CONSTJUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,155,63,10 + CONTROL "FPU support",IDC_JITFPU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,168,62,10 + CONTROL "Force settings",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,141,62,10 + CONTROL "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,155,62,10 + CONTROL "Direct",IDC_TRUST0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,235,141,52,10 + CONTROL "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,155,52,10 + CONTROL "After RTG",IDC_TRUST2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,168,52,10 + CONTROL "More compatible [] More compatible but slower FPU emulation.",IDC_COMPATIBLE_FPU, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,206,73,10 + GROUPBOX "FPU",IDC_STATIC,6,144,81,76,BS_LEFT + CONTROL "24-bit addressing",IDC_COMPATIBLE24,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,100,73,8 + CONTROL "None",IDC_FPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,154,63,10 + CONTROL "68881",IDC_FPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,166,63,10 + CONTROL "68882",IDC_FPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,179,63,10 + CONTROL "CPU internal",IDC_FPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,192,63,10 +END + +IDD_FLOPPY DIALOGEX 0, 0, 300, 240 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + COMBOBOX IDC_DF0TEXT,2,22,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DF0TYPE,123,6,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Write-protected",IDC_STATIC,174,8,59,10,SS_CENTERIMAGE + CONTROL "",IDC_DF0WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,4,10,15 + PUSHBUTTON "Eject",IDC_EJECT0,253,4,30,15 + PUSHBUTTON "...",IDC_DF0,287,4,10,15 + COMBOBOX IDC_DF1TEXT,2,58,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DF1TYPE,123,42,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Write-protected",IDC_STATIC,174,43,59,10,SS_CENTERIMAGE + CONTROL "",IDC_DF1WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,40,10,15 + PUSHBUTTON "Eject",IDC_EJECT1,253,40,30,15 + PUSHBUTTON "...",IDC_DF1,287,40,10,15 + COMBOBOX IDC_DF2TEXT,2,93,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DF2TYPE,123,77,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Write-protected",IDC_STATIC,174,77,59,10,SS_CENTERIMAGE + CONTROL "",IDC_DF2WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,75,9,15 + PUSHBUTTON "Eject",IDC_EJECT2,253,75,30,15 + PUSHBUTTON "...",IDC_DF2,287,75,10,15 + COMBOBOX IDC_DF3TEXT,2,128,296,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DF3TYPE,123,112,49,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Write-protected",IDC_STATIC,174,113,59,10,SS_CENTERIMAGE + CONTROL "",IDC_DF3WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,238,111,9,15 + PUSHBUTTON "Eject",IDC_EJECT3,253,110,30,15 + PUSHBUTTON "...",IDC_DF3,287,109,10,15 + GROUPBOX "New Floppy Disk Image",IDC_SETTINGSTEXT,5,183,289,49 + COMBOBOX IDC_FLOPPYTYPE,16,196,51,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Create Standard Disk [] Creates a standard 880 or 1760 KB ADF disk image.",IDC_CREATE,76,196,97,15 + PUSHBUTTON "Create Custom Disk [] Creates a low level (MFM) ADF disk image (about 2MB). Useful for programs that use non-standard disk formats (for example some save disks or DOS-formatted floppies)",IDC_CREATE_RAW,183,196,101,15 + GROUPBOX "Floppy Drive Emulation Speed",IDC_SETTINGSTEXT2,5,144,289,35 + CONTROL "",IDC_FLOPPYSPD,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,32,152,116,20 + EDITTEXT IDC_FLOPPYSPDTEXT,169,155,107,12,ES_CENTER | ES_READONLY + PUSHBUTTON "Delete save image",IDC_SAVEIMAGE0,43,5,70,15,NOT WS_VISIBLE + PUSHBUTTON "Delete save image",IDC_SAVEIMAGE1,43,40,70,15,NOT WS_VISIBLE + PUSHBUTTON "Delete save image",IDC_SAVEIMAGE2,43,75,70,15,NOT WS_VISIBLE + PUSHBUTTON "Delete save image",IDC_SAVEIMAGE3,43,110,70,15,NOT WS_VISIBLE + EDITTEXT IDC_CREATE_NAME,75,215,98,13,ES_AUTOHSCROLL + RTEXT "Disk label:",IDC_STATIC,14,216,52,10,SS_CENTERIMAGE + CONTROL "DF0:",IDC_DF0ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,6,34,15 + CONTROL "DF1:",IDC_DF1ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,41,34,15 + CONTROL "DF2:",IDC_DF2ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,76,34,15 + CONTROL "DF3:",IDC_DF3ENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,3,111,34,15 +END + +IDD_HARDDISK DIALOGEX 0, 0, 300, 240 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +EXSTYLE WS_EX_CONTEXTHELP +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,182 + PUSHBUTTON "Add &Directory or Archive...",IDC_NEW_FS,10,186,103,15 + PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,130,186,74,15 + PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,220,186,75,15 + PUSHBUTTON "Remove",IDC_REMOVE,232,207,60,15 + PUSHBUTTON "&Properties",IDC_EDIT,232,225,60,15 + CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,209,100,10 + CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,209,119,10 + CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,220,121,10 + CONTROL "Include network drives",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,220,101,10 +END + +IDD_SOUND DIALOGEX 0, 0, 300, 231 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + RTEXT "Sound device:",IDC_SOUNDCARD,8,9,51,13,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDCARDLIST,64,9,229,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Sound Emulation",IDC_SOUNDSETTINGS,5,30,120,81 + CONTROL "Disabled",IDC_SOUND0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,45,101,10 + CONTROL "Disabled, but emulated",IDC_SOUND1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,57,102,10 + CONTROL "Enabled",IDC_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,69,102,10 + CONTROL "Enabled, 100% accurate",IDC_SOUND3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,81,101,10 + GROUPBOX "Volume",IDC_STATIC,131,36,164,31 + CONTROL "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,44,105,20 + EDITTEXT IDC_SOUNDVOLUME2,247,47,40,12,ES_CENTER | ES_READONLY + GROUPBOX "Sound Buffer Size",IDC_STATIC,132,73,164,31 + CONTROL "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,138,81,106,19 + EDITTEXT IDC_SOUNDBUFFERMEM,248,84,40,12,ES_CENTER | ES_READONLY + GROUPBOX "Settings",IDC_SOUNDINTERPOLATION2,6,114,290,60 + LTEXT "Frequency:",IDC_SOUNDFREQTXT,11,147,53,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDFREQ,13,156,51,75,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + LTEXT "Audio filter:",IDC_SOUNDFILTERTXT,209,148,77,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDFILTER,209,157,80,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Channel mode:",IDC_SOUNDSTEREOTXT,11,124,57,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDSTEREO,13,133,122,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Interpolation:",IDC_SOUNDINTERPOLATIONTXT,209,124,75,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDINTERPOLATION,209,132,80,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Stereo separation:",IDC_SOUNDSTEREOSEPTXT,141,124,63,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDSTEREOSEP,142,133,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Stereo delay:",IDC_SOUNDSTEREOMIXTXT,141,148,63,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDSTEREOMIX,142,157,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Floppy Drive Sound Emulation",IDC_STATIC,6,177,290,46 + CONTROL "",IDC_SOUNDDRIVEVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,185,107,19 + EDITTEXT IDC_SOUNDDRIVEVOLUME2,124,191,40,12,ES_CENTER | ES_READONLY + COMBOBOX IDC_SOUNDDRIVE,237,187,46,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SOUNDDRIVESELECT,18,205,265,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SOUNDSWAP,73,157,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Swap channels:",IDC_SOUNDSWAPTXT,74,148,61,8,SS_CENTERIMAGE + CONTROL "Automatic switching",IDC_SOUND_AUTO,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,95,103,10 +END + +IDD_LOADSAVE DIALOGEX 0, 0, 302, 241 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_CONFIGTREE,"SysTreeView32",TVS_HASLINES | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,6,3,289,153,WS_EX_CLIENTEDGE + RTEXT "Name:",IDC_STATIC,4,161,40,15,SS_CENTERIMAGE + EDITTEXT IDC_EDITNAME,48,162,146,13,ES_AUTOHSCROLL + RTEXT "Description:",IDC_STATIC,4,183,41,15,SS_CENTERIMAGE + EDITTEXT IDC_EDITDESCRIPTION,48,183,146,13,ES_AUTOHSCROLL + RTEXT "Link:",IDC_STATIC,4,204,40,15,SS_CENTERIMAGE + COMBOBOX IDC_CONFIGLINK,48,205,93,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Ignore link",IDC_CONFIGNOLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,146,206,48,10 + EDITTEXT IDC_EDITPATH,199,161,49,15,ES_AUTOHSCROLL | WS_DISABLED + CONTROL "Autoload",IDC_CONFIGAUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,253,163,42,10 + GROUPBOX "Additional Information",IDC_STATIC,199,179,96,38,BS_LEFT + PUSHBUTTON "View",IDC_VIEWINFO,208,195,37,15 + PUSHBUTTON "Set",IDC_SETINFO,250,195,37,15 + PUSHBUTTON "Load",IDC_QUICKLOAD,5,225,44,15 + PUSHBUTTON "Save",IDC_QUICKSAVE,54,225,44,15 + PUSHBUTTON "Load From...",IDC_LOAD,121,225,49,15 + PUSHBUTTON "Delete",IDC_DELETE,251,225,44,15 + PUSHBUTTON "Save As...",IDC_SAVE,175,225,44,15 +END + +IDD_PORTS DIALOGEX 0, 0, 300, 238 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Parallel Port",IDC_SERPARFRAME,5,2,291,68 + RTEXT "Printer:",IDC_STATIC,12,15,25,15,SS_CENTERIMAGE + COMBOBOX IDC_PRINTERLIST,49,15,153,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,220,14,58,12 + CONTROL "PostScript detection",IDC_PSPRINTERDETECT,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,11,33,79,12 + CONTROL "PostScript printer emulation",IDC_PSPRINTER,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,95,33,110,12 + RTEXT "Autoflush [] Time in seconds after a pending print job is automatically flushed.",IDC_PRINTERAUTOFLUSHTXT,202,32,57,15,SS_NOTIFY | SS_CENTERIMAGE + EDITTEXT IDC_PRINTERAUTOFLUSH,263,33,25,12,ES_NUMBER + RTEXT "Ghostscript extra parameters:",IDC_STATIC,12,49,102,15,SS_CENTERIMAGE + EDITTEXT IDC_PS_PARAMS,124,50,165,12,ES_AUTOHSCROLL + GROUPBOX "Serial Port",IDC_SERIALFRAME,4,72,292,48 + COMBOBOX IDC_SERIAL,49,84,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,11,102,48,13 + CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,65,102,55,12 + GROUPBOX "MIDI",IDC_MIDIFRAME,4,123,292,33 + RTEXT "Out:",IDC_MIDI,10,134,34,15,SS_CENTERIMAGE + COMBOBOX IDC_MIDIOUTLIST,50,134,95,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "In:",IDC_MIDI2,150,134,29,15,SS_CENTERIMAGE + COMBOBOX IDC_MIDIINLIST,185,134,95,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Mouse/Joystick Ports",IDC_PORT0,4,158,292,75 + COMBOBOX IDC_PORT0_JOYS,45,174,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_PORT1_JOYS,45,195,241,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Swap ports",IDC_SWAP,211,214,75,14 + RTEXT "Port 0:",IDC_STATIC,11,173,25,15,SS_CENTERIMAGE + RTEXT "Port 1:",IDC_STATIC,11,194,25,15,SS_CENTERIMAGE + LTEXT "X-Arcade layout information []#1",IDC_STATIC,16,213,106,15,SS_NOTIFY | SS_CENTERIMAGE + CONTROL "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT, + "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,132,103,65,12 + CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,207,103,78,13 +END + +IDD_CONTRIBUTORS DIALOGEX 0, 0, 411, 242 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION +CAPTION "UAE Authors and Contributors..." +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "Ok",ID_OK,177,219,53,14 + CONTROL "",IDC_CONTRIBUTORS,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_RAGGEDRIGHT | TCS_OWNERDRAWFIXED | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,4,5,404,206 +END + +IDD_ABOUT DIALOGEX 0, 0, 300, 191 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + CONTROL "",IDC_RICHEDIT1,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,45,10,210,15 + CONTROL "",IDC_RICHEDIT2,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,30,260,13 + PUSHBUTTON "Contributors",IDC_CONTRIBUTORS,110,55,80,15 + CONTROL "",IDC_UAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,120,80,15 + CONTROL "",IDC_PICASSOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,90,80,20 + CONTROL "",IDC_AMIGAHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,109,90,80,20 + CONTROL "",IDC_WINUAEHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,120,80,15 + CONTROL "",IDC_AIABHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,110,120,80,15 + CONTROL "",IDC_THEROOTS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,145,80,15 + CONTROL "",IDC_CAPS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,200,145,80,15 + CONTROL "",IDC_ABIME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,110,145,80,15 + CONTROL "",IDC_CLOANTOHOME,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,20,90,80,20 + CONTROL "",IDC_AMIGASYS,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,63,169,80,15 + CONTROL "",IDC_AMIKIT,"RICHEDIT",TCS_SCROLLOPPOSITE | TCS_RAGGEDRIGHT | TCS_MULTISELECT | WS_DISABLED,157,169,80,15 +END + +IDD_MISC1 DIALOGEX 0, 0, 300, 237 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Advanced",IDC_STATIC,8,2,285,110 + CONTROL "Untrap mouse with middle button",IDC_JULIAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,15,129,10 + CONTROL "Show GUI on startup",IDC_SHOWGUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,27,120,10 + CONTROL "On-screen LEDs",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,40,115,10 + CONTROL "uaescsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,53,117,10 + CONTROL "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,66,117,10 + CONTROL "bsdsocket.library emulation",IDC_SOCKETS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,15,120,10 + CONTROL "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,27,120,10 + CONTROL "Don't use RGB overlays",IDC_NOOVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,40,120,10 + CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,66,115,10 + GROUPBOX "Keyboard LEDs",IDC_STATIC,7,140,85,94 + COMBOBOX IDC_KBLED1,22,154,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_KBLED2,22,173,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_KBLED3,22,193,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Logging",IDC_STATIC,97,140,195,25 + CONTROL "Create log file",IDC_CREATELOGFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,107,151,72,10 + CONTROL "Illegal memory accesses",IDC_ILLEGAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,151,95,10 + GROUPBOX "State Files",IDC_STATIC,98,165,195,69 + PUSHBUTTON "Load state...",IDC_DOLOADSTATE,105,182,49,14 + PUSHBUTTON "Save state...",IDC_DOSAVESTATE,105,208,49,14 + CONTROL "Enable state recording",IDC_STATE_CAPTURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,181,88,10 + RTEXT "Recording rate (seconds):",IDC_STATIC,157,199,86,10,SS_CENTERIMAGE | WS_TABSTOP + COMBOBOX IDC_STATE_RATE,248,197,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + RTEXT "Recording buffer (MB):",IDC_STATIC,157,219,83,10,SS_CENTERIMAGE | WS_TABSTOP + COMBOBOX IDC_STATE_BUFFERSIZE,248,217,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Always on top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,79,117,10 + CONTROL "Catweasel",IDC_CATWEASEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,79,115,10 + CONTROL "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,216,64,10 + COMBOBOX IDC_SCSIMODE,161,51,104,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_LANGUAGE,103,121,179,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Language",IDC_STATIC,7,112,285,25 + CONTROL "Disable powersaving features",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,120,10 + CONTROL "Magic Mouse",IDC_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,92,119,10 +END + +IDD_HARDFILE DIALOGEX 0, 0, 299, 212 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Hardfile Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "Settings",IDC_STATIC,10,5,280,113 + RTEXT "Path:",IDC_HARDFILE_DIR_TEXT,26,18,22,10 + EDITTEXT IDC_PATH_NAME,52,15,213,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_SELECTOR,271,15,11,15 + RTEXT "FileSys:",IDC_HARDFILE_FILESYS_TEXT,14,37,34,10 + EDITTEXT IDC_PATH_FILESYS,52,34,213,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_FILESYS_SELECTOR,271,34,11,15 + RTEXT "Device:",IDC_HARDFILE_DEVICE_TEXT,17,58,31,10 + EDITTEXT IDC_HARDFILE_DEVICE,52,54,40,15,ES_AUTOHSCROLL + RTEXT "Boot priority:",IDC_HARDFILE_BOOTPRI_TEXT,24,79,44,8 + EDITTEXT IDC_HARDFILE_BOOTPRI,74,75,40,15 + CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,57,50,10 + PUSHBUTTON "Enable RDB mode",IDC_HDF_RDB,192,55,92,14 + RTEXT "Surfaces:",IDC_SURFACES_TEXT,120,79,30,10 + EDITTEXT IDC_HEADS,155,75,35,15,ES_NUMBER + RTEXT "Reserved:",IDC_RESERVED_TEXT,197,79,35,10 + EDITTEXT IDC_RESERVED,237,75,35,15,ES_NUMBER + RTEXT "Sectors:",IDC_SECTORS_TEXT,120,101,30,10 + EDITTEXT IDC_SECTORS,155,96,35,15,ES_NUMBER + RTEXT "Block size:",IDC_BLOCKSIZE_TEXT,197,101,35,10 + EDITTEXT IDC_BLOCKSIZE,237,96,35,15,ES_NUMBER + GROUPBOX "New hard disk image file",IDC_STATIC,10,120,280,62 + PUSHBUTTON "Create",IDC_HF_CREATE,50,135,80,14 + EDITTEXT IDC_HF_SIZE,146,135,61,15,ES_NUMBER + PUSHBUTTON "OK",IDOK,102,191,50,14 + PUSHBUTTON "Cancel",IDCANCEL,158,191,50,14 + EDITTEXT IDC_HF_DOSTYPE,146,158,61,15 + COMBOBOX IDC_HDF_CONTROLLER,73,97,41,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + RTEXT "DOS type",IDC_STATIC,214,160,32,10,SS_CENTERIMAGE + RTEXT "MB",IDC_STATIC,214,138,13,10,SS_CENTERIMAGE + RTEXT "Type:",IDC_STATIC,18,160,25,10,SS_CENTERIMAGE + RTEXT "HD Controller:",IDC_STATIC,13,98,52,10,SS_CENTERIMAGE +END + +IDD_FILESYS DIALOGEX 15, 25, 299, 111 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Volume Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + LTEXT "Device name:",-1,5,9,54,10 + EDITTEXT IDC_VOLUME_DEVICE,65,5,104,15,ES_AUTOHSCROLL + LTEXT "Volume label:",-1,5,31,54,10 + EDITTEXT IDC_VOLUME_NAME,65,25,103,15,ES_AUTOHSCROLL + LTEXT "Path:",-1,5,51,44,10 + EDITTEXT IDC_PATH_NAME,65,46,227,15,ES_AUTOHSCROLL + PUSHBUTTON "Select Directory",IDC_FS_SELECT_DIR,64,66,103,15 + CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,215,9,75,10 + RTEXT "Boot priority:",IDC_VOLUME_BOOTPRI_TEXT,178,29,59,8 + EDITTEXT IDC_VOLUME_BOOTPRI,261,27,30,15 + PUSHBUTTON "OK",IDOK,65,91,48,15 + PUSHBUTTON "Cancel",IDCANCEL,120,91,48,15 + PUSHBUTTON "Select Archive or Plain File",IDC_FS_SELECT_FILE,189,66,103,15 + PUSHBUTTON "Eject",IDC_FS_SELECT_EJECT,230,91,62,15 +END + +IDD_SETINFO DIALOGEX 0, 0, 229, 85 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Additional Information Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + RTEXT "Path:",-1,5,20,24,15,SS_CENTERIMAGE + EDITTEXT IDC_PATH_NAME,35,20,169,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_SELECTOR,210,20,10,15 + PUSHBUTTON "OK",IDOK,120,65,48,15 + PUSHBUTTON "Cancel",IDCANCEL,175,65,48,15 +END + +IDD_CHIPSET DIALOGEX 0, 65490, 300, 229 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "Chipset",IDC_STATIC,14,11,145,90 + CONTROL "OCS [] Original chipset. A1000 and most A500s.",IDC_OCS, + "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,26,51,10 + CONTROL "ECS Agnus [] Enhanced chipset (ECS Agnus chip only). Later A500 and A2000 hardware revisions.",IDC_ECS_AGNUS, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,42,55,10 + CONTROL "Full ECS [] Full ECS chipset (ECS Agnus and ECS Denise chips). A500+, A600 and A3000.",IDC_ECS, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,58,52,10 + CONTROL "AGA [] Advanced Graphics Architecture chipset. A1200, A4000 and CD32.",IDC_AGA, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,26,51,10 + CONTROL "NTSC [] North American and Japanese display standard, 60Hz refresh rate. Other countries use PAL (50Hz. display refresh rate)",IDC_NTSC, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,58,50,10 + GROUPBOX "Options",IDC_STATIC,168,11,114,89 + CONTROL "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,30,96,10 + CONTROL "Cycle-exact [] The most compatible A500 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,43,100,10 + GROUPBOX "Collision Level",IDC_STATIC,14,105,267,48 + CONTROL "None [] Collision hardware emulation disabled.",IDC_COLLISION0, + "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,40,121,59,10 + CONTROL "Sprites only [] Emulate only sprite vs. sprite collisions.",IDC_COLLISION1, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,137,62,10 + CONTROL "Sprites and Sprites vs. Playfield [] Recommended collision emulation level.",IDC_COLLISION2, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,109,121,161,10 + CONTROL "Full [] 100% collision hardware emulation. Only very few games need this option. Slowest.",IDC_COLLISION3, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,109,137,119,10 + GROUPBOX "Sound Emulation",IDC_STATIC,13,159,268,65 + CONTROL "Disabled",IDC_CS_SOUND0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,39,175,102,10 + CONTROL "Emulated",IDC_CS_SOUND1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,190,91,10 + CONTROL "Emulated, 100% accurate",IDC_CS_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,39,205,95,10 + CONTROL "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,56,100,10 + CONTROL "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,174,68,100,10 + COMBOBOX IDC_CS_EXT,101,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE +END + +IDD_CHIPSET2 DIALOGEX 0, 65490, 300, 247 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "Advanced Chipset Options",IDC_STATIC,7,6,287,239 + GROUPBOX "Battery Backed Up Real Time Clock",IDC_STATIC,14,37,275,29 + CONTROL "None",IDC_CS_RTC1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,22,49,55,10 + CONTROL "MSM6242B",IDC_CS_RTC2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,91,49,52,10 + CONTROL "RF5C01A",IDC_CS_RTC3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,160,49,46,10 + EDITTEXT IDC_CS_RTCADJUST,218,47,64,13,ES_AUTOHSCROLL + GROUPBOX "CIA-A TOD Clock Source",IDC_STATIC,12,69,275,29 + CONTROL "Vertical Sync",IDC_CS_CIAA_TOD1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,25,81,63,10 + CONTROL "Power Supply 50Hz",IDC_CS_CIAA_TOD2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,95,81,85,10 + CONTROL "Power Supply 60Hz",IDC_CS_CIAA_TOD3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,192,81,88,10 + CONTROL "Boot ROM Mirror",IDC_CS_KSMIRROR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,108,80,10 + CONTROL "A1000 Boot RAM/ROM",IDC_CS_A1000RAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,108,88,10 + CONTROL "CD32 CD",IDC_CS_CD32CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,121,76,10 + CONTROL "CD32 C2P",IDC_CS_CD32C2P,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,121,87,10 + CONTROL "CD32 NVRAM",IDC_CS_CD32NVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,121,84,10 + CONTROL "CDTV CD",IDC_CS_CDTVCD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,134,47,10 + CONTROL "CDTV SRAM",IDC_CS_CDTVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,133,87,10 + CONTROL "CDTV SRAM Expansion",IDC_CS_CDTVRAMEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,133,90,10 + CONTROL "A600/A1200 IDE",IDC_CS_IDE1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,146,79,10 + CONTROL "A4000/A4000T IDE",IDC_CS_IDE2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,146,88,10 + CONTROL "Ramsey revision:",IDC_CS_RAMSEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,211,71,10 + EDITTEXT IDC_CS_RAMSEYREV,94,209,45,13,ES_AUTOHSCROLL + CONTROL "Fat Gary revision:",IDC_CS_FATGARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,224,71,10 + EDITTEXT IDC_CS_FATGARYREV,94,223,45,13,ES_AUTOHSCROLL + CONTROL "A3000 SCSI",IDC_CS_DMAC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,175,76,10 + CONTROL "Compatible Settings",IDC_CS_COMPATIBLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,21,234,10 + CONTROL "DF0: ID Hardware",IDC_CS_DF0IDHW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,108,92,10 + CONTROL "Agnus/Alice revision:",IDC_CS_AGNUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,211,81,10 + EDITTEXT IDC_CS_AGNUSREV,235,209,45,13,ES_AUTOHSCROLL + CONTROL "Denise/Lisa revision:",IDC_CS_DENISE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,227,81,10 + EDITTEXT IDC_CS_DENISEREV,235,226,45,13,ES_AUTOHSCROLL + CONTROL "A590/A2091 SCSI",IDC_CS_A2091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,175,76,10 + CONTROL "A4000T SCSI",IDC_CS_DMAC2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,175,88,10 + LTEXT "A4091/A4000T SCSI not yet implemented.",IDC_STATIC,25,161,224,8,SS_CENTERIMAGE + CONTROL "PCMCIA",IDC_CS_PCMCIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,146,92,10 + CONTROL "A4091 SCSI",IDC_CS_A4091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,187,76,10 + CONTROL "CDTV SCSI",IDC_CS_CDTVSCSI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,187,76,10 + CONTROL "Include host SCSI devices",IDC_CS_SCSIMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,187,101,10 +END + +IDD_AVIOUTPUT DIALOGEX 0, 0, 288, 203 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Output Properties",IDC_STATIC,5,8,274,118 + EDITTEXT IDC_AVIOUTPUT_FILETEXT,15,21,226,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_CLIENTEDGE + PUSHBUTTON "...",IDC_AVIOUTPUT_FILE,249,20,19,12 + CONTROL "Audio",IDC_AVIOUTPUT_AUDIO,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_TABSTOP,15,36,39,11 + CONTROL "",IDC_AVIOUTPUT_AUDIO_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,59,36,209,11 + CONTROL "Video",IDC_AVIOUTPUT_VIDEO,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_TABSTOP,15,50,39,11 + CONTROL "",IDC_AVIOUTPUT_VIDEO_STATIC,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,59,50,209,11 + CONTROL "Disable frame rate limit while recording",IDC_AVIOUTPUT_FRAMELIMITER, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,68,158,10 + CONTROL "AVI output enabled",IDC_AVIOUTPUT_ACTIVATED,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,15,103,108,14 + CONTROL "PAL",IDC_AVIOUTPUT_PAL,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,133,103,66,14 + CONTROL "NTSC",IDC_AVIOUTPUT_NTSC,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,204,103,66,14 + CONTROL "Slider1",IDC_AVIOUTPUT_FPS,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_ENABLESELRANGE | WS_TABSTOP,166,84,87,11 + LTEXT "fps",IDC_AVIOUTPUT_FPS_STATIC,255,84,19,8 + PUSHBUTTON "Save screenshot",IDC_SCREENSHOT,16,141,76,14 + GROUPBOX "Ripper",IDC_STATIC,5,127,274,38 + PUSHBUTTON "Pro Wizard 1.62",IDC_PROWIZARD,100,141,76,14,WS_DISABLED + CONTROL "Sample ripper",IDC_SAMPLERIPPER_ACTIVATED,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,192,141,77,14 + GROUPBOX "Input Recorder",IDC_STATIC,5,166,274,33 + CONTROL "Record",IDC_INPREC_RECORD,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,191,177,77,14 + CONTROL "Playback",IDC_INPREC_PLAY,"Button",BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,16,178,77,14 + CONTROL "Alt. playback mode",IDC_INPREC_PLAYMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,103,180,78,10 + CONTROL "Disable sound output while recording",IDC_AVIOUTPUT_NOSOUNDOUTPUT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,85,148,10 +END + +IDD_INPUT DIALOGEX 0, 0, 300, 242 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_INPUTTYPE,5,5,98,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_INPUTDEVICE,109,5,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_INPUTDEVICEDISABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,282,8,9,8 + CONTROL "List1",IDC_INPUTLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,22,290,146 + COMBOBOX IDC_INPUTAMIGACNT,5,174,24,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_INPUTAMIGA,33,174,262,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + RTEXT "Joystick dead zone (%):",-1,7,196,79,10,SS_CENTERIMAGE + EDITTEXT IDC_INPUTDEADZONE,92,195,25,12,ES_NUMBER + RTEXT "Autofire rate (frames):",-1,10,212,76,10,SS_CENTERIMAGE + EDITTEXT IDC_INPUTAUTOFIRERATE,92,210,25,12,ES_NUMBER + RTEXT "Digital joy-mouse speed:",-1,124,196,84,10,SS_CENTERIMAGE + EDITTEXT IDC_INPUTSPEEDD,215,195,25,12,ES_NUMBER + RTEXT "Analog joy-mouse speed:",-1,120,212,88,10,SS_CENTERIMAGE + EDITTEXT IDC_INPUTSPEEDA,215,211,25,12,ES_NUMBER + RTEXT "Mouse speed:",-1,132,228,76,10,SS_CENTERIMAGE + EDITTEXT IDC_INPUTSPEEDM,215,227,25,12,ES_NUMBER + PUSHBUTTON "Copy from:",IDC_INPUTCOPY,249,195,45,14 + COMBOBOX IDC_INPUTCOPYFROM,249,211,45,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Swap 1<>2",IDC_INPUTSWAP,249,226,45,14 +END + +IDD_FILTER DIALOGEX 0, 0, 296, 224 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Filter Settings",-1,0,0,294,186 + CONTROL "Enable",IDC_FILTERENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,17,46,10 + COMBOBOX IDC_FILTERMODE,62,15,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_FILTERFILTER,128,15,81,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Reset to defaults",IDC_FILTERDEFAULT,213,15,73,14 + RTEXT "Horiz. size:",-1,4,44,54,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,37,152,19 + EDITTEXT IDC_FILTERHZV,253,40,34,12,ES_CENTER | ES_READONLY + RTEXT "Vert. size:",-1,5,64,54,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,57,152,19 + EDITTEXT IDC_FILTERVZV,253,59,34,12,ES_CENTER | ES_READONLY + RTEXT "Horiz. position:",-1,5,84,55,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,77,151,19 + EDITTEXT IDC_FILTERHOV,253,79,34,12,ES_CENTER | ES_READONLY + RTEXT "Vert. position:",-1,5,103,55,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,99,151,19 + EDITTEXT IDC_FILTERVOV,253,101,34,12,ES_CENTER | ES_READONLY + RTEXT "Extra settings:",-1,27,133,57,10,SS_CENTERIMAGE + CONTROL "Slider1",IDC_FILTERXL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,157,151,19 + EDITTEXT IDC_FILTERXLV,253,159,34,12,ES_CENTER | ES_READONLY + COMBOBOX IDC_FILTERSLR,253,130,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Presets",-1,0,187,296,36 + COMBOBOX IDC_FILTERPRESETS,8,201,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,200,47,14 + PUSHBUTTON "Save",IDC_FILTERPRESETSAVE,184,200,47,14 + PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,200,47,14 + COMBOBOX IDC_FILTERHZMULT,67,43,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_FILTERVZMULT,67,63,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,26,168,63,10 + COMBOBOX IDC_FILTERXTRA,105,130,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP +END + +IDD_HARDDRIVE DIALOGEX 0, 0, 380, 66 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Harddrive Settings" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + LTEXT "Hard drive:",-1,7,11,35,10 + COMBOBOX IDC_HARDDRIVE,49,9,325,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Read/write",IDC_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,247,33,55,10 + DEFPUSHBUTTON "Add hard drive",IDOK,173,30,65,14 + PUSHBUTTON "Cancel",IDCANCEL,321,30,54,14 + DEFPUSHBUTTON "Create hard disk image file",IDC_HARDDRIVE_IMAGE,49,30,115,14 + EDITTEXT IDC_PATH_NAME,89,49,169,15,ES_AUTOHSCROLL | NOT WS_VISIBLE +END + +IDD_MISC2 DIALOGEX 0, 0, 300, 92 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "When Active",IDC_STATIC,8,7,88,73 + RTEXT "Run at priority:",IDC_ACTIVE_PRI,14,17,52,10,SS_CENTERIMAGE | WS_TABSTOP + COMBOBOX IDC_ACTIVE_PRIORITY,14,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "When Inactive",IDC_STATIC,102,7,92,73 + RTEXT "Run at priority:",IDC_INACTIVE_PRI,109,17,51,10,SS_CENTERIMAGE | WS_TABSTOP + COMBOBOX IDC_INACTIVE_PRIORITY,109,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,50,69,10 + CONTROL "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,63,79,10 + GROUPBOX "When Minimized",IDC_STATIC,199,7,92,73 + RTEXT "Run at priority:",IDC_MINIMIZED_PRI,207,18,51,10,SS_CENTERIMAGE | WS_TABSTOP + COMBOBOX IDC_MINIMIZED_PRIORITY,207,30,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,50,69,10 + CONTROL "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,63,79,10 +END + +IDD_DISK DIALOGEX 0, 0, 300, 242 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_CONTROL | DS_CENTER | DS_CENTERMOUSE | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + CONTROL "",IDC_DISKLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,6,292,196 + PUSHBUTTON "Remove floppy disk image",IDC_DISKLISTREMOVE,149,223,101,15 + COMBOBOX IDC_DISKTEXT,3,205,293,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Insert floppy disk image",IDC_DISKLISTINSERT,34,223,101,15 +END + +IDD_PANEL DIALOGEX 0, 0, 420, 278 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT +CAPTION "WinUAE Properties" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + GROUPBOX "",IDC_PANEL_FRAME,112,4,303,247,NOT WS_VISIBLE + CONTROL "",IDC_PANELTREE,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_NOSCROLL | WS_BORDER | WS_TABSTOP,5,5,101,248,WS_EX_CLIENTEDGE + GROUPBOX "",IDC_PANEL_FRAME_OUTER,110,2,307,251 + PUSHBUTTON "Reset",IDC_RESETAMIGA,6,259,47,14 + PUSHBUTTON "Quit",IDC_QUITEMU,57,259,47,14 + DEFPUSHBUTTON "OK",IDOK,260,259,50,14 + PUSHBUTTON "Cancel",IDCANCEL,313,259,50,14 + PUSHBUTTON "Help",IDHELP,366,259,50,14,WS_DISABLED +END + +IDD_PATHS DIALOGEX 0, 0, 300, 237 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + LTEXT "System ROMs:",IDC_PATHS_ROML,14,9,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_ROM,14,22,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_ROMS,281,22,11,15 + LTEXT "Configuration files:",IDC_PATHS_CONFIGL,14,40,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_CONFIG,14,52,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_CONFIGS,281,52,11,15 + LTEXT "Screenshots:",IDC_PATHS_SCREENSHOTL,14,71,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_SCREENSHOT,14,83,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_SCREENSHOTS,281,83,11,15 + LTEXT "State files:",IDC_PATHS_STATEFILEL,14,102,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_SAVESTATE,14,114,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_SAVESTATES,281,114,11,15 + LTEXT "Videos:",IDC_PATHS_AVIOUTPUTL,14,132,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_AVIOUTPUT,14,144,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_AVIOUTPUTS,282,144,11,15 + LTEXT "Saveimages:",IDC_PATHS_SAVEIMAGEL,14,163,260,8,SS_CENTERIMAGE + EDITTEXT IDC_PATHS_SAVEIMAGE,14,175,261,15,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_PATHS_SAVEIMAGES,281,175,11,15 + PUSHBUTTON "Reset to defaults",IDC_PATHS_DEFAULT,14,199,92,14 + PUSHBUTTON "Rescan ROMs",IDC_ROM_RESCAN,14,218,92,14 + PUSHBUTTON "Clear registry",IDC_RESETREGISTRY,112,218,77,14 + COMBOBOX IDC_PATHS_DEFAULTTYPE,112,199,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Clear disk history",IDC_RESETDISKHISTORY,198,218,77,14 +END + +IDD_QUICKSTART DIALOGEX 0, 0, 300, 242 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + GROUPBOX "Emulated Hardware",IDC_QUICKSTART_CONFIG,3,0,294,54 + RTEXT "Model:",IDC_STATIC,5,14,50,10,SS_CENTERIMAGE + COMBOBOX IDC_QUICKSTART_MODEL,59,12,233,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Configuration:",IDC_STATIC,5,33,50,10,SS_CENTERIMAGE + COMBOBOX IDC_QUICKSTART_CONFIGURATION,59,31,233,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Compatibility vs Required CPU Power ",IDC_QUICKSTART_COMPA,3,56,294,33 + RTEXT "Best compatibility",IDC_STATIC,13,70,67,10,SS_CENTERIMAGE + CONTROL "",IDC_QUICKSTART_COMPATIBILITY,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,65,115,21 + RTEXT "Low compatibility",IDC_STATIC,215,70,63,10,SS_CENTERIMAGE + GROUPBOX "Host Configuration",IDC_QUICKSTART_HOST,3,91,294,33 + RTEXT "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE + COMBOBOX IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Emulated Floppy Drives",IDC_QUICKSTART_DF,3,126,294,84 + CONTROL "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,136,72,15 + PUSHBUTTON "Select disk image",IDC_DF0QQ,85,136,98,15 + RTEXT "Write-protected",IDC_STATIC,185,139,56,10,SS_CENTERIMAGE + CONTROL "",IDC_DF0WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,137,10,15 + PUSHBUTTON "Eject",IDC_EJECT0Q,261,136,30,15 + COMBOBOX IDC_DF0TEXTQ,9,154,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + CONTROL "Floppy drive DF1:",IDC_DF1QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,172,71,15 + PUSHBUTTON "Select disk image",IDC_DF1QQ,85,172,98,15 + RTEXT "Write-protected",IDC_STATIC,185,175,55,10,SS_CENTERIMAGE + CONTROL "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,173,10,15 + PUSHBUTTON "Eject",IDC_EJECT1Q,261,172,30,15 + COMBOBOX IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Set configuration",IDC_QUICKSTART_SETCONFIG,9,219,72,15,NOT WS_VISIBLE + GROUPBOX "Mode",IDC_STATIC,190,211,107,27,BS_LEFT + CONTROL "Start in Quickstart mode",IDC_QUICKSTARTMODE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,197,222,94,10 +END + +IDD_FRONTEND DIALOGEX 0, 0, 420, 242 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_FE_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,6,9,235,124 + GROUPBOX "",IDC_FE_INFO,249,140,160,95 + GROUPBOX "",IDC_FE_SCREENSHOT,249,7,160,128 +END + +IDD_PROGRESSBAR DIALOGEX 0, 0, 229, 58 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Processing..." +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,88,40,50,14 + CONTROL "",IDC_PROGRESSBAR,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,19,215,14 + CTEXT "x",IDC_PROGRESSBAR_TEXT,23,5,187,10,SS_CENTERIMAGE | WS_TABSTOP +END + +IDD_STRINGBOX DIALOGEX 0, 0, 229, 58 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Enter text..." +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,48,39,50,14 + PUSHBUTTON "Cancel",IDCANCEL,151,39,50,14 + EDITTEXT IDC_STRINGBOXEDIT,7,17,214,14,ES_AUTOHSCROLL | ES_WANTRETURN + CTEXT "Custom input event",IDC_STRINGBOX_TEXT,23,5,187,10,SS_CENTERIMAGE | WS_TABSTOP +END + +IDD_DEBUGGER DIALOGEX 0, 0, 454, 368 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_THICKFRAME +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "WinUAE Debugger" +FONT 8, "Courier New", 0, 0, 0x0 +BEGIN + EDITTEXT IDC_DBG_OUTPUT1,1,79,370,262,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_DBG_OUTPUT2,1,79,370,262,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL | NOT WS_TABSTOP + LISTBOX IDC_DBG_MEM,1,92,370,249,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_DASM,1,92,370,249,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + EDITTEXT IDC_DBG_MEMINPUT,1,79,36,12,ES_AUTOHSCROLL | ES_WANTRETURN + EDITTEXT IDC_DBG_INPUT,1,342,354,12,ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "?",IDC_DBG_HELP,356,342,15,12,NOT WS_TABSTOP + PUSHBUTTON "Set to PC",IDC_DBG_MEMTOPC,38,79,45,12,NOT WS_TABSTOP + LISTBOX IDC_DBG_DREG,1,1,52,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_AREG,54,1,52,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_AMEM,106,1,231,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_CCR,338,1,57,42,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_SP_VBR,338,44,115,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_MMISC,396,1,57,42,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_PC,1,68,52,10,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_PREFETCH,54,68,283,10,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_FPREG,372,218,81,66,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_FPSR,372,285,81,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_MISCCPU,372,320,81,34,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + CONTROL "",IDC_DBG_STATUS,"msctls_statusbar32",0x103,0,355,453,12 + LISTBOX IDC_DBG_BRKPTS,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_DBG_MCUSTOM,372,79,81,138,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DBG_MISC,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_DBG_CUSTOM,1,79,370,262,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APPICON ICON "winuae.ico" +IDI_FLOPPY ICON "35floppy.ico" +IDI_ABOUT ICON "amigainfo.ico" +IDI_HARDDISK ICON "Drive.ico" +IDI_CPU ICON "cpu.ico" +IDI_PORTS ICON "joystick.ico" +IDI_INPUT ICON "joystick.ico" +IDI_MISC1 ICON "misc.ico" +IDI_MISC2 ICON "misc.ico" +IDI_MOVE_UP ICON "move_up.ico" +IDI_MOVE_DOWN ICON "move_dow.ico" +IDI_AVIOUTPUT ICON "avioutput.ico" +IDI_DISK ICON "Drive.ico" +IDI_CONFIGFILE ICON "file.ico" +IDI_FOLDER ICON "folder.ico" +IDI_SOUND ICON "sound.ico" +IDI_DISPLAY ICON "screen.ico" +IDI_ROOT ICON "root.ico" +IDI_MEMORY ICON "chip.ico" +IDI_QUICKSTART ICON "quickstart.ico" +IDI_PATHS ICON "paths.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,4,4,0 + PRODUCTVERSION 1,4,4,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "WinUAE" + VALUE "FileVersion", "1.4.4" + VALUE "InternalName", "WinUAE" + VALUE "LegalCopyright", "© 1996-2007 under the GNU Public License (GPL)" + VALUE "OriginalFilename", "WinUAE.exe" + VALUE "ProductName", "WinUAE" + VALUE "ProductVersion", "1.4.4" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_MYHAND CURSOR "H_arrow.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDM_SYSTRAY MENU +BEGIN + POPUP "Menu" + BEGIN + MENUITEM "Configuration", ID_ST_CONFIGURATION + POPUP "Floppy drives" + BEGIN + MENUITEM "Eject all drives", ID_ST_EJECTALL + MENUITEM "DF0:", ID_ST_DF0 + MENUITEM "DF1:", ID_ST_DF1 + MENUITEM "DF2:", ID_ST_DF2 + MENUITEM "DF3:", ID_ST_DF3 + END + MENUITEM "Reset", ID_ST_RESET + MENUITEM "Help", ID_ST_HELP + MENUITEM "Quit WinUAE", ID_ST_QUIT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// WAVE +// + +IDR_DRIVE_STARTUP_A500_1 WAVE "drive_startup.wav" +IDR_DRIVE_CLICK_A500_1 WAVE "drive_click.wav" +IDR_DRIVE_SPIN_A500_1 WAVE "drive_spin.wav" +IDR_DRIVE_SNATCH_A500_1 WAVE "drive_snatch.wav" +IDR_DRIVE_SPINND_A500_1 WAVE "drive_spinnd.wav" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_XARCADE BITMAP "xarcade-winuae.bmp" +IDB_LCD160X43 BITMAP "lcd.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_KICKSTART "ROM" + IDS_DISK "Disk swapper" + IDS_DISPLAY "Display" + IDS_HARDDISK "Hard drives" + IDS_FLOPPY "Floppy drives" + IDS_ABOUT "About" + IDS_LOADSAVE "Configurations" + IDS_AVIOUTPUT "Output" + IDS_PORTS "Game & I/O ports" + IDS_MISC1 "Misc" + IDS_MEMORY "RAM" + IDS_CPU "CPU and FPU" + IDS_CHIPSET "Chipset" + IDS_INPUT "Input" + IDS_FILTER "Filter" +END + +STRINGTABLE +BEGIN + IDS_MISC2 "Priority" + IDS_PATHS "Paths" + IDS_QUICKSTART "Quickstart" + IDS_FRONTEND "Frontend" + IDS_CHIPSET2 "Adv. Chipset" +END + +STRINGTABLE +BEGIN + IDS_EXTTEXT "Floppy disk image files" + IDS_EXTACTUAL "ADF" + IDS_SOUND "Sound" + IDS_CDROM "CD-ROM" + IDS_FRAMERATE "Every %1Frame" + IDS_SECOND "second " + IDS_THIRD "third " + IDS_FOURTH "fourth " + IDS_FIFTH "fifth " + IDS_SIXTH "sixth " + IDS_SEVENTH "seventh " + IDS_EIGHTH "eighth " +END + +STRINGTABLE +BEGIN + IDS_NINTH "ninth " + IDS_TENTH "tenth " + IDS_SELECTADF "Select a floppy disk image file..." + IDS_ADF "Floppy disk image files" + IDS_CHOOSEBLANK "Choose a blank floppy disk image file..." + IDS_SELECTHDF "Select a hard disk image file..." + IDS_HDF "Hard disk image files" + IDS_SELECTUAE "Select a WinUAE configuration file..." + IDS_UAE "WinUAE configuration files" + IDS_SELECTROM "Select a system ROM file..." + IDS_ROM "System ROM files" + IDS_SELECTKEY "Select a system ROM key file..." + IDS_KEY "System ROM key files" + IDS_SELECTINFO "Select information for your configuration..." + IDS_NONE "none" + IDS_VOLUME "Volume" +END + +STRINGTABLE +BEGIN + IDS_SELECTFILESYSROOT "Please select the root directory of the file system..." + IDS_DEFAULTMIDIOUT "Default MIDI-Out Device" + IDS_CONTRIBUTORS1 "Bernd Schmidt - The Grand-Master\nSam Jordan - Custom-chip, floppy-DMA, etc.\nMathias Ortmann - Original WinUAE Main Guy, BSD Socket support\nBrian King - Picasso96 Support, Integrated GUI for WinUAE, previous WinUAE Main Guy\nToni Wilen - Core updates, WinUAE Main Guy\nGustavo Goedert/Peter Remmers/Michael Sontheimer/Tomi Hakala/Tim Gunn/Nemo Pohle - DOS Port Stuff\nSamuel Devulder/Olaf Barthel/Sam Jordan - Amiga Ports\nKrister Bergman - XFree86 and OS/2 Port\nA. Blanchard/Ernesto Corvi - MacOS Port\nChristian Bauer - BeOS Port\nIan Stephenson - NextStep Port\nPeter Teichmann - Acorn/RiscOS Port\nStefan Reinauer - ZorroII/III AutoConfig, Serial Support\nChristian Schmitt/Chris Hames - Serial Support\nHerman ten Brugge - 68020/68881 Emulation Code\nTauno Taipaleenmaki - Various UAE-Control/UAE-Library Support\nBrett Eden/Tim Gunn/Paolo Besser/Nemo Pohle - Various Docs and Web-Sites\nGeorg Veichtlbauer - Help File coordinator, German GUI\nFulvio Leonardi - Italian translator for WinUAE\n" + IDS_CONTRIBUTORS2 "Bill Panagouleas - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nPéter Tóth /Balázs Rátkai/Iván Herczeg/András Arató - Hungarian translation.\nKarsten Bock, Gavin Fance, Dirk Trowe and Christoph Meier - Freezer cartridge hardware support." + IDS_INVALIDPRTPORT "The printer you have in this configuration is not valid on this machine.\n" + IDS_RESTOREUSS "Restore a WinUAE snapshot file" + IDS_USS "WinUAE snapshot files" + IDS_WRONGOSVERSION "WinUAE is no longer supported on Windows NT. Please upgrade to either Windows 2000 or Windows XP or a later version." + IDS_SELECTFLASH "Select a flash or battery-backed RAM file..." + IDS_FLASH "WinUAE flash or battery-backed RAM file" + IDS_INPUTHOSTWIDGET "Input source" + IDS_INPUTAMIGAEVENT "Input target" + IDS_INPUTAUTOFIRE "Autofire" + IDS_SAVEUSS "Save a WinUAE snapshot file" + IDS_MIDIOVERFLOW "Sysexbuffer overflow. Should not happen. Please report this to\nberndroesch1@compuserve.de" +END + +STRINGTABLE +BEGIN + IDS_PATH "Path" + IDS_RW "R/W" + IDS_SECTORS "Sectors" + IDS_SURFACES "Bill Panagouleas - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nHungarian translation - Péter Tóth , Balázs Rátkai , Iván Herczeg , András Arató" + IDS_RESERVED "Reserved" + IDS_BLOCKSIZE "Block size" + IDS_NAME "Name" + IDS_DESCRIPTION "Description" + IDS_COULDNOTLOADCONFIG "Could not load the selected configuration!\n" + IDS_NOHELP "Online help is disabled because the HTML Help functionality is not installed on this system. HTML Help is available from http://www.microsoft.com/downloads/.\n" + IDS_MUSTSELECTCONFIG "You must select a configuration or enter a name before selecting Load...\n" + IDS_INVALIDCOMPORT "The serial port you have in this configuration is not valid on this machine.\n" +END + +STRINGTABLE +BEGIN + IDS_HFDSIZE "Size" + IDS_DEVICE "Device" + IDS_BOOTPRI "BootPri" + IDS_FLOPPY_COMPATIBLE " (compatible)" + IDS_FLOPPY_TURBO "Turbo" + IDS_YES "yes" + IDS_NO "no" + IDS_PRI_ABOVENORMAL "Above Normal" + IDS_PRI_NORMAL "Normal" + IDS_PRI_BELOWNORMAL "Below Normal" + IDS_PRI_LOW "Low" + IDS_OLDRTGLIBRARY "The installed LIBS:Picasso96/rtg.library (%d.%d) should be updated.\nA newer version is included in the ""Amiga Programs"" directory\n of the WinUAE distribution archive.\n\nNewer library version fixes graphics problems and increases performance." + IDS_DEFAULT_AF2005 "Amiga Forever 2005+" + IDS_DEFAULT_AF "Amiga Forever" + IDS_DEFAULT_WINUAE "WinUAE default (old)" +END + +STRINGTABLE +BEGIN + IDS_SOUND_STEREO2 "Cloned Stereo (4 Channels)" + IDS_INPUT_CUSTOMEVENT "" + IDS_DEFAULT_NEWWINUAE "WinUAE default (new)" +END + +STRINGTABLE +BEGIN + IDS_UNSUPPORTEDPIXELFORMAT + "Error: unsupported pixel format. Please use a different screen mode.\n" + IDS_MUSTENTERNAME "You must select a configuration or enter a name before selecting Save...\n" + IDS_MUSTSELECTCONFIGFORDELETE + "You must select a configuration or enter a name before selecting Delete...\n" + IDS_DELETECONFIGCONFIRMATION + "Are you sure you want to Delete this configuration?\n" + IDS_DELETECONFIGTITLE "Confirm Delete" + IDS_MUSTSELECTPATH "You must select a path!" + IDS_SETTINGSERROR "Settings error" + IDS_MUSTSELECTNAME "You must select a name for the volume!" + IDS_MUSTSELECTFILE "You must select a file!" + IDS_FAILEDHARDFILECREATION "Failed to create hard disk image file..." + IDS_CREATIONERROR "Creation error" + IDS_ERRORTITLE "WinUAE message" +END + +STRINGTABLE +BEGIN + IDS_INP "WinUAE Input Recording" + IDS_RESTOREINP "Playback a WinUAE input recording" + IDS_SAVEINP "Record a WinUAE input recording" + IDS_SCREEN_WINDOWED "Windowed" + IDS_SCREEN_FULLSCREEN "Fullscreen" + IDS_SCREEN_FULLWINDOW "Full-window" + IDS_SCREEN_VSYNC "VSync" + IDS_SOUND_MONO "Mono" + IDS_SOUND_MIXED "Mixed" + IDS_SOUND_STEREO "Stereo" + IDS_SOUND_INTERPOL_DISABLED "Disabled" + IDS_SOUND_FILTER_OFF "Always off" + IDS_SOUND_FILTER_EMULATED "Emulated (A500)" +END + +STRINGTABLE +BEGIN + IDS_SOUND_FILTER_EMULATED_E "Emulated (A1200)" + IDS_INPUT_COMPATIBILITY "Compatibility mode" + IDS_INPUT_CUSTOM "Configuration #%d" + IDS_INPUT_COPY_DEFAULT "Default" + IDS_INPUT_COPY_CUSTOM "Config #%d" + IDS_3D_NO_FILTER "Point (%d-bit)" + IDS_3D_BILINEAR "Bilinear (%d-bit)" + IDS_VSYNC_DEFAULT "Default" + IDS_DRIVESOUND_NONE "No sound" + IDS_DRIVESOUND_DEFAULT_A500 "A500 (WinUAE built-in)" + IDS_AVIOUTPUT_NOCODEC "no codec selected" + IDS_DISK_IMAGENAME "Disk image" + IDS_DISK_DRIVENAME "Drive" + IDS_AGA8BIT "AGA emulation requires a 16-bit or higher display depth.\nSwitching from 8-bit to 16-bit." + IDS_UNSUPPORTEDSCREENMODE + "The selected screen mode can't be displayed in a window, because %s\nSwitching to full-screen display." + IDS_UNSUPPORTEDSCREENMODE_1 + "the desktop is running in an unknown color mode." +END + +STRINGTABLE +BEGIN + IDS_UNSUPPORTEDSCREENMODE_2 + "the desktop is running in 8-bit color depth, which WinUAE can't use in windowed mode." + IDS_UNSUPPORTEDSCREENMODE_3 + "the desktop is too small for the specified window size." + IDS_UNSUPPORTEDSCREENMODE_4 + "you selected an RTG (Picasso96) display with a color depth different from that of the desktop and an overlay was unavailable." + IDS_FLOPPYTYPE35DD "3.5"" DD" + IDS_FLOPPYTYPE35HD "3.5"" HD" + IDS_FLOPPYTYPE525SD "5.25"" SD" + IDS_FLOPPYTYPEDISABLED "Disabled" + IDS_STMENUNOFLOPPY "No floppy disk inserted" + IDS_TREEVIEW_HARDWARE "Hardware" + IDS_TREEVIEW_HOST "Host" + IDS_TREEVIEW_MISC "Miscellaneous" + IDS_TREEVIEW_SETTINGS "Settings" + IDS_WINUAETITLE_MMB "[Mouse active - press ALT+TAB or middle mouse button to cancel]" + IDS_WINUAETITLE_NORMAL "[Mouse active - press ALT+TAB to cancel]" + IDS_STARTEMULATION "Start" + IDS_TREEVIEW_ABOUT "About" +END + +STRINGTABLE +BEGIN + IDS_NOHARDDRIVES "No hard disks detected that were either empty or RDB-partitioned." + IDS_DEFAULT_HOST "Default Configuration" + IDS_SOUND_4CHANNEL "4 Channels" + IDS_HF_FS_CUSTOM "Custom" + IDS_SELECTFS "Select file system handler (FastFileSystem, SmartFilesystem, etc.)" + IDS_KEYJOY "Keyboard Layout A (Numeric keypad, 0 and 5 = Fire)\nKeyboard Layout B (Cursor keys, Right CTRL and ALT = Fire)\nKeyboard Layout C (W=Up S=Down A=Left D=Right, Left ALT = Fire)\nX-Arcade (Left)\nX-Arcade (Right)" + IDS_STATEFILE_UNCOMPRESSED "Uncompressed" + IDS_STATEFILE_RAMDUMP "RAM dump" + IDS_STATEFILE_WAVE "Wave audio dump" + IDS_SOUND_SWAP_PAULA "Paula only" + IDS_SOUND_SWAP_AHI "AHI only" + IDS_SOUND_SWAP_BOTH "Both" + IDS_SOUND_FILTER_ON_AGA "Always on (A500)" + IDS_SOUND_FILTER_ON_A500 "Always on (A1200)" + IDS_DRIVESOUND_PC_FLOPPY "PC floppy drive %c" + IDS_FLOPPYTYPE35DDESCOM "3.5"" ESCOM" +END + +STRINGTABLE +BEGIN + IDS_NUMSG_NEEDEXT2 "The software uses a non-standard floppy disk format. You may need to use a custom floppy disk image file instead of a standard one. This message will not appear again." + IDS_NUMSG_NOROMKEY "Could not find system ROM key file." + IDS_NUMSG_KSROMCRCERROR "System ROM checksum incorrect. The system ROM image file may be corrupt." + IDS_NUMSG_KSROMREADERROR "Error while reading system ROM." +END + +STRINGTABLE +BEGIN + IDS_NUMSG_NOEXTROM "No extended ROM found." + IDS_NUMSG_MODRIP_NOTFOUND "No music modules or packed data found." + IDS_NUMSG_MODRIP_FINISHED "Scan finished." + IDS_NUMSG_MODRIP_SAVE "Module/packed data found\n%s\nStart address %08.8X, Size %d bytes\nWould you like to save it?" + IDS_NUMSG_KS68020 "The selected system ROM requires a 68020 with 32-bit addressing or 68030 or higher CPU." + IDS_NUMSG_ROMNEED "One of the following system ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." + IDS_NUMSG_STATEHD "WARNING: Current configuration is not fully compatible with state saves.\nThis message will not appear again." + IDS_NUMSG_NOCAPS "Selected disk image needs the SPS plugin\nwhich is available from\nhttp//www.softpres.org/" + IDS_NUMSG_OLDCAPS "You need an updated SPS plugin\nwhich is available from\nhttp//www.softpres.org/" + IDS_IMGCHK_BOOTBLOCKCRCERROR + "The selected floppy disk image is not bootable (boot block checksum error)" + IDS_IMGCHK_BOOTBLOCKNO "The selected floppy disk image is not bootable (no boot block)" + IDS_IMGCHK_DAMAGED "The selected floppy disk image is damaged or unformatted" + IDS_IMGCHK_KS2 "The selected floppy disk image requires a 2.04 or later system ROM.\nThe configuration has been updated." + IDS_IMGCHK_KS3 "The selected floppy disk image requires a 3.0 or later system ROM.\nThe configuration has been updated." + IDS_ROMSCANEND "Scan of ROMs finished" +END + +STRINGTABLE +BEGIN + IDS_ROM_AVAILABLE "available" + IDS_ROM_UNAVAILABLE "unavailable" + IDS_HARDDRIVESAFETYWARNING1 + "Warning: The drive safety check is active. Selected drive is not empty and non-RDB partitioned." + IDS_NUMSG_KS68EC020 "The selected system ROM requires a 68020 with 24-bit addressing or higher CPU." + IDS_ROMSCANNOROMS "No supported system ROMs detected." + IDS_NUMSG_KICKREP "You need to have a floppy disk (image file) in DF0: to use the system ROM replacement." + IDS_NUMSG_KICKREPNO "The floppy disk (image file) in DF0: is not compatible with the system ROM replacement functionality." + IDS_NUMSG_NOROM "Could not load system ROM, trying system ROM replacement." + IDS_HDCLONE_OK "Hard drive image file created succesfully." + IDS_HDCLONE_FAIL "Hard drive image file creation failed.\nError code %d:%d." + IDS_NUMSG_KS68030 "The selected system ROM requires a 68030 CPU." + IDS_NUMSG_EXPROMNEED "One of the following expansion boot ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs." + IDS_HARDDRIVESAFETYWARNING2 + "Warning: The drive safety check has been disabled, and non-empty and non-RDB partitioned hard disk(s) were detected." +END + +STRINGTABLE +BEGIN + IDS_QS_MODELS "A500\nA500+\nA600\nA1000\nA1200\nA3000\nCD32\nCDTV\nArcadia Multi Select system\nExpanded WinUAE example configuration" + IDS_QS_MODEL_A500 "1.3 ROM, OCS, 512 KB Chip + 512 KB Slow RAM (most common)\nThis configuration is capable of running most games and demos produced for first-generation hardware. Only few exceptions need a different configuration (e.g. the oldest games tend to be incompatible with this configuration).\n1.3 ROM, ECS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nLater hardware revision of the A500. Nearly 100% compatible with the previous configuration.\n1.3 ROM, ECS Agnus, 1 MB Chip RAM\nFew newer games and demos require this configuration.\n1.3 ROM, OCS Agnus, 512 KB Chip RAM\nVery old (e.g. pre-1988) games and demos may require this configuration.\n1.2 ROM, OCS Agnus, 512 KB Chip RAM\nAs available for the A1000, and installed on the first A500 and A2000 series. Some very old programs only work correctly with this configuration. Note: This system ROM version can only boot from floppy disk (no hard disk boot support).\n1.2 ROM, OCS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nThis configuration adds expansion memory to the first A500 produced. Try this if your game does not work with newer configurations, but works with the previous one. It could add some features to the game, including faster loading times. Note: This system ROM version can only boot from floppy disk (no hard disk boot support)." + IDS_QS_MODEL_A500P "Basic non-expanded configuration\nThe A500+ adds an ECS Agnus chip, 1 MB of Chip RAM and a 2.0 ROM to the A500. Many A500 games and demos don't work properly on an A500+.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" + IDS_QS_MODEL_A600 "Basic non-expanded configuration\nThe A600 is smaller than the A500+ and has an updated 2.0 ROM.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" + IDS_QS_MODEL_A1000 "512 KB Chip RAM\nThe A1000 was the first model produced, with a configuration equivalent to that of an A500 with OCS chipset. You normally don't need to use this configuration, unless you are nostalgic and would like to hear the short A1000 boot tune\n""ICS"" Denise without EHB support\nVery first A1000 models had Denise without EHB capability.\n256 KB Chip RAM\n Unexpanded A1000. All later A1000 models were sold with a 256 KB RAM expansion built-in." + IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4 MB Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run." + IDS_QS_MODEL_CD32 "CD32\nThe CD32 was one the first 32-bit consoles on the market. It is basically an A1200 with a built-in CD-ROM drive. Insert your CD32 or CDTV CD-ROM into a free CD-ROM drive before starting the emulation." + IDS_QS_MODEL_CDTV "CDTV\nThe CDTV was the first model with a built-in CD-ROM drive. Looking like a black CD player, it featured a configuration equivalent to that of an A500 with 1 MB RAM and an ECS chipset.\nFloppy drive and 64KB SRAM card expanded CDTV\n" +END + +STRINGTABLE +BEGIN + IDS_QS_MODEL_UAE "High-end expanded configuration" + IDS_QS_MODEL_ARCADIA "Arcadia\nArcadia Multi Select system is arcade platform developed by Arcadia and Mastertronic. It is based on an A500 mainboard with ROM cage attached to expansion port. Arcadia ROM files go to ""Cartridge ROM File"" in ROM-panel." + IDS_QS_MODEL_A3000 "1.4 ROM, 2MB Chip + 8MB Fast\n\n3.1 ROM, 2MB Chip + 8MB Fast\n" + IDS_QS_MODEL_A4000 "A4000 (test)\nA4000" + IDS_QS_MODEL_A4000T "A4000T (test)\nA4000T" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Finnish resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN) +#ifdef _WIN32 +LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.\0" +END + + +3 TEXTINCLUDE +BEGIN + "\r\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Finnish resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/od-win32/scaler.c b/od-win32/scaler.c index 007c63fd..ce4dd69a 100755 --- a/od-win32/scaler.c +++ b/od-win32/scaler.c @@ -54,7 +54,7 @@ int Init_2xSaI (int rb, int gb, int bb, int rs, int gs, int bs) } static _inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) -{ +{ const bool ac = (A==C); const bool bc = (B==C); const int x1 = ac; @@ -549,11 +549,11 @@ static void internal_scale2x_16_def(u16 *dst0, u16* dst1, const u16* src0, const } static void internal_scale2x_32_def(u32* dst0, - u32* dst1, - const u32* src0, - const u32* src1, - const u32* src2, - unsigned count) { + u32* dst1, + const u32* src0, + const u32* src1, + const u32* src2, + unsigned count) { /* first pixel */ dst0[0] = src1[0]; dst1[0] = src1[0]; @@ -618,187 +618,187 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* /* always do the first and last run */ count -= 2*4; -#ifdef __GNUC__ +#ifdef __GNUC__ __asm__ __volatile__( - /* first run */ - /* set the current, current_pre, current_next registers */ - "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ - "movq 0(%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - /* central runs */ - "shrl $2,%4\n" - "jz 1f\n" - ASM_JUMP_ALIGN - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - - /* final run */ - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - "emms\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); + /* first run */ + /* set the current, current_pre, current_next registers */ + "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ + "movq 0(%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + /* central runs */ + "shrl $2,%4\n" + "jz 1f\n" + ASM_JUMP_ALIGN + "0:\n" + + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + "decl %4\n" + "jnz 0b\n" + "1:\n" + + /* final run */ + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + "emms\n" + + : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) + : + : "cc" + ); #else __asm { mov eax, src0; @@ -806,7 +806,7 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* mov ecx, src2; mov edx, dst; mov esi, count; - + /* first run */ /* set the current, current_pre, current_next registers */ pxor mm0,mm0; /* use a fake black out of screen */ @@ -925,7 +925,7 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* add ebx,8; add ecx,8; add edx,16; - + dec esi; jnz label0; label1: @@ -998,185 +998,185 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* #ifdef __GNUC__ __asm__ __volatile__( - /* first run */ - /* set the current, current_pre, current_next registers */ - "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ - "movq 0(%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - /* central runs */ - "shrl $1,%4\n" - "jz 1f\n" - ASM_JUMP_ALIGN - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - - /* final run */ - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - "emms\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); + /* first run */ + /* set the current, current_pre, current_next registers */ + "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ + "movq 0(%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + /* central runs */ + "shrl $1,%4\n" + "jz 1f\n" + ASM_JUMP_ALIGN + "0:\n" + + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + "decl %4\n" + "jnz 0b\n" + "1:\n" + + /* final run */ + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + "emms\n" + + : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) + : + : "cc" + ); #else __asm { mov eax, src0; @@ -1184,7 +1184,7 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* mov ecx, src2; mov edx, dst; mov esi, count; - + /* first run */ /* set the current, current_pre, current_next registers */ pxor mm0,mm0; @@ -1246,7 +1246,7 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* shr esi,1; jz label1; label0: - + /* set the current, current_pre, current_next registers */ movq mm0,qword ptr [ebx-8]; movq mm7,qword ptr [ebx]; @@ -1306,7 +1306,7 @@ label0: dec esi; jnz label0; label1: - + /* final run */ /* set the current, current_pre, current_next registers */ movq mm0,qword ptr [ebx-8]; @@ -1383,11 +1383,11 @@ static void internal_scale2x_32_mmx(u32* dst0, u32* dst1, const u32* src0, const #endif void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height) + u8 *dstPtr, u32 dstPitch, int width, int height) { u16 *dst0 = (u16 *)dstPtr; u16 *dst1 = dst0 + (dstPitch/2); - + u16 *src0 = (u16 *)srcPtr; u16 *src1 = src0 + (srcPitch/2); u16 *src2 = src1 + (srcPitch/2); @@ -1395,7 +1395,7 @@ void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ if(cpu_mmx) { internal_scale2x_16_mmx(dst0, dst1, src0, src0, src1, width); - { + { int count = height; count -= 2; @@ -1439,18 +1439,18 @@ void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ } void AdMame2x32(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height) + u8 *dstPtr, u32 dstPitch, int width, int height) { u32 *dst0 = (u32 *)dstPtr; u32 *dst1 = dst0 + (dstPitch/4); - + u32 *src0 = (u32 *)srcPtr; u32 *src1 = src0 + (srcPitch/4); u32 *src2 = src1 + (srcPitch/4); #if defined(MMX) && (defined(X86_ASSEMBLY) || defined(X86_MSVC_ASSEMBLY)) if(cpu_mmx) { internal_scale2x_32_mmx(dst0, dst1, src0, src0, src1, width); - + { int count = height; diff --git a/od-win32/scaler2.c b/od-win32/scaler2.c index 6b215b21..2ba6aaa8 100755 --- a/od-win32/scaler2.c +++ b/od-win32/scaler2.c @@ -54,7 +54,7 @@ int Init_2xSaI (int rb, int gb, int bb, int rs, int gs, int bs) } static _inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) -{ +{ const bool ac = (A==C); const bool bc = (B==C); const int x1 = ac; @@ -549,11 +549,11 @@ static void internal_scale2x_16_def(u16 *dst0, u16* dst1, const u16* src0, const } static void internal_scale2x_32_def(u32* dst0, - u32* dst1, - const u32* src0, - const u32* src1, - const u32* src2, - unsigned count) { + u32* dst1, + const u32* src0, + const u32* src1, + const u32* src2, + unsigned count) { /* first pixel */ dst0[0] = src1[0]; dst1[0] = src1[0]; @@ -618,187 +618,187 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* /* always do the first and last run */ count -= 2*4; -#ifdef __GNUC__ +#ifdef __GNUC__ __asm__ __volatile__( - /* first run */ - /* set the current, current_pre, current_next registers */ - "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ - "movq 0(%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - /* central runs */ - "shrl $2,%4\n" - "jz 1f\n" - ASM_JUMP_ALIGN - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - - /* final run */ - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ - "psrlq $48,%%mm0\n" - "psllq $48,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $16,%%mm2\n" - "psrlq $16,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqw %%mm6,%%mm2\n" - "pcmpeqw %%mm6,%%mm4\n" - "pcmpeqw (%2),%%mm3\n" - "pcmpeqw (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqw %%mm1,%%mm2\n" - "pcmpeqw %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpcklwd %%mm4,%%mm2\n" - "punpckhwd %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - "emms\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); + /* first run */ + /* set the current, current_pre, current_next registers */ + "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ + "movq 0(%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + /* central runs */ + "shrl $2,%4\n" + "jz 1f\n" + ASM_JUMP_ALIGN + "0:\n" + + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + "decl %4\n" + "jnz 0b\n" + "1:\n" + + /* final run */ + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ + "psrlq $48,%%mm0\n" + "psllq $48,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $16,%%mm2\n" + "psrlq $16,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqw %%mm6,%%mm2\n" + "pcmpeqw %%mm6,%%mm4\n" + "pcmpeqw (%2),%%mm3\n" + "pcmpeqw (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqw %%mm1,%%mm2\n" + "pcmpeqw %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpcklwd %%mm4,%%mm2\n" + "punpckhwd %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + "emms\n" + + : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) + : + : "cc" + ); #else __asm { mov eax, src0; @@ -806,7 +806,7 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* mov ecx, src2; mov edx, dst; mov esi, count; - + /* first run */ /* set the current, current_pre, current_next registers */ pxor mm0,mm0; /* use a fake black out of screen */ @@ -925,7 +925,7 @@ static void internal_scale2x_16_mmx_single(u16* dst, const u16* src0, const u16* add ebx,8; add ecx,8; add edx,16; - + dec esi; jnz label0; label1: @@ -998,185 +998,185 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* #ifdef __GNUC__ __asm__ __volatile__( - /* first run */ - /* set the current, current_pre, current_next registers */ - "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ - "movq 0(%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - /* central runs */ - "shrl $1,%4\n" - "jz 1f\n" - ASM_JUMP_ALIGN - "0:\n" - - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "movq 8(%1),%%mm1\n" - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - - /* next */ - "addl $8,%0\n" - "addl $8,%1\n" - "addl $8,%2\n" - "addl $16,%3\n" - - "decl %4\n" - "jnz 0b\n" - "1:\n" - - /* final run */ - /* set the current, current_pre, current_next registers */ - "movq -8(%1),%%mm0\n" - "movq (%1),%%mm7\n" - "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ - "psrlq $32,%%mm0\n" - "psllq $32,%%mm1\n" - "movq %%mm7,%%mm2\n" - "movq %%mm7,%%mm3\n" - "psllq $32,%%mm2\n" - "psrlq $32,%%mm3\n" - "por %%mm2,%%mm0\n" - "por %%mm3,%%mm1\n" - - /* current_upper */ - "movq (%0),%%mm6\n" - - /* compute the upper-left pixel for dst0 on %%mm2 */ - /* compute the upper-right pixel for dst0 on %%mm4 */ - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "movq %%mm0,%%mm3\n" - "movq %%mm1,%%mm5\n" - "pcmpeqd %%mm6,%%mm2\n" - "pcmpeqd %%mm6,%%mm4\n" - "pcmpeqd (%2),%%mm3\n" - "pcmpeqd (%2),%%mm5\n" - "pandn %%mm2,%%mm3\n" - "pandn %%mm4,%%mm5\n" - "movq %%mm0,%%mm2\n" - "movq %%mm1,%%mm4\n" - "pcmpeqd %%mm1,%%mm2\n" - "pcmpeqd %%mm0,%%mm4\n" - "pandn %%mm3,%%mm2\n" - "pandn %%mm5,%%mm4\n" - "movq %%mm2,%%mm3\n" - "movq %%mm4,%%mm5\n" - "pand %%mm6,%%mm2\n" - "pand %%mm6,%%mm4\n" - "pandn %%mm7,%%mm3\n" - "pandn %%mm7,%%mm5\n" - "por %%mm3,%%mm2\n" - "por %%mm5,%%mm4\n" - - /* set *dst0 */ - "movq %%mm2,%%mm3\n" - "punpckldq %%mm4,%%mm2\n" - "punpckhdq %%mm4,%%mm3\n" - "movq %%mm2,(%3)\n" - "movq %%mm3,8(%3)\n" - "emms\n" - - : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) - : - : "cc" - ); + /* first run */ + /* set the current, current_pre, current_next registers */ + "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ + "movq 0(%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + /* central runs */ + "shrl $1,%4\n" + "jz 1f\n" + ASM_JUMP_ALIGN + "0:\n" + + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "movq 8(%1),%%mm1\n" + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + + /* next */ + "addl $8,%0\n" + "addl $8,%1\n" + "addl $8,%2\n" + "addl $16,%3\n" + + "decl %4\n" + "jnz 0b\n" + "1:\n" + + /* final run */ + /* set the current, current_pre, current_next registers */ + "movq -8(%1),%%mm0\n" + "movq (%1),%%mm7\n" + "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ + "psrlq $32,%%mm0\n" + "psllq $32,%%mm1\n" + "movq %%mm7,%%mm2\n" + "movq %%mm7,%%mm3\n" + "psllq $32,%%mm2\n" + "psrlq $32,%%mm3\n" + "por %%mm2,%%mm0\n" + "por %%mm3,%%mm1\n" + + /* current_upper */ + "movq (%0),%%mm6\n" + + /* compute the upper-left pixel for dst0 on %%mm2 */ + /* compute the upper-right pixel for dst0 on %%mm4 */ + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "movq %%mm0,%%mm3\n" + "movq %%mm1,%%mm5\n" + "pcmpeqd %%mm6,%%mm2\n" + "pcmpeqd %%mm6,%%mm4\n" + "pcmpeqd (%2),%%mm3\n" + "pcmpeqd (%2),%%mm5\n" + "pandn %%mm2,%%mm3\n" + "pandn %%mm4,%%mm5\n" + "movq %%mm0,%%mm2\n" + "movq %%mm1,%%mm4\n" + "pcmpeqd %%mm1,%%mm2\n" + "pcmpeqd %%mm0,%%mm4\n" + "pandn %%mm3,%%mm2\n" + "pandn %%mm5,%%mm4\n" + "movq %%mm2,%%mm3\n" + "movq %%mm4,%%mm5\n" + "pand %%mm6,%%mm2\n" + "pand %%mm6,%%mm4\n" + "pandn %%mm7,%%mm3\n" + "pandn %%mm7,%%mm5\n" + "por %%mm3,%%mm2\n" + "por %%mm5,%%mm4\n" + + /* set *dst0 */ + "movq %%mm2,%%mm3\n" + "punpckldq %%mm4,%%mm2\n" + "punpckhdq %%mm4,%%mm3\n" + "movq %%mm2,(%3)\n" + "movq %%mm3,8(%3)\n" + "emms\n" + + : "+r" (src0), "+r" (src1), "+r" (src2), "+r" (dst), "+r" (count) + : + : "cc" + ); #else __asm { mov eax, src0; @@ -1184,7 +1184,7 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* mov ecx, src2; mov edx, dst; mov esi, count; - + /* first run */ /* set the current, current_pre, current_next registers */ pxor mm0,mm0; @@ -1246,7 +1246,7 @@ static void internal_scale2x_32_mmx_single(u32* dst, const u32* src0, const u32* shr esi,1; jz label1; label0: - + /* set the current, current_pre, current_next registers */ movq mm0,qword ptr [ebx-8]; movq mm7,qword ptr [ebx]; @@ -1306,7 +1306,7 @@ label0: dec esi; jnz label0; label1: - + /* final run */ /* set the current, current_pre, current_next registers */ movq mm0,qword ptr [ebx-8]; @@ -1383,11 +1383,11 @@ static void internal_scale2x_32_mmx(u32* dst0, u32* dst1, const u32* src0, const #endif void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height) + u8 *dstPtr, u32 dstPitch, int width, int height) { u16 *dst0 = (u16 *)dstPtr; u16 *dst1 = dst0 + (dstPitch/2); - + u16 *src0 = (u16 *)srcPtr; u16 *src1 = src0 + (srcPitch/2); u16 *src2 = src1 + (srcPitch/2); @@ -1395,7 +1395,7 @@ void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ if(cpu_mmx) { internal_scale2x_16_mmx(dst0, dst1, src0, src0, src1, width); - { + { int count = height; count -= 2; @@ -1439,18 +1439,18 @@ void AdMame2x(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ } void AdMame2x32(u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */ - u8 *dstPtr, u32 dstPitch, int width, int height) + u8 *dstPtr, u32 dstPitch, int width, int height) { u32 *dst0 = (u32 *)dstPtr; u32 *dst1 = dst0 + (dstPitch/4); - + u32 *src0 = (u32 *)srcPtr; u32 *src1 = src0 + (srcPitch/4); u32 *src2 = src1 + (srcPitch/4); #ifdef MMX if(cpu_mmx) { internal_scale2x_32_mmx(dst0, dst1, src0, src0, src1, width); - + { int count = height; diff --git a/od-win32/scaler_more.c b/od-win32/scaler_more.c index a561fd0f..90e3a047 100755 --- a/od-win32/scaler_more.c +++ b/od-win32/scaler_more.c @@ -37,7 +37,7 @@ void PAL_init(void) } else { xx1 = 2; xx2 = 5; - xx3 = 7; + xx3 = 7; } pal_noise_mask = (1 << (currprefs.gfx_filter_noise * 7 / 100)) - 1; scanlinelevel = 128 - currprefs.gfx_filter_scanlines * 128 / 100; @@ -104,14 +104,14 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i src = src + pitchs * ys + xs - 2; trg = trg + pitcht * yt + xt; if (width < 8) { - wstart = width; - wfast = 0; - wend = 0; + wstart = width; + wfast = 0; + wend = 0; } else { - /* alignment: 8 pixels*/ - wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); - wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ - wend = (width - wstart) & 0x07; /* do not forget the rest*/ + /* alignment: 8 pixels*/ + wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); + wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ + wend = (width - wstart) & 0x07; /* do not forget the rest*/ } wint = width + 5; lineptr0 = line_yuv_0; @@ -120,17 +120,17 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i tmpsrc = src - pitchs; line = lineptr0; for (x = 0; x < wint; x++) { - uae_u32 cl0, cl1, cl2, cl3; - - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; - line[0] = 0; - line[1] = zcb(cl0) + zcb(cl1) + zcb(cl2) + zcb(cl3); - line[2] = zcr(cl0) + zcr(cl1) + zcr(cl2) + zcr(cl3); - tmpsrc++; - line += 3; + uae_u32 cl0, cl1, cl2, cl3; + + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; + line[0] = 0; + line[1] = zcb(cl0) + zcb(cl1) + zcb(cl2) + zcb(cl3); + line[2] = zcr(cl0) + zcr(cl1) + zcr(cl2) + zcr(cl3); + tmpsrc++; + line += 3; } for (y = 0; y < height; y++) { @@ -138,47 +138,47 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i randomshift = rand() & 15; randomoffset = rand() & 2047; - tmpsrc = src; - tmptrg = trg; + tmpsrc = src; + tmptrg = trg; - line = lineptr0; - lineptr0 = lineptr1; - lineptr1 = line; + line = lineptr0; + lineptr0 = lineptr1; + lineptr1 = line; - tmpsrc = src; - line = lineptr0; - for (x = 0; x < wint; x++) { + tmpsrc = src; + line = lineptr0; + for (x = 0; x < wint; x++) { int r = (randomtable[randomoffset++] >> randomshift) & pal_noise_mask; - uae_u32 cl0, cl1, cl2, cl3; - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; + uae_u32 cl0, cl1, cl2, cl3; + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; line[0] = (zyl(cl1) + zyh(cl2) * (scn - r) / 128 + zyl(cl3)) / 256; /* 1/4 + 1/2 + 1/4 */ - line[1] = zcb(cl0) + zcb(cl1) + zcb(cl2) + zcb(cl3); - line[2] = zcr(cl0) + zcr(cl1) + zcr(cl2) + zcr(cl3); - tmpsrc++; - line += 3; - } - - line = lineptr0; - linepre = lineptr1; - for (x = 0; x < (wfast << 3) + wend + wstart; x++) { - - l = line[0]; - u = (line[1] + linepre[1]) / 8; - v = (line[2] + linepre[2]) / 8; - line += 3; - linepre += 3; - - red = (v + l) / 256; - blu = (u + l) / 256; - grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); - *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; - } - - src += pitchs; - trg += pitcht; + line[1] = zcb(cl0) + zcb(cl1) + zcb(cl2) + zcb(cl3); + line[2] = zcr(cl0) + zcr(cl1) + zcr(cl2) + zcr(cl3); + tmpsrc++; + line += 3; + } + + line = lineptr0; + linepre = lineptr1; + for (x = 0; x < (wfast << 3) + wend + wstart; x++) { + + l = line[0]; + u = (line[1] + linepre[1]) / 8; + v = (line[2] + linepre[2]) / 8; + line += 3; + linepre += 3; + + red = (v + l) / 256; + blu = (u + l) / 256; + grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); + *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; + } + + src += pitchs; + trg += pitcht; } } #endif @@ -205,14 +205,14 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i src = src + pitchs * ys + xs - 2; trg = trg + pitcht * yt + xt; if (width < 8) { - wstart = width; - wfast = 0; - wend = 0; + wstart = width; + wfast = 0; + wend = 0; } else { - /* alignment: 8 pixels*/ - wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); - wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ - wend = (width - wstart) & 0x07; /* do not forget the rest*/ + /* alignment: 8 pixels*/ + wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); + wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ + wend = (width - wstart) & 0x07; /* do not forget the rest*/ } wint = width + 5; lineptr0 = line_yuv_0; @@ -221,17 +221,17 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i tmpsrc = src - pitchs; line = lineptr0; for (x = 0; x < wint; x++) { - uae_u32 cl0, cl1, cl2, cl3; - - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; - line[0] = 0; - line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); - line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); - tmpsrc++; - line += 3; + uae_u32 cl0, cl1, cl2, cl3; + + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; + line[0] = 0; + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; } for (y = 0; y < height; y++) { @@ -239,47 +239,47 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i randomshift = rand() & 15; randomoffset = rand() & 2047; - tmpsrc = src; - tmptrg = trg; + tmpsrc = src; + tmptrg = trg; - line = lineptr0; - lineptr0 = lineptr1; - lineptr1 = line; + line = lineptr0; + lineptr0 = lineptr1; + lineptr1 = line; - tmpsrc = src; - line = lineptr0; - for (x = 0; x < wint; x++) { + tmpsrc = src; + line = lineptr0; + for (x = 0; x < wint; x++) { int r = (randomtable[randomoffset++] >> randomshift) & pal_noise_mask; - uae_u32 cl0, cl1, cl2, cl3; - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; + uae_u32 cl0, cl1, cl2, cl3; + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; line[0] = (zylRGB(cl1) + zyhRGB(cl2) * (scn - r) / 128 + zylRGB(cl3)) / 256; /* 1/4 + 1/2 + 1/4 */ - line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); - line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); - tmpsrc++; - line += 3; - } - - line = lineptr0; - linepre = lineptr1; - for (x = 0; x < (wfast << 3) + wend + wstart; x++) { - - l = line[0]; - u = (line[1] + linepre[1]) / 8; - v = (line[2] + linepre[2]) / 8; - line += 3; - linepre += 3; - - red = (v + l) / 256; - blu = (u + l) / 256; - grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); - *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; - } - - src += pitchs; - trg += pitcht; + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; + } + + line = lineptr0; + linepre = lineptr1; + for (x = 0; x < (wfast << 3) + wend + wstart; x++) { + + l = line[0]; + u = (line[1] + linepre[1]) / 8; + v = (line[2] + linepre[2]) / 8; + line += 3; + linepre += 3; + + red = (v + l) / 256; + blu = (u + l) / 256; + grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); + *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; + } + + src += pitchs; + trg += pitcht; } } @@ -305,14 +305,14 @@ void PAL_1x1_16(uae_u16 *src, int pitchs, uae_u16 *trg, int pitcht, int width, i src = src + pitchs * ys + xs - 2; trg = trg + pitcht * yt + xt; if (width < 8) { - wstart = width; - wfast = 0; - wend = 0; + wstart = width; + wfast = 0; + wend = 0; } else { - /* alignment: 8 pixels*/ - wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); - wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ - wend = (width - wstart) & 0x07; /* do not forget the rest*/ + /* alignment: 8 pixels*/ + wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); + wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ + wend = (width - wstart) & 0x07; /* do not forget the rest*/ } wint = width + 5; lineptr0 = line_yuv_0; @@ -321,17 +321,17 @@ void PAL_1x1_16(uae_u16 *src, int pitchs, uae_u16 *trg, int pitcht, int width, i tmpsrc = src - pitchs; line = lineptr0; for (x = 0; x < wint; x++) { - uae_u32 cl0, cl1, cl2, cl3; - - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; - line[0] = 0; - line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); - line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); - tmpsrc++; - line += 3; + uae_u32 cl0, cl1, cl2, cl3; + + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; + line[0] = 0; + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; } for (y = 0; y < height; y++) { @@ -339,46 +339,46 @@ void PAL_1x1_16(uae_u16 *src, int pitchs, uae_u16 *trg, int pitcht, int width, i randomshift = rand() & 15; randomoffset = rand() & 2047; - tmpsrc = src; - tmptrg = trg; + tmpsrc = src; + tmptrg = trg; - line = lineptr0; - lineptr0 = lineptr1; - lineptr1 = line; + line = lineptr0; + lineptr0 = lineptr1; + lineptr1 = line; - tmpsrc = src; - line = lineptr0; - for (x = 0; x < wint; x++) { + tmpsrc = src; + line = lineptr0; + for (x = 0; x < wint; x++) { int r = (randomtable[randomoffset++] >> randomshift) & pal_noise_mask; - uae_u32 cl0, cl1, cl2, cl3; - cl0 = tmpsrc[0]; - cl1 = tmpsrc[xx1]; - cl2 = tmpsrc[xx2]; - cl3 = tmpsrc[xx3]; + uae_u32 cl0, cl1, cl2, cl3; + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; line[0] = (zylRGB(cl1) + zyhRGB(cl2) * (scn - r) / 128 + zylRGB(cl3)) / 256; /* 1/4 + 1/2 + 1/4 */ - line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); - line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); - tmpsrc++; - line += 3; - } - - line = lineptr0; - linepre = lineptr1; - for (x = 0; x < (wfast << 3) + wend + wstart; x++) { - - l = line[0]; - u = (line[1] + linepre[1]) / 8; - v = (line[2] + linepre[2]) / 8; - line += 3; - linepre += 3; - - red = (v + l) / 256; - blu = (u + l) / 256; - grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); - *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; - } - - src += pitchs; - trg += pitcht; + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; + } + + line = lineptr0; + linepre = lineptr1; + for (x = 0; x < (wfast << 3) + wend + wstart; x++) { + + l = line[0]; + u = (line[1] + linepre[1]) / 8; + v = (line[2] + linepre[2]) / 8; + line += 3; + linepre += 3; + + red = (v + l) / 256; + blu = (u + l) / 256; + grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); + *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; + } + + src += pitchs; + trg += pitcht; } } diff --git a/od-win32/screenshot.c b/od-win32/screenshot.c index 613c58ca..c8f53c73 100755 --- a/od-win32/screenshot.c +++ b/od-win32/screenshot.c @@ -23,7 +23,7 @@ int screenshotmode = PNG_SCREENSHOTS; static void namesplit (char *s) { int l; - + l = strlen (s) - 1; while (l >= 0) { if (s[l] == '.') @@ -49,13 +49,13 @@ static int toclipboard (BITMAPINFO *bi, void *bmp) EmptyClipboard (); hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bi->bmiHeader.biSize + bi->bmiHeader.biSizeImage); if (hg) { - dib = GlobalLock (hg); + dib = GlobalLock (hg); if (dib) { memcpy (dib, &bi->bmiHeader, bi->bmiHeader.biSize); memcpy (dib + bi->bmiHeader.biSize, bmp, bi->bmiHeader.biSizeImage); } - GlobalUnlock (hg); - if (SetClipboardData (CF_DIB, hg)) + GlobalUnlock (hg); + if (SetClipboardData (CF_DIB, hg)) v = 1; } CloseClipboard (); @@ -64,7 +64,7 @@ static int toclipboard (BITMAPINFO *bi, void *bmp) return v; } -static HDC surface_dc, offscreen_dc; +static HDC surface_dc, offscreen_dc; static BITMAPINFO bi; // bitmap info static LPVOID lpvBits = NULL; // pointer to bitmap bits array static HBITMAP offscreen_bitmap; @@ -73,7 +73,7 @@ static int screenshot_prepared; void screenshot_free(void) { if (surface_dc) - releasehdc (surface_dc); + releasehdc (surface_dc); surface_dc = NULL; if(offscreen_dc) DeleteDC(offscreen_dc); @@ -104,12 +104,12 @@ int screenshot_prepare(void) // need a HBITMAP to convert it to a DIB if((offscreen_bitmap = CreateCompatibleBitmap(surface_dc, width, height)) == NULL) - goto oops; // error - + goto oops; // error + // The bitmap is empty, so let's copy the contents of the surface to it. // For that we need to select it into a device context. if((offscreen_dc = CreateCompatibleDC(surface_dc)) == NULL) - goto oops; // error + goto oops; // error // select offscreen_bitmap into offscreen_dc hgdiobj = SelectObject(offscreen_dc, offscreen_bitmap); @@ -119,7 +119,7 @@ int screenshot_prepare(void) // de-select offscreen_bitmap SelectObject(offscreen_dc, hgdiobj); - + ZeroMemory(&bi, sizeof(bi)); bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = width; @@ -184,7 +184,7 @@ static int savepng(FILE *fp) } png_init_io(png_ptr, fp); - png_set_filter(png_ptr, 0, PNG_FILTER_NONE); + png_set_filter(png_ptr, 0, PNG_FILTER_NONE); png_set_IHDR(png_ptr, info_ptr, w, h, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); @@ -225,30 +225,30 @@ void screenshot(int mode, int doprepare) { static int recursive; FILE *fp = NULL; - + HBITMAP offscreen_bitmap = NULL; // bitmap that is converted to a DIB HDC offscreen_dc = NULL; // offscreen DC that we can select offscreen bitmap into if(recursive) - return; - + return; + recursive++; if (!screenshot_prepared || doprepare) { - if (!screenshot_prepare()) + if (!screenshot_prepare()) goto oops; } if (mode == 0) { - toclipboard (&bi, lpvBits); + toclipboard (&bi, lpvBits); } else { - char filename[MAX_DPATH]; - char path[MAX_DPATH]; - char name[MAX_DPATH]; - char underline[] = "_"; - int number = 0; - - fetch_path ("ScreenshotPath", path, sizeof (path)); + char filename[MAX_DPATH]; + char path[MAX_DPATH]; + char name[MAX_DPATH]; + char underline[] = "_"; + int number = 0; + + fetch_path ("ScreenshotPath", path, sizeof (path)); CreateDirectory (path, NULL); name[0] = 0; if (currprefs.dfxtype[0] >= 0) @@ -256,7 +256,7 @@ void screenshot(int mode, int doprepare) if (!name[0]) underline[0] = 0; namesplit (name); - + while(++number < 1000) // limit 999 iterations / screenshots { sprintf(filename, "%s%s%s%03d.%s", path, name, underline, number, screenshotmode ? "png" : "bmp"); @@ -275,20 +275,20 @@ void screenshot(int mode, int doprepare) fp = NULL; if (!ok) goto oops; - write_log("Screenshot saved as \"%s\"\n", filename); + write_log ("Screenshot saved as \"%s\"\n", filename); break; } fclose (fp); fp = NULL; } } - + oops: if(fp) - fclose(fp); - + fclose(fp); + if (doprepare) - screenshot_free(); + screenshot_free(); recursive--; } diff --git a/od-win32/serial_win32.c b/od-win32/serial_win32.c index 3c4bdb9b..7bfebe07 100755 --- a/od-win32/serial_win32.c +++ b/od-win32/serial_win32.c @@ -10,7 +10,7 @@ #include "sysconfig.h" #include "sysdeps.h" - + #include "options.h" #include "uae.h" #include "memory.h" @@ -57,11 +57,11 @@ void SERPER (uae_u16 w) serper = w; if (w & 0x8000) { - if (!warned) { - write_log("SERIAL: program uses 9bit mode PC=%x\n", M68K_GETPC); + if (!warned) { + write_log ("SERIAL: program uses 9bit mode PC=%x\n", M68K_GETPC); warned++; - } - ninebit = 1; + } + ninebit = 1; } w &= 0x7fff; @@ -115,7 +115,7 @@ static void checkreceive (int mode) return; if (data_in_serdatr) { - /* probably not needed but there may be programs that expect OVRUNs.. */ + /* probably not needed but there may be programs that expect OVRUNs.. */ gettimeofday (&tv, NULL); if (tv.tv_sec > lastchartime) { ovrun = 1; @@ -147,10 +147,10 @@ static void checkreceive (int mode) } } } else { - if (!readser (&recdata)) + if (!readser (&recdata)) return; serdatr = recdata; - serdatr |= 0x100; + serdatr |= 0x100; } gettimeofday (&tv, NULL); lastchartime = tv.tv_sec + 5; @@ -184,12 +184,12 @@ static void checksend (int mode) writeser (serdatshift); #endif data_in_serdat = 0; - INTREQ_f (0x8000 | 0x0001); + INTREQ_f (0x8000 | 0x0001); #if SERIALDEBUG > 2 write_log ("SERIAL: send %04.4X (%c)\n", serdatshift, dochar (serdatshift)); #endif } -} +} void serial_hsynchandler (void) { @@ -232,7 +232,7 @@ void SERDAT (uae_u16 w) write_log ("SERIAL: program wrote to SERDAT but old byte wasn't fetched yet\n"); } #endif - + if (seriallog) console_out("%c", dochar (w)); @@ -268,7 +268,7 @@ uae_u16 SERDATR (void) if (ovrun) serdatr |= 0x8000; #if SERIALDEBUG > 2 - write_log( "SERIAL: read 0x%04.4x (%c) %x\n", serdatr, dochar (serdatr), m68k_getpc()); + write_log ( "SERIAL: read 0x%04.4x (%c) %x\n", serdatr, dochar (serdatr), m68k_getpc ()); #endif ovrun = 0; data_in_serdatr = 0; @@ -278,13 +278,13 @@ uae_u16 SERDATR (void) void serial_check_irq (void) { if (data_in_serdatr) - INTREQ_0 (0x8000 | 0x0800); + INTREQ_0 (0x8000 | 0x0800); } void serial_dtr_on(void) { #if SERIALHSDEBUG > 0 - write_log( "SERIAL: DTR on\n" ); + write_log ( "SERIAL: DTR on\n" ); #endif dtr = 1; if (currprefs.serial_demand) @@ -297,7 +297,7 @@ void serial_dtr_on(void) void serial_dtr_off(void) { #if SERIALHSDEBUG > 0 - write_log( "SERIAL: DTR off\n" ); + write_log ( "SERIAL: DTR off\n" ); #endif dtr = 0; #ifdef SERIAL_PORT @@ -316,7 +316,7 @@ static uae_u8 oldserbits; static void serial_status_debug(char *s) { #if SERIALHSDEBUG > 1 - write_log("%s: DTR=%d RTS=%d CD=%d CTS=%d DSR=%d\n", s, + write_log ("%s: DTR=%d RTS=%d CD=%d CTS=%d DSR=%d\n", s, (oldserbits & 0x80) ? 0 : 1, (oldserbits & 0x40) ? 0 : 1, (oldserbits & 0x20) ? 0 : 1, (oldserbits & 0x10) ? 0 : 1, (oldserbits & 0x08) ? 0 : 1); #endif @@ -334,46 +334,46 @@ uae_u8 serial_readstatus(uae_u8 dir) if (!(serbits & 0x20)) { serbits |= 0x20; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: CD off\n" ); + write_log ( "SERIAL: CD off\n" ); #endif } } else { if (serbits & 0x20) { serbits &= ~0x20; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: CD on\n" ); + write_log ( "SERIAL: CD on\n" ); #endif } } if (!(status & TIOCM_DSR)) { - if (!(serbits & 0x08)) { + if (!(serbits & 0x08)) { serbits |= 0x08; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: DSR off\n" ); + write_log ( "SERIAL: DSR off\n" ); #endif - } + } } else { - if (serbits & 0x08) { + if (serbits & 0x08) { serbits &= ~0x08; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: DSR on\n" ); + write_log ( "SERIAL: DSR on\n" ); #endif } } if (!(status & TIOCM_CTS)) { - if (!(serbits & 0x10)) { + if (!(serbits & 0x10)) { serbits |= 0x10; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: CTS off\n" ); + write_log ( "SERIAL: CTS off\n" ); #endif - } + } } else { - if (serbits & 0x10) { + if (serbits & 0x10) { serbits &= ~0x10; #if SERIALHSDEBUG > 0 - write_log( "SERIAL: CTS on\n" ); + write_log ( "SERIAL: CTS on\n" ); #endif } } @@ -407,7 +407,7 @@ uae_u8 serial_writestatus (uae_u8 newstate, uae_u8 dir) write_log ("SERIAL: RTS cleared\n"); #endif } else { - setserstat (TIOCM_RTS, 1); + setserstat (TIOCM_RTS, 1); #if SERIALHSDEBUG > 0 write_log ("SERIAL: RTS set\n"); #endif @@ -417,11 +417,11 @@ uae_u8 serial_writestatus (uae_u8 newstate, uae_u8 dir) #if 0 /* CIA io-pins can be read even when set to output.. */ if ((newstate & 0x20) != (oldserbits & 0x20) && (dir & 0x20)) - write_log ("SERIAL: warning, program tries to use CD as an output!\n"); + write_log ("SERIAL: warning, program tries to use CD as an output!\n"); if ((newstate & 0x10) != (oldserbits & 0x10) && (dir & 0x10)) - write_log ("SERIAL: warning, program tries to use CTS as an output!\n"); + write_log ("SERIAL: warning, program tries to use CTS as an output!\n"); if ((newstate & 0x08) != (oldserbits & 0x08) && (dir & 0x08)) - write_log ("SERIAL: warning, program tries to use DSR as an output!\n"); + write_log ("SERIAL: warning, program tries to use DSR as an output!\n"); #endif if (logcnt > 0) { @@ -452,8 +452,8 @@ void serial_open(void) return; serper = 0; if(!openser(currprefs.sername)) { - write_log("SERIAL: Could not open device %s\n", currprefs.sername); - return; + write_log ("SERIAL: Could not open device %s\n", currprefs.sername); + return; } serdev = 1; #endif diff --git a/od-win32/sfhelper.c b/od-win32/sfhelper.c index 36578fe5..430d3fb2 100755 --- a/od-win32/sfhelper.c +++ b/od-win32/sfhelper.c @@ -10,7 +10,7 @@ int main (int argc, char **argv) char *wu; FILE *f; uae_u8 *b, *p1, *p2, *p3, *cfgbuf, *databuf; - int size, size2, i, num, offset; + int size, size2, i, num, offset; if (argc < 4) { printf("Usage: sfhelper.exe [..]"); @@ -42,7 +42,7 @@ int main (int argc, char **argv) if (!strcmp (p1, "_DATA_STARTS_HERE")) databuf = p1; } - p1++; + p1++; if (cfgbuf && databuf) break; } diff --git a/od-win32/shm.c b/od-win32/shm.c index ed970b59..ace18c53 100755 --- a/od-win32/shm.c +++ b/od-win32/shm.c @@ -1,6 +1,6 @@ #include -#include "sysconfig.h" +#include "sysconfig.h" #include "sysdeps.h" #include "sys/mman.h" #include "include/memory.h" @@ -50,10 +50,10 @@ void init_shm( void ) natmem_offset = addr; break; } - addr += 0x01000000; + addr += 0x01000000; } if (natmem_offset) { - write_log( "NATMEM: Our special area is 0x%x\n", natmem_offset); + write_log ( "NATMEM: Our special area is 0x%x\n", natmem_offset); } else { canbang = 0; } @@ -89,7 +89,7 @@ STATIC_INLINE key_t find_shmkey( key_t key ) int mprotect(void *addr, size_t len, int prot) { int result = 0; - + return result; } @@ -98,7 +98,7 @@ int shmget(key_t key, size_t size, int shmflg, char *name) int result = -1; if( ( key == IPC_PRIVATE ) || ( ( shmflg & IPC_CREAT ) && ( find_shmkey( key ) == -1) ) ) { - write_log( "shmget of size %d for %s\n", size, name ); + write_log ( "shmget of size %d for %s\n", size, name ); if( ( result = get_next_shmkey() ) != -1 ) { HANDLE h = CreateFileMapping (NULL, 0, PAGE_READWRITE, 0, size, NULL); if (h == NULL) @@ -139,7 +139,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) } void *shmat(int shmid, LPVOID shmaddr, int shmflg) -{ +{ struct shmid_ds *shm = &shmids[shmid]; if(shm->addr == shmaddr ) @@ -157,13 +157,13 @@ int shmdt(const void *shmaddr) int i; if (shmaddr == (void*)0xffffffff) return 0; - write_log("shmdt: %08.8X\n", shmaddr); + write_log ("shmdt: %08.8X\n", shmaddr); if (UnmapViewOfFile ((LPCVOID)shmaddr) == FALSE) { win32_error("UnmapViewOfFile %08.8X", shmaddr); return 0; } for( i = 0; i < MAX_SHMID; i++ ) { - struct shmid_ds *shm = &shmids[i]; + struct shmid_ds *shm = &shmids[i]; if (shm->addr == shmaddr) { shm->addr = (void*)0xffffffff; } diff --git a/od-win32/soundcheck.c b/od-win32/soundcheck.c index 5bd1cb1f..348a0250 100755 --- a/od-win32/soundcheck.c +++ b/od-win32/soundcheck.c @@ -84,7 +84,7 @@ static void pause_audio_ds (void) static void resume_audio_ds (void) { HRESULT hr; - + clearbuffer (); hr = IDirectSoundBuffer_Play (lpDSBsecondary, 0, 0, DSBPLAY_LOOPING); if (hr != DS_OK) @@ -124,11 +124,11 @@ static int open_audio_ds (void) WAVEFORMATEX wavfmt; int minfreq, maxfreq; int freq = sounddata_frequency; - + hr = DirectSoundCreate (&sound_device_guid[devicenum], &lpDS, NULL); if (hr != DS_OK) { - write_log ("SOUND: DirectSoundCreate() failure: %s\n", DXError (hr)); - return 0; + write_log ("SOUND: DirectSoundCreate() failure: %s\n", DXError (hr)); + return 0; } memset (&DSCaps, 0, sizeof (DSCaps)); DSCaps.dwSize = sizeof(DSCaps); @@ -146,23 +146,23 @@ static int open_audio_ds (void) if (minfreq > freq) { freq = minfreq; sounddata_frequency = freq; - write_log("SOUND: minimum supported frequency: %d\n", minfreq); + write_log ("SOUND: minimum supported frequency: %d\n", minfreq); } if (maxfreq < freq) { freq = maxfreq; sounddata_frequency = freq; - write_log("SOUND: maximum supported frequency: %d\n", maxfreq); + write_log ("SOUND: maximum supported frequency: %d\n", maxfreq); } } else { - write_log("SOUND: ignored weird min (%d) or max (%d) sample rate\n", minfreq, maxfreq); + write_log ("SOUND: ignored weird min (%d) or max (%d) sample rate\n", minfreq, maxfreq); } - + memset (&sound_buffer, 0, sizeof (sound_buffer)); sound_buffer.dwSize = sizeof (sound_buffer); sound_buffer.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_GETCURRENTPOSITION2; hr = IDirectSound_CreateSoundBuffer (lpDS, &sound_buffer, &lpDSBprimary, NULL); if( hr != DS_OK ) { - write_log ("SOUND: Primary CreateSoundBuffer() failure: %s\n", DXError (hr)); + write_log ("SOUND: Primary CreateSoundBuffer() failure: %s\n", DXError (hr)); goto error; } @@ -183,15 +183,15 @@ static int open_audio_ds (void) hr = IDirectSound_SetCooperativeLevel (lpDS, hwnd, DSSCL_PRIORITY); if (hr != DS_OK) { - write_log ("SOUND: Can't set cooperativelevel: %s\n", DXError (hr)); - goto error; + write_log ("SOUND: Can't set cooperativelevel: %s\n", DXError (hr)); + goto error; } dsoundbuf = sounddata_bufsize; if (dsoundbuf < DSBSIZE_MIN) - dsoundbuf = DSBSIZE_MIN; + dsoundbuf = DSBSIZE_MIN; if (dsoundbuf > DSBSIZE_MAX) - dsoundbuf = DSBSIZE_MAX; + dsoundbuf = DSBSIZE_MAX; memset (&sound_buffer, 0, sizeof (sound_buffer)); sound_buffer.dwSize = sizeof (sound_buffer); @@ -201,16 +201,16 @@ static int open_audio_ds (void) hr = IDirectSound_CreateSoundBuffer( lpDS, &sound_buffer, &lpDSBsecondary, NULL ); if (hr != DS_OK) { - write_log ("SOUND: Secondary CreateSoundBuffer() failure: %s\n", DXError (hr)); - goto error; + write_log ("SOUND: Secondary CreateSoundBuffer() failure: %s\n", DXError (hr)); + goto error; } hr = IDirectSoundBuffer_SetFormat (lpDSBprimary, &wavfmt); if( hr != DS_OK ) { - write_log ("SOUND: Primary SetFormat() failure: %s\n", DXError (hr)); - goto error; + write_log ("SOUND: Primary SetFormat() failure: %s\n", DXError (hr)); + goto error; } - + clearbuffer (); return 1; @@ -238,33 +238,33 @@ static HWND GetConsoleHwnd(void) HWND hwndFound; // this is what is returned to the caller char pszNewWindowTitle[MY_BUFSIZE]; // contains fabricated WindowTitle char pszOldWindowTitle[MY_BUFSIZE]; // contains original WindowTitle - + // fetch current window title - + GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE); - + // format a "unique" NewWindowTitle - + wsprintf(pszNewWindowTitle,"%d/%d", - GetTickCount(), - GetCurrentProcessId()); - + GetTickCount(), + GetCurrentProcessId()); + // change current window title - + SetConsoleTitle(pszNewWindowTitle); - + // ensure window title has been updated - + Sleep(40); - + // look for NewWindowTitle - + hwndFound=FindWindow(NULL, pszNewWindowTitle); - + // restore original window title - + SetConsoleTitle(pszOldWindowTitle); - + return(hwndFound); } @@ -331,7 +331,7 @@ static int sm (int ms) return 0; } else { WaitForSingleObject (timehandle, ms); - ResetEvent (timehandle); + ResetEvent (timehandle); timeKillEvent (TimerEvent); } return 1; @@ -351,7 +351,7 @@ static int getpos (void) } static void runtest(void) -{ +{ int pos, spos, expected, len, freqdiff; int lastpos, minpos, maxpos; int mult = sounddata_stereo ? 4 : 2; @@ -393,8 +393,8 @@ static void runtest(void) write_log2 ("position granularity: minimum %d, maximum %d samples\n", minpos, maxpos); len = 200; while (len <= 1400) { - pause_audio_ds (); - resume_audio_ds (); + pause_audio_ds (); + resume_audio_ds (); while (pos > 1000) pos = getpos(); while (pos < 1000) @@ -417,7 +417,7 @@ static void runtest(void) write_log2("real calculated frequency: %d\n", sounddata_frequency - freqdiff); pause_audio_ds (); -} +} static int selectdevice (void) { @@ -467,42 +467,42 @@ static int osdetect (void) } if(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, - &hAccessToken )) { - if(GetLastError() != ERROR_NO_TOKEN) - return 1; - // - // retry against process token if no thread token exists - // - if(!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, - &hAccessToken)) - return 1; + &hAccessToken )) { + if(GetLastError() != ERROR_NO_TOKEN) + return 1; + // + // retry against process token if no thread token exists + // + if(!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, + &hAccessToken)) + return 1; } bSuccess = GetTokenInformation(hAccessToken,TokenGroups,InfoBuffer, - 1024, &dwInfoBufferSize); + 1024, &dwInfoBufferSize); CloseHandle(hAccessToken); if(!bSuccess ) - return 1; + return 1; if(!AllocateAndInitializeSid(&siaNtAuthority, 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, - &psidAdministrators)) - return 1; + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &psidAdministrators)) + return 1; // assume that we don't find the admin SID. bSuccess = FALSE; for(x=0;xGroupCount;x++) { - if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) ) - { - bSuccess = TRUE; - break; - } + if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) ) + { + bSuccess = TRUE; + break; + } } FreeSid(psidAdministrators); @@ -531,7 +531,7 @@ int main (int argc, char **argv) devicenum = selectdevice (); i = 0; while (srates[i]) { - sounddata_frequency = srates[i]; + sounddata_frequency = srates[i]; if (open_audio_ds ()) { if (!timebegin ()) { printf ("no MM timer, exiting..\n"); diff --git a/od-win32/sounddep/sound.c b/od-win32/sounddep/sound.c index e4c58bc1..a2fb5130 100755 --- a/od-win32/sounddep/sound.c +++ b/od-win32/sounddep/sound.c @@ -1,6 +1,6 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Win32 sound interface (DirectSound) * * Copyright 1997 Mathias Ortmann @@ -90,7 +90,7 @@ static int lastfreq; void update_sound (int freq) { if (freq < 0) - freq = lastfreq; + freq = lastfreq; lastfreq = freq; if (have_sound) { if (isvsync() || currprefs.chipset_refreshrate) { @@ -130,10 +130,10 @@ static void pause_audio_ds (void) waiting_for_buffer = 0; hr = IDirectSoundBuffer_Stop (lpDSBsecondary); if (FAILED(hr)) - write_log("SOUND: DirectSoundBuffer_Stop failed, %s\n", DXError(hr)); + write_log ("SOUND: DirectSoundBuffer_Stop failed, %s\n", DXError(hr)); hr = IDirectSoundBuffer_SetCurrentPosition (lpDSBsecondary, 0); if (FAILED(hr)) - write_log("SOUND: DirectSoundBuffer_SetCurretPosition failed, %s\n", DXError(hr)); + write_log ("SOUND: DirectSoundBuffer_SetCurretPosition failed, %s\n", DXError(hr)); cleardsbuffer (); } @@ -198,10 +198,10 @@ static void setvolume (void) LONG vol = DSBVOLUME_MIN; if (currprefs.sound_volume < 100 && !mute) - vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - currprefs.sound_volume / 100.0))); + vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - currprefs.sound_volume / 100.0))); hr = IDirectSoundBuffer_SetVolume (lpDSBsecondary, vol); if (FAILED(hr)) - write_log ("SOUND: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log ("SOUND: SetVolume(%d) failed: %s\n", vol, DXError (hr)); setvolume_ahi (vol); } @@ -216,7 +216,7 @@ static void recalc_offsets(void) const static GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001,0x0000,0x0010, {0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}; #define KSAUDIO_SPEAKER_QUAD_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \ - SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) + SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) struct dsaudiomodes { int ch; @@ -241,7 +241,7 @@ static void fillsupportedmodes(int freq) supportedmodes[1].ksmode = 0; if (FAILED(IDirectSound8_GetSpeakerConfig(lpDS, &speakerconfig))) speakerconfig = DSSPEAKER_STEREO; - + memset (&wavfmt, 0, sizeof (WAVEFORMATEXTENSIBLE)); wavfmt.Format.nSamplesPerSec = freq; wavfmt.Format.wBitsPerSample = 16; @@ -251,8 +251,8 @@ static void fillsupportedmodes(int freq) wavfmt.Samples.wValidBitsPerSample = 16; for (ch = 4; ch <= 6; ch+= 2) { wavfmt.Format.nChannels = ch; - wavfmt.Format.nBlockAlign = wavfmt.Format.wBitsPerSample / 8 * wavfmt.Format.nChannels; - wavfmt.Format.nAvgBytesPerSec = wavfmt.Format.nBlockAlign * wavfmt.Format.nSamplesPerSec; + wavfmt.Format.nBlockAlign = wavfmt.Format.wBitsPerSample / 8 * wavfmt.Format.nChannels; + wavfmt.Format.nAvgBytesPerSec = wavfmt.Format.nBlockAlign * wavfmt.Format.nSamplesPerSec; if (ch == 6) { rn[0] = KSAUDIO_SPEAKER_5POINT1; rn[1] = KSAUDIO_SPEAKER_5POINT1_SURROUND; @@ -262,7 +262,7 @@ static void fillsupportedmodes(int freq) rn[1] = KSAUDIO_SPEAKER_QUAD_SURROUND; rn[2] = KSAUDIO_SPEAKER_SURROUND; rn[3] = 0; - } + } skip = sound_mode_skip; for (round = 0; rn[round]; round++) { if (skip > 0 && rn[round + 1] != 0) { @@ -286,10 +286,10 @@ static void fillsupportedmodes(int freq) } } } - write_log("SOUND: %08.8X ", speakerconfig); + write_log ("SOUND: %08.8X ", speakerconfig); for (i = 0; i < mode; i++) - write_log("%d:%08.8X ", supportedmodes[i].ch, supportedmodes[i].ksmode); - write_log("\n"); + write_log ("%d:%08.8X ", supportedmodes[i].ch, supportedmodes[i].ksmode); + write_log ("\n"); } static int open_audio_ds (int size) @@ -308,33 +308,33 @@ static int open_audio_ds (int size) snd_configsize = size; sndbufsize = size / 32; if (sndbufsize > SND_MAX_BUFFER) - sndbufsize = SND_MAX_BUFFER; + sndbufsize = SND_MAX_BUFFER; max_sndbufsize = size * 4; if (max_sndbufsize > SND_MAX_BUFFER2) - max_sndbufsize = SND_MAX_BUFFER2; + max_sndbufsize = SND_MAX_BUFFER2; dsoundbuf = max_sndbufsize * 2; if (dsoundbuf < DSBSIZE_MIN) - dsoundbuf = DSBSIZE_MIN; + dsoundbuf = DSBSIZE_MIN; if (dsoundbuf > DSBSIZE_MAX) - dsoundbuf = DSBSIZE_MAX; + dsoundbuf = DSBSIZE_MAX; if (max_sndbufsize * 2 > dsoundbuf) - max_sndbufsize = dsoundbuf / 2; + max_sndbufsize = dsoundbuf / 2; recalc_offsets(); hr = DirectSoundCreate8 (&sound_device_guid[currprefs.win32_soundcard], &lpDS, NULL); if (FAILED(hr)) { - write_log ("SOUND: DirectSoundCreate8() failure: %s\n", DXError (hr)); - return 0; + write_log ("SOUND: DirectSoundCreate8() failure: %s\n", DXError (hr)); + return 0; } hr = IDirectSound_SetCooperativeLevel (lpDS, hMainWnd, DSSCL_PRIORITY); if (FAILED(hr)) { - write_log ("SOUND: Can't set cooperativelevel: %s\n", DXError (hr)); - goto error; + write_log ("SOUND: Can't set cooperativelevel: %s\n", DXError (hr)); + goto error; } memset (&DSCaps, 0, sizeof (DSCaps)); @@ -353,23 +353,23 @@ static int open_audio_ds (int size) if (minfreq > freq && freq < 22050) { freq = minfreq; changed_prefs.sound_freq = currprefs.sound_freq = freq; - write_log("SOUND: minimum supported frequency: %d\n", minfreq); + write_log ("SOUND: minimum supported frequency: %d\n", minfreq); } if (maxfreq < freq && freq > 44100) { freq = maxfreq; changed_prefs.sound_freq = currprefs.sound_freq = freq; - write_log("SOUND: maximum supported frequency: %d\n", maxfreq); + write_log ("SOUND: maximum supported frequency: %d\n", maxfreq); } } fillsupportedmodes(freq); for (round = 0; supportedmodes[round].ch; round++) { - DWORD ksmode = 0; - + DWORD ksmode = 0; + pdsb = NULL; memset (&wavfmt, 0, sizeof (WAVEFORMATEXTENSIBLE)); - wavfmt.Format.nChannels = ch; + wavfmt.Format.nChannels = ch; wavfmt.Format.nSamplesPerSec = freq; wavfmt.Format.wBitsPerSample = 16; if (supportedmodes[round].ch != ch) @@ -402,13 +402,13 @@ static int open_audio_ds (int size) hr = IDirectSound_CreateSoundBuffer(lpDS, &sound_buffer, &pdsb, NULL); if (SUCCEEDED(hr)) break; - if (sound_buffer.dwFlags & DSBCAPS_LOCHARDWARE) { + if (sound_buffer.dwFlags & DSBCAPS_LOCHARDWARE) { HRESULT hr2 = hr; sound_buffer.dwFlags &= ~DSBCAPS_LOCHARDWARE; sound_buffer.dwFlags |= DSBCAPS_LOCSOFTWARE; hr = IDirectSound_CreateSoundBuffer(lpDS, &sound_buffer, &pdsb, NULL); if (SUCCEEDED(hr)) { - write_log("SOUND: Couldn't use hardware buffer (switched to software): %s\n", DXError (hr2)); + write_log ("SOUND: Couldn't use hardware buffer (switched to software): %s\n", DXError (hr2)); break; } } @@ -419,7 +419,7 @@ static int open_audio_ds (int size) goto error; hr = IDirectSound_QueryInterface(pdsb, &IID_IDirectSoundBuffer8, (LPVOID*)&lpDSBsecondary); if (FAILED(hr)) { - write_log ("SOUND: Secondary QueryInterface() failure: %s\n", DXError (hr)); + write_log ("SOUND: Secondary QueryInterface() failure: %s\n", DXError (hr)); goto error; } IDirectSound_Release(pdsb); @@ -565,7 +565,7 @@ void restart_sound_buffer(void) return; hr = IDirectSoundBuffer_GetCurrentPosition (lpDSBsecondary, &playpos, &safed); if (FAILED(hr)) { - write_log("SOUND: DirectSoundBuffer_GetCurrentPosition failed, %s\n", DXError(hr)); + write_log ("SOUND: DirectSoundBuffer_GetCurrentPosition failed, %s\n", DXError(hr)); return; } writepos = playpos + snd_writeoffset; @@ -597,7 +597,7 @@ static void finish_sound_buffer_ds (void) if (!waiting_for_buffer) return; if (savestate_state) - return; + return; if (waiting_for_buffer == 1) { hr = IDirectSoundBuffer_Play (lpDSBsecondary, 0, 0, DSBPLAY_LOOPING); @@ -623,11 +623,11 @@ static void finish_sound_buffer_ds (void) sleep_millis(1); counter--; if (counter < 0) { - write_log("SOUND: stuck?!?!\n"); + write_log ("SOUND: stuck?!?!\n"); break; } } - write_log("SOUND: %d = (%d - %d)\n", safedist - playpos, safedist, playpos); + write_log ("SOUND: %d = (%d - %d)\n", safedist - playpos, safedist, playpos); recalc_offsets(); safedist -= playpos; if (safedist < 64) @@ -645,7 +645,7 @@ static void finish_sound_buffer_ds (void) #endif waiting_for_buffer = -1; restart_sound_buffer(); - write_log("SOUND: bs=%d w=%d max=%d tof=%d tuf=%d\n", + write_log ("SOUND: bs=%d w=%d max=%d tof=%d tuf=%d\n", sndbufsize, snd_writeoffset, snd_maxoffset, snd_totalmaxoffset_of, snd_totalmaxoffset_uf); tfprev = timeframes + 10; @@ -706,7 +706,7 @@ static void finish_sound_buffer_ds (void) statuscnt = SND_STATUSCNT; restart_sound_buffer(); diff = snd_writeoffset; - write_log("SOUND: underflow (%d %d)\n", diff, snd_totalmaxoffset_of); + write_log ("SOUND: underflow (%d %d)\n", diff, snd_totalmaxoffset_of); break; } @@ -730,11 +730,11 @@ static void finish_sound_buffer_ds (void) return; if (FAILED(hr)) { write_log ("SOUND: lock failed: %s (%d %d)\n", DXError (hr), writepos, sndbufsize); - return; + return; } memcpy (b1, sndbuffer, s1); if (b2) - memcpy (b2, (uae_u8*)sndbuffer + s1, s2); + memcpy (b2, (uae_u8*)sndbuffer + s1, s2); IDirectSoundBuffer_Unlock (lpDSBsecondary, b1, s1, b2, s2); vdiff = diff - snd_writeoffset; @@ -767,9 +767,9 @@ static void finish_sound_buffer_ds (void) write_log ("b=%4d,%5d,%5d,%5d d=%5d vd=%5.0f s=%+02.1f\n", sndbufsize, snd_configsize, max_sndbufsize, dsoundbuf, diff, vdiff, skipmode); tfprev = timeframes; - if (!avioutput_audio) + if (!avioutput_audio) sound_setadjust (skipmode); - gui_data.sndbuf = vdiff * 1000 / (snd_maxoffset - snd_writeoffset); + gui_data.sndbuf = vdiff * 1000 / (snd_maxoffset - snd_writeoffset); } writepos += sndbufsize; @@ -813,7 +813,7 @@ void finish_sound_buffer (void) #endif #ifdef AVIOUTPUT if (avioutput_audio) - AVIOutput_WriteAudio ((uae_u8*)sndbuffer, sndbufsize); + AVIOutput_WriteAudio ((uae_u8*)sndbuffer, sndbufsize); if (avioutput_enabled && (!avioutput_framelimiter || avioutput_nosoundoutput)) return; #endif @@ -837,7 +837,7 @@ static BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrv char **enumerate_sound_devices (int *total) { if (!num_sound_devices) - DirectSoundEnumerate ((LPDSENUMCALLBACK)DSEnumProc, 0); + DirectSoundEnumerate ((LPDSENUMCALLBACK)DSEnumProc, 0); if (total) *total = num_sound_devices; if (currprefs.win32_soundcard >= num_sound_devices) @@ -848,7 +848,7 @@ char **enumerate_sound_devices (int *total) } #include -#include +#include /* Based on @@ -865,7 +865,7 @@ const static GUID XIID_IAudioEndpointVolume = {0x5CDF2C82, 0x841E,0x4546, static int setget_master_volume_vista(int setvolume, int *volume, int *mute) { IMMDeviceEnumerator *deviceEnumerator = NULL; - IMMDevice *defaultDevice = NULL; + IMMDevice *defaultDevice = NULL; IAudioEndpointVolume *endpointVolume = NULL; HRESULT hr; int ok = 0; @@ -895,7 +895,7 @@ static int setget_master_volume_vista(int setvolume, int *volume, int *mute) ok++; } } - endpointVolume->lpVtbl->Release(endpointVolume); + endpointVolume->lpVtbl->Release(endpointVolume); } defaultDevice->lpVtbl->Release(defaultDevice); } @@ -910,9 +910,9 @@ static void mcierr(char *str, DWORD err) if (err == MMSYSERR_NOERROR) return; if (mciGetErrorString(err, es, sizeof es)) - write_log("MCIErr: %s: %d = '%s'\n", str, err, es); + write_log ("MCIErr: %s: %d = '%s'\n", str, err, es); else - write_log("%s, errcode=%d\n", str, err); + write_log ("%s, errcode=%d\n", str, err); } /* from http://www.codeproject.com/audio/mixerSetControlDetails.asp */ static int setget_master_volume_xp(int setvolume, int *volume, int *mute) @@ -936,7 +936,7 @@ static int setget_master_volume_xp(int setvolume, int *volume, int *mute) ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_DIGITAL; result = mixerGetLineInfo((HMIXEROBJ) hMixer, &ml, MIXER_GETLINEINFOF_COMPONENTTYPE); } - if (result == MMSYSERR_NOERROR) { + if (result == MMSYSERR_NOERROR) { mlc.cbStruct = sizeof(MIXERLINECONTROLS); mlc.dwLineID = ml.dwLineID; mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; @@ -967,7 +967,7 @@ static int setget_master_volume_xp(int setvolume, int *volume, int *mute) mcb.fValue = 0; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); if (setvolume) { - mcb.fValue = *mute; + mcb.fValue = *mute; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE); } else { result = mixerGetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_GETCONTROLDETAILSF_VALUE); diff --git a/od-win32/sounddep/sound.h b/od-win32/sounddep/sound.h index 343c7da8..bb604703 100755 --- a/od-win32/sounddep/sound.h +++ b/od-win32/sounddep/sound.h @@ -1,8 +1,8 @@ -/* +/* * UAE - The Un*x Amiga Emulator - * + * * Support for Linux/USS sound - * + * * Copyright 1997 Bernd Schmidt */ diff --git a/od-win32/support.c b/od-win32/support.c index 817f1bf6..f0c07d82 100755 --- a/od-win32/support.c +++ b/od-win32/support.c @@ -1,6 +1,6 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Miscellaneous machine dependent support functions and definitions * * Copyright 1996 Bernd Schmidt diff --git a/od-win32/win32.c b/od-win32/win32.c index 3f34bc05..fcf9b082 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -270,13 +270,13 @@ static int figure_processor_speed (void) int i, ratecnt = 5; LARGE_INTEGER freq; int qpc_avail = 0; - int mmx = 0; + int mmx = 0; rpt_available = no_rdtsc > 0 ? 0 : 1; #ifdef X86_MSVC_ASSEMBLY __try { - __asm + __asm { rdtsc } @@ -286,7 +286,7 @@ static int figure_processor_speed (void) } __try { - __asm + __asm { mov eax,1 cpuid @@ -313,12 +313,12 @@ static int figure_processor_speed (void) qpcdivisor++; qpc_avail = -1; } - write_log("CLOCKFREQ: QPF %.2fMHz (%.2fMHz, DIV=%d)\n", freq.QuadPart / 1000000.0, + write_log ("CLOCKFREQ: QPF %.2fMHz (%.2fMHz, DIV=%d)\n", freq.QuadPart / 1000000.0, qpfrate / 1000000.0, 1 << qpcdivisor); if (SystemInfo.dwNumberOfProcessors > 1 && no_rdtsc >= 0) rpt_available = 0; /* RDTSC can be weird in SMP-systems */ } else { - write_log("CLOCKREQ: QPF not supported\n"); + write_log ("CLOCKREQ: QPF not supported\n"); } if (!rpt_available && !qpc_avail) { @@ -344,7 +344,7 @@ static int figure_processor_speed (void) clockrate = win32_read_processor_time(); sleep_millis (500); clockrate = (win32_read_processor_time() - clockrate) * 2; - write_log("CLOCKFREQ: RDTSC %.2fMHz (busy) / %.2fMHz (idle)\n", + write_log ("CLOCKFREQ: RDTSC %.2fMHz (busy) / %.2fMHz (idle)\n", clockrate / 1000000.0, clockrateidle / 1000000.0); clkdiv = (double)clockrate / (double)clockrateidle; clockrate >>= 6; @@ -388,7 +388,7 @@ static int figure_processor_speed (void) write_log ("%1.2fms ", rate1 / clockrate1000); ratea1 += rate1; } - write_log("\n"); + write_log ("\n"); timeend (); sleep_millis (50); } @@ -402,7 +402,7 @@ static int figure_processor_speed (void) write_log ("%1.2fms ", rate2 / clockrate1000); ratea2 += rate2; } - write_log("\n"); + write_log ("\n"); } SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); @@ -568,7 +568,7 @@ static void winuae_active (HWND hWnd, int minimized) sleep_millis (2); timermode = ot; if (timermode != 0) - timeend(); + timeend(); focus = 1; pri = &priorities[currprefs.win32_inactive_priority]; @@ -742,7 +742,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, recursive--; return 0; } - break; + break; case WM_ACTIVATE: if (recursive) return 0; @@ -769,7 +769,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } } recursive--; - return 0; + return 0; case WM_ACTIVATEAPP: { @@ -794,7 +794,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } manual_palette_refresh_needed = 1; recursive--; - return 0; + return 0; } case WM_PALETTECHANGED: @@ -896,7 +896,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, case WM_DROPFILES: dragdrop (hWnd, (HDROP)wParam, &changed_prefs, -1); break; - + case WM_TIMER: #ifdef PARALLEL_PORT finishjob (); @@ -1030,7 +1030,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, case 0xff: // WM_INPUT: handle_rawinput (lParam); break; - + case WM_NOTIFY: { LPNMHDR nm = (LPNMHDR)lParam; @@ -1041,7 +1041,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, case NM_CLICK: case NM_RCLICK: { - LPNMMOUSE lpnm = (LPNMMOUSE) lParam; + LPNMMOUSE lpnm = (LPNMMOUSE) lParam; int num = (int)lpnm->dwItemSpec; if (num >= 7 && num <= 10) { num -= 7; @@ -1063,7 +1063,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } } break; - + case WM_USER + 1: /* Systray icon */ switch (lParam) { @@ -1204,7 +1204,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, RECT rc2; if (GetWindowRect(hMainWnd, &rc2)) { DWORD left = rc2.left - win_x_diff; - DWORD top = rc2.top - win_y_diff; + DWORD top = rc2.top - win_y_diff; if (amigawin_rect.left & 3) { MoveWindow (hMainWnd, rc2.left + 4 - amigawin_rect.left % 4, rc2.top, rc2.right - rc2.left, rc2.bottom - rc2.top, TRUE); @@ -1307,7 +1307,7 @@ int WIN32_RegisterClasses( void ) g_dwBackgroundColor = RGB(10, 0, 10); hDC = GetDC (NULL); - if (GetDeviceCaps (hDC, NUMCOLORS) != -1) + if (GetDeviceCaps (hDC, NUMCOLORS) != -1) g_dwBackgroundColor = RGB (255, 0, 255); ReleaseDC (NULL, hDC); @@ -1336,7 +1336,7 @@ int WIN32_RegisterClasses( void ) wc.lpszClassName = "PCsuxRox"; if (!RegisterClass (&wc)) return 0; - + wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW; wc.lpfnWndProc = HiddenWindowProc; wc.cbClsExtra = 0; @@ -1349,12 +1349,12 @@ int WIN32_RegisterClasses( void ) wc.lpszClassName = "Useless"; if (!RegisterClass (&wc)) return 0; - + hHiddenWnd = CreateWindowEx (0, "Useless", "You don't see me", WS_POPUP, 0, 0, - 1, 1, + 1, 1, NULL, NULL, 0, NULL); if (!hHiddenWnd) return 0; @@ -1373,7 +1373,7 @@ int WIN32_CleanupLibraries( void ) { if (hRichEdit) FreeLibrary(hRichEdit); - + if (hHtmlHelp) FreeLibrary(hHtmlHelp); @@ -1492,7 +1492,7 @@ HMODULE language_load(WORD language) char *dllname; if (language <= 0) { - /* new user-specific Windows ME/2K/XP method to get UI language */ + /* new user-specific Windows ME/2K/XP method to get UI language */ pGetUserDefaultUILanguage = (PGETUSERDEFAULTUILANGUAGE)GetProcAddress( GetModuleHandle("kernel32.dll"), "GetUserDefaultUILanguage"); language = GetUserDefaultLangID(); @@ -1567,7 +1567,7 @@ struct threadpriorities priorities[] = { static void pritransla (void) { int i; - + for (i = 0; priorities[i].id; i++) { char tmp[MAX_DPATH]; WIN32GUI_LoadUIString (priorities[i].id, tmp, sizeof (tmp)); @@ -1581,7 +1581,7 @@ static void WIN32_InitLang(void) if (hWinUAEKey) { DWORD regkeytype; DWORD regkeysize = sizeof(langid); - RegQueryValueEx (hWinUAEKey, "Language", 0, ®keytype, (LPBYTE)&langid, ®keysize); + RegQueryValueEx (hWinUAEKey, "Language", 0, ®keytype, (LPBYTE)&langid, ®keysize); } hUIDLL = language_load(langid); pritransla (); @@ -1594,12 +1594,12 @@ static int WIN32_InitLibraries( void ) /* Determine our processor speed and capabilities */ if (!figure_processor_speed()) return 0; - + /* Make sure we do an InitCommonControls() to get some advanced controls */ InitCommonControls(); - + hRichEdit = LoadLibrary ("RICHED32.DLL"); - + return result; } @@ -1650,7 +1650,7 @@ void logging_init(void) return; } if (first == 1) { - write_log("Log (%s): '%s%s'\n", currprefs.win32_logfile ? "enabled" : "disabled", + write_log ("Log (%s): '%s%s'\n", currprefs.win32_logfile ? "enabled" : "disabled", start_path_data, LOG_NORMAL); if (debugfile) log_close (debugfile); @@ -1847,7 +1847,7 @@ static int fetchpri (int pri, int defpri) static const char *obsolete[] = { "killwinkeys", "sound_force_primary", "iconified_highpriority", "sound_sync", "sound_tweak", "directx6", "sound_style", - "file_path", "iconified_nospeed", "activepriority", + "file_path", "iconified_nospeed", "activepriority", 0 }; @@ -1992,10 +1992,10 @@ static int isfilesindir(char *p) strcat (path, "\\*.*"); h = FindFirstFile(path, &fd); if (h != INVALID_HANDLE_VALUE) { - for (i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { if (!FindNextFile (h, &fd)) - break; - } + break; + } FindClose(h); } if (i == 3) @@ -2063,23 +2063,23 @@ int get_rom_path(char *out, int mode) } } } - break; + break; case 1: { - char tmp2[MAX_DPATH]; + char tmp2[MAX_DPATH]; strcpy (tmp2, start_path_new1); strcat (tmp2, "..\\system\\rom"); if (isfilesindir(tmp2)) - strcpy (tmp, tmp2); + strcpy (tmp, tmp2); } - break; + break; case 2: { char tmp2[MAX_DPATH]; strcpy (tmp2, start_path_new2); strcat (tmp2, "system\\rom"); if (isfilesindir(tmp2)) - strcpy (tmp, tmp2); + strcpy (tmp, tmp2); } break; case 3: @@ -2088,15 +2088,15 @@ int get_rom_path(char *out, int mode) strcpy (tmp2, start_path_af); strcat (tmp2, "..\\shared\\rom"); if (isfilesindir(tmp2)) - strcpy (tmp, tmp2); + strcpy (tmp, tmp2); } break; default: - return -1; + return -1; } if (isfilesindir(tmp)) { strcpy (out, tmp); - fixtrailing (out); + fixtrailing (out); } return out[0] ? 1 : 0; } @@ -2201,7 +2201,7 @@ static int parseversion (char **vs) { char tmp[10]; int i; - + i = 0; while (**vs >= '0' && **vs <= '9') { if (i >= sizeof (tmp)) @@ -2330,7 +2330,7 @@ static void WIN32_HandleRegistryStuff(void) if (RegSetValueEx (hWinUAEKey, "ROMCheckVersion", 0, REG_SZ, (CONST BYTE *)VersionStr, strlen (VersionStr) + 1) == ERROR_SUCCESS) forceroms = 1; } - + size = sizeof (quickstart); dwType = REG_DWORD; RegQueryValueEx(hWinUAEKey, "QuickStartMode", 0, &dwType, (LPBYTE)&quickstart, &size); @@ -2383,7 +2383,7 @@ static int betamessage (void) if (!hWinUAEKey) break; - if (GetModuleFileName(NULL, tmp1, sizeof tmp1) == 0) + if (GetModuleFileName(NULL, tmp1, sizeof tmp1) == 0) break; h = CreateFile(tmp1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) @@ -2417,7 +2417,7 @@ static int betamessage (void) size = sizeof data; if (hWinUAEKey && RegQueryValueEx(hWinUAEKey, "Beta_Just_Shut_Up", 0, &dwType, (LPBYTE)&data, &size) == ERROR_SUCCESS) { if (data == 68000) { - write_log("I was told to shut up :(\n"); + write_log ("I was told to shut up :(\n"); return 1; } } @@ -2462,7 +2462,7 @@ static int dxdetect (void) int os_winnt, os_winnt_admin, os_64bit, os_vista, os_winxp; -static int isadminpriv (void) +static int isadminpriv (void) { DWORD i, dwSize = 0, dwResult = 0; HANDLE hToken; @@ -2471,7 +2471,7 @@ static int isadminpriv (void) PSID pSID = (PSID)&sidBuffer; SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY; int isadmin = 0; - + // Open a handle to the access token for the calling process. if (!OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &hToken)) { write_log ("OpenProcessToken Error %u\n", GetLastError()); @@ -2482,7 +2482,7 @@ static int isadminpriv (void) if(!GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize)) { dwResult = GetLastError(); if(dwResult != ERROR_INSUFFICIENT_BUFFER) { - write_log("GetTokenInformation Error %u\n", dwResult); + write_log ("GetTokenInformation Error %u\n", dwResult); return FALSE; } } @@ -2502,7 +2502,7 @@ static int isadminpriv (void) DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSID)) { - write_log( "AllocateAndInitializeSid Error %u\n", GetLastError() ); + write_log ( "AllocateAndInitializeSid Error %u\n", GetLastError() ); return FALSE; } @@ -2511,7 +2511,7 @@ static int isadminpriv (void) if (EqualSid(pSID, pGroupInfo->Groups[i].Sid)) isadmin = 1; } - + if (pSID) FreeSid(pSID); if (pGroupInfo) @@ -2585,15 +2585,15 @@ void create_afnewdir(int remove) pSHGetSpecialFolderPath = (SHGETSPECIALFOLDERPATH)GetProcAddress( GetModuleHandle("shell32.dll"), "SHGetSpecialFolderPathA"); if (pSHGetFolderPath) - ok = SUCCEEDED(pSHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, 0, tmp)); + ok = SUCCEEDED(pSHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, 0, tmp)); else if (pSHGetSpecialFolderPath) - ok = pSHGetSpecialFolderPath(NULL, tmp, CSIDL_COMMON_DOCUMENTS, 0); + ok = pSHGetSpecialFolderPath(NULL, tmp, CSIDL_COMMON_DOCUMENTS, 0); if (ok) { - fixtrailing(tmp); - strcpy (tmp2, tmp); - strcat (tmp2, "Amiga Files"); - strcpy (tmp, tmp2); - strcat(tmp, "\\WinUAE"); + fixtrailing(tmp); + strcpy (tmp2, tmp); + strcat (tmp2, "Amiga Files"); + strcpy (tmp, tmp2); + strcat(tmp, "\\WinUAE"); if (remove) { if (GetFileAttributes(tmp) != INVALID_FILE_ATTRIBUTES) { RemoveDirectory(tmp); @@ -2624,7 +2624,7 @@ static void getstartpaths(void) KEY_WRITE | KEY_READ, NULL, &key, &dispo) == ERROR_SUCCESS) { DWORD size = sizeof (prevpath); - DWORD dwType = REG_SZ; + DWORD dwType = REG_SZ; if (RegQueryValueEx (key, "PathMode", 0, &dwType, (LPBYTE)&prevpath, &size) != ERROR_SUCCESS) prevpath[0] = 0; RegCloseKey(key); @@ -2651,12 +2651,12 @@ static void getstartpaths(void) strcpy (tmp, start_path_exe); strcat (tmp, "roms"); if (isfilesindir(tmp)) { - strcpy (xstart_path_uae, start_path_exe); + strcpy (xstart_path_uae, start_path_exe); } strcpy (tmp, start_path_exe); strcat (tmp, "configurations"); if (isfilesindir(tmp)) { - strcpy (xstart_path_uae, start_path_exe); + strcpy (xstart_path_uae, start_path_exe); } strcpy (tmp, start_path_exe); @@ -3081,7 +3081,7 @@ int driveclick_loadresource (struct drvsample *sp, int drivetype) static LONG WINAPI WIN32_ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec) { - write_log("EVALEXCEPTION!\n"); + write_log ("EVALEXCEPTION!\n"); return EXCEPTION_EXECUTE_HANDLER; } #else @@ -3120,7 +3120,7 @@ LONG WINAPI WIN32_ExceptionFilter(struct _EXCEPTION_POINTERS *pExceptionPointers if ((p >= (void*)regs.pc_p && p < (void*)(regs.pc_p + 32)) || (p >= (void*)prevpc && p < (void*)(prevpc + 32))) { int got = 0; - uaecptr opc = m68k_getpc(®s); + uaecptr opc = m68k_getpc (®s); void *ps = get_real_address (0); m68k_dumpstate (0, 0); efix (&ctx->Eax, p, ps, &got); @@ -3273,7 +3273,7 @@ static void LLError(const char *s) if (err == ERROR_MOD_NOT_FOUND || err == ERROR_DLL_NOT_FOUND) return; - write_log("%s failed to open %d\n", s, err); + write_log ("%s failed to open %d\n", s, err); } HMODULE WIN32_LoadLibrary (const char *name) @@ -3346,7 +3346,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin HANDLE thread; thread = GetCurrentThread(); - original_affinity = SetThreadAffinityMask(thread, 1); + original_affinity = SetThreadAffinityMask(thread, 1); #if 0 CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter; pChangeWindowMessageFilter = (CHANGEWINDOWMESSAGEFILTER)GetProcAddress( diff --git a/od-win32/win32.h b/od-win32/win32.h index 2d387765..463adcc8 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -1,8 +1,8 @@ -/* +/* * UAE - The Un*x Amiga Emulator - * + * * Win32-specific header file - * + * * (c) 1997-1999 Mathias Ortmann * (c) 1998-2001 Brian King */ @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 1 +#define WINUAEBETA 2 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 8, 19) +#define WINUAEDATE MAKEBD(2007, 9, 2) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32_decompress.c b/od-win32/win32_decompress.c index 5ea42bc3..7e69069c 100755 --- a/od-win32/win32_decompress.c +++ b/od-win32/win32_decompress.c @@ -17,26 +17,26 @@ #include "zfile.h" typedef UINT32 (WINAPI * CreateObjectFunc)( - const GUID *clsID, - const GUID *interfaceID, + const GUID *clsID, + const GUID *interfaceID, void **outObject); DEFINE_GUID (IID_IInArchive, 0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00); DEFINE_GUID (CLSID_CFormat7z, 0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x05, 0x00, 0x00); STDMETHOD(Open)(IInStream *stream, const UINT64 *maxCheckStartPosition, - IArchiveOpenCallback *openArchiveCallback) PURE; -STDMETHOD(Close)(void) PURE; -STDMETHOD(GetNumberOfItems)(UINT32 *numItems) PURE; + IArchiveOpenCallback *openArchiveCallback) PURE; +STDMETHOD(Close)(void) PURE; +STDMETHOD(GetNumberOfItems)(UINT32 *numItems) PURE; STDMETHOD(GetProperty)(UINT32 index, PROPID propID, PROPVARIANT *value) PURE; -STDMETHOD(Extract)(const UINT32* indices, UINT32 numItems, +STDMETHOD(Extract)(const UINT32* indices, UINT32 numItems, INT32 testMode, IArchiveExtractCallback *extractCallback) PURE; STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE; -STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties) PURE; -STDMETHOD(GetPropertyInfo)(UINT32 index, +STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties) PURE; +STDMETHOD(GetPropertyInfo)(UINT32 index, BSTR *name, PROPID *propID, VARTYPE *varType) PURE; -STDMETHOD(GetNumberOfArchiveProperties)(UINT32 *numProperties) PURE; -STDMETHOD(GetArchivePropertyInfo)(UINT32 index, +STDMETHOD(GetNumberOfArchiveProperties)(UINT32 *numProperties) PURE; +STDMETHOD(GetArchivePropertyInfo)(UINT32 index, BSTR *name, PROPID *propID, VARTYPE *varType) PURE; void test7z (void) @@ -44,7 +44,7 @@ void test7z (void) HMODULE lib; CreateObjectFunc createObjectFunc; void *archive; - + lib = LoadLibrary ("7z.dll"); if (!lib) return; @@ -53,20 +53,19 @@ void test7z (void) return; } - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + diff --git a/od-win32/win32_nogui.c b/od-win32/win32_nogui.c index f5d0f276..7b9581f1 100755 --- a/od-win32/win32_nogui.c +++ b/od-win32/win32_nogui.c @@ -88,7 +88,7 @@ void sleep_millis (int ms) Sleep (ms); } else { WaitForSingleObject (timehandle, ms); - ResetEvent (timehandle); + ResetEvent (timehandle); timeKillEvent (TimerEvent); } } @@ -113,9 +113,9 @@ static uae_u64 win32_read_processor_time (void) uae_u32 foo, bar; __asm { - rdtsc - mov foo, eax - mov bar, edx + rdtsc + mov foo, eax + mov bar, edx } return ((uae_u64)bar << 32) | foo; } @@ -130,12 +130,12 @@ static int figure_processor_speed (void) int i, ratecnt = 6; LARGE_INTEGER freq; int qpc_avail = 0; - int mmx = 0; + int mmx = 0; rpt_available = 1; __try { - __asm + __asm { rdtsc } @@ -145,7 +145,7 @@ static int figure_processor_speed (void) } __try { - __asm + __asm { mov eax,1 cpuid @@ -159,7 +159,7 @@ static int figure_processor_speed (void) if (QueryPerformanceFrequency(&freq)) { qpc_avail = 1; - write_log("CLOCKFREQ: QPF %.2fMHz\n", freq.QuadPart / 1000000.0); + write_log ("CLOCKFREQ: QPF %.2fMHz\n", freq.QuadPart / 1000000.0); qpfrate = freq.QuadPart; /* we don't want 32-bit overflow */ if (qpfrate > 100000000) { @@ -167,7 +167,7 @@ static int figure_processor_speed (void) qpc_avail = -1; } } else { - write_log("CLOCKREQ: QPF not supported\n"); + write_log ("CLOCKREQ: QPF not supported\n"); } if (!rpt_available && !qpc_avail) @@ -190,7 +190,7 @@ static int figure_processor_speed (void) clockrate = win32_read_processor_time(); sleep_millis (500); clockrate = (win32_read_processor_time() - clockrate) * 2; - write_log("CLOCKFREQ: RDTSC %.2fMHz (busy) / %.2fMHz (idle)\n", + write_log ("CLOCKFREQ: RDTSC %.2fMHz (busy) / %.2fMHz (idle)\n", clockrate / 1000000.0, clockrateidle / 1000000.0); clkdiv = (double)clockrate / (double)clockrateidle; clockrate >>= 6; @@ -205,7 +205,7 @@ static int figure_processor_speed (void) clockrate = qpfrate; clockrate1000 = clockrate / 1000.0; if (dummythread_die < 0) { - dummythread_die = 0; + dummythread_die = 0; _beginthread(&dummythread, 0, 0); } if (!qpc_avail) @@ -225,7 +225,7 @@ static int figure_processor_speed (void) write_log ("%1.2fms ", rate1 / clockrate1000); ratea1 += rate1; } - write_log("\n"); + write_log ("\n"); timeend (); sleep_millis (50); } @@ -239,12 +239,12 @@ static int figure_processor_speed (void) write_log ("%1.2fms ", rate2 / clockrate1000); ratea2 += rate2; } - write_log("\n"); + write_log ("\n"); } SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_NORMAL); dummythread_die = 1; - + if (clkdiv >= 0.90 && clkdiv <= 1.10 && rpt_available) { limit = 2.5; if ((ratea2 / ratecnt) < limit * clockrate1000) { /* regular Sleep() is ok */ @@ -402,7 +402,7 @@ void logging_init( void ) if (first == 1) { if (debugfile) fclose (debugfile); - debugfile = 0; + debugfile = 0; } if( currprefs.win32_logfile ) { sprintf( debugfilename, "%s\\winuaelog.txt", start_path ); @@ -466,13 +466,13 @@ int _stdcall WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmd, int show) { char **argv, *posn; int argc; - + hInst = hInstance; argc = __argc; argv = __argv; start_path = xmalloc( MAX_DPATH ); GetModuleFileName( NULL, start_path, MAX_DPATH ); if( ( posn = strrchr( start_path, '\\' ) ) ) - *posn = 0; + *posn = 0; real_main (argc, argv); if (mm_timerres && timermode == 0) timeend (); diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 925de4cd..3e815091 100755 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -90,11 +90,11 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd) DirectDrawState.temporary.desc.dwWidth = dst_width; DirectDrawState.temporary.desc.dwHeight = dst_height; if (DirectDraw_GetPrimaryPixelFormat (&DirectDrawState.temporary.desc.ddpfPixelFormat)) - DirectDrawState.temporary.desc.dwFlags |= DDSD_PIXELFORMAT; - ddrval = IDirectDraw7_CreateSurface (DirectDrawState.directdraw.dd, - &DirectDrawState.temporary.desc, - &DirectDrawState.temporary.surface, - NULL); + DirectDrawState.temporary.desc.dwFlags |= DDSD_PIXELFORMAT; + ddrval = IDirectDraw7_CreateSurface (DirectDrawState.directdraw.dd, + &DirectDrawState.temporary.desc, + &DirectDrawState.temporary.surface, + NULL); if (FAILED(ddrval)) { write_log ("DDRAW: failed to create temp surface\n%s\n", DXError (ddrval)); tempsurf = 0; @@ -132,9 +132,9 @@ void S2X_render (void) ah -= (int)(-v * 4.0 / 10); if (aw * scale > dst_width) - aw = dst_width / scale; + aw = dst_width / scale; if (ah * scale > dst_height) - ah = dst_height / scale; + ah = dst_height / scale; if (ah < 16) return; @@ -202,7 +202,7 @@ void S2X_render (void) return; } } - dptr = (uae_u8*)desc.lpSurface; + dptr = (uae_u8*)desc.lpSurface; pitch = desc.lPitch; } else { if (!DirectDraw_SurfaceLock (lockable_surface)) @@ -213,7 +213,7 @@ void S2X_render (void) if (usedfilter->type == UAE_FILTER_SCALE2X ) { /* 16+32/2X */ - if (amiga_depth == 16 && dst_depth == 16) { + if (amiga_depth == 16 && dst_depth == 16) { AdMame2x (sptr, gfxvidinfo.rowbytes, dptr, pitch, aw, ah); ok = 1; } else if (amiga_depth == 32 && dst_depth == 32) { @@ -224,7 +224,7 @@ void S2X_render (void) #if 0 } else if (usedfilter->type == UAE_FILTER_HQ) { /* 32/2X+3X+4X */ - int hqsrcpitch = gfxvidinfo.rowbytes - aw * amiga_depth / 8; + int hqsrcpitch = gfxvidinfo.rowbytes - aw * amiga_depth / 8; int hqdstpitch = pitch - aw * scale * dst_depth / 8; int hqdstpitch2 = pitch * scale - aw * scale * dst_depth / 8; if (scale == 2) { @@ -237,7 +237,7 @@ void S2X_render (void) hq3x_16 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); ok = 1; } else if (amiga_depth == 16 && dst_depth == 32) { - hq3x_32 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); + hq3x_32 (sptr, dptr, aw, ah, hqdstpitch, hqsrcpitch, hqdstpitch2); ok = 1; } } else if (scale == 4) { @@ -257,7 +257,7 @@ void S2X_render (void) } else if (usedfilter->type == UAE_FILTER_SUPER2XSAI) { /* 16/2X */ if (scale == 2 && amiga_depth == 16 && dst_depth == 16) { - Super2xSaI (sptr, gfxvidinfo.rowbytes, dptr, pitch, aw, ah); + Super2xSaI (sptr, gfxvidinfo.rowbytes, dptr, pitch, aw, ah); ok = 1; } @@ -270,7 +270,7 @@ void S2X_render (void) } else if (usedfilter->type == UAE_FILTER_PAL) { /* 16/32/1X */ - if (amiga_depth == 32 && dst_depth == 32) { + if (amiga_depth == 32 && dst_depth == 32) { PAL_1x1_32((uae_u32*)sptr, gfxvidinfo.rowbytes, (uae_u32*)dptr, pitch, aw, ah); ok = 1; } else if (amiga_depth == 16 && dst_depth == 16) { @@ -296,12 +296,12 @@ void S2X_render (void) } if (ok == 0 && currprefs.gfx_filter) { - usedfilter = &uaefilters[0]; - changed_prefs.gfx_filter = usedfilter->type; + usedfilter = &uaefilters[0]; + changed_prefs.gfx_filter = usedfilter->type; } if (temp_needed) { - IDirectDrawSurface7_Unlock (dds, NULL); + IDirectDrawSurface7_Unlock (dds, NULL); DirectDraw_Blt (DirectDraw_GetLockableType(), &dr, temporary_surface, &sr, 0, NULL); } else { DirectDraw_SurfaceUnlock (); @@ -314,7 +314,7 @@ void S2X_refresh (void) uae_u8 *dptr; if (!DirectDraw_SurfaceLock (lockable_surface)) - return; + return; dptr = DirectDraw_GetSurfacePointer (); pitch = DirectDraw_GetSurfacePitch(); for (y = 0; y < dst_height; y++) diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index 5e4927ff..ac724aa7 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -348,20 +348,20 @@ static int set_ddraw (void) goto oops; if (dxfullscreen) { - write_log( "set_ddraw: Trying %dx%d, bits=%d, refreshrate=%d\n", width, height, bits, freq ); + write_log ( "set_ddraw: Trying %dx%d, bits=%d, refreshrate=%d\n", width, height, bits, freq ); ddrval = DirectDraw_SetDisplayMode (width, height, bits, freq); if (FAILED(ddrval)) { write_log ("set_ddraw: failed, trying without forced refresh rate\n"); ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); if (FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't SetDisplayMode()\n" ); + write_log ( "set_ddraw: Couldn't SetDisplayMode()\n" ); goto oops; } } ddrval = DirectDraw_GetDisplayMode(); if (FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't GetDisplayMode()\n" ); + write_log ( "set_ddraw: Couldn't GetDisplayMode()\n" ); goto oops; } } @@ -369,19 +369,19 @@ static int set_ddraw (void) if (dd) { ddrval = DirectDraw_CreateClipper(); if (FAILED(ddrval)) { - write_log( "set_ddraw: No clipping support\n" ); + write_log ( "set_ddraw: No clipping support\n" ); goto oops; } ddrval = DirectDraw_CreateSurface (width, height); if (FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't CreateSurface() for primary because %s.\n", DXError( ddrval ) ); + write_log ( "set_ddraw: Couldn't CreateSurface() for primary because %s.\n", DXError( ddrval ) ); goto oops; } if (DirectDraw_GetPrimaryBitCount() != (unsigned)bits && overlay) { ddrval = DirectDraw_CreateOverlaySurface (width, height, bits, 0); if(FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't CreateOverlaySurface(%d,%d,%d) because %s.\n", width, height, bits, DXError( ddrval ) ); + write_log ( "set_ddraw: Couldn't CreateOverlaySurface(%d,%d,%d) because %s.\n", width, height, bits, DXError( ddrval ) ); goto oops2; } } else { @@ -392,14 +392,14 @@ static int set_ddraw (void) if (!DirectDraw_DetermineLocking (dxfullscreen)) { - write_log( "set_ddraw: Couldn't determine locking.\n" ); + write_log ( "set_ddraw: Couldn't determine locking.\n" ); goto oops; } ddrval = DirectDraw_SetClipper (hAmigaWnd); if (FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't SetHWnd()\n" ); + write_log ( "set_ddraw: Couldn't SetHWnd()\n" ); goto oops; } @@ -407,7 +407,7 @@ static int set_ddraw (void) ddrval = DirectDraw_CreatePalette (currentmode->pal); if (FAILED(ddrval)) { - write_log( "set_ddraw: Couldn't CreatePalette()\n" ); + write_log ( "set_ddraw: Couldn't CreatePalette()\n" ); goto oops; } } @@ -525,7 +525,7 @@ static void sortmodes (void) pw = DisplayModes[i].res.width; idx++; } - DisplayModes[i].residx = idx; + DisplayModes[i].residx = idx; } } @@ -539,11 +539,11 @@ static void modesList (void) j = 0; while (DisplayModes[i].refresh[j] > 0) { if (j > 0) - write_log(","); + write_log (","); write_log ("%d", DisplayModes[i].refresh[j]); j++; } - write_log(")\n"); + write_log (")\n"); i++; } } @@ -562,7 +562,7 @@ BOOL CALLBACK displaysCallback (GUID *guid, LPSTR desc, LPSTR name, LPVOID ctx, if (guid == 0) { POINT pt = { 0, 0 }; md->primary = 1; - lpmi.cbSize = sizeof (lpmi); + lpmi.cbSize = sizeof (lpmi); GetMonitorInfo(MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&lpmi); md->rect = lpmi.rcMonitor; } else { @@ -667,7 +667,7 @@ int WIN32GFX_AdjustScreenmode(uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbi : *ppixbits == 24 ? RGBMASK_24BIT : RGBMASK_32BIT); int pass, i = 0, index = 0; - + for (pass = 0; pass < 2; pass++) { struct PicassoResolution *dm; uae_u32 mask = (pass == 0 @@ -960,10 +960,10 @@ void gfx_unlock_picasso (void) relock = TRUE; unlockscr(); } - DX_Blit (p96_double_buffer_firstx, p96_double_buffer_first, - p96_double_buffer_firstx, p96_double_buffer_first, + DX_Blit (p96_double_buffer_firstx, p96_double_buffer_first, + p96_double_buffer_firstx, p96_double_buffer_first, p96_double_buffer_lastx - p96_double_buffer_firstx + 1, - p96_double_buffer_last - p96_double_buffer_first + 1, + p96_double_buffer_last - p96_double_buffer_first + 1, BLIT_SRC); if (relock) { lockscr(); @@ -1108,7 +1108,7 @@ int check_prefs_changed_gfx (void) c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 1 : 0; c |= currprefs.win32_no_overlay != changed_prefs.win32_no_overlay ? 2 : 0; - if (display_change_requested || c) + if (display_change_requested || c) { cfgfile_configuration_change(1); if (display_change_requested) @@ -1153,17 +1153,17 @@ int check_prefs_changed_gfx (void) currprefs.win32_borderless = changed_prefs.win32_borderless; currprefs.win32_no_overlay = changed_prefs.win32_no_overlay; - inputdevice_unacquire (); + inputdevice_unacquire (); if (c & 2) { close_windows (); graphics_init (); } - init_custom (); + init_custom (); if (c & 4) { pause_sound (); resume_sound (); } - inputdevice_acquire (); + inputdevice_acquire (); return 1; } @@ -1247,7 +1247,7 @@ int check_prefs_changed_gfx (void) closeprinter (); #endif } - if (strcmp (currprefs.sername, changed_prefs.sername) || + if (strcmp (currprefs.sername, changed_prefs.sername) || currprefs.serial_hwctsrts != changed_prefs.serial_hwctsrts || currprefs.serial_direct != changed_prefs.serial_direct || currprefs.serial_demand != changed_prefs.serial_demand) { @@ -1387,11 +1387,11 @@ void DX_SetPalette (int start, int count) if( picasso96_state.RGBFormat != RGBFB_CHUNKY ) return; - if (picasso_vidinfo.pixbytes != 1) + if (picasso_vidinfo.pixbytes != 1) { /* write_log ("DX Setpalette emulation\n"); */ /* This is the case when we're emulating a 256 color display. */ - while (count-- > 0) + while (count-- > 0) { int r = picasso96_state.CLUT[start].Red; int g = picasso96_state.CLUT[start].Green; @@ -1424,7 +1424,7 @@ void DX_SetPalette (int start, int count) void DX_Invalidate (int x, int y, int width, int height) { int last, lastx; - + if (y < 0 || height < 0) { y = 0; height = picasso_vidinfo.height; @@ -1479,8 +1479,8 @@ void DX_Invalidate (int x, int y, int width, int height) height = currentmode->current_height; } if (DirectDraw_GetLockableType() == secondary_surface) { - BOOL relock = FALSE; - if (DirectDraw_IsLocked()) { + BOOL relock = FALSE; + if (DirectDraw_IsLocked()) { relock = TRUE; unlockscr(); } @@ -1512,7 +1512,7 @@ static COLORREF BuildColorRef(int color, RGBFTYPE pixelformat) return result; #if 0 int r,g,b; - write_log( "DX_Blit() called to fill with color of 0x%x, rgbtype of 0x%x\n", color, pixelformat ); + write_log ( "DX_Blit() called to fill with color of 0x%x, rgbtype of 0x%x\n", color, pixelformat ); switch( pixelformat ) { @@ -1557,11 +1557,11 @@ static COLORREF BuildColorRef(int color, RGBFTYPE pixelformat) b = color & 0xFF000000 >> 24; break; default: - write_log( "Uknown 0x%x pixel-format\n", pixelformat ); + write_log ( "Uknown 0x%x pixel-format\n", pixelformat ); break; } result = RGB(r,g,b); - write_log( "R = 0x%02x, G = 0x%02x, B = 0x%02x - result = 0x%08x\n", r, g, b, result ); + write_log ( "R = 0x%02x, G = 0x%02x, B = 0x%02x - result = 0x%08x\n", r, g, b, result ); return result; #endif } @@ -1607,13 +1607,13 @@ int DX_Fill(int dstx, int dsty, int width, int height, uae_u32 color, RGBFTYPE r /* We've colour-filled the visible, but still need to colour-fill the offscreen */ hr = DirectDraw_Blt(secondary_surface, &srcrect, invalid_surface, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx); if (FAILED(hr)) { - write_log("DX_Fill2(%dx%d %d%d): %s\n", dstx, dsty, width, height, DXError(hr)); + write_log ("DX_Fill2(%dx%d %d%d): %s\n", dstx, dsty, width, height, DXError(hr)); result = 0; } } } else { - write_log("DX_Fill(%dx%d %d%d): %s\n", dstx, dsty, width, height, DXError(hr)); + write_log ("DX_Fill(%dx%d %d%d): %s\n", dstx, dsty, width, height, DXError(hr)); } return result; } @@ -1663,13 +1663,13 @@ int DX_Blit(int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT_ /* Set up our destination rectangle, and adjust for blit to windowed display (if necessary ) */ SetRect(&dstrect, dstx, dsty, dstx + width, dsty + height); - + centerrect(&dstrect); /* Render our blit within the primary surface */ result = DirectDraw_Blt(primary_surface, &dstrect, DirectDraw_GetLockableType(), &srcrect, DDBLT_WAIT | DDBLT_ROP, &fx); if (FAILED(result)) { - write_log("DX_Blit1(%d,%d,%d,%d) failed: %s\n", srcx, srcy, width, height, DXError(result)); + write_log ("DX_Blit1(%d,%d,%d,%d) failed: %s\n", srcx, srcy, width, height, DXError(result)); return 0; } else if(DirectDraw_GetLockableType() == secondary_surface) { /* We've just blitted from the offscreen to the visible, but still need to blit from offscreen to offscreen @@ -1678,7 +1678,7 @@ int DX_Blit(int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT_ SetRect(&dstrect, dstx, dsty, dstx + width, dsty + height); result = DirectDraw_Blt(secondary_surface, &dstrect, secondary_surface, &srcrect, DDBLT_WAIT | DDBLT_ROP, &fx); if (FAILED(result)) { - write_log("DX_Blit2(%d,%d,%d,%d) failed: %s\n", srcx, srcy, width, height, DXError(result)); + write_log ("DX_Blit2(%d,%d,%d,%d) failed: %s\n", srcx, srcy, width, height, DXError(result)); } } } @@ -1963,7 +1963,7 @@ static int create_windows (void) rc.left = 1; else rc.left = stored_x; - + if (stored_y > GetSystemMetrics (SM_CYVIRTUALSCREEN)) rc.top = 1; else @@ -2081,7 +2081,7 @@ static BOOL doInit (void) currentmode->native_depth = 0; tmp_depth = currentmode->current_depth; - write_log("W=%d H=%d B=%d CT=%d\n", + write_log ("W=%d H=%d B=%d CT=%d\n", DirectDraw_CurrentWidth (), DirectDraw_CurrentHeight (), DirectDraw_GetSurfaceBitCount (), colortype); if (currentmode->current_depth < 15 && (currprefs.chipset_mask & CSMASK_AGA) && isfullscreen () > 0 && !WIN32GFX_IsPicassoScreen()) { @@ -2108,7 +2108,7 @@ static BOOL doInit (void) modefallback (DM_OVERLAY); updatemodes (); } - + if (colortype == RGBFB_NONE) { fs_warning = IDS_UNSUPPORTEDSCREENMODE_1; } else if (colortype == RGBFB_CLUT && DirectDraw_GetSurfaceBitCount() != 8) { @@ -2224,7 +2224,7 @@ static BOOL doInit (void) flags = DirectDraw_GetPixelFormatFlags(); DirectDraw_SurfaceUnlock(); if (flags & (DDPF_RGB | DDPF_PALETTEINDEXED8 | DDPF_RGBTOYUV)) { - write_log("%s mode (bits: %d, pixbytes: %d)\n", currentmode->flags & DM_DX_FULLSCREEN ? "Full screen" : "Window", + write_log ("%s mode (bits: %d, pixbytes: %d)\n", currentmode->flags & DM_DX_FULLSCREEN ? "Full screen" : "Window", DirectDraw_GetSurfaceBitCount(), currentmode->current_depth >> 3); } else { char szMessage[MAX_DPATH]; diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index d1040300..d1a3b7c6 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -279,7 +279,7 @@ static int drag_start (HWND hWnd, HWND hListView, LPARAM lParam) // we create a single-line drag image, then // append it to the bottom of the complete drag image hOneImageList = ListView_CreateDragImage(hListView, iPos, &p); - hTempImageList = ImageList_Merge(hDragImageList, + hTempImageList = ImageList_Merge(hDragImageList, 0, hOneImageList, 0, 0, iHeight); ImageList_Destroy(hDragImageList); ImageList_Destroy(hOneImageList); @@ -359,7 +359,7 @@ static int drag_end (HWND hWnd, HWND hListView, LPARAM lParam, int **draggeditem (*draggeditems)[cnt++] = iPos; iPos = ListView_GetNextItem(hListView, iPos, LVNI_SELECTED); } - (*draggeditems)[cnt] = -1; + (*draggeditems)[cnt] = -1; return lvhti.iItem; } static int drag_move (HWND hWnd, LPARAM lParam) @@ -456,7 +456,7 @@ static struct romdata *scan_single_rom (char *path) strcpy (tmp, path); rd = scan_arcadia_rom (tmp, 0); if (rd) - return rd; + return rd; rd = getromdatabypath(path); if (rd && rd->crc32 == 0xffffffff) return rd; @@ -482,7 +482,7 @@ static int addrom (HKEY fkey, struct romdata *rd, char *name) sprintf(tmp2, ":ROM%03d", rd->id); } if (RegSetValueEx (fkey, tmp1, 0, REG_SZ, (CONST BYTE *)tmp2, strlen (tmp2) + 1) != ERROR_SUCCESS) - return 0; + return 0; return 1; } @@ -496,7 +496,7 @@ static int isromext(char *path) ext++; if (!stricmp (ext, "rom") || !stricmp (ext, "adf") || !stricmp (ext, "key") - || !stricmp (ext, "a500") || !stricmp (ext, "a1200") || !stricmp (ext, "a4000")) + || !stricmp (ext, "a500") || !stricmp (ext, "a1200") || !stricmp (ext, "a4000")) return 1; for (i = 0; uae_archive_extensions[i]; i++) { if (!stricmp (ext, uae_archive_extensions[i])) @@ -548,7 +548,7 @@ static int scan_rom (char *path, HKEY fkey) static int listrom (int *roms) { int i; - + i = 0; while (roms[i] >= 0) { struct romdata *rd = getromdatabyid (roms[i]); @@ -588,7 +588,7 @@ static void show_rom_list (void) strcat (avail, "\n"); strcat (unavail, "\n"); p1 = "A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0\nCD32\0CDTV\0Arcadia Multi Select\0High end WinUAE\0\nA590/A2091 SCSI Boot ROM\0\0"; - + p = malloc (100000); if (!p) return; @@ -603,8 +603,8 @@ static void show_rom_list (void) strcat (p, p1); strcat (p, ": "); if (listrom (rp)) ok = 1; - while(*rp++ != -1); - if (*rp != -1) { + while(*rp++ != -1); + if (*rp != -1) { if (ok) { ok = 0; if (listrom (rp)) @@ -612,7 +612,7 @@ static void show_rom_list (void) } while(*rp++ != -1); } - rp++; + rp++; if (ok) strcat (p, avail); else strcat (p, unavail); p1 = p2; @@ -628,7 +628,7 @@ static int scan_roms_2 (HKEY fkey, char *pathp) WIN32_FIND_DATA find_data; HANDLE handle; int ret; - + if (!pathp) return 0; GetFullPathName(pathp, MAX_DPATH, path, NULL); @@ -638,14 +638,14 @@ static int scan_roms_2 (HKEY fkey, char *pathp) ret = 0; handle = FindFirstFile (buf, &find_data); if (handle == INVALID_HANDLE_VALUE) - return 0; + return 0; for (;;) { - char tmppath[MAX_DPATH]; - strcpy (tmppath, path); - strcat (tmppath, find_data.cFileName); - if (!(find_data.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY |FILE_ATTRIBUTE_SYSTEM)) && find_data.nFileSizeLow < 10000000) { + char tmppath[MAX_DPATH]; + strcpy (tmppath, path); + strcat (tmppath, find_data.cFileName); + if (!(find_data.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY |FILE_ATTRIBUTE_SYSTEM)) && find_data.nFileSizeLow < 10000000) { if (scan_rom (tmppath, fkey)) - ret = 1; + ret = 1; } if (FindNextFile (handle, &find_data) == 0) { FindClose (handle); @@ -695,7 +695,7 @@ int scan_roms (void) for (;;) { keys = get_keyring(); fetch_path("KickstartPath", path, sizeof path); - scan_roms_3 (fkey, paths, 0, path); + scan_roms_3 (fkey, paths, 0, path); for(i = 0; ;i++) { ret = get_rom_path(path, i); if (ret < 0) @@ -715,15 +715,15 @@ int scan_roms (void) xfree(paths[i]); RegCreateKeyEx(hWinUAEKey , "DetectedROMs", 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_READ | KEY_WRITE, NULL, &fkey, NULL); + KEY_READ | KEY_WRITE, NULL, &fkey, NULL); if (fkey) { - id = 1; - for (;;) { + id = 1; + for (;;) { struct romdata *rd = getromdatabyid(id); if (!rd) - break; + break; if (rd->crc32 == 0xffffffff) - addrom(fkey, rd, NULL); + addrom(fkey, rd, NULL); id++; } RegCloseKey(fkey); @@ -781,7 +781,7 @@ int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isde DWORD ct, ct2, size; char tmp1[MAX_DPATH], tmp2[MAX_DPATH]; char fname[MAX_DPATH]; - + strcpy (fname, filename); if (!zfile_exists (fname)) { fetch_configurationpath (fname, sizeof (fname)); @@ -956,16 +956,16 @@ int DirectorySelection(HWND hDlg, int flag, char *path) buf[0] = 0; bi.hwndOwner = hDlg; - bi.pidlRoot = NULL; + bi.pidlRoot = NULL; bi.pszDisplayName = buf; - bi.lpszTitle = "Select folder"; - bi.ulFlags = 0; - bi.lpfn = NULL; - bi.lParam = 0; - - // Browse for a folder and return its PIDL. - pidlBrowse = SHBrowseForFolder(&bi); - if (pidlBrowse != NULL) { + bi.lpszTitle = "Select folder"; + bi.ulFlags = 0; + bi.lpfn = NULL; + bi.lParam = 0; + + // Browse for a folder and return its PIDL. + pidlBrowse = SHBrowseForFolder(&bi); + if (pidlBrowse != NULL) { if (SHGetPathFromIDList(pidlBrowse, buf)) { strcpy (path, buf); return 1; @@ -1006,9 +1006,9 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs char szTitle[MAX_DPATH] = { 0 }; char szFormat[MAX_DPATH]; char szFilter[MAX_DPATH] = { 0 }; - + memset (&openFileName, 0, sizeof (OPENFILENAME)); - + strncpy (init_path, start_path_data, MAX_DPATH); switch (flag) { @@ -1038,13 +1038,13 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs case 16: fetch_path ("InputPath", init_path, sizeof (init_path)); break; - + } openFileName.lStructSize = os_winnt ? sizeof (OPENFILENAME) : OPENFILENAME_SIZE_VERSION_400; openFileName.hwndOwner = hDlg; openFileName.hInstance = hInst; - + switch (flag) { case 0: WIN32GUI_LoadUIString(IDS_SELECTADF, szTitle, MAX_DPATH); @@ -1249,7 +1249,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs sprintf (full_path, "%s\\%s", full_path2, nextp); nextp += strlen (nextp) + 1; } - switch (wParam) + switch (wParam) { case IDC_PATH_NAME: case IDC_PATH_FILESYS: @@ -1476,7 +1476,7 @@ static unsigned long memsizes[] = { /* 8 */ 0x02000000, /* 32-meg */ /* 9 */ 0x04000000, /* 64-meg */ /* 10*/ 0x08000000, //128 Meg -/* 11*/ 0x10000000, //256 Meg +/* 11*/ 0x10000000, //256 Meg /* 12*/ 0x20000000, //512 Meg The correct size is set in mman.c /* 13*/ 0x40000000, //1GB /* 14*/ 0x00180000, //1.5MB @@ -1645,7 +1645,7 @@ static struct ConfigStruct *CreateConfigStore (struct ConfigStruct *oldconfig) int level = 0, i; char path[MAX_DPATH], name[MAX_DPATH]; struct ConfigStruct *cs; - + if (oldconfig) { strcpy (path, oldconfig->Path); strcpy (name, oldconfig->Name); @@ -1696,7 +1696,7 @@ static char *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *conf DiskSelection(hDlg, IDC_LOAD, 4, &workprefs, 0); EnableWindow(GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]); break; - + case CONFIG_SAVE: if (strlen (name) == 0 || strcmp (name, ".uae") == 0) { char szMessage[MAX_DPATH]; @@ -1707,7 +1707,7 @@ static char *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *conf cfgfile_save (&workprefs, path, configtypepanel); } break; - + case CONFIG_LOAD: if (strlen (name) == 0) { char szMessage[MAX_DPATH]; @@ -2166,21 +2166,21 @@ static int listview_entry_from_click (HWND list, int *column) static INT_PTR CALLBACK InfoSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; - - switch (msg) + + switch (msg) { case WM_INITDIALOG: recursive++; SetDlgItemText (hDlg, IDC_PATH_NAME, workprefs.info); recursive--; return TRUE; - + case WM_COMMAND: if (recursive) break; recursive++; - - switch(wParam) + + switch(wParam) { case IDC_SELECTOR: DiskSelection (hDlg, IDC_PATH_NAME, 8, &workprefs, 0); @@ -2192,7 +2192,7 @@ static INT_PTR CALLBACK InfoSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, LP EndDialog (hDlg, 0); break; } - + GetDlgItemText(hDlg, IDC_PATH_NAME, workprefs.info, sizeof workprefs.info); recursive--; break; @@ -2465,7 +2465,7 @@ static INT_PTR CALLBACK LoadSaveDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA case WM_USER: break; - + case WM_COMMAND: { recursive++; @@ -2617,7 +2617,7 @@ static INT_PTR CALLBACK LoadSaveDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA break; } } - + return FALSE; } @@ -2669,11 +2669,11 @@ typedef struct url_info char *url; } urlinfo; -static urlinfo urls[] = +static urlinfo urls[] = { {IDC_CLOANTOHOME, FALSE, "Cloanto's Amiga Forever", "http://www.amigaforever.com/"}, {IDC_AMIGAHOME, FALSE, "Amiga Inc.", "http://www.amiga.com"}, - {IDC_PICASSOHOME, FALSE, "Picasso96 Home Page", "http://www.picasso96.cogito.de/"}, + {IDC_PICASSOHOME, FALSE, "Picasso96 Home Page", "http://www.picasso96.cogito.de/"}, {IDC_UAEHOME, FALSE, "UAE Home Page", "http://uae.coresystems.de/"}, {IDC_WINUAEHOME, FALSE, "WinUAE Home Page", "http://www.winuae.net/"}, {IDC_AIABHOME, FALSE, "AIAB", "http://www.amigainabox.co.uk/"}, @@ -2711,14 +2711,14 @@ static void url_handler(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) POINT point; point.x = LOWORD (lParam); point.y = HIWORD (lParam); - - for (i = 0; urls[i].id >= 0; i++) + + for (i = 0; urls[i].id >= 0; i++) { RECT rect; GetWindowRect(GetDlgItem(hDlg, urls[i].id), &rect); ScreenToClient(hDlg, (POINT*)&rect); ScreenToClient(hDlg, (POINT*)&rect.right); - if(PtInRect(&rect, point)) + if(PtInRect(&rect, point)) { if(msg == WM_LBUTTONDOWN) { @@ -2820,7 +2820,7 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM currentpage = PATHS_ID; ShowWindow (GetDlgItem (hDlg, IDC_RESETREGISTRY), FALSE); numtypes = 0; - SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_RESETCONTENT, 0, 0L); + SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_RESETCONTENT, 0, 0L); if (af_path_2005 & 1) { WIN32GUI_LoadUIString(IDS_DEFAULT_AF2005, tmp, sizeof tmp); SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp); @@ -2848,12 +2848,12 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM selpath = numtypes; ptypes[numtypes++] = PATH_TYPE_OLDAF; } - WIN32GUI_LoadUIString(IDS_DEFAULT_WINUAE, tmp, sizeof tmp); - SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp); - if (path_type == 0) + WIN32GUI_LoadUIString(IDS_DEFAULT_WINUAE, tmp, sizeof tmp); + SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)tmp); + if (path_type == 0) selpath = numtypes; ptypes[numtypes++] = 0; - SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_SETCURSEL, selpath, 0); + SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_SETCURSEL, selpath, 0); EnableWindow(GetDlgItem (hDlg, IDC_PATHS_DEFAULTTYPE), numtypes > 0 ? TRUE : FALSE); values_to_pathsdialog (hDlg); recursive--; @@ -2868,9 +2868,9 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM case IDC_PATHS_ROMS: fetch_path ("KickstartPath", tmp, sizeof (tmp)); if (DirectorySelection (hDlg, 0, tmp)) { - load_keyring(&workprefs, NULL); + load_keyring(&workprefs, NULL); set_path ("KickstartPath", tmp); - if (!scan_roms ()) + if (!scan_roms ()) gui_message_id (IDS_ROMSCANNOROMS); values_to_pathsdialog (hDlg); } @@ -2936,7 +2936,7 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM GetWindowText (GetDlgItem (hDlg, IDC_PATHS_AVIOUTPUT), tmp, sizeof (tmp)); set_path ("VideoPath", tmp); break; - case IDC_PATHS_DEFAULT: + case IDC_PATHS_DEFAULT: val = SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_GETCURSEL, 0, 0L); if (val != CB_ERR && val >= 0 && val < numtypes) { val = ptypes[val]; @@ -3027,7 +3027,7 @@ static void load_quickstart (HWND hDlg, int romcheck) { ew (guiDlg, IDC_RESETAMIGA, FALSE); workprefs.nr_floppies = quickstart_floppy; - quickstart_ok = build_in_prefs (&workprefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck); + quickstart_ok = built_in_prefs (&workprefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck); enable_for_quickstart (hDlg); addfloppytype (hDlg, 0); addfloppytype (hDlg, 1); @@ -3142,7 +3142,7 @@ static void init_quickstartdlg (HWND hDlg) if (quickstart_conf >= i) quickstart_conf = 0; SendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_SETCURSEL, quickstart_conf, 0); - + if (quickstart_compa >= amodels[quickstart_model].compalevels) quickstart_compa = 1; if (quickstart_compa >= amodels[quickstart_model].compalevels) @@ -3438,9 +3438,9 @@ static INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM currentpage = ABOUT_ID; init_aboutdlg (hDlg); break; - + case WM_COMMAND: - if (wParam == IDC_CONTRIBUTORS) + if (wParam == IDC_CONTRIBUTORS) DisplayContributors (hDlg); break; case WM_SETCURSOR: @@ -3451,7 +3451,7 @@ static INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM url_handler( hDlg, msg, wParam, lParam ); break; } - + return FALSE; } @@ -3507,7 +3507,7 @@ static void init_frequency_combo (HWND hDlg, int dmode) int i, j, freq, tmp; char hz[20], hz2[20], txt[100]; LRESULT index; - + i = 0; index = 0; while ((freq = DisplayModes[dmode].refresh[i]) > 0 && index < MAX_REFRESH_RATES) { storedrefreshrates[index++] = freq; @@ -3716,7 +3716,7 @@ static int display_toselect(int fs, int vsync, int p96) if (p96) return fs * 2 + vsync; if (fs == 2) - return 3; + return 3; if (!vsync) return fs; if (fs == 1 && vsync) @@ -3911,7 +3911,7 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l workprefs.gfx_xcenter = (IsDlgButtonChecked (hDlg, IDC_XCENTER) ? 2 : 0 ); /* Smart centering */ workprefs.gfx_ycenter = (IsDlgButtonChecked (hDlg, IDC_YCENTER) ? 2 : 0 ); /* Smart centering */ - if (msg == WM_COMMAND && HIWORD (wParam) == CBN_SELCHANGE) + if (msg == WM_COMMAND && HIWORD (wParam) == CBN_SELCHANGE) { if (LOWORD (wParam) == IDC_DISPLAYSELECT) { posn = SendDlgItemMessage (hDlg, IDC_DISPLAYSELECT, CB_GETCURSEL, 0, 0); @@ -3996,7 +3996,7 @@ static INT_PTR CALLBACK DisplayDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR { static int recursive = 0; - switch (msg) + switch (msg) { case WM_INITDIALOG: pages[DISPLAY_ID] = hDlg; @@ -4030,9 +4030,9 @@ static INT_PTR CALLBACK DisplayDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR init_da(hDlg); update_da(); } - handle_da (hDlg); - values_from_displaydlg (hDlg, msg, wParam, lParam); - enable_for_displaydlg (hDlg); + handle_da (hDlg); + values_from_displaydlg (hDlg, msg, wParam, lParam); + enable_for_displaydlg (hDlg); recursive--; break; @@ -4152,10 +4152,10 @@ static void values_from_chipsetdlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l else if (workprefs.produce_sound >= 2) workprefs.produce_sound = 2; } - n = SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_GETCURSEL, 0, 0); + n = SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_GETCURSEL, 0, 0); if (n != CB_ERR) { workprefs.cs_compatible = n; - build_in_chipset_prefs (&workprefs); + built_in_chipset_prefs (&workprefs); } } @@ -4257,7 +4257,7 @@ static void values_to_chipsetdlg2 (HWND hDlg) txt[0] = 0; if (workprefs.cs_agnusrev >= 0) { rev = workprefs.cs_agnusrev; - sprintf (txt, "%02.2X", rev); + sprintf (txt, "%02.2X", rev); } else if (workprefs.cs_compatible) { rev = 0; if (workprefs.ntscmode) @@ -4272,14 +4272,14 @@ static void values_to_chipsetdlg2 (HWND hDlg) txt[0] = 0; if (workprefs.cs_deniserev >= 0) { rev = workprefs.cs_deniserev; - sprintf (txt, "%01.1X", rev); + sprintf (txt, "%01.1X", rev); } else if (workprefs.cs_compatible) { rev = 0xf; if (workprefs.chipset_mask & CSMASK_ECS_DENISE) rev = 0xc; if (workprefs.chipset_mask & CSMASK_AGA) rev = 0x8; - sprintf (txt, "%01.1X", rev); + sprintf (txt, "%01.1X", rev); } SetDlgItemText(hDlg, IDC_CS_DENISEREV, txt); } @@ -4308,7 +4308,7 @@ static void values_from_chipsetdlg2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM workprefs.cs_a4091 = IsDlgButtonChecked (hDlg, IDC_CS_A4091) ? 1 : 0; #if 0 if (msg == WM_COMMAND && LOWORD(wParam) == IDC_CS_SCSIMODE) - workprefs.scsi = IsDlgButtonChecked (hDlg, IDC_CS_SCSIMODE) ? 2 : 0; + workprefs.scsi = IsDlgButtonChecked (hDlg, IDC_CS_SCSIMODE) ? 2 : 0; #endif workprefs.cs_cdtvscsi = IsDlgButtonChecked (hDlg, IDC_CS_CDTVSCSI) ? 1 : 0; workprefs.cs_pcmcia = IsDlgButtonChecked (hDlg, IDC_CS_PCMCIA) ? 1 : 0; @@ -4669,8 +4669,6 @@ static void values_from_kickstartdlg (HWND hDlg) getromfile (hDlg, IDC_ROMFILE, workprefs.romfile, sizeof (workprefs.romfile)); getromfile (hDlg, IDC_ROMFILE2, workprefs.romextfile, sizeof (workprefs.romextfile)); getromfile (hDlg, IDC_CARTFILE, workprefs.cartfile, sizeof (workprefs.cartfile)); - ew (hDlg, IDC_HRTMON, workprefs.cartfile[0] ? FALSE : TRUE); - //CheckDlgButton(hDlg, IDC_HRTMON, workprefs.cart_internal == 1 ? TRUE : FALSE); } static void values_to_kickstartdlg (HWND hDlg) @@ -4721,8 +4719,6 @@ static void init_kickstart (HWND hDlg) scan_roms (); if (fkey) RegCloseKey (fkey); - ew (hDlg, IDC_HRTMON, full_property_sheet); - } static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -4730,7 +4726,7 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP static int recursive; char tmp[MAX_DPATH]; - switch( msg ) + switch( msg ) { case WM_INITDIALOG: pages[KICKSTART_ID] = hDlg; @@ -4764,7 +4760,7 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP DiskSelection(hDlg, IDC_ROMFILE2, 6, &workprefs, 0); values_to_kickstartdlg (hDlg); break; - + case IDC_FLASHCHOOSER: DiskSelection(hDlg, IDC_FLASHFILE, 11, &workprefs, 0); values_to_kickstartdlg (hDlg); @@ -4791,7 +4787,7 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP workprefs.cart_internal = IsDlgButtonChecked(hDlg, IDC_HRTMON) ? 1 : 0; ew (hDlg, IDC_CARTFILE, workprefs.cart_internal == 1 ? FALSE : TRUE); break; -#endif +#endif } recursive--; break; @@ -4898,7 +4894,7 @@ static void misc_lang(HWND hDlg) if (hWinUAEKey) { DWORD regkeytype; DWORD regkeysize = sizeof(langid); - RegQueryValueEx (hWinUAEKey, "Language", 0, ®keytype, (LPBYTE)&langid, ®keysize); + RegQueryValueEx (hWinUAEKey, "Language", 0, ®keytype, (LPBYTE)&langid, ®keysize); } SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)"Autodetect"); @@ -4988,7 +4984,7 @@ static void values_to_miscdlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"20"); SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"30"); sprintf (txt, "%d", workprefs.statecapturerate / 50); - SendDlgItemMessage( hDlg, IDC_STATE_RATE, WM_SETTEXT, 0, (LPARAM)txt); + SendDlgItemMessage( hDlg, IDC_STATE_RATE, WM_SETTEXT, 0, (LPARAM)txt); SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"5"); @@ -4997,7 +4993,7 @@ static void values_to_miscdlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"50"); SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"100"); sprintf (txt, "%d", workprefs.statecapturebuffersize / (1024 * 1024)); - SendDlgItemMessage( hDlg, IDC_STATE_BUFFERSIZE, WM_SETTEXT, 0, (LPARAM)txt); + SendDlgItemMessage( hDlg, IDC_STATE_BUFFERSIZE, WM_SETTEXT, 0, (LPARAM)txt); misc_scsi(hDlg); misc_lang(hDlg); @@ -5020,12 +5016,12 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) char txt[100]; int v; static int recursive; - + if (recursive) return FALSE; recursive++; - switch (msg) + switch (msg) { case WM_USER: @@ -5079,7 +5075,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) switch(wParam) { case IDC_DOSAVESTATE: - if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) + if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) save_state (savestate_fname, "Description!"); break; case IDC_DOLOADSTATE: @@ -5335,14 +5331,14 @@ static void values_from_cpudlg (HWND hDlg) { int newcpu, newfpu, newtrust, oldcache, jitena; static int cachesize_prev, comptrust_prev, compforce_prev; - + workprefs.cpu_compatible = workprefs.cpu_cycle_exact | (IsDlgButtonChecked (hDlg, IDC_COMPATIBLE) ? 1 : 0); workprefs.fpu_strict = IsDlgButtonChecked (hDlg, IDC_COMPATIBLE_FPU) ? 1 : 0; workprefs.address_space_24 = IsDlgButtonChecked (hDlg, IDC_COMPATIBLE24) ? 1 : 0; workprefs.m68k_speed = IsDlgButtonChecked (hDlg, IDC_CS_HOST) ? -1 : IsDlgButtonChecked (hDlg, IDC_CS_68000) ? 0 : SendMessage (GetDlgItem (hDlg, IDC_SPEED), TBM_GETPOS, 0, 0) * CYCLE_UNIT; - + newcpu = IsDlgButtonChecked (hDlg, IDC_CPU0) ? 68000 : IsDlgButtonChecked (hDlg, IDC_CPU1) ? 68010 : IsDlgButtonChecked (hDlg, IDC_CPU2) ? 68020 @@ -5401,7 +5397,7 @@ static void values_from_cpudlg (HWND hDlg) jitena = IsDlgButtonChecked (hDlg, IDC_JITENABLE) ? 1 : 0; workprefs.cachesize = SendMessage(GetDlgItem(hDlg, IDC_CACHE), TBM_GETPOS, 0, 0) * 1024; if (!jitena) { - cachesize_prev = workprefs.cachesize; + cachesize_prev = workprefs.cachesize; comptrust_prev = workprefs.comptrustbyte; compforce_prev = workprefs.compforcesettings; workprefs.cachesize = 0; @@ -5666,7 +5662,7 @@ static void values_to_sounddlg (HWND hDlg) } SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_SETCURSEL, workprefs.sound_mixed_stereo_delay > 0 ? workprefs.sound_mixed_stereo_delay : 0, 0); - + SendDlgItemMessage(hDlg, IDC_SOUNDINTERPOLATION, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_SOUND_INTERPOL_DISABLED, txt, sizeof (txt)); SendDlgItemMessage(hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)txt); @@ -5685,7 +5681,7 @@ static void values_to_sounddlg (HWND hDlg) i++; } sprintf (txt, "%d", workprefs.sound_freq); - SendDlgItemMessage(hDlg, IDC_SOUNDFREQ, WM_SETTEXT, 0, (LPARAM)txt); + SendDlgItemMessage(hDlg, IDC_SOUNDFREQ, WM_SETTEXT, 0, (LPARAM)txt); switch (workprefs.produce_sound) { case 0: which_button = IDC_SOUND0; break; @@ -5954,12 +5950,11 @@ static INT_PTR CALLBACK VolumeSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, switch (msg) { case WM_INITDIALOG: { - if (archivehd < 0) { - if (my_existsfile(current_fsvdlg.rootdir)) - archivehd = 1; - else if (my_existsdir(current_fsvdlg.rootdir)) - archivehd = 0; - } + archivehd = -1; + if (my_existsfile(current_fsvdlg.rootdir)) + archivehd = 1; + else if (my_existsdir(current_fsvdlg.rootdir)) + archivehd = 0; recursive++; SetDlgItemText (hDlg, IDC_VOLUME_NAME, current_fsvdlg.volume); SetDlgItemText (hDlg, IDC_VOLUME_DEVICE, current_fsvdlg.device); @@ -5980,43 +5975,44 @@ static INT_PTR CALLBACK VolumeSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, if (HIWORD (wParam) == BN_CLICKED) { switch (LOWORD (wParam)) { - case IDC_SELECTOR: - { + case IDC_FS_SELECT_EJECT: + SetDlgItemText (hDlg, IDC_PATH_NAME, ""); + SetDlgItemText (hDlg, IDC_VOLUME_NAME, ""); + CheckDlgButton (hDlg, IDC_RW, FALSE); + ew (hDlg, IDC_RW, FALSE); + archivehd = -1; + break; + case IDC_FS_SELECT_FILE: strcpy (directory_path, current_fsvdlg.rootdir); - if (archivehd) { - if (DiskSelection(hDlg, 0, 14, &workprefs, directory_path)) - SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path); - } else { - WIN32GUI_LoadUIString(IDS_SELECTFILESYSROOT, szTitle, MAX_DPATH); - browse_info.hwndOwner = hDlg; - browse_info.pidlRoot = NULL; - browse_info.pszDisplayName = directory_path; - browse_info.lpszTitle = ""; - browse_info.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS; - browse_info.lpfn = NULL; - browse_info.iImage = 0; - if ((browse = SHBrowseForFolder (&browse_info)) != NULL) { - SHGetPathFromIDList (browse, directory_path); - SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path); - } + if (DiskSelection(hDlg, 0, 14, &workprefs, directory_path)) { + char *s = filesys_createvolname (NULL, directory_path, "Harddrive"); + SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path); + SetDlgItemText (hDlg, IDC_VOLUME_NAME, s); + xfree (s); + CheckDlgButton (hDlg, IDC_RW, FALSE); + ew (hDlg, IDC_RW, FALSE); + archivehd = 1; } - } break; - case IDOK: - { -#if 0 - if(!my_existsfile(current_fsvdlg.rootdir) && !my_existsdir(current_fsvdlg.rootdir)) { - char szMessage[MAX_DPATH]; - char szTitle[MAX_DPATH]; - WIN32GUI_LoadUIString(IDS_MUSTSELECTPATH, szMessage, MAX_DPATH); - WIN32GUI_LoadUIString(IDS_SETTINGSERROR, szTitle, MAX_DPATH); - MessageBox(hDlg, szMessage, szTitle, - MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); - break; + case IDC_FS_SELECT_DIR: + strcpy (directory_path, current_fsvdlg.rootdir); + WIN32GUI_LoadUIString(IDS_SELECTFILESYSROOT, szTitle, MAX_DPATH); + browse_info.hwndOwner = hDlg; + browse_info.pidlRoot = NULL; + browse_info.pszDisplayName = directory_path; + browse_info.lpszTitle = ""; + browse_info.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS; + browse_info.lpfn = NULL; + browse_info.iImage = 0; + if ((browse = SHBrowseForFolder (&browse_info)) != NULL) { + SHGetPathFromIDList (browse, directory_path); + SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path); + ew (hDlg, IDC_RW, TRUE); + archivehd = 0; } -#endif + break; + case IDOK: EndDialog (hDlg, 1); - } break; case IDCANCEL: EndDialog (hDlg, 0); @@ -6165,7 +6161,7 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam DiskSelection (hDlg, IDC_PATH_FILESYS, 12, &workprefs, 0); break; case IDOK: - if(strlen(current_hfdlg.filename) == 0 ) + if(strlen(current_hfdlg.filename) == 0 ) { char szMessage[MAX_DPATH]; char szTitle[MAX_DPATH]; @@ -6263,7 +6259,7 @@ static INT_PTR CALLBACK HarddriveSettingsProc (HWND hDlg, UINT msg, WPARAM wPara case IDCANCEL: EndDialog (hDlg, 0); break; - case IDC_HARDDRIVE_IMAGE: + case IDC_HARDDRIVE_IMAGE: if (posn != CB_ERR) harddrive_to_hdf(hDlg, &workprefs, posn); break; @@ -6362,7 +6358,7 @@ static void harddisk_edit (HWND hDlg) } current_hfdlg.rw = !uci->readonly; current_hfdlg.bootpri = uci->bootpri; - if (CustomDialogBox(IDD_HARDFILE, hDlg, HardfileSettingsProc)) + if (CustomDialogBox(IDD_HARDFILE, hDlg, HardfileSettingsProc)) { int result = add_filesys_config (&workprefs, entry, current_hfdlg.devicename, 0, current_hfdlg.filename, ! current_hfdlg.rw, current_hfdlg.sectors, current_hfdlg.surfaces, @@ -6375,7 +6371,7 @@ static void harddisk_edit (HWND hDlg) current_hfdlg.rw = !uci->readonly; strncpy (current_hfdlg.filename, uci->rootdir, (sizeof current_hfdlg.filename) - 1); current_hfdlg.filename[(sizeof current_hfdlg.filename) - 1] = '\0'; - if (CustomDialogBox(IDD_HARDDRIVE, hDlg, HarddriveSettingsProc)) + if (CustomDialogBox(IDD_HARDDRIVE, hDlg, HarddriveSettingsProc)) { int result = add_filesys_config (&workprefs, entry, 0, 0, current_hfdlg.filename, ! current_hfdlg.rw, 0, 0, @@ -6399,7 +6395,8 @@ static void harddisk_edit (HWND hDlg) archivehd = -1; if (CustomDialogBox(IDD_FILESYS, hDlg, VolumeSettingsProc)) { int result = add_filesys_config (&workprefs, entry, current_fsvdlg.device, current_fsvdlg.volume, - current_fsvdlg.rootdir, ! current_fsvdlg.rw, 0, 0, 0, 0, current_fsvdlg.bootpri, 0, 0, 0); + current_fsvdlg.rootdir, !current_fsvdlg.rw, 0, 0, 0, 0, current_fsvdlg.bootpri, 0, 0, 0); + filesys_insert (entry, current_fsvdlg.volume, current_fsvdlg.rootdir, !current_fsvdlg.rw, 0); } } } @@ -6530,7 +6527,7 @@ static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA pages[HARDDISK_ID] = hDlg; currentpage = HARDDISK_ID; EnableWindow (GetDlgItem(hDlg, IDC_NEW_HD), os_winnt && os_winnt_admin > 1 ? TRUE : FALSE); - + case WM_USER: CheckDlgButton (hDlg, IDC_MAPDRIVES, workprefs.win32_automount_drives); CheckDlgButton (hDlg, IDC_MAPDRIVES_NET, workprefs.win32_automount_netdrives); @@ -6575,7 +6572,7 @@ static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA break; } break; - + case WM_NOTIFY: if (((LPNMHDR) lParam)->idFrom == IDC_VOLUMELIST) harddiskdlg_volume_notify (hDlg, (NM_LISTVIEW *) lParam); @@ -6583,7 +6580,7 @@ static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA default: return FALSE; } - + return FALSE; } @@ -6623,7 +6620,7 @@ static void floppytooltip (HWND hDlg, int num, uae_u32 crc32) TOOLINFO ti; int id; char tmp[100]; - + if (currentpage == QUICKSTART_ID) id = floppybuttonsq[num][0]; else @@ -6638,7 +6635,7 @@ static void floppytooltip (HWND hDlg, int num, uae_u32 crc32) return; sprintf (tmp, "CRC=%08.8X", crc32); ti.lpszText = tmp; - SendMessage (ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); + SendMessage (ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); } static void addfloppyhistory_2 (HWND hDlg, HKEY fkey, int n, int f_text) @@ -6658,7 +6655,7 @@ static void addfloppyhistory_2 (HWND hDlg, HKEY fkey, int n, int f_text) break; i++; strcpy (tmppath, s); - p = tmppath + strlen(tmppath) - 1; + p = tmppath + strlen(tmppath) - 1; for (j = 0; uae_archive_extensions[j]; j++) { p2 = strstr (tmppath, uae_archive_extensions[j]); if (p2) { @@ -6666,9 +6663,9 @@ static void addfloppyhistory_2 (HWND hDlg, HKEY fkey, int n, int f_text) break; } } - while (p > tmppath) { + while (p > tmppath) { if (*p == '\\' || *p == '/') - break; + break; p--; } strcpy (tmpname, p + 1); @@ -6773,7 +6770,7 @@ static void getfloppytype (HWND hDlg, int n) { int f_type = floppybuttons[n][3]; LRESULT val = SendDlgItemMessage (hDlg, f_type, CB_GETCURSEL, 0, 0L); - + if (val != CB_ERR && workprefs.dfxtype[n] != val - 1) { workprefs.dfxtype[n] = (int)val - 1; addfloppytype (hDlg, n); @@ -6820,10 +6817,10 @@ static int getfloppybox (HWND hDlg, int f_text, char *out, int maxlen) p1 = strstr(tmp, " { "); p2 = strstr(tmp, " }"); if (p1 && p2 && p2 > p1) { - *p1 = 0; - memset (out, 0, maxlen); - memcpy (out, p1 + 3, p2 - p1 - 3); - strcat (out, tmp); + *p1 = 0; + memset (out, 0, maxlen); + memcpy (out, p1 + 3, p2 - p1 - 3); + strcat (out, tmp); } xfree (tmp); i = 0; @@ -6851,7 +6848,7 @@ static void getfloppyname (HWND hDlg, int n) static void addallfloppies (HWND hDlg) { int i; - + for (i = 0; i < 4; i++) addfloppytype (hDlg, i); addfloppyhistory (hDlg); @@ -6890,7 +6887,7 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA int i; static char diskname[40] = { "empty" }; - switch (msg) + switch (msg) { case WM_INITDIALOG: { @@ -6936,7 +6933,7 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA addallfloppies (hDlg); recursive--; break; - + case WM_COMMAND: if (recursive > 0) break; @@ -6948,23 +6945,23 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA case IDC_DF0TEXTQ: getfloppyname (hDlg, 0); addfloppytype (hDlg, 0); - addfloppyhistory (hDlg); + addfloppyhistory (hDlg); break; case IDC_DF1TEXT: case IDC_DF1TEXTQ: getfloppyname (hDlg, 1); addfloppytype (hDlg, 1); - addfloppyhistory (hDlg); + addfloppyhistory (hDlg); break; case IDC_DF2TEXT: getfloppyname (hDlg, 2); addfloppytype (hDlg, 2); - addfloppyhistory (hDlg); + addfloppyhistory (hDlg); break; case IDC_DF3TEXT: getfloppyname (hDlg, 3); addfloppytype (hDlg, 3); - addfloppyhistory (hDlg); + addfloppyhistory (hDlg); break; case IDC_DF0TYPE: getfloppytype (hDlg, 0); @@ -6989,7 +6986,7 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA case IDC_DF1ENABLE: case IDC_DF1QENABLE: getfloppytypeq (hDlg, 1); - break; + break; case IDC_DF2ENABLE: getfloppytypeq (hDlg, 2); break; @@ -7089,7 +7086,7 @@ static ACCEL SwapperAccel[] = { { FALT|FVIRTKEY, '6', 10006 }, { FALT|FVIRTKEY, '7', 10007 }, { FALT|FVIRTKEY, '8', 10008 }, { FALT|FVIRTKEY, '9', 10009 }, { FALT|FVIRTKEY, '0', 10010 }, { FALT|FSHIFT|FVIRTKEY, '1', 10011 }, { FALT|FSHIFT|FVIRTKEY, '2', 10012 }, { FALT|FSHIFT|FVIRTKEY, '3', 10013 }, { FALT|FSHIFT|FVIRTKEY, '4', 10014 }, { FALT|FSHIFT|FVIRTKEY, '5', 10015 }, { FALT|FSHIFT|FVIRTKEY, '6', 10016 }, { FALT|FSHIFT|FVIRTKEY, '7', 10017 }, { FALT|FSHIFT|FVIRTKEY, '8', 10018 }, { FALT|FSHIFT|FVIRTKEY, '9', 10019 }, { FALT|FSHIFT|FVIRTKEY, '0', 10020 }, - { FVIRTKEY, VK_UP, 10101 }, { FVIRTKEY, VK_DOWN, 10102 }, { FVIRTKEY, VK_RIGHT, 10104 }, + { FVIRTKEY, VK_UP, 10101 }, { FVIRTKEY, VK_DOWN, 10102 }, { FVIRTKEY, VK_RIGHT, 10104 }, { FVIRTKEY|FSHIFT, VK_UP, IDC_UP }, { FVIRTKEY|FSHIFT, VK_DOWN, IDC_DOWN }, { FVIRTKEY|FCONTROL, '1', 10201 }, { FVIRTKEY|FCONTROL, '2', 10202 }, { FVIRTKEY|FCONTROL, '3', 10203 }, { FVIRTKEY|FCONTROL, '4', 10204 }, { FVIRTKEY|FCONTROL|FSHIFT, '1', 10205 }, { FVIRTKEY|FCONTROL|FSHIFT, '2', 10206 }, { FVIRTKEY|FCONTROL|FSHIFT, '3', 10207 }, { FVIRTKEY|FCONTROL|FSHIFT, '4', 10208 }, @@ -7128,7 +7125,7 @@ static INT_PTR CALLBACK SwapperDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR static int entry; char tmp[MAX_DPATH]; - switch (msg) + switch (msg) { case WM_INITDIALOG: pages[DISK_ID] = hDlg; @@ -7244,19 +7241,19 @@ static INT_PTR CALLBACK SwapperDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR addswapperfile (hDlg, entry); } break; - + case IDC_DISKLISTINSERT: if (entry >= 0) { if (getfloppybox (hDlg, IDC_DISKTEXT, tmp, sizeof (tmp))) { strcpy (workprefs.dfxlist[entry], tmp); - addfloppyhistory (hDlg); + addfloppyhistory (hDlg); InitializeListView (hDlg); swapperhili (hDlg, entry); } else { addswapperfile (hDlg, entry); } } - break; + break; case IDC_DISKLISTREMOVE: if (entry >= 0) { @@ -7289,21 +7286,21 @@ static INT_PTR CALLBACK SwapperDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR break; } case WM_NOTIFY: - if (((LPNMHDR) lParam)->idFrom == IDC_DISKLIST) + if (((LPNMHDR) lParam)->idFrom == IDC_DISKLIST) { int dblclick = 0, button = 0, col; HWND list; NM_LISTVIEW *nmlistview; nmlistview = (NM_LISTVIEW *) lParam; cachedlist = list = nmlistview->hdr.hwndFrom; - switch (nmlistview->hdr.code) + switch (nmlistview->hdr.code) { case LVN_BEGINDRAG: drag_start (hDlg, cachedlist, lParam); break; case NM_RDBLCLK: case NM_DBLCLK: - dblclick = 1; + dblclick = 1; /* fall-through here too */ case NM_RCLICK: if (nmlistview->hdr.code == NM_RCLICK || nmlistview->hdr.code == NM_RDBLCLK) @@ -7392,7 +7389,7 @@ static void updatejoyport (HWND hDlg) { int i, j; char tmp[MAX_DPATH], tmp2[MAX_DPATH]; - + enable_for_portsdlg (hDlg); if (joy0previous < 0) joy0previous = inputdevice_get_device_total (IDTYPE_JOYSTICK) + 1; @@ -7477,7 +7474,7 @@ static void fixjport (int *port, int v) vv += JSEM_KBDLAYOUT; } *port = vv; -} +} static void values_from_portsdlg (HWND hDlg) { @@ -7557,11 +7554,11 @@ static void values_from_portsdlg (HWND hDlg) item = SendDlgItemMessage (hDlg, IDC_SERIAL, CB_GETCURSEL, 0, 0L); if (item != CB_ERR && item > 0) { - workprefs.use_serial = 1; + workprefs.use_serial = 1; strcpy (workprefs.sername, comports[item - 1].dev); } else { - workprefs.use_serial = 0; - workprefs.sername[0] = 0; + workprefs.use_serial = 0; + workprefs.sername[0] = 0; } workprefs.serial_demand = 0; if (IsDlgButtonChecked (hDlg, IDC_SER_SHARED)) @@ -7605,7 +7602,7 @@ static void values_to_portsdlg (HWND hDlg) // Warn the user that their printer-port selection is not valid on this machine char szMessage[MAX_DPATH]; WIN32GUI_LoadUIString(IDS_INVALIDPRTPORT, szMessage, MAX_DPATH); - pre_gui_message (szMessage); + pre_gui_message (szMessage); // Disable the invalid parallel-port selection workprefs.prtname[0] = 0; result = 0; @@ -7615,7 +7612,7 @@ static void values_to_portsdlg (HWND hDlg) CheckDlgButton(hDlg, IDC_PSPRINTER, workprefs.parallel_postscript_emulation); CheckDlgButton(hDlg, IDC_PSPRINTERDETECT, workprefs.parallel_postscript_detection); SetDlgItemText(hDlg, IDC_PS_PARAMS, workprefs.ghostscript_parameters); - + SendDlgItemMessage(hDlg, IDC_PRINTERLIST, CB_SETCURSEL, result, 0); SendDlgItemMessage(hDlg, IDC_MIDIOUTLIST, CB_SETCURSEL, workprefs.win32_midioutdev + 2, 0); if (!bNoMidiIn && workprefs.win32_midiindev >= 0) @@ -7623,12 +7620,12 @@ static void values_to_portsdlg (HWND hDlg) else SendDlgItemMessage(hDlg, IDC_MIDIINLIST, CB_SETCURSEL, 0, 0); ew (hDlg, IDC_MIDIINLIST, workprefs.win32_midioutdev < -1 ? FALSE : TRUE); - + CheckDlgButton(hDlg, IDC_UAESERIAL, workprefs.uaeserial); CheckDlgButton(hDlg, IDC_SER_SHARED, workprefs.serial_demand); CheckDlgButton(hDlg, IDC_SER_CTSRTS, workprefs.serial_hwctsrts); CheckDlgButton(hDlg, IDC_SER_DIRECT, workprefs.serial_direct); - + if(!workprefs.sername[0]) { SendDlgItemMessage (hDlg, IDC_SERIAL, CB_SETCURSEL, 0, 0L); workprefs.use_serial = 0; @@ -7647,7 +7644,7 @@ static void values_to_portsdlg (HWND hDlg) WIN32GUI_LoadUIString(IDS_INVALIDCOMPORT, szMessage, MAX_DPATH); pre_gui_message (szMessage); // Select "none" as the COM-port - SendDlgItemMessage(hDlg, IDC_SERIAL, CB_SETCURSEL, 0L, 0L); + SendDlgItemMessage(hDlg, IDC_SERIAL, CB_SETCURSEL, 0L, 0L); // Disable the chosen serial-port selection workprefs.sername[0] = 0; workprefs.use_serial = 0; @@ -7680,7 +7677,7 @@ static void init_portsdlg( HWND hDlg ) SendDlgItemMessage (hDlg, IDC_SERIAL, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)szNone); for (port = 0; port < MAX_SERIAL_PORTS && comports[port].name; port++) { - SendDlgItemMessage(hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)comports[port].name); + SendDlgItemMessage(hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)comports[port].name); } SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_RESETCONTENT, 0, 0L); @@ -7754,7 +7751,7 @@ static INT_PTR CALLBACK PortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM static int recursive = 0; int temp; - switch (msg) + switch (msg) { case WM_INITDIALOG: recursive++; @@ -7765,7 +7762,7 @@ static INT_PTR CALLBACK PortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM values_to_portsdlg(hDlg); updatejoyport(hDlg); recursive--; - break; + break; case WM_USER: recursive++; enable_for_portsdlg (hDlg); @@ -7843,7 +7840,7 @@ static INT_PTR CALLBACK StringBoxDialogProc(HWND hDlg, UINT msg, WPARAM wParam, case IDOK: stringboxdialogactive = -1; DestroyWindow (hDlg); - return TRUE; + return TRUE; case IDCANCEL: stringboxdialogactive = 0; DestroyWindow (hDlg); @@ -7851,7 +7848,7 @@ static INT_PTR CALLBACK StringBoxDialogProc(HWND hDlg, UINT msg, WPARAM wParam, } break; } - return DefWindowProc(hDlg, msg, wParam, lParam); + return DefWindowProc(hDlg, msg, wParam, lParam); } static int askinputcustom(HWND hDlg, char *custom, int maxlen) @@ -8001,7 +7998,7 @@ static void doinputcustom(HWND hDlg, int newcustom) int flags; custom1[0] = 0; inputdevice_get_mapped_name (input_selected_device, input_selected_widget, - &flags, 0, custom1, input_selected_sub_num); + &flags, 0, custom1, input_selected_sub_num); if (strlen(custom1) > 0 || newcustom) { if (askinputcustom(hDlg, custom1, sizeof custom1)) { inputdevice_set_mapping (input_selected_device, input_selected_widget, @@ -8134,7 +8131,7 @@ static INT_PTR CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM int items = 0, entry = 0; static int recursive; - switch (msg) + switch (msg) { case WM_INITDIALOG: pages[INPUT_ID] = hDlg; @@ -8143,7 +8140,7 @@ static INT_PTR CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM inputdevice_config_change (); input_selected_widget = -1; init_inputdlg(hDlg); - + case WM_USER: recursive++; enable_for_inputdlg (hDlg); @@ -8174,12 +8171,12 @@ static INT_PTR CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM recursive--; break; case WM_NOTIFY: - if (((LPNMHDR) lParam)->idFrom == IDC_INPUTLIST) + if (((LPNMHDR) lParam)->idFrom == IDC_INPUTLIST) { int row; nmlistview = (NM_LISTVIEW *) lParam; list = nmlistview->hdr.hwndFrom; - switch (nmlistview->hdr.code) + switch (nmlistview->hdr.code) { case NM_DBLCLK: dblclick = 1; @@ -8410,7 +8407,7 @@ static void values_to_hw3ddlg (HWND hDlg) int idx = SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_GETCURSEL, 0, 0L); if (idx == CB_ERR) idx = -1; - SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_RESETCONTENT, 0, 0L); + SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_RESETCONTENT, 0, 0L); for (i = 0; filter_extra[i].label; i++) { if (filter_selected == &filter_extra[i] && idx < 0) idx2 = i; @@ -8438,16 +8435,16 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L); for (i = 0; filtermultnames[i]; i++) { - SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]); - SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]); + SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]); + SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]); } SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_SETCURSEL, 0, 0); SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_SETCURSEL, 0, 0); for (i = 0; filtermultnames[i]; i++) { if (filtermults[i] == workprefs.gfx_filter_horiz_zoom_mult) - SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_SETCURSEL, i, 0); + SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_SETCURSEL, i, 0); if (filtermults[i] == workprefs.gfx_filter_vert_zoom_mult) - SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_SETCURSEL, i, 0); + SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_SETCURSEL, i, 0); } SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_RESETCONTENT, 0, 0L); @@ -8462,7 +8459,7 @@ static void values_to_hw3ddlg (HWND hDlg) i++; } SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_SETCURSEL, j, 0); - + j = 0; SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)""); @@ -8493,7 +8490,7 @@ static void values_to_hw3ddlg (HWND hDlg) RegCloseKey (fkey); } } - + SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_zoom); SendDlgItemMessage (hDlg, IDC_FILTERVZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_vert_zoom); SendDlgItemMessage (hDlg, IDC_FILTERHO, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_offset); @@ -8586,7 +8583,7 @@ static void filter_preset (HWND hDlg, WPARAM wParam) } else if (wParam == IDC_FILTERPRESETLOAD) { char *s = tmp2; char *t; - + load = 1; strcat (s, ","); t = strchr (s, ','); @@ -8646,7 +8643,7 @@ static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l static int recursive; LRESULT item; - switch (msg) + switch (msg) { case WM_INITDIALOG: #if WINUAEBETA == 0 @@ -8655,7 +8652,7 @@ static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l pages[HW3D_ID] = hDlg; currentpage = HW3D_ID; enable_for_hw3ddlg (hDlg); - + case WM_USER: if(recursive > 0) break; @@ -8758,32 +8755,32 @@ static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l static void values_to_avioutputdlg(HWND hDlg) { char tmpstr[256]; - + updatewinfsmode (&workprefs); SetDlgItemText(hDlg, IDC_AVIOUTPUT_FILETEXT, avioutput_filename); - + sprintf(tmpstr, "%d fps", avioutput_fps); SendMessage(GetDlgItem(hDlg, IDC_AVIOUTPUT_FPS_STATIC), WM_SETTEXT, (WPARAM) 0, (LPARAM) tmpstr); - + sprintf(tmpstr, "Actual: %d x %d", workprefs.gfx_size.width, workprefs.gfx_size.height); SendMessage(GetDlgItem(hDlg, IDC_AVIOUTPUT_DIMENSIONS_STATIC), WM_SETTEXT, (WPARAM) 0, (LPARAM) tmpstr); - + switch(avioutput_fps) { case VBLANK_HZ_PAL: CheckRadioButton(hDlg, IDC_AVIOUTPUT_PAL, IDC_AVIOUTPUT_NTSC, IDC_AVIOUTPUT_PAL); break; - + case VBLANK_HZ_NTSC: CheckRadioButton(hDlg, IDC_AVIOUTPUT_PAL, IDC_AVIOUTPUT_NTSC, IDC_AVIOUTPUT_NTSC); break; - + default: CheckDlgButton(hDlg, IDC_AVIOUTPUT_PAL, BST_UNCHECKED); CheckDlgButton(hDlg, IDC_AVIOUTPUT_NTSC, BST_UNCHECKED); break; } - + CheckDlgButton (hDlg, IDC_AVIOUTPUT_FRAMELIMITER, avioutput_framelimiter ? FALSE : TRUE); CheckDlgButton (hDlg, IDC_AVIOUTPUT_NOSOUNDOUTPUT, avioutput_nosoundoutput ? TRUE : FALSE); CheckDlgButton (hDlg, IDC_AVIOUTPUT_ACTIVATED, avioutput_requested ? BST_CHECKED : BST_UNCHECKED); @@ -8810,7 +8807,7 @@ static void enable_for_avioutputdlg(HWND hDlg) #if defined (PROWIZARD) ew (hDlg, IDC_PROWIZARD, TRUE); if (full_property_sheet) - ew (hDlg, IDC_PROWIZARD, FALSE); + ew (hDlg, IDC_PROWIZARD, FALSE); #endif ew (hDlg, IDC_SCREENSHOT, full_property_sheet ? FALSE : TRUE); @@ -8820,7 +8817,7 @@ static void enable_for_avioutputdlg(HWND hDlg) ew (hDlg, IDC_AVIOUTPUT_NTSC, TRUE); ew (hDlg, IDC_AVIOUTPUT_FPS, TRUE); ew (hDlg, IDC_AVIOUTPUT_FILE, TRUE); - + if(workprefs.produce_sound < 2) { ew (hDlg, IDC_AVIOUTPUT_AUDIO, FALSE); ew (hDlg, IDC_AVIOUTPUT_AUDIO_STATIC, FALSE); @@ -8840,7 +8837,7 @@ static void enable_for_avioutputdlg(HWND hDlg) WIN32GUI_LoadUIString (IDS_AVIOUTPUT_NOCODEC, tmp, sizeof tmp); } SetWindowText(GetDlgItem(hDlg, IDC_AVIOUTPUT_AUDIO_STATIC), tmp); - + if (avioutput_audio != AVIAUDIO_WAV) avioutput_video = AVIOutput_GetVideoCodec(tmp, sizeof tmp); if(!avioutput_video) { @@ -8869,7 +8866,7 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA { static int recursive = 0; char tmp[1000]; - + switch(msg) { case WM_INITDIALOG: @@ -8881,17 +8878,17 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, avioutput_fps); SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL); if (!avioutput_filename[0]) { - fetch_path ("VideoPath", avioutput_filename, sizeof (avioutput_filename)); - strcat (avioutput_filename, "output.avi"); + fetch_path ("VideoPath", avioutput_filename, sizeof (avioutput_filename)); + strcat (avioutput_filename, "output.avi"); } - + case WM_USER: recursive++; values_to_avioutputdlg(hDlg); enable_for_avioutputdlg(hDlg); recursive--; return TRUE; - + case WM_HSCROLL: { recursive++; @@ -8901,14 +8898,14 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA recursive--; return TRUE; } - + case WM_COMMAND: if(recursive > 0) - break; - + break; + recursive++; - + switch(wParam) { @@ -8956,37 +8953,37 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA case IDC_SCREENSHOT: screenshot(1, 0); break; - + case IDC_AVIOUTPUT_PAL: SendDlgItemMessage(hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_PAL); SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL); break; - + case IDC_AVIOUTPUT_NTSC: SendDlgItemMessage(hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_NTSC); SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL); break; - + case IDC_AVIOUTPUT_AUDIO: { if (avioutput_enabled) - AVIOutput_End (); + AVIOutput_End (); if(IsDlgButtonChecked(hDlg, IDC_AVIOUTPUT_AUDIO) == BST_CHECKED) { avioutput_audio = AVIOutput_ChooseAudioCodec(hDlg, tmp, sizeof tmp); enable_for_avioutputdlg(hDlg); } else { avioutput_audio = 0; - } + } break; } - + case IDC_AVIOUTPUT_VIDEO: { if (avioutput_enabled) - AVIOutput_End (); + AVIOutput_End (); if(IsDlgButtonChecked(hDlg, IDC_AVIOUTPUT_VIDEO) == BST_CHECKED) { avioutput_video = AVIOutput_ChooseVideoCodec(hDlg, tmp, sizeof tmp); - if (avioutput_audio = AVIAUDIO_WAV) + if (avioutput_audio = AVIAUDIO_WAV) avioutput_audio = 0; enable_for_avioutputdlg(hDlg); } else { @@ -8995,11 +8992,11 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA enable_for_avioutputdlg(hDlg); break; } - + case IDC_AVIOUTPUT_FILE: { OPENFILENAME ofn; - + ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hDlg; @@ -9017,26 +9014,26 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA ofn.lpTemplateName = NULL; ofn.lCustData = 0; ofn.lpstrFilter = "Video Clip (*.avi)\0*.avi\0Wave Sound (*.wav)\0"; - + if(!GetSaveFileName(&ofn)) break; if (ofn.nFilterIndex == 2) { - avioutput_audio = AVIAUDIO_WAV; - avioutput_video = 0; - if (strlen (avioutput_filename) > 4 && !stricmp (avioutput_filename + strlen (avioutput_filename) - 4, ".avi")) + avioutput_audio = AVIAUDIO_WAV; + avioutput_video = 0; + if (strlen (avioutput_filename) > 4 && !stricmp (avioutput_filename + strlen (avioutput_filename) - 4, ".avi")) strcpy (avioutput_filename + strlen (avioutput_filename) - 4, ".wav"); } break; } - + } - + values_from_avioutputdlg(hDlg, msg, wParam, lParam); values_to_avioutputdlg(hDlg); enable_for_avioutputdlg(hDlg); - + recursive--; - + return TRUE; } return FALSE; @@ -9486,8 +9483,8 @@ static void centerWindow (HWND hDlg) GetWindowRect (owner, &rcOwner); GetWindowRect (hDlg, &rcDlg); CopyRect (&rc, &rcOwner); - OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top); - OffsetRect(&rc, -rc.left, -rc.top); + OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top); + OffsetRect(&rc, -rc.left, -rc.top); OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom); x = rcOwner.left + (rc.right / 2); y = rcOwner.top + (rc.bottom / 2); @@ -9520,7 +9517,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) RECT r, r2; int ret = 0; DWORD flags; - + DragQueryPoint (hd, &pt); pt.y += GetSystemMetrics (SM_CYMENU) + GetSystemMetrics (SM_CYBORDER); cnt = DragQueryFile (hd, 0xffffffff, NULL, 0); @@ -9558,7 +9555,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) int type = -1; DragQueryFile (hd, i, file, sizeof (file)); - flags = GetFileAttributes(file); + flags = GetFileAttributes(file); if (flags & FILE_ATTRIBUTE_DIRECTORY) type = ZFILE_HDF; if (type < 0) { @@ -9571,22 +9568,27 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) } } + if (currentpage < 0 && i == 0) { + if (filesys_insert (-1, NULL, file, 0, 0)) + continue; + } + switch (type) { - case ZFILE_DISKIMAGE: - if (currentpage == DISK_ID) { + case ZFILE_DISKIMAGE: + if (currentpage == DISK_ID) { list = 0; while (list < MAX_SPARE_DRIVES) { - if (!strcasecmp (prefs->dfxlist[list], file)) + if (!strcasecmp (prefs->dfxlist[list], file)) break; list++; } if (list == MAX_SPARE_DRIVES) { - list = 0; - while (list < MAX_SPARE_DRIVES) { + list = 0; + while (list < MAX_SPARE_DRIVES) { if (!prefs->dfxlist[list][0]) { - strcpy (prefs->dfxlist[list], file); - break; + strcpy (prefs->dfxlist[list], file); + break; } list++; } @@ -9599,21 +9601,21 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) disk_insert (drv, workprefs.df[drv]); drv++; if (drv >= (currentpage == QUICKSTART_ID ? 2 : 4)) - drv = 0; + drv = 0; if (workprefs.dfxtype[drv] < 0) - drv = 0; + drv = 0; if (drv == firstdrv) - i = cnt; + i = cnt; } break; case ZFILE_ROM: - if (rd) { + if (rd) { if (rd->type == ROMTYPE_KICK || rd->type == ROMTYPE_KICKCD32) - strcpy (prefs->romfile, file); + strcpy (prefs->romfile, file); if (rd->type == ROMTYPE_EXTCD32 || rd->type == ROMTYPE_EXTCDTV) - strcpy (prefs->romextfile, file); + strcpy (prefs->romextfile, file); if (rd->type == ROMTYPE_AR) - strcpy (prefs->cartfile, file); + strcpy (prefs->cartfile, file); } else { strcpy (prefs->romfile, file); } @@ -9621,7 +9623,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) case ZFILE_HDF: if (flags & FILE_ATTRIBUTE_DIRECTORY) { if (!full_property_sheet && currentpage < 0) - filesys_insert(-1, NULL, file, 0, 0); + filesys_insert (-1, NULL, file, 0, 0); else add_filesys_config (&workprefs, -1, NULL, "", file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); @@ -9631,34 +9633,34 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) } break; case ZFILE_NVR: - strcpy (prefs->flashfile, file); + strcpy (prefs->flashfile, file); break; case ZFILE_CONFIGURATION: - if (target_cfgfile_load (&workprefs, file, 0, 0)) { + if (target_cfgfile_load (&workprefs, file, 0, 0)) { if (full_property_sheet) { - inputdevice_updateconfig (&workprefs); - if (!workprefs.start_gui) + inputdevice_updateconfig (&workprefs); + if (!workprefs.start_gui) ret = 1; } else { - uae_restart (workprefs.start_gui, file); - ret = 1; + uae_restart (workprefs.start_gui, file); + ret = 1; } } break; case ZFILE_STATEFILE: - savestate_state = STATE_DORESTORE; - strcpy (savestate_fname, file); - ret = 1; + savestate_state = STATE_DORESTORE; + strcpy (savestate_fname, file); + ret = 1; break; default: if (currentpage < 0 && !full_property_sheet) { - filesys_insert(-1, NULL, file, 0, 0); + filesys_insert (-1, NULL, file, 0, 0); } else if (currentpage == HARDDISK_ID) { add_filesys_config (&workprefs, -1, NULL, "", file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); } else { rd = scan_arcadia_rom (file, 0); - if (rd) { + if (rd) { if (rd->type == ROMTYPE_ARCADIABIOS) strcpy (prefs->romextfile, file); else if (rd->type == ROMTYPE_ARCADIAGAME) @@ -9690,7 +9692,7 @@ static INT_PTR CALLBACK DialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP quit_program = 1; regs.spcflags |= SPCFLAG_BRK; } - } + } return TRUE; case WM_INITDIALOG: guiDlg = hDlg; @@ -9988,7 +9990,7 @@ static int GetSettings (int all_options, HWND hwnd) hAccelTable = NULL; DragAcceptFiles(hwnd, TRUE); if (first) - write_log("Entering GUI idle loop\n"); + write_log ("Entering GUI idle loop\n"); scaleresource_setmaxsize(800, 600); tres = scaleresource(panelresource, hwnd); dhwnd = CreateDialogIndirect (tres->inst, tres->resource, hwnd, DialogProc); @@ -10040,7 +10042,7 @@ static int GetSettings (int all_options, HWND hwnd) DispatchMessage (&msg); } if (dialogreturn >= 0) - break; + break; } psresult = dialogreturn; } @@ -10059,7 +10061,7 @@ static int GetSettings (int all_options, HWND hwnd) int gui_init (void) { int ret; - + read_rom_list(); for (;;) { ret = GetSettings(1, currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL); @@ -10083,7 +10085,7 @@ int gui_update (void) void gui_exit (void) { int i; - + for (i = 0; i < C_PAGES; i++) { if (ppage[i].accel) DestroyAcceleratorTable (ppage[i].accel); @@ -10174,7 +10176,7 @@ void gui_led (int led, int on) break; j--; } - tt = dfx[led - 1]; + tt = dfx[led - 1]; tt[0] = 0; if (strlen (p + j) > 0) sprintf (tt, "%s (CRC=%08.8X)", p + j, gui_data.crc32[led - 1]); @@ -10278,9 +10280,9 @@ int gui_message_multibutton (int flags, const char *format,...) va_start (parms, format); vsprintf( msg, format, parms ); va_end (parms); - write_log( msg ); + write_log ( msg ); if (msg[strlen(msg)-1]!='\n') - write_log("\n"); + write_log ("\n"); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); @@ -10325,14 +10327,14 @@ void gui_message (const char *format,...) if (flipflop) ShowWindow (hAmigaWnd, SW_MINIMIZE); - write_log(msg); + write_log (msg); if (msg[strlen(msg) - 1] != '\n') - write_log("\n"); + write_log ("\n"); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); if (!MessageBox (hwnd, msg, szTitle, flags)) - write_log("MessageBox(%s) failed, err=%d\n", msg, GetLastError()); + write_log ("MessageBox(%s) failed, err=%d\n", msg, GetLastError()); if (flipflop) ShowWindow (hAmigaWnd, SW_RESTORE); @@ -10358,7 +10360,7 @@ void pre_gui_message (const char *format,...) va_end (parms); write_log (msg); if (msg[strlen(msg)-1]!='\n') - write_log("\n"); + write_log ("\n"); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); strcat (szTitle, BetaStr); diff --git a/od-win32/win32gui_extra.c b/od-win32/win32gui_extra.c index e60eb85e..b6aa4b5f 100755 --- a/od-win32/win32gui_extra.c +++ b/od-win32/win32gui_extra.c @@ -93,7 +93,7 @@ static BYTE *skiptext(BYTE *s) static BYTE *todword(BYTE *p) { while ((LONG_PTR)p & 3) - p++; + p++; return p; } diff --git a/od-win32/winuae_msvc/winuae_msvc.vcproj b/od-win32/winuae_msvc/winuae_msvc.vcproj index 4f89e678..82fab5ce 100755 --- a/od-win32/winuae_msvc/winuae_msvc.vcproj +++ b/od-win32/winuae_msvc/winuae_msvc.vcproj @@ -51,7 +51,7 @@ Name="VCCLCompilerTool" AdditionalOptions="" Optimization="0" - AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep" + AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include" PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32_IE=0x0500" GeneratePreprocessedFile="0" KeepComments="false" @@ -263,7 +263,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" WholeProgramOptimization="false" - AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep" + AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include" PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0500" StringPooling="true" ExceptionHandling="0" @@ -1046,7 +1046,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" WholeProgramOptimization="true" - AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep" + AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include" PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0500" StringPooling="true" ExceptionHandling="0" @@ -1847,7 +1847,7 @@ > + + @@ -2033,6 +2037,10 @@ RelativePath="..\..\prowizard\rippers\NoiseRunner.c" > + + @@ -2101,10 +2109,6 @@ RelativePath="..\..\prowizard\rippers\Prorunner20.c" > - - @@ -2117,6 +2121,10 @@ RelativePath="..\..\prowizard\rippers\SGT-Packer.c" > + + @@ -2145,6 +2153,10 @@ RelativePath="..\..\prowizard\rippers\StimPacker.c" > + + @@ -2225,6 +2237,10 @@ RelativePath="..\..\prowizard\rippers\TimeCruncher17.c" > + + diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 191dcd5f..b78cd038 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,19 @@ +Beta 2: + +- 4-channel stereo mixing fixed (broke in b1) +- Pro-Wizard updated (1.62) +- directory filesystem ACTION_INHIBIT fixed (didn't really do much + and if it rarely did, result was infinite loop) +- directory filesystem ACTION_EXAMINE_ALL implemented (more optimal + but also more complex way to read directory listing). Bugs possible, + please test it by running all kinds of new utilities. eac_MatchString + confirmed working, eac_MatchFunc not tested (no test program found) + Full logging currently enabled. +- some removable directory drive fixes +- Harddrives GUI can be used to eject and insert directory harddrives + on the fly (device name ignored) + Beta 1: - ROM scan now always scans all detected ROM paths (skips duplicate @@ -39,6 +54,14 @@ Beta 1: only drives that were empty when emulation was started will be remounted. (It is quite bad idea to remove OS/boot drive..) - weird things can happen if files are open when changing drive + - volume name is automatically generated from directory or file name + - very useful when installing software, just drag and drop + installation package (lha-archive for example) and run it. + No need for temporarily locations or worry about losing flags or + file comments. + - overrides normal (executables -> floppy drive, configuration file + -> restart emulation etc..) drag and drop function if GUI is not + active and dropped file/directory gets accepted by filesystem. - CPU emulation and other cleanups (Bernd Schmidt!) - X-Power Professional 500 v1.3 supported - Nordic Power v1.5 supported diff --git a/od-win32/writelog.c b/od-win32/writelog.c index 4d9e5a8c..f779d276 100755 --- a/od-win32/writelog.c +++ b/od-win32/writelog.c @@ -33,7 +33,7 @@ static HWND myGetConsoleWindow(void) GETCONSOLEWINDOW pGetConsoleWindow; /* Windows 2000 or newer only */ pGetConsoleWindow = (GETCONSOLEWINDOW)GetProcAddress( - GetModuleHandle("kernel32.dll"), "GetConsoleWindow"); + GetModuleHandle("kernel32.dll"), "GetConsoleWindow"); if (pGetConsoleWindow) return pGetConsoleWindow(); return NULL; @@ -99,11 +99,11 @@ void reopen_console(void) return; hwnd = myGetConsoleWindow(); if (hwnd && hWinUAEKey) { - int newpos = 1; - LONG x, y, w, h; + int newpos = 1; + LONG x, y, w, h; DWORD regkeytype; DWORD regkeysize = sizeof(LONG); - if (RegQueryValueEx (hWinUAEKey, "LoggerPosX", 0, ®keytype, (LPBYTE)&x, ®keysize) != ERROR_SUCCESS) + if (RegQueryValueEx (hWinUAEKey, "LoggerPosX", 0, ®keytype, (LPBYTE)&x, ®keysize) != ERROR_SUCCESS) newpos = 0; if (RegQueryValueEx (hWinUAEKey, "LoggerPosY", 0, ®keytype, (LPBYTE)&y, ®keysize) != ERROR_SUCCESS) newpos = 0; @@ -119,7 +119,7 @@ void reopen_console(void) rc.bottom = y + h; if (MonitorFromRect (&rc, MONITOR_DEFAULTTONULL) != NULL) { SetForegroundWindow(hwnd); - SetWindowPos(hwnd, HWND_TOP, x, y, w, h, SWP_NOACTIVATE); + SetWindowPos(hwnd, HWND_TOP, x, y, w, h, SWP_NOACTIVATE); } } @@ -324,7 +324,7 @@ char* buf_out (char *buffer, int *bufsize, const char *format, ...) void *log_open(const char *name, int append, int bootlog) { FILE *f; - + f = fopen(name, append ? "a" : "wt"); bootlogmode = bootlog; if (!cs_init) diff --git a/picasso96.c b/picasso96.c index 089bf452..40d27ffb 100755 --- a/picasso96.c +++ b/picasso96.c @@ -44,9 +44,9 @@ #include "picasso96.h" #ifdef JIT -int have_done_picasso=0; /* For the JIT compiler */ -int picasso_is_special=PIC_WRITE; /* ditto */ -int picasso_is_special_read=PIC_READ; /* ditto */ +int have_done_picasso = 0; /* For the JIT compiler */ +int picasso_is_special = PIC_WRITE; /* ditto */ +int picasso_is_special_read = PIC_READ; /* ditto */ #endif #ifdef PICASSO96 @@ -55,9 +55,9 @@ int p96hack_vpos, p96hack_vpos2, p96refresh_active; #define P96TRACING_ENABLED 0 #if P96TRACING_ENABLED -#define P96TRACE(x) do { write_log x; } while(0) +#define P96TRACE(x) do { write_log ("P96: "); write_log x; } while(0) #else -#define P96TRACE(x) +#define P96TRACE(x) do { } while(0) #endif static uae_u32 gfxmem_lget (uaecptr) REGPARAM; @@ -78,7 +78,7 @@ static uae_u8 all_ones_bitmap, all_zeros_bitmap; struct picasso96_state_struct picasso96_state; struct picasso_vidbuf_description picasso_vidinfo; -/* These are the maximum resolutions... They are filled in by GetSupportedResolutions() */ +/* These are the maximum resolutions. They are filled in by GetSupportedResolutions() */ /* have to fill this in, otherwise problems occur * @@@ ??? what problems? */ @@ -260,19 +260,20 @@ static int CopyRenderInfoStructureA2U (uaecptr amigamemptr, struct RenderInfo *r uaecptr memp = get_long (amigamemptr + PSSO_RenderInfo_Memory); if (valid_address (memp, PSSO_RenderInfo_sizeof)) { - ri->AMemory=memp; + ri->AMemory = memp; ri->Memory = get_real_address (memp); ri->BytesPerRow = get_word (amigamemptr + PSSO_RenderInfo_BytesPerRow); ri->RGBFormat = get_long (amigamemptr + PSSO_RenderInfo_RGBFormat); return 1; } - write_log ("ERROR - Invalid RenderInfo memory area...\n"); + write_log ("ERROR - Invalid RenderInfo memory area.\n"); return 0; } static int CopyPatternStructureA2U (uaecptr amigamemptr, struct Pattern *pattern) { uaecptr memp = get_long (amigamemptr + PSSO_Pattern_Memory); + if (valid_address (memp, PSSO_Pattern_sizeof)) { pattern->Memory = get_real_address (memp); pattern->XOffset = get_word (amigamemptr + PSSO_Pattern_XOffset); @@ -283,7 +284,7 @@ static int CopyPatternStructureA2U (uaecptr amigamemptr, struct Pattern *pattern pattern->DrawMode = get_byte (amigamemptr + PSSO_Pattern_DrawMode); return 1; } - write_log ("ERROR - Invalid Pattern memory area...\n"); + write_log ("ERROR - Invalid Pattern memory area.\n"); return 0; } @@ -337,7 +338,7 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) tmpl->BgPen = get_long (amigamemptr + PSSO_Template_BgPen); return 1; } - write_log ("ERROR - Invalid Template memory area...\n"); + write_log ("ERROR - Invalid Template memory area.\n"); return 0; } @@ -346,8 +347,12 @@ static void CopyLibResolutionStructureU2A (struct LibResolution *libres, uaecptr char *uaememptr = 0; int i; - uaememptr = gfxmem_xlate (amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ - memset (uaememptr, 0, PSSO_LibResolution_sizeof); /* zero out our LibResolution structure */ + /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ + uaememptr = gfxmem_xlate (amigamemptr); + + /* zero out our LibResolution structure */ + memset (uaememptr, 0, PSSO_LibResolution_sizeof); + strcpy (uaememptr + PSSO_LibResolution_P96ID, libres->P96ID); put_long (amigamemptr + PSSO_LibResolution_DisplayID, libres->DisplayID); put_word (amigamemptr + PSSO_LibResolution_Width, libres->Width); @@ -403,7 +408,6 @@ static void AmigaListAddTail (uaecptr list, uaecptr node) * filled rectangle in the frame buffer; it can be used as a memcpy source if * there is no OS specific function to fill the rectangle. */ - static void do_fillrect (uae_u8 *src, int x, int y, int width, int height, uae_u32 pen, int Bpp, RGBFTYPE rgbtype) { @@ -504,7 +508,6 @@ static void do_fillrect (uae_u8 *src, int x, int y, int width, int height, * must do it by hand using the data in the save area, pointed to by * srcp. */ - static void do_blit (struct RenderInfo *ri, int Bpp, int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT_OPCODE opcode, int can_do_blit) @@ -748,8 +751,8 @@ void picasso_refresh (int call_setpalette) have_done_picasso=1; #endif - /* Make sure that the first time we show a Picasso video mode, we don't blit any crap. - * We can do this by checking if we have an Address yet. */ + /* Make sure that the first time we show a Picasso video mode, we don't + * blit any crap. We can do this by checking if we have an Address yet. */ if (picasso96_state.Address) { unsigned int width, height; /* blit the stuff from our static frame-buffer to the gfx-card */ @@ -795,7 +798,7 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, } if (mask == 0xFF || Bpp > 1) { - if( opcode == BLIT_SRC ) { + if (opcode == BLIT_SRC) { /* handle normal case efficiently */ if (ri->Memory == dstri->Memory && dsty == srcy) { unsigned long i; @@ -823,8 +826,8 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, for (y = 0; y < height; y++) { int bound = src + total_width - 4; //copy now the longs - for( src2_32 = src, dst2_32 = dst; src2_32 < bound; src2_32++, dst2_32++ ) { - switch( opcode ) { + for (src2_32 = src, dst2_32 = dst; src2_32 < bound; src2_32++, dst2_32++) { + switch (opcode) { case BLIT_FALSE: *dst2_32 = 0; break; @@ -856,13 +859,13 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, *dst2_32 = ~(*src2_32 ^ *dst2_32); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2_32 = ~(*src2_32) | *dst2_32; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2_32 = ~(*dst2_32) | *src2_32; @@ -882,13 +885,13 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, } break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; } /* switch opcode */ } // for end //now copy the rest few bytes - for (src2 = src2_32, dst2 = dst2_32; src2 < src + total_width; src2++, dst2++ ) { - switch( opcode ) { + for (src2 = src2_32, dst2 = dst2_32; src2 < src + total_width; src2++, dst2++) { + switch (opcode) { case BLIT_FALSE: *dst2 = 0; break; @@ -920,13 +923,13 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, *dst2 = ~(*src2 ^ *dst2); break; case BLIT_DST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_DST!\n"); break; case BLIT_NOTONLYSRC: *dst2 = ~(*src2) | *dst2; break; case BLIT_SRC: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_SRC!\n"); break; case BLIT_NOTONLYDST: *dst2 = ~(*dst2) | *src2; @@ -938,7 +941,7 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, *dst2 = 0xFF; break; case BLIT_LAST: - write_log( "do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); + write_log ("ERROR - do_blitrect_frame_buffer shouldn't get BLIT_LAST!\n"); break; case 30: //code for swap source with dest in long { @@ -1098,6 +1101,7 @@ uae_u32 picasso_InitCard (void) int ModeInfoStructureCount = 1, LibResolutionStructureCount = 0; uaecptr amigamemptr = 0; uaecptr AmigaBoardInfo = m68k_areg (regs, 2); + put_word (AmigaBoardInfo + PSSO_BoardInfo_BitsPerCannon, DX_BitsPerCannon ()); put_word (AmigaBoardInfo + PSSO_BoardInfo_RGBFormats, picasso96_pixel_format); put_word (AmigaBoardInfo + PSSO_BoardInfo_SoftSpriteFlags, picasso96_pixel_format); @@ -1149,8 +1153,10 @@ uae_u32 picasso_InitCard (void) && DisplayModes[i].res.height == DisplayModes[j].res.height); amigamemptr = gfxmem_start + allocated_gfxmem - 16384 + (PSSO_LibResolution_sizeof * LibResolutionStructureCount++); + CopyLibResolutionStructureU2A (&res, amigamemptr); DumpLibResolutionStructure (amigamemptr); + AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amigamemptr); } @@ -1243,14 +1249,15 @@ void picasso_clip_mouse (int *px, int *py) */ uae_u32 picasso_SetColorArray (void) { - /* Fill in some static UAE related structure about this new CLUT setting - * We need this for CLUT-based displays, and for mapping CLUT to hi/true colour */ + /* Fill in some static UAE related structure about this new CLUT setting. + * We need this for CLUT-based displays, and for mapping CLUT to hi/true + * colour */ + uaecptr boardinfo = m68k_areg (regs, 0); uae_u16 start = m68k_dreg (regs, 0); uae_u16 count = m68k_dreg (regs, 1); - int i; - uaecptr boardinfo = m68k_areg (regs, 0); uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT + start * 3; int changed = 0; + int i; for (i = start; i < start + count; i++) { int r = get_byte (clut); @@ -1262,6 +1269,7 @@ uae_u32 picasso_SetColorArray (void) picasso96_state.CLUT[i].Red = r; picasso96_state.CLUT[i].Green = g; picasso96_state.CLUT[i].Blue = b; + clut += 3; } if (changed) { @@ -1270,7 +1278,6 @@ uae_u32 picasso_SetColorArray (void) if (start + count > last_color_changed) last_color_changed = start + count; } - /*write_log ("SetColorArray(%d,%d)\n", start, count); */ return 1; } @@ -1341,7 +1348,8 @@ uae_u32 picasso_SetGC (void) picasso96_state.GC_Depth = get_byte (modeinfo + PSSO_ModeInfo_Depth); picasso96_state.GC_Flags = get_byte (modeinfo + PSSO_ModeInfo_Flags); - P96TRACE (("SetGC(%d,%d,%d)\n", picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth)); + P96TRACE (("SetGC(%d,%d,%d)\n", picasso96_state.Width, picasso96_state.Height, + picasso96_state.GC_Depth)); set_gc_called = 1; /* @@@ when do we need to reset this? */ init_picasso_screen (); @@ -1472,7 +1480,7 @@ uae_u32 picasso_InvertRect (void) wgfx_flushline (); if (CopyRenderInfoStructureA2U (renderinfo, &ri)) { - P96TRACE(("InvertRect %dbpp 0x%lx\n", Bpp, (long)mask)); + P96TRACE (("InvertRect %dbpp 0x%lx\n", Bpp, (long)mask)); if (mask != 0xFF && Bpp > 1) mask = 0xFF; @@ -1488,7 +1496,7 @@ uae_u32 picasso_InvertRect (void) if (mask == 0xFF) do_invertrect (&ri, Bpp, X, Y, Width, Height); else - do_blit( &ri, Bpp, X, Y, X, Y, Width, Height, BLIT_SRC, 0); + do_blit (&ri, Bpp, X, Y, X, Y, Width, Height, BLIT_SRC, 0); } result = 1; } @@ -1543,7 +1551,7 @@ STATIC_INLINE void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y memcpy (dst, src, Width * Bpp); } else { for (lines = 0; lines < (Height - 1); lines++, dst += ri->BytesPerRow) - memset( dst, Pen, Width ); + memset (dst, Pen, Width); } } @@ -1605,7 +1613,7 @@ uae_u32 picasso_FillRect (void) if (Width == 1) { for (i = 0; i < Height; i++) { - if( Bpp == 4 ) + if (Bpp == 4) gfxmem_lput (addr + (i * picasso96_state.BytesPerRow), Pen); else if (Bpp == 2) gfxmem_wput (addr + (i * picasso96_state.BytesPerRow), Pen); @@ -1619,7 +1627,7 @@ uae_u32 picasso_FillRect (void) else if (Bpp == 2) gfxmem_wput (addr + (i*Bpp), Pen); else - gfxmem_bput( addr + (i*Bpp), Pen ); + gfxmem_bput (addr + (i*Bpp), Pen); } } return 1; @@ -1653,7 +1661,7 @@ uae_u32 picasso_FillRect (void) } else { /* We get here only if Mask != 0xFF */ if (Bpp != 1) { - write_log( "WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp); + write_log ("WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp); } else { Pen &= Mask; Mask = ~Mask; @@ -1681,27 +1689,27 @@ uae_u32 picasso_FillRect (void) /* -* BlitRect() is a generic (any chunky pixel format) rectangle copier -* NOTE: If dstri is NULL, then we're only dealing with one RenderInfo area, and called from picasso_BlitRect() -* -* OpCodes: -* 0 = FALSE: dst = 0 -* 1 = NOR: dst = ~(src | dst) -* 2 = ONLYDST: dst = dst & ~src -* 3 = NOTSRC: dst = ~src -* 4 = ONLYSRC: dst = src & ~dst -* 5 = NOTDST: dst = ~dst -* 6 = EOR: dst = src^dst -* 7 = NAND: dst = ~(src & dst) -* 8 = AND: dst = (src & dst) -* 9 = NEOR: dst = ~(src ^ dst) -*10 = DST: dst = dst -*11 = NOTONLYSRC: dst = ~src | dst -*12 = SRC: dst = src -*13 = NOTONLYDST: dst = ~dst | src -*14 = OR: dst = src | dst -*15 = TRUE: dst = 0xFF -*/ + * BlitRect() is a generic (any chunky pixel format) rectangle copier + * NOTE: If dstri is NULL, then we're only dealing with one RenderInfo area, and called from picasso_BlitRect() + * + * OpCodes: + * 0 = FALSE: dst = 0 + * 1 = NOR: dst = ~(src | dst) + * 2 = ONLYDST: dst = dst & ~src + * 3 = NOTSRC: dst = ~src + * 4 = ONLYSRC: dst = src & ~dst + * 5 = NOTDST: dst = ~dst + * 6 = EOR: dst = src^dst + * 7 = NAND: dst = ~(src & dst) + * 8 = AND: dst = (src & dst) + * 9 = NEOR: dst = ~(src ^ dst) + * 10 = DST: dst = dst + * 11 = NOTONLYSRC: dst = ~src | dst + * 12 = SRC: dst = src + * 13 = NOTONLYDST: dst = ~dst | src + * 14 = OR: dst = src | dst + * 15 = TRUE: dst = 0xFF + */ struct blitdata { struct RenderInfo ri_struct; @@ -1718,15 +1726,15 @@ struct blitdata BLIT_OPCODE opcode; } blitrectdata; -STATIC_INLINE int BlitRectHelper( void ) +STATIC_INLINE int BlitRectHelper (void) { - struct RenderInfo *ri = blitrectdata.ri; + struct RenderInfo *ri = blitrectdata.ri; struct RenderInfo *dstri = blitrectdata.dstri; - unsigned long srcx = blitrectdata.srcx; - unsigned long srcy = blitrectdata.srcy; - unsigned long dstx = blitrectdata.dstx; - unsigned long dsty = blitrectdata.dsty; - unsigned long width = blitrectdata.width; + unsigned long srcx = blitrectdata.srcx; + unsigned long srcy = blitrectdata.srcy; + unsigned long dstx = blitrectdata.dstx; + unsigned long dsty = blitrectdata.dsty; + unsigned long width = blitrectdata.width; unsigned long height = blitrectdata.height; uae_u8 mask = blitrectdata.mask; BLIT_OPCODE opcode = blitrectdata.opcode; @@ -1737,7 +1745,7 @@ STATIC_INLINE int BlitRectHelper( void ) int can_do_visible_blit = 0; if (opcode == BLIT_DST) { - write_log( "WARNING: BlitRect() being called with opcode of BLIT_DST\n" ); + write_log ("WARNING: BlitRect() being called with opcode of BLIT_DST\n"); return 1; } @@ -1770,9 +1778,9 @@ STATIC_INLINE int BlitRectHelper( void ) } else do_blit (dstri, Bpp, dstx, dsty, dstx, dsty, width, height, opcode, 0); - P96TRACE(("Did do_blit 1 in BlitRect()\n")); + P96TRACE (("Did do_blit 1 in BlitRect()\n")); } else { - P96TRACE(("Did not do_blit 1 in BlitRect()\n")); + P96TRACE (("Did not do_blit 1 in BlitRect()\n")); } return 1; @@ -1780,14 +1788,14 @@ STATIC_INLINE int BlitRectHelper( void ) STATIC_INLINE int BlitRect (uaecptr ri, uaecptr dstri, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, - unsigned long width, unsigned long height, uae_u8 mask, BLIT_OPCODE opcode ) + unsigned long width, unsigned long height, uae_u8 mask, BLIT_OPCODE opcode) { /* Set up the params */ - CopyRenderInfoStructureA2U( ri, &blitrectdata.ri_struct ); + CopyRenderInfoStructureA2U (ri, &blitrectdata.ri_struct); blitrectdata.ri = &blitrectdata.ri_struct; if (dstri) { - CopyRenderInfoStructureA2U( dstri, &blitrectdata.dstri_struct ); + CopyRenderInfoStructureA2U (dstri, &blitrectdata.dstri_struct); blitrectdata.dstri = &blitrectdata.dstri_struct; } else blitrectdata.dstri = NULL; @@ -1836,7 +1844,7 @@ uae_u32 picasso_BlitRect (void) wgfx_flushline (); - P96TRACE(("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask)); + P96TRACE (("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask)); result = BlitRect (renderinfo, (uaecptr)NULL, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC); return result; @@ -1875,7 +1883,7 @@ uae_u32 picasso_BlitRectNoMaskComplete (void) uae_u32 result = 0; #ifdef JIT - special_mem|=picasso_is_special_read|picasso_is_special; + special_mem |= picasso_is_special_read|picasso_is_special; #endif wgfx_flushline (); @@ -1963,7 +1971,7 @@ uae_u32 picasso_BlitPattern (void) unsigned long Y = (uae_u16)m68k_dreg (regs, 1); unsigned long W = (uae_u16)m68k_dreg (regs, 2); unsigned long H = (uae_u16)m68k_dreg (regs, 3); - uae_u8 Mask = (uae_u8) m68k_dreg (regs, 4); + uae_u8 Mask = (uae_u8) m68k_dreg (regs, 4); uae_u32 RGBFmt = m68k_dreg (regs, 7); uae_u8 Bpp = GetBytesPerPixel (RGBFmt); int inversion = 0; @@ -1992,10 +2000,10 @@ uae_u32 picasso_BlitPattern (void) pattern.DrawMode &= 0x03; if (Mask != 0xFF) { - if( Bpp > 1 ) + if (Bpp > 1) Mask = 0xFF; - if( pattern.DrawMode == COMP) + if (pattern.DrawMode == COMP) write_log ("WARNING - BlitPattern() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.\n", Mask); else result = 1; @@ -2004,7 +2012,7 @@ uae_u32 picasso_BlitPattern (void) if (result) { # ifdef P96TRACING_ENABLED - DumpPattern(&pattern); + DumpPattern (&pattern); # endif ysize_mask = (1 << pattern.Size) - 1; xshift = pattern.XOffset & 15; @@ -2130,7 +2138,7 @@ uae_u32 picasso_BlitTemplate (void) uae_u32 result = 0; #ifdef JIT - special_mem|=picasso_is_special_read|picasso_is_special; + special_mem |= picasso_is_special_read|picasso_is_special; #endif wgfx_flushline (); @@ -2175,7 +2183,7 @@ uae_u32 picasso_BlitTemplate (void) bitoffset = tmp.XOffset % 8; -# if defined( P96TRACING_ENABLED ) && ( P96TRACING_LEVEL > 0 ) +# if defined (P96TRACING_ENABLED) && (P96TRACING_LEVEL > 0) DumpTemplate(&tmp, W, H); # endif @@ -2553,7 +2561,7 @@ uae_u32 picasso_BlitPlanar2Direct (void) uae_u32 result = 0; #ifdef JIT - special_mem|=picasso_is_special_read|picasso_is_special; + special_mem |= picasso_is_special_read|picasso_is_special; #endif wgfx_flushline (); @@ -2569,7 +2577,7 @@ uae_u32 picasso_BlitPlanar2Direct (void) PlanarToDirect (&local_ri, &local_bm, srcx, srcy, dstx, dsty, width, height, Mask, &local_cim); if (renderinfo_is_current_screen (&local_ri)) - do_blit( &local_ri, GetBytesPerPixel( local_ri.RGBFormat ), dstx, dsty, dstx, dsty, width, height, BLIT_SRC, 0); + do_blit (&local_ri, GetBytesPerPixel (local_ri.RGBFormat), dstx, dsty, dstx, dsty, width, height, BLIT_SRC, 0); result = 1; } return result; @@ -2710,9 +2718,9 @@ static uae_u32 REGPARAM2 gfxmem_lget (uaecptr addr) uae_u32 *m; #ifdef JIT - special_mem|=picasso_is_special_read; + special_mem |= picasso_is_special_read; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; m = (uae_u32 *) (gfxmemory + addr); return do_get_mem_long (m); @@ -2723,9 +2731,9 @@ static uae_u32 REGPARAM2 gfxmem_wget (uaecptr addr) uae_u16 *m; #ifdef JIT - special_mem|=picasso_is_special_read; + special_mem |= picasso_is_special_read; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; m = (uae_u16 *) (gfxmemory + addr); return do_get_mem_word (m); @@ -2734,9 +2742,9 @@ static uae_u32 REGPARAM2 gfxmem_wget (uaecptr addr) static uae_u32 REGPARAM2 gfxmem_bget (uaecptr addr) { #ifdef JIT - special_mem|=picasso_is_special_read; + special_mem |= picasso_is_special_read; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; return gfxmemory[addr]; } @@ -2746,9 +2754,9 @@ static void REGPARAM2 gfxmem_lput (uaecptr addr, uae_u32 l) uae_u32 *m; #ifdef JIT - special_mem|=picasso_is_special; + special_mem |= picasso_is_special; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; m = (uae_u32 *) (gfxmemory + addr); do_put_mem_long (m, l); @@ -2761,9 +2769,9 @@ static void REGPARAM2 gfxmem_wput (uaecptr addr, uae_u32 w) { uae_u16 *m; #ifdef JIT - special_mem|=picasso_is_special; + special_mem |= picasso_is_special; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; m = (uae_u16 *) (gfxmemory + addr); do_put_mem_word (m, (uae_u16) w); @@ -2775,9 +2783,9 @@ static void REGPARAM2 gfxmem_wput (uaecptr addr, uae_u32 w) static void REGPARAM2 gfxmem_bput (uaecptr addr, uae_u32 b) { #ifdef JIT - special_mem|=picasso_is_special; + special_mem |= picasso_is_special; #endif - addr -= gfxmem_start & gfxmem_mask; + addr -= gfxmem_start; addr &= gfxmem_mask; gfxmemory[addr] = b; diff --git a/prowizard/rippers/extern.h b/prowizard/include/extern.h similarity index 94% rename from prowizard/rippers/extern.h rename to prowizard/include/extern.h index b9d339dc..8655a79c 100755 --- a/prowizard/rippers/extern.h +++ b/prowizard/include/extern.h @@ -17,6 +17,7 @@ extern short testcrunchmaniaSimple ( void ); extern short testCRND ( void ); extern short testDefjam32 ( void ); extern short testDefjam32pro ( void ); +extern short testDefjamCruncher32t (void); extern short testDoubleAction10 ( void ); extern short testDragpack100 ( void ); extern short testDragpack252 ( void ); @@ -76,11 +77,13 @@ extern short testMP_noID ( void ); extern short testMP_withID ( void ); extern short testMUGICIAN ( void ); extern short testNewtron ( void ); +extern short testNewtronOld ( void ); extern short testNFH ( void ); extern short testNoiserunner ( void ); extern short testNoisepacker1 ( void ); extern short testNoisepacker2 ( void ); extern short testNoisepacker3 ( void ); +extern short testNovoTrade ( void ); extern short testP40A ( void ); extern short testP41A ( void ); extern short testP50A ( void ); @@ -104,18 +107,20 @@ extern short testPRUN2 ( void ); /*extern short testPTK ( void );*/ extern short testQuadraComposer ( void ); extern short testSGT ( void ); +extern short testSkizzo ( void ); extern short testSKYT ( void ); extern short testSoundFX13 ( void ); extern short testSoundTracker ( void ); extern short testSTARPACK ( void ); extern short testSTK26 ( void ); extern short testSTIM ( void ); +extern short testStoneArtsPlayer ( void ); extern short testTheDarkDemon ( void ); +extern short testTitanicsPlayer ( void ); extern short testTMK ( void ); extern short testTP1 ( void ); extern short testTP2 ( void ); extern short testTP3 ( void ); -extern short testTreasure ( void ); extern short testUNIC_noID ( void ); extern short testUNIC_withID ( void ); extern short testUNIC_withemptyID ( void ); @@ -192,11 +197,13 @@ extern void Rip_MUGICIAN ( void ); extern void Rip_MP_noID ( void ); extern void Rip_MP_withID ( void ); extern void Rip_Newtron ( void ); +extern void Rip_NewtronOld ( void ); extern void Rip_NFH ( void ); extern void Rip_Noisepacker1 ( void ); extern void Rip_Noisepacker2 ( void ); extern void Rip_Noisepacker3 ( void ); extern void Rip_Noiserunner ( void ); +extern void Rip_NovoTrade ( void); extern void Rip_P22A ( void ); extern void Rip_P30A ( void ); extern void Rip_P40A ( void ); @@ -219,6 +226,7 @@ extern void Rip_PP30 ( void ); /*extern void Rip_PTK ( void );*/ extern void Rip_QuadraComposer ( void ); extern void Rip_SGT ( void ); +extern void Rip_Skizzo ( void ); extern void Rip_SKYT ( void ); extern void Rip_SoundFX13 ( void ); extern void Rip_SoundTracker ( void ); @@ -226,12 +234,13 @@ extern void Rip_STARPACK ( void ); /*extern void Rip_StarTrekker ( void );*/ extern void Rip_STK26 ( void ); extern void Rip_STIM ( void ); +extern void Rip_StoneArtsPlayer ( void ); extern void Rip_TheDarkDemon ( void ); +extern void Rip_TitanicsPlayer ( void ); extern void Rip_TMK ( void ); extern void Rip_TP1 ( void ); extern void Rip_TP2 ( void ); extern void Rip_TP3 ( void ); -extern void Rip_Treasure ( void ); extern void Rip_PRUN2 ( void ); extern void Rip_PRUN1 ( void ); extern void Rip_UNIC_withID ( void ); @@ -261,11 +270,13 @@ extern void Depack_KRIS ( void ); extern void Depack_KSM ( void ); extern void Depack_MP ( void ); extern void Depack_Newtron ( void ); +extern void Depack_NewtronOld ( void ); extern void Depack_NFH ( void ); extern void Depack_Noiserunner ( void ); extern void Depack_Noisepacker1 ( void ); extern void Depack_Noisepacker2 ( void ); extern void Depack_Noisepacker3 ( void ); +extern void Depack_NovoTrade ( void ); extern void Depack_P22 ( void ); extern void Depack_P30 ( void ); extern void Depack_P40 ( void ); @@ -288,16 +299,18 @@ extern void Depack_PRUN1 ( void ); extern void Depack_PRUN2 ( void ); extern void Depack_QuadraComposer ( void ); extern void Depack_SGT ( void ); +extern void Depack_Skizzo ( void ); extern void Depack_SKYT ( void ); extern void Depack_STARPACK ( void ); extern void Depack_STK26 ( void ); extern void Depack_STIM ( void ); +extern void Depack_StoneArtsPlayer ( void ); extern void Depack_TheDarkDemon ( void ); +extern void Depack_TitanicsPlayer ( void ); extern void Depack_TMK ( void ); extern void Depack_TP1 ( void ); extern void Depack_TP2 ( void ); extern void Depack_TP3 ( void ); -extern void Depack_Treasure ( void ); extern void Depack_UNIC ( void ); extern void Depack_UNIC2 ( void ); extern void Depack_WN ( void ); @@ -317,7 +330,7 @@ extern short test_1_start ( Ulong ); extern short test_smps ( long, long, long, Uchar, Uchar ); extern long PWGetFileSize ( char * ); extern FILE * PW_fopen ( char *, char * ); -extern void fillPTKtable ( Uchar [37][2] ); +extern void fillPTKtable ( Uchar[37][2] ); /* globals */ /* Some say it's badly coding when using Globals ... sure it is, now what's the solution ? */ @@ -338,3 +351,5 @@ extern Ulong PW_WholeSampleSize; extern char Extensions[_KNOWN_FORMATS+1][33]; extern Uchar CONVERT; extern Uchar Amiga_EXE_Header; + +extern void write_log (const char *, ...); \ No newline at end of file diff --git a/prowizard/rippers/globals.h b/prowizard/include/globals.h similarity index 94% rename from prowizard/rippers/globals.h rename to prowizard/include/globals.h index 77b29c12..2c67fa7b 100755 --- a/prowizard/rippers/globals.h +++ b/prowizard/include/globals.h @@ -10,7 +10,10 @@ #include /*#include */ #ifdef DOS -#include +#include +#endif +#ifdef DMALLOC +#include "dmalloc.h" #endif @@ -26,7 +29,7 @@ __inline Ulong htonl (Ulong v) } #endif -#define _KNOWN_FORMATS 130 +#define _KNOWN_FORMATS 135 #define _TYPES_FILENAME "_types_" #define _TYPES_LINE_LENGHT 256 #define MINIMAL_FILE_LENGHT 64 @@ -174,4 +177,9 @@ enum GNUPacker12, CrunchmaniaSimple, dmu, + TitanicsPlayer, + NewtronOld, + NovoTrade, + Skizzo, + StoneArtsPlayer, }; diff --git a/prowizard/rippers/ptktable.h b/prowizard/include/ptktable.h similarity index 100% rename from prowizard/rippers/ptktable.h rename to prowizard/include/ptktable.h diff --git a/prowizard/rippers/tuning.h b/prowizard/include/tuning.h similarity index 100% rename from prowizard/rippers/tuning.h rename to prowizard/include/tuning.h diff --git a/prowizard/rippers/vars.h b/prowizard/include/vars.h similarity index 100% rename from prowizard/rippers/vars.h rename to prowizard/include/vars.h diff --git a/prowizard/misc/misc.c b/prowizard/misc/misc.c index a5ef7e7c..e88369a7 100755 --- a/prowizard/misc/misc.c +++ b/prowizard/misc/misc.c @@ -1,7 +1,5 @@ -#include "../rippers/globals.h" -#include "../rippers/extern.h" - -extern void write_log (const char *, ...); +#include "globals.h" +#include "extern.h" /* * at now, when this fonction is called, no global var has been used ... @@ -20,7 +18,7 @@ void Support_Types ( void ) types_file = fopen ( _TYPES_FILENAME , "rb" ); if ( types_file == NULL ) { - write_log ( "!!! couldn't find \"%s\" file !. Default extension used.\n" + printf ( "!!! couldn't find \"%s\" file !. Default extension used.\n" , _TYPES_FILENAME ); Support_Types_FileDefault (); return; @@ -39,7 +37,7 @@ void Support_Types ( void ) continue; if ( sizeof ( read_line ) < 2 ) { - write_log ( "!!! Damaged \"%s\" file at non-commented line %ld\n" + printf ( "!!! Damaged \"%s\" file at non-commented line %ld\n" , _TYPES_FILENAME , PW_i+1 ); PW_i = 99999l; break; @@ -50,7 +48,7 @@ void Support_Types ( void ) Extensions[PW_i][cpt] = read_line[cpt]; cpt += 1; } - /*write_log ( "[%ld]%ld:%s," , PW_i,ftell (types_file),read_line );*/ + /*printf ( "[%ld]%ld:%s," , PW_i,ftell (types_file),read_line );*/ PW_i += 1; if ( PW_i == _KNOWN_FORMATS ) break; @@ -58,7 +56,7 @@ void Support_Types ( void ) if ( PW_i != _KNOWN_FORMATS ) { - write_log ( "!!! Damaged \"%s\" file. Missing up %ld extensions definitions\n" + printf ( "!!! Damaged \"%s\" file. Missing up %ld extensions definitions\n" , _TYPES_FILENAME , _KNOWN_FORMATS-(PW_i+1)); Support_Types_FileDefault (); return; @@ -212,10 +210,17 @@ void Support_Types_FileDefault ( void ) strcpy ( Extensions[127], "GNUPacker12" ); strcpy ( Extensions[128], "CrunchmaniaSimple" ); strcpy ( Extensions[129], "dmu" ); - strcpy ( Extensions[130], "---" ); + strcpy ( Extensions[130], "TitanicsPlayer" ); + strcpy ( Extensions[131], "NewtronOld" ); + strcpy ( Extensions[132], "NovoTrade" ); + strcpy ( Extensions[133], "Skizzo" ); + strcpy ( Extensions[134], "StoneArtsPlayer" ); + strcpy ( Extensions[135], "---" ); } + + /* * saving what's found. Mainly music file here. * PW_Start_Address & OutputSize are global .. not everybody likes @@ -236,7 +241,8 @@ void Save_Rip ( char * format_to_save, int FMT_EXT ) sprintf ( OutName_final , "%ld.%s" , Cpt_Filename , Extensions[FMT_EXT] ); write_log ( " saving in file \"%s\" ... " , OutName_final ); Cpt_Filename += 1; - PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save); + PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save, PW_Start_Address, OutputSize); + //PW_out = PW_fopen ( OutName_final , "w+b" ); if (!PW_out) return; fwrite ( &in_data[PW_Start_Address] , OutputSize , 1 , PW_out ); @@ -246,7 +252,7 @@ void Save_Rip ( char * format_to_save, int FMT_EXT ) { write_log ( " converting to Protracker ... " ); } - fflush ( stdout ); + //fflush ( stdout ); Save_Status = GOOD; } @@ -269,9 +275,8 @@ void Save_Rip_Special ( char * format_to_save, int FMT_EXT, Uchar * Header_Block sprintf ( OutName_final , "%ld.%s" , Cpt_Filename , Extensions[FMT_EXT] ); write_log ( " saving in file \"%s\" ... " , OutName_final ); Cpt_Filename += 1; - PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save ); - if (!PW_out) - return; +// PW_out = PW_fopen ( OutName_final , "w+b" ); + PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save, PW_Start_Address, OutputSize ); fwrite ( Header_Block , Block_Size , 1 , PW_out ); fwrite ( &in_data[PW_Start_Address] , OutputSize , 1 , PW_out ); fclose ( PW_out ); @@ -283,7 +288,7 @@ void Save_Rip_Special ( char * format_to_save, int FMT_EXT, Uchar * Header_Block write_log ( " Header of this file was missing and has been rebuilt !\n" ); if ( FMT_EXT == DragPack252) write_log ( " WARNING !: it's a fake header since in this case !!\n" ); - fflush ( stdout ); + //fflush ( stdout ); Amiga_EXE_Header = GOOD; Save_Status = GOOD; } @@ -317,6 +322,22 @@ void Crap ( char *Format , Uchar Delta , Uchar Pack , FILE *out ) } } +/* writing craps in converted MODs */ +void Crap15 ( char *Format , Uchar Delta , Uchar Pack , FILE *out ) +{ + fseek ( out , 260 , SEEK_SET ); + fprintf ( out , "[ Converted with ]" ); + fseek ( out , 290 , SEEK_SET ); + fprintf ( out , "[ ProWizard for PC ]" ); + fseek ( out , 320 , SEEK_SET ); + fprintf ( out , "[ written by Asle! ]" ); + + fseek ( out , 380 , SEEK_SET ); + fprintf ( out , "[ Original Format: ]" ); + fseek ( out , 410 , SEEK_SET ); + fprintf ( out , "[%s]" , Format ); +} + /* * Special version of Test() for cruncher data (Ice! etc...) * only one file and not hundreds ... @@ -329,7 +350,7 @@ short testSpecialCruncherData ( long Pack_addy , long Unpack_addy ) /* e.g. addressing of unassigned data */ if ( ( (long)PW_i + Pack_addy ) > PW_in_size ) { -/*write_log ( "#0\n" );*/ +/*printf ( "#0\n" );*/ return BAD; } @@ -346,25 +367,25 @@ short testSpecialCruncherData ( long Pack_addy , long Unpack_addy ) if ( (PW_k <= 2) || (PW_l <= 2) ) { -/*write_log ( "#1\n" );*/ +/*printf ( "#1\n" );*/ return BAD; } if ( PW_l > 0x989680 ) /* 10 mb */ { -/*write_log ( "#2\n" );*/ +/*printf ( "#2\n" );*/ return BAD; } if ( PW_k <= PW_l ) { -/*write_log ( "#3\n" );*/ +/*printf ( "#3\n" );*/ return BAD; } if ( PW_k > 0x989689 ) /* 10 Megs ! */ { -/*write_log ( "#4\n" );*/ +/*printf ( "#4\n" );*/ return BAD; } @@ -392,7 +413,7 @@ void Rip_SpecialCruncherData ( char *Packer_Name , int Header_Size , int Packer_ OutputSize = PW_l + Header_Size; } - /* write_log ( "\b\b\b\b\b\b\b\b%s file found at %ld !. its size is : %ld\n" , Packer_Name , PW_Start_Address , OutputSize );*/ + /* printf ( "\b\b\b\b\b\b\b\b%s file found at %ld !. its size is : %ld\n" , Packer_Name , PW_Start_Address , OutputSize );*/ /* OutName[1] = Extensions[Packer_Extension_Define][0]; OutName[2] = Extensions[Packer_Extension_Define][1]; OutName[3] = Extensions[Packer_Extension_Define][2];*/ @@ -409,7 +430,7 @@ void Rip_SpecialCruncherData ( char *Packer_Name , int Header_Size , int Packer_ /* yet again on Xigh's suggestion. How to handle 'correctly' a file size */ -long GetFileSizeX (char * infile) +long PWGetFileSize (char * infile) { long i; struct stat *Stat; @@ -423,18 +444,18 @@ long GetFileSizeX (char * infile) #if 0 /* Same as fopen() but saves a lot of tests, done only here. */ /* Done to check if the output file could be created */ -FILE * PW_fopen (char *filename, char *fopenargs) +FILE * PW_fopen (char *filename, char fopenargs[3] ) { FILE *local_out; local_out = fopen (filename, fopenargs); if (local_out == NULL) { - write_log ("!!couldn't create the file \"%s\"!\nexiting...",filename); + printf ("!!couldn't create the file \"%s\"!\nexiting...",filename); exit (-1); } return local_out; } -#endif +#endif FILE * PW_fopen (char *filename, char *fopenargs) { return moduleripper_fopen (filename, fopenargs); diff --git a/prowizard/misc/testbag.c b/prowizard/misc/testbag.c index 7e4307ff..10149bb4 100755 --- a/prowizard/misc/testbag.c +++ b/prowizard/misc/testbag.c @@ -1,5 +1,5 @@ -#include "../rippers/globals.h" -#include "../rippers/extern.h" +#include "globals.h" +#include "extern.h" /* diff --git a/prowizard/prowiz.c b/prowizard/prowiz.c index 1bb874c2..e889b7c5 100755 --- a/prowizard/prowiz.c +++ b/prowizard/prowiz.c @@ -1,13 +1,13 @@ /* * Pro-Wizard_1.c * - * 1997-2006 (c) Sylvain "Asle" Chipaux + * 1997-2007 (c) Sylvain "Asle" Chipaux * */ -#include "rippers/globals.h" -#include "rippers/extern.h" -#include "rippers/vars.h" +#include "include/globals.h" +#include "include/extern.h" +#include "include/vars.h" #if 0 @@ -20,7 +20,7 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) in_data = in_data_p; PW_in_size = PW_in_size_p; #if 0 - printf ( "\n\n-<([ Pro-Wizard v1.61a ])>-\n\n" ); + printf ( "\n\n-<([ Pro-Wizard v1.62 ])>-\n\n" ); if ( ac != 2 ) { @@ -236,6 +236,20 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) } } + /* -GD- Skizzo*/ + if ( (in_data[PW_i] == 0x2D) && + (in_data[PW_i+1] == 'G') && + (in_data[PW_i+2] == 'D') && + (in_data[PW_i+3] == 0x2D) ) + { + if ( testSkizzo() != BAD ) + { + Rip_Skizzo (); + Depack_Skizzo (); + continue; + } + } + /* Max Packer 1.2 */ if ((in_data[PW_i] == 0x28) && (in_data[PW_i+1] == 0x3C) && @@ -322,6 +336,7 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) /* The player 6.0a (packed samples)? */ if ( testP60A_pack() != BAD ) { + printf ( "\b\b\b\b\b\b\b\bThe Player 6.0A with PACKED samples found at %ld ... cant rip it!\n" , PW_Start_Address ); /*Rip_P60A ();*/ /*Depack_P60A ();*/ continue; @@ -338,6 +353,7 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) /* The player 6.1a (packed samples)? */ if ( testP61A_pack() != BAD ) { + printf ( "\b\b\b\b\b\b\b\bThe Player 6.1A with PACKED samples found at %ld ... cant rip it!\n" , PW_Start_Address ); /*Rip_P61A ();*/ /*Depack_P61A ();*/ continue; @@ -478,6 +494,22 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) Depack_Newtron (); continue; } + + /* Newtron Old */ + if ( testNewtronOld() != BAD ) + { + Rip_NewtronOld (); + Depack_NewtronOld (); + continue; + } + + /* Titanics Packer ? */ + if ( testTitanicsPlayer() != BAD ) + { + Rip_TitanicsPlayer (); + Depack_TitanicsPlayer (); + continue; + } } @@ -768,9 +800,9 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) if ( (in_data[PW_i+1] == 0xFA) && (in_data[PW_i+2] == 0x02) && (in_data[PW_i+3] == 0x8C) && - (in_data[PW_i+4] == 0x4B) && - (in_data[PW_i+5] == 0xF9) && - (in_data[PW_i+6] == 0x00)) + ((in_data[PW_i+4] == 0x4B) || (in_data[PW_i+4] == 0x9B))&& + ((in_data[PW_i+5] == 0xF9) || (in_data[PW_i+5] == 0xCD))&& + ((in_data[PW_i+6] == 0x00) || (in_data[PW_i+6] == 0x4E))) { if ( testDefjam32() == BAD ) break; @@ -866,7 +898,7 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) Rip_BSIFutureComposer (); break; } - /* "Fuck" : ID of Noise From Heaven chiptunes */ + /* "Fuck" : ID of Noise From Heaven chiptunes */ if ( (in_data[PW_i+1] == 'u') && (in_data[PW_i+2] == 'c') && (in_data[PW_i+3] == 'k') ) @@ -874,7 +906,18 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) if ( testNFH() == BAD ) break; Rip_NFH (); - Depack_NFH (); + Depack_NFH (); + break; + } + /* "FAST" : ID of Stone Arts Player */ + if ( (in_data[PW_i+1] == 'A') && + (in_data[PW_i+2] == 'S') && + (in_data[PW_i+3] == 'T') ) + { + if ( testStoneArtsPlayer() == BAD ) + break; + Rip_StoneArtsPlayer (); + Depack_StoneArtsPlayer (); break; } #ifdef INCLUDEALL @@ -1530,6 +1573,19 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) } } + /*if ( (in_data[PW_i+1] == 'O') && + (in_data[PW_i+2] == 'D') && + (in_data[PW_i+3] == 'U') ) + {*/ + /* NovoTrade */ + /*if ( testNovoTrade() != BAD ) + { + Rip_NovoTrade (); + Depack_NovoTrade (); + break; + } + }*/ + if ( (in_data[PW_i+1] == 'T') && (in_data[PW_i+2] == 'N') && (in_data[PW_i+3] == 0x00) ) @@ -1711,7 +1767,7 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) (in_data[PW_i+2] == '2') && (in_data[PW_i+3] == '0') ) { - write_log ( "PowerPacker ID (PP20) found at %ld ... cant rip it!\n" , PW_i ); + printf ( "PowerPacker ID (PP20) found at %ld ... cant rip it!\n" , PW_i ); break; } #endif @@ -2337,8 +2393,52 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) Rip_Tetrapack_2_1 (); break; } + + /* Defjam Cruncher 3.2T */ + if ( (in_data[PW_i+1] == 0x00) && + (in_data[PW_i+2] == 0x43) && + (in_data[PW_i+3] == 0xFA) && + (in_data[PW_i+4] == 0x02) && + (in_data[PW_i+5] == 0x8C) && + (in_data[PW_i+6] == 0x4B) && + (in_data[PW_i+7] == 0xF9) && + (in_data[PW_i+8] == 0x00) && + (in_data[PW_i+9] == 0xDF) && + (in_data[PW_i+10] == 0xF1)) + { + if ( testDefjam32t() == BAD ) + break; + Rip_Defjam32 (); + break; + } #endif break; + case 0x80: + /* Viruz2 8000 */ +/* if ( (in_data[PW_i+1] == 0x00) && + (in_data[PW_i+2] == 0x00) && + (in_data[PW_i+3] == 0x00) && + ((in_data[PW_i+6] == 0x00) || (in_data[PW_i+8] == 0x01)) && + (in_data[PW_i+7] == 0x00) && + (in_data[PW_i+8] == 0x01) && + (in_data[PW_i+9] == 0x00) && + (in_data[PW_i+10] == 0x00) && + (in_data[PW_i+11] == 0x00) && + (in_data[PW_i+12] == 0x00) && + (in_data[PW_i+13] == 0x00) && + (in_data[PW_i+14] == 0x00) && + (in_data[PW_i+16] == 0xAB) && + (in_data[PW_i+17] == 0x05) && + (in_data[PW_i+18] == 0x00) && + (in_data[PW_i+19] == 0x04) && + (in_data[PW_i+20] == 0x04) && + (in_data[PW_i+21] == 0x08) ) + { + if ( testViruz2_80 () == BAD ) + break; + continue; + }*/ + break; case 0xAC: /* AC1D packer ?!? */ @@ -2366,17 +2466,35 @@ int prowizard_search (Uchar *in_data_p, int PW_in_size_p) } break; + case 0xE0: + +/* if ( (in_data[PW_i+1] == 0x01) && + (in_data[PW_i+2] == 0x00) && + (in_data[PW_i+3] == 0x00) && + (in_data[PW_i+7] == 0x00) && + (in_data[PW_i+8] == 0x01) && + (in_data[PW_i+9] == 0x00) && + (in_data[PW_i+10] == 0x00) && + (in_data[PW_i+11] == 0x00) && + (in_data[PW_i+12] == 0x00) ) + { + if ( testViruz2_E0 () == BAD ) + break; + continue; + }*/ + break; + default: /* do nothing ... save continuing :) */ break; } /* end of switch */ } - #if 0 free ( in_data ); printf ( "\n" ); - printf ( " 1997-2005 (c) Sylvain \"Asle\" Chipaux (asle@free.fr)\n\n"); + printf ( " 1997-2007 (c) Sylvain \"Asle\" Chipaux (asle@free.fr)\n\n"); +/* getchar();*/ exit ( 0 ); #endif return 0; diff --git a/prowizard/rippers/Bytekiller.c b/prowizard/rippers/Bytekiller.c index 6ac4fe37..d096c904 100755 --- a/prowizard/rippers/Bytekiller.c +++ b/prowizard/rippers/Bytekiller.c @@ -109,7 +109,6 @@ short testByteKiller_20 ( void ) (in_data[PW_Start_Address+6] != 0x00 ) || (in_data[PW_Start_Address+7] != 0xDF ) || (in_data[PW_Start_Address+8] != 0xF1 ) || - (in_data[PW_Start_Address+9] != 0x80 ) || (in_data[PW_Start_Address+10] != 0x41 ) || (in_data[PW_Start_Address+11] != 0xFA ) || (in_data[PW_Start_Address+12] != 0x00 ) || @@ -383,7 +382,7 @@ void Rip_ByteKiller ( void ) } if ( Save_Status == GOOD ) - PW_i += (OutputSize - 173); /* 171 should do but call it "just to be sure" :) */ + PW_i += 173; /* 171 should do but call it "just to be sure" :) */ } void Rip_ByteKiller30 ( void ) @@ -427,7 +426,7 @@ void Rip_ByteKiller30 ( void ) } if ( Save_Status == GOOD ) - PW_i += (OutputSize - 36); /* 32 should do but call it "just to be sure" :) */ + PW_i += 36; /* 32 should do but call it "just to be sure" :) */ } @@ -506,6 +505,6 @@ void Rip_bytekillerpro10 ( void ) } if ( Save_Status == GOOD ) - PW_i += (OutputSize - 54); /* 51 should do but call it "just to be sure" :) */ + PW_i += 54; /* 51 should do but call it "just to be sure" :) */ } diff --git a/prowizard/rippers/DefjamCruncher32-pro.c b/prowizard/rippers/DefjamCruncher32-pro.c index c9394aff..208982c0 100755 --- a/prowizard/rippers/DefjamCruncher32-pro.c +++ b/prowizard/rippers/DefjamCruncher32-pro.c @@ -1,5 +1,6 @@ /* testDefjam32() */ /* testDefjam32pro() */ +/* testDefjam32t() */ /* Rip_Defjam32() */ #include "globals.h" @@ -150,6 +151,68 @@ short testDefjam32pro ( void ) } +short testDefjam32t ( void ) +{ + + PW_Start_Address = PW_i; + + if ( (in_data[PW_Start_Address+12] != 0x28 ) || + (in_data[PW_Start_Address+13] != 0x7A ) || + (in_data[PW_Start_Address+14] != 0x01 ) || + (in_data[PW_Start_Address+15] != 0x54 ) || + (in_data[PW_Start_Address+16] != 0x20 ) || + (in_data[PW_Start_Address+17] != 0x4C ) || + (in_data[PW_Start_Address+18] != 0xD1 ) || + (in_data[PW_Start_Address+19] != 0xFC ) ) + { + /* should be enough :))) */ +/*printf ( "#2 Start:%ld\n" , PW_Start_Address );*/ + return BAD; + + } + + + /* packed size */ + PW_l = ( (in_data[PW_Start_Address+20]*256*256*256) + + (in_data[PW_Start_Address+21]*256*256) + + (in_data[PW_Start_Address+22]*256) + + in_data[PW_Start_Address+23] ); + + PW_l += 692; + + if ( PW_i >= 32 ) + { + if ( (in_data[PW_Start_Address-32] != 0x00 ) || + (in_data[PW_Start_Address-31] != 0x00 ) || + (in_data[PW_Start_Address-30] != 0x03 ) || + (in_data[PW_Start_Address-29] != 0xF3 ) || + (in_data[PW_Start_Address-28] != 0x00 ) || + (in_data[PW_Start_Address-27] != 0x00 ) || + (in_data[PW_Start_Address-26] != 0x00 ) || + (in_data[PW_Start_Address-25] != 0x00 ) || + (in_data[PW_Start_Address-24] != 0x00 ) || + (in_data[PW_Start_Address-23] != 0x00 ) || + (in_data[PW_Start_Address-22] != 0x00 ) || + (in_data[PW_Start_Address-21] != 0x01 ) || + (in_data[PW_Start_Address-20] != 0x00 ) || + (in_data[PW_Start_Address-19] != 0x00 ) || + (in_data[PW_Start_Address-18] != 0x00 ) || + (in_data[PW_Start_Address-17] != 0x00 ) ) + { + Amiga_EXE_Header = BAD; + } + else + Amiga_EXE_Header = GOOD; + } + else + Amiga_EXE_Header = BAD; + + + return GOOD; + /* PW_l is the size of the pack */ +} + + void Rip_Defjam32 ( void ) { /* PW_l is still the whole size */ @@ -188,13 +251,13 @@ void Rip_Defjam32 ( void ) in_data[PW_Start_Address+OutputSize-2] = 0x03; in_data[PW_Start_Address+OutputSize-1] = 0xF2; - Save_Rip_Special ( "Defjam Cruncher 3.2 / pro Exe-file", Defjam_32, Amiga_EXE_Header_Block , 32 ); + Save_Rip_Special ( "Defjam Cruncher 3.2 / pro / t Exe-file", Defjam_32, Amiga_EXE_Header_Block , 32 ); free ( Amiga_EXE_Header_Block ); } else { PW_Start_Address -= 32; - Save_Rip ( "Defjam Cruncher 3.2 / pro Exe-file", Defjam_32 ); + Save_Rip ( "Defjam Cruncher 3.2 / pro / t Exe-file", Defjam_32 ); } if ( Save_Status == GOOD ) diff --git a/prowizard/rippers/GnuPlayer.c b/prowizard/rippers/GnuPlayer.c index 9d09c51d..83e5c1d4 100755 --- a/prowizard/rippers/GnuPlayer.c +++ b/prowizard/rippers/GnuPlayer.c @@ -304,10 +304,10 @@ void Depack_GnuPlayer ( void ) { samp = (in_data[Where]>>4)&0x0f; if ( samp & 0x08 ) samp -= 0x10; - Whatever[k] = (Whatever[k-1] + samp); k++; + Whatever[k++] = (Whatever[k-1] + samp); samp = in_data[Where] & 0x0f; if ( samp & 0x08 ) samp -= 0x10; - Whatever[k] = (Whatever[k-1] + samp); k++; + Whatever[k++] = (Whatever[k-1] + samp); Where += 1; } Where -= 1; diff --git a/prowizard/rippers/ModuleProtector.c b/prowizard/rippers/ModuleProtector.c index af677441..39e4589f 100755 --- a/prowizard/rippers/ModuleProtector.c +++ b/prowizard/rippers/ModuleProtector.c @@ -233,7 +233,7 @@ void Rip_MP_withID ( void ) Save_Rip ( "Module Protector Packed music", Module_protector ); if ( Save_Status == GOOD ) - PW_i += (OutputSize - 5); /* 4 should do but call it "just to be sure" :) */ + PW_i += 3; /* 4 should do but call it "just to be sure" :) */ } diff --git a/prowizard/rippers/Newtron.c b/prowizard/rippers/Newtron.c index f5662d21..38ac7d4a 100755 --- a/prowizard/rippers/Newtron.c +++ b/prowizard/rippers/Newtron.c @@ -1,5 +1,5 @@ /* - * newtron.c ... 9 mar 2003 + * newtron.c ... 9 mar 2003/21 jan 2007 */ /* testNewtron() */ /* Rip_Newtron() */ @@ -124,11 +124,12 @@ void Rip_Newtron ( void ) } /* - * newtron.c 2003 (c) Asle / ReDoX + * newtron.c 2003-2007 (c) Asle / ReDoX * * Converts Newtron packed MODs back to PTK MODs * * Last update: 09 mar 2003 + * fixed again : 21 jan 2007 */ void Depack_Newtron ( void ) @@ -151,7 +152,7 @@ void Depack_Newtron ( void ) /* title */ fwrite ( Whatever , 20 , 1 , out ); - Where = 4; + Where += 4; for ( i=0 ; i<31 ; i++ ) { @@ -165,7 +166,7 @@ void Depack_Newtron ( void ) /*printf ( "Whole sample size : %ld\n" , Total_Sample_Size );*/ /* pattern table lenght & Ntk byte */ - fwrite ( &in_data[0] , 1 , 1 , out ); + fwrite ( &in_data[PW_Start_Address] , 1 , 1 , out ); Whatever[0] = 0x7f; fwrite ( &Whatever[0] , 1 , 1 , out ); diff --git a/prowizard/rippers/NewtronOld.c b/prowizard/rippers/NewtronOld.c new file mode 100755 index 00000000..a8d7eef0 --- /dev/null +++ b/prowizard/rippers/NewtronOld.c @@ -0,0 +1,234 @@ +/* + * newtronold.c ... 21 jan 2007 +*/ +/* testNewtronOld() */ +/* Rip_NewtronOld() */ +/* Depack_NewtronOld() */ + + +#include "globals.h" +#include "extern.h" + + +short testNewtronOld ( void ) +{ + /* test #1 */ + if ( (PW_i < 11) || ((PW_i+6+1+1024+2)>PW_in_size)) + { + return BAD; + } + + /* test #1.5 */ + PW_Start_Address = PW_i-11; + if ( in_data[PW_Start_Address+2] != 0x00 ) + { + return BAD; + } + + /* test #2 */ + PW_l=(in_data[PW_Start_Address]*256)+in_data[PW_Start_Address+1]+8; + PW_l = (PW_l/8)-1; + PW_WholeSampleSize = 0; + for ( PW_j=0 ; PW_j 0x7f) || (PW_l == 0x00) ) + { + /*printf( "#4 (start:%ld)(indata[0]:%x)\n",PW_Start_Address,in_data[PW_Start_Address] );*/ + return BAD; + } + + /* test #5 */ + /* PW_l is the size of the patternlist */ + PW_k = (in_data[PW_Start_Address]*256)+in_data[PW_Start_Address+1]+8; + /* PW_k is the patternlist addy */ + if (((PW_k/8)*8) != PW_k) + { + /*printf( "#5.0\n" );*/ + return BAD; + } + + PW_m = 0; + for ( PW_j=0 ; PW_j PW_m ) + PW_m = in_data[PW_Start_Address+PW_k+PW_j]; + if ( in_data[PW_Start_Address+PW_k+PW_j] > 0x7f ) + { + /*printf( "#5.1 (PW_l:%lx)(PW_k:%lx)(Where:%ld)(val:%x)\n",PW_l,PW_k,PW_Start_Address+PW_k+PW_j,in_data[PW_Start_Address+PW_k+PW_j]);*/ + return BAD; + } + } + PW_m += 1; + + /* #6 */ + /* PW_l is the size of the patternlist */ + /* PW_m contains the number of pattern saved */ + if ( ((PW_m*1024) + PW_k + PW_l + PW_Start_Address) > PW_in_size) + { + return BAD; + } + + /* test #7 ptk notes .. gosh ! (testing all patterns !) */ + /* PW_k is the patternlist addy */ + /* PW_l is the size of the patternlist */ + /* PW_m contains the number of pattern saved */ + /* PW_WholeSampleSize is the whole sample size */ + PW_k += PW_l; + /* PW_k is now the pat data addy */ + for ( PW_j=0 ; PW_j<(256*PW_m) ; PW_j++ ) + { + PW_l = in_data[PW_Start_Address+PW_k+PW_j*4]; + if ( PW_l > 19 ) /* 0x13 */ + { + /*printf( "#7,0\n" );*/ + return BAD; + } + PW_n = in_data[PW_Start_Address+PW_k+PW_j*4]&0x0f; + PW_n *= 256; + PW_n += in_data[PW_Start_Address+PW_k+1+PW_j*4]; + if ( (PW_n > 0) && (PW_n<0x71) ) + { + /*printf ( "#7,1 (Start:%ld)(where:%ld)(note:%ld)\n" , PW_Start_Address,PW_Start_Address+PW_k+PW_j*4, PW_WholeSampleSize );*/ + return BAD; + } + } + + return GOOD; +} + + + +void Rip_NewtronOld ( void ) +{ + /* PW_WholeSampleSize is the whole sample size :) */ + /* PW_m contains the number of pattern saved */ + /* PW_k is the pat data addy */ + + OutputSize = PW_k + PW_WholeSampleSize + (PW_m*1024); + + CONVERT = GOOD; + Save_Rip ( "Newtron module Old", NewtronOld ); + + if ( Save_Status == GOOD ) + PW_i += 11; +} + +/* + * newtronold.c 2007 (c) Asle / ReDoX + * + * Converts Newtron Old packed MODs back to PTK MODs + * +*/ + +void Depack_NewtronOld ( void ) +{ + Uchar *Whatever; + long i=0,j=0; + long Total_Sample_Size=0; + long Where = PW_Start_Address; + long patlistaddy=0; + Uchar patsize = 0; + Uchar max=0x00; + FILE *out; + + if ( Save_Status == BAD ) + return; + + sprintf ( Depacked_OutName , "%ld.mod" , Cpt_Filename-1 ); + out = PW_fopen ( Depacked_OutName , "w+b" ); + + Whatever = (Uchar *) malloc (130); + BZERO ( Whatever , 130 ); + + /* title */ + fwrite ( Whatever , 20 , 1 , out ); + + /* size of header */ + patlistaddy = (in_data[Where]*256)+in_data[Where+1]+8; + /* nbr of samples */ + j = (patlistaddy/8)-1; + + Where += 8; + + for ( i=0 ; i max ) + max = in_data[Where+i]; + Whatever[i] = in_data[Where+i]; + } + fwrite ( &Whatever[0] , 128 , 1 , out ); + Where += patsize; + /*printf ( "Number of pattern : %d\n" , Max+1 );*/ + + Whatever[0] = 'M'; + Whatever[1] = '.'; + Whatever[2] = 'K'; + Whatever[3] = '.'; + fwrite ( Whatever , 4 , 1 , out ); + + /* pattern data */ + i = (max+1)*1024; + fwrite ( &in_data[Where] , i , 1 , out ); + Where += i; + free ( Whatever ); + + /* sample data */ + fwrite ( &in_data[Where] , Total_Sample_Size , 1 , out ); + + Crap ( " Newtron old " , BAD , BAD , out ); + + fflush ( out ); + fclose ( out ); + + printf ( "done\n" ); + return; /* useless ... but */ +} diff --git a/prowizard/rippers/NovoTrade.c b/prowizard/rippers/NovoTrade.c new file mode 100755 index 00000000..5081767e --- /dev/null +++ b/prowizard/rippers/NovoTrade.c @@ -0,0 +1,249 @@ +/* (5th of may 2007) +*/ +/* testNovoTrade() */ +/* Rip_NovoTrade() */ +/* Depack_NovoTrade() */ + + +#include "globals.h" +#include "extern.h" + + +short testNovoTrade ( void ) +{ + /* test #1 */ + PW_Start_Address = PW_i; + if ((PW_i + 38) > PW_in_size) + { + /*printf ("[1] PW_Start_Address : %ld\n", PW_Start_Address);*/ + return BAD; + } + PW_j = (in_data[PW_Start_Address+20]*256)+in_data[PW_Start_Address+21] + 4; + if ((PW_i + PW_j + 4) > PW_in_size) + { + /*printf ("[2] PW_Start_Address : %ld\n", PW_Start_Address);*/ + return BAD; + } + PW_k = (in_data[PW_Start_Address+28]*256)+in_data[PW_Start_Address+29] + PW_j + 4; + if ((PW_i + PW_k + 2) > PW_in_size) + { + /*printf ("[3] PW_Start_Address : %ld\n", PW_Start_Address);*/ + return BAD; + } + /* PW_j is on "BODY" tag */ + /* PW_k is on "SAMP" tag */ + + /* test #2 let's verify */ + if ( (in_data[PW_Start_Address+PW_j] != 'B') && + (in_data[PW_Start_Address+PW_j+1] != 'O') && + (in_data[PW_Start_Address+PW_j+2] != 'D') && + (in_data[PW_Start_Address+PW_j+3] != 'Y')) + { + /*printf ("[4] PW_Start_Address : %ld\n", PW_Start_Address);*/ + return BAD; + } + if ( (in_data[PW_Start_Address+PW_k] != 'S') && + (in_data[PW_Start_Address+PW_k+1] != 'A') && + (in_data[PW_Start_Address+PW_k+2] != 'M') && + (in_data[PW_Start_Address+PW_k+3] != 'P')) + { + /*printf ("[5] (start)%ld, (BODY)%lx, (at)%lx\n", PW_Start_Address,PW_j,PW_k);*/ + return BAD; + } + + /* no much but should be enough :) */ + return GOOD; +} + + +void Rip_NovoTrade ( void ) +{ + /* get nbr sample */ + PW_j = (in_data[PW_Start_Address+22]*256)+in_data[PW_Start_Address+23]; + /* get BODY addy */ + PW_m = (in_data[PW_Start_Address+20]*256)+in_data[PW_Start_Address+21] + 4; + /* get SAMP addy */ + PW_k = (in_data[PW_Start_Address+28]*256)+in_data[PW_Start_Address+29] + PW_m + 4; + PW_WholeSampleSize = 0; + for ( PW_l=0 ; PW_l 0x7f ) + { + return BAD; + } + + for ( PW_k=0 ; PW_k<31 ; PW_k++ ) + { + /* size */ + PW_j = (((in_data[PW_Start_Address+42+PW_k*30]*256)+in_data[PW_Start_Address+43+PW_k*30])*2); + /* loop start */ + PW_m = (((in_data[PW_Start_Address+46+PW_k*30]*256)+in_data[PW_Start_Address+47+PW_k*30])*2); + /* loop size */ + PW_n = (((in_data[PW_Start_Address+48+PW_k*30]*256)+in_data[PW_Start_Address+49+PW_k*30])*2); + + if ( test_smps(PW_j*2, PW_m, PW_n, in_data[PW_Start_Address+45+30*PW_k], in_data[PW_Start_Address+44+30*PW_k] ) == BAD ) + { + /*printf ( "start : %ld\n", PW_Start_Address );*/ + return BAD; + } + + PW_WholeSampleSize += PW_j; + } + + return GOOD; +} + + + +void Rip_StoneArtsPlayer ( void ) +{ + /* PW_WholeSampleSize is already the whole sample size */ + PW_l=0; + for ( PW_k=0 ; PW_k<128 ; PW_k++ ) + if ( in_data[PW_Start_Address+952+PW_k] > PW_l ) + PW_l = in_data[PW_Start_Address+952+PW_k]; + PW_l += 1; + OutputSize = (PW_l*1024) + 1084 + PW_WholeSampleSize; + + CONVERT = GOOD; + Save_Rip ( "Stone Arts Player module", StoneArtsPlayer ); + + if ( Save_Status == GOOD ) + PW_i += 1082; /* 1080 could be enough */ +} + + + +/* + * StoneArtsPlayer.c 2007 (c) Asle + * + * Converts MODs converted with Stone Arts Player + * + * example module provided by Muerto ;) +*/ +void Depack_StoneArtsPlayer ( void ) +{ + Uchar *Whatever; + Uchar poss[37][2]; + Uchar Max=0x00; + long WholeSampleSize=0; + long i=0,j=0; + long Where=PW_Start_Address; + FILE *out; + + fillPTKtable(poss); + + if ( Save_Status == BAD ) + return; + + sprintf ( Depacked_OutName , "%ld.mod" , Cpt_Filename-1 ); + out = PW_fopen ( Depacked_OutName , "w+b" ); + + /* read and write whole header */ + fwrite ( &in_data[Where] , 950 , 1 , out ); + + /* get whole sample size */ + for ( i=0 ; i<31 ; i++ ) + { + WholeSampleSize += (((in_data[Where+42+i*30]*256)+in_data[Where+43+i*30])*2); + } + /*printf ( "Whole sanple size : %ld\n" , WholeSampleSize );*/ + + /* read and write size of pattern list */ + /* read and write ntk byte and pattern list */ + fwrite ( &in_data[Where+950] , 130 , 1 , out ); + Where += 952; + + /* write ID */ + Whatever = (Uchar *) malloc (4); + Whatever[0] = 'M'; + Whatever[1] = '.'; + Whatever[2] = 'K'; + Whatever[3] = '.'; + fwrite ( Whatever , 4 , 1 , out ); + + /* get number of pattern */ + Max = 0x00; + for ( i=0 ; i<128 ; i++ ) + { + if ( in_data[Where+i] > Max ) + Max = in_data[Where+i]; + } + /*printf ( "Number of pattern : %d\n" , Max );*/ + + /* pattern data */ + Where = PW_Start_Address + 1084; + for ( i=0 ; i<=Max ; i++ ) + { + for ( j=0 ; j<256 ; j++ ) + { + Whatever[0] = in_data[Where]; + Whatever[2] = in_data[Where+2]; + Whatever[3] = in_data[Where+3]; + Whatever[0] |= poss[in_data[Where+1]/2][0]; + Whatever[1] = poss[in_data[Where+1]/2][1]; + fwrite ( Whatever , 4 , 1 , out ); + Where += 4; + } + } + free ( Whatever ); + + + /* sample data */ + fwrite ( &in_data[Where] , WholeSampleSize , 1 , out ); + + + /* crap */ + Crap ( "Stone Arts Player " , BAD , BAD , out ); + + fflush ( out ); + fclose ( out ); + + printf ( "done\n" ); + return; /* useless ... but */ +} + diff --git a/prowizard/rippers/ThePlayer61a.c b/prowizard/rippers/ThePlayer61a.c index 7d9df1d2..8ad3f95d 100755 --- a/prowizard/rippers/ThePlayer61a.c +++ b/prowizard/rippers/ThePlayer61a.c @@ -537,7 +537,7 @@ void Rip_P61A ( void ) Save_Rip ( "The Player 6.1A module", P61A ); if ( Save_Status == GOOD ) - PW_i += (OutputSize - 12); /* 7 should do but call it "just to be sure" :) */ + PW_i += 12; /* 7 should do but call it "just to be sure" :) */ } diff --git a/prowizard/rippers/TitanicsPlayer.c b/prowizard/rippers/TitanicsPlayer.c new file mode 100755 index 00000000..794ef896 --- /dev/null +++ b/prowizard/rippers/TitanicsPlayer.c @@ -0,0 +1,307 @@ +/* testTitanicsPlayer() */ +/* Rip_TitanicsPlayer() */ +/* Depack_TitanicsPlayer() */ + +#include "globals.h" +#include "extern.h" + + +short testTitanicsPlayer ( void ) +{ + if ( PW_i < 7 ) + return BAD; + PW_Start_Address = PW_i-7; + + /* test samples */ + PW_n = PW_WholeSampleSize = 0; + for ( PW_k=0 ; PW_k<15 ; PW_k++ ) + { + if ( in_data[PW_Start_Address+7+PW_k*12] > 0x40 ) + { + /*printf ("#1 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + if ( in_data[PW_Start_Address+6+PW_k*12] != 0x00 ) + { + /*printf ("#1.1 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + + PW_o = ((in_data[PW_Start_Address+PW_k*12]*256*256*256) + + (in_data[PW_Start_Address+1+PW_k*12]*256*256)+ + (in_data[PW_Start_Address+2+PW_k*12]*256)+ + in_data[PW_Start_Address+3+PW_k*12]); + if ((PW_o > PW_in_size) || ((PW_o < 180) && (PW_o != 0))) + { + /*printf ("#1.2 : (start : %ld)(PW_o:%ld)(sample:%ld)\n",PW_Start_Address,PW_o,PW_k);*/ + return BAD; + } + + /* size */ + PW_j = (in_data[PW_Start_Address+4+PW_k*12]*256) + in_data[PW_Start_Address+5+PW_k*12]; + /* loop start */ + PW_l = (in_data[PW_Start_Address+8+PW_k*12]*256) + in_data[PW_Start_Address+9+PW_k*12]; + /* loop size */ + PW_m = (in_data[PW_Start_Address+10+PW_k*12]*256) + in_data[PW_Start_Address+11+PW_k*12]; + if ( (PW_l>PW_j) || (PW_m>PW_j+1) || (PW_j>32768)) + { + /*printf ("#2 : (start : %ld) (smpsize:%ld)(loopstart:%ld)(loopsiz:%ld)\n",PW_Start_Address,PW_j,PW_l,PW_m);*/ + return BAD; + } + if ( PW_m == 0 ) + { + /*printf ("#3 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + if ( (PW_j == 0) && ((PW_l != 0) || (PW_m != 1) )) + { + /*printf ("#4 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + PW_WholeSampleSize += PW_j; + } + if (PW_WholeSampleSize < 2) + { + /*printf ("#4.5 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + + /* test pattern addresses */ + PW_o=BAD; + PW_l = 0; + for ( PW_k=0 ; PW_k<256; PW_k += 2 ) + { + /*printf ("%x - ",in_data[PW_Start_Address+PW_k+188]);*/ + if ( (in_data[PW_Start_Address+PW_k+180] == 0xFF) && (in_data[PW_Start_Address+PW_k+181] == 0xFF) ) + { + PW_o = GOOD; + break; + } + PW_j = ((in_data[PW_Start_Address+PW_k+180]*256)+ + in_data[PW_Start_Address+PW_k+181]); + if (PW_j < 180) + { + /*printf ("#5 : (start : %ld)(PW_j:%ld)(PW_k:%ld)\n",PW_Start_Address,PW_j,PW_k);*/ + return BAD; + } + if (PW_j>PW_l) + PW_l = PW_j; + } + if (PW_o == BAD) + { + /*printf ("#6 : (start : %ld)\n",PW_Start_Address);*/ + return BAD; + } + + /* PW_l is the max addy of the pattern addies */ + return GOOD; +} + + +/* With the help of Xigh :) .. thx */ +int cmplong(const void * a, const void * b) +{ + long * aa = (long *) a; + long * bb = (long *) b; + if (*aa == *bb) + return 0; + if(*aa > *bb) + return +1; + return -1; +} + + +void Rip_TitanicsPlayer ( void ) +{ + /* retrieve highest smp addy */ + PW_j = 0;PW_n=0; + for ( PW_k=0 ; PW_k<15 ; PW_k++ ) + { + PW_o = ((in_data[PW_Start_Address+PW_k*12]*256*256*256) + + (in_data[PW_Start_Address+1+PW_k*12]*256*256)+ + (in_data[PW_Start_Address+2+PW_k*12]*256)+ + in_data[PW_Start_Address+3+PW_k*12]); + if ( PW_o > PW_n) + { + PW_n = PW_o; + PW_j = PW_k; + } + } + /* PW_n is the highest smp addy ; PW_j is its ref */ + OutputSize = PW_n + (((in_data[PW_Start_Address+PW_j*12+4]*256)+in_data[PW_Start_Address+PW_j*12+5])*2); + + CONVERT = GOOD; + Save_Rip ( "Titanics Player module", TitanicsPlayer ); + + if ( Save_Status == GOOD ) + PW_i += 180; /* after smp desc */ +} + + +/* + * TitanicsPlayer.c 2007 (c) Sylvain "Asle" Chipaux + * +*/ + +#define ON 1 +#define OFF 2 + +void Depack_TitanicsPlayer ( void ) +{ + Uchar *Whatever; + Uchar c1=0x00,c2=0x00,c3=0x00,c4=0x00; + long Pat_Addresses[128]; + long Pat_Addresses_ord[128]; + long Pat_Addresses_final[128]; + long Max=0l; + Uchar poss[37][2]; + Uchar PatPos; + long Where=PW_Start_Address; + long SmpAddresses[15]; + long SampleSizes[15]; + unsigned long i=0,j=0,k=0,l; + FILE *out; + + if ( Save_Status == BAD ) + return; + + BZERO ( Pat_Addresses , 128 ); + BZERO ( Pat_Addresses_ord , 128 ); + BZERO ( Pat_Addresses_final , 128 ); + + fillPTKtable(poss); + + sprintf ( Depacked_OutName , "%ld.stk" , Cpt_Filename-1 ); + out = PW_fopen ( Depacked_OutName , "w+b" ); + + /* title */ + Whatever = (Uchar *) malloc ( 2048 ); + BZERO ( Whatever , 2048 ); + fwrite ( &Whatever[0] , 20 , 1 , out ); + + /* read and write whole header */ + /*printf ( "Converting sample headers ... " );*/ + for ( i=0 ; i<15 ; i++ ) /* only 15 samples */ + { + /* retrieve addresses of samples */ + SmpAddresses[i] = ((in_data[Where]*256*256*256)+ + (in_data[Where+1]*256*256)+ + (in_data[Where+2]*256)+ + (in_data[Where+3])); + + /* write name */ + fwrite ( &Whatever[0] , 22 , 1 , out ); + /* size */ + k = (in_data[Where+4] * 256) + in_data[Where+5]; + k *= 2; + SampleSizes[i] = k; + fwrite ( &in_data[Where+4] , 1 , 1 , out ); + fwrite ( &in_data[Where+5] , 1 , 1 , out ); + /* finetune */ + fwrite ( &in_data[Where+6] , 1 , 1 , out ); + /* volume */ + fwrite ( &in_data[Where+7] , 1 , 1 , out); + /* loop start */ + fwrite ( &in_data[Where+8] , 1 , 1 , out ); + fwrite ( &in_data[Where+9] , 1 , 1 , out ); + fwrite ( &in_data[Where+10] , 1 , 1 , out ); + fwrite ( &in_data[Where+11] , 1 , 1 , out ); + + Where += 12; + } + /*printf ( "ok\n" );*/ + + /* pattern list */ + /*printf ( "creating the pattern list ... " );*/ + for ( PatPos=0x00 ; PatPos<128 ; PatPos++ ) + { + if ( in_data[Where+PatPos*2] == 0xFF ) + break; + Pat_Addresses_ord[PatPos] = Pat_Addresses[PatPos] = (in_data[Where+PatPos*2]*256)+in_data[Where+PatPos*2+1]; + } + + /* write patpos */ + fwrite ( &PatPos , 1 , 1 , out ); + + /* restart byte */ + c1 = 0x00; + fwrite ( &c1 , 1 , 1 , out ); + + /* With the help of Xigh :) .. thx */ + qsort (Pat_Addresses_ord,PatPos,sizeof(long),cmplong); + j=0; + for (i=0;iMax) + Max = j; + } + fwrite ( Whatever , 128 , 1 , out ); + /*printf ( "ok\n" );*/ + + /* pattern data */ + for (i=0;i<=Max;i++) + { + k = 0; + /*printf ("Where : %ld\n",Where);*/ + Where = Pat_Addresses_final[i] + PW_Start_Address; + BZERO (Whatever,2048); + do + { + /* k is row nbr */ + c1 = (((in_data[Where+1]>>6)&0x03)*4); /* voice */ + + /* no note ... */ + if ((in_data[Where+1]&0x3f)<=36) + { + Whatever[(k*16)+c1] = poss[in_data[Where+1]&0x3f][0]; + Whatever[(k*16)+c1+1] = poss[in_data[Where+1]&0x3F][1]; + } + Whatever[(k*16)+c1+2] = in_data[Where+2]; + Whatever[(k*16)+c1+3] = in_data[Where+3]; + Where += 4; + + if ((in_data[Where]&0x7f) != 0x00) + k += (in_data[Where]&0x7f); + if (k > 1024) + { + /*printf ("pat %ld too big\n",i);*/ + break; + } + }while ((in_data[Where-4] & 0x80) != 0x80); /* pattern break it seems */ + fwrite (&Whatever[0],1024,1,out); + } + Where -= 4; + /* Where is now on the first smp */ + + free ( Whatever ); + /*printf ( " ok\n" );*/ + /*fflush ( stdout );*/ + + + /* sample data */ + /*printf ( "Saving sample data ... " );*/ + for (i=0; i<15; i++) + { + if ( SmpAddresses[i] != 0 ) + fwrite ( &in_data[PW_Start_Address+SmpAddresses[i]], SampleSizes[i], 1, out); + } + + /* crap */ + Crap15 ( " Titanics Player " , BAD , BAD , out ); + + fflush ( out ); + fclose ( out ); + + printf ( "done\n" ); + return; /* useless ... but */ +} diff --git a/prowizard/rippers/TreasurePattern.c b/prowizard/rippers/TreasurePattern.c index edb1ca45..925f3218 100755 --- a/prowizard/rippers/TreasurePattern.c +++ b/prowizard/rippers/TreasurePattern.c @@ -101,7 +101,7 @@ short testTreasure ( void ) -void Rip_TP3 ( void ) +void Rip_Tre( void ) { /* PW_j is the size of the pattern list */ /* PW_l is the number of sample */ diff --git a/prowizard/rippers/Viruz2.c b/prowizard/rippers/Viruz2.c new file mode 100755 index 00000000..4bfe0759 --- /dev/null +++ b/prowizard/rippers/Viruz2.c @@ -0,0 +1,136 @@ +/* Viruz2 - made by kb_ Farbrausch */ +/* 06-05-2007 - test version by Muerto - mostly asle :D*/ +/* 08-05-2007 - Saved the first V2m mod!! - BUT phoemes not incluted.. yet!*/ +/* testV2 */ + +/* This is an ongoing dev version made by Muerto - not part of PW4PC package */ + +#include "globals.h" +#include "extern.h" + +/* void testViruz2_60 (void)*/ +short testViruz2_60 () +{ + PW_Start_Address = PW_i; /* bypass the 20 bytes already tested */ + + for (PW_j = PW_Start_Address+20; PW_j<(PW_in_size-12); PW_j++) + { + /* PW_in_size if the size of the input file */ + + if ((in_data[PW_j+1] == 0x00) && + (in_data[PW_j+2] == 0x00) && + (in_data[PW_j+3] == 0x00) && + ((in_data[PW_j+4] == 0x01) || (in_data[PW_j+4] == 0x1F)) && + (in_data[PW_j+5] == 0x00) && + (in_data[PW_j+6] == 0x00) && + (in_data[PW_j+7] == 0x00) && + ((in_data[PW_j+8] == 0x08) || (in_data[PW_j+8] == 0x26)) && + (in_data[PW_j+9] == 0x00) && + (in_data[PW_j+10] == 0x00) && + (in_data[PW_j+11] == 0x00) ) + { + /* printf ( "\n found end tag for 6000 at %ld (%lx)\n",PW_j, PW_j ); */ + /*OutputSize is the global PW var to store the output size, used by Save_Rip*/ + OutputSize = (PW_j+12)-PW_Start_Address; + CONVERT = BAD; /* tells PW not to consider converting to PTK */ + Save_Rip ( "Viruz 2", Viruz2 ); + if ( Save_Status == GOOD ) + PW_i += 1; /* to bypass the case test */ + } + } + return GOOD; +} + +short testViruz2_80 () +{ + Uchar MYTEST = BAD; + PW_Start_Address = PW_i; /* bypass the 20 bytes already tested */ + + /* test 1 */ + for (PW_j = PW_Start_Address+20; PW_j<(PW_in_size-12); PW_j++) + { + /* PW_in_size if the size of the input file */ + /* Test before @@@ */ + if ((in_data[PW_j] == 0x16) && + (in_data[PW_j+1] == 0x00) && + (in_data[PW_j+2] == 0x00) && + (in_data[PW_j+3] == 0x00) && + ((in_data[PW_j+8] == 0x64) || (in_data[PW_j+8] == 0x6B) || (in_data[PW_j+8] == 0x6E) || (in_data[PW_j+8] == 0x7F) || (in_data[PW_j+8] == 0x5B) || (in_data[PW_j+8] == 0x60) || (in_data[PW_j+8] == 0x19) || (in_data[PW_j+8] == 0x66) || (in_data[PW_j+8] == 0x58) || (in_data[PW_j+8] == 0x0E) || (in_data[PW_j+8] == 0x5A) ) && + ((in_data[PW_j+17] == 0x00) || (in_data[PW_j+17] == 0x01) || (in_data[PW_j+17] == 0x02) || (in_data[PW_j+17] == 0x1F)) && + ((in_data[PW_j+18] == 0x00) || (in_data[PW_j+18] == 0x01) || (in_data[PW_j+18] == 0x33)) && + ((in_data[PW_j+19] == 0x00) || (in_data[PW_j+19] == 0x01) || (in_data[PW_j+19] == 0x02) || (in_data[PW_j+19] == 0x36))) + + { + MYTEST = GOOD; + printf ("first row of test OK (where : %ld)\n",PW_j); + break; + } + } + if (MYTEST == GOOD) + { /* test 1 OK - proceed to test 2, then save if successful */ + while (PW_j<(PW_in_size-12)) + { + /* test after @@@ */ + if ((in_data[PW_j] == 0xF8) && + (in_data[PW_j+1] == 0x02) && + (in_data[PW_j+2] == 0x00) && + (in_data[PW_j+3] == 0x00) && + (in_data[PW_j+4] == 0x86) && + (in_data[PW_j+5] == 0x03) && + (in_data[PW_j+6] == 0x00) && + (in_data[PW_j+7] == 0x00) && + (in_data[PW_j+8] == 0xA1) && + (in_data[PW_j+9] == 0x04) && + (in_data[PW_j+10] == 0x00) && + (in_data[PW_j+11] == 0x00)) + + { + /* printf ( "\n found end tag for 8000 at %ld (%lx)\n",PW_j, PW_j ); */ + /*OutputSize is the global PW var to store the output size, used by Save_Rip*/ + OutputSize = (PW_j+12)-PW_Start_Address; + CONVERT = BAD; /* tells PW not to consider converting to PTK */ + Save_Rip ( "Viruz 2", Viruz2 ); + if ( Save_Status == GOOD ) + PW_i += 1; /* to bypass the case test */ + } + PW_j++; + } + } + return GOOD; +} + +short testViruz2_E0 () +{ + PW_Start_Address = PW_i; /* bypass the 20 bytes already tested */ + + for (PW_j = PW_Start_Address+20; PW_j<(PW_in_size-12); PW_j++) + { + /* PW_in_size if the size of the input file */ + + if ((in_data[PW_j] == 0x94) && + ((in_data[PW_j+1] == 0x00) || (in_data[PW_j+1] == 0x01)) && + (in_data[PW_j+2] == 0x00) && + (in_data[PW_j+3] == 0x00) && + ((in_data[PW_j+4] == 0x01) || (in_data[PW_j+4] == 0x78) || (in_data[PW_j+4] == 0x81) || (in_data[PW_j+4] == 0xDD)) && + ((in_data[PW_j+5] == 0x00) || (in_data[PW_j+5] == 0x01)) && + (in_data[PW_j+6] == 0x00) && + (in_data[PW_j+7] == 0x00) && + ((in_data[PW_j+8] == 0x08) || (in_data[PW_j+8] == 0xC2) || (in_data[PW_j+8] == 0x27) || (in_data[PW_j+8] == 0xC8) || (in_data[PW_j+8] == 0x01) ) && + ((in_data[PW_j+9] == 0x00) || (in_data[PW_j+9] == 0x01)) && + (in_data[PW_j+10] == 0x00) && + (in_data[PW_j+11] == 0x00) ) + { + /* printf ( "\n found end tag for E001 at %ld (%lx)\n",PW_j, PW_j ); */ + /*OutputSize is the global PW var to store the output size, used by Save_Rip*/ + OutputSize = (PW_j+12)-PW_Start_Address; + CONVERT = BAD; /* tells PW not to consider converting to PTK */ + Save_Rip ( "Viruz 2", Viruz2 ); + if ( Save_Status == GOOD ) + PW_i += 1; /* to bypass the case test */ + } + } + return GOOD; +} + +/* end of func */ + diff --git a/prowizard/rippers/skizzo.c b/prowizard/rippers/skizzo.c new file mode 100755 index 00000000..d9396cf9 --- /dev/null +++ b/prowizard/rippers/skizzo.c @@ -0,0 +1,182 @@ +/* (5th of may 2007) +*/ +/* testSkizzo() */ +/* Rip_Skizzo() */ +/* Depack_Skizzo() */ + + +#include "globals.h" +#include "extern.h" + + +short testSkizzo ( void ) +{ + /* test #1 */ + PW_Start_Address = PW_i-24; + if ((PW_i + 38) > PW_in_size) + { + /*printf ("[1] PW_Start_Address : %ld\n", PW_Start_Address);*/ + return BAD; + } + PW_j = in_data[PW_Start_Address+22]; /* nbr of samples */ + if ((PW_j > 31) || (PW_j==0)) + { + /*printf ("[2] (nbr of samples:%ld) PW_Start_Address : %ld\n", PW_j,PW_Start_Address);*/ + return BAD; + } + + return GOOD; +} + + +void Rip_Skizzo ( void ) +{ + /* PW_j is the nbr of samples */ + /* get nbr of stored patts */ + PW_k = in_data[PW_Start_Address+23]; + /* get size of patlist */ + PW_m = in_data[PW_Start_Address+20] & 0x7f; + PW_WholeSampleSize = 0; + for ( PW_l=0 ; PW_lcmd[0]); + write_log ("SCSI command %02X, no direction specified (IN?)!\n", sd->cmd[0]); return -2; } @@ -99,7 +99,7 @@ struct scsi_data *scsi_alloc_native(int id, int nativeunit) { struct scsi_data *sd; if (!sys_command_open (DF_SCSI, nativeunit)) { - write_log("SCSI: native scsi unit %d failed to open\n", nativeunit); + write_log ("SCSI: native scsi unit %d failed to open\n", nativeunit); return NULL; } sd = (struct scsi_data*)xcalloc(sizeof (struct scsi_data), 1); @@ -135,7 +135,7 @@ int scsi_send_data(struct scsi_data *sd, uae_u8 b) sd->buffer[sd->offset++] = b; } else { if (sd->offset >= 16) { - write_log("SCSI command buffer overflow!\n"); + write_log ("SCSI command buffer overflow!\n"); return 0; } sd->cmd[sd->offset++] = b; diff --git a/scsidev.c b/scsidev.c index c38783d5..95c45176 100755 --- a/scsidev.c +++ b/scsidev.c @@ -211,7 +211,7 @@ static int start_thread (struct scsidevdata *sdd) static uae_u32 scsidev_open (void) { - uaecptr tmp1 = m68k_areg(regs, 1); /* IOReq */ + uaecptr tmp1 = m68k_areg (regs, 1); /* IOReq */ uae_u32 unit = m68k_dreg (regs, 0); struct scsidevdata *sdd; @@ -223,7 +223,7 @@ static uae_u32 scsidev_open (void) if ((sdd = get_scsidev_data (unit)) && start_thread (sdd)) { opencount++; - put_word (m68k_areg(regs, 6)+32, get_word (m68k_areg(regs, 6)+32) + 1); + put_word (m68k_areg (regs, 6)+32, get_word (m68k_areg (regs, 6)+32) + 1); put_long (tmp1 + 24, unit); /* io_Unit */ put_byte (tmp1 + 31, 0); /* io_Error */ put_byte (tmp1 + 8, 7); /* ln_type = NT_REPLYMSG */ @@ -242,7 +242,7 @@ static uae_u32 scsidev_close (void) #endif opencount--; - put_word (m68k_areg(regs, 6) + 32, get_word (m68k_areg(regs, 6) + 32) - 1); + put_word (m68k_areg (regs, 6) + 32, get_word (m68k_areg (regs, 6) + 32) - 1); return 0; } @@ -537,21 +537,21 @@ static void scsidev_do_io (struct scsidevdata *sdd, uaecptr request) #ifdef DEBUGME printf ("scsidev: did io: sdd = 0x%x\n", sdd); printf ("scsidev: did io: request = %08lx\n", (unsigned long)request); - printf ("scsidev: did io: error = %d\n", (int)get_word(request+31)); + printf ("scsidev: did io: error = %d\n", (int)get_word (request+31)); #endif } static uae_u32 scsidev_beginio (void) { - uae_u32 request = m68k_areg(regs, 1); + uae_u32 request = m68k_areg (regs, 1); int unit = get_long (request + 24); struct scsidevdata *sdd = get_scsidev_data (unit); #ifdef DEBUGME printf ("scsidev_begin_io: sdd = 0x%x\n", sdd); printf ("scsidev_begin_io: request = %08lx\n", (unsigned long)request); - printf ("scsidev_begin_io: cmd = %d\n", (int)get_word(request+28)); + printf ("scsidev_begin_io: cmd = %d\n", (int)get_word (request+28)); #endif put_byte (request+8, NT_MESSAGE); @@ -599,7 +599,7 @@ static void *scsidev_thread (void *sddv) #ifdef DEBUGME printf ("scsidev_penguin: sdd = 0x%x\n", sdd); printf ("scsidev_penguin: req = %08lx\n", (unsigned long)request); - printf ("scsidev_penguin: cmd = %d\n", (int)get_word(request+28)); + printf ("scsidev_penguin: cmd = %d\n", (int)get_word (request+28)); #endif if (!request) { printf ("scsidev_penguin: going down with 0x%x\n", sdd->sync_sem); @@ -680,14 +680,14 @@ uaecptr scsidev_startup (uaecptr resaddr) #endif /* Build a struct Resident. This will set up and initialize * the uaescsi.device */ - put_word(resaddr + 0x0, 0x4AFC); - put_long(resaddr + 0x2, resaddr); - put_long(resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ - put_word(resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ - put_word(resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ - put_long(resaddr + 0xE, ROM_scsidev_resname); - put_long(resaddr + 0x12, ROM_scsidev_resid); - put_long(resaddr + 0x16, ROM_scsidev_init); /* calls scsidev_init */ + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ + put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ + put_long (resaddr + 0xE, ROM_scsidev_resname); + put_long (resaddr + 0x12, ROM_scsidev_resid); + put_long (resaddr + 0x16, ROM_scsidev_init); /* calls scsidev_init */ resaddr += 0x1A; return resaddr; diff --git a/scsiemul.c b/scsiemul.c index 672579a3..344f1926 100755 --- a/scsiemul.c +++ b/scsiemul.c @@ -77,11 +77,11 @@ #define ASYNC_REQUEST_NONE 0 #define ASYNC_REQUEST_TEMP 1 -#define ASYNC_REQUEST_CHANGEINT 10 +#define ASYNC_REQUEST_CHANGEINT 10 #define ASYNC_REQUEST_FRAMEINT 11 #define ASYNC_REQUEST_PLAY 12 #define ASYNC_REQUEST_READXL 13 -#define ASYNC_REQUEST_FRAMECALL 14 +#define ASYNC_REQUEST_FRAMECALL 14 struct devstruct { int unitnum, aunit; @@ -123,12 +123,12 @@ static struct device_info *devinfo (int mode, int unitnum, struct device_info *d return sys_command_info (mode, unitnum, di); } -static void io_log (char *msg, uaecptr request) +static void io_log (const char *msg, uaecptr request) { if (log_scsi) write_log ("%s: %08X %d %08X %d %d io_actual=%d io_error=%d\n", - msg, request, get_word(request + 28), get_long(request + 40), - get_long(request + 36), get_long(request + 44), + msg, request, get_word (request + 28), get_long (request + 40), + get_long (request + 36), get_long (request + 44), get_long (request + 32), get_byte (request + 31)); } @@ -204,7 +204,7 @@ static uae_u32 REGPARAM2 dev_close_2 (TrapContext *context) return 0; dev_close_3 (dev, pdev); put_long (request + 24, 0); - put_word (m68k_areg(&context->regs, 6) + 32, get_word (m68k_areg(&context->regs, 6) + 32) - 1); + put_word (m68k_areg (&context->regs, 6) + 32, get_word (m68k_areg (&context->regs, 6) + 32) - 1); return 0; } @@ -269,7 +269,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context, int type) } dev->opencnt++; - put_word (m68k_areg(&context->regs, 6) + 32, get_word (m68k_areg(&context->regs, 6) + 32) + 1); + put_word (m68k_areg (&context->regs, 6) + 32, get_word (m68k_areg (&context->regs, 6) + 32) + 1); put_byte (ioreq + 31, 0); put_byte (ioreq + 8, 7); return 0; @@ -392,7 +392,7 @@ static int command_read (int mode, struct devstruct *dev, uaecptr data, int offs { int blocksize = dev->di.bytespersector; uae_u8 *temp; - + length /= blocksize; offset /= blocksize; while (length > 0) { @@ -410,7 +410,7 @@ static int command_write (int mode, struct devstruct *dev, uaecptr data, int off { int blocksize = dev->di.bytespersector; struct device_scsi_info dsi; - + if (!sys_command_scsi_info(mode, dev->unitnum, &dsi)) return 20; length /= blocksize; @@ -774,14 +774,14 @@ static uaecptr diskdev_startup (uaecptr resaddr) * the cd.device */ if (log_scsi) write_log ("diskdev_startup(0x%x)\n", resaddr); - put_word(resaddr + 0x0, 0x4AFC); - put_long(resaddr + 0x2, resaddr); - put_long(resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ - put_word(resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ - put_word(resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ - put_long(resaddr + 0xE, ROM_diskdev_resname); - put_long(resaddr + 0x12, ROM_diskdev_resid); - put_long(resaddr + 0x16, ROM_diskdev_init); + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ + put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ + put_long (resaddr + 0xE, ROM_diskdev_resname); + put_long (resaddr + 0x12, ROM_diskdev_resid); + put_long (resaddr + 0x16, ROM_diskdev_init); resaddr += 0x1A; return resaddr; } @@ -794,14 +794,14 @@ uaecptr scsidev_startup (uaecptr resaddr) write_log ("scsidev_startup(0x%x)\n", resaddr); /* Build a struct Resident. This will set up and initialize * the uaescsi.device */ - put_word(resaddr + 0x0, 0x4AFC); - put_long(resaddr + 0x2, resaddr); - put_long(resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ - put_word(resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ - put_word(resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ - put_long(resaddr + 0xE, ROM_scsidev_resname); - put_long(resaddr + 0x12, ROM_scsidev_resid); - put_long(resaddr + 0x16, ROM_scsidev_init); /* calls scsidev_init */ + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ + put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ + put_long (resaddr + 0xE, ROM_scsidev_resname); + put_long (resaddr + 0x12, ROM_scsidev_resid); + put_long (resaddr + 0x16, ROM_scsidev_init); /* calls scsidev_init */ resaddr += 0x1A; return resaddr; return diskdev_startup (resaddr); diff --git a/serial.c b/serial.c index ad3fed07..8b903ef6 100755 --- a/serial.c +++ b/serial.c @@ -185,7 +185,7 @@ void SERDAT (uae_u16 w) if (currprefs.serial_demand && !dtr) { if (!isbaeh) { - write_log("SERDAT: Baeh.. Your software needs SERIAL_ALWAYS to work properly.\n"); + write_log ("SERDAT: Baeh.. Your software needs SERIAL_ALWAYS to work properly.\n"); isbaeh=1; } return; diff --git a/svgancui.c b/svgancui.c index d405fc9b..84aeeb5a 100755 --- a/svgancui.c +++ b/svgancui.c @@ -20,7 +20,6 @@ #endif #include -#include "config.h" #include "options.h" #include "uae.h" #include "tui.h" diff --git a/traps.c b/traps.c index 25ff7b68..2c20155b 100755 --- a/traps.c +++ b/traps.c @@ -94,7 +94,7 @@ unsigned int define_trap (TrapHandler handler_func, int flags, const char *name) if (trap_count == MAX_TRAPS) { write_log ("Ran out of emulator traps\n"); abort (); - return 0; + return -1; } else { unsigned int trap_num = trap_count++; struct Trap *trap = &traps[trap_num]; diff --git a/uaeexe.c b/uaeexe.c index 98b755d4..26e6d2fc 100755 --- a/uaeexe.c +++ b/uaeexe.c @@ -24,15 +24,15 @@ static uae_u32 REGPARAM3 uaeexe_server (TrapContext *context) REGPARAM; /* * Install the server */ -void uaeexe_install(void) +void uaeexe_install (void) { uaecptr loop; loop = here (); - org(UAEEXE_ORG); + org (UAEEXE_ORG); calltrap (deftrap (uaeexe_server)); - dw(RTS); - org(loop); + dw (RTS); + org (loop); } /* @@ -44,17 +44,17 @@ void uaeexe_install(void) * to launch the command asynchronously. Please note also that the * remote cli works better if you've got the fifo-handler installed. */ -int uaeexe(const char *cmd) +int uaeexe (const char *cmd) { struct uae_xcmd *nw; if (!running) goto NORUN; - nw = (struct uae_xcmd*)malloc (sizeof *nw); + nw = malloc (sizeof *nw); if (!nw) goto NOMEM; - nw->cmd = (char*)malloc (strlen (cmd) + 1); + nw->cmd = malloc (strlen (cmd) + 1); if (!nw->cmd) { free (nw); goto NOMEM; @@ -64,68 +64,68 @@ int uaeexe(const char *cmd) nw->prev = last; nw->next = NULL; - if(!first) - first = nw; - if(last) { + if (!first) + first = nw; + if (last) { last->next = nw; - last = nw; + last = nw; } else - last = nw; + last = nw; return UAEEXE_OK; NOMEM: return UAEEXE_NOMEM; NORUN: - write_log("Remote cli is not running.\n"); + write_log ("Remote cli is not running.\n"); return UAEEXE_NOTRUNNING; } /* * returns next command to be executed */ -static char *get_cmd(void) +static char *get_cmd (void) { struct uae_xcmd *cmd; char *s; - if(!first) + if (!first) return NULL; s = first->cmd; cmd = first; first = first->next; - if(!first) + if (!first) last = NULL; - free(cmd); + free (cmd); return s; } /* * helper function */ -#define ARG(x) (get_long (m68k_areg (&context->regs, 7) + 4*(x+1))) +#define ARG(x) (get_long (m68k_areg (&context->regs, 7) + 4 * (x + 1))) static uae_u32 REGPARAM2 uaeexe_server (TrapContext *context) { int len; char *cmd; char *dst; - if(ARG(0) && !running) { + if (ARG (0) && !running) { running = 1; - write_log("Remote CLI started.\n"); + write_log ("Remote CLI started.\n"); } - cmd = get_cmd(); - if(!cmd) + cmd = get_cmd (); + if (!cmd) return 0; - if(!ARG(0)) { + if (!ARG (0)) { running = 0; return 0; } - dst = (char *)get_real_address(ARG(0)); - len = ARG(1); - strncpy(dst,cmd,len); - write_log ("Sending '%s' to remote cli\n",cmd); - free(cmd); - return ARG(0); + dst = (char *)get_real_address (ARG (0)); + len = ARG (1); + strncpy (dst, cmd, len); + write_log ("Sending '%s' to remote cli\n", cmd); + free (cmd); + return ARG (0); } diff --git a/uaeipc.c b/uaeipc.c index c8d2bb93..ac097940 100755 --- a/uaeipc.c +++ b/uaeipc.c @@ -67,11 +67,11 @@ static int listenIPC(void) return 0; } } else if (err != ERROR_IO_PENDING) { - write_log ("IPC: ConnectNamedPipe failed, err=%d\n", err); + write_log ("IPC: ConnectNamedPipe failed, err=%d\n", err); closeIPC(); return 0; } - write_log("IPC: waiting for connections\n"); + write_log ("IPC: waiting for connections\n"); return 1; } @@ -198,13 +198,13 @@ int checkIPC(struct uae_prefs *p) connected = TRUE; return 0; } - if (writepending) { + if (writepending) { writepending = FALSE; SetEvent (ol.hEvent); memset (&ol, 0, sizeof ol); ol.hEvent = olevent; return 0; - } + } } if (!readpending) { ok = ReadFile(hipc, buffer, IPC_BUFFER_SIZE, &ret, &ol); @@ -223,7 +223,7 @@ int checkIPC(struct uae_prefs *p) } } readpending = FALSE; - write_log("IPC: got message '%s'\n", buffer); + write_log ("IPC: got message '%s'\n", buffer); parsemessage((char*)buffer, p, (char*)outbuf, sizeof outbuf); memset (&ol, 0, sizeof ol); ol.hEvent = olevent; @@ -231,7 +231,7 @@ int checkIPC(struct uae_prefs *p) err = GetLastError(); if (!ok && err != ERROR_IO_PENDING) { write_log ("IPC: WriteFile() err=%d\n", err); - resetIPC(); + resetIPC(); return 0; } writepending = TRUE; diff --git a/uaelib.c b/uaelib.c index a5c6595a..a49b9012 100755 --- a/uaelib.c +++ b/uaelib.c @@ -313,8 +313,8 @@ static uae_u32 FindFunctionInObject (uae_u8 *objectptr) return 0; } -#define CREATE_NATIVE_FUNC_PTR uae_u32 (* native_func)( uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, \ - uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32) +#define CREATE_NATIVE_FUNC_PTR uae_u32 (* native_func) (uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, \ + uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32) #define SET_NATIVE_FUNC(x) native_func = (uae_u32 (*)(uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32, uae_u32))(x) #define CALL_NATIVE_FUNC( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6 ) if(native_func) native_func( d1,d2,d3,d4,d5,d6,d7,a1,a2,a3,a4,a5,a6 ) /* A0 - Contains a ptr to the native .obj data. This ptr is Amiga-based. */ @@ -340,13 +340,12 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode (struct regstruct *regs) uae_u8* object_UAM = NULL; CREATE_NATIVE_FUNC_PTR; - if( get_mem_bank( object_AAM ).check( object_AAM, 1 ) ) - object_UAM = get_mem_bank( object_AAM).xlateaddr( object_AAM ); + if (get_mem_bank(object_AAM).check (object_AAM, 1)) + object_UAM = get_mem_bank (object_AAM).xlateaddr (object_AAM); - if( object_UAM ) - { - SET_NATIVE_FUNC( FindFunctionInObject( object_UAM ) ); - CALL_NATIVE_FUNC( d1, d2, d3, d4, d5, d6, d7, a1, a2, a3, a4, a5, a6); + if (object_UAM) { + SET_NATIVE_FUNC (FindFunctionInObject (object_UAM)); + CALL_NATIVE_FUNC (d1, d2, d3, d4, d5, d6, d7, a1, a2, a3, a4, a5, a6); } return 1; #endif @@ -366,14 +365,14 @@ static int native_dos_op (uae_u32 mode, uae_u32 p1, uae_u32 p2, uae_u32 p3) if (mode) return -1; /* receive native path from lock - * p1 = dos.library:Lock, p2 = buffer, p3 = max buffer size + * p1 = dos.library:Lock, p2 = buffer, p3 = max buffer size */ v = get_native_path (p1, tmp); if (v) return v; for (i = 0; i <= strlen(tmp) && i < p3 - 1; i++) { - put_byte (p2 + i, tmp[i]); - put_byte (p2 + i + 1, 0); + put_byte (p2 + i, tmp[i]); + put_byte (p2 + i + 1, 0); } return 0; } @@ -448,9 +447,9 @@ static uae_u32 REGPARAM2 uaelib_demux (TrapContext *context) #endif case 85: return native_dos_op (ARG1, ARG2, ARG3, ARG4); case 86: - if (valid_address(ARG1, 1)) - write_log("DBG: %s\n", get_real_address(ARG1)); - return 1; + if (valid_address (ARG1, 1)) + write_log ("DBG: %s\n", get_real_address (ARG1)); + return 1; } return 0; } @@ -465,8 +464,8 @@ void emulib_install (void) org (RTAREA_BASE + 0xFF60); #if 0 dw (0x4eb9); - dw ((RTAREA_BASE >> 16) | get_word(RTAREA_BASE + 36)); - dw (get_word(RTAREA_BASE + 38) + 12); + dw ((RTAREA_BASE >> 16) | get_word (RTAREA_BASE + 36)); + dw (get_word (RTAREA_BASE + 38) + 12); #endif calltrap (define_trap (uaelib_demux, 0, "")); dw (RTS); diff --git a/uaeserial.c b/uaeserial.c index 73f2d7fa..9fa86cac 100755 --- a/uaeserial.c +++ b/uaeserial.c @@ -149,9 +149,10 @@ static char *getdevname (void) static void io_log (char *msg, uaecptr request) { if (log_uaeserial) - write_log ("%s: %08X %d %08.8X %d %d io_actual=%d io_error=%d\n", - msg, request,get_word(request + 28),get_long(request + 40),get_long(request + 36),get_long(request + 44), - get_long (request + 32), get_byte (request + 31)); + write_log ("%s: %08X %d %08.8X %d %d io_actual=%d io_error=%d\n", + msg, request, get_word (request + 28), get_long (request + 40), + get_long (request + 36), get_long (request + 44), + get_long (request + 32), get_byte (request + 31)); } static struct devstruct *getdevstruct (int uniq) @@ -187,38 +188,38 @@ static uae_u32 REGPARAM2 dev_close (TrapContext *context) uae_u32 request = m68k_areg (&context->regs, 1); struct devstruct *dev; - dev = getdevstruct (get_long(request + 24)); + dev = getdevstruct (get_long (request + 24)); if (!dev) return 0; if (log_uaeserial) write_log ("%s:%d close, req=%x\n", getdevname(), dev->unit, request); dev_close_3 (dev); put_long (request + 24, 0); - put_word (m68k_areg(&context->regs, 6) + 32, get_word (m68k_areg(&context->regs, 6) + 32) - 1); + put_word (m68k_areg (&context->regs, 6) + 32, get_word (m68k_areg (&context->regs, 6) + 32) - 1); return 0; } static void resetparams(struct devstruct *dev, uaecptr req) { - put_long(req + io_CtlChar, 0x00001311); - put_long(req + io_RBufLen, 1024); - put_long(req + io_ExtFlags, 0); - put_long(req + io_Baud, 9600); - put_long(req + io_BrkTime, 250000); - put_long(req + io_TermArray0, 0); - put_long(req + io_TermArray1, 0); - put_byte(req + io_ReadLen, 8); - put_byte(req + io_WriteLen, 8); - put_byte(req + io_StopBits, 1); - put_byte(req + io_SerFlags, get_byte(req + io_SerFlags) & (SERF_XDISABLED | SERF_SHARED | SERF_7WIRE)); - put_word(req + io_Status, 0); + put_long (req + io_CtlChar, 0x00001311); + put_long (req + io_RBufLen, 1024); + put_long (req + io_ExtFlags, 0); + put_long (req + io_Baud, 9600); + put_long (req + io_BrkTime, 250000); + put_long (req + io_TermArray0, 0); + put_long (req + io_TermArray1, 0); + put_byte (req + io_ReadLen, 8); + put_byte (req + io_WriteLen, 8); + put_byte (req + io_StopBits, 1); + put_byte (req + io_SerFlags, get_byte (req + io_SerFlags) & (SERF_XDISABLED | SERF_SHARED | SERF_7WIRE)); + put_word (req + io_Status, 0); } static int setparams(struct devstruct *dev, uaecptr req) { int v; int rbuffer, baud, rbits, wbits, sbits, rtscts, parity, xonxoff; - + rbuffer = get_long (req + io_RBufLen); v = get_long (req + io_ExtFlags); if (v) { @@ -247,12 +248,12 @@ static int setparams(struct devstruct *dev, uaecptr req) return 5; } write_log ("%s:%d BAUD=%d BUF=%d BITS=%d+%d RTSCTS=%d PAR=%d XO=%06.6X\n", - getdevname(), dev->unit, + getdevname(), dev->unit, baud, rbuffer, rbits, sbits, rtscts, parity, xonxoff); v = uaeser_setparams (dev->sysdata, baud, rbuffer, rbits, sbits, rtscts, parity, xonxoff); if (v) { - write_log("->failed\n"); + write_log ("->failed\n"); return v; } return 0; @@ -292,7 +293,7 @@ static uae_u32 REGPARAM2 dev_open (TrapContext *context) dev->unit = unit; dev->open = 1; dev->uniq = ++uniq; - dev->exclusive = (get_word(ioreq + io_SerFlags) & SERF_SHARED) ? 0 : 1; + dev->exclusive = (get_word (ioreq + io_SerFlags) & SERF_SHARED) ? 0 : 1; put_long (ioreq + 24, dev->uniq); resetparams (dev, ioreq); err = setparams (dev, ioreq); @@ -306,7 +307,7 @@ static uae_u32 REGPARAM2 dev_open (TrapContext *context) write_log ("%s:%d open ioreq=%08.8X\n", getdevname(), unit, ioreq); start_thread (dev); - put_word (m68k_areg(&context->regs, 6) + 32, get_word (m68k_areg(&context->regs, 6) + 32) + 1); + put_word (m68k_areg (&context->regs, 6) + 32, get_word (m68k_areg (&context->regs, 6) + 32) + 1); put_byte (ioreq + 31, 0); put_byte (ioreq + 8, 7); return 0; @@ -367,7 +368,7 @@ static int release_async_request (struct devstruct *dev, uaecptr request) prevar = NULL; while (ar) { if (ar->request == request) { - if (prevar == NULL) + if (prevar == NULL) dev->ar = ar->next; else prevar->next = ar->next; @@ -393,7 +394,7 @@ static void abort_async (struct devstruct *dev, uaecptr request) return; } if (log_uaeserial) - write_log ("%s:%d asyncronous request=%08.8X aborted\n", getdevname(), dev->unit, request); + write_log ("%s:%d asyncronous request=%08.8X aborted\n", getdevname(), dev->unit, request); put_byte (request + 31, -2); put_byte (request + 30, get_byte (request + 30) | 0x20); write_comm_pipe_u32 (&dev->requests, request, 1); @@ -458,14 +459,14 @@ void uaeser_signal (struct devstruct *dev, int sigmask) } break; default: - write_log("%s:%d incorrect async request %x (cmd=%d) signaled?!", getdevname(), dev->unit, request, command); + write_log ("%s:%d incorrect async request %x (cmd=%d) signaled?!", getdevname(), dev->unit, request, command); break; } if (io_done) { if (log_uaeserial) write_log ("%s:%d async request %x completed\n", getdevname(), dev->unit, request); - put_long (request + 32, io_actual); + put_long (request + 32, io_actual); put_byte (request + 31, io_error); ar->ready = 1; write_comm_pipe_u32 (&dev->requests, request, 1); @@ -492,7 +493,7 @@ static void cmd_reset(struct devstruct *dev, uaecptr req) put_long (req + io_StopBits, 1); put_long (req + io_SerFlags, SERF_XDISABLED); put_word (req + io_Status, 0); -} +} static int dev_do_io (struct devstruct *dev, uaecptr request, int quick) { @@ -564,7 +565,7 @@ static uae_u32 REGPARAM2 dev_beginio (TrapContext *context) uae_u32 request = m68k_areg (&context->regs, 1); uae_u8 flags = get_byte (request + 30); int command = get_word (request + 28); - struct devstruct *dev = getdevstruct (get_long(request + 24)); + struct devstruct *dev = getdevstruct (get_long (request + 24)); put_byte (request + 8, NT_MESSAGE); if (!dev) { @@ -577,7 +578,7 @@ static uae_u32 REGPARAM2 dev_beginio (TrapContext *context) write_log ("device %s:%d command %d bug with IO_QUICK\n", getdevname(), dev->unit, command); return get_byte (request + 31); } else { - put_byte (request + 30, get_byte (request + 30) & ~1); + put_byte (request + 30, get_byte (request + 30) & ~1); write_comm_pipe_u32 (&dev->requests, request, 1); return 0; } @@ -593,7 +594,7 @@ static void *dev_thread (void *devs) for (;;) { uaecptr request = (uaecptr)read_comm_pipe_u32_blocking (&dev->requests); uae_sem_wait (&change_sem); - if (!request) { + if (!request) { dev->thread_running = 0; uae_sem_post (&dev->sync_sem); uae_sem_post (&change_sem); @@ -602,7 +603,7 @@ static void *dev_thread (void *devs) uae_ReplyMsg (request); release_async_request (dev, request); } else if (dev_do_io (dev, request, 0) == 0) { - uae_ReplyMsg (request); + uae_ReplyMsg (request); } else { add_async_request (dev, request); uaeser_trigger (dev->sysdata); @@ -623,7 +624,7 @@ static uae_u32 REGPARAM2 dev_init (TrapContext *context) static uae_u32 REGPARAM2 dev_abortio (TrapContext *context) { uae_u32 request = m68k_areg (&context->regs, 1); - struct devstruct *dev = getdevstruct (get_long(request + 24)); + struct devstruct *dev = getdevstruct (get_long (request + 24)); if (!dev) { put_byte (request + 31, 32); @@ -662,14 +663,14 @@ uaecptr uaeserialdev_startup (uaecptr resaddr) write_log ("uaeserialdev_startup(0x%x)\n", resaddr); /* Build a struct Resident. This will set up and initialize * the serial.device */ - put_word(resaddr + 0x0, 0x4AFC); - put_long(resaddr + 0x2, resaddr); - put_long(resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ - put_word(resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ - put_word(resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ - put_long(resaddr + 0xE, ROM_uaeserialdev_resname); - put_long(resaddr + 0x12, ROM_uaeserialdev_resid); - put_long(resaddr + 0x16, ROM_uaeserialdev_init); + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ + put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ + put_long (resaddr + 0xE, ROM_uaeserialdev_resname); + put_long (resaddr + 0x12, ROM_uaeserialdev_resid); + put_long (resaddr + 0x16, ROM_uaeserialdev_init); resaddr += 0x1A; return resaddr; } @@ -690,7 +691,7 @@ void uaeserialdev_install (void) /* initcode */ initcode = here (); calltrap (deftrap (dev_init)); dw (RTS); - + /* Open */ openfunc = here (); calltrap (deftrap (dev_open)); dw (RTS); diff --git a/zfile.c b/zfile.c index c31ea6b5..49ffbf4e 100755 --- a/zfile.c +++ b/zfile.c @@ -243,11 +243,11 @@ const char *uae_diskimageextensions[] = int zfile_is_ignore_ext(const char *name) { int i; - + for (i = 0; uae_ignoreextensions[i]; i++) { - if (strlen(name) > strlen (uae_ignoreextensions[i]) && - !strcasecmp (uae_ignoreextensions[i], name + strlen (name) - strlen (uae_ignoreextensions[i]))) - return 1; + if (strlen(name) > strlen (uae_ignoreextensions[i]) && + !strcasecmp (uae_ignoreextensions[i], name + strlen (name) - strlen (uae_ignoreextensions[i]))) + return 1; } return 0; } @@ -373,7 +373,7 @@ static struct zfile *zfile_opensinglefile(struct zfile *l) while (*s != 0 && *s != '/' && *s != '\\') s--; if (s > tmp) s++; - write_log("loading from singlefile: '%s'\n", tmp); + write_log ("loading from singlefile: '%s'\n", tmp); while (*p++); offset = (p[0] << 24)|(p[1] << 16)|(p[2] << 8)|(p[3] << 0); p += 4; @@ -407,8 +407,8 @@ static struct zfile *zfile_fopen_nozip (const char *name, const char *mode) l->name = strdup (name); f = fopen (name, mode); if (!f) { - zfile_fclose (l); - return 0; + zfile_fclose (l); + return 0; } l->f = f; return l; @@ -659,7 +659,7 @@ size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z) if (z->data) { if (z->seek + l1 * l2 > z->size) { if (l1) - l2 = (z->size - z->seek) / l1; + l2 = (z->size - z->seek) / l1; else l2 = 0; if (l2 < 0) @@ -826,8 +826,8 @@ static struct znode *znode_alloc_child(struct znode *parent, const char *name) if (!parent->child) { parent->child = zn; } else { - struct znode *pn = parent->child; - while (pn->sibling) + struct znode *pn = parent->child; + while (pn->sibling) pn = pn->sibling; pn->sibling = zn; } @@ -841,8 +841,8 @@ static struct znode *znode_alloc_sibling(struct znode *sibling, const char *name if (!sibling->sibling) { sibling->sibling = zn; } else { - struct znode *pn = sibling->sibling; - while (pn->sibling) + struct znode *pn = sibling->sibling; + while (pn->sibling) pn = pn->sibling; pn->sibling = zn; } @@ -855,10 +855,10 @@ static void zvolume_addtolist(struct zvolume *zv) if (!zv) return; if (!zvolume_list) { - zvolume_list = zv; + zvolume_list = zv; } else { - struct zvolume *v = zvolume_list; - while (v->next) + struct zvolume *v = zvolume_list; + while (v->next) v = v->next; v->next = zv; } @@ -903,7 +903,7 @@ static struct zvolume *get_zvolume(const char *path) char *s = zfile_getname(zv->archive); if (strlen(path) >= strlen(s) && !memcmp (path, s, strlen(s))) return zv; - zv = zv->next; + zv = zv->next; } return NULL; } @@ -939,13 +939,13 @@ struct zvolume *zfile_fopen_archive_data(struct zfile *zf) zfile_fread (header, sizeof (header), 1, zf); zfile_fseek (zf, 0, SEEK_SET); if (header[0] == 'P' && header[1] == 'K') - zv = archive_directory_zip (zf); + zv = archive_directory_zip (zf); if (header[0] == 'R' && header[1] == 'a' && header[2] == 'r' && header[3] == '!') - zv = archive_directory_rar (zf); + zv = archive_directory_rar (zf); if (header[0] == 'L' && header[1] == 'Z' && header[2] == 'X') - zv = archive_directory_lzx (zf); + zv = archive_directory_lzx (zf); if (header[2] == '-' && header[3] == 'l' && header[4] == 'h' && header[6] == '-') - zv = archive_directory_lha (zf); + zv = archive_directory_lha (zf); return zv; } @@ -971,7 +971,7 @@ static int zfile_fopen_archive_recurse(struct zvolume *zv) zndir = get_znode(zv, tmp); if (!zndir) { struct zarchive_info zai = { 0 }; - zvnew = zvolume_alloc_empty (tmp); + zvnew = zvolume_alloc_empty (tmp); zai.name = tmp; zai.t = zn->mtime; zndir = zvolume_adddir_abs(zv, &zai); @@ -1002,7 +1002,7 @@ static struct zvolume *prepare_recursive_volume(struct zvolume *zv, const char * struct zfile *zf = NULL; struct zvolume *zvnew = NULL; - write_log("unpacking '%s'\n", path); + write_log ("unpacking '%s'\n", path); zf = zfile_open_archive(path, 0); if (!zf) goto end; @@ -1014,7 +1014,7 @@ static struct zvolume *prepare_recursive_volume(struct zvolume *zv, const char * zfile_fclose_archive(zv); return zvnew; end: - write_log("unpack failed\n"); + write_log ("unpack failed\n"); zfile_fclose_archive (zvnew); zfile_fclose(zf); return NULL; @@ -1046,7 +1046,7 @@ static struct znode *get_znode(struct zvolume *zv, const char *ppath) if (zvdeep->archive == NULL) { zvdeep = prepare_recursive_volume(zvdeep, zn->fullname); if (!zvdeep) { - write_log("failed to unpack '%s'\n", zn->fullname); + write_log ("failed to unpack '%s'\n", zn->fullname); return NULL; } /* replace dummy empty volume with real volume */ @@ -1091,7 +1091,7 @@ struct znode *znode_adddir(struct znode *parent, const char *name, struct zarchi { struct znode *zn; char path[MAX_DPATH]; - + sprintf(path, "%s%c%s", parent->fullname, FSDB_DIR_SEPARATOR, name); zn = get_znode(parent->volume, path); if (zn) @@ -1334,7 +1334,7 @@ int zfile_exists_archive (const char *path, const char *rel) char tmp[MAX_DPATH]; struct zvolume *zv; struct znode *zn; - + sprintf(tmp, "%s%c%s", path, FSDB_DIR_SEPARATOR, rel); zv = get_zvolume(tmp); zn = get_znode(zv, tmp); diff --git a/zfile_archive.c b/zfile_archive.c index 9a70b8ea..fe66df30 100755 --- a/zfile_archive.c +++ b/zfile_archive.c @@ -119,32 +119,32 @@ struct zfile *archive_access_select (struct zfile *zf, unsigned int id, int dode zn = &zv->root; while (zn) { int isok = 1; - + if (!zn->isfile) isok = 0; if (zfile_is_ignore_ext(zn->fullname)) isok = 0; if (isok) { if (tmphist[0]) { - DISK_history_add (tmphist, -1); - tmphist[0] = 0; - first = 0; + DISK_history_add (tmphist, -1); + tmphist[0] = 0; + first = 0; } if (first) { if (zfile_isdiskimage (zn->fullname)) strcpy (tmphist, zn->fullname); } else { - strcpy (tmphist, zn->fullname); - DISK_history_add (tmphist, -1); - tmphist[0] = 0; + strcpy (tmphist, zn->fullname); + DISK_history_add (tmphist, -1); + tmphist[0] = 0; } select = 0; if (!zf->zipname) - select = 1; + select = 1; if (zf->zipname && !strcasecmp (zf->zipname, zn->name)) - select = -1; + select = -1; if (zf->zipname && zf->zipname[0] == '#' && atol (zf->zipname + 1) == zipcnt) - select = -1; + select = -1; if (select && !we_have_file) { z = archive_getzfile(zn, id); if (z) { @@ -161,7 +161,7 @@ struct zfile *archive_access_select (struct zfile *zf, unsigned int id, int dode zn = zn->next; } if (first && tmphist[0]) - DISK_history_add (zfile_getname(zf), -1); + DISK_history_add (zfile_getname(zf), -1); zfile_fclose_archive (zv); if (z) { zfile_fclose(zf); @@ -288,7 +288,7 @@ struct zfile *archive_access_zip (struct znode *zn) unzCloseCurrentFile (uz); return z; } - + /* 7Z */ #include "archivers/7z/7zCrc.h" @@ -325,7 +325,7 @@ static SZ_RESULT SzFileSeekImp(void *object, CFileSize pos) static void init_7z(void) { static int initialized; - + if (initialized) return; initialized = 1; @@ -368,7 +368,7 @@ struct zvolume *archive_directory_7z (struct zfile *z) ctx->archiveStream.zf = z; res = SzArchiveOpen(&ctx->archiveStream.InStream, &ctx->db, &allocImp, &allocTempImp); if (res != SZ_OK) { - write_log("7Z: SzArchiveOpen %s returned %d\n", zfile_getname(z), res); + write_log ("7Z: SzArchiveOpen %s returned %d\n", zfile_getname(z), res); return NULL; } zv = zvolume_alloc(z, ArchiveFormat7Zip, ctx); @@ -399,15 +399,15 @@ struct zfile *archive_access_7z (struct znode *zn) struct SevenZContext *ctx; ctx = zv->handle; - res = SzExtract(&ctx->archiveStream.InStream, &ctx->db, zn->offset, - &ctx->blockIndex, &ctx->outBuffer, &ctx->outBufferSize, - &offset, &outSizeProcessed, + res = SzExtract(&ctx->archiveStream.InStream, &ctx->db, zn->offset, + &ctx->blockIndex, &ctx->outBuffer, &ctx->outBufferSize, + &offset, &outSizeProcessed, &allocImp, &allocTempImp); if (res == SZ_OK) { - z = zfile_fopen_empty (zn->fullname, zn->size); + z = zfile_fopen_empty (zn->fullname, zn->size); zfile_fwrite (ctx->outBuffer + offset, zn->size, 1, z); } else { - write_log("7Z: SzExtract %s returned %d\n", zn->fullname, res); + write_log ("7Z: SzExtract %s returned %d\n", zn->fullname, res); } return z; } @@ -436,8 +436,8 @@ static int rar_resetf(struct zfile *z) { z->f = fopen (z->name, "rb"); if (!z->f) { - zfile_fclose (z); - return 0; + zfile_fclose (z); + return 0; } return 1; } @@ -484,7 +484,7 @@ static int CALLBACK RARCallbackProc(UINT msg,LONG UserData,LONG P1,LONG P2) struct RARContext { struct RAROpenArchiveData OpenArchiveData; - struct RARHeaderDataEx HeaderData; + struct RARHeaderDataEx HeaderData; HANDLE hArcData; }; @@ -519,7 +519,7 @@ struct zvolume *archive_directory_rar (struct zfile *z) zfile_fclose_archive(zv); return NULL; } - zfile_fclose_archive(zv); + zfile_fclose_archive(zv); return archive_directory_arcacc (z, ArchiveFormatRAR); } pRARSetCallback(rc->hArcData, RARCallbackProc, 0); @@ -532,9 +532,9 @@ struct zvolume *archive_directory_rar (struct zfile *z) zai.name = name; zai.size = rc->HeaderData.UnpSize; zai.t = fromdostime(rc->HeaderData.FileTime); - zn = zvolume_addfile_abs(zv, &zai); + zn = zvolume_addfile_abs(zv, &zai); zn->offset = cnt++; - pRARProcessFile(rc->hArcData, RAR_SKIP, NULL, NULL); + pRARProcessFile(rc->hArcData, RAR_SKIP, NULL, NULL); } pRARCloseArchive(rc->hArcData); zftmp = zfile_fopen_empty (z->name, 0); @@ -586,7 +586,7 @@ struct aaFILETIME uae_u32 dwHighDateTime; }; typedef void* aaHandle; -// This struct contains file information from an archive. The caller may store +// This struct contains file information from an archive. The caller may store // this information for accessing this file after calls to findFirst, findNext #define FileInArchiveInfoStringSize 1024 struct aaFileInArchiveInfo { @@ -800,9 +800,9 @@ static void addfile(struct zvolume *zv, const char *path, uae_u8 *data, int size zai.size = size; zn = zvolume_addfile_abs(zv, &zai); if (zn) - zn->f = z; + zn->f = z; else - zfile_fclose(z); + zfile_fclose(z); } static uae_u8 exeheader[]={0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00}; -- 2.47.3