Forum Rule: Always post complete source code & details to reproduce any issue!
Page 8 of 10 FirstFirst ... 6 7 8 9 10 LastLast
Results 176 to 200 of 242

Thread: [posted] Commodore C64 Emulation on a Teensy 3.6 Microcontroller

  1. #176
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    If there are some free I/Os I think is better adding some buttons for using only some shortcuts to be used in "handheld" mode.
    I think are needed only 7 buttons: LOAD,",RUN,ENTER,cursors,Joystick Swap and Spacebar. This would make a portable console with no need to attach an USB keyboard, so can be made a fork without USB keyboard.
    If there are no IOs free (I don't have taken a look to code yet) maybe is possible to use the UART and attach a little device (like a PIC12F) that uses UART and take care of reading additional buttons

  2. #177
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,780
    See https://github.com/FrankBoesing/Teen..._PinMapUse.txt for used pins. Others are unused. For VGA, please have a look at the sources, or wait for an update of this file in the next days..

  3. #178
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    Looks like there are 10 or 12 unused IOs in the LCD version. The serial debug which pin uses?
    If I want to hook some buttons on those IOs and then use the sendString feature on the button press, where is the better place where to put some code to read buttons?

  4. #179
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,109
    Frank's note on a T_LC on the USB port could handle more buttons and provide input through the normal codepath.

    Could perhaps be a challenge to introduce code to monitor 'onboard' pin changes and respond once the processor has jumped to emulation execution - even if you found a place to hook the USB code to trigger the input?

    <edit> or stick a wireless keyboard radio plug in the USB port and use the keyboard as needed - that is what I was doing.
    Last edited by defragster; 04-06-2018 at 09:25 AM.

  5. #180
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Yesterday the parts arrived. Frankīs board kit and the TFT screen and Teensy 3.6 (ordered from Poland) Just the fun part left - to solder it all together and try out the software...

    Click image for larger version. 

Name:	20180410_200718.jpg 
Views:	35 
Size:	111.8 KB 
ID:	13560

  6. #181
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Guys, I need some help with the setup - something must be wrong with the Arduino IDE environment, as I get compiler errors about "println" declarations. It should be included from stdio.h or similar (thereīs a print.h somewhere). Compiling the BLINK test program works and I have gone through all the advice about moving libraries to proper directories etc. Compiler error and a warning, included for reference:

    Code:
    Arduino:1.8.5 (Windows 7), TD: 1.42-beta3, Kort:"Teensy 3.6, Serial, 240 MHz (overclock), Faster, Swedish"
    
    ...
    "C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++14 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=240000000 -DUSB_SERIAL -DLAYOUT_SWEDISH "@C:\Users\user1\AppData\Local\Temp\arduino_build_589447/sketch/defs.h" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_589447/pch" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Program Files (x86)\Arduino\libraries\Teensy64" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36" "-IC:\Program Files (x86)\Arduino\libraries\SdFat-master\src" "-IC:\Program Files (x86)\Arduino\libraries\Teensy-reSID-master" "C:\Program Files (x86)\Arduino\libraries\Teensy64\cpu.cpp" -o "C:\Users\user1\AppData\Local\Temp\arduino_build_589447\libraries\Teensy64\cpu.cpp.o"
    C:\Program Files (x86)\Arduino\libraries\Teensy64\cpu.cpp: In function 'void cpu_clock(int)':
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\cpu.cpp:2652:12: warning: variable 'writeCycles' set but not used [-Wunused-but-set-variable]
    
     static int writeCycles = 0;
    
                ^
    
    ...
    "C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++14 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=142 -DARDUINO=10805 -DF_CPU=240000000 -DUSB_SERIAL -DLAYOUT_SWEDISH "@C:\Users\user1\AppData\Local\Temp\arduino_build_589447/sketch/defs.h" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_589447/pch" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3" "-IC:\Program Files (x86)\Arduino\libraries\Teensy64" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36" "-IC:\Program Files (x86)\Arduino\libraries\SdFat-master\src" "-IC:\Program Files (x86)\Arduino\libraries\Teensy-reSID-master" "C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp" -o "C:\Users\user1\AppData\Local\Temp\arduino_build_589447\libraries\Teensy64\keyboard_usb.cpp.o"
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp: In member function 'virtual bool c64USBKeyboard::claim(Device_t*, int, const uint8_t*, uint32_t)':
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp:48:60: error: 'println' was not declared in this scope
    
       println("c64USBKeyboard claim this=", (uint32_t)this, HEX);
    
                                                                ^
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp: In member function 'void c64USBKeyboard::LEDS(uint8_t)':
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp:148:41: error: 'println' was not declared in this scope
    
       println("Keyboard setLEDS ", leds, HEX);
    
                                             ^
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp: In member function 'void c64USBKeyboard::updateLEDS()':
    
    C:\Program Files (x86)\Arduino\libraries\Teensy64\keyboard_usb.cpp:154:46: error: 'println' was not declared in this scope
    
       println("KBD: Update LEDS", leds_.byte, HEX);
    
                                                  ^
    
    Using library Teensy64 in folder: C:\Program Files (x86)\Arduino\libraries\Teensy64 (legacy)
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SPI 
    Using library USBHost_t36 at version 0.1 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHost_t36 
    Using library SdFat-master at version 1.0.5 in folder: C:\Program Files (x86)\Arduino\libraries\SdFat-master 
    Using library Teensy-reSID-master in folder: C:\Program Files (x86)\Arduino\libraries\Teensy-reSID-master (legacy)
    Error compiling for board Teensy 3.6.

  7. #182
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,071
    Might be a typo in the source code of keyboard_usb.cpp since println() can never be used alone, it needs an object inherited from the Stream class, as for example in Serial.println().

  8. #183
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by Theremingenieur View Post
    Might be a typo in the source code of keyboard_usb.cpp since println() can never be used alone, it needs an object inherited from the Stream class, as for example in Serial.println().
    Thanks! In this case, I just went the easy way for now... commented out those failing "println" and it all compiled nicely A familiar blue screen appeared.

  9. #184
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Running a few games. Some works, other donīt. A few will start, but hangs after a while. I made a film clip on some of them, just for fun:



  10. #185
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by zonkt View Post
    Running a few games. Some works, other donīt. A few will start, but hangs after a while. I made a film clip on some of them, just for fun:
    Depending on if the game has been cracked or not, or perhaps in what way. The result of loading and running it, may be different. I found a few sources with plenty of games and demos etc. Results so far:

    Works
    Donkey Kong
    Dig Dug
    Blue Max
    Super Lem
    Stunt Car Racer (you can actually save and load game progress, if using "tape" as media)
    Paper Boy
    Necromancer
    Commando
    Uridium

    Great fun! Now I have to arrange with a proper box and perhaps a small cooling heat sink for the Teensy chip (it gets warm after a while, but not critically hot)

  11. #186
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    Hi,
    I'm trying to compile but I've error about "Ctags pattern" is missing

  12. #187
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    I've put the original platform.txt and compile. Can anyone helpme? How can I use the platform.txt of Frank without having "Ctags pattern" error?

  13. #188
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    The original platform.txt has those rows in:

    # ctags
    # ------------------------------
    tools.ctags.path={runtime.tools.ctags.path}
    tools.ctags.cmd.path={path}/ctags
    tools.ctags.pattern="{cmd.path}" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "{source_file}"

    so I added those rows in the modified platform.txt by frank but now I've those errors:

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\Teensy64.cpp:226:2: error: #error Teensy64: Please select F_CPU=240MHz

    #error Teensy64: Please select F_CPU=240MHz

    ^

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\Teensy64.cpp:230:2: error: #error Teensy64: Please select F_BUS=120MHz

    #error Teensy64: Please select F_BUS=120MHz

    ^

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\Teensy64.cpp:238:2: error: #error Teensy64: Set AUDIO_BLOCK_SAMPLES to 32

    #error Teensy64: Set AUDIO_BLOCK_SAMPLES to 32

    ^

  14. #189
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    Sorry my mistake, I've copied platform.txt in the wrong path.

    Now I've some errors due to "println" not declared:

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\keyboard_usb.cpp:48:60: error: 'println' was not declared in this scope

    println("c64USBKeyboard claim this=", (uint32_t)this, HEX);

    ^

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\keyboard_usb.cpp: In member function 'void c64USBKeyboard::LEDS(uint8_t)':

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\keyboard_usb.cpp:148:41: error: 'println' was not declared in this scope

    println("Keyboard setLEDS ", leds, HEX);

    ^

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\keyboard_usb.cpp: In member function 'void c64USBKeyboard::updateLEDS()':

    C:\Users\Gianni\Documents\Arduino\libraries\Teensy 64\keyboard_usb.cpp:154:46: error: 'println' was not declared in this scope

    println("KBD: Update LEDS", leds_.byte, HEX);

    ^

  15. #190
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    Problem is on keyboard_usb.cpp at rows 48, 148, 154
    there are statements as:

    println("KBD: Update LEDS", leds_.byte, HEX);

    cannot put Serial.println instead of println because there are 3 arguments. For now those lines can be commented out

  16. #191
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by Cyb3rn0id View Post
    Sorry my mistake, I've copied platform.txt in the wrong path.
    Yes, the new platform.txt should be placed here (after installing the teensyduino package https://www.pjrc.com/teensy/td_download.html ):

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\platform.txt

  17. #192
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by Cyb3rn0id View Post
    Problem is on keyboard_usb.cpp at rows 48, 148, 154
    there are statements as:

    println("KBD: Update LEDS", leds_.byte, HEX);

    cannot put Serial.println instead of println because there are 3 arguments. For now those lines can be commented out
    Same thing that I described in post #181 I didn't put time on fixing the code, so comment it out was an easy solution... and it works so far.
    Iīm planning to write a Howto-document on how to download and install stuff from scratch - just to make it easier for beginners to get started. The soldering of hardware took just over an hour, but fiddling with the software, Arduino IDE etc, way more.

  18. #193
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,071
    It looks like FrankB defined somewhere a println function Macro which is intended to work without a preceding Stream object for debugging purposes. But that „somewhere“ seems not to be included.
    Commenting out these println commands is fine.

  19. #194
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,780
    Quote Originally Posted by zonkt View Post
    Running a few games. Some works, other donīt. A few will start, but hangs after a while. I made a film clip on some of them, just for fun:


    I'm still working on an update

    p.s. and yes, just remove the prints, fow now..

  20. #195
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    All working. Display arrived. I've a defect: two vertical white lines on the right. Is it normal or my display is defective?

  21. #196
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by Cyb3rn0id View Post
    All working. Display arrived. I've a defect: two vertical white lines on the right. Is it normal or my display is defective?
    Check out the videos posted here - no white lines visible. Not very likely a soldering problem or other hardware, but something to do with the internal screen connections or memory mapping (?). Hereīs how mine looks:


  22. #197
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    I think is a display problem. I'll buy another.
    In the meanwhile I've tested some games (converted from D64 to PRG using dirmaster)

    A Journey to the center of the earth (ozisoft) -> works
    B.C.'s quest for tires -> partially works. I've played a little and arrived on the mountain (where the rocks falls down), the player hits something invisible, maybe a defective sprite collision?
    Doctor Who and the mines of terror -> don't work. IEC access screen remains stuck above the intro image
    Cybernoid -> don't work, random white/yellow patterns

    NumLock feature doesn't work. When I hit num/lock for the joystick swap, board stucks, neither CRT ALT CANC reset, I must disconnet power

    Sometimes screen initialization fails: screen is shifted

  23. #198
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    @Zonkt you've mounted the female strip wrong side. I've made same error, then I've desoldered and soldered to back side

  24. #199
    Junior Member Cyb3rn0id's Avatar
    Join Date
    Mar 2018
    Location
    Italy
    Posts
    16
    Dragon's Lair II - Escape from Singe's Castle - from IEC - stucks at second stage (ye olde whirlpools)

  25. #200
    Junior Member
    Join Date
    Apr 2018
    Location
    Sweden
    Posts
    13
    Quote Originally Posted by Cyb3rn0id View Post
    @Zonkt you've mounted the female strip wrong side. I've made same error, then I've desoldered and soldered to back side
    I was in a hurry Have put it in its right place and will put it inside a small box for better protection. The connectors are soldered and makes the mount slightly lower. Added a small heat sink to the chip.
    Click image for larger version. 

Name:	30740150_1952011758204389_3655116004683415552_n.jpg 
Views:	34 
Size:	127.9 KB 
ID:	13618 Click image for larger version. 

Name:	30738439_1952011668204398_9061892364720668672_n.jpg 
Views:	26 
Size:	96.2 KB 
ID:	13619

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •