News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Joseman

Skool Daze port for CPC (FINISHED)

Started by Joseman, 22:33, 14 May 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joseman

Final version of SKOOL DAZE port for CPC, download here:

skool daze 4 cpc &copy _public_domain_ (2015)

Hi

I worked out to compile the source code on the cpc, change the screen layout to spectrum (#4000 with 256x192).

after this, i patched the original sound routine to a CPC sound routine, to emulate the spectrum beeper. This routine was inspired on what @SyX said about using the B channel of the CPC to emulate the zx beeper.

After the introduction music, you can see how the screen appears to be scrolled from right to left, i don't know if this is the original game code writing on the spectrum screen (#4000) as the game on spectrum starts scrolling from right to left.. i didn't path any screen routines... but it seems that the game tries to work on the cpc like on the spectrum  :laugh:

here is the sna if you want to hear the music of skool daze on cpc, is not a big deal as the program doesn't do anything besides play the original theme music, but i like to show my little work on this to the community  :P

here is the sna: Skool Daze CPC [music working].sna

andycadley

Well it's a good start. Now you just need to patch up the drawing routines a bit.  :D

alex76gr

I still believe that i got my myopia from the green GT-65 monitor, but i can't prove it! :)

Joseman

#3
Hi

I've managed to make a routine that converts "on the fly" 8 spectrum screen bytes to 16 cpc screen bytes, no color attributes (i have to think how can i traslate the attribute bytes to the cpc screen ram) and no optimization at all, i'm trying only to prove me that i can do this  :laugh: .

I call this routine just when the  8bytes with screen spectrum format is going to be printed on the spectrum screen, i intercept the bytes, convert it to 2-bytes mode 1 amstrad (16 bytes), and then print it on the amstrad screen.

because of this routine, the game can show now the "skool daze" logo and the scorebox.

Next step is traslate x and y coordinates to the amstrad screen ram for 8x8 tiles (i think, i have to see). If i achieve this, then the game must almost start working on the cpc... I accept suggestions!  :laugh:

Here is the sna: Music theme, logo and scoreboard working.sna

arnoldemu

keep going with your progress :)

One suggestion:

Keep far away from MacDeath ;)

(You know how much he likes Speccy ports ;) ).

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Nich

I was also aware that someone had disassembled the source code for Skool Daze, but I never had the time or motivation to inspect it more closely or attempt to convert it to the CPC.

I have many fond memories of playing Skool Daze on the Spectrum when I was 9 or 10 years old so I would *love* to see a CPC version, even if it is a Speccy port! :)

BSC

What a great project! I used to play Skool Daze with my brother for ages (must have been around 1983) - what a great game! And fond memories :)

Thank you very much for approaching this conversion. And if I can be of any help - maybe concerning the sound / music department - let me know! I don't have a lot of spare time, but I'll see what I can do.
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

Joseman

#7
Hi

Thankyou for all the encouragement! and thankyou for the help offers.

Right now i'm trying to figure out how to manage the speccy screen ram on the amstrad.

I'll try to convert spc screen memory to coordinates -> coordinates to cpc screen memory

But like i said, i'm open to suggestions and help in this field :P   i don't know if there is a nearly direct conversion from spc to cpc with a conversion table or something like this, at the moment i'll try the 2 side conversion.

KaosOverride

#8
Maybe this can help:

Http://wordpress.animatez.co.uk/computers/zx-spectrum/screen-memory-layout/       

Http://whatnotandgobbleaduke.blogspot.com.es/2011/07/zx-spectrum-screen-memory-layout.html?m=1   


By what the first url shows, playing with HL seting the fixed offset from &4000 (010xxxxx..) to &C000 (110xxxxx..) and reorganize the Y bits, you are done, I think... Or if you continue to use the ZX screen offset then just the Y bits from HL :)

You have the source code, so this should be trivial to patch. Also you can use your own zx 1bit pixel to cpc pixel function to use the attribute table to select more than 2 colours.
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Joseman

Hi @KaosOverride  ;)

Yes, i know this 2 pages, and yes, i was thinking that in a bit level it can be reproduced...

at the moment i don't need the &c000 conversion because i'm using the spectrum screen memory (#4000), if i can do anything with it, perhaps in the future i will change to &c000 where is more easy to control the boundaries.

i was thinking in calculate only the row position, as the row itself is linear memory... but i don't think that it will work with pixel shifting that cross any boundarie...

As you see i don't know clearly what to do at the moment...








KaosOverride

Please take a look at the first URL. ZX lines are interlaced x8 like CPC ones, but ZX has 3 screen blocks. CPC has 1 fullscreen block. The HL register is used as shown at the graph. The Y coordinate bits are rearranged so memory mapping fix to the three blocks.

If you have a pseudo ZX framebuffer at CPC's &4000 without the 3 blocks, just one full block, just modify how Y bits are stored in HL and you have a just 1 block framebuffer interlaced x8.

The trick is that Y5, Y4 and Y3 are used as low bits for Y coirdinate. This maps 4x 2kb blocks, and 3 of them are used for the 3 screen blocks.

You have spectrum like geometry , but the map is 010 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 ... But ZX is 010 Y7 Y6 Y2 Y1 Y0 Y5 Y4 Y3 ...

You have to change the way HL is used , change the H increments for the Y2-Y0 to L, and the L block manipulation of Y5-Y3 to H
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

KaosOverride

Ohh and you have to shift all the bits because ZX pixel is 1 bit and CPC mode 1 are 2 bits...
01 Y7 Y6 Y5 Y4 Y3

Yes, and more tweaks are needed... :(
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

MacDeath

Is the game good to begin with ?

Also I have no issue with properly redone speccy games aka raster wankfest in fullscreen...  :laugh:

does seems like how to be a complete bastard.

Joseman

#13

Source Wiki:

The ZX Spectrum version was voted the 4th best game of all time in a special issue of Your Sinclair magazine in 2004.

P.S. i'm searching and learning code to convert pixel coordinates to cpc screen memory (done)

I need now some code to convert spectrum screen memory to pixel coordinates...

Joseman

And  here we go...

I really sweated blood to achieve this... i get the skool to show on screen.

The code is a mess, unoptimized to hell, making tricks everywhere, but at least i achieved it!

The most important is that I learned a lot about the game and if the skool shows up... then i learned well ;)

Here it is the sna: showing the skool.sna

and now going to sleep!  :P



Gryzor


MacDeath

#16
who said speccy port was lazy and easy ?


oops... well it would if you had the documented source code... sort of.
ghood luck anywhay, and don't forget to ask for the graphics convertions...




Joseman

Quote from: MacDeath on 12:39, 25 May 15

oops... well it would if you had the documented source code... sort of.
good luck anywhay, and don't forget to ask for the graphics convertions...


Yes, if i have the sufficient knowledge this conversion will be in about 2 hours  :laugh:

About the help in graphics and sounds, thanks really, but at the moment i want to know if i can achieve this (full game working) before waste everyone's time.

this days i will try to locate the screen at #0000, this way the game will load in the exact position than in spectrum (right now is not this way) as some code i've read uses  jumps to a predefined memory positions...

when i achieve this, another sna will emerge  :laugh:


MacDeath

#18
Good luck then in your Epic quest.

Try to see if you can contact original coder for this game, sometimes you can get lucky with that. ;)

Also ask the ZX spectrum community... they know their machine well.

Joseman

Ok

The video ram is now located at #100 - #3EFF (i can't do at #0000 because the game uses IM1)

Now all the original code and data is located at the same position than on spectrum. A lot of routines and data are hard stored, change it's location will be madness, because all this routines will be needed to change and reprogrammed.

Because of this (data in the same location), now you can see the characters in the ground floor, they are something like ghosts right now  :laugh:

As promised here is the sna: skool Daze [video memory relocalized, data in original place].sna







Joseman

#20
Quick update:

Now the ringbell and the lessonbox is working...

easy task here as they use routines that i already converted (slow & dirty  :laugh: ) to cpc.

sna: skool Daze [ringbell and lessonbox working].sna

KaosOverride

Lol some tiles are in reverse video. Thanks to the 8x8 colour attrib....
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Joseman

Quote from: KaosOverride on 23:46, 27 May 15
Lol some tiles are in reverse video. Thanks to the 8x8 colour attrib....

Well at the time there is no handle for the color, it's only 1bit data, pixel or no pixel, hence only 2 colours, the appearance of reverse video is only casual (i think)

KaosOverride

The reverse video looks like the tile is correct, but the color attribute will reverse the 2 colours to correct ones.

Maybe is better to redo some tiles and avoid reverse tricks. Do you have the original CPC video ram free? That's 16kb free for expanded to 4 colours tiles..
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Joseman

Quote from: KaosOverride on 15:03, 28 May 15
Do you have the original CPC video ram free? That's 16kb free for expanded to 4 colours tiles..

no, and it will never be  :laugh:


Powered by SMFPacks Menu Editor Mod