Jump to content

CursorKeys

Members
  • Posts

    86
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by CursorKeys

  1. Hi and Welcome, The same it must be for many of us. I went from C64 to Amiga to PC. (But first had and Amiga 500, and my first "PC", was a "bridge board", in my later Amiga 2000) /CKs
  2. Version 1.0.1

    15 downloads

    X16 Forum This is my third "Double PETSCII" demo. But this time around, the colors are gone. It is only black and white. This is a converted PETSCII picture, the trick was to see if with no colors still some nice effects could be done. Besides PETSCII, there are also a few effects. The demo is written in KickC, and the PETSCII editor is once more the alfa version of HyperPetscii. The link to this can be found here: https://hyperpyxel.com/?p=229 Note: It is still pretty unstable and does not work well on a browser in the MAC for some reason. If you cannot run it on an emulator, you can see it on youtube here: https://youtu.be/3x7OieGqQCg Keep cool, and keep it (DOUBLE) PETSCII.
  3. Black and White View File X16 Forum This is my third "Double PETSCII" demo. But this time around, the colors are gone. It is only black and white. This is a converted PETSCII picture, the trick was to see if with no colors still some nice effects could be done. Besides PETSCII, there are also a few effects. The demo is written in KickC, and the PETSCII editor is once more the alfa version of HyperPetscii. The link to this can be found here: https://hyperpyxel.com/?p=229 Note: It is still pretty unstable and does not work well on a browser in the MAC for some reason. If you cannot run it on an emulator, you can see it on youtube here: https://youtu.be/3x7OieGqQCg Keep cool, and keep it (DOUBLE) PETSCII. Submitter CursorKeys Submitted 06/17/21 Category Demos  
  4. Ok, so for those interested in my results, I made a little you tube video. Yeah, I know, I talk slow and not very "smooth" (pun intended), but it's a little side adventure from me to make good videos. https://youtu.be/Ln7pIIZKyvI
  5. Wow. I should have known that, but it's new to me. So C can be compiled to WebAssembly (which is basically Javascript, but optimized), that is pretty nifty. I did not know there was any decent support for that. What is the cross compiler being used?
  6. Hi, I am not sure but. 1. Is the code of the emulator not on github, so you can do with it what you want? 2. I think it exists in 2 flavours, C and javascript. Also, the Web version of it could also "easily" be wrapped into a electron application I think. Code is here: https://github.com/commanderx16/x16-emulator Of course read the license agreement and stuff. The people making the emulator have put quite some time into it I can imagine, I am not sure if they want it branched of into other projects, or if they are cool with that, I think there are some commodore IP's involved there as well for the roms. /CKs
  7. Not sure if it helps. But one other speed optimization, that I've been thinking of is slashing the resolution in the computation phase. So, lets say, we do a 640x480 picture, and divide it in 8x8 pixels "blocks". But instead we scratch that, half the resolution to 320x200, and compare with "pretend" 4x4 pixels blocks. (scale down the font) Then when done, we still have the same (ish) result, but the calculation time is slashed to 1/4th or so. I think it may work, the reason is the actual pixel perfect compare is maybe not needed since the end result will never be a perfect match. (unless for some special cases). Anyway, interesting little project, I keep following it, to see where it leads
  8. Wow really cool. Did I understand you try all combination of pixels to all combinations of characters, or do you do this per 8x8 square? The 8x8 square method is what I do, it's not as sophisticated as yours. Your 2petscii images look really close to the original. I needed to click on it and check it twice, to see it was petscii, and not a bitmap. . I did not do 256 color ones yet, but in your results I see the improvements, they are significant. Really fun seeing. I'll test your program when I have some time, I like to see how it runs on my laptop. To optimise, for me a really fun experiment would be to go all out, and do like this. Use the GFX card to do the "mass parallel threading", like with Cuda or so. This is how they speed up deep learning for example. Maybe some day Great work so far
  9. Hi guys, thanks for the input so far. This is perfect, I am working on including it in my game now, (converted to c). Thanks CKs
  10. Wow. I missed that. Thanks for the tip, that super simplifies the whole thing!! So if I scroll to the "end", it will start showing the beginning, like this (imagine a screen of 6x4 characters :)) ? w w w w w w ----------------- <- scollpointer <- screen top x x x x x x y y y y y y z z z z z z a a a a a a <------- after "zzzzzz" the screen starts showing "aaaaaa", since "aaaaaa" is at the beginning of vmem ---------------- <------ screen end I see one problem though, the whole of vmem would be dedicated to the scrolling area, what if you have two layers, sprites, and so on, they also live in vmem, so they would be overwritten, if I use up all memory as a scroll buffer. Or is that not so?
  11. Hi guys, I am working on a small problem: smooth scrolling. Scrolling the vera layers is really smooth and easy (VERA_L0_VSCROLL_L), but you cannot scroll forever, since you will run out of vera memory at some point to display. So I like to scroll 8 pixels, in text mode, and then scroll the whole text buffer up one char, and reset the VERA_L0_VSCROLL_L register, and fill the bottom screen text line with new data (using a pseudo random generator) I have all of that working, and now it is up to optimizations to avoid screen flicker. Flicker seemed to start somewhere to 1/5th of the bottom of the screen. After optimizing, it's from 1/4th of the top of the screen. I start scrolling on vsync. So I managed to improve speed about 120 scan lines or so. But there is more to be done. The flicker is not gone, it just got reduced. So the core issue is this. The moving of the screen data around is relatively slow. And I won't be able to do it in just a few scanlines, it needs at least a 100 scanlines or so, and those scanlines flicker, when I do it when the scanline is being drawn while I update . Solutions I see: 1. Double buffering. Done this before, Blitzbasic and so on, but feels somehow like cheating on a 6502 retro machine. 2. Split up the operations of moving data around. When the rasterline is in the top half of the screen, scroll the lower screen part, and visa versa. 3. Just scroll more pixels by hardware, so the moving of the data, happens less often, it flickers only now and then a little. I was thinking, I am sure not the first to encounter the issue, what is your opinions on best solution? Thanks /CK
  12. Hi! More or less this is why I went to KickC, since (maturity aside), it has build in functions for enabling interrupts. SEI() and CLI(). It's like a minimal super super minimal "framework" to get it done. Anyway when I am more or less happy with my code working in both world (ASM and C) without the inexplicable behaviour, a framework sounds like a cool project. But yeah, first it needs to work properly Sorry for the spam, thanks for the feedback so far guys, I do appreciate it. ps. Now I think of it, I don't see a "libraries and frameworks" section under downloads, so not sure where to post it, if I'd ever get around to doing something like that.
  13. Ok, that is cool, that was my aim from the start. The weird thing here is that, the is change in the non-interupt part. The main code behaviour seems modified by the interrupt. Or the change is the main code breaks the interrupt. So it's the combination of the two that does not go too well. Anyways..... more investigations seem to be needed... kickc seems to have build in debugger, that can talk to the emulator, or such I understood. Maybe I give that a spin, but I'm not sure how that would look, with interupts twirling about.
  14. I hear your argument for 100% assembly and maybe I will eventually be convinced. But for me now it is either "use c and make cool stuff on the x16", or "do assembly and need plenty of time, and end up not coding for the x16" Anyway, we'll see where it ends... To start out it is KickC. I did not really get a liking for cc65 too much. Maybe a question of taste, but if a simple thing like "Don't start the program in lowercase", had to be dealt with as a workaround, I felt that was an bad indicator for me. For the complete assembly code, I'll be thank full to know what you think, if you want to comment, so I publish it below. Maybe I learn something Anyway, I added many comments, but most code is generated by kickc. My after kickc did it's "thing" comments start with "/////".
  15. Maybe, but how would it explain, that the key-counter works fine on first key-press, and then stops working. And works fine when it is ensured that the keycounter is in a volatile variable?
  16. Thanks. I think it was auto generated code. So I added the jump, and it looks like this on the generated assembly now. But no change. It works fine, when I have the variables as volatile (store them in memory instead of loaded in registers), but when I remove the volatile keyword, it stops working. Or a more exact description is, main loop indicator and the keyboard loop indicator on the screen stop cycling, but the behavior is erratic, when I print a number on the screen in the main loop, suddenly there is no issues in the main loop anymore.
  17. It took me a bit of time to find a free timeslot to look at, but I managed to "sort of" make it work, Thanks to SlithyMatt excelent videos, and Elektron72 Below is my code. So what works is that I have two interupts, VSYNC and LINE. Line I like to have so I can figure out where on the screen I am, and when I want to scroll. VSYNC, I like to have for timing. The code below does 3 things. -Update left top character 1, each time you press space. -Updater left to character 2, each time the main loop detects the line interrupt is executed -Updater left to character 3, each time the main loop loops It works. Sort of. It only works, if I make my variables "volatile" inside the main loop. This to me indicates that there is something ongoing with the registers each time the interrupt runs, that breaks the code in the main loop. I have tried with only VSYNC interrupt and there is no issue then. From SlithyMatts code examples, I took as and example the code { ply plx pla rti } To end the line interrupt nicely. Some how it not working. Any ideas? And the interupt code in assembly.
  18. Version 0.8

    38 downloads

    Simon Snake has fallen down a hole, you must rescue him, by avoiding obstacles on his way down. Controls: Cursor Keys, for left and right. Space to start or continue the game. Falling snake was a game that I wrote on the C64 in Basic, but now converted to KickC, because I want to add more features to it, and was running on the limits of what I wanted to squeeze into Basic. All graphics, except player sprite are Petscii. "Cut Scenes", are in "Lores Double Petscii". The Basic version you can also find below as a tutorial "How to create a simple game in basic on the X16" This time the game is written in Kickc, allowing more features to be added. Current status: 90% of all Basic features have been converted to C. Extra features have been added that were easier to add in C, like "cut scenes". Sound and more game play elements are to be added still. Video below. (music added in post production)
  19. Falling Snake (C) View File Simon Snake has fallen down a hole, you must rescue him, by avoiding obstacles on his way down. Controls: Cursor Keys, for left and right. Space to start or continue the game. Falling snake was a game that I wrote on the C64 in Basic, but now converted to KickC, because I want to add more features to it, and was running on the limits of what I wanted to squeeze into Basic. All graphics, except player sprite are Petscii. "Cut Scenes", are in "Lores Double Petscii". The Basic version you can also find below as a tutorial "How to create a simple game in basic on the X16" This time the game is written in Kickc, allowing more features to be added. Current status: 90% of all Basic features have been converted to C. Extra features have been added that were easier to add in C, like "cut scenes". Sound and more game play elements are to be added still. Video below. (music added in post production) Submitter CursorKeys Submitted 05/22/21 Category Games  
    Really nice. My favorite demo on the X16 right now! I have a silly question. You mentioned: - It uses the original data (but its split into 8kb blocks, so it can fit into banked ram) I am wondering, did you consider pushing the whole data in Vera Ram, there is 2 MB of it, and you could "stream" from there with the Vera pointer being auto updated after each read. And what was the reason to not go for that?
  20. Thanks for pointing me in the right direction. But how do you check the cause of the interupt? Is it in the acumulator, or how else is it passed to the interupt routine? (I haven't done interupts in much detail before)
  21. Hi! I have been playing with interupts a little, in kickc, and it all works nice. But now I tried to incooperate it in a game I hit a snag. It seems when I setup an interupt, for scanline, my keyboard functions stop working. I am probably doing something really basic wrong. The weird thing is also, when I restore the interupt to it's previous state, the keyboard is still not working. ps. the keyboard routing I am using is kickc "kbhit", which seems to call kernal routine "GETIN" at $FFE4, I also tried directly calling kernal routines, which works fine, but not when my interupt is enabled. ps2. I enable the interupt, something like this. What I am asking is. How does the keyboard normally work? 1- Is there an interupt when a key is pressed? Why does that interup stop working when I set my scanline interupt. How are they related? Do I need to do some extra "magic" at the end of my scanline interupt, to keep the key handling interupt working? 2- Can you somehow check the keyboard in a loop, without interupt, by polling a memory address or maybe a vram address, and if so which one? Also anyone could point me to the correct sections in the documentation, I will be thankfull! The most accurate I have found an answer is the section in the manual called "'Custom keyboard scan code handler". But I somehow don't get the full picture. Thanks CC
  22. Thanks! I've been looking with my eyes closed it seems, the answer is so obvious when you see it
  23. I think you are right, you can have 1 layer in 256 colors. But in my demos both layers where 16 colors. (or at least I only used 16 colors in both layers, with standard c64 palette)
  24. A few more words about converting bitmaps to (double) PETSCII. Alot of effort goes into finding the right settings, for just that picture. Alot of bitmaps, don't work very well, while some work very well. It has to do with 4 things. 1. Mapping bitmap colors to 16 color palette. Sometimes you need to tweek the contrast, and sometimes the saturation, and sometimes a magic combo works. But sometimes it just won't work, and some preprocessing will do the trick. Low contrast pictures are harder then hi contrast pictures. 2. Dithering can make a picture look better, but dithering can be done in several ways. Best it seems when 1 part of the picture has dither and another part does not. The mrTuth demo uses no dithering. (It was really on the flip of a coin which of the two pictures I liked best, with or without dither) 3. Finding the best matching characters, to each 8x8 bitmap subarea area. This is a bit like "magic", since there are multiple possible solutions, and which is the best one? My algoritm just takes one solution for a single layer. Then another algoritm for the second (double petscii) layer, to see if it can improve on the original solution. I have a better algoritm in mind, but not yet implemented. 4. Hires vs Lores. A hires double petscii resolution is easier as a target for a bitmap picture. Since even if the conversion is not perfect, the resolution makes somewhat up for it. So whatever tools you develop, you probably need a whole bunch of settings as input, or alternatively implement some AI, to find the best settings for you Ok, more about this later, when I make the tool publicly available. -CC
×
×
  • Create New...

Important Information

Please review our Terms of Use