Commit graph

42 commits

Author SHA1 Message Date
bebbo
369f2e57f1 reported cycle count is bogus 2024-02-03 21:24:26 +01:00
Poul-Henning Kamp
91878a8c8f Add void argument to make these proper prototypes 2021-08-15 06:58:45 +00:00
Poul-Henning Kamp
0d5b364b78 Update cpu-name table to match the enum in m68k.h 2021-08-15 06:42:39 +00:00
Mateusz Kramarczyk
40e8cea1a4 Fix compile errors. 2020-06-13 15:09:11 +02:00
Karl Stenerud
6f04ba062e
Merge pull request #53 from zelurker/master
big fpu update
2019-12-15 08:35:14 +01:00
R. Belmont
7a934a8506 680x0 FPU updates [R. Belmont]
- Rewritten to use SoftFloat instead of unportable native FP math
 - Support added for Motorola 96-bit extended floats
 - More addressing modes and conditions supported

The taitojc games function identically to the old implementation (I stepped
through the main matrix multiply in dendeg and the registers never diverged)
and speed on Core 2 Duo is a wash - sometimes softfloat's faster, sometimes
not, but the difference on -str 90 never exceeded 1%.
2019-12-14 13:14:18 +01:00
Karl Stenerud
710f795aaf
Merge pull request #52 from zelurker/master
the pmmu emulation
2019-12-13 20:00:27 +01:00
Emmanuel Anne
7efac187bd follow mame choice again
m68kmmu.h uses functions from m68kfpu.c which are static, so m68kfpu.c
can't be compiled alone anymore if we want to keep some basic
compatibility... I know, it's not super clean, but it's not my
choice...!
Also pmmu_translate_addr can't be inline anymore because of this (there
are quite a few functions from m68kcpu.h using it, and it can be
included only in m68kcpu.c !)
2019-12-13 13:40:42 +01:00
R. Belmont
530f644bd3 MC680x0 update
- Reworked PMMU/core interface so PMMU now sees all cop 0 instructions
 - Improved disassembly of PMMU instructions
 - Preliminary 68LC040 support
 - Fixed disassembly for EC/LC variants of '030/'040
2019-12-13 13:40:05 +01:00
Karl Stenerud
556c574387
Merge pull request #51 from zelurker/master
2 fixes for the previous patches
2019-12-13 09:40:46 +01:00
R. Belmont
d5576b3797 m680x0 update:
- Added working PMMU address translation (not feature complete, but sufficient
  to boot several 68030 Macs in MESS)
- Fixed up disassembly of some PMMU instructions
- Added "68020 with 68851" CPU type
2019-12-12 17:34:22 +01:00
Emmanuel Anne
8126887721 move the reset_cycles to the cpu context 2019-12-12 10:41:54 +01:00
Karl Stenerud
0d60cea0e3
Merge pull request #50 from zelurker/master
a new set of patches from mame !
2019-12-12 09:46:07 +01:00
R. Belmont
29825f54a8 M680x0 update
- Add CPU types 68EC030, 68030, and 68EC040
- Start of 030/040 PMMU, including stubbed PMOVE
2019-12-12 00:08:26 +01:00
Ryan Holtz
fd717a418f Don't mention in whatsnew - puts the BSD optimization back in. 2019-12-11 19:31:08 +01:00
Ryan Holtz
6155d7171f Fleshed out SCC68070 definition in m68k core, for CD-i use in MESS [Harmony] 2019-12-11 19:22:30 +01:00
R. Belmont
093d69d650 m68k: don't save signal contexts on *BSD and Mac OS X [scarlet, R. Belmont] 2019-12-11 19:09:19 +01:00
Angelo Salese
8e00fcdbae Added very basic SCC68070 implementation, currently is just a basic m68k with 32-bits of address lines.
The plan is to add the on-chip peripherals on the magicard.c driver then, when I get some consistency, hardwire it to the cpu core.

Please check this modification asap (should be fine, but I haven't compiled with a clean build)
2019-12-11 18:50:34 +01:00
Aaron Giles
6eb0d06b89 CPUs actually take some time to reset. Changed the 68000/68010 to eat an appropriate number of cycles after a reset. 2019-12-11 17:07:03 +01:00
Philip Pemberton
27787fbad6 remove unused m68ki_bus_error_return_jmp_buf 2019-11-27 16:26:52 +00:00
Philip Pemberton
3a2c230e22 add missing int i 2019-11-27 16:09:33 +00:00
Philip Pemberton
8143681fd8 add bus error emulation 2019-11-27 16:06:53 +00:00
Karl Stenerud
8266fbe873 Removed INLINE and replaced it with static inline because it's part of the spec since c9x.
Beefed up the warnings and cleared them up.
m68kfpu.c is no longer included by m68kcpu.c.
Removed a bunch of internal function forward declarations, except for those used by macros.
Converted CRLF line endings to LF.
2019-11-03 19:33:07 +01:00
Emmanuel Anne
241d1ef7f0 illegal instruction callback 2019-09-06 13:48:36 +02:00
Emmanuel Anne
2c0f575be8 from dgen fix M68K_REG_SR handling in m68k_set_reg()
m68k_set_reg() is used to set registers to a given value. Modifying the
status register should not check for interrupts and especially not update
the stack pointer.

Fixes various freezes happening when loading save states or cycling between
CPU emulators.
2019-09-05 12:07:37 +02:00
Aaron Giles
f0d95c3dee Fixed handling of interrupts when the CPU was in the STOP state. 2019-09-05 06:09:45 +02:00
Aaron Giles
0a75e6e85e Changed 68000 interrupts to only trigger during execution.
This means that multiple changes without any execution will be seen as atomic. It also means that PULSE_LINE no longer works for signalling IRQs.

Added checks in the debug build to catch people who try to use
PULSE_LINE for non-NMI and non-RESET input lines on CPUs that no
longer support direct interrupt generation. Over time expect this
list to increase.
2019-09-05 05:59:47 +02:00
Aaron Giles
5d9df94233 Fix m68k irq line support.
Before this patch a:
      cpunum_set_input_line(5, ASSERT_LINE);
      cpunum_set_input_line(3, ASSERT_LINE);
      cpunum_set_input_line(3, CLEAR_LINE);

    loses the state of line 5.  This patch fixes it by adding an explicit
    but optional "virtual irq line" support to the 68k interface.

    Fix m68k interrupt handling by some drivers.

    Clearing the NMI line to clear all the IRQ lines worked, but it just
    doesn't make sense.  Now that the irq lines are really independant,
    the handling can be simplified.
2019-09-05 05:55:21 +02:00
Emmanuel Anne
b2ed988978 mame123: const, formating, and fix for reset instruction 2019-09-04 23:50:18 +02:00
Emmanuel Anne
25e031e169 mame120: version update to 3.31 2019-09-04 23:21:26 +02:00
Emmanuel Anne
bb4ca57463 mame115: u/sint32 definition update, movec for 040 2019-09-04 23:08:15 +02:00
Emmanuel Anne
abc09c9056 cmpild, tas and rte callbacks (mame110) 2019-09-04 22:45:50 +02:00
Emmanuel Anne
a9a9bba50b fpu emulation mainly (from mame98 to mame106)
I removed the mame specific stuff from m68kfpu.c to make it portable
again
2019-09-04 21:15:31 +02:00
Emmanuel Anne
de46c037cb mame098: support for 68040 ! 2019-09-04 19:05:11 +02:00
Derek Fawcus
3ae92a7166 Correct file modes
A number of non executable files had the execute bit set,
so clear it.
2018-07-13 18:47:16 +01:00
George Koehler
3368bed368 Remove extra #include <stdio.h> to fix uint
There was a conflict between Musahi's uint and OpenBSD's uint:

    $ cc -o m68kmake m68kmake.c
    $ ./m68kmake
    $ cc -DM68K_COMPILE_FOR_MAME=0 -c m68kcpu.c
    In file included from m68kcpu.c:565:
    In file included from /usr/include/stdio.h:46:
    /usr/include/sys/types.h:58:22: error: cannot combine with previous 'int'
          declaration specifier
    typedef unsigned int    uint;           /* Sys V compatibility */
                            ^
    ./m68kcpu.h:75:25: note: expanded from macro 'uint'
    #define uint   unsigned int
                            ^
    1 error generated.
2018-06-09 16:30:52 -04:00
Martin Hellspong
83c920e893 Fix unimplemented instruction cycles
According to the M68000UM, the two unimplemented instruction exceptions
both cost 34 cycles, not 4.

Actually, that's a bit of a lie. Table 8-14. Exception Processing
Execution Times does not even mention unimplemented instruction
exceptions, but section 6.3.6 Illegal and Unimplemented Instructions
basically says that unimplemented instructions are just a special case
of illegal instructions in that they have separate exception vectors.
2016-04-27 23:58:57 +02:00
Karl Stenerud
fe6a4b2caf Merge pull request #15 from marhel/reset-instr-mode
Reset CPU_INSTR_MODE in m68k_pulse_reset
2016-03-08 14:04:50 -08:00
Martin Hellspong
f8cd2487f5 Reset CPU_INSTR_MODE in m68k_pulse_reset
Or resetting when CPU_INSTR_MODE is set to INSTRUCTION_NO affects what
is pushed by address errors even after calling m68k_init,
m68k_set_cpu_type, and m68k_pulse_reset.
2016-03-08 21:59:22 +01:00
Martin Hellspong
72d5f81103 Fix incorrect Scc cycle count
The Scc instruction with a register operand takes two extra cycles when
the condition is true, on the 68000. On the 010/020 there are no such
penalty.
2016-03-08 21:58:34 +01:00
Karl Stenerud
09e885364e Convert CD to LF so that m68kmake doesn't choke in unix. 2014-07-02 07:30:56 -07:00
Karl Stenerud
ecaf821d8f Version 3.4 2013-07-15 15:46:55 -07:00