Skip to content

Commit

Permalink
Added further comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nanochess committed Apr 12, 2024
1 parent 2f79cc8 commit 96bbfa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ https://github.com/nanochess

This is a port of the amazing Ray Tracer in Atari 8-bit BASIC by D. Scott Williamson. You can see it at [https://bunsen.itch.io/raytrace-movie-atari-8bit-by-d-scott-williamson](https://bunsen.itch.io/raytrace-movie-atari-8bit-by-d-scott-williamson) in turn based on a static BBC micro version by @coprolite9000 [https://bbcmic.ro/?t=9ctpk](https://bbcmic.ro/?t=9ctpk)

I asked him for permission to make a port to a boot sector, and here it is.
I asked Williamson for permission to make a port to a boot sector, and here it is. I was running around 590 bytes until I found a duplicated calculation that could be made into a subroutine. The code isn't exactly the same because I changed some constants to adapt it, and also collapsed some to save bytes. Anyway, I'm pretty happy I finally found good use for the VGA palette!

If you are going to run it in real hardware it requires a minimum of a Pentium Pro, otherwise most modern emulators will be able to run it.

One of the biggest surprises is how so fast are modern computers so technically the animation is real-time in my Macbook Air running the ray tracer in Windows XP under VirtualBox. You can see it on [Youtube](https://www.youtube.com/watch?v=AZdzECF2Huw).

### How to use it.

If you want to assemble it, you must download the Netwide Assembler (NASM) from www.nasm.us
Expand Down
14 changes: 7 additions & 7 deletions ray.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ com_file: equ 0
org 0x7c00 ; Start address for boot sector
%endif

mov ax,0x0013
int 0x10
mov ax,0x0013 ; Video mode 320x200x256 colors
int 0x10 ; Call BIOS.

sub sp,total
mov bp,sp
sub sp,total ; Make space for internal variables.
mov bp,sp ; Use BP to refer them.

mov ax,0xa000
mov ax,0xa000 ; Point to video RAM.
mov es,ax

finit
cld
finit ; Reset coprocessor.
cld ; Clear direction flag.
restart:
fld dword [const_25] ; Initial viewpoint (z)
fstp dword [bp+var_a] ; a = 25.0
Expand Down

0 comments on commit 96bbfa3

Please sign in to comment.