Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d07c7c4
Created skeleton for IBM System/23
RetroAND Dec 26, 2024
0d23f45
Corrected errors at system23.cpp; created layout
RetroAND Dec 26, 2024
f625fbb
Corrected further errors into the driver; driver now compiles!
RetroAND Dec 26, 2024
90fda0f
Added cpu test register;
RetroAND Dec 27, 2024
65c9dcc
Added diagnostics PPI; added keyboard PPI; fixed seven segment displays;
RetroAND Dec 29, 2024
a4ae513
Tied SID to high; added RAM
RetroAND Dec 30, 2024
9497c50
Implemented test 4;
RetroAND Dec 31, 2024
dcb63e7
Added 8257 DMA
RetroAND Jan 1, 2025
7eae688
Added 8275 device
RetroAND Jan 2, 2025
b2daf97
First extensions to the comments
rfka01 Jan 3, 2025
d857834
Video enabled; layout changes;
RetroAND Jan 3, 2025
4cc2f76
Added 1980 BIOS; fixed layout;
RetroAND Jan 4, 2025
8907baf
Added DIP settings;
RetroAND Jan 5, 2025
8140e3d
Fixed dipswitches
RetroAND Jan 6, 2025
83631ac
Merge pull request #1 from rfka01/master
RetroAND Jan 6, 2025
74eb646
Fixed 8275 behaviour before initialization; added light pen test circ…
RetroAND Jan 8, 2025
9a64313
Commented verbose define;
RetroAND Jan 8, 2025
c25242a
Fixed 8275 bug where it didn't output the correct GG pins; test 05 as…
RetroAND Jan 9, 2025
32eb064
Revert "First extensions to the comments"
RetroAND Jan 9, 2025
e14c918
added column attribute to CRTC; corrected light pen write strobe; add…
RetroAND Jan 10, 2025
83b092e
Added more rom definitions for Set "R";
RetroAND Jan 10, 2025
26d0401
Moved diagnostics probe; added ROM definitions; added PIT, PIC and US…
RetroAND Jan 11, 2025
ae30897
Added memory definition lines; fixed "A" dipswitches, cleared all err…
RetroAND Jan 19, 2025
8dac684
All tests pass; keyboard skeleton
RetroAND Feb 1, 2025
1a886ae
Keyboard implementation - still need fixes
RetroAND Feb 4, 2025
74be318
Stabilization of counter and sense select signals;
RetroAND Feb 4, 2025
45c6a94
Stabilized ROM errors; assigned some keys in the keyboard;
RetroAND Feb 6, 2025
0df83e8
Key assignation
RetroAND Feb 6, 2025
3696b98
Key assignation correction;
RetroAND Feb 11, 2025
b4da514
Logging disabled
RetroAND Feb 11, 2025
e71aeb1
Printf disabled
RetroAND Feb 12, 2025
beb1046
Initialized variables
RetroAND Feb 24, 2025
624320a
Added IBM 4178629 video device; switched to IBM CRTC from i8275;
RetroAND Apr 10, 2025
0873a3c
Defined different behaviours at the interrupt generation for both the…
RetroAND Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions src/devices/video/i8275.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
TODO:

- double spaced rows
- preset counters - how it affects DMA and HRTC?

*/

Expand Down Expand Up @@ -62,7 +61,7 @@ const int i8275_device::character_attribute[3][16] =
// device type definitions
DEFINE_DEVICE_TYPE(I8275, i8275_device, "i8275", "Intel 8275 CRTC")
DEFINE_DEVICE_TYPE(I8276, i8276_device, "i8276", "Intel 8276 CRTC")

DEFINE_DEVICE_TYPE(IBM4178629, ibm4178629_device, "ibm4178629", "IBM 418629 CRTC")


//**************************************************************************
Expand Down Expand Up @@ -96,13 +95,16 @@ i8275_device::i8275_device(const machine_config &mconfig, device_type type, cons
m_buffer_dma(0),
m_lpen(0),
m_scanline(0),
m_column(0),
m_dma_stop(false),
m_end_of_screen(false),
m_preset(false),
m_cursor_blink(0),
m_char_blink(0),
m_stored_attr(0),
m_field_attr(0)
m_field_attr(0),
m_ibmCRTC(false),
m_init(false)
{
memset(m_param, 0x00, sizeof(m_param));
}
Expand All @@ -117,6 +119,12 @@ i8276_device::i8276_device(const machine_config &mconfig, const char *tag, devic
{
}

ibm4178629_device::ibm4178629_device(const machine_config &mconfig, const char * tag, device_t *owner, uint32_t clock) :
i8275_device(mconfig, IBM4178629, tag, owner, clock)
{
this->m_ibmCRTC = true;
}


void i8275_device::device_resolve_objects()
{
Expand Down Expand Up @@ -145,6 +153,13 @@ void i8275_device::device_start()
m_scanline_timer = timer_alloc(FUNC(i8275_device::scanline_tick), this);
}

//preinitialize the device with valid data (in real hardware parameters initialize to random)
m_param[REG_SCN1] = 0x4f;
m_param[REG_SCN2] = 0x58;
m_param[REG_SCN3] = 0x89;
m_param[REG_SCN4] = 0xd9;
recompute_parameters();

// state saving
save_item(NAME(m_status));
save_item(NAME(m_param));
Expand All @@ -161,6 +176,7 @@ void i8275_device::device_start()
save_item(NAME(m_buffer_dma));
save_item(NAME(m_lpen));
save_item(NAME(m_scanline));
save_item(NAME(m_column));
save_item(NAME(m_irq_scanline));
save_item(NAME(m_vrtc_scanline));
save_item(NAME(m_vrtc_drq_scanline));
Expand All @@ -171,6 +187,8 @@ void i8275_device::device_start()
save_item(NAME(m_char_blink));
save_item(NAME(m_stored_attr));
save_item(NAME(m_field_attr));
save_item(NAME(m_ibmCRTC));
save_item(NAME(m_init));
}


Expand Down Expand Up @@ -298,8 +316,10 @@ TIMER_CALLBACK_MEMBER(i8275_device::scanline_tick)
{
for (i8275_device *crtc = this; crtc != nullptr; crtc = crtc->m_next_crtc)
{
if ((crtc->m_status & ST_IE) && !(crtc->m_status & ST_IR))
// If either the IC is initialized or it is an IBM CRTC the interrupt is set if the EI flag is set
if ((crtc->m_status & ST_IE) && !(crtc->m_status & ST_IR) && (crtc->m_init || crtc->m_ibmCRTC))
{
LOG("I8275 IRQ Set\n");
crtc->m_status |= ST_IR;
crtc->m_write_irq(ASSERT_LINE);
}
Expand Down Expand Up @@ -358,6 +378,7 @@ TIMER_CALLBACK_MEMBER(i8275_device::scanline_tick)
auto [data, attr] = crtc->char_from_buffer(n, sx, rc, lc, end_of_row, blank_row);
charcode |= uint32_t(data) << (n * 8);
attrcode |= uint32_t(attr) << (n * 8);
crtc->m_column = sx;
}

m_display_cb(m_bitmap,
Expand Down Expand Up @@ -410,6 +431,7 @@ std::pair<uint8_t, uint8_t> i8275_device::char_from_buffer(int n, int sx, int rc
{
// simply blank the attribute character itself
attr = FAC_B;
attr |= (data & FAC_GG); // add the GG attributes
}
}
else if (data >= 0xf0 || BIT(end_of_row, n))
Expand Down Expand Up @@ -562,7 +584,7 @@ void i8275_device::write(offs_t offset, uint8_t data)
*/
case CMD_RESET:
LOG("I8275 Reset\n");

m_init = true;
m_status &= ~(ST_IE | ST_IR | ST_VE);
LOG("I8275 IRQ 0\n");
m_write_irq(CLEAR_LINE);
Expand Down Expand Up @@ -716,8 +738,8 @@ void i8275_device::lpen_w(int state)
{
if (!m_lpen && state)
{
m_param[REG_LPEN_COL] = screen().hpos() / m_hpixels_per_column;
m_param[REG_LPEN_ROW] = screen().vpos() / scanlines_per_row();
m_param[REG_LPEN_COL] = m_column + 3; //According to the datasheet the column is at least three positions off
m_param[REG_LPEN_ROW] = m_scanline / scanlines_per_row();

m_status |= ST_LP;
}
Expand Down
11 changes: 11 additions & 0 deletions src/devices/video/i8275.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class i8275_device : public device_t,
int m_lpen;

int m_scanline;
int m_column;
int m_irq_scanline;
int m_vrtc_scanline;
int m_vrtc_drq_scanline;
Expand All @@ -245,6 +246,9 @@ class i8275_device : public device_t,
uint8_t m_stored_attr;
uint8_t m_field_attr;

bool m_ibmCRTC;
bool m_init;

// timers
emu_timer *m_hrtc_on_timer;
emu_timer *m_drq_on_timer;
Expand All @@ -258,9 +262,16 @@ class i8276_device : public i8275_device
i8276_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};

class ibm4178629_device : public i8275_device
{
public:
ibm4178629_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};


// device type definition
DECLARE_DEVICE_TYPE(I8275, i8275_device)
DECLARE_DEVICE_TYPE(I8276, i8276_device)
DECLARE_DEVICE_TYPE(IBM4178629, ibm4178629_device)

#endif // MAME_VIDEO_I8275_H
Loading