Where's the Speccy love?

antonie
Posts: 49
Joined: Mon May 25, 2020 7:03 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Where's the Speccy love?

Unread post by antonie »

Miguel T80c wrote: Sun May 31, 2020 4:18 pm It sounds like this because it really is not an easy task, it is not a simple port, it is necessary to solve the SRAM problem before. It is what I have heard from a couple of developers, but who knows ... maybe someone will come and solve this problem quickly.
The core is also under continuous development and improvement. So, unlike a traditional "retro" core where the effort is largely focussed on making it as accurate as possible, with the Next, the port will have to contend with new features, or bug fixes, being made in each new official release.
Not impossible, for sure, but it does create "management overhead" to ensure the MiSTer core remains synchronised with the main core.
User avatar
kiFla
Posts: 5
Joined: Sun May 24, 2020 8:59 pm

Re: Where's the Speccy love?

Unread post by kiFla »

Newsdee wrote: Wed May 27, 2020 8:42 am The current Spectrum core is pretty much perfect for me.

It can run ULA+ games and the Spectrum 2+ upgraded audio, and I think it even supports reading things from tape if you have the ADC input.
What else would it need?
Yes, supports loading from tapes with ACC board input. Loading works great, like real spectrum feel.
User avatar
Sorgelig
Site Admin
Posts: 877
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 211 times

Re: Where's the Speccy love?

Unread post by Sorgelig »

Direct port with just external tweaks is impossible.
But i'm sure with some deep modification of ram handling inside the core the port is possible.
MiST and its clones are in the same boat and will require the same in-dept changes to port the Next, so i suggest to widen your search for someone to port. If someone will port it to MiST, then it will be easy to port to MiSTer from there. Ask Gyurco (Slingshot) if he is willing to port to MiST :)
I know he is a fan of ZX Spectrum.

As i've told earlier, i'm not really interesting in Next so i don't want to spend my time for core which is basically the same as existing ZX Spectum core. So i'm not willing to do in-dept modifications to port.
The biggest issue (if it will be ported) with Next will be requirement of VHD image. So you will have to put files inside that image to access them in Next core. It's very inconvenient. My ZX Spectrum core works with files on SD card, so it's a way more convenient to manage.
WolfgangBlack
Posts: 53
Joined: Mon Jun 01, 2020 3:19 am
Has thanked: 14 times
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by WolfgangBlack »

kiFla wrote: Wed Jun 03, 2020 1:35 pmYes, supports loading from tapes with ACC board input. Loading works great, like real spectrum feel.
You could just buy a Next or a repro Speccy.
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Sorgelig wrote: Fri Jun 05, 2020 7:16 am Direct port with just external tweaks is impossible.
But i'm sure with some deep modification of ram handling inside the core the port is possible.
MiST and its clones are in the same boat and will require the same in-dept changes to port the Next, so i suggest to widen your search for someone to port. If someone will port it to MiST, then it will be easy to port to MiSTer from there. Ask Gyurco (Slingshot) if he is willing to port to MiST :)
I know he is a fan of ZX Spectrum.

As i've told earlier, i'm not really interesting in Next so i don't want to spend my time for core which is basically the same as existing ZX Spectum core. So i'm not willing to do in-dept modifications to port.
The biggest issue (if it will be ported) with Next will be requirement of VHD image. So you will have to put files inside that image to access them in Next core. It's very inconvenient. My ZX Spectrum core works with files on SD card, so it's a way more convenient to manage.
I am working in the Mister port of ZX Next. I have the core Running in Altera Cyclone V Board with 512 Kb of SRAM without problems.
The problem here is using the SDRAM instead SRAM. The VRAM part of the core is too big (96 Kb) compared with Spectrum core (16Kb) and is not in a static address. This is a serious problem to port to Mist due we do not have enough BRAM in Mist.
Regards
User avatar
ron
Posts: 159
Joined: Sun May 24, 2020 7:02 pm
Has thanked: 67 times
Been thanked: 58 times

Re: Where's the Speccy love?

Unread post by ron »

This capture belongs to benitoss's port.
ron_mister_zxnext_benitoss.jpg
ron_mister_zxnext_benitoss.jpg (85.83 KiB) Viewed 13982 times
User avatar
ron
Posts: 159
Joined: Sun May 24, 2020 7:02 pm
Has thanked: 67 times
Been thanked: 58 times

Re: Where's the Speccy love?

Unread post by ron »

Here some more pics from Benitoss port
benitoss_mister_zxnextboot01.jpg
benitoss_mister_zxnextboot01.jpg (95.15 KiB) Viewed 13979 times
benitoss_mister_zxnextboot02.jpg
benitoss_mister_zxnextboot02.jpg (89.67 KiB) Viewed 13979 times
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

As you can see in the pictures the core can read the VHD image and load the firmware of the TBLue and several files of the VHD image file.
Now I am working in the memory part, the idea is similar than the Spectum core. The initial memory logic is done as a dual port but everything goes to the SRAM. So, we need to put the vram memory (16 Kb block X 6 bocks consecutively, 3 blocks for layer2 and another 3 blocks for shadow layer2) in total 96 Kb in the BRAM cache. The problem is that the LAyer 2 has not the same start address (it is not always in the same block of the memory, can be selected by the user through the NextOS. So I can know what is the offset of this Layer2 and apply it to read and write in the BRAM memory
All writes and reads in VRAM we send to this BRAM. The rest of the memory addresses will be handled in the SDRAM.
User avatar
NML32
Posts: 288
Joined: Sun May 24, 2020 6:57 pm
Has thanked: 272 times
Been thanked: 43 times

Re: Where's the Speccy love?

Unread post by NML32 »

It's nice to see progress is being made with the ZX Spectrum Next core.
rampa
Posts: 29
Joined: Sat Jun 06, 2020 5:25 pm
Has thanked: 6 times
Been thanked: 43 times

Re: Where's the Speccy love?

Unread post by rampa »

rickdangerous wrote: Wed May 27, 2020 3:57 pm I have the source ported to MiSTer but the SDRAM is not working. Maybe someone could help.
do you have it posted anywhere? Thanks!
User avatar
rickdangerous
Posts: 265
Joined: Sun May 24, 2020 7:35 pm
Location: Lisbon, Portugal
Has thanked: 31 times
Been thanked: 55 times
Contact:

Re: Where's the Speccy love?

Unread post by rickdangerous »

No, just shared with some known devs.

MiSTer and FPGA Gaming European Shop
Classic MiSTer, MultiSystem, JAMMIX iTX and Official Addons.
https://ultimatemister.com powered by RetroShop.pt

User avatar
Sorgelig
Site Admin
Posts: 877
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 211 times

Re: Where's the Speccy love?

Unread post by Sorgelig »

benitoss wrote: Fri Jun 05, 2020 9:27 pm As you can see in the pictures the core can read the VHD image and load the firmware of the TBLue and several files of the VHD image file.
Now I am working in the memory part, the idea is similar than the Spectum core. The initial memory logic is done as a dual port but everything goes to the SRAM. So, we need to put the vram memory (16 Kb block X 6 bocks consecutively, 3 blocks for layer2 and another 3 blocks for shadow layer2) in total 96 Kb in the BRAM cache. The problem is that the LAyer 2 has not the same start address (it is not always in the same block of the memory, can be selected by the user through the NextOS. So I can know what is the offset of this Layer2 and apply it to read and write in the BRAM memory
All writes and reads in VRAM we send to this BRAM. The rest of the memory addresses will be handled in the SDRAM.
Where i can read technical info about Next video modes? I need to know which video modes are supported and where video frame buffers can be.
Ip75
Posts: 5
Joined: Tue May 26, 2020 8:19 am

Re: Where's the Speccy love?

Unread post by Ip75 »

This looks like the place: https://wiki.specnext.dev
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Every day I am closer
photo_2020-06-08_11-34-31.jpg
photo_2020-06-08_11-34-31.jpg (79.66 KiB) Viewed 13878 times
photo_2020-06-08_11-31-23.jpg
photo_2020-06-08_11-31-23.jpg (88.45 KiB) Viewed 13878 times
photo_2020-06-08_11-31-19.jpg
photo_2020-06-08_11-31-19.jpg (92.07 KiB) Viewed 13878 times
Step by step
Fallon
Posts: 110
Joined: Mon May 25, 2020 1:48 am
Has thanked: 50 times
Been thanked: 22 times

Re: Where's the Speccy love?

Unread post by Fallon »

Keep going! ZX Spectrum Next has a fantastic community with plenty of new games and software.
User avatar
NightShadowPT
Posts: 208
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 9 times

Re: Where's the Speccy love?

Unread post by NightShadowPT »

I'm really excited about this one.

Looking forward to see the result!

Cheers
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Sorgelig wrote: Sun Jun 07, 2020 12:00 pm Where i can read technical info about Next video modes? I need to know which video modes are supported and where video frame buffers can be.
You have a lot of information in the ZX Spectrum Next Wiki.
Here https://wiki.specnext.dev/Memory_map you have the map memory

The layer2 and shadow layer2 spend continuous 3 banks of 16KB each (in total 6 continuous banks ) . But the position is variable.
NextZXOS moves the Layer 2 bank assignments. Therefore, Layer 2, after NextZXOS boots, is mapped to 16k-banks 9-11. The Layer 2 shadow memory is also assigned to 16k-banks 9-11.
layer2_active_bank -> std_logic_vector(6 downto 0) is the starting 16K bank
The default value of layer2_active_bank is 8 --> "0001000" (minimum value) and the maximum value of this variable is 106 --> ‭"1101010‬"
The default value of layer2_shadow_bank is 11 --> "0001011"
Be carefull although the bank number of default layer2 is 8, it start after the bank 0 start in $040000 so we have to add that ofsset.
it is shown in this line (we add +1 to add the offset of $40000) -->

Code: Select all

layer2_bank_eff <= (('0' & layer2_active_bank_q(6 downto 4)) + 1) & layer2_active_bank_q(3 downto 0); 
layer2_bank_eff is the bank effective abd it is used to calculate the absolute address layer2_addr_eff

Code: Select all

layer2_addr_eff <= (layer2_bank_eff + ("00000" & layer2_addr(16 downto 14))) & layer2_addr(13 downto 0);
So theoretically we have to create a VRAM containing the 6 blocks X 16 Kb of Layer2 banks and Layer2 Shadow banks.

My actual core is running in a Cyclone V 22K cells using SRAM

So, I gonna use the same SDRAM instanciate of your Spectrum core but I have to solve the logical part of the VRAM with variable address.

For me the VRAM will have 96Kb and
1) I will read in it when the core accesses to port B(layer2), but I have to send to the VRAM memory the relative address memory of the layer2 (my starting reference address is always 0) instead the absolute value of the complete address total RAM.
2) To read/write in CPU the core uses port A. The data will be send to the SDRAM unless the part A writes in VRAM (see the next case)
3) To write in VRAM (the core uses the port A), I have to use logic to know if the memory address to write belongs to the VRAM (layer2 or layer2 shadow bloks) or is the rest of the complete RAM. If it belongs to VRAM , I have to convert the absolute address in relative to VRAM and write in VRAM and SDRAM at the same time. If the memory address belongs to the rest of the RAM memory I have to write only the absolute address in the SDRAM only.
Do you think I am right?

Solving this part I think I have the core done, I am really close, maybe I am gonna need your help in the this part.
Thanks
KnC
Posts: 107
Joined: Sun May 24, 2020 6:47 pm
Been thanked: 15 times

Re: Where's the Speccy love?

Unread post by KnC »

Looking forward to seeing this core make it to the MiSTer
I have been using a emulator for a while now for zxnext hoping for them to become available on the site but having it on the mister would be so much better :)
User avatar
Sorgelig
Site Admin
Posts: 877
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 211 times

Re: Where's the Speccy love?

Unread post by Sorgelig »

if some app/game will change layer 2 position very fast, then you won't have time to re-load layer2 into BRAM.
256x192 is standard Spectrum dot clock 7MHz. SDRAM is 16bit, so every word will be fetched at 3.5MHz. If you will use 2-word burst then fetch will be every 1.75MHz. This is pretty much comfortable access time for SDRAM working at around 112MHz. So you don't need to use VRAM. You can fetch layer2 directly from SDRAM.

there is another strategy for MiSTer: use DDR3 for layer2. DDR3 should be write only from CPU. Write access to DDR3 is usually immediate as you don't have to wait for data. The video system will fetch the video data sequentially, so you can add burst mode to fetch for example a whole line to BRAM buffer and while it renders the line from BRAM to screen, you can prefetch another line from DDR3 to second BRAM buffer.

So, there are several ways to handle the video buffer.
antonie
Posts: 49
Joined: Mon May 25, 2020 7:03 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Where's the Speccy love?

Unread post by antonie »

@benitoss, purely out of curiosity, how do you intend dealing with the specnext wifi module and accelerated functions provided by the Pi? E.g. dot commands that are used to load .TZX files. Similarly, NextSync uses the wifi module to send and receive files to/from the outside world.
User avatar
Sorgelig
Site Admin
Posts: 877
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 211 times

Re: Where's the Speccy love?

Unread post by Sorgelig »

Need to see what communication channel is used for RPi. If it's UART then MiSTer already provides this communication, so just need to add linux app servicing Next commands.
AFAIK RPi is optional feature. It has nothing to do with ZX emulation.
antonie
Posts: 49
Joined: Mon May 25, 2020 7:03 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Where's the Speccy love?

Unread post by antonie »

Sorgelig wrote: Wed Jun 10, 2020 7:08 am Need to see what communication channel is used for RPi. If it's UART then MiSTer already provides this communication, so just need to add linux app servicing Next commands.
AFAIK RPi is optional feature. It has nothing to do with ZX emulation.
Yup, agreed. It is only available on the "accelerated" version of the SpecNext. Just curious to see how far the port would go.
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Sorgelig wrote: Wed Jun 10, 2020 7:08 am Need to see what communication channel is used for RPi. If it's UART then MiSTer already provides this communication, so just need to add linux app servicing Next commands.
AFAIK RPi is optional feature. It has nothing to do with ZX emulation.
The communication channel used between the FPGA and Pi is serial (UART), but the Pi transmit the audio back to the FPGA through a I2S cahnnel.
This is the basic communication to playing TZX with the Pi or for playing audio and mod files with the PI
Regards
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Sorgelig wrote: Tue Jun 09, 2020 8:13 pm if some app/game will change layer 2 position very fast, then you won't have time to re-load layer2 into BRAM.
256x192 is standard Spectrum dot clock 7MHz. SDRAM is 16bit, so every word will be fetched at 3.5MHz. If you will use 2-word burst then fetch will be every 1.75MHz. This is pretty much comfortable access time for SDRAM working at around 112MHz. So you don't need to use VRAM. You can fetch layer2 directly from SDRAM.

there is another strategy for MiSTer: use DDR3 for layer2. DDR3 should be write only from CPU. Write access to DDR3 is usually immediate as you don't have to wait for data. The video system will fetch the video data sequentially, so you can add burst mode to fetch for example a whole line to BRAM buffer and while it renders the line from BRAM to screen, you can prefetch another line from DDR3 to second BRAM buffer.

So, there are several ways to handle the video buffer.
Thanks for the answer. I appreciate it
Could you give me a core example of your first strategy ?

Regards
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

Here You have the two screens of configuration
photo_2020-06-10_22-54-09.jpg
photo_2020-06-10_22-54-09.jpg (177.29 KiB) Viewed 13729 times
photo_2020-06-10_22-54-19.jpg
photo_2020-06-10_22-54-19.jpg (162.37 KiB) Viewed 13729 times
Everything is working now ( VGA (15 Khz and 31 Khz), HDMI, Keyboard, joysticks, sound , and the second SD or VHD file) unless the 2 MB of memory in SDRAM.
All tests done in BRAM (maximum 400 Kb available) are good but the system has not enough memory to start the menu system.
If I solve the SDRAM memory issue the core is gonna work perfectly.

Later I can add the RTC, the UART WIFI and simulate the PI system with a UART and I2S connection (very similar that the emulation of the Munt is doing in the ao486 core, in fact we can use similar program that the Pi uses)

Regards
User avatar
Chris23235
Top Contributor
Posts: 841
Joined: Sun May 24, 2020 8:45 pm
Has thanked: 106 times
Been thanked: 167 times

Re: Where's the Speccy love?

Unread post by Chris23235 »

Will it only work with a second SD card in the I/O board, or will it also work with an USB HDD or a card that is connected via a USB hub?
antonie
Posts: 49
Joined: Mon May 25, 2020 7:03 pm
Has thanked: 2 times
Been thanked: 3 times

Re: Where's the Speccy love?

Unread post by antonie »

benitoss wrote: Thu Jun 11, 2020 4:09 am Here You have the two screens of configuration

photo_2020-06-10_22-54-09.jpg

photo_2020-06-10_22-54-19.jpg

Everything is working now ( VGA (15 Khz and 31 Khz), HDMI, Keyboard, joysticks, sound , and the second SD or VHD file) unless the 2 MB of memory in SDRAM.
All tests done in BRAM (maximum 400 Kb available) are good but the system has not enough memory to start the menu system.
If I solve the SDRAM memory issue the core is gonna work perfectly.

Later I can add the RTC, the UART WIFI and simulate the PI system with a UART and I2S connection (very similar that the emulation of the Munt is doing in the ao486 core, in fact we can use similar program that the Pi uses)

Regards
Really great work @benitoss...can't wait to compare your core to my actual SpecNext.
benitoss
Posts: 12
Joined: Wed Jun 03, 2020 3:46 pm
Been thanked: 1 time

Re: Where's the Speccy love?

Unread post by benitoss »

To accelerate the implementation of the ZX Next core I have published in my GitHub the actual core.
https://github.com/benitoss/ZXNext_Mister

The core needs to use the second SD or the VHD image that you can get here : https://github.com/benitoss/ZXNext_Mist ... xt_vhd.zip

Actually it only uses 400 Kb of BRAM Memory, we only need implement 2 MB using SDRAM and it will Work

Regards
User avatar
ron
Posts: 159
Joined: Sun May 24, 2020 7:02 pm
Has thanked: 67 times
Been thanked: 58 times

Re: Where's the Speccy love?

Unread post by ron »

@benitoss, great work mate ! , We just need to know how to correctly instantiate that SDRAM
jordi
Posts: 225
Joined: Thu Jun 11, 2020 10:11 am
Has thanked: 87 times
Been thanked: 71 times

Re: Where's the Speccy love?

Unread post by jordi »

Would like having it.
Post Reply