gtBASIC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
wbushby
Posts: 173
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

OK, thanks for that info. I can then develop and test the code. I was starting to get frustrated waiting for my new man cave to be finished. It is running about 4 months behind schedule.
wbushby
Posts: 173
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

@axelb
You have this line for getting controller buttons.
button.lo = get("SERIAL_RAW") XOR 255
I thought controller buttons were obtained using "BUTTON_STATE" ?
bmwtcu
Posts: 141
Joined: 01 Nov 2018, 12:02

Re: gtBASIC

Post by bmwtcu »

I think what he's suggesting is to first read all 8 bits of the raw famicom serial data one time into a variable that you can use with follow-up conditionals to parse, which would enable you to theoretically handle all 256 possible combinations of simultaneous key presses.
Attachments
input.JPG
input.JPG (14.66 KiB) Viewed 108 times
SERIAL_RAW.JPG
SERIAL_RAW.JPG (11.68 KiB) Viewed 109 times
wbushby
Posts: 173
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

I understand now. I hadn't tied SERIALRAW and BUTTONSTATE together when I read that before.
I have found that BUTTONSTATE provides the information showing direction key and A key being simultaneously pressed so either can be used it seems.
at67
Posts: 586
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

There's a good explanation of the difference between the two registers here, by Marcel: viewtopic.php?t=138

1) serialRaw is the raw bits read from the shift register every 60Hz.
2) buttonState is an edge triggered representation of serialRaw that the native ROM creates for one shot events.
3) Axel's first line of code uses XOR 255 to invert the result read as both serialRaw and buttonState are active low logic
wbushby
Posts: 173
Joined: 16 Jul 2021, 10:59

Re: gtBASIC

Post by wbushby »

Here is an upgrade to Manic Miner that allows you to walk and jump at the same time when using a controller. 'A' button for jump.
Attachments
manicminer64k41v1.3.gt1
(58.54 KiB) Downloaded 11 times
bmwtcu
Posts: 141
Joined: 01 Nov 2018, 12:02

Re: gtBASIC

Post by bmwtcu »

Works much better!
axelb
Posts: 33
Joined: 07 Jan 2021, 06:27

Re: gtBASIC

Post by axelb »

Your new version is now working great with my controller. Thank you!
Post Reply