mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
AltairZ80: Updates prev PR to support Extended Mem
The previous PR that added the "ROM" option to "load -h" did not support extended memory. @psco provided an update that corrects that problem.
This commit is contained in:
parent
0a22668b29
commit
b3a1bc2466
@ -209,6 +209,7 @@ uint32 getCommon(void);
|
||||
uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
|
||||
int32 (*routine)(const int32, const int32, const int32), const char* name, uint8 unmap);
|
||||
|
||||
static void PutBYTEasROMorRAM(register uint32 Addr, const register uint32 Value, const register uint32 makeROM);
|
||||
void PutBYTEExtended(register uint32 Addr, const register uint32 Value);
|
||||
uint32 GetBYTEExtended(register uint32 Addr);
|
||||
void cpu_raise_interrupt(uint32 irq);
|
||||
@ -1937,6 +1938,15 @@ static void PutBYTE(register uint32 Addr, const register uint32 Value) {
|
||||
}
|
||||
}
|
||||
|
||||
static void PutBYTEasROMorRAM(register uint32 Addr, const register uint32 Value, const register uint32 makeROM) {
|
||||
Addr &= ADDRMASK; /* registers are NOT guaranteed to be always 16-bit values */
|
||||
if ((cpu_unit.flags & UNIT_CPU_BANKED) && (((common_low == 0) && (Addr < common)) || ((common_low == 1) && (Addr >= common))))
|
||||
Addr |= bankSelect << MAXBANKSIZELOG2;
|
||||
|
||||
mmu_table[Addr >> LOG2PAGESIZE] = makeROM ? ROM_PAGE : RAM_PAGE;
|
||||
M[Addr] = Value;
|
||||
}
|
||||
|
||||
void PutBYTEExtended(register uint32 Addr, const register uint32 Value) {
|
||||
MDEV m;
|
||||
|
||||
@ -7559,13 +7569,7 @@ static t_stat cpu_hex_load(FILE *fileref, CONST char *cptr, CONST char *fnam, in
|
||||
}
|
||||
bufptr += 2;
|
||||
|
||||
if (makeROM) {
|
||||
mmu_table[addr >> LOG2PAGESIZE] = ROM_PAGE;
|
||||
} else {
|
||||
mmu_table[addr >> LOG2PAGESIZE] = RAM_PAGE;
|
||||
}
|
||||
|
||||
M[addr++] = databyte;
|
||||
PutBYTEasROMorRAM(addr++, databyte, makeROM);
|
||||
|
||||
chksum += databyte;
|
||||
cnt++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user