I just made a homebrew program for testing a 3-button Sega Genesis controller. This one also runs on QBasic for testing the k

[Released: 1988] The Sega Genesis was Sega's most successful console; though Sega has never released a total sales figure quote. Several add-ons were created including the Sega CD and Sega 32X which extended its capabilities.

Post Reply
User avatar
/genesis
Corporate
Posts: 8534
Joined: Tue Jun 04, 2019 11:44 pm

I just made a homebrew program for testing a 3-button Sega Genesis controller. This one also runs on QBasic for testing the k

Post by /genesis »

' ' ======================================================= ' INPUT DEVICE TESTER: FOR DOS, WINDOWS, AND SEGA GENESIS ' ======================================================= ' A HOMEBREW TECH DEMO FOR TESTING INPUT ' ' A program where one can test the keyboard for QBasic/QB64 ' and, test the controller for the Sega Genesis on SecondBASIC ' ' This is Reddit user /u/SupremoZanne's first attempt at ' writing a program which automatically changes it's ' program routine if a different dialect of BASIC is chosen. ' ' This tech demo here was also made so we could have a program ' that runs on QBasic for DOS, QB64 for Windows, Mac OS and Linux ' as well as SecondBASIC for Sega Genesis. ' ' The BASIC programming language has so many dialects, that it's ' time we find ways to automatically detect which type ' is being used as a program gets written. ' DIM ch AS INTEGER DIM x AS INTEGER DIM y AS INTEGER CLS ' IF TIME$ = "" THEN GOSUB notQB ' A special trap to redirect to "Sega Genesis" mode. ' PRINT PRINT " You are using QuickBasic, QBasic or QB64." PRINT PRINT " INKEY$ entry: " PRINT PRINT " PRESS SPACEBAR 5 TIMES IN A ROW TO QUIT" DO k$ = "" WHILE k$ = "" k$ = INKEY$ GOSUB spray WEND k = ASC(RIGHT$(k$, 1)) COLOR 14 LOCATE 4, 16 SELECT CASE k CASE 32 PRINT " " q = q + 1 CASE ELSE PRINT k$; " " q = 0 END SELECT IF q = 5 THEN GOSUB ending LOOP ending: CLS COLOR 7 END spray: x = (RND(1) * 79) + 1 y = (RND(1) * 14) + 8 COLOR RND(1) * 15 ch = (RND(1) * 222) + 32 LOCATE y, x PRINT CHR$(ch); RETURN notQB: PRINT PRINT "You are using SecondBASIC." PRINT PRINT "button pressed: " PRINT DO LOCATE 5, 1 COLOR 0 PRINT " UP" PRINT " LEFT RIGHT |A| |B| |C| | START |" PRINT " DOWN" PRINT PRINT "joypad() value: " WHILE j = 0 GOSUB spray2 j = JoyPad(0) WEND COLOR 2 LOCATE 9, 16 PRINT j; " " LOCATE 5, 5 IF j.0 THEN PRINT "UP" LOCATE 7, 4 IF j.1 THEN PRINT "DOWN" LOCATE 6, 1 IF j.2 THEN PRINT "LEFT" LOCATE 6, 7 IF j.3 THEN PRINT "RIGHT" LOCATE 6, 17 IF j.4 THEN PRINT "|B|" LOCATE 6, 21 IF j.5 THEN PRINT "|C|" LOCATE 6, 13 IF j.6 THEN PRINT "|A|" LOCATE 6, 25 IF j.7 THEN PRINT "| START |" WHILE j = JoyPad(0) GOSUB spray2 WEND LOCATE 9, 16 COLOR 2 PRINT JoyPad(0); " " LOOP spray2: LOCATE 11 + RND(14), RND(40) COLOR RND(4) PRINT CHR$(RND(255)); RETURN
submitted by /u/SupremoZanne
[link] [comments]

More...
Post Reply

Return to “Genesis Forum”