Commit graph

149 commits

Author SHA1 Message Date
Karl Stenerud
2158f70810
Merge pull request #105 from bebbo/p4
implement and fix some fpu instructions
2024-02-08 10:14:42 +01:00
Karl Stenerud
0902af7aab
Merge pull request #104 from bebbo/p3
add fdmoved to the disassembler
2024-02-08 10:12:30 +01:00
Karl Stenerud
dc4ac26cd9
Merge pull request #103 from bebbo/p2
reported cycle count is bogus
2024-02-08 10:12:06 +01:00
Karl Stenerud
5708b9211d
Merge pull request #102 from bebbo/master
fix cycles for shift and mul
2024-02-08 10:11:32 +01:00
bebbo
ffdd51b18a implement and fix some fpu instructions 2024-02-03 21:32:57 +01:00
bebbo
ca418a4d61 add to the disassembler 2024-02-03 21:29:24 +01:00
bebbo
369f2e57f1 reported cycle count is bogus 2024-02-03 21:24:26 +01:00
bebbo
7ec87cd98a fix cycles for shift and mul 2024-02-03 21:18:59 +01:00
Karl Stenerud
fc7a6fc602
Merge pull request #80 from bsdphk/master
Minor fixes to keep modern compilers happy
2021-08-16 08:16:03 +02:00
Poul-Henning Kamp
7bb99d700c Add missing prototypes 2021-08-15 07:01:59 +00:00
Poul-Henning Kamp
5f08834807 Make diagnostic functions take const char * arguments. 2021-08-15 07:01:12 +00: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
Poul-Henning Kamp
5a98127e53 Add a missing comma 2021-08-15 06:42:18 +00:00
Karl Stenerud
d0ab9ace32
Merge pull request #78 from agentbooth/master
fix for Freebee emulator
2021-07-29 06:19:06 +02:00
shadyjesse
df4d10b9cb allow bus error to occur when already exception handling a bus error (fixes page fault within a page fault in Freebee emulator) 2021-07-22 18:06:08 -04:00
Karl Stenerud
9494c3be62 Update example readme since it was getting horribly out of date 2021-06-24 09:10:32 +02:00
Karl Stenerud
2b85f48031 Add symlink to softfloat so that example app can compile 2021-06-24 08:47:05 +02:00
Karl Stenerud
66d00ece8a
Merge pull request #75 from lleoha/fix-compile-errors
Fix compile errors.
2020-06-14 10:40:13 +02:00
Mateusz Kramarczyk
40e8cea1a4 Fix compile errors. 2020-06-13 15:09:11 +02:00
Karl Stenerud
8d0d7bb3b5
Merge pull request #74 from jotd666/master
misc instructions fixes & additions
2020-06-10 08:30:19 +02:00
jotd
8541cd65d5 fscc instruction: added (disp,Ax) mode 2020-06-09 23:13:45 +02:00
jotd
8633295412 in m68k_in.c
- fixed all CHK2/CMP2 instructions to support signed bounds. Previously it only worked with unsigned. Also sped up a bit
  by changing | by || in Z evaluation formula
- cptrapcc opcodes are still unsupported, but if no exception occurs, at least PC is properly updated
- trapt/trapcc 16 & 32 instructions: PC is updated before exception is triggered (or if exception isn't triggered). This fixes the
  return address value (just in case code returns from trap with RTE) and also the stackframe (XDAda 68040 compiler
  read the data parameter to check exception type, wrong exception type is read if stackframe is incorrect)

in m68kfpu.c

- fatalerror message fprintf => vfprintf
- added address register + displacement mode (mode 5, READ_EA_FPE/WRITE_EA_FPE), also changed prototype to it can be called with this mode
  from FMOVEM loop
- added immediate mode (READ_EA_FPE)
- fpgen_rm_reg (FMOVE to register): added a lot of missing condition code update (SET_CONDITION_CODES(REG_FP[dst]))
- added FSDIVS and FSMULS (easy as it's the same case as FDIV and FMUL). Updated condition codes for FDIV
- fmove_fpcr: connected softfloat 4 rounding modes to this instruction, that didn't set rounding at all, when it's
  perfectly emulated in softfloat module (just added:  float_rounding_mode = (REG_FPCR >> 4) & 0x3;)
- fmovem: added address register+displacement mode (READ_EA_FPE/WRITE_EA_FPE interface had to be changed)
- added FScc instruction
- note: number of cycles for the added instructions isn't exact
2020-06-07 11:45:28 +02:00
jotd
3b8e84fd83 m68k_in.c:
- fixed all CHK2/CMP2 instructions to support signed bounds. Previously it only worked with unsigned. Also sped up a bit
  by changing | by || in Z evaluation formula
- cptrapcc opcodes are still unsupported, but if no exception occurs, at least PC is properly updated
- trapt/trapcc 16 & 32 instructions: PC is updated before exception is triggered (or if exception isn't triggered). This fixes the
  return address value (just in case code returns from trap with RTE) and also the stackframe (XDAda 68040 compiler
  read the data parameter to check exception type, wrong exception type is read if stackframe is incorrect)

m68kfpu.c:

- fatalerror message fprintf => vfprintf
- added address register + displacement mode (mode 5, READ_EA_FPE/WRITE_EA_FPE), also changed prototype to it can be called with this mode
  from FMOVEM loop
- added immediate mode (READ_EA_FPE)
- fpgen_rm_reg (FMOVE to register): added a lot of missing condition code update (SET_CONDITION_CODES(REG_FP[dst]))
- added FSDIVS and FSMULS (easy as it's the same case as FDIV and FMUL). Updated condition codes for FDIV
- fmove_fpcr: connected softfloat 4 rounding modes to this instruction, that didn't set rounding at all, when it's
  perfectly emulated in softfloat module (just added:  float_rounding_mode = (REG_FPCR >> 4) & 0x3;)
- fmovem: added address register+displacement mode (READ_EA_FPE/WRITE_EA_FPE interface had to be changed)
- added FScc instruction
- note: number of cycles for the added instructions isn't exact
2020-06-06 14:41:52 +02:00
Karl Stenerud
8784597791 Clean up GCC compiler warnings.
Fixes #39
2020-05-27 06:22:41 +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
de395aa3de M68k: Add more conditionals and FGETEXP instruction [R. Belmont] 2019-12-14 15:11:55 +01:00
Emmanuel Anne
d1fd51f474 Makefile: add some m68kcpu.c dependancies 2019-12-14 15:07:13 +01:00
R. Belmont
3db368e052 m680x0 FPU updates: [R. Belmont]
- BCD packed decimal now supported, including k-factor
 - Improved FSAVE/FRESTORE including FPU reset when restoring a NULL frame
 - FREM instruction supported
 - Better disassembly of FPU instructions
2019-12-14 15:06:35 +01:00
R. Belmont
3ec8f605b4 680x0 FPU update: [R. Belmont]
- Implemented FMOVECR
 - Added load extended PC relative indexed support
 - Cleanup some duplicated code
2019-12-14 14:38: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
R. Belmont
4cbdf6bb2f 680x0: Improve disassembly for various FMOVE forms [R. Belmont] 2019-12-14 09:14:43 +01:00
R. Belmont
8e1710d0f7 Properly show 32-bit displacement for 020+ A reg relative [R. Belmont] 2019-12-14 09:11:14 +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
Emmanuel Anne
3639c27e9c move the pmmu translation from ADDRESS_68K to the _fc functions
too dangerous in the ADDRESS_68K macro, this thing must be called only
once by address.
2019-12-13 11:41:40 +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
50baa65d4c 680x0 update: - Support PMOVE modes from PMMU - Allow the FPU to be used for both '030 and '040 - Add byte and word FPU loads/stores - Fixed buggy FPU 64-bit stores in the (An) addressing mode
If anyone has any ideas on how to sanely handle the 68k FPU's 96-bit "take
that, Intel" mode let me know ;-)
2019-12-12 21:24:43 +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
414590fc75 m68k: throw F-line trap correctly when PMMU instructions are hit on non-equipped CPUs. 2019-12-12 09:26:19 +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
R. Belmont
af456894d5 m68k: disassemble PMOVE instruction (move to/from PMMU) 2019-12-11 20:09:25 +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