/* * JR-IDE Project * - (c) 2017 Alan Hightower * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __JRIDE_H__ #define __JRIDE_H__ #if JRIDE_ISA #define JRIDE_ROM_WINDOW_SIZE 0x4000 #define JRIDE_ROM_RANGE_START 0xc8000 #define JRIDE_ROM_RANGE_END 0xe0000 #define JRIDE_FLASH_PAGE_LOG2 13 #define JRIDE_FLASH_RANGE_START 0xc8000 #define JRIDE_FLASH_RANGE_END 0xe0000 #define JRIDE_ROM_REG_BASE (15 * 1024) #define JRIDE_IDE_DATA_WIN (JRIDE_ROM_REG_BASE + 0) #define JRIDE_IDE_REG_BASE (JRIDE_ROM_REG_BASE + 512) #define JRIDE_FLASH_BASE_REG (JRIDE_ROM_REG_BASE + 512 + 16) #define JRIDE_FLASH_PAGE_REG (JRIDE_ROM_REG_BASE + 512 + 17) #else // PCjr - default #define JRIDE_ROM_WINDOW_SIZE 0x4000 #define JRIDE_ROM_RANGE_START 0xc0000 #define JRIDE_ROM_RANGE_END 0xd0000 #define JRIDE_FLASH_PAGE_LOG2 14 #define JRIDE_FLASH_RANGE_START 0xc0000 #define JRIDE_FLASH_RANGE_END 0xd0000 #define JRIDE_ROM_REG_BASE ((14 * 1024) + 512) #define JRIDE_IDE_DATA_WIN (JRIDE_ROM_REG_BASE + 0) #define JRIDE_IDE_REG_BASE (JRIDE_ROM_REG_BASE + 512) #define JRIDE_RAM_MAP_REG (JRIDE_ROM_REG_BASE + 512 + 16) #define JRIDE_FLASH_MAP_REG (JRIDE_ROM_REG_BASE + 512 + 17) #define JRIDE_SCRATCH_RAM (JRIDE_ROM_REG_BASE + 512 + 18) #define JRIDE_POST_DATA_PORT 0x10 #define JRIDE_POST_CTRL_PORT 0x72 #define JRIDE_RTC_ADDR_PORT 0x70 #define JRIDE_RTC_DATA_PORT 0x71 #endif // 'ISA/PCjr #define JRIDE_FLASH_PAGE_SIZE (1 << JRIDE_FLASH_PAGE_LOG2) #define JRIDE_FLASH_PAGE_MASK (JRIDE_FLASH_PAGE_SIZE - 1) #define IDE_REG_ERROR (1) // R #define IDE_REG_FEATURE (1) // W #define IDE_REG_SEC_COUNT (2) #define IDE_REG_ADDR_SEC (3) #define IDE_REG_ADDR_CYL_L (4) #define IDE_REG_ADDR_CYL_H (5) #define IDE_REG_ADDR_HEAD (6) #define IDE_REG_STATUS (7) // R #define IDE_REG_COMMAND (7) // W #define IDE_REG_XTIDE_V1 (8) // Conflict with XT-IDEv1/2 latch reg #define IDE_REG_UART_DATA (9) #define IDE_REG_UART_STS (10) // R #define IDE_REG_UART_SECR (11) #define IDE_REG_ALT_STATUS (14) #define IDE_REG_ADDRESS (15) #endif