Minimig Discussion Forum

Discussing the Open Source FPGA Amiga Project
It is currently Tue Sep 19, 2017 7:00 pm

All times are UTC




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Bug in TG68K
PostPosted: Wed Feb 06, 2013 9:00 pm 
Offline

Joined: Tue Sep 25, 2012 7:15 pm
Posts: 105
I found a bug in the tg68k core. The movep.w in the following code fragment from atari tos 1.04 uses an incorrect address:

Code:
00001f8e   303c0a05         MOVE.W   #2565,D0
00001f92   01880005         MOVEP.W   D0,#5(A0)
00001f96   03080005         MOVEP.W   #5(A0),D1


This code fragment is entered with with A0 being set to $fffffc20. This code is this supposed to write $0a to $fffffc25 and $05 to $fffffc27 and afterwards read from the same two addresses. Running a atari emulator shows that exactly this is happening.

The tg68k from the latest de1 port writes $0a to $ffffff28 and $05 to $ffffff2a and afterwards reads from $ffffbe9c and $ffffbe9e. So it seems the address calculation is significantly broken.

I am currently trying to add the bus fault capability to the tg68 core, so i won't immediately have a look at this new issue. Perhaps one of you guys would like to have a look at it. Even if the movep instruction is rarely used, it may still affect the minimig as well.


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 07, 2013 7:24 pm 
Offline

Joined: Mon Dec 21, 2009 8:19 pm
Posts: 9
Yes this is a bug. Thank you for your report. I will fix it shortly.

Peter Graf has reported another bug. BTST Dn,#data is also wrong.

Best
TobiFlex


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 07, 2013 8:24 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
Another minor bug (reported to me by Gerhard Suttner):
movem.l does weird things if the register list is empty. (i.e. movem.l ,-(a7), opcodes 48E7 0000 or movem.l (a7)+, opcodes 4CDF 0000)
Such code is nonsensical of course, but I'm told the Aztec C compiler generates such code when there are no registers to be saved.

I had a go at fixing this, but didn't get far. movem.l ,-(a7) seems to replace stack pointer with the program counter!

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 07, 2013 9:15 pm 
Offline

Joined: Tue Sep 25, 2012 7:15 pm
Posts: 105
TobiFlex wrote:
Yes this is a bug. Thank you for your report. I will fix it shortly.


TobiFlex is back!! Nice to see you.

I have another one: You are using the data that's read back during a non-autovector irq as a replacement for the IPL bits which in turn are used to generate the irq vector. This is wrong. Instead the data read during a non-autovector irq ack phase is the vector. I fixed that in my version as Atari TOS needs that and it works as far as i can tell.

I think the non-autovector fix is in here:
http://www.harbaum.org/till/mist/mist_hdl.tgz
(if not i'll upload a new version asap)

Another thing i fixed today is the address fault (bus error) trap. TOS also needs this as it's used to check for the absence of certain hardware.

I am pretty sure my fixes are everything but nice and clean, so feel free to ignore them :-)


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Fri Feb 08, 2013 9:55 pm 
Offline

Joined: Mon Dec 21, 2009 8:19 pm
Posts: 9
I have done sometings:

-- bugfix session 07/08.Feb.2013
-- movem ,-(an)
-- movem (an)+, - thanks Gerhard Suttner
-- btst dn,#data - thanks Peter Graf
-- movep - thanks Till Harbaum
-- IPL vector - thanks Till Harbaum
--

I hope i have remove the bugs without generate some new bugs.

Best
TobiFlex


Attachments:
tg68KC.zip [25.53 KiB]
Downloaded 322 times
Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Sat Feb 09, 2013 12:17 am 
Offline

Joined: Tue Nov 09, 2010 3:10 pm
Posts: 316
I tested the new core on the DE1 and it seems to work fine, no problems found so far. Thanks TobiFlex & the rest!

The current version seems to fix at least the Whdload version of Lost Vikings game, which didn't work for me before, and that's great!

Enjoy!

_________________
** my minimig builds: http://somuch.guru/ **


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Sat Feb 09, 2013 8:46 pm 
Offline

Joined: Tue Sep 25, 2012 7:15 pm
Posts: 105
TobiFlex wrote:
I have done sometings:
...


Great, thanks. I have just integrated this into my atari setup and i am now waiting for the build to succeed.

May i ask for a bus error interface? There are already three commented lines in your code dealing with an "address fault trap". I uncommented them and added some more rather trivial code and it works. The atari st needs bus error capability as this is required to detect the presence of the blitter chip. Also the memory test expects to run into a bus error at the end of the st ram area (although it can be tricked not to do that by generating dtack after the end of the ram area but returning false data there, so the memory test stops there as well).

Unlike a real 68k my hacked bus error requires an additional dtack with the berr signal, but that's easy to accomplish in the wrapper.


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 14, 2013 9:14 am 
Offline

Joined: Tue Sep 25, 2012 7:15 pm
Posts: 105
The new TG68 works great. See it booting TOS and running a sysinfo tool here:

http://www.youtube.com/watch?v=U6qSgVioBgY


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 14, 2013 10:50 pm 
Offline

Joined: Thu Jun 18, 2009 9:54 am
Posts: 349
Chaos: Could you please upload a DE1 binary with the latest fixes? (Including MMRobinsonb5's audio.v if possible). Or maybe it's available elsewhere?

Master of Gizmo: Any chance of an Atari ST port to the DE1? :D
Just asking!


Top
 Profile  
 
 Post subject: Re: Bug in TG68K
PostPosted: Thu Feb 14, 2013 11:40 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
Master of Gizmo wrote:
The new TG68 works great. See it booting TOS and running a sysinfo tool here:http://www.youtube.com/watch?v=U6qSgVioBgY


It's awesome to see this taking shape! :)

gaula92 wrote:
Chaos: Could you please upload a DE1 binary with the latest fixes? (Including MMRobinsonb5's audio.v if possible). Or maybe it's available elsewhere?


The DE1 has a "proper" sound chip, so all the sigmadeltary hackery should be redundant on the DE1.

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Translated by Xaphos © 2007, 2008, 2009 phpBB.fr