GP32 Im going to try to port Arnold (Linux SDL Port)


Antiriad

Member
Joined
Apr 11, 2003
Messages
343
Website
Visit site
Hello all (ive also posted this on the Yahoo GP32 dev board),

Having badgered all and sundry for someone else to do this, i have decided to get the ball rolling of a Amstrad CPC emulator for the GP32 myself even though i have no programming knowledge.

Hopefully if i can just get the OS screen to show up (with or without sound) on my GP32 i will be satisfied enough as perhaps it could inspire others to finish my work.

Ive done the easy part and downloaded the DevKit (found the tutorial page for this also), the SDL port for GP32 and most importantly the source files for the SDL version of Arnold adapted by Andreas Micklei.

The Amstrad CPC came in both 64k (464, 664, 464+) and 128k (6128, 6128+) formats and ran off a Z80 processor running at 4Mhz and used a AY-3-8912 chip for sound similiar to the one used in an Atari ST and probably exactly the same as the one in the Sinclair 128.

It was capable of producing three colour modes: low res 16 colours 160x200; med res 4 colours 320x200; high res 2 colours 640x200. Im aware of the GP32's inability to run higher than 320x240.

Ive done the easy part and drawn up a project plan that i will *attempt* to stick to. Presumptious i know, but i liked the idea of planning ahead how id ideally like thigns to work.

v0.1 Aims
---------
- 6128 Emulation Only
- Graphics!
- Sound!

v0.2 Aims
---------
- Map GP32 Joypad and A B Button to CPC Joystick
(Joy Up = Joy Up [↑])
(Joy Down = Joy Down [↓])
(Joy Left = Joy Left [←])
(Joy Right = Joy Right [→])
(A Button = Fire 1 [X])
(B Button = Fire 2 [Z])

- SMC File Browser with SubDirectory support
Load SNA files
(Right Button to activate)
(Joypad Up/Down to Navigate)
(Joypad A or B to Select)

v0.3 Aims
---------
- Load DSK files
- Virtual keyboard: On screen GUI - using 40 pixels free below
(Select Button to activate)
(Joypad Up/Down/Left/Right to Navigate)
(Joypad A or B to Confirm)
(Left Button toggle Caps On/Off)
(Right Button toggle Shift On/Off)


v0.4 Aims
---------
- Menu Screen (Separate)
(Joypad Up/Down to Navigate)
(Joypad Left/Right to select)
(Joypad A or B to Confirm)
(Start Button to activate)
- Frameskip Option 0 1 2 3 4
- Reboot CPC
- Reboot GP32


v0.5 Aims
---------
- Customisable Map keys to Up, Down, Left, Right, Fire 1, Fire 2
- Save Config (Press Select in Menu to activate)

v0.6 Aims
---------
- Change Amstrad Type: 464, 664, 6128, 464+, 6128+
- Compile Roms into exectuable
- CPC+ Support: Load Carts (cpr)

v0.7 Aims
---------

- Save Snapshot (Press Left)
- Zlib Support

As it runs from SDL for the graphics and sound, and is according to its author apparently devoid of any x86 code, i can hope i might be able to achieve the basic first stage.

I know for a fact that ANYTHING in regards to a GUI im going to desperately need you guys help (as if i dont already with the non GUI stuff). If im honest, my approach to its structure has been heavily influenced by Speccyal and Frodo. I admit have a big concern in regards to a virtual keyboard on the screen due to the Amstrads ability to change modes. On the other hand,a seperate screen would be most unfeasable when it comes to loading DSK files - that and Skeezix got round this problem with Castaway.

What i would like is perhaps some pointers... :D
Im guessing right now i need to isolate the appropriate source code from Arnold and then compile it using the SDL port for GP32 then use the DevKit to convert it into a GXB file? Naturally, ill be running GeePee32 on my PC for all this!

Ive bookmarked http://cyberdiem.com/vin/learn.html and http://www.strath.ac.uk/IT/Docs/Ccourse/ and am hoping to utilise these both. Alternatively should i buy a book about C?

Of course if you think im way over my head with this one (last time i did programming was BASIC on my real Amstrad CPC back in the day) let me know, and ill exit stage left...
 

ShadowXX

Still Fresh
Joined
Jul 11, 2003
Messages
2
Happy trying Antiriad (named after the old C64 Game??),

but your project plan has some little flaws...
Many of the aim's with numbers higher/equal then 0.4 'must' be implemented first and some of the aim's of the lower numbers must be implemented second.

(e.g. 0.4 has the aim for frameskip...you 'must' implement frameskip in the first version...rewriting the display code at a later time can be a real mess.....)

And got my words.....Creating an Emu (even it's a Port) is more than downloading and compiling....

J.S.Shadow
(Buisiness Programmer)
 

woogal

Certified Guru
Joined
May 15, 2003
Messages
1,823
Age
45
Location
Newark, UK
Website
gp32.sector808.org
I think this may be a bit too much for your first coding project. Looking through the code there are several areas that will need re-writing as the GP32 version of SDL is a very early port and only supports graphics and controls, not the audio and timer functionality you will also need.

If I were you I'd start a simple little program right from scratch until you get to grips with the basics of coding for the GP32 (and coding in general). Porting might sound easy (and sometimes it can be), but when you come across a bug it can sometimes be incredibly difficult to track down, even for experienced coders.
 

Antiriad

Member
Joined
Apr 11, 2003
Messages
343
Website
Visit site
Id still like to at least try mind. I gather from the Linux porter that when it was put over by Kevin Thacker, all it did was display the Amstrad BASIC screen and nothing else.

If i could just do this part (although i gather that the GP32 sdl port will soon incorparate sound and timers), i would be satisfied enough. I know all my ideas for how id like the emulator to ideally be were just imagination on my part. And if you would like to tell me what order it should be done , id be interested even if its highly unlikely it would be me doing it.

I'd genuinely like to learn C if i can create something worthwhile - eventually even. Could someone at least recommend a good book to start with? This one for instance?
 

Antiriad

Member
Joined
Apr 11, 2003
Messages
343
Website
Visit site
Well, ive ordered the book "The C Programming Language (Prentice Hall Software Series)" by Brian W. Kernighan and Dennis M. Ritchie as well as its Answer book.

So im going to give this a proper crack, and not run away like a wuss! So its "Hello World" here i come...

I enclose a revised plan which i hope is more realistic

Stage 1 Aims
---------------
- 6128+ Emulation Only
- SDL Graphics

Stage 2 Aims
---------------
- SDL Sound
- Map GP32 Joypad and A B Button to CPC Joystick
(Joy Up = Joy Up)
(Joy Down = Joy Down)
(Joy Left = Joy Left)
(Joy Right = Joy Right)
(A Button = Fire 1)
(B Button = Fire 2)

Stage 3 Aims
---------------
- Load Other Carts (cpr)
- SMC File Browser with SubDirectory support
(Right Button to activate)
(Joypad Up/Down to Navigate)
(Joypad A or B to Select)

Stage 4 Aims
---------------
- Virtual keyboard: On screen GUI
(Select Button to activate)
(Joypad Up/Down/Left/Right to Navigate)
(Joypad A or B to Confirm)
(Left Button toggle Caps On/Off)
(Right Button toggle Shift On/Off)
- Load SNA files
- Load DSK files

Stage 5 Aims
---------------
- Menu Screen
(Joypad Up/Down to Navigate)
(Joypad Left/Right to select)
(Joypad A or B to Confirm)
(Start Button to activate)
- Change Amstrad Type: 464, 664, 6128, 464+, 6128+
- Reboot CPC
- Reboot GP32

Stage 6 Aims
---------------
- Save Snapshot (Press Left)
- Tape Support: Load, Play, Rewind (cdt)

Stage 7 Aims
---------------
- Customisable Map keys to Up, Down, Left, Right, Fire 1, Fire 2
- Save Config (Press Select in Menu to activate)
- Zlib Support

As SDL is graphics only right now, i hope to just be able to do that first. Andreas Micklei wisely said 6128+ emulation would be best to start with as it bypasses the need for keyboard emulation. Frameskip has also been dropped for the reason its not been ported to the Linux Port (as well as what ShadowXX said!)

Once again, if any of the above is in the wrong chronological order let me know.
 
Top