Jump to content

borgar

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

14 Good

Recent Profile Visitors

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

  1. That's basically because I don't really know how to use the assembler (at least not yet), so I just went for the default program declaration the feels natural to me. It's at least 30 years ago since I last touched assembly language (and that was on M68000 systems). So I'm more or less starting over from scratch and haven't really gotten to the the more assembler manual yet. I have started reading up on the 6802 instruction set though. Not too hard to get a basic grasp of that given the small instruction set.
  2. Let me again state that this is probably a very minmal problem and it could be covered by expanding the documentation for asmsub a bit. However, if you would like to add it to the compiler I suggest adding it to the asmsub declaration. asmsub get_low(ubyte value @A) uses (testvar) clobbers(Y) -> ubyte @A { %asm {{ sta testvar lda #$0F and testvar tay lda tbl,y rts }} I.e uses (testvar) (or something similar) just lets the compiler know that testvar is no longer a potential unused variable, even if there is no actual use in the assembly code. I assume you are parsing this line anyway to match call parameters.
  3. I basically assumed that it would be fine to use ZP_SCRATCH variables as long as I avoided calling any subroutines "In between" use. That seem to be correct then. BTW, the main problem with using the various zero page location is that we won't know which are used by the code until after compile is done. Note that this isn't likely an especially serious challenge but it's sort of would belong in a block similar to "clobbers" (i.e that the compiler marks variable as "used" if it's listed for the asmsub).
  4. I've written a couple of assembly routines as a test and this seem to work fine. However, I was wondering how to use "temp" variables in the asmsub. I.e. I could not just add ubyte tmpvar in the module file and then have the asmsub use this e.g. with sta testvar I figured out that this is because the compiler removes the variable since it's unused in the actual prog8 code. Is there a way to indicate that a variable is in use in a asmsub? BTW, I used P8ZP_SCRATCH_REG since I found that in the asmsub's in textelite.p8.
  5. I've uploaded a new version of Petaxian making it a bit more like a proper game. Now loop over 8 stages, 3 different enemy types (requiring different 1 to 3 hits to kill). And some simple sound effects. I basically just copied the X16 sound code from Tehtriz.
  6. Thanks for the hints. I have already taken a peak at the asm output for what I think is the revelant sub and there might very well be a few things that might be possible to optimize. But since there are no problems getting it to run on the cx16 I think I'll focus on getting a bit more of the main functionallity completed before I concentrate on C64 speed.
  7. I've uploaded my first version of the Petaxian game now (very much inspired by C64 Galaga). It's no where near a complete game, but it's sort of playable. As expected in this thread it's written in Prog8 which has certainly allowed me to make this a lot faster than trying to re-learn 6502 machine language (last used in 1987 when I upgraded from C64 to an Amiga 500). Though I'm a bit tempted to look closer at assembly to see if I can speed this up enough to get it to run smoothly on C64. It can be compiled and run on C64 as well but it slows down when there are a lot of moving "bits" on screen at once.
  8. borgar

    Petaxian

    Version 0.2

    12 downloads

    I had been lurking on the forums for a few months when I found Prog8 and though this looked interesting. I.e. I could learn a new language and test out the emulator. I recently saw some good demos using C64 emulator but just based on PETSCII graphics and I though this looked suprisingly cool. Then I remembered the old Galaga game on the C64, the one using just (few) petscii chars. I thought making something similar would be a nice challenge. This is currently more of a prototype/tech demo than a complete game, the game play basically loops over two mirrored stages but it's at least in a sort of playable state. The intention is to make it a bit more like a proper game but it may never feel like a complete game (programming the gameplay is more fun than designing levels etc).
  9. Petaxian View File I had been lurking on the forums for a few months when I found Prog8 and though this looked interesting. I.e. I could learn a new language and test out the emulator. I recently saw some good demos using C64 emulator but just based on PETSCII graphics and I though this looked suprisingly cool. Then I remembered the old Galaga game on the C64, the one using just (few) petscii chars. I thought making something similar would be a nice challenge. This is currently more of a prototype/tech demo than a complete game, the game play basically loops over two mirrored stages but it's at least in a sort of playable state. The intention is to make it a bit more like a proper game but it may never feel like a complete game (programming the gameplay is more fun than designing levels etc). Submitter borgar Submitted 05/01/21 Category Games  
  10. I laughed out loud reading this tread. I have to admit I also had an extensive collection of "offsite backups" on the C64. I had a nice archive of games saved with turbo tape and several notebooks containing indexes with tape number and counter position for each "backup". My only defense is that I stopped any nefarious practices as soon as I started to earn enough money to actually purchase games. I have certainly given a significant amount of money to the industry over they years and have bought a lot lot more games than I will have ever have time to play (according to my backlog on Steam, GOG and PSN, not to mention all the un-played physical disks etc.) Seems a bit unfair to be honest. Back in my C64 days I had plenty of time but no money for games. Now it's the opposite, not enough time to play all the games I buy
  11. Yes, this is the same error I get. And I will make sure I include any error messages as well if I should find any other issues in the future
  12. I've found another compiler bug. I'm creating a data structure with an array of arrays (i.e array elements are memory locations). Here is a relevant code parts: const REF_ACTIVE = 0 uword[] container = [ &item1, &item2 ] uword myref = container[1] ubyte tmp = myref[REF_ACTIVE] Basically using arry index [0] doesn't work in this assignment (anything above 0 works fine). Curiously it does compile if the same value is used in an if statement. Compilable sample attached. tmp.p8
  13. I get Prog8 compiler v6.4 by Irmen de Jong (irmen@razorvine.net) This software is licensed under the GNU GPL 3.0, see https://www.gnu.org/licenses/gpl.html Compiler target: cx16. Parsing... importing 'tmp' tmp.p8:6:14: extraneous input '\r\n' expecting {'[', '+', '-', '~', 'not', '(', 'true', 'false', NAME, DEC_INTEGER, HEX_INTEGER, BIN_INTEGER, '&', '@', FLOAT_NUMBER, STRING, SINGLECHAR} ←[91mThere are 1 errors in 'tmp'. ←[0m I'm compiling on Windows 10 with jdk-11.0.8.10.
  14. I have actually found something I'd consider a small bug in the compiler. You can't have a comment in the array initialization list as a separate line. So ubyte[6] arr = [ 1,2,3, ; Comment here 5,6,7 ] is illegal. I found this while trying add some comments in my data. It's not a big issue since this ubyte[6] arr = [ 1,2,3, ; Comment here 5,6,7 ] works fine.
×
×
  • Create New...

Important Information

Please review our Terms of Use