izapple2/cardVidHD.go

55 lines
1.6 KiB
Go
Raw Permalink Normal View History

2020-10-03 21:38:26 +00:00
package izapple2
/*
Simulates just what is needed to make Total Replay use the GS modes if the VidHD card is found
See:
https://github.com/a2-4am/4cade/blob/master/src/hw.vidhd.a
2019-11-11 21:58:42 +00:00
http://www.applelogic.org/files/GSHARDWAREREF.pdf, page 89
*/
2020-10-13 22:26:47 +00:00
// CardVidHD represents a VidHD card
type CardVidHD struct {
cardBase
}
2024-01-06 20:48:23 +00:00
func newCardVidHDBuilder() *cardBuilder {
return &cardBuilder{
name: "VidHD Card - limited",
2024-02-08 21:17:14 +00:00
description: "Firmware signature of the VidHD card to trick Total Replay to use the SHR mode",
2024-01-06 20:48:23 +00:00
buildFunc: func(params map[string]string) (Card, error) {
var c CardVidHD
2024-03-24 19:15:16 +00:00
c.loadRom(buildVidHDRom(), cardRomSimple)
2024-01-06 20:48:23 +00:00
return &c, nil
},
}
2020-10-13 22:26:47 +00:00
}
func buildVidHDRom() []uint8 {
data := make([]uint8, 256)
data[0] = 0x24
data[1] = 0xEA
data[2] = 0x4C
return data
}
2019-11-11 21:58:42 +00:00
const (
ioDataNewVideo uint8 = 0x29
)
2020-10-13 22:26:47 +00:00
func (c *CardVidHD) assign(a *Apple2, slot int) {
2019-11-12 22:47:48 +00:00
// The softswitches are outside the card reserved ss
2022-08-05 17:43:17 +00:00
a.io.addSoftSwitchR(0x22, buildNotImplementedSoftSwitchR(a.io), "VIDHD-TBCOLOR")
a.io.addSoftSwitchW(0x22, buildNotImplementedSoftSwitchW(a.io), "VIDHD-TBCOLOR")
a.io.addSoftSwitchR(0x29, getStatusSoftSwitch(a.io, ioDataNewVideo), "VIDHD-NEWVIDEO")
a.io.addSoftSwitchW(0x29, setStatusSoftSwitch(a.io, ioDataNewVideo), "VIDHD-NEWVIDEO")
a.io.addSoftSwitchR(0x34, buildNotImplementedSoftSwitchR(a.io), "VIDHD-CLOCKCTL")
a.io.addSoftSwitchW(0x34, buildNotImplementedSoftSwitchW(a.io), "VIDHD-CLOCKCTL")
a.io.addSoftSwitchR(0x35, buildNotImplementedSoftSwitchR(a.io), "VIDHD-SHADOW")
a.io.addSoftSwitchW(0x35, buildNotImplementedSoftSwitchW(a.io), "VIDHD-SHADOW")
2019-11-11 21:58:42 +00:00
c.cardBase.assign(a, slot)
}