News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Recent posts

#1
avatar_krusty_benediction
Demos / Re: 40 YEARS AMSTRAD MINI DEMO
Last post by krusty_benediction - Today at 21:21
Et voilà

first proof of concept of the demo playing 2 parts that seems to not have big bugs.
I have not yet worked on the bundle to help participants to code and test their part, but I have made some data reorganization to ease that.

Here is the code of the two fake parts (using basm, but I'll provide necessary for standard assemblers)

part1

;;
; Example of simple part that relies on the demo system and it s automatic music play
; No init are used for this part
;
; Of course parts can be written with any assembler as soon as the API contracts are respected.
; I'm pretty sure my files are rasm compatible


include "demosystem/public_macros.asm"
include "contract/part1.asm"

org PART1_LOADING_AREA

;;
; Each part must start with these 3 jump blocks
; So systematically 6 bytes that compress badly are lost
; In case no init is used, set the address to demo_system_address_of_a_ret
part1
dw init_assets_with_firmware  ; System has not been killed yet, it is then possible to use it to build/compute stuff
               ; this is called one time just after deo launched
dw init_assets_without_firmware ; Some other init may prfere a killed system.
                                ; it is better to lost 3 bytes rather than plenty more by saving firmware state
dw play_part ;

;;
; First stage init.
; Print a string using the firmware
init_assets_with_firmware
ld hl, .txt
.loop
ld a, (hl) : inc hl
or a : ret z
call 0xbb5a
jr .loop
.txt db 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, "Part 1 uses firmware in first init stage, then clears some screen area in second stage. It's effect only consists in writting random bytes in the first 256 bytes of screen. Music is played under interruption by the system."
   db 10, 13
db 0

;;
; Second stage init.
; Clear some bytes on screen
init_assets_without_firmware
ld hl, 0xc000 + 80 * 5
ld de, 0xc000 + 80 * 5 + 1
ld bc, 256
ld (hl), 255
ldir
ret



;;
; A fake part that write random things on memory screen
play_part
; todo register a gunction to leave properly

; just a garbage effect to verify we loop and play the music
ld hl, 0xc000
.frame_loop

ld b, 50
.code_loop
ld a, r
ld (hl), a
inc l
djnz .code_loop

; Only a limit amount of  frames is allowed (init included)
; so we loop only if the system gives the authorization
DS_CHECK_IF_MUST_LEAVE (void)
jp nz, .frame_loop

.leave
; cleanup the mess
ld hl, 0xc000
ld de, 0xc000 + 1
ld bc, 256
ld (hl), l
ldir

if 0

; lost lots of time to see the screen cleanup
ld b, 50*3
.slow_down
push bc
DS_WAIT_VSYNC (void)
halt
halt
pop bc
djnz .slow_down
endif


; music is already under interruption, so there is no need to activate it again
DS_LAUNCH_NEXT_PART (void)




part2
;;
; Example of part that
; - does some inits
; - manually plays the music
; - make use of the data space in the banks
;
; Of course parts can be written with any assembler as soon as the API contracts are respected.
; I'm pretty sure my files are rasm compatible


include "demosystem/public_macros.asm"
include "contract/part2.asm"


org PART2_LOADING_AREA

FOREVER_VARIABLE_SPACE equ PART2_AVAILABLE_MEMORY_SPACE_FIRST_BYTE
VARIABLE1_RELATIVE_POSITION equ 0 ; a word that change over time
VARIABLE2_RELATIVE_POSITION equ 2 ; a byte to chose the palette

;;
; Each part must start with these 3 jump blocks
; So systematically 6 bytes that compress badly are lost
part2
dw init_assets_with_firmware ; System has not been killed yet, it is then possible to use it to build/compute stuff
               ; this is called one time just after deo launched
dw init_assets_without_firmware ; Some other init may prfere a killed system.
                                ; it is better to lost 3 bytes rather than plenty more by saving firmware state
dw play_part ;

;;
; the part uses the firmware for some init stuff
init_assets_with_firmware
; some fake data storage to test memory access
ld bc, 0x7f00 + PART2_DATA_BANK : out (c), c

ld hl, 0xdead
ld (FOREVER_VARIABLE_SPACE + VARIABLE1_RELATIVE_POSITION + 0), hl

ld bc, 0x7f00 + 0xc0 : out (c), c

ld hl, .msg
.loop
ld a, (hl) : or a : ret z
inc hl
call 0xbb5a
jr .loop
.msg db 10, "Part 2 uses system and write 0xdead in its dedicatd space during init 1, then 0xbeef in init 2. The effect continuously changes these values one time per call. Music is manually played and its duration is shown. Persistent memory is used to count the number of runs and select the palette", 0

;;
; This init is done when firmware is not used
init_assets_without_firmware
assert $<0x4000

; Some fake data storage to replace the previous one
ld bc, 0x7f00 + PART2_DATA_BANK : out (c), c
ld hl, 0xbeef
ld (FOREVER_VARIABLE_SPACE + VARIABLE1_RELATIVE_POSITION + 0), hl
ld bc, 0x7f00 + 0xc0 : out (c), c


xor a
ld (FOREVER_VARIABLE_SPACE + VARIABLE2_RELATIVE_POSITION ), a

assert $<0x4000
ret

play_part
.init
; play with the data stored
DS_SELECT_BANK PART2_DATA_BANK
ld hl, (FOREVER_VARIABLE_SPACE + VARIABLE1_RELATIVE_POSITION + 0)
inc (hl)

ld hl, (FOREVER_VARIABLE_SPACE + VARIABLE1_RELATIVE_POSITION + 1)
dec (hl)


; deactivate screen display
ld bc, 0xbc00  + 1 : out (c), c
ld bc, 0xbd00  + 0 : out (c), c

DS_SELECT_BANK PART2_DATA_BANK
ld a, (FOREVER_VARIABLE_SPACE + VARIABLE2_RELATIVE_POSITION + 0)
inc a : and %11
ld (FOREVER_VARIABLE_SPACE + VARIABLE2_RELATIVE_POSITION+0 ), a
DS_SELECT_BANK 0xc0

DS_STOP_INTERRUPTED_MUSIC (void)


; we play the music a bit later than the vsync.
; lets hope this 1/2 hlts of difference do not impact the sound experience
.frame_loop
DS_WAIT_VSYNC (void)

; Get the persistent data
DS_SELECT_BANK PART2_DATA_BANK
ld a, (FOREVER_VARIABLE_SPACE + VARIABLE2_RELATIVE_POSITION+0)
push af
DS_SELECT_BANK 0xc0
pop af


; Select the color according to it
ld d, 0 : ld e, a
ld hl, .raster_table
add hl, de
ld a, (hl)

; play the music using a different color
halt : halt
ld bc, 0x7f10 : out (c), c
out (c), a
DS_PLAY_MUSIC (void)
ld bc, 0x7f10 : out (c), c
ld bc, 0x7f40 : out (c), c
halt
ld bc, 0x7f54 : out (c), c


; Only a limit amount of  frames is allowed (init included)
; so we loop only if the system gives the authorization
DS_CHECK_IF_MUST_LEAVE (void)
jp nz, .frame_loop

.leave

; reactivate screen display
ld bc, 0xbc00  + 1 : out (c), c
ld bc, 0xbd00  + 80/2 : out (c), c


DS_INSTALL_INTERRUPTED_MUSIC (void)
DS_LAUNCH_NEXT_PART (void)


.raster_table
db 0x4b, 0x44, 0x45, 0x44
assert $< 0x4000

#2
S
Games / Re: The Key, a A "full" point ...
Last post by St-BeidE(DE/GB) - Today at 21:21
Quote from: St-BeidE(DE/GB) on Yesterday at 15:25My first thoughts where the same.
I just have no tapedeck at all.
On the other hand, it forces me to build
an arduino solution...
Not sooo bad at least.

Stefan
Errr... damn.
I just recognized, there is no Arduino based solution
of a "tape recorder" that is able to "record".
Seems, it's only PLAY file capable ?

Steven
#3
The parcel arrived safely. Thanks a lot PulkoMandy :) .
#4
I need this!!!
#5
Hi everyone, hola CPC archeologists!

I managed to recover the source files which make up the 1st iteration of Soundtrakker, written around 1991. The README contains a short story about the recovery, so have a look at https://github.com/BetaSoftCologne/soundtrakker if you are interested in some old stuff. 
#6
Everyone was talking about the Atari 2600. Never seen one or something similar, just arcades.
So I told my mother I want one.
Then I went out to brag to my friends that I would get one too.
A friend told me then : Why don't you get a Spectrum, it's an Atari and computer.
(You guessed right if you think that we were totally noobs)
Went back to home asking for a Spectrum...
Out again, same thing. Another one told me : Why don't you get an Amstrad?
What's this now? It's an Atari and computer, but it has a disk instead of tape and loads faster.
And Amstrad it was for me.
#7
T
Programming / CPCTelera 1.5 Decrunching Issu...
Last post by Typhon - Today at 20:40
Allo all,
So I've got a small CPCTelera 1.5 (development branch) uncompression issue. 
I have successfully generated a compressed and packed png (160x200 for Mode 0 screen) ->bin (via image_conversion.mk):

PALETTE=0 2 3 4 6 9 11 13 14 15 17 18 20 24 25 26
$(eval $(call IMG2SP, SET_MODE        , 0));
$(eval $(call IMG2SP, SET_PALETTE_FW  , $(PALETTE)))
$(eval $(call IMG2SP, SET_OUTPUT      , bin))
$(eval $(call IMG2SP, SET_IMG_FORMAT  , screen))
$(eval $(call IMG2SP, SET_FOLDER      , tmp/))
$(eval $(call IMG2SP, CONVERT         , img/transition.png, 160, 200, transition, palette, tileset))
$(eval $(call IMG2SP, CONVERT_PALETTE , $(PALETTE), t_palette))


Which is then converted again successfully via compression.mk into three source files:

$(eval $(call ADD2PACK,transition,tmp/transition.bin))
$(eval $(call PACKZX7B,transition,src/))


With amongst other things, 3 output files, transition.h, transition.s, and transition.h.s. I include these in my code successfully:

// File 'src/transition.h' generated using cpct_pack
// Compresor used:  zx7b
// Files compressed: [ 'tmp/transition.bin' ]
// Uncompressed:    16400 bytes
// Compressed:      630 bytes
// Space saved:      15770 bytes
//
#ifndef transition_630_H
#define transition_630_H
// Declaration of the compressed array
extern const unsigned char transition[630];
// Address of the latest byte of the compressed array (for unpacking purposes)
#define transition_end      (transition + 630 - 1)
// Compressed and uncompressed sizes
#define transition_size_z  630
#define transition_size    16400
#endif

However, when I try to decompress and display onto the screen:

cpct_zx7b_decrunch_s(VIDEO_MEM_END, transition_end);

It *does* display (see attached screenshot), however, the decrunching routine doesn't seem to stop and overwrites the rest of my program with unpredictable results (crashes mainly).

You cannot view this attachment.

Note that (as mentioned on a previous thread on the forum.) #define VIDEO_MEM_END ((void*)0xffff)


if I don't decrunch, all is good, but the image doesn't display.

What gives?

#8
In 80's my papa was the publisher of a "racing form". A 4 pages newsletter on horse racing published 3-4 times a week, our family business. A friend of him, a pioneer computer programmer, eventually convinced him to add comparative racing data to the newsletter. In 1986 he offered to write the software for granted. And he did too (in GWBasic), both for data entry, a prediction analysis alghorithm (which was quite genial at the time) and for printing the proofs (via an electronic typewriter). The only thing we needed was a "PC compatible". So papa bought an Amstrad PC 1512 (with double disc drive, and no hdd). The plan proved to be very successful but this is another story. Alongside the 1512, the seller convinced him to buy a CPC 464 with green screen monitor for his nerdy son (yours truly) who was craving for anything, well, nerdy.

So the answer is that the CPC chose me, not the vice versa. And I'm happy it did!
#9
Quote from: Targhan on Today at 18:18I didn't choose the CPC. It chose me.
Yeah!  Whole universe was create because God wanted to you got CPC. :)
#10
The mouse needs a NOT gate for each direction. And that's all. I once made something similar to ST mouse.
Years later I thought that even that wouldn't be necessary. Just supply 5V to pin 7 in mouse, e.g. from pin 5 or 9 from CPC through diodes. That is, from the unused "mass" to the second joystick or from Fire3. I don't remember which direction the current flows. And instead of NOT gates, replace up<>down and right<>left. And theoretically it should work. But I don't have CPC at hand to check it.
Powered by SMFPacks Menu Editor Mod