Jump to content

DusanStrakl

Members
  • Content Count

    36
  • Joined

  • Last visited

  • Days Won

    4

DusanStrakl last won the day on August 15

DusanStrakl had the most liked content!

Community Reputation

46 Excellent

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for the comment Mikael. It seems that there was some interference between effects library and some VERA related actions from BASIC programs, specifically in your case, scrolling of the screen. I added some code to save and restore VERA state inside the IRQ Player. I tried both EFFECTS.PRG and EFFECTSHI.PRG with your program and it seems to work without problems now.
  2. No worries, everybody has made this mistake at least once. If you have too much time you can read up following two posts on why it behaves this way: Mathematical explanation: http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html If you want to go to the level of silicon: http://www.righto.com/2013/01/a-small-part-of-6502-chip-explained.html
  3. Thanks. I hope you can make it. Just share your progress and there is plenty of help out there. I myself do not come over here often enough but will try to follow this forum a bit closer in the future.
  4. Thanks. If there is specific topic you feel needs coverage I would be happy to dig into.
  5. I have covered most of the topics you are asking about in the series of tutorials on my blog: https://www.8bitcoding.com/p/commander-x16.html I go pretty deep into explanations on how VERA works, different video modes, sprites, sprite animations, scrolling, layers and even some simple libraries to add music to your programs. Examples are written mostly in BASIC and some in Assembly but of course all the hardware related subjects are applicable to all programming languages.
  6. Interesting. It might be tricky to poke values directly because BASIC might be too slow and the player is called 50 times per second. Maybe try stopping the current sound by poking 0 into "running" first, change the envelope parameters and then start the sound by poking 255 into "phase". Obviously I haven't tried this...
  7. I wrote few games in BASIC and it can be done. Even with faster CPU speed you still have to design it very carefully though. Like you found out graphics is usually a bottleneck so whenever you can use hardware to help use it. So perhaps instead of continuously drawing to screen, try to load the whole map at once directly into VRAM and move around by scrolling which typically only requires couple of POKEs instead of drawing. In my experience any time you have to do X times Y loop for drawing from BASIC it is time to reconsider the design. If assembly is an option of course that changes everything but it is not a BASIC game anymore and that is a special kind of challenge. Perhaps some of the examples and resources from my blog would be helpful: https://www.8bitcoding.com/p/commander-x16.html
  8. Of course Andy, that's why I posted the source code so that anybody can reuse it. I didn't plan to make this particular library multichannel but it should be pretty easy doable. I think your approach to simply duplicate the code four times for four channels is totally fine, the other approach would be a loop. I am actually working on another library that is intended to play music in the background and supports full ADSR sound modulation and would have few predefined instruments etc. It is almost working but I am currently distracted by another project but hopefully I can find few days to finish and test it.
  9. Version 1.1.0

    9 downloads

    Usage Because of its simplicity the library can be stored in a 1K space below basic programs, starting at $0400. Save the EFFECTS.PRG program in the directory where your BASIC program is stored, which would typically be in the same directory from where you are running the emulator. Load library with LOAD command: LOAD”EFFECTS.PRG”,8,1,$0400 Since this routine after the first run adds a new interrupt handler it is good practice to only load it once. It is therefore recommended to do a simple check: IF PEEK($400)=0 THEN LOAD”EFFECTS.PRG”,8,1,$0400 And that is it. Now you only need to call the needed sound effect from the BASIC program with a simple SYS command. We have four different effects so four different addresses can be called: SYS $400 PING Is designed for events like picking coins or rewards. SYS $403 SHOOT Effect that can be used for shooting the gun or other weapon. SYS $406 EXPLODE Electricity zapping or perhaps a laser gun sound. SYS $409 ZAP Long explosion for when we successfully blow something up Alternative binary named EFFECTSHI.PRG that loads into memory at $9000 can be downloaded. Of course calls are then $9000 for PING, $9003 for SHOOT, $9006 for ZAP and $9009 for EXPLODE. Full source code and walk through is available at my blog: https://www.8bitcoding.com/p/simplest-sound-effects-library-for.html Demo video:
  10. Simplest Sound Effects Library for BASIC programs View File Usage Because of its simplicity the library can be stored in a 1K space below basic programs, starting at $0400. Save the EFFECTS.PRG program in the directory where your BASIC program is stored, which would typically be in the same directory from where you are running the emulator. Load library with LOAD command: LOAD”EFFECTS.PRG”,8,1,$0400 Since this routine after the first run adds a new interrupt handler it is good practice to only load it once. It is therefore recommended to do a simple check: IF PEEK($400)=0 THEN LOAD”EFFECTS.PRG”,8,1,$0400 And that is it. Now you only need to call the needed sound effect from the BASIC program with a simple SYS command. We have four different effects so four different addresses can be called: SYS $400 PING Is designed for events like picking coins or rewards. SYS $403 SHOOT Effect that can be used for shooting the gun or other weapon. SYS $406 EXPLODE Electricity zapping or perhaps a laser gun sound. SYS $409 ZAP Long explosion for when we successfully blow something up Alternative binary named EFFECTSHI.PRG that loads into memory at $9000 can be downloaded. Of course calls are then $9000 for PING, $9003 for SHOOT, $9006 for ZAP and $9009 for EXPLODE. Full source code and walk through is available at my blog: https://www.8bitcoding.com/p/simplest-sound-effects-library-for.html Demo video: Submitter DusanStrakl Submitted 08/12/20 Category Dev Tools  
  11. Interesting project. I was actually thinking about putting it on my list of possible future projects but unfortunately that list is way too big already especially considering available free time Considering that sending data to VERA can be a bottleneck some sort of hybrid solution of tile background with hardware scrolling and bitmap road with bending by using scan line shifting might work and leave enough CPU time for manipulating animated sprites that could be used for everything else. Keep us updated and good luck!
  12. Sounds great. Any news on the Keyboard driver? Will we be able to read all CX16 keys? Thanks, Dusan
  13. Perfect. Exactly the answer I was hoping for and it works as expected. Thanks, Dusan
×
×
  • Create New...

Important Information

Please review our Terms of Use