Cyprian Posted February 18, 2020 Share Posted February 18, 2020 nice routine faster would be unroling the LDA/STA code Quote Link to comment Share on other sites More sharing options...
Nop90 Posted February 18, 2020 Author Share Posted February 18, 2020 39 minutes ago, Cyprian_K said: nice routine faster would be unroling the LDA/STA code Don't think. But try if you want and let me know if you can make it faster. Quote Link to comment Share on other sites More sharing options...
enthusi Posted February 18, 2020 Share Posted February 18, 2020 (edited) I used a different approach which I think is as fast as it gets. For each color the code is: &label1=*+1 lda #00 sta $fda0 &label2=*+1 lda #00 sta $fdb0 ... Then in the same rasterline after setting up the colors, the values for the next line are set via selfmod-code: lda luchs_pal+0*102,y sta label1 lda luchs_pal+1*102,y sta label2 ... Y is the current line and simply increased (as I dont even use HBL but you could take the current line from the register as well). The data is interleaved such that this works out nicely (you can easily have scrolling images as well as I uploaded once somewhere here). So there is no need to add 32 or anything each line. Edit: with this interleave you can store the colors from the table directly lda table,y sta $fda0 ... but lda $1234,Y is slower than lda $1234. This routine was maxed out for speed. Edited February 18, 2020 by enthusi 1 Quote Link to comment Share on other sites More sharing options...
laoo Posted February 18, 2020 Share Posted February 18, 2020 (edited) 13 hours ago, Nop90 said: I don't know how may cycles last the scanline According to my experiments and measurements in 60 Hz display there are 449 CPU cycles in scanline. EDIT: Correction - 453 cycles. Edited February 19, 2020 by laoo Quote Link to comment Share on other sites More sharing options...
+karri Posted February 18, 2020 Share Posted February 18, 2020 This technique could be great for splitting screen stuff. Perhaps like Fire and ice! Run header and footer as hi-colour. Keep the middle as normal 16 colour area. Quote Link to comment Share on other sites More sharing options...
laoo Posted February 18, 2020 Share Posted February 18, 2020 It could be tricky to run Suzy only after processing header and before processing footer. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 18, 2020 Share Posted February 18, 2020 51 minutes ago, laoo said: It could be tricky to run Suzy only after processing header and before processing footer. Why would I need Suzy? The middle area pixels are already in the display page. Suzy would be busy processing the next frame and accessing the draw page. Did I miss something? Quote Link to comment Share on other sites More sharing options...
laoo Posted February 18, 2020 Share Posted February 18, 2020 17 minutes ago, karri said: Suzy would be busy processing the next frame and accessing the draw page. Obviously we can't utilize Suzy and alter color registers at the same time. For simpler approach we could use HBL that would do something useful only in header and footer and Mikey is fast enough to burn some cycles in empty HBL handler without much harm. Although I was thinking about something akin enthusi's idea without using HBL and we need a way either to wake up CPU only before drawing header and footer or to use Suzy only when CPU isn't busy - and I was referring to this approach, but I think now it is not practical as we could always use other timer with some lower resolution if we don't want to use HBL. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 19, 2020 Share Posted February 19, 2020 How is the moving text on top of hi-colour backdrop created? Without Suzy? Quote Link to comment Share on other sites More sharing options...
42bs Posted February 19, 2020 Share Posted February 19, 2020 11 hours ago, laoo said: It could be tricky to run Suzy only after processing header and before processing footer. Why? Suzy is drawing the new frame. Only remember to restart Suzy after HBL did interrupt her. Quote Link to comment Share on other sites More sharing options...
laoo Posted February 19, 2020 Share Posted February 19, 2020 1 hour ago, 42bs said: Why? Suzy is drawing the new frame. Only remember to restart Suzy after HBL did interrupt her. As I said the whole thing is trivial when using HBL. I was just thinking about the method without any interrupts but as it's good for whole frame still images, it's essentially useless when Suzy is involved. Quote Link to comment Share on other sites More sharing options...
42bs Posted February 19, 2020 Share Posted February 19, 2020 (edited) 7 minutes ago, laoo said: As I said the whole thing is trivial when using HBL. I was just thinking about the method without any interrupts but as it's good for whole frame still images, it's essentially useless when Suzy is involved. If you want only a parts of the screen (upper/lower) with high-color mode w/o HBL interrupt: WAIT_FOR_VBL SWITCH_BUF FOR TOP_HEIGHT DO WAIT_FOR_HBL CHANGE_COLOR DONE Draw next frame WAIT_FOR_LOWER_BOUNDERY FOR LOW_HEIGHT DO WAIT_FOR_HBL CHANGE_COLOR DONE Edited February 19, 2020 by 42bs 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted February 19, 2020 Share Posted February 19, 2020 Having a static palette that changes midway could be a cool effect when moving from one leve to the next. During the move you would have up to 32 colours on the screen. Quote Link to comment Share on other sites More sharing options...
42bs Posted February 19, 2020 Share Posted February 19, 2020 9 minutes ago, karri said: Having a static palette that changes midway could be a cool effect when moving from one leve to the next. During the move you would have up to 32 colours on the screen. Vertical move should be easy. Horizontal will be tricky and not that exact. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 19, 2020 Share Posted February 19, 2020 I really have to try my artistic skills to see what I could get out of this effect. If time permits I could still have a go on the rebel storyline in On Duty. I just got some extra RAM to use 1 Quote Link to comment Share on other sites More sharing options...
solo/ng Posted February 24, 2020 Share Posted February 24, 2020 On 2/19/2020 at 10:20 AM, 42bs said: If you want only a parts of the screen (upper/lower) with high-color mode w/o HBL interrupt: WAIT_FOR_VBL SWITCH_BUF FOR TOP_HEIGHT DO WAIT_FOR_HBL CHANGE_COLOR DONE Draw next frame WAIT_FOR_LOWER_BOUNDERY FOR LOW_HEIGHT DO WAIT_FOR_HBL CHANGE_COLOR DONE and how the whole game/logic/draw sprites/etc is incorporated here? I dont get it (unless its for a static image) Quote Link to comment Share on other sites More sharing options...
42bs Posted February 25, 2020 Share Posted February 25, 2020 6 hours ago, solo/ng said: and how the whole game/logic/draw sprites/etc is incorporated here? I dont get it (unless its for a static image) In "Draw next frame" But I noticed (see cpu cycle thread) that "WAIT_FOR_HBL" w/o interrupts is tricky. 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.