Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2003, 16:09
Avatar de Instru
Instru
 
Fecha de Ingreso: noviembre-2002
Ubicación: Mexico
Mensajes: 2.751
Antigüedad: 21 años, 6 meses
Puntos: 52
Extraer sonidos.

Nesesito extraer sonidos de una Rom gb pero nesesito ayuda.
aqui estan unos datos para hacerlo.
Solo quiero que me den ejemplos de codigo en C o simplemente instrucciones de como hacerlo.


HEADER FIELDS

Offset Size Description
====== ==== ==========================
00 3 Identifier string ("GBS")
03 1 Version (1)
04 1 Number of songs (1-255)
05 1 First song (usually 1)
06 2 Load address ($400-$7fff)
08 2 Init address ($400-$7fff)
0a 2 Play address ($400-$7fff)
0c 2 Stack pointer
0e 1 Timer modulo (see TIMING)
0f 1 Timer control (see TIMING)
10 32 Title string
30 32 Author string
50 32 Copyright string
70 nnnn Code and Data (see RST VECTORS)



RST VECTORS

The GameBoy CPU has 8 1-byte instructions that call fixed addresses:

RST 00 = CALL $0000 RST 20 = CALL $0020
RST 08 = CALL $0008 RST 28 = CALL $0028
RST 10 = CALL $0010 RST 30 = CALL $0030
RST 18 = CALL $0018 RST 38 = CALL $0038




Register Name Description
======== ==== =============
FF05 TIMA Timer Counter
FF06 TMA Timer Modulo
FF07 TAC Timer Control




TAC Field Bits:

Bit 1 & 0, counter rate
00: 4096 Hz
01: 262144 Hz
10: 65536 Hz
11: 16384 Hz

Bit 2, interrupt type
0: Use v-blank
1: Use timer

Bit 6 - 3, reserved for expansion
Set them to 0

Bit 7, CPU clock rate
0: Use normal rate
1: Use 2x (fast) rate
ld hl,songs ; point to selection table

add a,l ; add accumulator to L
ld l,a

jr nc,$+1 ; increment H on overflow; if all table entries
inc h ; have same address MSB, you can eliminate this

ld a,(hl) ; read song number from table into accumulator

jp init ; jump to the init routine

songs: .db 3,1,5,4,2 ; selection sequence table





Esto es algo de informacion que consegui. solo nesesito un pequeño ejemplo para entender correctamente como utilizar esta informacion.

Saludos

"Viva C"