News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Devilmarkus

Barbarian 128k

Started by Devilmarkus, 12:31, 28 October 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

remax

#25
Funny,

I was just having a Barbarian session, and i was wondering if it was possible to do exactly what you did.

Congrats!

Herr... "Pokes : No" gives infinite live and one shot victory?  :o
Brain Radioactivity

MacDeath

#26
what about 4bpp coded sprites instead ?


I found out the sprites (warrior's) are in 2bpp (mode1) as can be seen by the find fraphics function on winape.
it is converted, recoloured, and masked, hence the mode1 limitation despite being in mode0 at the display.

it take perhaps some CPU, but it saves a lot lot lot of RAM indeed...

Just imagine sprites in 4bpp, with both flips (left or right direction) and different spriteset for both opponents in order to have "colour swap"...yeah that's right.
May weight like 8 time the Datas.

instead it converts 2bpp into Mode0, choose the colours as well, may even flip left-right.
thx code (pun!) there are only 2 warriors on screen... but lots of different movements, so quite a lot of tiles for sprites.

Not sure that to manage 8x time the datas would be even more CPU efficient (=faster), would it ?

Many 1vs1 fighting games are quite slow on CPC actually... ut I think it is unfair... even without Hardsprites, the CPC could certainly handle on 2 well animated sprite betterly, provided those games rarely have scrolling...
But to mask something can be quite heavy indeed, need to get a patch of background to erase previous srpites (the ones from the last frame) then put new ones (masked and calculated) on those...

Controls and A.I (CPU opponent needs to be somewhat challenging)... colision detection... surely the CPU has some heavy job here and then anyway...
Is this even double buffered ?

So yeah, to patch to get a true history mode and single loading is great... but a 128K version could do even more actually... and multiload is great with Disks.

Axelay

Quote from: Devilmarkus on 14:52, 28 October 13

As long the ram bank is swapped, I need to disable the interrupts, yes...


Could that final CALL &7ddd be made after the EI?

Devilmarkus

Quote from: remax on 01:15, 29 October 13
Herr... "Pokes : No" gives infinite live and one shot victory?  :o

Sorry about that.

I forgot to remove the pokes after loading...

So, edit line 20 in BARBAR.BAS and remove the 2 POKEs here...

(Or download this DSK here)

[attachurl=2]

Calling &7DDD after EI causes a bad palette... :D
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

remax

Quote from: Devilmarkus on 11:42, 29 October 13
Sorry about that.

I forgot to remove the pokes after loading...

So, edit line 20 in BARBAR.BAS and remove the 2 POKEs here...

(Or download this DSK here)

[attachurl=2]

Calling &7DDD after EI causes a bad palette... :D

Thanks  ::)
Brain Radioactivity

qbert

Hi there !
Let me correct on this : the sprites here are not 2bpp like "mode 1", but 2bpp like "multi-color mode" on the Commodore 64 ! .... yes, remember all of this was drawn on the C64, definitively a lesser (but faster) machine !  ;D   1 mhz CPU and color-clash ... and they did it : Barbarian, the Ultimate Warrior...  :P


Quote from: MacDeath on 03:18, 29 October 13

what about 4bpp coded sprites instead ?

I found out the sprites (warrior's) are in 2bpp (mode1) as can be seen by the find fraphics function on winape.
it is converted, recoloured, and masked, hence the mode1 limitation despite being in mode0 at the display.

it take perhaps some CPU, but it saves a lot lot lot of RAM indeed...

Just imagine sprites in 4bpp, with both flips (left or right direction) and different spriteset for both opponents in order to have "colour swap"...yeah that's right.
May weight like 8 time the Datas.

instead it converts 2bpp into Mode0, choose the colours as well, may even flip left-right.
thx code (pun!) there are only 2 warriors on screen... but lots of different movements, so quite a lot of til
[...]


qbert

#31
The C64 was doing that too with 64k only  ;D  ok the video RAM space needed is halved.
I applaude to this great initiative that eradicate the limitation that was obscuring the fact that the CPC version is definitively better because prettier.


Quote from: Devilmarkus on 12:31, 28 October 13

For me, the most annoying limiatation was, that you have to select a scene on startup.

MacDeath

#32
QuoteLet me correct on this : the sprites here are not 2bpp like "mode 1", but 2bpp like "multi-color mode" on the Commodore 64 ! .... yes, remember all of this was drawn on the C64, definitively a lesser (but faster) machine !     1 mhz CPU and color-clash ... and they did it : Barbarian, the Ultimate Warrior...
true too. the method had many advantages...
No need to redo graphics AND would save some precious RAM for those CPC64K...

QuoteThe C64 was doing that too with 64k only  ;D  ok the video RAM space needed is halved.
True too.
2bpp graphics in wide pixels... 4 colours per attributes.
the attribute table having some weight but still far lighter than 4bpp for a whole screen.

CPC in 64K :
native graphics are almost twice heavier...
"VRAM" uses more on the RAM (a whole 16K for the 160x200)
More code because no hardwired sprites... need to perform soft conversion from 2bpp to 4bpp, need to mask so a buffer for the background may be needed, parts of it must be kept in the RAM to refresh, while hardsprite based can just leave the background as it is.


On CPC there are some ways to do it : all parts of the screen that may get animation (sprites) over it are to be stored so you can always get again the fresh background...

or else you keep a smaller buffer for the parts/characters that are covered by the sprites, but this would be actually heavier on CPU I guess... and you may risk loosing bits if bugs or faulty thing... (or not ?).

sad part is that a CPC could really compete actually quite well with C64 for most games without scrolling provided it was 128K only.

Hell even having a CPC480 or CPC496 could be enough to save many speccy48 ports from those RAM saving technics.



64K CPCs are so underRAMed.


Fano learnt and proved so much when dealing with Rick Dangerous and R-Type...
To me that is even a miracle some actually managed to produce good games with CPC464.


Fun to see the PC CGA version also share the same 8bit sprites as CPC and C64... "wide pixels" lol...

romppainen

When talking of C64 version the 64k limit was certainly reached as it doesn't have all the backgrounds simultaneously in memory either: Game is split into 2 parts, "combat practise" (endless) and "fight to the death" (completable) with 2 different backgrounds each, which need to be loaded separately.

qbert

 wops... sorry for the confusion... so it was 2x2 and not 4x1 ... thank you for the correction !
Well... thanks to Devilmarkus, the CPC version is not only the prettiest 8bit version, it is now the richest version too !  8)

Quote from: romppainen on 02:45, 30 October 13
When talking of C64 version the 64k limit was certainly reached as it doesn't have all the backgrounds simultaneously in memory either: Game is split into 2 parts, "combat practise" (endless) and "fight to the death" (completable) with 2 different backgrounds each, which need to be loaded separately.


MacDeath

The CPC version is actually even somewhat pretier than 16bit versions IMO...


Backgrounds are really well lavished on CPC.

Devilmarkus

Fiddling on the game's palette and pixels...

Also changed the name to "Death Sword" as it's the American name of this game...

The scenes so far:

Spoiler: ShowHide







Will not show more details yet, but I have help from MacDeath and TotO ;)

And I'm sure, SyX is getting mad with my questions :P
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

SyX

Quote from: Devilmarkus on 07:13, 02 November 13And I'm sure, SyX is getting mad with my questions :P
No, specially... but you have an special skill for getting me in my most busy moments of the day  :P

TFM

Quote from: SyX on 15:07, 02 November 13
No, specially... but you have an special skill for getting me in my most busy moments of the day  :P


Same here.  :P   :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Devilmarkus

Progress: ~98% ;)

New video:
Erstellt von Camtasia Studio 8

Looking for some people who can test it on the real machine:
- CPC 6128
- CPC 664 and 464 (expanded to 128k at least)
- CPC's with extra ROMs, Expansions etc...

The game does not work on CPC+!
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

GOB

Why not on cpc+ ?
If it's the keyboard test you can correct it ;)


Devilmarkus

We tested it on a 6128+ and the GFX gone mad...

(Perhaps a bad transfer, who knows?)

But I'm still looking for people, who can check it on a real CPC... !??!

How to patch it for CPC+? (Keyboard)

The DSK available on cpc-power.com is good for emulators, but doesnt work on a real CPC+
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#42
Here's the keyboard scan for Barbarian: (+ more code? This is a codepart which is called from somewhere)

        LD        B,&F7                   ;;820C:   ..      06 F7
        LD        C,&82                   ;;820E:   ..      0E 82
        OUT        (C),C                   ;;8210:   .I      ED 49
        LD        HL,&835E                ;;8212:   !^.     21 5E 83
        XOR        A                       ;;8215:   .       AF
        LD        D,&0B                   ;;8216:   ..      16 0B
        PUSH        AF                      ;;8218:   .       F5
        LD        C,(HL)                  ;;8219:   N       4E
        LD        B,&F4                   ;;821A:   ..      06 F4
        OUT        (C),A                   ;;821C:   .y      ED 79
        LD        B,&F6                   ;;821E:   ..      06 F6
        IN        A,(C)                   ;;8220:   .x      ED 78
        OR        &C0                     ;;8222:   ..      F6 C0
        OUT        (C),A                   ;;8224:   .y      ED 79
        AND        &3F                     ;;8226:   .?      E6 3F
        OUT        (C),A                   ;;8228:   .y      ED 79
        LD        B,&F4                   ;;822A:   ..      06 F4
        OUT        (C),C                   ;;822C:   .I      ED 49
        LD        B,&F6                   ;;822E:   ..      06 F6
        LD        C,A                     ;;8230:   O       4F
        OR        &80                     ;;8231:   ..      F6 80
        OUT        (C),A                   ;;8233:   .y      ED 79
        OUT        (C),C                   ;;8235:   .I      ED 49
        POP        AF                      ;;8237:   .       F1
        INC        A                       ;;8238:   <       3C
        INC        HL                      ;;8239:   #       23
        DEC        D                       ;;823A:   .       15
        JR        NZ,&8218                ;;823B:    .      20 DB
        LD        D,&0A                   ;;823D:   ..      16 0A
        LD        E,&00                   ;;823F:   ..      1E 00
        LD        HL,&8352                ;;8241:   !R.     21 52 83
        LD        B,&F7                   ;;8244:   ..      06 F7
        LD        C,&82                   ;;8246:   ..      0E 82
        OUT        (C),C                   ;;8248:   .I      ED 49
        LD        B,&F4                   ;;824A:   ..      06 F4
        LD        A,&0E                   ;;824C:   >.      3E 0E
        OUT        (C),A                   ;;824E:   .y      ED 79
        LD        B,&F6                   ;;8250:   ..      06 F6
        IN        A,(C)                   ;;8252:   .x      ED 78
        OR        &C0                     ;;8254:   ..      F6 C0
        OR        E                       ;;8256:   .       B3
        LD        C,A                     ;;8257:   O       4F
        AND        &3F                     ;;8258:   .?      E6 3F
        OUT        (C),C                   ;;825A:   .I      ED 49
        OUT        (C),A                   ;;825C:   .y      ED 79
        INC        B                       ;;825E:   .       04
        LD        C,&92                   ;;825F:   ..      0E 92
        OUT        (C),C                   ;;8261:   .I      ED 49
        DEC        B                       ;;8263:   .       05
        OR        &40                     ;;8264:   .@      F6 40
        OUT        (C),A                   ;;8266:   .y      ED 79
        LD        B,&F4                   ;;8268:   ..      06 F4
        IN        A,(C)                   ;;826A:   .x      ED 78
        CPL        ;;826C:   /       2F
        LD        (HL),A                  ;;826D:   w       77
        INC        HL                      ;;826E:   #       23
        INC        E                       ;;826F:   .       1C
        DEC        D                       ;;8270:   .       15
        JP        NZ,&8244                ;;8271:   .D.     C2 44 82
        RET        ;;8274:   .       C9



So, who can patch it? The method from T&J doesnt work here.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

dragon

#43
QuoteLooking for some people who can test it on the real machine:
- CPC 6128

I can test the game in my cost down 6128 if you want.

Devilmarkus

Would be cool!

I sent you a PM with the informations.

BTW.: Thanks to César (CNGSoft) I patched the keyboard routine for CPC+ (He rewrote the complete PSG- and Keyboard code!)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

redbox

Quote from: Devilmarkus on 18:21, 04 November 13
So, who can patch it? The method from T&J doesnt work here.

I have the original version of Barbarian (Dump No.4 on CPC Power) and I've managed to patch it to work on the Plus as well:


    org    &81ab

    ld     hl,&82bc       
    ld     bc,&f40e               
    out     (c),c
    ld     b,&f6
    in     a,(c)
    and     &30
    ld     c,a
    or     &c0                     
    out     (c),a                 
    out     (c),c                 
    inc     b
    ld     a,&92
    out     (c),a                 

    set     6,c                   

scankey:
    ld     b,&f6
    out     (c),c                 
    ld     b,&f4                 
    in     a,(c)                 
    cpl                     
    ld     (hl),a                 
    inc     hl                   
    inc     c                     
    ld     a,c
    and     &0f
    cp     &0a                   
    jr     nz,scankey           

    ret


Have tested it in WinApe and it works, but not had a chance on a real Plus yet.


Devilmarkus

#46
We did this:

(complete replacement for PSG and Keyboard scanning)

        ld        bc,$F782
        out        (c),c
        ld        hl,$835E
        ld        e,0
barb128k_psg:
        ld        b,$F4
        out        (c),e
        ld        bc,$F6C0
        out        (c),c
        out        (c),0
        ld        b,$F4
        ld        a,(hl)
        out        (c),a
        ld        bc,$F680
        out        (c),c
        out        (c),0
        inc        hl
        inc        e
        ld        a,e
        cp        $0B
        jr        c,barb128k_psg
        ld        hl,$8352
        ld        e,$40
barb128k_kbd:
        ld        bc,$F782
        out        (c),c
        ld        bc,$F40E
        out        (c),c
        ld        bc,$F6C0
        out        (c),c
        out        (c),0

        ld        bc,$F792
        out        (c),c
        dec        b
        out        (c),e
        ld        b,$F4
        in        a,(c)
        cpl
        ld        (hl),a
        inc        hl
        inc        e
        ld        a,e
        cp        $4A
        jr        c,barb128k_kbd
        ret

        defs        &15


Last DEFS &15 is because the new code is &15 bytes shorter than the original code.

It's perhaps located @ different area in ram, because my game is based on BARB2A.

(BARB1A,1B don't have Draxx, and BARB2B was way too large to patch around... BARB2A did not remove Draxx and Princess from scene, but thanks to Fano, I also managed this....)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

First test:
CPC 6128:


When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

dragon


romppainen

I can do some testing with real 6128 during next weekend if still needed.

Powered by SMFPacks Menu Editor Mod