3/17/2016 updated
Status
FTDI Done
~ UPDATE ~
Attached: 0.3.0U Preparing for G2 ATA Support made an extra 74HC00 by mistake.
I should also mention i have a good enough parts to make 1 complete unit with g2 connector
and 2-3 ones minus g2 port...
eCastos is now taking shape , though still very minimal its progress a bit since the OP.
Please download and run on a capable dreamcast plox. let me know!
Also check the "My Help Requests" section of this post
Code: Select all
/* Author: Warren Cyrus ~ DevolutionX
* This source code is composed with several kallistios provided examples.
*
* Additional code was written by the author.
* v0.3.0U 02/10/16
*/
CCCCCCCCCCCCC tttt
CCC::::::::::::C ttt:::t
CC:::::::::::::::C t:::::t
C:::::CCCCCCCC::::C t:::::t
eeeeeeeeeeee C:::::C CCCCCC aaaaaaaaaaaaa ssssssssss ttttttt:::::ttttttt ooooooooooo ssssssssss
ee::::::::::::ee C:::::C a::::::::::::a ss::::::::::s t:::::::::::::::::t oo:::::::::::oo ss::::::::::s
e::::::eeeee:::::eeC:::::C aaaaaaaaa:::::ass:::::::::::::s t:::::::::::::::::t o:::::::::::::::oss:::::::::::::s
e::::::e e:::::eC:::::C a::::as::::::ssss:::::stttttt:::::::tttttt o:::::ooooo:::::os::::::ssss:::::s
e:::::::eeeee::::::eC:::::C aaaaaaa:::::a s:::::s ssssss t:::::t o::::o o::::o s:::::s ssssss
e:::::::::::::::::e C:::::C aa::::::::::::a s::::::s t:::::t o::::o o::::o s::::::s
e::::::eeeeeeeeeee C:::::C a::::aaaa::::::a s::::::s t:::::t o::::o o::::o s::::::s
e:::::::e C:::::C CCCCCCa::::a a:::::assssss s:::::s t:::::t tttttto::::o o::::ossssss s:::::s
e::::::::e C:::::CCCCCCCC::::Ca::::a a:::::as:::::ssss::::::s t::::::tttt:::::to:::::ooooo:::::os:::::ssss::::::s
e::::::::eeeeeeee CC:::::::::::::::Ca:::::aaaa::::::as::::::::::::::s tt::::::::::::::to:::::::::::::::os::::::::::::::s
ee:::::::::::::e CCC::::::::::::C a::::::::::aa:::as:::::::::::ss tt:::::::::::tt oo:::::::::::oo s:::::::::::ss
eeeeeeeeeeeeee CCCCCCCCCCCCC aaaaaaaaaa aaaa sssssssssss ttttttttttt ooooooooooo sssssssssss
INFO:
The file main.c is eCastos' core operating facility.
The included Librarys are supportlib and protolib.
Supportlib is recycled & slightly altered code from
SWAT over @ http://www.dc-swat.ru/
Protolib is written by the Author.
LICENSE:
PART1:
The Following Files are NOT MINE:
enc28j60.c enc28j60.h g2_bus.c g2_bus.h
Please visit SWAT over @ http://www.dc-swat.ru/
For this information.
PART2:
All Remaining Code is CC4.0 License.
libsupport.a:
This is the core support library.
Includes drivers for Serial Ethernet Phy
And G2 BUS ATA Drives.
Files:
enc28j60.c / enc28j60.h
g2_bus.c / g2_bus.h
libproto.a:
This is the core library for eCastos.
Files:
proto_sub1.c / proto_sub1.h
proto_sub2.c / proto_sub2.h
proto_sio.c / proto_sio.h
Application:
Features as of the version in the header of this document include.
HDD:
G1ATA Hard Drive Support
EXT2 FileSystem Support
Device Detection
Device Initialization
Device Data (Sync | Flushing)
FileSystem Initialization
FileSystem Mount Control
Preliminary Write Support
Read And Display Root on G1
SIO:
Serial Device Check
Serial Device Initialization
Serial Device Shutdown
Serial Device Sync | Flush
PVR:
Display Initialization
Display Background
Display Text Initialization
Display On Screen Text
Render Primitives
Pause Rendering The PVR
GEN:
Main Program Loop
Primary Update Function
MapleBus Controllers
Controller Input
Program Execution
Shutdown Control
Subelf Display
State Machine
CREDIT WHERE DUE:
Bluecrab - Several Examples from src included in KOS and online @ http://dcemulation.org/
SWAT - Sources from DreamShell his popular OS
DanPotter - G2_bus Code
NOTES:
This is a Work In Progess
Testing is done over serial with dcload-serial 1.0.4 windows executable and the companion cdr.
MAKEFILE_DOC:
make options:
all - builds the librarys, subelf, and bootelf
________________________________________
^\ all /^
^ \__________________________________/ ^
^ make sure to build this first if ^
^ you used the clean command. librarys ^
^ are first to be built. ^
^______________________________________^
build - builds the subelf, and bootelf
________________________________________
^\ build /^
^ \__________________________________/ ^
^ this make command is the one to use ^
^ if requiring an executable for ^
^ testing on hardware. ^
^______________________________________^
dbg - starts dc-tool.exe and executes the target as elf
run - starts dc-tool.exe and ececutes the target as bin
________________________________________
^\ dbg & run /^
^ \__________________________________/ ^
^ can change in the makefile. ^
^ i use my own usb to serial setup ^
^ thats why its set to 1500000kbps ^
^ change the com port to match ur com# ^
^______________________________________^
rebuild - cleans the entire source, then executes 'all' and 'build' for a fresh build
clean - cleans the entire source
[code]
make rebuild
make dbg
OR
make rebuild
make run
OR
make clean
make all
make buildrun
make dbg
LIBPROTO Library
proto_sio.h:
[ int initSIO(int baud, int fifo) ]
Sets the parameters for the serial device.
Then detect & initialize the serial device.
[ int stopSIO() ]
Sends Shutdown for the serial device.
[ int flushSIO() ]
Sends pending data and syncs the serial device.
proto_sub1.h:
[ initTXT(int *n) ]
Sets the Encoding.
[ void initBG(char *bg) ]
Loads 'bg' into pvr texture memory.
[ void drawBG() ]
Renders the png and sets the parameters for rendering.
[ initVideo(int disMode, int pixMode) ]
Initializes the video.
Sets up the display with the KOS macros.
[ clearVideo(int r, int g, int b) ]
Clears video with input rgb color.
If in a loop this function can draw the input rgb color indefinitely.
[ printPVR(int x, int y, char *str) ]
Takes the input character string, also taking
the x and y coordinates then automatically
render it starting at top left corner(0=x,0=y)
and typical starting point for printPVR is x=0, y=0.
Code: Select all
//MAX is 20 lines #DISP_HEIGHT-480 / 24 = 20
//MAX characters is 53 per line #DISP_WIDTH-640 / 12 = 53 rounded down
while (MAGIC_FUNCTION) {
printPVR(0,0,"HELLO WORLD NOTE: 12 is the font char width");
printPVR(0,24,"Hello from 2nd line NOTE: 24 is font char height");
}
Recycled: Bluecrab
void drawHLine(int x1, int x2, int y, uint16 c);
void drawVLine(int x, int y1, int y2, uint16 c);
void drawCBox(int x1, int y1, int x2, int y2, uint16 c);
void drawFBox(int x1, int y1, int x2, int y2, uint16 c);
proto_sub2.h:
//FINISH SECTION
[ void mountCTL(char *blkhdd, int state ]);
[ void printDIR(char *dir ]);
[ void printRFS() ]
[ int checkHDD() ]
[ int initHDD() ]
[ int initFS(char *blkhdd) ]
[ int removeFS(char *blkhdd) ]
[ int syncHDD(char *blkhdd) ]
[ int writeToTextFile(char *blkhdd, char *str) ]
[ int writeRTF(char *blkhdd) ]
[ int readRTF(char *blkhdd) ]
[ int executeSub(char *rdsubelf, int bootm) ]
[ void shutDown(char *blkhdd) ]
[/code]
~ My Help Requests ~
[1] Figure out how to make a directory / file browser base with cut, copy, paste, delete.