Modified ColecoVision BIOS - Now working with NES controllers!

A project log for The Homebrew Handwired Z80 Computer - H2Z80

A 64K Z80 computher that you cand build by yourself only with perfboards, wires and some components

jorisclaytonJorisclayton 05/21/2024 at 01:540 Comments

    Now I'm ready with the modified Coleco Vision BIOS to the H2Z80. This BIOS version replace all the original coleco controller routines like read, decode, debounce memory clear, etc... I rewrite it from zero as my controller interface is much more simple than the Coleco ones, all the 8 data bits, corresponding to all 8 controller buttons, can be accessed at one time, just by read the controller ports (0E0h for player 1 and 0E1h for player 2). 

    It's was a little difficult, as I'm not much familiarize with assembly, I already write some code to interface some stuff like a 16x2 LCD and a PS/2 keyboard but understand all the Coleco controller routines take some time untill i ccould start to rewrite then. First I try to interpretate the BIOS with help of COLECOVISION CODING GUIDE book and do some little adjust to decode the NES protocol instead of the Coleco controllers, but it do not worked for me, so I mapped the RAM addresses used by the controllers with the BIOS code and a emulator that can show the RAM while runnig to check if it's really what I'm thinking that occours when the game is running.

     After read and map the RAM used by the controllers, I wrote this code that handle the NES controllers and interprets then to act like the ones expected by the system, I need to stay whith the BIOS size, 8192 bytes for this one that I'm using, to it continues to work for the direct addressed calls makes by the ROMs and by the own bios that I have. Also the controller interface part takes up to 532 bytes, my new version only needs 188 bytes so all the difference is filled by NOPs. 

    I do not found a workable BIOS with comments so I disassembled one with Z80DAS and interprated it with the coleco book mentioned above, I only used the controller Interface part, so all the other stuff like sound, VDP interfaces, logos, etc... stay as it was before. This BIOS works with the loader.asm program, written by J.B Langston, who I need to thanks for share his project and for direct help me when I'm stuck in some parts of my project. Here is a link for the loader.asm program page:

    Now the next step is interface a PS/2 keyboard to work with CPM 2.2 and TMS9918 directly in the 4.3" display, all indeppendent from terminal emulator on my PC, I wish to make my H2Z80 don't need more to be conected on my desktop/notebook, just like a real computer that works by itself.

    PS: As the controllers needs the modified BIOS to work with the Coleco Vision games, they, obviously, just work with games that uses the BIOS to interface the controllers and, yes, there are much games that do all the I/O stuff by itself, so they will not work with this project. For me it's not a problem as my goal isn't to run all ColecoVision library, it's just to learn a little more, and I learn a lot doing this little shit work, while having fun and do some eletronics!