HispaMSX

Re: [hispamsx] Philips 8280

2009-05-27 20:16:29
Quizas te venga bien esto:



   Org     100h
CALSLT:    EQU    0001CH        ;Inter slot call
EXBRSA:    EQU    0FAF0H        ;Slot address of BIOS (main) ROM
EXPTBL:    EQU    0FCC1H        ;Slot address of extended ROM
CHGMOD: EQU     0005FH
CHGET:  EQU     0009FH        ;SALIDA:   A=Tecla pulsada
BEEP:    EQU    000C0H

;    call    _ABRIR
;    call    _INI

   LD    A,8
       LD      (MODE),A
   CALL    CHGRP        ;Screen 8

   jp    digiup

jp fin
   CALL    _LEERCAB

   ld    iy,0
   LD    BC,212         ;Lee n§ de lineas
FRAM:
   PUSH    BC

   LD    IX,Imagen
   call    _LEER        ;Lee un frame

   CALL    WLINE
   LD    BC,100H        ;AVANCE VERTICAL EN VRAM
   ADD    IY,BC
   POP    BC
   DEC    C        ;AVANCE LINEA
   LD    A,0
   OR    C
   JP    NZ,FRAM        ;HASTA ULTIMO FRAME


   call    _transmite

CALL CHTEXT call _CERRAR
   LD    B,0
       LD      C,62H
       CALL    5

   ret


fIN:

;    CALL    BEEP
;    CALL    CHGET
;    CALL    BEEP


;    CALL    BEEP
;    CALL    CHGET
;    CALL    BEEP

   call    _digita


;    call    _delay
;    cALL    _IMPOSE_FULL
       CALL    _Digitize_View

       call    _Digitize_Set

;    CALL    BEEP
;    CALL    CHGET
;    CALL    BEEP


   call    _transmite
call _impose_off

;----------------------------------------------------------------------
;Modo Text
;----------------------------------------------------------------------
CALL CHTEXT
;----------------------------------------------------------------------
;Salir a Dos
;----------------------------------------------------------------------
TheEnd:
   LD    B,0
       LD      C,62H
       CALL    5

   ret
;----------------------------------------------------------------------
CHGRP:

   DI
   LD    A,(MODE)
   LD    IY,(EXPTBL - 1)
   LD    IX,CHGMOD
   CALL    CALSLT
   EI
   RET

;----------------------------------------------------------------------
CHTEXT:
   LD    A,0
   LD      (MODE),A
   CALL    CHGRP
   RET

;-----------------------------------------------------------------------------
;    RENDER DE UNA LINEA
;-----------------------------------------------------------------------------
WLINE:
   DI
   LD    C,99H

   PUSH    IY
   POP    HL

   LD    A,h
   AND    11000000B    ;2 BITS MAS ALTOS DE destino + 1 DE PAGINA

   RL    A
   RL    A
   RL    A

   OUT    (C),A        ; 00000,a16,a15,a14
   LD    A,10001110B    ;ESCRIBIR EN VDP R#14
   OUT    (C),A

   LD    A,l        ;8 BITS MAS ALTOS DE destino
   OUT    (C),A        ; a7,a6,a5,a4,a3,a2,a1
   LD    A,h
   AND    00111111B    ;6 bits MAS BAJOS DEL ALTO DE destino
   ADD     01000000B    ;COMANDO ESCRIBIR
   OUT    (C),A        ; 0,0 (read), a13,a12,a11,a10,a9,a8

   LD    C,98H
   LD    A,255
   LD    B,A

VPOK: LD A,(IX+0) ;LEE BYTE DEL BUFFER
   OUT    (C),A        ;PONE BYTE EN PANTALLA
   INC    IX        ;AVANZA BUFFER
   DEC    B        ;AVANZA COLUMNA
   LD    A,0
   OR    B
   JP    NZ,VPOK        ;HASTA ULTIMA COLUMNA
   inc    IX
   LD    A,(IX+0)    ;LEE BYTE DEL BUFFER
   OUT    (C),A        ;PONE BYTE EN PANTALLA
   EI
   RET

;----------------------------------------------------------------------



;----------------------------------------------------------------------
_INI: ld de,mini
   ld    c,09h
   call    05h
   ret

;----------------------------------------------------------------------
_FIN:
   ld    de,mfin
   ld    c,09h
   call    05h
   ret

;----------------------------------------------------------------------
_Leem:
   ld    de,mlee
   ld    c,09h
   call    05h
   ret

;----------------------------------------------------------------------
_Leei:
   ld    de,mlei
   ld    c,09h
   call    05h
   ret

;----------------------------------------------------------------------
_ABRIR:
   ld    c,43h
   ld    de,fiche
   ld    a,%00000001
   call    05h
   or    a
   jp    nz,_error
   ld    a,b
   ld    (Handle),a
   ret

;----------------------------------------------------------------------
_LEER:
   ld     a,(handle)
   ld    b,a
   ld    c,48h
   ld    de,buffer
   ld    hl,256
   call    05h
   or    a
   jp    nz,_error
   ret

;----------------------------------------------------------------------
_LEERcab:
   ld     a,(handle)
   ld    b,a
   ld    c,48h
   ld    de,buffer
   ld    hl,07h
   call    05h
   or    a
   jp    nz,_error
   ret

;----------------------------------------------------------------------
_CERRAR:
   ld    c,45h
   ld     a,(handle)
   ld    b,a
   or    a
   jp    nz,_error
   ret

;----------------------------------------------------------------------
_ERROR:
   ld    de,merror
   ld    c,09h
   call    05h
;    CALL    CHTEXT
   JP     FIN
   ret                ;Salir

;----------------------------------------------------------------------
_Transmite:
   DI
   LD    C,99H


   ld    hl,0

   LD    A,h
   AND    11000000B    ;2 BITS MAS ALTOS DE destino + 1 DE PAGINA

   RL    A
   RL    A
   RL    A

   OUT    (C),A        ; 00000,a16,a15,a14
   LD    A,10001110B    ;ESCRIBIR EN VDP R#14
   OUT    (C),A

   LD    A,l        ;8 BITS MAS ALTOS DE destino
   OUT    (C),A        ; a7,a6,a5,a4,a3,a2,a1
   LD    A,h
   AND    00111111B    ;6 bits MAS BAJOS DEL ALTO DE destino
;    ADD     00000000B    ;COMANDO LEER
   OUT    (C),A        ; 0,0 (read), a13,a12,a11,a10,a9,a8


;    ld    c,90h
;    ld    a,0
;    out    (c),a

   ld    iy,0
   ld    de,54272

_buc01:


_esp1:                ;IF NOT((INP(&H90)AND &B10)=&B10) THEN GOTO 90
   ld    c,90h
   in    a,(c)
   and    10b
    jp    z,_esp1        ;Espera ACK  (RECIBIDO)



   LD    C,98H
   IN    A,(C)        ;TOMA BYTE DE PANTALLA


   ld    c,91h
   out    (c),a        ;Prepara dato


   ld    c,90h        ;Envia dato (ENVIA ACK)
   ld    a,1
   out    (c),a


_esp2:                ;IF ((INP(&H90)AND &B10)=&B10) THEN GOTO 120
   in    a,(c)
   and    10b
   jp    nz,_esp2        ;Espera  no ACK  (RECIBIDO)


   out    (c),a        ;Quita ACK

   dec    de

   xor     a
   OR    d
   JP    NZ,_buc01
   XOR    A
   OR    e
   JP    NZ,_buc01
   EI
   ret

;----------------------------------------------------------------------
_VPEEK:

   LD    C,98H
   IN    A,(C)        ;COJE BYTE DE PANTALLA
   RET

;----------------------------------------------------------------------
_VPOKE:
   LD    C,99H

   PUSH    IY
   POP    HL

   LD    A,h
   AND    11000000B    ;2 BITS MAS ALTOS DE destino + 1 DE PAGINA

   RL    A
   RL    A
   RL    A

   OUT    (C),A        ; 00000,a16,a15,a14
   LD    A,10001110B    ;ESCRIBIR EN VDP R#14
   OUT    (C),A

   LD    A,l        ;8 BITS MAS ALTOS DE destino
   OUT    (C),A        ; a7,a6,a5,a4,a3,a2,a1
   LD    A,h
   AND    00111111B    ;6 bits MAS BAJOS DEL ALTO DE destino
   ADD     01000000B    ;COMANDO ESCRIBIR
   OUT    (C),A        ; 0,0 (read), a13,a12,a11,a10,a9,a8

   LD    C,98H
   LD    A,255
   OUT    (C),a        ;PONE BYTE EN PANTALLA
   RET

;----------------------------------------------------------------------
_impose_full:
   DI
   LD    C,F7H
   LD    A,10111111B
   OUT    (C),A

;40 VDP(9)=VDP(9) AND &HDF OR &H10
   LD    C,9BH
   LD    A,00001000B
   OUT    (C),A
   IN    A,(C)
   AND    cFH   ;dfh
   OR    10H
   LD    C,99H
   OUT    (C),A
   LD    A,10001000B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A

;41 VDP(10)=(VDP(10) AND &B11001111)OR &B00110000
   LD    C,9BH
   LD    A,00001001B
   OUT    (C),A
   IN    A,(C)
   AND    11001111B
   OR    00110000B
   LD    C,99H
   OUT    (C),A
   LD    A,10001001B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A

   LD    C,99H
   LD    A,FFH
   OUT    (C),A
   LD    A,10000111B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A

EI RET

;----------------------------------------------------------------------
_Digitize_view:
   DI
;60 'A=VDP(8)
;61 'VDP(8)=VDP(8) OR 32

luup2:
       LD      C,99H
       LD      A,00H
       OUT     (C),A

   LD    C,9BH
       LD      A,00001111B
   OUT    (C),A

       LD      C,99H
   IN    A,(C)

   and    01000000B
   jp    z,luup2


;70 VDP(7)=255
;    LD    C,99H
;    LD    A,FFH
;    OUT    (C),A
;    LD    A,10000111B    ;ESCRIBIR EN VDP R#8 VDP(9)
;    OUT    (C),A

;80 VDP(0)=VDP(0) OR &H40
   LD    C,9BH
   LD    A,00000000B
   OUT    (C),A
   IN    A,(C)
   OR    40H
   LD    C,99H
   OUT    (C),A
   LD    A,10000000B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A
EI
   RET

;----------------------------------------------------------------------
_digitize_set:
   DI
;110 VDP(0)=VDP(0) AND &HBF
   LD    C,9BH
   LD    A,00000000B
   OUT    (C),A
   IN    A,(C)
   AND    BFH
   LD    C,99H
   OUT    (C),A
   LD    A,10000000B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A

;120 VDP(7)=255
;    LD    C,99H
;    LD    A,FFH
;    OUT    (C),A
;    LD    A,10000111B    ;ESCRIBIR EN VDP R#8 VDP(9)
;    OUT    (C),A



;130 B=VDP(8)
luup1:
       LD      C,99H
       LD      A,00H
       OUT     (C),A

   LD    C,9BH
       LD      A,00001111B
   OUT    (C),A

       LD      C,99H
   IN    A,(C)

   and    01000000B
   jp    z,luup1



;131 'VDP(8)=VDP(8) AND 223

;140 VDP(7)=0
   LD    C,99H
   LD    A,0
   OUT    (C),A
   LD    A,10000111B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A
   EI
   RET

;----------------------------------------------------------------------
_impose_off:
   DI
;170 OUT(&HF7),&HFF
   LD    C,F7H
   LD    A,FFH
   OUT    (C),A

;180 VDP(9)=VDP(9) AND &HEF
   LD    C,9BH
   LD    A,00001000B
   OUT    (C),A
   IN    A,(C)
   AND    EFH
   LD    C,99H
   OUT    (C),A
   LD    A,10001000B    ;ESCRIBIR EN VDP R#8 VDP(9)
   OUT    (C),A

   EI
   RET

;----------------------------------------------------------------------
_DIGITA:
   DI
   LD    C,9BH
   LD    A,00001001B
   OUT    (C),A
   IN    A,(C)
   AND    11001111B
   OR    00100000B
   LD    C,99H
   OUT    (C),A
   LD    A,10001001B    ;ESCRIBIR EN VDP R#9 VDP(10)
OUT (C),A
   LD    C,F7H
   LD    A,10111111b
   OUT    (C),A        ;Sync Extern
LD C,99H
   LD    A,FFH
   OUT    (C),A
   LD    A,10000111B    ;ESCRIBIR EN VDP R#7 (Color)
   OUT    (C),A

   LD    C,F6H
   LD    A,10111111b
   OUT    (C),A

;    vdp(8)
luup:
       LD      C,99H
       LD      A,00H
       OUT     (C),A

   LD    C,9BH
       LD      A,00001111B
   OUT    (C),A

       LD      C,99H
   IN    A,(C)

   and    01000000B
   jp    z,luup



;    call    _delay


    LD    C,9BH
   LD    A,00000000B
   OUT    (C),A
   IN    A,(C)
   or    01000000b
   LD    C,99H
   OUT    (C),A
LD A,10000000B OUT (C),A

   EI
   RET

;----------------------------------------------------------------------
;----------------------------------------------------------------------

DigiUp:
   LD     A,(F3E6H)
   PUSH    AF
   LD    BC,FF07H
   CALL    VDPI
LD A,(FFEBH)
   AND    CFH
   OR    10H
   LD    B,A
   LD    C,09H
   CALL    VDPI

   LD    A,(FAF7H)
   AND    3FH
   OR    80H
   OUT    (F7H),A

IMPSON: LD A,(FFE7H)
   OR    32H
   LD    B,A
   LD    C,08H
   CALL    VDPI

TESTEC: CALL digiti
   jp     envio
   LD    IX,009CH
   LD    IY,(FCC0H)
   CALL    001CH
   JP    Z,TESTEC

LEETEC:
   LD    IX,009FH
   LD    IY,(FCC0H)
   CALL    001CH
   PUSH    AF
CALL VSCAN

   LD    A,(FFE7H)
   AND    EFH
   LD    B,A
   LD    C,08H
   CALL    VDPI

   POP    AF
   CP    20H
   JP    Z,LEETEC

   AND    DFH

   CP    1BH
   JP    Z,IMPSON

   LD    A,(FAF7H)
   OUT    (F7H),A

   LD    A,(FFEBH)
   AND    CFH
   LD    B,A
   LD    C,09H
   CALL    VDPI

   LD    A,(FFE7H)
   AND    FDH
   LD    B,A
   LD    C,08H
   CALL    VDPI

   POP    BC
   LD    C,07H
   CALL    VDPI
LD IX,00D2H
   LD    IY,(FCC0H)
   CALL    001CH

   RET


envio:
   push     af
   push    bc
   push    de
   push    ix
   push    iy
   call    _Transmite
   pop    iy
   pop    ix
   pop    de
   pop    bc
   pop    af
jp IMPSON

DIGITI:
   CALL    VSCAN

   LD    A,(F3DFH)
   OR    40h
   LD    B,A
   LD    C,00H
   CALL    VDPI
CALL VSCAN

   LD    A,(F3DFH)
   AND    bfh
   LD    B,A
   LD    C,00H
   CALL    VDPI

VSCAN:    CALL    SC1
   AND    40H
   JP    Z,VSCAN

VSCA2:
   CALL    SC1
   AND    40H
   JP    NZ,VSCA2
   RET

SC1: LD A,02H
   DI
   OUT    (99H),A
   LD    A,8fh
   OUT    (99H),A
   EX    (SP),HL
   EX    (SP),HL
   IN    A,(99H)
   EX    AF,AF'
   XOR    A
   OUT    (99H),A
   LD    A,8FH
   OUT    (99H),A
   EI
   EX    AF,AF'
   RET

VDPI:
   LD    A,B
   DI
   OUT    (99H),A
   LD    A,C
   AND    3FH
   OR    80H
   OUT    (99H),A
   EI
   LD    D,B
   LD    A,C
   LD    B,00H
   CP    08H
   JP    NC,GUAR1
   LD    HL,F3DFH
   JP    GUAR2

GUAR1:
   CP    18H
   RET    NC
   LD    HL,FFDFH

GUAR2:
   ADD    HL,BC
   LD    (HL),D
   RET

;----------------------------------------------------------------------
;----------------------------------------------------------------------
_delay:
   ld    c,255
delbuc:
   dec    c
   LD    A,0
   OR    C
   JP    NZ,delbuc        ;HASTA ULTIMO FRAME

   ret

;-----------------------------------------------------------------------------
;    VARIABLES
;-----------------------------------------------------------------------------

Handle: ds 1
EOFich: db 0
Fiche:  db "carlos1.pic",0
Mini:   db "Abierto.",13,10,"$"
Mlee:   db "lee.",13,10,"$"
Mlei:   db "leido.",13,10,"$"
Merror: db "Error." ,13,10,"$"
Mfin:   db "Cerrado." ,13,10,"$"

MODE:   DB      0

BUFFER:
IMAGEN: Ds    256


Es muy antiguo, si no me equivoco este era el programa que digitalizaba y luego enviaba por el puerto paralelo.


Un saludo.




mohai escribió:
Buenas,

alguien tiene bien explicados y con ejemplos (a ser posible), los comandos
BASIC y las funciones de captura y superposicion del MSX-2 ?

En el manual del 8280 se comentan "por encima" con un par de ejemplos muuuy
pobres, la verdad.

Un fallo (que yo haya visto) es que no se comenta para nada el segundo
parámetro del comando COPY SCREEN, ni en que influyen los colores de borde,
ni que hay que hacer para digitalizar una pantalla completa sin problemas...

Tambien me vale la esplicacioin de los registros del VDP necesarios y el
puerto F9.

salu2,
IvI


[Se han eliminado los trozos de este mensaje que no contenían texto]



                
______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com


<Anterior en la conversación] Conversación actual [Siguiente en la conversación>