MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / ide_write_word

Function ide_write_word

src/idecontrollers.cpp:1970–2205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1968}
1969
1970static void ide_write_word(struct ide_board *board, uaecptr addr, uae_u16 v)
1971{
1972 addr &= board->mask;
1973
1974#if DEBUG_IDE
1975 if ((addr & DEBUG_IDE_MASK) == DEBUG_IDE_MASK_VAL) {
1976 write_log(_T("IDE IO WORD WRITE %08x=%04x %08x\n"), addr, v, M68K_GETPC);
1977 }
1978#endif
1979
1980 if (board->configured) {
1981
1982 if (board->type == BUDDHA_IDE) {
1983
1984 int portnum;
1985 int regnum = get_buddha_reg(addr, board, &portnum, NULL);
1986 if (regnum == IDE_DATA) {
1987 if (board->ide[portnum])
1988 put_ide_reg_multi(board, IDE_DATA, v, portnum, 1);
1989 } else {
1990 ide_write_byte(board, addr, v >> 8);
1991 ide_write_byte(board, addr + 1, (uae_u8)v);
1992 }
1993
1994 } else if (board->type == ALF_IDE || board->type == TANDEM_IDE) {
1995
1996 int regnum = get_alf_reg(addr, board);
1997 if (regnum == IDE_DATA) {
1998 put_ide_reg(board, IDE_DATA, v);
1999 } else {
2000#if DEBUG_IDE_ALF
2001 write_log(_T("ALF IO WORD WRITE %08x %04x %08x\n"), addr, v, M68K_GETPC);
2002#endif
2003 }
2004
2005 } else if (board->type == XSURF_IDE) {
2006
2007 int portnum;
2008 int regnum = get_xsurf_reg(addr, board, &portnum);
2009 if (regnum >= 0) {
2010 if (regnum == IDE_DATA) {
2011 if (board->ide[portnum])
2012 put_ide_reg_multi(board, IDE_DATA, v, portnum, 1);
2013 } else {
2014 ide_write_byte(board, addr, v >> 8);
2015 ide_write_byte(board, addr + 1, (uae_u8)v);
2016 }
2017 }
2018
2019 } else if (board->type == GOLEMFAST_IDE) {
2020
2021 if ((addr & 0x8700) == 0x8100) {
2022 int regnum = get_golemfast_reg(addr, board);
2023 if (regnum == IDE_DATA) {
2024 put_ide_reg(board, IDE_DATA, v);
2025 } else {
2026 ide_write_byte(board, addr, v >> 8);
2027 ide_write_byte(board, addr + 1, (uae_u8)v);

Callers 2

ide_generic_wputFunction · 0.85
ide_generic_lputFunction · 0.85

Calls 15

get_buddha_regFunction · 0.85
put_ide_reg_multiFunction · 0.85
ide_write_byteFunction · 0.85
get_alf_regFunction · 0.85
put_ide_regFunction · 0.85
get_xsurf_regFunction · 0.85
get_golemfast_regFunction · 0.85
get_masoboshi_regFunction · 0.85
get_trifecta_regFunction · 0.85
apollo_scsi_bputFunction · 0.85
get_apollo_regFunction · 0.85
get_gvp_regFunction · 0.85

Tested by

no test coverage detected