FPGAs and 65816's

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
sweh
Posts: 2130
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: FPGAs and 65816's

Post by sweh » Sat May 03, 2014 1:04 pm

Hmm, a 2Gb SDcard formatted as FAT16....

Given that BEEB.MMB maxes out at 100M try a smaller card; 2Gb is at the max of what FAT16 would handle. Depending on how you formatted it, you might have ended up with FAT32.
Rgds
Stephen

PhilYoung
Posts: 203
Joined: Sun Jun 12, 2011 4:55 pm
Contact:

Re: FPGAs and 65816's

Post by PhilYoung » Sat May 03, 2014 1:55 pm

dominicbeesley wrote:Got a bit further this morning - the BEEB.MMB file wasn't in the first eight directory entries on the card so I moved it with a sector editor. It now recognises the card and image but I just get garbage when I do a *DCAT or *DIN/*.

Any ideas?
Maybe check if the same card works on a real BBC and SD adapter (assuming you have access to one) ?

Or see what FPGA/SD examples you can find, and see if those work OK with your hardware set-up, so outside of the emulated BBC environment. There is an SD card slot on the Terasic DE1, so I expect the documentation or tutorials for that should go into some detail that you could 'borrow'.

Remember, good artists copy, great artists steal.

Good luck,

Phil Young

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Sat May 03, 2014 5:14 pm

Thanks both,

I've had a dig with the sector editor and its definitely FAT16. I've got no other hardware to try it on at the moment so will have to try and get hold of another card. It definitely must be working to a limited extent as its getting as far as finding the BEEB.MMB file in the directory. I just wondered if this was a known issue - maybe with the file being toward the end of the cards address space.

I probably ought to reformat it but there's a load of GP2X stuff on there that I was working on years ago. I'll try backing it up and reformatting the card later.

Its not that easy getting hold of the older, smaller MMC cards new so I'll have to have buy a few second from ebay and see what I can get to work. I don't want to fork out much, this is just a stop-gap. I'll be rigging up a Vinculum at some point to make something more like the retroclinic datacentre thing or maybe an IDE disc like the JGHartson thing I've got on my Master...

Cheers

Dom

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Sat May 03, 2014 6:51 pm

Got it working now! Reformatting the card and rewriting the image has done it - it must have been a limit on the sector number for the file or something.

Now a question - this thing only has mode 0 at the moment - were there any mode 0 games?

D

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Tue May 06, 2014 8:36 am

I tried out a few games - some of them are quite playable even though in the wrong mode!

One that has eluded me so far is Acornsoft Snapper, it loads up ok draws the maze and scoreboard but no ghosts or snapper appear and it just hangs. After rigging up my in-circuit debugger (a cheapo Chinese 8 bit logic analyser that dumps a 6-bit protocol dump of data and address lines to a CSV then a script that reassembles that into a readable disassembly showing what go executed) I found it gets into a loop where it is waiting for the data on port B of the user via to change i.e. a continual CMP &fe60:BEQ -3....I just can't find what piece of hardware I'm not emulating right that causes it to do this. So, was there a special controller that hung off the user port? I thought all the acornsoft stuff just worked with analogue joysticks off the Analague port....

D

station240
Posts: 864
Joined: Tue Feb 09, 2010 6:11 pm
Location: South Australia
Contact:

Re: FPGAs and 65816's

Post by station240 » Tue May 06, 2014 9:34 am

dominicbeesley wrote:I tried out a few games - some of them are quite playable even though in the wrong mode!

One that has eluded me so far is Acornsoft Snapper, it loads up ok draws the maze and scoreboard but no ghosts or snapper appear and it just hangs. After rigging up my in-circuit debugger (a cheapo Chinese 8 bit logic analyser that dumps a 6-bit protocol dump of data and address lines to a CSV then a script that reassembles that into a readable disassembly showing what go executed) I found it gets into a loop where it is waiting for the data on port B of the user via to change i.e. a continual CMP &fe60:BEQ -3....I just can't find what piece of hardware I'm not emulating right that causes it to do this. So, was there a special controller that hung off the user port? I thought all the acornsoft stuff just worked with analogue joysticks off the Analague port....
I do recall some games required the user VIA to be installed as they used some of the timers etc.

Only the Master Compact has userport (digital) mouse input, and I doubt any games supported that.

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Tue May 06, 2014 9:41 am

The user via is installed and working, I've tested the timers and it has an MMBEEB SDCARD hanging off it.

I've tried setting unused portA/portB pins and handshake lines to 1 and 0 no difference. It just sits there polling port B....it looks like it is genuinely expecting something to be attached to port B I might rig up some switches and see if it is expecting a kempston type joystick to be attached or something...

D

User avatar
richardtoohey
Posts: 3739
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: FPGAs and 65816's

Post by richardtoohey » Tue May 06, 2014 10:11 pm

Tom mentions Snapper and VIA in this post ...

viewtopic.php?f=1&t=8164#p86252

... probably not enough detail to help, but might give a clue? If even related!

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Wed May 07, 2014 9:11 am

Aha, that could well be a clue - I'll try routing port_B_o to port_B_i....

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Sat Jun 20, 2015 10:38 am

I'm an idiot and forgot your post! I finally dug the thing out and decided I wanted to play Snapper - after an hour of looking through thousands of lines of debug output I worked it out for myself! Routing out to in on portB was what was required.

I suspect that actually the 6522 core needs a tweak as it I'm pretty sure that the time should set the output latch and that is what should be read - not that value on the pin. I've only got B-em to test with no real hardware but that doesn't read the T1 on PB7 when DDRB is set to input...

Anyway thanks again and I can now play Snapper...

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Sat Jun 20, 2015 1:12 pm

After a little more analysis I've worked out the problem. The 6522 core was doing the right thing but the Super MMC Rom was the "cause" of the problem. The Acornsoft games assume that the User VIA is configured as all outputs but Super MMC leaves the DDRB register as &03. Routing the output back to the input "cures" the problem but on real hardware might cause a problem if there was something plugged into the user port that pulled the PB7 pin low or high...

I know this may all be a bit boring and esoteric but I thought I'd post it up here in case anyone else runs into the same problem

D

User avatar
tricky
Posts: 3997
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: FPGAs and 65816's

Post by tricky » Sat Jun 20, 2015 2:19 pm

Thanks, it's always good to have as many reminders of these things as possible, sounds like an easy fix for snapper, but maybe something that could be added to the new MMC ROM.

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Fri Jun 26, 2015 4:16 pm

Next test game that has failed is Repton.

It goes through the start screen ok and you get to the menu when I start the game it plays the tune for a second or so (sounds maybe a little slow) then game field appears with repton in place, as soon as i press any direction key repton disappears and it hangs?

I'm not sure where to start looking with this one...

D

dominicbeesley
Posts: 960
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: FPGAs and 65816's

Post by dominicbeesley » Fri Jul 24, 2015 11:04 am

I've made some more progress on the "real" hardware side of things. I've kind of shelved the FPGA project as I discovered that the T65 hand very minimal 65816 implementation and the only other close runner looked like a lot of work to get through all the undocumented code and discover what might work.

So back to the real 65816. I'd got stuck with it not working and put it away last year when the baby arrived. A couple of weeks ago I got all my beeb stuff out and couldn't resist.

I've added a XC9572 CPLD and could not get that to work reliably. I tried adding address line buffers and all sorts of dicking around with the timing. I also re-made the 65816 daughter board with more decoupling capacitors closer to the chip and a better ground plane. Finally yesterday I separated out all the timing signals, buffered with 74F244's and found a setting for "fast slew rate" in the CPLD software. I suspect that the phi2 clock was not rising fast enough or not pulled high strongly enough as the CPU was randomly executing extra cycles during the phi2 high period. My new 500MSa/s logic analyser has been a big help here.

After all this I can now again boot into BASIC and use some of the functions on my RetroClinic datacentre. I get the odd "glitch" in BASIC manifested as random error messages - I'm not sure whether this is a timing problem, the clock still not being quite right or just something that the MOS/BASIC doesn't like about the 65816.

Anyway progress of sorts...I have now started training up my assistant in the hope that she will help me in writing a 16bit MOS...
Attachments
DSC_0301-s.JPG
DSC_0300-s.JPG
DSC_0299-s.JPG
DSC_0298-s.JPG
DSC_0286-s.JPG

Post Reply