manu
Cold Store
Posts: 5
|
Post by manu on Feb 12, 2023 21:14:57 GMT
Hi. Could the program be used with mode 1 for amstrad? Thanks.
|
|
|
Post by xavisan on Feb 13, 2023 22:52:14 GMT
Hi. Could the program be used with mode 1 for amstrad? Thanks. According to this it seems that no, (I couldn't be 100% sure either, but I haven't seen anything related to Amstrad mode 1). Now the engine has only one mode (160x200). But I suppose that changing those values could work for you and some other calculation should be reviewed. start equ $ ld hl,(57) ; fetch interrupt address. ld (firmad),hl ; store firmware address. call 48127 ; initialise screen to default settings. call 48148 ; clear the screen. xor a ; mode 0, 16 colours. call 48142 ; set screen mode. start0 call game ; start the game. jr start0 Neither by replacing the entries of the call to the ROM in the EngineCPC.asm file, the selection of the Screen mode in the amstrad is done through the call to the ROM &BD1C , which would be equ &BD1C , since in addition the screen resolution in the Amstrad varies from one mode to another, in addition to the colour palette, and many parts of the Engine would have to be modified, From what I've been looking at, even this would need to be modified (I'm sure there are many more things to take into account, that I don't know) ; This routine returns a mode 0 screen address for (dispx, dispy) in hl. scadd ld a,(dispx) ; x position. and 248 ; get character row (multiple of 8), only 25 so only need 5 bits. ld l,a ; copy to hl. ld h,0 add hl,hl ; * 16. ld b,h ; copy to bc. ld c,l ; bc = * 16. add hl,hl ; * 32. add hl,hl ; * 64. add hl,bc ; * 80. ; Done character row, now work out pixel position. ld a,(dispx) ; restore x position. and 7 ; line 0-7 within character square. rlca ; multiply by 2048. rlca rlca add a,h ; add to high byte. add a,192 ; add base address of screen. ld h,a ; store in high byte. ld a,(dispy) ; y coordinate. rra ; divide by 2, carry already cleared. ld c,a ; low byte. ld b,0 ; no high byte. add hl,bc ; add to address. ret What I wouldn't know how to tell you about the final result even modifying it, since the definition of the Sprites is another issue to take into account, as well as the tiles, which are related to the coordinates. (but it should work.). I don't know if someone will be able to guarantee it 100%, for my part I couldn't tell you, I have given you an answer by basically looking at the Engine's asm code, and by consulting the Data Becker book that I still have on ASM for Amstrad CPC. But /Xavi
|
|
manu
Cold Store
Posts: 5
|
Post by manu on Feb 14, 2023 11:59:53 GMT
thanks
|
|
|
Post by xavisan on Feb 14, 2023 21:07:38 GMT
|
|