NHP TURBO 3-6 BY PARCHE NEGRO
Después de mucho tiempo, he podido terminar de desamblar el copiador nhp 3.6, es importante para los amantes de la programación poder tener en nuestro recuerdos, estos códigos que algún día fueron armados y programados por personas importantes en nuestra niñes.
INTRODUCCION
Tío Parche como muchos de nosotros lo tratamos por cariño y admiración por su trabajo realizado en los años 80, es el precursor de muchos códigos fuentes de programas tanto educacionales como de copias para juegos en sistemas de cartuchos, discos y casetes.
¿Cual fue mi idea principal de este desamble?
Más que nada, cuando comencé en el mundo de la programación de assembler, incentivado por mucha gente, quise conocer de como estaban estructurado estos códigos de copiadores, mas que nada de copuchento y de tener mayores conocimientos de como se conectan y comunica el atari con los puertos o periféricos que usa.
para este desamble, ocupe el software WUDSN y codificación mads.
DESEMPOLBANDO EL NHP
Este copiador cuenta con 2 archivos en su interior que permite ensamblar en paquete único de archivo en su ejecución.
A-. KEM2 – Copia la rom la ram, para realizar variaciones de velocidad en la grabación y lectura de datos en la cinta.
B -. código de data que sera grabado en la cinta.
B1-. Loader – Data que contiene la portada y ejecución de carga de la data al atari.
B2-. Pagina 7 – Data que contiene la portada de muestra al comienzo de la cinta que aparece — PRISMA —
B3-. Data de carga de loader, donde indica cuantos bytes debe cargar.
esos son algunos datos que contiene la estructura en su desamble. Ahora pasaremos a conocer el código en si.
;KEM2.ASM
;COPIAD LA ROM A LA RAM
;
; SAVE #D8:KEM2
;
KEM
LDX #$C0
LDY #$00
SEI
LDA $D40E
PHA
STY $D40E
STX $CC
STY $CB
LOOP
LDA ($CB),Y
DEC $D301
STA ($CB),Y
INC $D301
INY
BNE LOOP
INC $CC
BEQ @EXIT
LDA $CC
CMP #$D0
BNE LOOP
LDA #$D8
STA $CC
BNE LOOP
@EXIT
DEC $D301
LDX #$01
LDY #$4C
LDA #$13
STX $EE17
STY $ED8F
STA $ED67
LDX #$80
LDY #$03
STX $EBA3
STY $EBA8
LDY #$04
LDA #$EA
NOP
STA $ED85,Y
DEY
BPL NOP
LDY #STACF-STACI
MOVE
LDA STACI,Y
STA $ECEF,Y
DEY
BPL MOVE
PLA
STA $D40E
CLI
CLC
RTS
STACI
LDA #$7D
LDX $62
BEQ CC0
LDA #$64
CC0
CLC
ADC $EE19,X
DEY
BPL CC0
CLC
ADC $0312
SEC
SBC #$64
BCC CC3
STA $0312
LDY #$02
LDX #$06
LDA #$4F
CC2
ADC $0312
BCC CC1
INY
CLC
CC1
DEX
BNE CC2
STA $02EE
STY $02EF
JMP $ED96
CC3
JMP $ED3D
STACF
El LOADER. simplemente lo estructure en bytes que es la manera de poder cargar los bytes de forma directa al momento de grabar.
;LOADER.ASM
LOAD
.BYTE $55,$55,$a0,$00,$8c,$44,$02,$c8
.BYTE $84,$09,$20,$5d,$cf,$4c,$c4,$ce
.BYTE $fc,$00,$00,$00,$60,$00,$52,$40
.BYTE $00,$07,$23,$00,$00,$01,$00,$80
.BYTE $70,$70,$70,$47,$3f,$cc,$70,$02
.BYTE $70,$02,$70,$70,$f0,$f0,$f0,$f0
.BYTE $f0,$f0,$70,$70,$70,$70,$70,$46
.BYTE $a3,$cc,$70,$02,$41,$20,$cc,$00
.BYTE $00,$e4,$ef,$e7,$e4,$e1,$f2,$eb
.BYTE $00,$00,$73,$6f,$66,$74,$77,$61
.BYTE $72,$65,$73,$00,$00,$00,$00,$00
.BYTE $00,$30,$32,$2f,$27,$32,$21,$2d
.BYTE $21,$33,$00,$30,$21,$32,$21,$00
.BYTE $23,$2f,$2d,$30,$35,$34,$21,$24
.BYTE $2f,$32,$25,$33,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$2c,$29,$2e,$25,$21,$00,$21
.BYTE $34,$21,$32,$29,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$23,$61,$72,$67
.BYTE $61,$72,$61,$00,$64,$65,$6e,$74
.BYTE $72,$6f,$00,$64,$65,$00,$00,$00
.BYTE $00,$00,$22,$6c,$6f,$71,$75,$65
.BYTE $73,$0e,$00,$00,$00,$00,$00,$00
.BYTE $00,$0d,$00,$00,$25,$00,$32,$00
.BYTE $32,$00,$2f,$00,$32,$00,$00,$0d
.BYTE $00,$00,$00,$00,$32,$65,$74,$72
.BYTE $6f,$63,$65,$64,$61,$00,$13,$00
.BYTE $76,$75,$65,$6c,$74,$61,$73,$00
.BYTE $79,$00,$70,$72,$65,$73,$69,$6f
.BYTE $6e,$65,$00,$80,$b3,$b4,$a1,$b2
.BYTE $b4,$80,$00,$a9,$40,$8d,$0e,$d4
.BYTE $a2,$e4,$a0,$5f,$a9,$06,$20,$5c
.BYTE $e4,$60,$a2,$04,$bd,$c4,$02,$9d
.BYTE $53,$cf,$ca,$10,$f7,$ad,$30,$02
.BYTE $8d,$58,$cf,$ad,$31,$02,$8d,$59
.BYTE $cf,$ad,$2f,$02,$8d,$5a,$cf,$ad
.BYTE $f4,$02,$8d,$5b,$cf,$ad,$f3,$02
.BYTE $8d,$5c,$cf,$60,$a2,$04,$bd,$53
.BYTE $cf,$9d,$c4,$02,$ca,$10,$f7,$ad
.BYTE $58,$cf,$8d,$30,$02,$ad,$59,$cf
.BYTE $8d,$31,$02,$ad,$5a,$cf,$8d,$2f
.BYTE $02,$ad,$5b,$cf,$8d,$f4,$02,$ad
.BYTE $5c,$cf,$8d,$f3,$02,$60,$a2,$20
.BYTE $a9,$cc,$8e,$30,$02,$8e,$02,$d4
.BYTE $8d,$31,$02,$8d,$03,$d4,$a9,$22
.BYTE $8d,$2f,$02,$8d,$00,$d4,$a9,$e0
.BYTE $8d,$f4,$02,$8d,$09,$d4,$a9,$02
.BYTE $8d,$f3,$02,$8d,$01,$d4,$a2,$04
.BYTE $bd,$03,$ce,$9d,$c4,$02,$9d,$16
.BYTE $d0,$ca,$10,$f4,$a9,$a3,$a2,$cc
.BYTE $8d,$38,$cc,$8e,$39,$cc,$a2,$cd
.BYTE $a0,$d7,$a9,$06,$20,$5c,$e4,$a2
.BYTE $e5,$a0,$cd,$a9,$c0,$8e,$00,$02
.BYTE $8c,$01,$02,$8d,$0e,$d4,$60,$a9
.BYTE $00,$8d,$fb,$cd,$ad,$c6,$02,$8d
.BYTE $01,$ce,$4c,$5f,$e4,$48,$8a,$48
.BYTE $ae,$fb,$cd,$bd,$fc,$cd,$8d,$0a
.BYTE $d4,$8d,$1a,$d0,$ee,$fb,$cd,$68
.BYTE $aa,$68,$40,$00,$52,$72,$b4,$ea
.BYTE $32,$ff,$ff,$28,$ca,$00,$44,$00
.BYTE $a9,$df,$a2,$cc,$8d,$38,$cc,$8e
.BYTE $39,$cc,$60,$20,$08,$ce,$a9,$3c
.BYTE $8d,$02,$d3,$a9,$fd,$20,$b0,$f2
.BYTE $ad,$1f,$d0,$c9,$06,$d0,$f9,$20
.BYTE $2d,$ce,$4c,$5d,$ce,$a9,$34,$8d
.BYTE $02,$d3,$a2,$10,$8e,$1c,$02,$ae
.BYTE $1c,$02,$d0,$fb,$a2,$fd,$86,$14
.BYTE $ad,$0f,$d2,$29,$10,$f0,$f5,$a6
.BYTE $14,$d0,$f5,$4c,$7e,$cd,$cc,$10
.BYTE $cc,$f0,$0a,$98,$59,$03,$07,$45
.BYTE $47,$e6,$47,$c8,$60,$ad,$0b,$d4
.BYTE $d0,$fb,$ad,$52,$cf,$f0,$4a,$20
.BYTE $2a,$cd,$20,$7e,$cd,$a2,$0b,$bd
.BYTE $14,$cc,$9d,$00,$03,$ca,$10,$f7
.BYTE $20,$59,$e4,$30,$96,$ad,$02,$07
.BYTE $cd,$52,$cf,$90,$8e,$f0,$03,$4c
.BYTE $6d,$ce,$ad,$ff,$07,$8d,$10,$cc
.BYTE $a2,$02,$bd,$ce,$cc,$c9,$10,$d0
.BYTE $08,$a9,$19,$9d,$ce,$cc,$ca,$10
.BYTE $f1,$de,$ce,$cc,$20,$54,$cd,$ce
.BYTE $52,$cf,$a0,$00,$84,$4d,$4c,$4e
.BYTE $ce,$20,$1b,$cd,$a9,$3c,$a2,$00
.BYTE $a0,$60,$8d,$02,$d3,$9a,$8c,$00
.BYTE $07,$6c,$e0,$02,$ac,$10,$cc,$20
.BYTE $4e,$ce,$8d,$ea,$ce,$20,$4e,$ce
.BYTE $8d,$eb,$ce,$2d,$ea,$ce,$c9,$ff
.BYTE $f0,$ed,$20,$4e,$ce,$8d,$12,$cc
.BYTE $20,$4e,$ce,$8d,$13,$cc,$20,$4e
.BYTE $ce,$8d,$ff,$ff,$ad,$ea,$ce,$cd
.BYTE $12,$cc,$d0,$08,$ad,$eb,$ce,$cd
.BYTE $13,$cc,$f0,$0b,$ee,$ea,$ce,$d0
.BYTE $03,$ee,$eb,$ce,$4c,$e6,$ce,$ad
.BYTE $e2,$02,$0d,$e3,$02,$f0,$b8,$a2
.BYTE $f0,$9a,$8c,$11,$cc,$20,$1b,$cd
.BYTE $20,$54,$cd,$20,$33,$cf,$20,$2a
.BYTE $cd,$20,$2d,$ce,$ac,$11,$cc,$a2
.BYTE $00,$9a,$8e,$e2,$02,$8e,$e3,$02
.BYTE $4c,$c7,$ce,$a2,$10,$bd,$41,$cf
.BYTE $9d,$00,$08,$ca,$10,$f7,$4c,$00
.BYTE $08,$a9,$3c,$8d,$02,$d3,$20,$0e
.BYTE $08,$a9,$fe,$8d,$01,$d3,$60,$6c
.BYTE $e2,$02,$00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00,$20,$2a,$cd
.BYTE $a2,$0b,$bd,$b0,$cf,$9d,$00,$03
.BYTE $ca,$10,$f7,$20,$59,$e4,$10,$10
.BYTE $a9,$3c,$8d,$02,$d3,$ad,$01,$d3
.BYTE $29,$fd,$8d,$01,$d3,$4c,$00,$04
.BYTE $a2,$13,$bd,$b2,$cf,$9d,$a3,$cc
.BYTE $ca,$10,$f7,$a2,$02,$bd,$c6,$cf
.BYTE $9d,$ce,$cc,$ca,$10,$f7,$a2,$03
.BYTE $ad,$c9,$cf,$86,$41,$8d,$52,$cf
.BYTE $a0,$7f,$a9,$00,$99,$00,$04,$88
.BYTE $10,$fa,$20,$7e,$cd,$4c,$54,$cd
.BYTE $60,$00,$52,$40,$b0,$cf,$23,$00
.BYTE $1a,$00,$00,$80
PAG7
.BYTE $00,$03,$00,$07,$09,$08,$20,$2c
.BYTE $07,$ae,$30,$02,$ac,$31,$02,$8e
.BYTE $fc,$cf,$8c,$fd,$cf,$a2,$e1,$a0
.BYTE $07,$a9,$00,$8e,$30,$02,$8e,$02
.BYTE $d4,$8c,$31,$02,$8c,$03,$d4,$85
.BYTE $41,$4c,$00,$04,$a2,$c0,$a0,$00
.BYTE $78,$ad,$0e,$d4,$48,$8c,$0e,$d4
.BYTE $86,$cc,$84,$cb,$b1,$cb,$ce,$01
.BYTE $d3,$91,$cb,$ee,$01,$d3,$c8,$d0
.BYTE $f3,$e6,$cc,$f0,$0c,$a5,$cc,$c9
.BYTE $d0,$d0,$e9,$a9,$d8,$85,$cc,$d0
.BYTE $e3,$ce,$01,$d3,$a2,$01,$a0,$4c
.BYTE $a9,$13,$8e,$17,$ee,$8c,$8f,$ed
.BYTE $8d,$67,$ed,$a2,$80,$a0,$03,$8e
.BYTE $a3,$eb,$8c,$a8,$eb,$a0,$04,$a9
.BYTE $ea,$99,$85,$ed,$88,$10,$fa,$a0
.BYTE $37,$b9,$91,$07,$99,$ef,$ec,$88
.BYTE $10,$f7,$68,$8d,$0e,$d4,$58,$18
.BYTE $60,$a9,$7d,$a6,$62,$f0,$02,$a9
.BYTE $64,$18,$7d,$19,$ee,$88,$10,$f9
.BYTE $18,$6d,$12,$03,$38,$e9,$64,$90
.BYTE $1c,$8d,$12,$03,$a0,$02,$a2,$06
.BYTE $a9,$4f,$6d,$12,$03,$90,$02,$c8
.BYTE $18,$ca,$d0,$f6,$8d,$ee,$02,$8c
.BYTE $ef,$02,$4c,$96,$ed,$4c,$3d,$ed
.BYTE $a0,$a0,$d0,$ef,$f2,$a0,$d0,$e1
.BYTE $f2,$e3,$e8,$e5,$a0,$ce,$e5,$e7
.BYTE $f2,$ef,$a0,$d3,$ef,$e6,$f4,$a0
.BYTE $a0,$70,$70,$70,$70,$70,$70,$70
.BYTE $70,$70,$70,$70,$70,$70,$70,$47
.BYTE $f5,$07,$41,$e1,$07,$00,$00,$0d
.BYTE $0d,$00,$00,$00,$30,$32,$29,$33
.BYTE $2d,$21,$00,$00,$00,$0d,$0d,$00
.BYTE $00,$a2,$00,$a0,$07,$86,$0c,$84
.BYTE $0d,$ae,$fc,$cf,$ac,$fd,$cf,$8e
.BYTE $30,$02,$8c,$31,$02,$6c,$04,$03
PAG4
.BYTE $55,$55,$fe,$ad,$01,$d3,$29,$02
.BYTE $f0,$17,$a2,$0b,$bd,$58,$04,$9d
.BYTE $00,$03,$ca,$10,$f7,$20,$59,$e4
.BYTE $30,$07,$ad,$64,$04,$85,$47,$18
.BYTE $60,$ae,$fc,$cf,$ac,$fd,$cf,$8e
.BYTE $30,$02,$8c,$31,$02,$a0,$00,$b9
.BYTE $3d,$04,$91,$58,$c8,$c0,$1b,$d0
.BYTE $f6,$a9,$3c,$8d,$02,$d3,$d0,$fe
.BYTE $a5,$b2,$b2,$af,$b2,$80,$81,$81
.BYTE $81,$00,$23,$21,$32,$27,$35,$25
.BYTE $00,$2e,$35,$25,$36,$21,$2d,$25
.BYTE $2e,$34,$25,$60,$00,$52,$40,$00
.BYTE $cc,$23,$00
.WORD LLOAD
.BYTE $00,$80
@GENDAT
.BYTE 0
ESPSIO
.BYTE $55,$55
NME
.BYTE '....................'
BLQ
.BYTE '...'
PFIN
.BYTE 0
Ustedes solo podrán apreciar un conjuntos de bytes que al mirar a simple vista no se ve nada, pero ahora veremos la estructura que esta en su interior y salir del enigma de este código.
LOADER
Esta es la parte más importante del copiador ya que nos permite poder cargar el juego en la memoria del computador atari.
;LOADER.ASM
BAFER = $0700
BUFAUX = $0800
?RUTINA = BUFAUX+JUMP-RUTINA
GENDAT = $47
;
ORG $CC00
.BYTE $55,$55
LDY #$00
STY $0244
INY
STY $09
JSR RECUPERO
JMP START
NBYTES
.BYTE 252 ;$FC
FLAGY
.BYTE 0
FINISH
.BYTE 0,0
MMMSIOV
.BYTE $60,$00,$52,$40
.WORD BAFER
.BYTE $23,$00
.WORD $0100
.BYTE $00,$80
DLIST
.BYTE $70,$70,$70,$47
.WORD MENSAJE
.BYTE $70,$02,$70,$02,$70,$70
.BYTE $F0,$F0,$F0,$F0,$F0,$F0
.BYTE $70,$70,$70,$70,$70,$46
DLERR
.WORD NAME
.BYTE $70,$02,$41
.WORD DLIST
MENSAJE
.SB " "
.SB +128,"prisma"
.SB " "
.SB " PROGRAMAS PARA COMPUTADORES "
.SB " LINEA ATARI "
NAME
.SB " "
.SB " Cargara dentro de "
CONTADOR
.SB " Bloques. "
MERR
.SB " - E R R O R - "
.SB " Retroceda 3 vueltas y presione START "
TIEMPO
LDA #$40
STA $D40E
LDX #$E4
LDY #$5F
LDA #$06
JSR $E45C
RTS
LNEW
LDX #$04
XNEW
LDA $02C4,X
STA PFIN+1,X
DEX
BPL XNEW
LDA $0230
STA PFIN+6
LDA $0231
STA PFIN+7
LDA 559 ;$022F
STA PFIN+8
LDA 756 ;$02F4
STA PFIN+9
LDA 755 ;$02F3
STA PFIN+10
RTS
NEWL
LDX #$04
YNEW
LDA PFIN+1,X
STA $02C4,X
DEX
BPL YNEW
LDA PFIN+6
STA $0230
LDA PFIN+7
STA $0231
LDA PFIN+8
STA 559
LDA PFIN+9
STA 756
LDA PFIN+10
STA 755
RTS
NEWDL
LDX # <DLIST
LDA # >DLIST
STX $0230
STX $D402
STA $0231
STA $D403
LDA #$22
STA 559
STA $D400
LDA #224
STA 756
STA $D409
LDA #$02
STA 755
STA $D401
LDX #$04
COLORLOOP
LDA TABLA,X
STA $02C4,X
STA $D016,X
DEX
BPL COLORLOOP
LDA # <NAME
LDX # >NAME
STA DLERR
STX DLERR+1
LDX #$CD
LDY #$D7
LDA #$06
JSR $E45C
LDX #$E5
LDY #$CD
LDA #$C0
STX $0200
STY $0201
STA $D40E
RTS
LDA #$00
STA NOSEPO
LDA $02C6
STA NOSEPOR02
JMP $E45F
PHA
TXA
PHA
LDX NOSEPO
LDA NOSEPO01,X
STA $D40A
STA $D01A
INC NOSEPO
PLA
TAX
PLA
RTI
NOSEPO
.BYTE 0
NOSEPO01
.BYTE $52,$72,$B4,$EA,$32
NOSEPOR02
.BYTE $FF,$FF
TABLA
.BYTE $28,$CA,$00,$44,$00
CONCHAT
LDA # <MERR
LDX # >MERR
STA DLERR
STX DLERR+1
RTS
ERROR
JSR CONCHAT
LDA #$3C
STA $D302
LDA #$FD
JSR $F2B0
VUELTA
LDA 53279
CMP #$06
BNE VUELTA
JSR SEARCH
JMP GRAB
SEARCH
LDA #$34
STA $D302
LDX #$10
STX $021C
SPEED
LDX $021C
BNE SPEED
SIGUE
LDX #$FD
STX $14
BUSCA
LDA $D20F
AND #$10
BEQ SIGUE
LDX $14
BNE BUSCA
JMP NEWDL
GBYTE
CPY NBYTES
BEQ GRAB
TYA
EOR BAFER+3,Y
EOR GENDAT
INC GENDAT
INY
RTS
GRAB
LDA $D40B
BNE GRAB
LDA PFIN
BEQ BYE
JSR LNEW
JSR NEWDL
?GRAB
LDX #$0B
MSIO
LDA MMMSIOV,X
STA $0300,X
DEX
BPL MSIO
JSR $E459
BMI ERROR
LDA BAFER+2
CMP PFIN
BCC ERROR
BEQ RETURN
JMP ?GRAB
RETURN
LDA BAFER+255
STA NBYTES
LDX #$02
C01
LDA CONTADOR,X
CMP #$10
BNE C02
LDA #$19
STA CONTADOR,X
DEX
BPL C01
C02
DEC CONTADOR,X
JSR NEWL
DEC PFIN
LDY #$00
STY 77
JMP GBYTE
BYE
JSR TIEMPO
LDA #$3C
LDX #$00
LDY #$60
STA $D302
TXS
STY BAFER
JMP ($02E0)
START
LDY NBYTES
LOOP
JSR GBYTE
STA MEMORY+1
JSR GBYTE
STA MEMORY+2
AND MEMORY+1
CMP #$FF
BEQ LOOP
JSR GBYTE
STA FINISH
JSR GBYTE
STA FINISH+1
MBTM
JSR GBYTE
MEMORY
STA $FFFF
LDA MEMORY+1
CMP FINISH
BNE OK
LDA MEMORY+2
CMP FINISH+1
BEQ VERFIN
OK
INC MEMORY+1
BNE NIM
INC MEMORY+2
NIM
JMP MBTM
VERFIN
LDA $02E2
ORA $02E3
BEQ LOOP
LDX #$F0
TXS
STY FLAGY
JSR TIEMPO
JSR NEWL
JSR RINIT
JSR LNEW
JSR SEARCH
LDY FLAGY
LDX #$00
TXS
STX $02E2
STX $02E3
JMP LOOP
RINIT
LDX #PFIN-RUTINA-1
MVRUT
LDA RUTINA,X
STA BUFAUX,X
DEX
BPL MVRUT
JMP BUFAUX
RUTINA
LDA #$3C
STA $D302
JSR ?RUTINA
LDA #$FE
STA $D301
RTS
JUMP
JMP ($02E2)
PFIN
.BYTE $00,$00,$00,$00,$00,$00
.BYTE $00,$00,$00,$00,$00
RECUPERO
JSR LNEW
LDX #$0B
RECUPER02
LDA FINRECUPERO,X
STA $0300,X
DEX
BPL RECUPER02
JSR $E459
BPL RECUPERO03
LDA #$3C
STA $D302
LDA $D301
AND #$FD
STA $D301
JMP $0400
RECUPERO03
LDX #$13
RECUPERO04
LDA FINRECUPERO+2,X
RECUPERO05
STA NAME,X
DEX
BPL RECUPERO04
LDX #$02
RECUPERO06
LDA FINRECUPERO+22,X
STA CONTADOR,X
DEX
BPL RECUPERO06
LDX #$03
LDA FINRECUPERO+25
STX $41
STA PFIN
LDY #$7F
LDA #$00
RECUPERO07
STA $0400,Y
DEY
BPL RECUPERO07
JSR NEWDL
JMP NEWL
FINRECUPERO
.BYTE $60,$00,$52,$40
.WORD FINRECUPERO
.BYTE $23,$00
.WORD 26
.BYTE $00,$80
PAGINA 7
;PAGINA7.ASM
org $0700
INICIO
.BYTE $00,$03
.WORD INICIO,PRINCIPAL
JSR KEM
LDX $230
LDY $0231
STX $CFFC
STY $CFFD
LDX #<DLS
LDY #>DLS
LDA #$00
STX $0230
STX $D402
STY $0231
STY $D403
STA $41
JMP $0400
KEM
LDX #$C0
LDY #$00
SEI
LDA $D40E
PHA
STY $D40E
STX $CC
STY $CB
LOOP
LDA ($CB),Y
DEC $D301
STA ($CB),Y
INC $D301
INY
BNE LOOP
INC $CC
BEQ @EXIT
LDA $CC
CMP #$D0
BNE LOOP
LDA #$D8
STA $CC
BNE LOOP
@EXIT
DEC $D301
LDX #$01
LDY #$4C
LDA #$13
STX $EE17
STY $ED8F
STA $ED67
LDX #$80
LDY #$03
STX $EBA3
STY $EBA8
LDY #$04
LDA #$EA
NOP
STA $ED85,Y
DEY
BPL NOP
LDY #STACF-STACI
MOVE
LDA STACI,Y
STA $ECEF,Y
DEY
BPL MOVE
PLA
STA $D40E
CLI
CLC
RTS
STACI
LDA #$7D
LDX $62
BEQ CC0
LDA #$64
CC0
CLC
ADC $EE19,X
DEY
BPL CC0
CLC
ADC $0312
SEC
SBC #$64
BCC CC3
STA $0312
LDY #$02
LDX #$06
LDA #$4F
CC2
ADC $0312
BCC CC1
INY
CLC
CC1
DEX
BNE CC2
STA $02EE
STY $02EF
JMP $ED96
CC3
JMP $ED3D
STACF
.BYTE +128," Por Parche Negro Soft "
DLS
.BYTE $70,$70,$70,$70,$70,$70,$70
.BYTE $70,$70,$70,$70,$70,$70,$70
.BYTE $47
.WORD SHOW
.BYTE $41
.WORD DLS
SHOW
.SB " -- PRISMA -- "
PRINCIPAL
LDX #<INICIO
LDY #>INICIO
STX $0C
STY $0D
LDX $CFFC
LDY $CFFD
STX $230
STY $231
JMP ($0304)
PAGINA 4
;PAGINA4.ASM
GENDAT = $47
;
ORG $03FD
.BYTE $55,$55,$FE
LDA $D301
AND #$02
BEQ ERROR
LDX #$0B
MOVE
LDA SIOV,X
STA $0300,X
DEX
BPL MOVE
JSR $E459
BMI ERROR
LDA FIN+1
STA GENDAT
CLC
RTS
ERROR
LDX $CFFC
LDY $CFFD
STX $0230
STY $0231
LDY #$00
LER
LDA TABLA,Y
STA ($58),Y
INY
CPY #27
BNE LER
LDA #$3C
STA $D302
LOOP
BNE LOOP
TABLA
.SBYTE "ERROR !!! CARGUE NUEVAMENTE"
SIOV
.BYTE $60,$00,$52,$40
.WORD $06FE
.BYTE $23,$00
.WORD $AAAA
.BYTE $00,$80
FIN
NHP 36
;NHP36.ASM
; OPT NO LIST
;
; GRABADOR SISTEMA NHP VER 3.6
;
; SAVE #D8:GRABB
;
;
; ASM,,#D8:GRABB.COM
;
@LEN = LEN+2
@LBAF = LEN+4
PPILA = LEN+5
PCRSR = $CB
ORG = PCRSR
SVMSC = $58
POSXY = $54
LENGHT = $4000
BAFER = $4000
FR0 = $D4
CIX = $F2
AFP = $D800
IFP = $D9AA
FPI = $D9D2
FASC = $D8E6
ZFR0 = $DA44
FDIV = $DB28
FMUL = $DADB
FMOVE = $DDB6
INBUFF = $F3
LBUFF = $0580
LLOAD = PAG7-LOAD
LAUTO = PAG4-PAG7
BL4 = LAUTO/128
LAST = LAUTO-128*BL4
GENDAT = $47
;
ORG $2000
ICL 'KEM2.ASM'
ICL 'LOADER.ASM'
DLS
.BYTE $70,$70,$70,$46
.WORD SHOW
.BYTE $70,$70,$02,$70,$70,$02,$02,$70
.BYTE $70,$70,$06,$70,$70,$70,$02,$70
.BYTE $70,$70,$06,$70,$70,$70,$02,$41
.WORD DLS
; -------------------------
; DEFINICION DEL DISPLAY
; PARA DIRECTORIO
; -------------------------
?DIR
.BYTE $70,$70,$70,$70,$70,$70,$70,$70
.BYTE $46
.WORD ???DIR
.BYTE $70,$02,$02,$02,$02,$02,$02,$02
.BYTE $02,$02,$41
.WORD ?DIR
SHOW
.SB "COPIADOR NHP VER 3.6"
.SB " "
.SB +128," NHP TURBO SOLO ROM POR PARCHE NEGRO "
.SB " "
.SB " 12345678901234567890 "
.SB +128,"NOMBRE CARATULA:"
CRSR
.SB "_ "
.SB " "
NAME
.SB " "
.SB +128,"FILE:"
FILE
.SB "_ "
.SB " "
.SB " TURBO "
TOF
.SB "OFF "
.SB +128,"BYTES LEIDOS:"
.SB " "
BYTES
.SB "***** "
.SB +128,"BLOQUES:"
.SB " "
BLOQUES
.SB "*** "
???DIR
.SB " DIRECTORIO "
??DIR
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
.SB " "
RY
.BYTE 0,0
LEN
.BYTE 0,0,0,0,0,0
CONT
.BYTE 0,0
STARTF
.BYTE 0,0
FINISH
.BYTE 0,0
@BL4
.BYTE 0
?FILE
.BYTE 'D:'
??FILE
.BYTE ' '
BBLQS
.BYTE "000",$9B
ALL
.BYTE 'D:*.*',$9B
DNHP
.BYTE $60,$00,$50,$80
.WORD ??DIR
.BYTE $35,$00,$00,$01,$00,$80
BAKBYT
.SB "00000"
BAKBLQ
.SB "000"
TURBO
.SB "TURBO"
FTURBO
.BYTE $FF
TON
.SB "ON "
RESTORE
LDY #19
?RESTORE
LDA #$20
STA ??FILE,Y
LDA #$00
STA NAME,Y
STA FILE,Y
DEY
BPL ?RESTORE
LDY #23
??RESTORE
LDA #$00
STA CRSR,Y
DEY
BPL ??RESTORE
LDY #34
???RESTORE
LDA #$00
STA FILE,Y
DEY
BPL ???RESTORE
LDA #63
STA CRSR
STA FILE
LDA #$10
LDY #$04
RESNUM
STA BYTES,Y
DEY
BPL RESNUM
STA BLOQUES
STA BLOQUES+1
STA BLOQUES+2
LDA #$FF
STA $D301
RTS
ASCINT
CMP #32
BCC ADD64
CMP #96
BCC SUB32
CMP #128
BCC REMAIN
CMP #160
BCC ADD64
CMP #224
BCC SUB32
BCS REMAIN
ADD64
CLC
ADC #64
BCC REMAIN
SUB32
SEC
SBC #32
REMAIN
RTS
SETUR
LDX #$04
LOSTR
LDA TURBO,X
CMP CRSR,X
BNE EXSTUR
DEX
BPL LOSTR
LDA FTURBO
EOR #$01
STA FTURBO
LDX #$02
LOMVTR
LDA TON,X
PHA
LDA TOF,X
STA TON,X
PLA
STA TOF,X
DEX
BPL LOMVTR
LDX #$00
TXS
JMP START
EXSTUR
RTS
CLS
LDX # <??DIR
LDY # >??DIR
STX PCRSR
STY PCRSR+1
LDY #$00
LDX #$00
?CLS
LDA #$00
STA (PCRSR),Y
INY
BNE ??CLS
INX
INC PCRSR+1
??CLS
CPY #104 ;$68
BNE ?CLS
CPX #$01
BNE ?CLS
RTS
OPEN
LDX #$10
LDA #$03
STA $0342,X
LDA # <?FILE
STA $0344,X
LDA # >?FILE
STA $0345,X
LDA #$04
STA $034A,X
LDA #$80
STA $034B,X
JSR $E456
DEY
BNE DIR
RTS
CLOSE
LDX #$10
LDA #$0C
STA $0342,X
JMP $E456
DIR
JSR CLOSE
JSR CLS
LDX # <?DIR
LDY # >?DIR
STX $0230
STY $0231
LDX # <??DIR
LDY # >??DIR
STX PCRSR
STY PCRSR+1
LDX #$10
LDA #$03
STA $0342,X
LDA # <ALL
STA $0344,X
LDA # >ALL
STA $0345,X
LDA #$06
STA $034A,X
LDA #$00
STA $034B,X
JSR $E456
LDA #$07
STA $0342,X
LDA #$00
STA $0348,X
STA $0349,X
STA RY
STA RY+1
LEDIR
JSR $E456
BMI ?EXIT
CMP #155
BEQ EXIT
JSR ASCINT
LDY RY
STA (PCRSR),Y
INC RY
BNE F0
INC PCRSR+1
INC RY+1
F0
LDY RY+1
CPY #$01
BNE F1
LDY RY
CPY #104 ;$68
BCC F1
JSR PAUSE
INC RY
F1
JMP LEDIR
EXIT
INC RY
INC RY
INC RY
JMP LEDIR
?EXIT
JSR CLOSE
JSR PAUSE
JSR CLS
PLA
PLA
JMP START
PAUSE
LDA 53279
CMP #$06
BNE PAUSE
JSR CLS
LDA #$00
STA RY
STA RY+1
LDA # <??DIR
STA PCRSR
LDA # >??DIR
STA PCRSR+1
LDX #$10
RTS
FLSH
LDY RY
LDA (PCRSR),Y
EOR #63
STA (PCRSR),Y
LDA #$10
STA $021A
RTS
OPENK
LDA #255
STA 764
LDX #$10
LDA #$03
STA $0342,X
STA $0345,X
LDA #$26
STA $0344,X
LDA #$04
STA $034A,X
JSR $E456
LDA #$07
STA $0342,X
LDA #$00
STA $0348,X
STA $0349,X
STA RY
RTS
RUTLEE
LDX # <FLSH
LDY # >FLSH
LDA #$10
STX $0228
STY $0229
STA $021A
JSR OPENK
GETEC
JSR $E456
CMP #$7E
BNE C0
LDY RY
BEQ GETEC
LDA #$00
STA (PCRSR),Y
LDA #63 ;$3F
DEY
STA (PCRSR),Y
DEC RY
JMP GETEC
C0
CMP #155 ;$9B
BEQ C2
JSR ASCINT
LDY RY
STA (PCRSR),Y
CPY #20 ;#14
BEQ C1
INC RY
C1
JMP GETEC
C2
JSR CLOSE
LDA #$00
STA $021A
LDY RY
STA (PCRSR),Y
RTS
FGET
LDA #$DF
STA $D301
LDA #$00
STA LEN
STA LEN+1
LOPFGET
LDX #$10
LDA #$07
STA $0342,X
LDA # <BAFER
STA $0344,X
LDA # >BAFER
STA $0345,X
LDA # <LENGHT
STA $0348,X
LDA # >LENGHT
STA $0349,X
??FGET
JSR $E456
CLC
LDA LEN
ADC $0348,X
STA LEN
LDA LEN+1
ADC $0349,X
STA LEN+1
CLC
LDA $D301
ADC #$04
STA $D301
LDA $0349,X
CMP # >LENGHT
BEQ LOPFGET
CPY #136 ;$88
BEQ ?FGET
JSR CLOSE
JSR CLS
LDX #$00
TXS
JMP START
?FGET
JSR ZFR0
LDA #252 ;$FC
STA FR0
JSR IFP
JSR FMOVE
LDA LEN
STA FR0
LDA LEN+1
STA FR0+1
JSR IFP
JSR PONBYTES
JSR FDIV
JSR PONBLOQUES
JSR FPI
LDA FR0
PHA
DEC FR0
JSR IFP
JSR FMOVE
LDA #252 ;$FC
STA FR0
LDA #$00
STA FR0+1
JSR IFP
JSR FMUL
JSR FPI
SEC
LDA LEN
SBC FR0
STA CONT+1
INC CONT+1
PLA
STA CONT
LDX #$10
RTS
PONBYTES
JSR NBYTES
STY RY
LDY #$04
?PONBYTES
LDA LBUFF,X
AND #$5F
STA BYTES,Y
DEY
DEX
DEC RY
BPL ?PONBYTES
RTS
PONBLOQUES
JSR NBYTES
STY RY
LDY #$02
?PONBLOQUES
LDA LBUFF,X
AND #$5F
STA BLOQUES,Y
DEY
DEX
DEC RY
BPL ?PONBLOQUES
LDA BLOQUES+2
CMP #$19
BEQ ??PP0
INC BLOQUES+2
PP0
LDY #$02
MVBLQ
LDA BLOQUES,Y
ORA #$20
STA BBLQS,Y
DEY
BPL MVBLQ
LDX # <BBLQS
LDY # >BBLQS
LDA #$00
STX INBUFF
STY INBUFF+1
STA CIX
JMP AFP
??PP0
LDA #$10
STA BLOQUES+2
LDA BLOQUES+1
CMP #$19
BEQ ???PP0
INC BLOQUES+1
JMP PP0
???PP0
LDA #$10
STA BLOQUES+1
INC BLOQUES
JMP PP0
NBYTES
JSR FASC
LDX #$00
LDY #$00
LDA LBUFF
CMP #$30 ;'0
BNE PL0
INX
PL0
LDA LBUFF,X
CMP #$80
BCS PL1
CMP #$2E ;'.
BEQ PL2
INX
INY
JMP PL0
PL1
RTS
PL2
DEX
LDA LBUFF,X
ORA #$80
STA LBUFF,X
DEY
RTS
SAVESIO
LDX #$0B
?SAVESIO
LDA ESIO,X
STA $0300,X
DEX
BPL ?SAVESIO
JMP $E459
ESIO
.BYTE $60,$00,$50,$80
.WORD ESPSIO
.BYTE $23,$00
.WORD 26
.BYTE $00,$80
OPENC
LDA $D40B
BNE OPENC
LDA #$FF
STA 764 ;$02FC
?OPENC
LDA 764
CMP #$FF
BEQ ?OPENC
LDA #$FF
STA 764
JMP $FD40
PONDATA
LDA BLOQUES
STA BLQ
LDA BLOQUES+1
STA BLQ+1
LDA BLOQUES+2
STA BLQ+2
LDY #$13
?PONDATA
LDA NAME,Y
STA NME,Y
DEY
BPL ?PONDATA
RTS
INITSIOV
LDY #$0B
?INITSIOV
LDA DNHP,Y
STA $0300,Y
DEY
BPL ?INITSIOV
LDA #$00
STA 77 ;$4D
RTS
AUTORUN
LDX # <PAG7
LDY # >PAG7
LDA #$02
STX MVPG7+1
STY MVPG7+2
STA @BL4
FALTA
JSR INITSIOV
LDX #<??DIR
LDY #>??DIR
STX $0304
STY $0305
LDX #131 ; $83
LDY #$00 ; $00
STX $0308
STY $0309
LDY #$00
TYA
CLBUF
STA ??DIR,Y
INY
CPY #131 ;$83
BNE CLBUF
LDA #$55
STA ??DIR
STA ??DIR+1
LDX #$FC
LDY #127 ;$7F
DEC @BL4
BPL NOFIN
LDX #$FA
LDY #LAST
STY ??DIR+130
NOFIN
STX ??DIR+2
MVPG7
LDA PAG7,Y
STA ??DIR+3,Y
DEY
BPL MVPG7
JSR $E459
CLC
LDA MVPG7+1
ADC #$80
STA MVPG7+1
LDA MVPG7+2
ADC #$00
STA MVPG7+2
LDA @BL4
BPL FALTA
RTS
GAUTO
LDA $D20A
STA GENDAT
STA @GENDAT
LDA #$FF
STA $D301
JSR AUTORUN
JSR INITSIOV
LDX # <131
LDY # >131
STX $0308
STY $0309
LDX # <PAG4
LDY # >PAG4
STX $0304
STY $0305
JSR $E459
JSR INITSIOV
LDA $D301
AND FTURBO
STA $D301
LDX #$20
STX $021C
?GAUTO
LDX $021C
BNE ?GAUTO
LDX # <LLOAD
LDY # >LLOAD
STX $0308
STY $0309
LDX # <LOAD
LDY # >LOAD
STX $0304
STY $0305
JSR $E459
RTS
REST
LDY #$04
??REST
LDA BYTES,Y
STA BAKBYT,Y
DEY
BPL ??REST
LDY #$02
???REST
LDA BLOQUES,Y
STA BAKBLQ,Y
DEY
BPL ???REST
RTS
?REST
LDY #$04
????REST
LDA BAKBYT,Y
STA BYTES,Y
DEY
BPL ????REST
LDY #$02
?????REST
LDA BAKBLQ,Y
STA BLOQUES,Y
DEY
BPL ?????REST
LDA CONT
STA PFIN
RTS
EXNHPUT
LDA #$80
STA 77
PLA
PLA
PLA
PLA
RTS
NHPUT
JSR SAVESIO
LDA #$55
STA ??DIR
STA ??DIR+1
LDA #252 ;$FC
STA ??DIR+255
LDA FTURBO
AND #$DF
STA $D301
LDX # <BAFER
LDY # >BAFER
STX M+1
STY M+2
LDX #$00
LDY #$00
STY $02E2
JSR GRABACION
JMP ?MVBF
GRABACION
LDA PFIN
STA ??DIR+2
BEQ EXNHPUT
CMP #$01
BNE RETURN
LDA CONT+1
STA ??DIR+255
RETURN
RTS
?MVBF
JSR GBYTE
STA STARTF
JSR GBYTE
STA STARTF+1
AND STARTF
CMP #$FF
BEQ ?MVBF
JSR GBYTE
STA FINISH
JSR GBYTE
STA FINISH+1
NHLOP
JSR GBYTE
LDA STARTF
CMP #$E3
BNE ?NHLOP
LDA STARTF+1
CMP #$02
BNE ?NHLOP
STA $02E2
?NHLOP
LDA STARTF
CMP FINISH
BNE NHCONT
LDA STARTF+1
CMP FINISH+1
BEQ ?MVBF
NHCONT
INC STARTF
BNE NOHI
INC STARTF+1
NOHI
JMP NHLOP
GBYTE
CPY ??DIR+255
BEQ EGRAB
TYA
M
EOR BAFER,X
EOR GENDAT
STA ??DIR+3,Y
TYA
EOR ??DIR+3,Y
EOR GENDAT
INC GENDAT
INY
INX
BNE EXNHPIT
INC M+2
BPL EXNHPIT
PHA
CLC
LDA $D301
ADC #$04
STA $D301
LDA # >BAFER
STA M+2
PLA
EXNHPIT
RTS
EGRAB
DEC PFIN
TXA
PHA
JSR INITSIOV
JSR $E459
LDX #$02
DECBL01
LDA BLOQUES,X
CMP #$10
BNE DECBL02
LDA #$19
STA BLOQUES,X
DEX
BPL DECBL01
DECBL02
DEC BLOQUES,X
PLA
TAX
LDA $02E2
BNE SLOWB
SIGUE
JSR GRABACION
LDY #$00
JMP GBYTE
SLOWB
TXA
PHA
LDX # <350 ;$015e
LDY # >350
STX $021C
STY $021D
IRG
LDA $021D
BNE IRG
LDA $021C
BNE IRG
LDA #$00
STA $02E2
PLA
TAX
JMP SIGUE
DOS
JMP ($0C)
@START
JSR DOS
START
LDX # <DLS
LDY # >DLS
STX $0230
STY $0231
LDA #$90
STA $02C8
STA $02C6
LDA #$CA
STA $02C5
JSR RESTORE
LDX # <CRSR
LDY # >CRSR
STX PCRSR
STY PCRSR+1
JSR RUTLEE
JSR SETUR
TYA
BEQ NOTITLE
LSR
STA RY+1
LDA #10
SEC
SBC RY+1
STA RY+1
LDX #$00
LDY RY+1
WRITE
LDA CRSR,X
STA NAME,Y
INY
INX
CPX RY
BNE WRITE
NOTITLE
LDX # <FILE
LDY # >FILE
STX PCRSR
STY PCRSR+1
JSR RUTLEE
LDY #19
CONV
LDA FILE,Y
BEQ ?REMAIN
AND #$7F
CMP #64
BCC ADD32
CMP #96
BCC SUB64
BCS ?REMAIN
ADD32
CLC
ADC #32
BCC OKLET
SUB64
SEC
SBC #64
?REMAIN
LDA #$9B
OKLET
STA ??FILE,Y
DEY
BPL CONV
JSR OPEN
JSR FGET
JSR CLOSE
JSR PONDATA
JSR REST
OTRACOPIA
JSR ?REST
JSR OPENC
JSR GAUTO
JSR NHPUT
LDX #$3C
LDA #$03
STA 53775
STX $D302
WAIT
LDA 53279
CMP #$07
BEQ WAIT
CMP #$06
BEQ OTRACOPIA
CMP #$03
BNE WAIT
JMP START
PIRATAS
JSR CLOSE
LDX # <OPENK
LDY # >OPENK
JSR CLOSE
JSR KEM
LDX # <@START
LDY # >@START
LDA #$03
STX $02
STY $03
STA $09
LDY #$FF
STY $08
INY
STY $0244
JMP START
RUN PIRATAS