Cisano Posted July 14 Share Posted July 14 Hi. In Stella dev mode, if I use asl CXM0P or asl CXM1P the screen becomes a mess. If I use asl CXPPMM everything works fine. Is there a reson for that? Can I use asl or another instruction with these registers? Thanks Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted July 14 Share Posted July 14 You are modifying the TIA write registers at the same address! No good. Quote Link to comment Share on other sites More sharing options...
Cisano Posted July 14 Author Share Posted July 14 I cannot write them. I need only the Carry ... Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted July 14 Share Posted July 14 But you do write them. ASL is a RMW (read, modify, write) operation. And since the TIA read and write registers share the same addresses, you are producing unwanted writes to TIA. Quote Link to comment Share on other sites More sharing options...
Cisano Posted July 14 Author Share Posted July 14 17 minutes ago, Thomas Jentzsch said: But you do write them. ASL is a RMW (read, modify, write) operation. And since the TIA read and write registers share the same addresses, you are producing unwanted writes to TIA. ok thanks Quote Link to comment Share on other sites More sharing options...
glurk Posted July 15 Share Posted July 15 Use the BIT instruction instead! Then branch or whatever on flags. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted July 18 Share Posted July 18 Yeah, mirrored addressing plus TIA having Read-Only registers as well as Write-Only registers that share the same addresses at certain mirrors is confusing when you start coding for the 2600. The mirrored addressing is somewhat easy to understand since the same 128 bytes of RAM are used for both Zero Page RAM (anything with address $00xx) as well as the stack which is in Page 1 (anything with address $01xx). These topics might help with the mirrored addressing: Mirrored memory Old Timer - New to 2600 Programming The memory map referenced in the first topic is no longer online, you can find it here via the Wayback Machine. By default the VCS.H file sets the read-only registers and the write-only registers to both start at address 0 for your code: Which means your code will use the same mirror addresses for these registers: CXM0P (read-only) and VSYNC (write-only) are both at $0000 CXM1P (read-only) and VBLANK (write-only) are both at $0001 CXPPMM (read-only) and COLUP1 (write-only) are both at $0007 So doing an ASL CXM0P will read CXM0P but write to VYSNC and ASL CXM1P will read CXM1P and write to VBLANK, which both affect video output. ASL CXPPMM will read CXPPM but write to COLUP1, so that modifies the color of PLAYER1 and MISSILE1. You might have been be updating COLUP1 later in the code, which would have hid the color change. 3 Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted July 20 Share Posted July 20 On 7/14/2024 at 12:33 PM, Cisano said: Can I use asl or another instruction with these registers? Yes. There are some ranges that can be used because the write register is undefined. Example: ASL CXM1P | $30 ; Read CXM1P, Write Undefined -------------------------------------------- $0000 - $003F = TIA.......(write)......(read) -------------------------------------------- $0000 = TIA Address $00 - (VSYNC)......(CXM0P) $0001 = TIA Address $01 - (VBLANK).....(CXM1P) $0002 = TIA Address $02 - (WSYNC)......(CXP0FB) $0003 = TIA Address $03 - (RSYNC)......(CXP1FB) $0004 = TIA Address $04 - (NUSIZ0).....(CXM0FB) $0005 = TIA Address $05 - (NUSIZ1).....(CXM1FB) $0006 = TIA Address $06 - (COLUP0).....(CXBLPF) $0007 = TIA Address $07 - (COLUP1).....(CXPPMM) $0008 = TIA Address $08 - (COLUPF).....(INPT0) $0009 = TIA Address $09 - (COLUBK).....(INPT1) $000A = TIA Address $0A - (CTRLPF).....(INPT2) $000B = TIA Address $0B - (REFP0)......(INPT3) $000C = TIA Address $0C - (REFP1)......(INPT4) $000D = TIA Address $0D - (PF0)........(INPT5) $000E = TIA Address $0E - (PF1)........(UNDEFINED) $000F = TIA Address $0F - (PF2)........(UNDEFINED) $0010 = TIA Address $10 - (RESP0)......(CXM0P) $0011 = TIA Address $11 - (RESP1)......(CXM1P) $0012 = TIA Address $12 - (RESM0)......(CXP0FB) $0013 = TIA Address $13 - (RESM1)......(CXP1FB) $0014 = TIA Address $14 - (RESBL)......(CXM0FB) $0015 = TIA Address $15 - (AUDC0)......(CXM1FB) $0016 = TIA Address $16 - (AUDC1)......(CXBLPF) $0017 = TIA Address $17 - (AUDF0)......(CXPPMM) $0018 = TIA Address $18 - (AUDF1)......(INPT0) $0019 = TIA Address $19 - (AUDV0)......(INPT1) $001A = TIA Address $1A - (AUDV1)......(INPT2) $001B = TIA Address $1B - (GRP0).......(INPT3) $001C = TIA Address $1C - (GRP1).......(INPT4) $001D = TIA Address $1D - (ENAM0)......(INPT5) $001E = TIA Address $1E - (ENAM1)......(UNDEFINED) $001F = TIA Address $1F - (ENABL)......(UNDEFINED) $0020 = TIA Address $20 - (HMP0).......(CXM0P) $0021 = TIA Address $21 - (HMP1).......(CXM1P) $0022 = TIA Address $22 - (HMM0).......(CXP0FB) $0023 = TIA Address $23 - (HMM1).......(CXP1FB) $0024 = TIA Address $24 - (HMBL).......(CXM0FB) $0025 = TIA Address $25 - (VDELP0).....(CXM1FB) $0026 = TIA Address $26 - (VDELP1).....(CXBLPF) $0027 = TIA Address $27 - (VDELBL).....(CXPPMM) $0028 = TIA Address $28 - (RESMP0).....(INPT0) $0029 = TIA Address $29 - (RESMP1).....(INPT1) $002A = TIA Address $2A - (HMOVE)......(INPT2) $002B = TIA Address $2B - (HMCLR)......(INPT3) $002C = TIA Address $2C - (CXCLR)......(INPT4) $002D = TIA Address $2D - (UNDEFINED)..(INPT5) $002E = TIA Address $2E - (UNDEFINED)..(UNDEFINED) $002F = TIA Address $2F - (UNDEFINED)..(UNDEFINED) $0030 = TIA Address $30 - (UNDEFINED)..(CXM0P) $0031 = TIA Address $31 - (UNDEFINED)..(CXM1P) $0032 = TIA Address $32 - (UNDEFINED)..(CXP0FB) $0033 = TIA Address $33 - (UNDEFINED)..(CXP1FB) $0034 = TIA Address $34 - (UNDEFINED)..(CXM0FB) $0035 = TIA Address $35 - (UNDEFINED)..(CXM1FB) $0036 = TIA Address $36 - (UNDEFINED)..(CXBLPF) $0037 = TIA Address $37 - (UNDEFINED)..(CXPPMM) $0038 = TIA Address $38 - (UNDEFINED)..(INPT0) $0039 = TIA Address $39 - (UNDEFINED)..(INPT1) $003A = TIA Address $3A - (UNDEFINED)..(INPT2) $003B = TIA Address $3B - (UNDEFINED)..(INPT3) $003C = TIA Address $3C - (UNDEFINED)..(INPT4) $003D = TIA Address $3D - (UNDEFINED)..(INPT5) $003E = TIA Address $3E - (UNDEFINED)..(UNDEFINED) $003F = TIA Address $3F - (UNDEFINED)..(UNDEFINED) 2 Quote Link to comment Share on other sites More sharing options...
glurk Posted July 20 Share Posted July 20 Just because you CAN doesn't mean you SHOULD. LOL!! I would just use BIT and not worry about unintended effects, FWIW. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted July 20 Share Posted July 20 46 minutes ago, glurk said: Just because you CAN doesn't mean you SHOULD. LOL!! I would just use BIT and not worry about unintended effects, FWIW. Usually a carry flag lasts longer than a negative flag. Therefore I have been using ASL too (e.g. with INPT4). 1 Quote Link to comment Share on other sites More sharing options...
Cisano Posted July 21 Author Share Posted July 21 22 hours ago, Omegamatrix said: Yes. There are some ranges that can be used because the write register is undefined. Example: ASL CXM1P | $30 ; Read CXM1P, Write Undefined That is cool! 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.