Caleb Garner Posted May 24, 2021 Share Posted May 24, 2021 Hi everyone, sorry in advance this is a multi question post. I'm excited to dive into this, but equally uncertain how to go about what's ahead. - I have recently got an O2, a respectable collection of games and a friend helped me out and installed the composite mod. - I also just got the O2em working and I found this great starter link http://atari2600land.com/odyssey2/odyssey2howtoprogram.html - I was able to download and compile the example project and run that in O2em so I'm feeling good that I'm ready to really start learning what the hell is going on with Assembly but beyond knowing that's the name of the language, I'm really unsure where to start learning (the right) language. I have experience with programming and logic so I'm familiar with the basic concepts but i've used higher level modern languages and tools.. i dabbled in basic as a kid (10 print "hello";) but never coded it creatively. I really don't know the first thing about assembly and the particular knowhow that would know how to talk to an O2 machine.. like how do you tell it to play music, notes, tones or how to listen to a "fire" button or keystroke. I mean is the O2 using straight "Assembly"? or is it something else? How do people know how to assemble a graphic? is there some test programs or something people use to create a given graphic in realtime? I understand sprites are assembled using a preset series of graphics, but just wonder how people make original graphics and animations. Maybe it's just done on paper? How do people test on actual hardware? I'm only aware of the packrat multicart, but that's even from what i can see a static pre-loaded multicart meaning i can't drop new roms into it https://www.packratvg.com/o2merch.html Thanks! Caleb Quote Link to comment Share on other sites More sharing options...
Mikebloke Posted May 24, 2021 Share Posted May 24, 2021 Hi Caleb, I don't know enough about it but I imagine it is just assembly, you'll just need an instruction set to know what does and doesn't work on the odyssey2. I'm still wracking my brains around the fairchild, so haven't delved into the odyssey2 yet but I imagine it's "easier" Regarding a micro sd card solution, the person to contact is this : https://atariage.com/forums/profile/72790-wilco2009/ Though Packrats multicard is also great I recommend getting both! The multicart will not be able to play homebrew you make though. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 24, 2021 Share Posted May 24, 2021 Thanks for using my tutorial! Glad you got it working. Odyssey 2 is assembly. There are no BASIC or C compilers for it. I assume the "graphic" you're talking about are the characters. There are 64 of them, like numbers and letters and little shapes and such. These are apart from the sprites (of which you get 4 of), but you can have up to 12 characters on screen (more if you really know what you're doing and use tricks). And then there are the "quads", groups of four characters. There are four of these. So we can have 4 quads, 12 characters, and four sprites on screen all at the same time. Music is a really hard thing to do on the Odyssey 2, I haven't even gotten music on it yet. On the flip side, how to make it interpret a keystroke or Action button is easy though. I could make another tutorial on using the characters if you'd like. Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted May 24, 2021 Author Share Posted May 24, 2021 awesome thanks for the replies! @Mikebloke so this "instruction set". do you know where i could find this? I take it this is some kind of list of O2 specific functions and such? the fire button, joystick, audio, etc. the things that a plain assembler code base wouldn't know (like if i were making an accounting program, vs a game) Yea I'm going to still get the packrat but I am definitely looking for some kind of SD type cart to load games i make onto it or maybe. I've reached out to wilco to see how things are looking lately with something that could let me load homebrew stuff. @atari2600land thanks so much for making that post to help people like me try things out. it was so nice that there's a graphic interface for the O2em.. i have a irrational dislike of running things from command prompts.. even back in the day.. Ah ok yes that all makes sense and thanks for those design parameters. Knowing the limits is a huge help. Yes it was the quads I was thinking about and read somewhere that it was a graphic made up of other symbols. So for the second demo (thanks for offering to do at all!), the big things that come to mind for me with questions.. - how does collision detection work? are there triggers like "on collision" or do maybe you check if two things overlap? - Is there a place I can see the 64 characters available? - When making a quad, how would you typically construct one? like when you're figuring out how to make a specific thing? digitally or on paper maybe? Are there any folks out there who have made a homebrew game that got some sound to work? I can understand how music could be tricky, but yea i'd really like to be able to make explosion sounds or basic blips / beeps when things happen. thankfully it's a mono voice chip so it's not like we have to manage polyphony and overlapping notes. I'm going to explore the forum more. I might find some answers there too. I'll see if I can find a book on assembly.. kinda irked because i could have sworn i had an old book on assembly in library and now i can't find the book. i don't think i got rid of it, but i also know las time i saw it i never dreamed i'd actually be trying to write something in assembly.. heh Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 24, 2021 Share Posted May 24, 2021 Here is a picture of all the characters. Collision detection is easy unless you want to check multiple things. You just need to figure out what value is in the collision register and then act accordingly. The Odyssey 2 has a few built-in sounds (like the SELECT GAME sound). Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted May 24, 2021 Author Share Posted May 24, 2021 ah ok yea i just found that graphic thanks for that! ok so that's interesting.. I like those kind of creative constraints. so you could pick any 4 of these characters and overlap them with each other? you can rotate / position them i imagine within some pixel constraint? ok built in sounds is encouraging. understood how it might get dicey getting into sound crafting custom tones.. even with a mono voice chip.. at this level. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 24, 2021 Share Posted May 24, 2021 You can't have characters overlapping. Playing sounds is easy. Here's how to play a built-in sound: mov a,#tune_keyclick call playsound Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 24, 2021 Share Posted May 24, 2021 And here is some example collision code: mov r0,#vdc_collision mov a,#vdc_coll_spr0 movx @r0,a mov r0,#03dh mov a,@r0 anl a,#002h ; check for collision of sprite 1 jnz collision_happened Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted May 24, 2021 Author Share Posted May 24, 2021 wow i have so much to learn! but wow yea that's so awesome. when you say "playsound" like how would you play noise vs a beep or what pitch is the beep? or is "playsound" that boot up scale sound you hear when you turn on the machine? Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 24, 2021 Share Posted May 24, 2021 "playsound" refers to the place in the BIOS that plays sounds. You can just call to it like that. There are different tunes (noises) you can call, mov a,#tune_buzz ; buzz mov a,#tune_select ; the select game sound mov a,#tune_select2 ; the select game sound backwards mov a,#tune_beep_error ; a low-pitched beep Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted May 24, 2021 Author Share Posted May 24, 2021 man that's awesome @atari2600land you make it look so easy! Are there any books that might help me get the right kind of info about assembly stuff? I see Assembly Language for the IBM-PC 1st edition (1992), but I'm concerned it's "too new" and might get me off on tangents that won't help me get better with the O2.. i just want to make sure i'm being as efficient with what i need to know.. this head has no room for a bunch of unrelated stuff =D barely room to figure out what i NEED to know. I was following this for a bit https://www.tutorialspoint.com/assembly_programming/index.htm but frankly it was asking me get into linux and what not and i'm like.. that's a bridge to far for me. Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted May 29, 2021 Author Share Posted May 29, 2021 Ok so i'm trying my first hello world.. it's not looking right. Can anyone see why it would work like this? I did get the compiler to compile the .bin but it's not displaying hello world. It seems to be 1:1 with the example in the tutorial. helloworld.a48 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted May 31, 2021 Share Posted May 31, 2021 Hello. The problem with your code is you forgot the initialization routine, telling what you run the program with is an Odyssey 2 program. cpu 8048 org 400h include "g7000.h" jmp myinit jmp irq ; interrupt jmp timer ; timer jmp vsyncirq ; VSYNC-interrupt jmp start jmp soundirq ; sound-interrupt myinit call init ; to skip Select game message timer ; needed, but can be blank, like this I added this to the beginning of your program and it works. Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted June 1, 2021 Author Share Posted June 1, 2021 oh wow thanks @atari2600land ok i had to clean up the mangled code (this forum doesn't seem to respect notepad formatting but i've attached the code and yes now it works! Thanks for helping with that. back to the tutorial stuff.. helloworld-fixed.a48 Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted June 1, 2021 Author Share Posted June 1, 2021 OK so this is where the rubber meets the road and runs over the noob programmer! I've been staring at this code for awhile and I just don't understand the "flow" here.. 1. I understand that starter code is needed now and is it safe to say that all programs need to have this open up? 2. with that "absolute" established now to the HW example.. What exactly is VDC or VDC registers? I'm working on chapter 2.7 right now and there's a lot to unpack even in this simple example. 3. they talk about using gfxoff and gfxon.. what is this all about? are you supposed to do this with each frame? Hide everything at the start of the code and then reveal the graphic at the end? why is this? what's going on? 4. call, mov, movp, inc, db.. what are these and pointers? IIRC pointers are a C thing where you reserve chunks of memory or something like that? 5. in the HW code there are all these r0 through r6 in various locations, not in order. the comments help a little, but they are kinda cryptic for me.. like: mov r0,#vdc_char0 ; start char ... inc r1. ; advance pointer advance pointer? start char (character?) I have more questions but i think 5 is plenty to start with as I analyze and break down how to work creatively within these code paradigms. Thanks! Caleb Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted June 1, 2021 Share Posted June 1, 2021 I suggest for more details to get registered with http://www.videopac.nl/forum The forum is mostly Videopac (Odyssey 2) stuff so you'll get more knowledgeable answers than if you ask here. Quote Link to comment Share on other sites More sharing options...
Caleb Garner Posted June 1, 2021 Author Share Posted June 1, 2021 Fantastic! I've reached out to them now to become a member. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.