Skip to content

Commit

Permalink
core, fix 68k cycles in cyclone,fame (exceptions,bit ops,ADDI.L,TAS,C…
Browse files Browse the repository at this point in the history
…HK,MUL*,DIV*)

also syncs these changes between fame and cyclone

in accordance with the test_inst_speed, available here:
https://gendev.spritesmind.net/forum/viewtopic.php?t=3321
DIV* is only closely approximated, it can be slightly on the high side.
  • Loading branch information
irixxxx committed Mar 7, 2024
1 parent 02d5786 commit 3f59182
Show file tree
Hide file tree
Showing 4 changed files with 438 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/irixxxx/libpicofe.git
[submodule "cpu/cyclone"]
path = cpu/cyclone
url = https://github.com/notaz/cyclone68000.git
url = https://github.com/irixxxx/cyclone68000.git
[submodule "pico/sound/emu2413"]
path = pico/sound/emu2413
url = https://github.com/digital-sound-antiques/emu2413.git
Expand Down
2 changes: 1 addition & 1 deletion cpu/cyclone
Submodule cyclone updated 4 files
+12 −3 Main.cpp
+31 −16 OpArith.cpp
+2 −2 OpBranch.cpp
+26 −9 OpLogic.cpp
13 changes: 9 additions & 4 deletions cpu/fame/famec.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
// internals core macros
/////////////////////////

// helper macros
#define BITCOUNT(r,v) \
(r = (v) - (((v)>>1)&0x55555555), r = (r&0x33333333) + ((r>>2)&0x33333333), \
r = (((r + (r>>4))&0x0f0f0f0f) * 0x01010101)>>24)

#define XB MEM_LE4(0)
#define XW MEM_LE2(0)

Expand Down Expand Up @@ -525,13 +530,13 @@ static const s32 exception_cycle_table[256] =
50, // 2: Bus Error
50, // 3: Address Error
34, // 4: Illegal Instruction
38, // 5: Divide by Zero
40, // 6: CHK
34, // 5: Divide by Zero
34, // 6: CHK
34, // 7: TRAPV
34, // 8: Privilege Violation
34, // 9: Trace
4, // 10:
4, // 11:
34, // 10: Line A
34, // 11: Line F
4, // 12: RESERVED
4, // 13: Coprocessor Protocol Violation
4, // 14: Format Error
Expand Down
Loading

0 comments on commit 3f59182

Please sign in to comment.