Jump to content

SerErris

Members
  • Content Count

    172
  • Joined

  • Last visited

  • Days Won

    1

SerErris last won the day on September 11

SerErris had the most liked content!

Community Reputation

69 Excellent

About SerErris

  • Birthday 12/08/1971

Recent Profile Visitors

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

  1. Make sure you read that ... the best explanation I have seen so far.
  2. My statement was more based around expectations to say what to expect. @desertfish is pretty much right on it and the reasons why C is pretty much inefficient on the 6502. BASIC has its own inefficiencies and is even compiled not considered fast. What I wanted to say is - If you need speed, Assembler is the only performance efficient way to do it. If it comes to complex calculations Basic can get you started, C can get you also the fragments going, but if you want to optimize on performance you need to write some assembly code. It would be great if we would have a debugger in the emulator that also can do profiling (how many cycles in which part of the program). If that would exist, you could then optimize the code where it makes the biggest impact and ignore the code you are just calling once or where you spend in total very few amount of time (in percent). The typical consideration is: 90% of execution time is spend in 10% of the code. That is what you want to optimize. So C with hand crafted Assembly routines optimized for speed might be a good and efficient procedure. However without a profiler you will never know.
  3. good catch - you are right .. corrected... New Version attached ... ca65.cson
  4. The whole procedureal generation is the real secret sauce in Elite ... besides the unparalleled graphics of that time. Also need to correct - the Seed is 6 bytes = 3 words. Start reading here: Sub TT20 and Sub TT54 gives you more or less the whole picture. TT24 is then calculating the real system data. Everything comes together than with the tokenized text routines (which is a masterpiece in itself). That will put out the information based on the system data. None of the strings you see on screen can be found anywhere in the code. They are also generated. That code and description can be found in QQ18. https://raw.githubusercontent.com/markmoxon/elite-beebasm/master/sources/elite-source.asm But now enough on that here... it is confusing the original post with non relevant data.
  5. I do not see any reason why I should need to build for X16 on Linux if I am Using. The whole Toolchain exists on Windows. If you want to use Linux - that is great and everything works there. But if you want to use Windows then WSL is just something to enable you to run Linux - which was not the idea in the first place. I now have done a setup with Atom as VSCode does not have any proper syntax highlighting I can easily change. I still need to do the build and run integration. I have not done that as I currently working on the source. After I have something to compile I will try to build the integration (which should be really nothing than a caller script to make and CC65).
  6. Just not related to prog8 but to Elite. You may want to lookup how the 256 planets worked in Elite. (check the source code I linked) It has a very good writeup how that works. In short: You have a pseudo random generator that is seeded by the galaxy seed (4 bytes). This seed is then taken through iterative random numbers to allways generate the same parameters for a specific planet. So if you feed in 240 into this generator (System Number), it will allways get the same result back to you, which is then feeded into the the System generator and gets you the name and the description. All of that is also generated and not stored anywhere. The marked prices are as well generated but also only varried with a random difference. /Edit: ah forgot the galaxies ... So if you jump the galaxy. the 4 bytes above will be all rotated left by 1 bit. That results into a different seed for each galaxy and will also return back to 1 for if you jump through 8 galaxies back to the first one.
  7. That is a good approach. Just wanted to make you aware of the fact of limitations of the Architecture in regards of high languages. Where the Amiga was optimal to use for C the C64 never was and the X16 compensates a bit by processor speed with factor of 8 but has the same limitations. The compiled BASIC was just a reference for comparison. It was not meant as a recommendation to go that way. Compiled Basic is for my point of view the way to go, if you really do not want to dive into Assembler. But it is still very slow. For serious game development IMO Assembler is still required. Maybe the main game loop can be written in C, but the intensive math and graphics routines should then be done directly in Assembler to avoid C functioncalls.
  8. So this is it ... I solved it by searching for the whole regex ( Line Start;any # of whitespaces;one of the allowed Mnemonics;any # of whitespaces; and then the letter 'A');followed by a word boundary). Setting both the Mnemonic and the Register in a group and then highlighten both individually works. The problem is that you need to highlight both parts otherwise the Mnemonic would be unhighlighted. I am not sure why the "X and Y" part does not highlight anything in the comments, but I do not care - it works. Attached you find the new ca65.cson file. ca65.cson
  9. Be aware that C is not a good language for the C64/X16/6502 in general. It is very heavy on all the calls and context switches, where the 6502 is not very good at. The stack is also only 8 bit and only 256 bytes in total and cannot get extended. So you need to create a software stack (which is exactly what cc65 is doing) and that is really slow to use. Yes you can program in high languages - and it will be faster than interpreted basic. However I assume (not tested) that compiled basic would be faster than any C code.
  10. That sounds like a good approach ... You are right A is very uncommon ... I can specifically look for certain mnemonics and X Y have a leading comma .. however still my problem with the comment apply. LDA (ADDR),X ; This is a ,X comment would still hightlight both X. I cannot find any statement that is highlighting anything only if it NOT part of a comment. @Greg King Why should I ignore spaces? The syntax will be still interpreted by the Assembler if there is a space between the comma and the Register. So if it is valid Syntax it should also be highlighted correctly. Haveing whitespaces between comma and the Register is not a big issue. ... However having a comment (;) anywhere in front of such a structure is a problem.
  11. There is actually only one valid Register ... if the first part is a mnemonic. This statment you have given will also show stuff in the comments .. LDA #50 ; This load A Register. would highlight the A in front of "A Register". However it is part of the comment and should not be highlighted anyway different, but highlighted as a comment. I cannot thing of any way really other the excluding stuff. Cause you need to exclude a match if a ; is in Front of the [AXY] ... Or in other words: try to match it, but if you meet a ";" ignore the rest of the string completely (never match). Not sure if something like that exists.
  12. Okay after reading the Regex Tutorial again .. it turns out that it should be this - which works in the JavaScript on regex101: \b[AXY](?<!^\s*[AXY]|^\s*;.*)\b Hower converting it to this # Registers { match: '\\b[AXY](?<!^\\s*[AXY]|^\\s*;.*)\\b' name: 'keyword.parameter.register.ca65' } Leads to nothing parsed anymore (all characters white now). I tried a lot of stuff but I cannot get my head around to something working in Atom.. This is my test text for regex101: Only the second and the last entry shall be matched. This does the trick as well (?<!^\s*|;.*)\b[AXY]\b ... it reads: Match [AXY] if it as single letter and if infront of it there is neither a ";" sign nor only whitespaces. Works again with JavaScript in regex101 - but not in atom.
  13. I still have some minor issue with it. 1. My register statement does not work as I would like it to be. I addressed this question in another thread put like to pull it out there, as it is not related to the original topic. So here we go. If I hit a Register as a parameter to a Assembly call I like to highlight it For instance I like to highlight the X in LDA ADDR,X where LDA should be highlighted as Mnemonic, ADDR should be highlighted as symbol/label , as operator and X as register. That works great with the current file. However if I just put X anywhere on the line (without anything else) it is getting highlighted to. I got a recommendation from @Ender to try that: { match: '^\\s*\\S+.*\\b([AXY])\\b' captures: 1: name: 'keyword.parameter.register.ca65' } The result is not as I expected it to be. Now every X or A will be highlighted and the rest of the line will be not highlighted at all. I also tried to change the match to this - but same result: match: '^\\s*\\w+.*\\b([AXY])\\b' .. Same result. So obviously I am overwriting the comment rule and this rule has somehow precendence. I would love to write it this way: If the line does not start with A or X or Y with any number of Whitespaces in front, then tread a word which consists only of the letter A or X or Y as a register. So the normal way would be like that: match :'(?!^\\s*[AXY])\\b[AXY])\\b' This part is the if not start+any number of whitespaces+[A or X or Y]. If that hits, the rest will be ignored. If that does not hit, the rest will get matched. However it does not work. It works if I put X in the first column. But as soon as I put it in second column with a space in front, the not part does not seem to work and it is getting matched as a register. This is what regex101 has to say about it: I cannot see what is wrong with it - but it is even there doing the highlighting for the " X" string
  14. Awesome ... not sure why that is not part of the official flight manual
×
×
  • Create New...

Important Information

Please review our Terms of Use