Jump to content
IGNORED

Now that MESS supports the Arcade Board...


Recommended Posts

I wonder how hard it would be to port stuff over to the Arcade Board from other systems.

 

Unfortunately I can't seem to get CP/M to boot on the current MESS so the possibility of running the Z80 and the AB side by side isn't there, which would make the idea of porting from, say, ColecoVision be a bit less daunting, slower Z80 aside. Though there is the CreatiVision which uses a 6502, 9918 and PSG (though, SN76489 rather than AY8910)...

Link to comment
https://forums.atariage.com/topic/234084-now-that-mess-supports-the-arcade-board/
Share on other sites

I've had so much trouble with MESS I pretty much gave up using it. Way too volatile.

 

I don't have any details on the arcade board but it shouldn't be too difficult to patch a program to use different addresses.

However, you'll probably have to extract the actual game from a cart image and relocate it in memory which would be a bit more work.

I suppose you could automated the process by patching an emulator to automate the work for you. That way if you can patch one game you can pretty much patch them all as long as they don't bank switch which would require more work.

 

Porting from 6502 to Z80 would be pretty time consuming and you are basically talking about a complete disassembly and rewrite.

 

Since the arcade board has pretty much zero support and next to no owners, I have to wonder what the point is though.

 

*edit*

Or is this a different arcade board than I'm thinking of?

Edited by JamesD

You are talking about the Apple II board, not the one someone did for S100 buss. So... slightly more complex.

I don't know how much of the Apple II hardware the CP/M board has access to so it may not even be possible.

(I forgot I was in the Apple II section)

Edited by JamesD

The Z80 SoftCard has full access to all the Apple memory (it doesn't have any of its own), but in a different arrangement.

 

The "Arcade Board" is a TMS9918 sprite card with an AY8910 on it (though addressed differently than the Mockingboard).

 

There seems to be a bug of some sort, because the memory test breaks, but at least BDEMO works pretty well, as do most of the test programs.

 

Here's a test disk.

 

The switch "-sl4 arcbd" is needed to give to MESS to enable it, and it puts the 9918 display on the right opposite the regular display.

As long as the Z80 has full access my comments should hold. You *may* need to relocate code and will definitely need to change addresses.

Speed will probably be an issue on games that reuse sprites a lot so pick something simple to start.

 

The Colecovision doesn't use an AY sound chip but a conversion could be done.

The AY has a wider range so it's a matter of extracting channel and converting frequency info between chips for the most part.

 

I'd suggest a Mockinboard to handle the sound due to the extra channel but there are extra steps involved when writing to a Mockingboard.

Otherwise you have to drop a channel or multiplex a channel.

I wouldn't even know where to begin on the last option other than alternate between channel settings every interrupt.

 

Set the AY waveform to a square wave since the SN waveform is fixed.

It will require more code and data though since the physical interface on the AY chip is more complex.

I think the SN has channel and frequency combined if I remember right.

On the AY it is separate and you may need to set high and low parts of the frequency.

Changes to the player shouldn't be huge but the amount of data will increase.

 

The Creatavision steps would be similar but you could skip the CP/M board.

 

You'd need to convert to keyboard and Apple joystick.

Keyboard's easy enough. Hell, accessing the keyboard is easier on the Apple than prolly any other 8-bit platform. XD

 

Joystick... Well, I have the Applesoft disassembly by Bob Sander-Cederlof, I can probably use the PDL() code as a base for handling the joystick.

 

What might be particularly interesting is a port of Zelda. What might be a better *start* would be code to set up the 9918 in 40x24 text mode and use it for text display.

Keyboard's easy enough. Hell, accessing the keyboard is easier on the Apple than prolly any other 8-bit platform. XD

 

Joystick... Well, I have the Applesoft disassembly by Bob Sander-Cederlof, I can probably use the PDL() code as a base for handling the joystick.

 

What might be particularly interesting is a port of Zelda. What might be a better *start* would be code to set up the 9918 in 40x24 text mode and use it for text display.

Mod the MESS code to use one of the newer graphics chips and use 80x24 text. Edited by JamesD

IIRC, wouldn't the extra lines on the V9938 interfere with access to the AY8910?

 

Though 40x24 would be a start. It would still be an improvement over Apple text - especially if CP437 were loaded onto the RAM.

IIRC, wouldn't the extra lines on the V9938 interfere with access to the AY8910?

 

Though 40x24 would be a start. It would still be an improvement over Apple text - especially if CP437 were loaded onto the RAM.

I'd have to do a little research.

I thought the 9938 and 9958 were interfaced the same on the CPU side but could address more dedicated video RAM.

As long as they don't require any more memory addresses to the CPU it wouldn't be a problem.

If the AY is addressed before the VDP then it shouldn't matter either.

Hm. The TMS9918 is hooked to 4 lines on the Arcade Board, though code is set up to use 2 for read and 2 for write always. It should be doable, then, but might break the demos (that's prolly fixable, especially for the big demo which defines the addresses as variables in code).

 

Running as a ][+ instead of a //e, I recognize the particular failure mode of the "softcard" device under CP/M 2.2: it's the same one that came up when *I* tried implementing a Z80 in Dapple. So I guess it "works", but not well enough for CP/M.

 

I do have a couple smaller (i.e., 8 KB) MSX games to possibly bring over, and both have Apple ][ versions...

I finally found the 9918 info buried in the docs. It uses 4 addresses as well.

 

I think the newer chips are backwards compatible but they support additional internal registers and commands.

 

*edit*

Not sure what you meant by lines so I double checked.

 

Section 4 of the 9918 manual has the info.

Edited by JamesD

6bbzIGD.png

 

It's a start!

 

ETA:

 

jTmQTN1.png

 

I'm starting to see success staring back at me.

10 POKE 49347, 0: POKE 49347, 0
20 FOR I=128 TO 135: READ X: POKE 49347, X: POKE 49347, I: NEXT
30 DATA 0,208,2,0,0,32,0,245
40 PRINT:PRINT CHR$(4)"BLOAD MSX.FNT,A$4000"
50 POKE 49347, 0: POKE 49347, 0
60 PRINT "INITIALIZING MEMORY": FOR I=0 TO 16383: POKE 49346, 0: NEXT
70 POKE 49347, 0: POKE 49347, 64
80 PRINT "COPYING FONT": FOR I = 0 TO 2047: POKE 49346,PEEK (16384+I): NEXT
90 PRINT "PRINTING A TEXT PATTERN"
100 FOR I=0 TO 255: POKE 49346, I: NEXT
Edited by The Usotsuki

Well...

 

I kind-of have this and I kind-of don't.

 

This works...

10 FOR I=2088 TO 3007
20 A1=I-256*INT(I/256):A2=INT(I/256)
30 A3=(I+16344)-256*INT((I+16344)/256):A4=INT((I+16344)/256)
40 POKE 49347,A1:POKE 49347,A2:X=PEEK(49344):POKE 49347,A3:POKE 49347,A4:POKE 49346,X
50 NEXT I
60 FOR I=1 TO 40:POKE 49346,160:NEXT

works, but my attempt to translate it to 6502...

abslot     =        4
abbase     =        $C080+(abslot<<4)
abrddat    =        abbase
abwrdat    =        abbase+2
abwrreg    =        abbase+3

          .org      $9000
entry:    lda       #$28
          sta       $05
          lda       #$08
          sta       $06
          lda       #$00
          sta       $07
          lda       #$48
@1:       lda       $05
          sta       abwrreg
          lda       $06
          sta       abwrreg
          ldx       abrddat
          lda       $07
          sta       abwrreg
          lda       $08
          sta       abwrreg
          stx       abwrdat
          inc       $05
          bne       @2
          inc       $06
@2:       inc       $07
          bne       @3
          inc       $08
@3:       lda       $07
          cmp       #$98
          bne       @1
          lda       $08
          cmp       #$4B
          bne       @1
          rts
          lda       #' '+$80
          ldy       #$40
@4:       sta       abwrdat
          dey
          bne       @4
          rts

...fails horribly.

 

This is the code to scroll the 40x24 display up one line.

It's alive!

 

http://3.buric.co/tms01.zip

The code's a bit messy but AFAICT it works. There's no support for graphics (yet, I'm considering it) or the 32x24 text mode, or slots other than 4 (you can easily reassemble for that by changing "abslot").

Here's the commands:

USR() and &POKE are the equivalent of PEEK and POKE for the VDP's memory. They work just like the 6502 equivalents.

&COLOR= sets the color of the display. TMS seemed to like white on medium blue and a lot of 9918-based systems seemed to go with it; this is 245. (Color values are computed background*16+foreground.)

&TEXT initializes the TMS9918 in text mode. This code comes pretty much straight out of the manual.

&DEF loads a font quickly into the memory (faster than doing 2048 peeks and pokes). You'll see this used in the HELLO file.

&HOME clears the screen. &HTAB and &VTAB move the cursor. These all work like the FPBASIC commands.

&ON enables, and &END disables, I/O redirection to the 9918. (The Arcade Board has an AY8910, but I haven't yet rewritten the bell code to use it in place of the system beeper.) &END is equivalent to PR#0:IN#0.

When PRINTing, most control characters work as expected with Ctrl-L clearing the screen.

INVERSE text is somewhat supported, but you need to use POKE 50,127 to avoid undesirable side effects (NORMAL works *cough* normally).

I'm open to improvements - I am a terrible 6502 coder after all.

There are comments - although putch, getch and scroll are admittedly poorly commented.

 

In getch's case it's because I never really finished it, but only implemented the bare minimum to get it working and showing a cursor.

Checked it and it works on my end. o.o;

 

Typical of me it's some awful, brute force coding. But I think I get how at least the 9918 interfacing works.

 

I figured this would be the most practical starting point, rather than trying to port stuff right away and watching my head explode.

http://3.buric.co/tms02.zip

 

This version will work under ProDOS. Also I cleaned up the source a little bit.

 

I'm not sure what I want to try to tackle next - Graphics II (which will be &HGR) or Graphics I. I should probably try to figure out how to move the system bell to the Arcade Board, by modifying what's left of my "Mockingbell" code...

There are comments - although putch, getch and scroll are admittedly poorly commented.

Those aren't comments, those are labels.

*edit*

I just grabbed the latest version and it looks much better.

Edited by JamesD

I'm trying to figure out stuff about the graphics mode now. Wish I could dump the VRAM from a running MSX, SG or ColecoVision.

 

My as yet unreleased current code base allows me to set up the modes (&GR1, &HGR) but I can't really do much with them yet.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...