yet another version of my handheld BASIC system in a GameGear case

Similar projects worth following
Xts uBASIC powered game console (see #Xts-uBASIC for further...)
that runs w/ 2 ESP32 MCUs,
a 2.8 TFT,
an MP3Player,
& legacy GameGear controls...
  • 2 × ESP32 devkit R1 MCUs
  • 1 × Adafruit 2.8 TFT SPI controlled
  • 1 × Sparkfun SX1509 I2C IO Expander
  • 1 × DFPlayer mini MP3 Player UART controlled
  • 1 × broken GameGear for case & buttons

  • My Xts-uBASIC keyword set

    Franck GALLIAT06/19/2018 at 11:21 0 comments

    Hi, Here is my current BASIC Keywords set:

    PRINT -----------------------> ADDED <?> shortcut
    REM, ------------------------> ADDED <'> shortcut
    INPUT, INKEY$ // INKEY$ : non blocking key listening ....
    INT(),RND() // int(1.5) -> rounds to 1 // rnd -> returns between 0.00 & 1.00
    STR$()      // STR$(1) => "1" (allows string concat)
    LEN(),      // LEN("abc") => 3 
    MEM --> function that return free ammount of RAM
    DIR, ----------------------> ADDED optional extension filter ex: DIR ".BAS"
    DIRARRAY ------------------> Stores FS list in "DIR$" ARRAY VARIABLE
    DIRM ----------------------> show FS content for MCU#2
    MUTE (toggle mute buzzer)
    BEEP 100,2        : 1-48 produces some notes, direct freq. otherwise, beeps for 2*50msec
    PLAY "ABC#"       : play some notes of OCTAVE_4
    PLAYT5K & PLAYT53 : to play audio (beep) files
    DRAWBPP           : display a 1bpp (B/W) picture to builtin screen
    DRAWPCT           : display a 64K colors picture
    DRAWSPRT          : draw a sprite (portion of a .PCT image file)
    CIRCLE x,y,r      : draw a circle
    LINE   x,y,x2,y2  : draw a line
    PSET   x,y        : switch ON a pixel
    PRESET x,y        : switch OFF a pixel
    RECT x,y,w,h,c,m  : c : 0,1,2,3 (black,white,gray, darkGray) // m : 0,1 (draw,fill)
    TRIANGLE x,y,x,y,x,y,c,m : as same as RECT but draws a triangle
    BLITT x           : 0 stop blitt / 1 trigger blitt / 2 auto blitt (default mode)
    SCREEN 0/1/2	  : switch resolution (128x64, 160x128, 320x240)
    (TEXT 0/1 -> change text overlay mode)
    BTN(x)            : function get button state
    LED [1..3], {0,1} : switch on/off a LED
    ( CONSOLE <out>,<in>,<gfx> : set I/O + GFX main devices )
    ( ECHO {0;1}        : enable/disable console output )
    DELAY x           : wait x msec
    SECS              : function that returns nb of seconds elapsed since boot
    MILLIS            : function that returns nb of milli-seconds elapsed since boot
    UPPER$(str)       : function that return UPPERCASE of str
    STRING$(nbTimes, chr) : function that returns repeating string of nbTimes * CHR$(chr)
    CHR$( chr )       : function that return a char of given ASCII code
    SPACE$(nbTimes)   : function that returns repeating string of nbTimes * CHR$(32)
    ASC( str )        : returns ascii code of 1st char of str
    INSTR( str, toFind ) : returns index of 'toFind' in 'str' (else 0)
    ABS(x)            : return absolute value of number
    COS(x)            : return cos( x in radians)
    SIN(x)            : return sin( x in radians)
    SQRT(x)           : return square-root of x
    POW(x,y)          : return x pow y
    MIN(x,y)		  : guess
    MAX(x,y)		  : guess ...
    EXEC "<extCmd>", "[<extArg>]" : to launch an extended command
    DO "? 3.14"       : ~ as eval() in JS, interprets & launch a String expr.
    DATAF "file", "SZ", "A$", "B" -> feeds A$ & B arrays w/ a PSEUDO CSV file content (ex: file.BAD) of a length of SZ
    (DATAU "url?", "SZ", "A$", "B" -> will do as same but with an URL)
    (COPY "/TOTO.PCT" -> copy an asset to MCU#2 )
    BYE               : to reset the MCU
    HALT              : to halt the MCU & optional connected RPI

  • Dual ESP32 layout explained

    Franck GALLIAT06/11/2018 at 11:43 0 comments

    I used 2x ESP32 (instead of only 1 in #Xts-uBASIC Pocket V2 ) because I needed hudge RAM to correctly manage the 320x240px Screen ops. (& ESP32 is relatively cheap & fast) so there is an UART Bridge between BOTH MCUs in order to send commands from #1 (BASIC+BEEP+BTNs+WIFI) & #2 (SCREEN + MP3Player) Then the SX1509 boards allows me to read all buttons to #1...

  • Try to code something on my handheld

    Franck GALLIAT05/23/2018 at 15:28 0 comments

    Hi, today I'm starting to write a little RPG demo (not a real game @ this time).

    Just for the experiment & detect lags (& try to fix those)

View all 3 project logs

  • 1
    Case mod & buttons wiring

    I found this very good tutorial about case & buttons reusing...

    Then I decided to try by myself.

    Then I connected all buttons to a Sparkfun SX1509 I2C I/O expander.

  • 2
    Mounted the 2 (bridged) MCUs !

    Hi, today I mounted the 2MCUs together...

    It now looks like this :

    From bottom to top : we have the 2x ESP32, the GPIO expander at center, then the 320x240px TFT w/ legacy GameGear controls PCB on sides.

    a small overview :

    buttons are responding & bridged screen works !

  • 3
    ADDED MP3 module

    Hi, last week : I added the MP3 Module (DFPlayer MINI) & wired 2x MCUs USBs + added a LED @ same place than original one.

    So we have the MP3Module on left side (linked to #2 MCU), BUZZER (linked to MCU#1) on right side & 2 USBs to control BOTH MCUs (via ArduinoIDE) + a micro female USB to power the whole system (@top)

    So it can now play BEEPs & MP3 Tracks !

View all 5 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates