mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
(MESS) c128: Rewrote the driver using the PLA for address decoding. [Curt Coder]
This commit is contained in:
parent
62019298b9
commit
6bb16d725e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6557,7 +6557,6 @@ src/mess/machine/bebox.c svneol=native#text/plain
|
||||
src/mess/machine/beta.c svneol=native#text/plain
|
||||
src/mess/machine/beta.h svneol=native#text/plain
|
||||
src/mess/machine/bk.c svneol=native#text/plain
|
||||
src/mess/machine/c128.c svneol=native#text/plain
|
||||
src/mess/machine/c128_comal80.c svneol=native#text/plain
|
||||
src/mess/machine/c128_comal80.h svneol=native#text/plain
|
||||
src/mess/machine/c1541.c svneol=native#text/plain
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,7 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* includes/c128.h
|
||||
*
|
||||
* Commodore C128 Home Computer
|
||||
*
|
||||
* peter.trauner@jk.uni-linz.ac.at
|
||||
*
|
||||
* Documentation: iDOC (http://www.softwolves.pp.se/idoc)
|
||||
* Christian Janoff <mepk@c64.org>
|
||||
*
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#ifndef __C128_H__
|
||||
#define __C128_H__
|
||||
#ifndef __C128__
|
||||
#define __C128__
|
||||
|
||||
#include "emu.h"
|
||||
#include "formats/cbm_snqk.h"
|
||||
@ -32,9 +21,6 @@
|
||||
#include "video/mos6566.h"
|
||||
#include "video/vdc8563.h"
|
||||
|
||||
// TODO remove
|
||||
#include "includes/c64_legacy.h"
|
||||
|
||||
#define Z80A_TAG "u10"
|
||||
#define M8502_TAG "u6"
|
||||
#define MOS8563_TAG "u22"
|
||||
@ -50,11 +36,11 @@
|
||||
#define CONTROL1_TAG "joy1"
|
||||
#define CONTROL2_TAG "joy2"
|
||||
|
||||
class c128_state : public legacy_c64_state
|
||||
class c128_state : public driver_device
|
||||
{
|
||||
public:
|
||||
c128_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: legacy_c64_state(mconfig, type, tag),
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, Z80A_TAG),
|
||||
m_subcpu(*this, M8502_TAG),
|
||||
m_mmu(*this, MOS8722_TAG),
|
||||
@ -64,19 +50,39 @@ public:
|
||||
m_sid(*this, MOS6581_TAG),
|
||||
m_cia1(*this, MOS6526_1_TAG),
|
||||
m_cia2(*this, MOS6526_2_TAG),
|
||||
//m_iec(*this, CBM_IEC_TAG),
|
||||
m_iec(*this, CBM_IEC_TAG),
|
||||
m_joy1(*this, CONTROL1_TAG),
|
||||
m_joy2(*this, CONTROL2_TAG),
|
||||
m_exp(*this, C64_EXPANSION_SLOT_TAG),
|
||||
m_user(*this, C64_USER_PORT_TAG),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
|
||||
m_z80en(0),
|
||||
m_loram(1),
|
||||
m_hiram(1),
|
||||
m_charen(1),
|
||||
m_game(1),
|
||||
m_exrom(1),
|
||||
m_rom1(NULL),
|
||||
m_rom2(NULL),
|
||||
m_rom3(NULL),
|
||||
m_rom4(NULL),
|
||||
m_from(NULL),
|
||||
m_charom(NULL)
|
||||
m_charom(NULL),
|
||||
m_color_ram(*this, "color_ram"),
|
||||
m_va14(1),
|
||||
m_va15(1),
|
||||
m_clrbank(0),
|
||||
m_cnt1(1),
|
||||
m_sp1(1),
|
||||
m_iec_data_out(1),
|
||||
m_cia1_irq(CLEAR_LINE),
|
||||
m_cia2_irq(CLEAR_LINE),
|
||||
m_vic_irq(CLEAR_LINE),
|
||||
m_exp_irq(CLEAR_LINE),
|
||||
m_exp_nmi(CLEAR_LINE),
|
||||
m_cass_rd(1),
|
||||
m_iec_srq(1)
|
||||
{ }
|
||||
|
||||
required_device<legacy_cpu_device> m_maincpu;
|
||||
@ -88,7 +94,7 @@ public:
|
||||
required_device<sid6581_device> m_sid;
|
||||
required_device<mos6526_device> m_cia1;
|
||||
required_device<mos6526_device> m_cia2;
|
||||
//required_device<cbm_iec_device> m_iec;
|
||||
required_device<cbm_iec_device> m_iec;
|
||||
required_device<vcs_control_port_device> m_joy1;
|
||||
required_device<vcs_control_port_device> m_joy2;
|
||||
required_device<c64_expansion_slot_device> m_exp;
|
||||
@ -99,10 +105,13 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
|
||||
void bankswitch_pla(offs_t offset, offs_t ta, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
|
||||
int *sden, int *dir, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic, int *from1, int *romh, int *roml, int *dwe, int *ioacc, int *clrbank, int *iocs, int *casenb);
|
||||
inline void check_interrupts();
|
||||
void read_pla(offs_t offset, offs_t ca, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0,
|
||||
int *sden, int *dir, int *gwe, int *rom1, int *rom2, int *rom3, int *rom4, int *charom, int *colorram, int *vic,
|
||||
int *from1, int *romh, int *roml, int *dwe, int *ioacc, int *clrbank, int *iocs, int *casenb);
|
||||
UINT8 read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io);
|
||||
void write_memory(address_space &space, offs_t offset, offs_t vma, UINT8 data, int ba, int aec, int z80io);
|
||||
inline void update_iec();
|
||||
|
||||
DECLARE_READ8_MEMBER( z80_r );
|
||||
DECLARE_WRITE8_MEMBER( z80_w );
|
||||
@ -111,24 +120,7 @@ public:
|
||||
DECLARE_READ8_MEMBER( read );
|
||||
DECLARE_WRITE8_MEMBER( write );
|
||||
DECLARE_READ8_MEMBER( vic_videoram_r );
|
||||
|
||||
DECLARE_READ8_MEMBER( read_io );
|
||||
DECLARE_READ8_MEMBER( mmu8722_port_r );
|
||||
DECLARE_WRITE8_MEMBER( mmu8722_port_w );
|
||||
DECLARE_READ8_MEMBER( mmu8722_ff00_r );
|
||||
DECLARE_WRITE8_MEMBER( mmu8722_ff00_w );
|
||||
DECLARE_READ8_MEMBER( dma8726_port_r );
|
||||
DECLARE_WRITE8_MEMBER( dma8726_port_w );
|
||||
DECLARE_WRITE8_MEMBER( write_0000 );
|
||||
DECLARE_WRITE8_MEMBER( write_1000 );
|
||||
DECLARE_WRITE8_MEMBER( write_4000 );
|
||||
DECLARE_WRITE8_MEMBER( write_8000 );
|
||||
DECLARE_WRITE8_MEMBER( write_a000 );
|
||||
DECLARE_WRITE8_MEMBER( write_c000 );
|
||||
DECLARE_WRITE8_MEMBER( write_d000 );
|
||||
DECLARE_WRITE8_MEMBER( write_e000 );
|
||||
DECLARE_WRITE8_MEMBER( write_ff00 );
|
||||
DECLARE_WRITE8_MEMBER( write_ff05 );
|
||||
DECLARE_READ8_MEMBER( vic_colorram_r );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( mmu_z80en_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( mmu_fsdir_w );
|
||||
@ -136,14 +128,11 @@ public:
|
||||
DECLARE_READ_LINE_MEMBER( mmu_exrom_r );
|
||||
DECLARE_READ_LINE_MEMBER( mmu_sense40_r );
|
||||
|
||||
DECLARE_READ8_MEMBER( vic_lightpen_x_cb );
|
||||
DECLARE_READ8_MEMBER( vic_lightpen_y_cb );
|
||||
DECLARE_READ8_MEMBER( vic_lightpen_button_cb );
|
||||
INTERRUPT_GEN_MEMBER( frame_interrupt );
|
||||
DECLARE_READ8_MEMBER( vic_dma_read );
|
||||
DECLARE_READ8_MEMBER( vic_dma_read_color );
|
||||
DECLARE_WRITE_LINE_MEMBER( vic_interrupt );
|
||||
DECLARE_READ8_MEMBER( vic_rdy_cb );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( vic_irq_w );
|
||||
|
||||
DECLARE_READ8_MEMBER( sid_potx_r );
|
||||
DECLARE_READ8_MEMBER( sid_poty_r );
|
||||
|
||||
@ -158,75 +147,60 @@ public:
|
||||
DECLARE_READ8_MEMBER( cia2_pa_r );
|
||||
DECLARE_WRITE8_MEMBER( cia2_pa_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( iec_data_w );
|
||||
|
||||
DECLARE_READ8_MEMBER( cpu_r );
|
||||
DECLARE_WRITE8_MEMBER( cpu_w );
|
||||
|
||||
void nmi();
|
||||
void irq(int level);
|
||||
void iec_data_out_w();
|
||||
void iec_srq_out_w();
|
||||
void bankswitch_64(int reset);
|
||||
void bankswitch_z80();
|
||||
void bankswitch_128(int reset);
|
||||
void bankswitch(int reset);
|
||||
void mmu8722_reset();
|
||||
DECLARE_WRITE_LINE_MEMBER( tape_read_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( iec_data_w );
|
||||
|
||||
DECLARE_READ8_MEMBER( exp_dma_r );
|
||||
DECLARE_WRITE8_MEMBER( exp_dma_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( exp_nmi_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( exp_dma_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( exp_reset_w );
|
||||
|
||||
// memory state
|
||||
int m_z80en;
|
||||
int m_loram;
|
||||
int m_hiram;
|
||||
int m_charen;
|
||||
int m_va14;
|
||||
int m_va15;
|
||||
int m_game;
|
||||
int m_exrom;
|
||||
int m_reset;
|
||||
const UINT8 *m_rom1;
|
||||
const UINT8 *m_rom2;
|
||||
const UINT8 *m_rom3;
|
||||
const UINT8 *m_rom4;
|
||||
const UINT8 *m_from;
|
||||
const UINT8 *m_charom;
|
||||
UINT8 *m_color_ram;
|
||||
|
||||
UINT8 *m_c128_basic;
|
||||
UINT8 *m_c128_kernal;
|
||||
UINT8 *m_c128_chargen;
|
||||
UINT8 *m_z80;
|
||||
UINT8 *m_editor;
|
||||
UINT8 *m_internal_function;
|
||||
UINT8 *m_external_function;
|
||||
UINT8 *m_vdcram;
|
||||
UINT8 m_mmu_reg[0x0b];
|
||||
int m_mmu_cpu;
|
||||
int m_mmu_page0;
|
||||
int m_mmu_page1;
|
||||
int m_c64mode;
|
||||
int m_write_io;
|
||||
int m_ram_bottom;
|
||||
int m_ram_top;
|
||||
UINT8 *m_ram_ptr;
|
||||
UINT8 m_c64_port_data;
|
||||
UINT8 m_keyline[3];
|
||||
// video state
|
||||
optional_shared_ptr<UINT8> m_color_ram;
|
||||
int m_va14;
|
||||
int m_va15;
|
||||
int m_clrbank;
|
||||
|
||||
// fast serial state
|
||||
int m_cnt1;
|
||||
int m_sp1;
|
||||
int m_data_out;
|
||||
int m_va1617;
|
||||
int m_nmilevel;
|
||||
int m_z80en;
|
||||
int m_iec_data_out;
|
||||
|
||||
// interrupt state
|
||||
int m_cia1_irq;
|
||||
DECLARE_DRIVER_INIT(c128pal);
|
||||
DECLARE_DRIVER_INIT(c128dcrp);
|
||||
DECLARE_DRIVER_INIT(c128dcr);
|
||||
DECLARE_DRIVER_INIT(c128dpal);
|
||||
DECLARE_DRIVER_INIT(c128d);
|
||||
DECLARE_DRIVER_INIT(c128);
|
||||
DECLARE_DRIVER_INIT(c128d81);
|
||||
INTERRUPT_GEN_MEMBER(c128_frame_interrupt);
|
||||
int m_cia2_irq;
|
||||
int m_vic_irq;
|
||||
int m_exp_irq;
|
||||
int m_exp_nmi;
|
||||
int m_cass_rd;
|
||||
int m_iec_srq;
|
||||
|
||||
// keyboard state
|
||||
UINT8 m_keyline[3];
|
||||
};
|
||||
|
||||
|
||||
/*----------- defined in machine/c128.c -----------*/
|
||||
|
||||
extern const mos6526_interface c128_cia1_intf, c128_cia2_intf;
|
||||
|
||||
#endif /* __C128_H__ */
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -636,14 +636,14 @@ v364
|
||||
c128 // Commodore 128 - NTSC
|
||||
c128cr // Commodore 128CR - NTSC (proto?)
|
||||
c128sfi // Commodore 128 - PAL (Swedish / Finnish)
|
||||
c128fra // Commodore 128 - PAL (French)
|
||||
//c128fra // Commodore 128 - PAL (French)
|
||||
c128ger // Commodore 128 - PAL (German)
|
||||
c128nor // Commodore 128 - PAL (Norwegian)
|
||||
//c128nor // Commodore 128 - PAL (Norwegian)
|
||||
c128d // Commodore 128D - PAL
|
||||
c128dpr // Commodore 128D - NTSC (proto)
|
||||
c128dcr // Commodore 128DCR - NTSC
|
||||
c128drde // Commodore 128DCR - PAL (German)
|
||||
c128drit // Commodore 128DCR - PAL (Italian)
|
||||
//c128drit // Commodore 128DCR - PAL (Italian)
|
||||
c128drsw // Commodore 128DCR - PAL (Swedish)
|
||||
c128d81 // Commodore 128D/81
|
||||
|
||||
|
@ -893,7 +893,6 @@ $(MESSOBJ)/cbm.a: \
|
||||
$(MESS_DRIVERS)/c65.o \
|
||||
$(MESS_MACHINE)/c65.o \
|
||||
$(MESS_DRIVERS)/c128.o \
|
||||
$(MESS_MACHINE)/c128.o \
|
||||
$(MESS_MACHINE)/c128_comal80.o \
|
||||
$(MESS_MACHINE)/cbmiec.o \
|
||||
$(MESS_MACHINE)/c1541.o \
|
||||
|
Loading…
Reference in New Issue
Block a user