From ac62471e383785139a008f9029b34a2d498f8ac4 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Sun, 10 Jul 2005 14:54:10 +0000 Subject: [PATCH] Making sure code is in executable sections Final Round. Fixed a very weird section change mid macro in video code - perhaps fixed CT Black Omen bug. --- zsnes/src/video/mode716.mac | 2 ++ zsnes/src/video/mode716b.asm | 1 + zsnes/src/video/mode716d.asm | 2 ++ zsnes/src/video/mode716e.asm | 2 ++ zsnes/src/video/mode716t.asm | 68 +++++++++++++++++++----------------- zsnes/src/video/mode7ext.asm | 2 ++ zsnes/src/video/mv16tms.asm | 1 + zsnes/src/video/newg162.asm | 2 ++ zsnes/src/video/newg16wn.mac | 2 ++ zsnes/src/video/newgfx.asm | 2 ++ zsnes/src/video/newgfx16.asm | 2 ++ zsnes/src/video/newgfx2.asm | 2 ++ zsnes/src/video/newgfxwn.mac | 2 +- zsnes/src/win/winintrf.asm | 4 +-- 14 files changed, 59 insertions(+), 35 deletions(-) diff --git a/zsnes/src/video/mode716.mac b/zsnes/src/video/mode716.mac index 77db8894..bd63c933 100644 --- a/zsnes/src/video/mode716.mac +++ b/zsnes/src/video/mode716.mac @@ -267,6 +267,8 @@ EXTSYM pesimpng,ScrDispl .calculatea %endmacro +SECTION .text + Mode7Startup16b: Mode7Calculate16b ; esi = pointer to video buffer diff --git a/zsnes/src/video/mode716b.asm b/zsnes/src/video/mode716b.asm index 7923afff..6270bd48 100644 --- a/zsnes/src/video/mode716b.asm +++ b/zsnes/src/video/mode716b.asm @@ -54,6 +54,7 @@ ALIGN16 inc ebp %endmacro +SECTION .text NEWSYM drawmode716b test byte[scaddset],1 diff --git a/zsnes/src/video/mode716d.asm b/zsnes/src/video/mode716d.asm index d6824aa0..c64619b4 100644 --- a/zsnes/src/video/mode716d.asm +++ b/zsnes/src/video/mode716d.asm @@ -26,6 +26,8 @@ EXTSYM xtravbuf,dcolortab,vidbright %include "video/mode7.mac" +SECTION .text + NEWSYM Gendcolortable ; generate Direct Color Table push eax diff --git a/zsnes/src/video/mode716e.asm b/zsnes/src/video/mode716e.asm index da95095c..fa8528cb 100644 --- a/zsnes/src/video/mode716e.asm +++ b/zsnes/src/video/mode716e.asm @@ -30,6 +30,8 @@ EXTSYM cwinptr ; Processes & Draws Mode 7 ;******************************************************* +SECTION .text + ALIGN16 NEWSYM drawmode716extbg diff --git a/zsnes/src/video/mode716t.asm b/zsnes/src/video/mode716t.asm index d62af722..6fb75321 100644 --- a/zsnes/src/video/mode716t.asm +++ b/zsnes/src/video/mode716t.asm @@ -263,38 +263,40 @@ EXTSYM fulladdtab Mode7ProcessB %1, domosaic16b, 2 ALIGN32 -SECTION .bss -.temp resd 1 ; for byte move left -.mode7xpos resd 1 ; x position -.tempa2 resd 1 ; keep this blank! -.mode7xrpos resd 1 ; x position -.tempa resd 1 ; keep this blank! -.mode7ypos resd 1 ; y position -.tempb2 resd 1 ; keep this blank! -.mode7yrpos resd 1 ; y position -.tempb resd 1 ; keep this blank! -.mode7xadder resd 1 ; number to add for x -.tempc2 resd 1 ; keep this blank! -.mode7xadd2 resd 1 ; number to add for x -.tempc resd 1 ; keep this blank! -.mode7yadder resd 1 ; number to add for y -.tempd2 resd 1 ; keep this blank! -.mode7yadd2 resd 1 ; number to add for y -.tempd resd 1 ; keep this blank! -.mode7ptr resd 1 ; pointer value -.mode7xinc resd 1 ; number to add for x -.mode7xincc resd 1 ; range check for x -.mode7yinc resd 1 ; number to add for y -.mode7xsloc resd 1 ; which screen x -.mode7ysloc resd 1 ; which screen y -.mode7xsrl resd 1 ; which relative screen x -.mode7ysrl resd 1 ; which relative screen y -.cxloc resw 1 ; cx location -.cyloc resw 1 ; cy location -.m7xaddofa resd 1 -.m7xaddof2a resd 1 -.m7yaddofa resd 1 -.m7yaddof2a resd 1 +SECTION .data + +.temp dd 0 ; for byte move left +.mode7xpos dd 0 ; x position +.tempa2 dd 0 ; keep this blank! +.mode7xrpos dd 0 ; x position +.tempa dd 0 ; keep this blank! +.mode7ypos dd 0 ; y position +.tempb2 dd 0 ; keep this blank! +.mode7yrpos dd 0 ; y position +.tempb dd 0 ; keep this blank! +.mode7xadder dd 0 ; number to add for x +.tempc2 dd 0 ; keep this blank! +.mode7xadd2 dd 0 ; number to add for x +.tempc dd 0 ; keep this blank! +.mode7yadder dd 0 ; number to add for y +.tempd2 dd 0 ; keep this blank! +.mode7yadd2 dd 0 ; number to add for y +.tempd dd 0 ; keep this blank! +.mode7ptr dd 0 ; pointer value +.mode7xinc dd 0 ; number to add for x +.mode7xincc dd 0 ; range check for x +.mode7yinc dd 0 ; number to add for y +.mode7xsloc dd 0 ; which screen x +.mode7ysloc dd 0 ; which screen y +.mode7xsrl dd 0 ; which relative screen x +.mode7ysrl dd 0 ; which relative screen y +.cxloc dw 0 ; cx location +.cyloc dw 0 ; cy location +.m7xaddofa dd 0 +.m7xaddof2a dd 0 +.m7yaddofa dd 0 +.m7yaddof2a dd 0 + SECTION .text .drawmode7win @@ -317,6 +319,8 @@ SECTION .text ;******************************************************* ; Processes & Draws Mode 7 half Addition ;******************************************************* +SECTION .text + NEWSYM drawmode716t test byte[scaddset],1 jnz near drawmode7dcolor diff --git a/zsnes/src/video/mode7ext.asm b/zsnes/src/video/mode7ext.asm index 1dde276b..af512c3d 100644 --- a/zsnes/src/video/mode7ext.asm +++ b/zsnes/src/video/mode7ext.asm @@ -39,6 +39,8 @@ EXTSYM ProcessMode7ngwin,ProcessMode7ngwinB ; Processes & Draws Mode 7 ;******************************************************* +SECTION .text + NEWSYM drawmode7extbg mov esi,[cwinptr] mov [winptrref],esi diff --git a/zsnes/src/video/mv16tms.asm b/zsnes/src/video/mv16tms.asm index e284fc75..e50818f3 100644 --- a/zsnes/src/video/mv16tms.asm +++ b/zsnes/src/video/mv16tms.asm @@ -205,6 +205,7 @@ EXTSYM pal16bxcl,coadder16,a16x16xinc,a16x16yinc,curypos,yflipadd %%loop %endmacro +SECTION .text NEWSYM draw8x816tms cmp byte[bgmode],5 diff --git a/zsnes/src/video/newg162.asm b/zsnes/src/video/newg162.asm index 87e0ff23..3848f1ce 100644 --- a/zsnes/src/video/newg162.asm +++ b/zsnes/src/video/newg162.asm @@ -90,6 +90,8 @@ EXTSYM vidmemch4s,vidmemch8s,cpalval,bgtxadd2,SpecialLine ret %endmacro +SECTION .text + cache2b16b: DoCache vcache2b,vcache2bs cache4b16b: diff --git a/zsnes/src/video/newg16wn.mac b/zsnes/src/video/newg16wn.mac index db022be6..a82f9c7c 100644 --- a/zsnes/src/video/newg16wn.mac +++ b/zsnes/src/video/newg16wn.mac @@ -173,6 +173,8 @@ %%nodraw %endmacro +SECTION .text + Nextwinmode: push ebx mov ebx,[ngcwinptr] diff --git a/zsnes/src/video/newgfx.asm b/zsnes/src/video/newgfx.asm index 0b9facfd..9c5d69fd 100644 --- a/zsnes/src/video/newgfx.asm +++ b/zsnes/src/video/newgfx.asm @@ -100,6 +100,8 @@ EXTSYM WindowDisables,winlogicb,ngwinptr,objwlrpos,objwen,objclineptr,CSprWinPtr mov [winbg1enval+eax+%1*256],bl %endmacro +SECTION .text + NEWSYM newengine8b ; store line by line data ; BGMode, BGxScrollX, BGxScrollY, both BGPtrs diff --git a/zsnes/src/video/newgfx16.asm b/zsnes/src/video/newgfx16.asm index e1b92c46..3a7c81c1 100644 --- a/zsnes/src/video/newgfx16.asm +++ b/zsnes/src/video/newgfx16.asm @@ -80,6 +80,8 @@ EXTSYM bgtxadd2 ; 3 = All of subscreen added to specific mainscreens ; 4 = Add+Sub enabled +SECTION .text + NEWSYM setpalallng mov dword[palchanged],1 diff --git a/zsnes/src/video/newgfx2.asm b/zsnes/src/video/newgfx2.asm index e5a66ea8..2351cb08 100644 --- a/zsnes/src/video/newgfx2.asm +++ b/zsnes/src/video/newgfx2.asm @@ -78,6 +78,8 @@ EXTSYM yposngom,flipyposngom,cbgval,ofsmval,ofsmvalh,vram,bgtxadd2 jnz near .finline %endmacro +SECTION .text + NEWSYM drawtileng2b cmp byte[ngwinen],1 je near drawtileng2bwin diff --git a/zsnes/src/video/newgfxwn.mac b/zsnes/src/video/newgfxwn.mac index 488f7e33..83c56763 100644 --- a/zsnes/src/video/newgfxwn.mac +++ b/zsnes/src/video/newgfxwn.mac @@ -22,7 +22,7 @@ - +SECTION .text Nextwinmode: diff --git a/zsnes/src/win/winintrf.asm b/zsnes/src/win/winintrf.asm index ca4ca0ce..7905a0c9 100644 --- a/zsnes/src/win/winintrf.asm +++ b/zsnes/src/win/winintrf.asm @@ -556,7 +556,7 @@ NEWSYM Get_Key ret SECTION .data -KeyConvTable +KeyConvTable: db 255,27 ,'1','2','3','4','5','6' ; 00h db '7','8','9','0','-','=',8 ,9 db 'Q','W','E','R','T','Y','U','I' ; 10h @@ -568,7 +568,7 @@ KeyConvTable db 255,255,255,255,255,255,255,255 ; 40h db 200,201,202,203,204,205,206,207 db 208,209,210,211,255,255,255,255 ; 50h -KeyConvTableS +KeyConvTableS: db 255,27 ,'!','@','#','$','%','^' ; 00h db '&','*','(',')','_','+',8 ,9 db 'Q','W','E','R','T','Y','U','I' ; 10h