Videopac / Odyssey2 forum
June 26, 2019, 04:46:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Join Rafael's Haunted Woods contest and win a copy of the game!
 
   Home   arcade Help Login Register links videopac.nl  
Pages: 1 2 [3] 4   Go Down
  Print  
Author Topic: mbed emulating a ROM cartridge  (Read 14208 times)
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #30 on: February 05, 2012, 06:07:00 PM »

Another step done: the Videopac sends key and/or joystick commands to the mbed en it responds too  Smiley

Code:

     call vdcenable ; enable VDC
call waitvsync ; wait for vblank

jt0 nomov ; mbed has not cleared T0 so no new data can be sent

dis i ; disable further interrupts
sel rb0 ; select register bank 0
in a,p1 ; get port1 setting
mov r6,a ; save in R6
orl p1,#0xbc ; enable luminance, disable COPYMODE, NC, EXRAM, VDC and KEYBOARD
anl p1,#0xbb ; enable KEYBOARD

mov r0,#0xf0 ; preset R0
mov r2,#0x08 ; and R2
call readkey_plus ; scan keyboard
jb7 nokey ; skip if no key pressed

;
; send keyboard code to the mbed side
;
call extramenable ; enable EXRAM

orl a,#0x80 ; set bit 7
mov r0,a ; make pointer
mov a,#0x00 ; set all data bits low
movx @r0,a ; write keyboard data

call vdcenable ; enable VDC
mov a,#0x56 ; play sound 0x56
call playsound ; do it
jmp startdisplay ; show it

nokey:
mov r0,#joystickdelay ; pointer to joystick delay
mov a,@r0 ; get value
jnz nojoy ; non zero ? then skip

mov r1,#0x00 ; select joystick 0
call getjoystick ; call bios
mov a,r1 ; get bit values
cpl a ; invert
jz nomov ; if non zero stick is not moved

;
; send joystick code to the mbed side
;
call extramenable ; enable EXRAM

orl a,#0x80 ; set bit 7
mov r0,a ; make pointer
mov a,#0xff ; set all data bits high
movx @r0,a ; write joystickdata

call vdcenable ; enable VDC
mov a,#0x66 ; play sound 0x66
call playsound ; do it

mov r0,#joystickdelay ; point to joystickdelay
mov a,#0x07 ; reset to 7 (vblanks)
nojoy:
dec a ; decrement joystick delay
mov @r0,a ; store back
nomov:

Data bit 5 is used for the voice as reset bit but it is now used as a selection bit between keyboard and joystick data.


Next step: load the selected rom into the emulator and start it up..

Another idea: using the '?' key could make a screen appear which has a (small) description of the selected game. This could be based on the CRC of the rom file.
« Last Edit: May 22, 2012, 07:42:34 AM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #31 on: February 06, 2012, 08:12:46 PM »

Testing the scrolling function with joystick and keyboard

YouTube: http://www.youtube.com/watch?v=HqzYRxexpx0
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
lordbubsy
Trying to get the cartridge in...
*
Posts: 5


G7000 rookie


« Reply #32 on: February 17, 2012, 07:51:00 PM »

Quote
We should continue this further in the mbed rom emu thread 

So far I only tested it with the mbed. I am sure the new mbed with the lightweight CPU (Cortex M0) will be too slow (it is also only 10 Euros cheaper than a 'real' mbed). The LPCxpresso and LPCmini both lack the 2MB flash storage so you will have to program some roms in the 512k of onboard CPU flashrom (the mbed's CPU has 512k of internal flash where it downloads the latest .bin file found on the 2MB of USB storage) The advantage of the LPCxpresso is that it has a lot more port pins available and (micro)SD card storage would be easy to add. With the mbed all external port pins are occupied.
OK, I hope this is the right thread.

Sorry for the late response, meanwhile I found:
http://www.watterott.com/de/LPC1769-LPCXpresso
23,80 (+3,50 shipping)

But I?ll wait till you finished your proto, it?s very exiting!
Will hard- and software be open source?


Logged

8-bit assimilation
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #33 on: February 17, 2012, 09:42:13 PM »

Yes the LPCxpresso is more pleasingly priced than the mbed but also lacks some features (onboard 2 MB flash rom, USB debug port and ethernet interface). My testboard is officially for the LPCxpresso so it has more IO pins available but the programming environment of the mbed is much easier to use. I do not like IDE?s: they restrict me too much  Smiley Still, once the mbed code has been compiled to a .bin file it can be easily transferred to the LPCxpresso.

So far my mbed code is not public, I have searched for something similar and could not find anything so it is quite 'unique' I guess. Also the Voice emulation part has some limitations concerning rom contents.
The Videopac code I have no problem with sharing, the first steps have been done by Rene, I only refined the code with some helpful hints from Ted.  Without the mbed part it is not very useful as it just displays the same 'rom' contents over and over again on the screen. The mbed can change that 'rom' contents when needed resulting in an 'instant change of display' on the Videopac side.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #34 on: February 21, 2012, 07:00:20 PM »

Small update:

I will go ahead with the LPCxpresso instead of the mbed for the cartridge prototype, with a bit of luck I can manage to take it with me to Apeldoorn to demonstrate it live. The storage will then be on (micro)SD card instead of the 2MB flash which will give even more possibilities. Furthermore I can optimize the data and address connections and calculations with the LPCxpresso because of it having more adjacent port pins available.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
lordbubsy
Trying to get the cartridge in...
*
Posts: 5


G7000 rookie


« Reply #35 on: February 21, 2012, 10:41:21 PM »

Quote
So far my mbed code is not public, I have searched for something similar and could not find anything so it is quite 'unique' I guess. Also the Voice emulation part has some limitations concerning rom contents.
The Videopac code I have no problem with sharing, the first steps have been done by Rene, I only refined the code with some helpful hints from Ted.  Without the mbed part it is not very useful as it just displays the same 'rom' contents over and over again on the screen. The mbed can change that 'rom' contents when needed resulting in an 'instant change of display' on the Videopac side.
Thanks for the info.
I finished my G7000 mods and cleaning, Smiley and enjoyed Satellite Attack on a SONY Trinitron TV for quite a while now.
With a homemade Arcade Joystick ( www.arcadeshop.de/index.php?language=en ) the feeling is even better!

Quote
I will go ahead with the LPCxpresso instead of the mbed
Sounds really great!

Nevertheless I?ll try to modify a cartridge with a 27C080 EPROM and try to address the different games (2k, 4k, 8k) with an AVR.
Logged

8-bit assimilation
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #36 on: February 26, 2012, 08:06:58 PM »

And it fits inside the cartridge.

By separating the programming part and the controller part the LPCxpresso fits nicely inside a cartridge. Now the microSD card socket needs to be placed somewhere convenient and the audio output has to have an outside connection and the prototype can be tested on several machines.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1115



« Reply #37 on: February 26, 2012, 10:43:29 PM »

cool - how much longer for the production run ?  Cool
Logged

sex, lies, and videopac
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #38 on: February 27, 2012, 07:26:06 AM »

Has anyone made an Eagle library for a Videopac cartridge ?
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #39 on: February 28, 2012, 07:27:02 AM »

Hmm.. seems the programming part also powers the CPU part with 3.3 Volts, so I need to install a 3.3V regulator to get it going   Smiley
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #40 on: February 29, 2012, 10:34:54 PM »

Regulator installed, first game from internal ROM finally runs.. Even standalone without the programming part.  Smiley
I falsely assumed that after reset the ports were initialized as inputs which they were not, some hours lost in debugging that one...
Next step: SD card connection, first get some sleep.... Shocked
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #41 on: March 01, 2012, 10:13:53 PM »

Phew.. (micro)SD card is working also, I used the supplied microSD to SD adapter as cardreader on the proto cartridge ( I simply glued it at the top of the front of the cartridge. I even managed to squeeze in a 3.5mm stereo jack for the audio output of The Voice.

Next step: the reset circuit. This must deliver a short reset pulse to the mbed/lpcxpresso when the reset button of the Videopac is pressed longer than 1 second (aka no bus activity for longer than 1 second since there is no reset line on the cartridge port) The mbed/lpcxpresso needs to restart already after pressing the reset button so it can load in the menu from the sdcard and be ready when the 8048 of the Videopac starts up again.

For now, I plugged the cart into the N60 and it is running some games already from the microSD card and it looks great!

Wit a bit of luck it will be 'ready enough' to take it to Apeldoorn.
« Last Edit: May 22, 2012, 07:47:21 AM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 859



gertk64
WWW
« Reply #42 on: March 01, 2012, 10:32:11 PM »

some more pics..
« Last Edit: May 22, 2012, 07:48:30 AM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1115



« Reply #43 on: March 01, 2012, 10:53:27 PM »

so cool !! can I be the first one to order one once they are available ?  Cool
Logged

sex, lies, and videopac
VideopacBelgium
Totally devoted to Videopac
*******
Posts: 1641



« Reply #44 on: March 02, 2012, 12:07:02 AM »

Great work !!!
Can I be the 2nd one to order one cart?  Kiss
Logged

Videopac digger
Pages: 1 2 [3] 4   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!