Jump to content
IGNORED

Just starting out exploring making homebrews for O2


Recommended Posts

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

 

 

 

 

 

  • Thanks 1
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Here is a picture of all the characters.

G7000_symbols.gif.e2727d28949fdf0733ddef557798638a.gif

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).

  • Like 2
Link to comment
Share on other sites

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.  

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

"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

Link to comment
Share on other sites

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.  

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

 

Screen Shot 2021-05-31 at 8.16.14 PM.png

Link to comment
Share on other sites

  • 2 years later...
On 5/24/2021 at 5:37 PM, atari2600land said:

Here is a picture of all the characters.

G7000_symbols.gif.e2727d28949fdf0733ddef557798638a.gif

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).

These character sets are definitely interesting, and since character 27 is a dot pattern, i was thinking that in case we want to create our character tile sets for both sprites and backgrounds we may could just use that dot tile and place them next to each other trough copy pasting and change it’s color as well,

we may could even create a toolchain kit to concert sprites & background tiles from other games from other 8bit systems into the odyssey 2 format (thus converting those tile sets into commando signals) wich simply should command the odyssey 2 to use that dot tile and copy paste and place it everywhere on screen and change it’s color per different position on screen as well (let’s say put dot pattern on position A with color 1,copy paste the next to position B with color 2 and so on and so on) because eventrough bg tiles are not allowed to be overlapped on top of each other,but this shouldn’r be a problem to do so right?

yeah there might be only a limited amount of sprites and background tiles to be put on screen atonce BUT what if we could just alternate those tile sets per frame we could just get around that problem as well while fooling the naked eeye,same thing with colors,we could alternate and dither those colors to fake more colors on screen,

 

as for audio we might could quickly alternates it’s timers or volume to create a wave form to simulate 1bit pcm audio to get more freedom in creating you own sound effects (depending how much processing power is invulved and if it is actually possible)

 

as for bankswitching,it may does support bankswitching internally from 2KB up to 8KB,BUT if we want to get outside that 8kB prison,we should use bankswitching externally to get more freedom in how large we want to make our games,sure if we wane to make a 32KB game for it we still need to design the game in wich each section is 1KB and load the one in after another one once needed,

we may could use an external cpu chip in the cartride to overdrive both cpu and ppu chips atonce to do more tasks atonce while the main cpu could be used for simple things,

now just imagine donkeykong,pacman,mariobros,enhanced popeye etc,,, being as close as possible to the arcade versions of it by using all tricks like this,that would be definitely cool and just imagine if it is all possible and what if game developers did knew about such tricks,it might could,ve courage them to make games for the odyssey 2 as well,so who ever knows😁

 

yeah am trying to think outside the box and see what could be done on the odyssey 2,it is such an innovative game console with limited computer capabilities with supposedly business intentions as well😁

Edited by johannesmutlu
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...