Jump to content
IGNORED

Raycasting demo


Recommended Posts

I dug up an old demo I tried to write a long time ago that attempted raycasting on the Inty. Unfortunately, it flickers on real hardware and I can't find the source to it :_(

Anyhow, here are the files I was able to find. The .rom file works in Nostalgia, and I recall trying it on an Intellicart (it ran, but with the aforementioned flicker). Anyhow, maybe it will be useful to someone...

Regards,

John

raycast_20151012.zip

Edited by JohnPCAE
  • Like 1
Link to comment
Share on other sites

You might try running this in a recent jzIntv with the debugger and history tracking enabled. When the history tracker's enabled, it will detect all sorts of glitch inducing problems and help you zoom in on them. If you hit '?' you'll see it also has some checkers you can enable to look for dropped STIC and GRAM writes.

 

The biggest culprit is too many non-interruptible instructions in a row. Shifts and MVOs are the two most common classes of non-interruptible instruction. jzIntv hints to me that that's your biggest issue, actually. In the following excerpt, I just enabled history logging and dropped STIC write detection:

 

NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
STIC CTRL WR drop: addr = $0028 @4429620 (data $0000) PC = $52DF
Prev STIC CTRL window ended @4423421; next window approx @4435454
STIC CTRL WR drop: addr = $0029 @4429629 (data $0000) PC = $52E0
STIC CTRL WR drop: addr = $002A @4429638 (data $0000) PC = $52E1
STIC CTRL WR drop: addr = $002B @4429647 (data $0000) PC = $52E2
STIC CTRL WR drop: addr = $002C @4429656 (data $0000) PC = $52E3
STIC CTRL WR drop: addr = $002D @4429665 (data $0000) PC = $52E4
STIC CTRL WR drop: addr = $002E @4429674 (data $0000) PC = $52E5
STIC CTRL WR drop: addr = $002F @4429683 (data $0000) PC = $52E6
NON_INT = 72 at PC = $52E7
NON_INT = 72 at PC = $52F0
NON_INT = 72 at PC = $52F9
NON_INT = 72 at PC = $5302
NON_INT = 72 at PC = $530B
NON_INT = 72 at PC = $5314
NON_INT = 72 at PC = $531D
NON_INT = 72 at PC = $50F7
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
STIC CTRL WR drop: addr = $0030 @4492212 (data $0000) PC = $52DF
Prev STIC CTRL window ended @4483157; next window approx @4495190
STIC CTRL WR drop: addr = $0031 @4492221 (data $0000) PC = $52E0
STIC CTRL WR drop: addr = $0032 @4492230 (data $0000) PC = $52E1
STIC CTRL WR drop: addr = $0033 @4492239 (data $0000) PC = $52E2
STIC CTRL WR drop: addr = $0034 @4492248 (data $0000) PC = $52E3
STIC CTRL WR drop: addr = $0035 @4492257 (data $0000) PC = $52E4
STIC CTRL WR drop: addr = $0036 @4492266 (data $0000) PC = $52E5
STIC CTRL WR drop: addr = $0037 @4492275 (data $0000) PC = $52E6
NON_INT = 72 at PC = $52E7
NON_INT = 72 at PC = $52F0
NON_INT = 72 at PC = $52F9
NON_INT = 72 at PC = $5302
NON_INT = 72 at PC = $530B
NON_INT = 72 at PC = $5314
NON_INT = 72 at PC = $531D
NON_INT = 72 at PC = $50F7
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
STIC CTRL WR drop: addr = $0038 @4545582 (data $0000) PC = $52DF
Prev STIC CTRL window ended @4542893; next window approx @4554926
STIC CTRL WR drop: addr = $0039 @4545591 (data $0000) PC = $52E0
STIC CTRL WR drop: addr = $003A @4545600 (data $0000) PC = $52E1
STIC CTRL WR drop: addr = $003B @4545609 (data $0000) PC = $52E2
STIC CTRL WR drop: addr = $003C @4545618 (data $0000) PC = $52E3
STIC CTRL WR drop: addr = $003D @4545627 (data $0000) PC = $52E4
STIC CTRL WR drop: addr = $003E @4545636 (data $0000) PC = $52E5
STIC CTRL WR drop: addr = $003F @4545645 (data $0000) PC = $52E6
NON_INT = 72 at PC = $52E7
NON_INT = 72 at PC = $52F0
NON_INT = 72 at PC = $52F9
NON_INT = 72 at PC = $5302
NON_INT = 72 at PC = $530B
NON_INT = 72 at PC = $5314
NON_INT = 72 at PC = $531D
NON_INT = 72 at PC = $50F7
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 72 at PC = $52E7
NON_INT = 72 at PC = $52F0
NON_INT = 72 at PC = $52F9
NON_INT = 72 at PC = $5302
NON_INT = 72 at PC = $530B
NON_INT = 72 at PC = $5314
NON_INT = 72 at PC = $531D
NON_INT = 72 at PC = $50F7
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 83 at PC = $53A8
NON_INT = 72 at PC = $52E7
NON_INT = 72 at PC = $52F0
NON_INT = 72 at PC = $52F9
NON_INT = 72 at PC = $5302

 

Too many non-interruptible instructions will cause the display to jump. The actual threshold is somewhere around 60.

 

Also, the STIC registers are only available for about 2900 cycles after the interrupt gets asserted. It looks like you're copying in a shadow of what you'd like in the STIC, but you're doing it late in your ISR. This is what I called "VBlank Period 1" in the Intellivision Wiki. http://wiki.intellivision.us/index.php?title=VBlank_Period_1

Link to comment
Share on other sites

It's too bad I lost the source, though there isn't all that much code in it. I ran it through dasm1600 and figured a few things out:

 

5000-5800: code

A000-B1FF: data (trig tables?)

B800-B8FF: data (the first 16 words defines the maze: 1-bit, 16x16 bitmap, 1=solid, 0=empty)

Link to comment
Share on other sites

You might want to consider adding a *.rom (or *.bin+*.cfg) to new updates so that people who are not familiar with the SDK1600 can try it it out too.

 

Hmm, I guess you have a point. Here's a ZIP with source and executables. I also improved the rendering performance a bit.

raycast.zip

Edited by JohnPCAE
  • Like 1
Link to comment
Share on other sites

I think I fixed the flicker problem...I was putting cart RAM at the same location as the STIC shadow. The flicker at least in the emulator seems to be gone once I moved the RAM. I also sped up the rendering.

 

I get different results in Nostalgia vs. jzIntv during rendering, but the same once rendering is finished. I'm wondering what this does on real hardware...

raycast.zip

  • Like 1
Link to comment
Share on other sites

You might find these features of intvnut's JLP Rev 02 interesting.

 

The problem with the hardware-accelerated math routines is that they are only available in the JLP firmware, not even in the emulator.

 

However, I believe that Joe, Arnauld, and Carl were each working on optimizing a multiplication routine in the INTVProg mailing list, some time ago. I further believe that Carl's version was accorded as the most efficient in the general cases. I'll try to to look it up and post it here.

 

-dZ.

Link to comment
Share on other sites

The problem with the hardware-accelerated math routines is that they are only available in the JLP firmware, not even in the emulator.

 

However, I believe that Joe, Arnauld, and Carl were each working on optimizing a multiplication routine in the INTVProg mailing list, some time ago. I further believe that Carl's version was accorded as the most efficient in the general cases. I'll try to to look it up and post it here.

 

-dZ.

 

Sorry, I found the thread in my mailing list archives, but it was regarding the computation of square roots, not multiplication/division.

 

-dZ.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...