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

Support 'Base 64A' - a Taiwanese Apple II clone #806

Closed
tomcw opened this issue Jun 30, 2020 · 12 comments
Closed

Support 'Base 64A' - a Taiwanese Apple II clone #806

tomcw opened this issue Jun 30, 2020 · 12 comments
Milestone

Comments

@tomcw
Copy link
Contributor

tomcw commented Jun 30, 2020

Spun off from #771.

Requested by @Drakepirate.

"Base 64A" is a Taiwanese Apple II clone: https://en.wikipedia.org/wiki/List_of_Apple_II_clones#Taiwan


My Base 64A Roms are 28K total ( D0:4K D8:4K E0:4K E8:4K F0:4K & F8:8K )
A reduced version of 12K cutting last 4k of F8 and 2k of rest of bin files partialy works but have no Applesoft prompt.

Ci.Base-64A.zip

Base64A

@tomcw
Copy link
Contributor Author

tomcw commented Jun 30, 2020

Hi Tom
Sorry to post it here, may be could be in request area...May be Can be the next clone to be implemented in Applewin? 🙄
I have the manual and extracted the ROMS from my real machine, also a friend made a discover of ROM mapping (Base has a text processor embedded) .

27D170C2-000C-4A50-BE04-D014F7C51DD2
86075695-2a53b100-babb-11ea-8506-f7c03ded394b

@tomcw
Copy link
Contributor Author

tomcw commented Jun 30, 2020

The extended (bank-switched) ROM needs to be properly supported, eg. during start-up with a disk in the drive, there are these AN0 accesses which (from the above screenshot) should bank switch the ROM:

  • D530: STA $C059
  • F7FA: STA $C059

@Drakepirate
Copy link

My friend made a Base-64A emulator in GO and it's free to use, may be it can help...

https://github.com/ivanizag/apple2

@Drakepirate
Copy link

Drakepirate commented Jun 30, 2020

package apple2

import (
"fmt"

"github.com/ivanizag/apple2/core6502"

)

/*
Copam BASE64A adaptation.
*/

// newBase64a instantiates an apple2
func newBase64a() *Apple2 {
var a Apple2

a.Name = "Base 64A"
a.mmu = newMemoryManager(&a)
a.cpu = core6502.NewNMOS6502(a.mmu)
a.io = newIoC0Page(&a)
addApple2SoftSwitches(a.io)
addBase64aSoftSwitches(a.io)

return &a

}

const (
// There are 6 ROM chips. Each can have 4Kb or 8Kb. They can fill
// 2 or 4 banks with 2kb windows.
base64aRomBankSize = 12 * 1024
base64aRomBankCount = 4
base64aRomWindowSize = 2 * 1024
base64aRomChipCount = 6
)

func loadBase64aRom(a *Apple2) error {
// Load the 6 PROM dumps
romBanksBytes := make([][]uint8, base64aRomBankCount)
for j := range romBanksBytes {
romBanksBytes[j] = make([]uint8, 0, base64aRomBankSize)
}

for i := 0; i < base64aRomChipCount; i++ {
	filename := fmt.Sprintf("<internal>/BASE64A_%X.BIN", 0xd0+i*0x08)
	data, err := loadResource(filename)
	if err != nil {
		return err
	}
	for j := range romBanksBytes {
		start := (j * base64aRomWindowSize) % len(data)
		romBanksBytes[j] = append(romBanksBytes[j], data[start:start+base64aRomWindowSize]...)
	}
}

// Create banks
for j := range romBanksBytes {
	a.mmu.physicalROM[j] = newMemoryRange(0xd000, romBanksBytes[j])
}

// Start with first bank active
a.mmu.setActiveROMPage(0)

return nil

}

func addBase64aSoftSwitches(io *ioC0Page) {
// Other softswitches, not implemented but called from the ROM
io.addSoftSwitchW(0x0C, notImplementedSoftSwitchW, "80COLOFF")
io.addSoftSwitchW(0x0E, notImplementedSoftSwitchW, "ALTCHARSETOFF")

// Write on the speaker. That is a double access and should do nothing
// but works somehow on the BASE64A
io.addSoftSwitchW(0x30, func(io *ioC0Page, value uint8) {
	speakerSoftSwitch(io)
}, "SPEAKER")

// ROM pagination softswitches. They use the annunciator 0 and 1
mmu := io.apple2.mmu
io.addSoftSwitchRW(0x58, func(*ioC0Page) uint8 {
	p := mmu.getActiveROMPage()
	mmu.setActiveROMPage(p & 2)
	return 0
}, "ANN0OFF-ROM")
io.addSoftSwitchRW(0x59, func(*ioC0Page) uint8 {
	p := mmu.getActiveROMPage()
	mmu.setActiveROMPage(p | 1)
	return 0
}, "ANN0ON-ROM")
io.addSoftSwitchRW(0x5A, func(*ioC0Page) uint8 {
	p := mmu.getActiveROMPage()
	mmu.setActiveROMPage(p & 1)
	return 0
}, "ANN1OFF-ROM")
io.addSoftSwitchRW(0x5B, func(*ioC0Page) uint8 {
	p := mmu.getActiveROMPage()
	mmu.setActiveROMPage(p | 2)
	return 0
}, "ANN1ON-ROM")

}

func charGenColumnsMapBase64a(column int) int {
bit := column + 2
// Weird positions
if column == 6 {
bit = 2
} else if column == 0 {
bit = 1
}
return bit
}

@Drakepirate
Copy link

Drakepirate commented Jun 30, 2020

Theese are the ROM dumps of my Base 64

@ivanizag
Copy link
Contributor

ivanizag commented Jul 1, 2020

Hi. I have been looking at this last night.

I added support for up to four pages of ROM from $D000 to $FFFF with small changes in MemInitializeRom(), UpdatePaging() and two bits in memmode. I connected that to the softswitches for AN0 and AN1 and added the extra entry for the new clone on the UI.

I was able to boot properly and use the extra ROM features of the Base64A.

Is this approach correct? It would be OK to send a pull request?

@sicklittlemonkey
Copy link
Contributor

sicklittlemonkey commented Jul 1, 2020 via email

@Drakepirate
Copy link

Excellent news!

ivanizag added a commit to ivanizag/AppleWin that referenced this issue Jul 1, 2020
ivanizag added a commit to ivanizag/AppleWin that referenced this issue Jul 1, 2020
@ivanizag
Copy link
Contributor

ivanizag commented Jul 1, 2020

Thanks for the support! Happy to contribute.

I have submitted the PR.

@yonglak
Copy link

yonglak commented Jul 4, 2020

Great, I have a Base64A here. Using 8x 4164 drams. There might be a bug in the Basic 'SGN' command if I remember (1983?). Maybe my eproms suffered bit rot. Good well designed apple 2 clone.
Thanks for posting the roms. (Drakepirate)

ivanizag added a commit to ivanizag/AppleWin that referenced this issue Jul 5, 2020
ivanizag added a commit to ivanizag/AppleWin that referenced this issue Jul 6, 2020
tomcw pushed a commit that referenced this issue Jul 6, 2020
. It's an Apple II plus clone.
. The 48K bank-switched Rom is controlled with AN0 and AN1.
. The character generation video Rom has two full character sets: English and German (F10 to switch).
NB. At the prompt, "TEST" runs the ROM self-test.
@tomcw tomcw added this to the 1.29.14 milestone Jul 6, 2020
@tomcw
Copy link
Contributor Author

tomcw commented Jul 6, 2020

Closing as @ivanizag's PR #807 has been merged into master for this issue.

@tomcw tomcw closed this as completed Jul 6, 2020
fenarinarsa pushed a commit to Fr3nchT0uch/AppleWin that referenced this issue Jul 11, 2020
…(PR AppleWin#807)

. It's an Apple II plus clone.
. The 48K bank-switched Rom is controlled with AN0 and AN1.
. The character generation video Rom has two full character sets: English and German (F10 to switch).
NB. At the prompt, "TEST" runs the ROM self-test.
# Conflicts:
#	AppleWinExpress2019.vcxproj.filters
@tomcw
Copy link
Contributor Author

tomcw commented Aug 18, 2020

@Drakepirate , @ivanizag - FYI there's a new AppleWin 1.29.14.0 here, which includes this update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants