#include <dos.h>
#include <string.h>
#include "src/lib/modex16.h"
-#include "src/lib/16_sprite.h"
+#include "src/lib/16_sprit.h"
#include "src/lib/16_ca.h"
#include "src/lib/16_mm.h"
struct vrl1_vgax_header huge *curr_vrl;
struct vrl_container *vrl;
int success;
- byte w=1;
+ word w=0;
-
- // DOSLIB: check our environment
- probe_dos();
-
- // DOSLIB: what CPU are we using?
- // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.
- // So this code by itself shouldn't care too much what CPU it's running on. Except that other
- // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for
- // the CPU to carry out tasks. --J.C.
- cpu_probe();
-
- // DOSLIB: check for VGA
- if (!probe_vga()) {
- printf("VGA probe failed\n");
- return;
- }
- // hardware must be VGA or higher!
- if (!(vga_state.vga_flags & VGA_IS_VGA)) {
- printf("This program requires VGA or higher graphics hardware\n");
- return;
- }
-
- //bmp = bitmapLoadPcx("data/chikyuu.pcx");
- gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);
-
mm.mmstarted=0;
MM_Startup(&mm, &mmi);
CA_Startup(&gvar);
if(CA_LoadFile("data/spri/chikyuu.vrs", &bigbuffer, &mm, &mmi)) baka=1; else baka=0;
- fd = open("data/spri/chikyuu.vrs", O_RDONLY|O_BINARY);
- size = lseek(fd, 0, SEEK_END);
- lseek(fd, 0, SEEK_SET);
- close(fd);
+// fd = open("data/spri/chikyuu.vrs", O_RDONLY|O_BINARY);
+// size = lseek(fd, 0, SEEK_END);
+// lseek(fd, 0, SEEK_SET);
+// close(fd);
// Insert sanity cheks later
vrs.buffer = bigbuffer;
vrs.data_size = size - sizeof(struct vrl1_vgax_header);
//read_vrs(&gvar, "data/spri/chikyuu.vrs", &vrs);
spri.spritesheet = &vrs;
spri.sprite_vrl_cont = malloc(sizeof(struct vrl_container));
-
- vrl = malloc(sizeof(struct vrl_container));
- i = get_vrl_by_id(&vrs, 10, vrl);
- if(i == -2)
+ i = set_anim_by_id(&spri, 11);
+ if (i == -1)
{
- puts("Die");
return;
}
- off = vrl1_vgax_genlineoffsets(curr_vrl/*vrl->buffer*/, vrl->buffer + sizeof(struct vrl1_vgax_header), vrl->data_size);
- fd = open("data/spri/chikyuu.vrl", O_RDONLY|O_BINARY);
- size = lseek(fd, 0, SEEK_END);
- lseek(fd, 0, SEEK_SET);
- close(fd);
+ spri.x = 5;
+ spri.y = 100;
- if(CA_LoadFile("data/spri/chikyuu.vrl", &bigbuffer, &mm, &mmi)) baka=1; else baka=0;
- off1 = vrl1_vgax_genlineoffsets(bigbuffer, (byte *)bigbuffer + sizeof(struct vrl1_vgax_header), size - sizeof(struct vrl1_vgax_header));
+// Uncomment to see broken sprites
+ //if(CA_ReadFile("data/spri/CHUBACW1.vrl", &bigbuffer, &mm)) baka=1; else baka=0;
+ //if(CA_LoadFile("data/spri/CHUBACW1.vrl", &bbuffer, &mm, &mmi)) baka=1; else baka=0;
+ // DOSLIB: check our environment
+ probe_dos();
- //read_vrs(&gvar, "data/spri/chikyuu.vrs", spri.spritesheet);
- i = set_anim_by_id(&spri, 10);
- if (i == -1)
- {
+ // DOSLIB: what CPU are we using?
+ // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.
+ // So this code by itself shouldn't care too much what CPU it's running on. Except that other
+ // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for
+ // the CPU to carry out tasks. --J.C.
+ cpu_probe();
+
+ // DOSLIB: check for VGA
+ if (!probe_vga()) {
+ printf("VGA probe failed\n");
+ return;
+ }
+ // hardware must be VGA or higher!
+ if (!(vga_state.vga_flags & VGA_IS_VGA)) {
+ printf("This program requires VGA or higher graphics hardware\n");
return;
}
- spri.x = spri.y = 70;
+ //bmp = bitmapLoadPcx("data/chikyuu.pcx");
+ gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);
- /* fix up the palette and everything */
- //modexPalUpdate1(bmp.palette);
- //modexLoadPalFile("data/spri/chikyuu.pal", &pal);
- //modexPalUpdate1(pal);
/* clear and draw one sprite and one bitmap */
VGAmodeX(1, 1, &gvar);
/* non sprite comparison */
start = *clockw;
modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 0, 0, 0, 0, 320, 240);
- animate_spri(&spri);
t1 = (*clockw-start) /18.2;
start = *clockw;
- draw_vrl1_vgax_modex(5,5,curr_vrl/*vrl->buffer*/,vrl->line_offsets,vrl->buffer + sizeof(struct vrl1_vgax_header),vrl->data_size);
- draw_vrl1_vgax_modex(40,40,curr_vrl/*vrs.buffer*/ + vrl_headers_offsets[0],vrs.vrl_line_offsets[0],vrs.buffer + vrl_headers_offsets[0] + sizeof(struct vrl1_vgax_header),vrl_headers_offsets[1] - vrl_headers_offsets[0] - sizeof(struct vrl1_vgax_header));
- draw_vrl1_vgax_modex(100, 5, bigbuffer, off1, (byte *)bigbuffer + sizeof(struct vrl1_vgax_header), size - sizeof(struct vrl1_vgax_header));
-
t2 = (*clockw-start)/18.2;
- //for (i = 0; i < 5; i++){
- //animate_spri(&spri);
+ for (i = 0; i < 5; i++){
+ spri.delay = 1; animate_spri(&spri); spri.x += 20; sleep(2); }
while(!kbhit())
{
switch(w)
{
- case 252:
+ case 1024:
modexPalUpdate0(pal);
- w=1;
+ w=0;
default:
w++;
break;