MSX Emulator

Started by airship, September 08, 2007, 08:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

airship

Is there (or could there be) an MSX computer emulator for the C128? I don't see why not. The Z80 is the same chip at the same speed as in the C128, and the SID and VIC (perhaps under 8510 control) could certainly handle the relatively crude audio and video requirements. I would think the MSX, MSX2, and MSX2+ would be easy, though with double the clock speed the TurboR version would be unreachable.

It's interesting for the MicroSoft involvement in trying to make it a standard, if nothing else.

The Wikipedia treatment: http://en.wikipedia.org/wiki/MSX

User's community: http://www.msx.org/

Technical info is here: http://fms.komkon.org/MSX/

There is also a version of SymBOS for the MSX: http://www.msx.org/modules.php?op=modload&name=Downloads&file=index&req=visit&lid=837
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Blacklord

Quote from: airshipThere is also a version of SymBOS for the MSX: http://www.msx.org/modules.php?op=modload&name=Downloads&file=index&req=visit&lid=837
SymbOS is (sorta) being discussed in two other threads (here & here). It's (unfortunately) unlikely there'll ever be a C128 conversion. A big shame actually, as it appears to be a nicely polished OS with somewhat more capbability than GEOS.

cheers,

Lance

nikoniko

A reasonable environment for running BASIC could probably be done, but with the 128's Z80 effectively operating at 2Mhz rather than the full 4Mhz, I doubt you'd have a pleasant time doing anything else. However, it would be a very cool accomplishment nonetheless. :D

A more realistic, albeit less exciting, goal might be a decent BBC Micro environment.

airship

You mean like the BBC Micro emulator listed here? :)

http://members.optusnet.com.au/vortex69/64EMULATES/64EMU.htm

And I forgot about thw 1/2 speed throttle on the Z80. Still, at 1/2 speed, it would still be interesting, no? And you might be able to figure out some tricks to improve that.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Blacklord

Quote from: airshipYou mean like the BBC Micro emulator listed here? :)

http://members.optusnet.com.au/vortex69/64EMULATES/64EMU.htm

And I forgot about thw 1/2 speed throttle on the Z80. Still, at 1/2 speed, it would still be interesting, no? And you might be able to figure out some tricks to improve that.
Not all of these are emulators - the 286 emulator is a sim - the 'dir' command works, but that is all, the Amiga emu falls into the same category.

The two Apple emulators are really AppleSoft BASIC simulators, the version 2 seems to work a little betrer than the first, I might play with this & see if it can be converted to the C128's 80 colum 2MHz mode.

I couldn't get the PET emulator to work :( There's also a PET emulator for the 128 code is here (I've never bothered trying to build this, though it would be a good start to expand upon (SuperPET emulator for the 128 anyone ?) :

The program consists of 4 parts

part 1 is the basic program which loads at address $1C01
part 2 is the setup routine which is at address $1D00
part 3 is the poke translation routine which is at address $1E00, and relocated to $0400
part 4 is the peek translation routine which is at address $2000, and relocated to $0600



basic part:

10 bank0
20 graphic5,1
30 fast
40 poke53280,0
50 color5,14
60 sys7424
70 print"PET EMULATOR FOR C128 BY BLACKY STARDUST"
80 clr
90 new

start: (load $1D00, orig $1D00)
sei
ldx #$00
stx $2F
stx $31
stx $33
stx $35
stx $39
ldx #$10
stx $30
stx $32
stx $34
ldx #$05
stx $D506
ldx #$00
transferloop:
lda $1E00,x
sta $0400,x
lda $1F00,x
sta $0500,x
lda $2000,x
sta $0600,x
lda $2100,x
sta $0700,x
inx
bne transferloop
ldx #$4C
stx $02B0
stx $02A2
ldx #$00
stx $02B1
stx $02A3
ldx #$04
stx $02B2
ldx #$06
stx $02A4
ldx #$4C
stx $0380
ldx #$00
stx $0381
ldx #$07
stx $0382
ldx #$EA
stx $0383
cli
rts

pokestart: (load $1E00, orig $0400)
lda $FF00
sta tempmmu
lda $7F
beq otherbankpoke
cpx #$3F
beq checkpoke
otherbankpoke:
lda $FF00
jmp $02B3
tempa:
.byte $00
tempx:
.byte $00
tempy:
.byte $00
tempmmu:
.byte $00
checkpoke:
sta tempa
stx tempx
sty tempy
ldx 02B9
stx pokein+1
inx
stx pokein2+1
pokein:
ldy $00
pokein2:
ldx $00
cpx #$80
bcc checknextpoke
cpx #$88
bcc doscreenpoke
checknextpoke:
cpx #$00
beq checkzppoke
cpx #$02
beq checkkeypoke
cpx #$01
beq ignorepoke
cpx #$03
beq ignorepoke
cpx #$E8
beq checksoundpoke
cpx #$E7
bcs ignorepoke
normalpoke:
lda #$3F
sta $FF00
txa
clc
adc #$18
sta storeit+2
sty storeit+1
pla
storeit:
sta $0000
ldx tempmmu
stx $FF00
rts
doscreenpoke:
jmp dorealscreenpoke
checksoundpoke:
jmp checkrealsoundpoke
checkzppoke:
cpy #$9E
beq ndxpoke
cpy #$C4
beq pnt1poke
cpy #$C5
beq pnt2poke
cpy #$C6
beq pntrpoke
cpy #$D8
beq cursypoke
ignorepoke:
pla
rts
ndxpoke:
pla
sta $D0
rts
pnt1poke:
pla
sta $E0
rts
pnt2poke:
pla
sta $E1
rts
pntrpoke:
pla
sta $EC
rts
cursypoke:
pla
sta $EB
rts
checkkeypoke:
cpy #$6F
bcc ignorepoke
cpy #$79
bcs ignorepoke
keypoke:
tya
sec
sbc #$25
sta storekey+1
pla
storekey:
sta $034A
rts
dorealscreenpoke:
txa
sec
sbc #$80
tax
pla
jsr pokevdcbyte
ldx tempmmu
stx $FF00
rts
putvdcreg:
stx $D600
putvdcregloop:
bit $D600
bpl putvdcregloop
sta $D601
rts
getvdcreg:
stx $D600
getvdcregloop:
bit $D600
bpl getvdcregloop
lda $D601
rts
pokevdcbyte:
pha
lda #$3E
sta $FF00
txa
ldx #$12
jsr putvdcreg
tya
ldx #$13
jsr putvdcreg
pla
ldx #$1F
jmp putvdcreg
soundon:
.byte $00
checkrealsoundpoke:
cpy #$4B
beq checksoundonvalue
cpy #$48
beq checkfrequency
jmp normalpoke
checksoundonvalue:
pla
cmp #$10
beq turnonsound
cmp #$00
beq turnoffsound
rts
turnonsound:
ldx #$3E
stx $FF00
ldx #$FF
stx $D400
ldx #$08
stx $D403
ldx #$00
stx $D405
ldx #$F0
stx $D406
ldx #$41
stx $D404
ldx #$0F
stx $D418
ldx #$01
stx soundon
back:
ldx tempmmu
stx $FF00
rts
turnoffsound:
ldx #$3E
stx $FF00
ldx #$00
stx $D418
stx soundon
jmp back
checkfrequency:
ldx #$3E
stx $FF00
pla
cmp #$00
bne pokefreq
sta $D418
jmp back
pokefreq:
sta freqvalue+1
lda #$FF
sec
freqvalue:
sbc #$00
sta $D401
ldx soundon
cpx #$01
bne back
ldx #$0F
stx $D418
jmp back

peekstart: (load $2000, orig $0600)
lda $FF00
sta tempmmu
lda $7F
beq otherbankpeek
cpx #$3F
beq checkpeek
otherbankpeek:
lda $FF00
jmp $02A5
tempa:
.byte $00
tempx:
.byte $00
tempy:
.byte $00
tempmmu:
.byte $00
checkpeek:
sta tempa
stx tempx
sty tempy
ldx $02AA
stx peekin+1
inx
stx peekin2+1
peekin:
ldy $00
peekin2:
ldx $00
cpx #$80
bcc checknextpeek
cpx #$88
bcc doscreenpeek
checknextpeek:
cpx #$00
beq checkzppeek
cpx #$02
beq checkkeypeek
normalpeek:
txa
clc
adc #$18
sta peekit+2
sty peekit+1
lda #$3F
sta $FF00
peekit:
lda $0000
ldx tempmmu
stx $FF00
rts
doscreenpeek:
jmp dorealscreenpeek
checkzppeek:
cpy #$34
beq memsiz1peek
cpy #$35
beq memsiz2peek
cpy #$8D
beq time1peek
cpy #$8E
beq time2peek
cpy #$8F
beq time3peek
cpy #$9E
beq ndxpeek
cpy #$C4
beq pnt1peek
cpy #$C5
beq pnt2peek
cpy #$C6
beq pntrpeek
cpy #$D5
beq linelenpeek
cpy #$D8
beq cursypeek
jmp normalpeek
memsiz1peek:
lda #$00
rts
memsiz2peek:
lda #$80
rts
time1peek:
lda $A0
rts
time2peek:
lda $A1
rts
time3peek:
lda $A2
rts
ndxpeek:
lda $D0
rts
pnt1peek:
lda $E0
rts
pnt2peek:
lda $E1
rts
pntrpeek:
lda $EC
rts
linelenpeek:
lda #$4F
rts
cursypeek:
lda $EB
rts
checkkeypeek:
cpy #$6F
bcc jmpnormalpeek
cpy #$79
bcc keypeek
jmpnormalpeek:
jmp normalpeek
keypeek:
tya
sec
sbc #$25
sta dokey+1
dokey:
lda $034A
rts
dorealscreenpeek:
txa
sec
sbc #$80
tax
jsr peekvdcbyte
ldx tempmmu
stx $FF00
rts
peekvdcbyte:
lda #$3E
sta $FF00
txa
ldx #$12
jsr putvdcreg
tya
ldx #$13
jsr putvdcreg
ldx #$1f
jmp getvdcreg