MIPS Assembly programming for the Playstation 1 (PS1/PSX)

The Playstation was Sony's first home console, While inferior in some ways to the more powerful N64, the Playstations huge storage capability, combined with an impressive game library saw the Playstation become the most popular console of the period, catapulting the playstation to the top of the console market.

Cpu 33.87 mhz  R3000 (MIPS I)
Ram 2MB
Video 1MB VRAM
Resolution 256x224 / 320x240 / 640x480

Documentation

Nocash PSXSPX Playstation Specifications

Memory Map

KUSEG KSEG0
(Cached)
KSEG1
(Uncached)
KSEG2
(IO Ports)
Size Purpose
0x00000000 0x80000000 0xA0000000 -- 2048K 
Main RAM (first 64K reserved for BIOS)
0x1F000000 0x9F000000 0xBF000000 -- 8192K Expansion Region 1 (ROM/RAM)
0x1F800000 0x9F800000 -- -- 1K Scratchpad (D-Cache used as Fast RAM)
0x1F801000 0x9F801000 0xBF801000 -- 8K I/O Ports
0x1F802000 0x9F802000 0xBF802000 -- 8K Expansion Region 2 (I/O Ports)
0x1FA00000 0x9FA00000 0xBFA00000 -- 2048K Expansion Region 3 (whatever purpose)
0x1FC00000 
0x9FC00000 
0xBFC00000 
-- 512K BIOS ROM (Kernel) (4096K max)
-- -- -- 0xFFFE0000 
0.5K I/O Ports (Cache Control)

Gpu Commands

Written to port 0x1F801810

Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Clear Cache 0 0x01 0
Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Set Screen Width 0 0x06 End X Start X
Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Send image to Framebuffer 0 0xA0























CPU to VRAM 1 Y X

2 H W

3 Pixel 2 Pixel 1

.. .. ...

n Pixel n*2+1 Pixel n*2
Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Fill Area 0 0x02 Color

1 Y X

2 H W
Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Copy Rectangle 0 0x80























VRAM to VRAM 1 SY SX

2 DY DX

3 H W
Function Byte 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Get image from Framebuffer 0 0xC0























VRAM to CPU 1 Y X

2 H W
read from GPUREAD port 3 Pixel 2 Pixel 1

.. .. ...

n Pixel n*2+1 Pixel n*2


Screen Memory

Each pixel is represented by one BIG ENDIAN word, in the format %-BBBBBGGGGGRRRRR



Joypad Bits

We want to start the joypad reading routine.

First we set up a valid stack pointer, Next we're going to call the bios function at address 0x000000B0

The command is stored in register T1, A1,A2,A3 and A4 contain the parameters

We point A0 and A2 to 'Joydata'... once we perform these two bios calls, the JoyData memory will automatically be updated with the data from the joypad


The format of the bits in 'JoyData are shown below:


Bits
 Byte 
7     6    
     5    
4      3     
     2     
      1     
     0    
0 N/A
1 0x41 �A�
2 0x5A �Z�
3 LEFT DOWN RGHT UP START 1 1 SELECT
4 SQUARE X O TRIANGL R1 L1 R2 L2


Endian

The N64 is BIG ENDIAN
the PSX is LITTLE ENDIAN



 

View Options
Default Dark
Simple (Hide this menu)
Print Mode (white background)

Top Menu
***Main Menu***
Youtube channel
Patreon
Introduction to Assembly (Basics for absolute beginners)
Amazon Affiliate Link
AkuSprite Editor
ChibiTracker
Dec/Bin/Hex/Oct/Ascii Table

Alt Tech
Archive.org
Bitchute
Odysee
Rumble
DailyMotion
Please note: I wlll upload more content to these alt platforms based on the views they bring in

Z80 Content
***Z80 Tutorial List***
Learn Z80 Assembly (2021)
Learn Z80 Assembly (old)
Hello World
Simple Samples
Advanced Series
Multiplatform Series
Platform Specific Series
ChibiAkumas Series
Grime Z80
Z80 Downloads
Z80 Cheatsheet
Sources.7z
DevTools kit
Z80 Platforms
Amstrad CPC
Elan Enterprise
Gameboy & Gameboy Color
Master System & GameGear
MSX & MSX2
Sam Coupe
TI-83
ZX Spectrum
Spectrum NEXT
Camputers Lynx

6502 Content
***6502 Tutorial List***
Learn 6502 Assembly
Advanced Series
Platform Specific Series
Hello World Series
Simple Samples
Grime 6502
6502 Downloads
6502 Cheatsheet
Sources.7z
DevTools kit
6502 Platforms
Apple IIe
Atari 800 and 5200
Atari Lynx
BBC Micro
Commodore 64
Commodore PET
Commander x16
Super Nintendo (SNES)
Nintendo NES / Famicom
PC Engine (Turbografx-16)
Vic 20

68000 Content
***68000 Tutorial List***
Learn 68000 Assembly
Hello World Series
Platform Specific Series
Simple Samples
Grime 68000
68000 Downloads
68000 Cheatsheet
Sources.7z
DevTools kit
68000 Platforms
Amiga 500
Atari ST
Neo Geo
Sega Genesis / Mega Drive
Sinclair QL
X68000 (Sharp x68k)

8086 Content
Learn 8086 Assembly
Platform Specific Series
Hello World Series
Simple Samples
8086 Downloads
8086 Cheatsheet
Sources.7z
DevTools kit
8086 Platforms
Wonderswan
MsDos

ARM Content
Learn ARM Assembly
Learn ARM Thumb Assembly
Platform Specific Series
Hello World
Simple Samples
ARM Downloads
ARM Cheatsheet
Sources.7z
DevTools kit
ARM Platforms
Gameboy Advance
Nintendo DS
Risc Os

Risc-V Content
Learn Risc-V Assembly
Risc-V Downloads
Risc-V Cheatsheet
Sources.7z
DevTools kit

MIPS Content
Learn Risc-V Assembly
Platform Specific Series
Hello World
Simple Samples
MIPS Downloads
MIPS Cheatsheet
Sources.7z
DevTools kit
MIPS Platforms
Playstation
N64

PDP-11 Content
Learn PDP-11 Assembly
Platform Specific Series
Simple Samples
PDP-11 Downloads
PDP-11 Cheatsheet
Sources.7z
DevTools kit
PDP-11 Platforms
PDP-11
UKNC

TMS9900 Content
Learn TMS9900 Assembly
Platform Specific Series
Hello World
TMS9900 Downloads
TMS9900 Cheatsheet
Sources.7z
DevTools kit
TMS9900 Platforms
Ti 99

6809 Content
Learn 6809 Assembly
Learn 6309 Assembly
Platform Specific Series
Hello World Series
Simple Samples
6809 Downloads
6809/6309 Cheatsheet
Sources.7z
DevTools kit
6809 Platforms
Dragon 32/Tandy Coco
Fujitsu FM7
TRS-80 Coco 3
Vectrex

65816 Content
Learn 65816 Assembly
Hello World
Simple Samples
65816 Downloads
65816 Cheatsheet
Sources.7z
DevTools kit
65816 Platforms
SNES

eZ80 Content
Learn eZ80 Assembly
Platform Specific Series
eZ80 Downloads
eZ80 Cheatsheet
Sources.7z
DevTools kit
eZ80 Platforms
Ti84 PCE

IBM370 Content
Learn IBM370 Assembly
Simple Samples
IBM370 Downloads
IBM370 Cheatsheet
Sources.7z
DevTools kit

Super-H Content
Learn SH2 Assembly
Hello World Series
Simple Samples
SH2 Downloads
SH2 Cheatsheet
Sources.7z
DevTools kit
SH2 Platforms
32x
Saturn

PowerPC Content
Learn PowerPC Assembly
Hello World Series
Simple Samples
PowerPC Downloads
PowerPC Cheatsheet
Sources.7z
DevTools kit
PowerPC Platforms
Gamecube

Work in Progress
ChibiAndroids

Misc bits
Ruby programming









Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book





Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!


























































































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book





Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!



































































































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book





Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!