dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
306 stars 25 forks source link

Support 1 MB Chip memory #214

Closed dirkwhoffmann closed 4 years ago

dirkwhoffmann commented 5 years ago

When a Fat Agnus is selected, vAmiga should allow up to 1 MB Chip memory.

Test case:

Archivio 3.zip

Error message shown on machines with 512 KB or less:

Schermata 2019-10-27 alle 10 14 12
Alessandro1970 commented 5 years ago

Option selection: OCS -> 512Mb Chip Ram always ECS -> 1Mb Chip Ram always I do not think that there were/are Amiga with OCS and 1Mb Chip RAM, It could be a trick but it could be incompatible.

dirkwhoffmann commented 5 years ago

The next release will support up to the breathtaking amount of 2MB Chip RAM 😎:

Bildschirmfoto 2019-11-09 um 12 53 35

The game itself doesn't work though. I think it requires ECS? No?

Bildschirmfoto 2019-11-09 um 12 48 46 Bildschirmfoto 2019-11-09 um 12 50 32
mithrendal commented 5 years ago

Nice 2MB.That is an massive amount of graphic and sound memory. πŸ¦ΎπŸ˜ŽπŸ‘πŸ»

Hmm they write that it supports also OCS here http://www.lemonamiga.com/?game_id=1757 🧐

Maybe it is confused when it tests the vAmiga for the ECS chipset? Or maybe the guys at lemmon are wrong. Or there are different sets of disk for OCS and AGA.

mithrendal commented 5 years ago

Here is a test article about the game. They say you need at least 1MB and a AGA Version is already in the works. So I think there were two versions out there. One OCS/ECS and one AGA.

https://www.kultboy.com/index.php?site=t&id=16831&s=2

mithrendal commented 5 years ago

I spotted the two versions on the net. Normal version has 4 disks. The AGA version has 7 disks. So we got here the normal NonAGA version which needs 1MB. The remaining question is whether it depends on some ECS chipset voodoo πŸ§žβ€β™‚οΈor not.

dirkwhoffmann commented 5 years ago

SAE with ECS Agnus:

Bildschirmfoto 2019-11-09 um 21 36 04

SAE with OCS Agnus:

Bildschirmfoto 2019-11-09 um 21 41 44

I like the first one more 🧐.

dirkwhoffmann commented 5 years ago

I forgot that a lot of Agnus functions in vAmiga apply a hard-coded bit mask of 0x7FFFE to the DMA pointers. Hence, if 2 MB Chip Ram is selected, the CPU will see those 2 MB, but Agnus will still see only 512 MB πŸ™ˆ.

mithrendal commented 5 years ago

Implementation of 8372a onwards is wrong then. Definitely 8372A identifies in vAmiga as 8372A but acts like its little sister chips the 8361, 8367, 8370 and 8371πŸ˜—

Still this shows the gamedefinition database at lemonamiga ist not error free. As they classify the game as 595F1107-A5A7-4701-8643-246AB8A6FD8B

dirkwhoffmann commented 5 years ago

Implementation of 8372a onwards is wrong then.

😒 Indeed.

This is because I am developing this project with PISDM(TM) (Priority Inversion Software Development Method) aka LITF: least important things first. As a result, the GUI can already detect misconfigurations 😎.

Bildschirmfoto 2019-11-09 um 10 48 16
dirkwhoffmann commented 5 years ago

Still this shows the gamedefinition database at lemonamiga ist not error free.

Yes, it definitely requires an ECS Agnus, because it requires 1 MB Chip Ram which is not supported by the old OCS Agnus. Interestingly, all my A500's already have the ECS Agnus.

dirkwhoffmann commented 5 years ago

BTW, when playing Heimdall in SAE and walking to the bottom of the screen, the main character vanishes. I am wondering if this is correct behaviour πŸ€”.

mithrendal commented 5 years ago

Maybe @Alessandro1970 can try on the A2000 which has 1MB chipram, what happens when the hero goes south ...

Dirk a question,I remember your retrobrite beauties all do only have 512k chipram right? What is with the expansion card with the leaking battery, did you still have it ? If it still works then maybe one day you can convert it into a chipram expansion with this description http://amiga.resource.cx/manual/1MBChip_A500_A2000.pdf ...

Alessandro1970 commented 5 years ago

Error: My A2000 has 512 chip ram, but it does not work yet. [1mb chip ram] I finished that game in the A 2000 so many years ago...

dirkwhoffmann commented 5 years ago

My A2000 has 512 chip ram, but it does not work yet.

Has the Gotek been fixed? πŸ€”

mithrendal commented 5 years ago

My A2000 has 512 chip ram, but it does not work yet.

Poor A2000 what is the problem that it does not work ? 😳 You made a typo, ... it has definitly 1024 KB chip ram.😊

Alessandro1970 commented 5 years ago

Yes 1mb chip ram but my Amiga 2000 is unusable

Alessandro1970 commented 5 years ago

http://amiga.resource.cx/mod/a2000.html

dirkwhoffmann commented 5 years ago

The ECS nightmare begins πŸ™ˆ. By supporting the old OCS Agnus only, I was able to code like this:

template <int x> void
Agnus::setBPLxPTH(uint16_t value)
{
    debug(BPLREG_DEBUG, "setBPLxPTH(%d, %X)\n", x, value);
    assert(1 <= x && x <= 6);

    bplpt[x - 1] = REPLACE_HI_WORD(bplpt[x - 1], value & 0x7);
}

Anybody spotting the ECS issue? Hint: & 0x7 cuts off everything above 512 KB. Now, I have to support varying register widths at various places 🀨.

I shouldn't have started to ad the ECS Agnus revisions... On the other hand, Heimdall seems to be cool 😎. I want to have that supported 🀀.

dirkwhoffmann commented 5 years ago

you can convert it into a chipram expansion with this description

It says I need a soldering iron and a sharp knife. As a theoretician I am not sure if I am allowed to use such tools πŸ™„. And considering what happened to the machine that is now known as the A500 MMSE, I better keep my hands off the mainboard.

dirkwhoffmann commented 5 years ago

If I haven't missed anything, only the following registers should be affected:

DSKPTH
BLTCPTH
BLTBPTH
BLTAPTH
BLTDPTH
COP1LCH
COP2LCH
AUDxLCH
BPLxPTH
SPRxPTH
mithrendal commented 5 years ago

You are now in the same situation as the commodore hardware technicans were some 30 years ago. The only difference they hardware you software. πŸ₯΄

I like the idea of giving an extra parameter let say β€žagnusaddresswidthβ€œ or so to the set functions more than an if inside the code.

Agnus::setBPLxPTH(uint16_t value, uword adresswidth)

Don’t know about performance impact though...

dirkwhoffmann commented 5 years ago

Much better now 😎

Bildschirmfoto 2019-11-10 um 11 43 56

Unfortunately, I cannot hear any sound πŸ˜–. Heimdall is supposed to have sound, isn't it?

mithrendal commented 5 years ago

The guy wears cool sports wear. πŸ˜‚ and the helmet. This must be a funny game.

Sound don’t know. Never played it. Watch YouTube lets play?

dirkwhoffmann commented 5 years ago

Unfortunately, I cannot hear any sound

I just fooled myself (again). Heimdall doesn't turn off the drive motor. Hence, vAmiga runs in warp mode (hard to notice in debug mode) and therefore with sound disabled.

Bildschirmfoto 2019-11-10 um 11 43 56

Now, the remaining issue is how to scroll the screen. Interestingly, I can walk the guy with the cool underpants and helmet into the invisible area. The screen simply doesn't scroll. Is there some key combination for that?

Bildschirmfoto 2019-11-10 um 11 44 33 Bildschirmfoto 2019-11-10 um 11 45 08

And who is the girl in to status bar on top next to my main character? πŸ€”

Alessandro1970 commented 5 years ago

https://youtu.be/H6HC29G1STE

dirkwhoffmann commented 5 years ago

https://youtu.be/H6HC29G1STE

So it should scroll automatically then 😒

dirkwhoffmann commented 5 years ago

It scrolls in SAE if an ECS Denise is selected. This means we won't be able to play the game with the guy with the cool pants and helmet for a long time in vAmiga. So sad 😒.

Bildschirmfoto 2019-11-10 um 12 36 24
mithrendal commented 5 years ago

I bet the girl in the status bar is the princess πŸ‘ΈπŸ» in defender of the crown! So we can in the meantime just rescue her somewhere near nottingham forest. πŸ€—

Once again classification at lemonamiga is completely wrong. I feel that I should tell them... Not only it needs ECS blitter but now also ECS denise πŸ₯΄

dirkwhoffmann commented 5 years ago

I'll close this, because an ECS Denise won't be supported by vAmiga in the near future.

Alessandro1970 commented 5 years ago

In WinUAE this game works with OCS and 1mb Chip RAM:

Untitled 2

mithrendal commented 5 years ago

Hi @Alessandro1970 great find ! That is really a big surprise. But maybe it is only bug in WinUAE? Because dirk said scrolling worked only when he enabled ECS Denise in SAE... (but on the other hand it could also be a bug in SAE and vAmiga) To find out we have to check a real Amiga with 1MB chipram and OCS denise or to find the scrolling code and whether it uses the new ECSDenise stuff. Could it be that in the end lemmonamiga was right ? 🀭

dirkwhoffmann commented 5 years ago

In WinUAE this game works with OCS and 1mb Chip RAM:

That's great! So we have a chance to get the game working some day.

I retried in SAE with 1 MB Chip + 512 KB Slow.

If started with OSC Agnus + OCS Denise, it shows graphics errors and doesn't load.

If started with ECS Agnus + OCS Denise, it doesn't scroll 😒:

Bildschirmfoto 2019-11-12 um 16 36 45

If started with ECS Agnus + ECS Denise, it scrolls.

Maybe @naTmeg knows what ECS Denise feature could be the reason to make it scroll? πŸ€”

mithrendal commented 5 years ago

when I rethink Allessandros settings in WinUAE then I am confused 😳... OCS and 1MB ChipRam is not possible 🧐! It could be that WinUAE switches automatically to ECS Agnus/DeniseπŸ™‹πŸ»β€β™€οΈ, if such an misconfiguration is selected... That means WinUAE maybe do not have these nice warning messages as vAmiga now has, but instead just silently do upgrade the custom chips ... at least that would explain why the game works ...

Alessandro1970 commented 5 years ago

...I have used kick 1.3 and with ocs + 1mb chip, no scrolling problem, it worked well in wiunae

mithrendal commented 5 years ago

Hi dirk, maybe it does the trick when we identifiing vAmigas "virtual" Denise as ECS capable as described at the very end in http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node00A2.html ? Could it be that the game is checking these chip identifications?

dirkwhoffmann commented 5 years ago

when we identifiing vAmigas "virtual" Denise as ECS capable

I could try that. But I would be surprised if UAE really switches to ECS automatically when 1 MB Chip or more is selected.

dirkwhoffmann commented 5 years ago

The scrolling issue was most likely due to Blitter timing. Works well in v0.46.2 😎:

Bildschirmfoto 2019-11-16 um 14 11 57 Bildschirmfoto 2019-11-16 um 14 12 51 Bildschirmfoto 2019-11-16 um 14 13 57
mithrendal commented 5 years ago

Very cool πŸ€“ and what a surprise !!! I would never have thought that the scrolling bug was due to a blitter accuracy problem. What for a bright minded guy has found this reason πŸ€”? Does that also mean that SAE has a better blitter accuracy when switching to ECS denise ?

dirkwhoffmann commented 5 years ago

Does that also mean that SAE has a better blitter accuracy when switching to ECS denise ?

As far as I can imagine, the selected Denise revision shouldn't affect the Blitter. Having said this, there is indeed a difference in SAE:

Test timing15 with OCS chipset and "waiting never":

sae_ocs

Test timing15 with OCS Agnus and ECS Denise and "waiting never":

sae_ecs

When another waiting mode is selected, e.g., "waiting auto", SAE does something completely strange (I think):

Bildschirmfoto 2019-11-16 um 20 56 09

On a real machine, it looks like this:

timing15_A500+

@naTmeg: Hi Rupert, if you wish to look into the issue, you can find the test case (as well as others) in the vAmigaTS repo:

https://github.com/dirkwhoffmann/vAmigaTS/tree/master/Blitter/timing