[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Raycasting 3D demo disk



Michael J. Mahon wrote:
David Schmenk wrote:
aiiadict@gmail.com wrote:

David Schmenk wrote:

I did have to add vertical details on the wall
boundaries or else it all blended together.

Dave...


  for sure...  you have to have some difference
in color otherwise it's all just one color :-)

You said textures are 16X16, with high nibble
matching low nibble..  If I don't make high
nibble = low nibble, it shows textures are
16X16 bytes, but hi/lo nibbles represent
1 pixel on top of another!...  error in the tex
editor showed me this, I was setting the byte
to 1 to 16, not $00,11,22,33,44,55 etc... and
I was getting black spots all over the place :-)

so, if I change the tex editor to display the 16X16
byte as a 16X32 graphic, and allow editing
the hi/lobytes individually, you could get better
resolution..  I don't know if the colors would be
predictable though...

Rich


The colors are replicated in the high and low nibble to avoid shifting during the rendering loop. Shifting by 4 is the worst case scenario for the 6502. I already had to unroll the rendering loop for every vertical pixel to get it fast enough. It still needs to be faster but having only one general purpose register makes things tough. Take a look at the memory map for lores to figure out why :-)

You can shift by 4 with a lookup table and a load...


... and an index register. Lookup tables are definitely an important part of 6502 programming. And that doesn't even answer the question of shifting which nibble where. It's what makes the 6502 such an interesting architecture to work with. Sort of a pathological case of the RISC philosophy. Name that Tune for CPUs - I can write that algorithm in 6 bytes and one register, Pat! I read somewhere that the designers of the ARM chip were somehow associated with the designers of the 6502. Having written a 6502 emulator in 68000 assembly (http://palmapple.sf.net) I would like to try using the ARM someday. There seems to be an almost one-to-one match of the opcodes. Even the mnemonics are similar. OK, where was I going with that? It's early. I'm rambling. I need coffee.

Dave...

-michael

NadaNet networking for Apple II computers!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."