Skip to content

Commit

Permalink
genpc: use trampoline instead of tag
Browse files Browse the repository at this point in the history
  • Loading branch information
cracyc committed Jul 3, 2024
1 parent ffd73a4 commit 0473bf3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/devices/machine/at.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void at_mb_device::device_add_mconfig(machine_config &config)
m_isabus->drq6_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq2_w));
m_isabus->drq7_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq3_w));
m_isabus->iochck_callback().set(FUNC(at_mb_device::iochck_w));
m_isabus->iochrdy_callback().set_inputline(":maincpu", INPUT_LINE_HALT);
m_isabus->iochrdy_callback().set(FUNC(at_mb_device::iochrdy_w));

MC146818(config, m_mc146818, 32.768_kHz_XTAL);
m_mc146818->irq().set(m_pic8259_slave, FUNC(pic8259_device::ir0_w));
Expand Down
1 change: 1 addition & 0 deletions src/devices/machine/at.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class at_mb_device : public device_t
void dma_write_byte(offs_t offset, uint8_t data);
uint8_t dma_read_word(offs_t offset);
void dma_write_word(offs_t offset, uint8_t data);
void iochrdy_w(int state) { m_maincpu->set_input_line(INPUT_LINE_HALT, state); };
};

DECLARE_DEVICE_TYPE(AT_MB, at_mb_device)
Expand Down
2 changes: 1 addition & 1 deletion src/devices/machine/genpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void ibm5160_mb_device::device_add_mconfig(machine_config &config)
m_isabus->drq2_callback().set(m_dma8237, FUNC(am9517a_device::dreq2_w));
m_isabus->drq3_callback().set(m_dma8237, FUNC(am9517a_device::dreq3_w));
m_isabus->iochck_callback().set(FUNC(ibm5160_mb_device::iochck_w));
m_isabus->iochrdy_callback().set_inputline(":maincpu", INPUT_LINE_HALT);
m_isabus->iochrdy_callback().set(FUNC(ibm5160_mb_device::iochrdy_w));

/* sound hardware */
SPEAKER(config, "mono").front_center();
Expand Down
1 change: 1 addition & 0 deletions src/devices/machine/genpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class ibm5160_mb_device : public device_t
void iochck_w(int state);

void pc_select_dma_channel(int channel, bool state);
void iochrdy_w(int state) { m_maincpu->set_input_line(INPUT_LINE_HALT, state); };
};


Expand Down

4 comments on commit 0473bf3

@cuavas
Copy link
Member

@cuavas cuavas commented on 0473bf3 Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at_mb_device::set_cputag and ibm5160_mb_device::set_cputag (or the device_config_complete member functions) are the proper places to connect stuff that needs to know the actual tag of the CPU device. They haven’t been removed.

@cracyc
Copy link
Member Author

@cracyc cracyc commented on 0473bf3 Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation error was from the ISA bus device which has no knowledge of the cpu tag https://github.com/mamedev/mame/actions/runs/9765791924/job/26957305271. The trampolines wouldn't work if the motherboard device didn't know what the tag was.

@cuavas
Copy link
Member

@cuavas cuavas commented on 0473bf3 Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at machine/at.h and machine/genpc.h – the correct place to configure things that need to know the actual tag of the CPU is in the set_cputag configuration helpers. Both of those headers have set_cputag configuration helpers, and e50319d is when that configuration helper was added to ibm5160_mb_device in machine/genpc.h.

@cracyc
Copy link
Member Author

@cracyc cracyc commented on 0473bf3 Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I checked that the machine configs had set_tag in them and they do but it still doesn't work at least for genpc so I just removed it until I or someone else figures out what I'm not understanding.

Please sign in to comment.