Commit Graph

13601 Commits

Author SHA1 Message Date
Vas Crabb
cff4924beb cpu/uml.cpp: Fixed assertion failures when simplification reduces operand count.
* Also added a few more simplifications.
* cpu/drcbearm64.cpp, cpu/drcbex64.cpp: Removed more speical cases for
  things the simplifier deals with.
2025-04-09 22:07:11 +10:00
Brice Onken
3612c23f96
machine/dp83932c.cpp: Advance CRBA on packet RX (#13571) 2025-04-09 07:32:40 -04:00
Vas Crabb
1f871c19ee -A few recompiler adjustments:
* cpu/drcbec.cpp: Don't clear carry flag on a zero-bit rotate through
  carry.
* cpu/drcbex86.cpp: Don't clear carry flag on a word-sized zero-bit
  rotate through carry (64-bit case is more involved).
* cpu/drcbex64.cpp: Removed code for another special case of ROLAND that
  the simplifier deals with.

-konami/ksys573.cpp, bus/pccard/linflash.cpp: Corrected "Gacha Gachamp".
2025-04-09 16:33:50 +10:00
m1macrophage
ccb469b9a7
sound/va_eg.cpp: Fixing subtle bugs. (#13570)
* Actually take a voltage snapshot when R or C change. This was being attempted, but didn't work because set_target_v would exit early if the target V was not changing. Made the snapshoting more explicit.
* Consider the EG done based on elapsed time, instead of proximity to target value. Some low volume DMX sounds were affected by this.
2025-04-09 00:36:19 +02:00
cam900
69b45ce25c
stern/mazerbla.cpp, video/mb_vcu.cpp: Updates/Cleanups: (#13569)
* video/mb_vcu.cpp:
 - Implement device_palette_interface for palette functionality.
 - Use an address space finder to access the host address space.
 - Use logmacro.h helpers for configurable logging.
 - Added a VRAM addressing helper.
 - Suppress side effects for debugger reads.
 - Cleanup 2bpp graphics drawing and screen update function.

* stern/mazerbla.cpp:
 - Reduced run-time tag lookups and preprocessor macros.
 - Reduced duplication and unnecessary trampolines.
 - Updated comments.
2025-04-09 07:37:45 +10:00
cam900
633e196e59
video/ppu2c0x*.cpp: Implemented device_palette_interface and cleaned up code: (#13491)
* Implement device_palette_interface for color palette functionality.
* Added some missing members to save states, and use fixed-size integer types for members that need to be saved.
* Moved many internal functions into protected: and private: sections.
* Use more appropriate integer types, made many local variables const.
2025-04-09 06:33:43 +10:00
shattered
689ed7c59d
ussr/dvk_kcgd.cpp: Corrected CPU type to K1801VP065 and removed serial speed workarounnd for MS7004 keyboard. (#13564)
* machine/ie15_kbd.cpp: Reassigned keys on the IE15 keyboard to match the layout of a VT52 keypad.
* ussr/ms0515.cpp, ussr/dvk_ksm.cpp: Removed keyboard serial speed workaround.
2025-04-09 06:13:23 +10:00
Vas Crabb
98b18d69f7 -emu/schedule.cpp: Restore timers expiring at the same time in the order they were scheduled when loading a saved state.
-emu/diexec.cpp: If a shorter input line pulse overlaps a longer pulse, don't shorten the pulse.

-cpu/e132xs: Added named input line number constants.

-video/sprite.cpp: Got rid of simple_list and fixed_allocator.
2025-04-09 04:22:53 +10:00
Roberto Fresca
e4d09c2b64 i8085 core: Readded the TODO item about the DSUB H flag verification. 2025-04-08 02:50:16 +02:00
hap
28ec18ab96 diexec: remove duplicate getter 2025-04-08 01:46:36 +02:00
Vas Crabb
cce7b01de9 cpu/powerpc: Fixed issues in POWER div (signed divide) instruction causing GitHub #13329.
This was "working" on x86-64 due to the backend treating shift/rotate
instructions with zero immediate bit count as a no-op even if the source
and destination registaer aren't the same.  Fixing the bug in the
back-end caused it to break the same way on x86-64 as it does on the
other three back-ends that didn't have this bug.
2025-04-08 06:50:34 +10:00
Vas Crabb
63be095e58 -cpu/uml.cpp: Rewrote the UML simplification code.
* Fixed many cases that could cause the upper bits of a register not to
  cleared following a 32-bit operation.
* Added more simplifications.
* Allow many simplifications when flag updates are requested.
* Fixed various bits of unreachable code.
* cpu/drcbearm64.cpp, cpu/drcbex64.cpp: Removed code for special-casing
  some situations the simplifier can now take care of consistently.

-cpu/drcbex64.cpp: Fixed a bug causing some shifts to be treated as a
 no-op when the destination and source are not the same.

-cpu/drcbearm64.cpp, cpu/drcbex64.cpp: Added a special case for
 comparing something to itself.

-cpu/e132xs: Use the CARRY instruction rather than a right shift to set
 up carry in.
2025-04-08 06:42:46 +10:00
hap
113d351625 i8085: remove myself from copyright holders, does not match my criteria 2025-04-07 19:03:27 +02:00
Roberto Fresca
574a30042b i8085 core: Take out from the TODO list the item related to
the undocumented DSUB H flag verification.
2025-04-07 18:24:04 +02:00
hap
35b49fd3f2 i8085: small cleanup 2025-04-07 12:18:39 +02:00
hap
1e40f6e880 i8085: no need for a diagram on how a rotate opcode works 2025-04-07 11:29:52 +02:00
Roberto Fresca
d3b0fd4678 Paracaidista driver and i8085 core improvements: [Roberto Fresca, Grull Osgo]
- Working RAM through PPI 8155 internal RAM and handlers.
 - Extended the PPI 8166 to support the 14bit timer + 2bit control.
 - Hooked the i8257 DMA controller.
 - Demuxed the digital inputs.
 - Adjusted screen visible area.
 - Worked the DMA support to get registers in the correct addressing.
 - Hooked the analogic inputs.
 - Added inputs for two players.
 - Added DIP switches for coinage, difficulty, and lives.
 - Added and demuxed spinner controls.
 - Added NVRAM support.
 - Sound support.
 - Adjusted the spinners parameters to general purpose.
 - Sound level control circuitry.
 - Wired players lamps.
 - Added technical notes.

 - Rewrote the enhanced no documented i8085 RDEL & DSUB
    instructions and their own flags.

Systems promoted to working
---------------------------
Paracaidista [Roberto Fresca, Grull Osgo]
2025-04-07 04:15:34 +02:00
cam900
dccd92dfbe
Fixed a few issues and cleaned up code in Hudson Soft PC Engine component devices: (#13493)
* sound/c6280.cpp: Improved accuracy of volume control and LFO.
* video/huc6260.cpp: Suppress side effects for debugger reads, fixed save state issues.
* video/huc6270.cpp: Suppress side effects for debugger reads.
* Chose better types for member variables, made more local variables const, reformatted code.
2025-04-07 03:40:45 +10:00
cam900
178f205a4a
video/gba_lcd.cpp: Implement device_palette_interface rather than instantiating a separate palette device. (#13481) 2025-04-07 03:15:56 +10:00
hap
e7250f3563 konami.lst: correction to prev commit with shift count 2025-04-06 18:21:00 +02:00
Vas Crabb
79db8d2a59 -cpu/e132xs: Use word addressing for I/O.
* There are no byte enable or write strobe signals for I/O, and there's
  only a single operand size, so word addresses make more sense.
* Also changed STBS/STWS to allow any valid signed or unsigned value of
  the applicable size.  This allows vamphalf attract mode to work as
  well as the storage test.

-misc/limenko.cpp: Better input types for spotty.
2025-04-07 00:24:48 +10:00
hap
1edf23d22d konami cpu: shift amount for the extra shift opcodes is 4-bit [Jim Westfall] 2025-04-06 13:36:55 +02:00
hap
ea3118ab93 konami cpu dasm: be consistent with uppercase data and reg names, renamed some opcodes 2025-04-06 13:36:55 +02:00
Vas Crabb
da2d86c9a8 cpu/e132xs: Changed STBS and STHS to do an unsigned range check.
* Fixes vamphalf storage test.
* Also fixed IO3 wake from power down.
2025-04-06 05:31:39 +10:00
Vas Crabb
c41a83655a -cpu/e132xs: Fixed I/O for models with 16-bit external bus.
* Only a single I/O access is generated for an I/O word read/write.  The
  upper half just disappears if the pins aren't present.  This fixes
  "phantom" I/O accesses, allowing address maps to be cleaned up a bit.
* Reduced I/O address width for models with 16-bit external bus to match
  hardware.
* Made addressing consistent between interpreter and recompiler for I/O
  double-word accesses.
* Implemented power down via internal I/O write for E1-X and later
  cores (none of the games I tested actually use it).

-misc/pasha2.cpp: Enabled the recompiler for Zooty Drum - it gets just
 as far as the interpreter now.
2025-04-06 03:54:24 +10:00
holub
fe50bb770a
cpu/z80: Improved z80 code generation (#13558) 2025-04-05 17:08:27 +02:00
Vas Crabb
d914e2a574 cpu/e132xs: Improved comment about model differences. 2025-04-05 06:18:17 +11:00
Vas Crabb
f109cfdf94 cpu/e132xs: It's rather important to initialise DRC handle pointers. 2025-04-05 04:58:04 +11:00
Vas Crabb
3c27e2fd8d cpu/e132xs: Untangled device types.
* Got package option (T, N or B suffix) out of device type.
* Enabled 4x PLL clock multiplier for GMS30C2216/GMS30C2232.
* Implemented entering power down mode via MCR for E1 and E1-X cores.
* Marginally better code generation for a few instructions.
* Log available bus/memory configuration options for different cores.
* Added post load handler for E1-XS and E1-XSR cores to install SDRAM
  mode/configuration handlers if necessary.
* Improved comment about different Hynix and Hyperstone CPU models.

-cpu/drcbearm64.cpp: Don't update flags that aren't requested in a few
 places.
2025-04-05 04:37:58 +11:00
cracyc
9d1ff6e8ee pc_vga: only set the ramdac color when all three values are written
ega: the mask only applies to the latch not the vram
2025-04-04 12:29:34 -05:00
cam900
0ca50cf1fb
cpu/z180/z180.cpp: Fix filename in comment (#13555) 2025-04-03 22:19:43 -04:00
hap
950b396e53 konami cpu: set EXG/TFR reg A high byte to 0x10 2025-04-03 19:10:20 +02:00
Vas Crabb
b1c09f02b4 -cpu/e132xs: Got rid of "Mission Craft flags" compile time option.
* Assume ROL sets the V and C flags the same way as SHL and MOVI clears
  the V flag.

-cpu/drcbex64.cpp: Optimise SUB x,0,y to a NEG instruction (gets down to
 one instruction from two or three a lot of the time).  This had been a
 TODO comment for ages.

-cpu/drcbex86.cpp: Got rid of unnecessary std::function use.  This
 substantially reduces the code size and reduces allocations during code
 generation.

-cpu/drcbearm64.cpp, cpu/drcbex64.cpp, cpu/drcbex86.cpp: Got rid of the
 intermediate tables in favour of bit switch statements.  This improves
 startup time, reduces code size, and gives the compiler more
 optimisation opportunities.

-cpu/drcbearm64.cpp, cpu/drcbex64.cpp, cpu/drcbex86.cpp: Got rid of
 asmjit namespace qualifiers left over from when the class declarations
 were in headers and hence outside the scope of the using namespace
 statements.
2025-04-04 03:49:01 +11:00
Vas Crabb
c5629193ce cpu/drcbearm64.cpp: orr immediate needs a mask immediate. 2025-04-03 16:41:01 +11:00
hap
456d6b7619 konami cpu: corrections to EXG/TFR opcode [hap, Jim Westfall] 2025-04-02 22:32:23 +02:00
Vas Crabb
e17d676fd1 cpu/drcbearm64.cpp: Fixed build after previous commit.
Sorry, I'm too tired and didn't git add this.  My bad.
2025-04-03 03:08:59 +11:00
Vas Crabb
436431d99b -cpu/e132xs: Miscellaneous fixes/optimisation:
* Fixed behaviour of delayed branches, trace exceptions, and saved PC
  calculation for error exceptions in delay slots for the interpreter.
  All instructions in delay slots, branching instructions that can raise
  exceptions and tracing shoud now (mis)behave properly for the
  interpreter, including things the manual says you shouldn't do.
* Fixed and optimised flag updates for left shifts for the recompiler.
* Optimised ROL instruction for the recompiler and made flag calculation
  equivalent to the interpreter both with and without the "Missioncraft
  flags" compile-time option.
* Only block interrupts for one instruction following a delayed branch.
* Optimised the SOFTWARE instruction a little for the recompiler.
* Added more SDRAM configuration logging and cleaned up code a bit.

-cpu/drcbearm64.cpp: Apply the change from 7efe37938f to OR and
 XOR instructions as well, and fix some cases where a 32-bit logical
 operation would fail to clear the upper bits of a register.

-cpu/drcbex64.cpp: Avoid more conditional branches on conditional MOV.
2025-04-03 02:40:43 +11:00
Devin Acker
9349b16a17
Add a skeleton for an Oldsmobile Driver Information System (#13525)
* New NOT_WORKING machine
----------
Oldsmobile Driver Information System (version 2.2 CH) [Devin Acker]
2025-04-02 10:22:45 -04:00
cam900
922a631001
bus/mmc5.cpp: Fix IRQ (#13547) 2025-04-02 11:09:38 +02:00
m1macrophage
3299e78bae
Implemented VA EG (Envelope Generator) and VCA (Voltage Controlled Amplifier) sound devices. (#13545)
* sound/va_eg.cpp, sound/va_vca.cpp: Envelope generator and voltage-controlled amplifier.

Implemented RC-based envelope generator and voltage-controlled amplifier devices.
Replaced custom implementations in paia/fatman, linn/linndrum and oberheim/dmx.

* Fixing comments.

* More comment fixes.

* Adding comments based on feedback.

* Fixed typo.
2025-04-02 10:31:23 +02:00
Patrick Mackinlay
a71c0333b7 x68k: add CZ-7BS1 dma glue logic 2025-04-02 13:27:05 +07:00
Patrick Mackinlay
ee6cb33f46 hd63450: add primitive /own and /dtack support
* also improve auto-request mode logic
2025-04-02 13:27:04 +07:00
Adam Billyard
3c729314b8
- consistent logging order for status (#13546)
Co-authored-by: Adam <adam@light-up.co.uk>
2025-04-02 00:07:38 +02:00
hap
cfa56c0d33 mb86233: add /3 clock divider 2025-04-01 12:28:27 +02:00
Vas Crabb
7efe37938f -cpu/e132xs: Log bus control and memory control setup.
-cpu/drcbearm64.cpp: Simplified logic for choosing optimal AND strategy.
2025-04-01 10:13:14 +11:00
Vas Crabb
1dca832b37 -cpu/e132xs.cpp: Improved exception emulation:
* Fixed behaviour of exceptions in delay slots, and fixed recompiler not
  updating ILC and P for some exceptions.
* Implemented privilege error exception on setting L in user mode for
  interpreter.

-emu/debug, osd/modules/debugger: Added an option to show
 exceptionpoints in breakpoints windows.
2025-04-01 03:45:36 +11:00
Adam Billyard
e0ea955d1b
cpu/m68000: For 68010 only, do not throw away buserr on prefetch (#13405) 2025-03-31 12:04:48 -04:00
cam900
3fb2594c99
devices/sound/mmc5.cpp: Implement MMC5 sound emulation (#13487)
* Implement MMC5 sound emulation
- Heavily based from devices/sound/nes_apu.cpp, Adjusted to differences compares to NES APU and MMC5.

* bus/nes/mmc5,cpp: Fix save state support, Implement MMC5 sound

* bus/nes/nes_slot.h: Fix save state support
 
* sound/nes_defs.h: Fix save state support
2025-03-30 15:53:31 -04:00
hap
15dd6ba403 v60: fix issue with CVTSW overflow flag after rounding 2025-03-30 20:39:31 +02:00
angelosa
27c2236773 skeleton/huangyeh_m68k.cpp: pinpoint a bunch of I/O handlers 2025-03-30 20:21:15 +02:00
Vas Crabb
eed05ed158 cpu/e132xs: Emulate more exceptions, more recompiler optimisation.
Emulate pointer error exception on load/store and range error exception
on store signed byte/half-word.

Further optimised code generation for MOV and MOVI.  These are very hot,
so this alone gains a further 2% performance or so in the dgPIX games.

Also some other miscellaneous cleanup.
2025-03-31 04:38:51 +11:00
hap
04edb1b554 minx: don't crash mame on divide by 0 2025-03-30 14:44:55 +02:00
Vas Crabb
27b3384acd -cpu/e132xs: Implemented pointer error exceptions for recompiler.
* Implemented pointer error exceptions on attempting to use a zero
  address register (other than SR) in the recompiler.
* Also optimised load/store instructions a bit and reduced copy/paste.
* Fixed a couple of disassembler issues.

-misc/dgpix.cpp: Demoted The X-Files to not working with unemulated
 protection.
2025-03-30 06:21:27 +11:00
hap
bff1ab51d9 m6502: like z80, around 10% performance gain by checking unset devcb on every opcode 2025-03-29 19:25:41 +01:00
hap
df2098bdcc z80: around 10% performance gain by checking if devcb is unset that is called on every opcode 2025-03-29 18:58:32 +01:00
angelosa
89f4c0d698 nec/pc88va.cpp: port SASI support from PC-9801 2025-03-29 16:13:20 +01:00
Vas Crabb
40a0638ba7 -cpu/e132xs: General cleanup and usability improvements:
* Aligned the operand field in disassembly.
* Calculate results of immediate values against the PC to make
  position-independent code easier to read  without constantly using a
  calculator (e.g. this shows destinations for call Rd, PC, imm).
* Added more symbols to the UML helper to make logged generated code
  more readable.
* Made single-instruction-per-sequence mode configurable rather than a
  compile-time option.
* Got rid of a criminal amount of copy/paste in the disassembler, and
  got rid of all the deprecated strcpy calls.
* Got rid of some duplicated constants, changed some constants from
  macros to enumerated values or constexpr globals.
* Reduced the amound of stuff in headers that doesn't need to be there.

-cpu/drcbex64.cpp: Don't construct std::function objects during code
 generation - they require allocation.

-eolith/eolith.cpp: Turned single-instruction-per-sequence mode on for
 now until someone works out why turning it off causes Raccoon World to
 generate so much code it's unplayably slow.
2025-03-29 04:56:48 +11:00
Vas Crabb
87dac9299c cpu/e132xs: More recompiler optimisation:
* Optimised double word shifts.
* Optimised the most common PC-relative operations to treat PC as
  constant when possible, including:
  - addi  PC,imm      (long relative branch)
  - add   PC,Rs       (computed goto)
  - sum   Rd,PC,imm   (calculate PC-relative address)
  - add   Rd,PC       (calculate PC-relative address)
  - ldw.d PC,Rs,imm   (PC-relative load)
  - stw.d PC,Rs,imm   (PC-relative store)
* Changed template parameters to LlamaCase to make them more visible
  different to constants/macros.
2025-03-28 18:04:55 +11:00
Vas Crabb
3533b7f79e cpu/e132xs: More recompiler optimisation:
* Disabled single-instruction-per-block mode.
* Don't bother with delay slot checks where it's unnecessary.
* Try to generate a speicalised copy of the delay slot instruction
  followed by a direct branch of possible.
* Use the pre-decoded instruction length for updating the PC.
* Specialised versions of the CHK instruction that always or never
  raise exceptions.
2025-03-27 23:15:45 +11:00
cam900
d48596b042
sound/s_dsp.cpp: Updates/Cleanups (#13488)
* sound/s_dsp.cpp: Fix pitch modulation emulation, Fix save state support

reference: https://snes.nesdev.org/wiki/SNESdev_Wiki

* sound/s_dsp.cpp: Fix indent

* s_dsp.cpp: Reduce unnecessary lines, Fix typenames

* sound/s_dsp.cpp: More std::clamp uses, Use BIT for single bit flags

* sound/s_dsp.cpp: Fix input clock, Fix indent, Use lowercase hexadecimal values, Use reference for voice state

reference: https://snes.nesdev.org/wiki/S-SMP

* sound/s_dsp.cpp: Use logmacro.h for logging, Use BIT for single bit flags
2025-03-26 23:35:51 -04:00
Vas Crabb
128c29c52f cpu/e132xs: More fixes and optimisation:
* Fixed failing to call the debugger instruction hook for the first
  instruction following an interrupt, exception or trap.
* Use UML branches to emulate non-delayed intra-block branches, avoiding
  the expensive "hash jump".
* Re-worked the instruction description code:
  - Calculate static branch targets for more instructions.
  - Flag instructions that may cause mode changes.
  - Don't be so eager to end an instruction sequence.
  - Removed the local register input/output flags - FP may no be the
    same when executing the code as when describing instructions.
* Fixed interpreter incorrectly setting ILC when an interrupt
  immediately follows a RET instruction.
* Fixed recompiler flag calculation regressions, and optimised a little.
2025-03-27 08:07:52 +11:00
Vas Crabb
3b7e214343 cpu/e132xs: Fixed some recompiler cycle counts:
* Fixed double-counting bug in exception dispatch.
* Fixed unsigned comparison of signed values in MUL cycles calculation.
2025-03-26 20:10:55 +11:00
Vas Crabb
81a0a72bda cpu/e132xs: Made debugging Hyperstone E1 software less painful.
* Fixed local register display in debugger (this never worked).
* Made disassembler show local register indices.
2025-03-26 19:11:24 +11:00
Matthew Daniels
d8f21c57f8
scsp: improve handling of MIDI interrupts (#13521) 2025-03-26 08:18:44 +01:00
Vas Crabb
9fd89a456e cpu/e132xs: Call debugger exception hook for TRAP instructions.
Also made cycle counts a bit more consistent between interpreter and
recompiler for exceptions and traps.
2025-03-26 17:58:40 +11:00
AJR
221f40f1b1 i960: Further disassembly fixes
- Enable decoding of a few more reg-type instructions
- Add 0x prefix to unary branch destinations
2025-03-25 21:39:36 -04:00
Vas Crabb
213e1b5857 cpu/e132xs: Moved interrupt check to the beginning of instruction execution.
* Fixes interrupts not being serviced while tracing.
* Further improves recompiler performance.
* Fixes recompiler interrupt check function calling itself recursively.
* Also added debugger exception hook calls to interpreter and recompiler.
2025-03-26 10:06:25 +11:00
angelosa
add2015ce3 machine/i82371sb.cpp: rectify 377e9d6d7d 2025-03-25 18:44:45 +01:00
Vas Crabb
ef974fbdad -cpu/e132xs: Fixes and optimisations:
* Fixed XM (index move) instructions failing to update the destination
  register on range error for interpreter and recompiler.
* Fixed double-word stores when the source indicates SR (both stored
  words are zero) for interpreter and recompiler.
* Fixed recompiler failing to set ILC and P on range error and frame
  error exceptions.
* Optimised recompiled code for word size shifts.
* Pushed more recompiler logic from run-time to code generation time and
  simplified delay slot PC check and trace check logic.
* Use MOV rather than LOAD where possible in recompiler to improve code
  generation performance and symbolic memory locatin names in
  disassembled UML.
* Updated TODO list in header comment, reduced copy/paste some more.

-cpu/drcbex64.cpp: Avoid some more unnecessary register copies for
 ROLAND.
2025-03-26 04:28:09 +11:00
Vas Crabb
76c8864115 cpu/e132xs: Optimised recompiled FRAME instruction.
Also added some more constants so there are a few less magic literals.
2025-03-25 09:04:37 +11:00
AJR
bdee79bc42 i960: Fix disassembly of ADD<cc>, SUB<cc> & SEL<cc> for cc = l, ne, le, o 2025-03-24 14:58:13 -04:00
Vas Crabb
4eed813fa1 cpu/e132xs: Removed leftover block end from a function that no longer generates a standalone block. 2025-03-25 05:05:59 +11:00
Vas Crabb
c13ea3d36b cpu/e132xs, cpu/drcbex64.cpp: More fixes and optimisation:
cpu/e132xs: Implemented supervisor and trace modes as recompiler modes.
This eliminates or simplifies a lot of run-time checks.  In particular,
the trace checks on every instruction are not generated when not
tracing, and simplified to just checking the P bit when tracing.

cpu/e132xs: Optimised code generation for RET, avoid a redundant load
when checking for an overflow trap, use the exception parameter for
exception codes rather than generating one function for each possible
code.  Also simplified interpreter code for RET.

cpu/e132xs: Implemented SUMS for the recompiler.

cpu/e132xs: Implemented privilege check for setting L (interrupt
lockout) for recompiler.  Not implemented for interpreter.

cpu/e132xs: Partially fixed tracing.  P flag should be set by all
instructions except RET.  Trace exceptions are not triggered for
branches when using the recompiler.

cpu/e132xs: Fixed ILC being set incorrectly for RET.

cpu/drcbex64.cpp: Avoid unnecessary expensive operations when a shift
operation request the zero and/or sign flags but not the carry flag.
2025-03-25 03:38:51 +11:00
Vas Crabb
91d9b3cb02 cpu/e132xs: Don't generate code to handle a delayed branch inline.
* Also avoid an redundant load when checking if trace is active.
* Reduces generated native instruction count by about 24% on x86-64 and
  gives an overall performance improvement of about 3.5% in -bench
  scores.
2025-03-24 03:33:04 +11:00
AJR
97467ad077 mn10300: Fix disassembly of ADD Dm, Dn 2025-03-22 20:44:30 -04:00
AJR
7c4cdf37ed mn10300: Fix disassembly of even more move instruction modes 2025-03-22 20:41:24 -04:00
AJR
96688cfe03 mn10300: Re-add missing LSR and ASR modes 2025-03-22 20:32:43 -04:00
AJR
ada8249a07 mn10300: Fix disassembly of yet another move instruction mode 2025-03-22 20:26:18 -04:00
AJR
f96fa09eda mn10300: Fix disassembly of another move instruction mode 2025-03-22 20:19:49 -04:00
AJR
70f8492d7f mn10300: Fix disassembly of some move instruction modes 2025-03-22 20:11:46 -04:00
AJR
e95cdde8e9 unidasm: Add Panasonic MN10300 disassembler 2025-03-22 19:28:42 -04:00
Vas Crabb
297e546844 srcclean the tree. 2025-03-23 05:13:47 +11:00
Vas Crabb
0e2241ef0a cpu/e132xs: Fixed IO2 interrupt check in recompiler.
Also further reduced conditional branches and logic operations in
interrupt check.
2025-03-23 05:04:41 +11:00
Vas Crabb
2e256840ff cpu/e132xs: More recompiler optimisation:
* Made interrupt check function generate far more compact code (about
  85% reduction in number of native instructions on x86-64).
* Optimised out-of-cycles check.
* Applied prior optimisation for trap/interrupt checks to static
  exception checks as well (code is still copy/pasted).
2025-03-23 04:05:02 +11:00
Nigel Barnes
892f944daa machine/psion_ssd.cpp: Don't save state of removable media. 2025-03-21 18:36:14 +00:00
Nigel Barnes
38d2cbaedf machine/psion_asic9.cpp: Improved ASIC9MX RAM configuration to detect 2MB.
psion/psion3a.cpp: Improved LCD palette contrast.
- Series 3mx now uses ASIC9MX to correctly detect 2MB RAM.

psion/siena.cpp: Improved LCD palette contrast.

psion/workabout.cpp: Improved LCD palette contrast.
- Workabout mx now uses ASIC9MX to correctly detect 2MB RAM.
2025-03-21 18:36:14 +00:00
AJR
e3997fb6b2 Revert "i960: don't preserve sign bit when shifting integer left (#13507)"
This reverts commit 5954767b0b.

This was merged way too hastily based on incomplete information.
2025-03-21 14:21:08 -04:00
Matthew Daniels
5954767b0b
i960: don't preserve sign bit when shifting integer left (#13507) 2025-03-21 19:02:43 +01:00
Vas Crabb
3313c37cb3 cpu/e132xs: More recompiler fixes:
* Cleaned up and commented code for generating an exception, reducing
  about nine memory accesses to update SR to two.
* Implemented NEGS, and fixed ADDS and SUBS not setting excption handler
  address.
* Optimised code to update Z flag on logic operations to avoid branches.
* Reduced copy/paste a bit more.
2025-03-22 04:32:22 +11:00
Matthew Daniels
53f391ff5e
v60: implement correct rounding mode when converting float to integer (#13506) 2025-03-21 17:40:22 +01:00
holub
48bdad7ada
z80/z80dasm.cpp: Switched *R (LDIR, OTIR, etc) debugger flag to STEP_OVER (#13451) 2025-03-21 11:29:39 +01:00
Vas Crabb
17cd39bb4c cpu/e132xs, cpu/drcbex64.cpp: Recompiler fixes and optimisations:
cpu/e132xs.cpp: Refactored code generation to improve performance and
fixed some issues:
* Moved a considerable amound of logic from execution time to code
  generation time.
* Fixed some cases where add/subtract carry was being interpreted
  incorrectly.
* Fixed a case where a load double intruction was incorrectly writing
  the same register twice.
* Use UML flags to generate condition codes for addition/subtraction.
* Use UML carry flag for carry-/borrow-in.
* Reduced UML register pressure (improves performance for hosts with
  fewer callee-saved CPU registers).
* Moved more logic to helper functions to simplify maintenance.

cpu/drcbex64.cpp: Fixed upper bits of UML registers being cleared when
used as address offset for LOAD/STORE.

cpu/drcbex64.cpp: Don't do expensive zero/sign flag update for shift
operations if only carry flag will be used.

cpu/drcbex64.cpp: Reduced copy/paste in READ[M]/WRITE[M] generators.
2025-03-21 17:56:15 +11:00
Matthew Daniels
5363907b72
Write the results of an ALU operation before writing to register/memory (#13486)
Sega Rally has an instruction that calculates d += p and loads a value into d at the same time; it is the loaded value that should be used, not the result of the ALU operation

Also only test the d register when performing an ALU operation
2025-03-20 22:17:38 +01:00
ffxx68
8c3d05ed50
fixing cpu for missing opcode (#13502) 2025-03-20 17:07:39 +01:00
Mark Garlanger
adcf81c34c
[heathzenith/h8.cpp] Update interrupt handling to not use set_input_line_and_vector (#13492)
* [heathzenith/h8.cpp] Update interrupt handling to not use set_input_line_and_vector

* Fix include guards for moved header file
2025-03-20 15:42:29 +01:00
Patrick Mackinlay
d34540af25 mips/mips1: remove embedded syscall logging 2025-03-20 13:05:40 +07:00
Vas Crabb
3ad89ebbc7 Some relatively simple recompiler optimisations:
cpu/drcbex64.cpp: Avoid a lot of unnecessary flag manipulation on
shift/rotate operations.  Don't calculate flags when not requested.
Don't preserve carry in for operations that don't use it as an input.

cpu/drcbex64.cpp: Avoid loading CL when ECX can be used.  Loading CL
doesn't clear the upper bits, so it depends on the previous value of
RCX, causing pipeline dependencies.  Loading ECX can grab a fresh rename
register.

cpu/drcbearm64.cpp: Attempt more optimisation on one more load immediate
operation.

cpu/e132xs: Get rid of a redundant TEST - ROLAND can set the Z flag.
2025-03-20 15:00:40 +11:00
AJR
3fed48aedd m16c: Fix disassembly syntax for adjnz/sbjnz 2025-03-19 15:46:12 -04:00
Vas Crabb
9e6036be2d -More DRC fixes/improvements:
* cpu/uml.cpp: Handle some more cases where ROLAND can be turned into
  AND in the simplifier.
* cpu/drcbearm.cpp, cpu/drcbex64.cpp: Fixed a number of cases where
  4-byte operations wouldn't clear the upper half of the destination
  (there are plenty more of these caused by the simplifier that will be
  harder to fix).
* cpu/drcbearm64.cpp: Fixed some cases where a conditional MOV could
  unexpectedly clear the upper bits of the destination.
* cpu/drcbex64.cpp: Improved code generation for various arithmetic and
  logical operations.  More AND/OR/XOR/ADD/ADDC operand combinations are
  optimised.  Special cases of ROLAND/ROLINS are optimised.
* cpu/drcbex64.cpp: Don't treat operands to FADD/FMUL as commutative.
  This isn't true when one is a NaN.

-cpu/e132xs: Use osd_printf_error for diagnositc output, and make more
 local variables const.
2025-03-20 03:27:08 +11:00
hap
7da0fa53ec tea1002: fix compile 2025-03-19 17:18:59 +01:00