ArcadeAction Posted April 30, 2017 Share Posted April 30, 2017 (edited) Hello, Now that I have a concrete idea for a relatively small game that I would like to play on the 7800 (way too early to reveal,I'd hate to end up on Trebor's Atari 7800 Homebrews and Hacks Thread "dormant" list ), I've picked up 7800 programming again. To see if I can wrap my head against MARIA's indirect character mode, I'm trying to hack Dan Boris' sprite demo code into a tiled mode demo (without sprites). The 7800 programmer's guide says this (I've checked two versions): The CTRL register is arranged as follows:CK | DM1 | DM0 | CW | BC | KM | RM1 | RM0...CW - Character Width.0 => Two (2) byte characters.1 => Single byte characters.... When I setup the CTRL register with CW=1 (Single byte character): lda #%01010011 sta CTRL I get the (unexpected) output as attached (7800_cw_1.png) While when I set it CW=0 (Two (2) byte characters), I get the output that I hoped to see, three smileys next to each other (7800_cw_0.png). But don't understand why CW=0 works, I had expected CW=1 to produce the right result. This is how I setup CHARBASE lda #$a0 sta CHARBASE Here's the relevant DL entry (xpos is contant with 0 value): ;Create DL entry for background ldy dlend,x ;Get the index to the end of this DL lda #$00 sta (dlpnt),y ;Low byte of data address iny lda #%01100000 ;Mode 320x1 sta (dlpnt),y iny lda #$b0 sta (dlpnt),y iny lda #%00011101 ;Palette 0, 1 byte wide sta (dlpnt),y iny lda xpos ;Horizontal position sta (dlpnt),y sty dlend,x And this is the graphic data and the tile data: ;************** Graphic Data ***************************** org $a000 .byte %00111100 org $a100 .byte %00111100 org $a200 .byte %01000010 org $a300 .byte %01000010 org $a400 .byte %10011001 org $a500 .byte %10011001 org $a600 .byte %10100101 org $a700 .byte %10100101 org $a800 .byte %10000001 org $a900 .byte %10000001 org $aA00 .byte %10100101 org $aB00 .byte %10100101 org $aC00 .byte %01000010 org $aD00 .byte %01000010 org $aE00 .byte %00111100 org $aF00 .byte %00111100 ;************** Character map ***************************** org $b000 .byte $0,$0,$0 Can somebody explain why two tiles are updated, while I tell the Maria chip that one character takes up 1 byte? I have added my modified script, but it's an experiment and messy, as I left a lot of the original code of Dan Boris' sprite code in it.That's fully my fault, do not blame Dan for this Thanks in advance for any help! background_test.asm atari7800.asm Edited April 30, 2017 by ArcadeAction Quote Link to comment Share on other sites More sharing options...
Mord Posted April 30, 2017 Share Posted April 30, 2017 I remember there's some sources with typos compared to the original gcc maria docs. I think this is one of them. In the attached doc it states the opposite of some other maria.txt files I have for the CTRL register's character width. gcc1702b_maria_specs.pdf Quote Link to comment Share on other sites More sharing options...
RevEng Posted April 30, 2017 Share Posted April 30, 2017 Mord is correct, 0=single width, 1=double width. The wiki version of the guide had this error too, but I've corrected it now. Quote Link to comment Share on other sites More sharing options...
ArcadeAction Posted April 30, 2017 Author Share Posted April 30, 2017 Great, thank you. I concluded the same after some more testing on my part (with a map with more characters) 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.