[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Game in assembly with USB joystick
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 1
File: asteroids.png (19 KB, 640x480) Image search: [Google]
asteroids.png
19 KB, 640x480
One of my final projects for university is to make a game with assembly, it sounds simple enough but its supposed to be controlled via USB joystick. As far as I know there's not interrupts for USB, what are the options for making this kind of communcation with the usb port?, the only option I can think of is to try to access the port directly with IN and OUT
>>
>>54637082
Well you *could* still call OS API functions from assembly (in Windows joySetCapture), but if you wanted to do it without them yeah I'd start with IN & OUT.

Are you already familiar with communicating with devices through ports?
>>
the code for usb communication will at least be an order of magnitude more complex than the code for your actual game
>>
>>54637516
Yeah my teacher is an asshole and she knew exactly that would happen
>>
Remember to cheat as many times as you can get away with, your teachers expect you to. It's part of programming.
>>
>>54639614
>>54639678
Does the USB component explicitly count as part of the game? Wouldn't it be possible to run a separate service and relay the USB inputs, thus technically keeping your program ASM-only?
>>
>>54640034
Could you elaborate on how can I do this? you mean a service like a hybrid program? or like another type of port?
One of the options I've heard from my classmates its to program with PIC an interface between the USB inputs on C and send signals to a serial/parallel port to take them on into the program with the usual ports and interrupts
>>
>>54640135
Not the guy you're replying to, but I was thinking you hook up an arduino or some other SoC between the controller and the computer with your game, and set the SoC to take in the joystick's USB input, use a library to decipher it, and send an appropriate signal to your game. Or maybe just use software on the computer running your game to do the same thing
>>
>>54637082
>2016
>Game in ASM
>on Windows
>as a final uni project
>gotta have USB support
good luck with that, call OS functions, if you can
>>
>>54637082
You sure you're not allowed to call the DirectInput DLLs? That feels like the only remotely sane solution to this.
>>
Ya you are gonna have to poll the port(s) since you cant tie an interrupt line to it.

If i was you i would check online for someone elses USB driver and adapt from it. Check OSdev.org for information. GL BROSEPHINA
>>
Wait, if you can't use external DLLs, how did you get graphics? You need at minimum the Win32 API for that.
Thread replies: 12
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.