It is currently Tue Nov 20, 2018 8:49 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Nov 01, 2018 4:47 am 
Offline

Joined: Sat Oct 27, 2018 12:29 pm
Posts: 3
Hello everybody,

Iam new in NES programming, but already in love with it.

Here is my problem :

I have a very basic .asm to display a background color, I did it following the tutorials online.

When I build my .asm on Windows using nesasm and playing it on nestopia it is working !

But I build the exactly same .asm using nesasm on Mac and playing it with Nestopia or FCEUX and my screen is black, nothing happen.

Do I have to do something special ?

To be sure, I tried with the asm example for background :
Code:
  .inesprg 1   ; 1x 16KB PRG code
  .ineschr 1   ; 1x  8KB CHR data
  .inesmap 0   ; mapper 0 = NROM, no bank swapping
  .inesmir 1   ; background mirroring


;;;;;;;;;;;;;;;


  .bank 0
  .org $C000
RESET:
  SEI          ; disable IRQs
  CLD          ; disable decimal mode
  LDX #$40
  STX $4017    ; disable APU frame IRQ
  LDX #$FF
  TXS          ; Set up stack
  INX          ; now X = 0
  STX $2000    ; disable NMI
  STX $2001    ; disable rendering
  STX $4010    ; disable DMC IRQs

vblankwait1:       ; First wait for vblank to make sure PPU is ready
  BIT $2002
  BPL vblankwait1

clrmem:
  LDA #$00
  STA $0000, x
  STA $0100, x
  STA $0200, x
  STA $0400, x
  STA $0500, x
  STA $0600, x
  STA $0700, x
  LDA #$FE
  STA $0300, x
  INX
  BNE clrmem

vblankwait2:      ; Second wait for vblank, PPU is ready after this
  BIT $2002
  BPL vblankwait2


  LDA #%10000000   ;intensify blues
  STA $2001

Forever:
  JMP Forever     ;jump back to Forever, infinite loop



NMI:
  RTI

;;;;;;;;;;;;;;



  .bank 1
  .org $FFFA     ;first of the three vectors starts here
  .dw NMI        ;when an NMI happens (once per frame if enabled) the
                   ;processor will jump to the label NMI:
  .dw RESET      ;when the processor first turns on or is reset, it will jump
                   ;to the label RESET:
  .dw 0          ;external interrupt IRQ is not used in this tutorial


;;;;;;;;;;;;;; 


  .bank 2
  .org $0000
  .incbin "mario.chr"   ;includes 8KB graphics file from SMB1


I followed a tutorial made on Mac !

Thank you in advance.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2018 7:18 am 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10978
Location: Rio de Janeiro - Brazil
Well, this program "intensifies blues" but never sets the background color in the first place. The background color is supposedly random on power on, and if by any chance the emulator selects black, you're not gonna see anything.

Try writing a different background color to the palette before intensifying the blues to see if anything changes.


Top
 Profile  
 
PostPosted: Thu Nov 01, 2018 8:00 am 
Offline

Joined: Sat Oct 27, 2018 12:29 pm
Posts: 3
tokumaru wrote:
Well, this program "intensifies blues" but never sets the background color in the first place. The background color is supposedly random on power on, and if by any chance the emulator selects black, you're not gonna see anything.

Try writing a different background color to the palette before intensifying the blues to see if anything changes.


It works ! Thank you so much!


Top
 Profile  
 
PostPosted: Thu Nov 01, 2018 2:07 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3138
Location: Tampere, Finland
I think that's the first example program from Nerdy Nights. Indeed it doesn't work on real NES as intended, but I recall at least some version of FCEUX (erroneously) producing a blue screen when running it.

Another way to fix it is to also set the grayscale bit together with the "blue" bit. The grayscale bit will force a non-black intensity.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Fri Nov 02, 2018 10:31 am 
Offline

Joined: Sat Oct 27, 2018 12:29 pm
Posts: 3
thefox wrote:
I think that's the first example program from Nerdy Nights. Indeed it doesn't work on real NES as intended, but I recall at least some version of FCEUX (erroneously) producing a blue screen when running it.

Another way to fix it is to also set the grayscale bit together with the "blue" bit. The grayscale bit will force a non-black intensity.


Yes @thefox, its come from the tutorial.

Thank you for the details!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group