Skip to content

Commit

Permalink
Moved Cave drivers and devices to atlus project and a new cave projec…
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa authored and stonedDiscord committed Apr 8, 2024
1 parent 00beed0 commit 44db97f
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 148 deletions.
22 changes: 0 additions & 22 deletions scripts/src/video.lua
Expand Up @@ -247,28 +247,6 @@ if (VIDEOS["EF9365"]~=null) then
}
end

--------------------------------------------------
--@src/devices/video/epic12.h,VIDEOS["EPIC12"] = true
--------------------------------------------------

if (VIDEOS["EPIC12"]~=null) then
files {
MAME_DIR .. "src/devices/video/epic12.cpp",
MAME_DIR .. "src/devices/video/epic12.h",
MAME_DIR .. "src/devices/video/epic12_blit0.cpp",
MAME_DIR .. "src/devices/video/epic12_blit1.cpp",
MAME_DIR .. "src/devices/video/epic12_blit2.cpp",
MAME_DIR .. "src/devices/video/epic12_blit3.cpp",
MAME_DIR .. "src/devices/video/epic12_blit4.cpp",
MAME_DIR .. "src/devices/video/epic12_blit5.cpp",
MAME_DIR .. "src/devices/video/epic12_blit6.cpp",
MAME_DIR .. "src/devices/video/epic12_blit7.cpp",
MAME_DIR .. "src/devices/video/epic12_blit8.cpp",
MAME_DIR .. "src/devices/video/epic12in.hxx",
MAME_DIR .. "src/devices/video/epic12pixel.hxx",
}
end

--------------------------------------------------
--
--@src/devices/video/fixfreq.h,VIDEOS["FIXFREQ"] = true
Expand Down
3 changes: 3 additions & 0 deletions src/mame/misc/cave.cpp → src/mame/atlus/cave.cpp
Expand Up @@ -46,6 +46,9 @@ Year + Game License PCB Tilemaps Sprites
To Do:
- Modernize state objects for each PCB sub-variant, rename to something more
apt than "cave_state";
- Sprite lag in some games (e.g. metmqstr). The sprites chip probably
generates interrupts (unknown_irq)
Expand Down
6 changes: 3 additions & 3 deletions src/mame/misc/cave.h → src/mame/atlus/cave.h
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
#ifndef MAME_MISC_CAVE_H
#define MAME_MISC_CAVE_H
#ifndef MAME_ATLUS_CAVE_H
#define MAME_ATLUS_CAVE_H

#pragma once

Expand Down Expand Up @@ -391,4 +391,4 @@ class ppsatan_state : public cave_state
void ppsatan_map(address_map &map);
};

#endif // MAME_MISC_CAVE_H
#endif // MAME_ATLUS_CAVE_H
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions src/mame/misc/cv1k.cpp → src/mame/cave/cv1k.cpp
Expand Up @@ -190,12 +190,13 @@ Timing

#include "emu.h"

#include "epic12.h"

#include "cpu/sh/sh3comn.h"
#include "cpu/sh/sh4.h"
#include "machine/nandflash.h"
#include "machine/rtc9701.h"
#include "sound/ymz770.h"
#include "video/epic12.h"

#include "screen.h"
#include "speaker.h"
Expand Down Expand Up @@ -945,9 +946,10 @@ ROM_END

uint64_t cv1k_state::speedup_r()
{
offs_t pc = m_maincpu->pc();
const offs_t pc = m_maincpu->pc();

if (pc == m_idlepc || pc == m_idlepc + 2) m_maincpu->spin_until_time(attotime::from_usec(10));
if (pc == m_idlepc || pc == m_idlepc + 2)
m_maincpu->spin_until_time(attotime::from_usec(10));

return m_ram[m_idleramoffs / 8];
}
Expand Down
17 changes: 5 additions & 12 deletions src/devices/video/epic12.cpp → src/mame/cave/epic12.cpp
Expand Up @@ -129,7 +129,7 @@ void epic12_device::device_reset()
m_blitter_busy = 0;
}

// todo, get these into the device class without ruining performance
// TODO: get these into the device class without ruining performance
u8 epic12_device::colrtable[0x20][0x40];
u8 epic12_device::colrtable_rev[0x20][0x40];
u8 epic12_device::colrtable_add[0x20][0x20];
Expand Down Expand Up @@ -727,7 +727,7 @@ void epic12_device::gfx_create_shadow_copy(address_space &space)
}


void epic12_device::gfx_exec(void)
void epic12_device::gfx_exec()
{
offs_t addr = m_gfx_addr_shadowcopy & 0x1fffffff;
m_clip.set(m_gfx_clip_x_shadowcopy - EP1C_CLIP_MARGIN, m_gfx_clip_x_shadowcopy + 320 - 1 + EP1C_CLIP_MARGIN,
Expand Down Expand Up @@ -865,7 +865,6 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
int scroll_x = -m_gfx_scroll_x;
int scroll_y = -m_gfx_scroll_y;


#if DEBUG_VRAM_VIEWER
if (m_debug_vram_view_en)
copybitmap(bitmap, *m_bitmaps, 0, 0, 0, 0, cliprect);
Expand Down Expand Up @@ -942,14 +941,8 @@ void epic12_device::install_handlers(int addr1, int addr2)
{
address_space &space = m_maincpu->space(AS_PROGRAM);

read32s_delegate read(*this);
write32_delegate write(*this);

read = read32s_delegate(*this, FUNC(epic12_device::blitter_r));
write = write32_delegate(*this, FUNC(epic12_device::blitter_w));

space.install_read_handler(addr1, addr2, std::move(read), 0xffffffffffffffffU);
space.install_write_handler(addr1, addr2, std::move(write), 0xffffffffffffffffU);
space.install_read_handler(addr1, addr2, emu::rw_delegate(*this, FUNC(epic12_device::blitter_r)), 0xffffffffffffffffU);
space.install_write_handler(addr1, addr2, emu::rw_delegate(*this, FUNC(epic12_device::blitter_w)), 0xffffffffffffffffU);
}

u64 epic12_device::fpga_r()
Expand Down Expand Up @@ -977,7 +970,7 @@ void epic12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask)
if (m_firmware_pos == 2323240)
{
u8 checksum = 0;
for(u8 c : m_firmware)
for (u8 c : m_firmware)
checksum += c;

switch (checksum)
Expand Down
8 changes: 4 additions & 4 deletions src/devices/video/epic12.h → src/mame/cave/epic12.h
@@ -1,8 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:David Haywood, Luca Elia, MetalliC
/* emulation of Altera Cyclone EPIC12 FPGA programmed as a blitter */
#ifndef MAME_VIDEO_EPIC12_H
#define MAME_VIDEO_EPIC12_H
#ifndef MAME_CAVE_EPIC12_H
#define MAME_CAVE_EPIC12_H

#pragma once

Expand Down Expand Up @@ -58,7 +58,7 @@ class epic12_device : public device_t, public device_video_interface
inline void gfx_draw_shadow_copy(address_space &space, offs_t *addr);
inline void gfx_upload(offs_t *addr);
inline void gfx_draw(offs_t *addr);
void gfx_exec(void);
void gfx_exec();
u32 gfx_ready_r();
void gfx_exec_w(address_space &space, offs_t offset, u32 data, u32 mem_mask = ~0);

Expand Down Expand Up @@ -890,4 +890,4 @@ class epic12_device : public device_t, public device_video_interface

DECLARE_DEVICE_TYPE(EPIC12, epic12_device)

#endif // MAME_VIDEO_EPIC12_H
#endif // MAME_CAVE_EPIC12_H
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 44db97f

Please sign in to comment.