tonma Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) That is ok. The game may even sound better with less noise. Edit: do you have a method for erasing the high score? This would be nice to have for "factory resetting" the cart after testing. Yep, I need to add this. I can put it on Option1. How can I test the Option1 Button ? I try old code like kbhit() but doesn't seem to work. I have a problem with the sound effect. Sometimes the sound Coin goes bad. I try to play song outside the tgi_busy loop but without sucess. I put this little demo for testing. No music, flap sound, coin sound when you get point and whip sound when you die. The coin sound crash sometime. The others works. soundtest.zip Edited January 4, 2017 by tonma 2 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 4, 2017 Share Posted January 4, 2017 Yep, I need to add this. I can put it on Option1. How can I test the Option1 Button ? I try old code like kbhit() but doesn't seem to work. I have a problem with the sound effect. Sometimes the sound Coin goes bad. I try to play song outside the tgi_busy loop but without sucess. I put this little demo for testing. No music, flap sound, coin sound when you get point and whip sound when you die. The coin sound crash sometime. The others works. Strange. I shorted the sound a bit. coin.zip 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 4, 2017 Share Posted January 4, 2017 (edited) Testing kbhit() and reading the character with cgetc() should work.And you need to include conio.h The mess with the sounds could come from IRQ routines. Perhaps you could pause the music engine before making changes like: lynx_snd_pause(); lynx_snd_play(0, musicptr.music0); lynx_snd_continue(); Edited January 4, 2017 by karri 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 4, 2017 Share Posted January 4, 2017 (edited) From my old code... if (kbhit()) { switch (cgetc()) { case 'F': tgi_flip(); break; case 'R': return RESTART_LYNX; case '1': // Option 1 break; default: break; } } Edited January 4, 2017 by karri Quote Link to comment Share on other sites More sharing options...
+karri Posted January 4, 2017 Share Posted January 4, 2017 The whip sound is tricky. I should test it on a real Lynx. Here is one version... Does anyone have a good whip sound? whip2.zip 1 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted January 5, 2017 Share Posted January 5, 2017 Yep, I need to add this. I can put it on Option1. How can I test the Option1 Button ? I try old code like kbhit() but doesn't seem to work. I have a problem with the sound effect. Sometimes the sound Coin goes bad. I try to play song outside the tgi_busy loop but without sucess. I put this little demo for testing. No music, flap sound, coin sound when you get point and whip sound when you die. The coin sound crash sometime. The others works. Also option 2 + Start should flip the screen. Maybe someone wanna hold it with the buttons on top? Quote Link to comment Share on other sites More sharing options...
+karri Posted January 5, 2017 Share Posted January 5, 2017 Getting the three buttons correct was done some years ago with the help of a few old timers. The kbhit() cgetc() combination has the correct touch and feel for the Lynx. It will properly return the right character for further processing. It is a bit tricky to get the timing and operations exact by just reading the bits from the hardware. So we created a minikeyboard in cc65 to get the feel right. Opt 1 = '1' Pause = 'P' // Toggle Pause Opt 2 = '2' Pause + Opt 1 = 'R' // Restart Lynx Pause + Opt 2 = 'F' // Toggle Flip screen Opt 1 + Opt 2 = '3' Pause + Opt 1 + Opt 2 = '?' The last two codes are probably never used for anything. Quote Link to comment Share on other sites More sharing options...
tonma Posted January 5, 2017 Author Share Posted January 5, 2017 Strange. I shorted the sound a bit. coin.zip It's look like the first version (coin.zip). I'll try the whip2. Well the problem may come from my code, I will make a simple version with only the sounds. I tried sound pause & continue but the game freeze the second time I use it. Thanks for conio.h, I always forgot the include. I need to change the mednafen config, because the key mapping is weird. Can't have Opt1 in emulator. Also option 2 + Start should flip the screen. Maybe someone wanna hold it with the buttons on top? I always thinking, It was a hardware function, not software And yes, I'll be the first to use " Opt 1 + Opt 2 = '3' " for erasing the eeprom. 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 5, 2017 Share Posted January 5, 2017 (edited) Changing the mappings for mednafen is trivial. Alt Shift 1 Then press up up down down left left right right q q q q w w w w SPACE SPACE z z z z x x x x Now the cursor keys are configured as joypad. Fire is z and x. Opt 1 is q, Opt 2 is w, Pause is SPACE. I hope to have time today to fine tune the sound effects on a real Lynx. Omg. Look what I found: Edited January 5, 2017 by karri 2 Quote Link to comment Share on other sites More sharing options...
tonma Posted January 5, 2017 Author Share Posted January 5, 2017 (edited) Very cool picture. I love it. Arrrgh the alt shit 1 doesn't work. Lot of linux user as the same problem, I'll change the value in the config file. The flip screen working, I've add it. The new sound whip2 doesn't work with me. Or maybe I need to put the 3 sounds with the music in one file. The instruments or patterns can conflict with each other ? Edited January 5, 2017 by tonma Quote Link to comment Share on other sites More sharing options...
tonma Posted January 5, 2017 Author Share Posted January 5, 2017 A test version. flapsfx : no music but sound, new version with flipscreen (yes I've made it : Pause + Opt 2), highscore and eeprom erase (opt1 + opt2) and the others things : new difficulty, flap sooner, ... flapsfx2 : only sound : BTN A / B : music / flap, KEY LEFT / RIGHT : coin / whip flapsfx.zip Quote Link to comment Share on other sites More sharing options...
+karri Posted January 5, 2017 Share Posted January 5, 2017 (edited) I tried to put all the sounds into one file. Channel 0 - music Channel 1 - flap Channel 2 - coin Channel 3 - whip I hope this helps... I also found out that modifying the music between pause / continue is not a good idea. So I assume you just have to give play commands at every event. chickendance.zip Edited January 5, 2017 by karri 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 5, 2017 Share Posted January 5, 2017 Flappy sitting on a Christmas tree 7 Quote Link to comment Share on other sites More sharing options...
+BitJag Posted January 6, 2017 Share Posted January 6, 2017 ooooo... With the exception of Zaku, this is the first time I have seen a board as thin as an official release. Did you make that by hand? Flappy sitting on a Christmas tree flappyxmas.jpg Quote Link to comment Share on other sites More sharing options...
TrekMD Posted January 6, 2017 Share Posted January 6, 2017 Love the look of that cart! Quote Link to comment Share on other sites More sharing options...
+karri Posted January 6, 2017 Share Posted January 6, 2017 ooooo... With the exception of Zaku, this is the first time I have seen a board as thin as an official release. Did you make that by hand? It did take a while to find chips thin enough to make it work. The eeprom for the high score is a bit tiny. Basically this is part of my blankcart project. Trying to create an affordable cart for hobby releases. The feel is not really comparable to Zaku plastics or Alpine Games laser sintered plastics. On the other hand ABS costs only 33% of the material used in laser sintered carts. The thickness of the cart is only 2.6mm and it fits both Lynx model 1 and model 2. 2 Quote Link to comment Share on other sites More sharing options...
Andromeda Stardust Posted January 6, 2017 Share Posted January 6, 2017 Flappy sitting on a Christmas tree flappyxmas.jpg Yyesss! It's beautiful! Quote Link to comment Share on other sites More sharing options...
tonma Posted January 6, 2017 Author Share Posted January 6, 2017 Flappy sitting on a Christmas tree flappyxmas.jpg I want it so much. I tried the all in one sound file and seems to works well. I clean my code and upload a test version. 1 Quote Link to comment Share on other sites More sharing options...
tonma Posted January 6, 2017 Author Share Posted January 6, 2017 The new version with sound effects that finally works. I cleaned up my code a little. Thanks for all your help. Tested on mednafen. My highscore is 41, not too bad flappylynx.zip 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 6, 2017 Share Posted January 6, 2017 Nice. The background sprite is TYPE_NORMAL when it should be TYPE_BACKGROUND. The tree trunks that are black are flickering as they are transparent. /* SPRCTL0 $FC80 */ #define BPP_4 0xC0 #define BPP_3 0x80 #define BPP_2 0x40 #define BPP_1 0x00 #define HFLIP 0x20 #define VFLIP 0x10 #define TYPE_SHADOW 0x07 #define TYPE_XOR 0x06 #define TYPE_NONCOLL 0x05 #define TYPE_NORMAL 0x04 #define TYPE_BOUNDARY 0x03 #define TYPE_BSHADOW 0x02 #define TYPE_BACKNONCOLL 0x01 #define TYPE_BACKGROUND 0x00 I am just burning the code to the cart. Fingers crossed.... Quote Link to comment Share on other sites More sharing options...
tonma Posted January 6, 2017 Author Share Posted January 6, 2017 (edited) All Fingers crossed I did not see the flickering. I open my code. For the intro, I have TYPE_BACKNONCOLL, else flappy collide with background. Edited January 6, 2017 by tonma Quote Link to comment Share on other sites More sharing options...
+karri Posted January 6, 2017 Share Posted January 6, 2017 (edited) The game sounds and plays really well. The eeprom did not save the high score. I have to try it with some other game to see if the chip is different. The eeprom works with MegaPak. So there may be a problem with the library routines. I wonder if you could use the older eeprom library. unsigned __fastcall__ lynx_eeprom_read (unsigned char cell); unsigned __fastcall__ lynx_eeprom_erase (unsigned char cell); unsigned __fastcall__ lynx_eeprom_write (unsigned char cell, unsigned val); Plain "unsigned" means 16 bit unsigned int. In the old driver you could only program bits that were '1' to '0'. So the correct way was to first erase the cell to all bits '1' and then write the data. At the intro screen the colours are correct. But when Flappy starts flying the tree trunks in the background start flickering. They appear to be black - index 0. I wonder if you could re-colour them to dark brown - index 11? I just tested the cart in Lynx II with McWill's screen and a Lynx I with original screen. Everything works except eeprom. Edited January 6, 2017 by karri Quote Link to comment Share on other sites More sharing options...
sage Posted January 6, 2017 Share Posted January 6, 2017 might still be that the eeprom is not fully working in emulator. but never got any complains. Quote Link to comment Share on other sites More sharing options...
tonma Posted January 6, 2017 Author Share Posted January 6, 2017 (edited) The game sounds and plays really well. The eeprom did not save the high score. I have to try it with some other game to see if the chip is different. The eeprom works with MegaPak. So there may be a problem with the library routines. I wonder if you could use the older eeprom library. unsigned __fastcall__ lynx_eeprom_read (unsigned char cell); unsigned __fastcall__ lynx_eeprom_erase (unsigned char cell); unsigned __fastcall__ lynx_eeprom_write (unsigned char cell, unsigned val); Plain "unsigned" means 16 bit unsigned int. In the old driver you could only program bits that were '1' to '0'. So the correct way was to first erase the cell to all bits '1' and then write the data. At the intro screen the colours are correct. But when Flappy starts flying the tree trunks in the background start flickering. They appear to be black - index 0. I wonder if you could re-colour them to dark brown - index 11? I just tested the cart in Lynx II with McWill's screen and a Lynx I with original screen. Everything works except eeprom. Aaaarrrgh I mess all my code to find why I have this glitche. Seem it's pen problem , like the F and E. When I remove the collision system with "tgi_setcollisiondetection(0);"; no gltiche. I try with handy, only see flickering with this emulator I'll try to change color to index 11 My code : SCB_REHV_PAL sprrobot1 = { BPP_4 | TYPE_NONCOLL | PACKED, REHV, 0x01, 0, robot1, 60, 32, 0x0200, 0x0200, { 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF } }; SCB_REHV_PAL sprbg = { BPP_4 | TYPE_NONCOLL| PACKED, REHV, 0x00, 0, toki2, 0, 0, 0x0100, 0x0100, { 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF } }; SCB_REHV_PAL sprsol = { BPP_4 | TYPE_NONCOLL | PACKED, REHV, 0x00, 0, sol, 128, 0, 0x0100, 0x0100, { 0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF } }; If I change type_noncoll with normal / background flappy change color with pen F And I can't use non_coll for the game, only for intro. I try for the eeprom but have conflct with : unsigned __fastcall__ lynx_eeprom_erase (unsigned char cell); I have : main.c(14): Error: Conflicting types for `lynx_eeprom_erase' My code : unsigned __fastcall__ lynx_eeprom_read (unsigned char cell); //unsigned __fastcall__ lynx_eeprom_erase (unsigned char cell); unsigned __fastcall__ lynx_eeprom_write (unsigned char cell, unsigned val); mynameH = lynx_eeprom_read(0); while (1) { if (myname > mynameH) { lynx_eeprom_write(0,myname); } if (kbhit()) { key = cgetc(); if (key == '3') { lynx_eeprom_write(0,1); lynx_eeprom_erase(0); } } I can add picture if needed. Picture add. 2 first screen : Sprite Normal and BG = type_background. The white of flappy change and flickering in bg Right picture : Sprite Normal and BG = type_noncollide. no flickering but the white of flappy change. So I musn't use the E and F color Edited January 6, 2017 by tonma 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 6, 2017 Share Posted January 6, 2017 yep. It is defined as lynx.h:void __fastcall__ lynx_eeprom_erase (unsigned char cell); The code if (key == '3') { lynx_eeprom_write(0,1); lynx_eeprom_erase(0); } could also be just lynx_eeprom_erase(0); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.