Karoshi MSX Community
05 de Julio de 2021, 01:14:55 pm *
Bienvenido(a), Visitante. Por favor, ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión
Noticias:
 
   Inicio   Ayuda Buscar Ingresar Registrarse  
Páginas: [1]
  Imprimir  
Autor Tema: Add a bit of MSX2 functionality to your MSX1 games  (Leído 3349 veces)
0 Usuarios y 1 Visitante están viendo este tema.
BiFiMSX
Karoshi Newbie
*
Mensajes: 23


« : 26 de Diciembre de 2005, 11:22:23 am »

Here a piece of code you can use to change palette when running your MSX1 game on an MSX2:
Código:
ld a,($2d) ; read MSX version
or a ; is it MSX1?
ret z ; then there's no need to use it anyway
ld a,(7) ; get first VDP write port
ld c,a
inc c ; prepare to write register data
di ; interrupts could screw things up
xor a ; from color 0
out (c),a
ld a,128+16 ; write R#16
out (c),a
ei
inc c ; prepare to write palette data
ld b,32 ; 16 color * 2 bytes for palette data
ld hl,palette
otir
ret
;
; the format of the palette is like $GRB
; and R, G and B must be between 0-7
; currently it's the default MSX2 palette
; but you set up your own in these dw's
;
palette: dw $000,$000,$611,$733,$117,$327,$151,$627
dw $171,$373,$661,$664,$411,$265,$555,$777
« Última modificación: 26 de Diciembre de 2005, 11:25:18 am por BiFiMSX » En línea

Páginas: [1]
  Imprimir  
 
Ir a:  

Impulsado por MySQL Impulsado por PHP Powered by SMF 1.1.21 | SMF © 2013, Simple Machines XHTML 1.0 válido! CSS válido!