Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************************
- **
- ** File: Fire.c
- ** Author: flype, 2016
- ** Compiler: VBCC 0.904
- **
- ************************************************************/
- #include <string.h>
- #include <time.h>
- #include <dos/stdio.h>
- #include <exec/exec.h>
- #include <exec/types.h>
- #include "ChunkyStartup.h"
- #include "Fire.h"
- #define RND(a) (rand() % a)
- UBYTE VersionID[] = "$VER: Fire 0.1 (2016-02-13) ® 2016 Apollo Team\b\n\0";
- int main(void)
- {
- //---------------------------------------------------------
- // Inits
- //---------------------------------------------------------
- int *FBBASE=0xDFF1EC;
- int frames=0, ticks=0, w=0;
- struct CSAllocCell *palette;
- if (ChunkyStartupInit(0, 0) == 0) {
- ex_out("Error: Init screen.");
- }
- if ((palette = LoadRmb("Fire.LoadRGB32")) == 0L) {
- ex_out("Error: Init palette.");
- }
- SetScreenPalette((ULONG*)(palette->csac_Buffer));
- FireInit();
- FireClear(0);
- srand(time(NULL));
- *FBBASE = (int)FireChunky;
- ResetTaskTime();
- //---------------------------------------------------------
- // Run
- //---------------------------------------------------------
- w = FireWidth - 1;
- while ( ListenEnd() == 0 ) {
- FireUpdate();
- FireFuel( RND(w), RND(210) );
- FireFuel( RND(w), RND(210) );
- FireFuel( RND(w), RND(210) );
- FireFuel( RND(w), RND(210) );
- FireDraw();
- /*
- ticks = GetTaskTime();
- if(ticks % 500 == 0) {
- FireClear(RND(255));
- }
- */
- // ScreenRefresh(FireChunky);
- // Delay(1);
- frames++;
- }
- //---------------------------------------------------------
- // Exit
- //---------------------------------------------------------
- ticks = GetTaskTime();
- printf("Frames: %u\n", frames);
- printf("Seconds: %u\n", ticks/50);
- printf("FPS: %u\n", frames/(ticks/50));
- FireClose();
- *FBBASE = (int)0xFB00000;
- ex_out(NULL);
- return(0L);
- }
- void ex_out(char *errorstring) {
- Exitmessage = errorstring;
- ChunkyStartupClose();
- exit(0);
- }
- /************************************************************
- **
- ** End
- **
- ************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement