Introducing VFLI for VIC-20: 208x256 pixels in 16 colours!

Modding and Technical Issues

Moderator: Moderators

User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Geez, this image is just IMPRESSIVE :shock: .
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

orion70 wrote:Geez, this image is just IMPRESSIVE. :shock:
I should give credit to the original test image of Roger Atrill's PowerShade (later renamed to Merlin) which had been a raytracer specifically tuned to the Acorn Archimedes platform. Here are some other examples, 'ballrings' is in the top row:

http://www.fortunecity.com/meltingpot/c ... allery.htm

I was involved in there forasmuch I had been hired in those days to write an editor, which would emit text files as scene descriptions for this raytracer. Within the GUI, objects in the scene could be edited as wire-frame models. The money I earned from that contract paid off the A5000 I had bought half a year earlier. :)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Mike wrote: I just tried out the converter with a raytraced example image in the proposed 168x320i mode, here's how the result would look like:

Image
That's incredible ! :shock:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

nbla000 wrote:Mega-Cart: the cartridge you plug in once and for all.
In the meantime I tested Mega-Cart on my modded VIC-20 for compatibility: several cartridge games, utilities (Waterloo BASIC, ...), the tape section, the demos (Robotic Liberation, ...) and the standard BASIC prompt with memory expansion.

Nearly everything behaved normally, just the menu-point 'RESET > unexpanded VIC' really didn't return me to 3583 BYTES FREE. Rather the internal expansion still was included. It seems Mega-Cart switches itself off in that case and then calls the normal reset routine, which then of course includes the internal expansion. On the contrary, when I started Waterloo BASIC unexpanded, I indeed got the '3.5K free' prompt - presumably all RAM on Mega-Cart is activated (including BLK5), and the BASIC pointers in 642, 644 and 648 are just pre-set as necessary.
That's incredible! :shock:
I surely didn't mod my VIC-20 for no reason. ;)
Last edited by Mike on Sun Aug 31, 2014 1:22 pm, edited 2 times in total.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Here's the NMI display routine for *.hhm pictures (208x256 "original" MAXIGRAFIK) on a VFLI-equipped VIC-20: (download)

Unlike MAXIGRAFIK, this mode leaves nearly 100% CPU power available to the running program and it also allows for disc access - indeed in the slide show the pictures are loaded while they're being displayed. This is achieved with two NMIs which switch between the charset located at $0400 and located at $1000, in the middle of the screen and somewhere during vertical retrace.

I've included the source for those interested. Besides the VFLI mod (at least the internal expansion to 8K), an external 8K RAM expansion also is required. Tested on my VIC-20 + FE3.

Greetings,

Michael
Last edited by Mike on Thu Feb 20, 2014 5:49 pm, edited 2 times in total.
rhurst
Omega Star Commander
Posts: 1369
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Sweet!
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

rhurst wrote:Sweet!
Sure. :)

Pop-quiz: what's the reason behind the following code snippet in the NMI display routine - and what does it do? 8)

Code: Select all

 [...]
 TSX
 LDA &0105,X
 CMP #&F1
 BNE Server_00
 LDA &0104,X
 CMP #&66
 BCC Server_00
 CMP #&6D
 BCS Server_00
 LDA #&6D
 STA &0104,X
.Server_00
 [...]
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

Let me guess:
Ensure that the IER of VIA 1 is set correctly on exit from NMI.

(Slightly) longer explanation:
The return address is reset to $F166 if it is in the area $F166-$F16D.
Thereby, the enclosed operation (conditionally) modifying the IER register is safe from NMI interrupts.

Nice routine!
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Not quite, but close.

This small routine in the kernal ROM is called at two places when the kernal enters a time-critical section: in the LISTEN routine and at the start of tape operation, to ensure no NMIs of the RS232 routines would step unto their feet:

Code: Select all

.F160  48        PHA
.F161  AD 1E 91  LDA $911E
.F164  F0 0C     BEQ $F172
.F166  AD 1E 91  LDA $911E
.F169  29 60     AND #$60
.F16B  D0 F9     BNE $F166
.F16D  A9 10     LDA #$10
.F16F  8D 1E 91  STA $911E
.F172  68        PLA
.F173  60        RTS
The branch at $F164 is probably never executed, because normally at least the RESTORE key NMI is enabled.

During display however, the RESTORE key *is* disabled and Timer 1 is enabled instead - being the only source of NMIs for now. When the above subroutine is called, the AND instruction at $F169 will determine at least one of the timer NMIs is enabled - and waits ... and waits ... and waits, until both timer NMIs have been disabled.

Which - during display of the new mode - is not going to happen anytime soon.

Now, my code snippet above senses this condition during NMI execution (stacked program counter within the loop?), and deliberately alters the return address on stack to the instruction immediately following the loop. After return from the NMI the two instructions at $F16D and $F16F disable NMIs from CB1 (which doesn't do any harm here) and then the routine exits cleanly.

The next NMI is only due in 10 milliseconds and so is guaranteed not to interfere with the LISTEN routine, which includes a 1 ms busy wait to check for EOI or 'device not present'.
Kananga
Vic 20 Afficionado
Posts: 317
Joined: Mon Mar 08, 2010 2:11 pm

Post by Kananga »

ok, my mistake LDA #$6D not $66. I didn't read your code to the end :) Attention span exhausted or something. Never hire me for code reviews!
Buy the new Bug-Wizard, the first 100 bugs are free!
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Hi!

In the meantime I had a PM exchange with wimoos, his VIC-20 includes an internal 3K expansion as in the VFLI mod. He could confirm that the display routine for *.hhm (original MAXIGRAFIK) files also works on his VIC-20. Only his 64HDD had some struggles, so the images still needed to be loaded while in text mode. So, there are still some open issues.

As I wrote above, on an NTSC VIC-20, there should be a 168x320i mode possible. That would however require someone here adventurous enough to mod his VIC-20 beforehand - and then taking the time to assist me in writing the display driver. This is not going to be an easy task, and most probably even needs some intermediate versions, with screen shots taken with a digital camera exchanged, etc.

Likewise, the mod can also be done on a 2-prong VIC-20. Instead of two 6116 chips, six 2114 chips are piggy-backed on the existing ones, and directly selected with UC4. U13 is not present in the 2-prong main board.

A corresponding BASIC extension might be a nice follow-up. :)

Greetings,

Michael
Last edited by Mike on Sat Jul 28, 2012 1:23 pm, edited 1 time in total.
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Finally I had the time to add the S-Video mod to my VIC-20. This again was a collaborate afford with a collegue done last evening.

The video output of my VIC-20 was especially bad behaved: 'split' pixels in cross-hatch patterns, and black-white contrast transient pixels between two different colours of near equal luminance. All in all the video output is now much nearer to the converter preview, which itself now just is missing the PAL colour blending.

Greetings, and a Happy Easter,

Michael
Last edited by Mike on Sat Jul 28, 2012 1:24 pm, edited 1 time in total.
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

Impressive! At this point, I should definitely involve my friend (who's an electronics engineer) in this new project :wink: .

Thanks Mike, and HAPPY EASTER to you and all my fellows here in Denial :D.
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

I really wish this mod was easier to do. As someone with next to know experience with electronics there's no way I'd let myself with this. I certainly wouldn't trust myself to put a soldering iron to a Vic-20. And I don't know anyone that has the experience to perform such a mod either. :( It's a shame because these pictures are brilliant and it would be awesome to see some software that could take advantage of this and that a reasonable number of people could use.

Regarding the S-video mod: Wow. That's a dramatic improvement.
If you don't mind me asking, why is it that the output of some Vic-20's is worse than others? I'm guessing it has something to do with the way the signals are mixed since the S-video mod fixes it? Is there any way to improve the video signal (without performing the S-video mod) by just changing a capacitor or something like that? Sorry for asking so many questions, but this is one of the biggest mysteries of the Vic-20 to me.

Happy Easter to you too Mike, orion, and all other Denial members. :)
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Wilson wrote:[...] why is it that the output of some Vic-20's is worse than others? [...] this is one of the biggest mysteries of the Vic-20 to me.
I posted a short explanation in the S-Video thread.
Post Reply