Jump to content

Bochum_Boy

New Members
  • Content Count

    58
  • Joined

  • Last visited

Community Reputation

47 Excellent

About Bochum_Boy

  • Rank
    Star Raider

Recent Profile Visitors

1,914 profile views
  1. Hi, for my project I try to create a level loader. The routine should load an array with information how to prepopulate a level. So, I create a set of level arrays that are loaded and then applied to my screen. This is done in lines 276 - 298. During initalization, in the draw level routine, the array is interpreted in the DrawBoard routine. Now, I got two problems: 1) The balls never occur on my screen, thus the level is not prepopulated. 2) Is there a chance to create instances of objects instead of copying the structures. Example: I want to have 5 instances of red balls without creating manually those five objects. I attached my code as is: #include <lynx.h> #include <conio.h> #include <tgi.h> #include <joystick.h> #include <6502.h> #include <stdlib.h> #include <_mikey.h> #include <_suzy.h> #include <time.h> #define MIKEY (*(struct __mikey *)0xFD00) //Bear Sprite unsigned char bb_w1[] = { 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0xb, 0xb0, 0x0, 0xbb, 0x55, 0xbb, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0xb, 0xb5, 0x5b, 0xbb, 0xbb, 0xbb, 0x55, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0x5, 0x55, 0x5b, 0xb8, 0x88, 0x88, 0x88, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0xb, 0xb8, 0x88, 0x88, 0x88, 0xbb, 0x0, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0xb, 0xb8, 0x8b, 0xb8, 0x88, 0x55, 0xaa, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0xb, 0xb8, 0x88, 0x85, 0x55, 0x55, 0x55, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0xb, 0xbb, 0xb8, 0x85, 0x55, 0x55, 0x55, 0x0, 0x0, 0x0, 0xd, 0x0, 0x0, 0x88, 0x88, 0xbb, 0xb5, 0x55, 0x55, 0x0, 0x0, 0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x9, 0x90, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00 }; unsigned char empty[] = { 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00 }; char* Screen[7][7]; char level_1[7][7] = { {9, 9, 1, 1, 1, 9, 9}, {9, 9, 1, 1, 1, 9, 9}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {9, 9, 1, 1, 1, 9, 9}, {9, 9, 1, 1, 1, 9, 9}, }; char level_2[7][7] = { {9, 9, 1, 1, 1, 9, 9}, {9, 9, 1, 1, 1, 9, 9}, {1, 1, 2, 1, 2, 1, 1}, {1, 1, 2, 2, 1, 1, 1}, {1, 1, 1, 2, 1, 1, 1}, {9, 9, 1, 1, 1, 9, 9}, {9, 9, 1, 1, 1, 9, 9}, }; //Arrays of sprites char* bb_spritedata[] = { bb_w0, bb_w1, bb_t0, bb_t1 }; //Struct of Bear typedef struct { char depository; SCB_REHVST_PAL sprite; unsigned char run_index; signed int lives; signed int crystals; unsigned char jump_index; } sprite_t; //Struct of Soil typedef struct { char depository; SCB_REHVST_PAL sprite; signed char index; } soil_t; //Struct of Crystal typedef struct { char depository; SCB_REHVST_PAL sprite; signed char hvel; signed char vvel; } ballsprite_t; //Spritepacks sprite_t BBear = { 0x0, { BPP_4 | TYPE_NORMAL,REHVST | LITERAL, 0x02, 0, bb_w0, 80, 75, 0x100, 0x100, 0x000, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },0,5,5,0 }; soil_t SSoil_Bottom = {0x0, { BPP_4 | TYPE_BACKGROUND ,REHVST | LITERAL, 0x05, 0, soil_0, 1, 99, 0x400, 0x100, 0x100, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },0 }; ballsprite_t CCrystal = { 0x0, { BPP_4 | TYPE_NORMAL,REHVST | LITERAL, 0x3, 0, ball_r, 5, 75, 0x100, 0x100, 0x000, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },5,2, }; ballsprite_t Ball_red = { 0x0, { BPP_4 | TYPE_NORMAL,REHVST | LITERAL, 0x3, 0, ball_r, 0, 0, 0x100, 0x100, 0x000, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },0,0, }; ballsprite_t Ball_green = { 0x0, { BPP_4 | TYPE_NORMAL,REHVST | LITERAL, 0x3, 0, ball_g, 0, 0, 0x100, 0x100, 0x000, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },0,0, }; ballsprite_t Ball_empty = { 0x0, { BPP_4 | TYPE_NORMAL,REHVST | LITERAL, 0x3, 0, empty, 0, 0, 0x100, 0x100, 0x000, 0x000, {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef} },0,0, }; //Variables signed char Run_Index = 0; signed int Score = 0; unsigned int hasInit_level = 0; unsigned char joy,ticks; char text[20]; signed int cannon_pos = 0; signed int x_dir = 0; signed int y_dir = 10; // cell size int squareWidth = 10; int squareHeight = 10; // Level size int width = 7; int height = 7; static void WaitTicks(int t) { int i; for (i=0; i < t; i++) { ; } } int check_pos(int pos) { if (abs(pos) > 90) { if(pos< -90) {pos = -90;} if(pos> 90) {pos = 90;} } return pos; } int get_x_dir(int pos) { signed int dir; if (pos < 0) { if(pos < -75) { dir = -5; } if (pos < -60 && pos >= -75) { dir = -4; } if (pos < -40 && pos >= -60) { dir = -3; } if (pos < -20 && pos >= -40) { dir = -2; } if (pos < 0 && pos >= -20) { dir = -1; } } else { if(pos > 75) { dir = 5; } if (pos > 60 && pos <= 75) { dir = 4; } if (pos > 40 && pos <= 60) { dir = 3; } if (pos > 20 && pos <= 40) { dir = 2; } if (pos > 0 && pos <= 20) { dir = 1; } } if (pos == 0) { dir = 0; } return dir; } // Routine to load level void LoadLevel(int level) { int i, j; if (level == 1) { for (i=0; i < 7; i++) { for (j=0; j < 7; j++) { Screen[i][j] = level_1[i][j]; WaitTicks(5); } } } } void DrawBoard() { int i, j; for (i=0; i < width; i++) { for (j=0; j < height; j++) { // game board if (level_1[i][j] == 1 ) { Ball_green.sprite.hpos = i*squareWidth; Ball_green.sprite.vpos = j*squareHeight; tgi_sprite(&Ball_green); } else if (level_1[i][j] == 9){ Ball_red.sprite.hpos = i*squareWidth; Ball_red.sprite.vpos = j*squareHeight; tgi_sprite(&Ball_red); } else { Ball_red.sprite.hpos = i*squareWidth; Ball_red.sprite.vpos = j*squareHeight; tgi_sprite(&Ball_empty); } } } hasInit_level = 1; } //Routine to create level void draw_level(){ //Soil_Sprite tgi_sprite(&SSoil_Bottom.sprite); // Create Level if( hasInit_level == 0 ) { LoadLevel(1); DrawBoard(); } } //Win void victory(int Score){ tgi_clear(); itoa(Score, &text[0],10); tgi_outtextxy(50,10,text); tgi_outtextxy(50,50,"Won!"); } void game(void) { char buffer[16]; clock_t now = clock(); while (1) { if (!tgi_busy()) { tgi_clear(); tgi_setcolor(COLOR_GREEN); tgi_outtextxy(0, 0, "WIP"); //Draw level draw_level(); //Get input joy = joy_read(JOY_1); //Reset sprite collindex BBear.sprite.sprcoll = 0x02; //Movements if (JOY_BTN_RIGHT(joy)) { cannon_pos += 5; cannon_pos = check_pos(cannon_pos); } if (JOY_BTN_LEFT(joy)) { cannon_pos -= 5; cannon_pos = check_pos(cannon_pos); } if (JOY_BTN_DOWN(joy)) { Run_Index--; } //Jumping if (JOY_BTN_UP(joy)) { Run_Index--; } //Fire the Crystal if (JOY_BTN_FIRE(joy)) { CCrystal.sprite.hpos = BBear.sprite.hpos; CCrystal.sprite.vpos = BBear.sprite.vpos; x_dir = get_x_dir(cannon_pos); CCrystal.vvel = -1; CCrystal.hvel = x_dir; } //Vertical movement regardless direction of CCrystal.sprite.vpos += CCrystal.vvel; CCrystal.sprite.hpos += CCrystal.hvel; WaitTicks(50); //Draw collidable sprites tgi_sprite(&CCrystal.sprite); tgi_sprite(&BBear.sprite); //Debugging text itoa(Score, &buffer[0],10); tgi_outtextxy(30, 0, buffer); //itoa(BBear.lives, &buffer[0],10); itoa(cannon_pos, &buffer[0],10); tgi_outtextxy(70, 0, buffer); itoa(y_dir, &buffer[0],10); tgi_outtextxy(120, 0, buffer); tgi_updatedisplay(); } } }
  2. Because I want to calculate an angle to determine a direction a speed of an object. Will work now with a 180 grad integer.
  3. No, it does not support floats only doubles, afaik.
  4. Is there a known example how to calculate a tan() function with a Lynx? The CC65 seems not to ship with Math.h. Bests,
  5. Got mine! Thanks a lot for this beautiful piece of HW!
  6. Are there any WonderSwan friends around? I am think about getting a used Crystal version as soon as I get some hands on a SD-card device (I'd love to play Judgement Silversword). In case, do you have game recommendations? For those not knowing this handheld: https://de.wikipedia.org/wiki/WonderSwan My handheld game past looks like someone's past that is made for an obscure device like this: GameBoy --> GameBoy Advance --> Sega GameGear --> Neo Geo Pocket Color (best so far!) --> Atari Lynx (love the programmability) --> Bandai WonderSwan
  7. Just got back to the project. I think I will clean the code and switch the game play a bit, so stay tuned
  8. Thanks Karri, I removed the second driver. I tried to add the RAM line to lynx.cfg but it threw me an error with illegal code. I attached my current lynx.cfg: SYMBOLS { __BLOCKSIZE__: value = 1024, type = export; # 1024 bytes / block __BOOTLDR__: type = import; __HEADERSIZE__: value = 64, type = export; __STARTOFDIRECTORY__: value = $CB, type = export; __DIRECTORYSIZE__: value = 5*8, type = export; __MEMORY_TOP__: value = $fff8, type = export; # Screen is just below the top vectors __SCREEN_SIZE__: value = 8160, type = export; __MEMORY_SCREEN1__: value = __MEMORY_TOP__ - __SCREEN_SIZE__, type = export; __MEMORY_SCREEN0__: value = __MEMORY_SCREEN1__ - __SCREEN_SIZE__, type = export; # Under the screen we put the C-stack __STACKSIZE__: value = $800, type = export; # 2K stack __MEMORY_STACK__: value = __MEMORY_SCREEN0__ - __STACKSIZE__, type = export; # Under the stack we must put the resident RAM segment __RAM_RESIDENT_SIZE__: value = $3000, type = export; __MEMORY_RAM__: value = __MEMORY_STACK__ - __RAM_RESIDENT_SIZE__, type = export; # Under the resident code we place the tunes __TUNES_SIZE__: value = $11dc, type = export; __MEMORY_TUNES__: value = __MEMORY_RAM__ - __TUNES_SIZE__, type = export; # Modules start adress __MEMORY_MODULES__: value = $0200, type = export; __MODULES_SIZE__: value = __MEMORY_TUNES__ - __MEMORY_MODULES__, type = export; } MEMORY { ZP: start = 0, size = $0100, type = rw, define = yes; HEADER: start = $0, size = __HEADERSIZE__, file = %O; BOOT: start = $0, size = __STARTOFDIRECTORY__, file = %O; DIR: start = $0, size = __DIRECTORYSIZE__, file = %O; RAM: start = __MEMORY_RAM__, size = __RAM_RESIDENT_SIZE__, define = yes, file = %O; INTRO: start = __MEMORY_MODULES__, size = __MODULES_SIZE__, define = yes, file = %O; GAME: start = __MEMORY_MODULES__, size = __MODULES_SIZE__, define = yes, file = %O; TUNE: start = __MEMORY_TUNES__, size = __TUNES_SIZE__, define = yes, file = %O; } SEGMENTS { # The cart.lnx _must_ be built in the order set here!!! # lnx header EXEHDR: load = HEADER, type = rw, define = yes; # encrypted + secondary bootloader BOOTLDR: load = BOOT, type = rw, define = yes; # cart directory DIRECTORY: load = DIR, type = rw, define = yes; # resident code that stays in memory always STARTUP: load = RAM, type = ro, define = yes; LOWCODE: load = RAM, type = ro, define = yes, optional = yes; INIT: load = RAM, type = ro, define = yes, optional = yes; CODE: load = RAM, type = ro, define = yes; RODATA: load = RAM, type = ro, define = yes; DATA: load = RAM, type = rw, define = yes; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; EXTZP: load = ZP, type = zp; APPZP: load = ZP, type = zp; # Intro module INTRO_CODE: load = INTRO, type = ro, define = yes; INTRO_RODATA: load = INTRO, type = ro, define = yes; INTRO_DATA: load = INTRO, type = rw, define = yes; INTRO_BSS: load = INTRO, type = bss, optional = yes; # The game GAME_CODE: load = GAME, type = ro, define = yes; GAME_RODATA: load = GAME, type = ro, define = yes; GAME_DATA: load = GAME, type = rw, define = yes; GAME_BSS: load = GAME, type = bss, optional = yes; # Tunes TUNE0_RODATA: load = TUNE, type = rw, define = yes; } FEATURES { CONDES: segment = RODATA, type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__; CONDES: segment = RODATA, type = destructor, label = __DESTRUCTOR_TABLE__, count = __DESTRUCTOR_COUNT__; CONDES: segment = DATA, type = interruptor, label = __INTERRUPTOR_TABLE__, count = __INTERRUPTOR_COUNT__; }
  9. Dear all, for my Bentley Bear project I switched to karris card template. But whenever I use tgi_setcollisiondetection(1) in the resident.c or game.c my Lynx freezes without loading the main game. Setting tgi_setcollisiondetection(0) makes the game run again, but I need the collision detection. Any ideas? Here is main main(void) from resident.c: int main(void) { tgi_install(&tgi_static_stddrv); tgi_install(&lynx_160_102_16); tgi_setcollisiondetection(0); tgi_init(); joy_install(&joy_static_stddrv); lynx_snd_init(); CLI(); lynx_load((int)&TUNE0_FILENR); #if 0 lynx_snd_pause(); lynx_snd_play(0, musicptr.music0); lynx_snd_play(1, musicptr.music1); lynx_snd_play(2, musicptr.music2); lynx_snd_play(3, musicptr.music3); lynx_snd_continue(); #endif while (1) { lynx_load((int)&INTRO_FILENR); intro(); lynx_load((int)&GAME_FILENR); tgi_setcollisiondetection(1); game(); } return 0; }
  10. As I had much trouble with my actual work, the project made only little progress. But I am happy to start working on it from next week again!
  11. Music is on its way in the game (thanks, DerLuchs and sage!) - the boss battle will need some work (maybe I get this one in next week). I will change my game's internal design to karri's template. I found some of the first beta testers, maybe some one else is interested? I might give out an Alpha in two weeks
  12. Thought about it, but my schedule is very tight at the moment! So, sorry, no ejagfest this year.
  13. Yay! Any distribution in Europe with low shipping costs planned? Would like to order a few of your games
×
×
  • Create New...