jbs30000 Posted May 4, 2017 Share Posted May 4, 2017 To make a long story short, nothing I do seems to work when trying to write code to display pixels. DASM creates a list file that looks fine, but the bin files doesn't work (Stella displays a black screen & alt-L shows 0 scanlines). To simplify things I created a program that clears all of the RAM, and then writes a pattern of %10101010 to the PF0, PF1, and PF2 registers. DASM creates a good list file but the bin is 0 bytes. At this point I'm frustrated both because I tried a lot of different fixes, and I KNOW the problem is a very small and simple one that I'm overlooking. So please, tell me what's wrong with this test program, so I can use the knowledge to fix my actual program. Thanks. P.S. I got so paranoid I took out all of the comments seeing if that would help . It's pretty simple so you shouldn't need them, but of course I'll answer any questions if something isn't clear. processor 6502 include ".\includes\vcs.h" include ".\includes\macro.h" SEG Code ORG $F000 ldx #FF lda #0 Clear STA 0,X DEX BNE Clear LDX #$EE STX COLUPF Frame_Loop LDA #0 STA VBLANK LDA #2 STA VSYNC STA WSYNC STA WSYNC STA WSYNC LDA #0 STA VSYNC ldx #37 VB_Loop STA WSYNC DEX BNE VB_Loop LDX #0 DrawLoop LDA #%10101010 STA PF0 STA PF1 STA PF2 STA WSYNC INX CPX #192 BNE DrawLoop Overscan LDA #%01000010 STA VBLANK LDX #30 Overscan_Loop STA WSYNC DEX BNE Overscan_Loop JMP Frame_Loop Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted May 4, 2017 Share Posted May 4, 2017 (edited) That LDX #FF should probably be LDX #$FF. EDIT: Okay there's something more... let me take a look. Edited May 4, 2017 by splendidnut Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted May 4, 2017 Share Posted May 4, 2017 Where is your reset vector? 1 Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted May 4, 2017 Share Posted May 4, 2017 processor 6502 include ".\vcs.h" include ".\macro.h" SEG Code ORG $F000 RORG $F000 Reset ldx #$FF lda #0 Clear STA 0,X DEX BNE Clear LDX #$EE STX COLUPF Frame_Loop LDA #2 STA VSYNC STA WSYNC STA WSYNC STA WSYNC LDA #0 STA VSYNC LDA #0 STA VBLANK ldx #37 VB_Loop STA WSYNC DEX BNE VB_Loop LDX #0 DrawLoop LDA #%10101010 STA PF0 STA PF1 STA PF2 STA WSYNC INX CPX #192 BNE DrawLoop Overscan LDA #%01000010 STA VBLANK LDX #30 Overscan_Loop STA WSYNC DEX BNE Overscan_Loop JMP Frame_Loop ORG $FFFC RORG $FFFC .word $F000 .word $F000 I fixed up the ORG/RORG statements and the RESET/BRK vectors at the end. NOTE: I had to change your includes to match where my files were located. Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted May 4, 2017 Share Posted May 4, 2017 Also... to compile I used the following command: dasm program.asm -f3 -v5 -oprogram.bin -f3 should always be used... -v5 to give for more info about assembly issues Quote Link to comment Share on other sites More sharing options...
jbs30000 Posted May 5, 2017 Author Share Posted May 5, 2017 Reset/Brk vectors - Oops, I forgot that bit of code. Thanks for reminding me. Compiling: I'm actually using 2 IDEs. For jEdit I have dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin For Crimson Editor I have the arguments: "$(FilePath)" -f3 -o"$(FileTitle).bin" -l"$(FileTitle).lst" -s"$(FileTitle).sym" Quote Link to comment Share on other sites More sharing options...
jbs30000 Posted May 5, 2017 Author Share Posted May 5, 2017 I'm embarrassed to say, I forgot the reset vector in my original program too. So I put it in....and I have an image! I knew it was something simple that I goofed up on. Thank you very much guys. I really appreciate it. 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.