Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hello,
I'm having trouble trying to create my first ROM+RAM rom :
I've specified the cartridge type and the ram size in the header, but, first, on my emulator memory window, I see all the bits of the RAM are set to 1 (RAM full of $FF) with no instruction for it, and, when I try to write a byte in it, it does nothing.
Do I miss something in my code ? Is there a specific method to read/write in cartridge RAM ?
Thanks.
I use WLA and Virtual Boy Advance by the way.
Here is my code :
;###################### En-Tete #####################################
.ROMDMG
.NAME "RAM"
.CARTRIDGETYPE 8
.COMPUTEGBCHECKSUM
.COMPUTEGBCOMPLEMENTCHECK
.LICENSEECODENEW "17"
.EMPTYFILL $00
.MEMORYMAP
SLOTSIZE $4000
DEFAULTSLOT 0
SLOT 0 $0000
SLOT 1 $4000
.ENDME
.RAMSIZE 2
.ROMBANKSIZE $4000
.ROMBANKS 2
.BANK 0 SLOT 0
.ORG $0100
nop
jp start
.ORG $0104
;Logo Nintendo, obligatoire
.db $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C
.db $00,$0D,$00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6
.db $DD,$DD,$D9,$99,$BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC
.db $99,$9F,$BB,$B9,$33,$3E
;##################################################################
;###################### Programme ###################################
.org $0150
start:
ld hl,$A000
ld a,$48
ld (hl),a
loop:
nop
jr loop
;##################################################################
With this code I'm trying to get the value $48 at the first adress of my RAM ($A000)
Offline
Thanks you, it works fine !
Do you know where I can find some information about the jump vectors ? My only sources are the pandocs and some web sites, but none of them give more information than :
--------------------------------------------------------------------------------
The following addresses are supposed to be used as jump vectors:
0000,0008,0010,0018,0020,0028,0030,0038 for RST commands
0040,0048,0050,0058,0060 for Interrupts
--------------------------------------------------------------------------------
Thanks
Offline
The first ones are used by RST opcodes. "RST 0x0008" is the same as "CALL 0x0008", but it's a byte long (call is 3 bytes long).
The other ones are the addresses where the CPU jumps after an interrupt (IF&IE&0x1F != 0) if IME is enabled.
Offline
OK, thanks
Offline