************************* video initial port 320x200 graphics and 640x400 text in a 640x480 window GETPIXS(x,y) PUTPIXS(x,y,c) color depth palette vga_mode(0x13); vgapalset(); clear_screen() ************************* text screen gotoxy(text_x,text_y) printf(......) cprintf(......) textcolor(c) textbackground(c) emulate an 80x25 text screen 80x50 ... ************************* timing clock() LOOPSPTICK prevloopcts smoothedloopcts[] //system clock() ticks ~18.2 times a second ************************* keyboard keyboardproc() deinit_keyboard() ************************* standard c / in gcc ? RAND_MAX yes ************************* graphics screen resolution screen resolution initial port 320x200 graphics and 640x400 text in a 640x480 window default 640x480 options 320*200 640*480 800x600 1024x768 1280x1024 1280x720 ... yres(int y) void squareproj( float ylet=133; graphical X_RES Y_RES X_RESM Y_RESM X_OFFS Y_OFFS all projections dpnsrerasering( drawplayernsr( drawshot( drawplayer( gridout() gridin() 2.c eraseplayernsrte ************************* changes beyond porting check/fix black hole absorbing players shots conservation physics fix two small c errors noted in old hardcopy, one more in a text buffer sometime put all radii in angular units (remove legacy pixel units) separate player mass from player radius variable ************************* pixel-based units p1rad p2rad shot radius blackab.m M_PI/Y_RES radius dpnsrerasering( drawplayernsr( emergeshots( wallcolliding( mass -- radius issues playermoment(r1) playerorbitmomentsphere(r1) shoot(int player) playerwallbouncel shotplrcollisions(int shotkollangular, float dt) p1p2bounce_sphere(float dist) p1p2bounce_flat(float dist) blackabgravity(float olon, float olat, float om, float *ov, float *oat, float dt, int real, int plrnotshot) blackabgravitar(float dt) baabsorbmomentum(float plon, float plat, float pm, float pv, float pat, int plrnotshot) blackabcollisions(void) if(physdisp) 2.c starblebounceflat