Pantomchap Posted May 18, 2017 Share Posted May 18, 2017 I must know. I also would like to know if other parts of the 2600 will use more time if I interact with them. Thanks! Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 18, 2017 Share Posted May 18, 2017 NMOS 6502 Opcodes as an example, look at LDA and you'll find: LDA (LoaD Accumulator) Affects Flags: S Z MODE SYNTAX HEX LEN TIM Immediate LDA #$44 $A9 2 2 Zero Page LDA $44 $A5 2 3 Zero Page,X LDA $44,X $B5 2 4 Absolute LDA $4400 $AD 3 4 Absolute,X LDA $4400,X $BD 3 4+ Absolute,Y LDA $4400,Y $B9 3 4+ Indirect,X LDA ($44,X) $A1 2 6 Indirect,Y LDA ($44),Y $B1 2 5+ + add 1 cycle if page boundary crossed the TIM column is the cycles so LDA #0 takes 2 cycles while LDA $0 takes 3. The only thing that'll take more time is if you write to WSYNC (Wait for SYNC) such as STA WSYNC. That's used to halt the CPU until the end of the scanline so you can synchronize your code with the electron beam. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 18, 2017 Share Posted May 18, 2017 Stella's built in debugger is also handy while you're learning the cycles. The numbers in the blue oval are the cycle counts for each instruction: 1 Quote Link to comment Share on other sites More sharing options...
Pantomchap Posted May 18, 2017 Author Share Posted May 18, 2017 (edited) NMOS 6502 Opcodes as an example, look at LDA and you'll find: LDA (LoaD Accumulator) Affects Flags: S Z MODE SYNTAX HEX LEN TIM Immediate LDA #$44 $A9 2 2 Zero Page LDA $44 $A5 2 3 Zero Page,X LDA $44,X $B5 2 4 Absolute LDA $4400 $AD 3 4 Absolute,X LDA $4400,X $BD 3 4+ Absolute,Y LDA $4400,Y $B9 3 4+ Indirect,X LDA ($44,X) $A1 2 6 Indirect,Y LDA ($44),Y $B1 2 5+ + add 1 cycle if page boundary crossed the TIM column is the cycles so LDA #0 takes 2 cycles while LDA $0 takes 3. The only thing that'll take more time is if you write to WSYNC (Wait for SYNC) such as STA WSYNC. That's used to halt the CPU until the end of the scanline so you can synchronize your code with the electron beam. Thank you so much! This resource will be extremely helpful to me. Edited May 18, 2017 by Pantomchap Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted May 18, 2017 Share Posted May 18, 2017 Thank you so much! This resource will be extremely helpful to me. No problem. I've also written a tutorial that you may find useful. It covers writing a 2K game from scratch. 1 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.