tag:blogger.com,1999:blog-76078854521721313822024-02-07T13:29:34.682-08:00ZX PrismThis blog aims to follow the development of my FPGA based Spectrum Compatible computer. The ZX Prism should remain compatible with the ZX Spectrum whilst expanding its graphics and memory.SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-7607885452172131382.post-76104797246062126682017-07-02T05:44:00.001-07:002017-07-15T04:57:01.261-07:00Adding Audio<em>(updated 15/7/2017)</em> I've recently started working on Prism again after a few months off. This last week I've finally gotten round to working on Prism's audio output. Up until now, Prism only had beeper and tape (SAVE) outputs, but now:<br />
<ul>
<li>In addition to being able to save to tape, Prism's tape-out and beeper output form a 2 bit channel audio output (the spectrum's audio circuit has similar behaviour)</li>
<li>Added 3x (modelled) YM2149 - used to implement Turbosound and the 128K Spectrum's AY-3-8912</li>
<li>Added 3 Covox (basically just an 8 bit latch on ports 0xFB, 0xF3 and 0xB3 which connect to DACs to give 3 channels of 8 bit digital sound). </li>
<li>Added Specdrum (like Covox, but on port 0xDF)</li>
<li>Added SounDrive 1.05 mode 1 (basically Covox on ports 0x0F,0x1F,0x4F and 0x5F). These are panned: 0x0F and 0x1F are "left" channels and 0x4F and 0x5F are "right" channels.</li>
<li>Added SAA1099 (the sound chip used in the Sam Coupe) with thanks to Miguel Angel Rodriguez Jodar for allowing me to use his implementation from the ZX Uno Sam core. At boot time, the SAA1099 is available on ports 0x02FF (data) and 0x01FF (register). However when Prism has been set to disable the Timex screen mode selection port (0xFF), then the SAA1099 is available at the same ports as on the Sam Coupe and SAA1099 add-ons (so: port 0x00FF(data) and 0x01FF(register)).</li>
<li>Added two sigma-delta DACs and a pair of resistor-capacitor filters to create the audio output (thanks again to Miguel for pointing me at the Xilinx document on sigma-delta DACs)</li>
<li>Added a mux to act as an audio output mixer.</li>
</ul>
It's sounding pretty good (though I have to disable a fixed-frequency buzzer on my FPGA dev board before I can hook up one of the audio outputs, so I've implemented it in mono for now)<br />
<br /><br />
<br />
<br />
<br />
<br />
<div>
</div>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com14tag:blogger.com,1999:blog-7607885452172131382.post-24749239745988754212016-07-28T05:19:00.003-07:002016-07-28T05:19:54.461-07:00Another 256 colour 256x128 Demo ImageJust a tiny update to show off another demo image showing off the linear 256x128 256 colour "clashless" mode.<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwKcmo0uawvAAMpFFUFCRYNfIFBl7PNPABK4kICyfDQRUyh1GFz93PFbH_GwITatxAq-eMTG4Iy_6mYbvXNdLm1FSyDe5PM3thmnfbMzpVbbBBo_an9ePfKLIcwSZSXtTOAjXl05bYoBce/s1600/P1050094.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwKcmo0uawvAAMpFFUFCRYNfIFBl7PNPABK4kICyfDQRUyh1GFz93PFbH_GwITatxAq-eMTG4Iy_6mYbvXNdLm1FSyDe5PM3thmnfbMzpVbbBBo_an9ePfKLIcwSZSXtTOAjXl05bYoBce/s400/P1050094.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yes, I DO seem to use Satan for demos quite often don't I.</td></tr>
</tbody></table>
<div>
<br /></div>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com71tag:blogger.com,1999:blog-7607885452172131382.post-76506350832640569152016-07-16T22:18:00.003-07:002016-07-17T05:41:55.655-07:00Solid progress...<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
So much progress since the last update! First up, I finally found why esxDOS wasn't working properly on Prism. Turns out that the divMMC automapper was working perfectly. The problem was actually with the SPI port. +3eMMC was working fine because it uses the SPI port slightly differently to esxDOS. A couple of tweaks to the SPI port implementation's sorted everything out - now both esxDOS and +3eMMC work perfectly.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKFvI9BZhxzVDTKXCMzXwxLme-WgQv7sVdzinorh1Bt6evQU3uOZuD1rQapoSMT2Q98mKmCn_15J0ffmR_e_z3Fdb1q2KXHeyRCvfzRzOiGmqlq2_ksd6OGB1RP1-bUEBvwTs4rtNZSRDl/s1600/P1040960.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKFvI9BZhxzVDTKXCMzXwxLme-WgQv7sVdzinorh1Bt6evQU3uOZuD1rQapoSMT2Q98mKmCn_15J0ffmR_e_z3Fdb1q2KXHeyRCvfzRzOiGmqlq2_ksd6OGB1RP1-bUEBvwTs4rtNZSRDl/s400/P1040960.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">FINALLY!</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio_kPEC8uqYu4fK8l8MjSfEW8pRUm6Jv8SPD50mylfB6X-xBJ3VPbQYv-7k9eubcxBZrkgEm7N2dXLMDsTVststBRJod3TEOYdV3hzJaKG-Oq_9sw6KGWbirS7GGQVdTj3IaygJbBZmfiX/s1600/P1040958.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio_kPEC8uqYu4fK8l8MjSfEW8pRUm6Jv8SPD50mylfB6X-xBJ3VPbQYv-7k9eubcxBZrkgEm7N2dXLMDsTVststBRJod3TEOYdV3hzJaKG-Oq_9sw6KGWbirS7GGQVdTj3IaygJbBZmfiX/s400/P1040958.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I was just about to give up on ever seeing this....</td></tr>
</tbody></table>
<br />
Getting esxDOS working means that I can use emulated TRDOS to try out some of the Russian software, some of which works best with no memory contention, or needs more than 128K of memory.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-gIT1Y0RmnRW5dOcvjUXHbdYdi8SXs7kmrx_P02TrWWe9k4IxtTU80wajz359Zxs1WtpBbN5QM5ZRVhlu5V0lD_7GFXMd_fhyphenhyphenZ1mXc_x9PIlUN8DEFpT5LnbJmxbH0cEHMpqO-niXbnm/s1600/P1040962.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-gIT1Y0RmnRW5dOcvjUXHbdYdi8SXs7kmrx_P02TrWWe9k4IxtTU80wajz359Zxs1WtpBbN5QM5ZRVhlu5V0lD_7GFXMd_fhyphenhyphenZ1mXc_x9PIlUN8DEFpT5LnbJmxbH0cEHMpqO-niXbnm/s400/P1040962.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fire And Ice running from TRD file. A fun and pretty platform puzzle game, similar to Solomon's Key</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbUwBskJobr9MK-NwYnYhd2IXAumnjAi1DDTVNb_dxGvT0YMSmxtExVZA0LEi-djKUSXMSovQllJbP8jOfpRLZRCaek1RrGVIC7OoiQCd7Ul2K2JSiiyQ-msvEripp1lhgS5sjrqMXJvJq/s1600/P1040973.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbUwBskJobr9MK-NwYnYhd2IXAumnjAi1DDTVNb_dxGvT0YMSmxtExVZA0LEi-djKUSXMSovQllJbP8jOfpRLZRCaek1RrGVIC7OoiQCd7Ul2K2JSiiyQ-msvEripp1lhgS5sjrqMXJvJq/s400/P1040973.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mortal Kombat, running from TRD<br />
<br /></td></tr>
</tbody></table>
Graphics modes, graphics modes... What would a Prism update be without more graphics modes? Firstly, I revisited Gigablend mode - this is a mode which blends the main and shadow screen together to give more colours - basically a hardware implementaiton of the software "Gigascreen" effect found in many Russion demos.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0bITzvE7mHEXdg-xpGV_vm3nZoamfOAsDButeT_X_AagF0e1Nzkwvn-EApHrLgfH0XXJUIecs6tFEzx9nIzckQObq295XkGUxWJ7QWCUibcY-yfP2_q4sdIJ2R8L-BKSBL_6Ww6txUpI4/s1600/P1040999.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0bITzvE7mHEXdg-xpGV_vm3nZoamfOAsDButeT_X_AagF0e1Nzkwvn-EApHrLgfH0XXJUIecs6tFEzx9nIzckQObq295XkGUxWJ7QWCUibcY-yfP2_q4sdIJ2R8L-BKSBL_6Ww6txUpI4/s400/P1040999.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Gigablend mode<br />
I'm afraid I don't know the artist to credit them</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVOS4uCqgMZ2KaVb-elAes4B1LHL3ilkVJf0Uo2L953xQPLXNHZROmIkQExDeq76GicN44KiPNXKih7gw3vtWWGi103LhE2YjNyHNOejszVGOhR6p0JdmmhmyzIza_ftePJuSgi7fUC1Wn/s1600/P1050002.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVOS4uCqgMZ2KaVb-elAes4B1LHL3ilkVJf0Uo2L953xQPLXNHZROmIkQExDeq76GicN44KiPNXKih7gw3vtWWGi103LhE2YjNyHNOejszVGOhR6p0JdmmhmyzIza_ftePJuSgi7fUC1Wn/s400/P1050002.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Probably one of my favourite gigascreen pictures, displayed using Gigablend mode. <br />
I'm really sorry I don't know the artist to credit them.</td></tr>
</tbody></table>
<br />
Looking back through the blog, I noted that I'd not said much about the 4 plane (16 colour) 256x192 mode. This works in a similar way to the Amiga - 4 bitplanes of pixel data which mean each pixel can be one of 16 colours (ie there is no colour clash). Of course, being Prism, this isn't restricted to the 16 default colours, they can be user defined. Here's a few examples<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWdI-vrnQEOxTwou8syz7E4pmqo1ZVK4JXJ06rFfTAvNox-7_lKya37IJ9qv4mjP_JkXenx0sEXHZl-dOv8kBTuWyPQltwX8_s7WIT2PY55e6-6MpYldAgWxF6a6um3gG-tZYSkPqaoCUG/s1600/P1040932.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWdI-vrnQEOxTwou8syz7E4pmqo1ZVK4JXJ06rFfTAvNox-7_lKya37IJ9qv4mjP_JkXenx0sEXHZl-dOv8kBTuWyPQltwX8_s7WIT2PY55e6-6MpYldAgWxF6a6um3gG-tZYSkPqaoCUG/s400/P1040932.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgahTJGmyW-a3AKwsHmicwOIkQ220IOoHQUxJ2AUseI7RxR-4_nxbEinmayj69mjgt8GDO9WkcXIlUSRMWP6ymdBnObIrBNB3PFz9xSLoF4_osuvSDj6ifYEuAGnPZxIxHQ_IX0bUompRBl/s1600/P1040938.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgahTJGmyW-a3AKwsHmicwOIkQ220IOoHQUxJ2AUseI7RxR-4_nxbEinmayj69mjgt8GDO9WkcXIlUSRMWP6ymdBnObIrBNB3PFz9xSLoF4_osuvSDj6ifYEuAGnPZxIxHQ_IX0bUompRBl/s400/P1040938.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimVRf0R3hvC-KUdMgn0DVNr8NnIP9Tc3CJ9WAj4dsM_M1YE8W9aKAspYncM68bWSgzsFnbtA1qLnC3_1jCFo1kpSJvFzoFsOzw6ErVI8BmtgEfaQvgUZampzhXukqKhrrnAU7Cehf8Fqz3/s1600/P1040941.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimVRf0R3hvC-KUdMgn0DVNr8NnIP9Tc3CJ9WAj4dsM_M1YE8W9aKAspYncM68bWSgzsFnbtA1qLnC3_1jCFo1kpSJvFzoFsOzw6ErVI8BmtgEfaQvgUZampzhXukqKhrrnAU7Cehf8Fqz3/s400/P1040941.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHuRL6nxo8MPwQVKyfIrE8p826OVEQPHHmedmsICjdoiTakiL29RnJqGGmJrkPIwnI7LbmkJNVa7ou4FK3duo2FTlK4dg9DnQsgcT8yu4T2tKPpkpBaVc4vBWhFa3giKGmuacMZko9Nkl7/s1600/P1040942.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHuRL6nxo8MPwQVKyfIrE8p826OVEQPHHmedmsICjdoiTakiL29RnJqGGmJrkPIwnI7LbmkJNVa7ou4FK3duo2FTlK4dg9DnQsgcT8yu4T2tKPpkpBaVc4vBWhFa3giKGmuacMZko9Nkl7/s400/P1040942.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAgHNz-G4sDFwvsKEASYpl2xiOrgGRa3_AWjRUUAdEWToUIU3hztTDf-OtobYpkn0SG1exAYtvt4HlfLGGjwi98y0roctnzNFVwv5pfJ9VxebrSjB5qstrPtoKHlUCtk12o6K71Zt5q0Xd/s1600/P1040943.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAgHNz-G4sDFwvsKEASYpl2xiOrgGRa3_AWjRUUAdEWToUIU3hztTDf-OtobYpkn0SG1exAYtvt4HlfLGGjwi98y0roctnzNFVwv5pfJ9VxebrSjB5qstrPtoKHlUCtk12o6K71Zt5q0Xd/s400/P1040943.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjezxFxPGL1m5ifj30iHL3p-WL67PCcRe88IkkNdCsqQPwk7TbrmvQ8qcTY7VFMPwUQ1e4JGGwFtOu5_pQARxomkg4Kb6Pkg1_XvYF3GTcNxtw8msdZ_AOsZOc_97mo_4DjhpXzJMaQEbDI/s1600/P1040945.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjezxFxPGL1m5ifj30iHL3p-WL67PCcRe88IkkNdCsqQPwk7TbrmvQ8qcTY7VFMPwUQ1e4JGGwFtOu5_pQARxomkg4Kb6Pkg1_XvYF3GTcNxtw8msdZ_AOsZOc_97mo_4DjhpXzJMaQEbDI/s400/P1040945.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI74BTfHxyHViNHqon83GKTee3cM-0SChDeBRD4F1UF2ZPuQcbFdW7OCQ7XMk_oK_2e59eI_QbEhxQbOHxRwgFkGKbjWNIjnhrGJTYux99vcV_D5In8IcG6JTQBMMSqUqJ_lErYEhYPhiF/s1600/P1040948.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI74BTfHxyHViNHqon83GKTee3cM-0SChDeBRD4F1UF2ZPuQcbFdW7OCQ7XMk_oK_2e59eI_QbEhxQbOHxRwgFkGKbjWNIjnhrGJTYux99vcV_D5In8IcG6JTQBMMSqUqJ_lErYEhYPhiF/s400/P1040948.JPG" width="400" /></a></div>
<br />
But what about brand new modes?<br />
<br />
How about a completely bonkers 4096 colour mode? Brainbow mode is a 3 plane 256x192 resolution mode with a twist. Each pixel can be one of 8 colours (black, blue, red, magenta, green, cyan, yellow or white/grey) the twist is that each 8x8 "attribute" square has a defined red, green and blue element intensity level. Probably of limited usefulness, but hey - it's up to 4096 colours on screen at once.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmc52sD936p1UVk7EO1GlTjzEh3iMwHtkrRtedDRKfvaKtU6rPd60SlnBYK33iLyJyL82SicN_ClYGsu20uBb-nQiU_zpYe-r3jYe8bTinpnHT53JBoGFFCEHM9gZLc69nImuxRIa879b/s1600/P1040927.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDmc52sD936p1UVk7EO1GlTjzEh3iMwHtkrRtedDRKfvaKtU6rPd60SlnBYK33iLyJyL82SicN_ClYGsu20uBb-nQiU_zpYe-r3jYe8bTinpnHT53JBoGFFCEHM9gZLc69nImuxRIa879b/s400/P1040927.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">It really is quite bonkers... </td></tr>
</tbody></table>
What else? Well definitely more useful are the new linear modes. In addition to the Radastan and Zesarux linear modes, Prism's ULA2 also has its own linear modes - two of which have been implemented to date.<br />
<br />
Firstly, the 128x128 resolution 256 colour mode which uses 16K of VRAM<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_bTDWb10y705ZQG8iKoIPjCZxkP2ESq0aMRlwOUDIVmbQaksbEQrsPTpJwl6O8fqpIMS3ZVAhY1Q75TXQtSGgzExYoRMZmXEqBrNV6EVFH9lFIgB8TFH6LP1R13oFuhxr0GhpHlQrw6pN/s1600/P1050066.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_bTDWb10y705ZQG8iKoIPjCZxkP2ESq0aMRlwOUDIVmbQaksbEQrsPTpJwl6O8fqpIMS3ZVAhY1Q75TXQtSGgzExYoRMZmXEqBrNV6EVFH9lFIgB8TFH6LP1R13oFuhxr0GhpHlQrw6pN/s400/P1050066.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256 colour linear (clashless) 128x128 mode</td></tr>
</tbody></table>
...and secondly, the 256x128 resolution 256 colour mode which uses all 32K of VRAM<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwg5XxMB7-IAb3aAKebs2dA-Z5I6IQZcJP-xdrBrKtmFgoPNSfRtLRKUSPYnn5Gow60Qxgj3wSEbX1dXThdH8ZAJkAUa1GI6yC2nkw-rXUcv3Ey9mGRhnyMrSrTJP8TYmLH82M-V2Oo71S/s1600/P1050058.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwg5XxMB7-IAb3aAKebs2dA-Z5I6IQZcJP-xdrBrKtmFgoPNSfRtLRKUSPYnn5Gow60Qxgj3wSEbX1dXThdH8ZAJkAUa1GI6yC2nkw-rXUcv3Ey9mGRhnyMrSrTJP8TYmLH82M-V2Oo71S/s400/P1050058.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: 12.8px;">256 colour linear (clashless) 256x128 mode</span></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSKyR5T_cwE9ezeVyegZ7_E6u3dkz_0Rx5LFybfqvADU6HdLQ5r4DsWdjM_9rTL56sqme3MwdCFdgvpJOFuRkyJM5FHjWUm4mZnRyFUdbanwiTT-r_7v3HkCSIsIWHoO25WDfr3rzLGOd/s1600/P1050079.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSKyR5T_cwE9ezeVyegZ7_E6u3dkz_0Rx5LFybfqvADU6HdLQ5r4DsWdjM_9rTL56sqme3MwdCFdgvpJOFuRkyJM5FHjWUm4mZnRyFUdbanwiTT-r_7v3HkCSIsIWHoO25WDfr3rzLGOd/s400/P1050079.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Hand-converted from a 256 colour BMP... ignore the couple of alignment errors ;)</td></tr>
</tbody></table>
<br />
Due to the data needed to be moved around, these modes are probably more useful for splash screens or perhaps static pictures in adventure type games than they would be for actual arcade games (happy to be proven wrong though!)<br />
<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com14tag:blogger.com,1999:blog-7607885452172131382.post-60902692368395657632016-01-16T05:58:00.003-08:002016-01-16T06:15:58.262-08:00Happy New Year<br />
<div class="separator" style="border-image: none; clear: both; text-align: left;">
Hi folks, Happy New Year.</div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
<br /></div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
There's been quite a few developments with Prism in the past few months, though again a lot of them are "under the hood" and not particularly visual. A lot's been done to improve stability at higher CPU speeds, and there's also been a large amount of refactoring of Prism's microcode to make it easier to work on and add new features. </div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
<br /></div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
Over Christmas, I did a lot of compatibility testing (also known as just playing games), as well as some playing around with palettes...</div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
</div>
<div class="separator" style="border-image: none; clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijkfGUdMq1J1Dl30EbTc45C5kDycjRuX5poA5OFXaC2JNdSACcHhbQzzQOGZEm3UES7W-LM3pqfdgrhW8ct26kzhUw7E9EflOYxCCzKUl81bWzEvY8PMVVOBzcdMFsJDbxDVZUoV9AtoBI/s1600/P1040909.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijkfGUdMq1J1Dl30EbTc45C5kDycjRuX5poA5OFXaC2JNdSACcHhbQzzQOGZEm3UES7W-LM3pqfdgrhW8ct26kzhUw7E9EflOYxCCzKUl81bWzEvY8PMVVOBzcdMFsJDbxDVZUoV9AtoBI/s400/P1040909.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Gauntlet II with a modified palette</td></tr>
</tbody></table>
<div class="separator" style="border-image: none; clear: both; text-align: center;">
<br /></div>
<div class="separator" style="border-image: none; clear: both; text-align: center;">
<br /></div>
<div class="separator" style="border-image: none; clear: both; text-align: left;">
Of course it wasn't ALL playing games and refactoring... I did do some work on adding new features, including Radstian mode (a 128x192 16 colour "chunky" mode with no colour clash). I also started adding César Hernández Bañó's additional screen modes (similar to Radstian mode but with different resolutions)</div>
<div class="separator" style="border-image: none; clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByUobVe8weFmw3LfNUcCXCiisyY2tHj_FbBs8kNIva0uIl-muC8fgiYggQ-xNyKSrua93yIu1YTebvw1UoEIjJu60rMV_oC1-fURNx-MmAutrX_I1GZ8DJ-zXRmTEwJ7p6hpxQS56I1tj/s1600/P1040877.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhByUobVe8weFmw3LfNUcCXCiisyY2tHj_FbBs8kNIva0uIl-muC8fgiYggQ-xNyKSrua93yIu1YTebvw1UoEIjJu60rMV_oC1-fURNx-MmAutrX_I1GZ8DJ-zXRmTEwJ7p6hpxQS56I1tj/s400/P1040877.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">SpongeBob Radastanpants gazing lovingly at a ZX Uno prototype</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjHC7Ghl2n4WqThERhmNHZBf3C5bA8kM6T_1PnAfywWpfK4OU4lK5CrPY0XbLkW6_6FgUOZsMPrLecgEZO8qlRel7C3GVGPIFkTsq_UGenN9gpxbc1C5H7UpKkTT98e18DuIQbtEiF_KVY/s1600/P1040878.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjHC7Ghl2n4WqThERhmNHZBf3C5bA8kM6T_1PnAfywWpfK4OU4lK5CrPY0XbLkW6_6FgUOZsMPrLecgEZO8qlRel7C3GVGPIFkTsq_UGenN9gpxbc1C5H7UpKkTT98e18DuIQbtEiF_KVY/s400/P1040878.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Another Radastan mode demo pic (though personally I think Robot Chicken did it better)<br />
<br /><br />
<div align="left">
<br /></div>
<div align="left">
I've also been working on a boot rom, based on a test ROM that César Hernández Bañó created. I'm re-learning Z80 after a break of several years, so César has been increadibly helpful, thanks mate! The boot ROM lets you chose which ROM you want to boot to, and lets you set a couple of options. It also displays the Prism logo which is based on a mock-up which Andrew Owen created for me a while ago. You can probably guess where I got the idea from ;)</div>
</td></tr>
</tbody></table>
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIPr0-4gFLPvlksWudZg0K6YFXwDO-hU_QoStDeWxceSmhPG0NTlL3Yj5B4BS94JvoAcmu1PzTzlmateBf-MRWghO4YDDsgY02ECXMIgz8v5-Y_mc0mahuuljuMev5iw5Uc4wuV8mXh-by/s1600/P1040921.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIPr0-4gFLPvlksWudZg0K6YFXwDO-hU_QoStDeWxceSmhPG0NTlL3Yj5B4BS94JvoAcmu1PzTzlmateBf-MRWghO4YDDsgY02ECXMIgz8v5-Y_mc0mahuuljuMev5iw5Uc4wuV8mXh-by/s400/P1040921.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Shine on, you crazy ROM selector.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj671LoUNBgIA4loMG1rpe5woki25-OFalRNO_hyt5WAPcnxd4AEnC6KTIJO9Ods_BkFJa5UNjEzkHqsKFC-unStNTxI7uvlJgbOoYrJz8d_qcP2N6Hx1GVq9-R3UYvglh_D17CGGcWmHPo/s1600/P1040918.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj671LoUNBgIA4loMG1rpe5woki25-OFalRNO_hyt5WAPcnxd4AEnC6KTIJO9Ods_BkFJa5UNjEzkHqsKFC-unStNTxI7uvlJgbOoYrJz8d_qcP2N6Hx1GVq9-R3UYvglh_D17CGGcWmHPo/s400/P1040918.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The boot rom utilises Prism's 16 colour (4 plane) clashless mode and as you can see it also departs from the Spectrum's standard colours - for example non-bright yellow's orange.</td></tr>
</tbody></table>
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com14tag:blogger.com,1999:blog-7607885452172131382.post-5759016589436601122015-08-29T08:45:00.002-07:002015-08-29T08:45:33.916-07:00New graphics modesToday I did a little bit of poggling around with the VGA driver and started adding some new functionality to it. There's still some tweaking to be done, but here's a taster.<br />
<br />
Last year, I did some experimentation around a hardware GigaScreen mode which did some tricky work interpolating pixels from the main and shadow screens depending on if it was an odd or even frame. This was an interesting experiment but the results left a lot to be desired on most monitors. Today I tried a different method - looking up the physical colour for the corresponding pixels on the main and shadow display, then blending the two. This seems to work quite nicely.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZF_ZdqzMKltTFxy245Ot7INooLmMkoNqxyvgM-pqaejcDqd2F2Kn3UmY9raAMNs9Pn_QfPvTB_er80ktQFuASN_KgyD1JLs57ZE7ExO320K9kR5dylY0wfrVh_6f8Oz0mR36xVzJAA8lu/s1600/P1040850.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZF_ZdqzMKltTFxy245Ot7INooLmMkoNqxyvgM-pqaejcDqd2F2Kn3UmY9raAMNs9Pn_QfPvTB_er80ktQFuASN_KgyD1JLs57ZE7ExO320K9kR5dylY0wfrVh_6f8Oz0mR36xVzJAA8lu/s400/P1040850.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Some blended colours, yesterday.</td></tr>
</tbody></table>
<br />
A couple of days ago I was reading up on the various graphics modes on other computers and came across documentation on the Commodore 64's low-res multicolour mode which halves the number of pixels per colour cell (from 8x8 to 4x8) but increases the number of colours per colour cell from 2 to 4. I decided that this sort of thing would be easy to add to Prism.<br />
<br />
I toyed with two different ideas - the first maintained the usual 256x192 resolution, and the second halved it, like the C64 mode. In both cases, a pixel is defined by two bits instead of the usual 1 bit - but in the first case pixel data bits are read 'progressively' and in the second they're read in pairs:<br />
<br />
256x192 res: (Bit 7 + Bit 6) (Bit 6+Bit 5) (Bit 5 + Bit 4) (Bit 4 + Bit 3) (Bit 3 + Bit 2) etc<br />
128x192 res: (Bit 7 + Bit 6) (Bit 5+Bit 4) (Bit 3 + Bit 2) (Bit 1 + Bit 0)<br />
<div>
<br /></div>
<div>
Normally, this pixel data would be 1 or 0 indicating ink or paper, the colours of which are defined in the associated attribute byte. In both these modes, the pixel data has 4 states: paper, ink 1, ink2 and ink 3. Paper is defined by the attribute byte in the usual way - bits 3 to 5 of the byte give the paper colour 0-7 and bit 6 indicates bright or not. The ink colours ignore the bright bit (bit 6) and instead, inks 1, 2 and 3 are all the colour 0 to 7 as defined by bits 0 to 2 of the attribute byte but their intensity differs:</div>
<div>
<br /></div>
<div>
00 - Paper (colour 0-7, bright 0 or 1)</div>
<div>
01 - Ink (colour 0-7, brightness intensity 1)</div>
<div>
10 - Ink (colour 0-7, brightness intensity 2)</div>
<div>
<div>
11 - Ink (colour 0-7, brightness intensity 3)</div>
</div>
<div>
<br /></div>
<div>
This isn't quite how the C64 chooses the colours, but it's sufficient for this experiment.</div>
<div>
<br /></div>
In short, the first method produces a sort of "anti-alias" effect, and the second is similar to the Commodore's "rectangular pixel" mode. Whilst some spectrum owners laughed at the blockiness of the Commodore mode, there's no denying that in the right application and with a little bit of thought, it can produce some great results.<br />
<br />
The following pictures show these modes in action on Prism. The images were basically chosen at random to show the effect, rather than being selected to showcase it....<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpgc6cH6zk-B74R__iu1h97YqJJSEYv9szJhWSir56Ox0CDsH6mBgyDau_lpSNhFZaJw3q7_I_ABFTlG3axEYVoDHMP0JV2i79l1XqzGroqK3RZExpFG1TqiLsKVsjwybcDaNUm-9q3BmQ/s1600/P1040849.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpgc6cH6zk-B74R__iu1h97YqJJSEYv9szJhWSir56Ox0CDsH6mBgyDau_lpSNhFZaJw3q7_I_ABFTlG3axEYVoDHMP0JV2i79l1XqzGroqK3RZExpFG1TqiLsKVsjwybcDaNUm-9q3BmQ/s400/P1040849.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">"Antialias" or "progressive" 256x192 4 colour-per cell mode</td></tr>
</tbody></table>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBawIr4BPwIddiigkcP-se0Uz-_5ztDzrfIDhRvOLDonB7J21zyJHFIn6BGZXUZ1U7wrB16_KxdDmHOn_5t3Z6kCv22gWT_HpEcy3irzkKt_-5thmeTn1mJf4rGYoAaNJs72iydZPi5LOB/s1600/P1040851.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="323" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBawIr4BPwIddiigkcP-se0Uz-_5ztDzrfIDhRvOLDonB7J21zyJHFIn6BGZXUZ1U7wrB16_KxdDmHOn_5t3Z6kCv22gWT_HpEcy3irzkKt_-5thmeTn1mJf4rGYoAaNJs72iydZPi5LOB/s400/P1040851.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Glorious Chunk-o-vision! 128x192 4 colour-per-cell mode</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxr1yNypYG-Te3Vakq_rmgQrY5ZwpvNR8KUaMQt37IXpwjh56fFs47P7eBLMG7TIkV-VUXz9i524r8DkXBOa5YtAhM_kPXWwS044PqwHrL5X_YDCUHQNLGo2TWQW5YWAoiidxjh_3J5Tts/s1600/P1040852.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxr1yNypYG-Te3Vakq_rmgQrY5ZwpvNR8KUaMQt37IXpwjh56fFs47P7eBLMG7TIkV-VUXz9i524r8DkXBOa5YtAhM_kPXWwS044PqwHrL5X_YDCUHQNLGo2TWQW5YWAoiidxjh_3J5Tts/s400/P1040852.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">X-Out in Chunk-o-vision</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiskpX1pR1qe5ugthqD0A4Vd97mjCUPCeLK_eu5lcNWE5S1nFhpadLDTLvMbZOlvJarq_LsgYfyrGWkohNHyXQJIdI1JFqSJi8maRJjneChsyj-zMDjIJPoUlk-0hWasyn0daTqdC9zvx4P/s1600/P1040854.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiskpX1pR1qe5ugthqD0A4Vd97mjCUPCeLK_eu5lcNWE5S1nFhpadLDTLvMbZOlvJarq_LsgYfyrGWkohNHyXQJIdI1JFqSJi8maRJjneChsyj-zMDjIJPoUlk-0hWasyn0daTqdC9zvx4P/s400/P1040854.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mr Heli's scoreboard in chunk-o-vision.<br />More or less readable even though the resolution's halved </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAE6UFSlEZ5q26wFBL5fTctjPFysVIJ5-qqFM9F1DqxgFesEDJvgonu1IEyUg77d3Iq6BKMgGul6tVp70z4ZK52UMEEMgZY0PfqmlElZUm8vei1RYZIsR6ZCNHvOlD85oPqO8AAO4MggoC/s1600/P1040853.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAE6UFSlEZ5q26wFBL5fTctjPFysVIJ5-qqFM9F1DqxgFesEDJvgonu1IEyUg77d3Iq6BKMgGul6tVp70z4ZK52UMEEMgZY0PfqmlElZUm8vei1RYZIsR6ZCNHvOlD85oPqO8AAO4MggoC/s400/P1040853.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">X-Out in-game Chunk-o-vision. Not too bad if you squint.<br />(apologies for the bad picture but you get the idea)</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis9w18Ffak5PAA8Cdj5bBpm_QRba5xmaDDbwWG8X6cwrstNE1iX0Z-3PqqdMqfHdZjlhBt-iiYsmhUj-ESpyrqVUpuLLSvCN1IFEa8Zmf08s12CmBJQRNImURCrnVU4juVyFxhQYuhk1ES/s1600/P1040855.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis9w18Ffak5PAA8Cdj5bBpm_QRba5xmaDDbwWG8X6cwrstNE1iX0Z-3PqqdMqfHdZjlhBt-iiYsmhUj-ESpyrqVUpuLLSvCN1IFEa8Zmf08s12CmBJQRNImURCrnVU4juVyFxhQYuhk1ES/s400/P1040855.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Mr Heli in-game Chunk-o-vision<br />It looks a little better when it's all moving</td></tr>
</tbody></table>
<br />
This is all early stuff anyway - future experiments may include centring the screen and making the pixels square again so it's less chunky. I'll also experiment with different ways of deriving the ink colours - currently its 3 intensities of the same base colour... The C64 has registers for selecting the other two inks. I could also try making the new 2 colours being blends of the ink and paper. Hmmm.<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com3tag:blogger.com,1999:blog-7607885452172131382.post-67327311908215590012015-08-25T05:11:00.002-07:002015-08-25T05:11:35.807-07:00Refactoring completeFor the last couple of months I've been doing some major refactoring of Prism's glue logic, data bus mux, MMU and SRAM/flash memory control subsystem. This has been a heck of a lot of work for very little in the way of new features - however it's reduced the delay on a lot of signals which means that hopefully, with a little tweaking, Prism should be able to run stable at faster CPU speeds.<br />
<br />
<br />
The new features added during this time are minimal but potentially useful:<br />
<br />
<br />
<ol>
<li>Spectrum +2A/+3 special memory modes added. Not much software that I'm aware of uses this "CP/M" or "all RAM" memory configuration - except CP/M of course and John Elliott's wonderful ZxZvm (which lets you play various Infocom adventures like Zork and Hitchiker's Guide to the Glalaxy on the Spectrum). A number of people, including me, have also written utilities to run ROM images (like the Interface 1 ROM cartridges) using this memory configuration.</li>
<li>A selectable "Video RAM Aperture". Select between VRAM being accessible by the CPU at memory addresses 0x4000 - 0x5AFF (default) or VRAM being the entire 16K between 0x4000 and 0x7FFF. The advantages of the default mode are that the system variables, printer buffer and the beginning of BASIC don't get stored in video memory and so allow the user to use video modes which use more VRAM than the standard Spectrum screen mode from BASIC without crashing (careful use of the "planar write mask" lets you write to other parts of VRAM). The disadvantage of the default mode is that software which uses certain Timex screen modes expect VRAM to be at 0x4000 - 0x5AFF and 0x6000 - 0x7AFF. So both modes have their uses. If using SE Basic in double-width mode for example, you will need to switch to the 16K VRAM aperture. </li>
</ol>
<br />
<br />
So just a quick update despite the fact I've just finished a bucketload of work (and still have a metric shitload of testing and tweaking to do!). I'll leave you with an "actual Prism screenshot!!!" teaser from when I was testing the VRAM aperture - a 16 colour, no colour clash image displayed using the 4-plane planar mode:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn-dtivLEPBAqoeGXyyWtWH2SNoxNhdz5Dok05nR6XsBtBSlQu2ZVARzQktUi5zlHJRNm8BzDw6O7-YfP5tbLxVnqKWcFOfYUYmIEBFL9ACUZp9XZm5rxTkKvhO8nMIsjEh9lw-pwzwROv/s1600/Img_2008.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="355" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn-dtivLEPBAqoeGXyyWtWH2SNoxNhdz5Dok05nR6XsBtBSlQu2ZVARzQktUi5zlHJRNm8BzDw6O7-YfP5tbLxVnqKWcFOfYUYmIEBFL9ACUZp9XZm5rxTkKvhO8nMIsjEh9lw-pwzwROv/s400/Img_2008.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<span id="goog_1776916465"></span><span id="goog_1776916466"></span><br />
<div>
</div>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-52167856814766838622015-04-11T02:35:00.000-07:002015-04-11T04:42:29.632-07:00Easter Update<div class="separator" style="clear: both; text-align: left;">
So yet again I've managed to go a couple of months without updating the Prism blog. Mister Polo poked me again, so here we go. In my last update I listed a number of things that I'd be working on this year. I'm happy to say that a number of them have already been successfully achieved.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Firstly, the MMU (memory control functionality) has been rewritten to make it easier to modify in future. It also now handles all memory as 8K pages instead of 16K pages which means that I could add the Timex/Spectrum SE/Chloe 280SE memory paging model. The Spectrum 128/Pentagon memory paging model still works exactly as expected. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Secondly, I've added in support for the Timex/Spectrum SE/Chloe 280SE screen modes. The shadow screens that the Spectrum SE and Chloe has were already implemented as Prism implements it's screen selection in the same way. Likewise, the Timex "Hi-Color" mode is the same as Prism's. The Timex/SE/Chloe 512x192 mode is different to Prism's however - where Prism's is full colour and is basically screen 0 and screen 1 side-by-side, the Timex/SE/Chloe mode is monochrome and interlaces alternate sets of 8 pixels. This screen mode is used in SE Basic's 80 column mode, which is the main reason I implemented it (Prism's 512x192 mode is better!)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's a video of Prism running Andrew Owen's (Chloe) MMUtest program:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dzDYO7xCjA7StOQfdaAmjCvrcJDBmyjhOmykqJay6fcFSWWiBg13OxZn8RYoPJyaejLy7FepL0wqF1ikfy2BQ' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To make my life easier, I wrote a small menu program which auto-loads from SD card when Prism boots. It lets me switch between different configurations - ZX Basic with 512 or 48K, SE Basic, the ZX81 emulator etc. It also shows off 256 colour mode - though as you can see the default palette has a number of blacks and whites at the moment!</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhZb08wTW8gnsriPyY30mysJy1wBg45n7GtB2b_-Vvy-B02ahjctPfPmrkCMMLwSfC6aN9amND8YoPAF1W2UunV44NSNBMKsjID3IEPyUz1oSiaJRx9CLVrEOqwKs6G1MO-KrR4PCYlsvZ/s1600/P1040804.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhZb08wTW8gnsriPyY30mysJy1wBg45n7GtB2b_-Vvy-B02ahjctPfPmrkCMMLwSfC6aN9amND8YoPAF1W2UunV44NSNBMKsjID3IEPyUz1oSiaJRx9CLVrEOqwKs6G1MO-KrR4PCYlsvZ/s1600/P1040804.JPG" height="240" width="320" /></a></div>
<br />
<br />
I also fixed a bug in the T80 soft CPU core where incorrect flag behaviour was observed following an LD A,R or LD A,I instruction. This fix was based on one done by the Speccy2010 team. This finally fixes Midnight Resistance, Greeen Beret, Hypersports, Gutz, King's Valley and a number of other things. After that, I was on a roll with getting games working so I also updated the floating bus emulation so now Sidewize works too (albeit with flickering sprites due to the timing diferences between Prism and a real Spectrum).<br />
<br />
Finally, after all this time I've actually gotten around to adding support for the "flash" attribute in standard attribute decoding mode! The Manic Miner loading screen works properly for the first time!<br />
<br />
As a bonus to make up for so long without an update, the following three pictures are a teaser of something I'm working on (and definitely not an April fool - that was over a week ago). What could this be the first stirrings of I wonder?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkovYgfVjVV-zw_uwuP8ecqUNXdvzytOsHYI0OdL_U4E2FRotV3YGbApFx6xSUm0zflBDt6HrD99p7safykGX-GBpGIqXHZT-IVY9z3jimXwfzmGa0_ZojowlG6X3C7wWdlMSa-DDumP2/s1600/P1040815.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkovYgfVjVV-zw_uwuP8ecqUNXdvzytOsHYI0OdL_U4E2FRotV3YGbApFx6xSUm0zflBDt6HrD99p7safykGX-GBpGIqXHZT-IVY9z3jimXwfzmGa0_ZojowlG6X3C7wWdlMSa-DDumP2/s1600/P1040815.JPG" height="240" width="320" /></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwy2R6HFqt5roSzOV8bPFmS5chSBuqjG8Bq3RzSMywgKPsyxK8yKuhUjnUqO6iElCaNgjrjLrr9OZFdoMliQmbduwncv1sVoDSuFKuREk-ZUDjfxQtBqqQ8R-1RGptedDODlH2LwL5WDoU/s1600/P1040816.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwy2R6HFqt5roSzOV8bPFmS5chSBuqjG8Bq3RzSMywgKPsyxK8yKuhUjnUqO6iElCaNgjrjLrr9OZFdoMliQmbduwncv1sVoDSuFKuREk-ZUDjfxQtBqqQ8R-1RGptedDODlH2LwL5WDoU/s1600/P1040816.JPG" height="240" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgGyFGtI78hQ-BX0YBVEpNNLQP55l4BNXixNANFF6BgmkC5DJlNy0zynX3n_-xSoJUSLLYKnSPofv7ADgu-AXsTMCnM0SAtkGoJV8JU73HoHwZubA0x6F6_1rtQgSd_JMhL2ZGV_lPc5a0/s1600/P1040817.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgGyFGtI78hQ-BX0YBVEpNNLQP55l4BNXixNANFF6BgmkC5DJlNy0zynX3n_-xSoJUSLLYKnSPofv7ADgu-AXsTMCnM0SAtkGoJV8JU73HoHwZubA0x6F6_1rtQgSd_JMhL2ZGV_lPc5a0/s1600/P1040817.JPG" height="240" width="320" /></a></div>
<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com1tag:blogger.com,1999:blog-7607885452172131382.post-50974389163598952632015-02-02T05:44:00.000-08:002015-02-02T05:44:15.390-08:00Happy New Year!Belated New Years greetings to you, special reader! Special because I doubt that too many people read the blog regularly especially now that I'm only updating every couple of months. So there you go, you're probably more or less unique. Rejoice in your individuality you little retrotechnohipster you.<br />
<br /><br />
So 2015 found me taking a brief hiatus from working on ZX Prism as I was in the UK for a month visiting family. On my return, I used the space the month had given me to take a step back and plot out the next few months' worth of work on ZX Prism.<br />
<br /><br />
More on that later, firstly let me fill you in on the work done on ZX Prism since the last update:<br />
<br /><br />
ZX Prism's "ROMs" are now stored in flash memory, and ZX Prism has been configured to use flash instead of on-FPGA emulated ROM. The flash chip provides 256 x 16K "ROMs". At power-on, ZX Prism boots from "ROM" 0. ROM switching is done by OUT 60987,x where X is the ROM number you wish to page in, with "X" being an 8 bit byte of course. Additionally, the Spectrum 128 and +2A/+3 ROM switching mechanism is implemented. Port 7FFD bit 4 alters bit 0 of the ROM number and Port 1FFD bit 2 alters bit 1 of the ROM number. <br />
<br /><br />
Added "SAFE" ROM mode. This is entered by holding reset (F12) and tapping F9. It maps a predefined ROM image stored in on-FPGA emulated ROM into memory location 0x0000. Therefore, ZX Prism will be bootable even if the flash chip is blank or corrupted. Currently on the development ZX Prism, this ROM image is the standard 48K spectrum ROM but will be replaced with a specific ZX Prism boot/utility ROM in future (containing, amongst other things, firmware for "flashing" ROM images into the flash memory)<br />
<br /><br />
Added "Programming" ROM mode. This moves the selected flash "ROM" page to 0x8000 in memory, enables the WR (write) signal to the flash chip, and presents the SAFE mode "ROM" at 0x0000. This mode is only used when programming or erasing the flash memory.<br />
<br /><br />
Wrote a rudimentary flash memory programmer/eraser in BASIC. Programmed the development ZX Prism's flash memory with the following ROMs for testing purposes: <br />
<ul>
<li>Sinclair Spectrum 16K/48K ROM</li>
<li>Sinclair Spectrum 128K ROM 0</li>
<li>Sinclair Spectrum 128K ROM 1</li>
<li>SE BASIC IV ROM 0</li>
<li>SE BASIC IV ROM 1</li>
<li>+3eMMC ROM 0 (hacked to use DivMMC's SPI ports)</li>
<li>+3eMMC ROM 1 (hacked to use DivMMC's SPI ports)</li>
<li>+3eMMC ROM 2 (hacked to use DivMMC's SPI ports)</li>
<li>+3eMMC ROM 3 (hacked to use DivMMC's SPI ports)</li>
<li>Some interface 2 ROM cartridge images</li>
</ul>
All worked as expected after a little bit of refactoring of the CPU data bus MUX :)<br />
<br /><br />
Added support for DivMMC. Much time was spent trying to debug this. To date, it's a partial success. Whilst the DivMMC memory control and automapper are not working (and have been temporarily disabled), the card control and SPI ports are working fine. These were tested by using the +3e ROMS for ZXMMC which were hacked to use the DivMMC port addresses. I've successfully loaded, saved and renamed files on a +3eDOS partition on an SD Card. For many this would be an acceptable solution, but I'd like to get the memory control and automapper working so that I can use esxDOS in the future.<br />
<br /><br />
Fixed an intermittent crash when booting to +3eMMC ROMs. Debugging this, along with trying to debug the DivMMC automapper, took up much of November. When I finally found the cause of the crash I could have slapped myself. The +3eMMC ROMs check for a disk in the floppy drive. As ZX Prism doesn't have a floppy controller but<em> <strong>does</strong> </em>emulate the floating bus, this meant that a read of the floppy controller port would sometimes return 255 (as a +2A/+2B does, indicating no floppy controller is present so fall back to +2A mode) but would sometimes return the last byte read by the video circuit - and it was this scenario that was causing the crash. The fix was therefore simple - return 255 for any read of the floppy controller's IO ports. The emulated floating bus is still returned for any other unused IO port.<br />
<br /><br />
So that's where I am today - ZX Prism can load and save to SD Cards which have been formatted to work on a +3e. For compatibility, I can switch to use the original Spectrum ROM. I can run the image of an Interface 2 cartridge. I can write new ROMs to the flash memory and boot from them. Plus all the other groovy stuff that's been discussed elsewhere on this blog. <br />
<br /><br />
A pretty good place to start out from in 2015 :)<br />
<br /><br />
So what's on the cards for this year? A small list of what I'll be working on next:<br />
<ul>
<li>Refactor the MMU and data bus MUX so that they're easier to add to/modify. </li>
<li>Update the MMU so that it can switch in either 8K or 16K pages easily.</li>
<li>Add support for the Chloe 280SE "sideways" memory paging model.</li>
<li>Add support for the Timex/Chloe screen modes</li>
<li>Hardware: interface an audio codec to the FPGA</li>
<li>Hardware: simple kempston joystick interface</li>
<li>Hardware: improve the VGA DAC</li>
<li>Add AY audio chip support; investigate modelling other audio chips (SAA, turbosound etc)</li>
</ul>
<br /><br />
There are other things on the list of course, but that's enough for starters I think!<br />
<div>
</div>
<br /><br />
<div>
</div>
<br /><br />
<br /><br />
<br /><br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-6150169681858836222014-10-10T07:57:00.003-07:002014-10-10T08:10:02.285-07:00Another small update for September and the beginning of OctoberApologies once more for the lack of updates in the last month or so. Mister Polomint prodded me a week ago to make some kind of post, so here it is. Steady progress is being made with a whole heap of testing and tuning and a few new features added. No pretty pictures or videos just yet, but there's been some more sceen modes added<br />
<br />
Again, rather than write an essay, I'll just post the last few additions to the changelog for now.<br />
<br />
<b><u>ZX Prism version 0.16 10/10/2014 (non-released, flashed to board)</u></b><br />
<br />
<ul>
<li>Added an extra bit to the Flash ROM address bus so the whole chip can be utilised.</li>
<li>Added check for CPU_RD on data bus multiplex (fixed Shadow Warriors and several others)</li>
<li>Added switch to limit memory to 128K (when used, fixes turbo outrun amongst others): OUT 36411,24 limits the page at 0xC000 to pages 0 to 7. OUT 36411,16 re-enables 512K.</li>
<li>Hooked MMC signals into the glue logic (but the associated IO registers not implemented yet)</li>
<li>More interrupt tuning for different CPU speeds. Speeds 0-6 (3.5MHz - 28Mhz) work with all games/demos tested. Speed 7 (56MHz) needs further tuning</li>
</ul>
<br />
<br />
<b><u>ZX Prism version 0.15 19/9/2014 (non-released, flashed to board)</u></b><br />
<br />
<ul>
<li>Fixed the main ZX Prism palette. (until this fix, all 3 colour elements were getting set at the same time, meaning you could only select from black and 15 shades of grey!)</li>
<li>Added write masks for writes to 0x4000 - 0x5FFF (0=currently paged, 1-15=combos of planes). This makes working with the new video modes easier - for example, you can write to multiple planes of a planar mode at the same time, or quickly modify existing software to work in an overlay mode by adding an OUT to the beginning and end of the sprite routine so sprites are written to the shadow screen and overlaid over the main screen to avoid colour clash... etc etc. Care must be taken when using this feature from BASIC (so as not to stop writes to system variables...) </li>
<li>Removed "64 ink, 4 paper" mode and replaced it with 3 plane planar mode (as defined by Andrew Owen) This mode avoids using memory at 0x6000</li>
<li>Added overlay options register which selects the attribute decode methods for upper and lower overlays</li>
<li>Added readable register <b>IN 0x8E3B </b>(36411) returns CPU speed and available system memory:</li>
</ul>
<br />
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>D4-D7 = Available memory</b></div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0000 – 48K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0001 – 128K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0010 – 256K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0011 – 512K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0100 – 1024K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0101 – 2048K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0110 – 4096K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span>0111 – 8192K</div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div style="text-align: left;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><b>D0-D3 = CPU speed</b></div>
<br />
<ul>
<li>Added readable register <b>IN 0x9E3B </b>(40507) returns microcode version (mainly to save me wondering which build of the FPGA code is currently running whilst I'm testing different versions!)</li>
</ul>
<br />
<br />
<b><u>ZX Prism version 0.14 10/9/2014 (non-released, flashed to board)</u></b><br />
<br />
<ul>
<li>In Quartus: Turned on "Auto RAM to Logic Cell Conversion" in Analysis&Synthesis More Settings</li>
<li>In Quartus: Changed optimization technique to "speed" (from "Balanced") in Analysis&Synthesis More Settings</li>
<li>In Quartus: Changed Optimization technique to "speed" (from "Balanced") in the Analysis & Synthesis page (diff to above)</li>
<li>Added attribute decode method 0111 - 64 inks (colours 0-63), 4 papers (colours 0-4) PpIiiiii (this mode was removed in version 0.15)</li>
<li>-Swapped default colours 0-15 with colours 24-31 so difference between bright 0 and bright 1 is more spectrum-like</li>
<li>Added a rudimentary floating bus (127 if reading screen, 255 if drawing border) - enough for Arkanoid to run (though the bat and ball flicker!)</li>
<li>Added overlay mode 1 (Polo Mode) - ink and paper colour 0 and 8 on top layer are treated as transparent and reveal the lower layer.</li>
<li>Added overlay mode 2 - ink and paper colour 0 on top layer are treated as transparent and reveal the lower layer</li>
<li>Added 256 colour mode 2 screen 0/1=ink1 colour + pixel data, screen 2/3=ink2 colour+pixel data, paper=border</li>
<li>Switched to spectrum 128/+2 partial decoding of IO 7FFD to see if that helps with some of the compatibility issues. This will need to change back if port 1FFD etc are used in future.</li>
<li>Added check for interrupt on function keys (to avoid crashes when changing CPU speeds)</li>
<li>Started adding an OSD</li>
</ul>
<br />
<br />
<b><u>ZX Prism version 0.13 31/8/2014 (non-released, flashed to board)</u></b><br />
<br />
<ul>
<li>Refactored cpu speed code. Default speed (speed 0000) is now 3.5MHz</li>
<li>As SRAM and FLASH share FPGA pins, wrote pin multiplexor to facilitate use of both. SRAM signals are mapped to the pins when SRAM_nCS is 0, FLASH signals are mapped when FLASH_nCE is 0. When bothare '1' the pins are set to high impedence so they can be used for other things (eg ROM cartridge, SID, general sound etc - will require fast bus transceiver to translate voltage levels and leave bus at high impedence when FLASH/SRAM are in use)</li>
<li>For the time being, the memory multiplex is "locked" to talk to SRAM only</li>
<li>Changed memory mapping so that VRAM is used by both video and cpu for page 5 and 7 (previously CPU writes were being mirrored by VRAM, with CPU reads using SRAM and video reads using VRAM..) this frees up 32K of SRAM for other uses.</li>
<li>More interrupt tuning (frame length, int start, int duration for speed 0) to fix Mikie (was freezing) and others which weren't detecting keypresses. FUSETEST now detects this as a 48K spectrum due to frame length</li>
</ul>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com1tag:blogger.com,1999:blog-7607885452172131382.post-70837398288801527042014-08-29T03:38:00.000-07:002014-08-29T03:39:42.163-07:00Progress report for AugustApologies for being quiet for a while - lots of tuning and small changes have been taking place. It's probably easiest to report just what's been going on by sharing this excerpt from the changelog:<br />
<b><br /></b>
<b>ZX Prism version 0.12</b><br />
Archived: 25/8/2014 (non-released, but flashed to board)<br />
<br />
<ul>
<li>After noting that shadow warriors screen corruption stopped in 7MHz mode (though it still crashed), added check for CLK_EN='0' for SRAM_WE. This stopped the screen corruption in all CPU speeds though the game still crashes.</li>
<li>added clock enable check for port 7FFD</li>
<li>Altered CPU speed selection to give choice of spectrum clock derived CPU speeds or Video clock derived speeds: 3.18MHz, 3.5MHz, 6.375MHz, 7MHz, 12.75MHz, 14MHz, 25.5MHz, 28MHz and 51MHz</li>
<li>Altered interupt generator so it generates a CPU or Video clock derived interrupt.</li>
<li>Fixed interrupt frequencies (CPU speed derived interrupt was being generated at 100Hz not 50Hz!</li>
<li>Fixed odd crashes at higher speeds... Now works up to 51MHz. </li>
<li>Disabled 56MHz clock speed as I couldn't get it to run without random crashing</li>
<li>Reinstated partial address decoding for port 7FFD (fixes crashes/odd behavior in some 128K games which don't fully address the port). Am currently using the partial decoding as used on the Spectrum +3, +2A and +2B</li>
<li>Fixed another problem with interrupts - the video clock derived interrupts were running at half speed.</li>
<li>"tuned" interrupt signal duration so that they are different for each clock speed, using R-Type as a test. Settled now for values for each clock speed which i) don't cause R-Type to crash, ii) Allow R-Type to detect keypresses, iii) Allow R-Types screen updating to happen properly. These will not likely be the final durations ;)</li>
<li>Made video domain interrupt calculator equal frame length equal to 1 VGA frame (oops)</li>
<li>Successfully loads Speedlocked game (Sabre Wulf from They Sold a Million) at double speed (with CPU at 7MHz) and quad speed (with CPU at 14MHz) from audio CD</li>
</ul>
<br />
<ul>
<li>Flashed this version to FPGA board via Active Serial (so that it runs as soon as the board is turned on instead of having to be configured by the PC each time)</li>
</ul>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcI8o_EOBTr4eKoPeWjQfO-xjPnRPM4l6olstsfDeOjVAtOKMlunYTAcM79d4XVjGImTq8XnIXf7PDTO_S0Qomt98pr_mQzZUd80gSg7hgqF7vjAeWnWhYXGeOaxFZy7MpsTezVe1zZMMN/s1600/P1030858.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcI8o_EOBTr4eKoPeWjQfO-xjPnRPM4l6olstsfDeOjVAtOKMlunYTAcM79d4XVjGImTq8XnIXf7PDTO_S0Qomt98pr_mQzZUd80gSg7hgqF7vjAeWnWhYXGeOaxFZy7MpsTezVe1zZMMN/s1600/P1030858.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Loading a ULAplus enhanced game</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJnasikUsO4hw9kBusDxYLljGviZftNVuHdkrUT3PCYzHlOhAYGFxC_aG1Ta__jXsIa3fwbQWfnarOK2323D0GHg2S4Vw752GgoMHb_mXIjICD-0YfIWH9jeqmdlSKjYT8dZPks_8pFFzd/s1600/P1030859.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJnasikUsO4hw9kBusDxYLljGviZftNVuHdkrUT3PCYzHlOhAYGFxC_aG1Ta__jXsIa3fwbQWfnarOK2323D0GHg2S4Vw752GgoMHb_mXIjICD-0YfIWH9jeqmdlSKjYT8dZPks_8pFFzd/s1600/P1030859.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And another ULAplus enhanced game. Hurrah for The Mojon Twins!</td></tr>
</tbody></table>
<br />
<b>ZX Prism version 0.11</b><br />
Archived: 18/8/2014 (non-released)<br />
<br />
<br />
<ul>
<li>Added support to read palette entries from ULAplus (IN 65339)</li>
<li>Altered Mike Stirling's keyboard driver to handle cases where multiple keyboard rows are scanned by software (fixes "press any key" problem in Pssst etc etc etc)</li>
<li>Fixed bus timing issues introduced/uncovered by changing keyboard driver (!)</li>
<li>CPU speed stable to 28MHz</li>
<li>Fully implemented rest of port 7FFD including latch locking for ports 7FFD and 1FFD</li>
<li>Small update to VIDEO driver to allow screen selection</li>
<li>Implemented scanning of function keys. F12 sends a reset signal to CPU etc. F1-F11 send signals to the "buswatch" glue logic block to act as NMI keys, turbo buttons etc.</li>
<li>Implemented F12 = reset</li>
<li>Implemented F9 = Unlock ports 7FFD/1FFD if locked</li>
<li>Implemented F5 - F8 as CPU speed selectors (allows me to test games at different CPU speeds without having to hack their loaders which was getting tedious..)</li>
<li>Made keyboard scanning synchronous with CPU at whatever speed (stops Starstrike II crashing)</li>
<li>implemented F1-F4 as NMI keys (all 4 just send NMI to CPU at this stage)</li>
<li>fixed VRAM timing error which resulted in noise on screen on some games (eg Gyroscope)</li>
</ul>
<br />
<br />
<br />
<b>ZX Prism version 0.1</b><br />
Archived: 12/8/2014 (non-released)<br />
<br />
FPGA:<br />
<br />
<ul>
<li>Spectrum ROM implemented as on-chip memory, hard-coded into 0x0000</li>
<li>Implemented extra sceen resolutions (512x192, 256x384, 512x384)</li>
<li>Implemented screen decode methods: Standard, 16+16, 32 colour, 256 colour 1, 4 plane planar</li>
<li>Implemented SRAM for 512K memory pagable into 0xC000; page 2 hard-coded into 0x8000</li>
<li>VRAM page 0 hard-coded into 0x4000, no shadow screen selection yet</li>
<li>Port 7FFD partially implemented (memory select on bits 0-2, 6 and 7)</li>
<li>CPU speed selectable. Tested at 3.5Mhz and 7MHz</li>
<li>Default palette defined (except last 8 entries!)</li>
<li>ULA2 palette implemented but colour definition currently broken</li>
<li>Basic ULAplus implementation (can turn on and off and redefine RGB palette)</li>
<li>PS/2 keycode -> spectrum keyboard scanning implemented (based on Mike Stirling's FPGA Spectrum keyboard code)</li>
</ul>
<br />
Hardware:<br />
<br />
<ul>
<li>Simple kempston joystick using on-devboard keys</li>
<li>Reset key implemented</li>
<li>PS/2 re-implemented off-devboard due to hardware issue and 2 dead FPGA pins</li>
<li>VGA re-implemented off-devboard to achieve 16 levels of red, green and blue (on-board VGA is 8 colour total)</li>
<li>Current RAM and ROM page displayed on 7-seg LED array</li>
<li>Tape IN and Tape OUT implemented via MX3232 RS232 UART.</li>
<li>Tape interface thoroughly tested and tweaked</li>
<li>Tape OUT tested with headphones only, haven't tried to SAVE</li>
<li>Beeper output directed to TAPE OUT for now (beeper port of ULA is XORed with the tape out port - some music routines, eg Manic Miner, don't work properly)</li>
</ul>
<br />
<br />
<b>Software tested against v0.1 (and subsequently used to test fixes in later revisions):</b><br />
<br />
<ul>
<li>Aquaplane (as expected the border effect doesn't work due to VGA timings and lack of contended memory)</li>
<li>Manic Miner (music didn't work due to how beeper is mixed with tape-out; ie digitally rather than in analog circuit)</li>
<li>Myth (seemed to work fine)</li>
<li>PSSST! (from ROM) (worked fine except 'press any key' only accepted keypress from a single row)</li>
<li>Fred (worked fine)</li>
<li>Kokotoni Wilf (graphical corruption; this may have been a dodgy load, must verify)</li>
<li>Gilligan's Gold (worked fine)</li>
<li>The Pyramid (worked fine)</li>
<li>Starbike (worked fine)</li>
<li>Match Point (worked fine)</li>
<li>Freddy Hardest (worked fine)</li>
<li>Buck Rogers (worked fine)</li>
<li>Midnight Resistance (loaded fine, redefine keys option didn't work)</li>
<li>Skool Daze (worked fine)</li>
<li>Slap Fight (worked fine though Slap Fight logo appeared to have some minor corruption -load error?)</li>
<li>Saboteur (worked fine)</li>
<li>Horace Goes Skiing (worked fine, seemed a little fast though - lack of contention?)</li>
<li>Bionic Commando 128 (crashes after loading first block on tape)</li>
<li>Super Sprint (worked fine except border effect didn't work, as expected)</li>
<li>Where Time Stood Still (worked fine)</li>
<li>Sabre Wulf (alkatraz loader from Ultimate Collected Works) (worked fine)</li>
<li>Uridium Plus (seemed to be working but couldn't move ship up and down - fire and reverse direction worked)</li>
<li>- Shadow Warriors (graphical corruption then crash)</li>
</ul>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrvmAhfmczXCPTaLjdoSRMlED-7nqWGuTS9Y2jfGyz6HT-S8E9PW_Wa8Tq9xEOn2_ej_ZYuexEtB6_i0zTVDRHWJslxmrv2lr-CgwN92wOPf4dCI3xBS6l_rlDWwp5zY8wBEUxJf7IC-4P/s1600/P1030872.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrvmAhfmczXCPTaLjdoSRMlED-7nqWGuTS9Y2jfGyz6HT-S8E9PW_Wa8Tq9xEOn2_ej_ZYuexEtB6_i0zTVDRHWJslxmrv2lr-CgwN92wOPf4dCI3xBS6l_rlDWwp5zY8wBEUxJf7IC-4P/s1600/P1030872.jpg" height="640" width="376" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">ZX Prism loading Ghouls N Ghosts from (audio) CD</td></tr>
</tbody></table>
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com3tag:blogger.com,1999:blog-7607885452172131382.post-33992314319311309342014-08-09T00:42:00.002-07:002014-08-09T00:42:35.564-07:00Small updateJust a small update for today as it's been a fairly busy week so I've not had much time to spend working on ZX Prism lately.<br />
<br />
Firstly, ZXPrism now has 512K available to it (in addition to the 32K video RAM). Up until this week, ZX Prism was running as a 32K machine, with its video RAM paged into the memory space 0x4000 - 0xBFFF. This arrangement was merely for testing. Prism's memory arrangement is now much more like you'd expect on a Spectrum 128, with video RAM at 0x4000 - 0x7FFF and 'ordinary' RAM between 0x8000 and 0xFFFF.<br />
<br />
Like on the Spectrum 128 etc, the extra RAM is split into 16K banks which get paged into the area 0xC000 - 0xFFFF; as ZX Prism has 512K, this equals 32 x 16K pages of RAM which I'll refer to as pages 0 - 31. Page 2 is always paged into memory area 0x8000 - 0xBFFF (currently; this page may be changed to be selectable in future). The memory which is paged into 0xC000 - 0xFFFF is selected using IO port 7FFD - the same as on the Spectrum 128 - but of course ZX Prism has more pages available than on the 128 so ZX Prism uses bits 6 and 7 of port 7FFD in addition to bits 0 to 2. This matches the way that the Russian Pentagon 512 does it:<br />
<br />
PORT 7FFD -<br />
<br />
D0 - page[0]<br />
D1 - page[1]<br />
D2 - page[2]<br />
D3 - display screen[bit 1] (msb - ZX Prism has 3 shadow screens, not 1)<br />
D4 - ROM bank select[bit 0] (Prism will eventually have 512K flash ROM)<br />
D5 - Prevent further memory paging (also known as "48K mode")<br />
D6 - page[3]<br />
D7 - page[4]<br />
<br />
ZX Prism's SRAM is actually 256K of 16 bit RAM. Bit 4 of the page number determines if the upper or lower byte of the 16 bit data bus are to be used, effectively splitting the SRAM into two lots of 256K which is how 512K is achieved.<br />
<br />
Currently ZX Prism's ROM is stored on the FPGA and is the original Sinclair ROM from the 16/48K Spectrum. As such, the ROM bank select currently does nothing. The "lock" to 48K mode also isn't yet implemented (though it would be trivial to do so), so ZX Prism currently perpetually runs in "USR 0" mode.<br />
<br />
The additional memory was tested a number of ways - firstly RAMTOP was set to below 0xC000 and then unique test data was written to each page; then the data from each page was read back and verified. Of course there's not much 512K software (at least not that's available as a TAP/TZX file) to test, but I've tested several 128K games.<br />
<br />
Speaking of tapes, I'd been finding loading to be a little unreliable. Everything would be OK for 3 or so minutes but then it would fail. It didn't matter if this was a turbo loader or standard loader. Eventually I found that one of the resistors in the tape-in circuit was getting very warm - when I swapped that out for a resistor of the same value but higher current rating, things got a lot more reliable. I still seem to have to use a higher volume level than on a normal Spectrum - I suspect that's due to the Spectrum's ULA working at 5v, and the Max3232 RS232 UART that I'm using to buffer input between tape and FPGA is expecting a higher voltage.<br />
<br />
Finally, I've started hooking up the MMC slots so I can start implementing DivMMC and getting ESXDOS working. I'll have to do some more research on when exactly ESXDOS needs to be paged in and out of the ROM area (it reacts to an NMI switch, pages in as a shadow ROM on RST8, and has tape traps at least... and I have no idea of what triggers them - or what triggers a page out). I also need to know how the DivMMC does its ROM/RAM paging. If anyone can help, leave me a comment or seek me out on WoSF.<br />
<br />
I've already done a bunch of Googling and searching threads on the World of Spectrum forums... Looks like I'll have to ask the designers/coders (or an emulator author perhaps) directly. Andrew Owen's already managed to give me a certain amount of insight, but I'm far from clear on all points!<br />
<br />
Finally, a picture of ZX Prism as it currently looks. Please ignore any dodgy soldering you might notice. I've just got a new soldering iron, and it's a huge upgrade from my last one!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ_LCF_jOmOEBDa1O01UkMQjyqHs5RbmgC-LdULNbhL_I5WT83lilwGd3NdGq4aZgYrUyruhAN69FsGiurP5lYcxfu_GNWzPPIPZVD1SRerDD8oBThpxOX3OhaoQYj8AMeCP218j1EHPmO/s1600/P1030857.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ_LCF_jOmOEBDa1O01UkMQjyqHs5RbmgC-LdULNbhL_I5WT83lilwGd3NdGq4aZgYrUyruhAN69FsGiurP5lYcxfu_GNWzPPIPZVD1SRerDD8oBThpxOX3OhaoQYj8AMeCP218j1EHPmO/s1600/P1030857.JPG" height="300" width="400" /></a></div>
<br />
The dev board is a Black Gold Cyclone IV kit, which is very nice but you have to translate all the documentation from Chinese! This dev board comes with 256K of 16 bit SRAM, a similar sized FLASH, about 4MB of SDRAM, RS232, VGA, USB, PS/2 (which was broken on my board), and a LAN socket as well as the 7 segment displays and LCD screen. The veroboard contains the analogue circuitry for tape-in and (untested as yet) tape-out, the dual MMC sockets, and also the break-out connector for the PS/2 and VGA daughterboard (not pictured) which replace the implementation of each on the main dev board (the PS/2 socket was broken on delivery, and the on-board VGA was 8 colour only)<br />
<div>
<br /></div>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-44436176134826743532014-08-03T06:37:00.000-07:002014-08-03T06:38:32.901-07:00ULAplus supportSpent the weekend tying up some loose ends and working on the user-definable palettes. ULAplus support is pretty much working now (it's currenlty missing the ability to read the palette back, and the ULAplus specification includes the Timex screen modes which aren't implemented yet).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi09C7aSnSh3O0azHLYyR5aDjR0c7EohaWotuonvrj8spIQE3_7fnpWW3XWfE-VsKbYKdocpjj0Chu3fPV6Je-BDTaSb5ANJP2Y9hDKSmPkQGytY5zON9NnB_Otj2GsxFNvDx-s0QON8r8A/s1600/ULAplus.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi09C7aSnSh3O0azHLYyR5aDjR0c7EohaWotuonvrj8spIQE3_7fnpWW3XWfE-VsKbYKdocpjj0Chu3fPV6Je-BDTaSb5ANJP2Y9hDKSmPkQGytY5zON9NnB_Otj2GsxFNvDx-s0QON8r8A/s1600/ULAplus.jpg" height="297" width="400" /></a></div>
<br />
I've also hooked the SRAM up, so Prism now has 48K. There's 512K SRAM on the dev board and Prism will have access to all that once I've implemented bank switching.SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-17258918601559724052014-07-30T02:26:00.001-07:002014-07-30T02:26:51.471-07:002 days solid progressThe PS/2 woes bug me no more! After a LOT (and I mean a LOT) of head-scratching, troubleshooting and trying new sockets, USB keyboard adapters, alternative keyboards etc I discovered that the 2 pins on the FPGA which were linked to the PS/2 socket were permanently shorted to ground. This wasn't down to wiring or anything on the board - the inputs themselves were buggered. A bit of testing later found that my original PS/2 keyboard was dead as a Norwegian Blue and appeared to be the original source of my woes.<br />
<br />
Wiring the PS/2 clock and data inputs to two spare FPGA pins, and using a newly acquired PS/2 keyboard finally got ZX Prism responding to key presses. Hurrah! Some changes to interrupt generation which I'd made whilst troubleshooting the original problem got reverted and tuned over a nice game of Pssst.<br />
<br />
Pssst was "loaded" by way of using an image of the Psst IF1 cartridge in place of the Spectrum ROM. This was all well and fine, but I decided tonight that I'd try my hand at a tape interface. I started out by using the RXD input of the RS232 UART as the source of the "tape in" bit of the ULA port (IN 0xFE). The UART is tolerant of (relatively) high voltages and thus protects the FPGA from the crappy old 80s cassette players. Between the RXD pin of the UART and the tape socket is the usual circuitry found on an issue 3B spectrum between the tape socket and the ULA. I expected to have to do some tweaking, but no. Horace and the Spiders loaded first time.<br />
<br />
So in the last couple of days, there's been some good solid progress! Next, I'll try to get an MMC slot wired up and ESXDOS working. The MMC slot on ZX Prism was initially going to mirror the way ZXMMC works (same ports etc), which is the same way Mike Stirling implemented MMC on FPGA Spectrum, however DivMMC has recently been released and is very popular, so I'll use DivMMC's ports - this has a number of advantages, not least that the DivMMC version of ESXDOS will be able to be used.SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-77802053439507161442014-07-27T06:01:00.002-07:002014-07-27T06:01:48.880-07:00Screen decodingAs you may have noted from previous posts, ZX Prism goes through a number of different stages to convert values in memory into what's displayed on the screen.<br />
<br />
Firstly, the addresses in VRAM to be read are calculated; this takes into consideration a number of things: the type of mode being displayed - (standard (pixel+attribute), 16bit attribute (pixel+2 attribute), planar, text, tiled), the size of attribute (8x8, 8x1) etc. The appropriate parts of memory are then read.<br />
<br />
If a planar screen mode is selected, the pixel data from each plane is combined to produce a "logical colour" number. If a pixel+attribute screen mode is selected data is then decoded using a selectable attribute decode method, producing a "logical colour" number.<br />
<br />
Finally, the logical colour number is decoded into a physical colour - There are three selectable palettes to do this.<br />
<br />
The Default palette's first 16 colours are mapped to be the same as the colours on the ZX Spectrum (including colour 8 - "bright black" being identical to colour 0). The next 16 colours are the same again except duller.<br />
<br />
There is also a fully redefinable 256 colour palette. Finally, there's a palette which is directly mapped to the 256 colours available to choose from in ULAplus (this palette is automatically selected when ULAplus is used)<br />
<br />
These different parts of the screen data decoding process are all controlled using ZX Prism's 4-bit control registers. The registers are manipulated with an OUT to port 0x8E3B (36411).<br />
<br />
The value to be sent to port 0x8E3B is constructed as follows: <i>The most significant 4 bits of the value choose the register to be written to (in the case of the attribute decode method, this is register 3 - "0011" in binary). The least significant 4 bits of the value is the data to be sent to the register</i>. Again, using attribute decode method as an example:<br />
<br />
0000 selects Spectrum attribute decode (3 bits ink colour, 3 bits paper colour, 1 bit bright, 1 bit flash)<br />
0001 selects 16+16 attribute decode (3 bits ink, 3 bits paper, 1 bit bright for ink, 1 bit bright for paper)<br />
0010 selectes 32 colour mode (3 bits ink, 3 bits paper, 2 bits bright)<br />
0100 selectes 256 colour mode 1 (8 bits ink colour, paper colour is same as the border colour)<br />
0110 selects 16 colour planar mode (which doesn't use an attribute byte at all!)<br />
<br />
So:<br />
<span style="font-family: Courier New, Courier, monospace; font-weight: bold;"> OUT 36411,48</span><span style="font-family: inherit;"> selects spectrum attribute decode</span><br />
<span style="font-family: Courier New, Courier, monospace; font-weight: bold;"> OUT 36411,49 </span><span style="font-family: inherit;">selects 16+16 mode</span><br />
<span style="font-family: Courier New, Courier, monospace; font-weight: bold;"> OUT 36411,50 </span><span style="font-family: inherit;">selects 32 colour mode</span><br />
<span style="font-family: Courier New, Courier, monospace; font-weight: bold;"> OUT 36411,52 </span><span style="font-family: inherit;">selects 256 colour mode 1</span><br />
<span style="font-family: inherit;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil21cD1Pgw5_QF2rSCMHI-7507ISsG4b7qfoEgsp_tzM0463TwQzYcEnR1c3efXdUILYkGE9IHE-3-hNHmP7IfNF2ozlz6A-0EjoCr_wQv8_9AD9r9zcSuSwVbJxylHJtRFVpE7ja9geWb/s1600/P1030843.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil21cD1Pgw5_QF2rSCMHI-7507ISsG4b7qfoEgsp_tzM0463TwQzYcEnR1c3efXdUILYkGE9IHE-3-hNHmP7IfNF2ozlz6A-0EjoCr_wQv8_9AD9r9zcSuSwVbJxylHJtRFVpE7ja9geWb/s1600/P1030843.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256 colour mode 1, default palette</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin-qTFPAfJUrdf_jei_meJRuALeZVxDrnk2kjcuVQ-XPOROzNFdBFfDxSei3Op9G5M7tGk-B50kxmEc4wwkB1GwgLhdqBk0qtoj5Sb9-YLxiH4ZiDxS5LJN848S33X2ym63OU5rXk13IRM/s1600/P1030844.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin-qTFPAfJUrdf_jei_meJRuALeZVxDrnk2kjcuVQ-XPOROzNFdBFfDxSei3Op9G5M7tGk-B50kxmEc4wwkB1GwgLhdqBk0qtoj5Sb9-YLxiH4ZiDxS5LJN848S33X2ym63OU5rXk13IRM/s1600/P1030844.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">16+16 mode - you can see instances of bright ink over non-bright paper and vice-versa)</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbEoF1ghidAuIuusdI39YDdtWlZQD6-vhZS3pzYK_7_ZQpwmysqa2nFGAzC4aEJfCpOYqu81GLBu5HsXsBnIQ3h49ARcY9qFNn80v-ac8KCcIlQGNRd0HClD529HdBzKl7jBqNuAsV2tUf/s1600/P1030845.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbEoF1ghidAuIuusdI39YDdtWlZQD6-vhZS3pzYK_7_ZQpwmysqa2nFGAzC4aEJfCpOYqu81GLBu5HsXsBnIQ3h49ARcY9qFNn80v-ac8KCcIlQGNRd0HClD529HdBzKl7jBqNuAsV2tUf/s1600/P1030845.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">32 colour mode - 4 levels of bright</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8CHZAB4b4nvg6JqRJVTEXpjPYL-uAPM99epqvKy91Qlsyt0kxpHqIrNN6TQ9OQ1X2p9CN1x_9e6x0NoGFZkW-O4_cTH5ZI9XQn_Gb_REXUGp3HKQcrz7JuRRCGWJ_NZQmNCAHC4VZa8U8/s1600/P1030846.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8CHZAB4b4nvg6JqRJVTEXpjPYL-uAPM99epqvKy91Qlsyt0kxpHqIrNN6TQ9OQ1X2p9CN1x_9e6x0NoGFZkW-O4_cTH5ZI9XQn_Gb_REXUGp3HKQcrz7JuRRCGWJ_NZQmNCAHC4VZa8U8/s1600/P1030846.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256 colour mode 1, but with the ggggrrrrbb palette</td></tr>
</tbody></table>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-15386451328851821352014-07-24T02:39:00.000-07:002014-07-24T03:36:17.685-07:00Getting intense...Yesterday I wired up the remaining lines on the video DACs. ZX Prism now has more than 8 colours - in fact it has a total of 4096 colours available (though currently you can only choose up to 256 of them for use at one time).<br />
<br />
I again tested the 4-plane planar mode with RGBI attribute decoding. When doing so, I initially forgot to put the appropriate test data back into the VRAM pages - instead four loading screens were loaded (from an earlier 512x384 test). What resulted was both a complete mess and also a great demo of planar mode, so I decided to take a picture and put it up here.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI_L6tgLO0WeIiEVCIqysPAZP_JiELuJCbnwU2VFvGrqgUsUTvQbvsufMYebyC8CpgyX3BJa2aI6gsqbDb-c7IOc6ZR5Gq-tWoaWZrN1PHIDfaTiYqlpr0yek-OmPd8IWDrkdHgUO10ji4/s1600/P1030798.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI_L6tgLO0WeIiEVCIqysPAZP_JiELuJCbnwU2VFvGrqgUsUTvQbvsufMYebyC8CpgyX3BJa2aI6gsqbDb-c7IOc6ZR5Gq-tWoaWZrN1PHIDfaTiYqlpr0yek-OmPd8IWDrkdHgUO10ji4/s1600/P1030798.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Can you work out which game was loaded into which bitplane?</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoUduOrisARNmhCcFxJ5Sp5K_WQapUeMENKk0pAMAugo-4M7Xo_3PfXglnJ_fdmnpEV-2Z2Qg5Bj327kxigoTVtzFOEPbWmNMKF2guZ3Y25pdD1wiToZ_W22Odr5eR5GJiC6P3Rxl6eKw/s1600/P1030799.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoUduOrisARNmhCcFxJ5Sp5K_WQapUeMENKk0pAMAugo-4M7Xo_3PfXglnJ_fdmnpEV-2Z2Qg5Bj327kxigoTVtzFOEPbWmNMKF2guZ3Y25pdD1wiToZ_W22Odr5eR5GJiC6P3Rxl6eKw/s1600/P1030799.jpg" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">For fun, I did another one too...</td></tr>
</tbody></table>
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-84970464667967035542014-07-19T07:58:00.000-07:002014-07-19T07:58:12.526-07:0016 Colour Planar Mode RevisitedSo the toesocks in last post's 'planar mode' screenshots looked a little different to those in the gigascreen screenshot... I initially thought it was because I'd gotten the planes muddled up, but it turned out that my test data was inverted! (Thanks again to Guesser for swiftly providing me with corrected test data) OK, so I did also get the plane data muddled - but only once! Anyway, here's a couple of planar mode screenshots to give a rough idea of what can be done. I'm not an artist, so just used an automated tool to convert the prism+planets image... it didn't turn out great ;)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivK9IpDypOvlz55rWKMUBN3U18-GB4gQF7oqrj9DXRSfDpXEZKnDiy9IOdfO-odNLjamjyR7UjOfAJLvyv6Wf15k0e9rn5imRJcvxafKVRo72Xqyxsssx9Og0UzTrSz568XYoWzsEegK9e/s1600/P1030763.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivK9IpDypOvlz55rWKMUBN3U18-GB4gQF7oqrj9DXRSfDpXEZKnDiy9IOdfO-odNLjamjyR7UjOfAJLvyv6Wf15k0e9rn5imRJcvxafKVRo72Xqyxsssx9Og0UzTrSz568XYoWzsEegK9e/s1600/P1030763.JPG" height="300" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1M5Cm5WzRFPRJsPhxZEwQmS-Dumn6wsnF5_p0pK7tdeU30SEFUxDswJKguC7JbGsAw07A8f-KwoVtS1FCvy3k8M9SXiwcTxjY27TQSGINqWfsA4VeG8yqySN6mrKwb2kNmqN2RoXEu4ku/s1600/P1030764.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1M5Cm5WzRFPRJsPhxZEwQmS-Dumn6wsnF5_p0pK7tdeU30SEFUxDswJKguC7JbGsAw07A8f-KwoVtS1FCvy3k8M9SXiwcTxjY27TQSGINqWfsA4VeG8yqySN6mrKwb2kNmqN2RoXEu4ku/s1600/P1030764.JPG" height="300" width="400" /></a></div>
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-81625257220801082992014-07-17T06:30:00.004-07:002014-07-19T07:58:40.634-07:0016 Colour "colour-clash free" planar mode and Hardware GigascreenI put a plea out on the World of Spectrum forums for somebody to help me by producing some test screens in different formats. Guesser very quickly produced some files which enabled me to implement and test the 16 colour planar mode. This worked great first time, except that I forgot that the Spectrum's colours are in order of intensity, not in RGB binary order so I loaded the colour planes into the wrong VRAM pages. Oops. Well, you live and learn... What's more, when I tried to fix the order I got it wrong again. D'oh.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDEJPiIZ4OIIqwQCaVazc3bnQTc__pPy_jvTeCcwtYpjj01XxHmmZm0cDOL69QMSCdgyDSzD2HB-SsbkVPKfjt-VbB28n_6ndQwa4sXqnFx663IuhaPDNfB8YlVvr_TEKy1ldC9RYewrk8/s1600/P1030740.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDEJPiIZ4OIIqwQCaVazc3bnQTc__pPy_jvTeCcwtYpjj01XxHmmZm0cDOL69QMSCdgyDSzD2HB-SsbkVPKfjt-VbB28n_6ndQwa4sXqnFx663IuhaPDNfB8YlVvr_TEKy1ldC9RYewrk8/s1600/P1030740.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256x192 16 colour planar... with the bitplanes loaded into the wrong VRAM pages so the colours are muddled. Oops.</td></tr>
</tbody></table>
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbIzlaVgG7cmd6fuiN0c5X1fHLGK4tUYrTUfFrgkdKX9AcjOAOkCqjvqncpg9axVWipp2eaxjUXcV5D8bV5abxF8tiUBlnQ4073pRAQ8D_d70iGI5LAeJDb2nwvvag2F4LYunfydGLEkU/s1600/P1030742.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbIzlaVgG7cmd6fuiN0c5X1fHLGK4tUYrTUfFrgkdKX9AcjOAOkCqjvqncpg9axVWipp2eaxjUXcV5D8bV5abxF8tiUBlnQ4073pRAQ8D_d70iGI5LAeJDb2nwvvag2F4LYunfydGLEkU/s1600/P1030742.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Take 2... still not right, but it proves the mode works - the colours being wrong are 50% me being distracted by baby and 50% me not having eaten dinner (since remedied)</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAHVYE-cayzysO0PxOMcY_Gpt67ZgaYjHgImQb0WTgBLqoeAuF8TW04YfgvhIg2sNOMsWgkqjuqGD9RfXH7aZTGjkn6mbC3FP8XGKMckFhOYHjTCzyspuHJ3sPseXYC_2ZOyrNObDfmTw0/s1600/P1030743.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAHVYE-cayzysO0PxOMcY_Gpt67ZgaYjHgImQb0WTgBLqoeAuF8TW04YfgvhIg2sNOMsWgkqjuqGD9RfXH7aZTGjkn6mbC3FP8XGKMckFhOYHjTCzyspuHJ3sPseXYC_2ZOyrNObDfmTw0/s1600/P1030743.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Hardware Gigascreen - it appears to work without too much shimmer. I'll do more tuning once 4 bit per channel VGA is connected up - I suspect we lose something by having no "BRIGHT" colours at the moment (shortfall of the dev board, not ZX Prism)</td></tr>
</tbody></table>
<br />
<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-65443803625168687752014-07-16T06:13:00.000-07:002014-07-19T07:59:22.348-07:00Development moves to Cyclone IVBack again after a bit of a break - apologies for the radio silence once again, but real life has a habit of getting in the way of things like blogs! <br />
<br />
Much has happened with ZX Prism since my last post. The most major thing is that development moved from an Altera Cyclone II based dev board onto my shiny new Cyclone IV dev board. This has the major advantage that the Cylclone IV EP4CE15 FPGA used on this board has enough internal memory cells to implement the majority of the planned ZX Prism screen modes. Some of the more "out there" modes I had planned may fall by the wayside but there will still be plenty to choose from.<br />
<br />
Since moving to the new dev board, progress has been swift. I got the basic video driver ported across in just a couple of hours and then set about building a Spectrum-like computer. In just under 2 days, I had ZX Prism initialising and displaying the hallowed "(c) 1982 Sinclair Research Ltd" message. In the top left of a 512x384 resolution screen :) I tried alternative ROMS too, just to prove it wasn't a fluke and all worked happily - SE Basic and the ROM versions of JetPac and Pssst all booted fine.<br />
<br />
Since then I've been battling getting a PS/2 keyboard working. It worked for about an hour and then stopped working entirely without me changing anything. Some poking and prodding about the dev board with a multimeter showed that the data signal wasn't making it to the FPGA anymore. Routing the signal myself doesn't seem to have fixed things. I'll leave this for now - it's just led to several days of frustration and no further progress on Prism. I can come back to PS/2 later when I wire up the SD Card slots and replacement VGA connector. Yes, despite boasting a shiny new Cyclone IV, this dev board only has 1 bit VGA - that's right, at the moment ZX Prism only has 8 colours!<br />
<br />
Anyway it's been ages since my last post so here's some pictures of ZX Prism showing off it's 4 different screen resolutions:<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4ixQCgbzAIYMeEoy557FSGan-oa4Sfvm4Wz6uYsHt6xT4A2UFnm9N9Ziede_3lZjFVWXVvEaAylTSdLThQPoROuVBXR3r_bCFQ1Z2s6qT49BLAncsKKAVd4p9f5nYkeITGRDc_n6qK-z7/s1600/P1030710.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4ixQCgbzAIYMeEoy557FSGan-oa4Sfvm4Wz6uYsHt6xT4A2UFnm9N9Ziede_3lZjFVWXVvEaAylTSdLThQPoROuVBXR3r_bCFQ1Z2s6qT49BLAncsKKAVd4p9f5nYkeITGRDc_n6qK-z7/s1600/P1030710.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Standard 256x192 resolution, standard palette, standard attribute decoding</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrjwCDXjPYUVA7RqzGNJSBZ6_YByBNJ_l3qX0an5l0ktz07W0lxI5BZJhe31e_vo81Yg4twh32QmvefmMUlxmhT5XEpGKi1YN_M9lahMlbPv-1MJjdLxEwzGZfwvTpyh4JK6taM0llrGFg/s1600/P1030707.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrjwCDXjPYUVA7RqzGNJSBZ6_YByBNJ_l3qX0an5l0ktz07W0lxI5BZJhe31e_vo81Yg4twh32QmvefmMUlxmhT5XEpGKi1YN_M9lahMlbPv-1MJjdLxEwzGZfwvTpyh4JK6taM0llrGFg/s1600/P1030707.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"> 512x192 resolution, standard palette, standard attribute decoding <br />
(I will also add the monochrome Timex 512x192 mode later) </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEYjKCY75KkFzmKkVMJ-xICPTwNz6a1mv6fOxaLEYgNtiykQS_cQRKoVlOhvwQ3sJR-O90ITzsHsrnAzH7pXQxUJ3GKn_k6lCr5qjm2vKXc_Tn0rIWj9RTVE1MMHzoFWwXpWtMpc-BvS1i/s1600/P1030708.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEYjKCY75KkFzmKkVMJ-xICPTwNz6a1mv6fOxaLEYgNtiykQS_cQRKoVlOhvwQ3sJR-O90ITzsHsrnAzH7pXQxUJ3GKn_k6lCr5qjm2vKXc_Tn0rIWj9RTVE1MMHzoFWwXpWtMpc-BvS1i/s1600/P1030708.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"> 256x384 resolution, standard palette, standard attribute decoding</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMOCOOFKDiBpfEc-QdqzyKV1fsQkLSwSWNSBJgkEXMRSZsc7tofzPzZUw1qYW5MeyeUh_VHA9VbhZ0BPFQLK6SUSB2rtRiEXzhCgLnbeUAhsZplF_v29gvDseHvylrXIDXVwYivu0p0SWD/s1600/P1030709.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMOCOOFKDiBpfEc-QdqzyKV1fsQkLSwSWNSBJgkEXMRSZsc7tofzPzZUw1qYW5MeyeUh_VHA9VbhZ0BPFQLK6SUSB2rtRiEXzhCgLnbeUAhsZplF_v29gvDseHvylrXIDXVwYivu0p0SWD/s1600/P1030709.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">512x384 resolution, standard palette, standard attribute decoding</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRVHWECt80CoDw5kpOtUisSLg05TIPePJxnlYLYtrm7Ik2MHHUJMrCfufPNKQ03fKWP5XKdPbXGfbKZ2TPmcmVoMTghRUZDHTx1tHRbGc6232O1Nz0a67_mKK6pBiczYcIiQv5h4iLP3V/s1600/P1030711.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiRVHWECt80CoDw5kpOtUisSLg05TIPePJxnlYLYtrm7Ik2MHHUJMrCfufPNKQ03fKWP5XKdPbXGfbKZ2TPmcmVoMTghRUZDHTx1tHRbGc6232O1Nz0a67_mKK6pBiczYcIiQv5h4iLP3V/s1600/P1030711.JPG" height="300" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Booting the original Spectrum ROM in 512x384 resolution :)</td></tr>
</tbody></table>
<span id="goog_1694470401"><br /><br />
</span>SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-86625841430016103272013-07-26T07:07:00.000-07:002014-07-17T03:45:29.622-07:00Selecting screen modes, data decoding methods and palettesZX Prism lets you select from a number of different screen data decoding methods. Like the ZX Spectrum, many of these modes use an 'attribute' byte to define the ink and paper colours in each 8x8 square. Like the Timex range of Spectrum compatibles, these modes also support 8x1 attributes. Unlike either range of machines, ZX Prism lets you choose how the attributes are decoded into a logical colour number, and then how that logical colour is translated into the colour which displayed on screen.<br />
<br />
<strong>Screen resolution and 8x8/8x1 attribute selection is made using 4bit register 0010.</strong> <br />
Not all resolutions or features are available for all screen data decode methods. Where a resolution is not available, Prism reverts to 256x192, 8x8 attributes and non-gigascreen*. <br />
<br />
OUT 8E3B, 0010xxxx Screen resolution selection where xxxx is:<br />
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
<strong>0000 – 256x192 8x8 attributes</strong></div>
<strong>
0001 – 512x192 (vertically halved
display) 8x8 attributes</strong><br />
<strong>
0010 – 256x384 (horizontally halved
display) 8x8 attributes</strong><br />
<strong>
0011 – 512x384 (quartered display)
8x8 attributes</strong><br />
<strong>
0100 – 256x192 8x1 attributes
(“hicolour”)</strong><br />
<strong>
0101 – 512x192 (vertically halved
display) 8x1 attributes</strong><br />
<strong>
0110 – 256x384 (horizontally halved
display) 8x1 attributes</strong><br />
<strong>
0111 – 512x384 (quartered display)
8x1 attributes</strong><br />
<strong>
1000 – 256x192 Hardware GIGASCREEN
8x8 attributes *
</strong><br />
<strong>
1001 – 512x192 Hardware GIGASCREEN
8x8 attributes *</strong><br />
1010 – reserved<br />
1011 – reserved<br />
<strong> 1100 – 256x192 Hardware GIGASCREEN
8x1 attributes *</strong><br />
<strong>
</strong>1101 – reserved<br />
1110 – reserved<br />
1111 – reserved<br />
<br />
*<span style="font-size: xx-small;">Hardware gigascreen is an experimental feature which on even frames interlaces the even lines of screen 0 with odd lines of screen 1 and on odd frames interlaces the odd lines of screen 0 with even lines of screen 1.</span><br />
<br />
<strong>Screen data decoding method selection is made using 4bit register 0011:</strong><br />
<br />
OUT 8E3B, 0100xxxx ZX Prism palette selection where xxxx is:<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0000 – DEFAULT</strong></div>
ATTR: D0-D2 ink, D3-D5, paper, D6
bright, D7 Flash<br />
<br />
<strong> 0001 – 16+16 Colour</strong><br />
ATTR: D0-D2 ink, D3-D5, paper, D6
ink bright, D7 paper bright<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0010 - 32 Colour</strong></div>
ATTR: D0-D2 ink, D3-D5, paper, D6
bright, D7 NOT halfbright<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0011 - 16C</strong> (4 bits per pixel chunky
mode)</div>
<br />
<div style="margin-bottom: 0cm;">
<strong>0100 – 256 Colour mode 1</strong>
</div>
ATTR: D0-D7 - ink colour, BORDER –
paper colour<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0101 – 256 Colour mode 2 - 2 byte
attribute read.</strong></div>
ATTR: D0-D7 - ink colour, D8-D15 -
paper colour<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0110 – 16
colour Planar mode</strong>
</div>
<br />
<div style="margin-bottom: 0cm;">
0111 – [Reserved]</div>
<div style="margin-bottom: 0cm;">
1000 – [Reserved]</div>
<div style="margin-bottom: 0cm;">
1001 – [Reserved]</div>
1010 – [Reserved]<br />
1011 – [Reserved]<br />
1100 – [Reserved]<br />
<strong>1101 – Rasterscan</strong> (pixel colour =
BORDER colour)<br />
1110 – [Reserved]<br />
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
<strong>1111 – 256 colour chunky</strong> (8 bits
per pixel) mode</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1TfZIxbNyJCIVlMVm0KTO3XTnEEby5cXtFn29EEAenh-WoPRowXVL7zsEptMmE-udFeK1q4h1c4UnIphkeXAgSJQ-r4UnxmeuRRZ5K4CjyKPJtxK4r2o-g-dREvz5NomM20FpJFdxxYPh/s1600/Prism+Screen+Decoding+DEFAULT.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1TfZIxbNyJCIVlMVm0KTO3XTnEEby5cXtFn29EEAenh-WoPRowXVL7zsEptMmE-udFeK1q4h1c4UnIphkeXAgSJQ-r4UnxmeuRRZ5K4CjyKPJtxK4r2o-g-dREvz5NomM20FpJFdxxYPh/s400/Prism+Screen+Decoding+DEFAULT.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">DEFAULT decode mode is just like a ZX Spectrum - Ink and Paper are effectively chosen from two CLUTs of 8 colours each (if the default palette is used, this is identical to choosing colours 0-7 with bright set to either 0 or 1)<br />
</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ulMOZDYskF7cIaNeTc_FSrS2dWrEu9XxzpryoXngzShPPt0jCskehgnDEwyGXGBUOdoD9hM0HjrnjHM9MNrDxRHwahYOgcfpbDIUF0d-Kc8mgTm41OdXbYtE21qx1KaKbxC6X5Lv2pAd/s1600/Prism+Screen+Decoding+1616.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ulMOZDYskF7cIaNeTc_FSrS2dWrEu9XxzpryoXngzShPPt0jCskehgnDEwyGXGBUOdoD9hM0HjrnjHM9MNrDxRHwahYOgcfpbDIUF0d-Kc8mgTm41OdXbYtE21qx1KaKbxC6X5Lv2pAd/s400/Prism+Screen+Decoding+1616.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">16+16 Mode is similar to DEFAULT decode mode, except that ink and paper can be selected from a single group of 16 colours (if the default palette is used, this effectively gives you a separate bright bit each for paper and ink)<br />
</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZj3SfvbuaGWFJQn0DAaoPxBQz536qt4qz-3HfOX94z9avNThr29CC0He7u3JVkJ7_QMBCiq7jkY3TSNS3wcl1kYOXHMa00GgFa2BGHzNZVEgtpTH3gk8EuVPPD3TP5qtIwARxUHdjRP-t/s1600/Prism+Screen+Decoding+32.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZj3SfvbuaGWFJQn0DAaoPxBQz536qt4qz-3HfOX94z9avNThr29CC0He7u3JVkJ7_QMBCiq7jkY3TSNS3wcl1kYOXHMa00GgFa2BGHzNZVEgtpTH3gk8EuVPPD3TP5qtIwARxUHdjRP-t/s400/Prism+Screen+Decoding+32.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">32 Colour mode is similar to DEFAULT decode mode except that ink and paper are both selected from one of four different CLUTs of 8 colours each. If the default palette is used, this effectively gives you 4 levels of bright - the flash bit is an inverse "half-bright" bit (it's "on" when unset, off when set) to prevent the DEFAULT palette being too dark when used in 16 colour modes<br />
.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR6Lz-VDNR2bBTFcDr72ydPCF1W0-T-Ca6HzRK9gRH9USkMuOKXl6al0cHzbRJYGjgcufBm0jH7bmLth2hZHGbI_t4ZIphg581HpVWzFPCJndD2Elsis6sw5qfdbLWn4A2ZcBaqX4j-3ke/s1600/Prism+Screen+Decoding+256i.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR6Lz-VDNR2bBTFcDr72ydPCF1W0-T-Ca6HzRK9gRH9USkMuOKXl6al0cHzbRJYGjgcufBm0jH7bmLth2hZHGbI_t4ZIphg581HpVWzFPCJndD2Elsis6sw5qfdbLWn4A2ZcBaqX4j-3ke/s400/Prism+Screen+Decoding+256i.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256(i) colour mode uses the entire attribute byte to dictate the ink colour. Paper colour is dictated by the BORDER colour stored at IO address 0x9E3B.<br />
</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7aR4FJa4q6sQemrPygnrcj4v7umc69vc9vcruH921kx84snFGtpfovKTHt4PGV7ng-zav-IJwQWOJ8HIq9Par3XLWpLz0UYmbQjHulFOYLdjYdyTc58rANtQhpQxWD-w1ND2z5R4gz926/s1600/Prism+Screen+Decoding+256ii.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7aR4FJa4q6sQemrPygnrcj4v7umc69vc9vcruH921kx84snFGtpfovKTHt4PGV7ng-zav-IJwQWOJ8HIq9Par3XLWpLz0UYmbQjHulFOYLdjYdyTc58rANtQhpQxWD-w1ND2z5R4gz926/s400/Prism+Screen+Decoding+256ii.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256(ii) colour mode uses two attribute bytes. The first to dictate the ink colour, the second to dictate the paper colour.<br />
</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWaQQY9HnGxsCHEF5BzPkz6UE4_XX5AzuEoIwJIaYcLvA0ZS8CMq0zQlimBRis96KCONO0UPbMiUoza8AZ3UHZo9ui4zQXeMdTUy6IDcDz0SJoIByx5sb3b3AofCxmCOMOgQCsT5Pilg4U/s1600/Prism+Screen+Decoding+16planar.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWaQQY9HnGxsCHEF5BzPkz6UE4_XX5AzuEoIwJIaYcLvA0ZS8CMq0zQlimBRis96KCONO0UPbMiUoza8AZ3UHZo9ui4zQXeMdTUy6IDcDz0SJoIByx5sb3b3AofCxmCOMOgQCsT5Pilg4U/s400/Prism+Screen+Decoding+16planar.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">16 colour planar mode uses 4 256x192 pixel bitplanes to dictate pixel colour. In DEFAULT palette mode this equates to plane 1 (stored in page 5a) being a blue plane, plane 2 (page 7a) being a red plane, plane 3 (page Da) being a green plane and plane 4 (page Fa) being a "bright" plane. <br />
</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGEsvrEKHh3UaO7_Vu4LWCaKaghAXsYmBVoLR9zr2qI3YLAGrjcZ83YW1YB0zywEMX8EZ3N2di2Z0rF5zPnEFGsFxMYYolwqjTzbGnCXcSDNQOeIYhnBVWBvjVyVnyDSiaVFy36hXaZpAr/s1600/Prism+Screen+Decoding+256chunky.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGEsvrEKHh3UaO7_Vu4LWCaKaghAXsYmBVoLR9zr2qI3YLAGrjcZ83YW1YB0zywEMX8EZ3N2di2Z0rF5zPnEFGsFxMYYolwqjTzbGnCXcSDNQOeIYhnBVWBvjVyVnyDSiaVFy36hXaZpAr/s400/Prism+Screen+Decoding+256chunky.jpg" height="282" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">256 colour chunky mode uses a byte per pixel. A single screen takes up 48K of VRAM. This mode is only really of use for title (or otherwise static) screens due to the amount of data that needs to be shifted around.<br />
</td></tr>
</tbody></table>
<br />
There are 3 methods of decoding the "logical colour" into a physical colour:<br />
<ul>
<li>Default palette. This is a hard-coded palette. The first 16 colours are identical to the ZX Spectrum's colours, the next 16 are dimmer versions of the first 16. Colours 0-7 – intensity 1 colours; Colours 8-15 = intensity 3 versions
of colours 0-7; Colours 16-23 = intensity 0
versions of colours 0-7; Colours 24-31 = intensity 2 versions
of colours 0-7. [The remainder of the default palette are awaiting definition] </li>
<li>Prism palette. This is a user-defined palette. Each colour can be assigned 8 bit red, green and blue elements. Whilst the Prism specification allows 24bit definitions for each colour, some implementations may transcode these into 9bit colour (3 bits per element), 12 bit colour (4 bits per element) etc. My implementation currently uses 12 bit colour (4 bits per element) as shown in the diagrams above</li>
<li>GggRrrBb (aka G3R3D2 encoding) is a hard-coded palette as used by ULAplus, MSX etc. Bits 0 and 1 define the blue element; 2,3 and 4 define the red element and 5,6 and 6 define the green element.</li>
</ul>
<strong>Palette selection is made using 4bit register 0100:</strong><br />
<br />
OUT 8E3B, 0011xxxx ZX Prism palette selection where xxxx is:<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0000 – DEFAULT</strong>
</div>
<br />
<div style="margin-bottom: 0cm;">
Colour 0 – Black, Colour 1 –
Blue, Colour 2 – Red, Colour 3 – Magenta</div>
Colour 4 – Green, Colour 5 –
Cyan, Colour 6 – Yellow, Colour 7 – White<br />
<br />
Colours 0-7 – intensity 1 colours
(as numbered above)<br />
Colours 8-15 = intensity 3 versions
of colours 0-7<br />
Colours 16-23 = intensity 0
versions of colours 0-7<br />
Colours 24-31 = intensity 2 versions
of colours 0-7<br />
<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0001 – GGGRRRBB </strong></div>
<br />
<div style="margin-bottom: 0cm;">
bit (0) – blue(0)</div>
<div style="margin-bottom: 0cm;">
bit (1) – blue(1)</div>
bit (2) – red(0)<br />
bit (3) – red(1)<br />
bit (4) – red(2)<br />
bit (5) – green(0)<br />
bit (6) – green(1)<br />
bit(7) – green(2)<br />
<br />
<br />
<div style="margin-bottom: 0cm;">
<strong>0010 – ZX Prism PALETTE</strong></div>
<br />
Colour 0-255 looked up vs the user-defined ZXPrism
Palette<br />
<br />
<div style="margin-bottom: 0cm;">
<br /></div>
<br />
<br />
<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com35tag:blogger.com,1999:blog-7607885452172131382.post-74079909644959607362013-07-18T20:40:00.000-07:002013-07-18T20:40:35.000-07:00ZX Prism 1024K mode Memory Map<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdDkAKiyVU_ygUx9FEV4ULx7QjTCL3iejLogehhxYqetGgcQWKnir11eRYy8e0i9DS-huy-YHuP-ADWVmPSYdSdNMMI6Gb-QJ1497o0WUq4zxFyIivijKoiBmHmccyMwYpbWMx81mYykT/s1600/Screen+shot+2013-07-19+at+1.19.47+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCdDkAKiyVU_ygUx9FEV4ULx7QjTCL3iejLogehhxYqetGgcQWKnir11eRYy8e0i9DS-huy-YHuP-ADWVmPSYdSdNMMI6Gb-QJ1497o0WUq4zxFyIivijKoiBmHmccyMwYpbWMx81mYykT/s400/Screen+shot+2013-07-19+at+1.19.47+PM.png" width="400" /></a></div>
<br />
This may go some way to explaining why ZX Prism's codename was "Project Overkill" for a while.<br />
<br />
<b>Some further explanation/clarification:</b><br />
<br />
In 1024K mode, the memory page at 0xC000 is chosen using port 0x7FFD in the same way as the 1024K Pentagon (as documented in the ZX Profi documentation by Velesoft):<br />
<ul>
<li>7FFD bit 0 = Page # bit 0</li>
<li>7FFD bit 1 = Page # bit 1</li>
<li>7FFD bit 2 = Page # bit 2</li>
<li>7FFD bit 6 = Page # bit 3</li>
<li>7FFD bit 7 = Page # bit 4</li>
<li>7FFD bit 5 = Page # bit 5 </li>
</ul>
It should be noted that <b><i>outside</i></b> of 1024K mode, port 7FFD bit 5 when true works as expected (ie it locks the current memory configuration and prevents any further memory paging - known as "48K mode" in some circles). <br />
<br />
Due to the way this locking works in ZX Prism, enabling 1024K mode from "48K mode" has the effect of re-enabling memory paging.<br />
<br />
<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com2tag:blogger.com,1999:blog-7607885452172131382.post-50540480712646445462013-07-10T03:39:00.001-07:002014-07-17T03:47:31.417-07:00Formal specificationsDuring the FPGA debugging process, a number of things struck me. First was that I'd made the video RAM interface overly complicated - or at least more complicated than it needed to be - and secondly I realised that whilst I had a lot of notes about how the colour palettes, screen modes and CPU control were going to work, I hadn't sat down and formally produced a full specification.<br />
<br />
So I took a couple of steps back and also a small break to brainstorm a feature wishlist. I then thought about how all the different proposed features would work, which I considered "essential" and which were not essential but could be produced easily using the technology required to realise the "essential" features.<br />
<br />
As anyone following this blog will be all too aware, this process has taken some time, not least because a number of other areas of my life have been vying for my time as well. It's all for the best though, and the specification boasts a strong and usable feature list.<br />
<br />
Here's a taster.<br />
<br />
<u>Memory</u><br />
<ul>
<li>The all-RAM "Special" memory mode available in the Spectrum +2A/B and +3 will be replicated meaning ZX Prism will be able to run the various software that requires it.</li>
<li>Outside of the "Special" memory mode, the ROM area (0x0000 - 0x3FFF) is selected from 32 pages of FLASH (512K) or 32 pages of non-volatile RAM. This arrangement is controlled in the same way as the memory in the ZXMMC+ interface, including the fact that the page number selected is affected by the 128K ROM selection bit of port 7FFD. Unlike ZXMMC+, ZXPrism also watches the ROM selection bit of port 1FFD so that 64K rom sets (eg +3 or +3e) can be used. </li>
<li>The memory between 0xC000 and 0xFFFF, is 16K selected from a set of 64 pages, for a total memory of 1MB. The page number is selected in the same way as on the Pentagon, using port 7FFD bits 0-2, 5, 6 and 7. 1MB mode can be disabled for compatibility, re-enabling it can be used to re-enable paging if locked in 48K mode.</li>
<li>ZX Prism has 64K of video memory split into 8 x 8K segments. Which segment(s) the video circuitry used depends on which screen data decode method and which screen resolution is selected. As on the Spectrum, the CPU sees video memory between 0x4000 and 0x7FFFx, but unlike the Spectrum, it is possible to choose which 8K segment the CPU sees at 0x4000 and which 8K segment it sees at 0x6000. Of course in BASIC crashes will occur if the segment at 0x6000 is changed, so this is discouraged....</li>
<li>To reduce CPU overhead when using one of the "Planar" screen modes, it is possible to tell the hardware that writes to 0x4000 - 0x7FFF write to one, two, three or four planes (segments of video memory) at once. </li>
</ul>
<u>Hardware control</u><br />
<br />
ZXPrism hardware control is done via 16 x 4 bit registers. These are modified by writing to IO port 8E3B. The most significant nibble of the data writen to the port selects which register you are writing to, the least significant nibble is the data to be written to the register.<br />
<br />
OUT 8E3B, 0000xxxx - CPU speed control, where xxxx is:<br />
<br />
0000 – Slow (3.5MHz) DEFAULT<br />
<div style="margin-bottom: 0cm;">
0001 – Double (7MHz) if supported, else 3.5MHz</div>
<div style="margin-bottom: 0cm;">
0010 – Triple (10.5MHz) if
supported, else 7MHz</div>
<div style="margin-bottom: 0cm;">
0011 – Quadruple speed (14MHz) if
supported, else 10.5MHz</div>
<div style="margin-bottom: 0cm;">
0100 – 6x speed (21MHz) if
supported, else 14MHz</div>
<div style="margin-bottom: 0cm;">
0101 – 8x speed (28 Mhz) if
supported, else 21MHz</div>
<div style="margin-bottom: 0cm;">
. . .</div>
<div style="margin-bottom: 0cm;">
1111 – Fastest supported speed
(currently 21MHz)</div>
<br />
<br />
OUT 8E3B, 0001xxxx - Misc options<br />
<br />
0000 - <br />
xxx1 - Enable Spectrum 48K style video memory contention<br />
xx1x - Allow read/write to port xxFF (enable Timex mode)<br />
x1xx - Enable "Bright Black"<br />
1xxx - Disable 1024K mode/Enable 48K mode lock<br />
<br />
Other hardware control registers will be covered in more detail in future posts:<br />
<br />
OUT 8E3B, 0010xxxx - Screen resolution, attribute size, enable hardware "gigascreen" mode<br />
OUT 8E3B, 0011xxxx - Screen/Attribute data decode method <br />
OUT 8E3B, 0100xxxx - Colour decode method (hardcoded, ULAplus palette, PRISM palette)<br />
OUT 8E3B, 0101xxxx - CPUside Video Memory Control: Planar mode write options<br />
OUT 8E3B, 01100xxx - CPUside Video Memory Control: segment at 0x4000<br />
OUT 8E3B, 01101xxx - CPUside Video Memory Control: segment at 0x6000<br />
<br />
<br />
Hope that wets your whistle - more to come at a later date.SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com0tag:blogger.com,1999:blog-7607885452172131382.post-60872078721291230082012-09-20T06:29:00.000-07:002012-09-20T06:29:14.490-07:00Prism progress updateJust a quick update for now. LOTS has happened since I last posted though. LOTS more wiring has happened, mainly between the FPGA and the bus transceivers that I'm using to convert between the FPGA's 3.3v logic and the Z80's 5v logic. I've also put prism into a case, wired in the twin SD Card slots, and wired up a power switch, power status LED and a reset button. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBayh5G9qEr3Jvf3VLuz9CbIJaxOHZ__PNaVsI44RzTVioMyUS6fOWX1WbL4m_kwfH3NoMAij8A6F7dytuHCf79ooBn4IjNgPvFHXHaP9fP0e1R-GggCvLrA90VBXfTfFDpEBk6JEdlkLD/s1600/P1020844.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBayh5G9qEr3Jvf3VLuz9CbIJaxOHZ__PNaVsI44RzTVioMyUS6fOWX1WbL4m_kwfH3NoMAij8A6F7dytuHCf79ooBn4IjNgPvFHXHaP9fP0e1R-GggCvLrA90VBXfTfFDpEBk6JEdlkLD/s400/P1020844.JPG" width="400" /></a></div>
<div style="text-align: center;">
<span style="font-size: x-small;">On the left are the two SD Card slots with their related activity LEDs. Next, there's two red "NMI" buttons. Following that are 3 switches - the first will control if FLASH or NVRAM is to be used on startup. The third is the FLASH ROM write protect and the middle switch will likely switch between ABC and ACB stereo for the AY, though I've not decided for sure yet. Finally on the right is the power switch, power LED and reset switch.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_ka3QKugxBVSCWnrjQ8a8t5meDEg-LZmp-Cpd9ZwINljd2WBxVtRoSYm-9vfG1ZPSLUCUt_AZr4NzQneRnHMv8lEdtq5iIOTSayP0akCqq2xSvjp6zOsAGY66Tli0lshM236rxsQ6C55y/s1600/P1020843.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_ka3QKugxBVSCWnrjQ8a8t5meDEg-LZmp-Cpd9ZwINljd2WBxVtRoSYm-9vfG1ZPSLUCUt_AZr4NzQneRnHMv8lEdtq5iIOTSayP0akCqq2xSvjp6zOsAGY66Tli0lshM236rxsQ6C55y/s400/P1020843.JPG" width="400" /></a></div>
<div style="text-align: center;">
<span style="font-size: x-small;">On the bottom left is the PCB with the SD Card sockets mounted. Above that is the PCB with the joystick, keyboard and mouse sockets on it (not currently wired in). Above that's the VGA socket. The rest of the PCB is as described previously (though with a lot more wiring completed and the battery socket added)</span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
The four empty sockets on the right are for the main memory, Flash ROM and NVRAM. These have been temporarily removed during testing to avoid damaging them if anything goes awry... I've got quite a lot of the 32K SRAM chips I'm using as video RAM, which is probably just as well as the interface and interplay between the FPGA, Z80 and video RAM is the first thing I'm testing. I've sourced and ordered a small number of 20MHz Z80s too but will be testing with a spare 4MHz version.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Yes the wiring looks a little messy, but it was hard to come up with a tidy way of doing it! Each parcel of 8 wires from the bus transceivers are taped together to make it a little more managable.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
As of last weekend, ZX Prism is outputting a test pattern to its monitor. The pattern is generated using simple logic and counters in the FPGA, but it proves that the video circuitry is working, the syncs are being correctly generated and the 12 bit colour is working courtesy of the resistor-DAC.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWRkzQHkCXqVgz8h8DBNS2xgyeCVkJ9-X7F4GtOwEU0_5OS244ayDxVAquE7DnJ-tb0rj5IkF2F7Z7PyDwWbWGAYNprI85nXGXZRHpnArS5-yRzt8oRTuycvawJWSQsxrvGewsFoC80Ul/s1600/P1020842.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWRkzQHkCXqVgz8h8DBNS2xgyeCVkJ9-X7F4GtOwEU0_5OS244ayDxVAquE7DnJ-tb0rj5IkF2F7Z7PyDwWbWGAYNprI85nXGXZRHpnArS5-yRzt8oRTuycvawJWSQsxrvGewsFoC80Ul/s400/P1020842.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-small;">Simple test pattern..</span></div>
SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com1tag:blogger.com,1999:blog-7607885452172131382.post-62350716590450991382012-08-05T03:16:00.001-07:002012-08-05T03:16:20.271-07:00FPGA + Z80 + MemoryApologies for the radio silence to anybody still following progress on this project. The last few months I've been rather busy with other projects, and the progress on ZX Prism has mainly been on-paper; as per the previous post, I've redesigned ZX Prism to base it around a real Z80 instead of implementing the Z80 on the FPGA.<br />
<br />
The design's been completed and I've started realising it in hardware. I'm using a cheap FPGA mini dev board which basically contains a Cyclone II FPGA, clock source, serial EPROM and breaks out all the IO to pin headers. They cost around $20 (about 10 quid). I chose this board as there's several vendors on eBay selling them cheaply and hopefully if all works out, that'll mean the project's more accessable for others.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTBmPj5X5SDcxhvvD6Y1YE7THqiZKznSFdeGGLRVGehToeNnuQPl0EquxLUDSKGqcQfxjrYoT1Z8jCWsaxTL-Iai72vifYx2Ii5PkoG-zfFBkRSZEayEiuhV81DJBfIm-2PKUc5CYwwNvj/s1600/P1020839.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="197" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTBmPj5X5SDcxhvvD6Y1YE7THqiZKznSFdeGGLRVGehToeNnuQPl0EquxLUDSKGqcQfxjrYoT1Z8jCWsaxTL-Iai72vifYx2Ii5PkoG-zfFBkRSZEayEiuhV81DJBfIm-2PKUc5CYwwNvj/s320/P1020839.JPG" width="320" /></a></div>
<br />
The prototype so far - Z80 (top right), 29c040 512K Flash rom, 3 x 628512 (1 Meg RAM, 512K non volatile RAM), 2 x 61256 (64K video memory), AY 3 8912A sound chip, Cylone II FPGA dev board, 7 x 74245 level converters to convert 5v TTL signals to 3.3v as used by the FPGA and vice-versa.<br />
<br />
Still a long way to go, but definitely getting somewhere!<br />SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com1tag:blogger.com,1999:blog-7607885452172131382.post-86722173762975840072012-03-24T06:30:00.000-07:002012-03-24T06:30:25.070-07:00Not dead, just resting!Apologies for the lack of recent updates. Since the last update I've spent a lot of time rewriting the VGA handler so that it better matched Spectrum timings and also had enough clock ticks to create a bordered 512x384 pixl display. This was largely successful but I still could not get a lot of test software to work correctly - in fact most of it was still crashing upon loading. I've come to the conclusion that the soft-core z80 just isn't cutting it.<br />
<br />
But I'm not giving up. Not at all! In fact, I've started work on a project similar to ZX Badaloc and Harlequin - a spectrum with an FPGA taking the place of the ULA (and much of the glue logic etc). Most of the work done thus far on the ZX Prism FPGA will be able to be reused. This has the added bonus that, with a minimum of hacking, the FPGA part would be able to be dropped into a "real" spectrum. Another bonus is that I'll be able to do a real edge connector without needing heaps of voltage conversion and FPGA pins...<br />
<br />
I'm starting off with the CPU - I've got 10 a Mhz Z80A and a Z80 DMA chip. Once I get my GAL programmer working (or replaced), I'll effectively have a <a href="http://velesoft.speccy.cz/data-gear.htm">Velesoft Data Gear</a> CPU daughterboard which can be tested on one of my Spectrum 128 machines....SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com2tag:blogger.com,1999:blog-7607885452172131382.post-44615711797272397172011-09-19T23:08:00.000-07:002011-09-19T23:08:04.586-07:00IntegrationMuch recent development on the ZX Prism has been to integrate the video modes from the orignal (48K) Prism development into the new 256K one. This has thus far been pain free but of course there's nothing new to show! The only component I'd implemented in the original Prism which hasn't been integrated yet is the palette memory, and that's next on my list.<br />
<br />
Remembering the issue with "offset" screen attributes in the original paletted solution, and having identified some other timing issues relating to the video output and interrupts, I'm rewriting the video creation module including making the clock resolution higher. This allows me to fit the palette lookups into the standard video read/store cycle. It should also mean a resolution of 512x384 will be possible.<br />
<br />
The new video module will be written with the additional screen resolutions and colour decoding modes in mind (rather than them being retrofitted to Mike Stirling's video module).<br />
<br />
Whilst designing the new video module, ideas for additional video modes have arisen, including an "overlay" mode where the shadow screen is used as a background for the main screen - any areas of the main screen which are colour 0 will allow the shadow screen to show through. This could be used, for instance, for games - where the sprites are animated on the main screen, and coloured backgrounds are drawn on the shadow screen. There'd still be attribute clash between the sprites, but not between the sprites and the background. It's only 3 colours rather than two in each 8x8 attribute square, but it would provide a relatively easy way of sprucing up existing software.SJBhttp://www.blogger.com/profile/01893701778281575461noreply@blogger.com3