Interactive Raycaster For the Commodore 64 Under 256 Bytes
New submitter Wisdom writes "1bir (1 Block Interactive Raycaster) is a simple ray casting engine implemented only in 254 bytes to run on a stock, unexpanded Commodore 64. The name comes from the fact that on a C64 floppy disk, 1 block is equivalent to 254 bytes stored on a disk sector. In 254 bytes, 1bir sets up the screen for drawing, creates sine and cosine tables for 256 brads based on a simple approximation, casts rays into a 2D map that lives inside the C64 KERNAL ROM, renders the screen in coordination with KERNAL, evaluates 8-way joystick input and detects collision against walls. The ray casting core employs a brute force algorithm to determine visible walls, while the mapping portion supports both open-ended (infinitely looped) and traditional, closed maps. The source code in 6502 assembly is available, with extensive comments. A YouTube video showcases 1bir in a detailed manner with both kind of maps and more information, while a Vimeo video presents a shorter demonstration."
Don't underestimate the productivity of being able to work on a hobby project you enjoy
My UID is prime... is yours?
I work with a health IT company that's trying to give doctors better tools to solve and treat disease. Our project could improve the lives of lots of folks, and its quite difficult to find talented technical folks to join the team.
I appreciate this is a cool hobby project, I just wish the guy would use his not inconsiderable talents to work on something that has a more obvious real-world payoff (unless this is all a hologram running on 4x10^16 Commadore 64s).
I got an idea.Pay him to do it. Your company works for money.
You wouldn't be working for one of the two dozen firms doing mobile apps for connecting doctors to patients, looking for funding, explaining how you work "with" and not "for"?
world was created 5 seconds before this post as it is.
The next time you churn your next 500MB printer driver think about programs like this. Think long and hard.
Can't find talented technical folks to join the team, or can't find talented technical folks to join the team for well below market wages?
Usually when people say one, they really mean the other.
-- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
Projects like this are a great way to train new engineers for small embedded systems. There is a lot of work out there on 8-bit systems with a couple k of program space and a few hundred bytes of ram. At my place we actively collect books that targeted advanced computer programming techniques in the early 80's, because they line up good with the resources we typically have on a microcontroller that costs $1.27 now .
For example, given a 128x96 black and white LCD, create an algorithm that will draw a line between any two points. Oh, and you can only use integer math, and we'd prefer it if you kept division operations to a minimum, because we have to do division through a software library call...
The old-timers did that stuff in their spare time 30 years ago.
Actually the skills do transfer. The techniques of code optimization are many and universal. Which ones constitute acceptable use depends on the application (i.e. mathematical approximations are not always OK). From what I keep reading, HPC focuses a lot on matrix math - an area where some tricks can help a lot without affecting the results. I was manipulating 1GB 3d data sets interactively on a machine with 128M of RAM back in the day, and I suspect the technique has not gone mainstream yet.
and the second encoding of "sar" come to mind
Sorry, but it's "SHL" that has a duplicate encoding on x86. There are four slots for non-rotating shift instructions in "group 2": 4=SHL, 5=SHR, 6=???, 7=SAR. The /6 variant looks like it ought to be "SAL", and it is. However, unsigned left shifting is equivalent to signed left shifting, and thus the two opcodes end up doing the same thing. The original 8086 happy processed this instruction as a signed left shift because of how it interpreted the opcode bits, but that's the same as an unsigned left shift.
This was retained in modern processors, whereas "pop cs" was not.
"Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
Do you visit model railroad clubs and chastise them for playing with toys when there's so much real freight to be moved?
The C64 is worthy of fun.
FC Closer
Yeah. I'm also tired of self-righteous people claiming we shouldn't have fun because, somewhere there's a person with a need. Life isn't about sacrificing all your interests to the need of others. Even Jesus let his feet get washed from time to time.
We should learn what we need to know about issues, before we decide what we need to feel about them.