Support no slot clock installed on any card ROM

This commit is contained in:
Ivan Izaguirre 2020-09-01 17:46:30 +02:00
parent ccd100677e
commit fe72071245
4 changed files with 25 additions and 6 deletions

View File

@ -192,6 +192,8 @@ Only valid on SDL mode
set base model. Models available 2plus, 2e, 2enh, base64a (default "2enh")
-mono
emulate a green phosphor monitor instead of a NTSC color TV. Use F6 to toggle.
-nsc int
add a DS1216 No-Slot-Clock on the main ROM (use 0) or a slot ROM. -1 for none (default -1)
-panicSS
panic if a not implemented softswitch is used
-profile

View File

@ -190,6 +190,17 @@ func (a *Apple2) AddNoSlotClock() {
a.mmu.physicalROM[0] = nsc
}
// AddNoSlotClockInCard inserts a DS1215 no slot clock under a card ROM
func (a *Apple2) AddNoSlotClockInCard(slot int) error {
cardRom := a.mmu.cardsROM[slot]
if cardRom == nil {
return errors.New("No ROM available on the slot to add a no slot clock")
}
nsc := newNoSlotClockDS1216(a, cardRom)
a.mmu.cardsROM[slot] = nsc
return nil
}
// AddCardLogger inserts a fake card that logs accesses
func (a *Apple2) AddCardLogger(slot int) {
a.insertCard(&cardLogger{}, slot)

View File

@ -81,10 +81,10 @@ func MainApple() *Apple2 {
"thunderClockCardSlot",
4,
"slot for the ThunderClock Plus card. -1 for none")
nsc := flag.Bool(
nsc := flag.Int(
"nsc",
false,
"add a DS1216 No-Slot-Clock")
-1,
"add a DS1216 No-Slot-Clock on the main ROM (use 0) or a slot ROM. -1 for none")
mono := flag.Bool(
"mono",
false,
@ -290,8 +290,14 @@ func MainApple() *Apple2 {
a.AddRGBCard()
}
if *nsc {
if *nsc == 0 {
a.AddNoSlotClock()
} else if *nsc > 0 {
err := a.AddNoSlotClockInCard(*nsc)
if err != nil {
panic(err)
}
}
//a.AddCardInOut(2)

View File

@ -21,9 +21,9 @@ delegate to the replaced memoryHandler when needed.
On the Apple IIe it is usually installed under the ROM CD (under CF on later models). Similar for the Apple IIc.
It is usually not compatible with the ROMs of the Apple II+, but could be installed in a card with 28 pins ROM,
working on different addresses. We will install it under the main ROM for all models.
working on different addresses. We will install it under the main ROM for all models or under a card ROM.
Actually software looks like it only uses: 0xC300, 0xC301 and 0xC304
Actually software looks like it uses: 0xCs00, 0xCs01 and 0xCs04, usually slot 3
*/
type noSlotClockDS1216 struct {