News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Executioner

WinAPE enhancements

Started by Executioner, 10:09, 22 March 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TFM

#75
Quote from: Trebmint on 19:18, 13 April 16
Well most of the well respected emulators for NES, SNES, Megadrive, Master System, 2800/7800, long long list of machines from the 80's have these upscalers. I guess you're argument is true if you're into purely the machine, however if you want to play Roland on the Ropes or Sorcery and want better smoother less blocky graphics there is no way of doing so.
This doesn't change the code, speed or gameplay, just allows those that want to turn it on to have it look slightly better graphics


Good points... Well, in this case I would just use the PC itself for even better game experience. And I guess you could argue that this is not true in all cases.... oh well. Just not perfect this world.  ;) :)


Quote from: Trebmint on 21:54, 13 April 16I dont actually understand this really? If it doesnt change the software, just improves the imagery via the emulator then people who dont want to use it dont and people who do can!Are you really saying I wont use it, so I dont think anyone should be allowed too? Most other system emulators employ it so I cant see why the CPC is so pure as not to allow it


Maybe the solution could be to make very clear which feature are native to CPC/Plus and which are native to the emulator?!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Trebmint

Quote from: TFM on 22:32, 13 April 16

Good points... Well, in this case I would just use the PC itself for even better game experience. And I guess you could argue that this is not true in all cases.... oh well. Just not perfect this world.  ;) :)



Maybe the solution could be to make very clear which feature are native to CPC/Plus and which are native to the emulator?!
I'm sure anyone that would care would know the features of the CPC and PLUS machines. Lots of emulators for other systems from the 80's & 90's have these and nobody seems confused. All it does is smooth out pixels, and given mode 0 blown up on a modern pin sharp monitor looks far more jarring than it did back with the old blurry CPC monitors.... surely its not a bad option to have?

andycadley

Quote from: roudoudou on 22:23, 13 April 16
I have another INT 50 nops after the first INT. Cause of the extra-interrupt, split-rasters are delayed
Nope, the problem you have is that the firmware interrupt handler takes an age to do anything and as a result your timing is off at the start of the screen.

You can fix it by taking the firmware out of the equation, by doing something like:

ld hl,&c9fb
ld (&38),hl

to replace the interrupt routine with an EI: RET combo.

You can see this more easily if you turn on the "Show Ints" feature in WinAPE's registers window, which changes the border whilst interrupts are being serviced.

roudoudou

#78

As i said, this piece of code is a short version.

Try by yourself, in the full program, there is already an EI/RET in #38 -> that's why split raster are delayed of a CALL/EI/RET nops ;)


I have no explanation of the TWO interrupts per VBL with PRI enable, i'm sorry...




I will take a look at the show int feature and investigate further


Here is a longer version if you want to try







Quote
ORG #8000
nolist




DI
ld hl,#c9fb
ld (#38),hl
ei
call UnlockAsic
call WaitVBL
halt
; configure CRTC
InitWideScreen:
ld b,#BC
ld hl,crtcwidescreenregister
InitWideScreenLoop:
ld a,(hl)
inc hl
cp 255
jr z,InitWideScreenEnd
out (c),a
inc b
ld a,(hl)
inc hl
out (c),a
dec b
jr InitWideScreenLoop
InitWideScreenEnd:

; clear screen
LD HL,#C000
LD DE,#C001
LD (HL),0
LD BC,16383
LDIR

;--------------------------------------------------------------
call WaitVBL
call AsicON

MainLoop:
ld a,1
ld (#6800),a ; PRI line 1
ld b,199
ld de,#FF
ld hl,#6400
halt
loop64:
ld (hl),d ; split-raster
ld (hl),e
ld (hl),d
ld (hl),e
defs 64-4-8,0
djnz loop64
jp MainLoop





WaitVBL:
; wait VBL
ld b,#F5
novbl: in a,(c)
rra
jr nc,novbl


AsicOn:LD BC,#7FB8
OUT (C),C
ret

UnlockAsic:
DI
LD E,17     
        LD HL,ASIC   
        LD BC,#BC00
UnlockLoop    LD A,(HL) 
        OUT (C),A   
        INC HL       
        DEC E       
        JR NZ,UnlockLoop
        EI           
        RET
ASIC    DEFB 255,0,255,119,179
        DEFB 81,168,212,98,57,156
        DEFB 70,43,21,138,205,238

crtcwidescreenregister: defb 4,38,9,7,2,50,1,48,7,30,6,25,5,0,12,#30,13,0,255



My pronouns are RASM and ACE

roudoudou

#79
Here are registers captures before and after the INT-CALL






I ask a friend to run the code on a real CPC+

My pronouns are RASM and ACE

Executioner

It appears that since your HSYNC width and start covers both the start and end of a scan line the interrupt happens both at the end of scan line 0 when HCC wraps back to 0 and HSYNC is still active (ie. HCC=0, VLC=1, VCC=0) and when the HSYNC becomes active again at the end of the same scan line when HCC=32, VCC=0,VLC=1. You can either adjust the HSYNC position or reduce it's width (default 14 characters) to stop this.

Executioner

P.S. It would be nice to know if the same happens on a real Plus. Unfortunately I can't test since I'm on holiday.

roudoudou

Quote from: Executioner on 14:06, 14 April 16
P.S. It would be nice to know if the same happens on a real Plus. Unfortunately I can't test since I'm on holiday.


I asked a friend, i will have an answer tonight
My pronouns are RASM and ACE

roudoudou

Same result on a real CPC+, two INT on the same line. Winape is accurate  :D
My pronouns are RASM and ACE

roudoudou




Is there a way to assemble with winape assembler the undocumented instructions like LD E,SRL(IX+4) ?
If i use DEFB, Winape can disassemble. I tried two syntax -> LD E,SRL(IX+0) and SRL (IX+0),E
None of them work
May i miss something?
My pronouns are RASM and ACE

Executioner

Not currently, added to the TODO list (which is still quite big)

roudoudou

Hi
I use W2.0b2 and when quitting, there was a loud bass huge sound, like broooooooonnnnnnnnnnnnn (AFTER closing winape)
(I watched a demo, reset the machine, made a CAT then quitting)
I wait a little to see if it was a buffer emptying itself but no
The sound stops when i clicked a directory in windows explorer
My pronouns are RASM and ACE

Executioner

Quote from: roudoudou on 07:46, 10 June 16
Hi
I use W2.0b2 and when quitting, there was a loud bass huge sound, like broooooooonnnnnnnnnnnnn (AFTER closing winape)
(I watched a demo, reset the machine, made a CAT then quitting)
I wait a little to see if it was a buffer emptying itself but no
The sound stops when i clicked a directory in windows explorer

I think it is only with 8 bit sound. Caused by WinAPE using AY-style voltage bias (ie. unsigned wave output). I think the 16 bit version uses signed output, but the volume is probably roughly halved.

roudoudou

It seems that Winape generates interrupt even when CRTC is not initialized by the first ROM


A real CPC (or Arnold) does not generate interrupt with a partial Init of the CRTC (test with Asic CPC+) then it loops in the first HALT, even after a EI


My partial init (register/value ended by 255): defb 4,38,9,7,2,50,1,48,7,30,6,25,5,0,12,#30,13,0,255


Work on real CPC only with full init (all register values from 0 to 15): defb &3f, 48, 50, &8e, 38, 0, 25, 30, &00, &07, &00,&00,&30,&00,&c0,&00


My pronouns are RASM and ACE

Executioner

Quote from: roudoudou on 21:02, 19 June 16
It seems that Winape generates interrupt even when CRTC is not initialized by the first ROM

I don't understand the question. The main register you're not initialising is Register 0. I assume the default value isn't 63 then.

arnoldemu

Quote from: Executioner on 03:17, 25 June 16
I don't understand the question. The main register you're not initialising is Register 0. I assume the default value isn't 63 then.
correct all crtc registers are 0 at reset.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

roudoudou




i tried this with Winape 2ab2



out &bc00,15
out &bd00,222
print inp(&bf00)



it returns 0 instead of 222 as register 15 may be read (i know, it is WAS unused until today) but i need it  :P
My pronouns are RASM and ACE

Executioner

@roudoudou I'll look into that.

I got a new MSI notebook, so I'm attempting to move all the code over. I have a later version of Delphi (XE2) which I wanted to use and upgrade WinAPE from Delphi 7. Unfortunately, there are a few major problems with DirectX libraries etc. I'm looking into maybe going with Lazarus rather than Embarcadero RAD Studio because the prices of the new versions are quite ridiculous, and there are a lot of promising free cross-platform features.

Wanderer

Quote from: Executioner on 00:26, 13 October 16I'm looking into maybe going with Lazarus

Other projects have been coded with Lazarus, successfully as it seems. I happen to be using one of them (Total Commander - the 64-bit version is in Lazarus).

If you wish, you could try asking Christian (TC's developer) some info on the challenges he faced (in the forum).
- Wanderer -

roudoudou

Hi


I was testing some FDC format functions


I create a track with a size 6 sector


First i send a regular format command track 40, sector size 0, ID=1, Gap  then i change sector size to 6 during sector list sending


If i eject the floppy at this point, the DSK saved contains a track 40 with one size 0 sector (not 6 as specified AND expected)


If i format and write to the sector and finally eject the floppy, Winape crashes and write nothing to the DSK


The normal behaviour (or HFE point of view) is to unformat track cause sector 6 write will erase track descriptor. But, in a DSK point of view, it is expected than the sector is written and stored, without Winape crash, like Arnold will do, for example.






Here are the two sources


track format adapted from A100% code source



org #8000


ld bc,#FA7E
ld a,1
out (c),a
di


ld b,0
sttt
push bc
ld b,0
djnz $
pop bc
djnz sttt


ld bc,#FB7E
call recale


; start at track 40
ld a,40
ld hl,piste
ld (hl),a
jp seek


;--------------------------------
start
ld a,4
call putfdc
xor a
call putfdc
call getfdc
and #c0
jp nz,error
ld ix,liste_secteur
ld hl,sequence_format
ld d,6


formatage
ld a,(hl)
call putfdc
inc hl
dec d
jr nz,formatage
ld d,0 ; legal track format sector size (not used during writing operation)
ld e,(hl)
ld h,0
ld a,(ix+0)


data
ld l,a
test
in a,(c)
jp p,test
inc c
out (c),e ; track ?
dec c
test1
in a,(c)
jp p,test1
inc c
out (c),h ; head
dec c
test2
in a,(c)
jp p,test2
inc c
out (c),l ; Sector ID
dec c
test3
in a,(c)
jp p,test3
inc c
ld a,6
out (c),a ; Sector size 6
dec c
inc ix
ld a,(ix+0)
cp #ff
jr nz,data


ld hl,tampon
ld d,7


get
call getfdc
ld (hl),a
inc hl
dec d
jr nz,get


ld a,(tampon)
and #C8
jr nz,restart
ld a,(tampon+1)
and #82
jp nz,error
ld a,(tampon+2)
and #22
jp nz,error
ld a,4
call putfdc
xor a
call putfdc
call getfdc
and #C0
jp nz,error
ei
ld a,'#'
call #BB5A
di
ld hl,piste
inc (hl)
ld a,(hl)
cp 41
jr z,suit


seek ld a,#0F
call putfdc
xor a
call putfdc
ld a,(hl)
call putfdc
call ready
jp start


restart
call recale
jr seek


recale
ld a,7
call putfdc
xor a
call putfdc
ready
ld a,8
call putfdc
call getfdc
ld e,a
call getfdc
ld a,e
and #20
jr z,ready
ret


suit
ld a,7
call putfdc
xor a
call putfdc
call ready
ld hl,message_point
call printsystem


motoff ld bc,#FA7E
xor a
out (c),a
ei
ret


error
ei
call motoff
ld hl,message_erreur
call printsystem
ret


message_erreur defb 'Erreur (disquette protegee ou lecteur vide)'
message_point defb '.',10,13,0
message_fin defb 10,13,0


printsystem ld a,(hl)
or a
ret z
call #BB5A
inc hl
jr printsystem


putfdc push af
lieta in a,(c)
rla
jr nc,lieta
sors inc c
pop af
out (c),a
dec c
ret


getfdc push bc
ld bc,#FB7E
litfdc in a,(c)
rla
jr nc,litfdc
inc c
in a,(c)
pop bc
ret


sequence_format defb #4D,0,0,1,80 ; size 0 sector for command!
remp defb #AA
piste defb 40
liste_secteur defb 1,#FF
tampon defs 7,0



write sector from A100% code source


org #8000


; ECRITURE SECTEUR
; HL=adresse memoire
; A=piste
; D=secteur debut
; E=secteur fin
di
call MOTON
;
; 8191 #DD
; ended by a 8192e #DE
ld a,#DD
ld hl,#4000
ld (hl),a
ld de,#4001
ld bc,8191
ldir
inc a
ld (de),a
;




ld a,40
ld de,#101
ld hl,#4000
call ECRITURE
call MOTOFF
ei
ret


MOTOFF
ld bc,#FA7E
xor a
ld (MOTOR),a
out (c),a
ret


MOTON
ld a,(MOTOR)
or a
ret nz
ld bc,#FA7E
inc a
ld (MOTOR),a
out (c),a
ld e,25
MOTON_tempo
call WAITVBL
dec e
jr nz,MOTON_tempo
ret


VBL
ld b,#F5
NOVBL
in a,(c)
rra
jr nc,NOVBL
ret


VBLEND
ld b,#F5
CURRENTVBL
in a,(c)
rra
jr c,CURRENTVBL
ret


WAITVBL
CALL VBL
CALL VBLEND
ret


SEEKTEST
di
ld bc,#FB7E
LITFDC
in a,(c)
and #10
jr z,SEEK
LITFDC2
in a,(c)
rla
jr nc,LITFDC2
rla
jr c,ECRIS
LIS
inc c
in a,(c)
dec c
jr LITFDC


ECRIS
xor #FF
inc c
out (c),a
dec c
jr LITFDC


SEEK
ld a,#0F
call PUTFDC
xor a
call PUTFDC
ld a,(PISTE)
call PUTFDC
SEEKOK
ld a,8
call PUTFDC
call GETFDC
ld d,a
call GETFDC
ld a,d
and #20
jr z,SEEKOK
ret




ECRITURE
ld (PISTE),a
ld a,d
ld (SECTEURDEB),a
ld a,e
ld (SECTEURFIN),a
call SEEKTEST


push hl
ld hl,COMMAND
ld d,9
WRITECOMMAND
ld a,(hl)
inc hl
call PUTFDC
dec d
jr nz,WRITECOMMAND
pop hl
jr GETDATA


PASRES
inc c
ld a,(hl)
out (c),a
inc hl
dec c
GETDATA
in a,(c)
jp p,GETDATA
and #20
jr nz,PASRES


ld d,7
ld (MEM),hl
ld hl,RETOURFDC
LISRETOUR
call GETFDC
ld (hl),a
inc hl
dec d
jr nz,LISRETOUR
ret


PUTFDC
push af
PUTFDC2
in a,(c)
rla
jr nc,PUTFDC2
pop af
inc c
out (c),a
dec c
ret


GETFDC
in a,(c)
rla
jr nc,GETFDC
inc c
in a,(c)
dec c
ret




COMMAND defb #45
lecteur defb 0
piste defb 40
test defb 0
SECTEURDEB defb 1
type defb 6
SECTEURFIN defb 1
gap3 defb #20
taille defb 0


MEM defw 0
motor defb 0
RETOURFDC defs 7,0








My pronouns are RASM and ACE

Bryce

Hi,
        as many here know, I'm not a fan of emulators and always use real hardware. However, I now need to have a CPC for some coding while I'm travelling for a small project of mine, so I've just installed WinAPE. However, when I lock the computer and then return, WinAPE has always crashed with an error that seems to be associated with Win7/10 Aero GUI. I assume this issue is known, but I couldn't find any information about it. Is there some way of getting around this (other than turning off Aero) or is this problem being worked on?

Bryce.

robcfg

That's why you should finish your Portable CPC project...  ;)

Bryce

True, but when I'm away on business I don't want to be dragging two laptops around with me. There's also more chance of WinAPE getting fixed before I finish that laptop. :D

Bryce.

VincentGR

Can't help you with the aero thingy but how about using savestates?

Bryce

Quote from: VincentGR on 11:10, 20 October 16
Can't help you with the aero thingy but how about using savestates?

Not sure what you mean. How would that help me?

Bryce.

Powered by SMFPacks Menu Editor Mod