ATOM FPGA

discussion of games, software, hardware & emulators relating to the Acorn Atom and Acorn System machines.
User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Tue Oct 15, 2013 8:22 pm

Hi Kees,

The reason I am (bit) banging on about the older SDROM interface is because:
a) This is what Alan implemented in his FPGA
b) Implementing AtomMMC in the FPGA is hard because of the complexity of the PIC, and the fact that don't think an equivalent Open Source PIC core exists.

I believe iSDDOS 2.2 supported the older VIA based SDROM interface.

Do you have the source for this knocking about? I was just interested in comparing the read/write byte code with the MMBeeb version.

How much slower were these than AtomMMC?

Dave

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Tue Oct 15, 2013 8:31 pm

Found a relevant post from Charlie:
http://arduinonut.blogspot.co.uk/2009/0 ... m-rev.html

I think the mmbeeb bit banging code is very slick!

Dave

User avatar
AlanD
Posts: 241
Joined: Fri Jan 09, 2009 8:30 pm
Contact:

Re: ATOM FPGA

Post by AlanD » Tue Oct 15, 2013 9:08 pm

Hello Dave

i found the biggest draw back to sddos is only about 1 in 10 of my sd cards work

i partially dissassembled sddos rom

the spi part is

;;--------------------------------------------------------------
;;-- via spi routine write byte bit banger
;;-- SDSS data output bit 5; 0x20
;;-- SDCLK data output bit 6; 0x40
;;-- SDMOSI data output bit 7; 0x80
;;-- SDMISO data input bit 0 0x01
;;--------------------------------------1111111111111111111111111111111111111111
.lAEFA
STX &03D4
STY &03D5
LDY #&08
.lAF02
PHA
AND #&80
STA &B800
ORA #&40
STA &B800
LDX &B800
EOR #&40
STA &B800
TXA
ROR A
PLA
ROL A
DEY
BNE lAF02
LDY &03D5
LDX &03D4
RTS


AlanD

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Tue Oct 15, 2013 9:26 pm

Very interesting....

Comparing the inner loops, which are both bit banging a single bit
- sddos is 38 cycles
- mmbeeb is 14 cycles

That's nearly three times faster.

But AtomMMC is even faster, I think it transfers a whole byte in 16 cycles, so effectively 2 cycles per bit.

Dave

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 6:27 am

Hi guys,

sorry, I misunderstood the thread about bit-banging SPI.

I've added some information about a Xilink 65SPI chip which could be interesting. Also the sources for the SDROM v2.2 and Charlie's AtoMMC rom v1.3 are included based on connecting the SD-card to the 6522 VIA.

Greetings
Kees
Attachments
SDROM v2.2.zip
(90.11 KiB) Downloaded 76 times
ATOMMC_300.zip
(86.22 KiB) Downloaded 60 times
65SPI.zip
(224.34 KiB) Downloaded 60 times

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Wed Oct 16, 2013 7:00 am

Thanks for this Kees,

65SPI looks very interesting. The source is an ABEL file, which I think is now obsolete. I'll see if the latest version of ISE is able to migrate this. Otherwise, it would need to be manually ported.

Dave

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Wed Oct 16, 2013 7:03 am

Actually, this derivative might be a better starting point:
http://www.6502.org/users/andre/spi65b/
it's already been re-written in VHDL.

Dave

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 7:45 am

hoglet wrote:The options seem to be:

1. Port Atom Software Archive to SDROM/SDDOS

2. Implement the AtomMMC2 interface - very challenging, because of it's complex PIC device.

3. Plug in the real AtomMMC interface to the FPGA, but this is cheating, and there would be issues with 3.3V/5V IO incompatability.

I'll have a think about the possibility of (1), where each title becomes a separate disk. But this is quite a lot of new work.

Kees, do you have any bright ideas? I want my second Atom to be as useful as my first :lol:

Dave
Hi Dave,

I think this could be easily done with your Java skills :lol: The easiest way is to create a .DSK image file for every directory which also includes the menu. This way you can always restart the menu from every disk.

The problem could be the memory usage, most standard programs will run but programs using memory area #0A00-#0AFF and #2000-#21FF will cause problems and have to be rewritten with a (down)loader routine.

Greetings
Kees

Prime
Posts: 2808
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: ATOM FPGA

Post by Prime » Wed Oct 16, 2013 8:05 am

AtoMMC may be able to work at 3.3V, the PIC can work down to 2.0V, if a CMOS 74hc174 where used and the voltage dividers removed from the SPI lines then it should work.

Cheers.

Phill.

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Wed Oct 16, 2013 8:09 am

oss003 wrote:I think this could be easily done with your Java skills :lol: The easiest way is to create a .DSK image file for every directory which also includes the menu. This way you can always restart the menu from every disk.
What's the limit on the number of files per disk? 31? I think we will hit this in places (e.g. BB)

I was thinking of a disk image per title, which would contain
- the auto generated bootstrap script
- one or more files used by just this title

We would then end up with about 400 disk images (~40MB)

Can .DSK images be smaller than 100K?

There would be one additional one that would contain the menu files (10 in total)

The only thing I have not got straight is exactly how to make best use of multiple drives.

I was think the menu disk would always be mounted in drive 0, so that shift break would always re-load the menu:
*DONBOOT 0,0

The title disc would be dynamically mounted in drive 1, and then the bootstrap program would execute

*DIN 1,123 // Title ID 123 would be in Disk 123
*DRIVE 1
*DIR 1
*RUN 123 // Bootstrap program also called 123

Does this seem workable?

The only problem would be if *DRIVE 1 was somehow sticky, so that shift break would try to execute !BOOT of Drive 1 instead of reloading the menu from drive 0.

I'll have a go at the weekend if my SD Card socket has arrived by then.

Dave

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 8:16 am

oss003 wrote:I think this could be easily done with your Java skills :lol: The easiest way is to create a .DSK image file for every directory which also includes the menu. This way you can always restart the menu from every disk.
For some directories, multiple .DSK files have to be created.

Maybe it's better to mount the menu in drive 0 (or 0 and 1) and mount/switch the software in drive 2-3.

Greetings
Kees

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 8:26 am

Disk images can contain 31 files and are always 100kB, otherwise it's possible to exceed the image file length while saving a file in SDDOS.

You are also limited to max 7 chars per filename but you can use a 1 letter qualifier as subdirectory.

Greetings
Kees

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 8:40 am

hoglet wrote:Can .DSK images be smaller than 100K?
Just did a test and it works as long as you don't save anything to this disk.

Mount disk and type *VDU-HI

Greetings
Kees
Attachments
VDU-HI.zip
(1.15 KiB) Downloaded 53 times

User avatar
AlanD
Posts: 241
Joined: Fri Jan 09, 2009 8:30 pm
Contact:

Re: ATOM FPGA

Post by AlanD » Wed Oct 16, 2013 7:31 pm

Hello Dave

here is a simple spi port i wrote for another project it was used to talk to sd cards it may be of some use i guess
spi.rar
(1.02 KiB) Downloaded 86 times

AlanD

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Wed Oct 16, 2013 9:09 pm

Thanks for all the input and suggestions guys!!

Today I received one of these:
SdCardAdaptor.JPG
Carefully wired it up to my Papilio Arcade Wing, powered up, and checked voltages. Hmmm, no 3.3V and Voltage Regulator getting very hot! Powered down. Turns out there is a short between 3.3V and GND. Bugger!!! Spend the next two hours desoldering SMT components, in an attempts to track it down. Eventually spotted it on the underside of the board. Knife wielded. Resoldered all the SMD components. Powered back up again. Voltages seem OK. Insert SDCard, type SDDOS and amazingly it works!!!!!

So, I can now load programs from DSK files (I made an SDCard of all the DSK images I could find).

Kees, one thing I have realized now is that after RESET the file system is always Cassette, and I have to manually enter SDDOS. Is there a trick to getting SDDOS to initialize on reset? (Like the AtomMMC enable LK3 interrupt?).

Dave

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Wed Oct 16, 2013 9:32 pm

Hi Dave,

this proofs that not only the Atom isn't working the first time .... :lol:

SDDOS is a normal ROM with #40,#BF identifier and cannot be initialised on BREAK.

You could install the same boot routine like the one in AtoMMC because there's still room in the SDROM. Hmmm .... will do some testing to see if this works.

Greetings
Kees

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Wed Oct 16, 2013 9:46 pm

oss003 wrote:You could install the same boot routine like the one in AtoMMC because there's still room in the SDROM. Hmmm .... will do some testing to see if this works.
Are you talking about the way the A000 AtoMMC initializes, or the E000 AtoMMC?

If I remember correctly, the A000 AtomMMC relies on an interrupt generated by the AtomMMC hardware connected to PL8. In the case of my Atom FPGA, there will be no interrupt, because it's just a bit banger interface connected to the 6522.

Here's a question for Alan. Did you get anywhere with the Olimex MOD-VGA Board? This does seem a great basis for a entry level FPGA Atom. There's also one with 32MB SDRAM Chip for £5 more.

Dave

User avatar
AlanD
Posts: 241
Joined: Fri Jan 09, 2009 8:30 pm
Contact:

Re: ATOM FPGA

Post by AlanD » Wed Oct 16, 2013 10:24 pm

Hello Dave

yes i did get one of those olimex boards (you can fit either an sram or dram) i fitted an sram
i hacked the ps2 connector and it works a treat but have not done much to it since wakefeild

glad to hear you had some success with sddos

i think we need some pics of your fpga atom running some games (important test software i mean) =D> =D>

AlanD

User avatar
AlanD
Posts: 241
Joined: Fri Jan 09, 2009 8:30 pm
Contact:

Re: ATOM FPGA

Post by AlanD » Wed Oct 16, 2013 10:42 pm

Hello Dave

have you tried the turbo mode pressing f1 - f2 function keys switches the 6502 clock between 1MHz and 8 Mhz

makes playing games fun

AlanD

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Thu Oct 17, 2013 7:14 am

Yes, I accidentally hit that key, and nearly fell off my chair. :shock:

It also has a similar speed up on LOADing in SDDOS (not surprisingly I guess)

Dave

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Thu Oct 17, 2013 8:21 pm

Here's some pictures of some, errrr, test programs running.....
IMG_0348.JPG
IMG_0324.JPG
IMG_0326.JPG
IMG_0337.JPG
IMG_0341.JPG
IMG_0343.JPG
Dave

User avatar
AlanD
Posts: 241
Joined: Fri Jan 09, 2009 8:30 pm
Contact:

Re: ATOM FPGA

Post by AlanD » Thu Oct 17, 2013 9:16 pm

Hello dave

your atom is looking good =D>

AlanD

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Fri Oct 18, 2013 6:21 am

Hi Dave,

I was thinking ..... you don't have anything installed at #Exxx in the FPGA version so why not install SDDOS at #Exxx and initialise it with the patch in #Fxxx like the ROM switching software BRAN is initialised.

Greetings
Kees

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Fri Oct 18, 2013 7:02 am

oss003 wrote:I was thinking ..... you don't have anything installed at #Exxx in the FPGA version so why not install SDDOS at #Exxx and initialise it with the patch in #Fxxx like the ROM switching software BRAN is initialised.
Yes, this sounds a good plan. I was looking at the F000 patch yesterday just to try to understand it. Just 4 bytes were changed? I can easily figure this this out, but is it already described somewhere?

Was there ever an E000 version of SDDOS 2.2, or is this something we would have to create?

Dave

User avatar
danielj
Posts: 7694
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: ATOM FPGA

Post by danielj » Fri Oct 18, 2013 7:44 am

hoglet wrote:Here's some pictures of some, errrr, test programs running....
:-s wait a cotton picking minute, those displays are far too clear... Where's the faint ghosting? HANG ON, THAT'S NOT A REAL ATOM! etc. etc. feigned outrage.

:D
d.

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Fri Oct 18, 2013 1:09 pm

hoglet wrote:Yes, this sounds a good plan. I was looking at the F000 patch yesterday just to try to understand it. Just 4 bytes were changed? I can easily figure this this out, but is it already described somewhere?

Was there ever an E000 version of SDDOS 2.2, or is this something we would have to create?

Dave
Hi Dave,

wait a minute ... BRAN is initialised through the Floating Point, not the #Fxxx patch. #-o

I have the source of the SDDOS ROM so compiling it to #Exxx is no problem.
I'll give it a try this weekend.

Greetings
Kees

Code: Select all

=============================
Floating Point Patch (#Dxxx):
=============================

Original                     Patch
-------------------------    -------------------------
D4AF: Ad 04 E0  LDA #E004    D4AF: AD 1A EB  LDA #EB1A
D4B2: C9 BF     CMP @#BF     D4B2: C9 40     CMP @#40
D4B4: F0 0A     BEQ #D4C0    D4B4: F0 0A     BEQ #D4C0
D4B6: AD 00 A0  LDA #A000    D4B6: AD 01 A0  LDA #A001
D4B9: C9 40     CMP @#40     D4B9: C9 BF     CMP @#BF
D4BB: D0 83     BNE #D440    D4BB: D0 83     BNE #D440
D4BD: 4C 01 A0  JMP #A002    D4BD: 4C 02 A0  JMP #A002
D4C0: 4C 05 E0  JMP #E005    D4C0: 4C EB 1C  JMP #EB1C

============================
AtoMMC2 v2.6E Patch (#Exxx):
============================

#E000 - #EB19, Code AtoMMC2
#EB1A - #EFB3, Code Branquart 1.2 (starts with #40,#BF so #EB1C is the entry)
#EFB4 - #EFFF, Code AtoMMC2

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Fri Oct 18, 2013 5:38 pm

Thanks for the update Kees.

I've got two things to do this weekend:

- Compile an FPGA that contains just 8K RAM and the FPGA to check it will all fit in the GODIL40_XC3S250E and there are no pinout issues.

- Produce a SDDOS version of the Atom Software Archive.

You know, I think the biggest pain is going to be the 7 character file name limit, because there are lots of 8 character file names there at the moment. I think I can deal with most of this automatically, but there will probably be some chain loading cases where the programs might need modifying.

The best description of the Atom .DSK format I have found is here:
http://compgroups.net/comp.sys.acorn.ha ... at/1405035
Are there any more complete references (I'm good at Dutch Speak now :lol: )

Dave
Last edited by hoglet on Fri Oct 18, 2013 6:03 pm, edited 1 time in total.

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Fri Oct 18, 2013 6:02 pm

hoglet wrote:The best description of the Atom .DSK format I have found is here:
http://compgroups.net/comp.sys.acorn.ha ... at/1405035
Are there any more complete references (I'm good a Dutch Speak now :lol: )

Dave
Hi Dave,

sure there's a Dutch reference here (chapter DISK-CATALOG) :)

http://www.acornatom.nl/atom_handleidin ... ow2014.htm
http://www.acornatom.nl/atom_handleidin ... ow2015.htm

Greetings
Kees

User avatar
hoglet
Posts: 8776
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: ATOM FPGA

Post by hoglet » Fri Oct 18, 2013 6:09 pm

Thanks, this fill in some gaps.

I think "aantal files op schijf" means "number of files on disk", correct?

Dave

User avatar
oss003
Posts: 3153
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: ATOM FPGA

Post by oss003 » Fri Oct 18, 2013 6:22 pm

hoglet wrote:Thanks, this fill in some gaps.

I think "aantal files op schijf" means "number of files on disk", correct?

Dave
Yes, this byte is a pointer and contains (the number of files on disk) x 8. E.g. 4 files = #20

Greetings
Kees

Post Reply