Search the Community
Showing results for tags 'multisprite'.
-
Hi, cc2600 (https://github.com/steux/cc2600) is back with a new multisprite library, handcrafted with love for our little woody machine. Here are the features of this C library (full documentation and other examples to come in a short future) : - It's a real 2 sprites multisprite library, i.e. both P0 and P1 are dynamically allocated, which means less blinking overall. - It's a full vertical resolution / full color multisprite library, no compromise. - Background display is supported, but limited to a pair of register/value change every 2 lines. On the other hand, it's very flexible (you can change the playfield, the background color, even the ball register). No assymetric playfield support. Well, it's just not possible to do everything at once... - Vertical scrolling is included (60fps shmups on 2600?) - RAM usage is 5 bytes per sprite (x, y, nusiz / reflection / collision, model, y-sorting). - Support for bankswitching and superchip for sprites storage is included - Support for per sprite collision detection (with other sprites and playfield). - Uses early HMOVE (i.e. no black bars on the left hand side of the screen. I'm looking at you Ms. Pacman) - Partially out of screen sprite display is supported. - Macros can be defined to fill the few cycles still available during kernel display. - ~2KB kernel size (yes. It's big, sorry. Leaves a little room for background and sprites definition...) - No use of DPC/DPC+. Not even a single line of assembly code. Will use DPC/DPC+ in the future as an option, to use the display RAM/ROM AND to free some processing time during kernel display. - It's tested, but there still may be some unseen corner cases. Experience will tell. The idea is to ease the making of games in C using cc2600. The easy part is the management of sprites, with the multisprite_add, multisprite_move and multisprite_delete functions, and the kernel of course. The most difficult part is the definition of the playfield (pairs of registers/value), which at the moment is unfortunately needed (and eats at least 192 bytes). My idea was to provide some models, or better a playfield editor... Here is the first example (examples/test_multisprite.c, a 4KB rom) that displays a bunch of sprites (you can move one with the joystick to check the multisprite display "blinking"). To compile it from the cc2600 root directory (this will produce the a.a and a.lst resulting assembly code, as well as the out.a binary). cc2600 -Iheaders -g -v examples/test_multisprite.c #include "vcs_colors.h" #define BLANK 40 #define OVERSCAN 30 #define REG_COLUPF 0x08 #define REG_COLUBK 0x09 #define MS_NB_SPRITES_DEF 1 #define MS_KERNEL_DATA \ const char garfield[24] = { 0, 0, 0x12, 0x36, 0x4a, 0x33, 0x55, 0x33, 0xcb, 0xb6, 0x48, 0x3e, 0x5e, 0x6e, 0x76, 0x36, 0x84, 0xbc, 0x3a, 0x76, 0x66, 0x66, 0, 0}; \ const char garfield_colors[22] = { 0, 0, 0x3c, 0x3c, 0x3c, 0x0e, 0x0e, 0x0e, 0x3c, 0x3c, 0x3c, 0x3c, 0x38, 0x2c, 0x3c, 0x3c, 0x38, 0x38, 0x2c, 0x2c, 0x12, 0x12}; \ const char *ms_grptr[MS_NB_SPRITES_DEF] = {garfield}; \ const char *ms_coluptr[MS_NB_SPRITES_DEF] = {garfield_colors}; \ const char ms_height[MS_NB_SPRITES_DEF] = {24}; const char playfield[192 + 32] = { VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_LGREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK, VCS_RED, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_GREEN, REG_COLUBK, VCS_YELLOW, REG_COLUBK }; #define MS_SELECT_FAST #include "multisprite.h" void main() { char xpos = 50, ypos = 50, scrolling = 0; multisprite_init(playfield); multisprite_new(0, xpos, ypos, 0); multisprite_new(0, 50, 50, 3); multisprite_new(0, 50, 70, 3); multisprite_new(0, 100, 50, 3); multisprite_new(0, 30, -10, 3); multisprite_new(0, 30, 170, 3); multisprite_new(0, 50, 180, 3); do { *VBLANK = 2; // Enable VBLANK *VSYNC = 2; // Set VSYNC strobe(WSYNC); // Hold it for 3 scanlines strobe(WSYNC); strobe(WSYNC); *VSYNC = 0; // Turn VSYNC Off // Blank *TIM64T = ((BLANK - 3) * 76) / 64 - 3; // Do some logic here if (!(*SWCHA & 0x80) && xpos < 158) { xpos++; ms_nusiz[0] = 0; } // Right if (!(*SWCHA & 0x40) && xpos > 0) { xpos--; ms_nusiz[0] = 8; } // Left if (!(*SWCHA & 0x20)) { ypos++; } // Down if (!(*SWCHA & 0x10)) { ypos--; }// Up multisprite_move(0, xpos, ypos); ms_scenery = playfield - MS_OFFSET + scrolling; scrolling -= 2; if (scrolling < 0) scrolling = 32; multisprite_kernel_prep(); while (*INTIM); // Wait for end of blank multisprite_kernel(); // Overscan strobe(WSYNC); *VBLANK = 2; // Enable VBLANK *TIM64T = ((OVERSCAN) * 76) / 64 + 2; // Do some logic here multisprite_kernel_post(); while (*INTIM); // Wait for end of overscan } while(1); } Have fun and make good games with cc2600 ! cc2600-0.4.3-x86_64.msi test_multisprite.bin
-
I'm trying to make a sample game with 3 or 4 sprites. The problem is the character collision with floor is not very precise when it comes to gravity (pfread function). I have seen in similar threads that you have to divide by a specific number depending on width and height, but i can't get it correctly. I use multisprite kernel with pfread. Here's what i got so far: Sample.bas Sample.bas.bin Any suggestions? Thank you.
- 5 replies
-
- multisprite
- kernel
-
(and 2 more)
Tagged with:
-
From the album: Flappy
Flappy with sound and high resolution play field.-
- 1
-
- batari Basic
- Atari 2600
-
(and 2 more)
Tagged with:
-
From the album: Flappy
Version 2 -
From the album: Flappy
Flappy game Atari 2600 4K batari Basic mutlisprite kernel -
Here is my first released game for Atari 2600! FLAPPY FLAPPY is in the AtariAge Store! Get one to support this fun website: Here (link) My version is the way I wanted to play a 1-button game like this. More like the Activision releases where you try to beat your last score, or beat another player's score. The highest scoring game is retained while the power is on, and is shown in RED alternating with the last game's score, at Game Over. Also check out the unofficial box: Marc's Blog Version 11 RC2! Changes in "random" for the pipe. I can't tell any difference. Version 11 RC2 is the final version. No more changes were made. Downloads for emulation, or 2600 / 7800 flash card cart: flappy_RC2.bin flappyR2_PAL60.bas.bin It talks! No additional hardware required!16:9 W i d e s c r e e n compatible! Try it stretched. High score shows in red (until system is turned off). Try to beat your high score! Visit the AtariAge store! Own the physical cartridge! Version 11 RC2 is the final version. No more changes were made. Version 10 RC1! Score 99 + 1 should no longer roll back to zero! Yep. Scored 101 today, and was shocked to see the score roll over and show 1. Bug fixed. Version 9 ! Capped difficulty increase! Should be able to get scores greater than 50. Version 8 ! Added year to the title! Version 7 ! Score sound, darker green horizon, more windows! My best score is 53. I wanted scoring into the 100's, but I don't want it "drawn out boring" to get to the 100's. How about bird poop once every 10 points to give you a quick boost upwards? Version 6 ! Sound, & high resolution play field! Source code! Version 5 ! Title & High Score! No feedback to last version's question. Speed stops increasing after 40 points. Version 4 ! Difficulty! Every 10 points the pipes move faster! Sorry, but this makes it more fun. I can't help but chuckle after running into a pipe in the mid 30's I have to implement High Score, alternating with current score. I need to add a flapping sound. Question: Does it get too hard too fast? Version 3 ! Speech! My first game wouldn't be complete without sampled speech, now would it? Still 884 bytes left... Version 2 ! Custom multisprite kernel. (Put in your Flappy Project Folder.) 4 digit score (Sc2 & Sc1). Background colors. Source code. Two drawscreens. Flicker clouds. No NUSIZ in building scrolling. Version 1: Only 4K! Only spent 1 day programming! No sound! Uses all cycles! (I think I obsessed on the NUSIZ changing buildings.) Parallax scrolling! - H o r o z i n t a l l y also! Random pipe height! Advertisement free! No ads! (Sorry, I was really bored...) Final file = RC2 located above. Older files: flappy140216c.bas multisprite_kernel.asm.zip flappy140218e.bas flappy140228k.bas