In-line Vic20 emulator in Denial Forums

You need an actual VIC.

Moderator: Moderators

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

Post by orion70 »

Great job matsondawson! Will it work with a text adventure? :D
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Kweepa wrote:Anyone found working examples on the forum?

I was really hoping this would work:
http://sleepingelephant.com/ipw-web/bul ... 1&start=16
It's got a couple of {wht} type things, but that doesn't seem to be the problem...
Yup, I've been trying to get that to work, it's something to do with rnd(.) returning really small values (*10^-3). If I replace it with rnd(1) it works.

The CPU code is really old though so it's not surprising me.
If someone found me the random number generator function I could probably track down the instruction that doesn't work.

Edit: Cool!, the bug exists in my Java code too. Makes it a whole heap easier to debug.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Ok, the problem wasn't with the cpu code, I think it was the initial state of the vias. RND(.) means to seed the random number generator from the clocks, and the T1 clock doesn't seem to be initialised on startup. So I've inited the clocks to something other than 0, and it works now.

I still have to fix the petsci conversion though as the javascript regexp replace functions get buggered when you exceed char code 127.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

orion70 wrote:Great job matsondawson! Will it work with a text adventure? :D
It should, but it may take a long time to push it into the emulator. I should really just write a Basic program to PRG converter and direct load it to ram.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

BTW, you may need to update your bookmark link from the site again as the original link doesn't prevent the Vic20 emulation code from being cached. Meaning you won't get updated code as I push it through.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Schema wrote:Very slick!

I noticed it always puts the output in the first Code block in the thread, is this deliberate or a limitation?
It should output under whichever link you click on, unless you've already clicked on a link which will probably output in whatever you first clicked on, if it outputs at all. That's just because it's work in progress though. I'm thinking of removing inline and just having it float in-front of the code until you close it.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

I've added a new bookmark for executing prg links in-line at http://www.mdawson.net/denial/bookmark.php

It will find any links containing a file ending in .prg and change them to execute links.

Currently only unexpanded PRGs will work, I'll work on auto detecting memory requirements tomorrow.

If it isn't working check the link is still valid, is a direct link and doesn't require memory expansion.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Wow, more and more awesome!
Would it be possible to change the aspect ratio to make the text more readable?
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Kweepa wrote:Wow, more and more awesome!
Would it be possible to change the aspect ratio to make the text more readable?
I've changed the aspect back to 1.6ish for PRGs, and made the emulator window float with a close button and joykeys checkbox.

You'll need to update your bookmark to see the changes though.

Hopefully it's the last time your bookmarks will need updating as I've moved common code out of the link now.

I need to redo the basic link at a later date.

It's kinda fun to work through Roberts prgs, http://robert.hurst-ri.us/files/ if anyone wants to try. I think only the quikman+ one doesn't work as the + sign isn't encoded in the anchor (it means space in href land).
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

matsondawson wrote: I've changed the aspect back to 1.6ish for PRGs, and made the emulator window float with a close button and joykeys checkbox.
Super, thanks!
Do the adventures work for you? They run but produce some unpredictable output, such as repeated intro messages, "TOO DARK TO SEE", and so on.
User avatar
orion70
VICtalian
Posts: 4340
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

I can't say how surprised I am, as my jaw hit the floor...

Image
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Cool stuff ... one funny thing with joy keys enabled, when you hold the down arrow long enough, the browser window also scrolls. Perhaps it is not eating keyboard event entirely? Regardless, it's a software marvel -- many thanks!
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

Kweepa wrote:
matsondawson wrote: I've changed the aspect back to 1.6ish for PRGs, and made the emulator window float with a close button and joykeys checkbox.
Super, thanks!
Do the adventures work for you? They run but produce some unpredictable output, such as repeated intro messages, "TOO DARK TO SEE", and so on.
Heh, I thought that it was just a crap adventure game! It might be because there a few things to do to make it run, but I haven't put a restore key in so I cant test it yet.

http://www.zimmers.net/anonftp/pub/cbm/ ... s/00README

btw: sys 64802 seems to work now.
matsondawson
The Most Noble Order of Denial
Posts: 343
Joined: Fri May 01, 2009 4:44 pm

Post by matsondawson »

rhurst wrote:Cool stuff ... one funny thing with joy keys enabled, when you hold the down arrow long enough, the browser window also scrolls. Perhaps it is not eating keyboard event entirely? Regardless, it's a software marvel -- many thanks!
Which browser is doing that? As I am preventing keys from bubbling, and disabling default key events.
Post Reply