summaryrefslogtreecommitdiffstats
path: root/src/mame/includes/amiga.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/amiga.h')
-rw-r--r--src/mame/includes/amiga.h101
1 files changed, 53 insertions, 48 deletions
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 532bbe6341d..43432720cbb 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -28,24 +28,6 @@ Ernesto Corvi & Mariusz Wojcieszek
#include "screen.h"
-/*************************************
- *
- * Debugging
- *
- *************************************/
-
-#define LOG_COPPER 0
-#define GUESS_COPPER_OFFSET 0
-#define LOG_SPRITE_DMA 0
-
-/* A bit of a trick here: some registers are 32-bit. In order to efficiently */
-/* read them on both big-endian and little-endian systems, we store the custom */
-/* registers in 32-bit natural order. This means we need to XOR the register */
-/* address with 1 on little-endian systems. */
-#define CUSTOM_REG(x) (state->m_custom_regs[BYTE_XOR_BE(x)])
-#define CUSTOM_REG_SIGNED(x) ((int16_t)CUSTOM_REG(x))
-#define CUSTOM_REG_LONG(x) (*(uint32_t *)&state->m_custom_regs[x])
-
/*
A = Angus
D = Denise
@@ -321,12 +303,6 @@ Ernesto Corvi & Mariusz Wojcieszek
#define MAX_PLANES 6 /* 0 to 6, inclusive ( but we count from 0 to 5 ) */
-// chipset
-#define IS_OCS(state) (state->m_denise_id == 0xff)
-#define IS_ECS(state) (state->m_denise_id == 0xfc)
-#define IS_AGA(state) (state->m_denise_id == 0xf8)
-
-
class amiga_state : public driver_device
{
public:
@@ -415,9 +391,7 @@ public:
uint16_t m_copper_waitmask;
uint16_t m_copper_pending_offset;
uint16_t m_copper_pending_data;
-#if GUESS_COPPER_OFFSET
int m_wait_offset;
-#endif
/* playfield states */
int m_last_scanline;
@@ -442,8 +416,6 @@ public:
DECLARE_VIDEO_START( amiga_aga );
DECLARE_PALETTE_INIT( amiga );
- void render_scanline(bitmap_ind16 &bitmap, int scanline);
- void aga_render_scanline(bitmap_rgb32 &bitmap, int scanline);
uint32_t screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void update_screenmode();
@@ -514,8 +486,6 @@ public:
uint16_t m_agnus_id;
uint16_t m_denise_id;
- uint16_t m_custom_regs[256];
-
void custom_chip_w(uint16_t offset, uint16_t data, uint16_t mem_mask = 0xffff)
{
custom_chip_w(m_maincpu->space(AS_PROGRAM), offset, data, mem_mask);
@@ -524,6 +494,14 @@ public:
void blitter_setup();
protected:
+ // A bit of a trick here: some registers are 32-bit. In order to efficiently
+ // read them on both big-endian and little-endian systems, we store the custom
+ // registers in 32-bit natural order. This means we need to XOR the register
+ // address with 1 on little-endian systems.
+ uint16_t &CUSTOM_REG(offs_t x) { return m_custom_regs[BYTE_XOR_BE(x)]; }
+ int16_t &CUSTOM_REG_SIGNED(offs_t x) { return (int16_t &)CUSTOM_REG(x); }
+ uint32_t &CUSTOM_REG_LONG(offs_t x) { return *(uint32_t *)&m_custom_regs[x]; }
+
// agnus/alice chip id
enum
{
@@ -547,6 +525,11 @@ protected:
LISA = 0x00f8
};
+ // chipset
+ bool IS_OCS() const { return m_denise_id == 0xff; }
+ bool IS_ECS() const { return m_denise_id == 0xfc; }
+ bool IS_AGA() const { return m_denise_id == 0xf8; }
+
// driver_device overrides
virtual void machine_start() override;
virtual void machine_reset() override;
@@ -607,7 +590,45 @@ protected:
int m_cia_0_irq;
int m_cia_1_irq;
+ uint16_t m_custom_regs[256];
+ static const char *const s_custom_reg_names[0x100];
+
private:
+ // blitter helpers
+ uint32_t blit_ascending();
+ uint32_t blit_descending();
+ uint32_t blit_line();
+
+ // video helpers
+protected:
+ void set_genlock_color(uint16_t color);
+private:
+ void copper_setpc(uint32_t pc);
+ int copper_execute_next(int xpos);
+ void sprite_dma_reset(int which);
+ void sprite_enable_comparitor(int which, int enable);
+ void fetch_sprite_data(int scanline, int sprite);
+ void update_sprite_dma(int scanline);
+ uint32_t interleave_sprite_data(uint16_t lobits, uint16_t hibits);
+ int get_sprite_pixel(int x);
+ uint8_t assemble_odd_bitplanes(int planes, int ebitoffs);
+ uint8_t assemble_even_bitplanes(int planes, int ebitoffs);
+ void fetch_bitplane_data(int plane);
+ int update_ham(int newpix);
+ void update_display_window();
+ void render_scanline(bitmap_ind16 &bitmap, int scanline);
+
+ // AGA video helpers
+ void aga_palette_write(int color_reg, uint16_t data);
+ void aga_fetch_sprite_data(int scanline, int sprite);
+ void aga_render_scanline(bitmap_rgb32 &bitmap, int scanline);
+ void aga_update_sprite_dma(int scanline);
+ int aga_get_sprite_pixel(int x);
+ uint8_t aga_assemble_odd_bitplanes(int planes, int obitoffs);
+ uint8_t aga_assemble_even_bitplanes(int planes, int ebitoffs);
+ void aga_fetch_bitplane_data(int plane);
+ rgb_t aga_update_ham(int newpix);
+
enum
{
TIMER_SCANLINE,
@@ -641,6 +662,8 @@ private:
SERPER_LONG = 0x8000 // 9-bit mode
};
+ static const uint16_t s_expand_byte[256];
+
// pot counters
int m_pot0x, m_pot1x, m_pot0y, m_pot1y;
@@ -660,7 +683,6 @@ private:
// display window
rectangle m_diw;
bool m_diwhigh_valid;
- void update_display_window();
bool m_previous_lof;
bitmap_ind16 m_flickerfixer;
@@ -685,23 +707,6 @@ private:
uint32_t amiga_gethvpos();
};
-
-/*----------- defined in machine/amiga.c -----------*/
-
-extern const char *const amiga_custom_names[0x100];
-
-
-/*----------- defined in video/amiga.c -----------*/
-
-extern const uint16_t amiga_expand_byte[256];
-
-void amiga_copper_setpc(running_machine &machine, uint32_t pc);
-int amiga_copper_execute_next(running_machine &machine, int xpos);
-
-void amiga_set_genlock_color(running_machine &machine, uint16_t color);
-void amiga_sprite_dma_reset(running_machine &machine, int which);
-void amiga_sprite_enable_comparitor(running_machine &machine, int which, int enable);
-
MACHINE_CONFIG_EXTERN( pal_video );
MACHINE_CONFIG_EXTERN( ntsc_video );