Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltairZ80: Adds SET CPU RESIZEMEMORY and other #347

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

deltecent
Copy link
Contributor

Changing the CPU type or MEMORY size/configuration causes memory resources mapped by other devices to be removed. This is not made clear by HELP CPU and the user has no feedback that this is happening.

This PR does the following:

  1. HELP SET CPU now shows that SET CPU MEMORY requires a value.
  2. Feedback is now provided if the value is omitted or not properly formatted.
  3. Unmapped memory resources caused by a SET CPU command is now displayed on the SIMH console.
  4. Adds a SET CPU RESIZEMEMORY command that resizes system memory without unmapping other device memory resources.

@deltecent
Copy link
Contributor Author

Altair 8800 (Z80) simulator Open SIMH V4.1-0 Current        git commit id: c077c22d+uncommitted-changes
sim> set jadedd ena
sim> set cpu ver
sim> show cpu
CPU     
        64KB, NOITRAP, 8080, AZ80, STOPONHALT
        NONBANKED, ALTAIRROM, VERBOSE,
       0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF [16k]
00000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
04000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
08000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
0C000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWMMMMWWWWWWWWWWWWMMMMWWWWWWWWWWWR,
0x[02 03 04 05 08 09 0A 10 11 12 13 14 15 16 17 18 19 28 29 2A 2B 32 33 43 A0 A1 A2 A3 A4 A5 A6 A7 FD FE FF]
        MMU, NOSWITCHER, NOPO
sim> set cpu 24k
Unmapping memory 0x0e000, handler=jademem
Unmapping memory 0x0e100, handler=jademem
Unmapping memory 0x0e200, handler=jademem
Unmapping memory 0x0e300, handler=jademem
Unmapping memory 0x0f000, handler=jadeprom
Unmapping memory 0x0f100, handler=jadeprom
Unmapping memory 0x0f200, handler=jadeprom
Unmapping memory 0x0f300, handler=jadeprom
sim> show cpu
CPU     
        24KB, NOITRAP, 8080, AZ80, STOPONHALT
        NONBANKED, ALTAIRROM, VERBOSE,
       0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF [16k]
00000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
04000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
08000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
0C000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUR,
0x[02 03 04 05 08 09 0A 10 11 12 13 14 15 16 17 18 19 28 29 2A 2B 32 33 43 A0 A1 A2 A3 A4 A5 A6 A7 FD FE FF]
        MMU, NOSWITCHER, NOPO
sim> reset jadedd
  Mapping memory 0x0f000, handler=jadeprom
  Mapping memory 0x0f100, handler=jadeprom
  Mapping memory 0x0f200, handler=jadeprom
  Mapping memory 0x0f300, handler=jadeprom
  Mapping memory 0x0e000, handler=jademem
  Mapping memory 0x0e100, handler=jademem
  Mapping memory 0x0e200, handler=jademem
  Mapping memory 0x0e300, handler=jademem
  Mapping  IO 0043, handler=jadedev
sim> show cpu
CPU     
        24KB, NOITRAP, 8080, AZ80, STOPONHALT
        NONBANKED, ALTAIRROM, VERBOSE,
       0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF [16k]
00000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
04000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
08000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
0C000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUMMMMUUUUUUUUUUUUMMMMUUUUUUUUUUUR,
0x[02 03 04 05 08 09 0A 10 11 12 13 14 15 16 17 18 19 28 29 2A 2B 32 33 43 A0 A1 A2 A3 A4 A5 A6 A7 FD FE FF]
        MMU, NOSWITCHER, NOPO
sim> set cpu resize=32k
sim> show cpu
CPU     
        32KB, NOITRAP, 8080, AZ80, STOPONHALT
        NONBANKED, ALTAIRROM, VERBOSE,
       0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF [16k]
00000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
04000: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
08000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
0C000: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUMMMMUUUUUUUUUUUUMMMMUUUUUUUUUUUR,
0x[02 03 04 05 08 09 0A 10 11 12 13 14 15 16 17 18 19 28 29 2A 2B 32 33 43 A0 A1 A2 A3 A4 A5 A6 A7 FD FE FF]
        MMU, NOSWITCHER, NOPO
sim> 

Copy link
Contributor

@hharte hharte left a comment

Choose a reason for hiding this comment

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

Hello @deltecent ,

thank you for submitting these useful additions. One minor comment that I’d like to see the mapping/unmapping prints only when VERBOSE is set, ie:

Unmapping memory 0x0f300, handler=jadeprom

Mapping memory 0x0f000, handler=jadeprom

Thanks!

AltairZ80/altairz80_cpu.c Show resolved Hide resolved
Changing the CPU type or MEMORY size/configuration causes memory
resources mapped by other devices to be removed. This is not made
clear by "HELP CPU" and the user has no feedback that this is
happening.

This PR does the following:

1) HELP SET CPU shows that SET CPU MEMORY requires a value.
2) Feedback is provided if the value is omitted or not properly formatted.
3) Unmapped memory resources caused by a SET CPU command are displayed
   on the SIMH console.
4) Adds a SET CPU RESIZEMEMORY command that resizes system memory
   without unmapping other device memory resources.
Copy link
Contributor

@hharte hharte left a comment

Choose a reason for hiding this comment

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

Thanks @deltecent , the change looks ok to me. What do you think, @psco ?

@psco
Copy link
Contributor

psco commented Jan 15, 2024

Thank you @deltecent , this looks fine and can be merged.

@pkoning2 pkoning2 merged commit 2a5f758 into open-simh:master Feb 1, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants