Copy Link
Add to Bookmark
Report

The Doctor V64 Development Kit

Nintendo64's profile picture
Published in 
N64 various
 · 6 Dec 2020
The Doctor V64 for the Nintendo 64
Pin it
The Doctor V64 for the Nintendo 64

The Doctor V64 Development Kit
V 0.1

by _Demo_

General information

The V64 is based on a 6502 CPU, a custom PPU and a mpeg decoding unit. The bios rom can be paged between 8000h and FFFFh and there is 800h bytes of ram starting at 0000h.

I/O ports

The V64 i/o ports are mapped from C000h to C01Fh and 4016h-4017h

   ---------------------------------------------------------- 
|C000h | RW | W bit 2-0 ROM BANK |
| | | R bit 7 IDE INT |
| | | bit 6 MPEG INT (?) |
| | | bit 1 N64 POWER (?) |
| | | bit 0 PPU READY (1=READY) |
|----------------------------------------------------------|
|C001h | | W bit 7-0 WRITE TO PPU |
| | | R ? |
|----------------------------------------------------------|
|C002h | | RW ? |
|----------------------------------------------------------|
|C003h | | RW ? |
|----------------------------------------------------------|
|C004h | | RW RAM ADDRESS 0 |
|C005h | | RW RAM ADDRESS 1 |
|C006h | | RW RAM ADDRESS 2 |
|C007h | | RW RAM ADDRESS 3 |
|----------------------------------------------------------|
|C008h | | RW ? |
|----------------------------------------------------------|
|C009h | | RW ? |
|----------------------------------------------------------|
|C00Ah | | RW ? |
|----------------------------------------------------------|
|C00Bh | | RW ? |
|----------------------------------------------------------|
|C00Ch | | RW ? |
|----------------------------------------------------------|
|C00Dh | | RW IDE ADDRESS REGISTER |
|----------------------------------------------------------|
|C00Eh | | RW ? |
|----------------------------------------------------------|
|C00Fh | | W bit 1 BACKUP MODE |
|C00Fh | | bit 0 DRAM ENABLE |
|----------------------------------------------------------|
|C010h | | RW IDE DATA (LOW BYTE) |
|----------------------------------------------------------|
|C011h | | RW DRAM DATA (LOW BYTE) |
|----------------------------------------------------------|
|C012h | | RW ? |
|----------------------------------------------------------|
|C013h | | RW ? |
|----------------------------------------------------------|
|C014h | | RW IDE/DRAM (HIGH BYTE) |
|----------------------------------------------------------|
|C015h | | RW PRINTER PORT DATA (?) |
|----------------------------------------------------------|
|C016h | | RW PRINTER PORT EXTRA PINS (?) |
|----------------------------------------------------------|
|C017h | | RW PRINTER PORT EXTRA PINS (?) |
|----------------------------------------------------------|
|C018h | | RW MPEG CHIP (?) |
|C019h | | RW MPEG CHIP (?) |
|C01Ah | | RW MPEG CHIP (?) |
|C01Bh | | RW MPEG CHIP (?) |
|C01Ch | | RW MPEG CHIP (?) |
|C01Dh | | RW MPEG CHIP (?) |
|C01Eh | | RW MPEG CHIP (?) |
|C01Fh | | RW MPEG CHIP (?) |
----------------------------------------------------------


How to make a working .R64

To make a valid .R64 file, you need to make 6502 code starting at offset 0200h. The sample included with the kit show how to make sure the file is 1536 bytes. To compile, simply type x816 -d sample.asm then rename the resulting .bin to .r64 to be able to send it to the v64.

NES gamepad?

The V64 use the same joypad port the NES use. To know if the buttons on the top of the V64 have been pressed, simply write 1 then 0 at 4016h and read it 8 times.

4017h seems to be loaded when doing a dram test but i don't know why.

V64 PPU

The ppu used in the V64 is not too complicated, it use 1 byte commands to draw the screen.

 PPU      COMMANDS 
00h-7Fh Draw a tile
90h+Y Y position
A0h+X X position

SAMPLE.ASM

   .hrom 
.base $000200 ; main program
.org $200

PPUREADY = $C000
PPU = $C001
RESET = $FFFC

JSR.w WaitForKey
JSR.w INIT

LDA.w HelloMSG
STA.w MessageToDraw+1
LDA.w HelloMSG+1
STA.w MessageToDraw+2
JSR.w PRINTMSG

JSR.w WaitForKey

LDA.w RESET
STA.w Reboot+1
LDA.w RESET+1
STA.w Reboot+2

Reboot: JMP.w RESET


INIT:
LDA.b #$90 ;X=0
JSR.w WRITEPPU
LDA.b #$A0 ;Y=0
JSR.w WRITEPPU
LDY.b #$00
- LDA.b #$7F
JSR.w WRITEPPU
INY
BNE -
LDY.b #$F7
- LDA.b #$7F
JSR.w WRITEPPU
INY
BNE -
LDA.b #$90 ;X=0
JSR.w WRITEPPU
LDA.b #$A0 ;Y=0
JSR.w WRITEPPU
RTS

WRITEPPU:
STA.w PPU
- LDA.w PPUREADY
LSR A
BCC -
RTS

WaitForKey:
JSR.w ReadKeypad1
LDA.w Keypad1
AND.b #$FF
BEQ.w WaitForKey
- JSR.w ReadKeypad1
LDA.w Keypad1
AND.b #$FF
BNE.w -
RTS

ReadKeypad1:
LDY.b #$01
STY.w $4016
LDY.b #$00
STY.w $4016
LDX.b #$F8
-
LDA.w $4016
LSR A
ROL.w Keypad1
INX
BNE.w -
RTS

PRINTCHR:
CMP.b #$20
BNE PRINTCHR1
LDA.b #$7F
BNE PRINTCHRQ
PRINTCHR1:
CMP.b #'<'
BNE PRINTCHR2
LDA.b #$0B
BNE PRINTCHRQ
PRINTCHR2:
CMP.b #'>'
BNE PRINTCHR3
LDA.b #$0C
BNE PRINTCHRQ
PRINTCHR3:
CMP.b #45
BEQ PRINTCHR3A
CMP.b #'_'
BNE PRINTCHR4
PRINTCHR3A:
LDA.b #$0D
BNE PRINTCHRQ
PRINTCHR4:
CMP.b #'.'
BNE PRINTCHR5
LDA.b #$0E
BNE PRINTCHRQ
PRINTCHR5:
CMP.b #','
BNE PRINTCHR6
LDA.b #$0F
BNE PRINTCHRQ
PRINTCHR6:
CMP.b #'O'
BNE PRINTCHR7
LDA.b #$00 ; USE '0' FOR 'O'
BEQ PRINTCHRQ
PRINTCHR7:
CMP.b #47
BNE PRINTCHR8
LDA.b #$6D
BNE PRINTCHRQ
PRINTCHR8:
CMP.b #'a'
BCC PRINTCHR9
CMP.b #'z'+1
BCS PRINTCHRQ
SEC
SBC.b #$10
JMP WRITEPPU
PRINTCHR9:
SEC
SBC.b #$30
PRINTCHRQ:
JMP WRITEPPU

PRINTMSG:
LDY.b #$00
AgainMSG:
MessageToDraw:
LDA.w buffer,y
CMP.b #$FF
BEQ MessageDoneMSG
JSR PRINTCHR
INY
BNE AgainMSG
MessageDoneMSG:
RTS

Hello: .dcb $91,$A0,'Hello world',$92,$A0,$FF
HelloMSG: .dcw Hello

.pad $07FF
buffer:
Keypad1: .dcb $FF


TEST.BAT

 x816 -d sample.asm 
copy sample.bin sample.r64
tpc2 0 sample.r64

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT