Support the Apple II Parallel Printer Interface card
This commit is contained in:
parent
1777954a54
commit
f2bc9f21aa
|
@ -7,4 +7,5 @@ frontend/a2sdl/*.dsk
|
||||||
frontend/a2fyne/a2fyne
|
frontend/a2fyne/a2fyne
|
||||||
frontend/headless/headless
|
frontend/headless/headless
|
||||||
frontend/*/snapshot.gif
|
frontend/*/snapshot.gif
|
||||||
frontend/*/snapshot.png
|
frontend/*/snapshot.png
|
||||||
|
frontend/*/printer.out
|
|
@ -21,10 +21,11 @@ Portable emulator of an Apple II+ or //e. Written in Go.
|
||||||
- DiskII controller (state machine based for WOZ files)
|
- DiskII controller (state machine based for WOZ files)
|
||||||
- 16Kb Language Card
|
- 16Kb Language Card
|
||||||
- 256Kb Saturn RAM
|
- 256Kb Saturn RAM
|
||||||
|
- Parallel Printer Interface card
|
||||||
- 1Mb Memory Expansion Card (slinky)
|
- 1Mb Memory Expansion Card (slinky)
|
||||||
- RAMWorks style expansion Card (up to 16MB additional) (Apple //e only)
|
- RAMWorks style expansion Card (up to 16MB additional) (Apple //e only)
|
||||||
- ThunderClock Plus real time clock
|
- ThunderClock Plus real time clock
|
||||||
- Apple //e 80 columns with 64Kb extra RAM and optional RGB modes
|
- Apple //e 80 columns card with 64Kb extra RAM and optional RGB modes
|
||||||
- No Slot Clock based on the DS1216
|
- No Slot Clock based on the DS1216
|
||||||
- Videx Videoterm 80 column card with the Videx Soft Video Switch (Apple ][+ only)
|
- Videx Videoterm 80 column card with the Videx Soft Video Switch (Apple ][+ only)
|
||||||
- SwyftCard (Apple //e only)
|
- SwyftCard (Apple //e only)
|
||||||
|
@ -78,7 +79,7 @@ By default the following configuration is launched:
|
||||||
|
|
||||||
- Enhanced Apple //e with 65c02 processor
|
- Enhanced Apple //e with 65c02 processor
|
||||||
- RAMWorks card with 80 column, RGB (with Video7 modes) and 8Gb RAM in aux slot
|
- RAMWorks card with 80 column, RGB (with Video7 modes) and 8Gb RAM in aux slot
|
||||||
- Memory Expansion card with 1Gb in slot 1
|
- Parallel print inteface in slot 1
|
||||||
- VidHD card (SHR support) in slot 2
|
- VidHD card (SHR support) in slot 2
|
||||||
- FASTChip Accelerator card in slot 3
|
- FASTChip Accelerator card in slot 3
|
||||||
- Mouse card in slot 4
|
- Mouse card in slot 4
|
||||||
|
@ -206,7 +207,7 @@ Only valid on SDL mode
|
||||||
-languageCardSlot int
|
-languageCardSlot int
|
||||||
slot for the 16kb language card. -1 for none
|
slot for the 16kb language card. -1 for none
|
||||||
-memoryExpSlot int
|
-memoryExpSlot int
|
||||||
slot for the Memory Expansion card with 1GB. -1 for none (default 1)
|
slot for the Memory Expansion card with 1GB. -1 for none (default -1)
|
||||||
-mhz float
|
-mhz float
|
||||||
cpu speed in Mhz, use 0 for full speed. Use F5 to toggle. (default 1.0227142857142857)
|
cpu speed in Mhz, use 0 for full speed. Use F5 to toggle. (default 1.0227142857142857)
|
||||||
-model string
|
-model string
|
||||||
|
@ -217,6 +218,8 @@ Only valid on SDL mode
|
||||||
add a DS1216 No-Slot-Clock on the main ROM (use 0) or a slot ROM. -1 for none (default -1)
|
add a DS1216 No-Slot-Clock on the main ROM (use 0) or a slot ROM. -1 for none (default -1)
|
||||||
-panicSS
|
-panicSS
|
||||||
panic if a not implemented softswitch is used
|
panic if a not implemented softswitch is used
|
||||||
|
-printer int
|
||||||
|
slot for the Parallel Printer Interface. -1 for none (default 1)
|
||||||
-profile
|
-profile
|
||||||
generate profile trace to analyse with pprof
|
generate profile trace to analyse with pprof
|
||||||
-ramworks int
|
-ramworks int
|
||||||
|
|
|
@ -169,6 +169,11 @@ func (a *Apple2) AddSaturnCard(slot int) {
|
||||||
a.insertCard(NewCardSaturn(), slot)
|
a.insertCard(NewCardSaturn(), slot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddParallelPrinter inserts an Apple II Parallel Printer card
|
||||||
|
func (a *Apple2) AddParallelPrinter(slot int) {
|
||||||
|
a.insertCard(NewCardParallelPrinter(), slot)
|
||||||
|
}
|
||||||
|
|
||||||
// AddMemoryExpansionCard inserts an Apple II Memory Expansion card with 1GB
|
// AddMemoryExpansionCard inserts an Apple II Memory Expansion card with 1GB
|
||||||
func (a *Apple2) AddMemoryExpansionCard(slot int) {
|
func (a *Apple2) AddMemoryExpansionCard(slot int) {
|
||||||
a.insertCard(NewCardMemoryExpansion(), slot)
|
a.insertCard(NewCardMemoryExpansion(), slot)
|
||||||
|
|
|
@ -62,8 +62,12 @@ func MainApple() *Apple2 {
|
||||||
"slot for the FASTChip accelerator card, -1 for none")
|
"slot for the FASTChip accelerator card, -1 for none")
|
||||||
memoryExpansionCardSlot := flag.Int(
|
memoryExpansionCardSlot := flag.Int(
|
||||||
"memoryExpSlot",
|
"memoryExpSlot",
|
||||||
1,
|
-1,
|
||||||
"slot for the Memory Expansion card with 1GB. -1 for none")
|
"slot for the Memory Expansion card with 1GB. -1 for none")
|
||||||
|
parallelPrinterSlot := flag.Int(
|
||||||
|
"printer",
|
||||||
|
1,
|
||||||
|
"slot for the Parallel Printer Interface. -1 for none")
|
||||||
ramWorksKb := flag.Int(
|
ramWorksKb := flag.Int(
|
||||||
"ramworks",
|
"ramworks",
|
||||||
8192,
|
8192,
|
||||||
|
@ -227,6 +231,9 @@ func MainApple() *Apple2 {
|
||||||
if *saturnCardSlot >= 0 {
|
if *saturnCardSlot >= 0 {
|
||||||
a.AddSaturnCard(*saturnCardSlot)
|
a.AddSaturnCard(*saturnCardSlot)
|
||||||
}
|
}
|
||||||
|
if *parallelPrinterSlot >= 0 {
|
||||||
|
a.AddParallelPrinter(*parallelPrinterSlot)
|
||||||
|
}
|
||||||
if *memoryExpansionCardSlot >= 0 {
|
if *memoryExpansionCardSlot >= 0 {
|
||||||
a.AddMemoryExpansionCard(*memoryExpansionCardSlot)
|
a.AddMemoryExpansionCard(*memoryExpansionCardSlot)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package izapple2
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
Apple II Parallel Printer Interface card.
|
||||||
|
|
||||||
|
See:
|
||||||
|
https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/Parallel/Apple%20II%20Parallel%20Printer%20Interface%20Card/
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// CardParallelPrinter represents a Parallel Printer Interface card
|
||||||
|
type CardParallelPrinter struct {
|
||||||
|
cardBase
|
||||||
|
file *os.File
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewCardParallelPrinter creates a new CardParallelPrinter
|
||||||
|
func NewCardParallelPrinter() *CardParallelPrinter {
|
||||||
|
var c CardParallelPrinter
|
||||||
|
c.name = "Parallel Printer Interface"
|
||||||
|
c.loadRomFromResource("<internal>/Apple II Parallel Printer Interface Card ROM fixed.bin")
|
||||||
|
return &c
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *CardParallelPrinter) assign(a *Apple2, slot int) {
|
||||||
|
f, err := os.OpenFile(printerFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
c.file = f
|
||||||
|
|
||||||
|
c.addCardSoftSwitchW(0, func(_ *ioC0Page, value uint8) {
|
||||||
|
c.printByte(value)
|
||||||
|
}, "PARALLELDEVW")
|
||||||
|
|
||||||
|
c.cardBase.assign(a, slot)
|
||||||
|
}
|
||||||
|
|
||||||
|
const printerFile = "printer.out"
|
||||||
|
|
||||||
|
func (c *CardParallelPrinter) printByte(value uint8) {
|
||||||
|
value = value & 0x7f // Remove the MSB bit
|
||||||
|
c.file.Write([]byte{value})
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
°8HŠH˜Hx Xÿºhhhh¨Êšh(ª<>G½¸N˜)I0É
|
||||||
|
<EFBFBD>)Éx°˜<>8<06>Jj°¸
|
||||||
|
(„!<21>=¸<18>¸~¸h¨hªh`
|
||||||
|
}8ˆÐúµ!<21>88°ç©‰<C2A9>8<06>¸©…6˜]8
|
||||||
|
ðç^¸˜HŠ
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
¨<EFBFBD>@<40>þ™€À<E282AC>9I
|
||||||
|
Ð
<0A>8½¸j)€
|
||||||
|
°_½¸h¨hªhLðý½8ðå!é÷<C3A9>™i…$<24>’pþÿÿÿÿÿ<0F>!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ½8Å$h°H)€ ,Xÿðþ8pˆÿÿÿÿÿ
|
Loading…
Reference in New Issue