Minimig (Amiga) core discussion

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

Locked
User avatar
retrofun
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 108
Joined: Sat Jan 12, 2019 3:12 pm

Re: Minimig (Amiga) core discussion

Post by retrofun »

Same for minimig core on MiST, ADF & WHDLoad.

This is a combination of a bug in the game and a different behavior of the custom chip registers of the minimig core compared to a real AMiGA.

The game hangs in an endless loop at $55034-$5503a:

Code: Select all

$5502e lea $dff000,a0
$55034 btst #5,$9c,(a0)
$5503a beq.b $55034
Bit 5 (start of vertical blank) is read from INTREQ ($dff09c) that is a write-only/strobe register! The status should be read from INTREQR ($dff01e).


In paula_intcontroller.v 16'd0 is returned when reading from INTREQ. Real AMiGA's seem to return different values. Would need to be looked up in the specs or in emulator's code what's going on here...

Short test: when paula_intcontroller.v is changed to return the value of intreq the game starts:

Code: Select all

        if ((reg_address_in[8:1]==INTREQR[8:1]) || (reg_address_in[8:1]==INTREQ[8:1]))
                intreqr[15:0] = {1'b0,intreq[14:0]};
        else
                intreqr = 16'd0;
Maybe the same for registers INTENA/INTENAR.
sonycman
Atari freak
Atari freak
Posts: 51
Joined: Thu Aug 29, 2019 3:33 pm
Location: Russia

Re: Minimig (Amiga) core discussion

Post by sonycman »

The game Brian The Lion has bad music in the main menu, it is played wrong.
Precisely, the audio channel 0 is distorted.

In WinUAE (and on real hardware, I suppose) all is fine.

It appears that the cause is minimig`s incompatibility in custom registers write access.
The game updates audio channel 0 volume by this code:

Code: Select all

000110EE 1b69 0013 0008           MOVE.B (A1,$0013) == $000108df [3a],(A5,$0008) == $00dff0a8
Here we have a byte write access to AUD0VOL, but instead of "correct" byte address DFF0A9 write performed to DFF0A8.

Currently Paula audio channel code uses 7 least significant bits of CPU data bus to update AUDxVOL, byte strobes doesn`t taking into an account.
As a result the correct value getting dropped, and register being updated to "don`t care" data (in my case its zero), effectively distorting the sound.
Changing register address to DFF0A9 fixes the problem.

My minimig's build is based on MISTer 3.11.2019, but the behavior of most recent builds should be the same, I suppose.

As of now I see two possible fixes:
1. Locally change paula_audio_channel.v, taking into account CPU byte strobes, so that in case of byte access appropriate half of the word could be selected.
2. Globally change, for example, Gary.v, so that in case of custom register byte write access, it could mirror the payload byte to both bytes of the data bus word.

Would appreciate any advices regarding the fix.
slingshot
Atari God
Atari God
Posts: 1844
Joined: Mon Aug 06, 2018 3:05 pm

Re: Minimig (Amiga) core discussion

Post by slingshot »

sonycman wrote:
As of now I see two possible fixes:
1. Locally change paula_audio_channel.v, taking into account CPU byte strobes, so that in case of byte access appropriate half of the word could be selected.
2. Globally change, for example, Gary.v, so that in case of custom register byte write access, it could mirror the payload byte to both bytes of the data bus word.

Would appreciate any advices regarding the fix.
In reality, the 68000 mirrors the same byte to the upper and lower bits of the data bus on a byte write. TG68K doesn't do it? Tried it with FX68K? There are tricks using this on the Atari ST.
sonycman
Atari freak
Atari freak
Posts: 51
Joined: Thu Aug 29, 2019 3:33 pm
Location: Russia

Re: Minimig (Amiga) core discussion

Post by sonycman »

slingshot wrote: In reality, the 68000 mirrors the same byte to the upper and lower bits of the data bus on a byte write. TG68K doesn't do it?
Definitely not:

Code: Select all

	if BitField = 0 then
	  if oddout = addr(0) then
		data_write_mux <= "XXXXXXXX" & "XXXXXXXX" & data_write_muxin;
	  else
		data_write_mux <= "XXXXXXXX" & data_write_muxin & "XXXXXXXX";
	  end if;
	else
	  if oddout = addr(0) then
		data_write_mux <= "XXXXXXXX" & bf_ext_out & data_write_muxin;
	  else
		data_write_mux <= bf_ext_out & data_write_muxin & "XXXXXXXX";
	  end if;
As you can see, lower byte in even address access is "XXXXXXXX".

So this is a TG68K issue, then.
slingshot
Atari God
Atari God
Posts: 1844
Joined: Mon Aug 06, 2018 3:05 pm

Re: Minimig (Amiga) core discussion

Post by slingshot »

sonycman wrote: As you can see, lower byte in even address access is "XXXXXXXX".

So this is a TG68K issue, then.
But looks like it's not very hard to fix.
sonycman
Atari freak
Atari freak
Posts: 51
Joined: Thu Aug 29, 2019 3:33 pm
Location: Russia

Re: Minimig (Amiga) core discussion

Post by sonycman »

Brian the Lion has a second problem, a visual one this time:
https://youtu.be/6T8i5fBVtN8

The issue is in the blitter, line drawing mode.
The game cyclically activates the blitter almost without any reinitialization, relying on hardware automatic pointer increments.
But in line drawing mode channel D pointer is not autoincremented at all in current minimig code, only pointer C did.

Yet this D pointer is used when the first dot is being drawn (agnus_blitter_adrgen.v):

Code: Select all

assign address_out = enaptr && first_line_pixel ? {bltpth[CHD], bltptl[CHD]} : bltptr_out;
And that is the problem - in every cycle iteration (starting from second) the first dot being placed wrong.

I don`t know why it working this way.
Channel D (destination) has been practically disabled, except a single dot, and channel C (source) is used instead it in both roles.

Again, the solution would be to exclude D channel completely from line drawing mode.
Or to use it properly, so that the source (C channel) and destination (D) would be the different addresses.

Just verified the first, changing the code to:

Code: Select all

assign address_out = bltptr_out;
And the issue is fixed:
https://www.youtube.com/watch?v=rI8E7awCpVU
But this needs more testing.

Nice to hear any advices, as always, guys :)
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

sonycman wrote:Brian the Lion has a second problem, a visual one this time:
https://youtu.be/6T8i5fBVtN8

The issue is in the blitter, line drawing mode.
...
But this needs more testing.

Nice to hear any advices, as always, guys :)
Great job tracking it all down Sonycman!
I ran a subset of the known buggy demos and games, and I can see an improvement in couple of cases.

It would be great to open an Issue and/or Pull Request on github for MiSTer to document this.

BTW. There's a pretty new test-suite that uses bootable ADFs, and it looks quite interesting.
https://github.com/dirkwhoffmann/vAmigaTS.git


For the bus issue on 68020, I think the relevant material starts somewhere around page 73 in section 5.1.1: http://bitsavers.trailing-edge.com/comp ... l_1984.pdf
3
sonycman
Atari freak
Atari freak
Posts: 51
Joined: Thu Aug 29, 2019 3:33 pm
Location: Russia

Re: Minimig (Amiga) core discussion

Post by sonycman »

apolkosnik wrote: BTW. There's a pretty new test-suite that uses bootable ADFs, and it looks quite interesting.
https://github.com/dirkwhoffmann/vAmigaTS.git

For the bus issue on 68020, I think the relevant material starts somewhere around page 73 in section 5.1.1: http://bitsavers.trailing-edge.com/comp ... l_1984.pdf
3
Thank you, useful links indeed.
User avatar
comatron
Atariator
Atariator
Posts: 21
Joined: Mon Oct 22, 2018 2:56 pm
Location: Germany

Re: Minimig (Amiga) core discussion

Post by comatron »

Would it be a ton of work to add Action Replay MK3 functionality instead of HRTmon? I am really missing that tool i got in hardware here. Quicksaving to RAM in games would open a kind-of-savestate functionality for hard games. Even saving memory to disk does not work properly here with hrtmon and on top hrtmon cant read ofs which makes it pretty bad for oldschool adf-freakazoids like me.

the action replay roms are floating thru the net and it would be awesome to have the possibility to fire that roms into it instead of the hrtmon.rom. you guys think it will happen? i am not a fpga-programmer and have no clue what it takes to make that real. of course only for "stock a500" configurations as i dont think ar3 will work on ks 3.1 and whdload stuff (which btw. the hrtmon does not recognize either - i mean the whdload mode)

greetings and thanks for all your hard work
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

comatron wrote:Would it be a ton of work to add Action Replay MK3 functionality instead of HRTmon? I am really missing that tool i got in hardware here. Quicksaving to RAM in games would open a kind-of-savestate functionality for hard games. Even saving memory to disk does not work properly here with hrtmon and on top hrtmon cant read ofs which makes it pretty bad for oldschool adf-freakazoids like me.

the action replay roms are floating thru the net and it would be awesome to have the possibility to fire that roms into it instead of the hrtmon.rom. you guys think it will happen? i am not a fpga-programmer and have no clue what it takes to make that real. of course only for "stock a500" configurations as i dont think ar3 will work on ks 3.1 and whdload stuff (which btw. the hrtmon does not recognize either - i mean the whdload mode)

greetings and thanks for all your hard work
I agree that having an option to run AR would be a great help with debugging things. I have one that currently is collecting dust, until I solder a kickstart selectors for my A500 and 500+.
It looks like there are patched versions of AR that run on the ACA500plus accelerator cards that operate on more recent kickstart. I think Toni Wilen might have helped to make them work beyond Kickstart 2.x
I guess this piece of code might be useful in getting AR to runon the older Kickstarts at least:
https://github.com/robinsonb5/minimig_t ... nReplay3.v
chaos
Atari freak
Atari freak
Posts: 50
Joined: Thu Dec 18, 2014 10:09 am
Contact:

Re: Minimig (Amiga) core discussion

Post by chaos »

As far as I remember, AR only works with kickstart up to 2.04, and it has problems with the tg68k CPU core. Even in real Amigas it doesn't work with 020+ CPUs. AR was (is) used in the original minimig, so the code and support is already there. I removed it /replaced it with HRTMON since I found no way to make it work in the minimig+tg68k design.
** my minimig builds: http://somuch.guru/ **
kolla
Captain Atari
Captain Atari
Posts: 310
Joined: Thu Sep 17, 2015 11:39 pm
Contact:

Re: Minimig (Amiga) core discussion

Post by kolla »

Regarding original Minimig, have there been any improvements to the MiST/MiSTer Minimig cores that would also make sense to “bring back” to a Minimig for Minimig core? :)
-- kolla
User avatar
comatron
Atariator
Atariator
Posts: 21
Joined: Mon Oct 22, 2018 2:56 pm
Location: Germany

Re: Minimig (Amiga) core discussion

Post by comatron »

chaos wrote:As far as I remember, AR only works with kickstart up to 2.04, and it has problems with the tg68k CPU core. Even in real Amigas it doesn't work with 020+ CPUs. AR was (is) used in the original minimig, so the code and support is already there. I removed it /replaced it with HRTMON since I found no way to make it work in the minimig+tg68k design.
wow. nice to talk to the guy who made that possible. its like talking to a quantum physicist tho haha. big brain there, respect and thanx.

so somehow jens schoenfeld somehow managed to make the ar3 compatible to KS 3.1 as mentioned from another guy. i got the aca500+ and as far as i can remember back it worked there. at least partially. but to be honest i am just interested to use the ar3 on stock stuff. OCS/ECS KS1.3 and 512/512 ... or maybe at 1mb chip, which worked too in the days afaik.

but as far my understanding and my english gets me, even that is not possible? (i am not sure if the whole core uses tg86k or if just the 60020 part does). so i think, after a long time hunting after this topic i have to trash my dream of that und use hrtmon as far it is possible. tho what me fcks up most is, that i cant even list a directory witch a OFS disk. bad start. but thanx for the help and the explaination.
User avatar
retrofun
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 108
Joined: Sat Jan 12, 2019 3:12 pm

Re: Minimig (Amiga) core discussion

Post by retrofun »

apolkosnik wrote: It looks like there are patched versions of AR that run on the ACA500plus accelerator cards that operate on more recent kickstart. I think Toni Wilen might have helped to make them work beyond Kickstart 2.x
Yep. Here's the thread on EAB:

Action Replay rom Patch
http://eab.abime.net/showthread.php?t=66199
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

Kolla,

Sorry for a late response, I think that Sonycman's blitter fix and the bus write changes were not merged from the discussion on the MIST topic. I guess some of it got merged i to TG68K.C, but it has not been pulled into the MiSTer core.
kolla wrote:Regarding original Minimig, have there been any improvements to the MiST/MiSTer Minimig cores that would also make sense to “bring back” to a Minimig for Minimig core? :)
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Minimig (Amiga) core discussion

Post by Sorgelig »

apolkosnik wrote:Kolla,

Sorry for a late response, I think that Sonycman's blitter fix and the bus write changes were not merged from the discussion on the MIST topic. I guess some of it got merged i to TG68K.C, but it has not been pulled into the MiSTer core.
MiSTer Minimig sources are update with latest TG68K. If there are some changes not merged, then let me know.
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

Sorgelig wrote: MiSTer Minimig sources are update with latest TG68K. If there are some changes not merged, then let me know.
https://github.com/mist-devel/minimig-m ... 8bc892615d

This fixes some blitter problems in Brian the Lion.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Minimig (Amiga) core discussion

Post by Sorgelig »

apolkosnik wrote:
Sorgelig wrote: MiSTer Minimig sources are update with latest TG68K. If there are some changes not merged, then let me know.
https://github.com/mist-devel/minimig-m ... 8bc892615d

This fixes some blitter problems in Brian the Lion.
Thanks!
Imported.
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

Sorgelig wrote: Thanks!
Imported.
Any chance to roll a new release now?
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

There seems to be another graphical glitch (I didn't have the time to dig deeper, but I think that could be blitter's fault) that manifests itself in Brian the Lion game. I've posted an issue on github with some screenshots.

https://github.com/MiSTer-devel/Minimig ... /issues/52
apolkosnik
Atari maniac
Atari maniac
Posts: 90
Joined: Sat May 18, 2019 3:20 pm

Re: Minimig (Amiga) core discussion

Post by apolkosnik »

I was poking around some stuff in Quartus the other day and stepped across this piece of documentation from Intel. I guess it should be relatively easy to add the signals to the core, and perhaps some autoconfig (make it look like a network card) with some allocated memory range, and then it would require development of a driver on the Amiga side.
https://www.intel.com/content/dam/www/p ... hernet.pdf

Thoughts?
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Minimig (Amiga) core discussion

Post by Sorgelig »

basically, you don't need to do much in FPGA.
You just need to create some exchange protocol between Amiga and Linux using the memory buffer.
For example Amiga writes to specific memory the amount of data and length it wants to transmit. Linux part will see it and forward to ethernet. The same to opposite direction.
Then only driver on Amiga and support code on Linux will be required. Then it's up to Amiga driver what virtual ethernet device it will simulate on macro level.
TwinX
Atarian
Atarian
Posts: 7
Joined: Wed Nov 27, 2019 1:05 pm

Re: Minimig (Amiga) core discussion

Post by TwinX »

Hi, today i created a new sd card to run a HD image.
So all good mister setup etc. however i am unable to boot the minimig setup???

So back to my smaller working sd card that had also minimig (same version same kick etc.) but without hd only floppies.
This version also does not boot??? I am really lost and am unable to get it working again. I even tried older rbf files but non of them work.

Evrything else works, c64, neo geo arcades etc. All but the Amiga. Has anyone else exeprience this?
kolla
Captain Atari
Captain Atari
Posts: 310
Joined: Thu Sep 17, 2015 11:39 pm
Contact:

Re: Minimig (Amiga) core discussion

Post by kolla »

What do you mean with “boot”? That the core doesn’t start at all? Or that it starts and you can press F12, configure RAM, kickstart, disks etc, but that AmigaOS doesn’t boot?
-- kolla
TwinX
Atarian
Atarian
Posts: 7
Joined: Wed Nov 27, 2019 1:05 pm

Re: Minimig (Amiga) core discussion

Post by TwinX »

kolla wrote:What do you mean with “boot”? That the core doesn’t start at all? Or that it starts and you can press F12, configure RAM, kickstart, disks etc, but that AmigaOS doesn’t boot?
With boot i mean kickstart sorry i was not not specific enough. I should have been. I found the issue. The minimig is far more sensitive to memory then most of the other cores it seems.
I ran the mem test and got a lot of errors whilst in the past i did not. So i reflowed the chips to make sure it was soldered correct. (guess i did a terrible job building them.) Maybe it went bad because no good flux cleaning, temprature fluctiation, thick soldering fingers, i don't know. Anyway bad memory is no go with minimig.

The reflow job did the trick, all good now. Thanks.
Locked

Return to “MiSTer”