Several newb questions

What is a Uzebox? How can I get one? Check here!
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

I'm going to try to create Atari's Combat first, or at least the tank bit of it. It looks like someone started on this but never wrote any code. That should be simple enough for a beginner like myself, I hope.

After that, maybe Pang? Not sure.

I didn't get anything done yesterday as I was in too much pain but I'm feeling better today so I'm hoping to at least do some tutorials and make a start.

EDIT

No-one ever answered my question re Uzebox alternatives. The impression I get is there a quite a few open source hardware consoles out there but the Uzebox has the biggest community and the most games, right? A decent size community with plenty of open source examples is a huge advantage.
Last edited by danboid on Thu Jun 18, 2020 2:01 pm, edited 1 time in total.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Several newb questions

Post by CunningFellow »

Regarding alternatives - I don't think there are any with as much support / following.

It is fairly easy to make your own retro console. There are heaps of them on the net. It is hard to make one with a successful community that lasts more than a decade. I don't think anyone else apart from Alec has done that.

Arduboy was probably the only serious competitor but it is nowhere near as interesting.
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

What is the Uzebox DTV? It doesn't seem to get a mention in the usual places ie on the UB download page.

EDIT

I don't see any mention of Uzebox DTV here either:

http://uzebox.org/wiki/Homemade_Uzeboxe ... d_projects
Last edited by danboid on Thu Jun 18, 2020 7:15 pm, edited 1 time in total.
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

I have now replicated the steps in Matt's second UB video and got his hello tileset example to build and run under uzebox.

It's great that everything you need to develop for UB that isn't in its GH repo are in the standard Debian and Ubuntu repos, including the ARM(64) repos making it very easy to develop for UB on almost anything.
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

Now that I'm convinced the toolchain is working, the next step was to find some well-commented source to a simple game that builds for me.

The obvious first port of call is the Space Invaders tutorial linked to from the big tutorial link on the main UB site:

http://uzebox.org/wiki/index.php?title=Hello_World

There are two issues with this currently. The first is easily fixed and that is that the link to the source for space invaders on that page is broken but a working link to the SI source can instead be found here:

http://uzebox.org/wiki/Space_Invaders

That would be great, if I could get it to build:

Code: Select all

~/src/uzebox/MY_GAMES/SpaceInvaders/src/default$ make
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT uzeboxVideoEngineCore.o -MF dep/uzeboxVideoEngineCore.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -x assembler-with-cpp -Wa,-gdwarf2 -c  ../../../../kernel//uzeboxVideoEngineCore.s
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT uzeboxCore.o -MF dep/uzeboxCore.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -c  ../../../../kernel//uzeboxCore.c
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT uzeboxSoundEngine.o -MF dep/uzeboxSoundEngine.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -c  ../../../../kernel//uzeboxSoundEngine.c
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT uzeboxSoundEngineCore.o -MF dep/uzeboxSoundEngineCore.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -x assembler-with-cpp -Wa,-gdwarf2 -c  ../../../../kernel//uzeboxSoundEngineCore.s
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT uzeboxVideoEngine.o -MF dep/uzeboxVideoEngine.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -c  ../../../../kernel//uzeboxVideoEngine.c
avr-gcc -I"../../../../kernel/"  -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections  -MD -MP -MT SpaceInvaders.o -MF dep/SpaceInvaders.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=2 -DSOUND_CHANNEL_4_ENABLE=1 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=7 -DRAM_TILES_COUNT=14 -c  ../SpaceInvaders.c
../SpaceInvaders.c:321:13: error: variable ‘alienMaps’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 const char *alienMaps[] PROGMEM = { mapAlienGreen0, mapAlienGreen1, mapAlienGreen2, mapAlienGreen3,
             ^
../SpaceInvaders.c:327:13: error: variable ‘alienDeadMaps’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 const char *alienDeadMaps[] PROGMEM = { mapAlienDead0, mapAlienDead1, mapAlienDead2, mapAlienDead3 };
             ^
../SpaceInvaders.c:330:13: error: variable ‘shelterMaps’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
 const char *shelterMaps[] PROGMEM = { mapShelterDmg0, mapShelterDmg1, mapShelterDmg2 };
             ^
../SpaceInvaders.c: In function ‘main’:
../SpaceInvaders.c:1312:6: warning: variable ‘btnReleased’ set but not used [-Wunused-but-set-variable]
  u16 btnReleased = 0;  // Buttons that were released this frame
      ^
Makefile:76: recipe for target 'SpaceInvaders.o' failed
make: *** [SpaceInvaders.o] Error 1
It looks like the code to bugz is quite well commented so I'll probably use that as a guide instead unless someone can recommend some even better commented source for me to use as a guide? The simpler the code and the more comments the better.

It would be great to see the SI source fixed up so that it is buildable on a modern Linux (or Windows? I've not tried building it under Windows) OS then uploaded to github so that the existing tutorial can be used properly.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Several newb questions

Post by CunningFellow »

danboid wrote: Thu Jun 18, 2020 2:46 pm What is the Uzebox DTV? It doesn't seem to get a mention in the usual places ie on the UB download page.
http://uzebox.org/forums/viewtopic.php?f=4&t=2057
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

Thanks for the link CF!

I've been looking at the demos included in the UB repo.

The Arkanoid and SMB demos are a bit over my head now. tutorial.c (hello world) is more my sort of level . I was most keen on running ControllerTester but maybe that is for use on a physical UB only because it doesn't detect any controllers when I run it under cuzebox.

An ideal demo for me at this early stage would be something similar to a working ControllerTester but showing how to move an unanimated (or maybe a very simple 2 frame animation when in motion) sprite around the screen with a joystick or the cursor keys if running under cuzebox.

I'll try to work out how to do this if no-one steps up to provide such a demo.

EDIT

I've downloaded the source for the pong port, this is more my sort of level. It doesn't build under Linux but tomorrow I'll put more effort into getting it to build. Currently I just get:

Code: Select all

~/src/uzebox/MY_GAMES/Pong/default$ make
dep/uzeboxSoundEngineCore.o.d:1: *** multiple target patterns. Stop.
EDIT 2

Artcfox, you run Linux (Debian) don't you? It would be great if you could have a go at getting pong to build and run under cuzebox as that would make an ideal game example for me and other beginners. bugz is a bit too advanced for me.

It would be nice to have a very simple game demo (like pong) in the main ub repo. The other games currently included aren't dumb enough for me :)
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

If I make a UB it would be like this one:

https://www.youtube.com/watch?v=ydtDAn4TtaM

Which has microUSB power.

Is that the 'official' Euzebox design?
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Several newb questions

Post by Artcfox »

The problem with SpaceInvaders is that it included a copy of the kernel in the state that it was when the game was released. That kernel no longer compiles with the newest version of GCC, so I modified the Makefile to reference the directory with the latest kernel, and also to reference the proper relative bin directory with packrom in it. The source code also needed an extra const added to the PROGMEM declarations to make it compile with the latest GCC.

The fixed source code for Space Invaders is attached to this post.

The problem with Pong is that the default/deps directory was included in the .zip file, and that contained references to Windows pathnames. The deps directory just needs to be deleted, and then it will build fine on Linux. Pong also includes a copy of the kernel that it references, but I didn't change it to point to the latest kernel, because I didn't need to.

The fixed source code for Pong is also attached to this post.

They should be extracted into a directory under the main Uzebox repository, and then you can run the command:

Code: Select all

make
from within the:

Code: Select all

~/uzebox/MY_GAMES/SpaceInvaders/src/default
and

Code: Select all

~/uzebox/MY_GAMES/Pong/default
directories respectively. (This assumes that you checked out the main Uzebox repo in your home directory, and that you created a folder inside it called MY_GAMES, where you are extracting your games into.)

I haven't gotten around to making a basic sprite tutorial yet, though I did go through the basics of programming on the Uzebox with my daughter using a sprite that she drew, so I would probably follow the exact same format.

Have you gone though my Uzebox Mode 3 with Scrolling Guide yet? The next step (an exercise left to the reader) would be to add a sprite to it, and then have the camera follow the sprite around the screen as you move it.

I believe that this is the official EUzebox design: https://www.hwhardsoft.de/english/archive/euzebox/
Attachments
Pong.zip
(237.47 KiB) Downloaded 484 times
SpaceInvaders.zip
(199.38 KiB) Downloaded 484 times
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: Several newb questions

Post by danboid »

Thanks v.much for fixing and explaining those build issues Artcfox, especially pong. That is exactly the level of (lack of) complexity I was looking for in a uzebox game example. I can use this as a building block to start my own experiments and games.

I'd strongly recommend pong gets included in the official uzebox repo demos for these reasons. It seems to be GPL 3 so if Al agrees with me of its usefulness then maybe it will be promoted into the official uzebox repo. I'll make a pull request to that effect and that'll be my first, very minor contribution of sorts, thanks to Matt! :)

The uploader of that YT video has replied to me with a list of parts. Its not very detailed and I think its incomplete too as he doesn't seem to mention any kind of microUSB connector but at least its a start.

EDIT

No, I've not watched your video on scrolling yet Matt but I will. I've got plenty to play around with now that Pong builds. I need to get familar with more basic stuff first.
Post Reply