News: 11 March 2016 - Forum Rules

Author Topic: Writing to another bank  (Read 519 times)

HotCoffee

  • Jr. Member
  • **
  • Posts: 7
  • hi
    • View Profile
Writing to another bank
« on: August 29, 2021, 01:52:38 pm »
I have this Data Bytes in "bank 1":

Code: [Select]

Background:
  .db $00,$00,$00,$00,$00,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25 
  .db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$00,$00,$00,$00,$00

  .db $00,$00,$00,$00,$00,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25 
  .db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$00,$00,$00,$00,$00

  .db $00,$00,$00,$00,$00,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25 
  .db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$00,$00,$00,$00,$00

  .db $00,$00,$00,$00,$00,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25 
  .db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$00,$00,$00,$00,$00
 
  .db $00,$00,$00,$00,$00,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25 
  .db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$00,$00,$00,$00,$00

I read these bytes and write them in the PPU's background every frame.
However when I try to change them trough code nothing happens

I wrote this code at bank 0 to do it but it does not work.
Code: [Select]

ReadB:
  LDA $4016       
  AND #$01
  BEQ ReadBDone   
  LDA #$02
  STA Background
ReadBDone: 
     

I tried using a debugger to see what was going on and found out that once it gets to " STA Background " it simply does nothing.


Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 719
  • I am the baldest romhacker
    • View Profile
Re: Writing to another bank
« Reply #1 on: August 29, 2021, 03:16:41 pm »
Your "background" variable is located somewhere between 8000-FFFF. Basically nothing happens when you write there, unless it's a mapper register. You can't overwrite PRG.